@fatagnus/dink-web 2.24.0 → 2.24.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.d.ts CHANGED
@@ -96,4 +96,3 @@ export declare class DinkWebClient implements ServiceCaller {
96
96
  private encode;
97
97
  private decode;
98
98
  }
99
- //# sourceMappingURL=client.d.ts.map
package/dist/index.d.ts CHANGED
@@ -1,4 +1,312 @@
1
- export { DinkWebClient } from './client.js';
2
- export { type DinkWebConfig, type ServiceCaller, type Subscription, type StreamSubscription, type StreamOptions, type ServiceDefinition, type ConnectionStatus, type ConnectionStats, type WebTokenResponse, type TokenRefresher, type EdgeInfo, type Channel, type ChannelOptions, } from './types.js';
3
- export { DinkWebProvider, useDinkWeb, useDinkService, useChannel, type DinkWebProviderProps, type UseChannelOptions } from './react.js';
4
- //# sourceMappingURL=index.d.ts.map
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ import { ReactNode } from 'react';
4
+
5
+ export interface ServiceCaller {
6
+ call<Req, Resp>(edgeId: string, service: string, method: string, req: Req): Promise<Resp>;
7
+ callCenter<Req, Resp>(service: string, method: string, req: Req): Promise<Resp>;
8
+ subscribe<Req, Resp>(edgeId: string, service: string, method: string, req: Req, handler: (resp: Resp) => void, options?: StreamOptions): Promise<StreamSubscription>;
9
+ }
10
+ export interface Subscription {
11
+ unsubscribe(): void;
12
+ }
13
+ /**
14
+ * Extended subscription handle for streaming RPCs.
15
+ * Supports cancellation and lifecycle callbacks.
16
+ */
17
+ export interface StreamSubscription extends Subscription {
18
+ /** Send a cancel signal to the edge to abort the stream. */
19
+ cancel(): void;
20
+ }
21
+ /**
22
+ * Options for streaming RPC subscriptions.
23
+ */
24
+ export interface StreamOptions {
25
+ /** Called when the stream completes normally. */
26
+ onDone?: () => void;
27
+ /** Called when the stream encounters an error. */
28
+ onError?: (err: Error) => void;
29
+ }
30
+ export interface ServiceDefinition {
31
+ name: string;
32
+ version: string;
33
+ methods: string[];
34
+ }
35
+ /** Response from POST /api/keys/web-token */
36
+ export interface WebTokenResponse {
37
+ token: string;
38
+ ws_url: string;
39
+ expires_at: string;
40
+ }
41
+ /**
42
+ * Callback that fetches a fresh web token.
43
+ * Called automatically when the current token is about to expire.
44
+ * Should POST to /api/keys/web-token and return the response.
45
+ */
46
+ export type TokenRefresher = () => Promise<WebTokenResponse>;
47
+ export interface DinkWebConfig {
48
+ /** WebSocket URL (e.g., "wss://host:9222") */
49
+ url: string;
50
+ /** Authentication token (from /api/keys/web-token) */
51
+ token: string;
52
+ /** Token expiry time (ISO 8601 string or Date). Enables auto-refresh when set with tokenRefresher. */
53
+ expiresAt?: string | Date;
54
+ /** App ID for subject routing */
55
+ appId: string;
56
+ /** Request timeout in ms (default: 30000) */
57
+ timeout?: number;
58
+ /** Called when connection state changes */
59
+ onStatusChange?: (status: ConnectionStatus) => void;
60
+ /**
61
+ * Called to obtain a fresh token before the current one expires.
62
+ * If not set, the client will not auto-refresh tokens.
63
+ */
64
+ tokenRefresher?: TokenRefresher;
65
+ /**
66
+ * How many ms before expiry to trigger a refresh (default: 60000 = 1 minute).
67
+ */
68
+ refreshBeforeExpiryMs?: number;
69
+ }
70
+ export interface ConnectionStats {
71
+ /** Current connection status */
72
+ status: ConnectionStatus;
73
+ /** Number of reconnections since connect() */
74
+ reconnectCount: number;
75
+ /** Last measured round-trip time in ms, or null if not yet measured */
76
+ rttMs: number | null;
77
+ /** When the current token expires, or null if unknown */
78
+ tokenExpiresAt: Date | null;
79
+ }
80
+ export type ConnectionStatus = "connecting" | "connected" | "reconnecting" | "closed" | "error";
81
+ /** Discovered edge information */
82
+ export interface EdgeInfo {
83
+ edgeId: string;
84
+ name?: string;
85
+ labels?: Record<string, string>;
86
+ services?: string[];
87
+ status?: string;
88
+ }
89
+ /** Bidirectional raw byte channel between browser and edge. */
90
+ export interface Channel {
91
+ /** Unique channel identifier (e.g., "ch_abc123") */
92
+ readonly id: string;
93
+ /** Send raw bytes to the other side. Returns false if backpressure is active. */
94
+ write(data: Uint8Array): boolean;
95
+ /** Register handler for incoming raw bytes */
96
+ onData(handler: (data: Uint8Array) => void): void;
97
+ /** Close the channel (either side can initiate) */
98
+ close(): void;
99
+ /** Called when the channel closes (by either side). Supports multiple handlers. */
100
+ onClose(handler: (reason?: string) => void): void;
101
+ /** Send a JSON-serializable control message out-of-band */
102
+ sendControl(msg: unknown): void;
103
+ /** Register handler for incoming control messages */
104
+ onControl(handler: (msg: unknown) => void): void;
105
+ /** True if channel is open */
106
+ readonly isOpen: boolean;
107
+ /** Promise that resolves when the channel closes */
108
+ readonly closed: Promise<void>;
109
+ /** Number of bytes queued for sending */
110
+ readonly bufferedAmount: number;
111
+ /** Register handler called when buffered data has been flushed */
112
+ onDrain(handler: () => void): void;
113
+ }
114
+ /** Options for opening a channel. */
115
+ export interface ChannelOptions {
116
+ /** Called when the channel encounters an error. */
117
+ onError?: (err: Error) => void;
118
+ }
119
+ /**
120
+ * DinkWebClient connects to dinkd via NATS WebSocket from the browser.
121
+ * Implements ServiceCaller so generated client code works unchanged.
122
+ *
123
+ * Features:
124
+ * - Correct inbox-based streaming protocol (matches Node.js SDK)
125
+ * - Auto token refresh before expiry (requires tokenRefresher config)
126
+ * - Connection quality monitoring (RTT, reconnect count)
127
+ * - Automatic reconnection (built into nats.ws)
128
+ * - Center and edge service calls
129
+ * - Raw binary subscription mode for high-throughput streams
130
+ * - Edge discovery from the browser
131
+ */
132
+ export declare class DinkWebClient implements ServiceCaller {
133
+ private nc;
134
+ private config;
135
+ private _status;
136
+ private _reconnectCount;
137
+ private _rttMs;
138
+ private _tokenExpiresAt;
139
+ private _refreshTimer;
140
+ private _rttInterval;
141
+ constructor(config: DinkWebConfig);
142
+ get status(): ConnectionStatus;
143
+ /** Current connection statistics */
144
+ get stats(): ConnectionStats;
145
+ connect(): Promise<void>;
146
+ close(): Promise<void>;
147
+ /**
148
+ * Call an edge service via request/reply.
149
+ * Subject: edge.{appId}.{edgeId}.services.{service}.{method}
150
+ */
151
+ call<Req, Resp>(edgeId: string, service: string, method: string, req: Req): Promise<Resp>;
152
+ /**
153
+ * Call a center (cloud) service via request/reply.
154
+ * Subject: center.{appId}.services.{service}.{method}
155
+ */
156
+ callCenter<Req, Resp>(service: string, method: string, req: Req): Promise<Resp>;
157
+ /**
158
+ * Subscribe to a streaming edge service using the correct inbox-based protocol.
159
+ *
160
+ * Protocol:
161
+ * 1. Create a unique inbox subject
162
+ * 2. Subscribe to inbox (data) and inbox.done (completion)
163
+ * 3. Send { reply_subject, data } envelope via request to the .stream subject
164
+ * 4. Edge acks with { status, cancelSubject }
165
+ * 5. Edge publishes stream data to the inbox, then inbox.done when finished
166
+ * 6. On cancel/unsubscribe, publish to cancelSubject to abort the stream
167
+ */
168
+ subscribe<Req, Resp>(edgeId: string, service: string, method: string, req: Req, handler: (resp: Resp) => void, options?: StreamOptions): Promise<StreamSubscription>;
169
+ /**
170
+ * Subscribe to a streaming edge service in raw binary mode.
171
+ * Skips JSON encode/decode — handler receives raw Uint8Array payloads.
172
+ * Ideal for high-throughput binary streams (PTY output, file transfers).
173
+ *
174
+ * Uses the same inbox-based streaming protocol as subscribe().
175
+ */
176
+ subscribeRaw(edgeId: string, service: string, method: string, req: unknown, handler: (data: Uint8Array) => void, options?: StreamOptions): Promise<StreamSubscription>;
177
+ /**
178
+ * Open a bidirectional raw byte channel to an edge service.
179
+ * Returns a Channel object for sending/receiving raw Uint8Array data.
180
+ *
181
+ * Protocol:
182
+ * 1. Create two unique inbox subjects (output for receiving, input for sending)
183
+ * 2. Subscribe to output inbox (data) and output inbox.done (completion)
184
+ * 3. Send { reply_subject, input_subject, data } envelope via request to .channel subject
185
+ * 4. Edge acks with { status, cancelSubject }
186
+ * 5. Bidirectional raw byte flow over the two inboxes
187
+ * 6. Either side can close: client publishes to cancelSubject, edge publishes to outputInbox.done
188
+ */
189
+ openChannel(edgeId: string, service: string, method: string, request?: unknown, options?: ChannelOptions): Promise<Channel>;
190
+ /**
191
+ * Discover edges in the current app.
192
+ * Subject: center.{appId}.edges.discover
193
+ *
194
+ * This is a convenience for browser apps that need to find edges
195
+ * without a Convex backend intermediary.
196
+ */
197
+ discoverEdges(filter?: {
198
+ labels?: Record<string, string>;
199
+ service?: string;
200
+ }): Promise<EdgeInfo[]>;
201
+ /**
202
+ * Create a typed service client for an edge.
203
+ * Usage: const svc = client.service('edge-1', MyServiceClient);
204
+ */
205
+ service<T>(edgeId: string, factory: new (edgeId: string, caller: ServiceCaller) => T): T;
206
+ private scheduleTokenRefresh;
207
+ private refreshToken;
208
+ private startRttProbe;
209
+ private monitorStatus;
210
+ private stopTimers;
211
+ private setStatus;
212
+ private ensureConnected;
213
+ private encode;
214
+ private decode;
215
+ }
216
+ export interface DinkWebContextValue {
217
+ client: DinkWebClient | null;
218
+ status: ConnectionStatus;
219
+ stats: ConnectionStats;
220
+ }
221
+ export interface DinkWebProviderProps {
222
+ /** WebSocket URL (e.g., "wss://host:9222") */
223
+ url: string;
224
+ /** Authentication token */
225
+ token: string;
226
+ /** Token expiry (ISO string or Date) */
227
+ expiresAt?: string | Date;
228
+ /** App ID for subject routing */
229
+ appId: string;
230
+ /** Request timeout in ms */
231
+ timeout?: number;
232
+ /** Callback to fetch a fresh token before expiry */
233
+ tokenRefresher?: TokenRefresher;
234
+ /** Ms before expiry to trigger refresh (default: 60000) */
235
+ refreshBeforeExpiryMs?: number;
236
+ children: ReactNode;
237
+ }
238
+ /**
239
+ * Provider that manages DinkWebClient lifecycle.
240
+ * Creates and connects the client on mount, drains on unmount.
241
+ * Reconnects when url/token/appId change.
242
+ */
243
+ export declare function DinkWebProvider({ url, token, expiresAt, appId, timeout, tokenRefresher, refreshBeforeExpiryMs, children, }: DinkWebProviderProps): import("react").FunctionComponentElement<import("react").ProviderProps<DinkWebContextValue | null>>;
244
+ /**
245
+ * Access the DinkWebClient instance, connection status, and stats.
246
+ *
247
+ * @throws Error if used outside DinkWebProvider
248
+ *
249
+ * @example
250
+ * ```tsx
251
+ * function StatusBar() {
252
+ * const { client, status, stats } = useDinkWeb();
253
+ * return <div>Status: {status}, RTT: {stats.rttMs}ms</div>;
254
+ * }
255
+ * ```
256
+ */
257
+ export declare function useDinkWeb(): DinkWebContextValue;
258
+ /**
259
+ * Get a typed service client bound to a specific edge.
260
+ * Memoized — returns the same instance as long as edgeId and client don't change.
261
+ *
262
+ * @param edgeId - Edge to bind the service client to
263
+ * @param factory - Generated service client class (e.g., TerminalServiceClient)
264
+ *
265
+ * @example
266
+ * ```tsx
267
+ * function Terminal({ edgeId }: { edgeId: string }) {
268
+ * const svc = useDinkService(edgeId, TerminalServiceClient);
269
+ * // svc.StreamOutput(...), svc.SendInput(...), etc.
270
+ * }
271
+ * ```
272
+ */
273
+ export declare function useDinkService<T>(edgeId: string, factory: new (edgeId: string, caller: ServiceCaller) => T): T | null;
274
+ /**
275
+ * Options for the useChannel hook.
276
+ */
277
+ export interface UseChannelOptions extends ChannelOptions {
278
+ /** If false, the channel will not be opened. Default: true. */
279
+ enabled?: boolean;
280
+ }
281
+ /**
282
+ * Open a bidirectional raw byte channel to an edge service.
283
+ * Manages channel lifecycle — opens on mount/deps change, closes on unmount.
284
+ *
285
+ * @param edgeId - Edge to connect to
286
+ * @param service - Service name
287
+ * @param method - Method name
288
+ * @param request - Initial request payload
289
+ * @param options - Channel options
290
+ *
291
+ * @example
292
+ * ```tsx
293
+ * function Terminal({ edgeId }: { edgeId: string }) {
294
+ * const { channel, isOpen, error } = useChannel(
295
+ * edgeId, 'TerminalService', 'shell',
296
+ * { shell: '/bin/bash', cols: 80, rows: 24 }
297
+ * );
298
+ *
299
+ * useEffect(() => {
300
+ * if (!channel) return;
301
+ * channel.onData((data) => term.write(data));
302
+ * }, [channel]);
303
+ * }
304
+ * ```
305
+ */
306
+ export declare function useChannel(edgeId: string, service: string, method: string, request?: unknown, options?: UseChannelOptions): {
307
+ channel: Channel | null;
308
+ isOpen: boolean;
309
+ error: Error | null;
310
+ };
311
+
312
+ export {};
package/dist/react.d.ts CHANGED
@@ -1,36 +1,221 @@
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ import { ReactNode } from 'react';
4
+
5
+ export interface ServiceCaller {
6
+ call<Req, Resp>(edgeId: string, service: string, method: string, req: Req): Promise<Resp>;
7
+ callCenter<Req, Resp>(service: string, method: string, req: Req): Promise<Resp>;
8
+ subscribe<Req, Resp>(edgeId: string, service: string, method: string, req: Req, handler: (resp: Resp) => void, options?: StreamOptions): Promise<StreamSubscription>;
9
+ }
10
+ export interface Subscription {
11
+ unsubscribe(): void;
12
+ }
1
13
  /**
2
- * React hooks for DinkWebClient.
3
- *
4
- * Provides DinkWebProvider for connection lifecycle management,
5
- * useDinkWeb for accessing client + status, and useDinkService
6
- * for typed service client access with auto-edge binding.
7
- *
8
- * @module @fatagnus/dink-web/react
14
+ * Extended subscription handle for streaming RPCs.
15
+ * Supports cancellation and lifecycle callbacks.
9
16
  */
