@epilot/automation-client 2.16.4 → 2.16.5-rc.2

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 n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var r=n(o(240));t.default=r.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":{"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}(914),n=exports;for(var r in o)n[r]=o[r];o.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})();
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":{}}}}},"servers":[{"url":"https://automation.sls.epilot.io"}]}')}},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})})();
@@ -220,5 +220,10 @@
220
220
  }
221
221
  }
222
222
  }
223
- }
223
+ },
224
+ "servers": [
225
+ {
226
+ "url": "https://automation.sls.epilot.io"
227
+ }
228
+ ]
224
229
  }
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 | TriggerWebhookAction | CreateDocumentAction | SendEmailAction | /* Creates an order entity with prices from journey */ CartCheckoutAction | CustomAction | AutomationAction;
129
+ export type AnyAction = MapEntityAction | TriggerWorkflowAction | TriggerWebhookAction | ERPAction | CreateDocumentAction | SendEmailAction | /* Creates an order entity with prices from journey */ CartCheckoutAction | CustomAction | AutomationAction;
130
130
  export type AnyActionConfig = /**
131
131
  * example:
132
132
  * {
@@ -297,6 +297,21 @@ declare namespace Components {
297
297
  * }
298
298
  */
299
299
  TriggerWebhookActionConfig | /**
300
+ * example:
301
+ * {
302
+ * "id": "2520gja-2sgmsaga-0asg-822jgal",
303
+ * "name": "ERP",
304
+ * "type": "erp",
305
+ * "config": {
306
+ * "entity_sources": [
307
+ * "contact",
308
+ * "account"
309
+ * ],
310
+ * "target_webhook_id": "25jg9ag2ga"
311
+ * }
312
+ * }
313
+ */
314
+ ERPActionConfig | /**
300
315
  * example:
301
316
  * {
302
317
  * "id": "08g988-ojt2jtaga-292h-8978gsaga",
@@ -443,7 +458,7 @@ declare namespace Components {
443
458
  * ```
444
459
  *
445
460
  */
446
- EntityOperationTrigger | ActivityTrigger | EntityManualTrigger | ReceivedEmailTrigger;
461
+ EntityOperationTrigger | ActivityTrigger | EntityManualTrigger | ReceivedEmailTrigger | FlowsTrigger;
447
462
  export interface AnythingButCondition {
448
463
  "anything-but"?: string[];
449
464
  }
@@ -793,6 +808,10 @@ declare namespace Components {
793
808
  * Who disabled the flow (system or user)
794
809
  */
795
810
  disabled_by: "system" | "user";
811
+ /**
812
+ * The 360 user email that disabled the flow
813
+ */
814
+ blame?: string;
796
815
  };
797
816
  triggers: AnyTrigger[];
798
817
  trigger_conditions?: /**
@@ -941,15 +960,46 @@ declare namespace Components {
941
960
  */
942
961
  execution_summary: /* Execution item for bulk trigger automation. It maps each entity to its automation execution id & status */ ExecItem[];
943
962
  }
944
- export interface BulkTriggerRequest {
963
+ export type BulkTriggerRequest = {
945
964
  flow_id: /**
946
965
  * example:
947
966
  * 7791b04a-16d2-44a2-9af9-2d59c25c512f
948
967
  */
949
968
  AutomationFlowId;
950
- entities_refs?: EntityRef[];
951
- entities_query?: string;
952
- }
969
+ entities_refs: EntityRef[];
970
+ } | {
971
+ flow_id: /**
972
+ * example:
973
+ * 7791b04a-16d2-44a2-9af9-2d59c25c512f
974
+ */
975
+ AutomationFlowId;
976
+ entities_query: string;
977
+ } | {
978
+ flow_id: /**
979
+ * example:
980
+ * 7791b04a-16d2-44a2-9af9-2d59c25c512f
981
+ */
982
+ AutomationFlowId;
983
+ entities_filter: /**
984
+ * 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.
985
+ * example:
986
+ * [
987
+ * {
988
+ * "term": {
989
+ * "_schema": "contact"
990
+ * }
991
+ * },
992
+ * {
993
+ * "terms": {
994
+ * "status": [
995
+ * "active"
996
+ * ]
997
+ * }
998
+ * }
999
+ * ]
1000
+ */
1001
+ EntitySearchFilter;
1002
+ };
953
1003
  /**
954
1004
  * Creates an order entity with prices from journey
955
1005
  */
