@epilot/automation-client 2.9.0 → 2.9.2

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
@@ -9,6 +9,14 @@ import type {
9
9
 
10
10
  declare namespace Components {
11
11
  namespace Schemas {
12
+ export interface ActionCondition {
13
+ id?: string;
14
+ /**
15
+ * Result of the condition evaluation
16
+ */
17
+ evaluationResult?: boolean;
18
+ conditions?: Condition[];
19
+ }
12
20
  /**
13
21
  * example:
14
22
  * e3d3ebac-baab-4395-abf4-50b5bf1f8b74
@@ -225,7 +233,7 @@ declare namespace Components {
225
233
  * }
226
234
  * }
227
235
  */
228
- SendEmailActionConfig | /* Creates an order entity with prices from journey */ CartCheckoutActionConfig | AutomationActionConfig | ConditionActionConfig;
236
+ SendEmailActionConfig | /* Creates an order entity with prices from journey */ CartCheckoutActionConfig | AutomationActionConfig;
229
237
  export type AnyTrigger = FrontendSubmitTrigger | JourneySubmitTrigger | ApiSubmissionTrigger | /**
230
238
  * - If provides filter_config, executes an automation based on the filtered configuration when an entity event occurs.
231
239
  * - The conditions on a filter follows the event bridge patterns - `https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html`
@@ -509,6 +517,10 @@ declare namespace Components {
509
517
  [name: string]: any;
510
518
  };
511
519
  };
520
+ /**
521
+ * Condition Id to be checked before executing the action
522
+ */
523
+ condition_id?: string;
512
524
  execution_status?: ExecutionStatus;
513
525
  started_at?: string;
514
526
  updated_at?: string;
@@ -564,6 +576,10 @@ declare namespace Components {
564
576
  [name: string]: any;
565
577
  };
566
578
  };
579
+ /**
580
+ * Condition Id to be checked before executing the action
581
+ */
582
+ condition_id?: string;
567
583
  }
568
584
  export interface AutomationActionExecutionState {
569
585
  execution_status?: ExecutionStatus;
@@ -624,20 +640,8 @@ declare namespace Components {
624
640
  * 9ec3711b-db63-449c-b894-54d5bb622a8f
625
641
  */
626
642
  AutomationActionId;
643
+ conditions?: ActionCondition[];
627
644
  actions: AnyAction[];
628
- /**
629
- * The edges between actions which define the flow order
630
- */
631
- edges?: /**
632
- * example:
633
- * {
634
- * "id": "9ec3711b-db63-449c-b894-54d5bb622a8f",
635
- * "start": "3567cabc-587f-4ba2-8752-1f3da0100d1f",
636
- * "end": "4e29af6c-9824-461c-bcfb-505840a949ba",
637
- * "condition_output": true
638
- * }
639
- */
640
- Edge[];
641
645
  /**
642
646
  * Version of the flow
643
647
  * example:
@@ -682,23 +686,11 @@ declare namespace Components {
682
686
  * submission
683
687
  */
684
688
  entity_schema?: string;
689
+ conditions?: ActionCondition[];
685
690
  /**
686
691
  * The actions (nodes) of the automation flow
687
692
  */
688
693
  actions: AnyActionConfig[];
689
- /**
690
- * The edges between actions which define the flow order
691
- */
692
- edges?: /**
693
- * example:
694
- * {
695
- * "id": "9ec3711b-db63-449c-b894-54d5bb622a8f",
696
- * "start": "3567cabc-587f-4ba2-8752-1f3da0100d1f",
697
- * "end": "4e29af6c-9824-461c-bcfb-505840a949ba",
698
- * "condition_output": true
699
- * }
700
- */
701
- Edge[];
702
694
  /**
703
695
  * Number of automation executions that ran
704
696
  * example:
@@ -784,6 +776,10 @@ declare namespace Components {
784
776
  [name: string]: any;
785
777
  };
786
778
  };
779
+ /**
780
+ * Condition Id to be checked before executing the action
781
+ */
782
+ condition_id?: string;
787
783
  execution_status?: ExecutionStatus;
788
784
  started_at?: string;
789
785
  updated_at?: string;
@@ -840,6 +836,10 @@ declare namespace Components {
840
836
  [name: string]: any;
841
837
  };
842
838
  };
839
+ /**
840
+ * Condition Id to be checked before executing the action
841
+ */
842
+ condition_id?: string;
843
843
  }
844
844
  export interface CartCheckoutConfig {
845
845
  /**
@@ -877,51 +877,11 @@ declare namespace Components {
877
877
  target_unique?: string[];
878
878
  }
879
879
  export type Comparison = "equals" | "any_of" | "not_empty" | "is_empty";
880
- export interface ConditionActionConfig {
881
- id?: /**
882
- * example:
883
- * 9ec3711b-db63-449c-b894-54d5bb622a8f
884
- */
885
- AutomationActionId;
886
- flow_action_id?: /**
887
- * example:
888
- * 9ec3711b-db63-449c-b894-54d5bb622a8f
889
- */
890
- AutomationActionId;
891
- name?: string;
892
- type?: "condition";
893
- config?: ConditionConfig;
894
- /**
895
- * Whether to stop execution in a failed state if this action fails
896
- */
897
- allow_failure?: boolean;
898
- /**
899
- * Flag indicating whether the action was created automatically or manually
900
- */
901
- created_automatically?: boolean;
902
- /**
903
- * Flag indicating whether the same action can be in bulk in a single execution. e.g; send-email / map-entity
904
- */
905
- is_bulk_action?: boolean;
906
- reason?: {
907
- /**
908
- * Why the action has to be skipped/failed
909
- * example:
910
- * There are no registered portal users for the given emails, hence skipping the action
911
- */
912
- message?: string;
913
- /**
914
- * Extra metadata about the skipping reason - such as a certain condition not met, etc.
915
- */
916
- payload?: {
917
- [name: string]: any;
918
- };
919
- };
920
- }
921
- export interface ConditionConfig {
880
+ export interface Condition {
922
881
  source?: {
923
- id?: string;
924
882
  type?: string;
883
+ id?: string;
884
+ schema?: string;
925
885
  attribute?: string;
926
886
  };
927
887
  operation?: "equals" | "not_equals" | "contains" | "not_contains" | "starts_with" | "ends_with" | "greater_than" | "less_than" | "greater_than_or_equals" | "less_than_or_equals" | "is_empty" | "is_not_empty";
@@ -983,6 +943,10 @@ declare namespace Components {
983
943
  [name: string]: any;
984
944
  };
985
945
  };
946
+ /**
947
+ * Condition Id to be checked before executing the action
948
+ */
949
+ condition_id?: string;
986
950
  execution_status?: ExecutionStatus;
987
951
  started_at?: string;
988
952
  updated_at?: string;
@@ -1054,6 +1018,10 @@ declare namespace Components {
1054
1018
  [name: string]: any;
1055
1019
  };
1056
1020
  };
1021
+ /**
1022
+ * Condition Id to be checked before executing the action
1023
+ */
1024
+ condition_id?: string;
1057
1025
  }
