@epilot/automation-client 2.12.1 → 2.13.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.
package/dist/openapi.d.ts CHANGED
@@ -35,6 +35,29 @@ declare namespace Components {
35
35
  */
36
36
  ConditionStatement[];
37
37
  }
38
+ export interface ActionSchedule {
39
+ /**
40
+ * Schedule Id
41
+ */
42
+ id: string;
43
+ /**
44
+ * The id of the configured scheduler which will be added on automation triggered
45
+ */
46
+ scheduleId?: 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 {
53
+ /**
54
+ * The iGd of the action or trigger
55
+ */
56
+ id: string;
57
+ origin: "trigger" | "action";
58
+ schema: string;
59
+ attribute: string;
60
+ }
38
61
  /**
39
62
  * example:
40
63
  * e3d3ebac-baab-4395-abf4-50b5bf1f8b74
@@ -549,6 +572,10 @@ declare namespace Components {
549
572
  * Condition Id to be checked before executing the action
550
573
  */
551
574
  condition_id?: string;
575
+ /**
576
+ * Schedule Id which indicates the schedule of the action
577
+ */
578
+ schedule_id?: string;
552
579
  execution_status?: ExecutionStatus;
553
580
  started_at?: string;
554
581
  updated_at?: string;
@@ -608,6 +635,10 @@ declare namespace Components {
608
635
  * Condition Id to be checked before executing the action
609
636
  */
610
637
  condition_id?: string;
638
+ /**
639
+ * Schedule Id which indicates the schedule of the action
640
+ */
641
+ schedule_id?: string;
611
642
  }
612
643
  export interface AutomationActionExecutionState {
613
644
  execution_status?: ExecutionStatus;
@@ -669,6 +700,7 @@ declare namespace Components {
669
700
  */
670
701
  AutomationActionId;
671
702
  conditions?: ActionCondition[];
703
+ schedules?: ActionSchedule[];
672
704
  actions: AnyAction[];
673
705
  resume_token?: /**
674
706
  * A unique token to resume a paused automation execution
@@ -721,6 +753,7 @@ declare namespace Components {
721
753
  */
722
754
  entity_schema?: string;
723
755
  conditions?: ActionCondition[];
756
+ schedules?: ActionSchedule[];
724
757
  /**
725
758
  * The actions (nodes) of the automation flow
726
759
  */
@@ -793,14 +826,16 @@ declare namespace Components {
793
826
  AutomationFlowId;
794
827
  /**
795
828
  * Status of the bulk trigger automation job
796
- * * APPROVAL: Waiting for user approval to start the bulk trigger automation
797
- * * IN_PROGRESS: Bulk trigger automation execution is in progress
798
- * * SUCCESS: Bulk trigger automation execution is completed successfully
799
- * * FAILED: Bulk trigger automation execution is failed
800
- * * 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
801
836
  *
802
837
  */
803
- status: "APPROVAL" | "IN_PROGRESS" | "SUCCESS" | "FAILED" | "CANCELLED";
838
+ status: "approval" | "starting" | "in_progress" | "send_report" | "finished" | "failed" | "cancelled";
804
839
  /**
805
840
  * User ID who created the bulk trigger automation job
806
841
  * example:
@@ -820,54 +855,13 @@ declare namespace Components {
820
855
  */
821
856
  task_token?: string;
822
857
  /**
823
- * List of entity ids that are waiting for triggering automation
858
+ * Entity ID of the report file entity
824
859
  */
825
- pending?: {
826
- entity_id: /**
827
- * example:
828
- * e3d3ebac-baab-4395-abf4-50b5bf1f8b74
829
- */
830
- EntityId;
831
- }[];
860
+ report_file_entity_id?: string;
832
861
  /**
833
- * List of entity ids and automation execution ids that were triggered successfully
862
+ * List of entities & their automation execution id & status
834
863
  */
835
- triggered?: {
836
- entity_id: /**
837
- * example:
838
- * e3d3ebac-baab-4395-abf4-50b5bf1f8b74
839
- */
840
- EntityId;
841
- execution_id: /**
842
- * example:
843
- * 9baf184f-bc81-4128-bca3-d974c90a12c4
844
- */
845
- AutomationExecutionId;
846
- }[];
847
- /**
848
- * List of entity ids that were skipped or failed
849
- */
850
- failed?: {
851
- entity_id: /**
852
- * example:
853
- * e3d3ebac-baab-4395-abf4-50b5bf1f8b74
854
- */
855
- EntityId;
856
- /**
857
- * Error message for the failed automation execution
858
- */
859
- error: string;
860
- }[];
861
- /**
862
- * List of entity ids that were cancelled from triggering automation
863
- */
864
- cancelled?: {
865
- entity_id: /**
866
- * example:
867
- * e3d3ebac-baab-4395-abf4-50b5bf1f8b74
868
- */
869
- EntityId;
870
- }[];
864
+ execution_summary: /* Execution item for bulk trigger automation. It maps each entity to its automation execution id & status */ ExecItem[];
871
865
  }
872
866
  export interface BulkTriggerRequest {
873
867
  flow_id: /**
@@ -929,6 +923,10 @@ declare namespace Components {
929
923
  * Condition Id to be checked before executing the action
930
924
  */
931
925
  condition_id?: string;
926
+ /**
927
+ * Schedule Id which indicates the schedule of the action
928
+ */
929
+ schedule_id?: string;
932
930
  execution_status?: ExecutionStatus;
933
931
  started_at?: string;
934
932
  updated_at?: string;
@@ -989,6 +987,10 @@ declare namespace Components {
989
987
  * Condition Id to be checked before executing the action
990
988
  */
991
989
  condition_id?: string;
990
+ /**
991
+ * Schedule Id which indicates the schedule of the action
992
+ */
993
+ schedule_id?: string;
992
994
  }
993
995
  export interface CartCheckoutConfig {
994
996
  /**
@@ -1050,9 +1052,12 @@ declare namespace Components {
1050
1052
  */
1051
1053
  id?: string; // uuid
1052
1054
  source?: {
1055
+ /**
1056
+ * The id of the action or trigger
1057
+ */
1058
+ id?: string;
1053
1059
  origin?: "trigger" | "action";
1054
1060
  originType?: "entity" | "workflow" | "journey_block";
1055
- id?: string;
1056
1061
  schema?: string;
1057
1062
  attribute?: string;
1058
1063
  attributeType?: "string" | "text" | "number" | "boolean" | "date" | "datetime" | "tags" | "country" | "email" | "phone" | "product" | "price" | "status" | "relation" | "multiselect" | "select" | "radio" | "relation_user" | "purpose" | "label";
@@ -1122,6 +1127,10 @@ declare namespace Components {
1122
1127
  * Condition Id to be checked before executing the action
1123
1128
  */
1124
1129
  condition_id?: string;
1130
+ /**
1131
+ * Schedule Id which indicates the schedule of the action
1132
+ */
1133
+ schedule_id?: string;
1125
1134
  execution_status?: ExecutionStatus;
1126
1135
  started_at?: string;
1127
1136
  updated_at?: string;
@@ -1197,6 +1206,10 @@ declare namespace Components {
1197
1206
  * Condition Id to be checked before executing the action
1198
1207
  */
1199
1208
  condition_id?: string;
1209
+ /**
1210
+ * Schedule Id which indicates the schedule of the action
1211
+ */
1212
+ schedule_id?: string;
1200
1213
  }
1201
1214
  export interface CreateDocumentConfig {
1202
1215
  template_id?: string;
@@ -1463,7 +1476,27 @@ declare namespace Components {
1463
1476
  details?: ErrorDetail[];
1464
1477
  };
1465
1478
  }
1466
- export type ExecutionStatus = "pending" | "in_progress" | "paused" | "success" | "failed" | "cancelled" | "skipped";
1479
+ /**
1480
+ * Execution item for bulk trigger automation. It maps each entity to its automation execution id & status
1481
+ */
1482
+ export interface ExecItem {
1483
+ entity_id: /**
1484
+ * example:
1485
+ * e3d3ebac-baab-4395-abf4-50b5bf1f8b74
1486
+ */
1487
+ EntityId;
1488
+ execution_id?: /**
1489
+ * example:
1490
+ * 9baf184f-bc81-4128-bca3-d974c90a12c4
1491
+ */
1492
+ AutomationExecutionId;
1493
+ execution_status: ExecutionStatus;
1494
+ /**
1495
+ * Error message for the failed automation execution
1496
+ */
1497
+ error?: string;
1498
+ }
1499
+ export type ExecutionStatus = "pending" | "in_progress" | "paused" | "success" | "failed" | "cancelled" | "skipped" | "scheduled";
1467
1500
  export interface ExistsCondition {
1468
1501
  exists?: boolean;
1469
1502
  }
@@ -1550,6 +1583,10 @@ declare namespace Components {
1550
1583
  * Condition Id to be checked before executing the action
1551
1584
  */
1552
1585
  condition_id?: string;
1586
+ /**
1587
+ * Schedule Id which indicates the schedule of the action
1588
+ */
1589
+ schedule_id?: string;
1553
1590
  execution_status?: ExecutionStatus;
1554
1591
  started_at?: string;
1555
1592
  updated_at?: string;
@@ -1727,6 +1764,10 @@ declare namespace Components {
1727
1764
  * Condition Id to be checked before executing the action
1728
1765
  */
1729
1766
  condition_id?: string;
1767
+ /**
1768
+ * Schedule Id which indicates the schedule of the action
1769
+ */
1770
+ schedule_id?: string;
1730
1771
  }
1731
1772
  export interface MapEntityConfig {
1732
1773
  mapping_config?: MappingConfigRef;
@@ -1984,6 +2025,10 @@ declare namespace Components {
1984
2025
  * Condition Id to be checked before executing the action
1985
2026
  */
1986
2027
  condition_id?: string;
2028
+ /**
2029
+ * Schedule Id which indicates the schedule of the action
2030
+ */
2031
+ schedule_id?: string;
1987
2032
  execution_status?: ExecutionStatus;
1988
2033
  started_at?: string;
1989
2034
  updated_at?: string;
@@ -2053,6 +2098,10 @@ declare namespace Components {
2053
2098
  * Condition Id to be checked before executing the action
2054
2099
  */
2055
2100
  condition_id?: string;
2101
+ /**
2102
+ * Schedule Id which indicates the schedule of the action
2103
+ */
2104
+ schedule_id?: string;
2056
2105
  }
2057
2106
  export interface SendEmailConfig {
2058
2107
  email_template_id?: string;
@@ -2260,6 +2309,10 @@ declare namespace Components {
2260
2309
  * Condition Id to be checked before executing the action
2261
2310
  */
2262
2311
  condition_id?: string;
2312
+ /**
2313
+ * Schedule Id which indicates the schedule of the action
2314
+ */
2315
+ schedule_id?: string;
2263
2316
  execution_status?: ExecutionStatus;
2264
2317
  started_at?: string;
2265
2318
  updated_at?: string;
@@ -2332,6 +2385,10 @@ declare namespace Components {
2332
2385
  * Condition Id to be checked before executing the action
2333
2386
  */
2334
2387
  condition_id?: string;
2388
+ /**
2389
+ * Schedule Id which indicates the schedule of the action
2390
+ */
2391
+ schedule_id?: string;
2335
2392
  }
2336
2393
  export interface TriggerWebhookConfig {
2337
2394
  entity_sources?: string[];
@@ -2385,6 +2442,10 @@ declare namespace Components {
2385
2442
  * Condition Id to be checked before executing the action
2386
2443
  */
2387
2444
  condition_id?: string;
2445
+ /**
2446
+ * Schedule Id which indicates the schedule of the action
2447
+ */
2448
+ schedule_id?: string;
2388
2449
  execution_status?: ExecutionStatus;
2389
2450
  started_at?: string;
2390
2451
  updated_at?: string;
@@ -2476,6 +2537,10 @@ declare namespace Components {
2476
2537
  * Condition Id to be checked before executing the action
2477
2538
  */
2478
2539
  condition_id?: string;
2540
+ /**
2541
+ * Schedule Id which indicates the schedule of the action
2542
+ */
2543
+ schedule_id?: string;
2479
2544
  }
2480
2545
  /**
2481
2546
  * example:
@@ -3061,6 +3126,8 @@ export interface PathsDictionary {
3061
3126
  export type Client = OpenAPIClient<OperationMethods, PathsDictionary>
3062
3127
 
3063
3128
  export type ActionCondition = Components.Schemas.ActionCondition;
3129
+ export type ActionSchedule = Components.Schemas.ActionSchedule;
3130
+ export type ActionScheduleSource = Components.Schemas.ActionScheduleSource;
3064
3131
  export type ActivityId = Components.Schemas.ActivityId;
3065
3132
  export type ActivityTrigger = Components.Schemas.ActivityTrigger;
3066
3133
  export type AnyAction = Components.Schemas.AnyAction;
@@ -3103,6 +3170,7 @@ export type EqualsIgnoreCaseCondition = Components.Schemas.EqualsIgnoreCaseCondi
3103
3170
  export type ErrorCode = Components.Schemas.ErrorCode;
3104
3171
  export type ErrorDetail = Components.Schemas.ErrorDetail;
3105
3172
  export type ErrorOutput = Components.Schemas.ErrorOutput;
3173
+ export type ExecItem = Components.Schemas.ExecItem;
3106
3174
  export type ExecutionStatus = Components.Schemas.ExecutionStatus;
3107
3175
  export type ExistsCondition = Components.Schemas.ExistsCondition;
3108
3176
  export type FilterConditionOnEvent = Components.Schemas.FilterConditionOnEvent;
package/dist/openapi.json CHANGED
@@ -615,6 +615,12 @@
615
615
  "$ref": "#/components/schemas/ActionCondition"
616
616
  }
617
617
  },
618
+ "schedules": {
619
+ "type": "array",
620
+ "items": {
621
+ "$ref": "#/components/schemas/ActionSchedule"
622
+ }
623
+ },
618
624
  "actions": {
619
625
  "type": "array",
620
626
  "description": "The actions (nodes) of the automation flow",
@@ -814,6 +820,10 @@
814
820
  "condition_id": {
815
821
  "type": "string",
816
822
  "description": "Condition Id to be checked before executing the action"
823
+ },
824
+ "schedule_id": {
825
+ "type": "string",
826
+ "description": "Schedule Id which indicates the schedule of the action"
817
827
  }
818
828
  }
819
829
  },
@@ -1942,6 +1952,10 @@
1942
1952
  "source": {
1943
1953
  "type": "object",
1944
1954
  "properties": {
1955
+ "id": {
1956
+ "type": "string",
1957
+ "description": "The id of the action or trigger"
1958
+ },
1945
1959
  "origin": {
1946
1960
  "type": "string",
1947
1961
  "enum": [
@@ -1957,9 +1971,6 @@
1957
1971
  "journey_block"
1958
1972
  ]
1959
1973
  },
1960
- "id": {
1961
- "type": "string"
1962
- },
1963
1974
  "schema": {
1964
1975
  "type": "string"
1965
1976
  },
@@ -2063,6 +2074,55 @@
2063
2074
  }
2064
2075
  }
2065
2076
  },
2077
+ "ActionScheduleSource": {
2078
+ "type": "object",
2079
+ "description": "The source of the schedule_at timestamp that will be used to schedule the action",
2080
+ "properties": {
2081
+ "id": {
2082
+ "type": "string",
2083
+ "description": "The iGd of the action or trigger"
2084
+ },
2085
+ "origin": {
2086
+ "type": "string",
2087
+ "enum": [
2088
+ "trigger",
2089
+ "action"
2090
+ ]
2091
+ },
2092
+ "schema": {
2093
+ "type": "string"
2094
+ },
2095
+ "attribute": {
2096
+ "type": "string"
2097
+ }
2098
+ },
2099
+ "required": [
2100
+ "id",
2101
+ "origin",
2102
+ "schema",
2103
+ "attribute"
2104
+ ]
2105
+ },
2106
+ "ActionSchedule": {
2107
+ "type": "object",
2108
+ "properties": {
2109
+ "id": {
2110
+ "type": "string",
2111
+ "description": "Schedule Id"
2112
+ },
2113
+ "scheduleId": {
2114
+ "type": "string",
2115
+ "description": "The id of the configured scheduler which will be added on automation triggered"
2116
+ },
2117
+ "source": {
2118
+ "$ref": "#/components/schemas/ActionScheduleSource"
2119
+ }
2120
+ },
2121
+ "required": [
2122
+ "id",
2123
+ "source"
2124
+ ]
2125
+ },
2066
2126
  "AutomationExecutionId": {
2067
2127
  "type": "string",
2068
2128
  "example": "9baf184f-bc81-4128-bca3-d974c90a12c4"
@@ -2112,6 +2172,12 @@
2112
2172
  "$ref": "#/components/schemas/ActionCondition"
2113
2173
  }
2114
2174
  },
2175
+ "schedules": {
2176
+ "type": "array",
2177
+ "items": {
2178
+ "$ref": "#/components/schemas/ActionSchedule"
2179
+ }
2180
+ },
2115
2181
  "actions": {
2116
2182
  "type": "array",
2117
2183
  "items": {
@@ -2304,7 +2370,8 @@
2304
2370
  "success",
2305
2371
  "failed",
2306
2372
  "cancelled",
2307
- "skipped"
2373
+ "skipped",
2374
+ "scheduled"
2308
2375
  ]
2309
2376
  },
2310
2377
  "GetExecutionsResp": {
@@ -2388,7 +2455,8 @@
2388
2455
  "status",
2389
2456
  "created_by",
2390
2457
  "created_at",
2391
- "updated_at"
2458
+ "updated_at",
2459
+ "execution_summary"
2392
2460
  ],
2393
2461
  "properties": {
2394
2462
  "job_id": {
@@ -2402,13 +2470,15 @@
2402
2470
  },
2403
2471
  "status": {
2404
2472
  "type": "string",
2405
- "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",
2473
+ "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",
2406
2474
  "enum": [
2407
- "APPROVAL",
2408
- "IN_PROGRESS",
2409
- "SUCCESS",
2410
- "FAILED",
2411
- "CANCELLED"
2475
+ "approval",
2476
+ "starting",
2477
+ "in_progress",
2478
+ "send_report",
2479
+ "finished",
2480
+ "failed",
2481
+ "cancelled"
2412
2482
  ]
2413
2483
  },
2414
2484
  "created_by": {
@@ -2434,74 +2504,39 @@
2434
2504
  "description": "Task token to approve/cancel the bulk automation job",
2435
2505
  "example": "8c086140-f33e-4bb7-a993-50c0f2402c7b"
2436
2506
  },
2437
- "pending": {
2438
- "type": "array",
2439
- "description": "List of entity ids that are waiting for triggering automation",
2440
- "items": {
2441
- "type": "object",
2442
- "required": [
2443
- "entity_id"
2444
- ],
2445
- "properties": {
2446
- "entity_id": {
2447
- "$ref": "#/components/schemas/EntityId"
2448
- }
2449
- }
2450
- }
2507
+ "report_file_entity_id": {
2508
+ "type": "string",
2509
+ "description": "Entity ID of the report file entity"
2451
2510
  },
2452
- "triggered": {
2511
+ "execution_summary": {
2453
2512
  "type": "array",
2454
- "description": "List of entity ids and automation execution ids that were triggered successfully",
2513
+ "description": "List of entities & their automation execution id & status",
2455
2514
  "items": {
2456
- "type": "object",
2457
- "required": [
2458
- "entity_id",
2459
- "execution_id"
2460
- ],
2461
- "properties": {
2462
- "entity_id": {
2463
- "$ref": "#/components/schemas/EntityId"
2464
- },
2465
- "execution_id": {
2466
- "$ref": "#/components/schemas/AutomationExecutionId"
2467
- }
2468
- }
2515
+ "$ref": "#/components/schemas/ExecItem"
2469
2516
  }
2517
+ }
2518
+ }
2519
+ },
2520
+ "ExecItem": {
2521
+ "type": "object",
2522
+ "description": "Execution item for bulk trigger automation. It maps each entity to its automation execution id & status",
2523
+ "required": [
2524
+ "entity_id",
2525
+ "execution_status"
2526
+ ],
2527
+ "properties": {
2528
+ "entity_id": {
2529
+ "$ref": "#/components/schemas/EntityId"
2470
2530
  },
2471
- "failed": {
2472
- "type": "array",
2473
- "description": "List of entity ids that were skipped or failed",
2474
- "items": {
2475
- "type": "object",
2476
- "required": [
2477
- "entity_id",
2478
- "error"
2479
- ],
2480
- "properties": {
2481
- "entity_id": {
2482
- "$ref": "#/components/schemas/EntityId"
2483
- },
2484
- "error": {
2485
- "type": "string",
2486
- "description": "Error message for the failed automation execution"
2487
- }
2488
- }
2489
- }
2531
+ "execution_id": {
2532
+ "$ref": "#/components/schemas/AutomationExecutionId"
2490
2533
  },
2491
- "cancelled": {
2492
- "type": "array",
2493
- "description": "List of entity ids that were cancelled from triggering automation",
2494
- "items": {
2495
- "type": "object",
2496
- "required": [
2497
- "entity_id"
2498
- ],
2499
- "properties": {
2500
- "entity_id": {
2501
- "$ref": "#/components/schemas/EntityId"
2502
- }
2503
- }
2504
- }
2534
+ "execution_status": {
2535
+ "$ref": "#/components/schemas/ExecutionStatus"
2536
+ },
2537
+ "error": {
2538
+ "type": "string",
2539
+ "description": "Error message for the failed automation execution"
2505
2540
  }
2506
2541
  }
2507
2542
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/automation-client",
3
- "version": "2.12.1",
3
+ "version": "2.13.0",
4
4
  "description": "Client library for epilot automation API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",