Skip to content

Graphorin API reference v0.1.0


Graphorin API reference / @graphorin/client / / Transport

Interface: Transport

Defined in: packages/client/src/transport/types.ts:84

Active transport handle. The client owns the handle and disposes it via Transport.close on every cleanup path.

Stable

Properties

PropertyModifierTypeDescriptionDefined in
kindreadonlyTransportKind-packages/client/src/transport/types.ts:85
lastEventIdreadonlystring | undefinedLast server-issued event id observed on this connection.packages/client/src/transport/types.ts:97
urlreadonlystring-packages/client/src/transport/types.ts:86

Methods

close()

ts
close(code?, reason?): void;

Defined in: packages/client/src/transport/types.ts:95

Parameters

ParameterType
code?number
reason?string

Returns

void


send()

ts
send(frame): void;

Defined in: packages/client/src/transport/types.ts:94

Send a client → server frame. Throws when the transport is not in the open state, or when the underlying back-end does not support send (the SSE transport throws every send via import('../errors.js').TransportFailedError — clients should fall back to REST for control-plane operations on SSE).

Parameters

ParameterType
frame| { id: string | number; jsonrpc: "2.0"; method: "initialize"; params: { capabilities?: Record<string, unknown>; clientInfo: { name: string; version: string; }; }; v: "1"; } | { id: string | number; jsonrpc: "2.0"; method: "subscription.subscribe"; params: { lastSequenceId?: number; sinceEventId?: string; subject: string; }; v: "1"; } | { id: string | number; jsonrpc: "2.0"; method: "subscription.unsubscribe"; params: { subscriptionId: string; }; v: "1"; } | { id: string | number; jsonrpc: "2.0"; method: "run.cancel"; params: { drain?: boolean; onPendingApprovals?: "deny" | "preserve"; reason?: string; runId: string; }; v: "1"; } | { id: string | number; jsonrpc: "2.0"; method: "ping"; params?: { nonce?: string; }; v: "1"; } | { jsonrpc: "2.0"; method: "notifications/cancelled"; params: { requestId: string; }; v: "1"; }

Returns

void