@aionixone/client-aionixfn 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 (44) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +11 -0
  3. package/dist/generated/authoring.d.ts +18 -0
  4. package/dist/generated/authoring.d.ts.map +1 -0
  5. package/dist/generated/authoring.js +6 -0
  6. package/dist/generated/authoring.js.map +1 -0
  7. package/dist/generated/catalog.d.ts +373 -0
  8. package/dist/generated/catalog.d.ts.map +1 -0
  9. package/dist/generated/catalog.js +373 -0
  10. package/dist/generated/catalog.js.map +1 -0
  11. package/dist/generated/index.d.ts +7 -0
  12. package/dist/generated/index.d.ts.map +1 -0
  13. package/dist/generated/index.js +8 -0
  14. package/dist/generated/index.js.map +1 -0
  15. package/dist/generated/schema_types.d.ts +41 -0
  16. package/dist/generated/schema_types.d.ts.map +1 -0
  17. package/dist/generated/schema_types.js +3 -0
  18. package/dist/generated/schema_types.js.map +1 -0
  19. package/dist/generated/service.d.ts +436 -0
  20. package/dist/generated/service.d.ts.map +1 -0
  21. package/dist/generated/service.js +561 -0
  22. package/dist/generated/service.js.map +1 -0
  23. package/dist/generated/trn.d.ts +51 -0
  24. package/dist/generated/trn.d.ts.map +1 -0
  25. package/dist/generated/trn.js +241 -0
  26. package/dist/generated/trn.js.map +1 -0
  27. package/dist/generated/types.d.ts +240 -0
  28. package/dist/generated/types.d.ts.map +1 -0
  29. package/dist/generated/types.js +3 -0
  30. package/dist/generated/types.js.map +1 -0
  31. package/dist/index.d.ts +2 -0
  32. package/dist/index.d.ts.map +1 -0
  33. package/dist/index.js +2 -0
  34. package/dist/index.js.map +1 -0
  35. package/package.json +30 -4
  36. package/src/generated/authoring.ts +6 -0
  37. package/src/generated/catalog.ts +376 -0
  38. package/src/generated/index.ts +8 -0
  39. package/src/generated/schema_types.ts +42 -0
  40. package/src/generated/service.ts +596 -0
  41. package/src/generated/trn.ts +336 -0
  42. package/src/generated/types.ts +272 -0
  43. package/src/index.ts +1 -0
  44. package/README.md +0 -3
