iii-sdk 0.19.3 → 0.19.4-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.
Files changed (85) hide show
  1. package/dist/channel.cjs +5 -0
  2. package/dist/channel.d.cts +2 -0
  3. package/dist/channel.d.mts +2 -0
  4. package/dist/channel.mjs +3 -0
  5. package/dist/{utils-DXL7JI0q.mjs → channels-BFs4n1g6.mjs} +2 -107
  6. package/dist/channels-BFs4n1g6.mjs.map +1 -0
  7. package/dist/{utils-CuS1Knym.cjs → channels-huduKJ-b.cjs} +2 -165
  8. package/dist/channels-huduKJ-b.cjs.map +1 -0
  9. package/dist/engine.cjs +5 -0
  10. package/dist/engine.d.cts +3 -0
  11. package/dist/engine.d.mts +3 -0
  12. package/dist/engine.mjs +3 -0
  13. package/dist/errors.cjs +33 -0
  14. package/dist/errors.cjs.map +1 -0
  15. package/dist/errors.d.cts +52 -0
  16. package/dist/errors.d.cts.map +1 -0
  17. package/dist/errors.d.mts +52 -0
  18. package/dist/errors.d.mts.map +1 -0
  19. package/dist/errors.mjs +29 -0
  20. package/dist/errors.mjs.map +1 -0
  21. package/dist/helpers.cjs +4 -3
  22. package/dist/helpers.cjs.map +1 -1
  23. package/dist/helpers.d.cts +19 -1
  24. package/dist/helpers.d.cts.map +1 -1
  25. package/dist/helpers.d.mts +19 -1
  26. package/dist/helpers.d.mts.map +1 -1
  27. package/dist/helpers.mjs +2 -1
  28. package/dist/helpers.mjs.map +1 -1
  29. package/dist/iii-constants-Baptl8nm.d.mts +47 -0
  30. package/dist/iii-constants-Baptl8nm.d.mts.map +1 -0
  31. package/dist/iii-constants-BqXp8xSN.d.cts +47 -0
  32. package/dist/iii-constants-BqXp8xSN.d.cts.map +1 -0
  33. package/dist/iii-constants-Br94RUNi.cjs +67 -0
  34. package/dist/iii-constants-Br94RUNi.cjs.map +1 -0
  35. package/dist/iii-constants-_k3SoHry.mjs +43 -0
  36. package/dist/iii-constants-_k3SoHry.mjs.map +1 -0
  37. package/dist/iii-types-6aHBgy7l.cjs +24 -0
  38. package/dist/iii-types-6aHBgy7l.cjs.map +1 -0
  39. package/dist/iii-types-CRx2qAjB.mjs +18 -0
  40. package/dist/iii-types-CRx2qAjB.mjs.map +1 -0
  41. package/dist/index.cjs +56 -133
  42. package/dist/index.cjs.map +1 -1
  43. package/dist/index.d.cts +8 -76
  44. package/dist/index.d.cts.map +1 -1
  45. package/dist/index.d.mts +8 -76
  46. package/dist/index.d.mts.map +1 -1
  47. package/dist/index.mjs +13 -88
  48. package/dist/index.mjs.map +1 -1
  49. package/dist/internal.cjs +0 -0
  50. package/dist/internal.d.cts +2 -0
  51. package/dist/internal.d.mts +2 -0
  52. package/dist/internal.mjs +1 -0
  53. package/dist/protocol.cjs +4 -0
  54. package/dist/protocol.d.cts +2 -0
  55. package/dist/protocol.d.mts +2 -0
  56. package/dist/protocol.mjs +3 -0
  57. package/dist/runtime.cjs +0 -0
  58. package/dist/runtime.d.cts +3 -0
  59. package/dist/runtime.d.mts +3 -0
  60. package/dist/runtime.mjs +1 -0
  61. package/dist/state.cjs.map +1 -1
  62. package/dist/state.d.cts +1 -1
  63. package/dist/state.d.mts +1 -1
  64. package/dist/state.mjs.map +1 -1
  65. package/dist/stream.d.cts +4 -245
  66. package/dist/stream.d.cts.map +1 -1
  67. package/dist/stream.d.mts +4 -245
  68. package/dist/stream.d.mts.map +1 -1
  69. package/dist/trigger.cjs +0 -0
  70. package/dist/trigger.d.cts +2 -0
  71. package/dist/trigger.d.mts +2 -0
  72. package/dist/trigger.mjs +1 -0
  73. package/dist/{utils-BnRzIUCy.d.cts → types-DduY0ha2.d.mts} +18 -203
  74. package/dist/types-DduY0ha2.d.mts.map +1 -0
  75. package/dist/{utils-e84Qph-9.d.mts → types-gwm9j9oD.d.cts} +18 -203
  76. package/dist/types-gwm9j9oD.d.cts.map +1 -0
  77. package/dist/utils-BtEFReHq.cjs +121 -0
  78. package/dist/utils-BtEFReHq.cjs.map +1 -0
  79. package/dist/utils-Cuv_ksKp.mjs +69 -0
  80. package/dist/utils-Cuv_ksKp.mjs.map +1 -0
  81. package/package.json +38 -2
  82. package/dist/utils-BnRzIUCy.d.cts.map +0 -1
  83. package/dist/utils-CuS1Knym.cjs.map +0 -1
  84. package/dist/utils-DXL7JI0q.mjs.map +0 -1
  85. package/dist/utils-e84Qph-9.d.mts.map +0 -1
