@soat/sdk 0.15.7 → 0.15.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -2185,7 +2185,7 @@ var Orchestrations = class {
2185
2185
  /**
2186
2186
  * Create an orchestration
2187
2187
  *
2188
- * Creates a new orchestration workflow definition in the project.
2188
+ * Creates a new orchestration (pipeline) definition in the project.
2189
2189
  */
2190
2190
  static createOrchestration(options) {
2191
2191
  return (options.client ?? client).post({
@@ -2711,6 +2711,97 @@ var Sessions = class {
2711
2711
  });
2712
2712
  }
2713
2713
  };
2714
+ var Tasks = class {
2715
+ /**
2716
+ * List tasks
2717
+ *
2718
+ * Lists tasks (the board query). Filter by workflow, state, status, or assignee — `GET /tasks?workflow_id=...&state=...` is one board column.
2719
+ */
2720
+ static listTasks(options) {
2721
+ return (options?.client ?? client).get({
2722
+ url: "/api/v1/tasks",
2723
+ ...options
2724
+ });
2725
+ }
2726
+ /**
2727
+ * Create a task
2728
+ *
2729
+ * Creates a task bound to a workflow. The task is placed in the workflow's initial state and that state's `on_enter` automation fires.
2730
+ */
2731
+ static createTask(options) {
2732
+ return (options.client ?? client).post({
2733
+ url: "/api/v1/tasks",
2734
+ ...options,
2735
+ headers: {
2736
+ "Content-Type": "application/json",
2737
+ ...options.headers
2738
+ }
2739
+ });
2740
+ }
2741
+ /**
2742
+ * Delete a task
2743
+ *
2744
+ * Deletes a task. Its transition history cascades.
2745
+ */
2746
+ static deleteTask(options) {
2747
+ return (options.client ?? client).delete({
2748
+ url: "/api/v1/tasks/{task_id}",
2749
+ ...options
2750
+ });
2751
+ }
2752
+ /**
2753
+ * Get a task
2754
+ *
2755
+ * Retrieves a task, including its active dispatch and automation status.
2756
+ */
2757
+ static getTask(options) {
2758
+ return (options.client ?? client).get({
2759
+ url: "/api/v1/tasks/{task_id}",
2760
+ ...options
2761
+ });
2762
+ }
2763
+ /**
2764
+ * Update a task
2765
+ *
2766
+ * Updates a task's payload, title, or assignee. `state` is never directly writable — move it with a transition. `payload` is shallow-merged over the existing payload (PATCH semantics): keys the request omits are preserved, so setting one field never discards values an on_enter automation wrote (e.g. `last_result`). The merged payload is validated against the workflow's `payload_schema`.
2767
+ */
2768
+ static updateTask(options) {
2769
+ return (options.client ?? client).patch({
2770
+ url: "/api/v1/tasks/{task_id}",
2771
+ ...options,
2772
+ headers: {
2773
+ "Content-Type": "application/json",
2774
+ ...options.headers
2775
+ }
2776
+ });
2777
+ }
2778
+ /**
2779
+ * Transition a task
2780
+ *
2781
+ * Fires a named transition on a task. The transition must exist in the workflow and be valid from the task's current state; its guard must pass. This is the single path every state change routes through.
2782
+ */
2783
+ static transitionTask(options) {
2784
+ return (options.client ?? client).post({
2785
+ url: "/api/v1/tasks/{task_id}/transitions",
2786
+ ...options,
2787
+ headers: {
2788
+ "Content-Type": "application/json",
2789
+ ...options.headers
2790
+ }
2791
+ });
2792
+ }
2793
+ /**
2794
+ * Get task history
2795
+ *
2796
+ * Returns the append-only transition history of a task.
2797
+ */
2798
+ static getTaskHistory(options) {
2799
+ return (options.client ?? client).get({
2800
+ url: "/api/v1/tasks/{task_id}/history",
2801
+ ...options
2802
+ });
2803
+ }
2804
+ };
2714
2805
  var Tools = class {
2715
2806
  /**
2716
2807
  * List tools
@@ -3275,6 +3366,71 @@ var Webhooks = class {
3275
3366
  });
3276
3367
  }
3277
3368
  };
3369
+ var Workflows = class {
3370
+ /**
3371
+ * List workflows
3372
+ *
3373
+ * Lists workflow definitions in a project.
3374
+ */
3375
+ static listWorkflows(options) {
3376
+ return (options?.client ?? client).get({
3377
+ url: "/api/v1/workflows",
3378
+ ...options
3379
+ });
3380
+ }
3381
+ /**
3382
+ * Create a workflow
3383
+ *
3384
+ * Creates a new workflow definition. The definition is statically validated.
3385
+ */
3386
+ static createWorkflow(options) {
3387
+ return (options.client ?? client).post({
3388
+ url: "/api/v1/workflows",
3389
+ ...options,
3390
+ headers: {
3391
+ "Content-Type": "application/json",
3392
+ ...options.headers
3393
+ }
3394
+ });
3395
+ }
3396
+ /**
3397
+ * Delete a workflow
3398
+ *
3399
+ * Deletes a workflow. Rejected while open tasks exist.
3400
+ */
3401
+ static deleteWorkflow(options) {
3402
+ return (options.client ?? client).delete({
3403
+ url: "/api/v1/workflows/{workflow_id}",
3404
+ ...options
3405
+ });
3406
+ }
3407
+ /**
3408
+ * Get a workflow
3409
+ *
3410
+ * Retrieves a workflow definition.
3411
+ */
3412
+ static getWorkflow(options) {
3413
+ return (options.client ?? client).get({
3414
+ url: "/api/v1/workflows/{workflow_id}",
3415
+ ...options
3416
+ });
3417
+ }
3418
+ /**
3419
+ * Update a workflow
3420
+ *
3421
+ * Updates a workflow definition. Structural changes (states/transitions) are re-validated. Existing tasks in a removed state stay put but can only leave via transitions valid in the new definition.
3422
+ */
3423
+ static updateWorkflow(options) {
3424
+ return (options.client ?? client).patch({
3425
+ url: "/api/v1/workflows/{workflow_id}",
3426
+ ...options,
3427
+ headers: {
3428
+ "Content-Type": "application/json",
3429
+ ...options.headers
3430
+ }
3431
+ });
3432
+ }
3433
+ };
3278
3434
  //#endregion
3279
3435
  //#region src/soatClient.ts
3280
3436
  /**
@@ -3400,11 +3556,13 @@ exports.Projects = Projects;
3400
3556
  exports.Secrets = Secrets;
3401
3557
  exports.Sessions = Sessions;
3402
3558
  exports.SoatClient = SoatClient;
3559
+ exports.Tasks = Tasks;
3403
3560
  exports.Tools = Tools;
3404
3561
  exports.Traces = Traces;
3405
3562
  exports.Triggers = Triggers;
3406
3563
  exports.Usage = Usage;
3407
3564
  exports.Users = Users;
3408
3565
  exports.Webhooks = Webhooks;
3566
+ exports.Workflows = Workflows;
3409
3567
  exports.createClient = createClient;
3410
3568
  exports.createConfig = createConfig;