@epilot/automation-client 1.9.7 → 2.0.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.json CHANGED
@@ -446,7 +446,7 @@
446
446
  "actions": {
447
447
  "type": "array",
448
448
  "items": {
449
- "$ref": "#/components/schemas/AnyAction"
449
+ "$ref": "#/components/schemas/AnyActionConfig"
450
450
  }
451
451
  },
452
452
  "runs": {
@@ -527,9 +527,6 @@
527
527
  {
528
528
  "$ref": "#/components/schemas/MapEntityAction"
529
529
  },
530
- {
531
- "$ref": "#/components/schemas/FillEntityAction"
532
- },
533
530
  {
534
531
  "$ref": "#/components/schemas/TriggerWorkflowAction"
535
532
  },
@@ -550,7 +547,32 @@
550
547
  }
551
548
  ]
552
549
  },
553
- "AutomationAction": {
550
+ "AnyActionConfig": {
551
+ "anyOf": [
552
+ {
553
+ "$ref": "#/components/schemas/MapEntityActionConfig"
554
+ },
555
+ {
556
+ "$ref": "#/components/schemas/TriggerWorkflowActionConfig"
557
+ },
558
+ {
559
+ "$ref": "#/components/schemas/TriggerWebhookActionConfig"
560
+ },
561
+ {
562
+ "$ref": "#/components/schemas/CreateDocumentActionConfig"
563
+ },
564
+ {
565
+ "$ref": "#/components/schemas/SendEmailActionConfig"
566
+ },
567
+ {
568
+ "$ref": "#/components/schemas/CartCheckoutActionConfig"
569
+ },
570
+ {
571
+ "$ref": "#/components/schemas/AutomationActionConfig"
572
+ }
573
+ ]
574
+ },
575
+ "AutomationActionConfig": {
554
576
  "type": "object",
555
577
  "properties": {
556
578
  "id": {
@@ -569,6 +591,19 @@
569
591
  "type": "object",
570
592
  "additionalProperties": true
571
593
  },
594
+ "allow_failure": {
595
+ "description": "Whether to stop execution in a failed state if this action fails",
596
+ "type": "boolean"
597
+ },
598
+ "created_automatically": {
599
+ "description": "Flag indicating whether the action was created automatically or manually",
600
+ "type": "boolean"
601
+ }
602
+ }
603
+ },
604
+ "AutomationActionExecutionState": {
605
+ "type": "object",
606
+ "properties": {
572
607
  "execution_status": {
573
608
  "$ref": "#/components/schemas/ExecutionStatus"
574
609
  },
@@ -578,14 +613,6 @@
578
613
  "updated_at": {
579
614
  "type": "string"
580
615
  },
581
- "allow_failure": {
582
- "description": "Whether to stop execution in a failed state if this action fails",
583
- "type": "boolean"
584
- },
585
- "created_automatically": {
586
- "description": "Flag indicating whether the action was created automatically or manually",
587
- "type": "boolean"
588
- },
589
616
  "outputs": {
590
617
  "type": "object",
591
618
  "additionalProperties": true,
@@ -593,9 +620,27 @@
593
620
  },
594
621
  "error_output": {
595
622
  "$ref": "#/components/schemas/ErrorOutput"
623
+ },
624
+ "retry_strategy": {
625
+ "type": "string",
626
+ "description": "different behaviors for retrying failed execution actions.",
627
+ "enum": [
628
+ "RETRY_AND_RESUME",
629
+ "RETRY_AND_STOP"
630
+ ]
596
631
  }
597
632
  }
598
633
  },
634
+ "AutomationAction": {
635
+ "allOf": [
636
+ {
637
+ "$ref": "#/components/schemas/AutomationActionConfig"
638
+ },
639
+ {
640
+ "$ref": "#/components/schemas/AutomationActionExecutionState"
641
+ }
642
+ ]
643
+ },
599
644
  "ErrorOutput": {
600
645
  "type": "object",
601
646
  "properties": {
@@ -623,6 +668,27 @@
623
668
  "INTERNAL_ERROR"
624
669
  ]
625
670
  },
671
+ "CartCheckoutActionConfig": {
672
+ "allOf": [
673
+ {
674
+ "$ref": "#/components/schemas/AutomationActionConfig"
675
+ },
676
+ {
677
+ "type": "object",
678
+ "description": "Creates an order entity with prices from journey",
679
+ "properties": {
680
+ "type": {
681
+ "enum": [
682
+ "cart-checkout"
683
+ ]
684
+ },
685
+ "config": {
686
+ "$ref": "#/components/schemas/CartCheckoutConfig"
687
+ }
688
+ }
689
+ }
690
+ ]
691
+ },
626
692
  "CartCheckoutAction": {
627
693
  "allOf": [
628
694
  {
@@ -695,10 +761,10 @@
695
761
  }
696
762
  }
697
763
  },
698
- "MapEntityAction": {
764
+ "MapEntityActionConfig": {
699
765
  "allOf": [
700
766
  {
701
- "$ref": "#/components/schemas/AutomationAction"
767
+ "$ref": "#/components/schemas/AutomationActionConfig"
702
768
  },
703
769
  {
704
770
  "type": "object",
@@ -709,7 +775,7 @@
709
775
  ]
710
776
  },
711
777
  "config": {
712
- "$ref": "#/components/schemas/MapEntityActionConfig"
778
+ "$ref": "#/components/schemas/MapEntityConfig"
713
779
  }
714
780
  }
715
781
  }
@@ -832,7 +898,27 @@
832
898
  }
