@epilot/automation-client 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/definition.js +1 -1
- package/dist/openapi.d.ts +530 -211
- package/package.json +1 -1
- package/src/openapi.d.ts +814 -0
package/dist/openapi.d.ts
CHANGED
|
@@ -9,178 +9,479 @@ import {
|
|
|
9
9
|
|
|
10
10
|
declare namespace Components {
|
|
11
11
|
namespace Schemas {
|
|
12
|
+
export type AnyAction = MapEntityAction | TriggerWorkflowAction | TriggerWebhookAction | CreateDocumentAction | SendEmailAction | AutomationAction;
|
|
13
|
+
/**
|
|
14
|
+
* example:
|
|
15
|
+
* [
|
|
16
|
+
* {
|
|
17
|
+
* "step_name": "Lead Sales",
|
|
18
|
+
* "user_ids": [
|
|
19
|
+
* 10010729
|
|
20
|
+
* ]
|
|
21
|
+
* },
|
|
22
|
+
* {
|
|
23
|
+
* "step_name": "Operations",
|
|
24
|
+
* "user_ids": [
|
|
25
|
+
* 10010728,
|
|
26
|
+
* 10010729
|
|
27
|
+
* ]
|
|
28
|
+
* }
|
|
29
|
+
* ]
|
|
30
|
+
*/
|
|
31
|
+
export interface AssignUsersToStep {
|
|
32
|
+
step_name?: string;
|
|
33
|
+
user_ids?: number[];
|
|
34
|
+
}
|
|
12
35
|
export interface AutomationAction {
|
|
13
36
|
id?: AutomationActionId;
|
|
14
|
-
/**
|
|
15
|
-
* example:
|
|
16
|
-
* Create Contact
|
|
17
|
-
*/
|
|
18
37
|
name?: string;
|
|
19
|
-
/**
|
|
20
|
-
* example:
|
|
21
|
-
* entity_mapping
|
|
22
|
-
*/
|
|
23
38
|
type?: string;
|
|
39
|
+
config?: {
|
|
40
|
+
[name: string]: any;
|
|
41
|
+
};
|
|
42
|
+
execution_status?: ExecutionStatus;
|
|
43
|
+
started_at?: string;
|
|
44
|
+
updated_at?: string;
|
|
24
45
|
/**
|
|
25
|
-
*
|
|
26
|
-
* {
|
|
27
|
-
* "target_schema": "contact",
|
|
28
|
-
* "mapping_attributes": [
|
|
29
|
-
* {
|
|
30
|
-
* "target": "email",
|
|
31
|
-
* "mode": "upsert_match",
|
|
32
|
-
* "source": "billing_contact.email"
|
|
33
|
-
* },
|
|
34
|
-
* {
|
|
35
|
-
* "target": "first_name",
|
|
36
|
-
* "mode": "copy_if_exists",
|
|
37
|
-
* "source": "billing_contact.first_name"
|
|
38
|
-
* },
|
|
39
|
-
* {
|
|
40
|
-
* "target": "last_name",
|
|
41
|
-
* "mode": "copy_if_exists",
|
|
42
|
-
* "source": "billing_contact.last_name"
|
|
43
|
-
* },
|
|
44
|
-
* {
|
|
45
|
-
* "target": "addresses",
|
|
46
|
-
* "mode": "append_if_exists",
|
|
47
|
-
* "source": "billing_contact",
|
|
48
|
-
* "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}"
|
|
49
|
-
* },
|
|
50
|
-
* {
|
|
51
|
-
* "target": "addresses",
|
|
52
|
-
* "mode": "append_if_exists",
|
|
53
|
-
* "source": "delivery_contact",
|
|
54
|
-
* "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}"
|
|
55
|
-
* }
|
|
56
|
-
* ]
|
|
57
|
-
* }
|
|
46
|
+
* Flag indicating whether the action was created automatically or manually
|
|
58
47
|
*/
|
|
59
|
-
|
|
48
|
+
created_automatically?: boolean;
|
|
49
|
+
outputs?: {
|
|
60
50
|
[name: string]: any;
|
|
61
51
|
};
|
|
52
|
+
error_output?: ErrorOutput;
|
|
62
53
|
}
|
|
63
54
|
/**
|
|
64
55
|
* example:
|
|
65
56
|
* 9ec3711b-db63-449c-b894-54d5bb622a8f
|
|
66
57
|
*/
|
|
67
58
|
export type AutomationActionId = string;
|
|
68
|
-
export interface
|
|
69
|
-
id
|
|
59
|
+
export interface AutomationExecution {
|
|
60
|
+
id: AutomationExecutionId;
|
|
70
61
|
/**
|
|
71
62
|
* example:
|
|
72
|
-
*
|
|
63
|
+
* success
|
|
73
64
|
*/
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
* example:
|
|
79
|
-
* {
|
|
80
|
-
* "entity_schema": "contact"
|
|
81
|
-
* }
|
|
82
|
-
*/
|
|
83
|
-
config: {
|
|
84
|
-
[name: string]: any;
|
|
85
|
-
};
|
|
86
|
-
}[];
|
|
65
|
+
execution_status?: ExecutionStatus;
|
|
66
|
+
entity_id: EntityId;
|
|
67
|
+
org_id: OrganizationId;
|
|
68
|
+
flow_id: AutomationFlowId;
|
|
87
69
|
/**
|
|
88
|
-
*
|
|
70
|
+
* example:
|
|
71
|
+
* Handle contact form
|
|
89
72
|
*/
|
|
90
|
-
|
|
91
|
-
actions?: AutomationAction[];
|
|
73
|
+
flow_name?: string;
|
|
92
74
|
created_at?: string; // date-time
|
|
93
75
|
updated_at?: string; // date-time
|
|
76
|
+
current_action_id?: AutomationActionId;
|
|
77
|
+
actions: AnyAction[];
|
|
94
78
|
}
|
|
95
79
|
/**
|
|
96
80
|
* example:
|
|
97
|
-
*
|
|
81
|
+
* 9baf184f-bc81-4128-bca3-d974c90a12c4
|
|
98
82
|
*/
|
|
99
|
-
export type
|
|
100
|
-
export interface
|
|
101
|
-
id?:
|
|
83
|
+
export type AutomationExecutionId = string;
|
|
84
|
+
export interface AutomationFlow {
|
|
85
|
+
id?: AutomationFlowId;
|
|
102
86
|
/**
|
|
103
87
|
* example:
|
|
104
|
-
*
|
|
88
|
+
* Handle contact form
|
|
105
89
|
*/
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
90
|
+
flow_name?: string;
|
|
91
|
+
/**
|
|
92
|
+
* Number of automation executions that ran
|
|
93
|
+
* example:
|
|
94
|
+
* 7
|
|
95
|
+
*/
|
|
96
|
+
runs?: number;
|
|
97
|
+
triggers?: (FrontendSubmitTrigger | JourneySubmitTrigger | EntityOperationTrigger)[];
|
|
98
|
+
trigger_conditions?: TriggerCondition[];
|
|
99
|
+
/**
|
|
100
|
+
* The entity schema
|
|
101
|
+
* example:
|
|
102
|
+
* submission
|
|
103
|
+
*/
|
|
104
|
+
entity_schema?: string;
|
|
105
|
+
actions?: AnyAction[];
|
|
109
106
|
created_at?: string; // date-time
|
|
110
107
|
updated_at?: string; // date-time
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* example:
|
|
111
|
+
* 7791b04a-16d2-44a2-9af9-2d59c25c512f
|
|
112
|
+
*/
|
|
113
|
+
export type AutomationFlowId = string;
|
|
114
|
+
export type Comparison = "equals" | "any_of" | "not_empty" | "is_empty";
|
|
115
|
+
/**
|
|
116
|
+
* example:
|
|
117
|
+
* {
|
|
118
|
+
* "id": "08g988-ojt2jtaga-292h-8978gsaga",
|
|
119
|
+
* "name": "Create Document",
|
|
120
|
+
* "type": "create-document",
|
|
121
|
+
* "config": {
|
|
122
|
+
* "template_id": {
|
|
123
|
+
* "type": "string",
|
|
124
|
+
* "example": "112b08ba-789c-42f2-9940-43b302f641e8\""
|
|
125
|
+
* },
|
|
126
|
+
* "filename": {
|
|
127
|
+
* "type": "string",
|
|
128
|
+
* "example": "newsletter.pdf\""
|
|
129
|
+
* }
|
|
130
|
+
* }
|
|
131
|
+
* }
|
|
132
|
+
*/
|
|
133
|
+
export interface CreateDocumentAction {
|
|
134
|
+
id?: AutomationActionId;
|
|
135
|
+
name?: string;
|
|
136
|
+
type?: string;
|
|
137
|
+
config?: CreateDocumentConfig;
|
|
138
|
+
execution_status?: ExecutionStatus;
|
|
139
|
+
started_at?: string;
|
|
140
|
+
updated_at?: string;
|
|
141
|
+
/**
|
|
142
|
+
* Flag indicating whether the action was created automatically or manually
|
|
143
|
+
*/
|
|
144
|
+
created_automatically?: boolean;
|
|
145
|
+
outputs?: {
|
|
146
|
+
[name: string]: any;
|
|
147
|
+
};
|
|
148
|
+
error_output?: ErrorOutput;
|
|
149
|
+
}
|
|
150
|
+
export interface CreateDocumentConfig {
|
|
151
|
+
template_id?: string;
|
|
152
|
+
filename?: string;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* example:
|
|
156
|
+
* e3d3ebac-baab-4395-abf4-50b5bf1f8b74
|
|
157
|
+
*/
|
|
158
|
+
export type EntityId = string;
|
|
159
|
+
export interface EntityOperationTrigger {
|
|
160
|
+
type: "entity_operation";
|
|
161
|
+
configuration: {
|
|
124
162
|
/**
|
|
125
163
|
* example:
|
|
126
|
-
*
|
|
164
|
+
* 210738fe-e1e6-446e-aaef-cce462d7d813
|
|
127
165
|
*/
|
|
128
|
-
|
|
166
|
+
source_id?: string;
|
|
129
167
|
/**
|
|
130
168
|
* example:
|
|
131
|
-
*
|
|
169
|
+
* submission
|
|
132
170
|
*/
|
|
133
|
-
|
|
171
|
+
schema?: string;
|
|
172
|
+
operations?: ("createEntity" | "updateEntity" | "deleteEntity")[];
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
export type ErrorCode = "MAPPING_ERROR" | "REFRESH_RELATIONS_ERROR" | "DUPLICATE_ENTITY_ERROR" | "TRIGGER_WORKFLOW_ERROR" | "TIMEOUT_ERROR" | "INTERNAL_ERROR" | "EMAIL_TEMPLATE_MISSING_DATA_ERROR";
|
|
176
|
+
export interface ErrorOutput {
|
|
177
|
+
error_code: ErrorCode;
|
|
178
|
+
error_reason: string;
|
|
179
|
+
}
|
|
180
|
+
export type ExecutionStatus = "pending" | "in_progress" | "success" | "failed" | "cancelled";
|
|
181
|
+
export interface FrontendSubmitTrigger {
|
|
182
|
+
type: "frontend_submission";
|
|
183
|
+
configuration: {
|
|
134
184
|
/**
|
|
135
185
|
* example:
|
|
136
|
-
*
|
|
137
|
-
* "target_schema": "contact",
|
|
138
|
-
* "mapping_attributes": [
|
|
139
|
-
* {
|
|
140
|
-
* "target": "email",
|
|
141
|
-
* "mode": "upsert_match",
|
|
142
|
-
* "source": "billing_contact.email"
|
|
143
|
-
* },
|
|
144
|
-
* {
|
|
145
|
-
* "target": "first_name",
|
|
146
|
-
* "mode": "copy_if_exists",
|
|
147
|
-
* "source": "billing_contact.first_name"
|
|
148
|
-
* },
|
|
149
|
-
* {
|
|
150
|
-
* "target": "last_name",
|
|
151
|
-
* "mode": "copy_if_exists",
|
|
152
|
-
* "source": "billing_contact.last_name"
|
|
153
|
-
* },
|
|
154
|
-
* {
|
|
155
|
-
* "target": "addresses",
|
|
156
|
-
* "mode": "append_if_exists",
|
|
157
|
-
* "source": "billing_contact",
|
|
158
|
-
* "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}"
|
|
159
|
-
* },
|
|
160
|
-
* {
|
|
161
|
-
* "target": "addresses",
|
|
162
|
-
* "mode": "append_if_exists",
|
|
163
|
-
* "source": "delivery_contact",
|
|
164
|
-
* "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}"
|
|
165
|
-
* }
|
|
166
|
-
* ]
|
|
167
|
-
* }
|
|
186
|
+
* 99
|
|
168
187
|
*/
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
188
|
+
source_id?: string;
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
export interface GetExecutionsResp {
|
|
192
|
+
total: number;
|
|
193
|
+
results: AutomationExecution[];
|
|
194
|
+
}
|
|
195
|
+
export interface JourneySubmitTrigger {
|
|
196
|
+
type: "journey_submission";
|
|
197
|
+
configuration: {
|
|
198
|
+
source_id: string; // uuid
|
|
199
|
+
};
|
|
173
200
|
}
|
|
174
201
|
/**
|
|
175
202
|
* example:
|
|
176
|
-
*
|
|
203
|
+
* {
|
|
204
|
+
* "id": "2520gja-2sgmsaga-0asg-822jgal",
|
|
205
|
+
* "name": "Map Entity",
|
|
206
|
+
* "type": "map-entity",
|
|
207
|
+
* "config": {
|
|
208
|
+
* "target_schema": "contact",
|
|
209
|
+
* "target_unique": [
|
|
210
|
+
* "email.email"
|
|
211
|
+
* ],
|
|
212
|
+
* "mapping_attributes": [
|
|
213
|
+
* {
|
|
214
|
+
* "target": "email",
|
|
215
|
+
* "mode": "append_if_exists",
|
|
216
|
+
* "source": "billing_contact",
|
|
217
|
+
* "value_json": "{\n \"email\": \"billing_contact.email\"\n}"
|
|
218
|
+
* },
|
|
219
|
+
* {
|
|
220
|
+
* "target": "_tags",
|
|
221
|
+
* "mode": "set_value",
|
|
222
|
+
* "value": [
|
|
223
|
+
* "primary",
|
|
224
|
+
* "payer"
|
|
225
|
+
* ]
|
|
226
|
+
* },
|
|
227
|
+
* {
|
|
228
|
+
* "target": "first_name",
|
|
229
|
+
* "mode": "copy_if_exists",
|
|
230
|
+
* "source": "billing_contact.first_name"
|
|
231
|
+
* },
|
|
232
|
+
* {
|
|
233
|
+
* "target": "last_name",
|
|
234
|
+
* "mode": "copy_if_exists",
|
|
235
|
+
* "source": "billing_contact.last_name"
|
|
236
|
+
* },
|
|
237
|
+
* {
|
|
238
|
+
* "target": "contact_type",
|
|
239
|
+
* "mode": "set_value",
|
|
240
|
+
* "value": "customer"
|
|
241
|
+
* },
|
|
242
|
+
* {
|
|
243
|
+
* "target": "addresses",
|
|
244
|
+
* "mode": "append_if_exists",
|
|
245
|
+
* "source": "billing_contact",
|
|
246
|
+
* "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 \"_tags\": [\"billing\", \"primary\"]\n}"
|
|
247
|
+
* },
|
|
248
|
+
* {
|
|
249
|
+
* "target": "addresses",
|
|
250
|
+
* "mode": "append_if_exists",
|
|
251
|
+
* "source": "delivery_contact",
|
|
252
|
+
* "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 \"_tags\": [\"delivery\", \"secondary\"]\n}"
|
|
253
|
+
* }
|
|
254
|
+
* ]
|
|
255
|
+
* }
|
|
256
|
+
* }
|
|
177
257
|
*/
|
|
178
|
-
export
|
|
258
|
+
export interface MapEntityAction {
|
|
259
|
+
id?: AutomationActionId;
|
|
260
|
+
name?: string;
|
|
261
|
+
type?: string;
|
|
262
|
+
config?: MapEntityActionConfig;
|
|
263
|
+
execution_status?: ExecutionStatus;
|
|
264
|
+
started_at?: string;
|
|
265
|
+
updated_at?: string;
|
|
266
|
+
/**
|
|
267
|
+
* Flag indicating whether the action was created automatically or manually
|
|
268
|
+
*/
|
|
269
|
+
created_automatically?: boolean;
|
|
270
|
+
outputs?: {
|
|
271
|
+
[name: string]: any;
|
|
272
|
+
};
|
|
273
|
+
error_output?: ErrorOutput;
|
|
274
|
+
}
|
|
275
|
+
export interface MapEntityActionConfig {
|
|
276
|
+
target_schema?: string;
|
|
277
|
+
target_unique?: string[];
|
|
278
|
+
mapping_attributes?: MappingAttribute[];
|
|
279
|
+
relation_attributes?: RelationAttribute[];
|
|
280
|
+
}
|
|
281
|
+
export interface MappingAttribute {
|
|
282
|
+
/**
|
|
283
|
+
* JSON like target path for the attribute. Eg. last_name
|
|
284
|
+
*/
|
|
285
|
+
target: string;
|
|
286
|
+
/**
|
|
287
|
+
* - copy_if_exists - it replaces the target attribute with the source value
|
|
288
|
+
* - append_if_exists - it currently replaces target attribute with array like values. Useful when you have multiple values to be added into one attribute.
|
|
289
|
+
* - set_value - it sets a value to a predefined value. Must be used together with value property.
|
|
290
|
+
*
|
|
291
|
+
*/
|
|
292
|
+
mode: "copy_if_exists" | "append_if_exists" | "set_value";
|
|
293
|
+
/**
|
|
294
|
+
* JSON source path for the value to be extracted from. Eg: steps[1].['Product Info'].price
|
|
295
|
+
*
|
|
296
|
+
*/
|
|
297
|
+
source: string;
|
|
298
|
+
/**
|
|
299
|
+
* To be provided only when mapping json objects into a target attribute. Eg array of addresses.
|
|
300
|
+
*
|
|
301
|
+
*/
|
|
302
|
+
value_json?: string;
|
|
303
|
+
/**
|
|
304
|
+
* Any value to be set: string, number, string[], number[], JSON object, etc. It will override existing values, if any.
|
|
305
|
+
*
|
|
306
|
+
*/
|
|
307
|
+
value?: {
|
|
308
|
+
};
|
|
309
|
+
}
|
|
179
310
|
/**
|
|
180
311
|
* example:
|
|
181
312
|
* e3d3ebac-baab-4395-abf4-50b5bf1f8b74
|
|
182
313
|
*/
|
|
183
|
-
export type
|
|
314
|
+
export type OrganizationId = string;
|
|
315
|
+
export interface RelationAttribute {
|
|
316
|
+
target: string;
|
|
317
|
+
target_tags: string[];
|
|
318
|
+
related_to: {
|
|
319
|
+
schema: string;
|
|
320
|
+
tag: string;
|
|
321
|
+
};
|
|
322
|
+
mode: "append" | "set";
|
|
323
|
+
}
|
|
324
|
+
export interface SearchAutomationsResp {
|
|
325
|
+
total: number;
|
|
326
|
+
results: AutomationFlow;
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* example:
|
|
330
|
+
* {
|
|
331
|
+
* "id": "25jga0-gkasl26-0asg-908sgaj2",
|
|
332
|
+
* "name": "Send Email",
|
|
333
|
+
* "type": "send-email",
|
|
334
|
+
* "config": {
|
|
335
|
+
* "email_template_id": "gasj02-29ug9asgm-29t9gsaghg2g-pkmbhx2",
|
|
336
|
+
* "language_code": "de"
|
|
337
|
+
* }
|
|
338
|
+
* }
|
|
339
|
+
*/
|
|
340
|
+
export interface SendEmailAction {
|
|
341
|
+
id?: AutomationActionId;
|
|
342
|
+
name?: string;
|
|
343
|
+
type?: string;
|
|
344
|
+
config?: SendEmailActionConfig;
|
|
345
|
+
execution_status?: ExecutionStatus;
|
|
346
|
+
started_at?: string;
|
|
347
|
+
updated_at?: string;
|
|
348
|
+
/**
|
|
349
|
+
* Flag indicating whether the action was created automatically or manually
|
|
350
|
+
*/
|
|
351
|
+
created_automatically?: boolean;
|
|
352
|
+
outputs?: {
|
|
353
|
+
[name: string]: any;
|
|
354
|
+
};
|
|
355
|
+
error_output?: ErrorOutput;
|
|
356
|
+
}
|
|
357
|
+
export interface SendEmailActionConfig {
|
|
358
|
+
email_template_id?: string;
|
|
359
|
+
language_code?: "de" | "en";
|
|
360
|
+
}
|
|
361
|
+
export interface StartExecutionRequest {
|
|
362
|
+
entity_id?: EntityId;
|
|
363
|
+
flow_id?: AutomationFlowId;
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* example:
|
|
367
|
+
* {
|
|
368
|
+
* "source": "billing_contact.email",
|
|
369
|
+
* "comparison": "exists"
|
|
370
|
+
* }
|
|
371
|
+
*/
|
|
372
|
+
export interface TriggerCondition {
|
|
373
|
+
source: string;
|
|
374
|
+
comparison: Comparison;
|
|
375
|
+
value?: string | number | string[] | number[];
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* example:
|
|
379
|
+
* {
|
|
380
|
+
* "id": "2520gja-2sgmsaga-0asg-822jgal",
|
|
381
|
+
* "name": "Trigger Webhook",
|
|
382
|
+
* "type": "trigger-webhook",
|
|
383
|
+
* "config": {
|
|
384
|
+
* "entity_sources": [
|
|
385
|
+
* "contact",
|
|
386
|
+
* "account"
|
|
387
|
+
* ],
|
|
388
|
+
* "target_webhook_id": "25jg9ag2ga"
|
|
389
|
+
* }
|
|
390
|
+
* }
|
|
391
|
+
*/
|
|
392
|
+
export interface TriggerWebhookAction {
|
|
393
|
+
id?: AutomationActionId;
|
|
394
|
+
name?: string;
|
|
395
|
+
type?: string;
|
|
396
|
+
config?: TriggerWebhookActionConfig;
|
|
397
|
+
execution_status?: ExecutionStatus;
|
|
398
|
+
started_at?: string;
|
|
399
|
+
updated_at?: string;
|
|
400
|
+
/**
|
|
401
|
+
* Flag indicating whether the action was created automatically or manually
|
|
402
|
+
*/
|
|
403
|
+
created_automatically?: boolean;
|
|
404
|
+
outputs?: {
|
|
405
|
+
[name: string]: any;
|
|
406
|
+
};
|
|
407
|
+
error_output?: ErrorOutput;
|
|
408
|
+
}
|
|
409
|
+
export interface TriggerWebhookActionConfig {
|
|
410
|
+
entity_sources?: string[];
|
|
411
|
+
target_webhook_id?: string;
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* example:
|
|
415
|
+
* {
|
|
416
|
+
* "id": "08g988-ojt2jtaga-292h-8978gsaga",
|
|
417
|
+
* "name": "Trigger Workflow",
|
|
418
|
+
* "type": "trigger-workflow",
|
|
419
|
+
* "config": {
|
|
420
|
+
* "target_workflow": "mfptvUMH",
|
|
421
|
+
* "conditions": [
|
|
422
|
+
* {
|
|
423
|
+
* "schema": "ivy-opportunity",
|
|
424
|
+
* "source": "customer.type",
|
|
425
|
+
* "comparison": "equals",
|
|
426
|
+
* "value": "PRIVATE"
|
|
427
|
+
* }
|
|
428
|
+
* ],
|
|
429
|
+
* "assign_steps": [
|
|
430
|
+
* {
|
|
431
|
+
* "step_name": "Lead Sales",
|
|
432
|
+
* "user_ids": [
|
|
433
|
+
* 10010729
|
|
434
|
+
* ]
|
|
435
|
+
* },
|
|
436
|
+
* {
|
|
437
|
+
* "step_name": "Operations",
|
|
438
|
+
* "user_ids": [
|
|
439
|
+
* 10010728,
|
|
440
|
+
* 10010729
|
|
441
|
+
* ]
|
|
442
|
+
* }
|
|
443
|
+
* ]
|
|
444
|
+
* }
|
|
445
|
+
* }
|
|
446
|
+
*/
|
|
447
|
+
export interface TriggerWorkflowAction {
|
|
448
|
+
id?: AutomationActionId;
|
|
449
|
+
name?: string;
|
|
450
|
+
type?: string;
|
|
451
|
+
config?: TriggerWorkflowConfig;
|
|
452
|
+
execution_status?: ExecutionStatus;
|
|
453
|
+
started_at?: string;
|
|
454
|
+
updated_at?: string;
|
|
455
|
+
/**
|
|
456
|
+
* Flag indicating whether the action was created automatically or manually
|
|
457
|
+
*/
|
|
458
|
+
created_automatically?: boolean;
|
|
459
|
+
outputs?: {
|
|
460
|
+
[name: string]: any;
|
|
461
|
+
};
|
|
462
|
+
error_output?: ErrorOutput;
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* example:
|
|
466
|
+
* {
|
|
467
|
+
* "schema": "contact",
|
|
468
|
+
* "source": "billing_contact.email",
|
|
469
|
+
* "comparison": "exists",
|
|
470
|
+
* "value": "test@epilot.cloud"
|
|
471
|
+
* }
|
|
472
|
+
*/
|
|
473
|
+
export interface TriggerWorkflowCondition {
|
|
474
|
+
source: string;
|
|
475
|
+
comparison: Comparison;
|
|
476
|
+
value?: string | number | string[] | number[];
|
|
477
|
+
schema: string;
|
|
478
|
+
}
|
|
479
|
+
export interface TriggerWorkflowConfig {
|
|
480
|
+
target_workflow?: string;
|
|
481
|
+
conditions?: TriggerWorkflowCondition[];
|
|
482
|
+
assignees?: string[];
|
|
483
|
+
assign_steps?: AssignUsersToStep[];
|
|
484
|
+
}
|
|
184
485
|
}
|
|
185
486
|
}
|
|
186
487
|
declare namespace Paths {
|
|
@@ -195,32 +496,21 @@ declare namespace Paths {
|
|
|
195
496
|
export type $200 = Components.Schemas.AutomationExecution;
|
|
196
497
|
}
|
|
197
498
|
}
|
|
198
|
-
namespace
|
|
199
|
-
export type RequestBody = Components.Schemas.
|
|
200
|
-
namespace Responses {
|
|
201
|
-
export type $201 = Components.Schemas.AutomationDefinition;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
namespace DeleteAutomation {
|
|
205
|
-
namespace Parameters {
|
|
206
|
-
export type DefinitionId = Components.Schemas.AutomationDefinitionId;
|
|
207
|
-
}
|
|
208
|
-
export interface PathParameters {
|
|
209
|
-
definition_id: Parameters.DefinitionId;
|
|
210
|
-
}
|
|
499
|
+
namespace CreateFlow {
|
|
500
|
+
export type RequestBody = Components.Schemas.AutomationFlow;
|
|
211
501
|
namespace Responses {
|
|
212
|
-
export type $
|
|
502
|
+
export type $201 = Components.Schemas.AutomationFlow;
|
|
213
503
|
}
|
|
214
504
|
}
|
|
215
|
-
namespace
|
|
505
|
+
namespace DeleteFlow {
|
|
216
506
|
namespace Parameters {
|
|
217
|
-
export type
|
|
507
|
+
export type FlowId = Components.Schemas.AutomationFlowId;
|
|
218
508
|
}
|
|
219
509
|
export interface PathParameters {
|
|
220
|
-
|
|
510
|
+
flow_id: Parameters.FlowId;
|
|
221
511
|
}
|
|
222
512
|
namespace Responses {
|
|
223
|
-
export type $200 = Components.Schemas.
|
|
513
|
+
export type $200 = Components.Schemas.AutomationFlow;
|
|
224
514
|
}
|
|
225
515
|
}
|
|
226
516
|
namespace GetExecution {
|
|
@@ -246,22 +536,33 @@ declare namespace Paths {
|
|
|
246
536
|
from?: Parameters.From;
|
|
247
537
|
}
|
|
248
538
|
namespace Responses {
|
|
249
|
-
export type $200 = Components.Schemas.
|
|
539
|
+
export type $200 = Components.Schemas.GetExecutionsResp;
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
namespace GetFlow {
|
|
543
|
+
namespace Parameters {
|
|
544
|
+
export type FlowId = Components.Schemas.AutomationFlowId;
|
|
545
|
+
}
|
|
546
|
+
export interface PathParameters {
|
|
547
|
+
flow_id: Parameters.FlowId;
|
|
548
|
+
}
|
|
549
|
+
namespace Responses {
|
|
550
|
+
export type $200 = Components.Schemas.AutomationFlow;
|
|
250
551
|
}
|
|
251
552
|
}
|
|
252
|
-
namespace
|
|
553
|
+
namespace PutFlow {
|
|
253
554
|
namespace Parameters {
|
|
254
|
-
export type
|
|
555
|
+
export type FlowId = Components.Schemas.AutomationFlowId;
|
|
255
556
|
}
|
|
256
557
|
export interface PathParameters {
|
|
257
|
-
|
|
558
|
+
flow_id: Parameters.FlowId;
|
|
258
559
|
}
|
|
259
|
-
export type RequestBody = Components.Schemas.
|
|
560
|
+
export type RequestBody = Components.Schemas.AutomationFlow;
|
|
260
561
|
namespace Responses {
|
|
261
|
-
export type $
|
|
562
|
+
export type $200 = Components.Schemas.AutomationFlow;
|
|
262
563
|
}
|
|
263
564
|
}
|
|
264
|
-
namespace
|
|
565
|
+
namespace SearchFlows {
|
|
265
566
|
namespace Parameters {
|
|
266
567
|
export type From = number;
|
|
267
568
|
/**
|
|
@@ -270,28 +571,24 @@ declare namespace Paths {
|
|
|
270
571
|
*/
|
|
271
572
|
export type Schema = string;
|
|
272
573
|
export type Size = number;
|
|
574
|
+
/**
|
|
575
|
+
* example:
|
|
576
|
+
* 600945fe-212e-4b97-acf7-391d64648384
|
|
577
|
+
*/
|
|
578
|
+
export type TriggerSourceId = string;
|
|
273
579
|
}
|
|
274
580
|
export interface QueryParameters {
|
|
275
581
|
schema?: Parameters.Schema;
|
|
276
582
|
size?: Parameters.Size;
|
|
277
583
|
from?: Parameters.From;
|
|
584
|
+
trigger_source_id?: Parameters.TriggerSourceId;
|
|
278
585
|
}
|
|
279
586
|
namespace Responses {
|
|
280
|
-
export
|
|
281
|
-
/**
|
|
282
|
-
* example:
|
|
283
|
-
* 1
|
|
284
|
-
*/
|
|
285
|
-
total?: number;
|
|
286
|
-
results?: Components.Schemas.AutomationDefinition[];
|
|
287
|
-
}
|
|
587
|
+
export type $200 = Components.Schemas.SearchAutomationsResp;
|
|
288
588
|
}
|
|
289
589
|
}
|
|
290
590
|
namespace StartExecution {
|
|
291
|
-
export
|
|
292
|
-
entity_id?: Components.Schemas.EntityId;
|
|
293
|
-
definition_id?: Components.Schemas.AutomationDefinitionId;
|
|
294
|
-
}
|
|
591
|
+
export type RequestBody = Components.Schemas.StartExecutionRequest;
|
|
295
592
|
namespace Responses {
|
|
296
593
|
export type $201 = Components.Schemas.AutomationExecution;
|
|
297
594
|
}
|
|
@@ -300,55 +597,55 @@ declare namespace Paths {
|
|
|
300
597
|
|
|
301
598
|
export interface OperationMethods {
|
|
302
599
|
/**
|
|
303
|
-
*
|
|
600
|
+
* searchFlows - searchFlows
|
|
304
601
|
*
|
|
305
|
-
* Search available automation
|
|
602
|
+
* Search available automation flows
|
|
306
603
|
*/
|
|
307
|
-
'
|
|
308
|
-
parameters?: Parameters<Paths.
|
|
604
|
+
'searchFlows'(
|
|
605
|
+
parameters?: Parameters<Paths.SearchFlows.QueryParameters> | null,
|
|
309
606
|
data?: any,
|
|
310
607
|
config?: AxiosRequestConfig
|
|
311
|
-
): OperationResponse<Paths.
|
|
608
|
+
): OperationResponse<Paths.SearchFlows.Responses.$200>
|
|
312
609
|
/**
|
|
313
|
-
*
|
|
610
|
+
* createFlow - createFlow
|
|
314
611
|
*
|
|
315
|
-
* Create new automation
|
|
612
|
+
* Create new automation flow
|
|
316
613
|
*/
|
|
317
|
-
'
|
|
614
|
+
'createFlow'(
|
|
318
615
|
parameters?: Parameters<UnknownParamsObject> | null,
|
|
319
|
-
data?: Paths.
|
|
616
|
+
data?: Paths.CreateFlow.RequestBody,
|
|
320
617
|
config?: AxiosRequestConfig
|
|
321
|
-
): OperationResponse<Paths.
|
|
618
|
+
): OperationResponse<Paths.CreateFlow.Responses.$201>
|
|
322
619
|
/**
|
|
323
|
-
*
|
|
620
|
+
* getFlow - getFlow
|
|
324
621
|
*
|
|
325
|
-
* List available automation
|
|
622
|
+
* List available automation flows
|
|
326
623
|
*/
|
|
327
|
-
'
|
|
328
|
-
parameters?: Parameters<Paths.
|
|
624
|
+
'getFlow'(
|
|
625
|
+
parameters?: Parameters<Paths.GetFlow.PathParameters> | null,
|
|
329
626
|
data?: any,
|
|
330
627
|
config?: AxiosRequestConfig
|
|
331
|
-
): OperationResponse<Paths.
|
|
628
|
+
): OperationResponse<Paths.GetFlow.Responses.$200>
|
|
332
629
|
/**
|
|
333
|
-
*
|
|
630
|
+
* putFlow - putFlow
|
|
334
631
|
*
|
|
335
|
-
* Update automation
|
|
632
|
+
* Update automation flow by id
|
|
336
633
|
*/
|
|
337
|
-
'
|
|
338
|
-
parameters?: Parameters<Paths.
|
|
339
|
-
data?: Paths.
|
|
634
|
+
'putFlow'(
|
|
635
|
+
parameters?: Parameters<Paths.PutFlow.PathParameters> | null,
|
|
636
|
+
data?: Paths.PutFlow.RequestBody,
|
|
340
637
|
config?: AxiosRequestConfig
|
|
341
|
-
): OperationResponse<Paths.
|
|
638
|
+
): OperationResponse<Paths.PutFlow.Responses.$200>
|
|
342
639
|
/**
|
|
343
|
-
*
|
|
640
|
+
* deleteFlow - deleteFlow
|
|
344
641
|
*
|
|
345
|
-
* Update automation
|
|
642
|
+
* Update automation flow by id
|
|
346
643
|
*/
|
|
347
|
-
'
|
|
348
|
-
parameters?: Parameters<Paths.
|
|
644
|
+
'deleteFlow'(
|
|
645
|
+
parameters?: Parameters<Paths.DeleteFlow.PathParameters> | null,
|
|
349
646
|
data?: any,
|
|
350
647
|
config?: AxiosRequestConfig
|
|
351
|
-
): OperationResponse<Paths.
|
|
648
|
+
): OperationResponse<Paths.DeleteFlow.Responses.$200>
|
|
352
649
|
/**
|
|
353
650
|
* getExecutions - getExecutions
|
|
354
651
|
*
|
|
@@ -389,62 +686,72 @@ export interface OperationMethods {
|
|
|
389
686
|
data?: any,
|
|
390
687
|
config?: AxiosRequestConfig
|
|
391
688
|
): OperationResponse<Paths.CancelExecution.Responses.$200>
|
|
689
|
+
/**
|
|
690
|
+
* retriggerAction - retriggerAction
|
|
691
|
+
*
|
|
692
|
+
* Retrigger a specific automation execution action
|
|
693
|
+
*/
|
|
694
|
+
'retriggerAction'(
|
|
695
|
+
parameters?: Parameters<UnknownParamsObject> | null,
|
|
696
|
+
data?: any,
|
|
697
|
+
config?: AxiosRequestConfig
|
|
698
|
+
): OperationResponse<any>
|
|
392
699
|
}
|
|
393
700
|
|
|
394
701
|
export interface PathsDictionary {
|
|
395
|
-
['/v1/automation/
|
|
702
|
+
['/v1/automation/flows']: {
|
|
396
703
|
/**
|
|
397
|
-
*
|
|
704
|
+
* searchFlows - searchFlows
|
|
398
705
|
*
|
|
399
|
-
* Search available automation
|
|
706
|
+
* Search available automation flows
|
|
400
707
|
*/
|
|
401
708
|
'get'(
|
|
402
|
-
parameters?: Parameters<Paths.
|
|
709
|
+
parameters?: Parameters<Paths.SearchFlows.QueryParameters> | null,
|
|
403
710
|
data?: any,
|
|
404
711
|
config?: AxiosRequestConfig
|
|
405
|
-
): OperationResponse<Paths.
|
|
712
|
+
): OperationResponse<Paths.SearchFlows.Responses.$200>
|
|
406
713
|
/**
|
|
407
|
-
*
|
|
714
|
+
* createFlow - createFlow
|
|
408
715
|
*
|
|
409
|
-
* Create new automation
|
|
716
|
+
* Create new automation flow
|
|
410
717
|
*/
|
|
411
718
|
'post'(
|
|
412
719
|
parameters?: Parameters<UnknownParamsObject> | null,
|
|
413
|
-
data?: Paths.
|
|
720
|
+
data?: Paths.CreateFlow.RequestBody,
|
|
414
721
|
config?: AxiosRequestConfig
|
|
415
|
-
): OperationResponse<Paths.
|
|
722
|
+
): OperationResponse<Paths.CreateFlow.Responses.$201>
|
|
416
723
|
}
|
|
417
|
-
['/v1/automation/
|
|
724
|
+
['/v1/automation/flows/{flow_id}']: {
|
|
418
725
|
/**
|
|
419
|
-
*
|
|
726
|
+
* getFlow - getFlow
|
|
420
727
|
*
|
|
421
|
-
* List available automation
|
|
728
|
+
* List available automation flows
|
|
422
729
|
*/
|
|
423
730
|
'get'(
|
|
424
|
-
parameters?: Parameters<Paths.
|
|
731
|
+
parameters?: Parameters<Paths.GetFlow.PathParameters> | null,
|
|
425
732
|
data?: any,
|
|
426
733
|
config?: AxiosRequestConfig
|
|
427
|
-
): OperationResponse<Paths.
|
|
734
|
+
): OperationResponse<Paths.GetFlow.Responses.$200>
|
|
428
735
|
/**
|
|
429
|
-
*
|
|
736
|
+
* putFlow - putFlow
|
|
430
737
|
*
|
|
431
|
-
* Update automation
|
|
738
|
+
* Update automation flow by id
|
|
432
739
|
*/
|
|
433
740
|
'put'(
|
|
434
|
-
parameters?: Parameters<Paths.
|
|
435
|
-
data?: Paths.
|
|
741
|
+
parameters?: Parameters<Paths.PutFlow.PathParameters> | null,
|
|
742
|
+
data?: Paths.PutFlow.RequestBody,
|
|
436
743
|
config?: AxiosRequestConfig
|
|
437
|
-
): OperationResponse<Paths.
|
|
744
|
+
): OperationResponse<Paths.PutFlow.Responses.$200>
|
|
438
745
|
/**
|
|
439
|
-
*
|
|
746
|
+
* deleteFlow - deleteFlow
|
|
440
747
|
*
|
|
441
|
-
* Update automation
|
|
748
|
+
* Update automation flow by id
|
|
442
749
|
*/
|
|
443
750
|
'delete'(
|
|
444
|
-
parameters?: Parameters<Paths.
|
|
751
|
+
parameters?: Parameters<Paths.DeleteFlow.PathParameters> | null,
|
|
445
752
|
data?: any,
|
|
446
753
|
config?: AxiosRequestConfig
|
|
447
|
-
): OperationResponse<Paths.
|
|
754
|
+
): OperationResponse<Paths.DeleteFlow.Responses.$200>
|
|
448
755
|
}
|
|
449
756
|
['/v1/automation/executions']: {
|
|
450
757
|
/**
|
|
@@ -490,6 +797,18 @@ export interface PathsDictionary {
|
|
|
490
797
|
config?: AxiosRequestConfig
|
|
491
798
|
): OperationResponse<Paths.CancelExecution.Responses.$200>
|
|
492
799
|
}
|
|
800
|
+
['/v1/automation/executions/{execution_id}/{action_id}/retrigger']: {
|
|
801
|
+
/**
|
|
802
|
+
* retriggerAction - retriggerAction
|
|
803
|
+
*
|
|
804
|
+
* Retrigger a specific automation execution action
|
|
805
|
+
*/
|
|
806
|
+
'post'(
|
|
807
|
+
parameters?: Parameters<UnknownParamsObject> | null,
|
|
808
|
+
data?: any,
|
|
809
|
+
config?: AxiosRequestConfig
|
|
810
|
+
): OperationResponse<any>
|
|
811
|
+
}
|
|
493
812
|
}
|
|
494
813
|
|
|
495
814
|
export type Client = OpenAPIClient<OperationMethods, PathsDictionary>
|