bem-ai-sdk 0.1.0 → 0.2.0

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 (41) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +9 -0
  3. package/client.d.mts +2 -2
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +2 -2
  6. package/client.d.ts.map +1 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs.map +1 -1
  9. package/package.json +1 -1
  10. package/resources/index.d.mts +1 -1
  11. package/resources/index.d.mts.map +1 -1
  12. package/resources/index.d.ts +1 -1
  13. package/resources/index.d.ts.map +1 -1
  14. package/resources/index.js.map +1 -1
  15. package/resources/index.mjs.map +1 -1
  16. package/resources/workflows/index.d.mts +1 -1
  17. package/resources/workflows/index.d.mts.map +1 -1
  18. package/resources/workflows/index.d.ts +1 -1
  19. package/resources/workflows/index.d.ts.map +1 -1
  20. package/resources/workflows/index.js.map +1 -1
  21. package/resources/workflows/index.mjs.map +1 -1
  22. package/resources/workflows/versions.d.mts +3 -0
  23. package/resources/workflows/versions.d.mts.map +1 -1
  24. package/resources/workflows/versions.d.ts +3 -0
  25. package/resources/workflows/versions.d.ts.map +1 -1
  26. package/resources/workflows/workflows.d.mts +169 -102
  27. package/resources/workflows/workflows.d.mts.map +1 -1
  28. package/resources/workflows/workflows.d.ts +169 -102
  29. package/resources/workflows/workflows.d.ts.map +1 -1
  30. package/resources/workflows/workflows.js.map +1 -1
  31. package/resources/workflows/workflows.mjs.map +1 -1
  32. package/src/client.ts +6 -2
  33. package/src/resources/index.ts +3 -1
  34. package/src/resources/workflows/index.ts +3 -1
  35. package/src/resources/workflows/versions.ts +3 -0
  36. package/src/resources/workflows/workflows.ts +187 -106
  37. package/src/version.ts +1 -1
  38. package/version.d.mts +1 -1
  39. package/version.d.ts +1 -1
  40. package/version.js +1 -1
  41. package/version.mjs +1 -1
@@ -132,99 +132,121 @@ export interface FunctionVersionIdentifier {
132
132
  versionNum?: number;
133
133
  }
134
134
 
135
+ /**
136
+ * V3 read representation of a workflow version.
137
+ */
135
138
  export interface Workflow {
136
139
  /**
137
- * Unique identifier of workflow.
140
+ * Unique identifier of the workflow.
138
141
  */
139
142
  id: string;
140
143
 
141
- mainFunction: FunctionVersionIdentifier;
144
+ /**
145
+ * The date and time the workflow was created.
146
+ */
147
+ createdAt: string;
148
+
149
+ /**
150
+ * All directed edges in this workflow version's DAG.
151
+ */
152
+ edges: Array<WorkflowEdgeResponse>;
142
153
 
143
154
  /**
144
- * Unique name of workflow. Must be UNIQUE on a per-environment basis.
155
+ * Name of the entry-point call-site node.
156
+ */
157
+ mainNodeName: string;
158
+
159
+ /**
160
+ * Unique name of the workflow within the environment.
145
161
  */
146
162
  name: string;
147
163
 
148
164
  /**
149
- * Version number of workflow version.
165
+ * All call-site nodes in this workflow version's DAG.
150
166
  */
151
- versionNum: number;
167
+ nodes: Array<WorkflowNodeResponse>;
152
168
 
153
169
  /**
154
- * Audit trail information for the workflow.
170
+ * The date and time the workflow was last updated.
155
171
  */
156
- audit?: Workflow.Audit;
172
+ updatedAt: string;
157
173
 
158
174
  /**
159
- * The date and time the workflow was created.
175
+ * Version number of this workflow version.
176
+ */
177
+ versionNum: number;
178
+
179
+ /**
180
+ * Audit trail information.
160
181
  */
161
- createdAt?: string;
182
+ audit?: WorkflowAudit;
162
183
 
163
184
  /**
164
- * Display name of workflow.
185
+ * Human-readable display name.
165
186
  */
166
187
  displayName?: string;
167
188
 
168
189
  /**
169
- * Email address of workflow.
190
+ * Inbound email address associated with the workflow, if any.
170
191
  */
171
192
  emailAddress?: string;
172
193
 
173
- relationships?: Array<Workflow.Relationship>;
174
-
175
194
  /**
176
- * Array of tags to categorize and organize workflows.
195
+ * Tags associated with the workflow.
177
196
  */
178
197
  tags?: Array<string>;
198
+ }
179
199
 
