@epilot/automation-client 2.26.0 → 2.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/openapi.d.ts CHANGED
@@ -126,7 +126,7 @@ declare namespace Components {
126
126
  types?: (("CreateMeterReading" | "UpdateMeterReading" | "DocDownloadedFromPortal" | "PortalUserResetPassword" | "PortalUserResetForgotPassword" | "SelfAssignmentFromPortal") | string)[];
127
127
  };
128
128
  }
129
- export type AnyAction = MapEntityAction | TriggerWorkflowAction | TriggerShareEntityAction | TriggerWebhookAction | InformERPAction | CreateDocumentAction | SendEmailAction | /* Creates an order entity with prices from journey */ CartCheckoutAction | CustomAction | AutomationAction | FlowExecutionCancelAction;
129
+ export type AnyAction = MapEntityAction | TriggerWorkflowAction | TriggerShareEntityAction | TriggerWebhookAction | InformERPAction | TriggerEventAction | CreateDocumentAction | SendEmailAction | /* Creates an order entity with prices from journey */ CartCheckoutAction | CustomAction | AutomationAction | FlowExecutionCancelAction;
130
130
  export type AnyActionConfig = /**
131
131
  * example:
132
132
  * {
@@ -312,6 +312,20 @@ declare namespace Components {
312
312
  * }
313
313
  */
314
314
  InformERPActionConfig | /**
315
+ * example:
316
+ * {
317
+ * "id": "2520gja-2sgmsaga-0asg-822jgal",
318
+ * "name": "Trigger Event",
319
+ * "type": "trigger-event",
320
+ * "config": {
321
+ * "event_name": "my_custom_event",
322
+ * "event_inputs": {
323
+ * "key": "value"
324
+ * }
325
+ * }
326
+ * }
327
+ */
328
+ TriggerEventActionConfig | /**
315
329
  * example:
316
330
  * {
317
331
  * "id": "08g988-ojt2jtaga-292h-8978gsaga",
@@ -479,7 +493,7 @@ declare namespace Components {
479
493
  * ```
480
494
  *
481
495
  */
482
- EntityOperationTrigger | ActivityTrigger | EntityManualTrigger | ReceivedEmailTrigger | FlowsTrigger;
496
+ EntityOperationTrigger | ActivityTrigger | EntityManualTrigger | ReceivedEmailTrigger | NewEmailThreadTrigger | FlowsTrigger;
483
497
  export interface AnythingButCondition {
484
498
  "anything-but"?: string[];
485
499
  }
@@ -806,7 +820,7 @@ declare namespace Components {
806
820
  * 2
807
821
  */
808
822
  version?: number;
809
- trigger_event?: TriggerEventManual | TriggerEventEntityActivity | TriggerEventEntityOperation | TriggerEventFlowAutomationTask;
823
+ trigger_event?: TriggerEventManual | TriggerEventEntityActivity | TriggerEventEntityOperation | TriggerEventFlowAutomationTask | TriggerEventMessaging;
810
824
  workflow_context?: WorkflowExecutionContext;
811
825
  }
812
826
  /**
@@ -2785,6 +2799,17 @@ declare namespace Components {
2785
2799
  */
2786
2800
  target_inbox_id?: string;
2787
2801
  }
2802
+ export interface NewEmailThreadTrigger {
2803
+ /**
2804
+ * example:
2805
+ * 12d4f45a-1883-4841-a94c-5928cb338a94
2806
+ */
2807
+ id?: string; // uuid
2808
+ type: "new_email_thread";
2809
+ configuration: {
2810
+ direction?: "INBOUND" | "OUTBOUND" | "BOTH";
2811
+ };
2812
+ }
2788
2813
  export interface NumericCondition {
2789
2814
  numeric?: (string | number)[];
2790
2815
  }
