@epilot/automation-client 2.0.1 → 2.0.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
- !function(e,t){for(var o in t)e[o]=t[o];t.__esModule&&Object.defineProperty(e,"__esModule",{value:!0})}(exports,(()=>{"use strict";var e={914:function(e,t,o){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var n=i(o(279));t.default=n.default},279:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"Automation API","description":"API Backend for epilot Automation Workflows feature","version":"1.0.0"},"tags":[{"name":"flows","description":"Automation flows"},{"name":"executions","description":"Automation executions"}],"security":[{"EpilotAuth":[]}],"paths":{"/v1/automation/flows":{"get":{"operationId":"searchFlows","summary":"searchFlows","description":"Search available automation flows","tags":["flows"],"parameters":[{"name":"schema","in":"query","description":"Entity Schema","schema":{"type":"string","example":"submission"}},{"name":"size","in":"query","description":"Pagination: max number of results to return","schema":{"type":"integer","default":25}},{"name":"from","in":"query","description":"Pagination: starting for results","schema":{"type":"integer","default":0}},{"name":"trigger_source_id","in":"query","description":"Trigger source identifier","schema":{"type":"string","example":"600945fe-212e-4b97-acf7-391d64648384"}}],"responses":{"200":{"description":"List of automation flows, including total count","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchAutomationsResp"}}}}}},"post":{"operationId":"createFlow","summary":"createFlow","description":"Create new automation flow","tags":["flows"],"requestBody":{"description":"Automation flow to create","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationFlow"}}}},"responses":{"201":{"description":"The created automation flow","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationFlow"}}}}}}},"/v1/automation/flows/{flow_id}":{"get":{"operationId":"getFlow","summary":"getFlow","description":"List available automation flows","tags":["flows"],"parameters":[{"name":"flow_id","in":"path","required":true,"description":"Automation Workflow ID","schema":{"$ref":"#/components/schemas/AutomationFlowId"}}],"responses":{"200":{"description":"The returned automation flow","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationFlow"}}}}}},"put":{"operationId":"putFlow","summary":"putFlow","description":"Update automation flow by id","tags":["flows"],"parameters":[{"name":"flow_id","in":"path","required":true,"description":"Automation Workflow ID","schema":{"$ref":"#/components/schemas/AutomationFlowId"}}],"requestBody":{"description":"Automation flow to create","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationFlow"}}}},"responses":{"200":{"description":"The updated automation flow","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationFlow"}}}}}},"delete":{"operationId":"deleteFlow","summary":"deleteFlow","description":"Update automation flow by id","tags":["flows"],"parameters":[{"name":"flow_id","in":"path","required":true,"description":"Automation Workflow ID","schema":{"$ref":"#/components/schemas/AutomationFlowId"}}],"responses":{"200":{"description":"The deleted automation flow","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationFlow"}}}}}}},"/v1/automation/executions":{"get":{"operationId":"getExecutions","summary":"getExecutions","description":"List automation executions","parameters":[{"name":"entity_id","in":"query","schema":{"$ref":"#/components/schemas/EntityId"}},{"name":"size","in":"query","description":"Pagination: max number of results to return","schema":{"type":"integer","default":25}},{"name":"from","in":"query","description":"Pagination: starting for results","schema":{"type":"integer","default":0}}],"tags":["executions"],"responses":{"200":{"description":"List of automation executions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetExecutionsResp"}}}}}},"post":{"operationId":"startExecution","summary":"startExecution","description":"Start new automation execution","requestBody":{"description":"Execution parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartExecutionRequest"}}}},"tags":["executions"],"responses":{"201":{"description":"The created execution","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationExecution"}}}}}}},"/v1/automation/executions/{execution_id}":{"get":{"operationId":"getExecution","summary":"getExecution","description":"Get automation execution","parameters":[{"name":"execution_id","in":"path","schema":{"$ref":"#/components/schemas/AutomationExecutionId"},"required":true}],"tags":["executions"],"responses":{"200":{"description":"The returned execution","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationExecution"}}}}}},"delete":{"operationId":"cancelExecution","summary":"cancelExecution","description":"Cancel automation execution","parameters":[{"name":"execution_id","in":"path","schema":{"$ref":"#/components/schemas/AutomationExecutionId"},"required":true}],"tags":["executions"],"responses":{"200":{"description":"The cancelled execution","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationExecution"}}}}}}},"/v1/automation/executions/{execution_id}/{action_id}/retrigger":{"post":{"operationId":"retriggerAction","summary":"retriggerAction","description":"Retrigger a specific automation execution action","tags":["executions"],"parameters":[{"name":"execution_id","in":"path","description":"Execution Id","schema":{"$ref":"#/components/schemas/AutomationExecutionId"},"required":true},{"name":"action_id","in":"path","description":"Id of Action to retrigger","schema":{"$ref":"#/components/schemas/AutomationActionId"},"required":true}],"responses":{"200":{"description":"action re-triggered with success"}}}}},"components":{"securitySchemes":{"EpilotAuth":{"type":"http","scheme":"bearer","description":"Epilot Bearer Token"}},"schemas":{"AutomationFlowId":{"type":"string","example":"7791b04a-16d2-44a2-9af9-2d59c25c512f"},"AutomationActionId":{"type":"string","example":"9ec3711b-db63-449c-b894-54d5bb622a8f"},"AutomationFlow":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/AutomationFlowId"},"flow_name":{"type":"string","description":"A descriptive name for the Automation","example":"Handle contact form"},"enabled":{"type":"boolean","description":"Whether the automation is enabled or not","default":true},"triggers":{"type":"array","items":{"$ref":"#/components/schemas/AnyTrigger"}},"trigger_conditions":{"type":"array","items":{"$ref":"#/components/schemas/TriggerCondition"}},"entity_schema":{"description":"The triggering entity schema","type":"string","example":"submission"},"actions":{"type":"array","items":{"$ref":"#/components/schemas/AnyActionConfig"}},"runs":{"type":"number","example":7,"description":"Number of automation executions that ran"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"created_by":{"type":"string","example":"user:123","description":"User / service who created automation flow"},"last_updated_by":{"type":"string","example":"user:123","description":"User / service who last updated automation flow"}},"required":["flow_name","triggers","actions"]},"SearchAutomationsResp":{"type":"object","properties":{"total":{"type":"number"},"results":{"type":"array","items":{"$ref":"#/components/schemas/AutomationFlow"}}},"required":["total","results"]},"AnyTrigger":{"anyOf":[{"$ref":"#/components/schemas/FrontendSubmitTrigger"},{"$ref":"#/components/schemas/JourneySubmitTrigger"},{"$ref":"#/components/schemas/ApiSubmissionTrigger"},{"$ref":"#/components/schemas/EntityOperationTrigger"},{"$ref":"#/components/schemas/ActivityTrigger"},{"$ref":"#/components/schemas/EntityManualTrigger"},{"$ref":"#/components/schemas/ReceivedEmailTrigger"}]},"AnyAction":{"anyOf":[{"$ref":"#/components/schemas/MapEntityAction"},{"$ref":"#/components/schemas/TriggerWorkflowAction"},{"$ref":"#/components/schemas/TriggerWebhookAction"},{"$ref":"#/components/schemas/CreateDocumentAction"},{"$ref":"#/components/schemas/SendEmailAction"},{"$ref":"#/components/schemas/CartCheckoutAction"},{"$ref":"#/components/schemas/AutomationAction"}]},"AnyActionConfig":{"anyOf":[{"$ref":"#/components/schemas/MapEntityActionConfig"},{"$ref":"#/components/schemas/TriggerWorkflowActionConfig"},{"$ref":"#/components/schemas/TriggerWebhookActionConfig"},{"$ref":"#/components/schemas/CreateDocumentActionConfig"},{"$ref":"#/components/schemas/SendEmailActionConfig"},{"$ref":"#/components/schemas/CartCheckoutActionConfig"},{"$ref":"#/components/schemas/AutomationActionConfig"}]},"AutomationActionConfig":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/AutomationActionId"},"flow_action_id":{"$ref":"#/components/schemas/AutomationActionId"},"name":{"type":"string"},"type":{"type":"string"},"config":{"type":"object","additionalProperties":true},"allow_failure":{"description":"Whether to stop execution in a failed state if this action fails","type":"boolean"},"created_automatically":{"description":"Flag indicating whether the action was created automatically or manually","type":"boolean"}}},"AutomationActionExecutionState":{"type":"object","properties":{"execution_status":{"$ref":"#/components/schemas/ExecutionStatus"},"started_at":{"type":"string"},"updated_at":{"type":"string"},"outputs":{"type":"object","additionalProperties":true,"example":{}},"error_output":{"$ref":"#/components/schemas/ErrorOutput"},"retry_strategy":{"type":"string","description":"different behaviors for retrying failed execution actions.","enum":["RETRY_AND_RESUME","RETRY_AND_STOP"]}}},"AutomationAction":{"allOf":[{"$ref":"#/components/schemas/AutomationActionConfig"},{"$ref":"#/components/schemas/AutomationActionExecutionState"}]},"ErrorOutput":{"type":"object","properties":{"error_code":{"$ref":"#/components/schemas/ErrorCode"},"error_reason":{"type":"string"}},"required":["error_code","error_reason"]},"ErrorCode":{"type":"string","enum":["MAPPING_ERROR","REFRESH_RELATIONS_ERROR","DUPLICATE_ENTITY_ERROR","TRIGGER_WORKFLOW_ERROR","TIMEOUT_ERROR","BAD_CONFIG","INTERNAL_ERROR"]},"CartCheckoutActionConfig":{"allOf":[{"$ref":"#/components/schemas/AutomationActionConfig"},{"type":"object","description":"Creates an order entity with prices from journey","properties":{"type":{"enum":["cart-checkout"]},"config":{"$ref":"#/components/schemas/CartCheckoutConfig"}}}]},"CartCheckoutAction":{"allOf":[{"$ref":"#/components/schemas/AutomationAction"},{"type":"object","description":"Creates an order entity with prices from journey","properties":{"type":{"enum":["cart-checkout"]},"config":{"$ref":"#/components/schemas/CartCheckoutConfig"}}}]},"CartCheckoutConfig":{"type":"object","properties":{"version":{"description":"Version of the config","type":"string","default":"1"},"mapping_config":{"$ref":"#/components/schemas/MappingConfigRef"},"relation_attributes":{"type":"array","items":{"$ref":"#/components/schemas/RelationAttribute"}},"mapping_attributes":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/MappingAttributeV2"},{"$ref":"#/components/schemas/MappingAttribute"}]}},"linkback_relation_attribute":{"type":"string","default":"mapped_entities","description":"Relation attribute on the main entity where the target entity will be linked. Set to false to disable linkback\\n"},"linkback_relation_tags":{"type":"array","description":"Relation tags (labels) to include in main entity linkback relation attribute","items":{"type":"string"}},"target_unique":{"type":"array","description":"Unique key for target entity (see upsertEntity of Entity API)","items":{"type":"string"}}}},"MapEntityActionConfig":{"allOf":[{"$ref":"#/components/schemas/AutomationActionConfig"},{"type":"object","properties":{"type":{"enum":["map-entity"]},"config":{"$ref":"#/components/schemas/MapEntityConfig"}}}],"example":{"id":"2520gja-2sgmsaga-0asg-822jgal","name":"Map Entity","type":"map-entity","config":{"target_schema":"contact","target_unique":["email.0.email"],"relation_attributes":[{"target":"company","mode":"append","source_filter":{"schema":"account","limit":1}}],"mapping_attributes":[{"target":"_tags","operation":{"_append":["primary","payer"],"_uniq":true}},{"target":"email","operation":{"_append":[{"email":{"_copy":"billing_contact.email"}}]}},{"target":"first_name","operation":{"_copy":"billing_contact.first_name"}},{"target":"last_name","operation":{"_copy":"billing_contact.last_name"}},{"target":"contact_type","operation":{"_set":"customer"}},{"target":"address","operation":{"_append":[{"_tags":["billing","primary"],"street_name":{"_copy":"billing_contact.street_name"},"street_number":{"_copy":"billing_contact.street_number"},"city":{"_copy":"billing_contact.city"},"postal_code":{"_copy":"billing_contact.postal_code"},"country":{"_copy":"billing_contact.country"}},{"_tags":["delivery"],"street_name":{"_copy":"delivery_contact.street_name"},"street_number":{"_copy":"delivery_contact.street_number"},"city":{"_copy":"delivery_contact.city"},"postal_code":{"_copy":"delivery_contact.postal_code"},"country":{"_copy":"delivery_contact.country"}}],"_uniq":["street_name","street_number","postal_code","country"]}}]}}},"MapEntityAction":{"allOf":[{"$ref":"#/components/schemas/AutomationAction"},{"type":"object","properties":{"type":{"enum":["map-entity"]},"config":{"$ref":"#/components/schemas/MapEntityConfig"}}}]},"MapEntityConfig":{"type":"object","properties":{"mapping_config":{"$ref":"#/components/schemas/MappingConfigRef"},"target_schema":{"type":"string","description":"Schema of target entity"},"target_unique":{"type":"array","description":"Unique key for target entity (see upsertEntity of Entity API)","items":{"type":"string"}},"mapping_attributes":{"type":"array","description":"Attribute mappings","items":{"anyOf":[{"$ref":"#/components/schemas/MappingAttributeV2"},{"$ref":"#/components/schemas/MappingAttribute"}]}},"relation_attributes":{"type":"array","description":"Relation mappings","items":{"$ref":"#/components/schemas/RelationAttribute"}},"linkback_relation_attribute":{"type":"string","default":"mapped_entities","description":"Relation attribute on the main entity where the target entity will be linked. Set to false to disable linkback\\n"},"linkback_relation_tags":{"type":"array","description":"Relation tags (labels) to include in main entity linkback relation attribute","items":{"type":"string"}}},"required":["target_schema"]},"MappingConfigRef":{"type":"object","properties":{"config_id":{"type":"string","description":"Id of Entity Mapping Configuration to run for mapping."},"target_id":{"type":"string","description":"Id of TargetConfig to run for mapping."},"version":{"type":"number","description":"Version of Entity Mapping Configuration to run for mapping."}},"required":["config_id","target_id"]},"RelationAttribute":{"type":"object","properties":{"target":{"type":"string","description":"Target attribute to store the relation in"},"target_tags":{"type":"array","description":"Relation tags (labels) to set for the stored relations","items":{"type":"string"}},"target_tags_include_source":{"type":"boolean","description":"Include all relation tags (labels) present on the main entity relation","default":false},"source_filter":{"type":"object","description":"A filter to identify which source entities to pick as relations from main entity","properties":{"limit":{"type":"integer","description":"Limit relations to maximum number (default, all matched relations)","minimum":0},"schema":{"type":"string","description":"Filter by specific schema"},"attribute":{"type":"string","description":"Filter by a specific relation attribute on the main entity"},"relation_tag":{"type":"string","description":"Filter by relation tag (label) on the main entity"},"tag":{"type":"string","description":"Filter by a specific tag on the related entity"},"self":{"type":"boolean","description":"Picks main entity as relation (overrides other filters)","default":false}}},"related_to":{"type":"object","additionalProperties":true,"deprecated":true},"mode":{"type":"string","enum":["append","prepend","set"]}},"required":["target","mode"]},"MappingAttributeV2":{"type":"object","properties":{"target":{"type":"string","description":"Target JSON path for the attribute to set"},"operation":{"$ref":"#/components/schemas/OperationNode"}},"required":["targetPath","operation"],"example":{"target":"_tags","operation":{"_append":["new","tags"],"_uniq":true}}},"OperationNode":{"description":"Mapping operation nodes are either primitive values or operation node objects","oneOf":[{"$ref":"#/components/schemas/OperationObjectNode"},{"$ref":"#/components/schemas/PrimitiveJSONValue"}]},"OperationObjectNode":{"type":"object","properties":{"_set":{"$ref":"#/components/schemas/PrimitiveJSONValue"},"_append":{"description":"Append to array","items":{"$ref":"#/components/schemas/PrimitiveJSONValue"}},"_uniq":{"description":"Unique array","oneOf":[{"type":"boolean","example":true},{"type":"array","description":"Unique key consisting of object keys","example":["email"],"items":{"type":"string"}}]},"_copy":{"description":"Copy JSONPath value from source entity context","type":"string","example":"contact.first_name"}},"additionalProperties":true},"PrimitiveJSONValue":{"description":"Represents any primitive JSON value","anyOf":[{"type":"string"},{"type":"boolean"},{"type":"number"},{"type":"object","additionalProperties":true},{"type":"array"}]},"MappingAttribute":{"anyOf":[{"$ref":"#/components/schemas/SetValueMapper"},{"$ref":"#/components/schemas/CopyValueMapper"},{"$ref":"#/components/schemas/AppendValueMapper"}]},"MappingAttributeMode":{"type":"string","enum":["copy_if_exists","append_if_exists","set_value"],"description":"- copy_if_exists - it replaces the target attribute with the source value - append_if_exists - it currently replaces target attribute with array like values. Useful when you have multiple values to be added into one attribute. - set_value - it sets a value to a predefined value. Must be used together with value property.\\n"},"SetValueMapper":{"type":"object","deprecated":true,"properties":{"mode":{"$ref":"#/components/schemas/MappingAttributeMode"},"target":{"type":"string","description":"JSON like target path for the attribute. Eg. last_name"},"value":{"description":"Any value to be set: string, number, string[], number[], JSON object, etc. It will override existing values, if any.\\n"}},"required":["mode","target","value"]},"CopyValueMapper":{"type":"object","deprecated":true,"properties":{"mode":{"$ref":"#/components/schemas/MappingAttributeMode"},"target":{"type":"string","description":"JSON like target path for the attribute. Eg. last_name"},"source":{"type":"string","description":"JSON source path for the value to be extracted from the main entity. Eg: steps[1].[\'Product Info\'].price\\n"}},"required":["mode","target","source"]},"AppendValueMapper":{"type":"object","deprecated":true,"properties":{"mode":{"$ref":"#/components/schemas/MappingAttributeMode"},"target":{"type":"string","description":"JSON like target path for the attribute. Eg. last_name"},"source":{"type":"string","description":"JSON source path for the value to be extracted from the main entity. Eg: steps[1].[\'Product Info\'].price\\n"},"value_json":{"type":"string","description":"To be provided only when mapping json objects into a target attribute. Eg array of addresses.\\n"},"target_unique":{"type":"array","items":{"type":"string"},"description":"Array of keys which should be used when checking for uniqueness. Eg: [country, city, postal_code]\\n"}},"required":["mode","target","value_json"]},"SendEmailActionConfig":{"allOf":[{"$ref":"#/components/schemas/AutomationActionConfig"},{"type":"object","properties":{"type":{"enum":["send-email"]},"config":{"$ref":"#/components/schemas/SendEmailConfig"}}}],"example":{"id":"25jga0-gkasl26-0asg-908sgaj2","name":"Send Email","type":"send-email","config":{"email_template_id":"gasj02-29ug9asgm-29t9gsaghg2g-pkmbhx2","language_code":"de"}}},"SendEmailAction":{"allOf":[{"$ref":"#/components/schemas/AutomationAction"},{"type":"object","properties":{"type":{"enum":["send-email"]},"config":{"$ref":"#/components/schemas/SendEmailConfig"}}}]},"SendEmailConfig":{"type":"object","properties":{"email_template_id":{"type":"string"},"language_code":{"type":"string","enum":["de","en"]},"attachments":{"type":"array","description":"Include extra file attachments in sent email.\\n\\nAttachments in email template will be sent regardless of this configuration.\\n","items":{"type":"object","properties":{"source_filter":{"type":"object","description":"Specify filters to match file entities related to main entity","properties":{"limit":{"type":"integer","description":"Limit files to maximum number (default, all matched file relations)","minimum":0,"example":1},"filename_regex":{"type":"string","description":"Match by filename. Regex syntax supported","example":".*"},"attribute":{"type":"string","description":"Filter by a specific relation attribute on the main entity","example":"_files"},"relation_tag":{"type":"string","description":"Filter by relation tag (label) on the main entity","example":"contract"},"tag":{"type":"string","description":"Filter by a specific tag on the related file entity"},"document_type":{"type":"string","description":"Filter by a specific document type (e.g. document)","enum":["document","text","image","video","audio","spreadsheet","presentation","font","archive","application","unknown"]},"self":{"type":"boolean","description":"Picks main entity as file (only works if source entity is a file)","default":false}}}}},"required":["email_template_id"]}}},"CreateDocumentActionConfig":{"allOf":[{"$ref":"#/components/schemas/AutomationActionConfig"},{"type":"object","properties":{"type":{"enum":["create-document"]},"config":{"$ref":"#/components/schemas/CreateDocumentConfig"}}}],"example":{"id":"08g988-ojt2jtaga-292h-8978gsaga","name":"Create Document","type":"create-document","config":{"template_id":{"type":"string","example":"112b08ba-789c-42f2-9940-43b302f641e8\\""},"filename":{"type":"string","example":"newsletter.pdf\\""}}}},"CreateDocumentAction":{"allOf":[{"$ref":"#/components/schemas/AutomationAction"},{"type":"object","properties":{"type":{"enum":["create-document"]},"config":{"$ref":"#/components/schemas/CreateDocumentConfig"}}}]},"CreateDocumentConfig":{"type":"object","properties":{"template_id":{"type":"string"},"filename":{"type":"string"}}},"TriggerWorkflowActionConfig":{"allOf":[{"$ref":"#/components/schemas/AutomationActionConfig"},{"type":"object","properties":{"type":{"enum":["trigger-workflow"]},"config":{"$ref":"#/components/schemas/TriggerWorkflowConfig"}}}],"example":{"id":"08g988-ojt2jtaga-292h-8978gsaga","name":"Trigger Workflow","type":"trigger-workflow","config":{"target_workflow":"mfptvUMH","conditions":[{"schema":"ivy-opportunity","source":"customer.type","comparison":"equals","value":"PRIVATE"}],"assign_steps":[{"step_name":"Lead Sales","user_ids":[10010729]},{"step_name":"Operations","user_ids":[10010728,10010729]}]}}},"TriggerWorkflowAction":{"allOf":[{"$ref":"#/components/schemas/AutomationAction"},{"type":"object","properties":{"type":{"enum":["trigger-workflow"]},"config":{"$ref":"#/components/schemas/TriggerWorkflowConfig"}}}]},"TriggerWorkflowConfig":{"type":"object","properties":{"target_workflow":{"type":"string"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/TriggerWorkflowCondition"}},"assignees":{"type":"array","items":{"type":"string"}},"assign_steps":{"type":"array","items":{"$ref":"#/components/schemas/AssignUsersToStep"}}}},"TriggerWorkflowCondition":{"allOf":[{"$ref":"#/components/schemas/TriggerCondition"},{"type":"object","properties":{"schema":{"type":"string"}}}],"required":["schema","source","comparison"],"example":{"schema":"contact","source":"email","comparison":"equals","value":"test@epilot.cloud"}},"AssignUsersToStep":{"type":"object","properties":{"step_id":{"type":"string"},"step_name":{"type":"string"},"user_ids":{"type":"array","items":{"type":"number"}}},"example":[{"step_id":"xyh9t2ha","step_name":"Lead Sales","user_ids":[10010729]},{"step_id":"29jgasl","step_name":"Operations","user_ids":[10010728,10010729]}]},"TriggerWebhookActionConfig":{"allOf":[{"$ref":"#/components/schemas/AutomationActionConfig"},{"type":"object","properties":{"type":{"enum":["trigger-webhook"]},"config":{"$ref":"#/components/schemas/TriggerWebhookConfig"}}}],"example":{"id":"2520gja-2sgmsaga-0asg-822jgal","name":"Trigger Webhook","type":"trigger-webhook","config":{"entity_sources":["contact","account"],"target_webhook_id":"25jg9ag2ga"}}},"TriggerWebhookAction":{"allOf":[{"$ref":"#/components/schemas/AutomationAction"},{"type":"object","properties":{"type":{"enum":["trigger-webhook"]},"config":{"$ref":"#/components/schemas/TriggerWebhookConfig"}}}]},"TriggerWebhookConfig":{"type":"object","properties":{"entity_sources":{"type":"array","items":{"type":"string"}},"target_webhook_id":{"type":"string"}}},"AutomationExecutionId":{"type":"string","example":"9baf184f-bc81-4128-bca3-d974c90a12c4"},"AutomationExecution":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/AutomationExecutionId"},"execution_status":{"$ref":"#/components/schemas/ExecutionStatus"},"entity_id":{"$ref":"#/components/schemas/EntityId"},"activity_id":{"$ref":"#/components/schemas/ActivityId"},"entity_snapshot":{"$ref":"#/components/schemas/EntityItemSnapshot"},"org_id":{"$ref":"#/components/schemas/OrganizationId"},"flow_id":{"$ref":"#/components/schemas/AutomationFlowId"},"flow_name":{"type":"string","example":"Handle contact form"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"current_action_id":{"$ref":"#/components/schemas/AutomationActionId"},"actions":{"type":"array","items":{"$ref":"#/components/schemas/AnyAction"}}},"required":["id","status","entity_id","org_id","flow_id","actions"]},"ExecutionStatus":{"type":"string","enum":["pending","in_progress","success","failed","cancelled"]},"GetExecutionsResp":{"type":"object","properties":{"total":{"type":"number"},"results":{"type":"array","items":{"$ref":"#/components/schemas/AutomationExecution"}}},"required":["total","results"]},"StartExecutionRequest":{"type":"object","properties":{"entity_id":{"$ref":"#/components/schemas/EntityId"},"flow_id":{"$ref":"#/components/schemas/AutomationFlowId"}}},"EntityId":{"type":"string","example":"e3d3ebac-baab-4395-abf4-50b5bf1f8b74"},"ActivityId":{"type":"string","example":"e3d3ebac-baab-4395-abf4-50b5bf1f8b74"},"OrganizationId":{"type":"string","example":"e3d3ebac-baab-4395-abf4-50b5bf1f8b74"},"JourneySubmitTrigger":{"type":"object","properties":{"type":{"type":"string","enum":["journey_submission"]},"configuration":{"type":"object","properties":{"source_id":{"type":"string","format":"uuid"}},"required":["source_id"]}},"required":["type","configuration"]},"FrontendSubmitTrigger":{"type":"object","properties":{"type":{"type":"string","enum":["frontend_submission"]},"configuration":{"type":"object","properties":{"source_id":{"type":"string","example":"99"}}}},"required":["type","configuration"]},"ApiSubmissionTrigger":{"type":"object","properties":{"type":{"type":"string","enum":["api_submission"]},"configuration":{"type":"object","properties":{"source_id":{"type":"string"}}}},"required":["type","configuration"]},"ReceivedEmailTrigger":{"type":"object","properties":{"type":{"type":"string","enum":["received_email"]},"configuration":{"type":"object","properties":{"message_type":{"type":"string","enum":["RECEIVED"]}}}},"required":["type","configuration"]},"EntityOperationTrigger":{"type":"object","properties":{"type":{"type":"string","enum":["entity_operation"]},"configuration":{"type":"object","properties":{"schema":{"type":"string","example":"submission"},"operations":{"type":"array","items":{"type":"string","enum":["createEntity","updateEntity","deleteEntity"]}}}}},"required":["type","configuration"]},"ActivityTrigger":{"type":"object","properties":{"type":{"type":"string","enum":["activity"]},"configuration":{"type":"object","properties":{"schema":{"type":"string","example":"submission"},"types":{"type":"array","items":{"type":"string","enum":["CreateMeterReading","UpdateMeterReading","MessageActivity","SyncActivity"]}}}}},"required":["type","configuration"]},"EntityManualTrigger":{"type":"object","properties":{"type":{"type":"string","enum":["entity_manual"]},"configuration":{"type":"object","properties":{"schema":{"description":"Which entity type can this automation be triggered from","type":"string","example":"submission"}}}},"required":["type","configuration"]},"TriggerCondition":{"type":"object","properties":{"source":{"type":"string"},"comparison":{"$ref":"#/components/schemas/Comparison"},"value":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"array","items":{"type":"string"}},{"type":"array","items":{"type":"number"}}]}},"required":["source","comparison"],"example":{"source":"billing_contact.email","comparison":"exists"}},"Comparison":{"type":"string","enum":["equals","any_of","not_empty","is_empty"]},"EntityItemSnapshot":{"type":"object","properties":{"_id":{"$ref":"#/components/schemas/EntityId"},"_title":{"type":"string"},"_org":{"type":"string"},"_schema":{"type":"string"},"_tags":{"type":"array","items":{"type":"string"}},"_created_at":{"type":"string","format":"date-time"},"_updated_at":{"type":"string","format":"date-time"}},"additionalProperties":true,"required":["_id","_title","_org","_schema","_created_at","_updated_at"]}}},"servers":[{"url":"https://automation.sls.epilot.io"},{"url":"https://automation.sls.epilot.io"}]}')}},t={};return function o(i){if(t[i])return t[i].exports;var n=t[i]={exports:{}};return e[i].call(n.exports,n,n.exports,o),n.exports}(914)})());
1
+ !function(e,t){for(var o in t)e[o]=t[o];t.__esModule&&Object.defineProperty(e,"__esModule",{value:!0})}(exports,(()=>{"use strict";var e={914:function(e,t,o){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var n=i(o(279));t.default=n.default},279:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"Automation API","description":"API Backend for epilot Automation Workflows feature","version":"1.0.0"},"tags":[{"name":"flows","description":"Automation flows"},{"name":"executions","description":"Automation executions"}],"security":[{"EpilotAuth":[]}],"paths":{"/v1/automation/flows":{"get":{"operationId":"searchFlows","summary":"searchFlows","description":"Search available automation flows","tags":["flows"],"parameters":[{"name":"schema","in":"query","description":"Entity Schema","schema":{"type":"string","example":"submission"}},{"name":"size","in":"query","description":"Pagination: max number of results to return","schema":{"type":"integer","default":25}},{"name":"from","in":"query","description":"Pagination: starting for results","schema":{"type":"integer","default":0}},{"name":"trigger_source_id","in":"query","description":"Trigger source identifier","schema":{"type":"string","example":"600945fe-212e-4b97-acf7-391d64648384"}}],"responses":{"200":{"description":"List of automation flows, including total count","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchAutomationsResp"}}}}}},"post":{"operationId":"createFlow","summary":"createFlow","description":"Create new automation flow","tags":["flows"],"requestBody":{"description":"Automation flow to create","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationFlow"}}}},"responses":{"201":{"description":"The created automation flow","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationFlow"}}}}}}},"/v1/automation/flows/{flow_id}":{"get":{"operationId":"getFlow","summary":"getFlow","description":"List available automation flows","tags":["flows"],"parameters":[{"name":"flow_id","in":"path","required":true,"description":"Automation Workflow ID","schema":{"$ref":"#/components/schemas/AutomationFlowId"}}],"responses":{"200":{"description":"The returned automation flow","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationFlow"}}}}}},"put":{"operationId":"putFlow","summary":"putFlow","description":"Update automation flow by id","tags":["flows"],"parameters":[{"name":"flow_id","in":"path","required":true,"description":"Automation Workflow ID","schema":{"$ref":"#/components/schemas/AutomationFlowId"}}],"requestBody":{"description":"Automation flow to create","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationFlow"}}}},"responses":{"200":{"description":"The updated automation flow","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationFlow"}}}}}},"delete":{"operationId":"deleteFlow","summary":"deleteFlow","description":"Update automation flow by id","tags":["flows"],"parameters":[{"name":"flow_id","in":"path","required":true,"description":"Automation Workflow ID","schema":{"$ref":"#/components/schemas/AutomationFlowId"}}],"responses":{"200":{"description":"The deleted automation flow","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationFlow"}}}}}}},"/v1/automation/executions":{"get":{"operationId":"getExecutions","summary":"getExecutions","description":"List automation executions","parameters":[{"name":"entity_id","in":"query","schema":{"$ref":"#/components/schemas/EntityId"}},{"name":"size","in":"query","description":"Pagination: max number of results to return","schema":{"type":"integer","default":25}},{"name":"from","in":"query","description":"Pagination: starting for results","schema":{"type":"integer","default":0}}],"tags":["executions"],"responses":{"200":{"description":"List of automation executions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetExecutionsResp"}}}}}},"post":{"operationId":"startExecution","summary":"startExecution","description":"Start new automation execution","requestBody":{"description":"Execution parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartExecutionRequest"}}}},"tags":["executions"],"responses":{"201":{"description":"The created execution","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationExecution"}}}}}}},"/v1/automation/executions/{execution_id}":{"get":{"operationId":"getExecution","summary":"getExecution","description":"Get automation execution","parameters":[{"name":"execution_id","in":"path","schema":{"$ref":"#/components/schemas/AutomationExecutionId"},"required":true}],"tags":["executions"],"responses":{"200":{"description":"The returned execution","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationExecution"}}}}}},"delete":{"operationId":"cancelExecution","summary":"cancelExecution","description":"Cancel automation execution","parameters":[{"name":"execution_id","in":"path","schema":{"$ref":"#/components/schemas/AutomationExecutionId"},"required":true}],"tags":["executions"],"responses":{"200":{"description":"The cancelled execution","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationExecution"}}}}}}},"/v1/automation/executions/{execution_id}/{action_id}/retrigger":{"post":{"operationId":"retriggerAction","summary":"retriggerAction","description":"Retry a specific automation execution action which failed / is stuck.","tags":["executions"],"parameters":[{"name":"execution_id","in":"path","description":"Execution Id","schema":{"$ref":"#/components/schemas/AutomationExecutionId"},"required":true},{"name":"action_id","in":"path","description":"Id of Action to retry.","schema":{"$ref":"#/components/schemas/AutomationActionId"},"required":true}],"requestBody":{"description":"Retry request details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetryReq"}}}},"responses":{"200":{"description":"action re-triggered with success"}}}}},"components":{"securitySchemes":{"EpilotAuth":{"type":"http","scheme":"bearer","description":"Epilot Bearer Token"}},"schemas":{"AutomationFlowId":{"type":"string","example":"7791b04a-16d2-44a2-9af9-2d59c25c512f"},"AutomationActionId":{"type":"string","example":"9ec3711b-db63-449c-b894-54d5bb622a8f"},"AutomationFlow":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/AutomationFlowId"},"flow_name":{"type":"string","description":"A descriptive name for the Automation","example":"Handle contact form"},"enabled":{"type":"boolean","description":"Whether the automation is enabled or not","default":true},"triggers":{"type":"array","items":{"$ref":"#/components/schemas/AnyTrigger"}},"trigger_conditions":{"type":"array","items":{"$ref":"#/components/schemas/TriggerCondition"}},"entity_schema":{"description":"The triggering entity schema","type":"string","example":"submission"},"actions":{"type":"array","items":{"$ref":"#/components/schemas/AnyActionConfig"}},"runs":{"type":"number","example":7,"description":"Number of automation executions that ran"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"created_by":{"type":"string","example":"user:123","description":"User / service who created automation flow"},"last_updated_by":{"type":"string","example":"user:123","description":"User / service who last updated automation flow"}},"required":["flow_name","triggers","actions"]},"SearchAutomationsResp":{"type":"object","properties":{"total":{"type":"number"},"results":{"type":"array","items":{"$ref":"#/components/schemas/AutomationFlow"}}},"required":["total","results"]},"AnyTrigger":{"anyOf":[{"$ref":"#/components/schemas/FrontendSubmitTrigger"},{"$ref":"#/components/schemas/JourneySubmitTrigger"},{"$ref":"#/components/schemas/ApiSubmissionTrigger"},{"$ref":"#/components/schemas/EntityOperationTrigger"},{"$ref":"#/components/schemas/ActivityTrigger"},{"$ref":"#/components/schemas/EntityManualTrigger"},{"$ref":"#/components/schemas/ReceivedEmailTrigger"}]},"AnyAction":{"anyOf":[{"$ref":"#/components/schemas/MapEntityAction"},{"$ref":"#/components/schemas/TriggerWorkflowAction"},{"$ref":"#/components/schemas/TriggerWebhookAction"},{"$ref":"#/components/schemas/CreateDocumentAction"},{"$ref":"#/components/schemas/SendEmailAction"},{"$ref":"#/components/schemas/CartCheckoutAction"},{"$ref":"#/components/schemas/AutomationAction"}]},"AnyActionConfig":{"anyOf":[{"$ref":"#/components/schemas/MapEntityActionConfig"},{"$ref":"#/components/schemas/TriggerWorkflowActionConfig"},{"$ref":"#/components/schemas/TriggerWebhookActionConfig"},{"$ref":"#/components/schemas/CreateDocumentActionConfig"},{"$ref":"#/components/schemas/SendEmailActionConfig"},{"$ref":"#/components/schemas/CartCheckoutActionConfig"},{"$ref":"#/components/schemas/AutomationActionConfig"}]},"AutomationActionConfig":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/AutomationActionId"},"flow_action_id":{"$ref":"#/components/schemas/AutomationActionId"},"name":{"type":"string"},"type":{"type":"string"},"config":{"type":"object","additionalProperties":true},"allow_failure":{"description":"Whether to stop execution in a failed state if this action fails","type":"boolean"},"created_automatically":{"description":"Flag indicating whether the action was created automatically or manually","type":"boolean"}}},"AutomationActionExecutionState":{"type":"object","properties":{"execution_status":{"$ref":"#/components/schemas/ExecutionStatus"},"started_at":{"type":"string"},"updated_at":{"type":"string"},"outputs":{"type":"object","additionalProperties":true,"example":{}},"error_output":{"$ref":"#/components/schemas/ErrorOutput"},"retry_strategy":{"$ref":"#/components/schemas/RetryStrategy"}}},"RetryStrategy":{"type":"string","description":"different behaviors for retrying failed execution actions.","enum":["RETRY_AND_RESUME","RETRY_AND_STOP"]},"AutomationAction":{"allOf":[{"$ref":"#/components/schemas/AutomationActionConfig"},{"$ref":"#/components/schemas/AutomationActionExecutionState"}]},"ErrorOutput":{"type":"object","properties":{"error_code":{"$ref":"#/components/schemas/ErrorCode"},"error_reason":{"type":"string"}},"required":["error_code","error_reason"]},"ErrorCode":{"type":"string","enum":["MAPPING_ERROR","REFRESH_RELATIONS_ERROR","DUPLICATE_ENTITY_ERROR","TRIGGER_WORKFLOW_ERROR","TIMEOUT_ERROR","BAD_CONFIG","INTERNAL_ERROR"]},"CartCheckoutActionConfig":{"allOf":[{"$ref":"#/components/schemas/AutomationActionConfig"},{"type":"object","description":"Creates an order entity with prices from journey","properties":{"type":{"enum":["cart-checkout"]},"config":{"$ref":"#/components/schemas/CartCheckoutConfig"}}}]},"CartCheckoutAction":{"allOf":[{"$ref":"#/components/schemas/AutomationAction"},{"type":"object","description":"Creates an order entity with prices from journey","properties":{"type":{"enum":["cart-checkout"]},"config":{"$ref":"#/components/schemas/CartCheckoutConfig"}}}]},"CartCheckoutConfig":{"type":"object","properties":{"version":{"description":"Version of the config","type":"string","default":"1"},"mapping_config":{"$ref":"#/components/schemas/MappingConfigRef"},"relation_attributes":{"type":"array","items":{"$ref":"#/components/schemas/RelationAttribute"}},"mapping_attributes":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/MappingAttributeV2"},{"$ref":"#/components/schemas/MappingAttribute"}]}},"linkback_relation_attribute":{"type":"string","default":"mapped_entities","description":"Relation attribute on the main entity where the target entity will be linked. Set to false to disable linkback\\n"},"linkback_relation_tags":{"type":"array","description":"Relation tags (labels) to include in main entity linkback relation attribute","items":{"type":"string"}},"target_unique":{"type":"array","description":"Unique key for target entity (see upsertEntity of Entity API)","items":{"type":"string"}}}},"MapEntityActionConfig":{"allOf":[{"$ref":"#/components/schemas/AutomationActionConfig"},{"type":"object","properties":{"type":{"enum":["map-entity"]},"config":{"$ref":"#/components/schemas/MapEntityConfig"}}}],"example":{"id":"2520gja-2sgmsaga-0asg-822jgal","name":"Map Entity","type":"map-entity","config":{"target_schema":"contact","target_unique":["email.0.email"],"relation_attributes":[{"target":"company","mode":"append","source_filter":{"schema":"account","limit":1}}],"mapping_attributes":[{"target":"_tags","operation":{"_append":["primary","payer"],"_uniq":true}},{"target":"email","operation":{"_append":[{"email":{"_copy":"billing_contact.email"}}]}},{"target":"first_name","operation":{"_copy":"billing_contact.first_name"}},{"target":"last_name","operation":{"_copy":"billing_contact.last_name"}},{"target":"contact_type","operation":{"_set":"customer"}},{"target":"address","operation":{"_append":[{"_tags":["billing","primary"],"street_name":{"_copy":"billing_contact.street_name"},"street_number":{"_copy":"billing_contact.street_number"},"city":{"_copy":"billing_contact.city"},"postal_code":{"_copy":"billing_contact.postal_code"},"country":{"_copy":"billing_contact.country"}},{"_tags":["delivery"],"street_name":{"_copy":"delivery_contact.street_name"},"street_number":{"_copy":"delivery_contact.street_number"},"city":{"_copy":"delivery_contact.city"},"postal_code":{"_copy":"delivery_contact.postal_code"},"country":{"_copy":"delivery_contact.country"}}],"_uniq":["street_name","street_number","postal_code","country"]}}]}}},"MapEntityAction":{"allOf":[{"$ref":"#/components/schemas/AutomationAction"},{"type":"object","properties":{"type":{"enum":["map-entity"]},"config":{"$ref":"#/components/schemas/MapEntityConfig"}}}]},"MapEntityConfig":{"type":"object","properties":{"mapping_config":{"$ref":"#/components/schemas/MappingConfigRef"},"target_schema":{"type":"string","description":"Schema of target entity"},"target_unique":{"type":"array","description":"Unique key for target entity (see upsertEntity of Entity API)","items":{"type":"string"}},"mapping_attributes":{"type":"array","description":"Attribute mappings","items":{"anyOf":[{"$ref":"#/components/schemas/MappingAttributeV2"},{"$ref":"#/components/schemas/MappingAttribute"}]}},"relation_attributes":{"type":"array","description":"Relation mappings","items":{"$ref":"#/components/schemas/RelationAttribute"}},"linkback_relation_attribute":{"type":"string","default":"mapped_entities","description":"Relation attribute on the main entity where the target entity will be linked. Set to false to disable linkback\\n"},"linkback_relation_tags":{"type":"array","description":"Relation tags (labels) to include in main entity linkback relation attribute","items":{"type":"string"}}},"required":["target_schema"]},"MappingConfigRef":{"type":"object","properties":{"config_id":{"type":"string","description":"Id of Entity Mapping Configuration to run for mapping."},"target_id":{"type":"string","description":"Id of TargetConfig to run for mapping."},"version":{"type":"number","description":"Version of Entity Mapping Configuration to run for mapping."}},"required":["config_id","target_id"]},"RelationAttribute":{"type":"object","properties":{"target":{"type":"string","description":"Target attribute to store the relation in"},"target_tags":{"type":"array","description":"Relation tags (labels) to set for the stored relations","items":{"type":"string"}},"target_tags_include_source":{"type":"boolean","description":"Include all relation tags (labels) present on the main entity relation","default":false},"source_filter":{"type":"object","description":"A filter to identify which source entities to pick as relations from main entity","properties":{"limit":{"type":"integer","description":"Limit relations to maximum number (default, all matched relations)","minimum":0},"schema":{"type":"string","description":"Filter by specific schema"},"attribute":{"type":"string","description":"Filter by a specific relation attribute on the main entity"},"relation_tag":{"type":"string","description":"Filter by relation tag (label) on the main entity"},"tag":{"type":"string","description":"Filter by a specific tag on the related entity"},"self":{"type":"boolean","description":"Picks main entity as relation (overrides other filters)","default":false}}},"related_to":{"type":"object","additionalProperties":true,"deprecated":true},"mode":{"type":"string","enum":["append","prepend","set"]}},"required":["target","mode"]},"MappingAttributeV2":{"type":"object","properties":{"target":{"type":"string","description":"Target JSON path for the attribute to set"},"operation":{"$ref":"#/components/schemas/OperationNode"}},"required":["targetPath","operation"],"example":{"target":"_tags","operation":{"_append":["new","tags"],"_uniq":true}}},"OperationNode":{"description":"Mapping operation nodes are either primitive values or operation node objects","oneOf":[{"$ref":"#/components/schemas/OperationObjectNode"},{"$ref":"#/components/schemas/PrimitiveJSONValue"}]},"OperationObjectNode":{"type":"object","properties":{"_set":{"$ref":"#/components/schemas/PrimitiveJSONValue"},"_append":{"description":"Append to array","items":{"$ref":"#/components/schemas/PrimitiveJSONValue"}},"_uniq":{"description":"Unique array","oneOf":[{"type":"boolean","example":true},{"type":"array","description":"Unique key consisting of object keys","example":["email"],"items":{"type":"string"}}]},"_copy":{"description":"Copy JSONPath value from source entity context","type":"string","example":"contact.first_name"}},"additionalProperties":true},"PrimitiveJSONValue":{"description":"Represents any primitive JSON value","anyOf":[{"type":"string"},{"type":"boolean"},{"type":"number"},{"type":"object","additionalProperties":true},{"type":"array"}]},"MappingAttribute":{"anyOf":[{"$ref":"#/components/schemas/SetValueMapper"},{"$ref":"#/components/schemas/CopyValueMapper"},{"$ref":"#/components/schemas/AppendValueMapper"}]},"MappingAttributeMode":{"type":"string","enum":["copy_if_exists","append_if_exists","set_value"],"description":"- copy_if_exists - it replaces the target attribute with the source value - append_if_exists - it currently replaces target attribute with array like values. Useful when you have multiple values to be added into one attribute. - set_value - it sets a value to a predefined value. Must be used together with value property.\\n"},"SetValueMapper":{"type":"object","deprecated":true,"properties":{"mode":{"$ref":"#/components/schemas/MappingAttributeMode"},"target":{"type":"string","description":"JSON like target path for the attribute. Eg. last_name"},"value":{"description":"Any value to be set: string, number, string[], number[], JSON object, etc. It will override existing values, if any.\\n"}},"required":["mode","target","value"]},"CopyValueMapper":{"type":"object","deprecated":true,"properties":{"mode":{"$ref":"#/components/schemas/MappingAttributeMode"},"target":{"type":"string","description":"JSON like target path for the attribute. Eg. last_name"},"source":{"type":"string","description":"JSON source path for the value to be extracted from the main entity. Eg: steps[1].[\'Product Info\'].price\\n"}},"required":["mode","target","source"]},"AppendValueMapper":{"type":"object","deprecated":true,"properties":{"mode":{"$ref":"#/components/schemas/MappingAttributeMode"},"target":{"type":"string","description":"JSON like target path for the attribute. Eg. last_name"},"source":{"type":"string","description":"JSON source path for the value to be extracted from the main entity. Eg: steps[1].[\'Product Info\'].price\\n"},"value_json":{"type":"string","description":"To be provided only when mapping json objects into a target attribute. Eg array of addresses.\\n"},"target_unique":{"type":"array","items":{"type":"string"},"description":"Array of keys which should be used when checking for uniqueness. Eg: [country, city, postal_code]\\n"}},"required":["mode","target","value_json"]},"SendEmailActionConfig":{"allOf":[{"$ref":"#/components/schemas/AutomationActionConfig"},{"type":"object","properties":{"type":{"enum":["send-email"]},"config":{"$ref":"#/components/schemas/SendEmailConfig"}}}],"example":{"id":"25jga0-gkasl26-0asg-908sgaj2","name":"Send Email","type":"send-email","config":{"email_template_id":"gasj02-29ug9asgm-29t9gsaghg2g-pkmbhx2","language_code":"de"}}},"SendEmailAction":{"allOf":[{"$ref":"#/components/schemas/AutomationAction"},{"type":"object","properties":{"type":{"enum":["send-email"]},"config":{"$ref":"#/components/schemas/SendEmailConfig"}}}]},"SendEmailConfig":{"type":"object","properties":{"email_template_id":{"type":"string"},"language_code":{"type":"string","enum":["de","en"]},"attachments":{"type":"array","description":"Include extra file attachments in sent email.\\n\\nAttachments in email template will be sent regardless of this configuration.\\n","items":{"type":"object","properties":{"source_filter":{"type":"object","description":"Specify filters to match file entities related to main entity","properties":{"limit":{"type":"integer","description":"Limit files to maximum number (default, all matched file relations)","minimum":0,"example":1},"filename_regex":{"type":"string","description":"Match by filename. Regex syntax supported","example":".*"},"attribute":{"type":"string","description":"Filter by a specific relation attribute on the main entity","example":"_files"},"relation_tag":{"type":"string","description":"Filter by relation tag (label) on the main entity","example":"contract"},"tag":{"type":"string","description":"Filter by a specific tag on the related file entity"},"document_type":{"type":"string","description":"Filter by a specific document type (e.g. document)","enum":["document","text","image","video","audio","spreadsheet","presentation","font","archive","application","unknown"]},"self":{"type":"boolean","description":"Picks main entity as file (only works if source entity is a file)","default":false}}}}},"required":["email_template_id"]}}},"CreateDocumentActionConfig":{"allOf":[{"$ref":"#/components/schemas/AutomationActionConfig"},{"type":"object","properties":{"type":{"enum":["create-document"]},"config":{"$ref":"#/components/schemas/CreateDocumentConfig"}}}],"example":{"id":"08g988-ojt2jtaga-292h-8978gsaga","name":"Create Document","type":"create-document","config":{"template_id":{"type":"string","example":"112b08ba-789c-42f2-9940-43b302f641e8\\""},"filename":{"type":"string","example":"newsletter.pdf\\""}}}},"CreateDocumentAction":{"allOf":[{"$ref":"#/components/schemas/AutomationAction"},{"type":"object","properties":{"type":{"enum":["create-document"]},"config":{"$ref":"#/components/schemas/CreateDocumentConfig"}}}]},"CreateDocumentConfig":{"type":"object","properties":{"template_id":{"type":"string"},"filename":{"type":"string"}}},"TriggerWorkflowActionConfig":{"allOf":[{"$ref":"#/components/schemas/AutomationActionConfig"},{"type":"object","properties":{"type":{"enum":["trigger-workflow"]},"config":{"$ref":"#/components/schemas/TriggerWorkflowConfig"}}}],"example":{"id":"08g988-ojt2jtaga-292h-8978gsaga","name":"Trigger Workflow","type":"trigger-workflow","config":{"target_workflow":"mfptvUMH","conditions":[{"schema":"ivy-opportunity","source":"customer.type","comparison":"equals","value":"PRIVATE"}],"assign_steps":[{"step_name":"Lead Sales","user_ids":[10010729]},{"step_name":"Operations","user_ids":[10010728,10010729]}]}}},"TriggerWorkflowAction":{"allOf":[{"$ref":"#/components/schemas/AutomationAction"},{"type":"object","properties":{"type":{"enum":["trigger-workflow"]},"config":{"$ref":"#/components/schemas/TriggerWorkflowConfig"}}}]},"TriggerWorkflowConfig":{"type":"object","properties":{"target_workflow":{"type":"string"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/TriggerWorkflowCondition"}},"assignees":{"type":"array","items":{"type":"string"}},"assign_steps":{"type":"array","items":{"$ref":"#/components/schemas/AssignUsersToStep"}}}},"TriggerWorkflowCondition":{"allOf":[{"$ref":"#/components/schemas/TriggerCondition"},{"type":"object","properties":{"schema":{"type":"string"}}}],"required":["schema","source","comparison"],"example":{"schema":"contact","source":"email","comparison":"equals","value":"test@epilot.cloud"}},"AssignUsersToStep":{"type":"object","properties":{"step_id":{"type":"string"},"step_name":{"type":"string"},"user_ids":{"type":"array","items":{"type":"number"}}},"example":[{"step_id":"xyh9t2ha","step_name":"Lead Sales","user_ids":[10010729]},{"step_id":"29jgasl","step_name":"Operations","user_ids":[10010728,10010729]}]},"TriggerWebhookActionConfig":{"allOf":[{"$ref":"#/components/schemas/AutomationActionConfig"},{"type":"object","properties":{"type":{"enum":["trigger-webhook"]},"config":{"$ref":"#/components/schemas/TriggerWebhookConfig"}}}],"example":{"id":"2520gja-2sgmsaga-0asg-822jgal","name":"Trigger Webhook","type":"trigger-webhook","config":{"entity_sources":["contact","account"],"target_webhook_id":"25jg9ag2ga"}}},"TriggerWebhookAction":{"allOf":[{"$ref":"#/components/schemas/AutomationAction"},{"type":"object","properties":{"type":{"enum":["trigger-webhook"]},"config":{"$ref":"#/components/schemas/TriggerWebhookConfig"}}}]},"TriggerWebhookConfig":{"type":"object","properties":{"entity_sources":{"type":"array","items":{"type":"string"}},"target_webhook_id":{"type":"string"}}},"AutomationExecutionId":{"type":"string","example":"9baf184f-bc81-4128-bca3-d974c90a12c4"},"AutomationExecution":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/AutomationExecutionId"},"execution_status":{"$ref":"#/components/schemas/ExecutionStatus"},"entity_id":{"$ref":"#/components/schemas/EntityId"},"activity_id":{"$ref":"#/components/schemas/ActivityId"},"entity_snapshot":{"$ref":"#/components/schemas/EntityItemSnapshot"},"org_id":{"$ref":"#/components/schemas/OrganizationId"},"flow_id":{"$ref":"#/components/schemas/AutomationFlowId"},"flow_name":{"type":"string","example":"Handle contact form"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"current_action_id":{"$ref":"#/components/schemas/AutomationActionId"},"actions":{"type":"array","items":{"$ref":"#/components/schemas/AnyAction"}}},"required":["id","status","entity_id","org_id","flow_id","actions"]},"ExecutionStatus":{"type":"string","enum":["pending","in_progress","success","failed","cancelled"]},"GetExecutionsResp":{"type":"object","properties":{"total":{"type":"number"},"results":{"type":"array","items":{"$ref":"#/components/schemas/AutomationExecution"}}},"required":["total","results"]},"StartExecutionRequest":{"type":"object","properties":{"entity_id":{"$ref":"#/components/schemas/EntityId"},"flow_id":{"$ref":"#/components/schemas/AutomationFlowId"}}},"EntityId":{"type":"string","example":"e3d3ebac-baab-4395-abf4-50b5bf1f8b74"},"ActivityId":{"type":"string","example":"e3d3ebac-baab-4395-abf4-50b5bf1f8b74"},"OrganizationId":{"type":"string","example":"e3d3ebac-baab-4395-abf4-50b5bf1f8b74"},"JourneySubmitTrigger":{"type":"object","properties":{"type":{"type":"string","enum":["journey_submission"]},"configuration":{"type":"object","properties":{"source_id":{"type":"string","format":"uuid"}},"required":["source_id"]}},"required":["type","configuration"]},"FrontendSubmitTrigger":{"type":"object","properties":{"type":{"type":"string","enum":["frontend_submission"]},"configuration":{"type":"object","properties":{"source_id":{"type":"string","example":"99"}}}},"required":["type","configuration"]},"ApiSubmissionTrigger":{"type":"object","properties":{"type":{"type":"string","enum":["api_submission"]},"configuration":{"type":"object","properties":{"source_id":{"type":"string"}}}},"required":["type","configuration"]},"ReceivedEmailTrigger":{"type":"object","properties":{"type":{"type":"string","enum":["received_email"]},"configuration":{"type":"object","properties":{"message_type":{"type":"string","enum":["RECEIVED"]}}}},"required":["type","configuration"]},"EntityOperationTrigger":{"type":"object","properties":{"type":{"type":"string","enum":["entity_operation"]},"configuration":{"type":"object","properties":{"schema":{"type":"string","example":"submission"},"operations":{"type":"array","items":{"type":"string","enum":["createEntity","updateEntity","deleteEntity"]}}}}},"required":["type","configuration"]},"ActivityTrigger":{"type":"object","properties":{"type":{"type":"string","enum":["activity"]},"configuration":{"type":"object","properties":{"schema":{"type":"string","example":"submission"},"types":{"type":"array","items":{"type":"string","enum":["CreateMeterReading","UpdateMeterReading","MessageActivity","SyncActivity"]}}}}},"required":["type","configuration"]},"EntityManualTrigger":{"type":"object","properties":{"type":{"type":"string","enum":["entity_manual"]},"configuration":{"type":"object","properties":{"schema":{"description":"Which entity type can this automation be triggered from","type":"string","example":"submission"}}}},"required":["type","configuration"]},"TriggerCondition":{"type":"object","properties":{"source":{"type":"string"},"comparison":{"$ref":"#/components/schemas/Comparison"},"value":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"array","items":{"type":"string"}},{"type":"array","items":{"type":"number"}}]}},"required":["source","comparison"],"example":{"source":"billing_contact.email","comparison":"exists"}},"Comparison":{"type":"string","enum":["equals","any_of","not_empty","is_empty"]},"EntityItemSnapshot":{"type":"object","properties":{"_id":{"$ref":"#/components/schemas/EntityId"},"_title":{"type":"string"},"_org":{"type":"string"},"_schema":{"type":"string"},"_tags":{"type":"array","items":{"type":"string"}},"_created_at":{"type":"string","format":"date-time"},"_updated_at":{"type":"string","format":"date-time"}},"additionalProperties":true,"required":["_id","_title","_org","_schema","_created_at","_updated_at"]},"RetryReq":{"type":"object","properties":{"retry_strategy":{"$ref":"#/components/schemas/RetryStrategy"}}}}},"servers":[{"url":"https://automation.sls.epilot.io"},{"url":"https://automation.sls.epilot.io"}]}')}},t={};return function o(i){if(t[i])return t[i].exports;var n=t[i]={exports:{}};return e[i].call(n.exports,n,n.exports,o),n.exports}(914)})());
package/dist/openapi.d.ts CHANGED
@@ -319,10 +319,7 @@ declare namespace Components {
319
319
  [name: string]: any;
320
320
  };
321
321
  error_output?: ErrorOutput;
322
- /**
323
- * different behaviors for retrying failed execution actions.
324
- */
325
- retry_strategy?: "RETRY_AND_RESUME" | "RETRY_AND_STOP";
322
+ retry_strategy?: /* different behaviors for retrying failed execution actions. */ RetryStrategy;
326
323
  }
327
324
  export interface AutomationActionConfig {
328
325
  id?: /**
@@ -361,10 +358,7 @@ declare namespace Components {
361
358
  [name: string]: any;
362
359
  };
363
360
  error_output?: ErrorOutput;
364
- /**
365
- * different behaviors for retrying failed execution actions.
366
- */
367
- retry_strategy?: "RETRY_AND_RESUME" | "RETRY_AND_STOP";
361
+ retry_strategy?: /* different behaviors for retrying failed execution actions. */ RetryStrategy;
368
362
  }
369
363
  /**
370
364
  * example:
@@ -512,10 +506,7 @@ declare namespace Components {
512
506
  [name: string]: any;
513
507
  };
514
508
  error_output?: ErrorOutput;
515
- /**
516
- * different behaviors for retrying failed execution actions.
517
- */
518
- retry_strategy?: "RETRY_AND_RESUME" | "RETRY_AND_STOP";
509
+ retry_strategy?: /* different behaviors for retrying failed execution actions. */ RetryStrategy;
519
510
  }
