@epilot/automation-client 2.16.1 → 2.16.4

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
@@ -126,32 +126,6 @@ declare namespace Components {
126
126
  types?: (("CreateMeterReading" | "UpdateMeterReading" | "DocDownloadedFromPortal" | "PortalUserResetPassword" | "PortalUserResetForgotPassword" | "SelfAssignmentFromPortal") | string)[];
127
127
  };
128
128
  }
129
- export interface AdvancedCustomActionConfig {
130
- /**
131
- * Name of the custom action
132
- */
133
- name?: string;
134
- /**
135
- * Description of the custom action
136
- */
137
- description?: string;
138
- /**
139
- * The ID of the app to fetch configuration from the app API
140
- * example:
141
- * c451c26a-cc7a-4c1c-92bf-1c6246cbfe88
142
- */
143
- app_id?: string;
144
- /**
145
- * The ID of the component from the app. As the app can potentially have multiple custom actions, this ID is used to identify the component
146
- * example:
147
- * 2f1c26a-cc7a-4c1c-92bf-1c6246cbfe88
148
- */
149
- component_id?: string;
150
- type: "advanced";
151
- advanced_settings?: {
152
- [name: string]: any;
153
- };
154
- }
155
129
  export type AnyAction = MapEntityAction | TriggerWorkflowAction | TriggerWebhookAction | CreateDocumentAction | SendEmailAction | /* Creates an order entity with prices from journey */ CartCheckoutAction | CustomAction | AutomationAction;
156
130
  export type AnyActionConfig = /**
157
131
  * example:
@@ -352,7 +326,7 @@ declare namespace Components {
352
326
  * }
353
327
  * }
354
328
  */
355
- SendEmailActionConfig | /* Creates an order entity with prices from journey */ CartCheckoutActionConfig | CustomActionConfig | AutomationActionConfig;
329
+ SendEmailActionConfig | /* Creates an order entity with prices from journey */ CartCheckoutActionConfig | CustomAction | AutomationActionConfig;
356
330
  export type AnyTrigger = FrontendSubmitTrigger | JourneySubmitTrigger | ApiSubmissionTrigger | /**
357
331
  * - If provides filter_config, executes an automation based on the filtered configuration when an entity event occurs.
358
332
  * - The conditions on a filter follows the event bridge patterns - `https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html`
@@ -911,64 +885,6 @@ declare namespace Components {
911
885
  */
912
886
  id?: string; // uuid
913
887
  }
914
- export interface BaseCustomActionConfig {
915
- /**
916
- * Name of the custom action
917
- */
918
- name?: string;
919
- /**
920
- * Description of the custom action
921
- */
922
- description?: string;
923
- /**
924
- * The ID of the app to fetch configuration from the app API
925
- * example:
926
- * c451c26a-cc7a-4c1c-92bf-1c6246cbfe88
927
- */
928
- app_id?: string;
929
- /**
930
- * The ID of the component from the app. As the app can potentially have multiple custom actions, this ID is used to identify the component
931
- * example:
932
- * 2f1c26a-cc7a-4c1c-92bf-1c6246cbfe88
933
- */
934
- component_id?: string;
935
- }
936
- export interface BasicCustomActionConfig {
937
- /**
938
- * Name of the custom action
939
- */
940
- name?: string;
941
- /**
942
- * Description of the custom action
943
- */
944
- description?: string;
945
- /**
946
- * The ID of the app to fetch configuration from the app API
947
- * example:
948
- * c451c26a-cc7a-4c1c-92bf-1c6246cbfe88
949
- */
950
- app_id?: string;
951
- /**
952
- * The ID of the component from the app. As the app can potentially have multiple custom actions, this ID is used to identify the component
953
- * example:
954
- * 2f1c26a-cc7a-4c1c-92bf-1c6246cbfe88
955
- */
956
- component_id?: string;
957
- type: "basic";
958
- basic_settings?: {
959
- /**
960
- * URL to call
961
- */
962
- url?: string;
963
- headers?: {
964
- [name: string]: any;
965
- };
966
- /**
967
- * SSM Reference to the auth token to use for the request
968
- */
969
- auth_token_ref?: string;
970
- };
971
- }
972
888
  export interface BulkTriggerJob {
973
889
  job_id: /**
974
890
  * Job ID for tracking the status of bulk trigger automation executions
@@ -1386,7 +1302,33 @@ declare namespace Components {
1386
1302
  AutomationActionId;
1387
1303
  name?: string;
1388
1304
  type?: "custom-action";
1389
- config?: BasicCustomActionConfig | AdvancedCustomActionConfig;
1305
+ config?: {
1306
+ [name: string]: any;
1307
+ /**
1308
+ * The name of the custom action
1309
+ * example:
1310
+ * Credit Check
1311
+ */
1312
+ name?: string;
1313
+ /**
1314
+ * The description of the custom action
1315
+ * example:
1316
+ * Check if the customer has a credit limit
1317
+ */
1318
+ description?: string;
1319
+ /**
1320
+ * The ID of the app to fetch configuration from the app API
1321
+ * example:
1322
+ * c451c26a-cc7a-4c1c-92bf-1c6246cbfe88
1323
+ */
1324
+ app_id?: string;
1325
+ /**
1326
+ * The ID of the component from the app. As the app can potentially have multiple custom actions, this ID is used to identify the component
1327
+ * example:
1328
+ * 2f1c26a-cc7a-4c1c-92bf-1c6246cbfe88
1329
+ */
1330
+ component_id?: string;
1331
+ };
1390
1332
  /**
1391
1333
  * Whether to stop execution in a failed state if this action fails
1392
1334
  */