833
899
  }
834
900
  },
835
- "MapEntityActionConfig": {
901
+ "MapEntityAction": {
902
+ "allOf": [
903
+ {
904
+ "$ref": "#/components/schemas/AutomationAction"
905
+ },
906
+ {
907
+ "type": "object",
908
+ "properties": {
909
+ "type": {
910
+ "enum": [
911
+ "map-entity"
912
+ ]
913
+ },
914
+ "config": {
915
+ "$ref": "#/components/schemas/MapEntityConfig"
916
+ }
917
+ }
918
+ }
919
+ ]
920
+ },
921
+ "MapEntityConfig": {
836
922
  "type": "object",
837
923
  "properties": {
838
924
  "mapping_config": {
@@ -908,133 +994,6 @@
908
994
  "target_id"
909
995
  ]
910
996
  },
911
- "FillEntityAction": {
912
- "allOf": [
913
- {
914
- "$ref": "#/components/schemas/AutomationAction"
915
- },
916
- {
917
- "type": "object",
918
- "deprecated": true,
919
- "properties": {
920
- "type": {
921
- "enum": [
922
- "fill-entity"
923
- ]
924
- },
925
- "config": {
926
- "$ref": "#/components/schemas/FillEntityConfig"
927
- }
928
- },
929
- "required": [
930
- "config"
931
- ]
932
- }
933
- ]
934
- },
935
- "FillEntityConfig": {
936
- "type": "object",
937
- "properties": {
938
- "mappings": {
939
- "type": "array",
940
- "items": {
941
- "$ref": "#/components/schemas/AddressMapper"
942
- }
943
- }
944
- },
945
- "required": [
946
- "mappings"
947
- ]
948
- },
949
- "AddressMapper": {
950
- "type": "object",
951
- "properties": {
952
- "target": {
953
- "type": "object",
954
- "properties": {
955
- "schema": {
956
- "type": "string",
957
- "description": "find target entity based on schema"
958
- },
959
- "tag": {
960
- "type": "string",
961
- "description": "find target entity based on entity tag"
962
- },
963
- "relation_tag": {
964
- "type": "string",
965
- "description": "find target entity based on relation tag on main entity relation"
966
- },
967
- "key": {
968
- "type": "string",
969
- "description": "target field for where to store this address."
970
- },
971
- "value_json": {
972
- "type": "string",
973
- "description": "stringified JSON for how to map address data"
974
- },
975
- "target_unique": {
976
- "type": "array",
977
- "items": {
978
- "type": "string"
979
- },
980
- "description": "Array of keys which should be used when checking for uniqueness. Eg: [country, city, postal_code]\n"
981
- }
982
- },
983
- "required": [
984
- "schema",
985
- "key",
986
- "value_json"
987
- ]
988
- },
989
- "reference": {
990
- "type": "object",
991
- "properties": {
992
- "schema": {
993
- "type": "string",
994
- "description": "Schema of the entity where the reference will be stored."
995
- },
996
- "key": {
997
- "type": "string",
998
- "description": "Field location to store the reference."
999
- },
1000
- "labels": {
1001
- "type": "array",
1002
- "items": {
1003
- "type": "string"
1004
- },
1005
- "description": "Optional relation labels to give meaning to this reference."
1006
- }
1007
- },
1008
- "required": [
1009
- "schema",
1010
- "key"
1011
- ]
1012
- }
1013
- },
1014
- "required": [
1015
- "target",
1016
- "reference"
1017
- ],
1018
- "example": {
1019
- "target": {
1020
- "schema": "contact",
1021
- "tag": "primary",
1022
- "key": "address",
1023
- "value_json": "{\"_tags\": [\"billing\"],\"city\":\"steps[0][Adresse][city]\",\"country\":\"steps[0][Adresse][countryCode]\",\"postal_code\":\"steps[0][Adresse][zipCode]\",\"street\":\"steps[0][Adresse][streetName]\",\"street_number\":\"steps[0][Adresse][houseNumber]\",\"additional_info\":\"steps[0][Adresse][addressExtention]\"}",
1024
- "target_unique": [
1025
- "country",
1026
- "city",
1027
- "postal_code",
1028
- "street",
1029
- "street_number"
1030
- ]
1031
- },
1032
- "reference": {
1033
- "schema": "opportunity",
1034
- "key": "billing_address"
1035
- }
1036
- }
1037
- },
1038
997
  "RelationAttribute": {
1039
998
  "type": "object",
1040
999
  "properties": {
@@ -1300,10 +1259,10 @@
1300
1259
  "value_json"
1301
1260
  ]
1302
1261
  },
1303
- "SendEmailAction": {
1262
+ "SendEmailActionConfig": {
1304
1263
  "allOf": [
1305
1264
  {
1306
- "$ref": "#/components/schemas/AutomationAction"
1265
+ "$ref": "#/components/schemas/AutomationActionConfig"
1307
1266
  },
1308
1267
  {
1309
1268
  "type": "object",
@@ -1314,7 +1273,7 @@
1314
1273
  ]
1315
1274
  },
1316
1275
  "config": {
1317
- "$ref": "#/components/schemas/SendEmailActionConfig"
1276
+ "$ref": "#/components/schemas/SendEmailConfig"
1318
1277
  }
1319
1278
  }
1320
1279
  }
@@ -1329,7 +1288,27 @@
1329
1288
  }
1330
1289
  }
