@epilot/automation-client 2.12.2 → 2.13.1

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/openapi.d.ts CHANGED
@@ -39,17 +39,24 @@ declare namespace Components {
39
39
  /**
40
40
  * Schedule Id
41
41
  */
42
- id?: string;
42
+ id: string;
43
43
  /**
44
- * The id of the configured scheduler
44
+ * The id of the configured scheduler which will be added on automation triggered
45
45
  */
46
- scheduleId?: string;
46
+ configuredSchedulerId?: string;
47
+ source: /* The source of the schedule_at timestamp that will be used to schedule the action */ ActionScheduleSource;
48
+ }
49
+ /**
50
+ * The source of the schedule_at timestamp that will be used to schedule the action
51
+ */
52
+ export interface ActionScheduleSource {
47
53
  /**
48
- * The source of the schedule_at timestamp that will be used to schedule the action
54
+ * The iGd of the action or trigger
49
55
  */
50
- source?: {
51
- [key: string]: any;
52
- };
56
+ id: string;
57
+ origin: "trigger" | "action";
58
+ schema: string;
59
+ attribute: string;
53
60
  }
54
61
  /**
55
62
  * example:
@@ -819,14 +826,16 @@ declare namespace Components {
819
826
  AutomationFlowId;
820
827
  /**
821
828
  * Status of the bulk trigger automation job
822
- * * APPROVAL: Waiting for user approval to start the bulk trigger automation
823
- * * IN_PROGRESS: Bulk trigger automation execution is in progress
824
- * * SUCCESS: Bulk trigger automation execution is completed successfully
825
- * * FAILED: Bulk trigger automation execution is failed
826
- * * CANCELLED: Bulk trigger automation execution was cancelled
829
+ * * approval: Waiting for user approval to start the bulk trigger automation
830
+ * * starting: Starting automation executions
831
+ * * in_progress: Automation execution are currently running
832
+ * * send_report: Automation executions finished running. Report is being created & sent to the user who initiated the bulk trigger automation
833
+ * * finished: Automation executions finished running. Some may have failed. Check the status of each entity.
834
+ * * failed: Bulk trigger automation execution failed. Some executions might have started. Check the status of each entity.
835
+ * * cancelled: Bulk trigger automation execution was cancelled
827
836
  *
828
837
  */
829
- status: "APPROVAL" | "IN_PROGRESS" | "SUCCESS" | "FAILED" | "CANCELLED";
838
+ status: "approval" | "starting" | "in_progress" | "send_report" | "finished" | "failed" | "cancelled";
830
839
  /**
831
840
  * User ID who created the bulk trigger automation job
832
841
  * example:
@@ -846,54 +855,9 @@ declare namespace Components {
846
855
  */
847
856
  task_token?: string;
848
857
  /**
849
- * List of entity ids that are waiting for triggering automation
850
- */
851
- pending?: {
852
- entity_id: /**
853
- * example:
854
- * e3d3ebac-baab-4395-abf4-50b5bf1f8b74
855
- */
856
- EntityId;
857
- }[];
858
- /**
859
- * List of entity ids and automation execution ids that were triggered successfully
858
+ * List of entities & their automation execution id & status
860
859
  */
861
- triggered?: {
862
- entity_id: /**
863
- * example:
864
- * e3d3ebac-baab-4395-abf4-50b5bf1f8b74
865
- */
866
- EntityId;
867
- execution_id: /**
868
- * example:
869
- * 9baf184f-bc81-4128-bca3-d974c90a12c4
870
- */
871
- AutomationExecutionId;
872
- }[];
873
- /**
874
- * List of entity ids that were skipped or failed
875
- */
876
- failed?: {
877
- entity_id: /**
878
- * example:
879
- * e3d3ebac-baab-4395-abf4-50b5bf1f8b74
880
- */
881
- EntityId;
882
- /**
883
- * Error message for the failed automation execution
884
- */
885
- error: string;
886
- }[];
887
- /**
888
- * List of entity ids that were cancelled from triggering automation
889
- */
890
- cancelled?: {
891
- entity_id: /**
892
- * example:
893
- * e3d3ebac-baab-4395-abf4-50b5bf1f8b74
894
- */
895
- EntityId;
896
- }[];
860
+ execution_summary: /* Execution item for bulk trigger automation. It maps each entity to its automation execution id & status */ ExecItem[];
897
861
  }
