@epilot/automation-client 2.5.7 → 2.6.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.
@@ -1 +1 @@
1
- !function(e,t){for(var o in t)e[o]=t[o];t.__esModule&&Object.defineProperty(e,"__esModule",{value:!0})}(exports,(()=>{"use strict";var e={914:function(e,t,o){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(o(946));t.default=i.default},946:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"","version":""},"paths":{"/v1/automation/flows":{"get":{"operationId":"searchFlows","parameters":[{"name":"schema","in":"query"},{"name":"size","in":"query"},{"name":"from","in":"query"},{"name":"trigger_source_id","in":"query"}]},"post":{"operationId":"createFlow","requestBody":{"content":{"application/json":{}}}}},"/v1/automation/flows/{flow_id}":{"get":{"operationId":"getFlow","parameters":[{"name":"flow_id","in":"path","required":true}]},"put":{"operationId":"putFlow","parameters":[{"name":"flow_id","in":"path","required":true}],"requestBody":{"content":{"application/json":{}}}},"delete":{"operationId":"deleteFlow","parameters":[{"name":"flow_id","in":"path","required":true}]}},"/v1/automation/executions":{"get":{"operationId":"getExecutions","parameters":[{"name":"entity_id","in":"query"},{"name":"size","in":"query"},{"name":"from","in":"query"}]},"post":{"operationId":"startExecution","requestBody":{"content":{"application/json":{}}}}},"/v1/automation/executions/{execution_id}":{"get":{"operationId":"getExecution","parameters":[{"name":"execution_id","in":"path","required":true}]},"delete":{"operationId":"cancelExecution","parameters":[{"name":"execution_id","in":"path","required":true}]}},"/v1/automation/executions/{execution_id}/{action_id}/retrigger":{"post":{"operationId":"retriggerAction","parameters":[{"name":"execution_id","in":"path","required":true},{"name":"action_id","in":"path","required":true}],"requestBody":{"required":false,"content":{"application/json":{}}}}}},"components":{},"servers":[{"url":"https://automation.sls.epilot.io"}]}')}},t={};return function o(r){if(t[r])return t[r].exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,o),i.exports}(914)})());
1
+ (()=>{"use strict";var e={914:function(e,t,o){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(o(240));t.default=i.default},240:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"","version":""},"paths":{"/v1/automation/flows":{"get":{"operationId":"searchFlows","parameters":[{"name":"schema","in":"query"},{"name":"size","in":"query"},{"name":"from","in":"query"},{"name":"trigger_source_id","in":"query"}]},"post":{"operationId":"createFlow","requestBody":{"content":{"application/json":{}}}}},"/v1/automation/flows/{flow_id}":{"get":{"operationId":"getFlow","parameters":[{"name":"flow_id","in":"path","required":true}]},"put":{"operationId":"putFlow","parameters":[{"name":"flow_id","in":"path","required":true}],"requestBody":{"content":{"application/json":{}}}},"delete":{"operationId":"deleteFlow","parameters":[{"name":"flow_id","in":"path","required":true}]}},"/v1/automation/executions":{"get":{"operationId":"getExecutions","parameters":[{"name":"entity_id","in":"query"},{"name":"size","in":"query"},{"name":"from","in":"query"}]},"post":{"operationId":"startExecution","requestBody":{"content":{"application/json":{}}}}},"/v1/automation/executions/{execution_id}":{"get":{"operationId":"getExecution","parameters":[{"name":"execution_id","in":"path","required":true}]},"delete":{"operationId":"cancelExecution","parameters":[{"name":"execution_id","in":"path","required":true}]}},"/v1/automation/executions/{execution_id}/{action_id}/retrigger":{"post":{"operationId":"retriggerAction","parameters":[{"name":"execution_id","in":"path","required":true},{"name":"action_id","in":"path","required":true}],"requestBody":{"required":false,"content":{"application/json":{}}}}}},"components":{},"servers":[{"url":"https://automation.sls.epilot.io"}]}')}},t={},o=function o(r){var i=t[r];if(void 0!==i)return i.exports;var n=t[r]={exports:{}};return e[r].call(n.exports,n,n.exports,o),n.exports}(914),r=exports;for(var i in o)r[i]=o[i];o.__esModule&&Object.defineProperty(r,"__esModule",{value:!0})})();
package/dist/index.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
package/dist/openapi.d.ts CHANGED
@@ -22,7 +22,7 @@ declare namespace Components {
22
22
  * submission
23
23
  */
24
24
  schema?: string;
25
- types?: ("CreateMeterReading" | "UpdateMeterReading" | "DocDownloadedFromPortal" | "MessageActivity" | "SyncActivity" | "EntityAccessFromPortal")[];
25
+ types?: ("CreateMeterReading" | "UpdateMeterReading" | "DocDownloadedFromPortal")[];
26
26
  };
27
27
  }
28
28
  export type AnyAction = MapEntityAction | TriggerWorkflowAction | TriggerWebhookAction | CreateDocumentAction | SendEmailAction | /* Creates an order entity with prices from journey */ CartCheckoutAction | AutomationAction;
@@ -245,6 +245,7 @@ declare namespace Components {
245
245
  * | Does not exist | ProductName does not exist | `"ProductName": [ { "exists": false } ]` |
246
246
  * | Begins with | OpportunityNumber starts with OPP- | `"opportunity_number": [ { "prefix": "OPP-" } ]` |
247
247
  * | Ends with | FileName ends with a .png extension | `"filename": [ { "suffix": ".png" } ]` |
248
+ * | Wildcard | search a string using a wildcard | `"email": [ { "wildcard": "*@doe.com" } ]` |
248
249
  * - To run the execution on all update events
249
250
  * ```
250
251
  * {
@@ -996,6 +997,7 @@ declare namespace Components {
996
997
  * | Does not exist | ProductName does not exist | `"ProductName": [ { "exists": false } ]` |
997
998
  * | Begins with | OpportunityNumber starts with OPP- | `"opportunity_number": [ { "prefix": "OPP-" } ]` |
998
999
  * | Ends with | FileName ends with a .png extension | `"filename": [ { "suffix": ".png" } ]` |
1000
+ * | Wildcard | search a string using a wildcard | `"email": [ { "wildcard": "*@doe.com" } ]` |
999
1001
  * - To run the execution on all update events
1000
1002
  * ```
1001
1003
  * {
@@ -1157,7 +1159,7 @@ declare namespace Components {
1157
1159
  * "DocUploadedFromPortal"
1158
1160
  * ]
1159
1161
  */
1160
- type?: (string | EqualsIgnoreCaseCondition | AnythingButCondition | ExistsCondition | PrefixCondition | SuffixCondition)[];
1162
+ type?: (string | EqualsIgnoreCaseCondition | AnythingButCondition | ExistsCondition | PrefixCondition | SuffixCondition | WildcardCondition)[];
1161
1163
  };
1162
1164
  };
1163
1165
  };
@@ -1175,7 +1177,7 @@ declare namespace Components {
1175
1177
  exists?: boolean;
1176
1178
  }
1177
1179
  export type FilterConditionOnEvent = OrCondition | {
1178
- [name: string]: (string | EqualsIgnoreCaseCondition | AnythingButCondition | NumericCondition | ExistsCondition | PrefixCondition | SuffixCondition)[];
1180
+ [name: string]: (string | EqualsIgnoreCaseCondition | AnythingButCondition | NumericCondition | ExistsCondition | PrefixCondition | SuffixCondition | WildcardCondition)[];
1179
1181
  };
1180
1182
  export interface FrontendSubmitTrigger {
1181
1183
  type: "frontend_submission";
@@ -2113,6 +2115,9 @@ declare namespace Components {
2113
2115
  */
2114
2116
  AssignUsersToStep[];
2115
2117
  }
2118
+ export interface WildcardCondition {
2119
+ wildcard?: string;
2120
+ }
2116
2121
  }
2117
2122
  }