1331
1290
  },
1332
- "SendEmailActionConfig": {
1291
+ "SendEmailAction": {
1292
+ "allOf": [
1293
+ {
1294
+ "$ref": "#/components/schemas/AutomationAction"
1295
+ },
1296
+ {
1297
+ "type": "object",
1298
+ "properties": {
1299
+ "type": {
1300
+ "enum": [
1301
+ "send-email"
1302
+ ]
1303
+ },
1304
+ "config": {
1305
+ "$ref": "#/components/schemas/SendEmailConfig"
1306
+ }
1307
+ }
1308
+ }
1309
+ ]
1310
+ },
1311
+ "SendEmailConfig": {
1333
1312
  "type": "object",
1334
1313
  "properties": {
1335
1314
  "email_template_id": {
@@ -1409,10 +1388,10 @@
1409
1388
  }
1410
1389
  }
1411
1390
  },
1412
- "CreateDocumentAction": {
1391
+ "CreateDocumentActionConfig": {
1413
1392
  "allOf": [
1414
1393
  {
1415
- "$ref": "#/components/schemas/AutomationAction"
1394
+ "$ref": "#/components/schemas/AutomationActionConfig"
1416
1395
  },
1417
1396
  {
1418
1397
  "type": "object",
@@ -1444,6 +1423,26 @@
1444
1423
  }
1445
1424
  }
1446
1425
  },
1426
+ "CreateDocumentAction": {
1427
+ "allOf": [
1428
+ {
1429
+ "$ref": "#/components/schemas/AutomationAction"
1430
+ },
1431
+ {
1432
+ "type": "object",
1433
+ "properties": {
1434
+ "type": {
1435
+ "enum": [
1436
+ "create-document"
1437
+ ]
1438
+ },
1439
+ "config": {
1440
+ "$ref": "#/components/schemas/CreateDocumentConfig"
1441
+ }
1442
+ }
1443
+ }
1444
+ ]
1445
+ },
1447
1446
  "CreateDocumentConfig": {
1448
1447
  "type": "object",
1449
1448
  "properties": {
@@ -1455,10 +1454,10 @@
1455
1454
  }
1456
1455
  }
1457
1456
  },
1458
- "TriggerWorkflowAction": {
1457
+ "TriggerWorkflowActionConfig": {
1459
1458
  "allOf": [
1460
1459
  {
1461
- "$ref": "#/components/schemas/AutomationAction"
1460
+ "$ref": "#/components/schemas/AutomationActionConfig"
1462
1461
  },
1463
1462
  {
1464
1463
  "type": "object",
@@ -1506,6 +1505,26 @@
1506
1505
  }
1507
1506
  }
1508
1507
  },
1508
+ "TriggerWorkflowAction": {
1509
+ "allOf": [
1510
+ {
1511
+ "$ref": "#/components/schemas/AutomationAction"
1512
+ },
1513
+ {
1514
+ "type": "object",
1515
+ "properties": {
1516
+ "type": {
1517
+ "enum": [
1518
+ "trigger-workflow"
1519
+ ]
1520
+ },
1521
+ "config": {
1522
+ "$ref": "#/components/schemas/TriggerWorkflowConfig"
1523
+ }
1524
+ }
1525
+ }
1526
+ ]
1527
+ },
1509
1528
  "TriggerWorkflowConfig": {
1510
1529
  "type": "object",
1511
1530
  "properties": {
@@ -1592,10 +1611,10 @@
1592
1611
  }
1593
1612
  ]
1594
1613
  },
1595
- "TriggerWebhookAction": {
1614
+ "TriggerWebhookActionConfig": {
1596
1615
  "allOf": [
1597
1616
  {
1598
- "$ref": "#/components/schemas/AutomationAction"
1617
+ "$ref": "#/components/schemas/AutomationActionConfig"
1599
1618
  },
1600
1619
  {
1601
1620
  "type": "object",
@@ -1606,7 +1625,7 @@
1606
1625
  ]
1607
1626
  },
1608
1627
  "config": {
1609
- "$ref": "#/components/schemas/TriggerWebhookActionConfig"
1628
+ "$ref": "#/components/schemas/TriggerWebhookConfig"
1610
1629
  }
1611
1630
  }
1612
1631
  }
@@ -1624,7 +1643,27 @@
1624
1643
  }