@@ -0,0 +1,596 @@
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 { AionixfnFunctionExecuteResponse, AionixfnFunctionListQuery, AionixfnFunctionListResponse, AionixfnFunctionLogQueryQuery, AionixfnFunctionLogQueryResponse, AionixfnFunctionReadResponse, AionixfnFunctionSchemaReadResponse, AionixfnFunctionSourceFileListQuery, AionixfnFunctionSourceFileListResponse, AionixfnFunctionSourceFileReadQuery, AionixfnFunctionSourceFileReadResponse, AionixfnFunctionSourceReadResponse, AionixfnFunctionSubmitResponse, AionixfnFunctionVersionDeleteResponse, AionixfnFunctionVersionListQuery, AionixfnFunctionVersionListResponse, AionixfnFunctionVersionReadResponse, AionixfnFunctionVersionSetCurrentResponse, AionixfnInvocationCancelResponse, AionixfnInvocationListQuery, AionixfnInvocationListResponse, AionixfnInvocationReadResponse, AionixfnLayerListQuery, AionixfnLayerListResponse, AionixfnLayerReadResponse, AionixfnLayerVersionDeleteResponse, AionixfnLayerVersionDownloadResponse, AionixfnLayerVersionListQuery, AionixfnLayerVersionListResponse, AionixfnLayerVersionReadResponse, AionixfnLayerVersionSetCurrentResponse } from './types.js';
7
+ import type { ExecuteFunctionRequest, SubmitFunctionRequest } from "@aionixone/client-types/aionixfn";
8
+ import type { DurableInvocationCancelRequest } from "@aionixone/client-types/core";
9
+
10
+ /** The `aionixfn` service. */
11
+ export class AionixfnService {
12
+ readonly function: AionixfnFunctionResource;
13
+ readonly invocation: AionixfnInvocationResource;
14
+ readonly layer: AionixfnLayerResource;
15
+
16
+ /** Not part of the public API: `AionixOne` constructs every service. */
17
+ constructor(engine: CallEngine) {
18
+ this.function = new AionixfnFunctionResource(engine);
19
+ this.invocation = new AionixfnInvocationResource(engine);
20
+ this.layer = new AionixfnLayerResource(engine);
21
+ }
22
+ }
23
+
24
+ /** The `function` operations of the `aionixfn` service. */
25
+ export class AionixfnFunctionResource {
26
+ readonly #engine: CallEngine;
27
+
28
+ /** Not part of the public API. */
29
+ constructor(engine: CallEngine) {
30
+ this.#engine = engine;
31
+ }
32
+
33
+ /**
34
+ * Execute function
35
+ *
36
+ * Execute the current function version or an exact qualified version without creating a durable invocation
37
+ *
38
+ * Run the current version selected by a stable Function TRN, or the exact version selected by a qualified Function TRN, without creating a durable invocation
39
+ *
40
+ * Replay: not idempotent; an attempt answered with `AionixFn_ExecutionCapacityUnavailable` did not run.
41
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_PayloadTooLarge`, `Internal_UnsupportedMediaType`, `Execution_PayloadLimitExceeded`, `AionixFn_FunctionNotFound`, `AionixFn_VersionNotFound`, `AionixFn_LayerNotFound`, `AionixFn_LayerVersionNotFound`, `AionixFn_InputSchemaViolation`, `AionixFn_ExecutionProfileUnsupported`, `AionixFn_ExecutionBackendUnavailable`, `AionixFn_ExecutionCapacityUnavailable`, `AionixFn_WorkloadConcurrencyLimitExceeded`, `AionixFn_Timeout`, `AionixFn_ExecutionCancelled`, `AionixFn_UnknownEffectOutcome`, `AionixFn_ExecutionFailed`, `AionixFn_OutputLimitExceeded`, `AionixFn_OutOfMemory`, `AionixFn_ProcessLimitExceeded`, `AionixFn_ExecutionEnvelopeCleanupFailed`, `AionixFn_InvocationFailed`, `Internal_IdempotencyKeyReused`, `Internal_Conflict`, `Internal_ConfigurationError`.
42
+ *
43
+ * @param trn AionixFn resource TRN in the route path, for example trn:aionixfn:tenant:test0001:function/smoke/echo or trn:aionixfn:tenant:test0001:function/smoke/echo:v1 depending on the command
44
+ * @param body The request body.
45
+ * @param options Call options.
46
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
47
+ */
48
+ execute(trn: string, body: ExecuteFunctionRequest, options?: CallOptions): Promise<AionixfnFunctionExecuteResponse> {
49
+ return this.#engine.call<AionixfnFunctionExecuteResponse>(OPERATIONS.aionixfn_function_execute, { path: `/functions/${encodePathParam(trn)}/execute`, body, primaryResourceTrn: trn }, options);
50
+ }
51
+
52
+ /**
53
+ * List functions
54
+ *
55
+ * Read AionixFn resource
56
+ *
57
+ * List functions with bounded offset pagination
58
+ *
59
+ * Replay: has no effect; retried after an attempt with an unknown result.
60
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`.
61
+ *
62
+ * @param query The query, by wire names.
63
+ * @param options Call options.
64
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
65
+ */
66
+ list(query?: AionixfnFunctionListQuery, options?: CallOptions): Promise<AionixfnFunctionListResponse> {
67
+ return this.#engine.call<AionixfnFunctionListResponse>(OPERATIONS.aionixfn_function_list, { path: withQuery(`/functions`, query) }, options);
68
+ }
69
+
70
+ /**
71
+ * Every item of `aionixfn.function.list`, page after page, starting from `query`.
72
+ * Each page is one call with its own time budget and retries.
73
+ *
74
+ * @param query The query of the first page; `limit` is the size of every page.
75
+ * @param options Call options of every page.
76
+ */
77
+ async *listIter(query?: AionixfnFunctionListQuery, options?: CallOptions): AsyncGenerator<AionixfnFunctionListResponse['items'][number], void, undefined> {
78
+ let offset = query?.offset ?? 0;
79
+ for (;;) {
80
+ const response = await this.list({ ...query, offset }, options);
81
+ const page = response;
82
+ yield* page.items;
83
+ if (!page.hasMore) return;
84
+ offset += page.items.length;
85
+ }
86
+ }
87
+
88
+ /**
89
+ * Read function logs
90
+ *
91
+ * Read a function's output
92
+ *
93
+ * Read one function's stdout, stderr and system records, optionally for one call. An empty result only means nothing currently matches.
94
+ *
95
+ * Replay: has no effect; retried after an attempt with an unknown result.
96
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `AionixFn_FunctionNotFound`, `Observability_CursorUnsupported`, `Observability_BackendUnavailable`, `Observability_BackendDecodeFailed`.
97
+ *
98
+ * @param trn AionixFn Function TRN whose output will be read
99
+ * @param query The query, by wire names.
100
+ * @param options Call options.
101
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
102
+ */
103
+ logQuery(trn: string, query?: AionixfnFunctionLogQueryQuery, options?: CallOptions): Promise<AionixfnFunctionLogQueryResponse> {
104
+ return this.#engine.call<AionixfnFunctionLogQueryResponse>(OPERATIONS.aionixfn_function_log_query, { path: withQuery(`/functions/${encodePathParam(trn)}/logs`, query), primaryResourceTrn: trn }, options);
105
+ }
106
+
107
+ /**
108
+ * Every item of `aionixfn.function.log_query`, page after page, starting from `query`.
109
+ * Each page is one call with its own time budget and retries.
110
+ *
111
+ * @param trn AionixFn Function TRN whose output will be read
112
+ * @param query The query of the first page; `limit` is the size of every page.
113
+ * @param options Call options of every page.
114
+ */
115
+ async *logQueryIter(trn: string, query?: AionixfnFunctionLogQueryQuery, options?: CallOptions): AsyncGenerator<AionixfnFunctionLogQueryResponse['items'][number], void, undefined> {
116
+ let cursor = query?.cursor;
117
+ for (;;) {
118
+ const response = await this.logQuery(trn, { ...query, cursor }, options);
119
+ const page = response;
120
+ yield* page.items;
121
+ if (page.nextCursor == null) return;
122
+ cursor = page.nextCursor;
123
+ }
124
+ }
125
+
126
+ /**
127
+ * Read function
128
+ *
129
+ * Read AionixFn resource
130
+ *
131
+ * Read one function definition, including runtime metadata, status, and version summary fields
132
+ *
133
+ * Replay: has no effect; retried after an attempt with an unknown result.
134
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `AionixFn_FunctionNotFound`.
135
+ *
136
+ * @param trn AionixFn resource TRN in the route path, for example trn:aionixfn:tenant:test0001:function/smoke/echo or trn:aionixfn:tenant:test0001:function/smoke/echo:v1 depending on the command
137
+ * @param options Call options.
138
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
139
+ */
140
+ read(trn: string, options?: CallOptions): Promise<AionixfnFunctionReadResponse> {
141
+ return this.#engine.call<AionixfnFunctionReadResponse>(OPERATIONS.aionixfn_function_read, { path: `/functions/${encodePathParam(trn)}`, primaryResourceTrn: trn }, options);
142
+ }
143
+
144
+ /**
145
+ * Read a function invocation contract
146
+ *
147
+ * Read the resource invocation contract
148
+ *
149
+ * Export the frozen tool contract resolved from a stable or qualified Function TRN
150
+ *
151
+ * Replay: has no effect; retried after an attempt with an unknown result.
152
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `AionixFn_FunctionNotFound`, `AionixFn_VersionNotFound`.
153
+ *
154
+ * @param trn AionixFn resource TRN in the route path, for example trn:aionixfn:tenant:test0001:function/smoke/echo or trn:aionixfn:tenant:test0001:function/smoke/echo:v1 depending on the command
155
+ * @param options Call options.
156
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
157
+ */
158
+ schemaRead(trn: string, options?: CallOptions): Promise<AionixfnFunctionSchemaReadResponse> {
159
+ return this.#engine.call<AionixfnFunctionSchemaReadResponse>(OPERATIONS.aionixfn_function_schema_read, { path: `/functions/${encodePathParam(trn)}/schema`, primaryResourceTrn: trn }, options);
160
+ }
161
+
162
+ /**
163
+ * List authored file metadata for one immutable Function version
164
+ *
165
+ * Replay: has no effect; retried after an attempt with an unknown result.
166
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_RateLimited`, `Internal_PayloadTooLarge`, `AionixFn_FunctionNotFound`, `AionixFn_VersionNotFound`, `Internal_NotFound`, `Internal_Conflict`.
167
+ *
168
+ * @param trn AionixFn resource TRN in the route path, for example trn:aionixfn:tenant:test0001:function/smoke/echo or trn:aionixfn:tenant:test0001:function/smoke/echo:v1 depending on the command
169
+ * @param query The query, by wire names.
170
+ * @param options Call options.
171
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
172
+ */
173
+ sourceFileList(trn: string, query?: AionixfnFunctionSourceFileListQuery, options?: CallOptions): Promise<AionixfnFunctionSourceFileListResponse> {
174
+ return this.#engine.call<AionixfnFunctionSourceFileListResponse>(OPERATIONS.aionixfn_function_source_file_list, { path: withQuery(`/functions/${encodePathParam(trn)}/source/files`, query), primaryResourceTrn: trn }, options);
175
+ }
176
+
177
+ /**
178
+ * Every item of `aionixfn.function.source_file_list`, page after page, starting from `query`.
179
+ * Each page is one call with its own time budget and retries.
180
+ *
181
+ * @param trn AionixFn resource TRN in the route path, for example trn:aionixfn:tenant:test0001:function/smoke/echo or trn:aionixfn:tenant:test0001:function/smoke/echo:v1 depending on the command
182
+ * @param query The query of the first page; `limit` is the size of every page.
183
+ * @param options Call options of every page.
184
+ */
185
+ async *sourceFileListIter(trn: string, query?: AionixfnFunctionSourceFileListQuery, options?: CallOptions): AsyncGenerator<AionixfnFunctionSourceFileListResponse['page']['items'][number], void, undefined> {
186
+ let offset = query?.offset ?? 0;
187
+ for (;;) {
188
+ const response = await this.sourceFileList(trn, { ...query, offset }, options);
189
+ const page = response.page;
190
+ yield* page.items;
191
+ if (!page.hasMore) return;
192
+ offset += page.items.length;
193
+ }
194
+ }
195
+
196
+ /**
197
+ * Read one verified source file; large files require explicit download
198
+ *
199
+ * Replay: has no effect; retried after an attempt with an unknown result.
200
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_RateLimited`, `Internal_PayloadTooLarge`, `AionixFn_FunctionNotFound`, `AionixFn_VersionNotFound`, `Internal_NotFound`, `Internal_Conflict`.
201
+ *
202
+ * @param trn AionixFn resource TRN in the route path, for example trn:aionixfn:tenant:test0001:function/smoke/echo or trn:aionixfn:tenant:test0001:function/smoke/echo:v1 depending on the command
203
+ * @param query The query, by wire names.
204
+ * @param options Call options.
205
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
206
+ */
207
+ sourceFileRead(trn: string, query: AionixfnFunctionSourceFileReadQuery, options?: CallOptions): Promise<AionixfnFunctionSourceFileReadResponse> {
208
+ return this.#engine.call<AionixfnFunctionSourceFileReadResponse>(OPERATIONS.aionixfn_function_source_file_read, { path: withQuery(`/functions/${encodePathParam(trn)}/source/file`, query), primaryResourceTrn: trn }, options);
209
+ }
210
+
211
+ /**
212
+ * Download function source
213
+ *
214
+ * Read a canonical function source package
215
+ *
216
+ * Replay: has no effect; retried after an attempt with an unknown result.
217
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_RateLimited`, `Internal_PayloadTooLarge`, `AionixFn_FunctionNotFound`, `AionixFn_VersionNotFound`, `Internal_NotFound`, `Internal_Conflict`.
218
+ *
219
+ * @param trn AionixFn resource TRN in the route path, for example trn:aionixfn:tenant:test0001:function/smoke/echo or trn:aionixfn:tenant:test0001:function/smoke/echo:v1 depending on the command
220
+ * @param options Call options.
221
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
222
+ */
223
+ sourceRead(trn: string, options?: CallOptions): Promise<AionixfnFunctionSourceReadResponse> {
224
+ return this.#engine.call<AionixfnFunctionSourceReadResponse>(OPERATIONS.aionixfn_function_source_read, { path: `/functions/${encodePathParam(trn)}/source`, primaryResourceTrn: trn }, options);
225
+ }
226
+
227
+ /**
228
+ * Submit function
229
+ *
230
+ * Submit a durable invocation for the current function version or an exact qualified version
231
+ *
232
+ * Create a durable invocation for the current version selected by a stable Function TRN, or the exact version selected by a qualified Function TRN
233
+ *
234
+ * Replay: the idempotency key replays the accepted execution for 3600 seconds.
235
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_PayloadTooLarge`, `Internal_UnsupportedMediaType`, `Internal_Timeout`, `Execution_PayloadLimitExceeded`, `AionixFn_FunctionNotFound`, `AionixFn_VersionNotFound`, `AionixFn_LayerNotFound`, `AionixFn_LayerVersionNotFound`, `AionixFn_InputSchemaViolation`, `AionixFn_ExecutionProfileUnsupported`, `AionixFn_ExecutionBackendUnavailable`, `Internal_IdempotencyKeyReused`, `Internal_Conflict`, `Internal_ConfigurationError`.
236
+ *
237
+ * @param trn AionixFn resource TRN in the route path, for example trn:aionixfn:tenant:test0001:function/smoke/echo or trn:aionixfn:tenant:test0001:function/smoke/echo:v1 depending on the command
238
+ * @param body The request body.
239
+ * @param options Call options.
240
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
241
+ */
242
+ submit(trn: string, body: SubmitFunctionRequest, options?: ExecutionCallOptions): Promise<AionixfnFunctionSubmitResponse> {
243
+ return this.#engine.call<AionixfnFunctionSubmitResponse>(OPERATIONS.aionixfn_function_submit, { path: `/functions/${encodePathParam(trn)}/submit`, body, primaryResourceTrn: trn }, options);
244
+ }
245
+
246
+ /**
247
+ * Delete function version
248
+ *
249
+ * Delete Function version
250
+ *
251
+ * Delete one immutable function version; the current version is refused
252
+ *
253
+ * Replay: not declared; an attempt with an unknown result is not retried.
254
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `AionixFn_FunctionNotFound`, `AionixFn_VersionNotFound`, `Declarative_RemovalBlocked`.
255
+ *
256
+ * @param trn Version TRN: the resource TRN with the v<n> qualifier of one version
257
+ * @param options Call options.
258
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
259
+ */
260
+ versionDelete(trn: string, options?: CallOptions): Promise<AionixfnFunctionVersionDeleteResponse> {
261
+ return this.#engine.call<AionixfnFunctionVersionDeleteResponse>(OPERATIONS.aionixfn_function_version_delete, { path: `/functions/${encodePathParam(trn)}/version`, primaryResourceTrn: trn }, options);
262
+ }
263
+
264
+ /**
265
+ * List function versions
266
+ *
267
+ * Read AionixFn resource
268
+ *
269
+ * List published versions for one function TRN
270
+ *
271
+ * Replay: has no effect; retried after an attempt with an unknown result.
272
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `AionixFn_FunctionNotFound`.
273
+ *
274
+ * @param trn Stable TRN of the versioned resource, without a version qualifier
275
+ * @param query The query, by wire names.
276
+ * @param options Call options.
277
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
278
+ */
279
+ versionList(trn: string, query?: AionixfnFunctionVersionListQuery, options?: CallOptions): Promise<AionixfnFunctionVersionListResponse> {
280
+ return this.#engine.call<AionixfnFunctionVersionListResponse>(OPERATIONS.aionixfn_function_version_list, { path: withQuery(`/functions/${encodePathParam(trn)}/versions`, query), primaryResourceTrn: trn }, options);
281
+ }
282
+
283
+ /**
284
+ * Every item of `aionixfn.function.version_list`, page after page, starting from `query`.
285
+ * Each page is one call with its own time budget and retries.
286
+ *
287
+ * @param trn Stable TRN of the versioned resource, without a version qualifier
288
+ * @param query The query of the first page; `limit` is the size of every page.
289
+ * @param options Call options of every page.
290
+ */
291
+ async *versionListIter(trn: string, query?: AionixfnFunctionVersionListQuery, options?: CallOptions): AsyncGenerator<AionixfnFunctionVersionListResponse['items'][number], void, undefined> {
292
+ let offset = query?.offset ?? 0;
293
+ for (;;) {
294
+ const response = await this.versionList(trn, { ...query, offset }, options);
295
+ const page = response;
296
+ yield* page.items;
297
+ if (!page.hasMore) return;
298
+ offset += page.items.length;
299
+ }
300
+ }
301
+
302
+ /**
303
+ * Read function version
304
+ *
305
+ * Read AionixFn resource
306
+ *
307
+ * Read one immutable function version and its frozen runtime metadata
308
+ *
309
+ * Replay: has no effect; retried after an attempt with an unknown result.
310
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `AionixFn_FunctionNotFound`, `AionixFn_VersionNotFound`.
311
+ *
312
+ * @param trn Version TRN: the resource TRN with the v<n> qualifier of one version
313
+ * @param options Call options.
314
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
315
+ */
316
+ versionRead(trn: string, options?: CallOptions): Promise<AionixfnFunctionVersionReadResponse> {
317
+ return this.#engine.call<AionixfnFunctionVersionReadResponse>(OPERATIONS.aionixfn_function_version_read, { path: `/functions/${encodePathParam(trn)}/version`, primaryResourceTrn: trn }, options);
318
+ }
319
+
320
+ /**
321
+ * Set the current function version
322
+ *
323
+ * Set the current Function version
324
+ *
325
+ * Point a function at one of its versions; stable invocations run it from now on
326
+ *
327
+ * Replay: not idempotent; an attempt answered with `AionixFn_FunctionNotFound`, `AionixFn_VersionNotFound` did not run.
328
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `AionixFn_FunctionNotFound`, `AionixFn_VersionNotFound`.
329
+ *
330
+ * @param trn Version TRN: the resource TRN with the v<n> qualifier of one version
331
+ * @param options Call options.
332
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
333
+ */
334
+ versionSetCurrent(trn: string, options?: CallOptions): Promise<AionixfnFunctionVersionSetCurrentResponse> {
335
+ return this.#engine.call<AionixfnFunctionVersionSetCurrentResponse>(OPERATIONS.aionixfn_function_version_set_current, { path: `/functions/${encodePathParam(trn)}/version/set-current`, primaryResourceTrn: trn }, options);
336
+ }
337
+ }
338
+
339
+ /** The `invocation` operations of the `aionixfn` service. */
340
+ export class AionixfnInvocationResource {
341
+ readonly #engine: CallEngine;
342
+
343
+ /** Not part of the public API. */
344
+ constructor(engine: CallEngine) {
345
+ this.#engine = engine;
346
+ }
347
+
348
+ /**
349
+ * Cancel invocation
350
+ *
351
+ * Cancel a running invocation
352
+ *
353
+ * Request cancellation for one invocation by its exact TRN
354
+ *
355
+ * Replay: not declared; an attempt with an unknown result is not retried.
356
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `AionixFn_InvocationNotFound`, `Internal_Conflict`.
357
+ *
358
+ * @param trn AionixFn resource TRN in the route path, for example trn:aionixfn:tenant:test0001:function/smoke/echo or trn:aionixfn:tenant:test0001:function/smoke/echo:v1 depending on the command
359
+ * @param body The request body.
360
+ * @param options Call options.
361
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
362
+ */
363
+ cancel(trn: string, body: DurableInvocationCancelRequest, options?: CallOptions): Promise<AionixfnInvocationCancelResponse> {
364
+ return this.#engine.call<AionixfnInvocationCancelResponse>(OPERATIONS.aionixfn_invocation_cancel, { path: `/invocations/${encodePathParam(trn)}/cancel`, body, primaryResourceTrn: trn }, options);
365
+ }
366
+
367
+ /**
368
+ * List invocations
369
+ *
370
+ * Read AionixFn resource
371
+ *
372
+ * List invocations recorded for one function or version lineage depending on the TRN you query
373
+ *
374
+ * Replay: has no effect; retried after an attempt with an unknown result.
375
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `AionixFn_FunctionNotFound`.
376
+ *
377
+ * @param trn AionixFn Function TRN whose invocations will be listed
378
+ * @param query The query, by wire names.
379
+ * @param options Call options.
380
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
381
+ */
382
+ list(trn: string, query?: AionixfnInvocationListQuery, options?: CallOptions): Promise<AionixfnInvocationListResponse> {
383
+ return this.#engine.call<AionixfnInvocationListResponse>(OPERATIONS.aionixfn_invocation_list, { path: withQuery(`/functions/${encodePathParam(trn)}/invocations`, query), primaryResourceTrn: trn }, options);
384
+ }
385
+
386
+ /**
387
+ * Every item of `aionixfn.invocation.list`, page after page, starting from `query`.
388
+ * Each page is one call with its own time budget and retries.
389
+ *
390
+ * @param trn AionixFn Function TRN whose invocations will be listed
391
+ * @param query The query of the first page; `limit` is the size of every page.
392
+ * @param options Call options of every page.
393
+ */
394
+ async *listIter(trn: string, query?: AionixfnInvocationListQuery, options?: CallOptions): AsyncGenerator<AionixfnInvocationListResponse['items'][number], void, undefined> {
395
+ let offset = query?.offset ?? 0;
396
+ for (;;) {
397
+ const response = await this.list(trn, { ...query, offset }, options);
398
+ const page = response;
399
+ yield* page.items;
400
+ if (!page.hasMore) return;
401
+ offset += page.items.length;
402
+ }
403
+ }
404
+
405
+ /**
406
+ * Read invocation
407
+ *
408
+ * Read AionixFn resource
409
+ *
410
+ * Read one invocation record, including status, input/output payloads, and execution metadata
411
+ *
412
+ * Replay: has no effect; retried after an attempt with an unknown result.
413
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `AionixFn_InvocationNotFound`.
414
+ *
415
+ * @param trn AionixFn resource TRN in the route path, for example trn:aionixfn:tenant:test0001:function/smoke/echo or trn:aionixfn:tenant:test0001:function/smoke/echo:v1 depending on the command
416
+ * @param options Call options.
417
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
418
+ */
419
+ read(trn: string, options?: CallOptions): Promise<AionixfnInvocationReadResponse> {
420
+ return this.#engine.call<AionixfnInvocationReadResponse>(OPERATIONS.aionixfn_invocation_read, { path: `/invocations/${encodePathParam(trn)}`, primaryResourceTrn: trn }, options);
421
+ }
422
+ }
423
+
424
+ /** The `layer` operations of the `aionixfn` service. */
425
+ export class AionixfnLayerResource {
426
+ readonly #engine: CallEngine;
427
+
428
+ /** Not part of the public API. */
429
+ constructor(engine: CallEngine) {
430
+ this.#engine = engine;
431
+ }
432
+
433
+ /**
434
+ * List layers
435
+ *
436
+ * List declaratively managed AionixFn Layers
437
+ *
438
+ * List declaratively managed layers with their current status
439
+ *
440
+ * Replay: has no effect; retried after an attempt with an unknown result.
441
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`.
442
+ *
443
+ * @param query The query, by wire names.
444
+ * @param options Call options.
445
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
446
+ */
447
+ list(query?: AionixfnLayerListQuery, options?: CallOptions): Promise<AionixfnLayerListResponse> {
448
+ return this.#engine.call<AionixfnLayerListResponse>(OPERATIONS.aionixfn_layer_list, { path: withQuery(`/layers`, query) }, options);
449
+ }
450
+
451
+ /**
452
+ * Every item of `aionixfn.layer.list`, page after page, starting from `query`.
453
+ * Each page is one call with its own time budget and retries.
454
+ *
455
+ * @param query The query of the first page; `limit` is the size of every page.
456
+ * @param options Call options of every page.
457
+ */
458
+ async *listIter(query?: AionixfnLayerListQuery, options?: CallOptions): AsyncGenerator<AionixfnLayerListResponse['items'][number], void, undefined> {
459
+ let offset = query?.offset ?? 0;
460
+ for (;;) {
461
+ const response = await this.list({ ...query, offset }, options);
462
+ const page = response;
463
+ yield* page.items;
464
+ if (!page.hasMore) return;
465
+ offset += page.items.length;
466
+ }
467
+ }
468
+
469
+ /**
470
+ * Read layer
471
+ *
472
+ * Read one declaratively managed AionixFn Layer
473
+ *
474
+ * Read one declaratively managed layer and its current status
475
+ *
476
+ * Replay: has no effect; retried after an attempt with an unknown result.
477
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `AionixFn_LayerNotFound`.
478
+ *
479
+ * @param trn AionixFn resource TRN in the route path, for example trn:aionixfn:tenant:test0001:function/smoke/echo or trn:aionixfn:tenant:test0001:function/smoke/echo:v1 depending on the command
480
+ * @param options Call options.
481
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
482
+ */
483
+ read(trn: string, options?: CallOptions): Promise<AionixfnLayerReadResponse> {
484
+ return this.#engine.call<AionixfnLayerReadResponse>(OPERATIONS.aionixfn_layer_read, { path: `/layers/${encodePathParam(trn)}`, primaryResourceTrn: trn }, options);
485
+ }
486
+
487
+ /**
488
+ * Delete layer version
489
+ *
490
+ * Delete one immutable AionixFn Layer version
491
+ *
492
+ * Delete one immutable layer version; the current version is refused
493
+ *
494
+ * Replay: not declared; an attempt with an unknown result is not retried.
495
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `AionixFn_LayerNotFound`, `AionixFn_LayerVersionNotFound`, `Declarative_RemovalBlocked`.
496
+ *
497
+ * @param trn Version TRN: the resource TRN with the v<n> qualifier of one version
498
+ * @param options Call options.
499
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
500
+ */
501
+ versionDelete(trn: string, options?: CallOptions): Promise<AionixfnLayerVersionDeleteResponse> {
502
+ return this.#engine.call<AionixfnLayerVersionDeleteResponse>(OPERATIONS.aionixfn_layer_version_delete, { path: `/layers/${encodePathParam(trn)}/version`, primaryResourceTrn: trn }, options);
503
+ }
504
+
505
+ /**
506
+ * Download layer version
507
+ *
508
+ * Download one immutable AionixFn Layer bundle
509
+ *
510
+ * Download the verified bundle for one exact layer version
511
+ *
512
+ * Replay: has no effect; retried after an attempt with an unknown result.
513
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `AionixFn_LayerVersionNotFound`, `Internal_NotFound`, `Internal_Conflict`.
514
+ *
515
+ * @param trn AionixFn resource TRN in the route path, for example trn:aionixfn:tenant:test0001:function/smoke/echo or trn:aionixfn:tenant:test0001:function/smoke/echo:v1 depending on the command
516
+ * @param options Call options.
517
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
518
+ */
519
+ versionDownload(trn: string, options?: CallOptions): Promise<AionixfnLayerVersionDownloadResponse> {
520
+ return this.#engine.call<AionixfnLayerVersionDownloadResponse>(OPERATIONS.aionixfn_layer_version_download, { path: `/layers/${encodePathParam(trn)}/version/download`, primaryResourceTrn: trn }, options);
521
+ }
522
+
523
+ /**
524
+ * List layer versions
525
+ *
526
+ * List immutable versions for one AionixFn Layer
527
+ *
528
+ * List immutable versions published for one layer
529
+ *
530
+ * Replay: has no effect; retried after an attempt with an unknown result.
531
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `AionixFn_LayerNotFound`.
532
+ *
533
+ * @param trn Stable TRN of the versioned resource, without a version qualifier
534
+ * @param query The query, by wire names.
535
+ * @param options Call options.
536
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
537
+ */
538
+ versionList(trn: string, query?: AionixfnLayerVersionListQuery, options?: CallOptions): Promise<AionixfnLayerVersionListResponse> {
539
+ return this.#engine.call<AionixfnLayerVersionListResponse>(OPERATIONS.aionixfn_layer_version_list, { path: withQuery(`/layers/${encodePathParam(trn)}/versions`, query), primaryResourceTrn: trn }, options);
540
+ }
541
+
542
+ /**
543
+ * Every item of `aionixfn.layer.version_list`, page after page, starting from `query`.
544
+ * Each page is one call with its own time budget and retries.
545
+ *
546
+ * @param trn Stable TRN of the versioned resource, without a version qualifier
547
+ * @param query The query of the first page; `limit` is the size of every page.
548
+ * @param options Call options of every page.
549
+ */
550
+ async *versionListIter(trn: string, query?: AionixfnLayerVersionListQuery, options?: CallOptions): AsyncGenerator<AionixfnLayerVersionListResponse['items'][number], void, undefined> {
551
+ let offset = query?.offset ?? 0;
552
+ for (;;) {
553
+ const response = await this.versionList(trn, { ...query, offset }, options);
554
+ const page = response;
555
+ yield* page.items;
556
+ if (!page.hasMore) return;
557
+ offset += page.items.length;
558
+ }
559
+ }
560
+
561
+ /**
562
+ * Read layer version
563
+ *
564
+ * Read one immutable AionixFn Layer version
565
+ *
566
+ * Read one immutable layer version and what it contributes to a function composition
567
+ *
568
+ * Replay: has no effect; retried after an attempt with an unknown result.
569
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `AionixFn_LayerVersionNotFound`.
570
+ *
571
+ * @param trn Version TRN: the resource TRN with the v<n> qualifier of one version
572
+ * @param options Call options.
573
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
574
+ */
575
+ versionRead(trn: string, options?: CallOptions): Promise<AionixfnLayerVersionReadResponse> {
576
+ return this.#engine.call<AionixfnLayerVersionReadResponse>(OPERATIONS.aionixfn_layer_version_read, { path: `/layers/${encodePathParam(trn)}/version`, primaryResourceTrn: trn }, options);
577
+ }
578
+
579
+ /**
580
+ * Set the current layer version
581
+ *
582
+ * Set the current Layer version
583
+ *
584
+ * Point a layer at one of its versions; stable references resolve to it from now on
585
+ *
586
+ * Replay: not idempotent; an attempt answered with `AionixFn_LayerNotFound`, `AionixFn_LayerVersionNotFound` did not run.
587
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `AionixFn_LayerNotFound`, `AionixFn_LayerVersionNotFound`.
588
+ *
589
+ * @param trn Version TRN: the resource TRN with the v<n> qualifier of one version
590
+ * @param options Call options.
591
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
592
+ */
593
+ versionSetCurrent(trn: string, options?: CallOptions): Promise<AionixfnLayerVersionSetCurrentResponse> {
594
+ return this.#engine.call<AionixfnLayerVersionSetCurrentResponse>(OPERATIONS.aionixfn_layer_version_set_current, { path: `/layers/${encodePathParam(trn)}/version/set-current`, primaryResourceTrn: trn }, options);
595
+ }
596
+ }