10
- import { type ReactNode } from 'react';
11
- import { DinkWebClient } from './client.js';
12
- import type { ConnectionStatus, ConnectionStats, ServiceCaller, TokenRefresher, Channel, ChannelOptions } from './types.js';
13
- interface DinkWebContextValue {
14
- client: DinkWebClient | null;
15
- status: ConnectionStatus;
16
- stats: ConnectionStats;
17
+ export interface StreamSubscription extends Subscription {
18
+ /** Send a cancel signal to the edge to abort the stream. */
19
+ cancel(): void;
20
+ }
21
+ /**
22
+ * Options for streaming RPC subscriptions.
23
+ */
24
+ export interface StreamOptions {
25
+ /** Called when the stream completes normally. */
26
+ onDone?: () => void;
27
+ /** Called when the stream encounters an error. */
28
+ onError?: (err: Error) => void;
29
+ }
30
+ /** Response from POST /api/keys/web-token */
31
+ export interface WebTokenResponse {
32
+ token: string;
33
+ ws_url: string;
34
+ expires_at: string;
35
+ }
36
+ /**
37
+ * Callback that fetches a fresh web token.
38
+ * Called automatically when the current token is about to expire.
39
+ * Should POST to /api/keys/web-token and return the response.
40
+ */
41
+ export type TokenRefresher = () => Promise<WebTokenResponse>;
42
+ export interface DinkWebConfig {
43
+ /** WebSocket URL (e.g., "wss://host:9222") */
44
+ url: string;
45
+ /** Authentication token (from /api/keys/web-token) */
46
+ token: string;
47
+ /** Token expiry time (ISO 8601 string or Date). Enables auto-refresh when set with tokenRefresher. */
48
+ expiresAt?: string | Date;
49
+ /** App ID for subject routing */
50
+ appId: string;
51
+ /** Request timeout in ms (default: 30000) */
52
+ timeout?: number;
53
+ /** Called when connection state changes */
54
+ onStatusChange?: (status: ConnectionStatus) => void;
55
+ /**
56
+ * Called to obtain a fresh token before the current one expires.
57
+ * If not set, the client will not auto-refresh tokens.
58
+ */
59
+ tokenRefresher?: TokenRefresher;
60
+ /**
61
+ * How many ms before expiry to trigger a refresh (default: 60000 = 1 minute).
62
+ */
63
+ refreshBeforeExpiryMs?: number;
64
+ }
65
+ export interface ConnectionStats {
66
+ /** Current connection status */
67
+ status: ConnectionStatus;
68
+ /** Number of reconnections since connect() */
69
+ reconnectCount: number;
70
+ /** Last measured round-trip time in ms, or null if not yet measured */
71
+ rttMs: number | null;
72
+ /** When the current token expires, or null if unknown */
73
+ tokenExpiresAt: Date | null;
74
+ }
75
+ export type ConnectionStatus = "connecting" | "connected" | "reconnecting" | "closed" | "error";
76
+ /** Discovered edge information */
77
+ export interface EdgeInfo {
78
+ edgeId: string;
79
+ name?: string;
80
+ labels?: Record<string, string>;
81
+ services?: string[];
82
+ status?: string;
83
+ }
84
+ /** Bidirectional raw byte channel between browser and edge. */
85
+ export interface Channel {
86
+ /** Unique channel identifier (e.g., "ch_abc123") */
87
+ readonly id: string;
88
+ /** Send raw bytes to the other side. Returns false if backpressure is active. */
89
+ write(data: Uint8Array): boolean;
90
+ /** Register handler for incoming raw bytes */
91
+ onData(handler: (data: Uint8Array) => void): void;
92
+ /** Close the channel (either side can initiate) */
93
+ close(): void;
94
+ /** Called when the channel closes (by either side). Supports multiple handlers. */
95
+ onClose(handler: (reason?: string) => void): void;
96
+ /** Send a JSON-serializable control message out-of-band */
97
+ sendControl(msg: unknown): void;
98
+ /** Register handler for incoming control messages */
99
+ onControl(handler: (msg: unknown) => void): void;
100
+ /** True if channel is open */
101
+ readonly isOpen: boolean;
102
+ /** Promise that resolves when the channel closes */
103
+ readonly closed: Promise<void>;
104
+ /** Number of bytes queued for sending */
105
+ readonly bufferedAmount: number;
106
+ /** Register handler called when buffered data has been flushed */
107
+ onDrain(handler: () => void): void;
108
+ }
109
+ /** Options for opening a channel. */
110
+ export interface ChannelOptions {
111
+ /** Called when the channel encounters an error. */
112
+ onError?: (err: Error) => void;
113
+ }
114
+ declare class DinkWebClient implements ServiceCaller {
115
+ private nc;
116
+ private config;
117
+ private _status;
118
+ private _reconnectCount;
119
+ private _rttMs;
120
+ private _tokenExpiresAt;
121
+ private _refreshTimer;
122
+ private _rttInterval;
123
+ constructor(config: DinkWebConfig);
124
+ get status(): ConnectionStatus;
125
+ /** Current connection statistics */
126
+ get stats(): ConnectionStats;
127
+ connect(): Promise<void>;
128
+ close(): Promise<void>;
129
+ /**
130
+ * Call an edge service via request/reply.
131
+ * Subject: edge.{appId}.{edgeId}.services.{service}.{method}
132
+ */
133
+ call<Req, Resp>(edgeId: string, service: string, method: string, req: Req): Promise<Resp>;
134
+ /**
135
+ * Call a center (cloud) service via request/reply.
136
+ * Subject: center.{appId}.services.{service}.{method}
137
+ */
138
+ callCenter<Req, Resp>(service: string, method: string, req: Req): Promise<Resp>;
139
+ /**
140
+ * Subscribe to a streaming edge service using the correct inbox-based protocol.
141
+ *
142
+ * Protocol:
143
+ * 1. Create a unique inbox subject
144
+ * 2. Subscribe to inbox (data) and inbox.done (completion)
145
+ * 3. Send { reply_subject, data } envelope via request to the .stream subject
146
+ * 4. Edge acks with { status, cancelSubject }
147
+ * 5. Edge publishes stream data to the inbox, then inbox.done when finished
148
+ * 6. On cancel/unsubscribe, publish to cancelSubject to abort the stream
149
+ */
150
+ subscribe<Req, Resp>(edgeId: string, service: string, method: string, req: Req, handler: (resp: Resp) => void, options?: StreamOptions): Promise<StreamSubscription>;
151
+ /**
152
+ * Subscribe to a streaming edge service in raw binary mode.
153
+ * Skips JSON encode/decode — handler receives raw Uint8Array payloads.
154
+ * Ideal for high-throughput binary streams (PTY output, file transfers).
155
+ *
156
+ * Uses the same inbox-based streaming protocol as subscribe().
157
+ */
158
+ subscribeRaw(edgeId: string, service: string, method: string, req: unknown, handler: (data: Uint8Array) => void, options?: StreamOptions): Promise<StreamSubscription>;
159
+ /**
160
+ * Open a bidirectional raw byte channel to an edge service.
161
+ * Returns a Channel object for sending/receiving raw Uint8Array data.
162
+ *
163
+ * Protocol:
164
+ * 1. Create two unique inbox subjects (output for receiving, input for sending)
165
+ * 2. Subscribe to output inbox (data) and output inbox.done (completion)
166
+ * 3. Send { reply_subject, input_subject, data } envelope via request to .channel subject
167
+ * 4. Edge acks with { status, cancelSubject }
168
+ * 5. Bidirectional raw byte flow over the two inboxes
169
+ * 6. Either side can close: client publishes to cancelSubject, edge publishes to outputInbox.done
170
+ */
171
+ openChannel(edgeId: string, service: string, method: string, request?: unknown, options?: ChannelOptions): Promise<Channel>;
172
+ /**
173
+ * Discover edges in the current app.
174
+ * Subject: center.{appId}.edges.discover
175
+ *
176
+ * This is a convenience for browser apps that need to find edges
177
+ * without a Convex backend intermediary.
178
+ */
179
+ discoverEdges(filter?: {
180
+ labels?: Record<string, string>;
181
+ service?: string;
182
+ }): Promise<EdgeInfo[]>;
183
+ /**
184
+ * Create a typed service client for an edge.
185
+ * Usage: const svc = client.service('edge-1', MyServiceClient);
186
+ */
187
+ service<T>(edgeId: string, factory: new (edgeId: string, caller: ServiceCaller) => T): T;
188
+ private scheduleTokenRefresh;
189
+ private refreshToken;
190
+ private startRttProbe;
191
+ private monitorStatus;
192
+ private stopTimers;
193
+ private setStatus;
194
+ private ensureConnected;
195
+ private encode;
196
+ private decode;
197
+ }
198
+ export interface DinkWebContextValue {
199
+ client: DinkWebClient | null;
200
+ status: ConnectionStatus;
201
+ stats: ConnectionStats;
17
202
  }
18
203
  export interface DinkWebProviderProps {
19
- /** WebSocket URL (e.g., "wss://host:9222") */
20
- url: string;
21
- /** Authentication token */
22
- token: string;
23
- /** Token expiry (ISO string or Date) */
24
- expiresAt?: string | Date;
25
- /** App ID for subject routing */
26
- appId: string;
27
- /** Request timeout in ms */
28
- timeout?: number;
29
- /** Callback to fetch a fresh token before expiry */
30
- tokenRefresher?: TokenRefresher;
31
- /** Ms before expiry to trigger refresh (default: 60000) */
32
- refreshBeforeExpiryMs?: number;
33
- children: ReactNode;
204
+ /** WebSocket URL (e.g., "wss://host:9222") */
205
+ url: string;
206
+ /** Authentication token */
207
+ token: string;
208
+ /** Token expiry (ISO string or Date) */
209
+ expiresAt?: string | Date;
210
+ /** App ID for subject routing */
211
+ appId: string;
212
+ /** Request timeout in ms */
213
+ timeout?: number;
214
+ /** Callback to fetch a fresh token before expiry */
215
+ tokenRefresher?: TokenRefresher;
216
+ /** Ms before expiry to trigger refresh (default: 60000) */
217
+ refreshBeforeExpiryMs?: number;
218
+ children: ReactNode;
34
219
  }
35
220
  /**
36
221
  * Provider that manages DinkWebClient lifecycle.
@@ -72,8 +257,8 @@ export declare function useDinkService<T>(edgeId: string, factory: new (edgeId:
72
257
  * Options for the useChannel hook.
73
258
  */
74
259
  export interface UseChannelOptions extends ChannelOptions {
75
- /** If false, the channel will not be opened. Default: true. */
76
- enabled?: boolean;
260
+ /** If false, the channel will not be opened. Default: true. */
261
+ enabled?: boolean;
77
262
  }
78
263
  /**
79
264
  * Open a bidirectional raw byte channel to an edge service.
@@ -101,9 +286,9 @@ export interface UseChannelOptions extends ChannelOptions {
101
286
  * ```
102
287
  */
103
288
  export declare function useChannel(edgeId: string, service: string, method: string, request?: unknown, options?: UseChannelOptions): {
104
- channel: Channel | null;
105
- isOpen: boolean;
106
- error: Error | null;
289
+ channel: Channel | null;
290
+ isOpen: boolean;
291
+ error: Error | null;
107
292
  };
293
+
108
294
  export {};
109
- //# sourceMappingURL=react.d.ts.map
package/dist/types.d.ts CHANGED
@@ -1,38 +1,40 @@
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
1
3
  export interface ServiceCaller {
2
- call<Req, Resp>(edgeId: string, service: string, method: string, req: Req): Promise<Resp>;
3
- callCenter<Req, Resp>(service: string, method: string, req: Req): Promise<Resp>;
4
- subscribe<Req, Resp>(edgeId: string, service: string, method: string, req: Req, handler: (resp: Resp) => void, options?: StreamOptions): Promise<StreamSubscription>;
4
+ call<Req, Resp>(edgeId: string, service: string, method: string, req: Req): Promise<Resp>;
5
+ callCenter<Req, Resp>(service: string, method: string, req: Req): Promise<Resp>;
6
+ subscribe<Req, Resp>(edgeId: string, service: string, method: string, req: Req, handler: (resp: Resp) => void, options?: StreamOptions): Promise<StreamSubscription>;
5
7
  }
6
8
  export interface Subscription {
7
- unsubscribe(): void;
9
+ unsubscribe(): void;
8
10
  }
9
11
  /**
10
12
  * Extended subscription handle for streaming RPCs.
11
13
  * Supports cancellation and lifecycle callbacks.
12
14
  */
13
15
  export interface StreamSubscription extends Subscription {
14
- /** Send a cancel signal to the edge to abort the stream. */
15
- cancel(): void;
16
+ /** Send a cancel signal to the edge to abort the stream. */
17
+ cancel(): void;
16
18
  }
17
19
  /**
18
20
  * Options for streaming RPC subscriptions.
19
21
  */
20
22
  export interface StreamOptions {
21
- /** Called when the stream completes normally. */
22
- onDone?: () => void;
23
- /** Called when the stream encounters an error. */
24
- onError?: (err: Error) => void;
23
+ /** Called when the stream completes normally. */
24
+ onDone?: () => void;
25
+ /** Called when the stream encounters an error. */
26
+ onError?: (err: Error) => void;
25
27
  }
26
28
  export interface ServiceDefinition {
27
- name: string;
28
- version: string;
29
- methods: string[];
29
+ name: string;
30
+ version: string;
31
+ methods: string[];
30
32
  }
31
33
  /** Response from POST /api/keys/web-token */
32
34
  export interface WebTokenResponse {
33
- token: string;
34
- ws_url: string;
35
- expires_at: string;
35
+ token: string;
36
+ ws_url: string;
37
+ expires_at: string;
36
38
  }
37
39
  /**
38
40
  * Callback that fetches a fresh web token.
@@ -41,75 +43,76 @@ export interface WebTokenResponse {
41
43
  */
42
44
  export type TokenRefresher = () => Promise<WebTokenResponse>;
43
45
  export interface DinkWebConfig {
44
- /** WebSocket URL (e.g., "wss://host:9222") */
45
- url: string;
46
- /** Authentication token (from /api/keys/web-token) */
47
- token: string;
48
- /** Token expiry time (ISO 8601 string or Date). Enables auto-refresh when set with tokenRefresher. */
49
- expiresAt?: string | Date;
50
- /** App ID for subject routing */
51
- appId: string;
52
- /** Request timeout in ms (default: 30000) */
53
- timeout?: number;
54
- /** Called when connection state changes */
55
- onStatusChange?: (status: ConnectionStatus) => void;
56
- /**
57
- * Called to obtain a fresh token before the current one expires.
58
- * If not set, the client will not auto-refresh tokens.
59
- */
60
- tokenRefresher?: TokenRefresher;
61
- /**
62
- * How many ms before expiry to trigger a refresh (default: 60000 = 1 minute).
63
- */
64
- refreshBeforeExpiryMs?: number;
46
+ /** WebSocket URL (e.g., "wss://host:9222") */
47
+ url: string;
48
+ /** Authentication token (from /api/keys/web-token) */
49
+ token: string;
50
+ /** Token expiry time (ISO 8601 string or Date). Enables auto-refresh when set with tokenRefresher. */
51
+ expiresAt?: string | Date;
52
+ /** App ID for subject routing */
53
+ appId: string;
54
+ /** Request timeout in ms (default: 30000) */
55
+ timeout?: number;
56
+ /** Called when connection state changes */
57
+ onStatusChange?: (status: ConnectionStatus) => void;
58
+ /**
59
+ * Called to obtain a fresh token before the current one expires.
60
+ * If not set, the client will not auto-refresh tokens.
61
+ */
62
+ tokenRefresher?: TokenRefresher;
63
+ /**
64
+ * How many ms before expiry to trigger a refresh (default: 60000 = 1 minute).
65
+ */
66
+ refreshBeforeExpiryMs?: number;
65
67
  }
66
68
  export interface ConnectionStats {
67
- /** Current connection status */
68
- status: ConnectionStatus;
69
- /** Number of reconnections since connect() */
70
- reconnectCount: number;
71
- /** Last measured round-trip time in ms, or null if not yet measured */
72
- rttMs: number | null;
73
- /** When the current token expires, or null if unknown */
74
- tokenExpiresAt: Date | null;
69
+ /** Current connection status */
70
+ status: ConnectionStatus;
71
+ /** Number of reconnections since connect() */
72
+ reconnectCount: number;
73
+ /** Last measured round-trip time in ms, or null if not yet measured */
74
+ rttMs: number | null;
75
+ /** When the current token expires, or null if unknown */
76
+ tokenExpiresAt: Date | null;
75
77
  }
76
- export type ConnectionStatus = 'connecting' | 'connected' | 'reconnecting' | 'closed' | 'error';
78
+ export type ConnectionStatus = "connecting" | "connected" | "reconnecting" | "closed" | "error";
77
79
  /** Discovered edge information */
78
80
  export interface EdgeInfo {
79
- edgeId: string;
80
- name?: string;
81
- labels?: Record<string, string>;
82
- services?: string[];
83
- status?: string;
81
+ edgeId: string;
82
+ name?: string;
83
+ labels?: Record<string, string>;
84
+ services?: string[];
85
+ status?: string;
84
86
  }
85
87
  /** Bidirectional raw byte channel between browser and edge. */
86
88
  export interface Channel {
87
- /** Unique channel identifier (e.g., "ch_abc123") */
88
- readonly id: string;
89
- /** Send raw bytes to the other side. Returns false if backpressure is active. */
90
- write(data: Uint8Array): boolean;
91
- /** Register handler for incoming raw bytes */
92
- onData(handler: (data: Uint8Array) => void): void;
93
- /** Close the channel (either side can initiate) */
94
- close(): void;
95
- /** Called when the channel closes (by either side). Supports multiple handlers. */
96
- onClose(handler: (reason?: string) => void): void;
97
- /** Send a JSON-serializable control message out-of-band */
98
- sendControl(msg: unknown): void;
99
- /** Register handler for incoming control messages */
100
- onControl(handler: (msg: unknown) => void): void;
101
- /** True if channel is open */
102
- readonly isOpen: boolean;
103
- /** Promise that resolves when the channel closes */
104
- readonly closed: Promise<void>;
105
- /** Number of bytes queued for sending */
106
- readonly bufferedAmount: number;
107
- /** Register handler called when buffered data has been flushed */
108
- onDrain(handler: () => void): void;
89
+ /** Unique channel identifier (e.g., "ch_abc123") */
90
+ readonly id: string;
91
+ /** Send raw bytes to the other side. Returns false if backpressure is active. */
92
+ write(data: Uint8Array): boolean;
93
+ /** Register handler for incoming raw bytes */
94
+ onData(handler: (data: Uint8Array) => void): void;
95
+ /** Close the channel (either side can initiate) */
96
+ close(): void;
97
+ /** Called when the channel closes (by either side). Supports multiple handlers. */
98
+ onClose(handler: (reason?: string) => void): void;
99
+ /** Send a JSON-serializable control message out-of-band */
100
+ sendControl(msg: unknown): void;
101
+ /** Register handler for incoming control messages */
102
+ onControl(handler: (msg: unknown) => void): void;
103
+ /** True if channel is open */
104
+ readonly isOpen: boolean;
105
+ /** Promise that resolves when the channel closes */
106
+ readonly closed: Promise<void>;
107
+ /** Number of bytes queued for sending */
108
+ readonly bufferedAmount: number;
109
+ /** Register handler called when buffered data has been flushed */
110
+ onDrain(handler: () => void): void;
109
111
  }
110
112
  /** Options for opening a channel. */
111
113
  export interface ChannelOptions {
112
- /** Called when the channel encounters an error. */
113
- onError?: (err: Error) => void;
114
+ /** Called when the channel encounters an error. */
115
+ onError?: (err: Error) => void;
114
116
  }
115
- //# sourceMappingURL=types.d.ts.map
117
+
118
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fatagnus/dink-web",
3
- "version": "2.24.0",
3
+ "version": "2.24.1",
4
4
  "description": "Browser SDK for Dink edge mesh platform via NATS WebSocket",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -30,7 +30,7 @@
30
30
  }
31
31
  },
32
32
  "scripts": {
33
- "build": "tsc",
33
+ "build": "tsc && dts-bundle-generator --config dts-bundle.config.json --no-banner",
34
34
  "clean": "rm -rf dist",
35
35
  "prebuild": "npm run clean",
36
36
  "prepublishOnly": "npm run build",
@@ -73,6 +73,7 @@
73
73
  "devDependencies": {
74
74
  "@types/node": "^20.10.0",
75
75
  "@types/react": "^19.2.14",
76
+ "dts-bundle-generator": "^9.5.1",
76
77
  "typescript": "^5.3.0"
77
78
  },
78
79
  "engines": {
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EACh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