1625
1644
  }
1626
1645
  },
1627
- "TriggerWebhookActionConfig": {
1646
+ "TriggerWebhookAction": {
1647
+ "allOf": [
1648
+ {
1649
+ "$ref": "#/components/schemas/AutomationAction"
1650
+ },
1651
+ {
1652
+ "type": "object",
1653
+ "properties": {
1654
+ "type": {
1655
+ "enum": [
1656
+ "trigger-webhook"
1657
+ ]
1658
+ },
1659
+ "config": {
1660
+ "$ref": "#/components/schemas/TriggerWebhookConfig"
1661
+ }
1662
+ }
1663
+ }
1664
+ ]
1665
+ },
1666
+ "TriggerWebhookConfig": {
1628
1667
  "type": "object",
1629
1668
  "properties": {
1630
1669
  "entity_sources": {
@@ -1907,9 +1946,6 @@
1907
1946
  "CreateMeterReading",
1908
1947
  "UpdateMeterReading",
1909
1948
  "MessageActivity",
1910
- "EntityCreated",
1911
- "EntityUpdated",
1912
- "EntityDeleted",
1913
1949
  "SyncActivity"
1914
1950
  ]
1915
1951
  }
package/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@epilot/automation-client",
3
- "version": "1.9.6",
3
+ "version": "2.0.0",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@epilot/automation-client",
9
- "version": "1.9.5",
9
+ "version": "2.0.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@dazn/lambda-powertools-correlation-ids": "^1.28.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/automation-client",
3
- "version": "1.9.7",
3
+ "version": "2.0.1",
4
4
  "description": "Client library for epilot automation API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",