520
511
  /**
521
512
  * Creates an order entity with prices from journey
@@ -628,10 +619,7 @@ declare namespace Components {
628
619
  [name: string]: any;
629
620
  };
630
621
  error_output?: ErrorOutput;
631
- /**
632
- * different behaviors for retrying failed execution actions.
633
- */
634
- retry_strategy?: "RETRY_AND_RESUME" | "RETRY_AND_STOP";
622
+ retry_strategy?: /* different behaviors for retrying failed execution actions. */ RetryStrategy;
635
623
  }
636
624
  /**
637
625
  * example:
@@ -778,10 +766,7 @@ declare namespace Components {
778
766
  [name: string]: any;
779
767
  };
780
768
  error_output?: ErrorOutput;
781
- /**
782
- * different behaviors for retrying failed execution actions.
783
- */
784
- retry_strategy?: "RETRY_AND_RESUME" | "RETRY_AND_STOP";
769
+ retry_strategy?: /* different behaviors for retrying failed execution actions. */ RetryStrategy;
785
770
  }
786
771
  /**
787
772
  * example:
@@ -1093,6 +1078,13 @@ declare namespace Components {
1093
1078
  };
1094
1079
  mode: "append" | "prepend" | "set";
1095
1080
  }
1081
+ export interface RetryReq {
1082
+ retry_strategy?: /* different behaviors for retrying failed execution actions. */ RetryStrategy;
1083
+ }
1084
+ /**
1085
+ * different behaviors for retrying failed execution actions.
1086
+ */
1087
+ export type RetryStrategy = "RETRY_AND_RESUME" | "RETRY_AND_STOP";
1096
1088
  export interface SearchAutomationsResp {
1097
1089
  total: number;
1098
1090
  results: AutomationFlow[];
@@ -1130,10 +1122,7 @@ declare namespace Components {
1130
1122
  [name: string]: any;
1131
1123
  };
1132
1124
  error_output?: ErrorOutput;
1133
- /**
1134
- * different behaviors for retrying failed execution actions.
1135
- */
1136
- retry_strategy?: "RETRY_AND_RESUME" | "RETRY_AND_STOP";
1125
+ retry_strategy?: /* different behaviors for retrying failed execution actions. */ RetryStrategy;
1137
1126
  }
