@aionixone/client-igniter 0.0.0-stage → 0.3.0-beta.3

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 (39) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +11 -0
  3. package/dist/generated/catalog.d.ts +277 -0
  4. package/dist/generated/catalog.d.ts.map +1 -0
  5. package/dist/generated/catalog.js +277 -0
  6. package/dist/generated/catalog.js.map +1 -0
  7. package/dist/generated/index.d.ts +6 -0
  8. package/dist/generated/index.d.ts.map +1 -0
  9. package/dist/generated/index.js +7 -0
  10. package/dist/generated/index.js.map +1 -0
  11. package/dist/generated/schema_types.d.ts +65 -0
  12. package/dist/generated/schema_types.d.ts.map +1 -0
  13. package/dist/generated/schema_types.js +3 -0
  14. package/dist/generated/schema_types.js.map +1 -0
  15. package/dist/generated/service.d.ts +293 -0
  16. package/dist/generated/service.d.ts.map +1 -0
  17. package/dist/generated/service.js +367 -0
  18. package/dist/generated/service.js.map +1 -0
  19. package/dist/generated/trn.d.ts +35 -0
  20. package/dist/generated/trn.d.ts.map +1 -0
  21. package/dist/generated/trn.js +194 -0
  22. package/dist/generated/trn.js.map +1 -0
  23. package/dist/generated/types.d.ts +152 -0
  24. package/dist/generated/types.d.ts.map +1 -0
  25. package/dist/generated/types.js +3 -0
  26. package/dist/generated/types.js.map +1 -0
  27. package/dist/index.d.ts +2 -0
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +2 -0
  30. package/dist/index.js.map +1 -0
  31. package/package.json +30 -4
  32. package/src/generated/catalog.ts +280 -0
  33. package/src/generated/index.ts +7 -0
  34. package/src/generated/schema_types.ts +66 -0
  35. package/src/generated/service.ts +395 -0
  36. package/src/generated/trn.ts +268 -0
  37. package/src/generated/types.ts +173 -0
  38. package/src/index.ts +1 -0
  39. package/README.md +0 -3