898
862
  export interface BulkTriggerRequest {
899
863
  flow_id: /**
@@ -1494,7 +1458,7 @@ declare namespace Components {
1494
1458
  export interface EqualsIgnoreCaseCondition {
1495
1459
  "equals-ignore-case"?: string;
1496
1460
  }
1497
- export type ErrorCode = "MAPPING_ERROR" | "REFRESH_RELATIONS_ERROR" | "DUPLICATE_ENTITY_ERROR" | "TRIGGER_WORKFLOW_ERROR" | "TIMEOUT_ERROR" | "BAD_CONFIG" | "INTERNAL_ERROR" | "TRIGGER_WEBHOOK_ERROR" | "TEMPLATE_ERROR" | "INVALID_PAYLOAD";
1461
+ export type ErrorCode = "MAPPING_ERROR" | "REFRESH_RELATIONS_ERROR" | "DUPLICATE_ENTITY_ERROR" | "TRIGGER_WORKFLOW_ERROR" | "TIMEOUT_ERROR" | "BAD_CONFIG" | "INTERNAL_ERROR" | "TRIGGER_WEBHOOK_ERROR" | "TEMPLATE_ERROR" | "INVALID_PAYLOAD" | "INVALID_SCHEDULE_CONFIG";
1498
1462
  export interface ErrorDetail {
1499
1463
  explanation: string;
1500
1464
  context?: string;
@@ -1508,6 +1472,26 @@ declare namespace Components {
1508
1472
  details?: ErrorDetail[];
1509
1473
  };
1510
1474
  }
1475
+ /**
1476
+ * Execution item for bulk trigger automation. It maps each entity to its automation execution id & status
1477
+ */
1478
+ export interface ExecItem {
1479
+ entity_id: /**
1480
+ * example:
1481
+ * e3d3ebac-baab-4395-abf4-50b5bf1f8b74
1482
+ */
1483
+ EntityId;
1484
+ execution_id?: /**
1485
+ * example:
1486
+ * 9baf184f-bc81-4128-bca3-d974c90a12c4
1487
+ */
1488
+ AutomationExecutionId;
1489
+ execution_status: ExecutionStatus;
1490
+ /**
1491
+ * Error message for the failed automation execution
1492
+ */
1493
+ error?: string;
1494
+ }
1511
1495
  export type ExecutionStatus = "pending" | "in_progress" | "paused" | "success" | "failed" | "cancelled" | "skipped" | "scheduled";
1512
1496
  export interface ExistsCondition {
1513
1497
  exists?: boolean;
@@ -2603,6 +2587,7 @@ declare namespace Components {
2603
2587
  * ]
2604
2588
  */
2605
2589
  AssignUsersToStep[];
2590
+ filter_with_purposes?: boolean;
2606
2591
  }
2607
2592
  export interface WildcardCondition {
2608
2593
  wildcard?: string;
@@ -3138,6 +3123,7 @@ export type Client = OpenAPIClient<OperationMethods, PathsDictionary>
3138
3123
 
3139
3124
  export type ActionCondition = Components.Schemas.ActionCondition;
3140
3125
  export type ActionSchedule = Components.Schemas.ActionSchedule;
3126
+ export type ActionScheduleSource = Components.Schemas.ActionScheduleSource;
3141
3127
  export type ActivityId = Components.Schemas.ActivityId;
3142
3128
  export type ActivityTrigger = Components.Schemas.ActivityTrigger;
3143
3129
  export type AnyAction = Components.Schemas.AnyAction;
@@ -3180,6 +3166,7 @@ export type EqualsIgnoreCaseCondition = Components.Schemas.EqualsIgnoreCaseCondi
3180
3166
  export type ErrorCode = Components.Schemas.ErrorCode;
3181
3167
  export type ErrorDetail = Components.Schemas.ErrorDetail;
3182
3168
  export type ErrorOutput = Components.Schemas.ErrorOutput;
3169
+ export type ExecItem = Components.Schemas.ExecItem;
3183
3170
  export type ExecutionStatus = Components.Schemas.ExecutionStatus;
3184
3171
  export type ExistsCondition = Components.Schemas.ExistsCondition;
3185
3172
  export type FilterConditionOnEvent = Components.Schemas.FilterConditionOnEvent;
package/dist/openapi.json CHANGED
@@ -909,7 +909,8 @@
909
909
  "INTERNAL_ERROR",
910
910
  "TRIGGER_WEBHOOK_ERROR",
911
911
  "TEMPLATE_ERROR",
912
- "INVALID_PAYLOAD"
912
+ "INVALID_PAYLOAD",
913
+ "INVALID_SCHEDULE_CONFIG"
913
914
  ]
914
915
  },