1058
1026
  export interface CreateDocumentConfig {
1059
1027
  template_id?: string;
@@ -1062,30 +1030,6 @@ declare namespace Components {
1062
1030
  export type DiffAdded = FilterConditionOnEvent;
1063
1031
  export type DiffDeleted = FilterConditionOnEvent;
1064
1032
  export type DiffUpdated = FilterConditionOnEvent;
1065
- /**
1066
- * example:
1067
- * {
1068
- * "id": "9ec3711b-db63-449c-b894-54d5bb622a8f",
1069
- * "start": "3567cabc-587f-4ba2-8752-1f3da0100d1f",
1070
- * "end": "4e29af6c-9824-461c-bcfb-505840a949ba",
1071
- * "condition_output": true
1072
- * }
1073
- */
1074
- export interface Edge {
1075
- id: string;
1076
- /**
1077
- * The action id from which the edge starts
1078
- */
1079
- start: string;
1080
- /**
1081
- * The action id to which the edge ends
1082
- */
1083
- end: string;
1084
- /**
1085
- * The condition output of the edge (binary)
1086
- */
1087
- condition_output?: boolean;
1088
- }
1089
1033
  /**
1090
1034
  * example:
1091
1035
  * e3d3ebac-baab-4395-abf4-50b5bf1f8b74
@@ -1401,6 +1345,10 @@ declare namespace Components {
1401
1345
  [name: string]: any;
1402
1346
  };
1403
1347
  };
1348
+ /**
1349
+ * Condition Id to be checked before executing the action
1350
+ */
1351
+ condition_id?: string;
1404
1352
  execution_status?: ExecutionStatus;
1405
1353
  started_at?: string;
1406
1354
  updated_at?: string;
@@ -1574,6 +1522,10 @@ declare namespace Components {
1574
1522
  [name: string]: any;
1575
1523
  };
1576
1524
  };
1525
+ /**
1526
+ * Condition Id to be checked before executing the action
1527
+ */
1528
+ condition_id?: string;
1577
1529
  }
