iii-sdk 0.22.1 → 0.23.0-alpha.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/dist/channel.d.cts +1 -1
- package/dist/channel.d.mts +1 -1
- package/dist/engine.d.cts +1 -2
- package/dist/engine.d.mts +1 -2
- package/dist/errors-B2LphIs-.d.cts +64 -0
- package/dist/errors-B2LphIs-.d.cts.map +1 -0
- package/dist/errors-BnYJZ4Ye.d.mts +64 -0
- package/dist/errors-BnYJZ4Ye.d.mts.map +1 -0
- package/dist/errors.cjs +20 -0
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.cts +2 -40
- package/dist/errors.d.mts +2 -40
- package/dist/errors.mjs +20 -1
- package/dist/errors.mjs.map +1 -1
- package/dist/helpers.d.cts +1 -1
- package/dist/helpers.d.mts +1 -1
- package/dist/{iii-types-BvaIabiX.cjs → iii-types-BHasLgj1.cjs} +2 -1
- package/dist/iii-types-BHasLgj1.cjs.map +1 -0
- package/dist/{iii-types-wPYrg7hX.mjs → iii-types-Btz-0RpP.mjs} +2 -1
- package/dist/iii-types-Btz-0RpP.mjs.map +1 -0
- package/dist/index.cjs +145 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +31 -11
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +31 -11
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +145 -19
- package/dist/index.mjs.map +1 -1
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.mts +1 -1
- package/dist/protocol.cjs +1 -1
- package/dist/protocol.d.cts +1 -1
- package/dist/protocol.d.mts +1 -1
- package/dist/protocol.mjs +1 -1
- package/dist/runtime.d.cts +1 -2
- package/dist/runtime.d.mts +1 -2
- package/dist/trigger.d.cts +1 -1
- package/dist/trigger.d.mts +1 -1
- package/dist/{types-BD2fp4Py.d.mts → types-Be3nGFI2.d.mts} +108 -2
- package/dist/types-Be3nGFI2.d.mts.map +1 -0
- package/dist/{types-n-760A15.d.cts → types-D-KH-5pT.d.cts} +108 -2
- package/dist/types-D-KH-5pT.d.cts.map +1 -0
- package/package.json +2 -2
- package/dist/errors.d.cts.map +0 -1
- package/dist/errors.d.mts.map +0 -1
- package/dist/iii-constants-Baptl8nm.d.mts +0 -47
- package/dist/iii-constants-Baptl8nm.d.mts.map +0 -1
- package/dist/iii-constants-BqXp8xSN.d.cts +0 -47
- package/dist/iii-constants-BqXp8xSN.d.cts.map +0 -1
- package/dist/iii-types-BvaIabiX.cjs.map +0 -1
- package/dist/iii-types-wPYrg7hX.mjs.map +0 -1
- package/dist/types-BD2fp4Py.d.mts.map +0 -1
- package/dist/types-n-760A15.d.cts.map +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { r as RegistrationRejectedError } from "./errors-B2LphIs-.cjs";
|
|
1
2
|
import { Readable, Writable } from "node:stream";
|
|
2
3
|
import { HttpInvocationConfig } from "@iii-dev/helpers/http";
|
|
3
4
|
|
|
@@ -21,12 +22,19 @@ declare enum MessageType {
|
|
|
21
22
|
UnregisterTriggerType = "unregistertriggertype",
|
|
22
23
|
TriggerRegistrationResult = "triggerregistrationresult",
|
|
23
24
|
WorkerRegistered = "workerregistered",
|
|
25
|
+
RegistrationRejected = "registrationrejected",
|
|
24
26
|
Reattach = "reattach"
|
|
25
27
|
}
|
|
26
28
|
type RegisterTriggerTypeMessage = {
|
|
27
29
|
message_type: MessageType.RegisterTriggerType; /** Unique identifier for the trigger type (e.g. `state`, `durable:subscriber`). */
|
|
28
30
|
id: string; /** Human-readable description of what this trigger type does. */
|
|
29
31
|
description: string;
|
|
32
|
+
/**
|
|
33
|
+
* Namespace this provider serves. Omit to let the engine use this
|
|
34
|
+
* connection's own, which is what a worker providing a trigger type for its
|
|
35
|
+
* own project wants.
|
|
36
|
+
*/
|
|
37
|
+
namespace?: string;
|
|
30
38
|
};
|
|
31
39
|
type ErrorBody = {
|
|
32
40
|
code: string;
|
|
@@ -40,6 +48,25 @@ type RegisterTriggerMessage = {
|
|
|
40
48
|
function_id: string; /** Trigger-type-specific configuration, matching the shape the trigger type expects. */
|
|
41
49
|
config: unknown; /** Arbitrary user-specifiable metadata supplied to the triggered handler function on every invocation. */
|
|
42
50
|
metadata?: Record<string, unknown>;
|
|
51
|
+
/**
|
|
52
|
+
* Namespace the trigger's target function resolves in.
|
|
53
|
+
*
|
|
54
|
+
* Omitting it does not bind in the engine's default: `registerTrigger` fills
|
|
55
|
+
* it from this worker's namespace, because the function a trigger names is
|
|
56
|
+
* one this worker registered, and that landed in the worker's namespace. Name
|
|
57
|
+
* another namespace, `default` included, to bind elsewhere.
|
|
58
|
+
*/
|
|
59
|
+
namespace?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Namespace to find the trigger type's provider in.
|
|
62
|
+
*
|
|
63
|
+
* Omitting it is not the same as `'default'`: it asks the engine to resolve,
|
|
64
|
+
* taking this worker's namespace first and the engine's own second. That is
|
|
65
|
+
* what lets a project ship its own provider for a type id the engine also
|
|
66
|
+
* provides, while a worker that has not been migrated keeps reaching the
|
|
67
|
+
* engine's without saying so. Naming one is strict.
|
|
68
|
+
*/
|
|
69
|
+
trigger_namespace?: string;
|
|
43
70
|
};
|
|
44
71
|
type RegisterFunctionFormat = {
|
|
45
72
|
/**
|
|
@@ -118,6 +145,11 @@ type MiddlewareFunctionInput = {
|
|
|
118
145
|
payload: Record<string, unknown>; /** Routing action, if any. */
|
|
119
146
|
action?: TriggerAction; /** Auth context returned by the auth function for this session. */
|
|
120
147
|
context: Record<string, unknown>;
|
|
148
|
+
/**
|
|
149
|
+
* Target namespace the invoke addressed; forward the call here to stay in the
|
|
150
|
+
* caller's namespace. Absent → the engine's default namespace.
|
|
151
|
+
*/
|
|
152
|
+
namespace?: string;
|
|
121
153
|
};
|
|
122
154
|
/**
|
|
123
155
|
* Request object passed to {@link IIIClient.trigger}.
|
|
@@ -130,6 +162,12 @@ type TriggerRequest<TInput = unknown> = {
|
|
|
130
162
|
action?: TriggerAction; /** Override the default invocation timeout, in milliseconds. */
|
|
131
163
|
timeoutMs?: number; /** Arbitrary user-specifiable metadata supplied to the triggered handler function on every invocation. */
|
|
132
164
|
metadata?: unknown;
|
|
165
|
+
/**
|
|
166
|
+
* Target namespace for routing. Omit to inherit this worker's; say `default`
|
|
167
|
+
* to reach the engine's from a namespaced worker. Serialized into the
|
|
168
|
+
* {@link InvokeFunctionMessage} `namespace` field.
|
|
169
|
+
*/
|
|
170
|
+
namespace?: string;
|
|
133
171
|
};
|
|
134
172
|
/**
|
|
135
173
|
* Serializable reference to one end of a streaming channel. Can be included
|
|
@@ -235,6 +273,51 @@ declare class ChannelReader {
|
|
|
235
273
|
close(): void;
|
|
236
274
|
}
|
|
237
275
|
//#endregion
|
|
276
|
+
//#region src/iii-constants.d.ts
|
|
277
|
+
/**
|
|
278
|
+
* Constants for the III module.
|
|
279
|
+
*/
|
|
280
|
+
/**
|
|
281
|
+
* Engine function paths for internal operations.
|
|
282
|
+
*
|
|
283
|
+
* Naming note: `LIST_TRIGGERS` / `INFO_TRIGGERS` cover trigger TYPES
|
|
284
|
+
* (templates). `LIST_REGISTERED_TRIGGERS` / `INFO_REGISTERED_TRIGGERS`
|
|
285
|
+
* cover trigger INSTANCES (subscriber rows). The old
|
|
286
|
+
* `engine::trigger-types::list` builtin has been removed and is now
|
|
287
|
+
* served by `engine::triggers::list`.
|
|
288
|
+
*/
|
|
289
|
+
declare const EngineFunctions: {
|
|
290
|
+
readonly LIST_FUNCTIONS: "engine::functions::list";
|
|
291
|
+
readonly INFO_FUNCTIONS: "engine::functions::info";
|
|
292
|
+
readonly LIST_WORKERS: "engine::workers::list";
|
|
293
|
+
readonly INFO_WORKERS: "engine::workers::info";
|
|
294
|
+
readonly LIST_TRIGGERS: "engine::triggers::list";
|
|
295
|
+
readonly INFO_TRIGGERS: "engine::triggers::info";
|
|
296
|
+
readonly LIST_REGISTERED_TRIGGERS: "engine::registered-triggers::list";
|
|
297
|
+
readonly INFO_REGISTERED_TRIGGERS: "engine::registered-triggers::info";
|
|
298
|
+
readonly REGISTER_WORKER: "engine::workers::register";
|
|
299
|
+
};
|
|
300
|
+
/** Engine trigger types */
|
|
301
|
+
declare const EngineTriggers: {
|
|
302
|
+
readonly FUNCTIONS_AVAILABLE: "engine::functions-available";
|
|
303
|
+
readonly LOG: "log";
|
|
304
|
+
};
|
|
305
|
+
/** Connection state for the III WebSocket */
|
|
306
|
+
type IIIConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting' | 'failed';
|
|
307
|
+
/** Configuration for WebSocket reconnection behavior */
|
|
308
|
+
interface IIIReconnectionConfig {
|
|
309
|
+
/** Starting delay in milliseconds (default: 1000ms) */
|
|
310
|
+
initialDelayMs: number;
|
|
311
|
+
/** Maximum delay cap in milliseconds (default: 30000ms) */
|
|
312
|
+
maxDelayMs: number;
|
|
313
|
+
/** Exponential backoff multiplier (default: 2) */
|
|
314
|
+
backoffMultiplier: number;
|
|
315
|
+
/** Random jitter factor 0-1 (default: 0.3) */
|
|
316
|
+
jitterFactor: number;
|
|
317
|
+
/** Maximum retry attempts, -1 for infinite (default: -1) */
|
|
318
|
+
maxRetries: number;
|
|
319
|
+
}
|
|
320
|
+
//#endregion
|
|
238
321
|
//#region src/triggers.d.ts
|
|
239
322
|
/**
|
|
240
323
|
* Configuration passed to a trigger handler when a trigger instance is
|
|
@@ -247,6 +330,12 @@ type TriggerConfig<TConfig> = {
|
|
|
247
330
|
function_id: string; /** Trigger-specific configuration. */
|
|
248
331
|
config: TConfig; /** Arbitrary user-specifiable metadata supplied to the triggered handler function on every invocation. */
|
|
249
332
|
metadata?: Record<string, unknown>;
|
|
333
|
+
/**
|
|
334
|
+
* Resolved namespace the trigger's target `function_id` uses. When the
|
|
335
|
+
* registration omitted it, the registering SDK fills this from its worker's
|
|
336
|
+
* namespace. A provider that later calls `trigger()` must pass it through.
|
|
337
|
+
*/
|
|
338
|
+
namespace?: string;
|
|
250
339
|
};
|
|
251
340
|
/**
|
|
252
341
|
* Handler interface for custom trigger types. Passed to
|
|
@@ -430,6 +519,23 @@ interface IIIClient {
|
|
|
430
519
|
* ```
|
|
431
520
|
*/
|
|
432
521
|
shutdown(): Promise<void>;
|
|
522
|
+
/**
|
|
523
|
+
* The current WebSocket connection state. `'failed'` is terminal: it follows
|
|
524
|
+
* a fatal registration rejection (see {@link getFatalError}). Mirrors the
|
|
525
|
+
* Python/Rust SDKs' `get_connection_state()`.
|
|
526
|
+
*/
|
|
527
|
+
getConnectionState(): IIIConnectionState;
|
|
528
|
+
/**
|
|
529
|
+
* Engine address this worker resolved to: the explicit `registerWorker`
|
|
530
|
+
* argument, else `III_URL`, else `ws://127.0.0.1:49134`.
|
|
531
|
+
*/
|
|
532
|
+
getAddress(): string;
|
|
533
|
+
/**
|
|
534
|
+
* The fatal registration rejection that terminated this connection, if any
|
|
535
|
+
* (e.g. a `WORKER_NAMESPACE_CONFLICT`); `undefined` while healthy. Mirrors the
|
|
536
|
+
* Python (`_fatal_error`) and Rust (`fatal_error()`) SDKs.
|
|
537
|
+
*/
|
|
538
|
+
getFatalError(): RegistrationRejectedError | undefined;
|
|
433
539
|
}
|
|
434
540
|
/**
|
|
435
541
|
* Handle returned by {@link IIIClient.registerTrigger}. Use `unregister()` to
|
|
@@ -541,5 +647,5 @@ type StreamResponse = {
|
|
|
541
647
|
*/
|
|
542
648
|
type StreamRequest<TBody = unknown> = Omit<InternalHttpRequest<TBody>, 'response'>;
|
|
543
649
|
//#endregion
|
|
544
|
-
export {
|
|
545
|
-
//# sourceMappingURL=types-
|
|
650
|
+
export { RegisterTriggerMessage as A, ChannelWriter as C, MiddlewareFunctionInput as D, MessageType as E, StreamChannelRef as M, TriggerRequest as N, RegisterFunctionFormat as O, ChannelReader as S, JsonValue as T, EngineTriggers as _, RegisterFunctionInput as a, ChannelDirection as b, RegisterTriggerTypeInput as c, StreamResponse as d, Trigger as f, EngineFunctions as g, TriggerHandler as h, InternalHttpRequest as i, RegisterTriggerTypeMessage as j, RegisterFunctionMessage as k, RemoteFunctionHandler as l, TriggerConfig as m, FunctionRef as n, RegisterFunctionOptions as o, TriggerTypeRef as p, IIIClient as r, RegisterTriggerInput as s, Channel as t, StreamRequest as u, IIIConnectionState as v, ErrorBody as w, ChannelItem as x, IIIReconnectionConfig as y };
|
|
651
|
+
//# sourceMappingURL=types-D-KH-5pT.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-D-KH-5pT.d.cts","names":[],"sources":["../src/iii-types.ts","../src/channels.ts","../src/iii-constants.ts","../src/triggers.ts","../src/types.ts"],"mappings":";;;;;;;;;AAOA;KAAY,SAAA,sCAKR,SAAA;EAAA,CACG,GAAA,WAAc,SAAA;AAAA;AAAA,aAET,WAAA;EACV,gBAAA;EACA,kBAAA;EACA,cAAA;EACA,gBAAA;EACA,mBAAA;EACA,eAAA;EACA,iBAAA;EACA,qBAAA;EACA,yBAAA;EACA,gBAAA;EACA,oBAAA;EACA,QAAA;AAAA;AAAA,KAGU,0BAAA;EACV,YAAA,EAAc,WAAA,CAAY,mBAAA,EAR1B;EAUA,EAAA,UARA;EAUA,WAAA;EARA;;;AAGF;;EAWE,SAAA;AAAA;AAAA,KAcU,SAAA;EACV,IAAA;EACA,OAAA;EACA,UAAA;AAAA;AAAA,KAWU,sBAAA;EAEI,gEAAd,YAAA,EAAc,WAAA,CAAY,eAAA,EAE1B;EAAA,EAAA,UAIA;EAFA,IAAA,UAMA;EAJA,WAAA,UAaA;EAXA,MAAA,WAqBiB;EAnBjB,QAAA,GAAW,MAAA;EAsBD;;;;;;;;EAbV,SAAA;EAiCA;;;;;AAQF;;;;EA/BE,iBAAA;AAAA;AAAA,KAGU,sBAAA;EAqDG;;;EAjDb,IAAA;EAyBc;;;EArBd,WAAA;EAiCA;;;EA7BA,IAAA;EAqCA;;;EAjCA,UAAA,GAAa,MAAA;EAqCoB;;AAUnC;EA3CE,KAAA;;;;EAIA,QAAA;EAAA,CACC,GAAA;AAAA;AAAA,KAGS,u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,OAAA,EACR,QAAA,GAAW,MAAA,oBACV,WAAA;EFlSyB;;AAQ9B;EE8RE,UAAA;AAAA;;;;;KAOU,OAAA;EF3RV,iCE6RA,MAAA,EAAQ,aAAA,EF7RE;EE+RV,MAAA,EAAQ,aAAA;EAER,SAAA,EAAW,gBAAA,EDrVD;ECuVV,SAAA,EAAW,gBAAA;AAAA;;;;;KAOD,mBAAA;EACV,WAAA,EAAa,MAAA;EACb,YAAA,EAAc,MAAA;EACd,IAAA,EAAM,KAAA;EACN,OAAA,EAAS,MAAA;EACT,MAAA;EACA,QAAA,EAAU,aAAA;EACV,YAAA,EAAc,aAAA;AAAA;;;;;;KAQJ,cAAA;EDtUyC,gCCwUnD,MAAA,GAAS,UAAA,mBDxUiD;EC0U1D,OAAA,GAAU,OAAA,EAAS,MAAA,2BD5UnB;EC8UA,MAAA,EAAQ,MAAA,CAAO,cAAA,ED9UuB;ECgVtC,KAAA;AAAA;;;;;;KAQU,aAAA,oBAAiC,IAAA,CAAK,mBAAA,CAAoB,KAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iii-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0-alpha.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"dependencies": {
|
|
75
75
|
"@opentelemetry/api": "^1.9.0",
|
|
76
76
|
"ws": "^8.18.3",
|
|
77
|
-
"@iii-dev/helpers": "0.
|
|
77
|
+
"@iii-dev/helpers": "0.23.0-alpha.2"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@opentelemetry/context-async-hooks": "^2.7.1",
|
package/dist/errors.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.cts","names":[],"sources":["../src/errors.ts"],"mappings":";;AAaA;;;;;;;;;;AAOA;;KAPY,mBAAA;EACV,IAAA;EACA,OAAA;EACA,WAAA;EACA,UAAA;AAAA;AAAA,cAGW,eAAA,SAAwB,KAAA;EAAA,SACnB,IAAA;EAAA,SACA,WAAA;EAAA,SACA,UAAA;cAEJ,IAAA,EAAM,mBAAA;AAAA;;;;;;;iBAeJ,WAAA,CAAY,KAAA,YAAiB,KAAA;EAC3C,IAAA;EACA,OAAA;EACA,UAAA;AAAA"}
|
package/dist/errors.d.mts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.mts","names":[],"sources":["../src/errors.ts"],"mappings":";;AAaA;;;;;;;;;;AAOA;;KAPY,mBAAA;EACV,IAAA;EACA,OAAA;EACA,WAAA;EACA,UAAA;AAAA;AAAA,cAGW,eAAA,SAAwB,KAAA;EAAA,SACnB,IAAA;EAAA,SACA,WAAA;EAAA,SACA,UAAA;cAEJ,IAAA,EAAM,mBAAA;AAAA;;;;;;;iBAeJ,WAAA,CAAY,KAAA,YAAiB,KAAA;EAC3C,IAAA;EACA,OAAA;EACA,UAAA;AAAA"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
//#region src/iii-constants.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Constants for the III module.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Engine function paths for internal operations.
|
|
7
|
-
*
|
|
8
|
-
* Naming note: `LIST_TRIGGERS` / `INFO_TRIGGERS` cover trigger TYPES
|
|
9
|
-
* (templates). `LIST_REGISTERED_TRIGGERS` / `INFO_REGISTERED_TRIGGERS`
|
|
10
|
-
* cover trigger INSTANCES (subscriber rows). The old
|
|
11
|
-
* `engine::trigger-types::list` builtin has been removed and is now
|
|
12
|
-
* served by `engine::triggers::list`.
|
|
13
|
-
*/
|
|
14
|
-
declare const EngineFunctions: {
|
|
15
|
-
readonly LIST_FUNCTIONS: "engine::functions::list";
|
|
16
|
-
readonly INFO_FUNCTIONS: "engine::functions::info";
|
|
17
|
-
readonly LIST_WORKERS: "engine::workers::list";
|
|
18
|
-
readonly INFO_WORKERS: "engine::workers::info";
|
|
19
|
-
readonly LIST_TRIGGERS: "engine::triggers::list";
|
|
20
|
-
readonly INFO_TRIGGERS: "engine::triggers::info";
|
|
21
|
-
readonly LIST_REGISTERED_TRIGGERS: "engine::registered-triggers::list";
|
|
22
|
-
readonly INFO_REGISTERED_TRIGGERS: "engine::registered-triggers::info";
|
|
23
|
-
readonly REGISTER_WORKER: "engine::workers::register";
|
|
24
|
-
};
|
|
25
|
-
/** Engine trigger types */
|
|
26
|
-
declare const EngineTriggers: {
|
|
27
|
-
readonly FUNCTIONS_AVAILABLE: "engine::functions-available";
|
|
28
|
-
readonly LOG: "log";
|
|
29
|
-
};
|
|
30
|
-
/** Connection state for the III WebSocket */
|
|
31
|
-
type IIIConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting' | 'failed';
|
|
32
|
-
/** Configuration for WebSocket reconnection behavior */
|
|
33
|
-
interface IIIReconnectionConfig {
|
|
34
|
-
/** Starting delay in milliseconds (default: 1000ms) */
|
|
35
|
-
initialDelayMs: number;
|
|
36
|
-
/** Maximum delay cap in milliseconds (default: 30000ms) */
|
|
37
|
-
maxDelayMs: number;
|
|
38
|
-
/** Exponential backoff multiplier (default: 2) */
|
|
39
|
-
backoffMultiplier: number;
|
|
40
|
-
/** Random jitter factor 0-1 (default: 0.3) */
|
|
41
|
-
jitterFactor: number;
|
|
42
|
-
/** Maximum retry attempts, -1 for infinite (default: -1) */
|
|
43
|
-
maxRetries: number;
|
|
44
|
-
}
|
|
45
|
-
//#endregion
|
|
46
|
-
export { IIIReconnectionConfig as i, EngineTriggers as n, IIIConnectionState as r, EngineFunctions as t };
|
|
47
|
-
//# sourceMappingURL=iii-constants-Baptl8nm.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"iii-constants-Baptl8nm.d.mts","names":[],"sources":["../src/iii-constants.ts"],"mappings":";;AAaA;;;;;;;;;;;cAAa,eAAA;EAAA;;;;;;;;;;;cAaA,cAAA;EAAA,SAGH,mBAAA;EAAA,SAAA,GAAA;AAAA;;KAWE,kBAAA;;UAQK,qBAAA;;EAEf,cAAA;;EAEA,UAAA;;EAEA,iBAAA;;EAEA,YAAA;;EAEA,UAAA;AAAA"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
//#region src/iii-constants.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Constants for the III module.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Engine function paths for internal operations.
|
|
7
|
-
*
|
|
8
|
-
* Naming note: `LIST_TRIGGERS` / `INFO_TRIGGERS` cover trigger TYPES
|
|
9
|
-
* (templates). `LIST_REGISTERED_TRIGGERS` / `INFO_REGISTERED_TRIGGERS`
|
|
10
|
-
* cover trigger INSTANCES (subscriber rows). The old
|
|
11
|
-
* `engine::trigger-types::list` builtin has been removed and is now
|
|
12
|
-
* served by `engine::triggers::list`.
|
|
13
|
-
*/
|
|
14
|
-
declare const EngineFunctions: {
|
|
15
|
-
readonly LIST_FUNCTIONS: "engine::functions::list";
|
|
16
|
-
readonly INFO_FUNCTIONS: "engine::functions::info";
|
|
17
|
-
readonly LIST_WORKERS: "engine::workers::list";
|
|
18
|
-
readonly INFO_WORKERS: "engine::workers::info";
|
|
19
|
-
readonly LIST_TRIGGERS: "engine::triggers::list";
|
|
20
|
-
readonly INFO_TRIGGERS: "engine::triggers::info";
|
|
21
|
-
readonly LIST_REGISTERED_TRIGGERS: "engine::registered-triggers::list";
|
|
22
|
-
readonly INFO_REGISTERED_TRIGGERS: "engine::registered-triggers::info";
|
|
23
|
-
readonly REGISTER_WORKER: "engine::workers::register";
|
|
24
|
-
};
|
|
25
|
-
/** Engine trigger types */
|
|
26
|
-
declare const EngineTriggers: {
|
|
27
|
-
readonly FUNCTIONS_AVAILABLE: "engine::functions-available";
|
|
28
|
-
readonly LOG: "log";
|
|
29
|
-
};
|
|
30
|
-
/** Connection state for the III WebSocket */
|
|
31
|
-
type IIIConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting' | 'failed';
|
|
32
|
-
/** Configuration for WebSocket reconnection behavior */
|
|
33
|
-
interface IIIReconnectionConfig {
|
|
34
|
-
/** Starting delay in milliseconds (default: 1000ms) */
|
|
35
|
-
initialDelayMs: number;
|
|
36
|
-
/** Maximum delay cap in milliseconds (default: 30000ms) */
|
|
37
|
-
maxDelayMs: number;
|
|
38
|
-
/** Exponential backoff multiplier (default: 2) */
|
|
39
|
-
backoffMultiplier: number;
|
|
40
|
-
/** Random jitter factor 0-1 (default: 0.3) */
|
|
41
|
-
jitterFactor: number;
|
|
42
|
-
/** Maximum retry attempts, -1 for infinite (default: -1) */
|
|
43
|
-
maxRetries: number;
|
|
44
|
-
}
|
|
45
|
-
//#endregion
|
|
46
|
-
export { IIIReconnectionConfig as i, EngineTriggers as n, IIIConnectionState as r, EngineFunctions as t };
|
|
47
|
-
//# sourceMappingURL=iii-constants-BqXp8xSN.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"iii-constants-BqXp8xSN.d.cts","names":[],"sources":["../src/iii-constants.ts"],"mappings":";;AAaA;;;;;;;;;;;cAAa,eAAA;EAAA;;;;;;;;;;;cAaA,cAAA;EAAA,SAGH,mBAAA;EAAA,SAAA,GAAA;AAAA;;KAWE,kBAAA;;UAQK,qBAAA;;EAEf,cAAA;;EAEA,UAAA;;EAEA,iBAAA;;EAEA,YAAA;;EAEA,UAAA;AAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"iii-types-BvaIabiX.cjs","names":[],"sources":["../src/iii-types.ts"],"sourcesContent":["import type { HttpInvocationConfig } from '@iii-dev/helpers/http'\n\n/**\n * Any JSON value: the TypeScript equivalent of the engine's arbitrary-JSON\n * wire values (Rust `serde_json::Value`). Used where the wire contract is\n * \"any JSON\", e.g. per-invocation `metadata`.\n */\nexport type JsonValue =\n | string\n | number\n | boolean\n | null\n | JsonValue[]\n | { [key: string]: JsonValue }\n\nexport enum MessageType {\n RegisterFunction = 'registerfunction',\n UnregisterFunction = 'unregisterfunction',\n InvokeFunction = 'invokefunction',\n InvocationResult = 'invocationresult',\n RegisterTriggerType = 'registertriggertype',\n RegisterTrigger = 'registertrigger',\n UnregisterTrigger = 'unregistertrigger',\n UnregisterTriggerType = 'unregistertriggertype',\n TriggerRegistrationResult = 'triggerregistrationresult',\n WorkerRegistered = 'workerregistered',\n Reattach = 'reattach',\n}\n\nexport type RegisterTriggerTypeMessage = {\n message_type: MessageType.RegisterTriggerType\n /** Unique identifier for the trigger type (e.g. `state`, `durable:subscriber`). */\n id: string\n /** Human-readable description of what this trigger type does. */\n description: string\n}\n\nexport type UnregisterTriggerTypeMessage = {\n message_type: MessageType.UnregisterTriggerType\n id: string\n}\n\nexport type UnregisterTriggerMessage = {\n message_type: MessageType.UnregisterTrigger\n id: string\n type?: string\n}\n\nexport type ErrorBody = {\n code: string\n message: string\n stacktrace?: string\n}\n\nexport type TriggerRegistrationResultMessage = {\n message_type: MessageType.TriggerRegistrationResult\n id: string\n type: string\n function_id: string\n error?: ErrorBody\n}\n\nexport type RegisterTriggerMessage = {\n /** Wire discriminator; always `MessageType.RegisterTrigger`. */\n message_type: MessageType.RegisterTrigger\n /** Unique trigger identifier, generated by the SDK during registration. */\n id: string\n /** Identifier of the registered trigger type this trigger uses (e.g. `storage::object-created`, `http`). */\n type: string\n /** ID of the function this trigger invokes when it fires. */\n function_id: string\n /** Trigger-type-specific configuration, matching the shape the trigger type expects. */\n config: unknown\n /** Arbitrary user-specifiable metadata supplied to the triggered handler function on every invocation. */\n metadata?: Record<string, unknown>\n}\n\nexport type RegisterFunctionFormat = {\n /**\n * The name of the parameter.\n */\n name?: string\n /**\n * The description of the parameter.\n */\n description?: string\n /**\n * The type of the parameter.\n */\n type?: 'string' | 'number' | 'boolean' | 'object' | 'array' | 'null' | 'map' | 'integer'\n /**\n * The body of the parameter (for objects).\n */\n properties?: Record<string, unknown>\n /**\n * The items of the parameter (for arrays).\n */\n items?: unknown\n /**\n * Whether the parameter is required.\n */\n required?: string[]\n [key: string]: unknown\n}\n\nexport type RegisterFunctionMessage = {\n message_type: MessageType.RegisterFunction\n /**\n * The path of the function (use :: for namespacing, e.g. external::my_lambda).\n */\n id: string\n /**\n * The description of the function.\n */\n description?: string\n /**\n * The request format of the function.\n */\n request_format?: RegisterFunctionFormat\n /**\n * The response format of the function.\n */\n response_format?: RegisterFunctionFormat\n /**\n * Arbitrary metadata attached to the function.\n */\n metadata?: Record<string, unknown>\n /**\n * HTTP invocation config for external HTTP functions (Lambda, Cloudflare Workers, etc.).\n */\n invocation?: HttpInvocationConfig\n}\n\n/**\n * Routing action for {@link TriggerRequest}. Determines how the engine\n * handles the invocation.\n *\n * - `enqueue`: Routes through a named queue for async processing.\n * - `void`: Fire-and-forget, no response.\n */\nexport type TriggerAction = { type: 'enqueue'; queue: string } | { type: 'void' }\n\n/**\n * Input passed to the RBAC middleware function on every function invocation\n * through the RBAC port. The middleware can inspect, modify, or reject the\n * call before it reaches the target function.\n */\nexport type MiddlewareFunctionInput = {\n /** ID of the function being invoked. */\n function_id: string\n /** Payload sent by the caller. */\n payload: Record<string, unknown>\n /** Routing action, if any. */\n action?: TriggerAction\n /** Auth context returned by the auth function for this session. */\n context: Record<string, unknown>\n}\n\n/**\n * Request object passed to {@link IIIClient.trigger}.\n *\n * @typeParam TInput - Type of the payload.\n */\nexport type TriggerRequest<TInput = unknown> = {\n /** ID of the function to invoke. */\n function_id: string\n /** Input data passed to the function. */\n payload: TInput\n /** Sets how the trigger is routed. Omit for a synchronous request/response. Specify for a specific routing scheme (e.g. `TriggerAction.Enqueue()`, `TriggerAction.Void()`). */\n action?: TriggerAction\n /** Override the default invocation timeout, in milliseconds. */\n timeoutMs?: number\n /** Arbitrary user-specifiable metadata supplied to the triggered handler function on every invocation. */\n metadata?: unknown\n}\n\nexport type InvokeFunctionMessage = {\n message_type: MessageType.InvokeFunction\n /**\n * This is optional for async invocations\n */\n invocation_id?: string\n /**\n * The path of the function.\n */\n function_id: string\n /**\n * The data to pass to the function\n */\n data: unknown\n /**\n * W3C trace-context traceparent header for distributed tracing\n */\n traceparent?: string\n /**\n * W3C baggage header for cross-cutting context propagation\n */\n baggage?: string\n /**\n * Trigger action for queue routing or fire-and-forget\n */\n action?: TriggerAction\n /**\n * Optional per-invocation metadata (arbitrary JSON). Travels as a separate\n * channel from `data`. Omitted from the JSON when undefined; absence on\n * inbound means \"no metadata\" (backward compatible with older engines).\n */\n metadata?: JsonValue\n}\n\nexport type InvocationResultMessage = {\n message_type: MessageType.InvocationResult\n /**\n * The id of the invocation\n */\n invocation_id: string\n /**\n * The path of the function.\n */\n function_id: string\n result?: unknown\n error?: unknown\n /**\n * W3C trace-context traceparent header for distributed tracing\n */\n traceparent?: string\n /**\n * W3C baggage header for cross-cutting context propagation\n */\n baggage?: string\n}\n\nexport type WorkerRegisteredMessage = {\n message_type: MessageType.WorkerRegistered\n worker_id: string\n /** Secret to present in a reattach frame on reconnect; absent on older engines. */\n reattach_token?: string\n}\n\nexport type UnregisterFunctionMessage = {\n message_type: MessageType.UnregisterFunction\n id: string\n}\n\n/**\n * Serializable reference to one end of a streaming channel. Can be included\n * in invocation payloads to pass channel endpoints between workers.\n */\nexport type StreamChannelRef = {\n /** Unique channel identifier. */\n channel_id: string\n /** Access key for authentication. */\n access_key: string\n /** Whether this ref is for reading or writing. */\n direction: 'read' | 'write'\n}\n\nexport type IIIMessage =\n | RegisterFunctionMessage\n | UnregisterFunctionMessage\n | InvokeFunctionMessage\n | InvocationResultMessage\n | RegisterTriggerMessage\n | RegisterTriggerTypeMessage\n | UnregisterTriggerMessage\n | UnregisterTriggerTypeMessage\n | TriggerRegistrationResultMessage\n | WorkerRegisteredMessage\n"],"mappings":";;AAeA,IAAY,cAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;KACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"iii-types-wPYrg7hX.mjs","names":[],"sources":["../src/iii-types.ts"],"sourcesContent":["import type { HttpInvocationConfig } from '@iii-dev/helpers/http'\n\n/**\n * Any JSON value: the TypeScript equivalent of the engine's arbitrary-JSON\n * wire values (Rust `serde_json::Value`). Used where the wire contract is\n * \"any JSON\", e.g. per-invocation `metadata`.\n */\nexport type JsonValue =\n | string\n | number\n | boolean\n | null\n | JsonValue[]\n | { [key: string]: JsonValue }\n\nexport enum MessageType {\n RegisterFunction = 'registerfunction',\n UnregisterFunction = 'unregisterfunction',\n InvokeFunction = 'invokefunction',\n InvocationResult = 'invocationresult',\n RegisterTriggerType = 'registertriggertype',\n RegisterTrigger = 'registertrigger',\n UnregisterTrigger = 'unregistertrigger',\n UnregisterTriggerType = 'unregistertriggertype',\n TriggerRegistrationResult = 'triggerregistrationresult',\n WorkerRegistered = 'workerregistered',\n Reattach = 'reattach',\n}\n\nexport type RegisterTriggerTypeMessage = {\n message_type: MessageType.RegisterTriggerType\n /** Unique identifier for the trigger type (e.g. `state`, `durable:subscriber`). */\n id: string\n /** Human-readable description of what this trigger type does. */\n description: string\n}\n\nexport type UnregisterTriggerTypeMessage = {\n message_type: MessageType.UnregisterTriggerType\n id: string\n}\n\nexport type UnregisterTriggerMessage = {\n message_type: MessageType.UnregisterTrigger\n id: string\n type?: string\n}\n\nexport type ErrorBody = {\n code: string\n message: string\n stacktrace?: string\n}\n\nexport type TriggerRegistrationResultMessage = {\n message_type: MessageType.TriggerRegistrationResult\n id: string\n type: string\n function_id: string\n error?: ErrorBody\n}\n\nexport type RegisterTriggerMessage = {\n /** Wire discriminator; always `MessageType.RegisterTrigger`. */\n message_type: MessageType.RegisterTrigger\n /** Unique trigger identifier, generated by the SDK during registration. */\n id: string\n /** Identifier of the registered trigger type this trigger uses (e.g. `storage::object-created`, `http`). */\n type: string\n /** ID of the function this trigger invokes when it fires. */\n function_id: string\n /** Trigger-type-specific configuration, matching the shape the trigger type expects. */\n config: unknown\n /** Arbitrary user-specifiable metadata supplied to the triggered handler function on every invocation. */\n metadata?: Record<string, unknown>\n}\n\nexport type RegisterFunctionFormat = {\n /**\n * The name of the parameter.\n */\n name?: string\n /**\n * The description of the parameter.\n */\n description?: string\n /**\n * The type of the parameter.\n */\n type?: 'string' | 'number' | 'boolean' | 'object' | 'array' | 'null' | 'map' | 'integer'\n /**\n * The body of the parameter (for objects).\n */\n properties?: Record<string, unknown>\n /**\n * The items of the parameter (for arrays).\n */\n items?: unknown\n /**\n * Whether the parameter is required.\n */\n required?: string[]\n [key: string]: unknown\n}\n\nexport type RegisterFunctionMessage = {\n message_type: MessageType.RegisterFunction\n /**\n * The path of the function (use :: for namespacing, e.g. external::my_lambda).\n */\n id: string\n /**\n * The description of the function.\n */\n description?: string\n /**\n * The request format of the function.\n */\n request_format?: RegisterFunctionFormat\n /**\n * The response format of the function.\n */\n response_format?: RegisterFunctionFormat\n /**\n * Arbitrary metadata attached to the function.\n */\n metadata?: Record<string, unknown>\n /**\n * HTTP invocation config for external HTTP functions (Lambda, Cloudflare Workers, etc.).\n */\n invocation?: HttpInvocationConfig\n}\n\n/**\n * Routing action for {@link TriggerRequest}. Determines how the engine\n * handles the invocation.\n *\n * - `enqueue`: Routes through a named queue for async processing.\n * - `void`: Fire-and-forget, no response.\n */\nexport type TriggerAction = { type: 'enqueue'; queue: string } | { type: 'void' }\n\n/**\n * Input passed to the RBAC middleware function on every function invocation\n * through the RBAC port. The middleware can inspect, modify, or reject the\n * call before it reaches the target function.\n */\nexport type MiddlewareFunctionInput = {\n /** ID of the function being invoked. */\n function_id: string\n /** Payload sent by the caller. */\n payload: Record<string, unknown>\n /** Routing action, if any. */\n action?: TriggerAction\n /** Auth context returned by the auth function for this session. */\n context: Record<string, unknown>\n}\n\n/**\n * Request object passed to {@link IIIClient.trigger}.\n *\n * @typeParam TInput - Type of the payload.\n */\nexport type TriggerRequest<TInput = unknown> = {\n /** ID of the function to invoke. */\n function_id: string\n /** Input data passed to the function. */\n payload: TInput\n /** Sets how the trigger is routed. Omit for a synchronous request/response. Specify for a specific routing scheme (e.g. `TriggerAction.Enqueue()`, `TriggerAction.Void()`). */\n action?: TriggerAction\n /** Override the default invocation timeout, in milliseconds. */\n timeoutMs?: number\n /** Arbitrary user-specifiable metadata supplied to the triggered handler function on every invocation. */\n metadata?: unknown\n}\n\nexport type InvokeFunctionMessage = {\n message_type: MessageType.InvokeFunction\n /**\n * This is optional for async invocations\n */\n invocation_id?: string\n /**\n * The path of the function.\n */\n function_id: string\n /**\n * The data to pass to the function\n */\n data: unknown\n /**\n * W3C trace-context traceparent header for distributed tracing\n */\n traceparent?: string\n /**\n * W3C baggage header for cross-cutting context propagation\n */\n baggage?: string\n /**\n * Trigger action for queue routing or fire-and-forget\n */\n action?: TriggerAction\n /**\n * Optional per-invocation metadata (arbitrary JSON). Travels as a separate\n * channel from `data`. Omitted from the JSON when undefined; absence on\n * inbound means \"no metadata\" (backward compatible with older engines).\n */\n metadata?: JsonValue\n}\n\nexport type InvocationResultMessage = {\n message_type: MessageType.InvocationResult\n /**\n * The id of the invocation\n */\n invocation_id: string\n /**\n * The path of the function.\n */\n function_id: string\n result?: unknown\n error?: unknown\n /**\n * W3C trace-context traceparent header for distributed tracing\n */\n traceparent?: string\n /**\n * W3C baggage header for cross-cutting context propagation\n */\n baggage?: string\n}\n\nexport type WorkerRegisteredMessage = {\n message_type: MessageType.WorkerRegistered\n worker_id: string\n /** Secret to present in a reattach frame on reconnect; absent on older engines. */\n reattach_token?: string\n}\n\nexport type UnregisterFunctionMessage = {\n message_type: MessageType.UnregisterFunction\n id: string\n}\n\n/**\n * Serializable reference to one end of a streaming channel. Can be included\n * in invocation payloads to pass channel endpoints between workers.\n */\nexport type StreamChannelRef = {\n /** Unique channel identifier. */\n channel_id: string\n /** Access key for authentication. */\n access_key: string\n /** Whether this ref is for reading or writing. */\n direction: 'read' | 'write'\n}\n\nexport type IIIMessage =\n | RegisterFunctionMessage\n | UnregisterFunctionMessage\n | InvokeFunctionMessage\n | InvocationResultMessage\n | RegisterTriggerMessage\n | RegisterTriggerTypeMessage\n | UnregisterTriggerMessage\n | UnregisterTriggerTypeMessage\n | TriggerRegistrationResultMessage\n | WorkerRegisteredMessage\n"],"mappings":";AAeA,IAAY,cAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;KACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types-BD2fp4Py.d.mts","names":[],"sources":["../src/iii-types.ts","../src/channels.ts","../src/triggers.ts","../src/types.ts"],"mappings":";;;;;;;AAOA;;KAAY,SAAA,sCAKR,SAAA;EAAA,CACG,GAAA,WAAc,SAAA;AAAA;AAAA,aAET,WAAA;EACV,gBAAA;EACA,kBAAA;EACA,cAAA;EACA,gBAAA;EACA,mBAAA;EACA,eAAA;EACA,iBAAA;EACA,qBAAA;EACA,yBAAA;EACA,gBAAA;EACA,QAAA;AAAA;AAAA,KAGU,0BAAA;EACV,YAAA,EAAc,WAAA,CAAY,mBAAA,EAP1B;EASA,EAAA,UAPA;EASA,WAAA;AAAA;AAAA,KAcU,SAAA;EACV,IAAA;EACA,OAAA;EACA,UAAA;AAAA;AAAA,KAWU,sBAAA;EAAsB,gEAEhC,YAAA,EAAc,WAAA,CAAY,eAAA,EAUT;EARjB,EAAA,UAFc;EAId,IAAA,UAFA;EAIA,WAAA;EAEA,MAAA,WAEA;EAAA,QAAA,GAAW,MAAA;AAAA;AAAA,KAGD,sBAAA;EAAA;;;EAIV,IAAA;EAAA;;;EAIA,WAAA;EAQa;;;EAJb,IAAA;EAaY;;AAGd;EAZE,UAAA,GAAa,MAAA;;;;EAIb,KAAA;EA6BW;;;EAzBX,QAAA;EAAA,CACC,GAAA;AAAA;AAAA,KAGS,uBAAA;EACV,YAAA,EAAc,WAAA,CAAY,gBAAA;EAQ1B;;;EAJA,EAAA;EAYkB;;;EARlB,WAAA;EAgBa;;;EAZb,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,2BAhUR;EAkUX,MAAA,EAAQ,MAAA,CAAO,cAAA,EAjUZ;EAmUH,KAAA;AAAA;;AAtRF;;;;KA8RY,aAAA,oBAAiC,IAAA,CAAK,mBAAA,CAAoB,KAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types-n-760A15.d.cts","names":[],"sources":["../src/iii-types.ts","../src/channels.ts","../src/triggers.ts","../src/types.ts"],"mappings":";;;;;;;AAOA;;KAAY,SAAA,sCAKR,SAAA;EAAA,CACG,GAAA,WAAc,SAAA;AAAA;AAAA,aAET,WAAA;EACV,gBAAA;EACA,kBAAA;EACA,cAAA;EACA,gBAAA;EACA,mBAAA;EACA,eAAA;EACA,iBAAA;EACA,qBAAA;EACA,yBAAA;EACA,gBAAA;EACA,QAAA;AAAA;AAAA,KAGU,0BAAA;EACV,YAAA,EAAc,WAAA,CAAY,mBAAA,EAP1B;EASA,EAAA,UAPA;EASA,WAAA;AAAA;AAAA,KAcU,SAAA;EACV,IAAA;EACA,OAAA;EACA,UAAA;AAAA;AAAA,KAWU,sBAAA;EAAsB,gEAEhC,YAAA,EAAc,WAAA,CAAY,eAAA,EAUT;EARjB,EAAA,UAFc;EAId,IAAA,UAFA;EAIA,WAAA;EAEA,MAAA,WAEA;EAAA,QAAA,GAAW,MAAA;AAAA;AAAA,KAGD,sBAAA;EAAA;;;EAIV,IAAA;EAAA;;;EAIA,WAAA;EAQa;;;EAJb,IAAA;EAaY;;AAGd;EAZE,UAAA,GAAa,MAAA;;;;EAIb,KAAA;EA6BW;;;EAzBX,QAAA;EAAA,CACC,GAAA;AAAA;AAAA,KAGS,uBAAA;EACV,YAAA,EAAc,WAAA,CAAY,gBAAA;EAQ1B;;;EAJA,EAAA;EAYkB;;;EARlB,WAAA;EAgBa;;;EAZb,cAAA,GAAiB,sBAAA;EAsBM;;;EAlBvB,eAAA,GAAkB,sBAAA;EAkB2B;;;EAd7C,QAAA,GAAW,MAAA;EAqBD;;;EAjBV,UAAA,G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