915
916
  "ErrorDetail": {
@@ -1804,6 +1805,9 @@
1804
1805
  "items": {
1805
1806
  "$ref": "#/components/schemas/AssignUsersToStep"
1806
1807
  }
1808
+ },
1809
+ "filter_with_purposes": {
1810
+ "type": "boolean"
1807
1811
  }
1808
1812
  }
1809
1813
  },
@@ -2071,6 +2075,35 @@
2071
2075
  }
2072
2076
  }
2073
2077
  },
2078
+ "ActionScheduleSource": {
2079
+ "type": "object",
2080
+ "description": "The source of the schedule_at timestamp that will be used to schedule the action",
2081
+ "properties": {
2082
+ "id": {
2083
+ "type": "string",
2084
+ "description": "The iGd of the action or trigger"
2085
+ },
2086
+ "origin": {
2087
+ "type": "string",
2088
+ "enum": [
2089
+ "trigger",
2090
+ "action"
2091
+ ]
2092
+ },
2093
+ "schema": {
2094
+ "type": "string"
2095
+ },
2096
+ "attribute": {
2097
+ "type": "string"
2098
+ }
2099
+ },
2100
+ "required": [
2101
+ "id",
2102
+ "origin",
2103
+ "schema",
2104
+ "attribute"
2105
+ ]
2106
+ },
2074
2107
  "ActionSchedule": {
2075
2108
  "type": "object",
2076
2109
  "properties": {
@@ -2078,32 +2111,18 @@
2078
2111
  "type": "string",
2079
2112
  "description": "Schedule Id"
2080
2113
  },
2081
- "scheduleId": {
2114
+ "configuredSchedulerId": {
2082
2115
  "type": "string",
2083
- "description": "The id of the configured scheduler"
2116
+ "description": "The id of the configured scheduler which will be added on automation triggered"
2084
2117
  },
2085
2118
  "source": {
2086
- "type": "object",
2087
- "description": "The source of the schedule_at timestamp that will be used to schedule the action",
2088
- "id": {
2089
- "type": "string",
2090
- "description": "The iGd of the action or trigger"
2091
- },
2092
- "origin": {
2093
- "type": "string",
2094
- "enum": [
2095
- "trigger",
2096
- "action"
2097
- ]
2098
- },
2099
- "schema": {
2100
- "type": "string"
2101
- },
2102
- "attribute": {
2103
- "type": "string"
2104
- }
2119
+ "$ref": "#/components/schemas/ActionScheduleSource"
2105
2120
  }
2106
- }
2121
+ },
2122
+ "required": [
2123
+ "id",
2124
+ "source"
2125
+ ]
2107
2126
  },
2108
2127
  "AutomationExecutionId": {
2109
2128
  "type": "string",
@@ -2437,7 +2456,8 @@
2437
2456
  "status",
2438
2457
  "created_by",
2439
2458
  "created_at",
2440
- "updated_at"
2459
+ "updated_at",
2460
+ "execution_summary"
2441
2461
  ],