200
+ export interface WorkflowAudit {
180
201
  /**
181
- * The date and time the workflow was last updated.
202
+ * Information about who created the current version.
182
203
  */
183
- updatedAt?: string;
184
- }
204
+ versionCreatedBy?: FunctionsAPI.UserActionSummary;
185
205
 
186
- export namespace Workflow {
187
206
  /**
188
- * Audit trail information for the workflow.
207
+ * Information about who created the workflow.
189
208
  */
190
- export interface Audit {
191
- /**
192
- * Information about who created the current version.
193
- */
194
- versionCreatedBy?: FunctionsAPI.UserActionSummary;
195
-
196
- /**
197
- * Information about who created the workflow.
198
- */
199
- workflowCreatedBy?: FunctionsAPI.UserActionSummary;
209
+ workflowCreatedBy?: FunctionsAPI.UserActionSummary;
200
210
 
201
- /**
202
- * Information about who last updated the workflow.
203
- */
204
- workflowLastUpdatedBy?: FunctionsAPI.UserActionSummary;
205
- }
211
+ /**
212
+ * Information about who last updated the workflow.
213
+ */
214
+ workflowLastUpdatedBy?: FunctionsAPI.UserActionSummary;
215
+ }
206
216
 
207
- export interface Relationship {
208
- destinationFunction: WorkflowsAPI.FunctionVersionIdentifier;
217
+ /**
218
+ * Read representation of a directed edge between call-site nodes.
219
+ */
220
+ export interface WorkflowEdgeResponse {
221
+ /**
222
+ * Name of the destination node.
223
+ */
224
+ destinationNodeName: string;
209
225
 
210
- sourceFunction: WorkflowsAPI.FunctionVersionIdentifier;
226
+ /**
227
+ * Name of the source node.
228
+ */
229
+ sourceNodeName: string;
211
230
 
212
- /**
213
- * Name of destination.
214
- */
215
- destinationName?: string;
216
- }
231
+ /**
232
+ * Labelled outlet on the source node, if any.
233
+ */
234
+ destinationName?: string;
217
235
  }
218
236
 