2118
2123
  declare namespace Paths {
package/dist/openapi.json CHANGED
@@ -2182,6 +2182,9 @@
2182
2182
  },
2183
2183
  {
2184
2184
  "$ref": "#/components/schemas/SuffixCondition"
2185
+ },
2186
+ {
2187
+ "$ref": "#/components/schemas/WildcardCondition"
2185
2188
  }
2186
2189
  ]
2187
2190
  },
@@ -2203,7 +2206,7 @@
2203
2206
  "type",
2204
2207
  "configuration"
2205
2208
  ],
2206
- "description": "- If provides filter_config, executes an automation based on the filtered configuration when an entity event occurs.\n- The conditions on a filter follows the event bridge patterns - `https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html`\n | Comparison | Example | Rule syntax |\n |------------------------|-----------------------------------------------------|----------------------------------------------------------|\n | Null | first_name is null | `\"first_name\": [ null ]` |\n | Empty | last_name is empty | `\"last_name\": [\"\"]` |\n | Equals | email is \"j.doe@email.com\" | `\"email\": [ \"j.doe@email.com\" ]` |\n | Equals (ignore case) | first_name is \"John\" | `\"first_name\": [ { \"equals-ignore-case\": \"john\" } ]` |\n | And | fist_name is \"John\" and last_name is \"Doe\" | `\"first_name\": [ \"John\" ], \"last_name\": [\"Doe\"]` |\n | Or | PaymentType is \"Invoice\" or \"SEPA\" | `\"PaymentType\": [ \"invoice\", \"sepa\"]` |\n | Or (multiple fields) | first_name is \"John\", or last_name is \"Doe\". | `\"$or\": [ { \"first_name\": [ \"John\" ] }, { \"last_name\": [ \"Doe\" ] } ]` |\n | Not | status is anything but \"cancelled\" | `\"status\": [ { \"anything-but\": [ \"cancelled\" ] } ]` |\n | Numeric (equals) | Price is 100 | `\"Price\": [ { \"numeric\": [ \"=\", 100 ] } ]` |\n | Numeric (range) | Price is more than 10, and less than or equal to 20 | `\"Price\": [ { \"numeric\": [ \">\", 10, \"<=\", 20 ] } ]` |\n | Exists | ProductName exists | `\"ProductName\": [ { \"exists\": true } ]` |\n | Does not exist | ProductName does not exist | `\"ProductName\": [ { \"exists\": false } ]` |\n | Begins with | OpportunityNumber starts with OPP- | `\"opportunity_number\": [ { \"prefix\": \"OPP-\" } ]` |\n | Ends with | FileName ends with a .png extension | `\"filename\": [ { \"suffix\": \".png\" } ]` |\n - To run the execution on all update events\n ```\n {\n \"type\": \"filter_entity_event\",\n \"configuration\": {\n \"operation\": {\n \"operation\": [\"updateEntity\"]\n }\n }\n }\n ```\n - To run the execution only when the updates are from a portal user\n ```\n {\n \"type\": \"filter_entity_event\",\n \"configuration\": {\n \"operation\": {\n \"operation\": [\"updateEntity\"]\n },\n \"activity\": {\n \"type\": \"EntityUpdatedFromPortal\"\n }\n }\n }\n ```\n - To run the execution only when there is an update on a specific attribute\n ```\n Only starts the automation when the email on a contact is changed\n {\n \"type\": \"filter_entity_event\",\n \"configuration\": {\n \"operation\": {\n \"operation\": [\"updateEntity\"],\n \"payload\": {\n \"_schema\": [\"contact\"]\n },\n \"diff\": {\n \"updated\": {\n \"email\": [{ \"exists\": true }]\n }\n }\n }\n }\n }\n ```\n - To run the execution only when a specific attribute is altered(created/updated/deleted)\n ```\n Only starts the automation when a price is altered on a contract\n {\n \"type\": \"filter_entity_event\",\n \"configuration\": {\n \"operation\": {\n \"payload\": {\n \"_schema\": [\"contract\"]\n },\n \"diff\": {\n // Whether he first_name has been added, updated, or removed\n $or: [\n {\n 'added.first_name': [{ exists: true }]\n },\n {\n 'updated.first_name': [{ exists: true }]\n },\n {\n 'deleted.first_name': [{ exists: true }]\n }\n ]\n }\n }\n }\n }\n ```\n - To run the execution if an attribute is changed from one state to another\n ```\n Only starts the automation when the order status changes from `open_for_acceptance` to `placed`\n {\n \"type\": \"filter_entity_event\",\n \"configuration\": {\n \"operation\": {\n \"operation\": [\"updateEntity\"],\n \"payload\": {\n \"_schema\": [\"order\"],\n \"status\": [\"placed\"]\n },\n \"diff\": {\n \"updated\": {\n \"status\": [\"open_for_acceptance\"]\n }\n }\n }\n }\n }\n ```\n"
2209
+ "description": "- If provides filter_config, executes an automation based on the filtered configuration when an entity event occurs.\n- The conditions on a filter follows the event bridge patterns - `https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html`\n | Comparison | Example | Rule syntax |\n |------------------------|-----------------------------------------------------|----------------------------------------------------------|\n | Null | first_name is null | `\"first_name\": [ null ]` |\n | Empty | last_name is empty | `\"last_name\": [\"\"]` |\n | Equals | email is \"j.doe@email.com\" | `\"email\": [ \"j.doe@email.com\" ]` |\n | Equals (ignore case) | first_name is \"John\" | `\"first_name\": [ { \"equals-ignore-case\": \"john\" } ]` |\n | And | fist_name is \"John\" and last_name is \"Doe\" | `\"first_name\": [ \"John\" ], \"last_name\": [\"Doe\"]` |\n | Or | PaymentType is \"Invoice\" or \"SEPA\" | `\"PaymentType\": [ \"invoice\", \"sepa\"]` |\n | Or (multiple fields) | first_name is \"John\", or last_name is \"Doe\". | `\"$or\": [ { \"first_name\": [ \"John\" ] }, { \"last_name\": [ \"Doe\" ] } ]` |\n | Not | status is anything but \"cancelled\" | `\"status\": [ { \"anything-but\": [ \"cancelled\" ] } ]` |\n | Numeric (equals) | Price is 100 | `\"Price\": [ { \"numeric\": [ \"=\", 100 ] } ]` |\n | Numeric (range) | Price is more than 10, and less than or equal to 20 | `\"Price\": [ { \"numeric\": [ \">\", 10, \"<=\", 20 ] } ]` |\n | Exists | ProductName exists | `\"ProductName\": [ { \"exists\": true } ]` |\n | Does not exist | ProductName does not exist | `\"ProductName\": [ { \"exists\": false } ]` |\n | Begins with | OpportunityNumber starts with OPP- | `\"opportunity_number\": [ { \"prefix\": \"OPP-\" } ]` |\n | Ends with | FileName ends with a .png extension | `\"filename\": [ { \"suffix\": \".png\" } ]` |\n | Wildcard | search a string using a wildcard | `\"email\": [ { \"wildcard\": \"*@doe.com\" } ]` |\n - To run the execution on all update events\n ```\n {\n \"type\": \"filter_entity_event\",\n \"configuration\": {\n \"operation\": {\n \"operation\": [\"updateEntity\"]\n }\n }\n }\n ```\n - To run the execution only when the updates are from a portal user\n ```\n {\n \"type\": \"filter_entity_event\",\n \"configuration\": {\n \"operation\": {\n \"operation\": [\"updateEntity\"]\n },\n \"activity\": {\n \"type\": \"EntityUpdatedFromPortal\"\n }\n }\n }\n ```\n - To run the execution only when there is an update on a specific attribute\n ```\n Only starts the automation when the email on a contact is changed\n {\n \"type\": \"filter_entity_event\",\n \"configuration\": {\n \"operation\": {\n \"operation\": [\"updateEntity\"],\n \"payload\": {\n \"_schema\": [\"contact\"]\n },\n \"diff\": {\n \"updated\": {\n \"email\": [{ \"exists\": true }]\n }\n }\n }\n }\n }\n ```\n - To run the execution only when a specific attribute is altered(created/updated/deleted)\n ```\n Only starts the automation when a price is altered on a contract\n {\n \"type\": \"filter_entity_event\",\n \"configuration\": {\n \"operation\": {\n \"payload\": {\n \"_schema\": [\"contract\"]\n },\n \"diff\": {\n // Whether he first_name has been added, updated, or removed\n $or: [\n {\n 'added.first_name': [{ exists: true }]\n },\n {\n 'updated.first_name': [{ exists: true }]\n },\n {\n 'deleted.first_name': [{ exists: true }]\n }\n ]\n }\n }\n }\n }\n ```\n - To run the execution if an attribute is changed from one state to another\n ```\n Only starts the automation when the order status changes from `open_for_acceptance` to `placed`\n {\n \"type\": \"filter_entity_event\",\n \"configuration\": {\n \"operation\": {\n \"operation\": [\"updateEntity\"],\n \"payload\": {\n \"_schema\": [\"order\"],\n \"status\": [\"placed\"]\n },\n \"diff\": {\n \"updated\": {\n \"status\": [\"open_for_acceptance\"]\n }\n }\n }\n }\n }\n ```\n"
2207
2210
  },