@@ -1434,55 +1376,6 @@ declare namespace Components {
1434
1376
  error_output?: ErrorOutput;
1435
1377
  retry_strategy?: /* different behaviors for retrying failed execution actions. */ RetryStrategy;
1436
1378
  }
1437
- export interface CustomActionConfig {
1438
- id?: /**
1439
- * example:
1440
- * 9ec3711b-db63-449c-b894-54d5bb622a8f
1441
- */
1442
- AutomationActionId;
1443
- flow_action_id?: /**
1444
- * example:
1445
- * 9ec3711b-db63-449c-b894-54d5bb622a8f
1446
- */
1447
- AutomationActionId;
1448
- name?: string;
1449
- type?: "custom-action";
1450
- config?: BasicCustomActionConfig | AdvancedCustomActionConfig;
1451
- /**
1452
- * Whether to stop execution in a failed state if this action fails
1453
- */
1454
- allow_failure?: boolean;
1455
- /**
1456
- * Flag indicating whether the action was created automatically or manually
1457
- */
1458
- created_automatically?: boolean;
1459
- /**
1460
- * Flag indicating whether the same action can be in bulk in a single execution. e.g; send-email / map-entity
1461
- */
1462
- is_bulk_action?: boolean;
1463
- reason?: {
1464
- /**
1465
- * Why the action has to be skipped/failed
1466
- * example:
1467
- * There are no registered portal users for the given emails, hence skipping the action
1468
- */
1469
- message?: string;
1470
- /**
1471
- * Extra metadata about the skipping reason - such as a certain condition not met, etc.
1472
- */
1473
- payload?: {
1474
- [name: string]: any;
1475
- };
1476
- };
1477
- /**
1478
- * Condition Id to be checked before executing the action
1479
- */
1480
- condition_id?: string;
1481
- /**
1482
- * Schedule Id which indicates the schedule of the action
1483
- */
1484
- schedule_id?: string;
1485
- }
1486
1379
  export type DiffAdded = FilterConditionOnEvent;
1487
1380
  export type DiffDeleted = FilterConditionOnEvent;
1488
1381
  export type DiffUpdated = FilterConditionOnEvent;
@@ -3602,7 +3495,6 @@ export type ActionSchedule = Components.Schemas.ActionSchedule;
3602
3495
  export type ActionScheduleSource = Components.Schemas.ActionScheduleSource;
3603
3496
  export type ActivityId = Components.Schemas.ActivityId;
3604
3497
  export type ActivityTrigger = Components.Schemas.ActivityTrigger;
3605
- export type AdvancedCustomActionConfig = Components.Schemas.AdvancedCustomActionConfig;
3606
3498
  export type AnyAction = Components.Schemas.AnyAction;
3607
3499
  export type AnyActionConfig = Components.Schemas.AnyActionConfig;
3608
3500
  export type AnyTrigger = Components.Schemas.AnyTrigger;