1578
1530
  export interface MapEntityConfig {
1579
1531
  mapping_config?: MappingConfigRef;
@@ -1800,6 +1752,10 @@ declare namespace Components {
1800
1752
  [name: string]: any;
1801
1753
  };
1802
1754
  };
1755
+ /**
1756
+ * Condition Id to be checked before executing the action
1757
+ */
1758
+ condition_id?: string;
1803
1759
  execution_status?: ExecutionStatus;
1804
1760
  started_at?: string;
1805
1761
  updated_at?: string;
@@ -1865,6 +1821,10 @@ declare namespace Components {
1865
1821
  [name: string]: any;
1866
1822
  };
1867
1823
  };
1824
+ /**
1825
+ * Condition Id to be checked before executing the action
1826
+ */
1827
+ condition_id?: string;
1868
1828
  }
1869
1829
  export interface SendEmailConfig {
1870
1830
  email_template_id?: string;
@@ -2061,6 +2021,10 @@ declare namespace Components {
2061
2021
  [name: string]: any;
2062
2022
  };
2063
2023
  };
2024
+ /**
2025
+ * Condition Id to be checked before executing the action
2026
+ */
2027
+ condition_id?: string;
2064
2028
  execution_status?: ExecutionStatus;
2065
2029
  started_at?: string;
2066
2030
  updated_at?: string;
@@ -2129,6 +2093,10 @@ declare namespace Components {
2129
2093
  [name: string]: any;
2130
2094
  };
2131
2095
  };
2096
+ /**
2097
+ * Condition Id to be checked before executing the action
2098
+ */
2099
+ condition_id?: string;
2132
2100
  }
2133
2101
  export interface TriggerWebhookConfig {
2134
2102
  entity_sources?: string[];
@@ -2178,6 +2146,10 @@ declare namespace Components {
2178
2146
  [name: string]: any;
2179
2147
  };
2180
2148
  };
2149
+ /**
2150
+ * Condition Id to be checked before executing the action
2151
+ */
2152
+ condition_id?: string;
2181
2153
  execution_status?: ExecutionStatus;
2182
2154
  started_at?: string;
2183
2155
  updated_at?: string;
@@ -2265,6 +2237,10 @@ declare namespace Components {
2265
2237
  [name: string]: any;
2266
2238
  };
2267
2239
  };
2240
+ /**
2241
+ * Condition Id to be checked before executing the action
2242
+ */
2243
+ condition_id?: string;
2268
2244
  }
