@epilot/automation-client 2.8.3 → 2.8.6

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
@@ -225,7 +225,7 @@ declare namespace Components {
225
225
  * }
226
226
  * }
227
227
  */
228
- SendEmailActionConfig | /* Creates an order entity with prices from journey */ CartCheckoutActionConfig | AutomationActionConfig;
228
+ SendEmailActionConfig | /* Creates an order entity with prices from journey */ CartCheckoutActionConfig | AutomationActionConfig | ConditionActionConfig;
229
229
  export type AnyTrigger = FrontendSubmitTrigger | JourneySubmitTrigger | ApiSubmissionTrigger | /**
230
230
  * - If provides filter_config, executes an automation based on the filtered configuration when an entity event occurs.
231
231
  * - The conditions on a filter follows the event bridge patterns - `https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html`
@@ -344,7 +344,7 @@ declare namespace Components {
344
344
  */
345
345
  EntityOperationTrigger | ActivityTrigger | EntityManualTrigger | ReceivedEmailTrigger;
346
346
  export interface AnythingButCondition {
347
- "anything-but"?: string[];
347
+ "anything-but"?: (string | number)[];
348
348
  }
349
349
  export interface ApiCallerContext {
350
350
  [name: string]: any;
@@ -655,7 +655,23 @@ declare namespace Components {
655
655
  * submission
656
656
  */
657
657
  entity_schema?: string;
658
+ /**
659
+ * The actions (nodes) of the automation flow
660
+ */
658
661
  actions: AnyActionConfig[];
662
+ /**
663
+ * The edges between actions which define the flow order
664
+ */
665
+ edges?: /**
666
+ * example:
667
+ * {
668
+ * "id": "9ec3711b-db63-449c-b894-54d5bb622a8f",
669
+ * "start": "3567cabc-587f-4ba2-8752-1f3da0100d1f",
670
+ * "end": "4e29af6c-9824-461c-bcfb-505840a949ba",
671
+ * "condition_output": true
672
+ * }
673
+ */
674
+ Edge[];
659
675
  /**
660
676
  * Number of automation executions that ran
661
677
  * example:
@@ -686,6 +702,12 @@ declare namespace Components {
686
702
  * Determines if the flow is a system generated flow
687
703
  */
688
704
  system_flow?: boolean;
705
+ /**
706
+ * Version of the flow
707
+ * example:
708
+ * 2
709
+ */
710
+ version?: number;
689
711
  }
690
712
  /**
691
713
  * example:
@@ -820,6 +842,52 @@ declare namespace Components {
820
842
  target_unique?: string[];
821
843
  }
822
844
  export type Comparison = "equals" | "any_of" | "not_empty" | "is_empty";
845
+ export interface ConditionActionConfig {
846
+ id?: /**
847
+ * example:
848
+ * 9ec3711b-db63-449c-b894-54d5bb622a8f
849
+ */
850
+ AutomationActionId;
851
+ flow_action_id?: /**
852
+ * example:
853
+ * 9ec3711b-db63-449c-b894-54d5bb622a8f
854
+ */
855
+ AutomationActionId;
856
+ name?: string;
857
+ type?: "condition";
858
+ config?: ConditionConfig;
859
+ /**
860
+ * Whether to stop execution in a failed state if this action fails
861
+ */
862
+ allow_failure?: boolean;
863
+ /**
864
+ * Flag indicating whether the action was created automatically or manually
865
+ */
866
+ created_automatically?: boolean;
867
+ reason?: {
868
+ /**
869
+ * Why the action has to be skipped/failed
870
+ * example:
871
+ * There are no registered portal users for the given emails, hence skipping the action
872
+ */
873
+ message?: string;
874
+ /**
875
+ * Extra metadata about the skipping reason - such as a certain condition not met, etc.
876
+ */
877
+ payload?: {
878
+ [name: string]: any;
879
+ };
880
+ };
881
+ }
882
+ export interface ConditionConfig {
883
+ source?: {
884
+ id?: string;
885
+ type?: string;
886
+ attributes?: string;
887
+ };
888
+ 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";
889
+ values?: string[];
890
+ }
823
891
  export interface CopyValueMapper {
824
892
  mode: /**
825
893
  * - copy_if_exists - it replaces the target attribute with the source value - append_if_exists - it currently replaces target attribute with array like values. Useful when you have multiple values to be added into one attribute. - set_value - it sets a value to a predefined value. Must be used together with value property.
@@ -947,6 +1015,30 @@ declare namespace Components {
947
1015
  export type DiffAdded = FilterConditionOnEvent;
948
1016
  export type DiffDeleted = FilterConditionOnEvent;
949
1017
  export type DiffUpdated = FilterConditionOnEvent;
1018
+ /**
1019
+ * example:
1020
+ * {
1021
+ * "id": "9ec3711b-db63-449c-b894-54d5bb622a8f",
1022
+ * "start": "3567cabc-587f-4ba2-8752-1f3da0100d1f",
1023
+ * "end": "4e29af6c-9824-461c-bcfb-505840a949ba",
1024
+ * "condition_output": true
1025
+ * }
1026
+ */
1027
+ export interface Edge {
1028
+ id: string;
1029
+ /**
1030
+ * The action id from which the edge starts
1031
+ */
1032
+ start: string;
1033
+ /**
1034
+ * The action id to which the edge ends
1035
+ */
1036
+ end: string;
1037
+ /**
1038
+ * The condition output of the edge (binary)
1039
+ */
1040
+ condition_output?: boolean;
1041
+ }
950
1042
  /**
951
1043
  * example:
952
1044
  * e3d3ebac-baab-4395-abf4-50b5bf1f8b74
@@ -1162,6 +1254,20 @@ declare namespace Components {
1162
1254
  type?: (string | EqualsIgnoreCaseCondition | AnythingButCondition | ExistsCondition | PrefixCondition | SuffixCondition | WildcardCondition)[];
1163
1255
  };
1164
1256
  };
1257
+ ecp_config?: {
1258
+ /**
1259
+ * example:
1260
+ * END_CUSTOMER_PORTAL
1261
+ */
1262
+ origin?: string;
1263
+ file_config?: {
1264
+ /**
1265
+ * example:
1266
+ * true
1267
+ */
1268
+ shared_with_end_customer?: boolean;
1269
+ };
1270
+ };
1165
1271
  };
