@epilot/automation-client 2.11.2 → 2.12.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.
@@ -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
  */
@@ -2415,6 +2533,12 @@ declare namespace Components {
2415
2533
  }
2416
2534
  }
2417
2535
  declare namespace Paths {
2536
+ namespace BulkTriggerExecutions {
2537
+ export type RequestBody = Components.Schemas.BulkTriggerRequest;
2538
+ namespace Responses {
2539
+ export type $202 = Components.Schemas.BulkTriggerJob;
2540
+ }
2541
+ }
2418
2542
  namespace CancelExecution {
2419
2543
  namespace Parameters {
2420
2544
  export type ExecutionId = /**
@@ -2451,6 +2575,22 @@ declare namespace Paths {
2451
2575
  export type $200 = Components.Schemas.AutomationFlow;
2452
2576
  }
2453
2577
  }
2578
+ namespace GetBulkJob {
2579
+ namespace Parameters {
2580
+ export type JobId = /**
2581
+ * Job ID for tracking the status of bulk trigger automation executions
2582
+ * example:
2583
+ * 8c086140-f33e-4bb7-a993-50c0f2402c7b
2584
+ */
2585
+ Components.Schemas.JobId;
2586
+ }
2587
+ export interface PathParameters {
2588
+ job_id: Parameters.JobId;
2589
+ }
2590
+ namespace Responses {
2591
+ export type $200 = Components.Schemas.BulkTriggerJob;
2592
+ }
2593
+ }
2454
2594
  namespace GetExecution {
2455
2595
  namespace Parameters {
2456
2596
  export type ExecutionId = /**
@@ -2500,6 +2640,23 @@ declare namespace Paths {
2500
2640
  export type $200 = Components.Schemas.AutomationFlow;
2501
2641
  }
2502
2642
  }
2643
+ namespace PatchBulkJob {
2644
+ namespace Parameters {
2645
+ export type JobId = /**
2646
+ * Job ID for tracking the status of bulk trigger automation executions
2647
+ * example:
2648
+ * 8c086140-f33e-4bb7-a993-50c0f2402c7b
2649
+ */
2650
+ Components.Schemas.JobId;
2651
+ }
2652
+ export interface PathParameters {
2653
+ job_id: Parameters.JobId;
2654
+ }
2655
+ export type RequestBody = Components.Schemas.PatchBulkJobRequest;
2656
+ namespace Responses {
2657
+ export type $200 = Components.Schemas.BulkTriggerJob;
2658
+ }
2659
+ }
2503
2660
  namespace PutFlow {
2504
2661
  namespace Parameters {
2505
2662
  export type FlowId = /**
@@ -2659,6 +2816,36 @@ export interface OperationMethods {
2659
2816
  data?: Paths.StartExecution.RequestBody,
2660
2817
  config?: AxiosRequestConfig
2661
2818
  ): OperationResponse<Paths.StartExecution.Responses.$201>
2819
+ /**
2820
+ * bulkTriggerExecutions - bulkTriggerExecutions
2821
+ *
2822
+ * Create a bulk job that triggers multiple automation executions
2823
+ */
2824
+ 'bulkTriggerExecutions'(
2825
+ parameters?: Parameters<UnknownParamsObject> | null,
2826
+ data?: Paths.BulkTriggerExecutions.RequestBody,
2827
+ config?: AxiosRequestConfig
2828
+ ): OperationResponse<Paths.BulkTriggerExecutions.Responses.$202>
2829
+ /**
2830
+ * getBulkJob - getBulkJob
2831
+ *
2832
+ * Get the status of a bulk job that triggers multiple automation executions
2833
+ */
2834
+ 'getBulkJob'(
2835
+ parameters?: Parameters<Paths.GetBulkJob.PathParameters> | null,
2836
+ data?: any,
2837
+ config?: AxiosRequestConfig
2838
+ ): OperationResponse<Paths.GetBulkJob.Responses.$200>
2839
+ /**
2840
+ * patchBulkJob - patchBulkJob
2841
+ *
2842
+ * Approve / Cancel bulk job that triggers multiple automation executions
2843
+ */
2844
+ 'patchBulkJob'(
2845
+ parameters?: Parameters<Paths.PatchBulkJob.PathParameters> | null,
2846
+ data?: Paths.PatchBulkJob.RequestBody,
2847
+ config?: AxiosRequestConfig
2848
+ ): OperationResponse<Paths.PatchBulkJob.Responses.$200>
2662
2849
  /**
2663
2850
  * getExecution - getExecution
2664
2851
  *
@@ -2783,6 +2970,40 @@ export interface PathsDictionary {
2783
2970
  config?: AxiosRequestConfig
2784
2971
  ): OperationResponse<Paths.StartExecution.Responses.$201>
2785
2972
  }
2973
+ ['/v1/automation/executions/bulk-jobs']: {
2974
+ /**
2975
+ * bulkTriggerExecutions - bulkTriggerExecutions
2976
+ *
2977
+ * Create a bulk job that triggers multiple automation executions
2978
+ */
2979
+ 'post'(
2980
+ parameters?: Parameters<UnknownParamsObject> | null,
2981
+ data?: Paths.BulkTriggerExecutions.RequestBody,
2982
+ config?: AxiosRequestConfig
2983
+ ): OperationResponse<Paths.BulkTriggerExecutions.Responses.$202>
2984
+ }
2985
+ ['/v1/automation/executions/bulk-jobs/{job_id}']: {
2986
+ /**
2987
+ * getBulkJob - getBulkJob
2988
+ *
2989
+ * Get the status of a bulk job that triggers multiple automation executions
2990
+ */
2991
+ 'get'(
2992
+ parameters?: Parameters<Paths.GetBulkJob.PathParameters> | null,
2993
+ data?: any,
2994
+ config?: AxiosRequestConfig
2995
+ ): OperationResponse<Paths.GetBulkJob.Responses.$200>
2996
+ /**
2997
+ * patchBulkJob - patchBulkJob
2998
+ *
2999
+ * Approve / Cancel bulk job that triggers multiple automation executions
3000
+ */
3001
+ 'patch'(
3002
+ parameters?: Parameters<Paths.PatchBulkJob.PathParameters> | null,
3003
+ data?: Paths.PatchBulkJob.RequestBody,
3004
+ config?: AxiosRequestConfig
3005
+ ): OperationResponse<Paths.PatchBulkJob.Responses.$200>
3006
+ }
2786
3007
  ['/v1/automation/executions/{execution_id}']: {
2787
3008
  /**
2788
3009
  * getExecution - getExecution
@@ -2858,6 +3079,8 @@ export type AutomationExecutionId = Components.Schemas.AutomationExecutionId;
2858
3079
  export type AutomationFlow = Components.Schemas.AutomationFlow;
2859
3080
  export type AutomationFlowId = Components.Schemas.AutomationFlowId;
2860
3081
  export type AutomationTrigger = Components.Schemas.AutomationTrigger;
3082
+ export type BulkTriggerJob = Components.Schemas.BulkTriggerJob;
3083
+ export type BulkTriggerRequest = Components.Schemas.BulkTriggerRequest;
2861
3084
  export type CartCheckoutAction = Components.Schemas.CartCheckoutAction;
2862
3085
  export type CartCheckoutActionConfig = Components.Schemas.CartCheckoutActionConfig;
2863
3086
  export type CartCheckoutConfig = Components.Schemas.CartCheckoutConfig;
@@ -2884,6 +3107,7 @@ export type ExistsCondition = Components.Schemas.ExistsCondition;
2884
3107
  export type FilterConditionOnEvent = Components.Schemas.FilterConditionOnEvent;
2885
3108
  export type FrontendSubmitTrigger = Components.Schemas.FrontendSubmitTrigger;
2886
3109
  export type GetExecutionsResp = Components.Schemas.GetExecutionsResp;
3110
+ export type JobId = Components.Schemas.JobId;
2887
3111
  export type JourneySubmitTrigger = Components.Schemas.JourneySubmitTrigger;
2888
3112
  export type MapEntityAction = Components.Schemas.MapEntityAction;
2889
3113
  export type MapEntityActionConfig = Components.Schemas.MapEntityActionConfig;
@@ -2898,6 +3122,7 @@ export type OperationObjectNode = Components.Schemas.OperationObjectNode;
2898
3122
  export type OrCondition = Components.Schemas.OrCondition;
2899
3123
  export type OrConditionForDiff = Components.Schemas.OrConditionForDiff;
2900
3124
  export type OrganizationId = Components.Schemas.OrganizationId;
3125
+ export type PatchBulkJobRequest = Components.Schemas.PatchBulkJobRequest;
2901
3126
  export type PrefixCondition = Components.Schemas.PrefixCondition;
2902
3127
  export type PrimitiveJSONValue = Components.Schemas.PrimitiveJSONValue;
2903
3128
  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",
@@ -2213,8 +2331,182 @@
2213
2331
  "flow_id": {
2214
2332
  "$ref": "#/components/schemas/AutomationFlowId"
2215
2333
  }
2334
+ },
2335
+ "required": [
2336
+ "entity_id",
2337
+ "flow_id"
2338
+ ]
2339
+ },
2340
+ "PatchBulkJobRequest": {
2341
+ "type": "object",
2342
+ "properties": {
2343
+ "action": {
2344
+ "type": "string",
2345
+ "enum": [
2346
+ "APPROVE",
2347
+ "CANCEL"
2348
+ ]
2349
+ },
2350
+ "task_token": {
2351
+ "type": "string"
2352
+ }
2353
+ },
2354
+ "required": [
2355
+ "action",
2356
+ "task_token"
2357
+ ]
2358
+ },
2359
+ "BulkTriggerRequest": {
2360
+ "type": "object",
2361
+ "properties": {
2362
+ "flow_id": {
2363
+ "$ref": "#/components/schemas/AutomationFlowId"
2364
+ },
2365
+ "entity_ids": {
2366
+ "type": "array",
2367
+ "items": {
2368
+ "$ref": "#/components/schemas/EntityId"
2369
+ }
2370
+ },
2371
+ "entities_query": {
2372
+ "type": "string"
2373
+ }
2374
+ },
2375
+ "required": [
2376
+ "flow_id"
2377
+ ]
2378
+ },
2379
+ "BulkTriggerJob": {
2380
+ "type": "object",
2381
+ "required": [
2382
+ "job_id",
2383
+ "org_id",
2384
+ "flow_id",
2385
+ "status",
2386
+ "created_by",
2387
+ "created_at",
2388
+ "updated_at"
2389
+ ],
2390
+ "properties": {
2391
+ "job_id": {
2392
+ "$ref": "#/components/schemas/JobId"
2393
+ },
2394
+ "org_id": {
2395
+ "$ref": "#/components/schemas/OrganizationId"
2396
+ },
2397
+ "flow_id": {
2398
+ "$ref": "#/components/schemas/AutomationFlowId"
2399
+ },
2400
+ "status": {
2401
+ "type": "string",
2402
+ "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",
2403
+ "enum": [
2404
+ "APPROVAL",
2405
+ "IN_PROGRESS",
2406
+ "SUCCESS",
2407
+ "FAILED",
2408
+ "CANCELLED"
2409
+ ]
2410
+ },
2411
+ "created_by": {
2412
+ "type": "string",
2413
+ "description": "User ID who created the bulk trigger automation job",
2414
+ "example": "1234"
2415
+ },
2416
+ "created_at": {
2417
+ "type": "string",
2418
+ "format": "date-time"
2419
+ },
2420
+ "updated_at": {
2421
+ "type": "string",
2422
+ "format": "date-time"
2423
+ },
2424
+ "approved_at": {
2425
+ "type": "string",
2426
+ "description": "Time when the bulk trigger automation executions job was approved",
2427
+ "format": "date-time"
2428
+ },
2429
+ "task_token": {
2430
+ "type": "string",
2431
+ "description": "Task token to approve/cancel the bulk automation job",
2432
+ "example": "8c086140-f33e-4bb7-a993-50c0f2402c7b"
2433
+ },
2434
+ "pending": {
2435
+ "type": "array",
2436
+ "description": "List of entity ids that are waiting for triggering automation",
2437
+ "items": {
2438
+ "type": "object",
2439
+ "required": [
2440
+ "entity_id"
2441
+ ],
2442
+ "properties": {
2443
+ "entity_id": {
2444
+ "$ref": "#/components/schemas/EntityId"
2445
+ }
2446
+ }
2447
+ }
2448
+ },
2449
+ "triggered": {
2450
+ "type": "array",
2451
+ "description": "List of entity ids and automation execution ids that were triggered successfully",
2452
+ "items": {
2453
+ "type": "object",
2454
+ "required": [
2455
+ "entity_id",
2456
+ "execution_id"
2457
+ ],
2458
+ "properties": {
2459
+ "entity_id": {
2460
+ "$ref": "#/components/schemas/EntityId"
2461
+ },
2462
+ "execution_id": {
2463
+ "$ref": "#/components/schemas/AutomationExecutionId"
2464
+ }
2465
+ }
2466
+ }
2467
+ },
2468
+ "failed": {
2469
+ "type": "array",
2470
+ "description": "List of entity ids that were skipped or failed",
2471
+ "items": {
2472
+ "type": "object",
2473
+ "required": [
2474
+ "entity_id",
2475
+ "error"
2476
+ ],
2477
+ "properties": {
2478
+ "entity_id": {
2479
+ "$ref": "#/components/schemas/EntityId"
2480
+ },
2481
+ "error": {
2482
+ "type": "string",
2483
+ "description": "Error message for the failed automation execution"
2484
+ }
2485
+ }
2486
+ }
2487
+ },
2488
+ "cancelled": {
2489
+ "type": "array",
2490
+ "description": "List of entity ids that were cancelled from triggering automation",
2491
+ "items": {
2492
+ "type": "object",
2493
+ "required": [
2494
+ "entity_id"
2495
+ ],
2496
+ "properties": {
2497
+ "entity_id": {
2498
+ "$ref": "#/components/schemas/EntityId"
2499
+ }
2500
+ }
2501
+ }
2502
+ }
2216
2503
  }
2217
2504
  },
2505
+ "JobId": {
2506
+ "type": "string",
2507
+ "description": "Job ID for tracking the status of bulk trigger automation executions",
2508
+ "example": "8c086140-f33e-4bb7-a993-50c0f2402c7b"
2509
+ },
2218
2510
  "EntityId": {
2219
2511
  "type": "string",
2220
2512
  "example": "e3d3ebac-baab-4395-abf4-50b5bf1f8b74"
@@ -2553,7 +2845,8 @@
2553
2845
  "UpdateMeterReading",
2554
2846
  "DocDownloadedFromPortal",
2555
2847
  "PortalUserResetPassword",
2556
- "PortalUserResetForgotPassword"
2848
+ "PortalUserResetForgotPassword",
2849
+ "SelfAssignmentFromPortal"
2557
2850
  ]
2558
2851
  },
2559
2852
  {
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.0",
4
4
  "description": "Client library for epilot automation API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",