1138
1127
  /**
1139
1128
  * example:
@@ -1296,10 +1285,7 @@ declare namespace Components {
1296
1285
  [name: string]: any;
1297
1286
  };
1298
1287
  error_output?: ErrorOutput;
1299
- /**
1300
- * different behaviors for retrying failed execution actions.
1301
- */
1302
- retry_strategy?: "RETRY_AND_RESUME" | "RETRY_AND_STOP";
1288
+ retry_strategy?: /* different behaviors for retrying failed execution actions. */ RetryStrategy;
1303
1289
  }
1304
1290
  /**
1305
1291
  * example:
@@ -1376,10 +1362,7 @@ declare namespace Components {
1376
1362
  [name: string]: any;
1377
1363
  };
1378
1364
  error_output?: ErrorOutput;
1379
- /**
1380
- * different behaviors for retrying failed execution actions.
1381
- */
1382
- retry_strategy?: "RETRY_AND_RESUME" | "RETRY_AND_STOP";
1365
+ retry_strategy?: /* different behaviors for retrying failed execution actions. */ RetryStrategy;
1383
1366
  }
1384
1367
  /**
1385
1368
  * example:
@@ -1609,6 +1592,7 @@ declare namespace Paths {
1609
1592
  execution_id: Parameters.ExecutionId;
1610
1593
  action_id: Parameters.ActionId;
1611
1594
  }
1595
+ export type RequestBody = Components.Schemas.RetryReq;
1612
1596
  namespace Responses {
1613
1597
  export interface $200 {
1614
1598
  }
@@ -1749,11 +1733,11 @@ export interface OperationMethods {
1749
1733
  /**
1750
1734
  * retriggerAction - retriggerAction
1751
1735
  *
1752
- * Retrigger a specific automation execution action
1736
+ * Retry a specific automation execution action which failed / is stuck.
1753
1737
  */
