@epilot/automation-client 2.19.0 → 2.21.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;
129
+ export type AnyAction = MapEntityAction | TriggerWorkflowAction | TriggerShareEntityAction | TriggerWebhookAction | InformERPAction | CreateDocumentAction | SendEmailAction | /* Creates an order entity with prices from journey */ CartCheckoutAction | CustomAction | AutomationAction | FlowExecutionCancelAction;
130
130
  export type AnyActionConfig = /**
131
131
  * example:
132
132
  * {
@@ -341,7 +341,28 @@ declare namespace Components {
341
341
  * }
342
342
  * }
343
343
  */
344
- SendEmailActionConfig | /* Creates an order entity with prices from journey */ CartCheckoutActionConfig | CustomAction | AutomationActionConfig;
344
+ SendEmailActionConfig | /* Creates an order entity with prices from journey */ CartCheckoutActionConfig | CustomAction | AutomationActionConfig | /**
345
+ * example:
346
+ * {
347
+ * "id": "2520gja-2sgmsaga-0asg-822jgal",
348
+ * "name": "Cancel Flow Execution",
349
+ * "type": "cancel-flow-execution",
350
+ * "config": {
351
+ * "selected_reasons": [
352
+ * {
353
+ * "id": "_6kITMwkv_0Uo4i7fO7Ja",
354
+ * "title": "when you are done! that's when you close it."
355
+ * },
356
+ * {
357
+ * "id": "qgK9sGbKoS7NxlAbNReVn",
358
+ * "title": "Client didn't want our services"
359
+ * }
360
+ * ],
361
+ * "extra_description": "Test cancellation"
362
+ * }
363
+ * }
364
+ */
365
+ FlowExecutionCancelActionConfig;
345
366
  export type AnyTrigger = FrontendSubmitTrigger | JourneySubmitTrigger | ApiSubmissionTrigger | /**
346
367
  * - If provides filter_config, executes an automation based on the filtered configuration when an entity event occurs.
347
368
  * - The conditions on a filter follows the event bridge patterns - `https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html`
@@ -1063,6 +1084,23 @@ declare namespace Components {
1063
1084
  */
1064
1085
  EntitySearchFilter;
1065
1086
  };
1087
+ /**
1088
+ * A reason for cancelling a flow execution
1089
+ */
1090
+ export interface CancellationReason {
1091
+ /**
1092
+ * Unique identifier for the cancellation reason
1093
+ * example:
1094
+ * _6kITMwkv_0Uo4i7fO7Ja
1095
+ */
1096
+ id: string;
1097
+ /**
1098
+ * Human-readable title for the cancellation reason
1099
+ * example:
1100
+ * Process completed successfully
1101
+ */
1102
+ title: string;
1103
+ }
1066
1104
  /**
1067
1105
  * Creates an order entity with prices from journey
1068
1106
  */
