iii-browser-sdk 0.25.0 → 0.26.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 +186 -49
- package/dist/helpers.cjs +1 -5
- package/dist/helpers.cjs.map +1 -1
- package/dist/helpers.d.cts +1 -5
- package/dist/helpers.d.cts.map +1 -1
- package/dist/helpers.d.mts +1 -5
- package/dist/helpers.d.mts.map +1 -1
- package/dist/helpers.mjs +1 -5
- package/dist/helpers.mjs.map +1 -1
- package/dist/index.cjs +1764 -1028
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +33 -9
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +33 -9
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1763 -1028
- package/dist/index.mjs.map +1 -1
- package/dist/stream.d.cts +2 -26
- package/dist/stream.d.cts.map +1 -1
- package/dist/stream.d.mts +2 -26
- package/dist/stream.d.mts.map +1 -1
- package/dist/{types-BGYN2Z4E.d.cts → types-DqyCQ8JS.d.mts} +631 -621
- package/dist/types-DqyCQ8JS.d.mts.map +1 -0
- package/dist/{types-Crw4auK5.d.mts → types-KMHoWM6-.d.cts} +631 -621
- package/dist/types-KMHoWM6-.d.cts.map +1 -0
- package/dist/{utils-BUI0XQTZ.cjs → utils-Cy-Lu8WQ.cjs} +22 -5
- package/dist/utils-Cy-Lu8WQ.cjs.map +1 -0
- package/dist/{utils-Bz5eP_hN.mjs → utils-CyT9CwWA.mjs} +22 -5
- package/dist/utils-CyT9CwWA.mjs.map +1 -0
- package/package.json +2 -2
- package/dist/types-BGYN2Z4E.d.cts.map +0 -1
- package/dist/types-Crw4auK5.d.mts.map +0 -1
- package/dist/utils-BUI0XQTZ.cjs.map +0 -1
- package/dist/utils-Bz5eP_hN.mjs.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as ObserverState, A as OpenEnum, B as DeliverHook, C as AuthResult, D as MiddlewareFunctionInput, E as MessageType, F as AddedHook, G as MatchKeys, H as InvocationContext, I as Call, J as ObserveSource, K as MatchPredicate, L as Caller, M as RegisterFunctionMessage, N as StreamChannelRef, O as OnFunctionRegistrationInput, P as TriggerRequest, Q as ObserverOptions, R as CallerInfo, S as AuthInput, T as EnqueueResult, U as Key, V as Filter, W as MatchHook, X as Observer, Y as Observed, Z as ObserverHandle, _ as RegistrationRejectedInit, a as ISdk, b as ChannelReader, c as RemoteFunctionHandler, d as IIIConnectionState, et as RemovedHook, f as IIIReconnectionConfig, g as RegistrationRejectedError, h as ObserveRejection, i as FunctionRef, j as RegisterFunctionFormat, k as OnFunctionRegistrationResult, l as EngineFunctions, m as InvocationErrorInit, n as ApiResponse, o as RegisterFunctionInput, p as InvocationError, q as ObserveReason, r as Channel, s as RegisterFunctionOptions, t as ApiRequest, tt as Target, u as EngineSources, w as CallRequest, x as ChannelWriter, z as Capture } from "./types-KMHoWM6-.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/reporter.d.ts
|
|
4
4
|
type ReporterLimits = {
|
|
@@ -37,7 +37,7 @@ type InitOptions = {
|
|
|
37
37
|
* `process.env`, so there is no environment-variable fallback: pass the
|
|
38
38
|
* option explicitly.
|
|
39
39
|
*/
|
|
40
|
-
namespace?: string; /** Default timeout for `worker.
|
|
40
|
+
namespace?: string; /** Default timeout for `worker.call()` invocations in milliseconds. Defaults to `30000`. */
|
|
41
41
|
invocationTimeoutMs?: number;
|
|
42
42
|
/**
|
|
43
43
|
* WebSocket reconnection behavior.
|
|
@@ -52,27 +52,51 @@ type InitOptions = {
|
|
|
52
52
|
};
|
|
53
53
|
};
|
|
54
54
|
/**
|
|
55
|
-
* Factory object that constructs routing actions for {@link ISdk.
|
|
55
|
+
* Factory object that constructs routing actions for {@link ISdk.call}.
|
|
56
56
|
*
|
|
57
57
|
* @example
|
|
58
58
|
* ```typescript
|
|
59
|
-
* import {
|
|
59
|
+
* import { CallAction } from 'iii-browser-sdk'
|
|
60
60
|
*
|
|
61
61
|
* // Enqueue to a named queue
|
|
62
|
-
* worker.
|
|
62
|
+
* worker.call({
|
|
63
63
|
* function_id: 'process',
|
|
64
64
|
* payload: { data: 'hello' },
|
|
65
|
-
* action:
|
|
65
|
+
* action: CallAction.Enqueue({ queue: 'jobs' }),
|
|
66
66
|
* })
|
|
67
67
|
*
|
|
68
68
|
* // Fire-and-forget
|
|
69
|
-
* worker.
|
|
69
|
+
* worker.call({
|
|
70
70
|
* function_id: 'notify',
|
|
71
71
|
* payload: {},
|
|
72
|
-
* action:
|
|
72
|
+
* action: CallAction.Void(),
|
|
73
73
|
* })
|
|
74
74
|
* ```
|
|
75
75
|
*/
|
|
76
|
+
declare const CallAction: {
|
|
77
|
+
/**
|
|
78
|
+
* Routes the invocation through a named queue. The engine enqueues the job,
|
|
79
|
+
* acknowledges the caller with `{ messageReceiptId }`, and processes it
|
|
80
|
+
* asynchronously.
|
|
81
|
+
*
|
|
82
|
+
* @param opts - Queue routing options.
|
|
83
|
+
* @param opts.queue - Name of the target queue.
|
|
84
|
+
*/
|
|
85
|
+
readonly Enqueue: (opts: {
|
|
86
|
+
queue: string;
|
|
87
|
+
}) => {
|
|
88
|
+
queue: string;
|
|
89
|
+
type: "enqueue";
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Fire-and-forget routing. The engine forwards the invocation without
|
|
93
|
+
* waiting for a response or queuing the job.
|
|
94
|
+
*/
|
|
95
|
+
readonly Void: () => {
|
|
96
|
+
type: "void";
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
/** @deprecated Use {@link CallAction}, the same object. */
|
|
76
100
|
declare const TriggerAction: {
|
|
77
101
|
/**
|
|
78
102
|
* Routes the invocation through a named queue. The engine enqueues the job,
|
|
@@ -113,5 +137,5 @@ declare const TriggerAction: {
|
|
|
113
137
|
*/
|
|
114
138
|
declare const registerWorker: (address: string, options?: InitOptions) => ISdk;
|
|
115
139
|
//#endregion
|
|
116
|
-
export { type ApiRequest, type ApiResponse, type AuthInput, type AuthResult, type Caller, type CallerInfo, type Capture, type Channel, ChannelReader, ChannelWriter, EngineFunctions,
|
|
140
|
+
export { type AddedHook, type ApiRequest, type ApiResponse, type AuthInput, type AuthResult, type Call, CallAction, type CallRequest, type Caller, type CallerInfo, type Capture, type Channel, ChannelReader, ChannelWriter, type DeliverHook, EngineFunctions, EngineSources, type EnqueueResult, type Filter, type FunctionRef, type IIIConnectionState, type IIIReconnectionConfig, type ISdk, type InitOptions, type InvocationContext, InvocationError, type InvocationErrorInit, type Key, type MatchHook, type MatchKeys, type MatchPredicate, type MessageType, type MiddlewareFunctionInput, type ObserveReason, ObserveRejection, type ObserveSource, type Observed, type Observer, type ObserverHandle, type ObserverOptions, type ObserverState, type OnFunctionRegistrationInput, type OnFunctionRegistrationResult, type OpenEnum, type RegisterFunctionFormat, type RegisterFunctionInput, type RegisterFunctionMessage, type RegisterFunctionOptions, RegistrationRejectedError, type RegistrationRejectedInit, type RemoteFunctionHandler, type RemovedHook, type StreamChannelRef, type Target, TriggerAction, type TriggerRequest, registerWorker };
|
|
117
141
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/reporter.ts","../src/iii.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/reporter.ts","../src/iii.ts"],"mappings":";;;KAkDY,cAAA;EC8I2D,8CD5IrE,UAAA,UCymEQ;EDvmER,QAAA,UCumEQ;EDrmER,QAAA,UC+lEkB;ED7lElB,QAAA;EAEA,aAAA;EAEA,eAAA;AAAA;;;;;;;;;;;;ACuGF;;KAAY,WAAA;EAuBmB;;;;;;EAhB7B,UAAA;EAAA;;;;;;;EAQA,SAAA,WAYA;EAVA,mBAAA;EAUoC;;;;;EAJpC,kBAAA,GAAqB,OAAA,CAAQ,qBAAA,GAi+DrB;EA/9DR,OAAA,GAAU,MAAA,kBA+9DF;EA79DR,OAAA;IAAY,aAAA;IAAwB,QAAA,GAAW,OAAA,CAAQ,cAAA;EAAA;AAAA;;;;;AAg+DzD;;;;;;;;;;;;;AAiBA;;;;;cAnCa,UAAA;EAmCmC;;;;;;;;EAAA;IA1B5B,KAAA;EAAA;;;;;;;;;;;;;cASP,aAAA;;;;;;;;;;IATO,KAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;cA0BP,cAAA,GAAkB,OAAA,UAAiB,OAAA,GAAU,WAAA,KAAc,IAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as ObserverState, A as OpenEnum, B as DeliverHook, C as AuthResult, D as MiddlewareFunctionInput, E as MessageType, F as AddedHook, G as MatchKeys, H as InvocationContext, I as Call, J as ObserveSource, K as MatchPredicate, L as Caller, M as RegisterFunctionMessage, N as StreamChannelRef, O as OnFunctionRegistrationInput, P as TriggerRequest, Q as ObserverOptions, R as CallerInfo, S as AuthInput, T as EnqueueResult, U as Key, V as Filter, W as MatchHook, X as Observer, Y as Observed, Z as ObserverHandle, _ as RegistrationRejectedInit, a as ISdk, b as ChannelReader, c as RemoteFunctionHandler, d as IIIConnectionState, et as RemovedHook, f as IIIReconnectionConfig, g as RegistrationRejectedError, h as ObserveRejection, i as FunctionRef, j as RegisterFunctionFormat, k as OnFunctionRegistrationResult, l as EngineFunctions, m as InvocationErrorInit, n as ApiResponse, o as RegisterFunctionInput, p as InvocationError, q as ObserveReason, r as Channel, s as RegisterFunctionOptions, t as ApiRequest, tt as Target, u as EngineSources, w as CallRequest, x as ChannelWriter, z as Capture } from "./types-DqyCQ8JS.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/reporter.d.ts
|
|
4
4
|
type ReporterLimits = {
|
|
@@ -37,7 +37,7 @@ type InitOptions = {
|
|
|
37
37
|
* `process.env`, so there is no environment-variable fallback: pass the
|
|
38
38
|
* option explicitly.
|
|
39
39
|
*/
|
|
40
|
-
namespace?: string; /** Default timeout for `worker.
|
|
40
|
+
namespace?: string; /** Default timeout for `worker.call()` invocations in milliseconds. Defaults to `30000`. */
|
|
41
41
|
invocationTimeoutMs?: number;
|
|
42
42
|
/**
|
|
43
43
|
* WebSocket reconnection behavior.
|
|
@@ -52,27 +52,51 @@ type InitOptions = {
|
|
|
52
52
|
};
|
|
53
53
|
};
|
|
54
54
|
/**
|
|
55
|
-
* Factory object that constructs routing actions for {@link ISdk.
|
|
55
|
+
* Factory object that constructs routing actions for {@link ISdk.call}.
|
|
56
56
|
*
|
|
57
57
|
* @example
|
|
58
58
|
* ```typescript
|
|
59
|
-
* import {
|
|
59
|
+
* import { CallAction } from 'iii-browser-sdk'
|
|
60
60
|
*
|
|
61
61
|
* // Enqueue to a named queue
|
|
62
|
-
* worker.
|
|
62
|
+
* worker.call({
|
|
63
63
|
* function_id: 'process',
|
|
64
64
|
* payload: { data: 'hello' },
|
|
65
|
-
* action:
|
|
65
|
+
* action: CallAction.Enqueue({ queue: 'jobs' }),
|
|
66
66
|
* })
|
|
67
67
|
*
|
|
68
68
|
* // Fire-and-forget
|
|
69
|
-
* worker.
|
|
69
|
+
* worker.call({
|
|
70
70
|
* function_id: 'notify',
|
|
71
71
|
* payload: {},
|
|
72
|
-
* action:
|
|
72
|
+
* action: CallAction.Void(),
|
|
73
73
|
* })
|
|
74
74
|
* ```
|
|
75
75
|
*/
|
|
76
|
+
declare const CallAction: {
|
|
77
|
+
/**
|
|
78
|
+
* Routes the invocation through a named queue. The engine enqueues the job,
|
|
79
|
+
* acknowledges the caller with `{ messageReceiptId }`, and processes it
|
|
80
|
+
* asynchronously.
|
|
81
|
+
*
|
|
82
|
+
* @param opts - Queue routing options.
|
|
83
|
+
* @param opts.queue - Name of the target queue.
|
|
84
|
+
*/
|
|
85
|
+
readonly Enqueue: (opts: {
|
|
86
|
+
queue: string;
|
|
87
|
+
}) => {
|
|
88
|
+
queue: string;
|
|
89
|
+
type: "enqueue";
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Fire-and-forget routing. The engine forwards the invocation without
|
|
93
|
+
* waiting for a response or queuing the job.
|
|
94
|
+
*/
|
|
95
|
+
readonly Void: () => {
|
|
96
|
+
type: "void";
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
/** @deprecated Use {@link CallAction}, the same object. */
|
|
76
100
|
declare const TriggerAction: {
|
|
77
101
|
/**
|
|
78
102
|
* Routes the invocation through a named queue. The engine enqueues the job,
|
|
@@ -113,5 +137,5 @@ declare const TriggerAction: {
|
|
|
113
137
|
*/
|
|
114
138
|
declare const registerWorker: (address: string, options?: InitOptions) => ISdk;
|
|
115
139
|
//#endregion
|
|
116
|
-
export { type ApiRequest, type ApiResponse, type AuthInput, type AuthResult, type Caller, type CallerInfo, type Capture, type Channel, ChannelReader, ChannelWriter, EngineFunctions,
|
|
140
|
+
export { type AddedHook, type ApiRequest, type ApiResponse, type AuthInput, type AuthResult, type Call, CallAction, type CallRequest, type Caller, type CallerInfo, type Capture, type Channel, ChannelReader, ChannelWriter, type DeliverHook, EngineFunctions, EngineSources, type EnqueueResult, type Filter, type FunctionRef, type IIIConnectionState, type IIIReconnectionConfig, type ISdk, type InitOptions, type InvocationContext, InvocationError, type InvocationErrorInit, type Key, type MatchHook, type MatchKeys, type MatchPredicate, type MessageType, type MiddlewareFunctionInput, type ObserveReason, ObserveRejection, type ObserveSource, type Observed, type Observer, type ObserverHandle, type ObserverOptions, type ObserverState, type OnFunctionRegistrationInput, type OnFunctionRegistrationResult, type OpenEnum, type RegisterFunctionFormat, type RegisterFunctionInput, type RegisterFunctionMessage, type RegisterFunctionOptions, RegistrationRejectedError, type RegistrationRejectedInit, type RemoteFunctionHandler, type RemovedHook, type StreamChannelRef, type Target, TriggerAction, type TriggerRequest, registerWorker };
|
|
117
141
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/reporter.ts","../src/iii.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/reporter.ts","../src/iii.ts"],"mappings":";;;KAkDY,cAAA;EC8I2D,8CD5IrE,UAAA,UCymEQ;EDvmER,QAAA,UCumEQ;EDrmER,QAAA,UC+lEkB;ED7lElB,QAAA;EAEA,aAAA;EAEA,eAAA;AAAA;;;;;;;;;;;;ACuGF;;KAAY,WAAA;EAuBmB;;;;;;EAhB7B,UAAA;EAAA;;;;;;;EAQA,SAAA,WAYA;EAVA,mBAAA;EAUoC;;;;;EAJpC,kBAAA,GAAqB,OAAA,CAAQ,qBAAA,GAi+DrB;EA/9DR,OAAA,GAAU,MAAA,kBA+9DF;EA79DR,OAAA;IAAY,aAAA;IAAwB,QAAA,GAAW,OAAA,CAAQ,cAAA;EAAA;AAAA;;;;;AAg+DzD;;;;;;;;;;;;;AAiBA;;;;;cAnCa,UAAA;EAmCmC;;;;;;;;EAAA;IA1B5B,KAAA;EAAA;;;;;;;;;;;;;cASP,aAAA;;;;;;;;;;IATO,KAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;cA0BP,cAAA,GAAkB,OAAA,UAAiB,OAAA,GAAU,WAAA,KAAc,IAAA"}
|