1754
1738
  'retriggerAction'(
1755
1739
  parameters?: Parameters<Paths.RetriggerAction.PathParameters> | null,
1756
- data?: any,
1740
+ data?: Paths.RetriggerAction.RequestBody,
1757
1741
  config?: AxiosRequestConfig
1758
1742
  ): OperationResponse<Paths.RetriggerAction.Responses.$200>
1759
1743
  }
@@ -1861,11 +1845,11 @@ export interface PathsDictionary {
1861
1845
  /**
1862
1846
  * retriggerAction - retriggerAction
1863
1847
  *
1864
- * Retrigger a specific automation execution action
1848
+ * Retry a specific automation execution action which failed / is stuck.
1865
1849
  */
1866
1850
  'post'(
1867
1851
  parameters?: Parameters<Paths.RetriggerAction.PathParameters> | null,
1868
- data?: any,
1852
+ data?: Paths.RetriggerAction.RequestBody,
1869
1853
  config?: AxiosRequestConfig
1870
1854
  ): OperationResponse<Paths.RetriggerAction.Responses.$200>
1871
1855
  }
package/dist/openapi.json CHANGED
@@ -361,7 +361,7 @@
361
361
  "post": {
362
362
  "operationId": "retriggerAction",
363
363
  "summary": "retriggerAction",
364
- "description": "Retrigger a specific automation execution action",
364
+ "description": "Retry a specific automation execution action which failed / is stuck.",
365
365
  "tags": [
366
366
  "executions"
367
367
  ],
@@ -378,13 +378,23 @@
378
378
  {
379
379
  "name": "action_id",
380
380
  "in": "path",
381
- "description": "Id of Action to retrigger",
381
+ "description": "Id of Action to retry.",
382
382
  "schema": {
383
383
  "$ref": "#/components/schemas/AutomationActionId"
384
384
  },
385
385
  "required": true
386
386
  }
387
387
  ],