@@ -0,0 +1,395 @@
1
+ // @generated by xtask ts-client-export; DO NOT EDIT
2
+
3
+ import { encodePathParam, withQuery } from '@aionixone/client-core';
4
+ import type { CallEngine, CallOptions, ExecutionCallOptions } from '@aionixone/client-core';
5
+ import { OPERATIONS } from './catalog.js';
6
+ import type { IgniterDeliveryCancelResponse, IgniterDeliveryListQuery, IgniterDeliveryListResponse, IgniterDeliveryReadResponse, IgniterDeliveryRedriveResponse, IgniterDeliveryUnknownOutcomeAcknowledgeResponse, IgniterTriggerAccessRequirementListResponse, IgniterTriggerDisableResponse, IgniterTriggerEnableResponse, IgniterTriggerHealthReadResponse, IgniterTriggerInvokeResponse, IgniterTriggerListQuery, IgniterTriggerListResponse, IgniterTriggerReadResponse, IgniterTriggerSchedulePreviewResponse, IgniterTriggerSyncResponse, IgniterTriggerValidateResponse, IgniterWebhookSourceListQuery, IgniterWebhookSourceListResponse, IgniterWebhookSourceReadResponse } from './types.js';
7
+ import type { DeliveryAcknowledgeUnknownRequest, DeliveryCancelRequest, DeliveryRedriveRequest, IgniterTriggerResource as igniter__IgniterTriggerResource, PreviewScheduleRequest, TriggerAccessRequirementsRequest, TriggerInvokeRequest } from "@aionixone/client-types/igniter";
8
+
9
+ /** The `igniter` service. */
10
+ export class IgniterService {
11
+ readonly delivery: IgniterDeliveryResource;
12
+ readonly trigger: IgniterTriggerResource;
13
+ readonly webhookSource: IgniterWebhookSourceResource;
14
+
15
+ /** Not part of the public API: `AionixOne` constructs every service. */
16
+ constructor(engine: CallEngine) {
17
+ this.delivery = new IgniterDeliveryResource(engine);
18
+ this.trigger = new IgniterTriggerResource(engine);
19
+ this.webhookSource = new IgniterWebhookSourceResource(engine);
20
+ }
21
+ }
22
+
23
+ /** The `delivery` operations of the `igniter` service. */
24
+ export class IgniterDeliveryResource {
25
+ readonly #engine: CallEngine;
26
+
27
+ /** Not part of the public API. */
28
+ constructor(engine: CallEngine) {
29
+ this.#engine = engine;
30
+ }
31
+
32
+ /**
33
+ * Cancel a delivery before its effect starts
34
+ *
35
+ * Cancel a pending or dead-letter delivery whose target effect has not started; its payload is released and a compact receipt is kept for the dedup window
36
+ *
37
+ * Replay: repeating it has no further effect; retried after an attempt with an unknown result.
38
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_InvalidState`, `Internal_PayloadTooLarge`, `Internal_UnsupportedMediaType`, `Igniter_DeliveryNotFound`, `Igniter_DeliveryStateConflict`.
39
+ *
40
+ * @param trn Igniter TRN in the route path, for example trn:igniter:tenant:test0001:trigger/nightly-sync or trn:igniter:tenant:test0001:delivery/nightly-sync/<delivery_id> depending on the command
41
+ * @param body The request body.
42
+ * @param options Call options.
43
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
44
+ */
45
+ cancel(trn: string, body: DeliveryCancelRequest, options?: CallOptions): Promise<IgniterDeliveryCancelResponse> {
46
+ return this.#engine.call<IgniterDeliveryCancelResponse>(OPERATIONS.igniter_delivery_cancel, { path: `/deliveries/${encodePathParam(trn)}/cancel`, body, primaryResourceTrn: trn }, options);
47
+ }
48
+
49
+ /**
50
+ * List deliveries
51
+ *
52
+ * List trigger deliveries with optional trigger, target, status, time-range, and pagination filters
53
+ *
54
+ * Replay: has no effect; retried after an attempt with an unknown result.
55
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_InvalidState`, `Igniter_TriggerNotFound`.
56
+ *
57
+ * @param query The query, by wire names.
58
+ * @param options Call options.
59
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
60
+ */
61
+ list(query?: IgniterDeliveryListQuery, options?: CallOptions): Promise<IgniterDeliveryListResponse> {
62
+ return this.#engine.call<IgniterDeliveryListResponse>(OPERATIONS.igniter_delivery_list, { path: withQuery(`/deliveries`, query) }, options);
63
+ }
64
+
65
+ /**
66
+ * Every item of `igniter.delivery.list`, page after page, starting from `query`.
67
+ * Each page is one call with its own time budget and retries.
68
+ *
69
+ * @param query The query of the first page; `limit` is the size of every page.
70
+ * @param options Call options of every page.
71
+ */
72
+ async *listIter(query?: IgniterDeliveryListQuery, options?: CallOptions): AsyncGenerator<IgniterDeliveryListResponse['items'][number], void, undefined> {
73
+ let offset = query?.offset ?? 0;
74
+ for (;;) {
75
+ const response = await this.list({ ...query, offset }, options);
76
+ const page = response;
77
+ yield* page.items;
78
+ if (!page.hasMore) return;
79
+ offset += page.items.length;
80
+ }
81
+ }
82
+
83
+ /**
84
+ * Get delivery by TRN
85
+ *
86
+ * Read one trigger delivery by TRN, including current state, target, target reference, and bounded error details
87
+ *
88
+ * Replay: has no effect; retried after an attempt with an unknown result.
89
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_InvalidState`, `Igniter_DeliveryNotFound`.
90
+ *
91
+ * @param trn Igniter TRN in the route path, for example trn:igniter:tenant:test0001:trigger/nightly-sync or trn:igniter:tenant:test0001:delivery/nightly-sync/<delivery_id> depending on the command
92
+ * @param options Call options.
93
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
94
+ */
95
+ read(trn: string, options?: CallOptions): Promise<IgniterDeliveryReadResponse> {
96
+ return this.#engine.call<IgniterDeliveryReadResponse>(OPERATIONS.igniter_delivery_read, { path: `/deliveries/${encodePathParam(trn)}`, primaryResourceTrn: trn }, options);
97
+ }
98
+
99
+ /**
100
+ * Redrive a dead-letter delivery
101
+ *
102
+ * Redrive the same delivery with its original payload and idempotency key
103
+ *
104
+ * Replay: not idempotent; an attempt answered with `Igniter_DeliveryNotFound`, `Igniter_DeliveryStateConflict` did not run.
105
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_InvalidState`, `Internal_PayloadTooLarge`, `Internal_UnsupportedMediaType`, `Igniter_DeliveryNotFound`, `Igniter_DeliveryStateConflict`.
106
+ *
107
+ * @param trn Igniter TRN in the route path, for example trn:igniter:tenant:test0001:trigger/nightly-sync or trn:igniter:tenant:test0001:delivery/nightly-sync/<delivery_id> depending on the command
108
+ * @param body The request body.
109
+ * @param options Call options.
110
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
111
+ */
112
+ redrive(trn: string, body: DeliveryRedriveRequest, options?: CallOptions): Promise<IgniterDeliveryRedriveResponse> {
113
+ return this.#engine.call<IgniterDeliveryRedriveResponse>(OPERATIONS.igniter_delivery_redrive, { path: `/deliveries/${encodePathParam(trn)}/redrive`, body, primaryResourceTrn: trn }, options);
114
+ }
115
+
116
+ /**
117
+ * Acknowledge an unknown delivery outcome
118
+ *
119
+ * Record an operator resolution for a delivery whose target outcome is unknown; the delivery stays unknown and never becomes delivered
120
+ *
121
+ * Replay: repeating it has no further effect; retried after an attempt with an unknown result.
122
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_InvalidState`, `Internal_PayloadTooLarge`, `Internal_UnsupportedMediaType`, `Igniter_DeliveryNotFound`, `Igniter_DeliveryStateConflict`.
123
+ *
124
+ * @param trn Igniter TRN in the route path, for example trn:igniter:tenant:test0001:trigger/nightly-sync or trn:igniter:tenant:test0001:delivery/nightly-sync/<delivery_id> depending on the command
125
+ * @param body The request body.
126
+ * @param options Call options.
127
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
128
+ */
129
+ unknownOutcomeAcknowledge(trn: string, body: DeliveryAcknowledgeUnknownRequest, options?: CallOptions): Promise<IgniterDeliveryUnknownOutcomeAcknowledgeResponse> {
130
+ return this.#engine.call<IgniterDeliveryUnknownOutcomeAcknowledgeResponse>(OPERATIONS.igniter_delivery_unknown_outcome_acknowledge, { path: `/deliveries/${encodePathParam(trn)}/unknown-outcome-acknowledge`, body, primaryResourceTrn: trn }, options);
131
+ }
132
+ }
133
+
134
+ /** The `trigger` operations of the `igniter` service. */
135
+ export class IgniterTriggerResource {
136
+ readonly #engine: CallEngine;
137
+
138
+ /** Not part of the public API. */
139
+ constructor(engine: CallEngine) {
140
+ this.#engine = engine;
141
+ }
142
+
143
+ /**
144
+ * List trigger access requirements
145
+ *
146
+ * List the permissions a trigger's runtime identity needs
147
+ *
148
+ * List the permissions a trigger's runtime identity needs, calculated from the saved trigger or unsaved content.
149
+ *
150
+ * Replay: has no effect; retried after an attempt with an unknown result.
151
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_InvalidState`, `Internal_PayloadTooLarge`, `Internal_UnsupportedMediaType`, `Igniter_TriggerNotFound`.
152
+ *
153
+ * @param trn Igniter TRN in the route path, for example trn:igniter:tenant:test0001:trigger/nightly-sync or trn:igniter:tenant:test0001:delivery/nightly-sync/<delivery_id> depending on the command
154
+ * @param body The request body.
155
+ * @param options Call options.
156
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
157
+ */
158
+ accessRequirementList(trn: string, body: TriggerAccessRequirementsRequest, options?: CallOptions): Promise<IgniterTriggerAccessRequirementListResponse> {
159
+ return this.#engine.call<IgniterTriggerAccessRequirementListResponse>(OPERATIONS.igniter_trigger_access_requirement_list, { path: `/triggers/${encodePathParam(trn)}/access-requirements`, body, primaryResourceTrn: trn }, options);
160
+ }
161
+
162
+ /**
163
+ * Disable a trigger
164
+ *
165
+ * Disable trigger
166
+ *
167
+ * Disable a trigger so scheduled or source-driven events stop dispatching
168
+ *
169
+ * Replay: not idempotent; an attempt answered with `Internal_Conflict` did not run.
170
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_InvalidState`, `Igniter_TriggerNotFound`, `Internal_Conflict`.
171
+ *
172
+ * @param trn Igniter TRN in the route path, for example trn:igniter:tenant:test0001:trigger/nightly-sync or trn:igniter:tenant:test0001:delivery/nightly-sync/<delivery_id> depending on the command
173
+ * @param options Call options.
174
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
175
+ */
176
+ disable(trn: string, options?: CallOptions): Promise<IgniterTriggerDisableResponse> {
177
+ return this.#engine.call<IgniterTriggerDisableResponse>(OPERATIONS.igniter_trigger_disable, { path: `/triggers/${encodePathParam(trn)}/disable`, primaryResourceTrn: trn }, options);
178
+ }
179
+
180
+ /**
181
+ * Enable a disabled trigger
182
+ *
183
+ * Enable trigger
184
+ *
185
+ * Enable a disabled trigger so the runtime resumes normal dispatching
186
+ *
187
+ * Replay: not idempotent; an attempt answered with `Internal_Conflict` did not run.
188
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_InvalidState`, `Igniter_TriggerNotFound`, `Internal_Conflict`.
189
+ *
190
+ * @param trn Igniter TRN in the route path, for example trn:igniter:tenant:test0001:trigger/nightly-sync or trn:igniter:tenant:test0001:delivery/nightly-sync/<delivery_id> depending on the command
191
+ * @param options Call options.
192
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
193
+ */
194
+ enable(trn: string, options?: CallOptions): Promise<IgniterTriggerEnableResponse> {
195
+ return this.#engine.call<IgniterTriggerEnableResponse>(OPERATIONS.igniter_trigger_enable, { path: `/triggers/${encodePathParam(trn)}/enable`, primaryResourceTrn: trn }, options);
196
+ }
197
+
198
+ /**
199
+ * Check trigger health status
200
+ *
201
+ * Read runtime health for one trigger, including whether the source is connected and the trigger is considered healthy
202
+ *
203
+ * Replay: has no effect; retried after an attempt with an unknown result.
204
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_InvalidState`, `Igniter_TriggerNotFound`.
205
+ *
206
+ * @param trn Igniter TRN in the route path, for example trn:igniter:tenant:test0001:trigger/nightly-sync or trn:igniter:tenant:test0001:delivery/nightly-sync/<delivery_id> depending on the command
207
+ * @param options Call options.
208
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
209
+ */
210
+ healthRead(trn: string, options?: CallOptions): Promise<IgniterTriggerHealthReadResponse> {
211
+ return this.#engine.call<IgniterTriggerHealthReadResponse>(OPERATIONS.igniter_trigger_health_read, { path: `/triggers/${encodePathParam(trn)}/health`, primaryResourceTrn: trn }, options);
212
+ }
213
+
214
+ /**
215
+ * Invoke trigger
216
+ *
217
+ * Manually invoke a trigger
218
+ *
219
+ * Manually invoke one trigger by TRN with an event payload; use dryRun to validate the target mapping without creating a delivery
220
+ *
221
+ * Replay: the idempotency key replays the accepted execution for 604800 seconds.
222
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_InvalidState`, `Internal_PayloadTooLarge`, `Internal_UnsupportedMediaType`, `Igniter_TriggerNotFound`, `Internal_IdempotencyKeyReused`, `Internal_Conflict`.
223
+ *
224
+ * @param trn Igniter TRN in the route path, for example trn:igniter:tenant:test0001:trigger/nightly-sync or trn:igniter:tenant:test0001:delivery/nightly-sync/<delivery_id> depending on the command
225
+ * @param body The request body.
226
+ * @param options Call options.
227
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
228
+ */
229
+ invoke(trn: string, body: TriggerInvokeRequest, options?: ExecutionCallOptions): Promise<IgniterTriggerInvokeResponse> {
230
+ return this.#engine.call<IgniterTriggerInvokeResponse>(OPERATIONS.igniter_trigger_invoke, { path: `/triggers/${encodePathParam(trn)}/invoke`, body, primaryResourceTrn: trn }, options);
231
+ }
232
+
233
+ /**
234
+ * List triggers
235
+ *
236
+ * List triggers with optional variant, enabled, Provider, search, tag, sort and pagination filters
237
+ *
238
+ * Replay: has no effect; retried after an attempt with an unknown result.
239
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_InvalidState`.
240
+ *
241
+ * @param query The query, by wire names.
242
+ * @param options Call options.
243
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
244
+ */
245
+ list(query?: IgniterTriggerListQuery, options?: CallOptions): Promise<IgniterTriggerListResponse> {
246
+ return this.#engine.call<IgniterTriggerListResponse>(OPERATIONS.igniter_trigger_list, { path: withQuery(`/triggers`, query) }, options);
247
+ }
248
+
249
+ /**
250
+ * Every item of `igniter.trigger.list`, page after page, starting from `query`.
251
+ * Each page is one call with its own time budget and retries.
252
+ *
253
+ * @param query The query of the first page; `limit` is the size of every page.
254
+ * @param options Call options of every page.
255
+ */
256
+ async *listIter(query?: IgniterTriggerListQuery, options?: CallOptions): AsyncGenerator<IgniterTriggerListResponse['items'][number], void, undefined> {
257
+ let offset = query?.offset ?? 0;
258
+ for (;;) {
259
+ const response = await this.list({ ...query, offset }, options);
260
+ const page = response;
261
+ yield* page.items;
262
+ if (!page.hasMore) return;
263
+ offset += page.items.length;
264
+ }
265
+ }
266
+
267
+ /**
268
+ * Get trigger by TRN
269
+ *
270
+ * Read one trigger by TRN, including trigger metadata, source configuration, target, declared activation, and runtime observations
271
+ *
272
+ * Replay: has no effect; retried after an attempt with an unknown result.
273
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_InvalidState`, `Igniter_TriggerNotFound`.
274
+ *
275
+ * @param trn Igniter TRN in the route path, for example trn:igniter:tenant:test0001:trigger/nightly-sync or trn:igniter:tenant:test0001:delivery/nightly-sync/<delivery_id> depending on the command
276
+ * @param options Call options.
277
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
278
+ */
279
+ read(trn: string, options?: CallOptions): Promise<IgniterTriggerReadResponse> {
280
+ return this.#engine.call<IgniterTriggerReadResponse>(OPERATIONS.igniter_trigger_read, { path: `/triggers/${encodePathParam(trn)}`, primaryResourceTrn: trn }, options);
281
+ }
282
+
283
+ /**
284
+ * Preview periodic trigger times
285
+ *
286
+ * Preview planned periodic trigger occurrences without saving or executing a trigger
287
+ *
288
+ * Calculate up to ten planned occurrences with the runtime scheduler, without saving or invoking a trigger.
289
+ *
290
+ * Replay: has no effect; retried after an attempt with an unknown result.
291
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_InvalidState`, `Internal_PayloadTooLarge`, `Internal_UnsupportedMediaType`.
292
+ *
293
+ * @param body The request body.
294
+ * @param options Call options.
295
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
296
+ */
297
+ schedulePreview(body: PreviewScheduleRequest, options?: CallOptions): Promise<IgniterTriggerSchedulePreviewResponse> {
298
+ return this.#engine.call<IgniterTriggerSchedulePreviewResponse>(OPERATIONS.igniter_trigger_schedule_preview, { path: `/triggers/schedule-preview`, body }, options);
299
+ }
300
+
301
+ /**
302
+ * Sync a managed webhook subscription now
303
+ *
304
+ * Sync the managed webhook subscription now
305
+ *
306
+ * Bring the next reconcile round of a managed webhook subscription forward instead of waiting out its backoff; only a scheduled round moves, and the response carries the current subscription status
307
+ *
308
+ * Replay: not idempotent; an attempt with an unknown result is not retried.
309
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_InvalidState`, `Igniter_TriggerNotFound`, `Internal_Conflict`.
310
+ *
311
+ * @param trn Igniter TRN in the route path, for example trn:igniter:tenant:test0001:trigger/nightly-sync or trn:igniter:tenant:test0001:delivery/nightly-sync/<delivery_id> depending on the command
312
+ * @param options Call options.
313
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
314
+ */
315
+ sync(trn: string, options?: CallOptions): Promise<IgniterTriggerSyncResponse> {
316
+ return this.#engine.call<IgniterTriggerSyncResponse>(OPERATIONS.igniter_trigger_sync, { path: `/triggers/${encodePathParam(trn)}/sync`, primaryResourceTrn: trn }, options);
317
+ }
318
+
319
+ /**
320
+ * Validate trigger configuration
321
+ *
322
+ * Validate an updated trigger configuration against an existing trigger TRN before applying the declarative resource change
323
+ *
324
+ * Replay: has no effect; retried after an attempt with an unknown result.
325
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_InvalidState`, `Internal_PayloadTooLarge`, `Internal_UnsupportedMediaType`.
326
+ *
327
+ * @param trn Igniter TRN in the route path, for example trn:igniter:tenant:test0001:trigger/nightly-sync or trn:igniter:tenant:test0001:delivery/nightly-sync/<delivery_id> depending on the command
328
+ * @param body The request body.
329
+ * @param options Call options.
330
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
331
+ */
332
+ validate(trn: string, body: igniter__IgniterTriggerResource, options?: CallOptions): Promise<IgniterTriggerValidateResponse> {
333
+ return this.#engine.call<IgniterTriggerValidateResponse>(OPERATIONS.igniter_trigger_validate, { path: `/triggers/${encodePathParam(trn)}/validate`, body, primaryResourceTrn: trn }, options);
334
+ }
335
+ }
336
+
337
+ /** The `webhookSource` operations of the `igniter` service. */
338
+ export class IgniterWebhookSourceResource {
339
+ readonly #engine: CallEngine;
340
+
341
+ /** Not part of the public API. */
342
+ constructor(engine: CallEngine) {
343
+ this.#engine = engine;
344
+ }
345
+
346
+ /**
347
+ * List webhook Sources
348
+ *
349
+ * List webhook Sources with their current declarations
350
+ *
351
+ * Replay: has no effect; retried after an attempt with an unknown result.
352
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_InvalidState`.
353
+ *
354
+ * @param query The query, by wire names.
355
+ * @param options Call options.
356
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
357
+ */
358
+ list(query?: IgniterWebhookSourceListQuery, options?: CallOptions): Promise<IgniterWebhookSourceListResponse> {
359
+ return this.#engine.call<IgniterWebhookSourceListResponse>(OPERATIONS.igniter_webhook_source_list, { path: withQuery(`/webhook-sources`, query) }, options);
360
+ }
361
+
362
+ /**
363
+ * Every item of `igniter.webhook-source.list`, page after page, starting from `query`.
364
+ * Each page is one call with its own time budget and retries.
365
+ *
366
+ * @param query The query of the first page; `limit` is the size of every page.
367
+ * @param options Call options of every page.
368
+ */
369
+ async *listIter(query?: IgniterWebhookSourceListQuery, options?: CallOptions): AsyncGenerator<IgniterWebhookSourceListResponse['items'][number], void, undefined> {
370
+ let offset = query?.offset ?? 0;
371
+ for (;;) {
372
+ const response = await this.list({ ...query, offset }, options);
373
+ const page = response;
374
+ yield* page.items;
375
+ if (!page.hasMore) return;
376
+ offset += page.items.length;
377
+ }
378
+ }
379
+
380
+ /**
381
+ * Get webhook Source by TRN
382
+ *
383
+ * Read one webhook Source and its current declaration
384
+ *
385
+ * Replay: has no effect; retried after an attempt with an unknown result.
386
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_InvalidState`, `Igniter_WebhookSourceNotFound`.
387
+ *
388
+ * @param trn Igniter TRN in the route path, for example trn:igniter:tenant:test0001:trigger/nightly-sync or trn:igniter:tenant:test0001:delivery/nightly-sync/<delivery_id> depending on the command
389
+ * @param options Call options.
390
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
391
+ */
392
+ read(trn: string, options?: CallOptions): Promise<IgniterWebhookSourceReadResponse> {
393
+ return this.#engine.call<IgniterWebhookSourceReadResponse>(OPERATIONS.igniter_webhook_source_read, { path: `/webhook-sources/${encodePathParam(trn)}`, primaryResourceTrn: trn }, options);
394
+ }
395
+ }
@@ -0,0 +1,268 @@
1
+ // @generated by xtask ts-client-export; DO NOT EDIT
2
+
3
+ function assertTrnField(name: string, value: string): string {
4
+ if (value.length === 0) {
5
+ throw new Error(`TRN field '${name}' must not be empty`);
6
+ }
7
+ return value;
8
+ }
9
+
10
+ type ParsedTrnFields = Record<string, string>;
11
+
12
+ interface PlaceholderToken {
13
+ name: string;
14
+ pathLike: boolean;
15
+ }
16
+
17
+ function parsePlaceholderToken(token: string): PlaceholderToken | null {
18
+ if (!token.startsWith('{') || !token.endsWith('}')) {
19
+ return null;
20
+ }
21
+ const raw = token.slice(1, -1);
22
+ const pathLike = raw.startsWith('...');
23
+ const name = (pathLike ? raw.slice(3) : raw).trim();
24
+ if (name.length === 0) {
25
+ return null;
26
+ }
27
+ return { name, pathLike };
28
+ }
29
+
30
+ function matchPatternSegments(
31
+ patternSegments: string[],
32
+ actualSegments: string[],
33
+ patternIndex = 0,
34
+ actualIndex = 0,
35
+ captures: ParsedTrnFields = {}
36
+ ): ParsedTrnFields | null {
37
+ if (patternIndex === patternSegments.length && actualIndex === actualSegments.length) {
38
+ return captures;
39
+ }
40
+ if (patternIndex >= patternSegments.length) {
41
+ return null;
42
+ }
43
+ const token = patternSegments[patternIndex];
44
+ const placeholder = parsePlaceholderToken(token);
45
+ if (!placeholder) {
46
+ if (actualIndex >= actualSegments.length || actualSegments[actualIndex] !== token) {
47
+ return null;
48
+ }
49
+ return matchPatternSegments(patternSegments, actualSegments, patternIndex + 1, actualIndex + 1, captures);
50
+ }
51
+ if (!placeholder.pathLike) {
52
+ if (actualIndex >= actualSegments.length || actualSegments[actualIndex].length === 0) {
53
+ return null;
54
+ }
55
+ return matchPatternSegments(
56
+ patternSegments,
57
+ actualSegments,
58
+ patternIndex + 1,
59
+ actualIndex + 1,
60
+ { ...captures, [placeholder.name]: actualSegments[actualIndex] }
61
+ );
62
+ }
63
+ for (let end = actualIndex + 1; end <= actualSegments.length; end += 1) {
64
+ const candidate = actualSegments.slice(actualIndex, end).join('/');
65
+ if (candidate.length === 0) {
66
+ continue;
67
+ }
68
+ const matched = matchPatternSegments(
69
+ patternSegments,
70
+ actualSegments,
71
+ patternIndex + 1,
72
+ end,
73
+ { ...captures, [placeholder.name]: candidate }
74
+ );
75
+ if (matched) {
76
+ return matched;
77
+ }
78
+ }
79
+ return null;
80
+ }
81
+
82
+ function parseTrnByPattern(pattern: string, trn: string): ParsedTrnFields | null {
83
+ const optionalQualifierStart = pattern.endsWith(']') ? pattern.lastIndexOf('[:') : -1;
84
+ const qualifierOptional = optionalQualifierStart >= 0;
85
+ const normalizedPattern = qualifierOptional
86
+ ? `${pattern.slice(0, optionalQualifierStart)}:${pattern.slice(optionalQualifierStart + 2, -1)}`
87
+ : pattern;
88
+ const patternParts = normalizedPattern.split(':');
89
+ const trnParts = trn.split(':');
90
+ if ((patternParts.length !== 5 && patternParts.length !== 6)
91
+ || (trnParts.length !== 5 && trnParts.length !== 6)) {
92
+ return null;
93
+ }
94
+ let captures: ParsedTrnFields = {};
95
+ for (let index = 0; index < 4; index += 1) {
96
+ const patternToken = patternParts[index];
97
+ const trnToken = trnParts[index];
98
+ const placeholder = parsePlaceholderToken(patternToken);
99
+ if (!placeholder) {
100
+ if (patternToken !== trnToken) {
101
+ return null;
102
+ }
103
+ continue;
104
+ }
105
+ if (placeholder.pathLike || trnToken.length === 0) {
106
+ return null;
107
+ }
108
+ captures = { ...captures, [placeholder.name]: trnToken };
109
+ }
110
+ const patternResource = patternParts[4].length === 0 ? [] : patternParts[4].split('/');
111
+ const trnResource = trnParts[4].length === 0 ? [] : trnParts[4].split('/');
112
+ const resourceCaptures = matchPatternSegments(patternResource, trnResource);
113
+ if (!resourceCaptures) {
114
+ return null;
115
+ }
116
+ captures = { ...captures, ...resourceCaptures };
117
+ const patternQualifier = patternParts[5];
118
+ const trnQualifier = trnParts[5];
119
+ if (patternQualifier === undefined) {
120
+ return trnQualifier === undefined ? captures : null;
121
+ }
122
+ if (trnQualifier === undefined) {
123
+ return qualifierOptional ? captures : null;
124
+ }
125
+ if (!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(trnQualifier)) {
126
+ return null;
127
+ }
128
+ const qualifierPlaceholder = parsePlaceholderToken(patternQualifier);
129
+ if (!qualifierPlaceholder) {
130
+ return patternQualifier === trnQualifier ? captures : null;
131
+ }
132
+ if (qualifierPlaceholder.pathLike) {
133
+ return null;
134
+ }
135
+ return { ...captures, [qualifierPlaceholder.name]: trnQualifier };
136
+ }
137
+
138
+ export interface buildIgniterDeliveryCollectionTrnInput {
139
+ tenant: string;
140
+ }
141
+
142
+ export function buildIgniterDeliveryCollectionTrn(input: buildIgniterDeliveryCollectionTrnInput): string {
143
+ return "trn:igniter:tenant:{tenant}:delivery/*"
144
+ .replace("{tenant}", assertTrnField("tenant", input.tenant))
145
+ ;
146
+ }
147
+
148
+ export function parseIgniterDeliveryCollectionTrn(trn: string): buildIgniterDeliveryCollectionTrnInput | null {
149
+ const parsed = parseTrnByPattern("trn:igniter:tenant:{tenant}:delivery/*", trn);
150
+ if (!parsed) {
151
+ return null;
152
+ }
153
+ return {
154
+ tenant: parsed.tenant,
155
+ };
156
+ }
157
+
158
+ export interface buildIgniterDeliveryItemTrnInput {
159
+ tenant: string;
160
+ trigger_name: string;
161
+ delivery_id: string;
162
+ }
163
+
164
+ export function buildIgniterDeliveryItemTrn(input: buildIgniterDeliveryItemTrnInput): string {
165
+ return "trn:igniter:tenant:{tenant}:delivery/{...trigger_name}/{delivery_id}"
166
+ .replace("{tenant}", assertTrnField("tenant", input.tenant))
167
+ .replace("{...trigger_name}", assertTrnField("trigger_name", input.trigger_name))
168
+ .replace("{delivery_id}", assertTrnField("delivery_id", input.delivery_id))
169
+ ;
170
+ }
171
+
172
+ export function parseIgniterDeliveryItemTrn(trn: string): buildIgniterDeliveryItemTrnInput | null {
173
+ const parsed = parseTrnByPattern("trn:igniter:tenant:{tenant}:delivery/{...trigger_name}/{delivery_id}", trn);
174
+ if (!parsed) {
175
+ return null;
176
+ }
177
+ return {
178
+ tenant: parsed.tenant,
179
+ trigger_name: parsed.trigger_name,
180
+ delivery_id: parsed.delivery_id,
181
+ };
182
+ }
183
+
184
+ export interface buildIgniterTriggerCollectionTrnInput {
185
+ tenant: string;
186
+ }
187
+
188
+ export function buildIgniterTriggerCollectionTrn(input: buildIgniterTriggerCollectionTrnInput): string {
189
+ return "trn:igniter:tenant:{tenant}:trigger/*"
190
+ .replace("{tenant}", assertTrnField("tenant", input.tenant))
191
+ ;
192
+ }
193
+
194
+ export function parseIgniterTriggerCollectionTrn(trn: string): buildIgniterTriggerCollectionTrnInput | null {
195
+ const parsed = parseTrnByPattern("trn:igniter:tenant:{tenant}:trigger/*", trn);
196
+ if (!parsed) {
197
+ return null;
198
+ }
199
+ return {
200
+ tenant: parsed.tenant,
201
+ };
202
+ }
203
+
204
+ export interface buildIgniterTriggerItemTrnInput {
205
+ tenant: string;
206
+ trigger: string;
207
+ }
208
+
209
+ export function buildIgniterTriggerItemTrn(input: buildIgniterTriggerItemTrnInput): string {
210
+ return "trn:igniter:tenant:{tenant}:trigger/{...trigger}"
211
+ .replace("{tenant}", assertTrnField("tenant", input.tenant))
212
+ .replace("{...trigger}", assertTrnField("trigger", input.trigger))
213
+ ;
214
+ }
215
+
216
+ export function parseIgniterTriggerItemTrn(trn: string): buildIgniterTriggerItemTrnInput | null {
217
+ const parsed = parseTrnByPattern("trn:igniter:tenant:{tenant}:trigger/{...trigger}", trn);
218
+ if (!parsed) {
219
+ return null;
220
+ }
221
+ return {
222
+ tenant: parsed.tenant,
223
+ trigger: parsed.trigger,
224
+ };
225
+ }
226
+
227
+ export interface buildIgniterWebhookSourceCollectionTrnInput {
228
+ tenant: string;
229
+ }
230
+
231
+ export function buildIgniterWebhookSourceCollectionTrn(input: buildIgniterWebhookSourceCollectionTrnInput): string {
232
+ return "trn:igniter:tenant:{tenant}:webhook-source/*"
233
+ .replace("{tenant}", assertTrnField("tenant", input.tenant))
234
+ ;
235
+ }
236
+
237
+ export function parseIgniterWebhookSourceCollectionTrn(trn: string): buildIgniterWebhookSourceCollectionTrnInput | null {
238
+ const parsed = parseTrnByPattern("trn:igniter:tenant:{tenant}:webhook-source/*", trn);
239
+ if (!parsed) {
240
+ return null;
241
+ }
242
+ return {
243
+ tenant: parsed.tenant,
244
+ };
245
+ }
246
+
247
+ export interface buildIgniterWebhookSourceItemTrnInput {
248
+ tenant: string;
249
+ webhook_source: string;
250
+ }
251
+
252
+ export function buildIgniterWebhookSourceItemTrn(input: buildIgniterWebhookSourceItemTrnInput): string {
253
+ return "trn:igniter:tenant:{tenant}:webhook-source/{...webhook_source}"
254
+ .replace("{tenant}", assertTrnField("tenant", input.tenant))
255
+ .replace("{...webhook_source}", assertTrnField("webhook_source", input.webhook_source))
256
+ ;
257
+ }
258
+
259
+ export function parseIgniterWebhookSourceItemTrn(trn: string): buildIgniterWebhookSourceItemTrnInput | null {
260
+ const parsed = parseTrnByPattern("trn:igniter:tenant:{tenant}:webhook-source/{...webhook_source}", trn);
261
+ if (!parsed) {
262
+ return null;
263
+ }
264
+ return {
265
+ tenant: parsed.tenant,
266
+ webhook_source: parsed.webhook_source,
267
+ };
268
+ }