219
- export interface WorkflowRequestRelationship {
220
- destinationFunction: FunctionVersionIdentifier;
221
-
222
- sourceFunction: FunctionVersionIdentifier;
237
+ /**
238
+ * Read representation of a call-site node.
239
+ */
240
+ export interface WorkflowNodeResponse {
241
+ /**
242
+ * Function (and version) executing at this call site.
243
+ */
244
+ function: FunctionVersionIdentifier;
223
245
 
224
246
  /**
225
- * Name of destination.
247
+ * Name of this call site, unique within the workflow version.
226
248
  */
227
- destinationName?: string;
249
+ name: string;
228
250
  }
229
251
 
230
252
  export interface WorkflowCreateResponse {
@@ -233,6 +255,9 @@ export interface WorkflowCreateResponse {
233
255
  */
234
256
  error?: string;
235
257
 
258
+ /**
259
+ * V3 read representation of a workflow version.
260
+ */
236
261
  workflow?: Workflow;
237
262
  }
238
263
 
@@ -242,6 +267,9 @@ export interface WorkflowRetrieveResponse {
242
267
  */
243
268
  error?: string;
244
269
 
270
+ /**
271
+ * V3 read representation of a workflow version.
272
+ */
245
273
  workflow?: Workflow;
246
274
  }
247
275
 
@@ -251,18 +279,21 @@ export interface WorkflowUpdateResponse {
251
279
  */
252
280
  error?: string;
253
281
 
282
+ /**
283
+ * V3 read representation of a workflow version.
284
+ */
254
285
  workflow?: Workflow;
255
286
  }
256
287
 
257
288
  export interface WorkflowCopyResponse {
258
289
  /**
259
- * Information about functions that were copied when copying to a different
260
- * environment. Empty when copying within the same environment.
290
+ * Functions that were copied when copying to a different environment. Empty when
291
+ * copying within the same environment.
261
292
  */
262
293
  copiedFunctions?: Array<WorkflowCopyResponse.CopiedFunction>;
263
294
 
264
295
  /**
265
- * The environment where the workflow was copied to.
296
+ * The environment the workflow was copied to.
266
297
  */
267
298
  environment?: string;
268
299
 
@@ -272,7 +303,7 @@ export interface WorkflowCopyResponse {
272
303
  error?: string;
273
304
 
274
305
  /**
275
- * The newly created workflow.
306
+ * V3 read representation of a workflow version.
276
307
  */
277
308
  workflow?: Workflow;
278
309
  }
@@ -313,92 +344,140 @@ export namespace WorkflowCopyResponse {
313
344
 
314
345
  export interface WorkflowCreateParams {
315
346
  /**
316
- * Display name of workflow.
347
+ * Name of the entry-point node. Must not be a destination of any edge.
317
348
  */
318
- displayName?: string;
349
+ mainNodeName: string;
319
350
 
320
351
  /**
321
- * Main function for the workflow. The `mainFunction` and `relationships` fields
322
- * act as a unit and must be provided together, or neither provided.
323
- *
324
- * - If `mainFunction` is provided without `relationships`, relationships will
325
- * default to an empty array.
326
- * - If `relationships` is provided, `mainFunction` must also be provided
327
- * (validation error if missing).
328
- * - If neither is provided, both mainFunction and relationships remain unchanged
329
- * from the current workflow version.
352
+ * Unique name for the workflow. Must match `^[a-zA-Z0-9_-]{1,128}$`.
330
353
  */
331
- mainFunction?: FunctionVersionIdentifier;
354
+ name: string;
332
355
 
333
356
  /**
334
- * Name of workflow. Can be updated to rename the workflow. Must be unique within
335
- * the environment and match the pattern ^[a-zA-Z0-9_-]{1,128}$.
357
+ * Call-site nodes in the DAG. At least one is required.
336
358
  */
337
- name?: string;
359
+ nodes: Array<WorkflowCreateParams.Node>;
338
360
 
339
361
  /**
340
- * Relationships between functions in the workflow. The `mainFunction` and
341
- * `relationships` fields act as a unit and must be provided together, or neither
342
- * provided.
343
- *
344
- * - If `relationships` is provided, `mainFunction` must also be provided
345
- * (validation error if missing).
346
- * - If `mainFunction` is provided without `relationships`, relationships will
347
- * default to an empty array.
348
- * - If neither is provided, both mainFunction and relationships remain unchanged
349
- * from the current workflow version.
362
+ * Human-readable display name.
350
363
  */
351
- relationships?: Array<WorkflowRequestRelationship>;
364
+ displayName?: string;
352
365
 
353
366
  /**
354
- * Array of tags to categorize and organize workflows.
367
+ * Directed edges between nodes. Omit or leave empty for single-node workflows.
368
+ */
369
+ edges?: Array<WorkflowCreateParams.Edge>;
370
+
371
+ /**
372
+ * Tags to categorize and organize the workflow.
355
373
  */
356
374
  tags?: Array<string>;
357
375
  }
358
376
 
377
+ export namespace WorkflowCreateParams {
378
+ /**
379
+ * A single function call-site node in a workflow DAG.
380
+ */
381
+ export interface Node {
382
+ /**
383
+ * The function (and version) to execute at this call site.
384
+ */
385
+ function: WorkflowsAPI.FunctionVersionIdentifier;
386
+
387
+ /**
388
+ * Name for this call site. Must be unique within the workflow version. Defaults to
389
+ * the function's own name when omitted.
390
+ */
391
+ name?: string;
392
+ }
393
+
394
+ /**
395
+ * A directed edge between two named call-site nodes.
396
+ */
397
+ export interface Edge {
398
+ /**
399
+ * Name of the destination node.
400
+ */
401
+ destinationNodeName: string;
402
+
403
+ /**
404
+ * Name of the source node.
405
+ */
406
+ sourceNodeName: string;
407
+
408
+ /**
409
+ * Labelled outlet on the source node that activates this edge. Omit for the
410
+ * default (unlabelled) outlet.
411
+ */
412
+ destinationName?: string;
413
+ }
414
+ }
415
+
359
416
  export interface WorkflowUpdateParams {
360
417
  /**
361
- * Display name of workflow.
418
+ * Human-readable display name.
362
419
  */
363
420
  displayName?: string;
364
421
 
422
+ edges?: Array<WorkflowUpdateParams.Edge>;
423
+
365
424
  /**
366
- * Main function for the workflow. The `mainFunction` and `relationships` fields
367
- * act as a unit and must be provided together, or neither provided.
368
- *
369
- * - If `mainFunction` is provided without `relationships`, relationships will
370
- * default to an empty array.
371
- * - If `relationships` is provided, `mainFunction` must also be provided
372
- * (validation error if missing).
373
- * - If neither is provided, both mainFunction and relationships remain unchanged
374
- * from the current workflow version.
425
+ * `mainNodeName`, `nodes`, and `edges` must be provided together to update the DAG
426
+ * topology. If none are provided the topology is copied unchanged from the current
427
+ * version.
375
428
  */
376
- mainFunction?: FunctionVersionIdentifier;
429
+ mainNodeName?: string;
377
430
 
378
431
  /**
379
- * Name of workflow. Can be updated to rename the workflow. Must be unique within
380
- * the environment and match the pattern ^[a-zA-Z0-9_-]{1,128}$.
432
+ * New name for the workflow (renames it). Must match `^[a-zA-Z0-9_-]{1,128}$`.
381
433
  */
382
434
  name?: string;
383
435
 
436
+ nodes?: Array<WorkflowUpdateParams.Node>;
437
+
384
438
  /**
385
- * Relationships between functions in the workflow. The `mainFunction` and
386
- * `relationships` fields act as a unit and must be provided together, or neither
387
- * provided.
388
- *
389
- * - If `relationships` is provided, `mainFunction` must also be provided
390
- * (validation error if missing).
391
- * - If `mainFunction` is provided without `relationships`, relationships will
392
- * default to an empty array.
393
- * - If neither is provided, both mainFunction and relationships remain unchanged
394
- * from the current workflow version.
439
+ * Tags to categorize and organize the workflow.
395
440
  */
396
- relationships?: Array<WorkflowRequestRelationship>;
441
+ tags?: Array<string>;
442
+ }
397
443
 
444
+ export namespace WorkflowUpdateParams {
398
445
  /**
399
- * Array of tags to categorize and organize workflows.
446
+ * A directed edge between two named call-site nodes.
400
447
  */
401
- tags?: Array<string>;
448
+ export interface Edge {
449
+ /**
450
+ * Name of the destination node.
451
+ */
452
+ destinationNodeName: string;
453
+
454
+ /**
455
+ * Name of the source node.
456
+ */
457
+ sourceNodeName: string;
458
+
459
+ /**
460
+ * Labelled outlet on the source node that activates this edge. Omit for the
461
+ * default (unlabelled) outlet.
462
+ */
463
+ destinationName?: string;
464
+ }
465
+
466
+ /**
467
+ * A single function call-site node in a workflow DAG.
468
+ */
469
+ export interface Node {
470
+ /**
471
+ * The function (and version) to execute at this call site.
472
+ */
473
+ function: WorkflowsAPI.FunctionVersionIdentifier;
474
+
475
+ /**
476
+ * Name for this call site. Must be unique within the workflow version. Defaults to
477
+ * the function's own name when omitted.
478
+ */
479
+ name?: string;
480
+ }
402
481
  }
403
482
 
404
483
  export interface WorkflowListParams extends WorkflowsPageParams {
@@ -483,7 +562,9 @@ export declare namespace Workflows {
483
562
  export {
484
563
  type FunctionVersionIdentifier as FunctionVersionIdentifier,
485
564
  type Workflow as Workflow,
486
- type WorkflowRequestRelationship as WorkflowRequestRelationship,
565
+ type WorkflowAudit as WorkflowAudit,
566
+ type WorkflowEdgeResponse as WorkflowEdgeResponse,
567
+ type WorkflowNodeResponse as WorkflowNodeResponse,
487
568
  type WorkflowCreateResponse as WorkflowCreateResponse,
488
569
  type WorkflowRetrieveResponse as WorkflowRetrieveResponse,
489
570
  type WorkflowUpdateResponse as WorkflowUpdateResponse,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.1.0'; // x-release-please-version
1
+ export const VERSION = '0.2.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.1.0";
1
+ export declare const VERSION = "0.2.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.1.0";
1
+ export declare const VERSION = "0.2.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.1.0'; // x-release-please-version
4
+ exports.VERSION = '0.2.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.1.0'; // x-release-please-version
1
+ export const VERSION = '0.2.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map