@epilot/automation-client 1.2.0 → 1.2.2

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/src/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,601 +8,876 @@ 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_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
- }
35
- export interface AutomationAction {
36
- id?: AutomationActionId;
37
- name?: string;
38
- type?: string;
39
- config?: {
40
- [name: string]: any;
41
- };
42
- execution_status?: ExecutionStatus;
43
- started_at?: string;
44
- updated_at?: string;
45
- /**
46
- * Flag indicating whether the action was created automatically or manually
47
- */
48
- created_automatically?: boolean;
49
- outputs?: {
50
- [name: string]: any;
51
- };
52
- error_output?: ErrorOutput;
53
- }
54
- /**
55
- * example:
56
- * 9ec3711b-db63-449c-b894-54d5bb622a8f
57
- */
58
- export type AutomationActionId = string;
59
- export interface AutomationExecution {
60
- id: AutomationExecutionId;
61
- /**
62
- * example:
63
- * success
64
- */
65
- execution_status?: ExecutionStatus;
66
- entity_id: EntityId;
67
- org_id: OrganizationId;
68
- flow_id: AutomationFlowId;
69
- /**
70
- * example:
71
- * Handle contact form
72
- */
73
- flow_name?: string;
74
- created_at?: string; // date-time
75
- updated_at?: string; // date-time
76
- current_action_id?: AutomationActionId;
77
- actions: AnyAction[];
78
- }
79
- /**
80
- * example:
81
- * 9baf184f-bc81-4128-bca3-d974c90a12c4
82
- */
83
- export type AutomationExecutionId = string;
84
- export interface AutomationFlow {
85
- id?: AutomationFlowId;
86
- /**
87
- * example:
88
- * Handle contact form
89
- */
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[];
106
- created_at?: string; // date-time
107
- updated_at?: string; // date-time
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: {
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;
162
149
  /**
163
150
  * example:
164
- * 210738fe-e1e6-446e-aaef-cce462d7d813
151
+ * [
152
+ * {
153
+ * "step_name": "Lead Sales",
154
+ * "user_ids": [
155
+ * 10010729
156
+ * ]
157
+ * },
158
+ * {
159
+ * "step_name": "Operations",
160
+ * "user_ids": [
161
+ * 10010728,
162
+ * 10010729
163
+ * ]
164
+ * }
165
+ * ]
165
166
  */
166
- source_id?: string;
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
+ }
167
194
  /**
168
195
  * example:
169
- * submission
196
+ * 9ec3711b-db63-449c-b894-54d5bb622a8f
170
197
  */
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: {
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
+ }
184
239
  /**
185
240
  * example:
186
- * 99
241
+ * 9baf184f-bc81-4128-bca3-d974c90a12c4
187
242
  */
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
- };
200
- }
201
- /**
202
- * example:
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
- * }
257
- */
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
- }
310
- /**
311
- * example:
312
- * e3d3ebac-baab-4395-abf4-50b5bf1f8b74
313
- */
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[];
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
+ }
573
+ /**
574
+ * 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
+ * }
587
+ */
588
+ export interface TriggerWebhookAction {
589
+ id?: /**
590
+ * example:
591
+ * 9ec3711b-db63-449c-b894-54d5bb622a8f
592
+ */
593
+ AutomationActionId;
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
+ }
613
+ /**
614
+ * 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
+ * }
646
+ */
647
+ export interface TriggerWorkflowAction {
648
+ id?: /**
649
+ * example:
650
+ * 9ec3711b-db63-449c-b894-54d5bb622a8f
651
+ */
652
+ AutomationActionId;
653
+ name?: string;
654
+ type?: string;
655
+ config?: TriggerWorkflowConfig;
656
+ execution_status?: ExecutionStatus;
657
+ started_at?: string;
658
+ updated_at?: string;
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
+ }
668
+ /**
669
+ * example:
670
+ * {
671
+ * "source": "email",
672
+ * "comparison": "equals",
673
+ * "schema": "contact",
674
+ * "value": "test@epilot.cloud"
675
+ * }
676
+ */
677
+ export interface TriggerWorkflowCondition {
678
+ source: string;
679
+ comparison: Comparison;
680
+ value?: string | number | string[] | number[];
681
+ schema: string;
682
+ }
683
+ export interface TriggerWorkflowConfig {
684
+ target_workflow?: string;
685
+ conditions?: /**
686
+ * example:
687
+ * {
688
+ * "source": "email",
689
+ * "comparison": "equals",
690
+ * "schema": "contact",
691
+ * "value": "test@epilot.cloud"
692
+ * }
693
+ */
694
+ TriggerWorkflowCondition[];
695
+ assignees?: string[];
696
+ assign_steps?: /**
697
+ * example:
698
+ * [
699
+ * {
700
+ * "step_name": "Lead Sales",
701
+ * "user_ids": [
702
+ * 10010729
703
+ * ]
704
+ * },
705
+ * {
706
+ * "step_name": "Operations",
707
+ * "user_ids": [
708
+ * 10010728,
709
+ * 10010729
710
+ * ]
711
+ * }
712
+ * ]
713
+ */
714
+ AssignUsersToStep[];
715
+ }
484
716
  }