@@ -1379,6 +1429,139 @@ declare namespace Components {
1379
1429
  export type DiffAdded = FilterConditionOnEvent;
1380
1430
  export type DiffDeleted = FilterConditionOnEvent;
1381
1431
  export type DiffUpdated = FilterConditionOnEvent;
1432
+ export interface ERPAction {
1433
+ id?: /**
1434
+ * example:
1435
+ * 9ec3711b-db63-449c-b894-54d5bb622a8f
1436
+ */
1437
+ AutomationActionId;
1438
+ flow_action_id?: /**
1439
+ * example:
1440
+ * 9ec3711b-db63-449c-b894-54d5bb622a8f
1441
+ */
1442
+ AutomationActionId;
1443
+ name?: string;
1444
+ type?: "trigger-webhook";
1445
+ config?: ERPConfig;
1446
+ /**
1447
+ * Whether to stop execution in a failed state if this action fails
1448
+ */
1449
+ allow_failure?: boolean;
1450
+ /**
1451
+ * Flag indicating whether the action was created automatically or manually
1452
+ */
1453
+ created_automatically?: boolean;
1454
+ /**
1455
+ * Flag indicating whether the same action can be in bulk in a single execution. e.g; send-email / map-entity
1456
+ */
1457
+ is_bulk_action?: boolean;
1458
+ reason?: {
1459
+ /**
1460
+ * Why the action has to be skipped/failed
1461
+ * example:
1462
+ * There are no registered portal users for the given emails, hence skipping the action
1463
+ */
1464
+ message?: string;
1465
+ /**
1466
+ * Extra metadata about the skipping reason - such as a certain condition not met, etc.
1467
+ */
1468
+ payload?: {
1469
+ [name: string]: any;
1470
+ };
1471
+ };
1472
+ /**
1473
+ * Condition Id to be checked before executing the action
1474
+ */
1475
+ condition_id?: string;
1476
+ /**
1477
+ * Schedule Id which indicates the schedule of the action
1478
+ */
1479
+ schedule_id?: string;
1480
+ execution_status?: ExecutionStatus;
1481
+ started_at?: string;
1482
+ updated_at?: string;
1483
+ /**
1484
+ * example:
1485
+ * {}
1486
+ */
1487
+ outputs?: {
1488
+ [name: string]: any;
1489
+ };
1490
+ error_output?: ErrorOutput;
1491
+ retry_strategy?: /* different behaviors for retrying failed execution actions. */ RetryStrategy;
1492
+ }
1493
+ /**
1494
+ * example:
1495
+ * {
1496
+ * "id": "2520gja-2sgmsaga-0asg-822jgal",
1497
+ * "name": "ERP",
1498
+ * "type": "erp",
1499
+ * "config": {
1500
+ * "entity_sources": [
1501
+ * "contact",
1502
+ * "account"
1503
+ * ],
1504
+ * "target_webhook_id": "25jg9ag2ga"
1505
+ * }
1506
+ * }
1507
+ */
1508
+ export interface ERPActionConfig {
1509
+ id?: /**
1510
+ * example:
1511
+ * 9ec3711b-db63-449c-b894-54d5bb622a8f
1512
+ */
1513
+ AutomationActionId;
1514
+ flow_action_id?: /**
1515
+ * example:
1516
+ * 9ec3711b-db63-449c-b894-54d5bb622a8f
1517
+ */
1518
+ AutomationActionId;
1519
+ name?: string;
1520
+ type?: "erp";
1521
+ config?: ERPConfig;
1522
+ /**
1523
+ * Whether to stop execution in a failed state if this action fails
1524
+ */
1525
+ allow_failure?: boolean;
1526
+ /**
1527
+ * Flag indicating whether the action was created automatically or manually
1528
+ */
1529
+ created_automatically?: boolean;
1530
+ /**
1531
+ * Flag indicating whether the same action can be in bulk in a single execution. e.g; send-email / map-entity
1532
+ */
1533
+ is_bulk_action?: boolean;
1534
+ reason?: {
1535
+ /**
1536
+ * Why the action has to be skipped/failed
1537
+ * example:
1538
+ * There are no registered portal users for the given emails, hence skipping the action
1539
+ */
1540
+ message?: string;
1541
+ /**
1542
+ * Extra metadata about the skipping reason - such as a certain condition not met, etc.
1543
+ */
1544
+ payload?: {
1545
+ [name: string]: any;
1546
+ };
1547
+ };
1548
+ /**
1549
+ * Condition Id to be checked before executing the action
1550
+ */
1551
+ condition_id?: string;
1552
+ /**
1553
+ * Schedule Id which indicates the schedule of the action
1554
+ */
1555
+ schedule_id?: string;
1556
+ }
1557
+ export interface ERPConfig {
1558
+ entity_sources?: string[];
1559
+ target_webhook_id?: string;
1560
+ /**
1561
+ * Whether to wait for the request to finish before continuing automation execution
1562
+ */
1563
+ sync?: boolean;
1564
+ }
1382
1565
  /**
1383
1566
  * example:
1384
1567
  * e3d3ebac-baab-4395-abf4-50b5bf1f8b74
@@ -1414,7 +1597,7 @@ declare namespace Components {
1414
1597
  schema?: string;
1415
1598
  };
1416
1599
  }
1417
- export type EntityOperation = "createEntity" | "updateEntity" | "deleteEntity";
1600
+ export type EntityOperation = "createEntity" | "updateEntity" | "deleteEntity" | "softDeleteEntity" | "restoreEntity";
1418
1601
  /**
1419
1602
  * - If provides filter_config, executes an automation based on the filtered configuration when an entity event occurs.
1420
1603
  * - The conditions on a filter follows the event bridge patterns - `https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html`
@@ -1628,6 +1811,166 @@ declare namespace Components {
1628
1811
  EntityId;
1629
1812
  entity_schema: string;
1630
1813
  }
1814
+ /**
1815
+ * 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.
1816
+ * example:
1817
+ * [
1818
+ * {
1819
+ * "term": {
1820
+ * "_schema": "contact"
1821
+ * }
1822
+ * },
1823
+ * {
1824
+ * "terms": {
1825
+ * "status": [
1826
+ * "active"
1827
+ * ]
1828
+ * }
1829
+ * }
1830
+ * ]
1831
+ */
1832
+ export type EntitySearchFilter = {
1833
+ /**
1834
+ * Returns documents that contain an exact term in a provided field.
1835
+ *
1836
+ * To return a document, the query term must exactly match the queried field's value, including whitespace and capitalization.
1837
+ *
1838
+ * You likely DO NOT want to use this filter on text fields and want to target its .keyword instead.
1839
+ *
1840
+ * example:
1841
+ * {
1842
+ * "_schema": "contact"
1843
+ * }
1844
+ */
1845
+ term?: {
1846
+ [name: string]: /* A filter field value. */ EntitySearchFilterValue;
1847
+ };
1848
+ /**
1849
+ * Returns documents that contain one of the exact terms in a provided field. See term filter for more info.
1850
+ * example:
1851
+ * {
1852
+ * "status": [
1853
+ * "active"
1854
+ * ]
1855
+ * }
1856
+ */
1857
+ terms?: {
1858
+ [name: string]: /* A filter field value. */ EntitySearchFilterValue[];
1859
+ };
1860
+ /**
1861
+ * Returns documents based on their IDs.
1862
+ * example:
1863
+ * {
1864
+ * "values": [
1865
+ * "550e8400-e29b-41d4-a716-446655440000"
1866
+ * ]
1867
+ * }
1868
+ */
1869
+ ids?: {
1870
+ values?: string[];
1871
+ };
1872
+ /**
1873
+ * Returns documents with fields that have terms within a certain range.
1874
+ * example:
1875
+ * {
1876
+ * "_created_at": {
1877
+ * "gte": "2021-01-01T00:00:00.000Z",
1878
+ * "lte": "2021-01-31T23:59:59.999Z"
1879
+ * }
1880
+ * }
1881
+ */
1882
+ range?: {
1883
+ [name: string]: {
1884
+ gt?: /* A filter field value. */ EntitySearchFilterValue;
1885
+ gte?: /* A filter field value. */ EntitySearchFilterValue;
1886
+ lt?: /* A filter field value. */ EntitySearchFilterValue;
1887
+ lte?: /* A filter field value. */ EntitySearchFilterValue;
1888
+ /**
1889
+ * The date format used to parse date values.
1890
+ */
1891
+ format?: string;
1892
+ /**
1893
+ * Indicates how the range query matches values for range fields.
1894
+ */
1895
+ relation?: "INTERSECTS" | "CONTAINS" | "WITHIN";
1896
+ /**
1897
+ * Coordinated Universal Time (UTC) offset or IANA time zone used to convert date values in the query to UTC.
1898
+ */
1899
+ time_zone?: string;
1900
+ };
1901
+ };
1902
+ /**
1903
+ * Returns documents that have a value in the specified field.
1904
+ * example:
1905
+ * {
1906
+ * "field": "_tags"
1907
+ * }
1908
+ */
1909
+ exists?: {
1910
+ field: string;
1911
+ };
1912
+ $and?: /**
1913
+ * 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.
1914
+ * example:
1915
+ * [
1916
+ * {
1917
+ * "term": {
1918
+ * "_schema": "contact"
1919
+ * }
1920
+ * },
1921
+ * {
1922
+ * "terms": {
1923
+ * "status": [
1924
+ * "active"
1925
+ * ]
1926
+ * }
1927
+ * }
1928
+ * ]
1929
+ */
1930
+ EntitySearchFilter;
1931
+ $or?: /**
1932
+ * 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.
1933
+ * example:
1934
+ * [
1935
+ * {
1936
+ * "term": {
1937
+ * "_schema": "contact"
1938
+ * }
1939
+ * },
1940
+ * {
1941
+ * "terms": {
1942
+ * "status": [
1943
+ * "active"
1944
+ * ]
1945
+ * }
1946
+ * }
1947
+ * ]
1948
+ */
1949
+ EntitySearchFilter;
1950
+ $not?: /**
1951
+ * 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.
1952
+ * example:
1953
+ * [
1954
+ * {
1955
+ * "term": {
1956
+ * "_schema": "contact"
1957
+ * }
1958
+ * },
1959
+ * {
1960
+ * "terms": {
1961
+ * "status": [
1962
+ * "active"
1963
+ * ]
1964
+ * }
1965
+ * }
1966
+ * ]
1967
+ */
1968
+ EntitySearchFilter;
1969
+ }[];
1970
+ /**
1971
+ * A filter field value.
1972
+ */
1973
+ export type EntitySearchFilterValue = /* A filter field value. */ (string | null) | number | boolean;
1631
1974
  export interface EqualsIgnoreCaseCondition {
1632
1975
  "equals-ignore-case"?: string;
1633
1976
  }
@@ -1685,6 +2028,17 @@ declare namespace Components {
1685
2028
  export type FilterConditionOnEvent = OrCondition | {
1686
2029
  [name: string]: (string | EqualsIgnoreCaseCondition | AnythingButCondition | NumericCondition | ExistsCondition | PrefixCondition | SuffixCondition | WildcardCondition)[];
1687
2030
  };
2031
+ export interface FlowsTrigger {
2032
+ /**
2033
+ * example:
2034
+ * 12d4f45a-1883-4841-a94c-5928cb338a94
2035
+ */
2036
+ id?: string; // uuid
2037
+ type: "flows_trigger";
2038
+ configuration: {
2039
+ source_id: string; // uuid
2040
+ };
2041
+ }
1688
2042
  export interface FrontendSubmitTrigger {
1689
2043
  /**
1690
2044
  * example:
@@ -3176,6 +3530,7 @@ declare namespace Paths {
3176
3530
  }
3177
3531
  }
3178
3532
 
3533
+
3179
3534
  export interface OperationMethods {
3180
3535
  /**
3181
3536
  * searchFlows - searchFlows
@@ -3490,6 +3845,7 @@ export interface PathsDictionary {
3490
3845
 
3491
3846
  export type Client = OpenAPIClient<OperationMethods, PathsDictionary>
3492
3847
 
3848
+
3493
3849
  export type ActionCondition = Components.Schemas.ActionCondition;
3494
3850
  export type ActionSchedule = Components.Schemas.ActionSchedule;
3495
3851
  export type ActionScheduleSource = Components.Schemas.ActionScheduleSource;
@@ -3527,12 +3883,17 @@ export type CustomAction = Components.Schemas.CustomAction;
3527
3883
  export type DiffAdded = Components.Schemas.DiffAdded;
3528
3884
  export type DiffDeleted = Components.Schemas.DiffDeleted;
3529
3885
  export type DiffUpdated = Components.Schemas.DiffUpdated;
3886
+ export type ERPAction = Components.Schemas.ERPAction;
3887
+ export type ERPActionConfig = Components.Schemas.ERPActionConfig;
3888
+ export type ERPConfig = Components.Schemas.ERPConfig;
3530
3889
  export type EntityId = Components.Schemas.EntityId;
3531
3890
  export type EntityItemSnapshot = Components.Schemas.EntityItemSnapshot;
3532
3891
  export type EntityManualTrigger = Components.Schemas.EntityManualTrigger;
3533
3892
  export type EntityOperation = Components.Schemas.EntityOperation;
3534
3893
  export type EntityOperationTrigger = Components.Schemas.EntityOperationTrigger;
3535
3894
  export type EntityRef = Components.Schemas.EntityRef;
3895
+ export type EntitySearchFilter = Components.Schemas.EntitySearchFilter;
3896
+ export type EntitySearchFilterValue = Components.Schemas.EntitySearchFilterValue;
3536
3897
  export type EqualsIgnoreCaseCondition = Components.Schemas.EqualsIgnoreCaseCondition;
3537
3898
  export type ErrorCode = Components.Schemas.ErrorCode;
3538
3899
  export type ErrorDetail = Components.Schemas.ErrorDetail;
@@ -3542,6 +3903,7 @@ export type ExecItem = Components.Schemas.ExecItem;
3542
3903
  export type ExecutionStatus = Components.Schemas.ExecutionStatus;
3543
3904
  export type ExistsCondition = Components.Schemas.ExistsCondition;
3544
3905
  export type FilterConditionOnEvent = Components.Schemas.FilterConditionOnEvent;
3906
+ export type FlowsTrigger = Components.Schemas.FlowsTrigger;
3545
3907
  export type FrontendSubmitTrigger = Components.Schemas.FrontendSubmitTrigger;
3546
3908
  export type GetExecutionsResp = Components.Schemas.GetExecutionsResp;
3547
3909
  export type JobId = Components.Schemas.JobId;
package/dist/openapi.json CHANGED
@@ -330,9 +330,15 @@
330
330
  },
331
331
  "example": {
332
332
  "flow_id": "8e2e067e-3c63-4b1a-8e02-6150a3d1fd89",
333
- "entity_ids": [
334
- "7791b04a-16d2-44a2-9af9-2d59c25c512f",
335
- "b35a6c51-2a15-4ef1-9623-20db37b0744f"
333
+ "entities_refs": [
334
+ {
335
+ "entity_schema": "opportunity",
336
+ "entity_id": "7791b04a-16d2-44a2-9af9-2d59c25c512f"
337
+ },
338
+ {
339
+ "entity_schema": "opportunity",
340
+ "entity_id": "b35a6c51-2a15-4ef1-9623-20db37b0744f"
341
+ }
336
342
  ]
337
343
  }
338
344
  }
@@ -662,6 +668,10 @@
662
668
  "user"
663
669
  ],
664
670
  "description": "Who disabled the flow (system or user)"
671
+ },
672
+ "blame": {
673
+ "type": "string",
674
+ "description": "The 360 user email that disabled the flow"
665
675
  }
666
676
  },
667
677
  "required": [
@@ -822,6 +832,9 @@
822
832
  },
823
833
  {
824
834
  "$ref": "#/components/schemas/ReceivedEmailTrigger"
835
+ },
836
+ {
837
+ "$ref": "#/components/schemas/FlowsTrigger"
825
838
  }
826
839
  ]
827
840
  },
@@ -836,6 +849,9 @@
836
849
  {
837
850
  "$ref": "#/components/schemas/TriggerWebhookAction"
838
851
  },
852
+ {
853
+ "$ref": "#/components/schemas/ERPAction"
854
+ },
839
855
  {
840
856
  "$ref": "#/components/schemas/CreateDocumentAction"
841
857
  },
@@ -864,6 +880,9 @@
864
880
  {
865
881
  "$ref": "#/components/schemas/TriggerWebhookActionConfig"
866
882
  },
883
+ {
884
+ "$ref": "#/components/schemas/ERPActionConfig"
885
+ },
867
886
  {
868
887
  "$ref": "#/components/schemas/CreateDocumentActionConfig"
869
888
  },
@@ -2119,6 +2138,77 @@
2119
2138
  }
2120
2139
  }
2121
2140
  },
2141
+ "ERPActionConfig": {
2142
+ "allOf": [
2143
+ {
2144
+ "$ref": "#/components/schemas/AutomationActionConfig"
2145
+ },
2146
+ {
2147
+ "type": "object",
2148
+ "properties": {
2149
+ "type": {
2150
+ "enum": [
2151
+ "erp"
2152
+ ]
2153
+ },
2154
+ "config": {
2155
+ "$ref": "#/components/schemas/ERPConfig"
2156
+ }
2157
+ }
2158
+ }
2159
+ ],
2160
+ "example": {
2161
+ "id": "2520gja-2sgmsaga-0asg-822jgal",
2162
+ "name": "ERP",
2163
+ "type": "erp",
2164
+ "config": {
2165
+ "entity_sources": [
2166
+ "contact",
2167
+ "account"
2168
+ ],
2169
+ "target_webhook_id": "25jg9ag2ga"
2170
+ }
2171
+ }
2172
+ },
2173
+ "ERPAction": {
2174
+ "allOf": [
2175
+ {
2176
+ "$ref": "#/components/schemas/AutomationAction"
2177
+ },
2178
+ {
2179
+ "type": "object",
2180
+ "properties": {
2181
+ "type": {
2182
+ "enum": [
2183
+ "trigger-webhook"
2184
+ ]
2185
+ },
2186
+ "config": {
2187
+ "$ref": "#/components/schemas/ERPConfig"
2188
+ }
2189
+ }
2190
+ }
2191
+ ]
2192
+ },
2193
+ "ERPConfig": {
2194
+ "type": "object",
2195
+ "properties": {
2196
+ "entity_sources": {
2197
+ "type": "array",
2198
+ "items": {
2199
+ "type": "string"
2200
+ }
2201
+ },
2202
+ "target_webhook_id": {
2203
+ "type": "string"
2204
+ },
2205
+ "sync": {
2206
+ "type": "boolean",
2207
+ "description": "Whether to wait for the request to finish before continuing automation execution",
2208
+ "default": false
2209
+ }
2210
+ }
2211
+ },
2122
2212
  "ConditionStatement": {
2123
2213
  "type": "object",
2124
2214
  "properties": {
@@ -2630,23 +2720,58 @@
2630
2720
  ]
2631
2721
  },
2632
2722
  "BulkTriggerRequest": {
2633
- "type": "object",
2634
- "properties": {
2635
- "flow_id": {
2636
- "$ref": "#/components/schemas/AutomationFlowId"
2723
+ "oneOf": [
2724
+ {
2725
+ "type": "object",
2726
+ "properties": {
2727
+ "flow_id": {
2728
+ "$ref": "#/components/schemas/AutomationFlowId"
2729
+ },
2730
+ "entities_refs": {
2731
+ "type": "array",
2732
+ "items": {
2733
+ "$ref": "#/components/schemas/EntityRef"
2734
+ }
2735
+ }
2736
+ },
2737
+ "required": [
2738
+ "flow_id",
2739
+ "entities_refs"
2740
+ ],
2741
+ "additionalProperties": false
2637
2742
  },
2638
- "entities_refs": {
2639
- "type": "array",
2640
- "items": {
2641
- "$ref": "#/components/schemas/EntityRef"
2642
- }
2743
+ {
2744
+ "type": "object",
2745
+ "properties": {
2746
+ "flow_id": {
2747
+ "$ref": "#/components/schemas/AutomationFlowId"
2748
+ },
2749
+ "entities_query": {
2750
+ "type": "string"
2751
+ }
2752
+ },
2753
+ "required": [
2754
+ "flow_id",
2755
+ "entities_query"
2756
+ ],
2757
+ "additionalProperties": false
2643
2758
  },
2644
- "entities_query": {
2645
- "type": "string"
2759
+ {
2760
+ "type": "object",
2761
+ "properties": {
2762
+ "flow_id": {
2763
+ "$ref": "#/components/schemas/AutomationFlowId"
2764
+ },
2765
+ "entities_filter": {
2766
+ "$ref": "#/components/schemas/EntitySearchFilter"
2767
+ }
2768
+ },
2769
+ "required": [
2770
+ "flow_id",
2771
+ "entities_filter"
2772
+ ],
2773
+ "additionalProperties": false
2646
2774
  }
2647
- },
2648
- "required": [
2649
- "flow_id"
2650
2775
  ]
2651
2776
  },
2652
2777
  "EntityRef": {
@@ -2788,6 +2913,40 @@
2788
2913
  }
2789
2914
  }
2790
2915
  },
2916
+ "FlowsTrigger": {
2917
+ "allOf": [
2918
+ {
2919
+ "$ref": "#/components/schemas/AutomationTrigger"
2920
+ },
2921
+ {
2922
+ "type": "object",
2923
+ "properties": {
2924
+ "type": {
2925
+ "type": "string",
2926
+ "enum": [
2927
+ "flows_trigger"
2928
+ ]
2929
+ },
2930
+ "configuration": {
2931
+ "type": "object",
2932
+ "properties": {
2933
+ "source_id": {
2934
+ "type": "string",
2935
+ "format": "uuid"
2936
+ }
2937
+ },
2938
+ "required": [
2939
+ "source_id"
2940
+ ]
2941
+ }
2942
+ },
2943
+ "required": [
2944
+ "type",
2945
+ "configuration"
2946
+ ]
2947
+ }
2948
+ ]
2949
+ },
2791
2950
  "JourneySubmitTrigger": {
2792
2951
  "allOf": [
2793
2952
  {
@@ -3129,7 +3288,180 @@
3129
3288
  "enum": [
3130
3289
  "createEntity",
3131
3290
  "updateEntity",
3132
- "deleteEntity"
3291
+ "deleteEntity",
3292
+ "softDeleteEntity",
3293
+ "restoreEntity"
3294
+ ]
3295
+ },
3296
+ "EntitySearchFilter": {
3297
+ "type": "array",
3298
+ "description": "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.",
3299
+ "items": {
3300
+ "type": "object",
3301
+ "minProperties": 1,
3302
+ "maxProperties": 1,
3303
+ "properties": {
3304
+ "term": {
3305
+ "description": "Returns documents that contain an exact term in a provided field.\n\nTo return a document, the query term must exactly match the queried field's value, including whitespace and capitalization.\n\nYou likely DO NOT want to use this filter on text fields and want to target its .keyword instead.\n",
3306
+ "externalDocs": {
3307
+ "url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-term-query.html"
3308
+ },
3309
+ "type": "object",
3310
+ "minProperties": 1,
3311
+ "maxProperties": 1,
3312
+ "additionalProperties": {
3313
+ "$ref": "#/components/schemas/EntitySearchFilterValue"
3314
+ },
3315
+ "example": {
3316
+ "_schema": "contact"
3317
+ }
3318
+ },
3319
+ "terms": {
3320
+ "description": "Returns documents that contain one of the exact terms in a provided field. See term filter for more info.",
3321
+ "externalDocs": {
3322
+ "url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-terms-query.html"
3323
+ },
3324
+ "type": "object",
3325
+ "minProperties": 1,
3326
+ "maxProperties": 1,
3327
+ "additionalProperties": {
3328
+ "type": "array",
3329
+ "items": {
3330
+ "$ref": "#/components/schemas/EntitySearchFilterValue"
3331
+ }
3332
+ },
3333
+ "example": {
3334
+ "status": [
3335
+ "active"
3336
+ ]
3337
+ }
3338
+ },
3339
+ "ids": {
3340
+ "description": "Returns documents based on their IDs.",
3341
+ "externalDocs": {
3342
+ "url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-ids-query.html"
3343
+ },
3344
+ "type": "object",
3345
+ "properties": {
3346
+ "values": {
3347
+ "type": "array",
3348
+ "items": {
3349
+ "type": "string"
3350
+ }
3351
+ }
3352
+ },
3353
+ "example": {
3354
+ "values": [
3355
+ "550e8400-e29b-41d4-a716-446655440000"
3356
+ ]
3357
+ }
3358
+ },
3359
+ "range": {
3360
+ "description": "Returns documents with fields that have terms within a certain range.",
3361
+ "externalDocs": {
3362
+ "url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-range-query.html"
3363
+ },
3364
+ "type": "object",
3365
+ "minProperties": 1,
3366
+ "maxProperties": 1,
3367
+ "additionalProperties": {
3368
+ "type": "object",
3369
+ "properties": {
3370
+ "gt": {
3371
+ "$ref": "#/components/schemas/EntitySearchFilterValue"
3372
+ },
3373
+ "gte": {
3374
+ "$ref": "#/components/schemas/EntitySearchFilterValue"
3375
+ },
3376
+ "lt": {
3377
+ "$ref": "#/components/schemas/EntitySearchFilterValue"
3378
+ },
3379
+ "lte": {
3380
+ "$ref": "#/components/schemas/EntitySearchFilterValue"
3381
+ },
3382
+ "format": {
3383
+ "type": "string",
3384
+ "description": "The date format used to parse date values."
3385
+ },
3386
+ "relation": {
3387
+ "type": "string",
3388
+ "enum": [
3389
+ "INTERSECTS",
3390
+ "CONTAINS",
3391
+ "WITHIN"
3392
+ ],
3393
+ "description": "Indicates how the range query matches values for range fields."
3394
+ },
3395
+ "time_zone": {
3396
+ "type": "string",
3397
+ "description": "Coordinated Universal Time (UTC) offset or IANA time zone used to convert date values in the query to UTC."
3398
+ }
3399
+ }
3400
+ },
3401
+ "example": {
3402
+ "_created_at": {
3403
+ "gte": "2021-01-01T00:00:00.000Z",
3404
+ "lte": "2021-01-31T23:59:59.999Z"
3405
+ }
3406
+ }
3407
+ },
3408
+ "exists": {
3409
+ "description": "Returns documents that have a value in the specified field.",
3410
+ "externalDocs": {
3411
+ "url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-exists-query.html"
3412
+ },
3413
+ "type": "object",
3414
+ "properties": {
3415
+ "field": {
3416
+ "type": "string"
3417
+ }
3418
+ },
3419
+ "required": [
3420
+ "field"
3421
+ ],
3422
+ "example": {
3423
+ "field": "_tags"
3424
+ }
3425
+ },
3426
+ "$and": {
3427
+ "$ref": "#/components/schemas/EntitySearchFilter"
3428
+ },
3429
+ "$or": {
3430
+ "$ref": "#/components/schemas/EntitySearchFilter"
3431
+ },
3432
+ "$not": {
3433
+ "$ref": "#/components/schemas/EntitySearchFilter"
3434
+ }
3435
+ }
3436
+ },
3437
+ "example": [
3438
+ {
3439
+ "term": {
3440
+ "_schema": "contact"
3441
+ }
3442
+ },
3443
+ {
3444
+ "terms": {
3445
+ "status": [
3446
+ "active"
3447
+ ]
3448
+ }
3449
+ }
3450
+ ]
3451
+ },
3452
+ "EntitySearchFilterValue": {
3453
+ "description": "A filter field value.",
3454
+ "oneOf": [
3455
+ {
3456
+ "type": "string",
3457
+ "nullable": true
3458
+ },
3459
+ {
3460
+ "type": "number"
3461
+ },
3462
+ {
3463
+ "type": "boolean"
3464
+ }
3133
3465
  ]
3134
3466
  },
3135
3467
  "EntityManualTrigger": {
@@ -3507,5 +3839,10 @@
3507
3839
  }
3508
3840
  }
3509
3841
  }
3510
- }
3842
+ },
3843
+ "servers": [
3844
+ {
3845
+ "url": "https://automation.sls.epilot.io"
3846
+ }
3847
+ ]
3511
3848
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/automation-client",
3
- "version": "2.16.4",
3
+ "version": "2.16.5-rc.2",
4
4
  "description": "Client library for epilot automation API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -66,7 +66,7 @@
66
66
  "json-loader": "^0.5.7",
67
67
  "node-fetch": "^3.2.10",
68
68
  "openapi-client-axios": "^7.5.1",
69
- "openapicmd": "^2.6.0",
69
+ "openapicmd": "^2.6.2",
70
70
  "ts-jest": "^26.5.0",
71
71
  "ts-loader": "^8.0.14",
72
72
  "ts-node": "^10.9.1",