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