@@ -1,4 +1,5 @@
1
1
  import { Readable, Writable } from "node:stream";
2
+ import { HttpInvocationConfig } from "@iii-dev/helpers/http";
2
3
 
3
4
  //#region src/iii-types.d.ts
4
5
  declare enum MessageType {
@@ -18,6 +19,11 @@ type RegisterTriggerTypeMessage = {
18
19
  id: string;
19
20
  description: string;
20
21
  };
22
+ type ErrorBody = {
23
+ code: string;
24
+ message: string;
25
+ stacktrace?: string;
26
+ };
21
27
  type RegisterTriggerMessage = {
22
28
  message_type: MessageType.RegisterTrigger;
23
29
  id: string;
@@ -26,35 +32,6 @@ type RegisterTriggerMessage = {
26
32
  config: unknown;
27
33
  metadata?: Record<string, unknown>;
28
34
  };
29
- /**
30
- * Authentication configuration for HTTP-invoked functions.
31
- *
32
- * - `hmac` -- HMAC signature verification using a shared secret.
33
- * - `bearer` -- Bearer token authentication.
34
- * - `api_key` -- API key sent via a custom header.
35
- */
36
- type HttpAuthConfig = {
37
- type: 'hmac';
38
- secret_key: string;
39
- } | {
40
- type: 'bearer';
41
- token_key: string;
42
- } | {
43
- type: 'api_key';
44
- header: string;
45
- value_key: string;
46
- };
47
- /**
48
- * Configuration for registering an HTTP-invoked function (Lambda, Cloudflare
49
- * Workers, etc.) instead of a local handler.
50
- */
51
- type HttpInvocationConfig = {
52
- /** URL to invoke. */url: string; /** HTTP method. Defaults to `POST`. */
53
- method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; /** Timeout in milliseconds. */
54
- timeout_ms?: number; /** Custom headers to send with the request. */
55
- headers?: Record<string, string>; /** Authentication configuration. */
56
- auth?: HttpAuthConfig;
57
- };
58
35
  type RegisterFunctionFormat = {
59
36
  /**
60
37
  * The name of the parameter
@@ -119,30 +96,6 @@ type TriggerAction = {
119
96
  } | {
120
97
  type: 'void';
121
98
  };
122
- /**
123
- * Input passed to the RBAC auth function during WebSocket upgrade.
124
- * Contains the HTTP headers, query parameters, and client IP from the
125
- * connecting worker's upgrade request.
126
- */
127
- type AuthInput = {
128
- /** HTTP headers from the WebSocket upgrade request. */headers: Record<string, string>; /** Query parameters from the upgrade URL. Each key maps to an array of values to support repeated keys. */
129
- query_params: Record<string, string[]>; /** IP address of the connecting client. */
130
- ip_address: string;
131
- };
132
- /**
133
- * Return value from the RBAC auth function. Controls which functions the
134
- * authenticated worker can invoke and what context is forwarded to the
135
- * middleware.
136
- */
137
- type AuthResult = {
138
- /** Additional function IDs to allow beyond the `expose_functions` config. */allowed_functions: string[]; /** Function IDs to deny even if they match `expose_functions`. Takes precedence over allowed. */
139
- forbidden_functions: string[]; /** Trigger type IDs the worker may register triggers for. When omitted, all types are allowed. */
140
- allowed_trigger_types?: string[]; /** Whether the worker may register new trigger types. */
141
- allow_trigger_type_registration: boolean; /** Whether the worker may register new functions. Defaults to `true` if omitted. */
142
- allow_function_registration?: boolean; /** Arbitrary context forwarded to the middleware function on every invocation. */
143
- context: Record<string, unknown>; /** Optional prefix applied to all function IDs registered by this worker. */
144
- function_registration_prefix?: string;
145
- };
146
99
  /**
147
100
  * Input passed to the RBAC middleware function on every function invocation
148
101
  * through the RBAC port. The middleware can inspect, modify, or reject the
@@ -154,79 +107,6 @@ type MiddlewareFunctionInput = {
154
107
  action?: TriggerAction; /** Auth context returned by the auth function for this session. */
155
108
  context: Record<string, unknown>;
156
109
  };
157
- /**
158
- * Input passed to the `on_trigger_type_registration_function_id` hook
159
- * when a worker attempts to register a new trigger type through the RBAC port.
160
- * Return an {@link OnTriggerTypeRegistrationResult} with the (possibly mapped)
161
- * fields, or throw to deny the registration.
162
- */
163
- type OnTriggerTypeRegistrationInput = {
164
- /** ID of the trigger type being registered. */trigger_type_id: string; /** Human-readable description of the trigger type. */
165
- description: string; /** Auth context from `AuthResult.context` for this session. */
166
- context: Record<string, unknown>;
167
- };
168
- /**
169
- * Result returned from the `on_trigger_type_registration_function_id` hook.
170
- * All fields are optional -- omitted fields keep the original value from the
171
- * registration request.
172
- */
173
- type OnTriggerTypeRegistrationResult = {
174
- /** Mapped trigger type ID. */trigger_type_id?: string; /** Mapped description. */
175
- description?: string;
176
- };
177
- /**
178
- * Input passed to the `on_trigger_registration_function_id` hook
179
- * when a worker attempts to register a trigger through the RBAC port.
180
- * Return an {@link OnTriggerRegistrationResult} with the (possibly mapped)
181
- * fields, or throw to deny the registration.
182
- */
183
- type OnTriggerRegistrationInput = {
184
- /** ID of the trigger being registered. */trigger_id: string; /** Trigger type identifier. */
185
- trigger_type: string; /** ID of the function this trigger is bound to. */
186
- function_id: string; /** Trigger-specific configuration. */
187
- config: unknown; /** Arbitrary metadata attached to the trigger. */
188
- metadata?: Record<string, unknown>; /** Auth context from `AuthResult.context` for this session. */
189
- context: Record<string, unknown>;
190
- };
191
- /**
192
- * Result returned from the `on_trigger_registration_function_id` hook.
193
- * All fields are optional -- omitted fields keep the original value from the
194
- * registration request.
195
- */
196
- type OnTriggerRegistrationResult = {
197
- /** Mapped trigger ID. */trigger_id?: string; /** Mapped trigger type. */
198
- trigger_type?: string; /** Mapped function ID. */
199
- function_id?: string; /** Mapped trigger configuration. */
200
- config?: unknown;
201
- };
202
- /**
203
- * Input passed to the `on_function_registration_function_id` hook
204
- * when a worker attempts to register a function through the RBAC port.
205
- * Return an {@link OnFunctionRegistrationResult} with the (possibly mapped)
206
- * fields, or throw to deny the registration.
207
- */
208
- type OnFunctionRegistrationInput = {
209
- /** ID of the function being registered. */function_id: string; /** Human-readable description of the function. */
210
- description?: string; /** Arbitrary metadata attached to the function. */
211
- metadata?: Record<string, unknown>; /** Auth context from `AuthResult.context` for this session. */
212
- context: Record<string, unknown>;
213
- };
214
- /**
215
- * Result returned from the `on_function_registration_function_id` hook.
216
- * All fields are optional -- omitted fields keep the original value from the
217
- * registration request.
218
- */
219
- type OnFunctionRegistrationResult = {
220
- /** Mapped function ID. */function_id?: string; /** Mapped description. */
221
- description?: string; /** Mapped metadata. */
222
- metadata?: Record<string, unknown>;
223
- };
224
- /**
225
- * Result returned when a function is invoked with `TriggerAction.Enqueue`.
226
- */
227
- type EnqueueResult = {
228
- /** Unique receipt ID for the enqueued message. */messageReceiptId: string;
229
- };
230
110
  /**
231
111
  * Request object passed to {@link ISdk.trigger}.
232
112
  *
@@ -397,7 +277,7 @@ type RegisterTriggerInput = Omit<RegisterTriggerMessage, 'message_type' | 'id'>;
397
277
  type RegisterFunctionInput = Omit<RegisterFunctionMessage, 'message_type'>;
398
278
  type RegisterFunctionOptions = Omit<RegisterFunctionMessage, 'message_type' | 'id'>;
399
279
  type RegisterTriggerTypeInput = Omit<RegisterTriggerTypeMessage, 'message_type'>;
400
- interface ISdk {
280
+ interface IIIClient {
401
281
  /**
402
282
  * Registers a new trigger. A trigger is a way to invoke a function when a certain event occurs.
403
283
  * @param trigger - The trigger to register
@@ -530,15 +410,17 @@ interface ISdk {
530
410
  */
531
411
  shutdown(): Promise<void>;
532
412
  }
413
+ /** @deprecated Renamed to `IIIClient`. */
414
+ type ISdk = IIIClient;
533
415
  /**
534
- * Handle returned by {@link ISdk.registerTrigger}. Use `unregister()` to
416
+ * Handle returned by {@link IIIClient.registerTrigger}. Use `unregister()` to
535
417
  * remove the trigger from the engine.
536
418
  */
537
419
  type Trigger = {
538
420
  /** Removes this trigger from the engine. */unregister(): void;
539
421
  };
540
422
  /**
541
- * Handle returned by {@link ISdk.registerFunction}. Contains the function's
423
+ * Handle returned by {@link IIIClient.registerFunction}. Contains the function's
542
424
  * `id` and an `unregister()` method.
543
425
  */
544
426
  type FunctionRef = {
@@ -546,7 +428,7 @@ type FunctionRef = {
546
428
  unregister: () => void;
547
429
  };
548
430
  /**
549
- * Typed handle returned by {@link ISdk.registerTriggerType}.
431
+ * Typed handle returned by {@link IIIClient.registerTriggerType}.
550
432
  *
551
433
  * Provides convenience methods to register triggers and functions scoped
552
434
  * to this trigger type, so callers don't need to repeat the `type` field.
@@ -619,89 +501,22 @@ type InternalHttpRequest<TBody = unknown> = {
619
501
  request_body: ChannelReader;
620
502
  };
621
503
  /**
622
- * Response object passed to HTTP function handlers. Use `status()` and
504
+ * Response object passed to streaming function handlers. Use `status()` and
623
505
  * `headers()` to set response metadata, write to `stream` for streaming
624
506
  * responses, and call `close()` when done.
625
507
  */
626
- type HttpResponse = {
508
+ type StreamResponse = {
627
509
  /** Set the HTTP status code. */status: (statusCode: number) => void; /** Set response headers. */
628
510
  headers: (headers: Record<string, string>) => void; /** Writable stream for the response body. */
629
511
  stream: NodeJS.WritableStream; /** Close the response. */
630
512
  close: () => void;
631
513
  };
632
514
  /**
633
- * Incoming HTTP request received by a function registered with an HTTP trigger.
634
- *
635
- * @typeParam TBody - Type of the parsed request body.
636
- */
637
- type HttpRequest<TBody = unknown> = Omit<InternalHttpRequest<TBody>, 'response'>;
638
- /**
639
- * Alias for {@link HttpRequest}. Represents an incoming API request.
515
+ * Incoming streaming request received by a function registered with a stream trigger.
640
516
  *
641
517
  * @typeParam TBody - Type of the parsed request body.
642
518
  */
643
- type ApiRequest<TBody = unknown> = HttpRequest<TBody>;
644
- /**
645
- * Structured API response returned from HTTP function handlers.
646
- *
647
- * @typeParam TStatus - HTTP status code literal type.
648
- * @typeParam TBody - Type of the response body.
649
- *
650
- * @example
651
- * ```typescript
652
- * const response: ApiResponse = {
653
- * status_code: 200,
654
- * headers: { 'content-type': 'application/json' },
655
- * body: { message: 'ok' },
656
- * }
657
- * ```
658
- */
659
- type ApiResponse<TStatus extends number = number, TBody = string | Buffer | Record<string, unknown>> = {
660
- /** HTTP status code. */status_code: TStatus; /** Response headers. */
661
- headers?: Record<string, string>; /** Response body. */
662
- body?: TBody;
663
- };
664
- //#endregion
665
- //#region src/utils.d.ts
666
- /**
667
- * Helper that wraps an HTTP-style handler (with separate `req`/`res` arguments)
668
- * into the function handler format expected by the SDK.
669
- *
670
- * @param callback - Async handler receiving an {@link HttpRequest} and {@link HttpResponse}.
671
- * @returns A function handler compatible with {@link ISdk.registerFunction}.
672
- *
673
- * @example
674
- * ```typescript
675
- * import { http } from 'iii-sdk'
676
- *
677
- * iii.registerFunction(
678
- * 'my-api',
679
- * http(async (req, res) => {
680
- * res.status(200)
681
- * res.headers({ 'content-type': 'application/json' })
682
- * res.stream.end(JSON.stringify({ hello: 'world' }))
683
- * res.close()
684
- * }),
685
- * )
686
- * ```
687
- */
688
- declare const http: (callback: (req: HttpRequest, res: HttpResponse) => Promise<void | ApiResponse>) => (req: InternalHttpRequest) => Promise<void | ApiResponse>;
689
- /**
690
- * Type guard that checks if a value is a {@link StreamChannelRef}.
691
- *
692
- * @param value - Value to check.
693
- * @returns `true` if the value is a valid `StreamChannelRef`.
694
- */
695
- declare const isChannelRef: (value: unknown) => value is StreamChannelRef;
696
- /**
697
- * Recursively extract all {@link StreamChannelRef} values from a JSON-like
698
- * input, returning each match paired with its dotted/bracketed path. Mirrors
699
- * the Rust SDK's `extract_channel_refs`.
700
- *
701
- * @param data - Arbitrary JSON-like value.
702
- * @returns Array of `[path, ref]` tuples. Empty when no refs are found.
703
- */
704
- declare const extractChannelRefs: (data: unknown) => Array<[string, StreamChannelRef]>;
519
+ type StreamRequest<TBody = unknown> = Omit<InternalHttpRequest<TBody>, 'response'>;
705
520
  //#endregion
706
- export { MessageType as A, RegisterTriggerTypeMessage as B, ChannelReader as C, EnqueueResult as D, AuthResult as E, OnTriggerRegistrationResult as F, TriggerRequest as H, OnTriggerTypeRegistrationInput as I, OnTriggerTypeRegistrationResult as L, OnFunctionRegistrationInput as M, OnFunctionRegistrationResult as N, HttpAuthConfig as O, OnTriggerRegistrationInput as P, RegisterFunctionMessage as R, ChannelItem as S, AuthInput as T, StreamChannelRef as V, Trigger as _, ApiResponse as a, TriggerHandler as b, HttpRequest as c, InternalHttpRequest as d, RegisterFunctionInput as f, RemoteFunctionHandler as g, RegisterTriggerTypeInput as h, ApiRequest as i, MiddlewareFunctionInput as j, HttpInvocationConfig as k, HttpResponse as l, RegisterTriggerInput as m, http as n, Channel as o, RegisterFunctionOptions as p, isChannelRef as r, FunctionRef as s, extractChannelRefs as t, ISdk as u, TriggerTypeRef as v, ChannelWriter as w, ChannelDirection as x, TriggerConfig as y, RegisterTriggerMessage as z };
707
- //# sourceMappingURL=utils-BnRzIUCy.d.cts.map
521
+ export { MiddlewareFunctionInput as C, RegisterTriggerTypeMessage as D, RegisterTriggerMessage as E, StreamChannelRef as O, MessageType as S, RegisterFunctionMessage as T, ChannelDirection as _, InternalHttpRequest as a, ChannelWriter as b, RegisterTriggerInput as c, StreamRequest as d, StreamResponse as f, TriggerHandler as g, TriggerConfig as h, ISdk as i, TriggerRequest as k, RegisterTriggerTypeInput as l, TriggerTypeRef as m, FunctionRef as n, RegisterFunctionInput as o, Trigger as p, IIIClient as r, RegisterFunctionOptions as s, Channel as t, RemoteFunctionHandler as u, ChannelItem as v, RegisterFunctionFormat as w, ErrorBody as x, ChannelReader as y };
522
+ //# sourceMappingURL=types-DduY0ha2.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-DduY0ha2.d.mts","names":[],"sources":["../src/iii-types.ts","../src/channels.ts","../src/triggers.ts","../src/types.ts"],"mappings":";;;;aAEY,WAAA;EACV,gBAAA;EACA,kBAAA;EACA,cAAA;EACA,gBAAA;EACA,mBAAA;EACA,eAAA;EACA,iBAAA;EACA,qBAAA;EACA,yBAAA;EACA,gBAAA;AAAA;AAAA,KAGU,0BAAA;EACV,YAAA,EAAc,WAAA,CAAY,mBAAA;EAC1B,EAAA;EACA,WAAA;AAAA;AAAA,KAcU,SAAA;EACV,IAAA;EACA,OAAA;EACA,UAAA;AAAA;AAAA,KAWU,sBAAA;EACV,YAAA,EAAc,WAAA,CAAY,eAAA;EAC1B,EAAA;EACA,IAAA;EACA,WAAA;E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RA,SAAA,EAAW,gBAAA,EDhR2B;ECkRtC,SAAA,EAAW,gBAAA;AAAA;AAAA,KAGD,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;;AAxShB;;;;KAgTY,cAAA;EAhTuE,gCAkTjF,MAAA,GAAS,UAAA,mBAlT+E;EAoTxF,OAAA,GAAU,OAAA,EAAS,MAAA,2BApT2B;EAsT9C,MAAA,EAAQ,MAAA,CAAO,cAAA,EAtTiD;EAwThE,KAAA;AAAA;;;AAjRF;;;KAyRY,aAAA,oBAAiC,IAAA,CAAK,mBAAA,CAAoB,KAAA"}
@@ -1,4 +1,5 @@
1
1
  import { Readable, Writable } from "node:stream";
2
+ import { HttpInvocationConfig } from "@iii-dev/helpers/http";
2
3
 
3
4
  //#region src/iii-types.d.ts
4
5
  declare enum MessageType {
@@ -18,6 +19,11 @@ type RegisterTriggerTypeMessage = {
18
19
  id: string;
19
20
  description: string;
20
21
  };
22
+ type ErrorBody = {
23
+ code: string;
24
+ message: string;
25
+ stacktrace?: string;
26
+ };
21
27
  type RegisterTriggerMessage = {
22
28
  message_type: MessageType.RegisterTrigger;
23
29
  id: string;
@@ -26,35 +32,6 @@ type RegisterTriggerMessage = {
26
32
  config: unknown;
27
33
  metadata?: Record<string, unknown>;
28
34
  };
29
- /**
30
- * Authentication configuration for HTTP-invoked functions.
31
- *
32
- * - `hmac` -- HMAC signature verification using a shared secret.
33
- * - `bearer` -- Bearer token authentication.
34
- * - `api_key` -- API key sent via a custom header.
35
- */
36
- type HttpAuthConfig = {
37
- type: 'hmac';
38
- secret_key: string;
39
- } | {
40
- type: 'bearer';
41
- token_key: string;
42
- } | {
43
- type: 'api_key';
44
- header: string;
45
- value_key: string;
46
- };
47
- /**
48
- * Configuration for registering an HTTP-invoked function (Lambda, Cloudflare
49
- * Workers, etc.) instead of a local handler.
50
- */
51
- type HttpInvocationConfig = {
52
- /** URL to invoke. */url: string; /** HTTP method. Defaults to `POST`. */
53
- method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; /** Timeout in milliseconds. */
54
- timeout_ms?: number; /** Custom headers to send with the request. */
55
- headers?: Record<string, string>; /** Authentication configuration. */
56
- auth?: HttpAuthConfig;
57
- };
58
35
  type RegisterFunctionFormat = {
59
36
  /**
60
37
  * The name of the parameter
@@ -119,30 +96,6 @@ type TriggerAction = {
119
96
  } | {
120
97
  type: 'void';
121
98
  };
122
- /**
123
- * Input passed to the RBAC auth function during WebSocket upgrade.
124
- * Contains the HTTP headers, query parameters, and client IP from the
125
- * connecting worker's upgrade request.
126
- */
127
- type AuthInput = {
128
- /** HTTP headers from the WebSocket upgrade request. */headers: Record<string, string>; /** Query parameters from the upgrade URL. Each key maps to an array of values to support repeated keys. */
129
- query_params: Record<string, string[]>; /** IP address of the connecting client. */
130
- ip_address: string;
131
- };
132
- /**
133
- * Return value from the RBAC auth function. Controls which functions the
134
- * authenticated worker can invoke and what context is forwarded to the
135
- * middleware.
136
- */
137
- type AuthResult = {
138
- /** Additional function IDs to allow beyond the `expose_functions` config. */allowed_functions: string[]; /** Function IDs to deny even if they match `expose_functions`. Takes precedence over allowed. */
139
- forbidden_functions: string[]; /** Trigger type IDs the worker may register triggers for. When omitted, all types are allowed. */
140
- allowed_trigger_types?: string[]; /** Whether the worker may register new trigger types. */
141
- allow_trigger_type_registration: boolean; /** Whether the worker may register new functions. Defaults to `true` if omitted. */
142
- allow_function_registration?: boolean; /** Arbitrary context forwarded to the middleware function on every invocation. */
143
- context: Record<string, unknown>; /** Optional prefix applied to all function IDs registered by this worker. */
144
- function_registration_prefix?: string;
145
- };
146
99
  /**
147
100
  * Input passed to the RBAC middleware function on every function invocation
148
101
  * through the RBAC port. The middleware can inspect, modify, or reject the
@@ -154,79 +107,6 @@ type MiddlewareFunctionInput = {
154
107
  action?: TriggerAction; /** Auth context returned by the auth function for this session. */
155
108
  context: Record<string, unknown>;
156
109
  };
157
- /**
158
- * Input passed to the `on_trigger_type_registration_function_id` hook
159
- * when a worker attempts to register a new trigger type through the RBAC port.
160
- * Return an {@link OnTriggerTypeRegistrationResult} with the (possibly mapped)
161
- * fields, or throw to deny the registration.
162
- */
163
- type OnTriggerTypeRegistrationInput = {
164
- /** ID of the trigger type being registered. */trigger_type_id: string; /** Human-readable description of the trigger type. */
165
- description: string; /** Auth context from `AuthResult.context` for this session. */
166
- context: Record<string, unknown>;
167
- };
168
- /**
169
- * Result returned from the `on_trigger_type_registration_function_id` hook.
170
- * All fields are optional -- omitted fields keep the original value from the
171
- * registration request.
172
- */
173
- type OnTriggerTypeRegistrationResult = {
174
- /** Mapped trigger type ID. */trigger_type_id?: string; /** Mapped description. */
175
- description?: string;
176
- };
177
- /**
178
- * Input passed to the `on_trigger_registration_function_id` hook
179
- * when a worker attempts to register a trigger through the RBAC port.
180
- * Return an {@link OnTriggerRegistrationResult} with the (possibly mapped)
181
- * fields, or throw to deny the registration.
182
- */
183
- type OnTriggerRegistrationInput = {
184
- /** ID of the trigger being registered. */trigger_id: string; /** Trigger type identifier. */
185
- trigger_type: string; /** ID of the function this trigger is bound to. */
186
- function_id: string; /** Trigger-specific configuration. */
187
- config: unknown; /** Arbitrary metadata attached to the trigger. */
188
- metadata?: Record<string, unknown>; /** Auth context from `AuthResult.context` for this session. */
189
- context: Record<string, unknown>;
190
- };
191
- /**
192
- * Result returned from the `on_trigger_registration_function_id` hook.
193
- * All fields are optional -- omitted fields keep the original value from the
194
- * registration request.
195
- */
196
- type OnTriggerRegistrationResult = {
197
- /** Mapped trigger ID. */trigger_id?: string; /** Mapped trigger type. */
198
- trigger_type?: string; /** Mapped function ID. */
199
- function_id?: string; /** Mapped trigger configuration. */
200
- config?: unknown;
201
- };
202
- /**
203
- * Input passed to the `on_function_registration_function_id` hook
204
- * when a worker attempts to register a function through the RBAC port.
205
- * Return an {@link OnFunctionRegistrationResult} with the (possibly mapped)
206
- * fields, or throw to deny the registration.
207
- */
208
- type OnFunctionRegistrationInput = {
209
- /** ID of the function being registered. */function_id: string; /** Human-readable description of the function. */
210
- description?: string; /** Arbitrary metadata attached to the function. */
211
- metadata?: Record<string, unknown>; /** Auth context from `AuthResult.context` for this session. */
212
- context: Record<string, unknown>;
213
- };
214
- /**
215
- * Result returned from the `on_function_registration_function_id` hook.
216
- * All fields are optional -- omitted fields keep the original value from the
217
- * registration request.
218
- */
219
- type OnFunctionRegistrationResult = {
220
- /** Mapped function ID. */function_id?: string; /** Mapped description. */
221
- description?: string; /** Mapped metadata. */
222
- metadata?: Record<string, unknown>;
223
- };
224
- /**
225
- * Result returned when a function is invoked with `TriggerAction.Enqueue`.
226
- */
227
- type EnqueueResult = {
228
- /** Unique receipt ID for the enqueued message. */messageReceiptId: string;
229
- };
230
110
  /**
231
111
  * Request object passed to {@link ISdk.trigger}.
232
112
  *
@@ -397,7 +277,7 @@ type RegisterTriggerInput = Omit<RegisterTriggerMessage, 'message_type' | 'id'>;
397
277
  type RegisterFunctionInput = Omit<RegisterFunctionMessage, 'message_type'>;
398
278
  type RegisterFunctionOptions = Omit<RegisterFunctionMessage, 'message_type' | 'id'>;
399
279
  type RegisterTriggerTypeInput = Omit<RegisterTriggerTypeMessage, 'message_type'>;
400
- interface ISdk {
280
+ interface IIIClient {
401
281
  /**
402
282
  * Registers a new trigger. A trigger is a way to invoke a function when a certain event occurs.
403
283
  * @param trigger - The trigger to register
@@ -530,15 +410,17 @@ interface ISdk {
530
410
  */
531
411
  shutdown(): Promise<void>;
532
412
  }
413
+ /** @deprecated Renamed to `IIIClient`. */
414
+ type ISdk = IIIClient;
533
415
  /**
534
- * Handle returned by {@link ISdk.registerTrigger}. Use `unregister()` to
416
+ * Handle returned by {@link IIIClient.registerTrigger}. Use `unregister()` to
535
417
  * remove the trigger from the engine.
536
418
  */
537
419
  type Trigger = {
538
420
  /** Removes this trigger from the engine. */unregister(): void;
539
421
  };
540
422
  /**
541
- * Handle returned by {@link ISdk.registerFunction}. Contains the function's
423
+ * Handle returned by {@link IIIClient.registerFunction}. Contains the function's
542
424
  * `id` and an `unregister()` method.
543
425
  */
544
426
  type FunctionRef = {
@@ -546,7 +428,7 @@ type FunctionRef = {
546
428
  unregister: () => void;
547
429
  };
548
430
  /**
549
- * Typed handle returned by {@link ISdk.registerTriggerType}.
431
+ * Typed handle returned by {@link IIIClient.registerTriggerType}.
550
432
  *
551
433
  * Provides convenience methods to register triggers and functions scoped
552
434
  * to this trigger type, so callers don't need to repeat the `type` field.
@@ -619,89 +501,22 @@ type InternalHttpRequest<TBody = unknown> = {
619
501
  request_body: ChannelReader;
620
502
  };
621
503
  /**
622
- * Response object passed to HTTP function handlers. Use `status()` and
504
+ * Response object passed to streaming function handlers. Use `status()` and
623
505
  * `headers()` to set response metadata, write to `stream` for streaming
624
506
  * responses, and call `close()` when done.
625
507
  */
626
- type HttpResponse = {
508
+ type StreamResponse = {
627
509
  /** Set the HTTP status code. */status: (statusCode: number) => void; /** Set response headers. */
628
510
  headers: (headers: Record<string, string>) => void; /** Writable stream for the response body. */
629
511
  stream: NodeJS.WritableStream; /** Close the response. */
630
512
  close: () => void;
631
513
  };
632
514
  /**
633
- * Incoming HTTP request received by a function registered with an HTTP trigger.
634
- *
635
- * @typeParam TBody - Type of the parsed request body.
636
- */
637
- type HttpRequest<TBody = unknown> = Omit<InternalHttpRequest<TBody>, 'response'>;
638
- /**
639
- * Alias for {@link HttpRequest}. Represents an incoming API request.
515
+ * Incoming streaming request received by a function registered with a stream trigger.
640
516
  *
641
517
  * @typeParam TBody - Type of the parsed request body.
642
518
  */
643
- type ApiRequest<TBody = unknown> = HttpRequest<TBody>;
644
- /**
645
- * Structured API response returned from HTTP function handlers.
646
- *
647
- * @typeParam TStatus - HTTP status code literal type.
648
- * @typeParam TBody - Type of the response body.
649
- *
650
- * @example
651
- * ```typescript
652
- * const response: ApiResponse = {
653
- * status_code: 200,
654
- * headers: { 'content-type': 'application/json' },
655
- * body: { message: 'ok' },
656
- * }
657
- * ```
658
- */
659
- type ApiResponse<TStatus extends number = number, TBody = string | Buffer | Record<string, unknown>> = {
660
- /** HTTP status code. */status_code: TStatus; /** Response headers. */
661
- headers?: Record<string, string>; /** Response body. */
662
- body?: TBody;
663
- };
664
- //#endregion
665
- //#region src/utils.d.ts
666
- /**
667
- * Helper that wraps an HTTP-style handler (with separate `req`/`res` arguments)
668
- * into the function handler format expected by the SDK.
669
- *
670
- * @param callback - Async handler receiving an {@link HttpRequest} and {@link HttpResponse}.
671
- * @returns A function handler compatible with {@link ISdk.registerFunction}.
672
- *
673
- * @example
674
- * ```typescript
675
- * import { http } from 'iii-sdk'
676
- *
677
- * iii.registerFunction(
678
- * 'my-api',
679
- * http(async (req, res) => {
680
- * res.status(200)
681
- * res.headers({ 'content-type': 'application/json' })
682
- * res.stream.end(JSON.stringify({ hello: 'world' }))
683
- * res.close()
684
- * }),
685
- * )
686
- * ```
687
- */
688
- declare const http: (callback: (req: HttpRequest, res: HttpResponse) => Promise<void | ApiResponse>) => (req: InternalHttpRequest) => Promise<void | ApiResponse>;
689
- /**
690
- * Type guard that checks if a value is a {@link StreamChannelRef}.
691
- *
692
- * @param value - Value to check.
693
- * @returns `true` if the value is a valid `StreamChannelRef`.
694
- */
695
- declare const isChannelRef: (value: unknown) => value is StreamChannelRef;
696
- /**
697
- * Recursively extract all {@link StreamChannelRef} values from a JSON-like
698
- * input, returning each match paired with its dotted/bracketed path. Mirrors
699
- * the Rust SDK's `extract_channel_refs`.
700
- *
701
- * @param data - Arbitrary JSON-like value.
702
- * @returns Array of `[path, ref]` tuples. Empty when no refs are found.
703
- */
704
- declare const extractChannelRefs: (data: unknown) => Array<[string, StreamChannelRef]>;
519
+ type StreamRequest<TBody = unknown> = Omit<InternalHttpRequest<TBody>, 'response'>;
705
520
  //#endregion
706
- export { MessageType as A, RegisterTriggerTypeMessage as B, ChannelReader as C, EnqueueResult as D, AuthResult as E, OnTriggerRegistrationResult as F, TriggerRequest as H, OnTriggerTypeRegistrationInput as I, OnTriggerTypeRegistrationResult as L, OnFunctionRegistrationInput as M, OnFunctionRegistrationResult as N, HttpAuthConfig as O, OnTriggerRegistrationInput as P, RegisterFunctionMessage as R, ChannelItem as S, AuthInput as T, StreamChannelRef as V, Trigger as _, ApiResponse as a, TriggerHandler as b, HttpRequest as c, InternalHttpRequest as d, RegisterFunctionInput as f, RemoteFunctionHandler as g, RegisterTriggerTypeInput as h, ApiRequest as i, MiddlewareFunctionInput as j, HttpInvocationConfig as k, HttpResponse as l, RegisterTriggerInput as m, http as n, Channel as o, RegisterFunctionOptions as p, isChannelRef as r, FunctionRef as s, extractChannelRefs as t, ISdk as u, TriggerTypeRef as v, ChannelWriter as w, ChannelDirection as x, TriggerConfig as y, RegisterTriggerMessage as z };
707
- //# sourceMappingURL=utils-e84Qph-9.d.mts.map
521
+ export { MiddlewareFunctionInput as C, RegisterTriggerTypeMessage as D, RegisterTriggerMessage as E, StreamChannelRef as O, MessageType as S, RegisterFunctionMessage as T, ChannelDirection as _, InternalHttpRequest as a, ChannelWriter as b, RegisterTriggerInput as c, StreamRequest as d, StreamResponse as f, TriggerHandler as g, TriggerConfig as h, ISdk as i, TriggerRequest as k, RegisterTriggerTypeInput as l, TriggerTypeRef as m, FunctionRef as n, RegisterFunctionInput as o, Trigger as p, IIIClient as r, RegisterFunctionOptions as s, Channel as t, RemoteFunctionHandler as u, ChannelItem as v, RegisterFunctionFormat as w, ErrorBody as x, ChannelReader as y };
522
+ //# sourceMappingURL=types-gwm9j9oD.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-gwm9j9oD.d.cts","names":[],"sources":["../src/iii-types.ts","../src/channels.ts","../src/triggers.ts","../src/types.ts"],"mappings":";;;;aAEY,WAAA;EACV,gBAAA;EACA,kBAAA;EACA,cAAA;EACA,gBAAA;EACA,mBAAA;EACA,eAAA;EACA,iBAAA;EACA,qBAAA;EACA,yBAAA;EACA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