1166
1272
  }
1167
1273
  export interface EqualsIgnoreCaseCondition {
@@ -1186,7 +1292,7 @@ declare namespace Components {
1186
1292
  exists?: boolean;
1187
1293
  }
1188
1294
  export type FilterConditionOnEvent = OrCondition | {
1189
- [name: string]: (string | EqualsIgnoreCaseCondition | AnythingButCondition | NumericCondition | ExistsCondition | PrefixCondition | SuffixCondition | WildcardCondition)[];
1295
+ [name: string]: (string | number | boolean | EqualsIgnoreCaseCondition | AnythingButCondition | NumericCondition | ExistsCondition | PrefixCondition | SuffixCondition | WildcardCondition)[];
1190
1296
  };
1191
1297
  export interface FrontendSubmitTrigger {
1192
1298
  type: "frontend_submission";
package/dist/openapi.json CHANGED
@@ -457,11 +457,19 @@
457
457
  },
458
458
  "actions": {
459
459
  "type": "array",
460
+ "description": "The actions (nodes) of the automation flow",
460
461
  "items": {
461
462
  "$ref": "#/components/schemas/AnyActionConfig"
462
463
  },
463
464
  "readOnly": true
464
465
  },
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
+ },
465
473
  "runs": {
466
474
  "type": "number",
467
475
  "example": 7,
@@ -498,6 +506,11 @@
498
506
  "system_flow": {
499
507
  "type": "boolean",
500
508
  "description": "Determines if the flow is a system generated flow"
509
+ },
510
+ "version": {
511
+ "type": "number",
512
+ "description": "Version of the flow",
513
+ "example": 2
501
514
  }
502
515
  },
503
516
  "required": [
@@ -506,6 +519,37 @@
506
519
  "actions"
507
520
  ]