388
+ "requestBody": {
389
+ "description": "Retry request details.",
390
+ "content": {
391
+ "application/json": {
392
+ "schema": {
393
+ "$ref": "#/components/schemas/RetryReq"
394
+ }
395
+ }
396
+ }
397
+ },
388
398
  "responses": {
389
399
  "200": {
390
400
  "description": "action re-triggered with success"
@@ -622,15 +632,18 @@
622
632
  "$ref": "#/components/schemas/ErrorOutput"
623
633
  },
624
634
  "retry_strategy": {
625
- "type": "string",
626
- "description": "different behaviors for retrying failed execution actions.",
627
- "enum": [
628
- "RETRY_AND_RESUME",
629
- "RETRY_AND_STOP"
630
- ]
635
+ "$ref": "#/components/schemas/RetryStrategy"
631
636
  }
632
637
  }
633
638
  },
639
+ "RetryStrategy": {
640
+ "type": "string",
641
+ "description": "different behaviors for retrying failed execution actions.",
642
+ "enum": [
643
+ "RETRY_AND_RESUME",
644
+ "RETRY_AND_STOP"
645
+ ]
646
+ },
634
647
  "AutomationAction": {
635
648
  "allOf": [
636
649
  {
@@ -2072,6 +2085,14 @@
2072
2085
  "_created_at",
2073
2086
  "_updated_at"
2074
2087
  ]
2088
+ },
2089
+ "RetryReq": {
2090
+ "type": "object",
2091
+ "properties": {
2092
+ "retry_strategy": {
2093
+ "$ref": "#/components/schemas/RetryStrategy"
2094
+ }
2095
+ }
2075
2096
  }
2076
2097
  }
2077
2098
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/automation-client",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Client library for epilot automation API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",