2208
2211
  "ActivityTrigger": {
2209
2212
  "type": "object",
@@ -2228,10 +2231,7 @@
2228
2231
  "enum": [
2229
2232
  "CreateMeterReading",
2230
2233
  "UpdateMeterReading",
2231
- "DocDownloadedFromPortal",
2232
- "MessageActivity",
2233
- "SyncActivity",
2234
- "EntityAccessFromPortal"
2234
+ "DocDownloadedFromPortal"
2235
2235
  ]
2236
2236
  }
2237
2237
  }
@@ -2358,6 +2358,9 @@
2358
2358
  },
2359
2359
  {
2360
2360
  "$ref": "#/components/schemas/SuffixCondition"
2361
+ },
2362
+ {
2363
+ "$ref": "#/components/schemas/WildcardCondition"
2361
2364
  }
2362
2365
  ]
2363
2366
  }
@@ -2426,6 +2429,14 @@
2426
2429
  }
2427
2430
  }
2428
2431
  },
2432
+ "WildcardCondition": {
2433
+ "type": "object",
2434
+ "properties": {
2435
+ "wildcard": {
2436
+ "type": "string"
2437
+ }
2438
+ }
2439
+ },
2429
2440
  "OrCondition": {
2430
2441
  "type": "object",
2431
2442
  "properties": {
@@ -2518,6 +2529,9 @@
2518
2529
  }
2519
2530
  },