2442
2462
  "properties": {
2443
2463
  "job_id": {
@@ -2451,13 +2471,15 @@
2451
2471
  },
2452
2472
  "status": {
2453
2473
  "type": "string",
2454
- "description": "Status of the bulk trigger automation job\n* APPROVAL: Waiting for user approval to start the bulk trigger automation\n* IN_PROGRESS: Bulk trigger automation execution is in progress\n* SUCCESS: Bulk trigger automation execution is completed successfully\n* FAILED: Bulk trigger automation execution is failed\n* CANCELLED: Bulk trigger automation execution was cancelled\n",
2474
+ "description": "Status of the bulk trigger automation job\n* approval: Waiting for user approval to start the bulk trigger automation\n* starting: Starting automation executions\n* in_progress: Automation execution are currently running\n* send_report: Automation executions finished running. Report is being created & sent to the user who initiated the bulk trigger automation\n* finished: Automation executions finished running. Some may have failed. Check the status of each entity.\n* failed: Bulk trigger automation execution failed. Some executions might have started. Check the status of each entity.\n* cancelled: Bulk trigger automation execution was cancelled\n",
2455
2475
  "enum": [
2456
- "APPROVAL",
2457
- "IN_PROGRESS",
2458
- "SUCCESS",
2459
- "FAILED",
2460
- "CANCELLED"
2476
+ "approval",
2477
+ "starting",
2478
+ "in_progress",
2479
+ "send_report",
2480
+ "finished",
2481
+ "failed",
2482
+ "cancelled"
2461
2483
  ]
2462
2484
  },
2463
2485
  "created_by": {
@@ -2483,74 +2505,35 @@
2483
2505
  "description": "Task token to approve/cancel the bulk automation job",
2484
2506
  "example": "8c086140-f33e-4bb7-a993-50c0f2402c7b"
2485
2507
  },
2486
- "pending": {
2508
+ "execution_summary": {
2487
2509
  "type": "array",
2488
- "description": "List of entity ids that are waiting for triggering automation",
2510
+ "description": "List of entities & their automation execution id & status",
2489
2511
  "items": {
2490
- "type": "object",
2491
- "required": [
2492
- "entity_id"
2493
- ],
2494
- "properties": {
2495
- "entity_id": {
2496
- "$ref": "#/components/schemas/EntityId"
2497
- }
2498
- }
2512
+ "$ref": "#/components/schemas/ExecItem"
2499
2513
  }
2514
+ }
2515
+ }
2516
+ },
2517
+ "ExecItem": {
2518
+ "type": "object",
2519
+ "description": "Execution item for bulk trigger automation. It maps each entity to its automation execution id & status",
2520
+ "required": [
2521
+ "entity_id",
2522
+ "execution_status"
2523
+ ],
2524
+ "properties": {
2525
+ "entity_id": {
2526
+ "$ref": "#/components/schemas/EntityId"
2500
2527
  },
2501
- "triggered": {
2502
- "type": "array",
2503
- "description": "List of entity ids and automation execution ids that were triggered successfully",
2504
- "items": {
2505
- "type": "object",
2506
- "required": [
2507
- "entity_id",
2508
- "execution_id"
2509
- ],
2510
- "properties": {
2511
- "entity_id": {
2512
- "$ref": "#/components/schemas/EntityId"
2513
- },
2514
- "execution_id": {
2515
- "$ref": "#/components/schemas/AutomationExecutionId"
2516
- }
2517
- }
2518
- }
2528
+ "execution_id": {
2529
+ "$ref": "#/components/schemas/AutomationExecutionId"
2519
2530
  },
2520
- "failed": {
2521
- "type": "array",
2522
- "description": "List of entity ids that were skipped or failed",
2523
- "items": {
2524
- "type": "object",
2525
- "required": [
2526
- "entity_id",
2527
- "error"
2528
- ],
2529
- "properties": {
2530
- "entity_id": {
2531
- "$ref": "#/components/schemas/EntityId"
2532
- },
2533
- "error": {
2534
- "type": "string",
2535
- "description": "Error message for the failed automation execution"
2536
- }
2537
- }
2538
- }
2531
+ "execution_status": {
2532
+ "$ref": "#/components/schemas/ExecutionStatus"
2539
2533
  },
2540
- "cancelled": {
2541
- "type": "array",
2542
- "description": "List of entity ids that were cancelled from triggering automation",
2543
- "items": {
2544
- "type": "object",
2545
- "required": [
2546
- "entity_id"
2547
- ],
2548
- "properties": {
2549
- "entity_id": {
2550
- "$ref": "#/components/schemas/EntityId"
2551
- }
2552
- }
2553
- }
2534
+ "error": {
2535
+ "type": "string",
2536
+ "description": "Error message for the failed automation execution"
2554
2537
  }
2555
2538
  }
2556
2539
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/automation-client",
3
- "version": "2.12.2",
3
+ "version": "2.13.1",
4
4
  "description": "Client library for epilot automation API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",