iii-browser-sdk 0.25.0 → 0.25.1-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
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";
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-Bf5tgTLe.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.trigger()` invocations in milliseconds. Defaults to `30000`. */
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.trigger}.
55
+ * Factory object that constructs routing actions for {@link ISdk.call}.
56
56
  *
57
57
  * @example
58
58
  * ```typescript
59
- * import { TriggerAction } from 'iii-browser-sdk'
59
+ * import { CallAction } from 'iii-browser-sdk'
60
60
  *
61
61
  * // Enqueue to a named queue
62
- * worker.trigger({
62
+ * worker.call({
63
63
  * function_id: 'process',
64
64
  * payload: { data: 'hello' },
65
- * action: TriggerAction.Enqueue({ queue: 'jobs' }),
65
+ * action: CallAction.Enqueue({ queue: 'jobs' }),
66
66
  * })
67
67
  *
68
68
  * // Fire-and-forget
69
- * worker.trigger({
69
+ * worker.call({
70
70
  * function_id: 'notify',
71
71
  * payload: {},
72
- * action: TriggerAction.Void(),
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, 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 };
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
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/reporter.ts","../src/iii.ts"],"mappings":";;;KA8CY,cAAA;ECwG0B,8CDtGpC,UAAA,UCsGuD;EDpGvD,QAAA,UCoGqE;EDlGrE,QAAA,UCq0DQ;EDn0DR,QAAA,UCm0DQ;EDj0DR,aAAA,UC2zDkB;EDzzDlB,eAAA;AAAA;;;;;;;;;;;;ACiEF;;KAAY,WAAA;EAuBmB;;;;;;EAhB7B,UAAA;EAAA;;;;;;;EAQA,SAAA,WAYA;EAVA,mBAAA;EAUoC;;;;;EAJpC,kBAAA,GAAqB,OAAA,CAAQ,qBAAA,GAuuDrB;EAruDR,OAAA,GAAU,MAAA,kBAquDF;EAnuDR,OAAA;IAAY,aAAA;IAAwB,QAAA,GAAW,OAAA,CAAQ,cAAA;EAAA;AAAA;;;;;AAovDzD;;;;;;;;;;;;;;;;;;cAhCa,aAAA;;;;;;;;;;IASO,KAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;cAuBP,cAAA,GAAkB,OAAA,UAAiB,OAAA,GAAU,WAAA,KAAc,IAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/reporter.ts","../src/iii.ts"],"mappings":";;;KAkDY,cAAA;EC2I2D,8CDzIrE,UAAA,UCqmEQ;EDnmER,QAAA,UCmmEQ;EDjmER,QAAA,UC2lEkB;EDzlElB,QAAA;EAEA,aAAA;EAEA,eAAA;AAAA;;;;;;;;;;;;ACoGF;;KAAY,WAAA;EAuBmB;;;;;;EAhB7B,UAAA;EAAA;;;;;;;EAQA,SAAA,WAYA;EAVA,mBAAA;EAUoC;;;;;EAJpC,kBAAA,GAAqB,OAAA,CAAQ,qBAAA,GAg+DrB;EA99DR,OAAA,GAAU,MAAA,kBA89DF;EA59DR,OAAA;IAAY,aAAA;IAAwB,QAAA,GAAW,OAAA,CAAQ,cAAA;EAAA;AAAA;;;;;AA+9DzD;;;;;;;;;;;;;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 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";
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-Bw5KRoof.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.trigger()` invocations in milliseconds. Defaults to `30000`. */
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.trigger}.
55
+ * Factory object that constructs routing actions for {@link ISdk.call}.
56
56
  *
57
57
  * @example
58
58
  * ```typescript
59
- * import { TriggerAction } from 'iii-browser-sdk'
59
+ * import { CallAction } from 'iii-browser-sdk'
60
60
  *
61
61
  * // Enqueue to a named queue
62
- * worker.trigger({
62
+ * worker.call({
63
63
  * function_id: 'process',
64
64
  * payload: { data: 'hello' },
65
- * action: TriggerAction.Enqueue({ queue: 'jobs' }),
65
+ * action: CallAction.Enqueue({ queue: 'jobs' }),
66
66
  * })
67
67
  *
68
68
  * // Fire-and-forget
69
- * worker.trigger({
69
+ * worker.call({
70
70
  * function_id: 'notify',
71
71
  * payload: {},
72
- * action: TriggerAction.Void(),
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, 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 };
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
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/reporter.ts","../src/iii.ts"],"mappings":";;;KA8CY,cAAA;ECwG0B,8CDtGpC,UAAA,UCsGuD;EDpGvD,QAAA,UCoGqE;EDlGrE,QAAA,UCq0DQ;EDn0DR,QAAA,UCm0DQ;EDj0DR,aAAA,UC2zDkB;EDzzDlB,eAAA;AAAA;;;;;;;;;;;;ACiEF;;KAAY,WAAA;EAuBmB;;;;;;EAhB7B,UAAA;EAAA;;;;;;;EAQA,SAAA,WAYA;EAVA,mBAAA;EAUoC;;;;;EAJpC,kBAAA,GAAqB,OAAA,CAAQ,qBAAA,GAuuDrB;EAruDR,OAAA,GAAU,MAAA,kBAquDF;EAnuDR,OAAA;IAAY,aAAA;IAAwB,QAAA,GAAW,OAAA,CAAQ,cAAA;EAAA;AAAA;;;;;AAovDzD;;;;;;;;;;;;;;;;;;cAhCa,aAAA;;;;;;;;;;IASO,KAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;cAuBP,cAAA,GAAkB,OAAA,UAAiB,OAAA,GAAU,WAAA,KAAc,IAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/reporter.ts","../src/iii.ts"],"mappings":";;;KAkDY,cAAA;EC2I2D,8CDzIrE,UAAA,UCqmEQ;EDnmER,QAAA,UCmmEQ;EDjmER,QAAA,UC2lEkB;EDzlElB,QAAA;EAEA,aAAA;EAEA,eAAA;AAAA;;;;;;;;;;;;ACoGF;;KAAY,WAAA;EAuBmB;;;;;;EAhB7B,UAAA;EAAA;;;;;;;EAQA,SAAA,WAYA;EAVA,mBAAA;EAUoC;;;;;EAJpC,kBAAA,GAAqB,OAAA,CAAQ,qBAAA,GAg+DrB;EA99DR,OAAA,GAAU,MAAA,kBA89DF;EA59DR,OAAA;IAAY,aAAA;IAAwB,QAAA,GAAW,OAAA,CAAQ,cAAA;EAAA;AAAA;;;;;AA+9DzD;;;;;;;;;;;;;AAiBA;;;;;cAnCa,UAAA;EAmCmC;;;;;;;;EAAA;IA1B5B,KAAA;EAAA;;;;;;;;;;;;;cASP,aAAA;;;;;;;;;;IATO,KAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;cA0BP,cAAA,GAAkB,OAAA,UAAiB,OAAA,GAAU,WAAA,KAAc,IAAA"}