@@ -3182,6 +3207,145 @@ declare namespace Components {
3182
3207
  export interface TriggerContext {
3183
3208
  [name: string]: string;
3184
3209
  }
3210
+ export interface TriggerEventAction {
3211
+ id?: /**
3212
+ * example:
3213
+ * 9ec3711b-db63-449c-b894-54d5bb622a8f
3214
+ */
3215
+ AutomationActionId;
3216
+ flow_action_id?: /**
3217
+ * example:
3218
+ * 9ec3711b-db63-449c-b894-54d5bb622a8f
3219
+ */
3220
+ AutomationActionId;
3221
+ name?: string;
3222
+ type?: "trigger-event";
3223
+ config?: /* Configuration for triggering an event catalog event */ TriggerEventConfig;
3224
+ /**
3225
+ * Whether to stop execution in a failed state if this action fails
3226
+ */
3227
+ allow_failure?: boolean;
3228
+ /**
3229
+ * Flag indicating whether the action was created automatically or manually
3230
+ */
3231
+ created_automatically?: boolean;
3232
+ /**
3233
+ * Flag indicating whether the same action can be in bulk in a single execution. e.g; send-email / map-entity
3234
+ */
3235
+ is_bulk_action?: boolean;
3236
+ reason?: {
3237
+ /**
3238
+ * Why the action has to be skipped/failed
3239
+ * example:
3240
+ * There are no registered portal users for the given emails, hence skipping the action
3241
+ */
3242
+ message?: string;
3243
+ /**
3244
+ * Extra metadata about the skipping reason - such as a certain condition not met, etc.
3245
+ */
3246
+ payload?: {
3247
+ [name: string]: any;
3248
+ };
3249
+ };
3250
+ /**
3251
+ * Condition Id to be checked before executing the action
3252
+ */
3253
+ condition_id?: string;
3254
+ /**
3255
+ * Schedule Id which indicates the schedule of the action
3256
+ */
3257
+ schedule_id?: string;
3258
+ execution_status?: ExecutionStatus;
3259
+ started_at?: string;
3260
+ updated_at?: string;
3261
+ /**
3262
+ * example:
3263
+ * {}
3264
+ */
3265
+ outputs?: {
3266
+ [name: string]: any;
3267
+ };
3268
+ error_output?: ErrorOutput;
3269
+ retry_strategy?: /* different behaviors for retrying failed execution actions. */ RetryStrategy;
3270
+ }
3271
+ /**
3272
+ * example:
3273
+ * {
3274
+ * "id": "2520gja-2sgmsaga-0asg-822jgal",
3275
+ * "name": "Trigger Event",
3276
+ * "type": "trigger-event",
3277
+ * "config": {
3278
+ * "event_name": "my_custom_event",
3279
+ * "event_inputs": {
3280
+ * "key": "value"
3281
+ * }
3282
+ * }
3283
+ * }
3284
+ */
3285
+ export interface TriggerEventActionConfig {
3286
+ id?: /**
3287
+ * example:
3288
+ * 9ec3711b-db63-449c-b894-54d5bb622a8f
3289
+ */
3290
+ AutomationActionId;
3291
+ flow_action_id?: /**
3292
+ * example:
3293
+ * 9ec3711b-db63-449c-b894-54d5bb622a8f
3294
+ */
3295
+ AutomationActionId;
3296
+ name?: string;
3297
+ type?: "trigger-event";
3298
+ config?: /* Configuration for triggering an event catalog event */ TriggerEventConfig;
3299
+ /**
3300
+ * Whether to stop execution in a failed state if this action fails
3301
+ */
3302
+ allow_failure?: boolean;
3303
+ /**
3304
+ * Flag indicating whether the action was created automatically or manually
3305
+ */
3306
+ created_automatically?: boolean;
3307
+ /**
3308
+ * Flag indicating whether the same action can be in bulk in a single execution. e.g; send-email / map-entity
3309
+ */
3310
+ is_bulk_action?: boolean;
3311
+ reason?: {
3312
+ /**
3313
+ * Why the action has to be skipped/failed
3314
+ * example:
3315
+ * There are no registered portal users for the given emails, hence skipping the action
3316
+ */
3317
+ message?: string;
3318
+ /**
3319
+ * Extra metadata about the skipping reason - such as a certain condition not met, etc.
3320
+ */
3321
+ payload?: {
3322
+ [name: string]: any;
3323
+ };
3324
+ };
3325
+ /**
3326
+ * Condition Id to be checked before executing the action
3327
+ */
3328
+ condition_id?: string;
3329
+ /**
3330
+ * Schedule Id which indicates the schedule of the action
3331
+ */
3332
+ schedule_id?: string;
3333
+ }
3334
+ /**
3335
+ * Configuration for triggering an event catalog event
3336
+ */
3337
+ export interface TriggerEventConfig {
3338
+ /**
3339
+ * The event catalog event name to trigger
3340
+ */
3341
+ event_name: string;
3342
+ /**
3343
+ * Inputs to be passed to trigger the event
3344
+ */
3345
+ event_inputs?: {
3346
+ [name: string]: any;
3347
+ };
3348
+ }
3185
3349
  export interface TriggerEventEntityActivity {
3186
3350
  type?: "entity_activity";
3187
3351
  /**
@@ -3258,6 +3422,21 @@ declare namespace Components {
3258
3422
  EntityId;
3259
3423
  caller?: ApiCallerContext;
3260
3424
  }
3425
+ export interface TriggerEventMessaging {
3426
+ type?: "new_email_thread";
3427
+ /**
3428
+ * example:
3429
+ * 123
3430
+ */
3431
+ org_id: string;
3432
+ thread_id: string;
3433
+ message_id: string;
3434
+ entity_id: /**
3435
+ * example:
3436
+ * e3d3ebac-baab-4395-abf4-50b5bf1f8b74
3437
+ */
3438
+ EntityId;
3439
+ }
3261
3440
  export interface TriggerShareEntityAction {
3262
3441
  id?: /**
3263
3442
  * example:
@@ -4611,6 +4790,7 @@ export type MappingAttributeV2 = Components.Schemas.MappingAttributeV2;
4611
4790
  export type MappingConfigRef = Components.Schemas.MappingConfigRef;
4612
4791
  export type MoveThreadAction = Components.Schemas.MoveThreadAction;
4613
4792
  export type MoveThreadConfig = Components.Schemas.MoveThreadConfig;
4793
+ export type NewEmailThreadTrigger = Components.Schemas.NewEmailThreadTrigger;
4614
4794
  export type NumericCondition = Components.Schemas.NumericCondition;
4615
4795
  export type OperationNode = Components.Schemas.OperationNode;
4616
4796
  export type OperationObjectNode = Components.Schemas.OperationObjectNode;
@@ -4637,10 +4817,14 @@ export type StartExecutionRequest = Components.Schemas.StartExecutionRequest;
4637
4817
  export type SuffixCondition = Components.Schemas.SuffixCondition;
4638
4818
  export type TriggerCondition = Components.Schemas.TriggerCondition;
4639
4819
  export type TriggerContext = Components.Schemas.TriggerContext;
4820
+ export type TriggerEventAction = Components.Schemas.TriggerEventAction;
4821
+ export type TriggerEventActionConfig = Components.Schemas.TriggerEventActionConfig;
4822
+ export type TriggerEventConfig = Components.Schemas.TriggerEventConfig;
4640
4823
  export type TriggerEventEntityActivity = Components.Schemas.TriggerEventEntityActivity;
4641
4824
  export type TriggerEventEntityOperation = Components.Schemas.TriggerEventEntityOperation;
4642
4825
  export type TriggerEventFlowAutomationTask = Components.Schemas.TriggerEventFlowAutomationTask;
4643
4826
  export type TriggerEventManual = Components.Schemas.TriggerEventManual;
4827
+ export type TriggerEventMessaging = Components.Schemas.TriggerEventMessaging;
4644
4828
  export type TriggerShareEntityAction = Components.Schemas.TriggerShareEntityAction;
4645
4829
  export type TriggerShareEntityActionConfig = Components.Schemas.TriggerShareEntityActionConfig;
4646
4830
  export type TriggerShareEntityConfig = Components.Schemas.TriggerShareEntityConfig;
package/dist/openapi.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "info": {
4
4
  "title": "Automation API",
5
5
  "description": "API Backend for epilot Automation Workflows feature",
6
- "version": "1.0.0"
6
+ "version": "1.2.0"
7
7
  },
8
8
  "tags": [
9
9
  {
@@ -1214,6 +1214,9 @@
1214
1214
  {
1215
1215
  "$ref": "#/components/schemas/ReceivedEmailTrigger"
1216
1216
  },
1217
+ {
1218
+ "$ref": "#/components/schemas/NewEmailThreadTrigger"
1219
+ },
1217
1220
  {
1218
1221
  "$ref": "#/components/schemas/FlowsTrigger"
1219
1222
  }
@@ -1236,6 +1239,9 @@
1236
1239
  {
1237
1240
  "$ref": "#/components/schemas/InformERPAction"
1238
1241
  },
1242
+ {
1243
+ "$ref": "#/components/schemas/TriggerEventAction"
1244
+ },
1239
1245
  {
1240
1246
  "$ref": "#/components/schemas/CreateDocumentAction"
1241
1247
  },
@@ -1273,6 +1279,9 @@
1273
1279
  {
1274
1280
  "$ref": "#/components/schemas/InformERPActionConfig"
1275
1281
  },
1282
+ {
1283
+ "$ref": "#/components/schemas/TriggerEventActionConfig"
1284
+ },
1276
1285
  {
1277
1286
  "$ref": "#/components/schemas/CreateDocumentActionConfig"
1278
1287
  },
@@ -2699,6 +2708,75 @@
2699
2708
  }
2700
2709
  }
2701
2710
  },
2711
+ "TriggerEventActionConfig": {
2712
+ "allOf": [
2713
+ {
2714
+ "$ref": "#/components/schemas/AutomationActionConfig"
2715
+ },
2716
+ {
2717
+ "type": "object",
2718
+ "properties": {
2719
+ "type": {
2720
+ "enum": [
2721
+ "trigger-event"
2722
+ ]
2723
+ },
2724
+ "config": {
2725
+ "$ref": "#/components/schemas/TriggerEventConfig"
2726
+ }
2727
+ }
2728
+ }
2729
+ ],
2730
+ "example": {
2731
+ "id": "2520gja-2sgmsaga-0asg-822jgal",
2732
+ "name": "Trigger Event",
2733
+ "type": "trigger-event",
2734
+ "config": {
2735
+ "event_name": "my_custom_event",
2736
+ "event_inputs": {
2737
+ "key": "value"
2738
+ }
2739
+ }
2740
+ }
2741
+ },
2742
+ "TriggerEventAction": {
2743
+ "allOf": [
2744
+ {
2745
+ "$ref": "#/components/schemas/AutomationAction"
2746
+ },
2747
+ {
2748
+ "type": "object",
2749
+ "properties": {
2750
+ "type": {
2751
+ "enum": [
2752
+ "trigger-event"
2753
+ ]
2754
+ },
2755
+ "config": {
2756
+ "$ref": "#/components/schemas/TriggerEventConfig"
2757
+ }
2758
+ }
2759
+ }
2760
+ ]
2761
+ },
2762
+ "TriggerEventConfig": {
2763
+ "type": "object",
2764
+ "description": "Configuration for triggering an event catalog event",
2765
+ "properties": {
2766
+ "event_name": {
2767
+ "type": "string",
2768
+ "description": "The event catalog event name to trigger"
2769
+ },
2770
+ "event_inputs": {
2771
+ "type": "object",
2772
+ "additionalProperties": true,
2773
+ "description": "Inputs to be passed to trigger the event"
2774
+ }
2775
+ },
2776
+ "required": [
2777
+ "event_name"
2778
+ ]
2779
+ },
2702
2780
  "FlowExecutionCancelActionConfig": {
2703
2781
  "allOf": [
2704
2782
  {
@@ -3097,6 +3175,9 @@
3097
3175
  },
3098
3176
  {
3099
3177
  "$ref": "#/components/schemas/TriggerEventFlowAutomationTask"
3178
+ },
3179
+ {
3180
+ "$ref": "#/components/schemas/TriggerEventMessaging"
3100
3181
  }
3101
3182
  ]
3102
3183
  },
@@ -3242,6 +3323,36 @@
3242
3323
  "activity_type"
3243
3324
  ]
3244
3325
  },
3326
+ "TriggerEventMessaging": {
3327
+ "type": "object",
3328
+ "properties": {
3329
+ "type": {
3330
+ "type": "string",
3331
+ "enum": [
3332
+ "new_email_thread"
3333
+ ]
3334
+ },
3335
+ "org_id": {
3336
+ "type": "string",
3337
+ "example": "123"
3338
+ },
3339
+ "thread_id": {
3340
+ "type": "string"
3341
+ },
3342
+ "message_id": {
3343
+ "type": "string"
3344
+ },
3345
+ "entity_id": {
3346
+ "$ref": "#/components/schemas/EntityId"
3347
+ }
3348
+ },
3349
+ "required": [
3350
+ "org_id",
3351
+ "thread_id",
3352
+ "message_id",
3353
+ "entity_id"
3354
+ ]
3355
+ },
3245
3356
  "TriggerEventEntityOperation": {
3246
3357
  "type": "object",
3247
3358
  "properties": {
@@ -3843,6 +3954,41 @@
3843
3954
  }
3844
3955
  ]
3845
3956
  },
3957
+ "NewEmailThreadTrigger": {
3958
+ "allOf": [
3959
+ {
3960
+ "$ref": "#/components/schemas/AutomationTrigger"
3961
+ },
3962
+ {
3963
+ "type": "object",
3964
+ "properties": {
3965
+ "type": {
3966
+ "type": "string",
3967
+ "enum": [
3968
+ "new_email_thread"
3969
+ ]
3970
+ },
3971
+ "configuration": {
3972
+ "type": "object",
3973
+ "properties": {
3974
+ "direction": {
3975
+ "type": "string",
3976
+ "enum": [
3977
+ "INBOUND",
3978
+ "OUTBOUND",
3979
+ "BOTH"
3980
+ ]
3981
+ }
3982
+ }
3983
+ }
3984
+ },
3985
+ "required": [
3986
+ "type",
3987
+ "configuration"
3988
+ ]
3989
+ }
3990
+ ]
3991
+ },
3846
3992
  "ReceivedEmailTrigger": {
3847
3993
  "allOf": [
3848
3994
  {
@@ -4646,9 +4792,6 @@
4646
4792
  }
4647
4793
  },
4648
4794
  "servers": [
4649
- {
4650
- "url": "https://automation.sls.epilot.io"
4651
- },
4652
4795
  {
4653
4796
  "url": "https://automation.sls.epilot.io"
4654
4797
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/automation-client",
3
- "version": "2.26.0",
3
+ "version": "2.27.0",
4
4
  "description": "Client library for epilot automation API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -76,4 +76,4 @@
76
76
  "whatwg-url": "^11.0.0"
77
77
  },
78
78
  "gitHead": "39426e86cfb320fa3227dc03f60ee6a10848e7c7"
79
- }
79
+ }