@epilot/automation-client 2.17.3 → 2.19.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/definition.js +1 -1
- package/dist/openapi-runtime.json +1 -6
- package/dist/openapi.d.ts +109 -14
- package/dist/openapi.json +368 -19
- package/package.json +2 -2
package/dist/definition.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={
|
|
1
|
+
(()=>{"use strict";var e={187:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var r=n(o(466));t.default=r.default},466: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":{"responses":{"NotFoundError":{"content":{"application/json":{}}},"ForbiddenError":{"content":{"application/json":{}}}}}}')}},t={},o=function o(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,o),i.exports}(187),n=exports;for(var r in o)n[r]=o[r];o.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})();
|
package/dist/openapi.d.ts
CHANGED
|
@@ -745,6 +745,7 @@ declare namespace Components {
|
|
|
745
745
|
*/
|
|
746
746
|
OrganizationId;
|
|
747
747
|
flow_id: /**
|
|
748
|
+
* ID of the Automation Flow
|
|
748
749
|
* example:
|
|
749
750
|
* 7791b04a-16d2-44a2-9af9-2d59c25c512f
|
|
750
751
|
*/
|
|
@@ -776,7 +777,7 @@ declare namespace Components {
|
|
|
776
777
|
* 2
|
|
777
778
|
*/
|
|
778
779
|
version?: number;
|
|
779
|
-
trigger_event?: TriggerEventManual | TriggerEventEntityActivity | TriggerEventEntityOperation;
|
|
780
|
+
trigger_event?: TriggerEventManual | TriggerEventEntityActivity | TriggerEventEntityOperation | TriggerEventFlowAutomationTask;
|
|
780
781
|
}
|
|
781
782
|
/**
|
|
782
783
|
* example:
|
|
@@ -785,6 +786,7 @@ declare namespace Components {
|
|
|
785
786
|
export type AutomationExecutionId = string;
|
|
786
787
|
export interface AutomationFlow {
|
|
787
788
|
id?: /**
|
|
789
|
+
* ID of the Automation Flow
|
|
788
790
|
* example:
|
|
789
791
|
* 7791b04a-16d2-44a2-9af9-2d59c25c512f
|
|
790
792
|
*/
|
|
@@ -833,7 +835,7 @@ declare namespace Components {
|
|
|
833
835
|
/**
|
|
834
836
|
* The actions (nodes) of the automation flow
|
|
835
837
|
*/
|
|
836
|
-
actions:
|
|
838
|
+
actions: AnyAction[];
|
|
837
839
|
/**
|
|
838
840
|
* Number of automation executions that ran
|
|
839
841
|
* example:
|
|
@@ -893,6 +895,7 @@ declare namespace Components {
|
|
|
893
895
|
_manifest?: string /* uuid */[] | null;
|
|
894
896
|
}
|
|
895
897
|
/**
|
|
898
|
+
* ID of the Automation Flow
|
|
896
899
|
* example:
|
|
897
900
|
* 7791b04a-16d2-44a2-9af9-2d59c25c512f
|
|
898
901
|
*/
|
|
@@ -917,6 +920,7 @@ declare namespace Components {
|
|
|
917
920
|
*/
|
|
918
921
|
OrganizationId;
|
|
919
922
|
flow_id: /**
|
|
923
|
+
* ID of the Automation Flow
|
|
920
924
|
* example:
|
|
921
925
|
* 7791b04a-16d2-44a2-9af9-2d59c25c512f
|
|
922
926
|
*/
|
|
@@ -924,15 +928,17 @@ declare namespace Components {
|
|
|
924
928
|
/**
|
|
925
929
|
* Status of the bulk trigger automation job
|
|
926
930
|
* * approval: Waiting for user approval to start the bulk trigger automation
|
|
927
|
-
* *
|
|
928
|
-
* *
|
|
931
|
+
* * querying_entities: Loading entities in batches
|
|
932
|
+
* * entities_loaded: All entities have been loaded and stored
|
|
933
|
+
* * executing: Automation execution are currently running
|
|
934
|
+
* * monitoring: All executions have been started, now monitoring their completion
|
|
929
935
|
* * send_report: Automation executions finished running. Report is being created & sent to the user who initiated the bulk trigger automation
|
|
930
936
|
* * finished: Automation executions finished running. Some may have failed. Check the status of each entity.
|
|
931
937
|
* * failed: Bulk trigger automation execution failed. Some executions might have started. Check the status of each entity.
|
|
932
938
|
* * cancelled: Bulk trigger automation execution was cancelled
|
|
933
939
|
*
|
|
934
940
|
*/
|
|
935
|
-
status: "approval" | "
|
|
941
|
+
status: "approval" | "querying_entities" | "entities_loaded" | "executing" | "monitoring" | "send_report" | "finished" | "failed" | "cancelled";
|
|
936
942
|
/**
|
|
937
943
|
* User ID who created the bulk trigger automation job
|
|
938
944
|
* example:
|
|
@@ -955,13 +961,68 @@ declare namespace Components {
|
|
|
955
961
|
* Entity ID of the report file entity
|
|
956
962
|
*/
|
|
957
963
|
report_file_entity_id?: string;
|
|
964
|
+
/**
|
|
965
|
+
* Query configuration for loading entities
|
|
966
|
+
*/
|
|
967
|
+
entity_query?: {
|
|
968
|
+
type: "refs" | "query" | "filter";
|
|
969
|
+
data: EntityRef[] | string | /**
|
|
970
|
+
* A subset of simplified Elasticsearch query clauses. The default operator is a logical AND. Use nested $and, $or, $not to combine filters using different logical operators.
|
|
971
|
+
* example:
|
|
972
|
+
* [
|
|
973
|
+
* {
|
|
974
|
+
* "term": {
|
|
975
|
+
* "_schema": "contact"
|
|
976
|
+
* }
|
|
977
|
+
* },
|
|
978
|
+
* {
|
|
979
|
+
* "terms": {
|
|
980
|
+
* "status": [
|
|
981
|
+
* "active"
|
|
982
|
+
* ]
|
|
983
|
+
* }
|
|
984
|
+
* }
|
|
985
|
+
* ]
|
|
986
|
+
*/
|
|
987
|
+
EntitySearchFilter;
|
|
988
|
+
};
|
|
989
|
+
/**
|
|
990
|
+
* Pagination state for entity loading
|
|
991
|
+
*/
|
|
992
|
+
pagination_state?: {
|
|
993
|
+
/**
|
|
994
|
+
* Number of entities per page
|
|
995
|
+
*/
|
|
996
|
+
page_size?: number;
|
|
997
|
+
/**
|
|
998
|
+
* Number of pages processed so far
|
|
999
|
+
*/
|
|
1000
|
+
pages_processed?: number;
|
|
1001
|
+
/**
|
|
1002
|
+
* Total number of entities processed so far
|
|
1003
|
+
*/
|
|
1004
|
+
total_processed?: number;
|
|
1005
|
+
/**
|
|
1006
|
+
* Stable query ID for pagination
|
|
1007
|
+
*/
|
|
1008
|
+
stable_query_id?: string;
|
|
1009
|
+
/**
|
|
1010
|
+
* Last sort value used for pagination
|
|
1011
|
+
*/
|
|
1012
|
+
search_after?: (string | number)[];
|
|
1013
|
+
/**
|
|
1014
|
+
* Whether there are more entities to load
|
|
1015
|
+
*/
|
|
1016
|
+
has_more?: boolean;
|
|
1017
|
+
};
|
|
958
1018
|
/**
|
|
959
1019
|
* List of entities & their automation execution id & status
|
|
960
1020
|
*/
|
|
961
|
-
execution_summary
|
|
1021
|
+
execution_summary?: /* Execution item for bulk trigger automation. It maps each entity to its automation execution id & status */ ExecItem[];
|
|
962
1022
|
}
|
|
963
1023
|
export type BulkTriggerRequest = {
|
|
964
1024
|
flow_id: /**
|
|
1025
|
+
* ID of the Automation Flow
|
|
965
1026
|
* example:
|
|
966
1027
|
* 7791b04a-16d2-44a2-9af9-2d59c25c512f
|
|
967
1028
|
*/
|
|
@@ -969,6 +1030,7 @@ declare namespace Components {
|
|
|
969
1030
|
entities_refs: EntityRef[];
|
|
970
1031
|
} | {
|
|
971
1032
|
flow_id: /**
|
|
1033
|
+
* ID of the Automation Flow
|
|
972
1034
|
* example:
|
|
973
1035
|
* 7791b04a-16d2-44a2-9af9-2d59c25c512f
|
|
974
1036
|
*/
|
|
@@ -976,6 +1038,7 @@ declare namespace Components {
|
|
|
976
1038
|
entities_query: string;
|
|
977
1039
|
} | {
|
|
978
1040
|
flow_id: /**
|
|
1041
|
+
* ID of the Automation Flow
|
|
979
1042
|
* example:
|
|
980
1043
|
* 7791b04a-16d2-44a2-9af9-2d59c25c512f
|
|
981
1044
|
*/
|
|
@@ -1888,7 +1951,7 @@ declare namespace Components {
|
|
|
1888
1951
|
*/
|
|
1889
1952
|
error?: string;
|
|
1890
1953
|
}
|
|
1891
|
-
export type ExecutionStatus = "pending" | "in_progress" | "paused" | "success" | "failed" | "cancelled" | "skipped" | "scheduled" | "hot";
|
|
1954
|
+
export type ExecutionStatus = "pending" | "starting" | "in_progress" | "paused" | "success" | "failed" | "cancelled" | "skipped" | "scheduled" | "hot";
|
|
1892
1955
|
export interface ExistsCondition {
|
|
1893
1956
|
exists?: boolean;
|
|
1894
1957
|
}
|
|
@@ -1903,14 +1966,7 @@ declare namespace Components {
|
|
|
1903
1966
|
id?: string; // uuid
|
|
1904
1967
|
type: "flows_trigger";
|
|
1905
1968
|
configuration: {
|
|
1906
|
-
/**
|
|
1907
|
-
* ID of the flow that triggers the automation
|
|
1908
|
-
*/
|
|
1909
1969
|
source_id: string; // uuid
|
|
1910
|
-
/**
|
|
1911
|
-
* Certain flows can be triggered automatically by a journey, this is the ID of that journey
|
|
1912
|
-
*/
|
|
1913
|
-
journey_id?: string; // uuid
|
|
1914
1970
|
};
|
|
1915
1971
|
}
|
|
1916
1972
|
export interface FrontendSubmitTrigger {
|
|
@@ -2750,10 +2806,19 @@ declare namespace Components {
|
|
|
2750
2806
|
*/
|
|
2751
2807
|
EntityId;
|
|
2752
2808
|
flow_id: /**
|
|
2809
|
+
* ID of the Automation Flow
|
|
2753
2810
|
* example:
|
|
2754
2811
|
* 7791b04a-16d2-44a2-9af9-2d59c25c512f
|
|
2755
2812
|
*/
|
|
2756
2813
|
AutomationFlowId;
|
|
2814
|
+
/**
|
|
2815
|
+
* ID of the Flow Execution
|
|
2816
|
+
*/
|
|
2817
|
+
flow_execution_id?: string;
|
|
2818
|
+
/**
|
|
2819
|
+
* ID of the automated flow action
|
|
2820
|
+
*/
|
|
2821
|
+
flow_automation_task_id?: string; // UUID
|
|
2757
2822
|
}
|
|
2758
2823
|
export interface SuffixCondition {
|
|
2759
2824
|
suffix?: string;
|
|
@@ -2808,6 +2873,30 @@ declare namespace Components {
|
|
|
2808
2873
|
ActivityId;
|
|
2809
2874
|
operation_type: EntityOperation;
|
|
2810
2875
|
}
|
|
2876
|
+
export interface TriggerEventFlowAutomationTask {
|
|
2877
|
+
type?: "flow_automation_task";
|
|
2878
|
+
/**
|
|
2879
|
+
* example:
|
|
2880
|
+
* 123
|
|
2881
|
+
*/
|
|
2882
|
+
org_id: string;
|
|
2883
|
+
entity_id: /**
|
|
2884
|
+
* example:
|
|
2885
|
+
* e3d3ebac-baab-4395-abf4-50b5bf1f8b74
|
|
2886
|
+
*/
|
|
2887
|
+
EntityId;
|
|
2888
|
+
/**
|
|
2889
|
+
* example:
|
|
2890
|
+
* wfwAJoT_cK
|
|
2891
|
+
*/
|
|
2892
|
+
flow_execution_id: string;
|
|
2893
|
+
/**
|
|
2894
|
+
* example:
|
|
2895
|
+
* 2fa221ec-3aac-4655-ab8f-c062eca44a3
|
|
2896
|
+
*/
|
|
2897
|
+
flow_automation_task_id: string; // UUID
|
|
2898
|
+
caller?: ApiCallerContext;
|
|
2899
|
+
}
|
|
2811
2900
|
export interface TriggerEventManual {
|
|
2812
2901
|
type?: "manual";
|
|
2813
2902
|
/**
|
|
@@ -3331,6 +3420,7 @@ declare namespace Paths {
|
|
|
3331
3420
|
namespace DeleteFlow {
|
|
3332
3421
|
namespace Parameters {
|
|
3333
3422
|
export type FlowId = /**
|
|
3423
|
+
* ID of the Automation Flow
|
|
3334
3424
|
* example:
|
|
3335
3425
|
* 7791b04a-16d2-44a2-9af9-2d59c25c512f
|
|
3336
3426
|
*/
|
|
@@ -3453,6 +3543,7 @@ declare namespace Paths {
|
|
|
3453
3543
|
namespace GetFlow {
|
|
3454
3544
|
namespace Parameters {
|
|
3455
3545
|
export type FlowId = /**
|
|
3546
|
+
* ID of the Automation Flow
|
|
3456
3547
|
* example:
|
|
3457
3548
|
* 7791b04a-16d2-44a2-9af9-2d59c25c512f
|
|
3458
3549
|
*/
|
|
@@ -3517,6 +3608,7 @@ declare namespace Paths {
|
|
|
3517
3608
|
namespace PutFlow {
|
|
3518
3609
|
namespace Parameters {
|
|
3519
3610
|
export type FlowId = /**
|
|
3611
|
+
* ID of the Automation Flow
|
|
3520
3612
|
* example:
|
|
3521
3613
|
* 7791b04a-16d2-44a2-9af9-2d59c25c512f
|
|
3522
3614
|
*/
|
|
@@ -3650,6 +3742,7 @@ declare namespace Paths {
|
|
|
3650
3742
|
}
|
|
3651
3743
|
}
|
|
3652
3744
|
|
|
3745
|
+
|
|
3653
3746
|
export interface OperationMethods {
|
|
3654
3747
|
/**
|
|
3655
3748
|
* searchFlows - searchFlows
|
|
@@ -3964,6 +4057,7 @@ export interface PathsDictionary {
|
|
|
3964
4057
|
|
|
3965
4058
|
export type Client = OpenAPIClient<OperationMethods, PathsDictionary>
|
|
3966
4059
|
|
|
4060
|
+
|
|
3967
4061
|
export type ActionCondition = Components.Schemas.ActionCondition;
|
|
3968
4062
|
export type ActionSchedule = Components.Schemas.ActionSchedule;
|
|
3969
4063
|
export type ActionScheduleSource = Components.Schemas.ActionScheduleSource;
|
|
@@ -4060,6 +4154,7 @@ export type SuffixCondition = Components.Schemas.SuffixCondition;
|
|
|
4060
4154
|
export type TriggerCondition = Components.Schemas.TriggerCondition;
|
|
4061
4155
|
export type TriggerEventEntityActivity = Components.Schemas.TriggerEventEntityActivity;
|
|
4062
4156
|
export type TriggerEventEntityOperation = Components.Schemas.TriggerEventEntityOperation;
|
|
4157
|
+
export type TriggerEventFlowAutomationTask = Components.Schemas.TriggerEventFlowAutomationTask;
|
|
4063
4158
|
export type TriggerEventManual = Components.Schemas.TriggerEventManual;
|
|
4064
4159
|
export type TriggerShareEntityAction = Components.Schemas.TriggerShareEntityAction;
|
|
4065
4160
|
export type TriggerShareEntityActionConfig = Components.Schemas.TriggerShareEntityActionConfig;
|
package/dist/openapi.json
CHANGED
|
@@ -273,6 +273,241 @@
|
|
|
273
273
|
"application/json": {
|
|
274
274
|
"schema": {
|
|
275
275
|
"$ref": "#/components/schemas/GetExecutionsResp"
|
|
276
|
+
},
|
|
277
|
+
"examples": {
|
|
278
|
+
"manual_trigger": {
|
|
279
|
+
"summary": "Manual trigger execution",
|
|
280
|
+
"value": {
|
|
281
|
+
"total": 1,
|
|
282
|
+
"results": [
|
|
283
|
+
{
|
|
284
|
+
"id": "9baf184f-bc81-4128-bca3-d974c90a12c4",
|
|
285
|
+
"execution_status": "success",
|
|
286
|
+
"entity_id": "e3d3ebac-baab-4395-abf4-50b5bf1f8b74",
|
|
287
|
+
"org_id": "123",
|
|
288
|
+
"flow_id": "7791b04a-16d2-44a2-9af9-2d59c25c512f",
|
|
289
|
+
"flow_name": "Handle contact form",
|
|
290
|
+
"created_at": "2023-01-01T10:00:00Z",
|
|
291
|
+
"updated_at": "2023-01-01T10:05:00Z",
|
|
292
|
+
"actions": [],
|
|
293
|
+
"version": 1,
|
|
294
|
+
"trigger_event": {
|
|
295
|
+
"type": "manual",
|
|
296
|
+
"org_id": "123",
|
|
297
|
+
"entity_id": "e3d3ebac-baab-4395-abf4-50b5bf1f8b74",
|
|
298
|
+
"caller": {
|
|
299
|
+
"EpilotAuth": {
|
|
300
|
+
"claims": {
|
|
301
|
+
"userId": "10006129",
|
|
302
|
+
"email": "user@epilot.cloud"
|
|
303
|
+
},
|
|
304
|
+
"userId": "10006129",
|
|
305
|
+
"organizationId": "123"
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
]
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
"entity_operation_trigger": {
|
|
314
|
+
"summary": "Entity operation trigger execution",
|
|
315
|
+
"value": {
|
|
316
|
+
"total": 1,
|
|
317
|
+
"results": [
|
|
318
|
+
{
|
|
319
|
+
"id": "8cdf274e-ab70-4029-9ca2-c863b80a11c3",
|
|
320
|
+
"execution_status": "in_progress",
|
|
321
|
+
"entity_id": "f4e4fcbd-cbcc-4496-bf5f-60c6ce2c621e",
|
|
322
|
+
"activity_id": "a1b2c3d4-e5f6-7890-1234-567890abcdef",
|
|
323
|
+
"org_id": "123",
|
|
324
|
+
"flow_id": "8e2e067e-3c63-4b1a-8e02-6150a3d1fd89",
|
|
325
|
+
"flow_name": "Contact updated automation",
|
|
326
|
+
"created_at": "2023-01-01T12:00:00Z",
|
|
327
|
+
"updated_at": "2023-01-01T12:02:00Z",
|
|
328
|
+
"actions": [],
|
|
329
|
+
"version": 1,
|
|
330
|
+
"trigger_event": {
|
|
331
|
+
"type": "entity_operation",
|
|
332
|
+
"entity_id": "f4e4fcbd-cbcc-4496-bf5f-60c6ce2c621e",
|
|
333
|
+
"org_id": "123",
|
|
334
|
+
"activity_id": "a1b2c3d4-e5f6-7890-1234-567890abcdef",
|
|
335
|
+
"operation_type": "updateEntity"
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
]
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
"entity_activity_trigger": {
|
|
342
|
+
"summary": "Entity activity trigger execution",
|
|
343
|
+
"value": {
|
|
344
|
+
"total": 1,
|
|
345
|
+
"results": [
|
|
346
|
+
{
|
|
347
|
+
"id": "7bde163d-9a5f-3f18-8b92-d752a79a10b2",
|
|
348
|
+
"execution_status": "failed",
|
|
349
|
+
"entity_id": "c2b1a9d8-7e6f-5040-3029-180716253f4e",
|
|
350
|
+
"activity_id": "b3c4d5e6-f7a8-9012-3456-789012bcdef0",
|
|
351
|
+
"org_id": "123",
|
|
352
|
+
"flow_id": "6d1d956d-2b52-4a0a-9e01-5049a2c0ee78",
|
|
353
|
+
"flow_name": "Document upload handler",
|
|
354
|
+
"created_at": "2023-01-01T14:00:00Z",
|
|
355
|
+
"updated_at": "2023-01-01T14:01:30Z",
|
|
356
|
+
"actions": [],
|
|
357
|
+
"version": 1,
|
|
358
|
+
"trigger_event": {
|
|
359
|
+
"type": "entity_activity",
|
|
360
|
+
"org_id": "123",
|
|
361
|
+
"activity_id": "b3c4d5e6-f7a8-9012-3456-789012bcdef0",
|
|
362
|
+
"activity_type": "DocUploadedFromPortal",
|
|
363
|
+
"entity_id": "c2b1a9d8-7e6f-5040-3029-180716253f4e"
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
]
|
|
367
|
+
}
|
|
368
|
+
},
|
|
369
|
+
"flow_automation_task_trigger": {
|
|
370
|
+
"summary": "Flow automation task trigger execution",
|
|
371
|
+
"value": {
|
|
372
|
+
"total": 1,
|
|
373
|
+
"results": [
|
|
374
|
+
{
|
|
375
|
+
"id": "5ade051c-8a4e-2e07-7a81-c641968a0fa1",
|
|
376
|
+
"execution_status": "paused",
|
|
377
|
+
"entity_id": "d3c2b1a0-8f7e-6d5c-4b3a-291807364e5f",
|
|
378
|
+
"org_id": "123",
|
|
379
|
+
"flow_id": "9f0f178f-4c74-5b2b-af12-6160b3d1ee89",
|
|
380
|
+
"flow_name": "Journey completion follow-up",
|
|
381
|
+
"created_at": "2023-01-01T16:00:00Z",
|
|
382
|
+
"updated_at": "2023-01-01T16:03:00Z",
|
|
383
|
+
"actions": [],
|
|
384
|
+
"version": 1,
|
|
385
|
+
"resume_token": "eyJraWQiOiJrZXkifQ==",
|
|
386
|
+
"trigger_event": {
|
|
387
|
+
"type": "flow_automation_task",
|
|
388
|
+
"org_id": "123",
|
|
389
|
+
"entity_id": "d3c2b1a0-8f7e-6d5c-4b3a-291807364e5f",
|
|
390
|
+
"flow_execution_id": "wfwAJoT_cK",
|
|
391
|
+
"flow_automation_task_id": "2fa221ec-3aac-4655-ab8f-c062eca44a3",
|
|
392
|
+
"caller": {
|
|
393
|
+
"EpilotAuth": {
|
|
394
|
+
"claims": {
|
|
395
|
+
"userId": "10006129",
|
|
396
|
+
"email": "user@epilot.cloud"
|
|
397
|
+
},
|
|
398
|
+
"userId": "10006129",
|
|
399
|
+
"organizationId": "123"
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
]
|
|
405
|
+
}
|
|
406
|
+
},
|
|
407
|
+
"mixed_execution_statuses": {
|
|
408
|
+
"summary": "Multiple executions with different trigger types and statuses",
|
|
409
|
+
"value": {
|
|
410
|
+
"total": 4,
|
|
411
|
+
"results": [
|
|
412
|
+
{
|
|
413
|
+
"id": "1aef262e-9b5f-4f29-8c93-e763b90b21d3",
|
|
414
|
+
"execution_status": "success",
|
|
415
|
+
"entity_id": "e3d3ebac-baab-4395-abf4-50b5bf1f8b74",
|
|
416
|
+
"org_id": "123",
|
|
417
|
+
"flow_id": "7791b04a-16d2-44a2-9af9-2d59c25c512f",
|
|
418
|
+
"flow_name": "Send welcome email",
|
|
419
|
+
"created_at": "2023-01-01T09:00:00Z",
|
|
420
|
+
"updated_at": "2023-01-01T09:02:00Z",
|
|
421
|
+
"actions": [],
|
|
422
|
+
"version": 2,
|
|
423
|
+
"trigger_event": {
|
|
424
|
+
"type": "manual",
|
|
425
|
+
"org_id": "123",
|
|
426
|
+
"entity_id": "e3d3ebac-baab-4395-abf4-50b5bf1f8b74",
|
|
427
|
+
"caller": {
|
|
428
|
+
"EpilotAuth": {
|
|
429
|
+
"claims": {
|
|
430
|
+
"userId": "10006129",
|
|
431
|
+
"email": "admin@epilot.cloud"
|
|
432
|
+
},
|
|
433
|
+
"userId": "10006129",
|
|
434
|
+
"organizationId": "123"
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
"id": "2bef373f-ac60-5039-9da4-f874ca1c32e4",
|
|
441
|
+
"execution_status": "in_progress",
|
|
442
|
+
"entity_id": "f4e4fcbd-cbcc-4496-bf5f-60c6ce2c621e",
|
|
443
|
+
"activity_id": "a1b2c3d4-e5f6-7890-1234-567890abcdef",
|
|
444
|
+
"org_id": "123",
|
|
445
|
+
"flow_id": "8e2e067e-3c63-4b1a-8e02-6150a3d1fd89",
|
|
446
|
+
"flow_name": "Update CRM system",
|
|
447
|
+
"created_at": "2023-01-01T10:30:00Z",
|
|
448
|
+
"updated_at": "2023-01-01T10:31:00Z",
|
|
449
|
+
"actions": [],
|
|
450
|
+
"version": 1,
|
|
451
|
+
"trigger_event": {
|
|
452
|
+
"type": "entity_operation",
|
|
453
|
+
"entity_id": "f4e4fcbd-cbcc-4496-bf5f-60c6ce2c621e",
|
|
454
|
+
"org_id": "123",
|
|
455
|
+
"activity_id": "a1b2c3d4-e5f6-7890-1234-567890abcdef",
|
|
456
|
+
"operation_type": "createEntity"
|
|
457
|
+
}
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
"id": "3cef484g-bd71-6149-ae04-0985db2d43f5",
|
|
461
|
+
"execution_status": "failed",
|
|
462
|
+
"entity_id": "c2b1a9d8-7e6f-5040-3029-180716253f4e",
|
|
463
|
+
"activity_id": "b3c4d5e6-f7a8-9012-3456-789012bcdef0",
|
|
464
|
+
"org_id": "123",
|
|
465
|
+
"flow_id": "6d1d956d-2b52-4a0a-9e01-5049a2c0ee78",
|
|
466
|
+
"flow_name": "Generate invoice",
|
|
467
|
+
"created_at": "2023-01-01T11:15:00Z",
|
|
468
|
+
"updated_at": "2023-01-01T11:16:30Z",
|
|
469
|
+
"actions": [],
|
|
470
|
+
"version": 1,
|
|
471
|
+
"trigger_event": {
|
|
472
|
+
"type": "entity_activity",
|
|
473
|
+
"org_id": "123",
|
|
474
|
+
"activity_id": "b3c4d5e6-f7a8-9012-3456-789012bcdef0",
|
|
475
|
+
"activity_type": "CreateMeterReading",
|
|
476
|
+
"entity_id": "c2b1a9d8-7e6f-5040-3029-180716253f4e"
|
|
477
|
+
}
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
"id": "4def595h-ce82-7259-bf15-1a96ec3e54g6",
|
|
481
|
+
"execution_status": "scheduled",
|
|
482
|
+
"entity_id": "d3c2b1a0-8f7e-6d5c-4b3a-291807364e5f",
|
|
483
|
+
"org_id": "123",
|
|
484
|
+
"flow_id": "9f0f178f-4c74-5b2b-af12-6160b3d1ee89",
|
|
485
|
+
"flow_name": "Scheduled reminder",
|
|
486
|
+
"created_at": "2023-01-01T12:45:00Z",
|
|
487
|
+
"updated_at": "2023-01-01T12:45:00Z",
|
|
488
|
+
"actions": [],
|
|
489
|
+
"version": 1,
|
|
490
|
+
"trigger_event": {
|
|
491
|
+
"type": "flow_automation_task",
|
|
492
|
+
"org_id": "123",
|
|
493
|
+
"entity_id": "d3c2b1a0-8f7e-6d5c-4b3a-291807364e5f",
|
|
494
|
+
"flow_execution_id": "xgxBKpU_dL",
|
|
495
|
+
"flow_automation_task_id": "3gb332fd-4bbd-5766-bc9g-d173fdb55b4",
|
|
496
|
+
"caller": {
|
|
497
|
+
"EpilotAuth": {
|
|
498
|
+
"claims": {
|
|
499
|
+
"userId": "10006130",
|
|
500
|
+
"email": "scheduler@epilot.cloud"
|
|
501
|
+
},
|
|
502
|
+
"userId": "10006130",
|
|
503
|
+
"organizationId": "123"
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
]
|
|
509
|
+
}
|
|
510
|
+
}
|
|
276
511
|
}
|
|
277
512
|
}
|
|
278
513
|
}
|
|
@@ -631,6 +866,7 @@
|
|
|
631
866
|
"schemas": {
|
|
632
867
|
"AutomationFlowId": {
|
|
633
868
|
"type": "string",
|
|
869
|
+
"description": "ID of the Automation Flow",
|
|
634
870
|
"example": "7791b04a-16d2-44a2-9af9-2d59c25c512f",
|
|
635
871
|
"readOnly": true
|
|
636
872
|
},
|
|
@@ -712,7 +948,7 @@
|
|
|
712
948
|
"type": "array",
|
|
713
949
|
"description": "The actions (nodes) of the automation flow",
|
|
714
950
|
"items": {
|
|
715
|
-
"$ref": "#/components/schemas/
|
|
951
|
+
"$ref": "#/components/schemas/AnyAction"
|
|
716
952
|
},
|
|
717
953
|
"readOnly": true
|
|
718
954
|
},
|
|
@@ -2551,6 +2787,9 @@
|
|
|
2551
2787
|
},
|
|
2552
2788
|
{
|
|
2553
2789
|
"$ref": "#/components/schemas/TriggerEventEntityOperation"
|
|
2790
|
+
},
|
|
2791
|
+
{
|
|
2792
|
+
"$ref": "#/components/schemas/TriggerEventFlowAutomationTask"
|
|
2554
2793
|
}
|
|
2555
2794
|
]
|
|
2556
2795
|
}
|
|
@@ -2589,6 +2828,42 @@
|
|
|
2589
2828
|
"entity_id"
|
|
2590
2829
|
]
|
|
2591
2830
|
},
|
|
2831
|
+
"TriggerEventFlowAutomationTask": {
|
|
2832
|
+
"type": "object",
|
|
2833
|
+
"properties": {
|
|
2834
|
+
"type": {
|
|
2835
|
+
"type": "string",
|
|
2836
|
+
"enum": [
|
|
2837
|
+
"flow_automation_task"
|
|
2838
|
+
]
|
|
2839
|
+
},
|
|
2840
|
+
"org_id": {
|
|
2841
|
+
"type": "string",
|
|
2842
|
+
"example": "123"
|
|
2843
|
+
},
|
|
2844
|
+
"entity_id": {
|
|
2845
|
+
"$ref": "#/components/schemas/EntityId"
|
|
2846
|
+
},
|
|
2847
|
+
"flow_execution_id": {
|
|
2848
|
+
"type": "string",
|
|
2849
|
+
"example": "wfwAJoT_cK"
|
|
2850
|
+
},
|
|
2851
|
+
"flow_automation_task_id": {
|
|
2852
|
+
"type": "string",
|
|
2853
|
+
"format": "UUID",
|
|
2854
|
+
"example": "2fa221ec-3aac-4655-ab8f-c062eca44a3"
|
|
2855
|
+
},
|
|
2856
|
+
"caller": {
|
|
2857
|
+
"$ref": "#/components/schemas/ApiCallerContext"
|
|
2858
|
+
}
|
|
2859
|
+
},
|
|
2860
|
+
"required": [
|
|
2861
|
+
"org_id",
|
|
2862
|
+
"entity_id",
|
|
2863
|
+
"flow_execution_id",
|
|
2864
|
+
"flow_automation_task_id"
|
|
2865
|
+
]
|
|
2866
|
+
},
|
|
2592
2867
|
"TriggerEventEntityActivity": {
|
|
2593
2868
|
"type": "object",
|
|
2594
2869
|
"properties": {
|
|
@@ -2714,6 +2989,7 @@
|
|
|
2714
2989
|
"type": "string",
|
|
2715
2990
|
"enum": [
|
|
2716
2991
|
"pending",
|
|
2992
|
+
"starting",
|
|
2717
2993
|
"in_progress",
|
|
2718
2994
|
"paused",
|
|
2719
2995
|
"success",
|
|
@@ -2750,6 +3026,15 @@
|
|
|
2750
3026
|
},
|
|
2751
3027
|
"flow_id": {
|
|
2752
3028
|
"$ref": "#/components/schemas/AutomationFlowId"
|
|
3029
|
+
},
|
|
3030
|
+
"flow_execution_id": {
|
|
3031
|
+
"type": "string",
|
|
3032
|
+
"description": "ID of the Flow Execution"
|
|
3033
|
+
},
|
|
3034
|
+
"flow_automation_task_id": {
|
|
3035
|
+
"type": "string",
|
|
3036
|
+
"format": "UUID",
|
|
3037
|
+
"description": "ID of the automated flow action"
|
|
2753
3038
|
}
|
|
2754
3039
|
},
|
|
2755
3040
|
"required": [
|
|
@@ -2855,8 +3140,7 @@
|
|
|
2855
3140
|
"status",
|
|
2856
3141
|
"created_by",
|
|
2857
3142
|
"created_at",
|
|
2858
|
-
"updated_at"
|
|
2859
|
-
"execution_summary"
|
|
3143
|
+
"updated_at"
|
|
2860
3144
|
],
|
|
2861
3145
|
"properties": {
|
|
2862
3146
|
"job_id": {
|
|
@@ -2870,11 +3154,13 @@
|
|
|
2870
3154
|
},
|
|
2871
3155
|
"status": {
|
|
2872
3156
|
"type": "string",
|
|
2873
|
-
"description": "Status of the bulk trigger automation job\n* approval: Waiting for user approval to start the bulk trigger automation\n*
|
|
3157
|
+
"description": "Status of the bulk trigger automation job\n* approval: Waiting for user approval to start the bulk trigger automation\n* querying_entities: Loading entities in batches\n* entities_loaded: All entities have been loaded and stored\n* executing: Automation execution are currently running\n* monitoring: All executions have been started, now monitoring their completion\n* send_report: Automation executions finished running. Report is being created & sent to the user who initiated the bulk trigger automation\n* finished: Automation executions finished running. Some may have failed. Check the status of each entity.\n* failed: Bulk trigger automation execution failed. Some executions might have started. Check the status of each entity.\n* cancelled: Bulk trigger automation execution was cancelled\n",
|
|
2874
3158
|
"enum": [
|
|
2875
3159
|
"approval",
|
|
2876
|
-
"
|
|
2877
|
-
"
|
|
3160
|
+
"querying_entities",
|
|
3161
|
+
"entities_loaded",
|
|
3162
|
+
"executing",
|
|
3163
|
+
"monitoring",
|
|
2878
3164
|
"send_report",
|
|
2879
3165
|
"finished",
|
|
2880
3166
|
"failed",
|
|
@@ -2908,6 +3194,80 @@
|
|
|
2908
3194
|
"type": "string",
|
|
2909
3195
|
"description": "Entity ID of the report file entity"
|
|
2910
3196
|
},
|
|
3197
|
+
"entity_query": {
|
|
3198
|
+
"type": "object",
|
|
3199
|
+
"description": "Query configuration for loading entities",
|
|
3200
|
+
"properties": {
|
|
3201
|
+
"type": {
|
|
3202
|
+
"type": "string",
|
|
3203
|
+
"enum": [
|
|
3204
|
+
"refs",
|
|
3205
|
+
"query",
|
|
3206
|
+
"filter"
|
|
3207
|
+
]
|
|
3208
|
+
},
|
|
3209
|
+
"data": {
|
|
3210
|
+
"oneOf": [
|
|
3211
|
+
{
|
|
3212
|
+
"type": "array",
|
|
3213
|
+
"items": {
|
|
3214
|
+
"$ref": "#/components/schemas/EntityRef"
|
|
3215
|
+
}
|
|
3216
|
+
},
|
|
3217
|
+
{
|
|
3218
|
+
"type": "string"
|
|
3219
|
+
},
|
|
3220
|
+
{
|
|
3221
|
+
"$ref": "#/components/schemas/EntitySearchFilter"
|
|
3222
|
+
}
|
|
3223
|
+
]
|
|
3224
|
+
}
|
|
3225
|
+
},
|
|
3226
|
+
"required": [
|
|
3227
|
+
"type",
|
|
3228
|
+
"data"
|
|
3229
|
+
]
|
|
3230
|
+
},
|
|
3231
|
+
"pagination_state": {
|
|
3232
|
+
"type": "object",
|
|
3233
|
+
"description": "Pagination state for entity loading",
|
|
3234
|
+
"properties": {
|
|
3235
|
+
"page_size": {
|
|
3236
|
+
"type": "integer",
|
|
3237
|
+
"description": "Number of entities per page"
|
|
3238
|
+
},
|
|
3239
|
+
"pages_processed": {
|
|
3240
|
+
"type": "integer",
|
|
3241
|
+
"description": "Number of pages processed so far"
|
|
3242
|
+
},
|
|
3243
|
+
"total_processed": {
|
|
3244
|
+
"type": "integer",
|
|
3245
|
+
"description": "Total number of entities processed so far"
|
|
3246
|
+
},
|
|
3247
|
+
"stable_query_id": {
|
|
3248
|
+
"type": "string",
|
|
3249
|
+
"description": "Stable query ID for pagination"
|
|
3250
|
+
},
|
|
3251
|
+
"search_after": {
|
|
3252
|
+
"type": "array",
|
|
3253
|
+
"description": "Last sort value used for pagination",
|
|
3254
|
+
"items": {
|
|
3255
|
+
"oneOf": [
|
|
3256
|
+
{
|
|
3257
|
+
"type": "string"
|
|
3258
|
+
},
|
|
3259
|
+
{
|
|
3260
|
+
"type": "number"
|
|
3261
|
+
}
|
|
3262
|
+
]
|
|
3263
|
+
}
|
|
3264
|
+
},
|
|
3265
|
+
"has_more": {
|
|
3266
|
+
"type": "boolean",
|
|
3267
|
+
"description": "Whether there are more entities to load"
|
|
3268
|
+
}
|
|
3269
|
+
}
|
|
3270
|
+
},
|
|
2911
3271
|
"execution_summary": {
|
|
2912
3272
|
"type": "array",
|
|
2913
3273
|
"description": "List of entities & their automation execution id & status",
|
|
@@ -2989,13 +3349,7 @@
|
|
|
2989
3349
|
"properties": {
|
|
2990
3350
|
"source_id": {
|
|
2991
3351
|
"type": "string",
|
|
2992
|
-
"format": "uuid"
|
|
2993
|
-
"description": "ID of the flow that triggers the automation"
|
|
2994
|
-
},
|
|
2995
|
-
"journey_id": {
|
|
2996
|
-
"type": "string",
|
|
2997
|
-
"format": "uuid",
|
|
2998
|
-
"description": "Certain flows can be triggered automatically by a journey, this is the ID of that journey"
|
|
3352
|
+
"format": "uuid"
|
|
2999
3353
|
}
|
|
3000
3354
|
},
|
|
3001
3355
|
"required": [
|
|
@@ -3902,10 +4256,5 @@
|
|
|
3902
4256
|
}
|
|
3903
4257
|
}
|
|
3904
4258
|
}
|
|
3905
|
-
}
|
|
3906
|
-
"servers": [
|
|
3907
|
-
{
|
|
3908
|
-
"url": "https://automation.sls.epilot.io"
|
|
3909
|
-
}
|
|
3910
|
-
]
|
|
4259
|
+
}
|
|
3911
4260
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epilot/automation-client",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.19.0",
|
|
4
4
|
"description": "Client library for epilot automation API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"test": "jest",
|
|
26
26
|
"typescript": "tsc",
|
|
27
27
|
"bundle-definition": "webpack",
|
|
28
|
-
"openapi": "node ../../scripts/update-openapi.js
|
|
28
|
+
"openapi": "node ../../scripts/update-openapi.js /Users/sureshs/workspace/automation-api/lambda/ApiHandlerFunction/openapi.yml",
|
|
29
29
|
"typegen": "openapi typegen src/openapi.json --client -b '/* eslint-disable */' > src/openapi.d.ts",
|
|
30
30
|
"build": "tsc && npm run build:patch && npm run bundle-definition",
|
|
31
31
|
"build:patch": "sed -i'' -e '/^__exportStar.*openapi.*$/d' dist/index.js",
|