@epilot/automation-client 0.4.2 → 0.5.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/openapi.d.ts +0 -522
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/automation-client",
3
- "version": "0.4.2",
3
+ "version": "0.5.0",
4
4
  "description": "API Client for epilot automation API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/openapi.d.ts DELETED
@@ -1,522 +0,0 @@
1
- /* eslint-disable */
2
- import {
3
- OpenAPIClient,
4
- Parameters,
5
- UnknownParamsObject,
6
- OperationResponse,
7
- AxiosRequestConfig,
8
- } from 'openapi-client-axios';
9
-
10
- declare namespace Components {
11
- namespace Schemas {
12
- export interface AutomationAction {
13
- id?: AutomationActionId;
14
- /**
15
- * example:
16
- * Create Contact
17
- */
18
- name?: string;
19
- /**
20
- * example:
21
- * entity_mapping
22
- */
23
- type?: string;
24
- /**
25
- * example:
26
- * {
27
- * "target_schema": "contact",
28
- * "mapping_attributes": [
29
- * {
30
- * "target": "email",
31
- * "mode": "upsert_match",
32
- * "source": "billing_contact.email"
33
- * },
34
- * {
35
- * "target": "first_name",
36
- * "mode": "copy_if_exists",
37
- * "source": "billing_contact.first_name"
38
- * },
39
- * {
40
- * "target": "last_name",
41
- * "mode": "copy_if_exists",
42
- * "source": "billing_contact.last_name"
43
- * },
44
- * {
45
- * "target": "addresses",
46
- * "mode": "append_if_exists",
47
- * "source": "billing_contact",
48
- * "value_json": "{\n \"street_name\": \"{{billing_contact.street_name}}\",\n \"street_number\": \"{{billing_contact.street_number}}\",\n \"city\": \"{{billing_contact.city}}\",\n \"postal_code\": \"{{billing_contact.postal_code}}\",\n \"country\": \"{{billing_contact.country}}\",\n}"
49
- * },
50
- * {
51
- * "target": "addresses",
52
- * "mode": "append_if_exists",
53
- * "source": "delivery_contact",
54
- * "value_json": "{\n \"street_name\": \"{{delivery_contact.street_name}}\",\n \"street_number\": \"{{delivery_contact.street_number}}\",\n \"city\": \"{{delivery_contact.city}}\",\n \"postal_code\": \"{{delivery_contact.postal_code}}\",\n \"country\": \"{{delivery_contact.country}}\",\n}"
55
- * }
56
- * ]
57
- * }
58
- */
59
- config?: {
60
- [name: string]: any;
61
- };
62
- }
63
- /**
64
- * example:
65
- * 9ec3711b-db63-449c-b894-54d5bb622a8f
66
- */
67
- export type AutomationActionId = string;
68
- export interface AutomationExecution {
69
- id?: AutomationExecutionId;
70
- /**
71
- * example:
72
- * success
73
- */
74
- status?: "pending" | "in_progress" | "success" | "failed" | "cancelled";
75
- entity_id?: EntityId;
76
- flow_id?: AutomationFlowId;
77
- /**
78
- * example:
79
- * Handle contact form
80
- */
81
- flow_name?: string;
82
- created_at?: string; // date-time
83
- updated_at?: string; // date-time
84
- current_action_id?: AutomationActionId;
85
- actions?: {
86
- status?: "pending" | "in_progress" | "success" | "failed";
87
- started_at?: string; // date-time
88
- updated_at?: string; // date-time
89
- /**
90
- * example:
91
- * {
92
- * "affected_entities": "cbbf0e83-0f37-4a0c-9801-93877ec0b2c2"
93
- * }
94
- */
95
- outputs?: {
96
- [name: string]: any;
97
- };
98
- /**
99
- * example:
100
- * {
101
- * "email": "$.contact.email",
102
- * "name": "$.contact.name",
103
- * "template_id": "6a5b1249-4093-4724-b25a-ae985f7877d6"
104
- * }
105
- */
106
- inputs?: {
107
- [name: string]: any;
108
- };
109
- id?: AutomationActionId;
110
- /**
111
- * example:
112
- * Create Contact
113
- */
114
- name?: string;
115
- /**
116
- * example:
117
- * entity_mapping
118
- */
119
- type?: string;
120
- /**
121
- * example:
122
- * {
123
- * "target_schema": "contact",
124
- * "mapping_attributes": [
125
- * {
126
- * "target": "email",
127
- * "mode": "upsert_match",
128
- * "source": "billing_contact.email"
129
- * },
130
- * {
131
- * "target": "first_name",
132
- * "mode": "copy_if_exists",
133
- * "source": "billing_contact.first_name"
134
- * },
135
- * {
136
- * "target": "last_name",
137
- * "mode": "copy_if_exists",
138
- * "source": "billing_contact.last_name"
139
- * },
140
- * {
141
- * "target": "addresses",
142
- * "mode": "append_if_exists",
143
- * "source": "billing_contact",
144
- * "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}"
145
- * },
146
- * {
147
- * "target": "addresses",
148
- * "mode": "append_if_exists",
149
- * "source": "delivery_contact",
150
- * "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}"
151
- * }
152
- * ]
153
- * }
154
- */
155
- config?: {
156
- [name: string]: any;
157
- };
158
- }[];
159
- }
160
- /**
161
- * example:
162
- * 9baf184f-bc81-4128-bca3-d974c90a12c4
163
- */
164
- export type AutomationExecutionId = string;
165
- export interface AutomationFlow {
166
- id?: AutomationFlowId;
167
- /**
168
- * example:
169
- * Handle contact form
170
- */
171
- flow_name?: string;
172
- triggers?: {
173
- on: "entity_create" | "entity_update" | "entity_delete" | "journey_submit" | "frontend_submit";
174
- /**
175
- * example:
176
- * {
177
- * "entity_schema": "contact"
178
- * }
179
- */
180
- config: {
181
- [name: string]: any;
182
- };
183
- }[];
184
- /**
185
- * List of conditions to be met for the automation to be triggered
186
- */
187
- trigger_conditions?: {
188
- source?: string;
189
- comparison?: "not_empty" | "is_empty" | "contains" | "equals";
190
- }[];
191
- /**
192
- * The entity schema
193
- * example:
194
- * submission
195
- */
196
- entity?: AutomationFlowId;
197
- actions?: AutomationAction[];
198
- created_at?: string; // date-time
199
- updated_at?: string; // date-time
200
- }
201
- /**
202
- * example:
203
- * 7791b04a-16d2-44a2-9af9-2d59c25c512f
204
- */
205
- export type AutomationFlowId = string;
206
- /**
207
- * example:
208
- * e3d3ebac-baab-4395-abf4-50b5bf1f8b74
209
- */
210
- export type EntityId = string;
211
- }
212
- }
213
- declare namespace Paths {
214
- namespace CancelExecution {
215
- namespace Parameters {
216
- export type ExecutionId = Components.Schemas.AutomationExecutionId;
217
- }
218
- export interface PathParameters {
219
- execution_id: Parameters.ExecutionId;
220
- }
221
- namespace Responses {
222
- export type $200 = Components.Schemas.AutomationExecution;
223
- }
224
- }
225
- namespace CreateFlow {
226
- export type RequestBody = Components.Schemas.AutomationFlow;
227
- namespace Responses {
228
- export type $201 = Components.Schemas.AutomationFlow;
229
- }
230
- }
231
- namespace DeleteFlow {
232
- namespace Parameters {
233
- export type FlowId = Components.Schemas.AutomationFlowId;
234
- }
235
- export interface PathParameters {
236
- flow_id: Parameters.FlowId;
237
- }
238
- namespace Responses {
239
- export type $200 = Components.Schemas.AutomationFlow;
240
- }
241
- }
242
- namespace GetExecution {
243
- namespace Parameters {
244
- export type ExecutionId = Components.Schemas.AutomationExecutionId;
245
- }
246
- export interface PathParameters {
247
- execution_id: Parameters.ExecutionId;
248
- }
249
- namespace Responses {
250
- export type $200 = Components.Schemas.AutomationExecution;
251
- }
252
- }
253
- namespace GetExecutions {
254
- namespace Parameters {
255
- export type EntityId = Components.Schemas.EntityId;
256
- export type From = number;
257
- export type Size = number;
258
- }
259
- export interface QueryParameters {
260
- entity_id?: Parameters.EntityId;
261
- size?: Parameters.Size;
262
- from?: Parameters.From;
263
- }
264
- namespace Responses {
265
- export type $200 = Components.Schemas.AutomationExecution[];
266
- }
267
- }
268
- namespace GetFlow {
269
- namespace Parameters {
270
- export type FlowId = Components.Schemas.AutomationFlowId;
271
- }
272
- export interface PathParameters {
273
- flow_id: Parameters.FlowId;
274
- }
275
- namespace Responses {
276
- export type $200 = Components.Schemas.AutomationFlow;
277
- }
278
- }
279
- namespace PutFlow {
280
- namespace Parameters {
281
- export type FlowId = Components.Schemas.AutomationFlowId;
282
- }
283
- export interface PathParameters {
284
- flow_id: Parameters.FlowId;
285
- }
286
- export type RequestBody = Components.Schemas.AutomationFlow;
287
- namespace Responses {
288
- export type $201 = Components.Schemas.AutomationFlow;
289
- }
290
- }
291
- namespace SearchFlows {
292
- namespace Parameters {
293
- export type From = number;
294
- /**
295
- * example:
296
- * submission
297
- */
298
- export type Schema = string;
299
- export type Size = number;
300
- }
301
- export interface QueryParameters {
302
- schema?: Parameters.Schema;
303
- size?: Parameters.Size;
304
- from?: Parameters.From;
305
- }
306
- namespace Responses {
307
- export interface $200 {
308
- /**
309
- * example:
310
- * 1
311
- */
312
- total?: number;
313
- results?: Components.Schemas.AutomationFlow[];
314
- }
315
- }
316
- }
317
- namespace StartExecution {
318
- export interface RequestBody {
319
- entity_id?: Components.Schemas.EntityId;
320
- flow_id?: Components.Schemas.AutomationFlowId;
321
- }
322
- namespace Responses {
323
- export type $201 = Components.Schemas.AutomationExecution;
324
- }
325
- }
326
- }
327
-
328
- export interface OperationMethods {
329
- /**
330
- * searchFlows - searchFlows
331
- *
332
- * Search available automation flows
333
- */
334
- 'searchFlows'(
335
- parameters?: Parameters<Paths.SearchFlows.QueryParameters> | null,
336
- data?: any,
337
- config?: AxiosRequestConfig
338
- ): OperationResponse<Paths.SearchFlows.Responses.$200>
339
- /**
340
- * createFlow - createFlow
341
- *
342
- * Create new automation flow
343
- */
344
- 'createFlow'(
345
- parameters?: Parameters<UnknownParamsObject> | null,
346
- data?: Paths.CreateFlow.RequestBody,
347
- config?: AxiosRequestConfig
348
- ): OperationResponse<Paths.CreateFlow.Responses.$201>
349
- /**
350
- * getFlow - getFlow
351
- *
352
- * List available automation flows
353
- */
354
- 'getFlow'(
355
- parameters?: Parameters<Paths.GetFlow.PathParameters> | null,
356
- data?: any,
357
- config?: AxiosRequestConfig
358
- ): OperationResponse<Paths.GetFlow.Responses.$200>
359
- /**
360
- * putFlow - putFlow
361
- *
362
- * Update automation flow by id
363
- */
364
- 'putFlow'(
365
- parameters?: Parameters<Paths.PutFlow.PathParameters> | null,
366
- data?: Paths.PutFlow.RequestBody,
367
- config?: AxiosRequestConfig
368
- ): OperationResponse<Paths.PutFlow.Responses.$201>
369
- /**
370
- * deleteFlow - deleteFlow
371
- *
372
- * Update automation flow by id
373
- */
374
- 'deleteFlow'(
375
- parameters?: Parameters<Paths.DeleteFlow.PathParameters> | null,
376
- data?: any,
377
- config?: AxiosRequestConfig
378
- ): OperationResponse<Paths.DeleteFlow.Responses.$200>
379
- /**
380
- * getExecutions - getExecutions
381
- *
382
- * List automation executions
383
- */
384
- 'getExecutions'(
385
- parameters?: Parameters<Paths.GetExecutions.QueryParameters> | null,
386
- data?: any,
387
- config?: AxiosRequestConfig
388
- ): OperationResponse<Paths.GetExecutions.Responses.$200>
389
- /**
390
- * startExecution - startExecution
391
- *
392
- * Start new automation execution
393
- */
394
- 'startExecution'(
395
- parameters?: Parameters<UnknownParamsObject> | null,
396
- data?: Paths.StartExecution.RequestBody,
397
- config?: AxiosRequestConfig
398
- ): OperationResponse<Paths.StartExecution.Responses.$201>
399
- /**
400
- * getExecution - getExecution
401
- *
402
- * Get automation execution
403
- */
404
- 'getExecution'(
405
- parameters?: Parameters<Paths.GetExecution.PathParameters> | null,
406
- data?: any,
407
- config?: AxiosRequestConfig
408
- ): OperationResponse<Paths.GetExecution.Responses.$200>
409
- /**
410
- * cancelExecution - cancelExecution
411
- *
412
- * Cancel automation execution
413
- */
414
- 'cancelExecution'(
415
- parameters?: Parameters<Paths.CancelExecution.PathParameters> | null,
416
- data?: any,
417
- config?: AxiosRequestConfig
418
- ): OperationResponse<Paths.CancelExecution.Responses.$200>
419
- }
420
-
421
- export interface PathsDictionary {
422
- ['/v1/automation/flows']: {
423
- /**
424
- * searchFlows - searchFlows
425
- *
426
- * Search available automation flows
427
- */
428
- 'get'(
429
- parameters?: Parameters<Paths.SearchFlows.QueryParameters> | null,
430
- data?: any,
431
- config?: AxiosRequestConfig
432
- ): OperationResponse<Paths.SearchFlows.Responses.$200>
433
- /**
434
- * createFlow - createFlow
435
- *
436
- * Create new automation flow
437
- */
438
- 'post'(
439
- parameters?: Parameters<UnknownParamsObject> | null,
440
- data?: Paths.CreateFlow.RequestBody,
441
- config?: AxiosRequestConfig
442
- ): OperationResponse<Paths.CreateFlow.Responses.$201>
443
- }
444
- ['/v1/automation/flows/{flow_id}']: {
445
- /**
446
- * getFlow - getFlow
447
- *
448
- * List available automation flows
449
- */
450
- 'get'(
451
- parameters?: Parameters<Paths.GetFlow.PathParameters> | null,
452
- data?: any,
453
- config?: AxiosRequestConfig
454
- ): OperationResponse<Paths.GetFlow.Responses.$200>
455
- /**
456
- * putFlow - putFlow
457
- *
458
- * Update automation flow by id
459
- */
460
- 'put'(
461
- parameters?: Parameters<Paths.PutFlow.PathParameters> | null,
462
- data?: Paths.PutFlow.RequestBody,
463
- config?: AxiosRequestConfig
464
- ): OperationResponse<Paths.PutFlow.Responses.$201>
465
- /**
466
- * deleteFlow - deleteFlow
467
- *
468
- * Update automation flow by id
469
- */
470
- 'delete'(
471
- parameters?: Parameters<Paths.DeleteFlow.PathParameters> | null,
472
- data?: any,
473
- config?: AxiosRequestConfig
474
- ): OperationResponse<Paths.DeleteFlow.Responses.$200>
475
- }
476
- ['/v1/automation/executions']: {
477
- /**
478
- * getExecutions - getExecutions
479
- *
480
- * List automation executions
481
- */
482
- 'get'(
483
- parameters?: Parameters<Paths.GetExecutions.QueryParameters> | null,
484
- data?: any,
485
- config?: AxiosRequestConfig
486
- ): OperationResponse<Paths.GetExecutions.Responses.$200>
487
- /**
488
- * startExecution - startExecution
489
- *
490
- * Start new automation execution
491
- */
492
- 'post'(
493
- parameters?: Parameters<UnknownParamsObject> | null,
494
- data?: Paths.StartExecution.RequestBody,
495
- config?: AxiosRequestConfig
496
- ): OperationResponse<Paths.StartExecution.Responses.$201>
497
- }
498
- ['/v1/automation/executions/{execution_id}']: {
499
- /**
500
- * getExecution - getExecution
501
- *
502
- * Get automation execution
503
- */
504
- 'get'(
505
- parameters?: Parameters<Paths.GetExecution.PathParameters> | null,
506
- data?: any,
507
- config?: AxiosRequestConfig
508
- ): OperationResponse<Paths.GetExecution.Responses.$200>
509
- /**
510
- * cancelExecution - cancelExecution
511
- *
512
- * Cancel automation execution
513
- */
514
- 'delete'(
515
- parameters?: Parameters<Paths.CancelExecution.PathParameters> | null,
516
- data?: any,
517
- config?: AxiosRequestConfig
518
- ): OperationResponse<Paths.CancelExecution.Responses.$200>
519
- }
520
- }
521
-
522
- export type Client = OpenAPIClient<OperationMethods, PathsDictionary>