2520
2531
  "servers": [
2532
+ {
2533
+ "url": "https://automation.sls.epilot.io"
2534
+ },
2521
2535
  {
2522
2536
  "url": "https://automation.sls.epilot.io"
2523
2537
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/automation-client",
3
- "version": "2.5.7",
3
+ "version": "2.6.0",
4
4
  "description": "Client library for epilot automation API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -64,16 +64,16 @@
64
64
  "jest": "^26.6.3",
65
65
  "json-loader": "^0.5.7",
66
66
  "node-fetch": "^3.2.10",
67
- "openapi-client-axios": "^6.0.0",
68
- "openapi-client-axios-typegen": "^7.2.0",
67
+ "openapi-client-axios": "^7.1.3",
68
+ "openapi-client-axios-typegen": "^7.4.1",
69
69
  "openapicmd": "^1.16.2",
70
70
  "ts-jest": "^26.5.0",
71
71
  "ts-loader": "^8.0.14",
72
- "ts-node": "^9.1.1",
72
+ "ts-node": "^10.9.1",
73
73
  "typescript": "^4.1.3",
74
74
  "webpack": "^5.18.0",
75
75
  "webpack-cli": "^4.4.0",
76
76
  "whatwg-url": "^11.0.0"
77
77
  },
78
78
  "gitHead": "39426e86cfb320fa3227dc03f60ee6a10848e7c7"
79
- }
79
+ }