508
521
  },
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
+ },
509
553
  "SearchAutomationsResp": {
510
554
  "type": "object",
511
555
  "properties": {
@@ -596,6 +640,9 @@
596
640
  },
597
641
  {
598
642
  "$ref": "#/components/schemas/AutomationActionConfig"
643
+ },
644
+ {
645
+ "$ref": "#/components/schemas/ConditionActionConfig"
599
646
  }
600
647
  ]
601
648
  },
@@ -1743,6 +1790,68 @@
1743
1790
  }
1744
1791
  }
1745
1792
  },
1793
+ "ConditionConfig": {
1794
+ "type": "object",
1795
+ "properties": {
1796
+ "source": {
1797
+ "type": "object",
1798
+ "properties": {
1799
+ "id": {
1800
+ "type": "string"
1801
+ },
1802
+ "type": {
1803
+ "type": "string"
1804
+ },
1805
+ "attributes": {
1806
+ "type": "string"
1807
+ }
1808
+ }
1809
+ },
1810
+ "operation": {
1811
+ "type": "string",
1812
+ "enum": [
1813
+ "equals",
1814
+ "not_equals",
1815
+ "contains",
1816
+ "not_contains",
1817
+ "starts_with",
1818
+ "ends_with",
1819
+ "greater_than",
1820
+ "less_than",
1821
+ "greater_than_or_equals",
1822
+ "less_than_or_equals",
1823
+ "is_empty",
1824
+ "is_not_empty"
1825
+ ]
1826
+ },
1827
+ "values": {
1828
+ "type": "array",
1829
+ "items": {
1830
+ "type": "string"
1831
+ }
1832
+ }
1833
+ }
1834
+ },
1835
+ "ConditionActionConfig": {
1836
+ "allOf": [
1837
+ {
1838
+ "$ref": "#/components/schemas/AutomationActionConfig"
1839
+ },
1840
+ {
1841
+ "type": "object",
1842
+ "properties": {
1843
+ "type": {
1844
+ "enum": [
1845
+ "condition"
1846
+ ]
1847
+ },
1848
+ "config": {
1849
+ "$ref": "#/components/schemas/ConditionConfig"
1850
+ }
1851
+ }
1852
+ }
1853
+ ]
1854
+ },
1746
1855
  "AutomationExecutionId": {
1747
1856
  "type": "string",
1748
1857
  "example": "9baf184f-bc81-4128-bca3-d974c90a12c4"
@@ -2234,6 +2343,24 @@
2234
2343
  }
2235
2344
  }
2236
2345
  }
2346
+ },
2347
+ "ecp_config": {
2348
+ "type": "object",
2349
+ "properties": {
2350
+ "origin": {
2351
+ "type": "string",
2352
+ "example": "END_CUSTOMER_PORTAL"
2353
+ },
2354
+ "file_config": {
2355
+ "type": "object",
2356
+ "properties": {
2357
+ "shared_with_end_customer": {
2358
+ "type": "boolean",
2359
+ "example": true
2360
+ }
2361
+ }
2362
+ }
2363
+ }
2237
2364
  }
2238
2365
  }
2239
2366
  }
@@ -2386,6 +2513,12 @@
2386
2513
  {
2387
2514
  "type": "string"
2388
2515
  },
2516
+ {
2517
+ "type": "number"
2518
+ },
2519
+ {
2520
+ "type": "boolean"
2521
+ },
2389
2522
  {
2390
2523
  "$ref": "#/components/schemas/EqualsIgnoreCaseCondition"
2391
2524
  },
@@ -2427,7 +2560,14 @@
2427
2560
  "anything-but": {
2428
2561
  "type": "array",
2429
2562
  "items": {
2430
- "type": "string"
2563
+ "oneOf": [
2564
+ {
2565
+ "type": "string"
2566
+ },
2567
+ {
2568
+ "type": "integer"
2569
+ }
2570
+ ]
2431
2571
  }
2432
2572
  }
2433
2573
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/automation-client",
3
- "version": "2.8.3",
3
+ "version": "2.8.6",
4
4
  "description": "Client library for epilot automation API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",