@epilot/automation-client 0.1.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.
- package/README.md +43 -0
- package/dist/client.d.ts +1 -0
- package/dist/client.js +14 -0
- package/dist/definition.d.ts +3 -0
- package/dist/definition.js +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +14 -0
- package/dist/openapi.d.ts +484 -0
- package/package.json +57 -0
- package/src/openapi.d.ts +484 -0
package/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# `@epilot/automation-client`
|
|
2
|
+
|
|
3
|
+
API Client for epilot automation API.
|
|
4
|
+
|
|
5
|
+
Uses [`openapi-client-axios`](https://github.com/anttiviljami/openapi-client-axios)
|
|
6
|
+
|
|
7
|
+
## Getting Started
|
|
8
|
+
|
|
9
|
+
Install the package:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install --save-dev @epilot/automation-client
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Import the package:
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import { getClient } from '@epilot/automation-client';
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Use the client:
|
|
22
|
+
```typescript
|
|
23
|
+
// get typed client
|
|
24
|
+
const client = await getClient();
|
|
25
|
+
|
|
26
|
+
// call an operation
|
|
27
|
+
const res = await client.testS3();
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## BaseURL & Authorization
|
|
31
|
+
|
|
32
|
+
To pass an authorization header and set up the API url, you can use axios
|
|
33
|
+
defaults:
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
const client = getClient();
|
|
37
|
+
client.defaults.baseURL = config.API_URL;
|
|
38
|
+
client.defaults.headers['authorization'] = `Bearer ${token}`;
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## API Docs:
|
|
42
|
+
|
|
43
|
+
https://docs.api.epilot.io/
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getClient: () => import("openapi-client-axios").OpenAPIClient<import("./openapi").OperationMethods, import("./openapi").PathsDictionary>;
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getClient = void 0;
|
|
7
|
+
var openapi_client_axios_1 = __importDefault(require("openapi-client-axios"));
|
|
8
|
+
var definition_1 = __importDefault(require("./definition"));
|
|
9
|
+
var getClient = function () {
|
|
10
|
+
var api = new openapi_client_axios_1.default({ definition: definition_1.default, quick: true });
|
|
11
|
+
return api.initSync();
|
|
12
|
+
};
|
|
13
|
+
exports.getClient = getClient;
|
|
14
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){for(var a in t)e[a]=t[a];t.__esModule&&Object.defineProperty(e,"__esModule",{value:!0})}(exports,(()=>{"use strict";var e={914:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(a(279));t.default=i.default},279:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"Automation API","description":"API Backend for epilot Automation Workflows feature","version":"1.0.0"},"tags":[{"name":"workflows","description":"Automation workflows"},{"name":"executions","description":"Automation executions"}],"security":[{"EpilotAuth":[]},{"AsOrganization":[]}],"paths":{"/v1/automation/workflows":{"get":{"operationId":"searchAutomations","summary":"searchAutomations","description":"Search available automation workflows","tags":["workflows"],"parameters":[{"name":"schema","in":"query","description":"Entity Schema","schema":{"type":"string","example":"submission"}},{"name":"size","in":"query","description":"Pagination: max number of results to return","schema":{"type":"integer","default":25}},{"name":"from","in":"query","description":"Pagination: starting for results","schema":{"type":"integer","default":0}}],"responses":{"200":{"description":"List of automation workflows","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer","example":1},"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"7791b04a-16d2-44a2-9af9-2d59c25c512f"},"workflow_name":{"type":"string","example":"Handle contact form"},"triggers":{"type":"array","items":{"type":"object","properties":{"on":{"type":"string","enum":["entity_create","entity_update","entity_delete","journey_submit","frontend_submit"]},"config":{"type":"object","additionalProperties":true,"example":{"entity_schema":"contact"}}},"required":["on","config"],"example":{"on":"journey_submit","config":{"journey_id":"53c5d0bb-4ee7-4ed6-b3e0-0262383fd4b9"}}}},"schemas":{"type":"array","description":"schemas this automation is available for","items":{"type":"string","example":"submission"}},"actions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"9ec3711b-db63-449c-b894-54d5bb622a8f"},"name":{"type":"string","example":"Create Contact"},"type":{"type":"string","example":"entity_mapping"},"config":{"type":"object","additionalProperties":true,"example":{"mapping_attributes":[{"target":"email","mode":"upsert_match","source":"billing_contact.email"},{"target":"first_name","mode":"copy_if_exists","source":"billing_contact.first_name"},{"target":"last_name","mode":"copy_if_exists","source":"billing_contact.last_name"},{"target":"addresses","mode":"append_if_exists","source":"billing_contact","value_json":"{\\n \\"street_name\\": \\"{{billing_contact.street_name}}\\",\\n \\"street_number\\": \\"{{billing_contact.street_number}}\\",\\n \\"city\\": \\"{{billing_contact.city}}\\",\\n \\"postal_code\\": \\"{{billing_contact.postal_code}}\\",\\n \\"country\\": \\"{{billing_contact.country}}\\",\\n}"},{"target":"addresses","mode":"append_if_exists","source":"delivery_contact","value_json":"{\\n \\"street_name\\": \\"{{delivery_contact.street_name}}\\",\\n \\"street_number\\": \\"{{delivery_contact.street_number}}\\",\\n \\"city\\": \\"{{delivery_contact.city}}\\",\\n \\"postal_code\\": \\"{{delivery_contact.postal_code}}\\",\\n \\"country\\": \\"{{delivery_contact.country}}\\",\\n}"}]}}}}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}}}}}}}}},"post":{"operationId":"createAutomation","summary":"createAutomation","description":"Create new automation workflow","tags":["workflows"],"requestBody":{"description":"Automation workflow to create","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"7791b04a-16d2-44a2-9af9-2d59c25c512f"},"workflow_name":{"type":"string","example":"Handle contact form"},"triggers":{"type":"array","items":{"type":"object","properties":{"on":{"type":"string","enum":["entity_create","entity_update","entity_delete","journey_submit","frontend_submit"]},"config":{"type":"object","additionalProperties":true,"example":{"entity_schema":"contact"}}},"required":["on","config"],"example":{"on":"journey_submit","config":{"journey_id":"53c5d0bb-4ee7-4ed6-b3e0-0262383fd4b9"}}}},"schemas":{"type":"array","description":"schemas this automation is available for","items":{"type":"string","example":"submission"}},"actions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"9ec3711b-db63-449c-b894-54d5bb622a8f"},"name":{"type":"string","example":"Create Contact"},"type":{"type":"string","example":"entity_mapping"},"config":{"type":"object","additionalProperties":true,"example":{"mapping_attributes":[{"target":"email","mode":"upsert_match","source":"billing_contact.email"},{"target":"first_name","mode":"copy_if_exists","source":"billing_contact.first_name"},{"target":"last_name","mode":"copy_if_exists","source":"billing_contact.last_name"},{"target":"addresses","mode":"append_if_exists","source":"billing_contact","value_json":"{\\n \\"street_name\\": \\"{{billing_contact.street_name}}\\",\\n \\"street_number\\": \\"{{billing_contact.street_number}}\\",\\n \\"city\\": \\"{{billing_contact.city}}\\",\\n \\"postal_code\\": \\"{{billing_contact.postal_code}}\\",\\n \\"country\\": \\"{{billing_contact.country}}\\",\\n}"},{"target":"addresses","mode":"append_if_exists","source":"delivery_contact","value_json":"{\\n \\"street_name\\": \\"{{delivery_contact.street_name}}\\",\\n \\"street_number\\": \\"{{delivery_contact.street_number}}\\",\\n \\"city\\": \\"{{delivery_contact.city}}\\",\\n \\"postal_code\\": \\"{{delivery_contact.postal_code}}\\",\\n \\"country\\": \\"{{delivery_contact.country}}\\",\\n}"}]}}}}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}}}},"responses":{"201":{"description":"The created automation workflow","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"7791b04a-16d2-44a2-9af9-2d59c25c512f"},"workflow_name":{"type":"string","example":"Handle contact form"},"triggers":{"type":"array","items":{"type":"object","properties":{"on":{"type":"string","enum":["entity_create","entity_update","entity_delete","journey_submit","frontend_submit"]},"config":{"type":"object","additionalProperties":true,"example":{"entity_schema":"contact"}}},"required":["on","config"],"example":{"on":"journey_submit","config":{"journey_id":"53c5d0bb-4ee7-4ed6-b3e0-0262383fd4b9"}}}},"schemas":{"type":"array","description":"schemas this automation is available for","items":{"type":"string","example":"submission"}},"actions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"9ec3711b-db63-449c-b894-54d5bb622a8f"},"name":{"type":"string","example":"Create Contact"},"type":{"type":"string","example":"entity_mapping"},"config":{"type":"object","additionalProperties":true,"example":{"mapping_attributes":[{"target":"email","mode":"upsert_match","source":"billing_contact.email"},{"target":"first_name","mode":"copy_if_exists","source":"billing_contact.first_name"},{"target":"last_name","mode":"copy_if_exists","source":"billing_contact.last_name"},{"target":"addresses","mode":"append_if_exists","source":"billing_contact","value_json":"{\\n \\"street_name\\": \\"{{billing_contact.street_name}}\\",\\n \\"street_number\\": \\"{{billing_contact.street_number}}\\",\\n \\"city\\": \\"{{billing_contact.city}}\\",\\n \\"postal_code\\": \\"{{billing_contact.postal_code}}\\",\\n \\"country\\": \\"{{billing_contact.country}}\\",\\n}"},{"target":"addresses","mode":"append_if_exists","source":"delivery_contact","value_json":"{\\n \\"street_name\\": \\"{{delivery_contact.street_name}}\\",\\n \\"street_number\\": \\"{{delivery_contact.street_number}}\\",\\n \\"city\\": \\"{{delivery_contact.city}}\\",\\n \\"postal_code\\": \\"{{delivery_contact.postal_code}}\\",\\n \\"country\\": \\"{{delivery_contact.country}}\\",\\n}"}]}}}}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}}}}}}},"/v1/automation/workflows/{workflow_id}":{"get":{"operationId":"getAutomation","summary":"getAutomation","description":"List available automation workflows","tags":["workflows"],"parameters":[{"name":"workflow_id","in":"path","required":true,"description":"Automation Workflow ID","schema":{"type":"string","example":"7791b04a-16d2-44a2-9af9-2d59c25c512f"}}],"responses":{"200":{"description":"The returned automation workflow","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"7791b04a-16d2-44a2-9af9-2d59c25c512f"},"workflow_name":{"type":"string","example":"Handle contact form"},"triggers":{"type":"array","items":{"type":"object","properties":{"on":{"type":"string","enum":["entity_create","entity_update","entity_delete","journey_submit","frontend_submit"]},"config":{"type":"object","additionalProperties":true,"example":{"entity_schema":"contact"}}},"required":["on","config"],"example":{"on":"journey_submit","config":{"journey_id":"53c5d0bb-4ee7-4ed6-b3e0-0262383fd4b9"}}}},"schemas":{"type":"array","description":"schemas this automation is available for","items":{"type":"string","example":"submission"}},"actions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"9ec3711b-db63-449c-b894-54d5bb622a8f"},"name":{"type":"string","example":"Create Contact"},"type":{"type":"string","example":"entity_mapping"},"config":{"type":"object","additionalProperties":true,"example":{"mapping_attributes":[{"target":"email","mode":"upsert_match","source":"billing_contact.email"},{"target":"first_name","mode":"copy_if_exists","source":"billing_contact.first_name"},{"target":"last_name","mode":"copy_if_exists","source":"billing_contact.last_name"},{"target":"addresses","mode":"append_if_exists","source":"billing_contact","value_json":"{\\n \\"street_name\\": \\"{{billing_contact.street_name}}\\",\\n \\"street_number\\": \\"{{billing_contact.street_number}}\\",\\n \\"city\\": \\"{{billing_contact.city}}\\",\\n \\"postal_code\\": \\"{{billing_contact.postal_code}}\\",\\n \\"country\\": \\"{{billing_contact.country}}\\",\\n}"},{"target":"addresses","mode":"append_if_exists","source":"delivery_contact","value_json":"{\\n \\"street_name\\": \\"{{delivery_contact.street_name}}\\",\\n \\"street_number\\": \\"{{delivery_contact.street_number}}\\",\\n \\"city\\": \\"{{delivery_contact.city}}\\",\\n \\"postal_code\\": \\"{{delivery_contact.postal_code}}\\",\\n \\"country\\": \\"{{delivery_contact.country}}\\",\\n}"}]}}}}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}}}}}},"put":{"operationId":"putAutomation","summary":"putAutomation","description":"Update automation workflow by id","tags":["workflows"],"parameters":[{"name":"workflow_id","in":"path","required":true,"description":"Automation Workflow ID","schema":{"type":"string","example":"7791b04a-16d2-44a2-9af9-2d59c25c512f"}}],"requestBody":{"description":"Automation workflow to create","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"7791b04a-16d2-44a2-9af9-2d59c25c512f"},"workflow_name":{"type":"string","example":"Handle contact form"},"triggers":{"type":"array","items":{"type":"object","properties":{"on":{"type":"string","enum":["entity_create","entity_update","entity_delete","journey_submit","frontend_submit"]},"config":{"type":"object","additionalProperties":true,"example":{"entity_schema":"contact"}}},"required":["on","config"],"example":{"on":"journey_submit","config":{"journey_id":"53c5d0bb-4ee7-4ed6-b3e0-0262383fd4b9"}}}},"schemas":{"type":"array","description":"schemas this automation is available for","items":{"type":"string","example":"submission"}},"actions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"9ec3711b-db63-449c-b894-54d5bb622a8f"},"name":{"type":"string","example":"Create Contact"},"type":{"type":"string","example":"entity_mapping"},"config":{"type":"object","additionalProperties":true,"example":{"mapping_attributes":[{"target":"email","mode":"upsert_match","source":"billing_contact.email"},{"target":"first_name","mode":"copy_if_exists","source":"billing_contact.first_name"},{"target":"last_name","mode":"copy_if_exists","source":"billing_contact.last_name"},{"target":"addresses","mode":"append_if_exists","source":"billing_contact","value_json":"{\\n \\"street_name\\": \\"{{billing_contact.street_name}}\\",\\n \\"street_number\\": \\"{{billing_contact.street_number}}\\",\\n \\"city\\": \\"{{billing_contact.city}}\\",\\n \\"postal_code\\": \\"{{billing_contact.postal_code}}\\",\\n \\"country\\": \\"{{billing_contact.country}}\\",\\n}"},{"target":"addresses","mode":"append_if_exists","source":"delivery_contact","value_json":"{\\n \\"street_name\\": \\"{{delivery_contact.street_name}}\\",\\n \\"street_number\\": \\"{{delivery_contact.street_number}}\\",\\n \\"city\\": \\"{{delivery_contact.city}}\\",\\n \\"postal_code\\": \\"{{delivery_contact.postal_code}}\\",\\n \\"country\\": \\"{{delivery_contact.country}}\\",\\n}"}]}}}}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}}}},"responses":{"201":{"description":"The updated automation workflow","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"7791b04a-16d2-44a2-9af9-2d59c25c512f"},"workflow_name":{"type":"string","example":"Handle contact form"},"triggers":{"type":"array","items":{"type":"object","properties":{"on":{"type":"string","enum":["entity_create","entity_update","entity_delete","journey_submit","frontend_submit"]},"config":{"type":"object","additionalProperties":true,"example":{"entity_schema":"contact"}}},"required":["on","config"],"example":{"on":"journey_submit","config":{"journey_id":"53c5d0bb-4ee7-4ed6-b3e0-0262383fd4b9"}}}},"schemas":{"type":"array","description":"schemas this automation is available for","items":{"type":"string","example":"submission"}},"actions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"9ec3711b-db63-449c-b894-54d5bb622a8f"},"name":{"type":"string","example":"Create Contact"},"type":{"type":"string","example":"entity_mapping"},"config":{"type":"object","additionalProperties":true,"example":{"mapping_attributes":[{"target":"email","mode":"upsert_match","source":"billing_contact.email"},{"target":"first_name","mode":"copy_if_exists","source":"billing_contact.first_name"},{"target":"last_name","mode":"copy_if_exists","source":"billing_contact.last_name"},{"target":"addresses","mode":"append_if_exists","source":"billing_contact","value_json":"{\\n \\"street_name\\": \\"{{billing_contact.street_name}}\\",\\n \\"street_number\\": \\"{{billing_contact.street_number}}\\",\\n \\"city\\": \\"{{billing_contact.city}}\\",\\n \\"postal_code\\": \\"{{billing_contact.postal_code}}\\",\\n \\"country\\": \\"{{billing_contact.country}}\\",\\n}"},{"target":"addresses","mode":"append_if_exists","source":"delivery_contact","value_json":"{\\n \\"street_name\\": \\"{{delivery_contact.street_name}}\\",\\n \\"street_number\\": \\"{{delivery_contact.street_number}}\\",\\n \\"city\\": \\"{{delivery_contact.city}}\\",\\n \\"postal_code\\": \\"{{delivery_contact.postal_code}}\\",\\n \\"country\\": \\"{{delivery_contact.country}}\\",\\n}"}]}}}}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}}}}}},"delete":{"operationId":"deleteAutomation","summary":"deleteAutomation","description":"Update automation workflow by id","tags":["workflows"],"parameters":[{"name":"workflow_id","in":"path","required":true,"description":"Automation Workflow ID","schema":{"type":"string","example":"7791b04a-16d2-44a2-9af9-2d59c25c512f"}}],"responses":{"200":{"description":"The deleted automation workflow","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"7791b04a-16d2-44a2-9af9-2d59c25c512f"},"workflow_name":{"type":"string","example":"Handle contact form"},"triggers":{"type":"array","items":{"type":"object","properties":{"on":{"type":"string","enum":["entity_create","entity_update","entity_delete","journey_submit","frontend_submit"]},"config":{"type":"object","additionalProperties":true,"example":{"entity_schema":"contact"}}},"required":["on","config"],"example":{"on":"journey_submit","config":{"journey_id":"53c5d0bb-4ee7-4ed6-b3e0-0262383fd4b9"}}}},"schemas":{"type":"array","description":"schemas this automation is available for","items":{"type":"string","example":"submission"}},"actions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"9ec3711b-db63-449c-b894-54d5bb622a8f"},"name":{"type":"string","example":"Create Contact"},"type":{"type":"string","example":"entity_mapping"},"config":{"type":"object","additionalProperties":true,"example":{"mapping_attributes":[{"target":"email","mode":"upsert_match","source":"billing_contact.email"},{"target":"first_name","mode":"copy_if_exists","source":"billing_contact.first_name"},{"target":"last_name","mode":"copy_if_exists","source":"billing_contact.last_name"},{"target":"addresses","mode":"append_if_exists","source":"billing_contact","value_json":"{\\n \\"street_name\\": \\"{{billing_contact.street_name}}\\",\\n \\"street_number\\": \\"{{billing_contact.street_number}}\\",\\n \\"city\\": \\"{{billing_contact.city}}\\",\\n \\"postal_code\\": \\"{{billing_contact.postal_code}}\\",\\n \\"country\\": \\"{{billing_contact.country}}\\",\\n}"},{"target":"addresses","mode":"append_if_exists","source":"delivery_contact","value_json":"{\\n \\"street_name\\": \\"{{delivery_contact.street_name}}\\",\\n \\"street_number\\": \\"{{delivery_contact.street_number}}\\",\\n \\"city\\": \\"{{delivery_contact.city}}\\",\\n \\"postal_code\\": \\"{{delivery_contact.postal_code}}\\",\\n \\"country\\": \\"{{delivery_contact.country}}\\",\\n}"}]}}}}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}}}}}}},"/v1/automation/executions":{"get":{"operationId":"getExecutions","summary":"getExecutions","description":"List automation executions","parameters":[{"name":"entity_id","in":"query","schema":{"type":"string","example":"e3d3ebac-baab-4395-abf4-50b5bf1f8b74"}},{"name":"size","in":"query","description":"Pagination: max number of results to return","schema":{"type":"integer","default":25}},{"name":"from","in":"query","description":"Pagination: starting for results","schema":{"type":"integer","default":0}}],"tags":["executions"],"responses":{"200":{"description":"List of automation executions","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"9baf184f-bc81-4128-bca3-d974c90a12c4"},"status":{"type":"string","enum":["pending","in_progress","success","failed","cancelled"],"example":"success"},"entity_id":{"type":"string","example":"e3d3ebac-baab-4395-abf4-50b5bf1f8b74"},"workflow_id":{"type":"string","example":"7791b04a-16d2-44a2-9af9-2d59c25c512f"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"current_action":{"type":"string","example":"9ec3711b-db63-449c-b894-54d5bb622a8f"},"actions":{"type":"array","items":{"allOf":[{"type":"object","properties":{"status":{"type":"string","enum":["pending","in_progress","success","failed"]}}},{"type":"object","properties":{"id":{"type":"string","example":"9ec3711b-db63-449c-b894-54d5bb622a8f"},"name":{"type":"string","example":"Create Contact"},"type":{"type":"string","example":"entity_mapping"},"config":{"type":"object","additionalProperties":true,"example":{"mapping_attributes":[{"target":"email","mode":"upsert_match","source":"billing_contact.email"},{"target":"first_name","mode":"copy_if_exists","source":"billing_contact.first_name"},{"target":"last_name","mode":"copy_if_exists","source":"billing_contact.last_name"},{"target":"addresses","mode":"append_if_exists","source":"billing_contact","value_json":"{\\n \\"street_name\\": \\"{{billing_contact.street_name}}\\",\\n \\"street_number\\": \\"{{billing_contact.street_number}}\\",\\n \\"city\\": \\"{{billing_contact.city}}\\",\\n \\"postal_code\\": \\"{{billing_contact.postal_code}}\\",\\n \\"country\\": \\"{{billing_contact.country}}\\",\\n}"},{"target":"addresses","mode":"append_if_exists","source":"delivery_contact","value_json":"{\\n \\"street_name\\": \\"{{delivery_contact.street_name}}\\",\\n \\"street_number\\": \\"{{delivery_contact.street_number}}\\",\\n \\"city\\": \\"{{delivery_contact.city}}\\",\\n \\"postal_code\\": \\"{{delivery_contact.postal_code}}\\",\\n \\"country\\": \\"{{delivery_contact.country}}\\",\\n}"}]}}}}]}}}}}}}}}},"post":{"operationId":"startExecution","summary":"startExecution","description":"Start new automation execution","requestBody":{"description":"Execution parameters","content":{"application/json":{"schema":{"type":"object","properties":{"entity_id":{"type":"string","example":"e3d3ebac-baab-4395-abf4-50b5bf1f8b74"},"workflow_id":{"type":"string","example":"7791b04a-16d2-44a2-9af9-2d59c25c512f"}}}}}},"tags":["executions"],"responses":{"201":{"description":"The created execution","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"9baf184f-bc81-4128-bca3-d974c90a12c4"},"status":{"type":"string","enum":["pending","in_progress","success","failed","cancelled"],"example":"success"},"entity_id":{"type":"string","example":"e3d3ebac-baab-4395-abf4-50b5bf1f8b74"},"workflow_id":{"type":"string","example":"7791b04a-16d2-44a2-9af9-2d59c25c512f"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"current_action":{"type":"string","example":"9ec3711b-db63-449c-b894-54d5bb622a8f"},"actions":{"type":"array","items":{"allOf":[{"type":"object","properties":{"status":{"type":"string","enum":["pending","in_progress","success","failed"]}}},{"type":"object","properties":{"id":{"type":"string","example":"9ec3711b-db63-449c-b894-54d5bb622a8f"},"name":{"type":"string","example":"Create Contact"},"type":{"type":"string","example":"entity_mapping"},"config":{"type":"object","additionalProperties":true,"example":{"mapping_attributes":[{"target":"email","mode":"upsert_match","source":"billing_contact.email"},{"target":"first_name","mode":"copy_if_exists","source":"billing_contact.first_name"},{"target":"last_name","mode":"copy_if_exists","source":"billing_contact.last_name"},{"target":"addresses","mode":"append_if_exists","source":"billing_contact","value_json":"{\\n \\"street_name\\": \\"{{billing_contact.street_name}}\\",\\n \\"street_number\\": \\"{{billing_contact.street_number}}\\",\\n \\"city\\": \\"{{billing_contact.city}}\\",\\n \\"postal_code\\": \\"{{billing_contact.postal_code}}\\",\\n \\"country\\": \\"{{billing_contact.country}}\\",\\n}"},{"target":"addresses","mode":"append_if_exists","source":"delivery_contact","value_json":"{\\n \\"street_name\\": \\"{{delivery_contact.street_name}}\\",\\n \\"street_number\\": \\"{{delivery_contact.street_number}}\\",\\n \\"city\\": \\"{{delivery_contact.city}}\\",\\n \\"postal_code\\": \\"{{delivery_contact.postal_code}}\\",\\n \\"country\\": \\"{{delivery_contact.country}}\\",\\n}"}]}}}}]}}}}}}}}}},"/v1/automation/executions/{execution_id}":{"get":{"operationId":"getExecution","summary":"getExecution","description":"Get automation execution","parameters":[{"name":"execution_id","in":"path","schema":{"type":"string","example":"9baf184f-bc81-4128-bca3-d974c90a12c4"},"required":true}],"tags":["executions"],"responses":{"200":{"description":"The returned execution","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"9baf184f-bc81-4128-bca3-d974c90a12c4"},"status":{"type":"string","enum":["pending","in_progress","success","failed","cancelled"],"example":"success"},"entity_id":{"type":"string","example":"e3d3ebac-baab-4395-abf4-50b5bf1f8b74"},"workflow_id":{"type":"string","example":"7791b04a-16d2-44a2-9af9-2d59c25c512f"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"current_action":{"type":"string","example":"9ec3711b-db63-449c-b894-54d5bb622a8f"},"actions":{"type":"array","items":{"allOf":[{"type":"object","properties":{"status":{"type":"string","enum":["pending","in_progress","success","failed"]}}},{"type":"object","properties":{"id":{"type":"string","example":"9ec3711b-db63-449c-b894-54d5bb622a8f"},"name":{"type":"string","example":"Create Contact"},"type":{"type":"string","example":"entity_mapping"},"config":{"type":"object","additionalProperties":true,"example":{"mapping_attributes":[{"target":"email","mode":"upsert_match","source":"billing_contact.email"},{"target":"first_name","mode":"copy_if_exists","source":"billing_contact.first_name"},{"target":"last_name","mode":"copy_if_exists","source":"billing_contact.last_name"},{"target":"addresses","mode":"append_if_exists","source":"billing_contact","value_json":"{\\n \\"street_name\\": \\"{{billing_contact.street_name}}\\",\\n \\"street_number\\": \\"{{billing_contact.street_number}}\\",\\n \\"city\\": \\"{{billing_contact.city}}\\",\\n \\"postal_code\\": \\"{{billing_contact.postal_code}}\\",\\n \\"country\\": \\"{{billing_contact.country}}\\",\\n}"},{"target":"addresses","mode":"append_if_exists","source":"delivery_contact","value_json":"{\\n \\"street_name\\": \\"{{delivery_contact.street_name}}\\",\\n \\"street_number\\": \\"{{delivery_contact.street_number}}\\",\\n \\"city\\": \\"{{delivery_contact.city}}\\",\\n \\"postal_code\\": \\"{{delivery_contact.postal_code}}\\",\\n \\"country\\": \\"{{delivery_contact.country}}\\",\\n}"}]}}}}]}}}}}}}}},"delete":{"operationId":"cancelExecution","summary":"cancelExecution","description":"Cancel automation execution","parameters":[{"name":"execution_id","in":"path","schema":{"type":"string","example":"9baf184f-bc81-4128-bca3-d974c90a12c4"},"required":true}],"tags":["executions"],"responses":{"200":{"description":"The cancelled execution","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"9baf184f-bc81-4128-bca3-d974c90a12c4"},"status":{"type":"string","enum":["pending","in_progress","success","failed","cancelled"],"example":"success"},"entity_id":{"type":"string","example":"e3d3ebac-baab-4395-abf4-50b5bf1f8b74"},"workflow_id":{"type":"string","example":"7791b04a-16d2-44a2-9af9-2d59c25c512f"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"current_action":{"type":"string","example":"9ec3711b-db63-449c-b894-54d5bb622a8f"},"actions":{"type":"array","items":{"allOf":[{"type":"object","properties":{"status":{"type":"string","enum":["pending","in_progress","success","failed"]}}},{"type":"object","properties":{"id":{"type":"string","example":"9ec3711b-db63-449c-b894-54d5bb622a8f"},"name":{"type":"string","example":"Create Contact"},"type":{"type":"string","example":"entity_mapping"},"config":{"type":"object","additionalProperties":true,"example":{"mapping_attributes":[{"target":"email","mode":"upsert_match","source":"billing_contact.email"},{"target":"first_name","mode":"copy_if_exists","source":"billing_contact.first_name"},{"target":"last_name","mode":"copy_if_exists","source":"billing_contact.last_name"},{"target":"addresses","mode":"append_if_exists","source":"billing_contact","value_json":"{\\n \\"street_name\\": \\"{{billing_contact.street_name}}\\",\\n \\"street_number\\": \\"{{billing_contact.street_number}}\\",\\n \\"city\\": \\"{{billing_contact.city}}\\",\\n \\"postal_code\\": \\"{{billing_contact.postal_code}}\\",\\n \\"country\\": \\"{{billing_contact.country}}\\",\\n}"},{"target":"addresses","mode":"append_if_exists","source":"delivery_contact","value_json":"{\\n \\"street_name\\": \\"{{delivery_contact.street_name}}\\",\\n \\"street_number\\": \\"{{delivery_contact.street_number}}\\",\\n \\"city\\": \\"{{delivery_contact.city}}\\",\\n \\"postal_code\\": \\"{{delivery_contact.postal_code}}\\",\\n \\"country\\": \\"{{delivery_contact.country}}\\",\\n}"}]}}}}]}}}}}}}}}}},"components":{"securitySchemes":{"EpilotAuth":{"type":"http","scheme":"bearer","description":"Epilot Bearer Token"},"AsOrganization":{"type":"apiKey","in":"header","name":"x-ivy-org-id","description":"Set organization id when using internal auth"}},"schemas":{"AutomationWorkflowId":{"type":"string","example":"7791b04a-16d2-44a2-9af9-2d59c25c512f"},"AutomationActionId":{"type":"string","example":"9ec3711b-db63-449c-b894-54d5bb622a8f"},"AutomationWorkflow":{"type":"object","properties":{"id":{"type":"string","example":"7791b04a-16d2-44a2-9af9-2d59c25c512f"},"workflow_name":{"type":"string","example":"Handle contact form"},"triggers":{"type":"array","items":{"type":"object","properties":{"on":{"type":"string","enum":["entity_create","entity_update","entity_delete","journey_submit","frontend_submit"]},"config":{"type":"object","additionalProperties":true,"example":{"entity_schema":"contact"}}},"required":["on","config"],"example":{"on":"journey_submit","config":{"journey_id":"53c5d0bb-4ee7-4ed6-b3e0-0262383fd4b9"}}}},"schemas":{"type":"array","description":"schemas this automation is available for","items":{"type":"string","example":"submission"}},"actions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"9ec3711b-db63-449c-b894-54d5bb622a8f"},"name":{"type":"string","example":"Create Contact"},"type":{"type":"string","example":"entity_mapping"},"config":{"type":"object","additionalProperties":true,"example":{"mapping_attributes":[{"target":"email","mode":"upsert_match","source":"billing_contact.email"},{"target":"first_name","mode":"copy_if_exists","source":"billing_contact.first_name"},{"target":"last_name","mode":"copy_if_exists","source":"billing_contact.last_name"},{"target":"addresses","mode":"append_if_exists","source":"billing_contact","value_json":"{\\n \\"street_name\\": \\"{{billing_contact.street_name}}\\",\\n \\"street_number\\": \\"{{billing_contact.street_number}}\\",\\n \\"city\\": \\"{{billing_contact.city}}\\",\\n \\"postal_code\\": \\"{{billing_contact.postal_code}}\\",\\n \\"country\\": \\"{{billing_contact.country}}\\",\\n}"},{"target":"addresses","mode":"append_if_exists","source":"delivery_contact","value_json":"{\\n \\"street_name\\": \\"{{delivery_contact.street_name}}\\",\\n \\"street_number\\": \\"{{delivery_contact.street_number}}\\",\\n \\"city\\": \\"{{delivery_contact.city}}\\",\\n \\"postal_code\\": \\"{{delivery_contact.postal_code}}\\",\\n \\"country\\": \\"{{delivery_contact.country}}\\",\\n}"}]}}}}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"AutomationAction":{"type":"object","properties":{"id":{"type":"string","example":"9ec3711b-db63-449c-b894-54d5bb622a8f"},"name":{"type":"string","example":"Create Contact"},"type":{"type":"string","example":"entity_mapping"},"config":{"type":"object","additionalProperties":true,"example":{"mapping_attributes":[{"target":"email","mode":"upsert_match","source":"billing_contact.email"},{"target":"first_name","mode":"copy_if_exists","source":"billing_contact.first_name"},{"target":"last_name","mode":"copy_if_exists","source":"billing_contact.last_name"},{"target":"addresses","mode":"append_if_exists","source":"billing_contact","value_json":"{\\n \\"street_name\\": \\"{{billing_contact.street_name}}\\",\\n \\"street_number\\": \\"{{billing_contact.street_number}}\\",\\n \\"city\\": \\"{{billing_contact.city}}\\",\\n \\"postal_code\\": \\"{{billing_contact.postal_code}}\\",\\n \\"country\\": \\"{{billing_contact.country}}\\",\\n}"},{"target":"addresses","mode":"append_if_exists","source":"delivery_contact","value_json":"{\\n \\"street_name\\": \\"{{delivery_contact.street_name}}\\",\\n \\"street_number\\": \\"{{delivery_contact.street_number}}\\",\\n \\"city\\": \\"{{delivery_contact.city}}\\",\\n \\"postal_code\\": \\"{{delivery_contact.postal_code}}\\",\\n \\"country\\": \\"{{delivery_contact.country}}\\",\\n}"}]}}}},"AutomationExecutionId":{"type":"string","example":"9baf184f-bc81-4128-bca3-d974c90a12c4"},"AutomationExecution":{"type":"object","properties":{"id":{"type":"string","example":"9baf184f-bc81-4128-bca3-d974c90a12c4"},"status":{"type":"string","enum":["pending","in_progress","success","failed","cancelled"],"example":"success"},"entity_id":{"type":"string","example":"e3d3ebac-baab-4395-abf4-50b5bf1f8b74"},"workflow_id":{"type":"string","example":"7791b04a-16d2-44a2-9af9-2d59c25c512f"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"current_action":{"type":"string","example":"9ec3711b-db63-449c-b894-54d5bb622a8f"},"actions":{"type":"array","items":{"allOf":[{"type":"object","properties":{"status":{"type":"string","enum":["pending","in_progress","success","failed"]}}},{"type":"object","properties":{"id":{"type":"string","example":"9ec3711b-db63-449c-b894-54d5bb622a8f"},"name":{"type":"string","example":"Create Contact"},"type":{"type":"string","example":"entity_mapping"},"config":{"type":"object","additionalProperties":true,"example":{"mapping_attributes":[{"target":"email","mode":"upsert_match","source":"billing_contact.email"},{"target":"first_name","mode":"copy_if_exists","source":"billing_contact.first_name"},{"target":"last_name","mode":"copy_if_exists","source":"billing_contact.last_name"},{"target":"addresses","mode":"append_if_exists","source":"billing_contact","value_json":"{\\n \\"street_name\\": \\"{{billing_contact.street_name}}\\",\\n \\"street_number\\": \\"{{billing_contact.street_number}}\\",\\n \\"city\\": \\"{{billing_contact.city}}\\",\\n \\"postal_code\\": \\"{{billing_contact.postal_code}}\\",\\n \\"country\\": \\"{{billing_contact.country}}\\",\\n}"},{"target":"addresses","mode":"append_if_exists","source":"delivery_contact","value_json":"{\\n \\"street_name\\": \\"{{delivery_contact.street_name}}\\",\\n \\"street_number\\": \\"{{delivery_contact.street_number}}\\",\\n \\"city\\": \\"{{delivery_contact.city}}\\",\\n \\"postal_code\\": \\"{{delivery_contact.postal_code}}\\",\\n \\"country\\": \\"{{delivery_contact.country}}\\",\\n}"}]}}}}]}}}},"EntityId":{"type":"string","example":"e3d3ebac-baab-4395-abf4-50b5bf1f8b74"}}}}')}},t={};return function a(n){if(t[n])return t[n].exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,a),i.exports}(914)})());
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./client"), exports);
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,484 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import {
|
|
3
|
+
OpenAPIClient,
|
|
4
|
+
Parameters,
|
|
5
|
+
UnknownParamsObject,
|
|
6
|
+
OperationResponse,
|
|
7
|
+
AxiosRequestConfig,
|
|
8
|
+
} from 'openapi-client-axios';
|
|
9
|
+
|
|
10
|
+
declare namespace Components {
|
|
11
|
+
namespace Schemas {
|
|
12
|
+
export interface AutomationAction {
|
|
13
|
+
id?: AutomationActionId;
|
|
14
|
+
/**
|
|
15
|
+
* example:
|
|
16
|
+
* Create Contact
|
|
17
|
+
*/
|
|
18
|
+
name?: string;
|
|
19
|
+
/**
|
|
20
|
+
* example:
|
|
21
|
+
* entity_mapping
|
|
22
|
+
*/
|
|
23
|
+
type?: string;
|
|
24
|
+
/**
|
|
25
|
+
* example:
|
|
26
|
+
* {
|
|
27
|
+
* "mapping_attributes": [
|
|
28
|
+
* {
|
|
29
|
+
* "target": "email",
|
|
30
|
+
* "mode": "upsert_match",
|
|
31
|
+
* "source": "billing_contact.email"
|
|
32
|
+
* },
|
|
33
|
+
* {
|
|
34
|
+
* "target": "first_name",
|
|
35
|
+
* "mode": "copy_if_exists",
|
|
36
|
+
* "source": "billing_contact.first_name"
|
|
37
|
+
* },
|
|
38
|
+
* {
|
|
39
|
+
* "target": "last_name",
|
|
40
|
+
* "mode": "copy_if_exists",
|
|
41
|
+
* "source": "billing_contact.last_name"
|
|
42
|
+
* },
|
|
43
|
+
* {
|
|
44
|
+
* "target": "addresses",
|
|
45
|
+
* "mode": "append_if_exists",
|
|
46
|
+
* "source": "billing_contact",
|
|
47
|
+
* "value_json": "{\n \"street_name\": \"{{billing_contact.street_name}}\",\n \"street_number\": \"{{billing_contact.street_number}}\",\n \"city\": \"{{billing_contact.city}}\",\n \"postal_code\": \"{{billing_contact.postal_code}}\",\n \"country\": \"{{billing_contact.country}}\",\n}"
|
|
48
|
+
* },
|
|
49
|
+
* {
|
|
50
|
+
* "target": "addresses",
|
|
51
|
+
* "mode": "append_if_exists",
|
|
52
|
+
* "source": "delivery_contact",
|
|
53
|
+
* "value_json": "{\n \"street_name\": \"{{delivery_contact.street_name}}\",\n \"street_number\": \"{{delivery_contact.street_number}}\",\n \"city\": \"{{delivery_contact.city}}\",\n \"postal_code\": \"{{delivery_contact.postal_code}}\",\n \"country\": \"{{delivery_contact.country}}\",\n}"
|
|
54
|
+
* }
|
|
55
|
+
* ]
|
|
56
|
+
* }
|
|
57
|
+
*/
|
|
58
|
+
config?: {
|
|
59
|
+
[name: string]: any;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* example:
|
|
64
|
+
* 9ec3711b-db63-449c-b894-54d5bb622a8f
|
|
65
|
+
*/
|
|
66
|
+
export type AutomationActionId = string;
|
|
67
|
+
export interface AutomationExecution {
|
|
68
|
+
id?: AutomationExecutionId;
|
|
69
|
+
/**
|
|
70
|
+
* example:
|
|
71
|
+
* success
|
|
72
|
+
*/
|
|
73
|
+
status?: "pending" | "in_progress" | "success" | "failed" | "cancelled";
|
|
74
|
+
entity_id?: EntityId;
|
|
75
|
+
workflow_id?: AutomationWorkflowId;
|
|
76
|
+
created_at?: string; // date-time
|
|
77
|
+
updated_at?: string; // date-time
|
|
78
|
+
current_action?: AutomationActionId;
|
|
79
|
+
actions?: {
|
|
80
|
+
status?: "pending" | "in_progress" | "success" | "failed";
|
|
81
|
+
id?: AutomationActionId;
|
|
82
|
+
/**
|
|
83
|
+
* example:
|
|
84
|
+
* Create Contact
|
|
85
|
+
*/
|
|
86
|
+
name?: string;
|
|
87
|
+
/**
|
|
88
|
+
* example:
|
|
89
|
+
* entity_mapping
|
|
90
|
+
*/
|
|
91
|
+
type?: string;
|
|
92
|
+
/**
|
|
93
|
+
* example:
|
|
94
|
+
* {
|
|
95
|
+
* "mapping_attributes": [
|
|
96
|
+
* {
|
|
97
|
+
* "target": "email",
|
|
98
|
+
* "mode": "upsert_match",
|
|
99
|
+
* "source": "billing_contact.email"
|
|
100
|
+
* },
|
|
101
|
+
* {
|
|
102
|
+
* "target": "first_name",
|
|
103
|
+
* "mode": "copy_if_exists",
|
|
104
|
+
* "source": "billing_contact.first_name"
|
|
105
|
+
* },
|
|
106
|
+
* {
|
|
107
|
+
* "target": "last_name",
|
|
108
|
+
* "mode": "copy_if_exists",
|
|
109
|
+
* "source": "billing_contact.last_name"
|
|
110
|
+
* },
|
|
111
|
+
* {
|
|
112
|
+
* "target": "addresses",
|
|
113
|
+
* "mode": "append_if_exists",
|
|
114
|
+
* "source": "billing_contact",
|
|
115
|
+
* "value_json": "{\n \"street_name\": \"{{billing_contact.street_name}}\",\n \"street_number\": \"{{billing_contact.street_number}}\",\n \"city\": \"{{billing_contact.city}}\",\n \"postal_code\": \"{{billing_contact.postal_code}}\",\n \"country\": \"{{billing_contact.country}}\",\n}"
|
|
116
|
+
* },
|
|
117
|
+
* {
|
|
118
|
+
* "target": "addresses",
|
|
119
|
+
* "mode": "append_if_exists",
|
|
120
|
+
* "source": "delivery_contact",
|
|
121
|
+
* "value_json": "{\n \"street_name\": \"{{delivery_contact.street_name}}\",\n \"street_number\": \"{{delivery_contact.street_number}}\",\n \"city\": \"{{delivery_contact.city}}\",\n \"postal_code\": \"{{delivery_contact.postal_code}}\",\n \"country\": \"{{delivery_contact.country}}\",\n}"
|
|
122
|
+
* }
|
|
123
|
+
* ]
|
|
124
|
+
* }
|
|
125
|
+
*/
|
|
126
|
+
config?: {
|
|
127
|
+
[name: string]: any;
|
|
128
|
+
};
|
|
129
|
+
}[];
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* example:
|
|
133
|
+
* 9baf184f-bc81-4128-bca3-d974c90a12c4
|
|
134
|
+
*/
|
|
135
|
+
export type AutomationExecutionId = string;
|
|
136
|
+
export interface AutomationWorkflow {
|
|
137
|
+
id?: AutomationWorkflowId;
|
|
138
|
+
/**
|
|
139
|
+
* example:
|
|
140
|
+
* Handle contact form
|
|
141
|
+
*/
|
|
142
|
+
workflow_name?: string;
|
|
143
|
+
triggers?: {
|
|
144
|
+
on: "entity_create" | "entity_update" | "entity_delete" | "journey_submit" | "frontend_submit";
|
|
145
|
+
/**
|
|
146
|
+
* example:
|
|
147
|
+
* {
|
|
148
|
+
* "entity_schema": "contact"
|
|
149
|
+
* }
|
|
150
|
+
*/
|
|
151
|
+
config: {
|
|
152
|
+
[name: string]: any;
|
|
153
|
+
};
|
|
154
|
+
}[];
|
|
155
|
+
/**
|
|
156
|
+
* schemas this automation is available for
|
|
157
|
+
*/
|
|
158
|
+
schemas?: string[];
|
|
159
|
+
actions?: AutomationAction[];
|
|
160
|
+
created_at?: string; // date-time
|
|
161
|
+
updated_at?: string; // date-time
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* example:
|
|
165
|
+
* 7791b04a-16d2-44a2-9af9-2d59c25c512f
|
|
166
|
+
*/
|
|
167
|
+
export type AutomationWorkflowId = string;
|
|
168
|
+
/**
|
|
169
|
+
* example:
|
|
170
|
+
* e3d3ebac-baab-4395-abf4-50b5bf1f8b74
|
|
171
|
+
*/
|
|
172
|
+
export type EntityId = string;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
declare namespace Paths {
|
|
176
|
+
namespace CancelExecution {
|
|
177
|
+
namespace Parameters {
|
|
178
|
+
export type ExecutionId = Components.Schemas.AutomationExecutionId;
|
|
179
|
+
}
|
|
180
|
+
export interface PathParameters {
|
|
181
|
+
execution_id: Parameters.ExecutionId;
|
|
182
|
+
}
|
|
183
|
+
namespace Responses {
|
|
184
|
+
export type $200 = Components.Schemas.AutomationExecution;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
namespace CreateAutomation {
|
|
188
|
+
export type RequestBody = Components.Schemas.AutomationWorkflow;
|
|
189
|
+
namespace Responses {
|
|
190
|
+
export type $201 = Components.Schemas.AutomationWorkflow;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
namespace DeleteAutomation {
|
|
194
|
+
namespace Parameters {
|
|
195
|
+
export type WorkflowId = Components.Schemas.AutomationWorkflowId;
|
|
196
|
+
}
|
|
197
|
+
export interface PathParameters {
|
|
198
|
+
workflow_id: Parameters.WorkflowId;
|
|
199
|
+
}
|
|
200
|
+
namespace Responses {
|
|
201
|
+
export type $200 = Components.Schemas.AutomationWorkflow;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
namespace GetAutomation {
|
|
205
|
+
namespace Parameters {
|
|
206
|
+
export type WorkflowId = Components.Schemas.AutomationWorkflowId;
|
|
207
|
+
}
|
|
208
|
+
export interface PathParameters {
|
|
209
|
+
workflow_id: Parameters.WorkflowId;
|
|
210
|
+
}
|
|
211
|
+
namespace Responses {
|
|
212
|
+
export type $200 = Components.Schemas.AutomationWorkflow;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
namespace GetExecution {
|
|
216
|
+
namespace Parameters {
|
|
217
|
+
export type ExecutionId = Components.Schemas.AutomationExecutionId;
|
|
218
|
+
}
|
|
219
|
+
export interface PathParameters {
|
|
220
|
+
execution_id: Parameters.ExecutionId;
|
|
221
|
+
}
|
|
222
|
+
namespace Responses {
|
|
223
|
+
export type $200 = Components.Schemas.AutomationExecution;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
namespace GetExecutions {
|
|
227
|
+
namespace Parameters {
|
|
228
|
+
export type EntityId = Components.Schemas.EntityId;
|
|
229
|
+
export type From = number;
|
|
230
|
+
export type Size = number;
|
|
231
|
+
}
|
|
232
|
+
export interface QueryParameters {
|
|
233
|
+
entity_id?: Parameters.EntityId;
|
|
234
|
+
size?: Parameters.Size;
|
|
235
|
+
from?: Parameters.From;
|
|
236
|
+
}
|
|
237
|
+
namespace Responses {
|
|
238
|
+
export type $200 = Components.Schemas.AutomationExecution[];
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
namespace PutAutomation {
|
|
242
|
+
namespace Parameters {
|
|
243
|
+
export type WorkflowId = Components.Schemas.AutomationWorkflowId;
|
|
244
|
+
}
|
|
245
|
+
export interface PathParameters {
|
|
246
|
+
workflow_id: Parameters.WorkflowId;
|
|
247
|
+
}
|
|
248
|
+
export type RequestBody = Components.Schemas.AutomationWorkflow;
|
|
249
|
+
namespace Responses {
|
|
250
|
+
export type $201 = Components.Schemas.AutomationWorkflow;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
namespace SearchAutomations {
|
|
254
|
+
namespace Parameters {
|
|
255
|
+
export type From = number;
|
|
256
|
+
/**
|
|
257
|
+
* example:
|
|
258
|
+
* submission
|
|
259
|
+
*/
|
|
260
|
+
export type Schema = string;
|
|
261
|
+
export type Size = number;
|
|
262
|
+
}
|
|
263
|
+
export interface QueryParameters {
|
|
264
|
+
schema?: Parameters.Schema;
|
|
265
|
+
size?: Parameters.Size;
|
|
266
|
+
from?: Parameters.From;
|
|
267
|
+
}
|
|
268
|
+
namespace Responses {
|
|
269
|
+
export interface $200 {
|
|
270
|
+
/**
|
|
271
|
+
* example:
|
|
272
|
+
* 1
|
|
273
|
+
*/
|
|
274
|
+
total?: number;
|
|
275
|
+
results?: Components.Schemas.AutomationWorkflow[];
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
namespace StartExecution {
|
|
280
|
+
export interface RequestBody {
|
|
281
|
+
entity_id?: Components.Schemas.EntityId;
|
|
282
|
+
workflow_id?: Components.Schemas.AutomationWorkflowId;
|
|
283
|
+
}
|
|
284
|
+
namespace Responses {
|
|
285
|
+
export type $201 = Components.Schemas.AutomationExecution;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
export interface OperationMethods {
|
|
291
|
+
/**
|
|
292
|
+
* searchAutomations - searchAutomations
|
|
293
|
+
*
|
|
294
|
+
* Search available automation workflows
|
|
295
|
+
*/
|
|
296
|
+
'searchAutomations'(
|
|
297
|
+
parameters?: Parameters<Paths.SearchAutomations.QueryParameters> | null,
|
|
298
|
+
data?: any,
|
|
299
|
+
config?: AxiosRequestConfig
|
|
300
|
+
): OperationResponse<Paths.SearchAutomations.Responses.$200>
|
|
301
|
+
/**
|
|
302
|
+
* createAutomation - createAutomation
|
|
303
|
+
*
|
|
304
|
+
* Create new automation workflow
|
|
305
|
+
*/
|
|
306
|
+
'createAutomation'(
|
|
307
|
+
parameters?: Parameters<UnknownParamsObject> | null,
|
|
308
|
+
data?: Paths.CreateAutomation.RequestBody,
|
|
309
|
+
config?: AxiosRequestConfig
|
|
310
|
+
): OperationResponse<Paths.CreateAutomation.Responses.$201>
|
|
311
|
+
/**
|
|
312
|
+
* getAutomation - getAutomation
|
|
313
|
+
*
|
|
314
|
+
* List available automation workflows
|
|
315
|
+
*/
|
|
316
|
+
'getAutomation'(
|
|
317
|
+
parameters?: Parameters<Paths.GetAutomation.PathParameters> | null,
|
|
318
|
+
data?: any,
|
|
319
|
+
config?: AxiosRequestConfig
|
|
320
|
+
): OperationResponse<Paths.GetAutomation.Responses.$200>
|
|
321
|
+
/**
|
|
322
|
+
* putAutomation - putAutomation
|
|
323
|
+
*
|
|
324
|
+
* Update automation workflow by id
|
|
325
|
+
*/
|
|
326
|
+
'putAutomation'(
|
|
327
|
+
parameters?: Parameters<Paths.PutAutomation.PathParameters> | null,
|
|
328
|
+
data?: Paths.PutAutomation.RequestBody,
|
|
329
|
+
config?: AxiosRequestConfig
|
|
330
|
+
): OperationResponse<Paths.PutAutomation.Responses.$201>
|
|
331
|
+
/**
|
|
332
|
+
* deleteAutomation - deleteAutomation
|
|
333
|
+
*
|
|
334
|
+
* Update automation workflow by id
|
|
335
|
+
*/
|
|
336
|
+
'deleteAutomation'(
|
|
337
|
+
parameters?: Parameters<Paths.DeleteAutomation.PathParameters> | null,
|
|
338
|
+
data?: any,
|
|
339
|
+
config?: AxiosRequestConfig
|
|
340
|
+
): OperationResponse<Paths.DeleteAutomation.Responses.$200>
|
|
341
|
+
/**
|
|
342
|
+
* getExecutions - getExecutions
|
|
343
|
+
*
|
|
344
|
+
* List automation executions
|
|
345
|
+
*/
|
|
346
|
+
'getExecutions'(
|
|
347
|
+
parameters?: Parameters<Paths.GetExecutions.QueryParameters> | null,
|
|
348
|
+
data?: any,
|
|
349
|
+
config?: AxiosRequestConfig
|
|
350
|
+
): OperationResponse<Paths.GetExecutions.Responses.$200>
|
|
351
|
+
/**
|
|
352
|
+
* startExecution - startExecution
|
|
353
|
+
*
|
|
354
|
+
* Start new automation execution
|
|
355
|
+
*/
|
|
356
|
+
'startExecution'(
|
|
357
|
+
parameters?: Parameters<UnknownParamsObject> | null,
|
|
358
|
+
data?: Paths.StartExecution.RequestBody,
|
|
359
|
+
config?: AxiosRequestConfig
|
|
360
|
+
): OperationResponse<Paths.StartExecution.Responses.$201>
|
|
361
|
+
/**
|
|
362
|
+
* getExecution - getExecution
|
|
363
|
+
*
|
|
364
|
+
* Get automation execution
|
|
365
|
+
*/
|
|
366
|
+
'getExecution'(
|
|
367
|
+
parameters?: Parameters<Paths.GetExecution.PathParameters> | null,
|
|
368
|
+
data?: any,
|
|
369
|
+
config?: AxiosRequestConfig
|
|
370
|
+
): OperationResponse<Paths.GetExecution.Responses.$200>
|
|
371
|
+
/**
|
|
372
|
+
* cancelExecution - cancelExecution
|
|
373
|
+
*
|
|
374
|
+
* Cancel automation execution
|
|
375
|
+
*/
|
|
376
|
+
'cancelExecution'(
|
|
377
|
+
parameters?: Parameters<Paths.CancelExecution.PathParameters> | null,
|
|
378
|
+
data?: any,
|
|
379
|
+
config?: AxiosRequestConfig
|
|
380
|
+
): OperationResponse<Paths.CancelExecution.Responses.$200>
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
export interface PathsDictionary {
|
|
384
|
+
['/v1/automation/workflows']: {
|
|
385
|
+
/**
|
|
386
|
+
* searchAutomations - searchAutomations
|
|
387
|
+
*
|
|
388
|
+
* Search available automation workflows
|
|
389
|
+
*/
|
|
390
|
+
'get'(
|
|
391
|
+
parameters?: Parameters<Paths.SearchAutomations.QueryParameters> | null,
|
|
392
|
+
data?: any,
|
|
393
|
+
config?: AxiosRequestConfig
|
|
394
|
+
): OperationResponse<Paths.SearchAutomations.Responses.$200>
|
|
395
|
+
/**
|
|
396
|
+
* createAutomation - createAutomation
|
|
397
|
+
*
|
|
398
|
+
* Create new automation workflow
|
|
399
|
+
*/
|
|
400
|
+
'post'(
|
|
401
|
+
parameters?: Parameters<UnknownParamsObject> | null,
|
|
402
|
+
data?: Paths.CreateAutomation.RequestBody,
|
|
403
|
+
config?: AxiosRequestConfig
|
|
404
|
+
): OperationResponse<Paths.CreateAutomation.Responses.$201>
|
|
405
|
+
}
|
|
406
|
+
['/v1/automation/workflows/{workflow_id}']: {
|
|
407
|
+
/**
|
|
408
|
+
* getAutomation - getAutomation
|
|
409
|
+
*
|
|
410
|
+
* List available automation workflows
|
|
411
|
+
*/
|
|
412
|
+
'get'(
|
|
413
|
+
parameters?: Parameters<Paths.GetAutomation.PathParameters> | null,
|
|
414
|
+
data?: any,
|
|
415
|
+
config?: AxiosRequestConfig
|
|
416
|
+
): OperationResponse<Paths.GetAutomation.Responses.$200>
|
|
417
|
+
/**
|
|
418
|
+
* putAutomation - putAutomation
|
|
419
|
+
*
|
|
420
|
+
* Update automation workflow by id
|
|
421
|
+
*/
|
|
422
|
+
'put'(
|
|
423
|
+
parameters?: Parameters<Paths.PutAutomation.PathParameters> | null,
|
|
424
|
+
data?: Paths.PutAutomation.RequestBody,
|
|
425
|
+
config?: AxiosRequestConfig
|
|
426
|
+
): OperationResponse<Paths.PutAutomation.Responses.$201>
|
|
427
|
+
/**
|
|
428
|
+
* deleteAutomation - deleteAutomation
|
|
429
|
+
*
|
|
430
|
+
* Update automation workflow by id
|
|
431
|
+
*/
|
|
432
|
+
'delete'(
|
|
433
|
+
parameters?: Parameters<Paths.DeleteAutomation.PathParameters> | null,
|
|
434
|
+
data?: any,
|
|
435
|
+
config?: AxiosRequestConfig
|
|
436
|
+
): OperationResponse<Paths.DeleteAutomation.Responses.$200>
|
|
437
|
+
}
|
|
438
|
+
['/v1/automation/executions']: {
|
|
439
|
+
/**
|
|
440
|
+
* getExecutions - getExecutions
|
|
441
|
+
*
|
|
442
|
+
* List automation executions
|
|
443
|
+
*/
|
|
444
|
+
'get'(
|
|
445
|
+
parameters?: Parameters<Paths.GetExecutions.QueryParameters> | null,
|
|
446
|
+
data?: any,
|
|
447
|
+
config?: AxiosRequestConfig
|
|
448
|
+
): OperationResponse<Paths.GetExecutions.Responses.$200>
|
|
449
|
+
/**
|
|
450
|
+
* startExecution - startExecution
|
|
451
|
+
*
|
|
452
|
+
* Start new automation execution
|
|
453
|
+
*/
|
|
454
|
+
'post'(
|
|
455
|
+
parameters?: Parameters<UnknownParamsObject> | null,
|
|
456
|
+
data?: Paths.StartExecution.RequestBody,
|
|
457
|
+
config?: AxiosRequestConfig
|
|
458
|
+
): OperationResponse<Paths.StartExecution.Responses.$201>
|
|
459
|
+
}
|
|
460
|
+
['/v1/automation/executions/{execution_id}']: {
|
|
461
|
+
/**
|
|
462
|
+
* getExecution - getExecution
|
|
463
|
+
*
|
|
464
|
+
* Get automation execution
|
|
465
|
+
*/
|
|
466
|
+
'get'(
|
|
467
|
+
parameters?: Parameters<Paths.GetExecution.PathParameters> | null,
|
|
468
|
+
data?: any,
|
|
469
|
+
config?: AxiosRequestConfig
|
|
470
|
+
): OperationResponse<Paths.GetExecution.Responses.$200>
|
|
471
|
+
/**
|
|
472
|
+
* cancelExecution - cancelExecution
|
|
473
|
+
*
|
|
474
|
+
* Cancel automation execution
|
|
475
|
+
*/
|
|
476
|
+
'delete'(
|
|
477
|
+
parameters?: Parameters<Paths.CancelExecution.PathParameters> | null,
|
|
478
|
+
data?: any,
|
|
479
|
+
config?: AxiosRequestConfig
|
|
480
|
+
): OperationResponse<Paths.CancelExecution.Responses.$200>
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
export type Client = OpenAPIClient<OperationMethods, PathsDictionary>
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@epilot/automation-client",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "API Client for epilot automation API",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "jest",
|
|
9
|
+
"typescript": "tsc",
|
|
10
|
+
"bundle-definition": "webpack",
|
|
11
|
+
"openapi": "openapi read --json --dereference --bundle ../lambda/ApiHandlerFunction/openapi.yml > src/openapi.json",
|
|
12
|
+
"typegen": "echo '/* eslint-disable */' > src/openapi.d.ts && typegen ../lambda/ApiHandlerFunction/openapi.yml >> src/openapi.d.ts",
|
|
13
|
+
"build": "npm run openapi && npm run typegen && npm run typescript && npm run bundle-definition",
|
|
14
|
+
"eslint": "../node_modules/.bin/eslint -c ../.eslintrc.yml",
|
|
15
|
+
"prepublishOnly": "npm run build"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"*.js",
|
|
19
|
+
"*.d.ts",
|
|
20
|
+
"**/*.js",
|
|
21
|
+
"**/*.d.ts",
|
|
22
|
+
"!*.test.*",
|
|
23
|
+
"!**/*.test.*",
|
|
24
|
+
"!node_modules",
|
|
25
|
+
"!src",
|
|
26
|
+
"!*.config.js"
|
|
27
|
+
],
|
|
28
|
+
"keywords": [],
|
|
29
|
+
"author": "epilot GmbH",
|
|
30
|
+
"license": "UNLICENSED",
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"axios": "^0.21.1"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"buffer": "^6.0.3",
|
|
36
|
+
"https-browserify": "^1.0.0",
|
|
37
|
+
"openapi-client-axios": "^3.13.1",
|
|
38
|
+
"stream-http": "^3.1.1",
|
|
39
|
+
"url": "^0.11.0",
|
|
40
|
+
"util": "^0.12.3"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@types/jest": "^26.0.20",
|
|
44
|
+
"axios": "^0.21.1",
|
|
45
|
+
"copy-webpack-plugin": "^7.0.0",
|
|
46
|
+
"jest": "^26.6.3",
|
|
47
|
+
"json-loader": "^0.5.7",
|
|
48
|
+
"openapi-client-axios-typegen": "^3.13.1",
|
|
49
|
+
"openapicmd": "^1.6.2",
|
|
50
|
+
"ts-jest": "^26.5.0",
|
|
51
|
+
"ts-loader": "^8.0.14",
|
|
52
|
+
"ts-node": "^9.1.1",
|
|
53
|
+
"typescript": "^4.1.3",
|
|
54
|
+
"webpack": "^5.18.0",
|
|
55
|
+
"webpack-cli": "^4.4.0"
|
|
56
|
+
}
|
|
57
|
+
}
|
package/src/openapi.d.ts
ADDED
|
@@ -0,0 +1,484 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import {
|
|
3
|
+
OpenAPIClient,
|
|
4
|
+
Parameters,
|
|
5
|
+
UnknownParamsObject,
|
|
6
|
+
OperationResponse,
|
|
7
|
+
AxiosRequestConfig,
|
|
8
|
+
} from 'openapi-client-axios';
|
|
9
|
+
|
|
10
|
+
declare namespace Components {
|
|
11
|
+
namespace Schemas {
|
|
12
|
+
export interface AutomationAction {
|
|
13
|
+
id?: AutomationActionId;
|
|
14
|
+
/**
|
|
15
|
+
* example:
|
|
16
|
+
* Create Contact
|
|
17
|
+
*/
|
|
18
|
+
name?: string;
|
|
19
|
+
/**
|
|
20
|
+
* example:
|
|
21
|
+
* entity_mapping
|
|
22
|
+
*/
|
|
23
|
+
type?: string;
|
|
24
|
+
/**
|
|
25
|
+
* example:
|
|
26
|
+
* {
|
|
27
|
+
* "mapping_attributes": [
|
|
28
|
+
* {
|
|
29
|
+
* "target": "email",
|
|
30
|
+
* "mode": "upsert_match",
|
|
31
|
+
* "source": "billing_contact.email"
|
|
32
|
+
* },
|
|
33
|
+
* {
|
|
34
|
+
* "target": "first_name",
|
|
35
|
+
* "mode": "copy_if_exists",
|
|
36
|
+
* "source": "billing_contact.first_name"
|
|
37
|
+
* },
|
|
38
|
+
* {
|
|
39
|
+
* "target": "last_name",
|
|
40
|
+
* "mode": "copy_if_exists",
|
|
41
|
+
* "source": "billing_contact.last_name"
|
|
42
|
+
* },
|
|
43
|
+
* {
|
|
44
|
+
* "target": "addresses",
|
|
45
|
+
* "mode": "append_if_exists",
|
|
46
|
+
* "source": "billing_contact",
|
|
47
|
+
* "value_json": "{\n \"street_name\": \"{{billing_contact.street_name}}\",\n \"street_number\": \"{{billing_contact.street_number}}\",\n \"city\": \"{{billing_contact.city}}\",\n \"postal_code\": \"{{billing_contact.postal_code}}\",\n \"country\": \"{{billing_contact.country}}\",\n}"
|
|
48
|
+
* },
|
|
49
|
+
* {
|
|
50
|
+
* "target": "addresses",
|
|
51
|
+
* "mode": "append_if_exists",
|
|
52
|
+
* "source": "delivery_contact",
|
|
53
|
+
* "value_json": "{\n \"street_name\": \"{{delivery_contact.street_name}}\",\n \"street_number\": \"{{delivery_contact.street_number}}\",\n \"city\": \"{{delivery_contact.city}}\",\n \"postal_code\": \"{{delivery_contact.postal_code}}\",\n \"country\": \"{{delivery_contact.country}}\",\n}"
|
|
54
|
+
* }
|
|
55
|
+
* ]
|
|
56
|
+
* }
|
|
57
|
+
*/
|
|
58
|
+
config?: {
|
|
59
|
+
[name: string]: any;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* example:
|
|
64
|
+
* 9ec3711b-db63-449c-b894-54d5bb622a8f
|
|
65
|
+
*/
|
|
66
|
+
export type AutomationActionId = string;
|
|
67
|
+
export interface AutomationExecution {
|
|
68
|
+
id?: AutomationExecutionId;
|
|
69
|
+
/**
|
|
70
|
+
* example:
|
|
71
|
+
* success
|
|
72
|
+
*/
|
|
73
|
+
status?: "pending" | "in_progress" | "success" | "failed" | "cancelled";
|
|
74
|
+
entity_id?: EntityId;
|
|
75
|
+
workflow_id?: AutomationWorkflowId;
|
|
76
|
+
created_at?: string; // date-time
|
|
77
|
+
updated_at?: string; // date-time
|
|
78
|
+
current_action?: AutomationActionId;
|
|
79
|
+
actions?: {
|
|
80
|
+
status?: "pending" | "in_progress" | "success" | "failed";
|
|
81
|
+
id?: AutomationActionId;
|
|
82
|
+
/**
|
|
83
|
+
* example:
|
|
84
|
+
* Create Contact
|
|
85
|
+
*/
|
|
86
|
+
name?: string;
|
|
87
|
+
/**
|
|
88
|
+
* example:
|
|
89
|
+
* entity_mapping
|
|
90
|
+
*/
|
|
91
|
+
type?: string;
|
|
92
|
+
/**
|
|
93
|
+
* example:
|
|
94
|
+
* {
|
|
95
|
+
* "mapping_attributes": [
|
|
96
|
+
* {
|
|
97
|
+
* "target": "email",
|
|
98
|
+
* "mode": "upsert_match",
|
|
99
|
+
* "source": "billing_contact.email"
|
|
100
|
+
* },
|
|
101
|
+
* {
|
|
102
|
+
* "target": "first_name",
|
|
103
|
+
* "mode": "copy_if_exists",
|
|
104
|
+
* "source": "billing_contact.first_name"
|
|
105
|
+
* },
|
|
106
|
+
* {
|
|
107
|
+
* "target": "last_name",
|
|
108
|
+
* "mode": "copy_if_exists",
|
|
109
|
+
* "source": "billing_contact.last_name"
|
|
110
|
+
* },
|
|
111
|
+
* {
|
|
112
|
+
* "target": "addresses",
|
|
113
|
+
* "mode": "append_if_exists",
|
|
114
|
+
* "source": "billing_contact",
|
|
115
|
+
* "value_json": "{\n \"street_name\": \"{{billing_contact.street_name}}\",\n \"street_number\": \"{{billing_contact.street_number}}\",\n \"city\": \"{{billing_contact.city}}\",\n \"postal_code\": \"{{billing_contact.postal_code}}\",\n \"country\": \"{{billing_contact.country}}\",\n}"
|
|
116
|
+
* },
|
|
117
|
+
* {
|
|
118
|
+
* "target": "addresses",
|
|
119
|
+
* "mode": "append_if_exists",
|
|
120
|
+
* "source": "delivery_contact",
|
|
121
|
+
* "value_json": "{\n \"street_name\": \"{{delivery_contact.street_name}}\",\n \"street_number\": \"{{delivery_contact.street_number}}\",\n \"city\": \"{{delivery_contact.city}}\",\n \"postal_code\": \"{{delivery_contact.postal_code}}\",\n \"country\": \"{{delivery_contact.country}}\",\n}"
|
|
122
|
+
* }
|
|
123
|
+
* ]
|
|
124
|
+
* }
|
|
125
|
+
*/
|
|
126
|
+
config?: {
|
|
127
|
+
[name: string]: any;
|
|
128
|
+
};
|
|
129
|
+
}[];
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* example:
|
|
133
|
+
* 9baf184f-bc81-4128-bca3-d974c90a12c4
|
|
134
|
+
*/
|
|
135
|
+
export type AutomationExecutionId = string;
|
|
136
|
+
export interface AutomationWorkflow {
|
|
137
|
+
id?: AutomationWorkflowId;
|
|
138
|
+
/**
|
|
139
|
+
* example:
|
|
140
|
+
* Handle contact form
|
|
141
|
+
*/
|
|
142
|
+
workflow_name?: string;
|
|
143
|
+
triggers?: {
|
|
144
|
+
on: "entity_create" | "entity_update" | "entity_delete" | "journey_submit" | "frontend_submit";
|
|
145
|
+
/**
|
|
146
|
+
* example:
|
|
147
|
+
* {
|
|
148
|
+
* "entity_schema": "contact"
|
|
149
|
+
* }
|
|
150
|
+
*/
|
|
151
|
+
config: {
|
|
152
|
+
[name: string]: any;
|
|
153
|
+
};
|
|
154
|
+
}[];
|
|
155
|
+
/**
|
|
156
|
+
* schemas this automation is available for
|
|
157
|
+
*/
|
|
158
|
+
schemas?: string[];
|
|
159
|
+
actions?: AutomationAction[];
|
|
160
|
+
created_at?: string; // date-time
|
|
161
|
+
updated_at?: string; // date-time
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* example:
|
|
165
|
+
* 7791b04a-16d2-44a2-9af9-2d59c25c512f
|
|
166
|
+
*/
|
|
167
|
+
export type AutomationWorkflowId = string;
|
|
168
|
+
/**
|
|
169
|
+
* example:
|
|
170
|
+
* e3d3ebac-baab-4395-abf4-50b5bf1f8b74
|
|
171
|
+
*/
|
|
172
|
+
export type EntityId = string;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
declare namespace Paths {
|
|
176
|
+
namespace CancelExecution {
|
|
177
|
+
namespace Parameters {
|
|
178
|
+
export type ExecutionId = Components.Schemas.AutomationExecutionId;
|
|
179
|
+
}
|
|
180
|
+
export interface PathParameters {
|
|
181
|
+
execution_id: Parameters.ExecutionId;
|
|
182
|
+
}
|
|
183
|
+
namespace Responses {
|
|
184
|
+
export type $200 = Components.Schemas.AutomationExecution;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
namespace CreateAutomation {
|
|
188
|
+
export type RequestBody = Components.Schemas.AutomationWorkflow;
|
|
189
|
+
namespace Responses {
|
|
190
|
+
export type $201 = Components.Schemas.AutomationWorkflow;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
namespace DeleteAutomation {
|
|
194
|
+
namespace Parameters {
|
|
195
|
+
export type WorkflowId = Components.Schemas.AutomationWorkflowId;
|
|
196
|
+
}
|
|
197
|
+
export interface PathParameters {
|
|
198
|
+
workflow_id: Parameters.WorkflowId;
|
|
199
|
+
}
|
|
200
|
+
namespace Responses {
|
|
201
|
+
export type $200 = Components.Schemas.AutomationWorkflow;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
namespace GetAutomation {
|
|
205
|
+
namespace Parameters {
|
|
206
|
+
export type WorkflowId = Components.Schemas.AutomationWorkflowId;
|
|
207
|
+
}
|
|
208
|
+
export interface PathParameters {
|
|
209
|
+
workflow_id: Parameters.WorkflowId;
|
|
210
|
+
}
|
|
211
|
+
namespace Responses {
|
|
212
|
+
export type $200 = Components.Schemas.AutomationWorkflow;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
namespace GetExecution {
|
|
216
|
+
namespace Parameters {
|
|
217
|
+
export type ExecutionId = Components.Schemas.AutomationExecutionId;
|
|
218
|
+
}
|
|
219
|
+
export interface PathParameters {
|
|
220
|
+
execution_id: Parameters.ExecutionId;
|
|
221
|
+
}
|
|
222
|
+
namespace Responses {
|
|
223
|
+
export type $200 = Components.Schemas.AutomationExecution;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
namespace GetExecutions {
|
|
227
|
+
namespace Parameters {
|
|
228
|
+
export type EntityId = Components.Schemas.EntityId;
|
|
229
|
+
export type From = number;
|
|
230
|
+
export type Size = number;
|
|
231
|
+
}
|
|
232
|
+
export interface QueryParameters {
|
|
233
|
+
entity_id?: Parameters.EntityId;
|
|
234
|
+
size?: Parameters.Size;
|
|
235
|
+
from?: Parameters.From;
|
|
236
|
+
}
|
|
237
|
+
namespace Responses {
|
|
238
|
+
export type $200 = Components.Schemas.AutomationExecution[];
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
namespace PutAutomation {
|
|
242
|
+
namespace Parameters {
|
|
243
|
+
export type WorkflowId = Components.Schemas.AutomationWorkflowId;
|
|
244
|
+
}
|
|
245
|
+
export interface PathParameters {
|
|
246
|
+
workflow_id: Parameters.WorkflowId;
|
|
247
|
+
}
|
|
248
|
+
export type RequestBody = Components.Schemas.AutomationWorkflow;
|
|
249
|
+
namespace Responses {
|
|
250
|
+
export type $201 = Components.Schemas.AutomationWorkflow;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
namespace SearchAutomations {
|
|
254
|
+
namespace Parameters {
|
|
255
|
+
export type From = number;
|
|
256
|
+
/**
|
|
257
|
+
* example:
|
|
258
|
+
* submission
|
|
259
|
+
*/
|
|
260
|
+
export type Schema = string;
|
|
261
|
+
export type Size = number;
|
|
262
|
+
}
|
|
263
|
+
export interface QueryParameters {
|
|
264
|
+
schema?: Parameters.Schema;
|
|
265
|
+
size?: Parameters.Size;
|
|
266
|
+
from?: Parameters.From;
|
|
267
|
+
}
|
|
268
|
+
namespace Responses {
|
|
269
|
+
export interface $200 {
|
|
270
|
+
/**
|
|
271
|
+
* example:
|
|
272
|
+
* 1
|
|
273
|
+
*/
|
|
274
|
+
total?: number;
|
|
275
|
+
results?: Components.Schemas.AutomationWorkflow[];
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
namespace StartExecution {
|
|
280
|
+
export interface RequestBody {
|
|
281
|
+
entity_id?: Components.Schemas.EntityId;
|
|
282
|
+
workflow_id?: Components.Schemas.AutomationWorkflowId;
|
|
283
|
+
}
|
|
284
|
+
namespace Responses {
|
|
285
|
+
export type $201 = Components.Schemas.AutomationExecution;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
export interface OperationMethods {
|
|
291
|
+
/**
|
|
292
|
+
* searchAutomations - searchAutomations
|
|
293
|
+
*
|
|
294
|
+
* Search available automation workflows
|
|
295
|
+
*/
|
|
296
|
+
'searchAutomations'(
|
|
297
|
+
parameters?: Parameters<Paths.SearchAutomations.QueryParameters> | null,
|
|
298
|
+
data?: any,
|
|
299
|
+
config?: AxiosRequestConfig
|
|
300
|
+
): OperationResponse<Paths.SearchAutomations.Responses.$200>
|
|
301
|
+
/**
|
|
302
|
+
* createAutomation - createAutomation
|
|
303
|
+
*
|
|
304
|
+
* Create new automation workflow
|
|
305
|
+
*/
|
|
306
|
+
'createAutomation'(
|
|
307
|
+
parameters?: Parameters<UnknownParamsObject> | null,
|
|
308
|
+
data?: Paths.CreateAutomation.RequestBody,
|
|
309
|
+
config?: AxiosRequestConfig
|
|
310
|
+
): OperationResponse<Paths.CreateAutomation.Responses.$201>
|
|
311
|
+
/**
|
|
312
|
+
* getAutomation - getAutomation
|
|
313
|
+
*
|
|
314
|
+
* List available automation workflows
|
|
315
|
+
*/
|
|
316
|
+
'getAutomation'(
|
|
317
|
+
parameters?: Parameters<Paths.GetAutomation.PathParameters> | null,
|
|
318
|
+
data?: any,
|
|
319
|
+
config?: AxiosRequestConfig
|
|
320
|
+
): OperationResponse<Paths.GetAutomation.Responses.$200>
|
|
321
|
+
/**
|
|
322
|
+
* putAutomation - putAutomation
|
|
323
|
+
*
|
|
324
|
+
* Update automation workflow by id
|
|
325
|
+
*/
|
|
326
|
+
'putAutomation'(
|
|
327
|
+
parameters?: Parameters<Paths.PutAutomation.PathParameters> | null,
|
|
328
|
+
data?: Paths.PutAutomation.RequestBody,
|
|
329
|
+
config?: AxiosRequestConfig
|
|
330
|
+
): OperationResponse<Paths.PutAutomation.Responses.$201>
|
|
331
|
+
/**
|
|
332
|
+
* deleteAutomation - deleteAutomation
|
|
333
|
+
*
|
|
334
|
+
* Update automation workflow by id
|
|
335
|
+
*/
|
|
336
|
+
'deleteAutomation'(
|
|
337
|
+
parameters?: Parameters<Paths.DeleteAutomation.PathParameters> | null,
|
|
338
|
+
data?: any,
|
|
339
|
+
config?: AxiosRequestConfig
|
|
340
|
+
): OperationResponse<Paths.DeleteAutomation.Responses.$200>
|
|
341
|
+
/**
|
|
342
|
+
* getExecutions - getExecutions
|
|
343
|
+
*
|
|
344
|
+
* List automation executions
|
|
345
|
+
*/
|
|
346
|
+
'getExecutions'(
|
|
347
|
+
parameters?: Parameters<Paths.GetExecutions.QueryParameters> | null,
|
|
348
|
+
data?: any,
|
|
349
|
+
config?: AxiosRequestConfig
|
|
350
|
+
): OperationResponse<Paths.GetExecutions.Responses.$200>
|
|
351
|
+
/**
|
|
352
|
+
* startExecution - startExecution
|
|
353
|
+
*
|
|
354
|
+
* Start new automation execution
|
|
355
|
+
*/
|
|
356
|
+
'startExecution'(
|
|
357
|
+
parameters?: Parameters<UnknownParamsObject> | null,
|
|
358
|
+
data?: Paths.StartExecution.RequestBody,
|
|
359
|
+
config?: AxiosRequestConfig
|
|
360
|
+
): OperationResponse<Paths.StartExecution.Responses.$201>
|
|
361
|
+
/**
|
|
362
|
+
* getExecution - getExecution
|
|
363
|
+
*
|
|
364
|
+
* Get automation execution
|
|
365
|
+
*/
|
|
366
|
+
'getExecution'(
|
|
367
|
+
parameters?: Parameters<Paths.GetExecution.PathParameters> | null,
|
|
368
|
+
data?: any,
|
|
369
|
+
config?: AxiosRequestConfig
|
|
370
|
+
): OperationResponse<Paths.GetExecution.Responses.$200>
|
|
371
|
+
/**
|
|
372
|
+
* cancelExecution - cancelExecution
|
|
373
|
+
*
|
|
374
|
+
* Cancel automation execution
|
|
375
|
+
*/
|
|
376
|
+
'cancelExecution'(
|
|
377
|
+
parameters?: Parameters<Paths.CancelExecution.PathParameters> | null,
|
|
378
|
+
data?: any,
|
|
379
|
+
config?: AxiosRequestConfig
|
|
380
|
+
): OperationResponse<Paths.CancelExecution.Responses.$200>
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
export interface PathsDictionary {
|
|
384
|
+
['/v1/automation/workflows']: {
|
|
385
|
+
/**
|
|
386
|
+
* searchAutomations - searchAutomations
|
|
387
|
+
*
|
|
388
|
+
* Search available automation workflows
|
|
389
|
+
*/
|
|
390
|
+
'get'(
|
|
391
|
+
parameters?: Parameters<Paths.SearchAutomations.QueryParameters> | null,
|
|
392
|
+
data?: any,
|
|
393
|
+
config?: AxiosRequestConfig
|
|
394
|
+
): OperationResponse<Paths.SearchAutomations.Responses.$200>
|
|
395
|
+
/**
|
|
396
|
+
* createAutomation - createAutomation
|
|
397
|
+
*
|
|
398
|
+
* Create new automation workflow
|
|
399
|
+
*/
|
|
400
|
+
'post'(
|
|
401
|
+
parameters?: Parameters<UnknownParamsObject> | null,
|
|
402
|
+
data?: Paths.CreateAutomation.RequestBody,
|
|
403
|
+
config?: AxiosRequestConfig
|
|
404
|
+
): OperationResponse<Paths.CreateAutomation.Responses.$201>
|
|
405
|
+
}
|
|
406
|
+
['/v1/automation/workflows/{workflow_id}']: {
|
|
407
|
+
/**
|
|
408
|
+
* getAutomation - getAutomation
|
|
409
|
+
*
|
|
410
|
+
* List available automation workflows
|
|
411
|
+
*/
|
|
412
|
+
'get'(
|
|
413
|
+
parameters?: Parameters<Paths.GetAutomation.PathParameters> | null,
|
|
414
|
+
data?: any,
|
|
415
|
+
config?: AxiosRequestConfig
|
|
416
|
+
): OperationResponse<Paths.GetAutomation.Responses.$200>
|
|
417
|
+
/**
|
|
418
|
+
* putAutomation - putAutomation
|
|
419
|
+
*
|
|
420
|
+
* Update automation workflow by id
|
|
421
|
+
*/
|
|
422
|
+
'put'(
|
|
423
|
+
parameters?: Parameters<Paths.PutAutomation.PathParameters> | null,
|
|
424
|
+
data?: Paths.PutAutomation.RequestBody,
|
|
425
|
+
config?: AxiosRequestConfig
|
|
426
|
+
): OperationResponse<Paths.PutAutomation.Responses.$201>
|
|
427
|
+
/**
|
|
428
|
+
* deleteAutomation - deleteAutomation
|
|
429
|
+
*
|
|
430
|
+
* Update automation workflow by id
|
|
431
|
+
*/
|
|
432
|
+
'delete'(
|
|
433
|
+
parameters?: Parameters<Paths.DeleteAutomation.PathParameters> | null,
|
|
434
|
+
data?: any,
|
|
435
|
+
config?: AxiosRequestConfig
|
|
436
|
+
): OperationResponse<Paths.DeleteAutomation.Responses.$200>
|
|
437
|
+
}
|
|
438
|
+
['/v1/automation/executions']: {
|
|
439
|
+
/**
|
|
440
|
+
* getExecutions - getExecutions
|
|
441
|
+
*
|
|
442
|
+
* List automation executions
|
|
443
|
+
*/
|
|
444
|
+
'get'(
|
|
445
|
+
parameters?: Parameters<Paths.GetExecutions.QueryParameters> | null,
|
|
446
|
+
data?: any,
|
|
447
|
+
config?: AxiosRequestConfig
|
|
448
|
+
): OperationResponse<Paths.GetExecutions.Responses.$200>
|
|
449
|
+
/**
|
|
450
|
+
* startExecution - startExecution
|
|
451
|
+
*
|
|
452
|
+
* Start new automation execution
|
|
453
|
+
*/
|
|
454
|
+
'post'(
|
|
455
|
+
parameters?: Parameters<UnknownParamsObject> | null,
|
|
456
|
+
data?: Paths.StartExecution.RequestBody,
|
|
457
|
+
config?: AxiosRequestConfig
|
|
458
|
+
): OperationResponse<Paths.StartExecution.Responses.$201>
|
|
459
|
+
}
|
|
460
|
+
['/v1/automation/executions/{execution_id}']: {
|
|
461
|
+
/**
|
|
462
|
+
* getExecution - getExecution
|
|
463
|
+
*
|
|
464
|
+
* Get automation execution
|
|
465
|
+
*/
|
|
466
|
+
'get'(
|
|
467
|
+
parameters?: Parameters<Paths.GetExecution.PathParameters> | null,
|
|
468
|
+
data?: any,
|
|
469
|
+
config?: AxiosRequestConfig
|
|
470
|
+
): OperationResponse<Paths.GetExecution.Responses.$200>
|
|
471
|
+
/**
|
|
472
|
+
* cancelExecution - cancelExecution
|
|
473
|
+
*
|
|
474
|
+
* Cancel automation execution
|
|
475
|
+
*/
|
|
476
|
+
'delete'(
|
|
477
|
+
parameters?: Parameters<Paths.CancelExecution.PathParameters> | null,
|
|
478
|
+
data?: any,
|
|
479
|
+
config?: AxiosRequestConfig
|
|
480
|
+
): OperationResponse<Paths.CancelExecution.Responses.$200>
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
export type Client = OpenAPIClient<OperationMethods, PathsDictionary>
|