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