@ironflow/browser 0.20.0 → 0.20.2
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/LICENSE +181 -0
- package/package.json +9 -9
- package/dist/agents/index.d.ts +0 -34
- package/dist/agents/index.d.ts.map +0 -1
- package/dist/agents/index.js +0 -24
- package/dist/agents/index.js.map +0 -1
- package/dist/agents/invoke.d.ts +0 -16
- package/dist/agents/invoke.d.ts.map +0 -1
- package/dist/agents/invoke.js +0 -222
- package/dist/agents/invoke.js.map +0 -1
- package/dist/agents/readMemory.d.ts +0 -18
- package/dist/agents/readMemory.d.ts.map +0 -1
- package/dist/agents/readMemory.js +0 -87
- package/dist/agents/readMemory.js.map +0 -1
- package/dist/agents/subscribe.d.ts +0 -23
- package/dist/agents/subscribe.d.ts.map +0 -1
- package/dist/agents/subscribe.js +0 -117
- package/dist/agents/subscribe.js.map +0 -1
- package/dist/agents/types.d.ts +0 -156
- package/dist/agents/types.d.ts.map +0 -1
- package/dist/agents/types.js +0 -7
- package/dist/agents/types.js.map +0 -1
- package/dist/client.d.ts +0 -844
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -2243
- package/dist/client.js.map +0 -1
- package/dist/config-client.d.ts +0 -43
- package/dist/config-client.d.ts.map +0 -1
- package/dist/config-client.js +0 -134
- package/dist/config-client.js.map +0 -1
- package/dist/config.d.ts +0 -91
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -55
- package/dist/config.js.map +0 -1
- package/dist/index.d.ts +0 -53
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -53
- package/dist/index.js.map +0 -1
- package/dist/kv.d.ts +0 -79
- package/dist/kv.d.ts.map +0 -1
- package/dist/kv.js +0 -289
- package/dist/kv.js.map +0 -1
- package/dist/projection-stream.d.ts +0 -42
- package/dist/projection-stream.d.ts.map +0 -1
- package/dist/projection-stream.js +0 -48
- package/dist/projection-stream.js.map +0 -1
- package/dist/subscription.d.ts +0 -107
- package/dist/subscription.d.ts.map +0 -1
- package/dist/subscription.js +0 -450
- package/dist/subscription.js.map +0 -1
- package/dist/transport/connectrpc.d.ts +0 -74
- package/dist/transport/connectrpc.d.ts.map +0 -1
- package/dist/transport/connectrpc.js +0 -393
- package/dist/transport/connectrpc.js.map +0 -1
- package/dist/transport/index.d.ts +0 -7
- package/dist/transport/index.d.ts.map +0 -1
- package/dist/transport/index.js +0 -6
- package/dist/transport/index.js.map +0 -1
- package/dist/transport/types.d.ts +0 -69
- package/dist/transport/types.d.ts.map +0 -1
- package/dist/transport/types.js +0 -5
- package/dist/transport/types.js.map +0 -1
- package/dist/transport/websocket.d.ts +0 -38
- package/dist/transport/websocket.d.ts.map +0 -1
- package/dist/transport/websocket.js +0 -276
- package/dist/transport/websocket.js.map +0 -1
|
@@ -1,393 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ConnectRPC transport implementation for browser
|
|
3
|
-
*
|
|
4
|
-
* Uses @connectrpc/connect-web for browser-compatible gRPC communication.
|
|
5
|
-
*/
|
|
6
|
-
import { createClient, ConnectError, Code } from "@connectrpc/connect";
|
|
7
|
-
import { createConnectTransport } from "@connectrpc/connect-web";
|
|
8
|
-
import { create } from "@bufbuild/protobuf";
|
|
9
|
-
import { calculateBackoff, HEADERS } from "@ironflow/core";
|
|
10
|
-
import { PubSubService } from "@ironflow/core/gen";
|
|
11
|
-
import { SubscribeRequestSchema, SubscribeOptionsSchema, AckMode as ProtoAckMode, BackpressureMode as ProtoBackpressureMode, } from "@ironflow/core/gen";
|
|
12
|
-
/**
|
|
13
|
-
* Convert SDK ack mode to protobuf enum
|
|
14
|
-
*/
|
|
15
|
-
function toProtoAckMode(mode) {
|
|
16
|
-
switch (mode) {
|
|
17
|
-
case "manual":
|
|
18
|
-
return ProtoAckMode.MANUAL;
|
|
19
|
-
case "auto":
|
|
20
|
-
default:
|
|
21
|
-
return ProtoAckMode.AUTO;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Convert SDK backpressure mode to protobuf enum
|
|
26
|
-
*/
|
|
27
|
-
function toProtoBackpressureMode(mode) {
|
|
28
|
-
switch (mode) {
|
|
29
|
-
case "drop":
|
|
30
|
-
return ProtoBackpressureMode.DROP;
|
|
31
|
-
case "block":
|
|
32
|
-
return ProtoBackpressureMode.BLOCK;
|
|
33
|
-
case "buffer":
|
|
34
|
-
default:
|
|
35
|
-
return ProtoBackpressureMode.BUFFER;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Check if a stream error is an explicit user/framework cancellation that
|
|
40
|
-
* should always be suppressed (page unload, React unmount, HMR).
|
|
41
|
-
*/
|
|
42
|
-
export function isExplicitCancellation(error) {
|
|
43
|
-
if (error == null || typeof error !== "object")
|
|
44
|
-
return false;
|
|
45
|
-
// Explicit abort via AbortController (unmount, pause, disconnect).
|
|
46
|
-
// DOMException does not extend Error in all environments, so check
|
|
47
|
-
// the name property directly on the object after the null guard.
|
|
48
|
-
if ("name" in error && error.name === "AbortError")
|
|
49
|
-
return true;
|
|
50
|
-
// ConnectRPC cancellation (page unload, React unmount, HMR)
|
|
51
|
-
if (error instanceof ConnectError && error.code === Code.Canceled)
|
|
52
|
-
return true;
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Check if a stream error is a recoverable network/availability issue that
|
|
57
|
-
* should be suppressed when auto-reconnect is enabled. These errors indicate
|
|
58
|
-
* transient problems the transport can recover from automatically.
|
|
59
|
-
*
|
|
60
|
-
* When auto-reconnect is disabled, these errors are surfaced to onError so
|
|
61
|
-
* users can implement their own recovery strategy.
|
|
62
|
-
*/
|
|
63
|
-
export function isTransientNetworkError(error) {
|
|
64
|
-
if (error == null || typeof error !== "object")
|
|
65
|
-
return false;
|
|
66
|
-
if (error instanceof ConnectError) {
|
|
67
|
-
// Server temporarily unavailable
|
|
68
|
-
if (error.code === Code.Unavailable)
|
|
69
|
-
return true;
|
|
70
|
-
// Stream aborted mid-reconnection (BodyStreamBuffer was aborted)
|
|
71
|
-
if (error.code === Code.Unknown &&
|
|
72
|
-
/aborted|BodyStreamBuffer/i.test(error.message))
|
|
73
|
-
return true;
|
|
74
|
-
}
|
|
75
|
-
// Network-level fetch failures (server not ready, offline)
|
|
76
|
-
if (error instanceof TypeError && /fetch|network/i.test(error.message))
|
|
77
|
-
return true;
|
|
78
|
-
return false;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* ConnectRPC-based transport for browser subscriptions
|
|
82
|
-
*
|
|
83
|
-
* Uses server streaming for auto-ack mode subscriptions.
|
|
84
|
-
*/
|
|
85
|
-
export class ConnectRPCTransport {
|
|
86
|
-
serverUrl;
|
|
87
|
-
options;
|
|
88
|
-
callbacks;
|
|
89
|
-
webTransport = null;
|
|
90
|
-
client = null;
|
|
91
|
-
_connectionState = "disconnected";
|
|
92
|
-
reconnectAttempt = 0;
|
|
93
|
-
reconnectTimer = null;
|
|
94
|
-
paused = false;
|
|
95
|
-
// Subscription tracking
|
|
96
|
-
activeSubscriptions = new Map();
|
|
97
|
-
subscriptionIdCounter = 0;
|
|
98
|
-
constructor(serverUrl, options) {
|
|
99
|
-
this.serverUrl = serverUrl;
|
|
100
|
-
this.options = options;
|
|
101
|
-
}
|
|
102
|
-
get connectionState() {
|
|
103
|
-
return this._connectionState;
|
|
104
|
-
}
|
|
105
|
-
setCallbacks(callbacks) {
|
|
106
|
-
this.callbacks = callbacks;
|
|
107
|
-
}
|
|
108
|
-
async connect() {
|
|
109
|
-
if (this._connectionState === "connected") {
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
if (this.paused) {
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
this._connectionState = "connecting";
|
|
116
|
-
this.callbacks?.onConnectionChange("connecting");
|
|
117
|
-
try {
|
|
118
|
-
// Build interceptors for auth and environment headers
|
|
119
|
-
const envHeader = this.options.environment;
|
|
120
|
-
const auth = this.options.auth;
|
|
121
|
-
const interceptors = [];
|
|
122
|
-
if (auth?.apiKey || auth?.token) {
|
|
123
|
-
interceptors.push((next) => async (req) => {
|
|
124
|
-
const token = auth.apiKey || auth.token;
|
|
125
|
-
req.header.set("Authorization", `Bearer ${token}`);
|
|
126
|
-
return next(req);
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
if (envHeader) {
|
|
130
|
-
interceptors.push((next) => async (req) => {
|
|
131
|
-
req.header.set(HEADERS.ENVIRONMENT, envHeader);
|
|
132
|
-
return next(req);
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
// Use Connect transport for streaming (simpler protocol, easier to debug)
|
|
136
|
-
this.webTransport = createConnectTransport({
|
|
137
|
-
baseUrl: this.serverUrl,
|
|
138
|
-
interceptors: interceptors.length > 0 ? interceptors : undefined,
|
|
139
|
-
});
|
|
140
|
-
// Create the PubSub client
|
|
141
|
-
// Type assertion needed due to connect-es v1/v2 type mismatch
|
|
142
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
143
|
-
this.client = createClient(PubSubService, this.webTransport);
|
|
144
|
-
// Mark as connected
|
|
145
|
-
this._connectionState = "connected";
|
|
146
|
-
this.reconnectAttempt = 0;
|
|
147
|
-
this.callbacks?.onConnectionChange("connected");
|
|
148
|
-
// Resubscribe all pending subscriptions
|
|
149
|
-
for (const [id, sub] of this.activeSubscriptions) {
|
|
150
|
-
this.startSubscriptionStream(id, sub);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
catch (error) {
|
|
154
|
-
this._connectionState = "disconnected";
|
|
155
|
-
this.callbacks?.onConnectionChange("disconnected");
|
|
156
|
-
throw error;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
disconnect() {
|
|
160
|
-
this.clearReconnectTimer();
|
|
161
|
-
this.paused = false;
|
|
162
|
-
// Abort all active subscriptions
|
|
163
|
-
for (const sub of this.activeSubscriptions.values()) {
|
|
164
|
-
sub.abortController.abort();
|
|
165
|
-
}
|
|
166
|
-
this.webTransport = null;
|
|
167
|
-
this.client = null;
|
|
168
|
-
this._connectionState = "disconnected";
|
|
169
|
-
this.activeSubscriptions.clear();
|
|
170
|
-
this.callbacks?.onConnectionChange("disconnected");
|
|
171
|
-
}
|
|
172
|
-
subscribe(pattern, options) {
|
|
173
|
-
const subscriptionId = `crpc-sub-${++this.subscriptionIdCounter}`;
|
|
174
|
-
// Create abort controller for this subscription
|
|
175
|
-
const abortController = new AbortController();
|
|
176
|
-
// Track the subscription
|
|
177
|
-
const activeSub = {
|
|
178
|
-
pattern,
|
|
179
|
-
options,
|
|
180
|
-
abortController,
|
|
181
|
-
};
|
|
182
|
-
this.activeSubscriptions.set(subscriptionId, activeSub);
|
|
183
|
-
// Start streaming if connected
|
|
184
|
-
if (this._connectionState === "connected") {
|
|
185
|
-
this.startSubscriptionStream(subscriptionId, activeSub);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
unsubscribe(subscriptionId) {
|
|
189
|
-
const sub = this.activeSubscriptions.get(subscriptionId);
|
|
190
|
-
if (sub) {
|
|
191
|
-
sub.abortController.abort();
|
|
192
|
-
this.activeSubscriptions.delete(subscriptionId);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
async ack(eventId, type, _delay) {
|
|
196
|
-
// Manual acks are not yet supported in the browser transport
|
|
197
|
-
// The server streaming only supports auto-ack mode
|
|
198
|
-
// Bidirectional streaming would be needed for manual acks
|
|
199
|
-
throw new Error(`Manual acknowledgments are not yet supported in the browser transport. ` +
|
|
200
|
-
`Cannot send ${type} for event ${eventId}. ` +
|
|
201
|
-
`Use ackMode: "auto" (default) or use WebSocket transport for manual acks.`);
|
|
202
|
-
}
|
|
203
|
-
pause() {
|
|
204
|
-
this.paused = true;
|
|
205
|
-
this.clearReconnectTimer();
|
|
206
|
-
// Abort all active streams
|
|
207
|
-
for (const sub of this.activeSubscriptions.values()) {
|
|
208
|
-
sub.abortController.abort();
|
|
209
|
-
// Create new abort controller for resume
|
|
210
|
-
sub.abortController = new AbortController();
|
|
211
|
-
}
|
|
212
|
-
this._connectionState = "disconnected";
|
|
213
|
-
this.callbacks?.onConnectionChange("disconnected");
|
|
214
|
-
}
|
|
215
|
-
resume() {
|
|
216
|
-
this.paused = false;
|
|
217
|
-
this.connect().catch(() => {
|
|
218
|
-
// Will retry via reconnect logic
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
/**
|
|
222
|
-
* Start the subscription stream for a given subscription
|
|
223
|
-
*/
|
|
224
|
-
async startSubscriptionStream(subscriptionId, sub) {
|
|
225
|
-
if (!this.client)
|
|
226
|
-
return;
|
|
227
|
-
try {
|
|
228
|
-
// Build subscribe request using protobuf create()
|
|
229
|
-
const request = create(SubscribeRequestSchema, {
|
|
230
|
-
pattern: sub.pattern,
|
|
231
|
-
options: create(SubscribeOptionsSchema, {
|
|
232
|
-
replay: sub.options?.replay ?? 0,
|
|
233
|
-
includeMetadata: sub.options?.includeMetadata ?? false,
|
|
234
|
-
filter: sub.options?.filter ?? "",
|
|
235
|
-
namespace: sub.options?.namespace ?? "default",
|
|
236
|
-
consumerGroup: sub.options?.consumerGroup ?? "",
|
|
237
|
-
ackMode: toProtoAckMode(sub.options?.ackMode),
|
|
238
|
-
backpressure: toProtoBackpressureMode(sub.options?.backpressure),
|
|
239
|
-
}),
|
|
240
|
-
});
|
|
241
|
-
// Notify subscription started
|
|
242
|
-
sub.subscriptionId = subscriptionId;
|
|
243
|
-
this.callbacks?.onSubscribed(sub.pattern, subscriptionId);
|
|
244
|
-
// Start server streaming
|
|
245
|
-
const stream = this.client.subscribe(request, {
|
|
246
|
-
signal: sub.abortController.signal,
|
|
247
|
-
});
|
|
248
|
-
// Process events from the stream
|
|
249
|
-
for await (const event of stream) {
|
|
250
|
-
// Check if subscription was cancelled
|
|
251
|
-
if (!this.activeSubscriptions.has(subscriptionId)) {
|
|
252
|
-
break;
|
|
253
|
-
}
|
|
254
|
-
// Convert protobuf event to SDK event
|
|
255
|
-
const subscriptionEvent = this.convertProtoEvent(event);
|
|
256
|
-
// Invoke callback
|
|
257
|
-
this.callbacks?.onEvent(subscriptionId, subscriptionEvent);
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
catch (error) {
|
|
261
|
-
// Explicit cancellations (AbortError, Code.Canceled) are always
|
|
262
|
-
// suppressed — these are user/framework-initiated (unmount, HMR).
|
|
263
|
-
if (isExplicitCancellation(error)) {
|
|
264
|
-
return;
|
|
265
|
-
}
|
|
266
|
-
// Transient network errors (Unavailable, fetch failures, mid-reconnect
|
|
267
|
-
// stream tears) are suppressed only when auto-reconnect is enabled,
|
|
268
|
-
// since the transport handles recovery automatically. When auto-reconnect
|
|
269
|
-
// is off, these fall through to onError so users can react.
|
|
270
|
-
if (isTransientNetworkError(error)) {
|
|
271
|
-
if (this.options.autoReconnect &&
|
|
272
|
-
this._connectionState === "connected" &&
|
|
273
|
-
this.activeSubscriptions.has(subscriptionId)) {
|
|
274
|
-
this.handleDisconnect();
|
|
275
|
-
return;
|
|
276
|
-
}
|
|
277
|
-
// autoReconnect is off — fall through to fire onError
|
|
278
|
-
}
|
|
279
|
-
// Check if subscription still exists
|
|
280
|
-
if (!this.activeSubscriptions.has(subscriptionId)) {
|
|
281
|
-
return;
|
|
282
|
-
}
|
|
283
|
-
// Extract error details from ConnectError or standard Error
|
|
284
|
-
let errorMessage = "Unknown error";
|
|
285
|
-
let errorCode = "STREAM_ERROR";
|
|
286
|
-
if (error instanceof ConnectError) {
|
|
287
|
-
errorMessage = error.message;
|
|
288
|
-
errorCode = error.code.toString();
|
|
289
|
-
}
|
|
290
|
-
else if (error instanceof Error) {
|
|
291
|
-
errorMessage = error.message;
|
|
292
|
-
errorCode = error.name || "STREAM_ERROR";
|
|
293
|
-
}
|
|
294
|
-
else {
|
|
295
|
-
// Fallback for non-Error objects
|
|
296
|
-
try {
|
|
297
|
-
errorMessage = String(error);
|
|
298
|
-
}
|
|
299
|
-
catch {
|
|
300
|
-
errorMessage = "Unknown non-Error object";
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
// Fire onError only for non-recoverable application errors
|
|
304
|
-
this.callbacks?.onError(subscriptionId, {
|
|
305
|
-
subscriptionId,
|
|
306
|
-
code: errorCode,
|
|
307
|
-
message: errorMessage,
|
|
308
|
-
retrying: this.options.autoReconnect,
|
|
309
|
-
});
|
|
310
|
-
// Trigger reconnect if enabled
|
|
311
|
-
if (this.options.autoReconnect && this._connectionState === "connected") {
|
|
312
|
-
this.handleDisconnect();
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
/**
|
|
317
|
-
* Convert protobuf event to SDK event
|
|
318
|
-
*/
|
|
319
|
-
convertProtoEvent(event) {
|
|
320
|
-
// Convert timestamp - protobuf Timestamp has seconds and nanos fields
|
|
321
|
-
let timestamp = new Date().toISOString();
|
|
322
|
-
if (event.metadata?.timestamp) {
|
|
323
|
-
const ts = event.metadata.timestamp;
|
|
324
|
-
// Timestamp has seconds (bigint) and nanos (number)
|
|
325
|
-
const ms = Number(ts.seconds) * 1000 + Math.floor(ts.nanos / 1000000);
|
|
326
|
-
timestamp = new Date(ms).toISOString();
|
|
327
|
-
}
|
|
328
|
-
return {
|
|
329
|
-
topic: event.topic,
|
|
330
|
-
data: (event.data ?? {}),
|
|
331
|
-
meta: event.metadata
|
|
332
|
-
? {
|
|
333
|
-
timestamp,
|
|
334
|
-
sequence: Number(event.sequence),
|
|
335
|
-
}
|
|
336
|
-
: undefined,
|
|
337
|
-
eventId: event.eventId,
|
|
338
|
-
};
|
|
339
|
-
}
|
|
340
|
-
/**
|
|
341
|
-
* Handle disconnection
|
|
342
|
-
*/
|
|
343
|
-
handleDisconnect() {
|
|
344
|
-
const wasConnected = this._connectionState === "connected";
|
|
345
|
-
this._connectionState = "disconnected";
|
|
346
|
-
if (wasConnected) {
|
|
347
|
-
this.callbacks?.onConnectionChange("disconnected");
|
|
348
|
-
}
|
|
349
|
-
// Schedule reconnection if enabled
|
|
350
|
-
if (this.options.autoReconnect && !this.paused) {
|
|
351
|
-
this.scheduleReconnect();
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
/**
|
|
355
|
-
* Schedule a reconnection attempt
|
|
356
|
-
*/
|
|
357
|
-
scheduleReconnect() {
|
|
358
|
-
if (this.reconnectTimer || this.paused) {
|
|
359
|
-
return;
|
|
360
|
-
}
|
|
361
|
-
this._connectionState = "reconnecting";
|
|
362
|
-
this.callbacks?.onConnectionChange("reconnecting");
|
|
363
|
-
this.reconnectAttempt++;
|
|
364
|
-
const delay = calculateBackoff(this.reconnectAttempt, this.options.reconnectDelay, this.options.maxReconnectDelay, this.options.reconnectBackoff);
|
|
365
|
-
this.reconnectTimer = setTimeout(() => {
|
|
366
|
-
this.reconnectTimer = null;
|
|
367
|
-
// Reset abort controllers for reconnect
|
|
368
|
-
for (const sub of this.activeSubscriptions.values()) {
|
|
369
|
-
sub.abortController = new AbortController();
|
|
370
|
-
}
|
|
371
|
-
this.connect().catch(() => {
|
|
372
|
-
// Will trigger another reconnect via handleDisconnect
|
|
373
|
-
this.handleDisconnect();
|
|
374
|
-
});
|
|
375
|
-
}, delay);
|
|
376
|
-
}
|
|
377
|
-
/**
|
|
378
|
-
* Clear the reconnect timer
|
|
379
|
-
*/
|
|
380
|
-
clearReconnectTimer() {
|
|
381
|
-
if (this.reconnectTimer) {
|
|
382
|
-
clearTimeout(this.reconnectTimer);
|
|
383
|
-
this.reconnectTimer = null;
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
/**
|
|
388
|
-
* Create a ConnectRPC transport for browser
|
|
389
|
-
*/
|
|
390
|
-
export function createConnectRPCTransport(serverUrl, options) {
|
|
391
|
-
return new ConnectRPCTransport(serverUrl, options);
|
|
392
|
-
}
|
|
393
|
-
//# sourceMappingURL=connectrpc.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connectrpc.js","sourceRoot":"","sources":["../../src/transport/connectrpc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ransportOptions, } from "./types.js";
|
|
5
|
-
export { createWebSocketTransport } from "./websocket.js";
|
|
6
|
-
export { createConnectRPCTransport } from "./connectrpc.js";
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/transport/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,YAAY,EACV,SAAS,EACT,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/transport/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/transport/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transport layer type definitions
|
|
3
|
-
*/
|
|
4
|
-
import type { SubscriptionEvent, SubscriptionErrorInfo, ConnectionState, SubscribeOptions, AckType } from "@ironflow/core";
|
|
5
|
-
/**
|
|
6
|
-
* Transport callbacks
|
|
7
|
-
*/
|
|
8
|
-
export interface TransportCallbacks {
|
|
9
|
-
/** Called when an event is received */
|
|
10
|
-
onEvent: (subscriptionId: string, event: SubscriptionEvent) => void;
|
|
11
|
-
/** Called when a subscription error occurs */
|
|
12
|
-
onError: (subscriptionId: string, error: SubscriptionErrorInfo) => void;
|
|
13
|
-
/** Called when connection state changes */
|
|
14
|
-
onConnectionChange: (state: ConnectionState) => void;
|
|
15
|
-
/** Called when a subscription is confirmed */
|
|
16
|
-
onSubscribed: (pattern: string, subscriptionId: string) => void;
|
|
17
|
-
/** Called when a subscription fails */
|
|
18
|
-
onSubscribeFailed: (pattern: string, error: Error) => void;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Transport interface for subscription connections
|
|
22
|
-
*/
|
|
23
|
-
export interface Transport {
|
|
24
|
-
/** Current connection state */
|
|
25
|
-
readonly connectionState: ConnectionState;
|
|
26
|
-
/** Connect to the server */
|
|
27
|
-
connect(): Promise<void>;
|
|
28
|
-
/** Disconnect from the server */
|
|
29
|
-
disconnect(): void;
|
|
30
|
-
/** Subscribe to a pattern */
|
|
31
|
-
subscribe(pattern: string, options?: SubscribeOptions): void;
|
|
32
|
-
/** Unsubscribe from a subscription */
|
|
33
|
-
unsubscribe(subscriptionId: string): void;
|
|
34
|
-
/** Send acknowledgment for an event */
|
|
35
|
-
ack(eventId: string, type: AckType, delay?: number): Promise<void>;
|
|
36
|
-
/** Set callbacks */
|
|
37
|
-
setCallbacks(callbacks: TransportCallbacks): void;
|
|
38
|
-
/** Pause the connection (for tab visibility) */
|
|
39
|
-
pause(): void;
|
|
40
|
-
/** Resume the connection */
|
|
41
|
-
resume(): void;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Transport factory function type
|
|
45
|
-
*/
|
|
46
|
-
export type TransportFactory = (serverUrl: string, options: TransportOptions) => Transport;
|
|
47
|
-
/**
|
|
48
|
-
* Transport options
|
|
49
|
-
*/
|
|
50
|
-
export interface TransportOptions {
|
|
51
|
-
/** Authentication headers */
|
|
52
|
-
auth?: {
|
|
53
|
-
apiKey?: string;
|
|
54
|
-
token?: string;
|
|
55
|
-
};
|
|
56
|
-
/** Auto-reconnect enabled */
|
|
57
|
-
autoReconnect: boolean;
|
|
58
|
-
/** Initial reconnect delay */
|
|
59
|
-
reconnectDelay: number;
|
|
60
|
-
/** Max reconnect delay */
|
|
61
|
-
maxReconnectDelay: number;
|
|
62
|
-
/** Reconnect backoff multiplier */
|
|
63
|
-
reconnectBackoff: number;
|
|
64
|
-
/** Target environment for environment isolation */
|
|
65
|
-
environment?: string;
|
|
66
|
-
/** Connection timeout in milliseconds (default: 10000) */
|
|
67
|
-
connectionTimeout?: number;
|
|
68
|
-
}
|
|
69
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/transport/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,OAAO,EACR,MAAM,gBAAgB,CAAC;AAExB;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,uCAAuC;IACvC,OAAO,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACpE,8CAA8C;IAC9C,OAAO,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACxE,2CAA2C;IAC3C,kBAAkB,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IACrD,8CAA8C;IAC9C,YAAY,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC;IAChE,uCAAuC;IACvC,iBAAiB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAC5D;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,+BAA+B;IAC/B,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAE1C,4BAA4B;IAC5B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzB,iCAAiC;IACjC,UAAU,IAAI,IAAI,CAAC;IAEnB,6BAA6B;IAC7B,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAE7D,sCAAsC;IACtC,WAAW,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1C,uCAAuC;IACvC,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnE,oBAAoB;IACpB,YAAY,CAAC,SAAS,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAElD,gDAAgD;IAChD,KAAK,IAAI,IAAI,CAAC;IAEd,4BAA4B;IAC5B,MAAM,IAAI,IAAI,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAC7B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,gBAAgB,KACtB,SAAS,CAAC;AAEf;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,6BAA6B;IAC7B,IAAI,CAAC,EAAE;QACL,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,6BAA6B;IAC7B,aAAa,EAAE,OAAO,CAAC;IACvB,8BAA8B;IAC9B,cAAc,EAAE,MAAM,CAAC;IACvB,0BAA0B;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mCAAmC;IACnC,gBAAgB,EAAE,MAAM,CAAC;IACzB,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0DAA0D;IAC1D,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B"}
|
package/dist/transport/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/transport/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WebSocket transport implementation
|
|
3
|
-
*/
|
|
4
|
-
import type { ConnectionState, SubscribeOptions, AckType } from "@ironflow/core";
|
|
5
|
-
import type { Transport, TransportCallbacks, TransportOptions } from "./types.js";
|
|
6
|
-
/**
|
|
7
|
-
* WebSocket-based transport for subscriptions
|
|
8
|
-
*/
|
|
9
|
-
export declare class WebSocketTransport implements Transport {
|
|
10
|
-
private readonly wsUrl;
|
|
11
|
-
private readonly options;
|
|
12
|
-
private callbacks?;
|
|
13
|
-
private ws;
|
|
14
|
-
private _connectionState;
|
|
15
|
-
private reconnectAttempt;
|
|
16
|
-
private reconnectTimer;
|
|
17
|
-
private paused;
|
|
18
|
-
private pendingSubscriptions;
|
|
19
|
-
constructor(serverUrl: string, options: TransportOptions);
|
|
20
|
-
get connectionState(): ConnectionState;
|
|
21
|
-
setCallbacks(callbacks: TransportCallbacks): void;
|
|
22
|
-
connect(): Promise<void>;
|
|
23
|
-
disconnect(): void;
|
|
24
|
-
subscribe(pattern: string, options?: SubscribeOptions): void;
|
|
25
|
-
unsubscribe(subscriptionId: string): void;
|
|
26
|
-
ack(eventId: string, type: AckType, delay?: number): Promise<void>;
|
|
27
|
-
pause(): void;
|
|
28
|
-
resume(): void;
|
|
29
|
-
private sendSubscribe;
|
|
30
|
-
private handleMessage;
|
|
31
|
-
private scheduleReconnect;
|
|
32
|
-
private clearReconnectTimer;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Create a WebSocket transport
|
|
36
|
-
*/
|
|
37
|
-
export declare function createWebSocketTransport(serverUrl: string, options: TransportOptions): Transport;
|
|
38
|
-
//# sourceMappingURL=websocket.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"websocket.d.ts","sourceRoot":"","sources":["../../src/transport/websocket.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAChB,OAAO,EAER,MAAM,gBAAgB,CAAC;AASxB,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAElF;;GAEG;AACH,qBAAa,kBAAmB,YAAW,SAA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