@epilot/automation-client 2.11.2 → 2.12.1

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.
@@ -1 +1 @@
1
- (()=>{"use strict";var e={914:function(e,t,o){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var n=r(o(240));t.default=n.default},240:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"","version":""},"paths":{"/v1/automation/flows":{"get":{"operationId":"searchFlows","parameters":[{"name":"schema","in":"query"},{"name":"size","in":"query"},{"name":"from","in":"query"},{"name":"trigger_source_id","in":"query"}],"responses":{}},"post":{"operationId":"createFlow","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/automation/flows/{flow_id}":{"get":{"operationId":"getFlow","parameters":[{"name":"flow_id","in":"path","required":true}],"responses":{}},"put":{"operationId":"putFlow","parameters":[{"name":"flow_id","in":"path","required":true}],"requestBody":{"content":{"application/json":{}}},"responses":{}},"delete":{"operationId":"deleteFlow","parameters":[{"name":"flow_id","in":"path","required":true}],"responses":{}}},"/v1/automation/executions":{"get":{"operationId":"getExecutions","parameters":[{"name":"entity_id","in":"query"},{"name":"size","in":"query"},{"name":"from","in":"query"}],"responses":{}},"post":{"operationId":"startExecution","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/automation/executions/{execution_id}":{"get":{"operationId":"getExecution","parameters":[{"name":"execution_id","in":"path","required":true}],"responses":{}},"delete":{"operationId":"cancelExecution","parameters":[{"name":"execution_id","in":"path","required":true}],"responses":{}}},"/v1/automation/executions/{execution_id}/{action_id}/retrigger":{"post":{"operationId":"retriggerAction","parameters":[{"name":"execution_id","in":"path","required":true},{"name":"action_id","in":"path","required":true}],"requestBody":{"required":false,"content":{"application/json":{}}},"responses":{}}},"/v1/automation/public/executions:resume":{"post":{"operationId":"resumeExecutionWithToken","requestBody":{"content":{"application/json":{}}},"responses":{}}}},"components":{},"servers":[{"url":"https://automation.sls.epilot.io"}]}')}},t={},o=function o(r){var n=t[r];if(void 0!==n)return n.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,o),i.exports}(914),r=exports;for(var n in o)r[n]=o[n];o.__esModule&&Object.defineProperty(r,"__esModule",{value:!0})})();
1
+ (()=>{"use strict";var e={914:function(e,t,o){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var n=r(o(240));t.default=n.default},240:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"","version":""},"paths":{"/v1/automation/flows":{"get":{"operationId":"searchFlows","parameters":[{"name":"schema","in":"query"},{"name":"size","in":"query"},{"name":"from","in":"query"},{"name":"trigger_source_id","in":"query"}],"responses":{}},"post":{"operationId":"createFlow","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/automation/flows/{flow_id}":{"get":{"operationId":"getFlow","parameters":[{"name":"flow_id","in":"path","required":true}],"responses":{}},"put":{"operationId":"putFlow","parameters":[{"name":"flow_id","in":"path","required":true}],"requestBody":{"content":{"application/json":{}}},"responses":{}},"delete":{"operationId":"deleteFlow","parameters":[{"name":"flow_id","in":"path","required":true}],"responses":{}}},"/v1/automation/executions":{"get":{"operationId":"getExecutions","parameters":[{"name":"entity_id","in":"query"},{"name":"size","in":"query"},{"name":"from","in":"query"}],"responses":{}},"post":{"operationId":"startExecution","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/automation/executions/bulk-jobs":{"post":{"operationId":"bulkTriggerExecutions","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/automation/executions/bulk-jobs/{job_id}":{"get":{"operationId":"getBulkJob","parameters":[{"name":"job_id","in":"path","required":true}],"responses":{}},"patch":{"operationId":"patchBulkJob","parameters":[{"name":"job_id","in":"path","required":true}],"requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/automation/executions/{execution_id}":{"get":{"operationId":"getExecution","parameters":[{"name":"execution_id","in":"path","required":true}],"responses":{}},"delete":{"operationId":"cancelExecution","parameters":[{"name":"execution_id","in":"path","required":true}],"responses":{}}},"/v1/automation/executions/{execution_id}/{action_id}/retrigger":{"post":{"operationId":"retriggerAction","parameters":[{"name":"execution_id","in":"path","required":true},{"name":"action_id","in":"path","required":true}],"requestBody":{"required":false,"content":{"application/json":{}}},"responses":{}}},"/v1/automation/public/executions:resume":{"post":{"operationId":"resumeExecutionWithToken","requestBody":{"content":{"application/json":{}}},"responses":{}}}},"components":{},"servers":[{"url":"https://automation.sls.epilot.io"}]}')}},t={},o=function o(r){var n=t[r];if(void 0!==n)return n.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,o),i.exports}(914),r=exports;for(var n in o)r[n]=o[n];o.__esModule&&Object.defineProperty(r,"__esModule",{value:!0})})();
@@ -107,6 +107,46 @@
107
107
  "responses": {}
108
108
  }
109
109
  },
110
+ "/v1/automation/executions/bulk-jobs": {
111
+ "post": {
112
+ "operationId": "bulkTriggerExecutions",
113
+ "requestBody": {
114
+ "content": {
115
+ "application/json": {}
116
+ }
117
+ },
118
+ "responses": {}
119
+ }
120
+ },
121
+ "/v1/automation/executions/bulk-jobs/{job_id}": {
122
+ "get": {
123
+ "operationId": "getBulkJob",
124
+ "parameters": [
125
+ {
126
+ "name": "job_id",
127
+ "in": "path",
128
+ "required": true
129
+ }
130
+ ],
131
+ "responses": {}
132
+ },
133
+ "patch": {
134
+ "operationId": "patchBulkJob",
135
+ "parameters": [
136
+ {
137
+ "name": "job_id",
138
+ "in": "path",
139
+ "required": true
140
+ }
141
+ ],
142
+ "requestBody": {
143
+ "content": {
144
+ "application/json": {}
145
+ }
146
+ },
147
+ "responses": {}
148
+ }
149
+ },
110
150
  "/v1/automation/executions/{execution_id}": {
111
151
  "get": {
112
152
  "operationId": "getExecution",
package/dist/openapi.d.ts CHANGED
@@ -53,7 +53,7 @@ declare namespace Components {
53
53
  * submission
54
54
  */
55
55
  schema?: string;
56
- types?: (("CreateMeterReading" | "UpdateMeterReading" | "DocDownloadedFromPortal" | "PortalUserResetPassword" | "PortalUserResetForgotPassword") | string)[];
56
+ types?: (("CreateMeterReading" | "UpdateMeterReading" | "DocDownloadedFromPortal" | "PortalUserResetPassword" | "PortalUserResetForgotPassword" | "SelfAssignmentFromPortal") | string)[];
57
57
  };
58
58
  }
59
59
  export type AnyAction = MapEntityAction | TriggerWorkflowAction | TriggerWebhookAction | CreateDocumentAction | SendEmailAction | /* Creates an order entity with prices from journey */ CartCheckoutAction | AutomationAction;
@@ -774,6 +774,114 @@ declare namespace Components {
774
774
  */
775
775
  id?: string; // uuid
776
776
  }
777
+ export interface BulkTriggerJob {
778
+ job_id: /**
779
+ * Job ID for tracking the status of bulk trigger automation executions
780
+ * example:
781
+ * 8c086140-f33e-4bb7-a993-50c0f2402c7b
782
+ */
783
+ JobId;
784
+ org_id: /**
785
+ * example:
786
+ * e3d3ebac-baab-4395-abf4-50b5bf1f8b74
787
+ */
788
+ OrganizationId;
789
+ flow_id: /**
790
+ * example:
791
+ * 7791b04a-16d2-44a2-9af9-2d59c25c512f
792
+ */
793
+ AutomationFlowId;
794
+ /**
795
+ * Status of the bulk trigger automation job
796
+ * * APPROVAL: Waiting for user approval to start the bulk trigger automation
797
+ * * IN_PROGRESS: Bulk trigger automation execution is in progress
798
+ * * SUCCESS: Bulk trigger automation execution is completed successfully
799
+ * * FAILED: Bulk trigger automation execution is failed
800
+ * * CANCELLED: Bulk trigger automation execution was cancelled
801
+ *
802
+ */
803
+ status: "APPROVAL" | "IN_PROGRESS" | "SUCCESS" | "FAILED" | "CANCELLED";
804
+ /**
805
+ * User ID who created the bulk trigger automation job
806
+ * example:
807
+ * 1234
808
+ */
809
+ created_by: string;
810
+ created_at: string; // date-time
811
+ updated_at: string; // date-time
812
+ /**
813
+ * Time when the bulk trigger automation executions job was approved
814
+ */
815
+ approved_at?: string; // date-time
816
+ /**
817
+ * Task token to approve/cancel the bulk automation job
818
+ * example:
819
+ * 8c086140-f33e-4bb7-a993-50c0f2402c7b
820
+ */
821
+ task_token?: string;
822
+ /**
823
+ * List of entity ids that are waiting for triggering automation
824
+ */
825
+ pending?: {
826
+ entity_id: /**
827
+ * example:
828
+ * e3d3ebac-baab-4395-abf4-50b5bf1f8b74
829
+ */
830
+ EntityId;
831
+ }[];
832
+ /**
833
+ * List of entity ids and automation execution ids that were triggered successfully
834
+ */
835
+ triggered?: {
836
+ entity_id: /**
837
+ * example:
838
+ * e3d3ebac-baab-4395-abf4-50b5bf1f8b74
839
+ */
840
+ EntityId;
841
+ execution_id: /**
842
+ * example:
843
+ * 9baf184f-bc81-4128-bca3-d974c90a12c4
844
+ */
845
+ AutomationExecutionId;
846
+ }[];
847
+ /**
848
+ * List of entity ids that were skipped or failed
849
+ */
850
+ failed?: {
851
+ entity_id: /**
852
+ * example:
853
+ * e3d3ebac-baab-4395-abf4-50b5bf1f8b74
854
+ */
855
+ EntityId;
856
+ /**
857
+ * Error message for the failed automation execution
858
+ */
859
+ error: string;
860
+ }[];
861
+ /**
862
+ * List of entity ids that were cancelled from triggering automation
863
+ */
864
+ cancelled?: {
865
+ entity_id: /**
866
+ * example:
867
+ * e3d3ebac-baab-4395-abf4-50b5bf1f8b74
868
+ */
869
+ EntityId;
870
+ }[];
871
+ }
872
+ export interface BulkTriggerRequest {
873
+ flow_id: /**
874
+ * example:
875
+ * 7791b04a-16d2-44a2-9af9-2d59c25c512f
876
+ */
877
+ AutomationFlowId;
878
+ entity_ids?: /**
879
+ * example:
880
+ * e3d3ebac-baab-4395-abf4-50b5bf1f8b74
881
+ */
882
+ EntityId[];
883
+ entities_query?: string;
884
+ }
777
885
  /**
778
886
  * Creates an order entity with prices from journey
779
887
  */
@@ -1381,6 +1489,12 @@ declare namespace Components {
1381
1489
  total: number;
1382
1490
  results: AutomationExecution[];
1383
1491
  }
1492
+ /**
1493
+ * Job ID for tracking the status of bulk trigger automation executions
1494
+ * example:
1495
+ * 8c086140-f33e-4bb7-a993-50c0f2402c7b
1496
+ */
1497
+ export type JobId = string;
1384
1498
  export interface JourneySubmitTrigger {
1385
1499
  /**
1386
1500
  * example:
@@ -1731,6 +1845,10 @@ declare namespace Components {
1731
1845
  * e3d3ebac-baab-4395-abf4-50b5bf1f8b74
1732
1846
  */
1733
1847
  export type OrganizationId = string;
1848
+ export interface PatchBulkJobRequest {
1849
+ action: "APPROVE" | "CANCEL";
1850
+ task_token: string;
1851
+ }
1734
1852
  export interface PrefixCondition {
1735
1853
  prefix?: string;
1736
1854
  }
@@ -2020,12 +2138,12 @@ declare namespace Components {
2020
2138
  value: any;
2021
2139
  }
2022
2140
  export interface StartExecutionRequest {
2023
- entity_id?: /**
2141
+ entity_id: /**
2024
2142
  * example:
2025
2143
  * e3d3ebac-baab-4395-abf4-50b5bf1f8b74
2026
2144
  */
2027
2145
  EntityId;
2028
- flow_id?: /**
2146
+ flow_id: /**
2029
2147
  * example:
2030
2148
  * 7791b04a-16d2-44a2-9af9-2d59c25c512f
2031
2149
  */
@@ -2408,6 +2526,7 @@ declare namespace Components {
2408
2526
  * ]
2409
2527
  */
2410
2528
  AssignUsersToStep[];
2529
+ filter_with_purposes?: boolean;
2411
2530
  }
2412
2531
  export interface WildcardCondition {
2413
2532
  wildcard?: string;
@@ -2415,6 +2534,12 @@ declare namespace Components {
2415
2534
  }
2416
2535
  }
2417
2536
  declare namespace Paths {
2537
+ namespace BulkTriggerExecutions {
2538
+ export type RequestBody = Components.Schemas.BulkTriggerRequest;
2539
+ namespace Responses {
2540
+ export type $202 = Components.Schemas.BulkTriggerJob;
2541
+ }
2542
+ }
2418
2543
  namespace CancelExecution {
2419
2544
  namespace Parameters {
2420
2545
  export type ExecutionId = /**
@@ -2451,6 +2576,22 @@ declare namespace Paths {
2451
2576
  export type $200 = Components.Schemas.AutomationFlow;
2452
2577
  }
2453
2578
  }
2579
+ namespace GetBulkJob {
2580
+ namespace Parameters {
2581
+ export type JobId = /**
2582
+ * Job ID for tracking the status of bulk trigger automation executions
2583
+ * example:
2584
+ * 8c086140-f33e-4bb7-a993-50c0f2402c7b
2585
+ */
2586
+ Components.Schemas.JobId;
2587
+ }
2588
+ export interface PathParameters {
2589
+ job_id: Parameters.JobId;
2590
+ }
2591
+ namespace Responses {
2592
+ export type $200 = Components.Schemas.BulkTriggerJob;
2593
+ }
2594
+ }
2454
2595
  namespace GetExecution {
2455
2596
  namespace Parameters {
2456
2597
  export type ExecutionId = /**
@@ -2500,6 +2641,23 @@ declare namespace Paths {
2500
2641
  export type $200 = Components.Schemas.AutomationFlow;
2501
2642
  }
2502
2643
  }
2644
+ namespace PatchBulkJob {
2645
+ namespace Parameters {
2646
+ export type JobId = /**
2647
+ * Job ID for tracking the status of bulk trigger automation executions
2648
+ * example:
2649
+ * 8c086140-f33e-4bb7-a993-50c0f2402c7b
2650
+ */
2651
+ Components.Schemas.JobId;
2652
+ }
2653
+ export interface PathParameters {
2654
+ job_id: Parameters.JobId;
2655
+ }
2656
+ export type RequestBody = Components.Schemas.PatchBulkJobRequest;
2657
+ namespace Responses {
2658
+ export type $200 = Components.Schemas.BulkTriggerJob;
2659
+ }
2660
+ }
2503
2661
  namespace PutFlow {
2504
2662
  namespace Parameters {
2505
2663
  export type FlowId = /**
@@ -2659,6 +2817,36 @@ export interface OperationMethods {
2659
2817
  data?: Paths.StartExecution.RequestBody,
2660
2818
  config?: AxiosRequestConfig
2661
2819
  ): OperationResponse<Paths.StartExecution.Responses.$201>
2820
+ /**
2821
+ * bulkTriggerExecutions - bulkTriggerExecutions
2822
+ *
2823
+ * Create a bulk job that triggers multiple automation executions
2824
+ */
2825
+ 'bulkTriggerExecutions'(
2826
+ parameters?: Parameters<UnknownParamsObject> | null,
2827
+ data?: Paths.BulkTriggerExecutions.RequestBody,
2828
+ config?: AxiosRequestConfig
2829
+ ): OperationResponse<Paths.BulkTriggerExecutions.Responses.$202>
2830
+ /**
2831
+ * getBulkJob - getBulkJob
2832
+ *
2833
+ * Get the status of a bulk job that triggers multiple automation executions
2834
+ */
2835
+ 'getBulkJob'(
2836
+ parameters?: Parameters<Paths.GetBulkJob.PathParameters> | null,
2837
+ data?: any,
2838
+ config?: AxiosRequestConfig
2839
+ ): OperationResponse<Paths.GetBulkJob.Responses.$200>
2840
+ /**
2841
+ * patchBulkJob - patchBulkJob
2842
+ *
2843
+ * Approve / Cancel bulk job that triggers multiple automation executions
2844
+ */
2845
+ 'patchBulkJob'(
2846
+ parameters?: Parameters<Paths.PatchBulkJob.PathParameters> | null,
2847
+ data?: Paths.PatchBulkJob.RequestBody,
2848
+ config?: AxiosRequestConfig
2849
+ ): OperationResponse<Paths.PatchBulkJob.Responses.$200>
2662
2850
  /**
2663
2851
  * getExecution - getExecution
2664
2852
  *
@@ -2783,6 +2971,40 @@ export interface PathsDictionary {
2783
2971
  config?: AxiosRequestConfig
2784
2972
  ): OperationResponse<Paths.StartExecution.Responses.$201>
2785
2973
  }
2974
+ ['/v1/automation/executions/bulk-jobs']: {
2975
+ /**
2976
+ * bulkTriggerExecutions - bulkTriggerExecutions
2977
+ *
2978
+ * Create a bulk job that triggers multiple automation executions
2979
+ */
2980
+ 'post'(
2981
+ parameters?: Parameters<UnknownParamsObject> | null,
2982
+ data?: Paths.BulkTriggerExecutions.RequestBody,
2983
+ config?: AxiosRequestConfig
2984
+ ): OperationResponse<Paths.BulkTriggerExecutions.Responses.$202>
2985
+ }
2986
+ ['/v1/automation/executions/bulk-jobs/{job_id}']: {
2987
+ /**
2988
+ * getBulkJob - getBulkJob
2989
+ *
2990
+ * Get the status of a bulk job that triggers multiple automation executions
2991
+ */
2992
+ 'get'(
2993
+ parameters?: Parameters<Paths.GetBulkJob.PathParameters> | null,
2994
+ data?: any,
2995
+ config?: AxiosRequestConfig
2996
+ ): OperationResponse<Paths.GetBulkJob.Responses.$200>
2997
+ /**
2998
+ * patchBulkJob - patchBulkJob
2999
+ *
3000
+ * Approve / Cancel bulk job that triggers multiple automation executions
3001
+ */
3002
+ 'patch'(
3003
+ parameters?: Parameters<Paths.PatchBulkJob.PathParameters> | null,
3004
+ data?: Paths.PatchBulkJob.RequestBody,
3005
+ config?: AxiosRequestConfig
3006
+ ): OperationResponse<Paths.PatchBulkJob.Responses.$200>
3007
+ }
2786
3008
  ['/v1/automation/executions/{execution_id}']: {
2787
3009
  /**
2788
3010
  * getExecution - getExecution
@@ -2858,6 +3080,8 @@ export type AutomationExecutionId = Components.Schemas.AutomationExecutionId;
2858
3080
  export type AutomationFlow = Components.Schemas.AutomationFlow;
2859
3081
  export type AutomationFlowId = Components.Schemas.AutomationFlowId;
2860
3082
  export type AutomationTrigger = Components.Schemas.AutomationTrigger;
3083
+ export type BulkTriggerJob = Components.Schemas.BulkTriggerJob;
3084
+ export type BulkTriggerRequest = Components.Schemas.BulkTriggerRequest;
2861
3085
  export type CartCheckoutAction = Components.Schemas.CartCheckoutAction;
2862
3086
  export type CartCheckoutActionConfig = Components.Schemas.CartCheckoutActionConfig;
2863
3087
  export type CartCheckoutConfig = Components.Schemas.CartCheckoutConfig;
@@ -2884,6 +3108,7 @@ export type ExistsCondition = Components.Schemas.ExistsCondition;
2884
3108
  export type FilterConditionOnEvent = Components.Schemas.FilterConditionOnEvent;
2885
3109
  export type FrontendSubmitTrigger = Components.Schemas.FrontendSubmitTrigger;
2886
3110
  export type GetExecutionsResp = Components.Schemas.GetExecutionsResp;
3111
+ export type JobId = Components.Schemas.JobId;
2887
3112
  export type JourneySubmitTrigger = Components.Schemas.JourneySubmitTrigger;
2888
3113
  export type MapEntityAction = Components.Schemas.MapEntityAction;
2889
3114
  export type MapEntityActionConfig = Components.Schemas.MapEntityActionConfig;
@@ -2898,6 +3123,7 @@ export type OperationObjectNode = Components.Schemas.OperationObjectNode;
2898
3123
  export type OrCondition = Components.Schemas.OrCondition;
2899
3124
  export type OrConditionForDiff = Components.Schemas.OrConditionForDiff;
2900
3125
  export type OrganizationId = Components.Schemas.OrganizationId;
3126
+ export type PatchBulkJobRequest = Components.Schemas.PatchBulkJobRequest;
2901
3127
  export type PrefixCondition = Components.Schemas.PrefixCondition;
2902
3128
  export type PrimitiveJSONValue = Components.Schemas.PrimitiveJSONValue;
2903
3129
  export type ReceivedEmailTrigger = Components.Schemas.ReceivedEmailTrigger;
package/dist/openapi.json CHANGED
@@ -13,6 +13,10 @@
13
13
  {
14
14
  "name": "executions",
15
15
  "description": "Automation executions"
16
+ },
17
+ {
18
+ "name": "bulk",
19
+ "description": "Bulk job for triggering automation executions"
16
20
  }
17
21
  ],
18
22
  "security": [
@@ -295,6 +299,120 @@
295
299
  }
296
300
  }
297
301
  },
302
+ "/v1/automation/executions/bulk-jobs": {
303
+ "post": {
304
+ "operationId": "bulkTriggerExecutions",
305
+ "summary": "bulkTriggerExecutions",
306
+ "description": "Create a bulk job that triggers multiple automation executions",
307
+ "requestBody": {
308
+ "description": "Execution parameters",
309
+ "content": {
310
+ "application/json": {
311
+ "schema": {
312
+ "$ref": "#/components/schemas/BulkTriggerRequest"
313
+ },
314
+ "example": {
315
+ "flow_id": "8e2e067e-3c63-4b1a-8e02-6150a3d1fd89",
316
+ "entity_ids": [
317
+ "7791b04a-16d2-44a2-9af9-2d59c25c512f",
318
+ "b35a6c51-2a15-4ef1-9623-20db37b0744f"
319
+ ]
320
+ }
321
+ }
322
+ }
323
+ },
324
+ "tags": [
325
+ "bulk"
326
+ ],
327
+ "responses": {
328
+ "202": {
329
+ "description": "Trigger Executions Job Info",
330
+ "content": {
331
+ "application/json": {
332
+ "schema": {
333
+ "$ref": "#/components/schemas/BulkTriggerJob"
334
+ }
335
+ }
336
+ }
337
+ }
338
+ }
339
+ }
340
+ },
341
+ "/v1/automation/executions/bulk-jobs/{job_id}": {
342
+ "get": {
343
+ "operationId": "getBulkJob",
344
+ "summary": "getBulkJob",
345
+ "description": "Get the status of a bulk job that triggers multiple automation executions",
346
+ "parameters": [
347
+ {
348
+ "name": "job_id",
349
+ "in": "path",
350
+ "schema": {
351
+ "$ref": "#/components/schemas/JobId"
352
+ },
353
+ "required": true
354
+ }
355
+ ],
356
+ "tags": [
357
+ "bulk"
358
+ ],
359
+ "responses": {
360
+ "200": {
361
+ "description": "Bulk Job Info",
362
+ "content": {
363
+ "application/json": {
364
+ "schema": {
365
+ "$ref": "#/components/schemas/BulkTriggerJob"
366
+ }
367
+ }
368
+ }
369
+ }
370
+ }
371
+ },
372
+ "patch": {
373
+ "operationId": "patchBulkJob",
374
+ "summary": "patchBulkJob",
375
+ "description": "Approve / Cancel bulk job that triggers multiple automation executions",
376
+ "parameters": [
377
+ {
378
+ "name": "job_id",
379
+ "in": "path",
380
+ "schema": {
381
+ "$ref": "#/components/schemas/JobId"
382
+ },
383
+ "required": true
384
+ }
385
+ ],
386
+ "requestBody": {
387
+ "content": {
388
+ "application/json": {
389
+ "schema": {
390
+ "$ref": "#/components/schemas/PatchBulkJobRequest"
391
+ },
392
+ "example": {
393
+ "action": "APPROVE",
394
+ "task_token": "b35a6c51-2a15-4ef1-9623-20db37b0744f"
395
+ }
396
+ }
397
+ }
398
+ },
399
+ "tags": [
400
+ "bulk"
401
+ ],
402
+ "responses": {
403
+ "200": {
404
+ "description": "Bulk Job Info",
405
+ "content": {
406
+ "application/json": {
407
+ "schema": {
408
+ "$ref": "#/components/schemas/BulkTriggerJob"
409
+ }
410
+ }
411
+ }
412
+ }
413
+ }
414
+ }
415
+ },
298
416
  "/v1/automation/executions/{execution_id}": {
299
417
  "get": {
300
418
  "operationId": "getExecution",
@@ -1676,6 +1794,9 @@
1676
1794
  "items": {
1677
1795
  "$ref": "#/components/schemas/AssignUsersToStep"
1678
1796
  }
1797
+ },
1798
+ "filter_with_purposes": {
1799
+ "type": "boolean"
1679
1800
  }
1680
1801
  }
1681
1802
  },
@@ -2213,8 +2334,182 @@
2213
2334
  "flow_id": {
2214
2335
  "$ref": "#/components/schemas/AutomationFlowId"
2215
2336
  }
2337
+ },
2338
+ "required": [
2339
+ "entity_id",
2340
+ "flow_id"
2341
+ ]
2342
+ },
2343
+ "PatchBulkJobRequest": {
2344
+ "type": "object",
2345
+ "properties": {
2346
+ "action": {
2347
+ "type": "string",
2348
+ "enum": [
2349
+ "APPROVE",
2350
+ "CANCEL"
2351
+ ]
2352
+ },
2353
+ "task_token": {
2354
+ "type": "string"
2355
+ }
2356
+ },
2357
+ "required": [
2358
+ "action",
2359
+ "task_token"
2360
+ ]
2361
+ },
2362
+ "BulkTriggerRequest": {
2363
+ "type": "object",
2364
+ "properties": {
2365
+ "flow_id": {
2366
+ "$ref": "#/components/schemas/AutomationFlowId"
2367
+ },
2368
+ "entity_ids": {
2369
+ "type": "array",
2370
+ "items": {
2371
+ "$ref": "#/components/schemas/EntityId"
2372
+ }
2373
+ },
2374
+ "entities_query": {
2375
+ "type": "string"
2376
+ }
2377
+ },
2378
+ "required": [
2379
+ "flow_id"
2380
+ ]
2381
+ },
2382
+ "BulkTriggerJob": {
2383
+ "type": "object",
2384
+ "required": [
2385
+ "job_id",
2386
+ "org_id",
2387
+ "flow_id",
2388
+ "status",
2389
+ "created_by",
2390
+ "created_at",
2391
+ "updated_at"
2392
+ ],
2393
+ "properties": {
2394
+ "job_id": {
2395
+ "$ref": "#/components/schemas/JobId"
2396
+ },
2397
+ "org_id": {
2398
+ "$ref": "#/components/schemas/OrganizationId"
2399
+ },
2400
+ "flow_id": {
2401
+ "$ref": "#/components/schemas/AutomationFlowId"
2402
+ },
2403
+ "status": {
2404
+ "type": "string",
2405
+ "description": "Status of the bulk trigger automation job\n* APPROVAL: Waiting for user approval to start the bulk trigger automation\n* IN_PROGRESS: Bulk trigger automation execution is in progress\n* SUCCESS: Bulk trigger automation execution is completed successfully\n* FAILED: Bulk trigger automation execution is failed\n* CANCELLED: Bulk trigger automation execution was cancelled\n",
2406
+ "enum": [
2407
+ "APPROVAL",
2408
+ "IN_PROGRESS",
2409
+ "SUCCESS",
2410
+ "FAILED",
2411
+ "CANCELLED"
2412
+ ]
2413
+ },
2414
+ "created_by": {
2415
+ "type": "string",
2416
+ "description": "User ID who created the bulk trigger automation job",
2417
+ "example": "1234"
2418
+ },
2419
+ "created_at": {
2420
+ "type": "string",
2421
+ "format": "date-time"
2422
+ },
2423
+ "updated_at": {
2424
+ "type": "string",
2425
+ "format": "date-time"
2426
+ },
2427
+ "approved_at": {
2428
+ "type": "string",
2429
+ "description": "Time when the bulk trigger automation executions job was approved",
2430
+ "format": "date-time"
2431
+ },
2432
+ "task_token": {
2433
+ "type": "string",
2434
+ "description": "Task token to approve/cancel the bulk automation job",
2435
+ "example": "8c086140-f33e-4bb7-a993-50c0f2402c7b"
2436
+ },
2437
+ "pending": {
2438
+ "type": "array",
2439
+ "description": "List of entity ids that are waiting for triggering automation",
2440
+ "items": {
2441
+ "type": "object",
2442
+ "required": [
2443
+ "entity_id"
2444
+ ],
2445
+ "properties": {
2446
+ "entity_id": {
2447
+ "$ref": "#/components/schemas/EntityId"
2448
+ }
2449
+ }
2450
+ }
2451
+ },
2452
+ "triggered": {
2453
+ "type": "array",
2454
+ "description": "List of entity ids and automation execution ids that were triggered successfully",
2455
+ "items": {
2456
+ "type": "object",
2457
+ "required": [
2458
+ "entity_id",
2459
+ "execution_id"
2460
+ ],
2461
+ "properties": {
2462
+ "entity_id": {
2463
+ "$ref": "#/components/schemas/EntityId"
2464
+ },
2465
+ "execution_id": {
2466
+ "$ref": "#/components/schemas/AutomationExecutionId"
2467
+ }
2468
+ }
2469
+ }
2470
+ },
2471
+ "failed": {
2472
+ "type": "array",
2473
+ "description": "List of entity ids that were skipped or failed",
2474
+ "items": {
2475
+ "type": "object",
2476
+ "required": [
2477
+ "entity_id",
2478
+ "error"
2479
+ ],
2480
+ "properties": {
2481
+ "entity_id": {
2482
+ "$ref": "#/components/schemas/EntityId"
2483
+ },
2484
+ "error": {
2485
+ "type": "string",
2486
+ "description": "Error message for the failed automation execution"
2487
+ }
2488
+ }
2489
+ }
2490
+ },
2491
+ "cancelled": {
2492
+ "type": "array",
2493
+ "description": "List of entity ids that were cancelled from triggering automation",
2494
+ "items": {
2495
+ "type": "object",
2496
+ "required": [
2497
+ "entity_id"
2498
+ ],
2499
+ "properties": {
2500
+ "entity_id": {
2501
+ "$ref": "#/components/schemas/EntityId"
2502
+ }
2503
+ }
2504
+ }
2505
+ }
2216
2506
  }
2217
2507
  },
2508
+ "JobId": {
2509
+ "type": "string",
2510
+ "description": "Job ID for tracking the status of bulk trigger automation executions",
2511
+ "example": "8c086140-f33e-4bb7-a993-50c0f2402c7b"
2512
+ },
2218
2513
  "EntityId": {
2219
2514
  "type": "string",
2220
2515
  "example": "e3d3ebac-baab-4395-abf4-50b5bf1f8b74"
@@ -2553,7 +2848,8 @@
2553
2848
  "UpdateMeterReading",
2554
2849
  "DocDownloadedFromPortal",
2555
2850
  "PortalUserResetPassword",
2556
- "PortalUserResetForgotPassword"
2851
+ "PortalUserResetForgotPassword",
2852
+ "SelfAssignmentFromPortal"
2557
2853
  ]
2558
2854
  },
2559
2855
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/automation-client",
3
- "version": "2.11.2",
3
+ "version": "2.12.1",
4
4
  "description": "Client library for epilot automation API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",