@@ -1958,6 +1996,152 @@ declare namespace Components {
1958
1996
  export type FilterConditionOnEvent = OrCondition | {
1959
1997
  [name: string]: (string | EqualsIgnoreCaseCondition | AnythingButCondition | NumericCondition | ExistsCondition | PrefixCondition | SuffixCondition | WildcardCondition)[];
1960
1998
  };
1999
+ export interface FlowExecutionCancelAction {
2000
+ id?: /**
2001
+ * example:
2002
+ * 9ec3711b-db63-449c-b894-54d5bb622a8f
2003
+ */
2004
+ AutomationActionId;
2005
+ flow_action_id?: /**
2006
+ * example:
2007
+ * 9ec3711b-db63-449c-b894-54d5bb622a8f
2008
+ */
2009
+ AutomationActionId;
2010
+ name?: string;
2011
+ type?: "cancel-flow-execution";
2012
+ config?: /* Configuration for cancelling a flow execution with selected reasons */ FlowExecutionCancelConfig;
2013
+ /**
2014
+ * Whether to stop execution in a failed state if this action fails
2015
+ */
2016
+ allow_failure?: boolean;
2017
+ /**
2018
+ * Flag indicating whether the action was created automatically or manually
2019
+ */
2020
+ created_automatically?: boolean;
2021
+ /**
2022
+ * Flag indicating whether the same action can be in bulk in a single execution. e.g; send-email / map-entity
2023
+ */
2024
+ is_bulk_action?: boolean;
2025
+ reason?: {
2026
+ /**
2027
+ * Why the action has to be skipped/failed
2028
+ * example:
2029
+ * There are no registered portal users for the given emails, hence skipping the action
2030
+ */
2031
+ message?: string;
2032
+ /**
2033
+ * Extra metadata about the skipping reason - such as a certain condition not met, etc.
2034
+ */
2035
+ payload?: {
2036
+ [name: string]: any;
2037
+ };
2038
+ };
2039
+ /**
2040
+ * Condition Id to be checked before executing the action
2041
+ */
2042
+ condition_id?: string;
2043
+ /**
2044
+ * Schedule Id which indicates the schedule of the action
2045
+ */
2046
+ schedule_id?: string;
2047
+ execution_status?: ExecutionStatus;
2048
+ started_at?: string;
2049
+ updated_at?: string;
2050
+ /**
2051
+ * example:
2052
+ * {}
2053
+ */
2054
+ outputs?: {
2055
+ [name: string]: any;
2056
+ };
2057
+ error_output?: ErrorOutput;
2058
+ retry_strategy?: /* different behaviors for retrying failed execution actions. */ RetryStrategy;
2059
+ }
2060
+ /**
2061
+ * example:
2062
+ * {
2063
+ * "id": "2520gja-2sgmsaga-0asg-822jgal",
2064
+ * "name": "Cancel Flow Execution",
2065
+ * "type": "cancel-flow-execution",
2066
+ * "config": {
2067
+ * "selected_reasons": [
2068
+ * {
2069
+ * "id": "_6kITMwkv_0Uo4i7fO7Ja",
2070
+ * "title": "when you are done! that's when you close it."
2071
+ * },
2072
+ * {
2073
+ * "id": "qgK9sGbKoS7NxlAbNReVn",
2074
+ * "title": "Client didn't want our services"
2075
+ * }
2076
+ * ],
2077
+ * "extra_description": "Test cancellation"
2078
+ * }
2079
+ * }
2080
+ */
2081
+ export interface FlowExecutionCancelActionConfig {
2082
+ id?: /**
2083
+ * example:
2084
+ * 9ec3711b-db63-449c-b894-54d5bb622a8f
2085
+ */
2086
+ AutomationActionId;
2087
+ flow_action_id?: /**
2088
+ * example:
2089
+ * 9ec3711b-db63-449c-b894-54d5bb622a8f
2090
+ */
2091
+ AutomationActionId;
2092
+ name?: string;
2093
+ type?: "cancel-flow-execution";
2094
+ config?: /* Configuration for cancelling a flow execution with selected reasons */ FlowExecutionCancelConfig;
2095
+ /**
2096
+ * Whether to stop execution in a failed state if this action fails
2097
+ */
2098
+ allow_failure?: boolean;
2099
+ /**
2100
+ * Flag indicating whether the action was created automatically or manually
2101
+ */
2102
+ created_automatically?: boolean;
2103
+ /**
2104
+ * Flag indicating whether the same action can be in bulk in a single execution. e.g; send-email / map-entity
2105
+ */
2106
+ is_bulk_action?: boolean;
2107
+ reason?: {
2108
+ /**
2109
+ * Why the action has to be skipped/failed
2110
+ * example:
2111
+ * There are no registered portal users for the given emails, hence skipping the action
2112
+ */
2113
+ message?: string;
2114
+ /**
2115
+ * Extra metadata about the skipping reason - such as a certain condition not met, etc.
2116
+ */
2117
+ payload?: {
2118
+ [name: string]: any;
2119
+ };
2120
+ };
2121
+ /**
2122
+ * Condition Id to be checked before executing the action
2123
+ */
2124
+ condition_id?: string;
2125
+ /**
2126
+ * Schedule Id which indicates the schedule of the action
2127
+ */
2128
+ schedule_id?: string;
2129
+ }
2130
+ /**
2131
+ * Configuration for cancelling a flow execution with selected reasons
2132
+ */
2133
+ export interface FlowExecutionCancelConfig {
2134
+ /**
2135
+ * List of reasons selected for this specific cancellation
2136
+ */
2137
+ selected_reasons?: /* A reason for cancelling a flow execution */ CancellationReason[];
2138
+ /**
2139
+ * Additional description or notes for the cancellation
2140
+ * example:
2141
+ * Process completed successfully
2142
+ */
2143
+ extra_description?: string;
2144
+ }
1961
2145
  export interface FlowsTrigger {
1962
2146
  /**
1963
2147
  * example:
@@ -4082,6 +4266,7 @@ export type AutomationFlowId = Components.Schemas.AutomationFlowId;
4082
4266
  export type AutomationTrigger = Components.Schemas.AutomationTrigger;
4083
4267
  export type BulkTriggerJob = Components.Schemas.BulkTriggerJob;
4084
4268
  export type BulkTriggerRequest = Components.Schemas.BulkTriggerRequest;
4269
+ export type CancellationReason = Components.Schemas.CancellationReason;
4085
4270
  export type CartCheckoutAction = Components.Schemas.CartCheckoutAction;
4086
4271
  export type CartCheckoutActionConfig = Components.Schemas.CartCheckoutActionConfig;
4087
4272
  export type CartCheckoutConfig = Components.Schemas.CartCheckoutConfig;
@@ -4112,6 +4297,9 @@ export type ExecItem = Components.Schemas.ExecItem;
4112
4297
  export type ExecutionStatus = Components.Schemas.ExecutionStatus;
4113
4298
  export type ExistsCondition = Components.Schemas.ExistsCondition;
4114
4299
  export type FilterConditionOnEvent = Components.Schemas.FilterConditionOnEvent;
4300
+ export type FlowExecutionCancelAction = Components.Schemas.FlowExecutionCancelAction;
4301
+ export type FlowExecutionCancelActionConfig = Components.Schemas.FlowExecutionCancelActionConfig;
4302
+ export type FlowExecutionCancelConfig = Components.Schemas.FlowExecutionCancelConfig;
4115
4303
  export type FlowsTrigger = Components.Schemas.FlowsTrigger;
4116
4304
  export type FrontendSubmitTrigger = Components.Schemas.FrontendSubmitTrigger;
4117
4305
  export type GetExecutionsResp = Components.Schemas.GetExecutionsResp;
package/dist/openapi.json CHANGED
@@ -1105,6 +1105,9 @@
1105
1105
  },
1106
1106
  {
1107
1107
  "$ref": "#/components/schemas/AutomationAction"
1108
+ },
1109
+ {
1110
+ "$ref": "#/components/schemas/FlowExecutionCancelAction"
1108
1111
  }
1109
1112
  ]
1110
1113
  },
@@ -1139,6 +1142,9 @@
1139
1142
  },
1140
1143
  {
1141
1144
  "$ref": "#/components/schemas/AutomationActionConfig"
1145
+ },
1146
+ {
1147
+ "$ref": "#/components/schemas/FlowExecutionCancelActionConfig"
1142
1148
  }
1143
1149
  ]
1144
1150
  },
@@ -2502,6 +2508,105 @@
2502
2508
  }
2503
2509
  }
2504
2510
  },
2511
+ "FlowExecutionCancelActionConfig": {
2512
+ "allOf": [
2513
+ {
2514
+ "$ref": "#/components/schemas/AutomationActionConfig"
2515
+ },
2516
+ {
2517
+ "type": "object",
2518
+ "properties": {
2519
+ "type": {
2520
+ "enum": [
2521
+ "cancel-flow-execution"
2522
+ ]
2523
+ },
2524
+ "config": {
2525
+ "$ref": "#/components/schemas/FlowExecutionCancelConfig"
2526
+ }
2527
+ }
2528
+ }
2529
+ ],
2530
+ "example": {
2531
+ "id": "2520gja-2sgmsaga-0asg-822jgal",
2532
+ "name": "Cancel Flow Execution",
2533
+ "type": "cancel-flow-execution",
2534
+ "config": {
2535
+ "selected_reasons": [
2536
+ {
2537
+ "id": "_6kITMwkv_0Uo4i7fO7Ja",
2538
+ "title": "when you are done! that's when you close it."
2539
+ },
2540
+ {
2541
+ "id": "qgK9sGbKoS7NxlAbNReVn",
2542
+ "title": "Client didn't want our services"
2543
+ }
2544
+ ],
2545
+ "extra_description": "Test cancellation"
2546
+ }
2547
+ }
2548
+ },
2549
+ "FlowExecutionCancelAction": {
2550
+ "allOf": [
2551
+ {
2552
+ "$ref": "#/components/schemas/AutomationAction"
2553
+ },
2554
+ {
2555
+ "type": "object",
2556
+ "properties": {
2557
+ "type": {
2558
+ "enum": [
2559
+ "cancel-flow-execution"
2560
+ ]
2561
+ },
2562
+ "config": {
2563
+ "$ref": "#/components/schemas/FlowExecutionCancelConfig"
2564
+ }
2565
+ }
2566
+ }
2567
+ ]
2568
+ },
2569
+ "FlowExecutionCancelConfig": {
2570
+ "type": "object",
2571
+ "description": "Configuration for cancelling a flow execution with selected reasons",
2572
+ "properties": {
2573
+ "selected_reasons": {
2574
+ "type": "array",
2575
+ "description": "List of reasons selected for this specific cancellation",
2576
+ "items": {
2577
+ "$ref": "#/components/schemas/CancellationReason"
2578
+ }
2579
+ },
2580
+ "extra_description": {
2581
+ "type": "string",
2582
+ "description": "Additional description or notes for the cancellation",
2583
+ "example": "Process completed successfully"
2584
+ }
2585
+ },
2586
+ "required": [
2587
+ "configured_reasons"
2588
+ ]
2589
+ },
2590
+ "CancellationReason": {
2591
+ "type": "object",
2592
+ "description": "A reason for cancelling a flow execution",
2593
+ "properties": {
2594
+ "id": {
2595
+ "type": "string",
2596
+ "description": "Unique identifier for the cancellation reason",
2597
+ "example": "_6kITMwkv_0Uo4i7fO7Ja"
2598
+ },
2599
+ "title": {
2600
+ "type": "string",
2601
+ "description": "Human-readable title for the cancellation reason",
2602
+ "example": "Process completed successfully"
2603
+ }
2604
+ },
2605
+ "required": [
2606
+ "id",
2607
+ "title"
2608
+ ]
2609
+ },
2505
2610
  "ConditionStatement": {
2506
2611
  "type": "object",
2507
2612
  "properties": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/automation-client",
3
- "version": "2.19.0",
3
+ "version": "2.21.0",
4
4
  "description": "Client library for epilot automation API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",