@epilot/automation-client
Advanced tools
Comparing version 0.9.0 to 0.10.0
@@ -1,1 +0,2 @@ | ||
export declare const getClient: () => import("openapi-client-axios").OpenAPIClient<import("./openapi").OperationMethods, import("./openapi").PathsDictionary>; | ||
import { Client } from './openapi'; | ||
export declare const getClient: () => Client; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k; |
/* eslint-disable */ | ||
import { | ||
import type { | ||
OpenAPIClient, | ||
@@ -11,572 +11,837 @@ Parameters, | ||
declare namespace Components { | ||
namespace Schemas { | ||
export type AnyAction = MapEntityAction | TriggerWorkflowAction | TriggerWebhookAction | CreateDocumentAction | SendEmailAction | AutomationAction; | ||
/** | ||
* example: | ||
* [ | ||
* { | ||
* "step_name": "Lead Sales", | ||
* "user_ids": [ | ||
* 10010729 | ||
* ] | ||
* }, | ||
* { | ||
* "step_name": "Operations", | ||
* "user_ids": [ | ||
* 10010728, | ||
* 10010729 | ||
* ] | ||
* } | ||
* ] | ||
*/ | ||
export interface AssignUsersToStep { | ||
step_name?: string; | ||
user_ids?: number[]; | ||
} | ||
export interface AutomationAction { | ||
id?: AutomationActionId; | ||
name?: string; | ||
type?: string; | ||
config?: { | ||
[name: string]: any; | ||
}; | ||
execution_status?: ExecutionStatus; | ||
started_at?: string; | ||
updated_at?: string; | ||
/** | ||
* Flag indicating whether the action was created automatically or manually | ||
*/ | ||
created_automatically?: boolean; | ||
} | ||
/** | ||
* example: | ||
* 9ec3711b-db63-449c-b894-54d5bb622a8f | ||
*/ | ||
export type AutomationActionId = string; | ||
export interface AutomationExecution { | ||
id: AutomationExecutionId; | ||
/** | ||
* example: | ||
* success | ||
*/ | ||
execution_status?: ExecutionStatus; | ||
entity_id: EntityId; | ||
org_id: OrganizationId; | ||
flow_id: AutomationFlowId; | ||
/** | ||
* example: | ||
* Handle contact form | ||
*/ | ||
flow_name?: string; | ||
created_at?: string; // date-time | ||
updated_at?: string; // date-time | ||
current_action_id?: AutomationActionId; | ||
actions: AnyAction[]; | ||
} | ||
/** | ||
* example: | ||
* 9baf184f-bc81-4128-bca3-d974c90a12c4 | ||
*/ | ||
export type AutomationExecutionId = string; | ||
export interface AutomationFlow { | ||
id?: AutomationFlowId; | ||
/** | ||
* example: | ||
* Handle contact form | ||
*/ | ||
flow_name?: string; | ||
/** | ||
* Number of automation executions that ran | ||
* example: | ||
* 7 | ||
*/ | ||
runs?: number; | ||
triggers?: (FrontendSubmitTrigger | JourneySubmitTrigger | EntityOperationTrigger)[]; | ||
trigger_conditions?: TriggerCondition[]; | ||
/** | ||
* The entity schema | ||
* example: | ||
* submission | ||
*/ | ||
entity_schema?: string; | ||
actions?: AnyAction[]; | ||
created_at?: string; // date-time | ||
updated_at?: string; // date-time | ||
} | ||
/** | ||
* example: | ||
* 7791b04a-16d2-44a2-9af9-2d59c25c512f | ||
*/ | ||
export type AutomationFlowId = string; | ||
export type Comparison = "equals" | "any_of" | "not_empty" | "is_empty"; | ||
/** | ||
* 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\"" | ||
* } | ||
* } | ||
* } | ||
*/ | ||
export interface CreateDocumentAction { | ||
id?: AutomationActionId; | ||
name?: string; | ||
type?: string; | ||
config?: CreateDocumentConfig; | ||
execution_status?: ExecutionStatus; | ||
started_at?: string; | ||
updated_at?: string; | ||
/** | ||
* Flag indicating whether the action was created automatically or manually | ||
*/ | ||
created_automatically?: boolean; | ||
outputs?: { | ||
[name: string]: any; | ||
}; | ||
} | ||
export interface CreateDocumentConfig { | ||
template_id?: string; | ||
filename?: string; | ||
} | ||
/** | ||
* example: | ||
* e3d3ebac-baab-4395-abf4-50b5bf1f8b74 | ||
*/ | ||
export type EntityId = string; | ||
export interface EntityOperationTrigger { | ||
type: "entity_operation"; | ||
configuration: { | ||
namespace Schemas { | ||
export type AnyAction = /** | ||
* example: | ||
* { | ||
* "id": "2520gja-2sgmsaga-0asg-822jgal", | ||
* "name": "Map Entity", | ||
* "type": "map-entity", | ||
* "config": { | ||
* "target_schema": "contact", | ||
* "target_unique": [ | ||
* "email.email" | ||
* ], | ||
* "mapping_attributes": [ | ||
* { | ||
* "target": "email", | ||
* "mode": "append_if_exists", | ||
* "source": "billing_contact", | ||
* "value_json": "{\n \"email\": \"billing_contact.email\"\n}" | ||
* }, | ||
* { | ||
* "target": "_tags", | ||
* "mode": "set_value", | ||
* "value": [ | ||
* "primary", | ||
* "payer" | ||
* ] | ||
* }, | ||
* { | ||
* "target": "first_name", | ||
* "mode": "copy_if_exists", | ||
* "source": "billing_contact.first_name" | ||
* }, | ||
* { | ||
* "target": "last_name", | ||
* "mode": "copy_if_exists", | ||
* "source": "billing_contact.last_name" | ||
* }, | ||
* { | ||
* "target": "contact_type", | ||
* "mode": "set_value", | ||
* "value": "customer" | ||
* }, | ||
* { | ||
* "target": "addresses", | ||
* "mode": "append_if_exists", | ||
* "source": "billing_contact", | ||
* "value_json": "{\n \"street_name\": \"billing_contact.street_name\",\n \"street_number\": \"billing_contact.street_number\",\n \"city\": \"billing_contact.city\",\n \"postal_code\": \"billing_contact.postal_code\",\n \"country\": \"billing_contact.country\",\n \"_tags\": [\"billing\", \"primary\"]\n}" | ||
* }, | ||
* { | ||
* "target": "addresses", | ||
* "mode": "append_if_exists", | ||
* "source": "delivery_contact", | ||
* "value_json": "{\n \"street_name\": \"delivery_contact.street_name\",\n \"street_number\": \"delivery_contact.street_number\",\n \"city\": \"delivery_contact.city\",\n \"postal_code\": \"delivery_contact.postal_code\",\n \"country\": \"delivery_contact.country\",\n \"_tags\": [\"delivery\", \"secondary\"]\n}" | ||
* } | ||
* ] | ||
* } | ||
* } | ||
*/ | ||
MapEntityAction | /** | ||
* 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 | /** | ||
* example: | ||
* { | ||
* "id": "2520gja-2sgmsaga-0asg-822jgal", | ||
* "name": "Trigger Webhook", | ||
* "type": "trigger-webhook", | ||
* "config": { | ||
* "entity_sources": [ | ||
* "contact", | ||
* "account" | ||
* ], | ||
* "target_webhook_id": "25jg9ag2ga" | ||
* } | ||
* } | ||
*/ | ||
TriggerWebhookAction | /** | ||
* 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 | /** | ||
* example: | ||
* { | ||
* "id": "25jga0-gkasl26-0asg-908sgaj2", | ||
* "name": "Send Email", | ||
* "type": "send-email", | ||
* "config": { | ||
* "email_template_id": "gasj02-29ug9asgm-29t9gsaghg2g-pkmbhx2", | ||
* "language_code": "de" | ||
* } | ||
* } | ||
*/ | ||
SendEmailAction | AutomationAction; | ||
/** | ||
* example: | ||
* 210738fe-e1e6-446e-aaef-cce462d7d813 | ||
* [ | ||
* { | ||
* "step_name": "Lead Sales", | ||
* "user_ids": [ | ||
* 10010729 | ||
* ] | ||
* }, | ||
* { | ||
* "step_name": "Operations", | ||
* "user_ids": [ | ||
* 10010728, | ||
* 10010729 | ||
* ] | ||
* } | ||
* ] | ||
*/ | ||
source_id?: string; | ||
export interface AssignUsersToStep { | ||
step_name?: string; | ||
user_ids?: number[]; | ||
} | ||
export interface AutomationAction { | ||
id?: /** | ||
* example: | ||
* 9ec3711b-db63-449c-b894-54d5bb622a8f | ||
*/ | ||
AutomationActionId; | ||
name?: string; | ||
type?: string; | ||
config?: { | ||
[name: string]: any; | ||
}; | ||
status?: ExecutionStatus; | ||
started_at?: string; | ||
updated_at?: string; | ||
/** | ||
* Flag indicating whether the action was created automatically or manually | ||
*/ | ||
created_automatically?: boolean; | ||
} | ||
/** | ||
* example: | ||
* submission | ||
* 9ec3711b-db63-449c-b894-54d5bb622a8f | ||
*/ | ||
schema?: string; | ||
operations?: ("createEntity" | "updateEntity" | "deleteEntity")[]; | ||
}; | ||
} | ||
export type ExecutionStatus = "pending" | "in_progress" | "success" | "failed" | "cancelled"; | ||
export interface FrontendSubmitTrigger { | ||
type: "frontend_submission"; | ||
configuration: { | ||
export type AutomationActionId = string; | ||
export interface AutomationExecution { | ||
id: /** | ||
* example: | ||
* 9baf184f-bc81-4128-bca3-d974c90a12c4 | ||
*/ | ||
AutomationExecutionId; | ||
/** | ||
* example: | ||
* success | ||
*/ | ||
status: ExecutionStatus; | ||
entity_id: /** | ||
* example: | ||
* e3d3ebac-baab-4395-abf4-50b5bf1f8b74 | ||
*/ | ||
EntityId; | ||
org_id: /** | ||
* example: | ||
* e3d3ebac-baab-4395-abf4-50b5bf1f8b74 | ||
*/ | ||
OrganizationId; | ||
flow_id: /** | ||
* example: | ||
* 7791b04a-16d2-44a2-9af9-2d59c25c512f | ||
*/ | ||
AutomationFlowId; | ||
/** | ||
* example: | ||
* Handle contact form | ||
*/ | ||
flow_name?: string; | ||
created_at?: string; // date-time | ||
updated_at?: string; // date-time | ||
current_action_id?: /** | ||
* example: | ||
* 9ec3711b-db63-449c-b894-54d5bb622a8f | ||
*/ | ||
AutomationActionId; | ||
actions: AnyAction[]; | ||
} | ||
/** | ||
* example: | ||
* 99 | ||
* 9baf184f-bc81-4128-bca3-d974c90a12c4 | ||
*/ | ||
source_id?: string; | ||
}; | ||
export type AutomationExecutionId = string; | ||
export interface AutomationFlow { | ||
id?: /** | ||
* example: | ||
* 7791b04a-16d2-44a2-9af9-2d59c25c512f | ||
*/ | ||
AutomationFlowId; | ||
/** | ||
* example: | ||
* Handle contact form | ||
*/ | ||
flow_name?: string; | ||
/** | ||
* Number of automation executions that ran | ||
* example: | ||
* 7 | ||
*/ | ||
runs?: number; | ||
triggers?: (FrontendSubmitTrigger | JourneySubmitTrigger | EntityOperationTrigger | EntityManualTrigger)[]; | ||
trigger_conditions?: /** | ||
* example: | ||
* { | ||
* "source": "billing_contact.email", | ||
* "comparison": "exists" | ||
* } | ||
*/ | ||
TriggerCondition[]; | ||
/** | ||
* The entity schema | ||
* example: | ||
* submission | ||
*/ | ||
entity_schema?: string; | ||
actions?: AnyAction[]; | ||
created_at?: string; // date-time | ||
updated_at?: string; // date-time | ||
} | ||
/** | ||
* example: | ||
* 7791b04a-16d2-44a2-9af9-2d59c25c512f | ||
*/ | ||
export type AutomationFlowId = string; | ||
export type Comparison = "equals" | "any_of" | "not_empty" | "is_empty"; | ||
/** | ||
* 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\"" | ||
* } | ||
* } | ||
* } | ||
*/ | ||
export interface CreateDocumentAction { | ||
id?: /** | ||
* example: | ||
* 9ec3711b-db63-449c-b894-54d5bb622a8f | ||
*/ | ||
AutomationActionId; | ||
name?: string; | ||
type?: string; | ||
config?: CreateDocumentConfig; | ||
status?: ExecutionStatus; | ||
started_at?: string; | ||
updated_at?: string; | ||
/** | ||
* Flag indicating whether the action was created automatically or manually | ||
*/ | ||
created_automatically?: boolean; | ||
outputs?: { | ||
[name: string]: any; | ||
}; | ||
} | ||
export interface CreateDocumentConfig { | ||
template_id?: string; | ||
filename?: string; | ||
} | ||
/** | ||
* example: | ||
* e3d3ebac-baab-4395-abf4-50b5bf1f8b74 | ||
*/ | ||
export type EntityId = string; | ||
export interface EntityManualTrigger { | ||
type: "entity_manual"; | ||
configuration: { | ||
/** | ||
* Which entity type can this automation be triggered from | ||
* example: | ||
* submission | ||
*/ | ||
schema?: string; | ||
}; | ||
} | ||
export interface EntityOperationTrigger { | ||
type: "entity_operation"; | ||
configuration: { | ||
/** | ||
* example: | ||
* submission | ||
*/ | ||
schema?: string; | ||
operations?: ("createEntity" | "updateEntity" | "deleteEntity")[]; | ||
}; | ||
} | ||
export type ExecutionStatus = "pending" | "in_progress" | "success" | "failed" | "cancelled"; | ||
export interface FrontendSubmitTrigger { | ||
type: "frontend_submission"; | ||
configuration: { | ||
/** | ||
* example: | ||
* 99 | ||
*/ | ||
source_id?: string; | ||
}; | ||
} | ||
export interface GetExecutionsResp { | ||
total: number; | ||
results: AutomationExecution[]; | ||
} | ||
export interface JourneySubmitTrigger { | ||
type: "journey_submission"; | ||
configuration: { | ||
source_id: string; // uuid | ||
}; | ||
} | ||
/** | ||
* example: | ||
* { | ||
* "id": "2520gja-2sgmsaga-0asg-822jgal", | ||
* "name": "Map Entity", | ||
* "type": "map-entity", | ||
* "config": { | ||
* "target_schema": "contact", | ||
* "target_unique": [ | ||
* "email.email" | ||
* ], | ||
* "mapping_attributes": [ | ||
* { | ||
* "target": "email", | ||
* "mode": "append_if_exists", | ||
* "source": "billing_contact", | ||
* "value_json": "{\n \"email\": \"billing_contact.email\"\n}" | ||
* }, | ||
* { | ||
* "target": "_tags", | ||
* "mode": "set_value", | ||
* "value": [ | ||
* "primary", | ||
* "payer" | ||
* ] | ||
* }, | ||
* { | ||
* "target": "first_name", | ||
* "mode": "copy_if_exists", | ||
* "source": "billing_contact.first_name" | ||
* }, | ||
* { | ||
* "target": "last_name", | ||
* "mode": "copy_if_exists", | ||
* "source": "billing_contact.last_name" | ||
* }, | ||
* { | ||
* "target": "contact_type", | ||
* "mode": "set_value", | ||
* "value": "customer" | ||
* }, | ||
* { | ||
* "target": "addresses", | ||
* "mode": "append_if_exists", | ||
* "source": "billing_contact", | ||
* "value_json": "{\n \"street_name\": \"billing_contact.street_name\",\n \"street_number\": \"billing_contact.street_number\",\n \"city\": \"billing_contact.city\",\n \"postal_code\": \"billing_contact.postal_code\",\n \"country\": \"billing_contact.country\",\n \"_tags\": [\"billing\", \"primary\"]\n}" | ||
* }, | ||
* { | ||
* "target": "addresses", | ||
* "mode": "append_if_exists", | ||
* "source": "delivery_contact", | ||
* "value_json": "{\n \"street_name\": \"delivery_contact.street_name\",\n \"street_number\": \"delivery_contact.street_number\",\n \"city\": \"delivery_contact.city\",\n \"postal_code\": \"delivery_contact.postal_code\",\n \"country\": \"delivery_contact.country\",\n \"_tags\": [\"delivery\", \"secondary\"]\n}" | ||
* } | ||
* ] | ||
* } | ||
* } | ||
*/ | ||
export interface MapEntityAction { | ||
id?: /** | ||
* example: | ||
* 9ec3711b-db63-449c-b894-54d5bb622a8f | ||
*/ | ||
AutomationActionId; | ||
name?: string; | ||
type?: string; | ||
config?: MapEntityActionConfig; | ||
status?: ExecutionStatus; | ||
started_at?: string; | ||
updated_at?: string; | ||
/** | ||
* Flag indicating whether the action was created automatically or manually | ||
*/ | ||
created_automatically?: boolean; | ||
outputs?: { | ||
[name: string]: any; | ||
}; | ||
} | ||
export interface MapEntityActionConfig { | ||
target_schema?: string; | ||
target_unique?: string[]; | ||
mapping_attributes?: MappingAttribute[]; | ||
relation_attributes?: RelationAttribute[]; | ||
} | ||
export interface MappingAttribute { | ||
/** | ||
* JSON like target path for the attribute. Eg. last_name | ||
*/ | ||
target: string; | ||
/** | ||
* - 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. | ||
* | ||
*/ | ||
mode: "copy_if_exists" | "append_if_exists" | "set_value"; | ||
/** | ||
* JSON source path for the value to be extracted from. Eg: steps[1].['Product Info'].price | ||
* | ||
*/ | ||
source: string; | ||
/** | ||
* To be provided only when mapping json objects into a target attribute. Eg array of addresses. | ||
* | ||
*/ | ||
value_json?: string; | ||
/** | ||
* Any value to be set: string, number, string[], number[], JSON object, etc. It will override existing values, if any. | ||
* | ||
*/ | ||
value?: { | ||
[key: string]: any; | ||
}; | ||
} | ||
/** | ||
* example: | ||
* e3d3ebac-baab-4395-abf4-50b5bf1f8b74 | ||
*/ | ||
export type OrganizationId = string; | ||
export interface RelationAttribute { | ||
target: string; | ||
target_tags: string[]; | ||
related_to: { | ||
schema: string; | ||
tag: string; | ||
}; | ||
mode: "append" | "set"; | ||
} | ||
export interface SearchAutomationsResp { | ||
total: number; | ||
results: AutomationFlow; | ||
} | ||
/** | ||
* example: | ||
* { | ||
* "id": "25jga0-gkasl26-0asg-908sgaj2", | ||
* "name": "Send Email", | ||
* "type": "send-email", | ||
* "config": { | ||
* "email_template_id": "gasj02-29ug9asgm-29t9gsaghg2g-pkmbhx2", | ||
* "language_code": "de" | ||
* } | ||
* } | ||
*/ | ||
export interface SendEmailAction { | ||
id?: /** | ||
* example: | ||
* 9ec3711b-db63-449c-b894-54d5bb622a8f | ||
*/ | ||
AutomationActionId; | ||
name?: string; | ||
type?: string; | ||
config?: SendEmailActionConfig; | ||
status?: ExecutionStatus; | ||
started_at?: string; | ||
updated_at?: string; | ||
/** | ||
* Flag indicating whether the action was created automatically or manually | ||
*/ | ||
created_automatically?: boolean; | ||
} | ||
export interface SendEmailActionConfig { | ||
email_template_id?: string; | ||
language_code?: "de" | "en"; | ||
} | ||
export interface StartExecutionRequest { | ||
entity_id?: /** | ||
* example: | ||
* e3d3ebac-baab-4395-abf4-50b5bf1f8b74 | ||
*/ | ||
EntityId; | ||
flow_id?: /** | ||
* example: | ||
* 7791b04a-16d2-44a2-9af9-2d59c25c512f | ||
*/ | ||
AutomationFlowId; | ||
} | ||
/** | ||
* example: | ||
* { | ||
* "source": "billing_contact.email", | ||
* "comparison": "exists" | ||
* } | ||
*/ | ||
export interface TriggerCondition { | ||
source: string; | ||
comparison: Comparison; | ||
value?: string | number | string[] | number[]; | ||
} | ||
/** | ||
* example: | ||
* { | ||
* "id": "2520gja-2sgmsaga-0asg-822jgal", | ||
* "name": "Trigger Webhook", | ||
* "type": "trigger-webhook", | ||
* "config": { | ||
* "entity_sources": [ | ||
* "contact", | ||
* "account" | ||
* ], | ||
* "target_webhook_id": "25jg9ag2ga" | ||
* } | ||
* } | ||
*/ | ||
export interface TriggerWebhookAction { | ||
id?: /** | ||
* example: | ||
* 9ec3711b-db63-449c-b894-54d5bb622a8f | ||
*/ | ||
AutomationActionId; | ||
name?: string; | ||
type?: string; | ||
config?: TriggerWebhookActionConfig; | ||
status?: ExecutionStatus; | ||
started_at?: string; | ||
updated_at?: string; | ||
/** | ||
* Flag indicating whether the action was created automatically or manually | ||
*/ | ||
created_automatically?: boolean; | ||
outputs?: { | ||
[name: string]: any; | ||
}; | ||
} | ||
export interface TriggerWebhookActionConfig { | ||
entity_sources?: string[]; | ||
target_webhook_id?: string; | ||
} | ||
/** | ||
* 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 | ||
* ] | ||
* } | ||
* ] | ||
* } | ||
* } | ||
*/ | ||
export interface TriggerWorkflowAction { | ||
id?: /** | ||
* example: | ||
* 9ec3711b-db63-449c-b894-54d5bb622a8f | ||
*/ | ||
AutomationActionId; | ||
name?: string; | ||
type?: string; | ||
config?: TriggerWorkflowConfig; | ||
status?: ExecutionStatus; | ||
started_at?: string; | ||
updated_at?: string; | ||
/** | ||
* Flag indicating whether the action was created automatically or manually | ||
*/ | ||
created_automatically?: boolean; | ||
outputs?: { | ||
workflow?: { | ||
[name: string]: any; | ||
}; | ||
}; | ||
} | ||
/** | ||
* example: | ||
* { | ||
* "source": "email", | ||
* "comparison": "equals", | ||
* "schema": "contact", | ||
* "value": "test@epilot.cloud" | ||
* } | ||
*/ | ||
export interface TriggerWorkflowCondition { | ||
source: string; | ||
comparison: Comparison; | ||
value?: string | number | string[] | number[]; | ||
schema: string; | ||
} | ||
export interface TriggerWorkflowConfig { | ||
target_workflow?: string; | ||
conditions?: /** | ||
* example: | ||
* { | ||
* "source": "email", | ||
* "comparison": "equals", | ||
* "schema": "contact", | ||
* "value": "test@epilot.cloud" | ||
* } | ||
*/ | ||
TriggerWorkflowCondition[]; | ||
assignees?: string[]; | ||
assign_steps?: /** | ||
* example: | ||
* [ | ||
* { | ||
* "step_name": "Lead Sales", | ||
* "user_ids": [ | ||
* 10010729 | ||
* ] | ||
* }, | ||
* { | ||
* "step_name": "Operations", | ||
* "user_ids": [ | ||
* 10010728, | ||
* 10010729 | ||
* ] | ||
* } | ||
* ] | ||
*/ | ||
AssignUsersToStep[]; | ||
} | ||
} | ||
export interface GetExecutionsResp { | ||
total: number; | ||
results: AutomationExecution[]; | ||
} | ||
export interface JourneySubmitTrigger { | ||
type: "journey_submission"; | ||
configuration: { | ||
source_id: string; // uuid | ||
}; | ||
} | ||
/** | ||
* example: | ||
* { | ||
* "id": "2520gja-2sgmsaga-0asg-822jgal", | ||
* "name": "Map Entity", | ||
* "type": "map-entity", | ||
* "config": { | ||
* "target_schema": "contact", | ||
* "target_unique": [ | ||
* "email.email" | ||
* ], | ||
* "mapping_attributes": [ | ||
* { | ||
* "target": "email", | ||
* "mode": "append_if_exists", | ||
* "source": "billing_contact", | ||
* "value_json": "{\n \"email\": \"billing_contact.email\"\n}" | ||
* }, | ||
* { | ||
* "target": "_tags", | ||
* "mode": "set_value", | ||
* "value": [ | ||
* "primary", | ||
* "payer" | ||
* ] | ||
* }, | ||
* { | ||
* "target": "first_name", | ||
* "mode": "copy_if_exists", | ||
* "source": "billing_contact.first_name" | ||
* }, | ||
* { | ||
* "target": "last_name", | ||
* "mode": "copy_if_exists", | ||
* "source": "billing_contact.last_name" | ||
* }, | ||
* { | ||
* "target": "contact_type", | ||
* "mode": "set_value", | ||
* "value": "customer" | ||
* }, | ||
* { | ||
* "target": "addresses", | ||
* "mode": "append_if_exists", | ||
* "source": "billing_contact", | ||
* "value_json": "{\n \"street_name\": \"billing_contact.street_name\",\n \"street_number\": \"billing_contact.street_number\",\n \"city\": \"billing_contact.city\",\n \"postal_code\": \"billing_contact.postal_code\",\n \"country\": \"billing_contact.country\",\n \"_tags\": [\"billing\", \"primary\"]\n}" | ||
* }, | ||
* { | ||
* "target": "addresses", | ||
* "mode": "append_if_exists", | ||
* "source": "delivery_contact", | ||
* "value_json": "{\n \"street_name\": \"delivery_contact.street_name\",\n \"street_number\": \"delivery_contact.street_number\",\n \"city\": \"delivery_contact.city\",\n \"postal_code\": \"delivery_contact.postal_code\",\n \"country\": \"delivery_contact.country\",\n \"_tags\": [\"delivery\", \"secondary\"]\n}" | ||
* } | ||
* ] | ||
* } | ||
* } | ||
*/ | ||
export interface MapEntityAction { | ||
id?: AutomationActionId; | ||
name?: string; | ||
type?: string; | ||
config?: MapEntityActionConfig; | ||
execution_status?: ExecutionStatus; | ||
started_at?: string; | ||
updated_at?: string; | ||
/** | ||
* Flag indicating whether the action was created automatically or manually | ||
*/ | ||
created_automatically?: boolean; | ||
outputs?: { | ||
[name: string]: any; | ||
}; | ||
} | ||
export interface MapEntityActionConfig { | ||
target_schema?: string; | ||
target_unique?: string[]; | ||
mapping_attributes?: MappingAttribute[]; | ||
relation_attributes?: RelationAttribute[]; | ||
} | ||
export interface MappingAttribute { | ||
/** | ||
* JSON like target path for the attribute. Eg. last_name | ||
*/ | ||
target: string; | ||
/** | ||
* - 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. | ||
* | ||
*/ | ||
mode: "copy_if_exists" | "append_if_exists" | "set_value"; | ||
/** | ||
* JSON source path for the value to be extracted from. Eg: steps[1].['Product Info'].price | ||
* | ||
*/ | ||
source: string; | ||
/** | ||
* To be provided only when mapping json objects into a target attribute. Eg array of addresses. | ||
* | ||
*/ | ||
value_json?: string; | ||
/** | ||
* Any value to be set: string, number, string[], number[], JSON object, etc. It will override existing values, if any. | ||
* | ||
*/ | ||
value?: { | ||
}; | ||
} | ||
/** | ||
* example: | ||
* e3d3ebac-baab-4395-abf4-50b5bf1f8b74 | ||
*/ | ||
export type OrganizationId = string; | ||
export interface RelationAttribute { | ||
target: string; | ||
target_tags: string[]; | ||
related_to: { | ||
schema: string; | ||
tag: string; | ||
}; | ||
mode: "append" | "set"; | ||
} | ||
export interface SearchAutomationsResp { | ||
total: number; | ||
results: AutomationFlow; | ||
} | ||
/** | ||
* example: | ||
* { | ||
* "id": "25jga0-gkasl26-0asg-908sgaj2", | ||
* "name": "Send Email", | ||
* "type": "send-email", | ||
* "config": { | ||
* "email_template_id": "gasj02-29ug9asgm-29t9gsaghg2g-pkmbhx2", | ||
* "language_code": "de" | ||
* } | ||
* } | ||
*/ | ||
export interface SendEmailAction { | ||
id?: AutomationActionId; | ||
name?: string; | ||
type?: string; | ||
config?: SendEmailActionConfig; | ||
execution_status?: ExecutionStatus; | ||
started_at?: string; | ||
updated_at?: string; | ||
/** | ||
* Flag indicating whether the action was created automatically or manually | ||
*/ | ||
created_automatically?: boolean; | ||
} | ||
export interface SendEmailActionConfig { | ||
email_template_id?: string; | ||
language_code?: "de" | "en"; | ||
} | ||
export interface StartExecutionRequest { | ||
entity_id?: EntityId; | ||
flow_id?: AutomationFlowId; | ||
} | ||
/** | ||
* example: | ||
* { | ||
* "source": "billing_contact.email", | ||
* "comparison": "exists" | ||
* } | ||
*/ | ||
export interface TriggerCondition { | ||
source: string; | ||
comparison: Comparison; | ||
value?: string | number | string[] | number[]; | ||
} | ||
/** | ||
* example: | ||
* { | ||
* "id": "2520gja-2sgmsaga-0asg-822jgal", | ||
* "name": "Trigger Webhook", | ||
* "type": "trigger-webhook", | ||
* "config": { | ||
* "entity_sources": [ | ||
* "contact", | ||
* "account" | ||
* ], | ||
* "target_webhook_id": "25jg9ag2ga" | ||
* } | ||
* } | ||
*/ | ||
export interface TriggerWebhookAction { | ||
id?: AutomationActionId; | ||
name?: string; | ||
type?: string; | ||
config?: TriggerWebhookActionConfig; | ||
execution_status?: ExecutionStatus; | ||
started_at?: string; | ||
updated_at?: string; | ||
/** | ||
* Flag indicating whether the action was created automatically or manually | ||
*/ | ||
created_automatically?: boolean; | ||
outputs?: { | ||
[name: string]: any; | ||
}; | ||
} | ||
export interface TriggerWebhookActionConfig { | ||
entity_sources?: string[]; | ||
target_webhook_id?: string; | ||
} | ||
/** | ||
* 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 | ||
* ] | ||
* } | ||
* ] | ||
* } | ||
* } | ||
*/ | ||
export interface TriggerWorkflowAction { | ||
id?: AutomationActionId; | ||
name?: string; | ||
type?: string; | ||
config?: TriggerWorkflowConfig; | ||
execution_status?: ExecutionStatus; | ||
started_at?: string; | ||
updated_at?: string; | ||
/** | ||
* Flag indicating whether the action was created automatically or manually | ||
*/ | ||
created_automatically?: boolean; | ||
outputs?: { | ||
workflow?: { | ||
[name: string]: any; | ||
}; | ||
}; | ||
} | ||
/** | ||
* example: | ||
* { | ||
* "schema": "contact", | ||
* "source": "billing_contact.email", | ||
* "comparison": "exists", | ||
* "value": "test@epilot.cloud" | ||
* } | ||
*/ | ||
export interface TriggerWorkflowCondition { | ||
source: string; | ||
comparison: Comparison; | ||
value?: string | number | string[] | number[]; | ||
schema: string; | ||
} | ||
export interface TriggerWorkflowConfig { | ||
target_workflow?: string; | ||
conditions?: TriggerWorkflowCondition[]; | ||
assignees?: string[]; | ||
assign_steps?: AssignUsersToStep[]; | ||
} | ||
} | ||
} | ||
declare namespace Paths { | ||
namespace CancelExecution { | ||
namespace Parameters { | ||
export type ExecutionId = Components.Schemas.AutomationExecutionId; | ||
namespace CancelExecution { | ||
namespace Parameters { | ||
export type ExecutionId = /** | ||
* example: | ||
* 9baf184f-bc81-4128-bca3-d974c90a12c4 | ||
*/ | ||
Components.Schemas.AutomationExecutionId; | ||
} | ||
export interface PathParameters { | ||
execution_id: Parameters.ExecutionId; | ||
} | ||
namespace Responses { | ||
export type $200 = Components.Schemas.AutomationExecution; | ||
} | ||
} | ||
export interface PathParameters { | ||
execution_id: Parameters.ExecutionId; | ||
namespace CreateFlow { | ||
export type RequestBody = Components.Schemas.AutomationFlow; | ||
namespace Responses { | ||
export type $201 = Components.Schemas.AutomationFlow; | ||
} | ||
} | ||
namespace Responses { | ||
export type $200 = Components.Schemas.AutomationExecution; | ||
namespace DeleteFlow { | ||
namespace Parameters { | ||
export type FlowId = /** | ||
* example: | ||
* 7791b04a-16d2-44a2-9af9-2d59c25c512f | ||
*/ | ||
Components.Schemas.AutomationFlowId; | ||
} | ||
export interface PathParameters { | ||
flow_id: Parameters.FlowId; | ||
} | ||
namespace Responses { | ||
export type $200 = Components.Schemas.AutomationFlow; | ||
} | ||
} | ||
} | ||
namespace CreateFlow { | ||
export type RequestBody = Components.Schemas.AutomationFlow; | ||
namespace Responses { | ||
export type $201 = Components.Schemas.AutomationFlow; | ||
namespace GetExecution { | ||
namespace Parameters { | ||
export type ExecutionId = /** | ||
* example: | ||
* 9baf184f-bc81-4128-bca3-d974c90a12c4 | ||
*/ | ||
Components.Schemas.AutomationExecutionId; | ||
} | ||
export interface PathParameters { | ||
execution_id: Parameters.ExecutionId; | ||
} | ||
namespace Responses { | ||
export type $200 = Components.Schemas.AutomationExecution; | ||
} | ||
} | ||
} | ||
namespace DeleteFlow { | ||
namespace Parameters { | ||
export type FlowId = Components.Schemas.AutomationFlowId; | ||
namespace GetExecutions { | ||
namespace Parameters { | ||
export type EntityId = /** | ||
* example: | ||
* e3d3ebac-baab-4395-abf4-50b5bf1f8b74 | ||
*/ | ||
Components.Schemas.EntityId; | ||
export type From = number; | ||
export type Size = number; | ||
} | ||
export interface QueryParameters { | ||
entity_id?: Parameters.EntityId; | ||
size?: Parameters.Size; | ||
from?: Parameters.From; | ||
} | ||
namespace Responses { | ||
export type $200 = Components.Schemas.GetExecutionsResp; | ||
} | ||
} | ||
export interface PathParameters { | ||
flow_id: Parameters.FlowId; | ||
namespace GetFlow { | ||
namespace Parameters { | ||
export type FlowId = /** | ||
* example: | ||
* 7791b04a-16d2-44a2-9af9-2d59c25c512f | ||
*/ | ||
Components.Schemas.AutomationFlowId; | ||
} | ||
export interface PathParameters { | ||
flow_id: Parameters.FlowId; | ||
} | ||
namespace Responses { | ||
export type $200 = Components.Schemas.AutomationFlow; | ||
} | ||
} | ||
namespace Responses { | ||
export type $200 = Components.Schemas.AutomationFlow; | ||
namespace PutFlow { | ||
namespace Parameters { | ||
export type FlowId = /** | ||
* example: | ||
* 7791b04a-16d2-44a2-9af9-2d59c25c512f | ||
*/ | ||
Components.Schemas.AutomationFlowId; | ||
} | ||
export interface PathParameters { | ||
flow_id: Parameters.FlowId; | ||
} | ||
export type RequestBody = Components.Schemas.AutomationFlow; | ||
namespace Responses { | ||
export type $200 = Components.Schemas.AutomationFlow; | ||
} | ||
} | ||
} | ||
namespace GetExecution { | ||
namespace Parameters { | ||
export type ExecutionId = Components.Schemas.AutomationExecutionId; | ||
namespace SearchFlows { | ||
namespace Parameters { | ||
export type From = number; | ||
/** | ||
* example: | ||
* submission | ||
*/ | ||
export type Schema = string; | ||
export type Size = number; | ||
/** | ||
* example: | ||
* 600945fe-212e-4b97-acf7-391d64648384 | ||
*/ | ||
export type TriggerSourceId = string; | ||
} | ||
export interface QueryParameters { | ||
schema?: /** | ||
* example: | ||
* submission | ||
*/ | ||
Parameters.Schema; | ||
size?: Parameters.Size; | ||
from?: Parameters.From; | ||
trigger_source_id?: /** | ||
* example: | ||
* 600945fe-212e-4b97-acf7-391d64648384 | ||
*/ | ||
Parameters.TriggerSourceId; | ||
} | ||
namespace Responses { | ||
export type $200 = Components.Schemas.SearchAutomationsResp; | ||
} | ||
} | ||
export interface PathParameters { | ||
execution_id: Parameters.ExecutionId; | ||
namespace StartExecution { | ||
export type RequestBody = Components.Schemas.StartExecutionRequest; | ||
namespace Responses { | ||
export type $201 = Components.Schemas.AutomationExecution; | ||
} | ||
} | ||
namespace Responses { | ||
export type $200 = Components.Schemas.AutomationExecution; | ||
} | ||
} | ||
namespace GetExecutions { | ||
namespace Parameters { | ||
export type EntityId = Components.Schemas.EntityId; | ||
export type From = number; | ||
export type Size = number; | ||
} | ||
export interface QueryParameters { | ||
entity_id?: Parameters.EntityId; | ||
size?: Parameters.Size; | ||
from?: Parameters.From; | ||
} | ||
namespace Responses { | ||
export type $200 = Components.Schemas.GetExecutionsResp; | ||
} | ||
} | ||
namespace GetFlow { | ||
namespace Parameters { | ||
export type FlowId = Components.Schemas.AutomationFlowId; | ||
} | ||
export interface PathParameters { | ||
flow_id: Parameters.FlowId; | ||
} | ||
namespace Responses { | ||
export type $200 = Components.Schemas.AutomationFlow; | ||
} | ||
} | ||
namespace PutFlow { | ||
namespace Parameters { | ||
export type FlowId = Components.Schemas.AutomationFlowId; | ||
} | ||
export interface PathParameters { | ||
flow_id: Parameters.FlowId; | ||
} | ||
export type RequestBody = Components.Schemas.AutomationFlow; | ||
namespace Responses { | ||
export type $200 = Components.Schemas.AutomationFlow; | ||
} | ||
} | ||
namespace SearchFlows { | ||
namespace Parameters { | ||
export type From = number; | ||
/** | ||
* example: | ||
* submission | ||
*/ | ||
export type Schema = string; | ||
export type Size = number; | ||
/** | ||
* example: | ||
* 600945fe-212e-4b97-acf7-391d64648384 | ||
*/ | ||
export type TriggerSourceId = string; | ||
} | ||
export interface QueryParameters { | ||
schema?: Parameters.Schema; | ||
size?: Parameters.Size; | ||
from?: Parameters.From; | ||
trigger_source_id?: Parameters.TriggerSourceId; | ||
} | ||
namespace Responses { | ||
export type $200 = Components.Schemas.SearchAutomationsResp; | ||
} | ||
} | ||
namespace StartExecution { | ||
export type RequestBody = Components.Schemas.StartExecutionRequest; | ||
namespace Responses { | ||
export type $201 = Components.Schemas.AutomationExecution; | ||
} | ||
} | ||
} | ||
@@ -583,0 +848,0 @@ |
{ | ||
"name": "@epilot/automation-client", | ||
"version": "0.9.0", | ||
"version": "0.10.0", | ||
"description": "API Client for epilot automation API", | ||
@@ -32,3 +32,3 @@ "main": "dist/index.js", | ||
"peerDependencies": { | ||
"axios": "^0.21.1" | ||
"axios": "^0.25.0" | ||
}, | ||
@@ -38,3 +38,3 @@ "dependencies": { | ||
"https-browserify": "^1.0.0", | ||
"openapi-client-axios": "^3.13.1", | ||
"openapi-client-axios": "^5.1.2", | ||
"stream-http": "^3.1.1", | ||
@@ -46,7 +46,7 @@ "url": "^0.11.0", | ||
"@types/jest": "^26.0.20", | ||
"axios": "^0.21.1", | ||
"axios": "^0.25.0", | ||
"copy-webpack-plugin": "^7.0.0", | ||
"jest": "^26.6.3", | ||
"json-loader": "^0.5.7", | ||
"openapi-client-axios-typegen": "^3.13.1", | ||
"openapi-client-axios-typegen": "^5.0.2", | ||
"openapicmd": "^1.6.2", | ||
@@ -60,2 +60,2 @@ "ts-jest": "^26.5.0", | ||
} | ||
} | ||
} |
1365
src/openapi.d.ts
/* eslint-disable */ | ||
import { | ||
import type { | ||
OpenAPIClient, | ||
@@ -11,572 +11,837 @@ Parameters, | ||
declare namespace Components { | ||
namespace Schemas { | ||
export type AnyAction = MapEntityAction | TriggerWorkflowAction | TriggerWebhookAction | CreateDocumentAction | SendEmailAction | AutomationAction; | ||
/** | ||
* example: | ||
* [ | ||
* { | ||
* "step_name": "Lead Sales", | ||
* "user_ids": [ | ||
* 10010729 | ||
* ] | ||
* }, | ||
* { | ||
* "step_name": "Operations", | ||
* "user_ids": [ | ||
* 10010728, | ||
* 10010729 | ||
* ] | ||
* } | ||
* ] | ||
*/ | ||
export interface AssignUsersToStep { | ||
step_name?: string; | ||
user_ids?: number[]; | ||
} | ||
export interface AutomationAction { | ||
id?: AutomationActionId; | ||
name?: string; | ||
type?: string; | ||
config?: { | ||
[name: string]: any; | ||
}; | ||
execution_status?: ExecutionStatus; | ||
started_at?: string; | ||
updated_at?: string; | ||
/** | ||
* Flag indicating whether the action was created automatically or manually | ||
*/ | ||
created_automatically?: boolean; | ||
} | ||
/** | ||
* example: | ||
* 9ec3711b-db63-449c-b894-54d5bb622a8f | ||
*/ | ||
export type AutomationActionId = string; | ||
export interface AutomationExecution { | ||
id: AutomationExecutionId; | ||
/** | ||
* example: | ||
* success | ||
*/ | ||
execution_status?: ExecutionStatus; | ||
entity_id: EntityId; | ||
org_id: OrganizationId; | ||
flow_id: AutomationFlowId; | ||
/** | ||
* example: | ||
* Handle contact form | ||
*/ | ||
flow_name?: string; | ||
created_at?: string; // date-time | ||
updated_at?: string; // date-time | ||
current_action_id?: AutomationActionId; | ||
actions: AnyAction[]; | ||
} | ||
/** | ||
* example: | ||
* 9baf184f-bc81-4128-bca3-d974c90a12c4 | ||
*/ | ||
export type AutomationExecutionId = string; | ||
export interface AutomationFlow { | ||
id?: AutomationFlowId; | ||
/** | ||
* example: | ||
* Handle contact form | ||
*/ | ||
flow_name?: string; | ||
/** | ||
* Number of automation executions that ran | ||
* example: | ||
* 7 | ||
*/ | ||
runs?: number; | ||
triggers?: (FrontendSubmitTrigger | JourneySubmitTrigger | EntityOperationTrigger)[]; | ||
trigger_conditions?: TriggerCondition[]; | ||
/** | ||
* The entity schema | ||
* example: | ||
* submission | ||
*/ | ||
entity_schema?: string; | ||
actions?: AnyAction[]; | ||
created_at?: string; // date-time | ||
updated_at?: string; // date-time | ||
} | ||
/** | ||
* example: | ||
* 7791b04a-16d2-44a2-9af9-2d59c25c512f | ||
*/ | ||
export type AutomationFlowId = string; | ||
export type Comparison = "equals" | "any_of" | "not_empty" | "is_empty"; | ||
/** | ||
* 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\"" | ||
* } | ||
* } | ||
* } | ||
*/ | ||
export interface CreateDocumentAction { | ||
id?: AutomationActionId; | ||
name?: string; | ||
type?: string; | ||
config?: CreateDocumentConfig; | ||
execution_status?: ExecutionStatus; | ||
started_at?: string; | ||
updated_at?: string; | ||
/** | ||
* Flag indicating whether the action was created automatically or manually | ||
*/ | ||
created_automatically?: boolean; | ||
outputs?: { | ||
[name: string]: any; | ||
}; | ||
} | ||
export interface CreateDocumentConfig { | ||
template_id?: string; | ||
filename?: string; | ||
} | ||
/** | ||
* example: | ||
* e3d3ebac-baab-4395-abf4-50b5bf1f8b74 | ||
*/ | ||
export type EntityId = string; | ||
export interface EntityOperationTrigger { | ||
type: "entity_operation"; | ||
configuration: { | ||
namespace Schemas { | ||
export type AnyAction = /** | ||
* example: | ||
* { | ||
* "id": "2520gja-2sgmsaga-0asg-822jgal", | ||
* "name": "Map Entity", | ||
* "type": "map-entity", | ||
* "config": { | ||
* "target_schema": "contact", | ||
* "target_unique": [ | ||
* "email.email" | ||
* ], | ||
* "mapping_attributes": [ | ||
* { | ||
* "target": "email", | ||
* "mode": "append_if_exists", | ||
* "source": "billing_contact", | ||
* "value_json": "{\n \"email\": \"billing_contact.email\"\n}" | ||
* }, | ||
* { | ||
* "target": "_tags", | ||
* "mode": "set_value", | ||
* "value": [ | ||
* "primary", | ||
* "payer" | ||
* ] | ||
* }, | ||
* { | ||
* "target": "first_name", | ||
* "mode": "copy_if_exists", | ||
* "source": "billing_contact.first_name" | ||
* }, | ||
* { | ||
* "target": "last_name", | ||
* "mode": "copy_if_exists", | ||
* "source": "billing_contact.last_name" | ||
* }, | ||
* { | ||
* "target": "contact_type", | ||
* "mode": "set_value", | ||
* "value": "customer" | ||
* }, | ||
* { | ||
* "target": "addresses", | ||
* "mode": "append_if_exists", | ||
* "source": "billing_contact", | ||
* "value_json": "{\n \"street_name\": \"billing_contact.street_name\",\n \"street_number\": \"billing_contact.street_number\",\n \"city\": \"billing_contact.city\",\n \"postal_code\": \"billing_contact.postal_code\",\n \"country\": \"billing_contact.country\",\n \"_tags\": [\"billing\", \"primary\"]\n}" | ||
* }, | ||
* { | ||
* "target": "addresses", | ||
* "mode": "append_if_exists", | ||
* "source": "delivery_contact", | ||
* "value_json": "{\n \"street_name\": \"delivery_contact.street_name\",\n \"street_number\": \"delivery_contact.street_number\",\n \"city\": \"delivery_contact.city\",\n \"postal_code\": \"delivery_contact.postal_code\",\n \"country\": \"delivery_contact.country\",\n \"_tags\": [\"delivery\", \"secondary\"]\n}" | ||
* } | ||
* ] | ||
* } | ||
* } | ||
*/ | ||
MapEntityAction | /** | ||
* 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 | /** | ||
* example: | ||
* { | ||
* "id": "2520gja-2sgmsaga-0asg-822jgal", | ||
* "name": "Trigger Webhook", | ||
* "type": "trigger-webhook", | ||
* "config": { | ||
* "entity_sources": [ | ||
* "contact", | ||
* "account" | ||
* ], | ||
* "target_webhook_id": "25jg9ag2ga" | ||
* } | ||
* } | ||
*/ | ||
TriggerWebhookAction | /** | ||
* 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 | /** | ||
* example: | ||
* { | ||
* "id": "25jga0-gkasl26-0asg-908sgaj2", | ||
* "name": "Send Email", | ||
* "type": "send-email", | ||
* "config": { | ||
* "email_template_id": "gasj02-29ug9asgm-29t9gsaghg2g-pkmbhx2", | ||
* "language_code": "de" | ||
* } | ||
* } | ||
*/ | ||
SendEmailAction | AutomationAction; | ||
/** | ||
* example: | ||
* 210738fe-e1e6-446e-aaef-cce462d7d813 | ||
* [ | ||
* { | ||
* "step_name": "Lead Sales", | ||
* "user_ids": [ | ||
* 10010729 | ||
* ] | ||
* }, | ||
* { | ||
* "step_name": "Operations", | ||
* "user_ids": [ | ||
* 10010728, | ||
* 10010729 | ||
* ] | ||
* } | ||
* ] | ||
*/ | ||
source_id?: string; | ||
export interface AssignUsersToStep { | ||
step_name?: string; | ||
user_ids?: number[]; | ||
} | ||
export interface AutomationAction { | ||
id?: /** | ||
* example: | ||
* 9ec3711b-db63-449c-b894-54d5bb622a8f | ||
*/ | ||
AutomationActionId; | ||
name?: string; | ||
type?: string; | ||
config?: { | ||
[name: string]: any; | ||
}; | ||
status?: ExecutionStatus; | ||
started_at?: string; | ||
updated_at?: string; | ||
/** | ||
* Flag indicating whether the action was created automatically or manually | ||
*/ | ||
created_automatically?: boolean; | ||
} | ||
/** | ||
* example: | ||
* submission | ||
* 9ec3711b-db63-449c-b894-54d5bb622a8f | ||
*/ | ||
schema?: string; | ||
operations?: ("createEntity" | "updateEntity" | "deleteEntity")[]; | ||
}; | ||
} | ||
export type ExecutionStatus = "pending" | "in_progress" | "success" | "failed" | "cancelled"; | ||
export interface FrontendSubmitTrigger { | ||
type: "frontend_submission"; | ||
configuration: { | ||
export type AutomationActionId = string; | ||
export interface AutomationExecution { | ||
id: /** | ||
* example: | ||
* 9baf184f-bc81-4128-bca3-d974c90a12c4 | ||
*/ | ||
AutomationExecutionId; | ||
/** | ||
* example: | ||
* success | ||
*/ | ||
status: ExecutionStatus; | ||
entity_id: /** | ||
* example: | ||
* e3d3ebac-baab-4395-abf4-50b5bf1f8b74 | ||
*/ | ||
EntityId; | ||
org_id: /** | ||
* example: | ||
* e3d3ebac-baab-4395-abf4-50b5bf1f8b74 | ||
*/ | ||
OrganizationId; | ||
flow_id: /** | ||
* example: | ||
* 7791b04a-16d2-44a2-9af9-2d59c25c512f | ||
*/ | ||
AutomationFlowId; | ||
/** | ||
* example: | ||
* Handle contact form | ||
*/ | ||
flow_name?: string; | ||
created_at?: string; // date-time | ||
updated_at?: string; // date-time | ||
current_action_id?: /** | ||
* example: | ||
* 9ec3711b-db63-449c-b894-54d5bb622a8f | ||
*/ | ||
AutomationActionId; | ||
actions: AnyAction[]; | ||
} | ||
/** | ||
* example: | ||
* 99 | ||
* 9baf184f-bc81-4128-bca3-d974c90a12c4 | ||
*/ | ||
source_id?: string; | ||
}; | ||
export type AutomationExecutionId = string; | ||
export interface AutomationFlow { | ||
id?: /** | ||
* example: | ||
* 7791b04a-16d2-44a2-9af9-2d59c25c512f | ||
*/ | ||
AutomationFlowId; | ||
/** | ||
* example: | ||
* Handle contact form | ||
*/ | ||
flow_name?: string; | ||
/** | ||
* Number of automation executions that ran | ||
* example: | ||
* 7 | ||
*/ | ||
runs?: number; | ||
triggers?: (FrontendSubmitTrigger | JourneySubmitTrigger | EntityOperationTrigger | EntityManualTrigger)[]; | ||
trigger_conditions?: /** | ||
* example: | ||
* { | ||
* "source": "billing_contact.email", | ||
* "comparison": "exists" | ||
* } | ||
*/ | ||
TriggerCondition[]; | ||
/** | ||
* The entity schema | ||
* example: | ||
* submission | ||
*/ | ||
entity_schema?: string; | ||
actions?: AnyAction[]; | ||
created_at?: string; // date-time | ||
updated_at?: string; // date-time | ||
} | ||
/** | ||
* example: | ||
* 7791b04a-16d2-44a2-9af9-2d59c25c512f | ||
*/ | ||
export type AutomationFlowId = string; | ||
export type Comparison = "equals" | "any_of" | "not_empty" | "is_empty"; | ||
/** | ||
* 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\"" | ||
* } | ||
* } | ||
* } | ||
*/ | ||
export interface CreateDocumentAction { | ||
id?: /** | ||
* example: | ||
* 9ec3711b-db63-449c-b894-54d5bb622a8f | ||
*/ | ||
AutomationActionId; | ||
name?: string; | ||
type?: string; | ||
config?: CreateDocumentConfig; | ||
status?: ExecutionStatus; | ||
started_at?: string; | ||
updated_at?: string; | ||
/** | ||
* Flag indicating whether the action was created automatically or manually | ||
*/ | ||
created_automatically?: boolean; | ||
outputs?: { | ||
[name: string]: any; | ||
}; | ||
} | ||
export interface CreateDocumentConfig { | ||
template_id?: string; | ||
filename?: string; | ||
} | ||
/** | ||
* example: | ||
* e3d3ebac-baab-4395-abf4-50b5bf1f8b74 | ||
*/ | ||
export type EntityId = string; | ||
export interface EntityManualTrigger { | ||
type: "entity_manual"; | ||
configuration: { | ||
/** | ||
* Which entity type can this automation be triggered from | ||
* example: | ||
* submission | ||
*/ | ||
schema?: string; | ||
}; | ||
} | ||
export interface EntityOperationTrigger { | ||
type: "entity_operation"; | ||
configuration: { | ||
/** | ||
* example: | ||
* submission | ||
*/ | ||
schema?: string; | ||
operations?: ("createEntity" | "updateEntity" | "deleteEntity")[]; | ||
}; | ||
} | ||
export type ExecutionStatus = "pending" | "in_progress" | "success" | "failed" | "cancelled"; | ||
export interface FrontendSubmitTrigger { | ||
type: "frontend_submission"; | ||
configuration: { | ||
/** | ||
* example: | ||
* 99 | ||
*/ | ||
source_id?: string; | ||
}; | ||
} | ||
export interface GetExecutionsResp { | ||
total: number; | ||
results: AutomationExecution[]; | ||
} | ||
export interface JourneySubmitTrigger { | ||
type: "journey_submission"; | ||
configuration: { | ||
source_id: string; // uuid | ||
}; | ||
} | ||
/** | ||
* example: | ||
* { | ||
* "id": "2520gja-2sgmsaga-0asg-822jgal", | ||
* "name": "Map Entity", | ||
* "type": "map-entity", | ||
* "config": { | ||
* "target_schema": "contact", | ||
* "target_unique": [ | ||
* "email.email" | ||
* ], | ||
* "mapping_attributes": [ | ||
* { | ||
* "target": "email", | ||
* "mode": "append_if_exists", | ||
* "source": "billing_contact", | ||
* "value_json": "{\n \"email\": \"billing_contact.email\"\n}" | ||
* }, | ||
* { | ||
* "target": "_tags", | ||
* "mode": "set_value", | ||
* "value": [ | ||
* "primary", | ||
* "payer" | ||
* ] | ||
* }, | ||
* { | ||
* "target": "first_name", | ||
* "mode": "copy_if_exists", | ||
* "source": "billing_contact.first_name" | ||
* }, | ||
* { | ||
* "target": "last_name", | ||
* "mode": "copy_if_exists", | ||
* "source": "billing_contact.last_name" | ||
* }, | ||
* { | ||
* "target": "contact_type", | ||
* "mode": "set_value", | ||
* "value": "customer" | ||
* }, | ||
* { | ||
* "target": "addresses", | ||
* "mode": "append_if_exists", | ||
* "source": "billing_contact", | ||
* "value_json": "{\n \"street_name\": \"billing_contact.street_name\",\n \"street_number\": \"billing_contact.street_number\",\n \"city\": \"billing_contact.city\",\n \"postal_code\": \"billing_contact.postal_code\",\n \"country\": \"billing_contact.country\",\n \"_tags\": [\"billing\", \"primary\"]\n}" | ||
* }, | ||
* { | ||
* "target": "addresses", | ||
* "mode": "append_if_exists", | ||
* "source": "delivery_contact", | ||
* "value_json": "{\n \"street_name\": \"delivery_contact.street_name\",\n \"street_number\": \"delivery_contact.street_number\",\n \"city\": \"delivery_contact.city\",\n \"postal_code\": \"delivery_contact.postal_code\",\n \"country\": \"delivery_contact.country\",\n \"_tags\": [\"delivery\", \"secondary\"]\n}" | ||
* } | ||
* ] | ||
* } | ||
* } | ||
*/ | ||
export interface MapEntityAction { | ||
id?: /** | ||
* example: | ||
* 9ec3711b-db63-449c-b894-54d5bb622a8f | ||
*/ | ||
AutomationActionId; | ||
name?: string; | ||
type?: string; | ||
config?: MapEntityActionConfig; | ||
status?: ExecutionStatus; | ||
started_at?: string; | ||
updated_at?: string; | ||
/** | ||
* Flag indicating whether the action was created automatically or manually | ||
*/ | ||
created_automatically?: boolean; | ||
outputs?: { | ||
[name: string]: any; | ||
}; | ||
} | ||
export interface MapEntityActionConfig { | ||
target_schema?: string; | ||
target_unique?: string[]; | ||
mapping_attributes?: MappingAttribute[]; | ||
relation_attributes?: RelationAttribute[]; | ||
} | ||
export interface MappingAttribute { | ||
/** | ||
* JSON like target path for the attribute. Eg. last_name | ||
*/ | ||
target: string; | ||
/** | ||
* - 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. | ||
* | ||
*/ | ||
mode: "copy_if_exists" | "append_if_exists" | "set_value"; | ||
/** | ||
* JSON source path for the value to be extracted from. Eg: steps[1].['Product Info'].price | ||
* | ||
*/ | ||
source: string; | ||
/** | ||
* To be provided only when mapping json objects into a target attribute. Eg array of addresses. | ||
* | ||
*/ | ||
value_json?: string; | ||
/** | ||
* Any value to be set: string, number, string[], number[], JSON object, etc. It will override existing values, if any. | ||
* | ||
*/ | ||
value?: { | ||
[key: string]: any; | ||
}; | ||
} | ||
/** | ||
* example: | ||
* e3d3ebac-baab-4395-abf4-50b5bf1f8b74 | ||
*/ | ||
export type OrganizationId = string; | ||
export interface RelationAttribute { | ||
target: string; | ||
target_tags: string[]; | ||
related_to: { | ||
schema: string; | ||
tag: string; | ||
}; | ||
mode: "append" | "set"; | ||
} | ||
export interface SearchAutomationsResp { | ||
total: number; | ||
results: AutomationFlow; | ||
} | ||
/** | ||
* example: | ||
* { | ||
* "id": "25jga0-gkasl26-0asg-908sgaj2", | ||
* "name": "Send Email", | ||
* "type": "send-email", | ||
* "config": { | ||
* "email_template_id": "gasj02-29ug9asgm-29t9gsaghg2g-pkmbhx2", | ||
* "language_code": "de" | ||
* } | ||
* } | ||
*/ | ||
export interface SendEmailAction { | ||
id?: /** | ||
* example: | ||
* 9ec3711b-db63-449c-b894-54d5bb622a8f | ||
*/ | ||
AutomationActionId; | ||
name?: string; | ||
type?: string; | ||
config?: SendEmailActionConfig; | ||
status?: ExecutionStatus; | ||
started_at?: string; | ||
updated_at?: string; | ||
/** | ||
* Flag indicating whether the action was created automatically or manually | ||
*/ | ||
created_automatically?: boolean; | ||
} | ||
export interface SendEmailActionConfig { | ||
email_template_id?: string; | ||
language_code?: "de" | "en"; | ||
} | ||
export interface StartExecutionRequest { | ||
entity_id?: /** | ||
* example: | ||
* e3d3ebac-baab-4395-abf4-50b5bf1f8b74 | ||
*/ | ||
EntityId; | ||
flow_id?: /** | ||
* example: | ||
* 7791b04a-16d2-44a2-9af9-2d59c25c512f | ||
*/ | ||
AutomationFlowId; | ||
} | ||
/** | ||
* example: | ||
* { | ||
* "source": "billing_contact.email", | ||
* "comparison": "exists" | ||
* } | ||
*/ | ||
export interface TriggerCondition { | ||
source: string; | ||
comparison: Comparison; | ||
value?: string | number | string[] | number[]; | ||
} | ||
/** | ||
* example: | ||
* { | ||
* "id": "2520gja-2sgmsaga-0asg-822jgal", | ||
* "name": "Trigger Webhook", | ||
* "type": "trigger-webhook", | ||
* "config": { | ||
* "entity_sources": [ | ||
* "contact", | ||
* "account" | ||
* ], | ||
* "target_webhook_id": "25jg9ag2ga" | ||
* } | ||
* } | ||
*/ | ||
export interface TriggerWebhookAction { | ||
id?: /** | ||
* example: | ||
* 9ec3711b-db63-449c-b894-54d5bb622a8f | ||
*/ | ||
AutomationActionId; | ||
name?: string; | ||
type?: string; | ||
config?: TriggerWebhookActionConfig; | ||
status?: ExecutionStatus; | ||
started_at?: string; | ||
updated_at?: string; | ||
/** | ||
* Flag indicating whether the action was created automatically or manually | ||
*/ | ||
created_automatically?: boolean; | ||
outputs?: { | ||
[name: string]: any; | ||
}; | ||
} | ||
export interface TriggerWebhookActionConfig { | ||
entity_sources?: string[]; | ||
target_webhook_id?: string; | ||
} | ||
/** | ||
* 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 | ||
* ] | ||
* } | ||
* ] | ||
* } | ||
* } | ||
*/ | ||
export interface TriggerWorkflowAction { | ||
id?: /** | ||
* example: | ||
* 9ec3711b-db63-449c-b894-54d5bb622a8f | ||
*/ | ||
AutomationActionId; | ||
name?: string; | ||
type?: string; | ||
config?: TriggerWorkflowConfig; | ||
status?: ExecutionStatus; | ||
started_at?: string; | ||
updated_at?: string; | ||
/** | ||
* Flag indicating whether the action was created automatically or manually | ||
*/ | ||
created_automatically?: boolean; | ||
outputs?: { | ||
workflow?: { | ||
[name: string]: any; | ||
}; | ||
}; | ||
} | ||
/** | ||
* example: | ||
* { | ||
* "source": "email", | ||
* "comparison": "equals", | ||
* "schema": "contact", | ||
* "value": "test@epilot.cloud" | ||
* } | ||
*/ | ||
export interface TriggerWorkflowCondition { | ||
source: string; | ||
comparison: Comparison; | ||
value?: string | number | string[] | number[]; | ||
schema: string; | ||
} | ||
export interface TriggerWorkflowConfig { | ||
target_workflow?: string; | ||
conditions?: /** | ||
* example: | ||
* { | ||
* "source": "email", | ||
* "comparison": "equals", | ||
* "schema": "contact", | ||
* "value": "test@epilot.cloud" | ||
* } | ||
*/ | ||
TriggerWorkflowCondition[]; | ||
assignees?: string[]; | ||
assign_steps?: /** | ||
* example: | ||
* [ | ||
* { | ||
* "step_name": "Lead Sales", | ||
* "user_ids": [ | ||
* 10010729 | ||
* ] | ||
* }, | ||
* { | ||
* "step_name": "Operations", | ||
* "user_ids": [ | ||
* 10010728, | ||
* 10010729 | ||
* ] | ||
* } | ||
* ] | ||
*/ | ||
AssignUsersToStep[]; | ||
} | ||
} | ||
export interface GetExecutionsResp { | ||
total: number; | ||
results: AutomationExecution[]; | ||
} | ||
export interface JourneySubmitTrigger { | ||
type: "journey_submission"; | ||
configuration: { | ||
source_id: string; // uuid | ||
}; | ||
} | ||
/** | ||
* example: | ||
* { | ||
* "id": "2520gja-2sgmsaga-0asg-822jgal", | ||
* "name": "Map Entity", | ||
* "type": "map-entity", | ||
* "config": { | ||
* "target_schema": "contact", | ||
* "target_unique": [ | ||
* "email.email" | ||
* ], | ||
* "mapping_attributes": [ | ||
* { | ||
* "target": "email", | ||
* "mode": "append_if_exists", | ||
* "source": "billing_contact", | ||
* "value_json": "{\n \"email\": \"billing_contact.email\"\n}" | ||
* }, | ||
* { | ||
* "target": "_tags", | ||
* "mode": "set_value", | ||
* "value": [ | ||
* "primary", | ||
* "payer" | ||
* ] | ||
* }, | ||
* { | ||
* "target": "first_name", | ||
* "mode": "copy_if_exists", | ||
* "source": "billing_contact.first_name" | ||
* }, | ||
* { | ||
* "target": "last_name", | ||
* "mode": "copy_if_exists", | ||
* "source": "billing_contact.last_name" | ||
* }, | ||
* { | ||
* "target": "contact_type", | ||
* "mode": "set_value", | ||
* "value": "customer" | ||
* }, | ||
* { | ||
* "target": "addresses", | ||
* "mode": "append_if_exists", | ||
* "source": "billing_contact", | ||
* "value_json": "{\n \"street_name\": \"billing_contact.street_name\",\n \"street_number\": \"billing_contact.street_number\",\n \"city\": \"billing_contact.city\",\n \"postal_code\": \"billing_contact.postal_code\",\n \"country\": \"billing_contact.country\",\n \"_tags\": [\"billing\", \"primary\"]\n}" | ||
* }, | ||
* { | ||
* "target": "addresses", | ||
* "mode": "append_if_exists", | ||
* "source": "delivery_contact", | ||
* "value_json": "{\n \"street_name\": \"delivery_contact.street_name\",\n \"street_number\": \"delivery_contact.street_number\",\n \"city\": \"delivery_contact.city\",\n \"postal_code\": \"delivery_contact.postal_code\",\n \"country\": \"delivery_contact.country\",\n \"_tags\": [\"delivery\", \"secondary\"]\n}" | ||
* } | ||
* ] | ||
* } | ||
* } | ||
*/ | ||
export interface MapEntityAction { | ||
id?: AutomationActionId; | ||
name?: string; | ||
type?: string; | ||
config?: MapEntityActionConfig; | ||
execution_status?: ExecutionStatus; | ||
started_at?: string; | ||
updated_at?: string; | ||
/** | ||
* Flag indicating whether the action was created automatically or manually | ||
*/ | ||
created_automatically?: boolean; | ||
outputs?: { | ||
[name: string]: any; | ||
}; | ||
} | ||
export interface MapEntityActionConfig { | ||
target_schema?: string; | ||
target_unique?: string[]; | ||
mapping_attributes?: MappingAttribute[]; | ||
relation_attributes?: RelationAttribute[]; | ||
} | ||
export interface MappingAttribute { | ||
/** | ||
* JSON like target path for the attribute. Eg. last_name | ||
*/ | ||
target: string; | ||
/** | ||
* - 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. | ||
* | ||
*/ | ||
mode: "copy_if_exists" | "append_if_exists" | "set_value"; | ||
/** | ||
* JSON source path for the value to be extracted from. Eg: steps[1].['Product Info'].price | ||
* | ||
*/ | ||
source: string; | ||
/** | ||
* To be provided only when mapping json objects into a target attribute. Eg array of addresses. | ||
* | ||
*/ | ||
value_json?: string; | ||
/** | ||
* Any value to be set: string, number, string[], number[], JSON object, etc. It will override existing values, if any. | ||
* | ||
*/ | ||
value?: { | ||
}; | ||
} | ||
/** | ||
* example: | ||
* e3d3ebac-baab-4395-abf4-50b5bf1f8b74 | ||
*/ | ||
export type OrganizationId = string; | ||
export interface RelationAttribute { | ||
target: string; | ||
target_tags: string[]; | ||
related_to: { | ||
schema: string; | ||
tag: string; | ||
}; | ||
mode: "append" | "set"; | ||
} | ||
export interface SearchAutomationsResp { | ||
total: number; | ||
results: AutomationFlow; | ||
} | ||
/** | ||
* example: | ||
* { | ||
* "id": "25jga0-gkasl26-0asg-908sgaj2", | ||
* "name": "Send Email", | ||
* "type": "send-email", | ||
* "config": { | ||
* "email_template_id": "gasj02-29ug9asgm-29t9gsaghg2g-pkmbhx2", | ||
* "language_code": "de" | ||
* } | ||
* } | ||
*/ | ||
export interface SendEmailAction { | ||
id?: AutomationActionId; | ||
name?: string; | ||
type?: string; | ||
config?: SendEmailActionConfig; | ||
execution_status?: ExecutionStatus; | ||
started_at?: string; | ||
updated_at?: string; | ||
/** | ||
* Flag indicating whether the action was created automatically or manually | ||
*/ | ||
created_automatically?: boolean; | ||
} | ||
export interface SendEmailActionConfig { | ||
email_template_id?: string; | ||
language_code?: "de" | "en"; | ||
} | ||
export interface StartExecutionRequest { | ||
entity_id?: EntityId; | ||
flow_id?: AutomationFlowId; | ||
} | ||
/** | ||
* example: | ||
* { | ||
* "source": "billing_contact.email", | ||
* "comparison": "exists" | ||
* } | ||
*/ | ||
export interface TriggerCondition { | ||
source: string; | ||
comparison: Comparison; | ||
value?: string | number | string[] | number[]; | ||
} | ||
/** | ||
* example: | ||
* { | ||
* "id": "2520gja-2sgmsaga-0asg-822jgal", | ||
* "name": "Trigger Webhook", | ||
* "type": "trigger-webhook", | ||
* "config": { | ||
* "entity_sources": [ | ||
* "contact", | ||
* "account" | ||
* ], | ||
* "target_webhook_id": "25jg9ag2ga" | ||
* } | ||
* } | ||
*/ | ||
export interface TriggerWebhookAction { | ||
id?: AutomationActionId; | ||
name?: string; | ||
type?: string; | ||
config?: TriggerWebhookActionConfig; | ||
execution_status?: ExecutionStatus; | ||
started_at?: string; | ||
updated_at?: string; | ||
/** | ||
* Flag indicating whether the action was created automatically or manually | ||
*/ | ||
created_automatically?: boolean; | ||
outputs?: { | ||
[name: string]: any; | ||
}; | ||
} | ||
export interface TriggerWebhookActionConfig { | ||
entity_sources?: string[]; | ||
target_webhook_id?: string; | ||
} | ||
/** | ||
* 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 | ||
* ] | ||
* } | ||
* ] | ||
* } | ||
* } | ||
*/ | ||
export interface TriggerWorkflowAction { | ||
id?: AutomationActionId; | ||
name?: string; | ||
type?: string; | ||
config?: TriggerWorkflowConfig; | ||
execution_status?: ExecutionStatus; | ||
started_at?: string; | ||
updated_at?: string; | ||
/** | ||
* Flag indicating whether the action was created automatically or manually | ||
*/ | ||
created_automatically?: boolean; | ||
outputs?: { | ||
workflow?: { | ||
[name: string]: any; | ||
}; | ||
}; | ||
} | ||
/** | ||
* example: | ||
* { | ||
* "schema": "contact", | ||
* "source": "billing_contact.email", | ||
* "comparison": "exists", | ||
* "value": "test@epilot.cloud" | ||
* } | ||
*/ | ||
export interface TriggerWorkflowCondition { | ||
source: string; | ||
comparison: Comparison; | ||
value?: string | number | string[] | number[]; | ||
schema: string; | ||
} | ||
export interface TriggerWorkflowConfig { | ||
target_workflow?: string; | ||
conditions?: TriggerWorkflowCondition[]; | ||
assignees?: string[]; | ||
assign_steps?: AssignUsersToStep[]; | ||
} | ||
} | ||
} | ||
declare namespace Paths { | ||
namespace CancelExecution { | ||
namespace Parameters { | ||
export type ExecutionId = Components.Schemas.AutomationExecutionId; | ||
namespace CancelExecution { | ||
namespace Parameters { | ||
export type ExecutionId = /** | ||
* example: | ||
* 9baf184f-bc81-4128-bca3-d974c90a12c4 | ||
*/ | ||
Components.Schemas.AutomationExecutionId; | ||
} | ||
export interface PathParameters { | ||
execution_id: Parameters.ExecutionId; | ||
} | ||
namespace Responses { | ||
export type $200 = Components.Schemas.AutomationExecution; | ||
} | ||
} | ||
export interface PathParameters { | ||
execution_id: Parameters.ExecutionId; | ||
namespace CreateFlow { | ||
export type RequestBody = Components.Schemas.AutomationFlow; | ||
namespace Responses { | ||
export type $201 = Components.Schemas.AutomationFlow; | ||
} | ||
} | ||
namespace Responses { | ||
export type $200 = Components.Schemas.AutomationExecution; | ||
namespace DeleteFlow { | ||
namespace Parameters { | ||
export type FlowId = /** | ||
* example: | ||
* 7791b04a-16d2-44a2-9af9-2d59c25c512f | ||
*/ | ||
Components.Schemas.AutomationFlowId; | ||
} | ||
export interface PathParameters { | ||
flow_id: Parameters.FlowId; | ||
} | ||
namespace Responses { | ||
export type $200 = Components.Schemas.AutomationFlow; | ||
} | ||
} | ||
} | ||
namespace CreateFlow { | ||
export type RequestBody = Components.Schemas.AutomationFlow; | ||
namespace Responses { | ||
export type $201 = Components.Schemas.AutomationFlow; | ||
namespace GetExecution { | ||
namespace Parameters { | ||
export type ExecutionId = /** | ||
* example: | ||
* 9baf184f-bc81-4128-bca3-d974c90a12c4 | ||
*/ | ||
Components.Schemas.AutomationExecutionId; | ||
} | ||
export interface PathParameters { | ||
execution_id: Parameters.ExecutionId; | ||
} | ||
namespace Responses { | ||
export type $200 = Components.Schemas.AutomationExecution; | ||
} | ||
} | ||
} | ||
namespace DeleteFlow { | ||
namespace Parameters { | ||
export type FlowId = Components.Schemas.AutomationFlowId; | ||
namespace GetExecutions { | ||
namespace Parameters { | ||
export type EntityId = /** | ||
* example: | ||
* e3d3ebac-baab-4395-abf4-50b5bf1f8b74 | ||
*/ | ||
Components.Schemas.EntityId; | ||
export type From = number; | ||
export type Size = number; | ||
} | ||
export interface QueryParameters { | ||
entity_id?: Parameters.EntityId; | ||
size?: Parameters.Size; | ||
from?: Parameters.From; | ||
} | ||
namespace Responses { | ||
export type $200 = Components.Schemas.GetExecutionsResp; | ||
} | ||
} | ||
export interface PathParameters { | ||
flow_id: Parameters.FlowId; | ||
namespace GetFlow { | ||
namespace Parameters { | ||
export type FlowId = /** | ||
* example: | ||
* 7791b04a-16d2-44a2-9af9-2d59c25c512f | ||
*/ | ||
Components.Schemas.AutomationFlowId; | ||
} | ||
export interface PathParameters { | ||
flow_id: Parameters.FlowId; | ||
} | ||
namespace Responses { | ||
export type $200 = Components.Schemas.AutomationFlow; | ||
} | ||
} | ||
namespace Responses { | ||
export type $200 = Components.Schemas.AutomationFlow; | ||
namespace PutFlow { | ||
namespace Parameters { | ||
export type FlowId = /** | ||
* example: | ||
* 7791b04a-16d2-44a2-9af9-2d59c25c512f | ||
*/ | ||
Components.Schemas.AutomationFlowId; | ||
} | ||
export interface PathParameters { | ||
flow_id: Parameters.FlowId; | ||
} | ||
export type RequestBody = Components.Schemas.AutomationFlow; | ||
namespace Responses { | ||
export type $200 = Components.Schemas.AutomationFlow; | ||
} | ||
} | ||
} | ||
namespace GetExecution { | ||
namespace Parameters { | ||
export type ExecutionId = Components.Schemas.AutomationExecutionId; | ||
namespace SearchFlows { | ||
namespace Parameters { | ||
export type From = number; | ||
/** | ||
* example: | ||
* submission | ||
*/ | ||
export type Schema = string; | ||
export type Size = number; | ||
/** | ||
* example: | ||
* 600945fe-212e-4b97-acf7-391d64648384 | ||
*/ | ||
export type TriggerSourceId = string; | ||
} | ||
export interface QueryParameters { | ||
schema?: /** | ||
* example: | ||
* submission | ||
*/ | ||
Parameters.Schema; | ||
size?: Parameters.Size; | ||
from?: Parameters.From; | ||
trigger_source_id?: /** | ||
* example: | ||
* 600945fe-212e-4b97-acf7-391d64648384 | ||
*/ | ||
Parameters.TriggerSourceId; | ||
} | ||
namespace Responses { | ||
export type $200 = Components.Schemas.SearchAutomationsResp; | ||
} | ||
} | ||
export interface PathParameters { | ||
execution_id: Parameters.ExecutionId; | ||
namespace StartExecution { | ||
export type RequestBody = Components.Schemas.StartExecutionRequest; | ||
namespace Responses { | ||
export type $201 = Components.Schemas.AutomationExecution; | ||
} | ||
} | ||
namespace Responses { | ||
export type $200 = Components.Schemas.AutomationExecution; | ||
} | ||
} | ||
namespace GetExecutions { | ||
namespace Parameters { | ||
export type EntityId = Components.Schemas.EntityId; | ||
export type From = number; | ||
export type Size = number; | ||
} | ||
export interface QueryParameters { | ||
entity_id?: Parameters.EntityId; | ||
size?: Parameters.Size; | ||
from?: Parameters.From; | ||
} | ||
namespace Responses { | ||
export type $200 = Components.Schemas.GetExecutionsResp; | ||
} | ||
} | ||
namespace GetFlow { | ||
namespace Parameters { | ||
export type FlowId = Components.Schemas.AutomationFlowId; | ||
} | ||
export interface PathParameters { | ||
flow_id: Parameters.FlowId; | ||
} | ||
namespace Responses { | ||
export type $200 = Components.Schemas.AutomationFlow; | ||
} | ||
} | ||
namespace PutFlow { | ||
namespace Parameters { | ||
export type FlowId = Components.Schemas.AutomationFlowId; | ||
} | ||
export interface PathParameters { | ||
flow_id: Parameters.FlowId; | ||
} | ||
export type RequestBody = Components.Schemas.AutomationFlow; | ||
namespace Responses { | ||
export type $200 = Components.Schemas.AutomationFlow; | ||
} | ||
} | ||
namespace SearchFlows { | ||
namespace Parameters { | ||
export type From = number; | ||
/** | ||
* example: | ||
* submission | ||
*/ | ||
export type Schema = string; | ||
export type Size = number; | ||
/** | ||
* example: | ||
* 600945fe-212e-4b97-acf7-391d64648384 | ||
*/ | ||
export type TriggerSourceId = string; | ||
} | ||
export interface QueryParameters { | ||
schema?: Parameters.Schema; | ||
size?: Parameters.Size; | ||
from?: Parameters.From; | ||
trigger_source_id?: Parameters.TriggerSourceId; | ||
} | ||
namespace Responses { | ||
export type $200 = Components.Schemas.SearchAutomationsResp; | ||
} | ||
} | ||
namespace StartExecution { | ||
export type RequestBody = Components.Schemas.StartExecutionRequest; | ||
namespace Responses { | ||
export type $201 = Components.Schemas.AutomationExecution; | ||
} | ||
} | ||
} | ||
@@ -583,0 +848,0 @@ |
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
259477
2122
0
+ Addedaxios@0.25.0(transitive)
+ Addedcopy-anything@3.0.5(transitive)
+ Addedis-what@4.1.16(transitive)
+ Addedopenapi-client-axios@5.3.1(transitive)
+ Addedopenapi-types@12.1.3(transitive)
- Removedargparse@1.0.10(transitive)
- Removedaxios@0.21.4(transitive)
- Removeddecode-uri-component@0.2.2(transitive)
- Removedesprima@4.0.1(transitive)
- Removedfilter-obj@1.1.0(transitive)
- Removedjs-yaml@3.14.1(transitive)
- Removedlodash@4.17.21(transitive)
- Removedopenapi-client-axios@3.14.1(transitive)
- Removedopenapi-types@9.3.1(transitive)
- Removedquery-string@7.1.3(transitive)
- Removedsplit-on-first@1.1.0(transitive)
- Removedsprintf-js@1.0.3(transitive)
- Removedstrict-uri-encode@2.0.0(transitive)
Updatedopenapi-client-axios@^5.1.2