2269
2245
  /**
2270
2246
  * example:
package/dist/openapi.json CHANGED
@@ -455,6 +455,12 @@
455
455
  "type": "string",
456
456
  "example": "submission"
457
457
  },
458
+ "conditions": {
459
+ "type": "array",
460
+ "items": {
461
+ "$ref": "#/components/schemas/ActionCondition"
462
+ }
463
+ },
458
464
  "actions": {
459
465
  "type": "array",
460
466
  "description": "The actions (nodes) of the automation flow",
@@ -463,13 +469,6 @@
463
469
  },
464
470
  "readOnly": true
465
471
  },
466
- "edges": {
467
- "type": "array",
468
- "description": "The edges between actions which define the flow order",
469
- "items": {
470
- "$ref": "#/components/schemas/Edge"
471
- }
472
- },
473
472
  "runs": {
474
473
  "type": "number",
475
474
  "example": 7,
@@ -519,37 +518,6 @@
519
518
  "actions"
520
519
  ]
521
520
  },
522
- "Edge": {
523
- "type": "object",
524
- "properties": {
525
- "id": {
526
- "type": "string"
527
- },
528
- "start": {
529
- "type": "string",
530
- "description": "The action id from which the edge starts"
531
- },
532
- "end": {
533
- "type": "string",
534
- "description": "The action id to which the edge ends"
535
- },
536
- "condition_output": {
537
- "type": "boolean",
538
- "description": "The condition output of the edge (binary)"
539
- }
540
- },
541
- "required": [
542
- "id",
543
- "start",
544
- "end"
545
- ],
546
- "example": {
547
- "id": "9ec3711b-db63-449c-b894-54d5bb622a8f",
548
- "start": "3567cabc-587f-4ba2-8752-1f3da0100d1f",
549
- "end": "4e29af6c-9824-461c-bcfb-505840a949ba",
550
- "condition_output": true
551
- }
552
- },
553
521
  "SearchAutomationsResp": {
554
522
  "type": "object",
555
523
  "properties": {
@@ -640,9 +608,6 @@
640
608
  },
641
609
  {
642
610
  "$ref": "#/components/schemas/AutomationActionConfig"
643
- },
644
- {
645
- "$ref": "#/components/schemas/ConditionActionConfig"
646
611
  }
647
612
  ]
648
613
  },
@@ -691,6 +656,10 @@
691
656
  "description": "Extra metadata about the skipping reason - such as a certain condition not met, etc."
692
657
  }
693
658
  }
659
+ },
660
+ "condition_id": {
661
+ "type": "string",
662
+ "description": "Condition Id to be checked before executing the action"
694
663
  }
695
664
  }
696
665
  },
@@ -1799,16 +1768,19 @@
1799
1768
  }
1800
1769
  }
1801
1770
  },
1802
- "ConditionConfig": {
1771
+ "Condition": {
1803
1772
  "type": "object",
1804
1773
  "properties": {
1805
1774
  "source": {
1806
1775
  "type": "object",
1807
1776
  "properties": {
1777
+ "type": {
1778
+ "type": "string"
1779
+ },
1808
1780
  "id": {
1809
1781
  "type": "string"
1810
1782
  },
1811
- "type": {
1783
+ "schema": {
1812
1784
  "type": "string"
1813
1785
  },
1814
1786
  "attribute": {
@@ -1841,25 +1813,23 @@
1841
1813
  }
1842
1814
  }
1843
1815
  },
1844
- "ConditionActionConfig": {
1845
- "allOf": [
1846
- {
1847
- "$ref": "#/components/schemas/AutomationActionConfig"
1816
+ "ActionCondition": {
1817
+ "type": "object",
1818
+ "properties": {
1819
+ "id": {
1820
+ "type": "string"
1848
1821
  },
1849
- {
1850
- "type": "object",
1851
- "properties": {
1852
- "type": {
1853
- "enum": [
1854
- "condition"
1855
- ]
1856
- },
1857
- "config": {
1858
- "$ref": "#/components/schemas/ConditionConfig"
1859
- }
1822
+ "evaluationResult": {
1823
+ "type": "boolean",
1824
+ "description": "Result of the condition evaluation"
1825
+ },
1826
+ "conditions": {
1827
+ "type": "array",
1828
+ "items": {
1829
+ "$ref": "#/components/schemas/Condition"
1860
1830
  }
1861
1831
  }
1862
- ]
1832
+ }
1863
1833
  },
1864
1834
  "AutomationExecutionId": {
1865
1835
  "type": "string",
@@ -1904,17 +1874,16 @@
1904
1874
  "current_action_id": {
1905
1875
  "$ref": "#/components/schemas/AutomationActionId"
1906
1876
  },
1907
- "actions": {
1877
+ "conditions": {
1908
1878
  "type": "array",
1909
1879
  "items": {
1910
- "$ref": "#/components/schemas/AnyAction"
1880
+ "$ref": "#/components/schemas/ActionCondition"
1911
1881
  }
1912
1882
  },
1913
- "edges": {
1883
+ "actions": {
1914
1884
  "type": "array",
1915
- "description": "The edges between actions which define the flow order",
1916
1885
  "items": {
1917
- "$ref": "#/components/schemas/Edge"
1886
+ "$ref": "#/components/schemas/AnyAction"
1918
1887
  }
1919
1888
  },
1920
1889
  "version": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/automation-client",
3
- "version": "2.9.0",
3
+ "version": "2.9.2",
4
4
  "description": "Client library for epilot automation API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",