iii-browser-sdk 0.24.6 → 0.25.0-rc.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/README.md +111 -11
- package/dist/helpers.cjs +1 -1
- package/dist/helpers.d.cts +1 -1
- package/dist/helpers.d.mts +1 -1
- package/dist/helpers.mjs +1 -1
- package/dist/index.cjs +2781 -96
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -4
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +18 -4
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2780 -97
- package/dist/index.mjs.map +1 -1
- package/dist/{types-DeNafz-M.d.mts → types-BGYN2Z4E.d.cts} +494 -6
- package/dist/types-BGYN2Z4E.d.cts.map +1 -0
- package/dist/{types-fqr5SRfu.d.cts → types-Crw4auK5.d.mts} +494 -6
- package/dist/types-Crw4auK5.d.mts.map +1 -0
- package/dist/{utils-CJV1pMqe.cjs → utils-BUI0XQTZ.cjs} +39 -4
- package/dist/{utils-CJV1pMqe.cjs.map → utils-BUI0XQTZ.cjs.map} +1 -1
- package/dist/{utils-nQQPFFRM.mjs → utils-Bz5eP_hN.mjs} +28 -5
- package/dist/{utils-nQQPFFRM.mjs.map → utils-Bz5eP_hN.mjs.map} +1 -1
- package/package.json +1 -1
- package/dist/types-DeNafz-M.d.mts.map +0 -1
- package/dist/types-fqr5SRfu.d.cts.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as OnTriggerTypeRegistrationInput, A as EngineFunctions, C as ObserveSource, D as ObserverOptions, E as ObserverHandle, F as InvocationErrorInit, G as EnqueueResult, H as ChannelWriter, I as ObserveRejection, J as ObserveDescriptorWire, K as MessageType, L as RegistrationRejectedError, M as IIIConnectionState, N as IIIReconnectionConfig, O as ObserverState, P as InvocationError, Q as OnTriggerRegistrationResult, R as RegistrationRejectedInit, S as ObserveReason, T as Observer, U as AuthInput, V as ChannelReader, W as AuthResult, X as OnFunctionRegistrationResult, Y as OnFunctionRegistrationInput, Z as OnTriggerRegistrationInput, _ as Capture, a as ISdk, at as RegisterTriggerTypeMessage, b as ObserveDoc, c as RegisterTriggerInput, d as Trigger, et as OnTriggerTypeRegistrationResult, f as TriggerTypeRef, g as CallerInfo, h as Caller, i as FunctionRef, it as RegisterTriggerMessage, j as EngineTriggers, k as Target, l as RegisterTriggerTypeInput, m as TriggerHandler, n as ApiResponse, nt as RegisterFunctionFormat, o as RegisterFunctionInput, ot as StreamChannelRef, p as TriggerConfig, q as MiddlewareFunctionInput, r as Channel, rt as RegisterFunctionMessage, s as RegisterFunctionOptions, st as TriggerRequest, t as ApiRequest, tt as OpenEnum, u as RemoteFunctionHandler, v as Filter, w as Observed, x as ObserveHooks, y as InvocationContext } from "./types-BGYN2Z4E.cjs";
|
|
2
2
|
|
|
3
|
+
//#region src/reporter.d.ts
|
|
4
|
+
type ReporterLimits = {
|
|
5
|
+
/** Flush at this many items (default 256). */batchItems: number; /** Flush this long after the first buffered item (default 5 ms). */
|
|
6
|
+
lingerMs: number; /** Bounded buffer: items (default 10 000). */
|
|
7
|
+
maxItems: number; /** Bounded buffer: bytes (default 8 MiB); an item larger than this is `TOO_LARGE`. */
|
|
8
|
+
maxBytes: number; /** One frame's limit (default 16 MiB, the engine's). */
|
|
9
|
+
maxFrameBytes: number; /** `localinvocationstats` cadence (default 10 s). */
|
|
10
|
+
statsIntervalMs: number;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
3
13
|
//#region src/iii.d.ts
|
|
4
14
|
/**
|
|
5
15
|
* Configuration options passed to {@link registerWorker}.
|
|
@@ -24,7 +34,7 @@ type InitOptions = {
|
|
|
24
34
|
* Namespace this worker registers under. When omitted the engine applies its
|
|
25
35
|
* `default` namespace. Scopes worker and function registrations so
|
|
26
36
|
* identically-named entries can coexist across namespaces. The browser has no
|
|
27
|
-
* `process.env`, so there is no environment-variable fallback
|
|
37
|
+
* `process.env`, so there is no environment-variable fallback: pass the
|
|
28
38
|
* option explicitly.
|
|
29
39
|
*/
|
|
30
40
|
namespace?: string; /** Default timeout for `worker.trigger()` invocations in milliseconds. Defaults to `30000`. */
|
|
@@ -35,7 +45,11 @@ type InitOptions = {
|
|
|
35
45
|
* @see {@link IIIReconnectionConfig} for available fields and defaults.
|
|
36
46
|
*/
|
|
37
47
|
reconnectionConfig?: Partial<IIIReconnectionConfig>; /** Browser WebSocket connections authenticate via query parameters or cookies; the `headers` option is ignored. */
|
|
38
|
-
headers?: Record<string, string>;
|
|
48
|
+
headers?: Record<string, string>; /** @internal Test knobs for the observe hooks and the reporter. */
|
|
49
|
+
observe?: {
|
|
50
|
+
hookTimeoutMs?: number;
|
|
51
|
+
reporter?: Partial<ReporterLimits>;
|
|
52
|
+
};
|
|
39
53
|
};
|
|
40
54
|
/**
|
|
41
55
|
* Factory object that constructs routing actions for {@link ISdk.trigger}.
|
|
@@ -99,5 +113,5 @@ declare const TriggerAction: {
|
|
|
99
113
|
*/
|
|
100
114
|
declare const registerWorker: (address: string, options?: InitOptions) => ISdk;
|
|
101
115
|
//#endregion
|
|
102
|
-
export { type ApiRequest, type ApiResponse, type AuthInput, type AuthResult, type Channel, ChannelReader, ChannelWriter, EngineFunctions, EngineTriggers, type EnqueueResult, type FunctionRef, type IIIConnectionState, type IIIReconnectionConfig, type ISdk, type InitOptions, type MessageType, type MiddlewareFunctionInput, type OnFunctionRegistrationInput, type OnFunctionRegistrationResult, type OnTriggerRegistrationInput, type OnTriggerRegistrationResult, type OnTriggerTypeRegistrationInput, type OnTriggerTypeRegistrationResult, type RegisterFunctionFormat, type RegisterFunctionInput, type RegisterFunctionMessage, type RegisterFunctionOptions, type RegisterTriggerInput, type RegisterTriggerMessage, type RegisterTriggerTypeInput, type RegisterTriggerTypeMessage, RegistrationRejectedError, type RegistrationRejectedInit, type RemoteFunctionHandler, type StreamChannelRef, type Trigger, TriggerAction, type TriggerConfig, type TriggerHandler, type TriggerRequest, type TriggerTypeRef, registerWorker };
|
|
116
|
+
export { type ApiRequest, type ApiResponse, type AuthInput, type AuthResult, type Caller, type CallerInfo, type Capture, type Channel, ChannelReader, ChannelWriter, EngineFunctions, EngineTriggers, type EnqueueResult, type Filter, type FunctionRef, type IIIConnectionState, type IIIReconnectionConfig, type ISdk, type InitOptions, type InvocationContext, InvocationError, type InvocationErrorInit, type MessageType, type MiddlewareFunctionInput, type ObserveDescriptorWire, type ObserveDoc, type ObserveHooks, type ObserveReason, ObserveRejection, type ObserveSource, type Observed, type Observer, type ObserverHandle, type ObserverOptions, type ObserverState, type OnFunctionRegistrationInput, type OnFunctionRegistrationResult, type OnTriggerRegistrationInput, type OnTriggerRegistrationResult, type OnTriggerTypeRegistrationInput, type OnTriggerTypeRegistrationResult, type OpenEnum, type RegisterFunctionFormat, type RegisterFunctionInput, type RegisterFunctionMessage, type RegisterFunctionOptions, type RegisterTriggerInput, type RegisterTriggerMessage, type RegisterTriggerTypeInput, type RegisterTriggerTypeMessage, RegistrationRejectedError, type RegistrationRejectedInit, type RemoteFunctionHandler, type StreamChannelRef, type Target, type Trigger, TriggerAction, type TriggerConfig, type TriggerHandler, type TriggerRequest, type TriggerTypeRef, registerWorker };
|
|
103
117
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/iii.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/reporter.ts","../src/iii.ts"],"mappings":";;;KA8CY,cAAA;ECiF0B,8CD/EpC,UAAA,UC+EuD;ED7EvD,QAAA,UC6EqE;ED3ErE,QAAA,UCkvDQ;EDhvDR,QAAA,UCgvDQ;ED9uDR,aAAA,UCwuDkB;EDtuDlB,eAAA;AAAA;;;;;;;;;;;;AC0CF;;KAAY,WAAA;EAuBmB;;;;;;EAhB7B,UAAA;EAAA;;;;;;;EAQA,SAAA,WAYA;EAVA,mBAAA;EAUoC;;;;;EAJpC,kBAAA,GAAqB,OAAA,CAAQ,qBAAA,GA2qDrB;EAzqDR,OAAA,GAAU,MAAA,kBAyqDF;EAvqDR,OAAA;IAAY,aAAA;IAAwB,QAAA,GAAW,OAAA,CAAQ,cAAA;EAAA;AAAA;;;;;AAwrDzD;;;;;;;;;;;;;;;;;;cAhCa,aAAA;;;;;;;;;;IASO,KAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;cAuBP,cAAA,GAAkB,OAAA,UAAiB,OAAA,GAAU,WAAA,KAAc,IAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as OnTriggerTypeRegistrationInput, A as EngineFunctions, C as ObserveSource, D as ObserverOptions, E as ObserverHandle, F as InvocationErrorInit, G as EnqueueResult, H as ChannelWriter, I as ObserveRejection, J as ObserveDescriptorWire, K as MessageType, L as RegistrationRejectedError, M as IIIConnectionState, N as IIIReconnectionConfig, O as ObserverState, P as InvocationError, Q as OnTriggerRegistrationResult, R as RegistrationRejectedInit, S as ObserveReason, T as Observer, U as AuthInput, V as ChannelReader, W as AuthResult, X as OnFunctionRegistrationResult, Y as OnFunctionRegistrationInput, Z as OnTriggerRegistrationInput, _ as Capture, a as ISdk, at as RegisterTriggerTypeMessage, b as ObserveDoc, c as RegisterTriggerInput, d as Trigger, et as OnTriggerTypeRegistrationResult, f as TriggerTypeRef, g as CallerInfo, h as Caller, i as FunctionRef, it as RegisterTriggerMessage, j as EngineTriggers, k as Target, l as RegisterTriggerTypeInput, m as TriggerHandler, n as ApiResponse, nt as RegisterFunctionFormat, o as RegisterFunctionInput, ot as StreamChannelRef, p as TriggerConfig, q as MiddlewareFunctionInput, r as Channel, rt as RegisterFunctionMessage, s as RegisterFunctionOptions, st as TriggerRequest, t as ApiRequest, tt as OpenEnum, u as RemoteFunctionHandler, v as Filter, w as Observed, x as ObserveHooks, y as InvocationContext } from "./types-Crw4auK5.mjs";
|
|
2
2
|
|
|
3
|
+
//#region src/reporter.d.ts
|
|
4
|
+
type ReporterLimits = {
|
|
5
|
+
/** Flush at this many items (default 256). */batchItems: number; /** Flush this long after the first buffered item (default 5 ms). */
|
|
6
|
+
lingerMs: number; /** Bounded buffer: items (default 10 000). */
|
|
7
|
+
maxItems: number; /** Bounded buffer: bytes (default 8 MiB); an item larger than this is `TOO_LARGE`. */
|
|
8
|
+
maxBytes: number; /** One frame's limit (default 16 MiB, the engine's). */
|
|
9
|
+
maxFrameBytes: number; /** `localinvocationstats` cadence (default 10 s). */
|
|
10
|
+
statsIntervalMs: number;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
3
13
|
//#region src/iii.d.ts
|
|
4
14
|
/**
|
|
5
15
|
* Configuration options passed to {@link registerWorker}.
|
|
@@ -24,7 +34,7 @@ type InitOptions = {
|
|
|
24
34
|
* Namespace this worker registers under. When omitted the engine applies its
|
|
25
35
|
* `default` namespace. Scopes worker and function registrations so
|
|
26
36
|
* identically-named entries can coexist across namespaces. The browser has no
|
|
27
|
-
* `process.env`, so there is no environment-variable fallback
|
|
37
|
+
* `process.env`, so there is no environment-variable fallback: pass the
|
|
28
38
|
* option explicitly.
|
|
29
39
|
*/
|
|
30
40
|
namespace?: string; /** Default timeout for `worker.trigger()` invocations in milliseconds. Defaults to `30000`. */
|
|
@@ -35,7 +45,11 @@ type InitOptions = {
|
|
|
35
45
|
* @see {@link IIIReconnectionConfig} for available fields and defaults.
|
|
36
46
|
*/
|
|
37
47
|
reconnectionConfig?: Partial<IIIReconnectionConfig>; /** Browser WebSocket connections authenticate via query parameters or cookies; the `headers` option is ignored. */
|
|
38
|
-
headers?: Record<string, string>;
|
|
48
|
+
headers?: Record<string, string>; /** @internal Test knobs for the observe hooks and the reporter. */
|
|
49
|
+
observe?: {
|
|
50
|
+
hookTimeoutMs?: number;
|
|
51
|
+
reporter?: Partial<ReporterLimits>;
|
|
52
|
+
};
|
|
39
53
|
};
|
|
40
54
|
/**
|
|
41
55
|
* Factory object that constructs routing actions for {@link ISdk.trigger}.
|
|
@@ -99,5 +113,5 @@ declare const TriggerAction: {
|
|
|
99
113
|
*/
|
|
100
114
|
declare const registerWorker: (address: string, options?: InitOptions) => ISdk;
|
|
101
115
|
//#endregion
|
|
102
|
-
export { type ApiRequest, type ApiResponse, type AuthInput, type AuthResult, type Channel, ChannelReader, ChannelWriter, EngineFunctions, EngineTriggers, type EnqueueResult, type FunctionRef, type IIIConnectionState, type IIIReconnectionConfig, type ISdk, type InitOptions, type MessageType, type MiddlewareFunctionInput, type OnFunctionRegistrationInput, type OnFunctionRegistrationResult, type OnTriggerRegistrationInput, type OnTriggerRegistrationResult, type OnTriggerTypeRegistrationInput, type OnTriggerTypeRegistrationResult, type RegisterFunctionFormat, type RegisterFunctionInput, type RegisterFunctionMessage, type RegisterFunctionOptions, type RegisterTriggerInput, type RegisterTriggerMessage, type RegisterTriggerTypeInput, type RegisterTriggerTypeMessage, RegistrationRejectedError, type RegistrationRejectedInit, type RemoteFunctionHandler, type StreamChannelRef, type Trigger, TriggerAction, type TriggerConfig, type TriggerHandler, type TriggerRequest, type TriggerTypeRef, registerWorker };
|
|
116
|
+
export { type ApiRequest, type ApiResponse, type AuthInput, type AuthResult, type Caller, type CallerInfo, type Capture, type Channel, ChannelReader, ChannelWriter, EngineFunctions, EngineTriggers, type EnqueueResult, type Filter, type FunctionRef, type IIIConnectionState, type IIIReconnectionConfig, type ISdk, type InitOptions, type InvocationContext, InvocationError, type InvocationErrorInit, type MessageType, type MiddlewareFunctionInput, type ObserveDescriptorWire, type ObserveDoc, type ObserveHooks, type ObserveReason, ObserveRejection, type ObserveSource, type Observed, type Observer, type ObserverHandle, type ObserverOptions, type ObserverState, type OnFunctionRegistrationInput, type OnFunctionRegistrationResult, type OnTriggerRegistrationInput, type OnTriggerRegistrationResult, type OnTriggerTypeRegistrationInput, type OnTriggerTypeRegistrationResult, type OpenEnum, type RegisterFunctionFormat, type RegisterFunctionInput, type RegisterFunctionMessage, type RegisterFunctionOptions, type RegisterTriggerInput, type RegisterTriggerMessage, type RegisterTriggerTypeInput, type RegisterTriggerTypeMessage, RegistrationRejectedError, type RegistrationRejectedInit, type RemoteFunctionHandler, type StreamChannelRef, type Target, type Trigger, TriggerAction, type TriggerConfig, type TriggerHandler, type TriggerRequest, type TriggerTypeRef, registerWorker };
|
|
103
117
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/iii.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/reporter.ts","../src/iii.ts"],"mappings":";;;KA8CY,cAAA;ECiF0B,8CD/EpC,UAAA,UC+EuD;ED7EvD,QAAA,UC6EqE;ED3ErE,QAAA,UCkvDQ;EDhvDR,QAAA,UCgvDQ;ED9uDR,aAAA,UCwuDkB;EDtuDlB,eAAA;AAAA;;;;;;;;;;;;AC0CF;;KAAY,WAAA;EAuBmB;;;;;;EAhB7B,UAAA;EAAA;;;;;;;EAQA,SAAA,WAYA;EAVA,mBAAA;EAUoC;;;;;EAJpC,kBAAA,GAAqB,OAAA,CAAQ,qBAAA,GA2qDrB;EAzqDR,OAAA,GAAU,MAAA,kBAyqDF;EAvqDR,OAAA;IAAY,aAAA;IAAwB,QAAA,GAAW,OAAA,CAAQ,cAAA;EAAA;AAAA;;;;;AAwrDzD;;;;;;;;;;;;;;;;;;cAhCa,aAAA;;;;;;;;;;IASO,KAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;cAuBP,cAAA,GAAkB,OAAA,UAAiB,OAAA,GAAU,WAAA,KAAc,IAAA"}
|