Graphorin API reference v0.7.0
Graphorin API reference / @graphorin/client / / Transport
Interface: Transport
Defined in: packages/client/src/transport/types.ts:92
Active transport handle. The client owns the handle and disposes it via Transport.close on every cleanup path.
Stable
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
kind | readonly | TransportKind | - | packages/client/src/transport/types.ts:93 |
lastEventId | readonly | string | undefined | Last server-issued event id observed on this connection. | packages/client/src/transport/types.ts:105 |
url | readonly | string | - | packages/client/src/transport/types.ts:94 |
Methods
close()
ts
close(code?, reason?): void;Defined in: packages/client/src/transport/types.ts:103
Parameters
| Parameter | Type |
|---|---|
code? | number |
reason? | string |
Returns
void
send()
ts
send(frame): void;Defined in: packages/client/src/transport/types.ts:102
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 TransportFailedError - clients should fall back to REST for control-plane operations on SSE).
Parameters
| Parameter | Type |
|---|---|
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: { 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