485
- }
486
717
  }
487
718
  declare namespace Paths {
488
- namespace CancelExecution {
489
- namespace Parameters {
490
- export type ExecutionId = Components.Schemas.AutomationExecutionId;
719
+ namespace CancelExecution {
720
+ namespace Parameters {
721
+ export type ExecutionId = /**
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
+ }
491
733
  }
492
- export interface PathParameters {
493
- execution_id: Parameters.ExecutionId;
734
+ namespace CreateFlow {
735
+ export type RequestBody = Components.Schemas.AutomationFlow;
736
+ namespace Responses {
737
+ export type $201 = Components.Schemas.AutomationFlow;
738
+ }
494
739
  }
495
- namespace Responses {
496
- export type $200 = Components.Schemas.AutomationExecution;
740
+ namespace DeleteFlow {
741
+ namespace Parameters {
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
+ }
497
754
  }
498
- }
499
- namespace CreateFlow {
500
- export type RequestBody = Components.Schemas.AutomationFlow;
501
- namespace Responses {
502
- export type $201 = Components.Schemas.AutomationFlow;
503
- }
504
- }
505
- namespace DeleteFlow {
506
- namespace Parameters {
507
- export type FlowId = Components.Schemas.AutomationFlowId;
755
+ namespace GetExecution {
756
+ namespace Parameters {
757
+ export type ExecutionId = /**
758
+ * example:
759
+ * 9baf184f-bc81-4128-bca3-d974c90a12c4
760
+ */
761
+ Components.Schemas.AutomationExecutionId;
762
+ }
763
+ export interface PathParameters {
764
+ execution_id: Parameters.ExecutionId;
765
+ }
766
+ namespace Responses {
767
+ export type $200 = Components.Schemas.AutomationExecution;
768
+ }
508
769
  }
509
- export interface PathParameters {
510
- flow_id: Parameters.FlowId;
770
+ namespace GetExecutions {
771
+ namespace Parameters {
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
+ }
511
788
  }
512
- namespace Responses {
513
- export type $200 = Components.Schemas.AutomationFlow;
789
+ namespace GetFlow {
790
+ namespace Parameters {
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
+ }
514
803
  }
515
- }
516
- namespace GetExecution {
517
- namespace Parameters {
518
- export type ExecutionId = Components.Schemas.AutomationExecutionId;
804
+ namespace PutFlow {
805
+ namespace Parameters {
806
+ export type FlowId = /**
807
+ * example:
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
+ }
519
819
  }
520
- export interface PathParameters {
521
- execution_id: Parameters.ExecutionId;
522
- }
523
- namespace Responses {
524
- export type $200 = Components.Schemas.AutomationExecution;
525
- }
526
- }
527
- namespace GetExecutions {
528
- namespace Parameters {
529
- export type EntityId = Components.Schemas.EntityId;
530
- export type From = number;
531
- export type Size = number;
532
- }
533
- export interface QueryParameters {
534
- entity_id?: Parameters.EntityId;
535
- size?: Parameters.Size;
536
- from?: Parameters.From;
537
- }
538
- namespace Responses {
539
- export type $200 = Components.Schemas.GetExecutionsResp;
540
- }
541
- }
542
- namespace GetFlow {
543
- namespace Parameters {
544
- export type FlowId = Components.Schemas.AutomationFlowId;
820
+ namespace RetriggerAction {
821
+ namespace Parameters {
822
+ export type ActionId = /**
823
+ * example:
824
+ * 9ec3711b-db63-449c-b894-54d5bb622a8f
825
+ */
826
+ Components.Schemas.AutomationActionId;
827
+ export type ExecutionId = /**
828
+ * example:
829
+ * 9baf184f-bc81-4128-bca3-d974c90a12c4
830
+ */
831
+ Components.Schemas.AutomationExecutionId;
832
+ }
833
+ export interface PathParameters {
834
+ execution_id: Parameters.ExecutionId;
835
+ action_id: Parameters.ActionId;
836
+ }
837
+ namespace Responses {
838
+ export interface $200 {
839
+ }
840
+ }
545
841
  }
546
- export interface PathParameters {
547
- flow_id: Parameters.FlowId;
842
+ namespace SearchFlows {
843
+ namespace Parameters {
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
+ }
548
874
  }
549
- namespace Responses {
550
- export type $200 = Components.Schemas.AutomationFlow;
875
+ namespace StartExecution {
876
+ export type RequestBody = Components.Schemas.StartExecutionRequest;
877
+ namespace Responses {
878
+ export type $201 = Components.Schemas.AutomationExecution;
879
+ }
551
880
  }
552
- }
553
- namespace PutFlow {
554
- namespace Parameters {
555
- export type FlowId = Components.Schemas.AutomationFlowId;
556
- }
557
- export interface PathParameters {
558
- flow_id: Parameters.FlowId;
559
- }
560
- export type RequestBody = Components.Schemas.AutomationFlow;
561
- namespace Responses {
562
- export type $200 = Components.Schemas.AutomationFlow;
563
- }
564
- }
565
- namespace RetriggerAction {
566
- namespace Parameters {
567
- export type ActionId = Components.Schemas.AutomationActionId;
568
- export type ExecutionId = Components.Schemas.AutomationExecutionId;
569
- }
570
- export interface PathParameters {
571
- execution_id: Parameters.ExecutionId;
572
- action_id: Parameters.ActionId;
573
- }
574
- }
575
- namespace SearchFlows {
576
- namespace Parameters {
577
- export type From = number;
578
- /**
579
- * example:
580
- * submission
581
- */
582
- export type Schema = string;
583
- export type Size = number;
584
- /**
585
- * example:
586
- * 600945fe-212e-4b97-acf7-391d64648384
587
- */
588
- export type TriggerSourceId = string;
589
- }
590
- export interface QueryParameters {
591
- schema?: Parameters.Schema;
592
- size?: Parameters.Size;
593
- from?: Parameters.From;
594
- trigger_source_id?: Parameters.TriggerSourceId;
595
- }
596
- namespace Responses {
597
- export type $200 = Components.Schemas.SearchAutomationsResp;
598
- }
599
- }
600
- namespace StartExecution {
601
- export type RequestBody = Components.Schemas.StartExecutionRequest;
602
- namespace Responses {
603
- export type $201 = Components.Schemas.AutomationExecution;
604
- }
605
- }
606
881
  }
607
882
 
608
883
  export interface OperationMethods {
@@ -705,7 +980,7 @@ export interface OperationMethods {
705
980
  parameters?: Parameters<Paths.RetriggerAction.PathParameters> | null,
706
981
  data?: any,
707
982
  config?: AxiosRequestConfig
708
- ): OperationResponse<any>
983
+ ): OperationResponse<Paths.RetriggerAction.Responses.$200>
709
984
  }
710
985
 
711
986
  export interface PathsDictionary {
@@ -817,7 +1092,7 @@ export interface PathsDictionary {
817
1092
  parameters?: Parameters<Paths.RetriggerAction.PathParameters> | null,
818
1093
  data?: any,
819
1094
  config?: AxiosRequestConfig
820
- ): OperationResponse<any>
1095
+ ): OperationResponse<Paths.RetriggerAction.Responses.$200>
821
1096
  }
822
1097
  }
823
1098