@@ -3620,8 +3512,6 @@ export type AutomationExecutionId = Components.Schemas.AutomationExecutionId;
3620
3512
  export type AutomationFlow = Components.Schemas.AutomationFlow;
3621
3513
  export type AutomationFlowId = Components.Schemas.AutomationFlowId;
3622
3514
  export type AutomationTrigger = Components.Schemas.AutomationTrigger;
3623
- export type BaseCustomActionConfig = Components.Schemas.BaseCustomActionConfig;
3624
- export type BasicCustomActionConfig = Components.Schemas.BasicCustomActionConfig;
3625
3515
  export type BulkTriggerJob = Components.Schemas.BulkTriggerJob;
3626
3516
  export type BulkTriggerRequest = Components.Schemas.BulkTriggerRequest;
3627
3517
  export type CartCheckoutAction = Components.Schemas.CartCheckoutAction;
@@ -3634,7 +3524,6 @@ export type CreateDocumentAction = Components.Schemas.CreateDocumentAction;
3634
3524
  export type CreateDocumentActionConfig = Components.Schemas.CreateDocumentActionConfig;
3635
3525
  export type CreateDocumentConfig = Components.Schemas.CreateDocumentConfig;
3636
3526
  export type CustomAction = Components.Schemas.CustomAction;
3637
- export type CustomActionConfig = Components.Schemas.CustomActionConfig;
3638
3527
  export type DiffAdded = Components.Schemas.DiffAdded;
3639
3528
  export type DiffDeleted = Components.Schemas.DiffDeleted;
3640
3529
  export type DiffUpdated = Components.Schemas.DiffUpdated;
package/dist/openapi.json CHANGED
@@ -874,7 +874,7 @@
874
874
  "$ref": "#/components/schemas/CartCheckoutActionConfig"
875
875
  },
876
876
  {
877
- "$ref": "#/components/schemas/CustomActionConfig"
877
+ "$ref": "#/components/schemas/CustomAction"
878
878
  },
879
879
  {
880
880
  "$ref": "#/components/schemas/AutomationActionConfig"
@@ -2005,33 +2005,10 @@
2005
2005
  }
2006
2006
  ]
2007
2007
  },
