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