2008
- "BaseCustomActionConfig": {
2009
- "type": "object",
2010
- "properties": {
2011
- "name": {
2012
- "type": "string",
2013
- "description": "Name of the custom action"
2014
- },
2015
- "description": {
2016
- "type": "string",
2017
- "description": "Description of the custom action"
2018
- },
2019
- "app_id": {
2020
- "type": "string",
2021
- "description": "The ID of the app to fetch configuration from the app API",
2022
- "example": "c451c26a-cc7a-4c1c-92bf-1c6246cbfe88"
2023
- },
2024
- "component_id": {
2025
- "type": "string",
2026
- "description": "The ID of the component from the app. As the app can potentially have multiple custom actions, this ID is used to identify the component",
2027
- "example": "2f1c26a-cc7a-4c1c-92bf-1c6246cbfe88"
2028
- }
2029
- }
2030
- },
2031
- "BasicCustomActionConfig": {
2008
+ "CustomAction": {
2032
2009
  "allOf": [
2033
2010
  {
2034
- "$ref": "#/components/schemas/BaseCustomActionConfig"
2011
+ "$ref": "#/components/schemas/AutomationAction"
2035
2012
  },
2036
2013
  {
2037
2014
  "type": "object",
@@ -2039,121 +2016,31 @@
2039
2016
  "type": {
2040
2017
  "type": "string",
2041
2018
  "enum": [
2042
- "basic"
2019
+ "custom-action"
2043
2020
  ]
2044
2021
  },
2045
- "basic_settings": {
2022
+ "config": {
2046
2023
  "type": "object",
2047
2024
  "properties": {
2048
- "url": {
2025
+ "name": {
2049
2026
  "type": "string",
2050
- "description": "URL to call"
2027
+ "description": "The name of the custom action",
2028
+ "example": "Credit Check"
2051
2029
  },
2052
- "headers": {
2053
- "type": "object",
2054
- "additionalProperties": true
2055
- },
2056
- "auth_token_ref": {
2030
+ "description": {
2057
2031
  "type": "string",
2058
- "description": "SSM Reference to the auth token to use for the request"
2059
- }
2060
- }
2061
- }
2062
- },
2063
- "required": [
2064
- "type"
2065
- ]
2066
- }
2067
- ]
2068
- },
2069
- "AdvancedCustomActionConfig": {
2070
- "allOf": [
2071
- {
2072
- "$ref": "#/components/schemas/BaseCustomActionConfig"
2073
- },
2074
- {
2075
- "type": "object",
2076
- "properties": {
2077
- "type": {
2078
- "type": "string",
2079
- "enum": [
2080
- "advanced"
2081
- ]
2082
- },
2083
- "advanced_settings": {
2084
- "type": "object",
2085
- "additionalProperties": true
2086
- }
2087
- },
2088
- "required": [
2089
- "type"
2090
- ]
2091
- }
2092
- ]
2093
- },
2094
- "CustomActionConfig": {
2095
- "allOf": [
2096
- {
2097
- "$ref": "#/components/schemas/AutomationActionConfig"
2098
- },
2099
- {
2100
- "type": "object",
2101
- "properties": {
2102
- "type": {
2103
- "type": "string",
2104
- "enum": [
2105
- "custom-action"
2106
- ]
2107
- },
2108
- "config": {
2109
- "oneOf": [
2110
- {
2111
- "$ref": "#/components/schemas/BasicCustomActionConfig"
2032
+ "description": "The description of the custom action",
2033
+ "example": "Check if the customer has a credit limit"
2112
2034
  },
2113
- {
2114
- "$ref": "#/components/schemas/AdvancedCustomActionConfig"
2115
- }
2116
- ],
2117
- "discriminator": {
2118
- "propertyName": "type",
2119
- "mapping": {
2120
- "basic": "#/components/schemas/BasicCustomActionConfig",
2121
- "advanced": "#/components/schemas/AdvancedCustomActionConfig"
2122
- }
2123
- }
2124
- }
2125
- }
2126
- }
2127
- ]
2128
- },
2129
- "CustomAction": {
2130
- "allOf": [
2131
- {
2132
- "$ref": "#/components/schemas/AutomationAction"
2133
- },
2134
- {
2135
- "type": "object",
2136
- "properties": {
2137
- "type": {
2138
- "type": "string",
2139
- "enum": [
2140
- "custom-action"
2141
- ]
2142
- },
2143
- "config": {
2144
- "oneOf": [
2145
- {
2146
- "$ref": "#/components/schemas/BasicCustomActionConfig"
2035
+ "app_id": {
2036
+ "type": "string",
2037
+ "description": "The ID of the app to fetch configuration from the app API",
2038
+ "example": "c451c26a-cc7a-4c1c-92bf-1c6246cbfe88"
2147
2039
  },
2148
- {
2149
- "$ref": "#/components/schemas/AdvancedCustomActionConfig"
2150
- }
2151
- ],
2152
- "discriminator": {
2153
- "propertyName": "type",
2154
- "mapping": {
2155
- "basic": "#/components/schemas/BasicCustomActionConfig",
2156
- "advanced": "#/components/schemas/AdvancedCustomActionConfig"
2040
+ "component_id": {
2041
+ "type": "string",
2042
+ "description": "The ID of the component from the app. As the app can potentially have multiple custom actions, this ID is used to identify the component",
2043
+ "example": "2f1c26a-cc7a-4c1c-92bf-1c6246cbfe88"
2157
2044
  }
2158
2045
  }
2159
2046
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/automation-client",
3
- "version": "2.16.1",
3
+ "version": "2.16.4",
4
4
  "description": "Client library for epilot automation API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -24,7 +24,7 @@
24
24
  "test": "jest",
25
25
  "typescript": "tsc",
26
26
  "bundle-definition": "webpack",
27
- "openapi": "node ../../scripts/update-openapi.js ../../../backend/automation-api/lambda/ApiHandlerFunction/openapi.yml",
27
+ "openapi": "node ../../scripts/update-openapi.js https://docs.api.epilot.io/automation.yaml",
28
28
  "typegen": "openapi typegen src/openapi.json --client -b '/* eslint-disable */' > src/openapi.d.ts",
29
29
  "build": "tsc && npm run build:patch && npm run bundle-definition",
30
30
  "build:patch": "sed -i'' -e '/^__exportStar.*openapi.*$/d' dist/index.js",