diff --git a/clients/workflow-definition-client/src/openapi-runtime.json b/clients/workflow-definition-client/src/openapi-runtime.json index 58ea6d9..2c80261 100644 --- a/clients/workflow-definition-client/src/openapi-runtime.json +++ b/clients/workflow-definition-client/src/openapi-runtime.json @@ -12,12 +12,14 @@ "paths": { "/v1/workflows/limits/max-allowed": { "get": { - "operationId": "getMaxAllowedLimit" + "operationId": "getMaxAllowedLimit", + "responses": {} } }, "/v1/workflows/definitions": { "get": { - "operationId": "getDefinitions" + "operationId": "getDefinitions", + "responses": {} }, "post": { "operationId": "createDefinition", @@ -26,7 +28,65 @@ "content": { "application/json": {} } - } + }, + "responses": {} + } + }, + "/v2/flows/templates": { + "get": { + "operationId": "listFlowTemplates", + "responses": {} + }, + "post": { + "operationId": "createFlowTemplate", + "requestBody": { + "required": true, + "content": { + "application/json": {} + } + }, + "responses": {} + } + }, + "/v2/flows/templates/{flowId}": { + "get": { + "operationId": "getFlowTemplate", + "parameters": [ + { + "in": "path", + "name": "flowId", + "required": true + } + ], + "responses": {} + }, + "put": { + "operationId": "updateFlowTemplate", + "parameters": [ + { + "in": "path", + "name": "flowId", + "required": true + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": {} + } + }, + "responses": {} + }, + "delete": { + "operationId": "deleteFlowTemplate", + "parameters": [ + { + "in": "path", + "name": "flowId", + "required": true + } + ], + "responses": {} } }, "/v1/workflows/definitions/{definitionId}": { @@ -38,7 +98,8 @@ "name": "definitionId", "required": true } - ] + ], + "responses": {} }, "put": { "operationId": "updateDefinition", @@ -54,7 +115,8 @@ "content": { "application/json": {} } - } + }, + "responses": {} }, "delete": { "operationId": "deleteDefinition", @@ -64,7 +126,8 @@ "name": "definitionId", "required": true } - ] + ], + "responses": {} } }, "/v1/workflows/closing-reasons": { @@ -76,7 +139,8 @@ "name": "includeInactive", "required": false } - ] + ], + "responses": {} }, "post": { "operationId": "createClosingReason", @@ -85,7 +149,8 @@ "content": { "application/json": {} } - } + }, + "responses": {} } }, "/v1/workflows/closing-reasons/{reasonId}": { @@ -97,7 +162,8 @@ "name": "reasonId", "required": true } - ] + ], + "responses": {} }, "patch": { "operationId": "changeReasonStatus", @@ -112,7 +178,8 @@ "content": { "application/json": {} } - } + }, + "responses": {} } }, "/v1/workflows/definitions/{definitionId}/closing-reasons": { @@ -124,7 +191,8 @@ "name": "definitionId", "required": true } - ] + ], + "responses": {} }, "patch": { "operationId": "setWorkflowClosingReasons", @@ -140,7 +208,8 @@ "content": { "application/json": {} } - } + }, + "responses": {} } } }, diff --git a/clients/workflow-definition-client/src/openapi.d.ts b/clients/workflow-definition-client/src/openapi.d.ts index 1bf4495..14375a4 100644 --- a/clients/workflow-definition-client/src/openapi.d.ts +++ b/clients/workflow-definition-client/src/openapi.d.ts @@ -10,6 +10,37 @@ import type { declare namespace Components { namespace Schemas { + export interface AutomationTask { + id: string; + name: string; + description?: /* Longer information regarding Task */ StepDescription; + journey?: StepJourney; + /** + * example: + * 2021-04-27T12:00:00.000Z + */ + due_date?: string; + dynamic_due_date?: /* Set due date for the task based on a dynamic condition */ DueDateConfig; + /** + * requirements that need to be fulfilled in order to enable the task while flow instances are running + */ + requirements?: /* describe the requirement for a task to be enabled */ EnableRequirement[]; + assigned_to?: string[]; + ecp?: /* Details regarding ECP for the workflow step */ ECPDetails; + installer?: /* Details regarding ECP for the workflow step */ ECPDetails; + /** + * Taxonomy ids that are associated with this workflow and used for filtering + */ + taxonomies?: string[]; + phase_id?: string; + task_type: TaskType; + automation_config: { + /** + * Id of the configured automation to run + */ + flow_id: string; + }; + } export interface ChangeReasonStatusReq { status: ClosingReasonsStatus; } @@ -43,19 +74,59 @@ declare namespace Components { reasons: ClosingReasonId[]; } export type ClosingReasonsStatus = "ACTIVE" | "INACTIVE"; + export interface Condition { + id: string; + logical_operator: "AND" | "OR"; + statements: Statement[]; + } + export interface DecisionTask { + id: string; + name: string; + description?: /* Longer information regarding Task */ StepDescription; + journey?: StepJourney; + /** + * example: + * 2021-04-27T12:00:00.000Z + */ + due_date?: string; + dynamic_due_date?: /* Set due date for the task based on a dynamic condition */ DueDateConfig; + /** + * requirements that need to be fulfilled in order to enable the task while flow instances are running + */ + requirements?: /* describe the requirement for a task to be enabled */ EnableRequirement[]; + assigned_to?: string[]; + ecp?: /* Details regarding ECP for the workflow step */ ECPDetails; + installer?: /* Details regarding ECP for the workflow step */ ECPDetails; + /** + * Taxonomy ids that are associated with this workflow and used for filtering + */ + taxonomies?: string[]; + phase_id?: string; + task_type: TaskType; + conditions: Condition[]; + } /** * Definition could be not found */ export interface DefinitionNotFoundResp { message?: string; } + /** + * Set due date for the task based on a dynamic condition + */ + export interface DueDateConfig { + duration: number; + unit: "minutes" | "hours" | "days" | "weeks" | "months"; + type: "WORKFLOW_STARTED" | "TASK_FINISHED"; + task_id?: string; + } /** * set a Duedate for a step then a specific */ export interface DynamicDueDate { numberOfUnits: number; timePeriod: "minutes" | "hours" | "days" | "weeks" | "months"; - actionTypeCondition: "WORKFLOW_STARTED" | "STEP_CLOSED"; + actionTypeCondition: "WORKFLOW_STARTED" | "STEP_CLOSE"; stepId?: string; } /** @@ -67,14 +138,132 @@ declare namespace Components { description?: string; journey?: StepJourney; } + export interface Edge { + id: string; + from_id: string; + to_id: string; + condition_id?: string; + } + /** + * describe the requirement for a task to be enabled + */ + export interface EnableRequirement { + task_id?: string; + phase_id?: string; + when: "TASK_FINISHED" | "PHASE_FINISHED"; + } export interface ErrorResp { message?: string; } + export interface EvaluationSource { + /** + * The id of the action or trigger + */ + id?: string; + origin?: "trigger" | "action"; + origin_type?: "entity" | "workflow" | "journey_block"; + schema?: string; + attribute?: string; + attribute_type?: "string" | "text" | "number" | "boolean" | "date" | "datetime" | "tags" | "country" | "email" | "phone" | "product" | "price" | "status" | "relation" | "multiselect" | "select" | "radio" | "relation_user" | "purpose" | "label"; + attribute_repeatable?: boolean; + attribute_operation?: "all" | "updated" | "added" | "deleted"; + } + export interface FlowTemplate { + id?: string; + name: string; + description?: string; + /** + * ISO String Date & Time + * example: + * 2021-04-27T12:01:13.000Z + */ + created_at?: string; + /** + * Whether the workflow is enabled or not + */ + enabled?: boolean; + /** + * ISO String Date & Time + * example: + * 2021-04-27T12:01:13.000Z + */ + updated_at?: string; + /** + * example: + * 2021-04-27T12:00:00.000Z + */ + due_date?: string; + dynamic_due_date?: /* Set due date for the task based on a dynamic condition */ DueDateConfig; + assigned_to?: string[]; + /** + * Indicates whether this workflow is available for End Customer Portal or not. By default it's not. + */ + available_in_ecp?: boolean; + phases?: Phase[]; + tasks: Task[]; + edges: Edge[]; + closing_reasons?: ClosingReasonId[]; + update_entity_attributes?: UpdateEntityAttributes[]; + /** + * Taxonomy ids that are associated with this workflow and used for filtering + */ + taxonomies?: string[]; + } + /** + * Short unique id (length 8) to identify the Flow Template. + * example: + * 7hj28akg + */ + export type FlowTemplateId = string; + export interface FlowTemplatesList { + results: FlowTemplate[]; + } export type ItemType = "STEP" | "SECTION"; + export interface ManualTask { + id: string; + name: string; + description?: /* Longer information regarding Task */ StepDescription; + journey?: StepJourney; + /** + * example: + * 2021-04-27T12:00:00.000Z + */ + due_date?: string; + dynamic_due_date?: /* Set due date for the task based on a dynamic condition */ DueDateConfig; + /** + * requirements that need to be fulfilled in order to enable the task while flow instances are running + */ + requirements?: /* describe the requirement for a task to be enabled */ EnableRequirement[]; + assigned_to?: string[]; + ecp?: /* Details regarding ECP for the workflow step */ ECPDetails; + installer?: /* Details regarding ECP for the workflow step */ ECPDetails; + /** + * Taxonomy ids that are associated with this workflow and used for filtering + */ + taxonomies?: string[]; + phase_id?: string; + task_type: TaskType; + } export interface MaxAllowedLimit { currentNoOfWorkflows?: number; maxAllowed?: number; } + export type Operator = "equals" | "not_equals" | "any_of" | "none_of" | "contains" | "not_contains" | "starts_with" | "ends_with" | "greater_than" | "less_than" | "greater_than_or_equals" | "less_than_or_equals" | "is_empty" | "is_not_empty"; + export interface Phase { + id: string; + name: string; + /** + * example: + * 2021-04-27T12:00:00.000Z + */ + due_date?: string; + dynamic_due_date?: /* Set due date for the task based on a dynamic condition */ DueDateConfig; + assigned_to?: string[]; + /** + * Taxonomy ids that are associated with this workflow and used for filtering + */ + taxonomies?: string[]; + } /** * A group of Steps that define the progress of the Workflow */ @@ -96,6 +285,12 @@ declare namespace Components { */ taxonomies?: string[]; } + export interface Statement { + id: string; + source: EvaluationSource; + operator: Operator; + values: string[]; + } /** * Action that needs to be done in a Workflow */ @@ -130,6 +325,10 @@ declare namespace Components { type: ItemType; ecp?: /* Details regarding ECP for the workflow step */ ECPDetails; installer?: /* Details regarding ECP for the workflow step */ ECPDetails; + /** + * Taxonomy ids that are associated with this workflow and used for filtering + */ + taxonomies?: string[]; } /** * Longer information regarding Task @@ -152,6 +351,33 @@ declare namespace Components { condition: "CLOSED"; } export type StepType = "MANUAL" | "AUTOMATION"; + export type Task = ManualTask | AutomationTask | DecisionTask; + export interface TaskBase { + id: string; + name: string; + description?: /* Longer information regarding Task */ StepDescription; + journey?: StepJourney; + /** + * example: + * 2021-04-27T12:00:00.000Z + */ + due_date?: string; + dynamic_due_date?: /* Set due date for the task based on a dynamic condition */ DueDateConfig; + /** + * requirements that need to be fulfilled in order to enable the task while flow instances are running + */ + requirements?: /* describe the requirement for a task to be enabled */ EnableRequirement[]; + assigned_to?: string[]; + ecp?: /* Details regarding ECP for the workflow step */ ECPDetails; + installer?: /* Details regarding ECP for the workflow step */ ECPDetails; + /** + * Taxonomy ids that are associated with this workflow and used for filtering + */ + taxonomies?: string[]; + phase_id?: string; + task_type: TaskType; + } + export type TaskType = "MANUAL" | "AUTOMATION" | "DECISION"; export interface UpdateEntityAttributes { source: "workflow_status" | "current_section" | "current_step"; target: { @@ -243,6 +469,15 @@ declare namespace Paths { export type $500 = Components.Schemas.ErrorResp; } } + namespace CreateFlowTemplate { + export type RequestBody = Components.Schemas.FlowTemplate; + namespace Responses { + export type $201 = Components.Schemas.FlowTemplate; + export type $400 = Components.Schemas.ErrorResp; + export type $401 = Components.Schemas.ErrorResp; + export type $500 = Components.Schemas.ErrorResp; + } + } namespace DeleteDefinition { namespace Parameters { export type DefinitionId = string; @@ -258,6 +493,26 @@ declare namespace Paths { } } } + namespace DeleteFlowTemplate { + namespace Parameters { + export type FlowId = /** + * Short unique id (length 8) to identify the Flow Template. + * example: + * 7hj28akg + */ + Components.Schemas.FlowTemplateId; + } + export interface PathParameters { + flowId: Parameters.FlowId; + } + namespace Responses { + export interface $204 { + } + export type $401 = Components.Schemas.ErrorResp; + export interface $404 { + } + } + } namespace GetAllClosingReasons { namespace Parameters { export type IncludeInactive = boolean; @@ -305,6 +560,26 @@ declare namespace Paths { export type $500 = Components.Schemas.ErrorResp; } } + namespace GetFlowTemplate { + namespace Parameters { + export type FlowId = /** + * Short unique id (length 8) to identify the Flow Template. + * example: + * 7hj28akg + */ + Components.Schemas.FlowTemplateId; + } + export interface PathParameters { + flowId: Parameters.FlowId; + } + namespace Responses { + export type $200 = Components.Schemas.FlowTemplate; + export type $400 = Components.Schemas.ErrorResp; + export type $401 = Components.Schemas.ErrorResp; + export type $404 = /* Definition could be not found */ Components.Schemas.DefinitionNotFoundResp; + export type $500 = Components.Schemas.ErrorResp; + } + } namespace GetMaxAllowedLimit { namespace Responses { export type $200 = Components.Schemas.MaxAllowedLimit; @@ -322,6 +597,12 @@ declare namespace Paths { export type $200 = Components.Schemas.ClosingReasonsIds; } } + namespace ListFlowTemplates { + namespace Responses { + export type $200 = Components.Schemas.FlowTemplatesList; + export type $500 = Components.Schemas.ErrorResp; + } + } namespace SetWorkflowClosingReasons { namespace Parameters { export type DefinitionId = string; @@ -350,6 +631,26 @@ declare namespace Paths { export type $500 = Components.Schemas.ErrorResp; } } + namespace UpdateFlowTemplate { + namespace Parameters { + export type FlowId = /** + * Short unique id (length 8) to identify the Flow Template. + * example: + * 7hj28akg + */ + Components.Schemas.FlowTemplateId; + } + export interface PathParameters { + flowId: Parameters.FlowId; + } + export type RequestBody = Components.Schemas.FlowTemplate; + namespace Responses { + export type $200 = Components.Schemas.FlowTemplate; + export type $400 = Components.Schemas.ErrorResp; + export type $401 = Components.Schemas.ErrorResp; + export type $500 = Components.Schemas.ErrorResp; + } + } } export interface OperationMethods { @@ -383,6 +684,56 @@ export interface OperationMethods { data?: Paths.CreateDefinition.RequestBody, config?: AxiosRequestConfig ): OperationResponse + /** + * listFlowTemplates - listFlowTemplates + * + * List all Flow Templates for a customer + */ + 'listFlowTemplates'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + /** + * createFlowTemplate - createFlowTemplate + * + * Create a new Flow Template. + */ + 'createFlowTemplate'( + parameters?: Parameters | null, + data?: Paths.CreateFlowTemplate.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + /** + * getFlowTemplate - getFlowTemplate + * + * Get specific FLow template for a customer + */ + 'getFlowTemplate'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + /** + * updateFlowTemplate - updateFlowTemplate + * + * Update Flow Template. + */ + 'updateFlowTemplate'( + parameters?: Parameters | null, + data?: Paths.UpdateFlowTemplate.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + /** + * deleteFlowTemplate - deleteFlowTemplate + * + * Delete Flow Template. + */ + 'deleteFlowTemplate'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse /** * getDefinition - getDefinition * @@ -510,6 +861,60 @@ export interface PathsDictionary { config?: AxiosRequestConfig ): OperationResponse } + ['/v2/flows/templates']: { + /** + * listFlowTemplates - listFlowTemplates + * + * List all Flow Templates for a customer + */ + 'get'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + /** + * createFlowTemplate - createFlowTemplate + * + * Create a new Flow Template. + */ + 'post'( + parameters?: Parameters | null, + data?: Paths.CreateFlowTemplate.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + } + ['/v2/flows/templates/{flowId}']: { + /** + * getFlowTemplate - getFlowTemplate + * + * Get specific FLow template for a customer + */ + 'get'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + /** + * updateFlowTemplate - updateFlowTemplate + * + * Update Flow Template. + */ + 'put'( + parameters?: Parameters | null, + data?: Paths.UpdateFlowTemplate.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + /** + * deleteFlowTemplate - deleteFlowTemplate + * + * Delete Flow Template. + */ + 'delete'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + } ['/v1/workflows/definitions/{definitionId}']: { /** * getDefinition - getDefinition @@ -612,6 +1017,7 @@ export interface PathsDictionary { export type Client = OpenAPIClient +export type AutomationTask = Components.Schemas.AutomationTask; export type ChangeReasonStatusReq = Components.Schemas.ChangeReasonStatusReq; export type ClosingReason = Components.Schemas.ClosingReason; export type ClosingReasonId = Components.Schemas.ClosingReasonId; @@ -619,17 +1025,33 @@ export type ClosingReasonNotFoundResp = Components.Schemas.ClosingReasonNotFound export type ClosingReasons = Components.Schemas.ClosingReasons; export type ClosingReasonsIds = Components.Schemas.ClosingReasonsIds; export type ClosingReasonsStatus = Components.Schemas.ClosingReasonsStatus; +export type Condition = Components.Schemas.Condition; +export type DecisionTask = Components.Schemas.DecisionTask; export type DefinitionNotFoundResp = Components.Schemas.DefinitionNotFoundResp; +export type DueDateConfig = Components.Schemas.DueDateConfig; export type DynamicDueDate = Components.Schemas.DynamicDueDate; export type ECPDetails = Components.Schemas.ECPDetails; +export type Edge = Components.Schemas.Edge; +export type EnableRequirement = Components.Schemas.EnableRequirement; export type ErrorResp = Components.Schemas.ErrorResp; +export type EvaluationSource = Components.Schemas.EvaluationSource; +export type FlowTemplate = Components.Schemas.FlowTemplate; +export type FlowTemplateId = Components.Schemas.FlowTemplateId; +export type FlowTemplatesList = Components.Schemas.FlowTemplatesList; export type ItemType = Components.Schemas.ItemType; +export type ManualTask = Components.Schemas.ManualTask; export type MaxAllowedLimit = Components.Schemas.MaxAllowedLimit; +export type Operator = Components.Schemas.Operator; +export type Phase = Components.Schemas.Phase; export type Section = Components.Schemas.Section; +export type Statement = Components.Schemas.Statement; export type Step = Components.Schemas.Step; export type StepDescription = Components.Schemas.StepDescription; export type StepJourney = Components.Schemas.StepJourney; export type StepRequirement = Components.Schemas.StepRequirement; export type StepType = Components.Schemas.StepType; +export type Task = Components.Schemas.Task; +export type TaskBase = Components.Schemas.TaskBase; +export type TaskType = Components.Schemas.TaskType; export type UpdateEntityAttributes = Components.Schemas.UpdateEntityAttributes; export type WorkflowDefinition = Components.Schemas.WorkflowDefinition; diff --git a/clients/workflow-definition-client/src/openapi.json b/clients/workflow-definition-client/src/openapi.json index 0dbb575..f8a1b3b 100644 --- a/clients/workflow-definition-client/src/openapi.json +++ b/clients/workflow-definition-client/src/openapi.json @@ -319,6 +319,279 @@ } } }, + "/v2/flows/templates": { + "get": { + "operationId": "listFlowTemplates", + "summary": "listFlowTemplates", + "description": "List all Flow Templates for a customer", + "tags": [ + "Flows V2" + ], + "responses": { + "200": { + "description": "Success - flow templates loaded with success. Empty array if customer has no flows defined.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FlowTemplatesList" + } + } + } + }, + "500": { + "description": "Other errors", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + } + } + }, + "post": { + "operationId": "createFlowTemplate", + "summary": "createFlowTemplate", + "description": "Create a new Flow Template.", + "tags": [ + "Flows V2" + ], + "requestBody": { + "description": "Flow Template payload", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FlowTemplate" + } + } + } + }, + "responses": { + "201": { + "description": "Success - if the flow template is created successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FlowTemplate" + } + } + } + }, + "400": { + "description": "Validation Errors", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + }, + "401": { + "description": "Authentication Errors", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + }, + "500": { + "description": "Other errors", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + } + } + } + }, + "/v2/flows/templates/{flowId}": { + "get": { + "operationId": "getFlowTemplate", + "summary": "getFlowTemplate", + "description": "Get specific FLow template for a customer", + "tags": [ + "Flows V2" + ], + "parameters": [ + { + "in": "path", + "name": "flowId", + "schema": { + "$ref": "#/components/schemas/FlowTemplateId" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "Returns the Flow Template", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FlowTemplate" + } + } + } + }, + "400": { + "description": "Validation Errors", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + }, + "401": { + "description": "Authentication Errors", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + }, + "404": { + "description": "Definition Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefinitionNotFoundResp" + } + } + } + }, + "500": { + "description": "Other errors", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + } + } + }, + "put": { + "operationId": "updateFlowTemplate", + "summary": "updateFlowTemplate", + "description": "Update Flow Template.", + "tags": [ + "Flows V2" + ], + "parameters": [ + { + "in": "path", + "name": "flowId", + "schema": { + "$ref": "#/components/schemas/FlowTemplateId" + }, + "required": true + } + ], + "requestBody": { + "description": "Flow Template payload", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FlowTemplate" + } + } + } + }, + "responses": { + "200": { + "description": "Flow template has been updated successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FlowTemplate" + } + } + } + }, + "400": { + "description": "Validation Errors", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + }, + "401": { + "description": "Authentication Errors", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + }, + "500": { + "description": "Other errors", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + } + } + }, + "delete": { + "operationId": "deleteFlowTemplate", + "summary": "deleteFlowTemplate", + "description": "Delete Flow Template.", + "tags": [ + "Flows V2" + ], + "parameters": [ + { + "in": "path", + "name": "flowId", + "schema": { + "$ref": "#/components/schemas/FlowTemplateId" + }, + "required": true, + "description": "Id of the flow template to de deleted." + } + ], + "responses": { + "204": { + "description": "Flow template has been deleted successfully" + }, + "401": { + "description": "Failed to authenticate", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResp" + } + } + } + }, + "404": { + "description": "No definition found" + } + } + } + }, "/v1/workflows/definitions/{definitionId}": { "get": { "operationId": "getDefinition", @@ -972,7 +1245,7 @@ } }, "schemas": { - "WorkflowDefinition": { + "FlowTemplate": { "type": "object", "properties": { "id": { @@ -984,7 +1257,7 @@ "description": { "type": "string" }, - "creationTime": { + "created_at": { "type": "string", "description": "ISO String Date & Time", "example": "2021-04-27T12:01:13.000Z" @@ -994,53 +1267,547 @@ "description": "Whether the workflow is enabled or not", "default": true }, - "lastUpdateTime": { + "updated_at": { "type": "string", "description": "ISO String Date & Time", "example": "2021-04-27T12:01:13.000Z" }, - "dueDate": { + "due_date": { "type": "string", "example": "2021-04-27T12:00:00.000Z" }, - "dynamicDueDate": { - "$ref": "#/components/schemas/DynamicDueDate" - }, - "userIds": { - "type": "array", - "items": { - "type": "number" - }, - "deprecated": true, - "description": "This field is deprecated. Please use assignedTo" + "dynamic_due_date": { + "$ref": "#/components/schemas/DueDateConfig" }, - "assignedTo": { + "assigned_to": { "type": "array", "items": { "type": "string" } }, - "enableECPWorkflow": { + "available_in_ecp": { "type": "boolean", "description": "Indicates whether this workflow is available for End Customer Portal or not. By default it's not." }, - "flow": { + "phases": { "type": "array", "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/Section" - }, - { - "$ref": "#/components/schemas/Step" - } - ] + "$ref": "#/components/schemas/Phase" } }, - "closingReasons": { + "tasks": { "type": "array", "items": { - "$ref": "#/components/schemas/ClosingReasonId" + "$ref": "#/components/schemas/Task" + } + }, + "edges": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Edge" + } + }, + "closing_reasons": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClosingReasonId" + } + }, + "update_entity_attributes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UpdateEntityAttributes" + } + }, + "taxonomies": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Taxonomy ids that are associated with this workflow and used for filtering" + } + }, + "required": [ + "name", + "tasks", + "edges" + ] + }, + "FlowTemplatesList": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FlowTemplate" + } + } + }, + "required": [ + "results" + ] + }, + "FlowTemplateId": { + "type": "string", + "description": "Short unique id (length 8) to identify the Flow Template.", + "example": "7hj28akg" + }, + "Task": { + "anyOf": [ + { + "$ref": "#/components/schemas/ManualTask" + }, + { + "$ref": "#/components/schemas/AutomationTask" + }, + { + "$ref": "#/components/schemas/DecisionTask" + } + ] + }, + "ManualTask": { + "allOf": [ + { + "$ref": "#/components/schemas/TaskBase" + } + ] + }, + "AutomationTask": { + "allOf": [ + { + "$ref": "#/components/schemas/TaskBase" + }, + { + "type": "object", + "required": [ + "automation_config" + ], + "properties": { + "automation_config": { + "type": "object", + "properties": { + "flow_id": { + "type": "string", + "description": "Id of the configured automation to run" + } + }, + "required": [ + "flow_id" + ] + } + } + } + ] + }, + "DecisionTask": { + "allOf": [ + { + "$ref": "#/components/schemas/TaskBase" + }, + { + "type": "object", + "required": [ + "conditions" + ], + "properties": { + "conditions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Condition" + } + } + } + } + ] + }, + "TaskBase": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "$ref": "#/components/schemas/StepDescription" + }, + "journey": { + "$ref": "#/components/schemas/StepJourney" + }, + "due_date": { + "type": "string", + "example": "2021-04-27T12:00:00.000Z" + }, + "dynamic_due_date": { + "$ref": "#/components/schemas/DueDateConfig" + }, + "requirements": { + "type": "array", + "description": "requirements that need to be fulfilled in order to enable the task while flow instances are running", + "items": { + "$ref": "#/components/schemas/EnableRequirement" + } + }, + "assigned_to": { + "type": "array", + "items": { + "type": "string" + } + }, + "ecp": { + "$ref": "#/components/schemas/ECPDetails" + }, + "installer": { + "$ref": "#/components/schemas/ECPDetails" + }, + "taxonomies": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Taxonomy ids that are associated with this workflow and used for filtering" + }, + "phase_id": { + "type": "string" + }, + "task_type": { + "$ref": "#/components/schemas/TaskType" + } + }, + "required": [ + "id", + "name", + "task_type" + ] + }, + "Phase": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "due_date": { + "type": "string", + "example": "2021-04-27T12:00:00.000Z" + }, + "dynamic_due_date": { + "$ref": "#/components/schemas/DueDateConfig" + }, + "assigned_to": { + "type": "array", + "items": { + "type": "string" + } + }, + "taxonomies": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Taxonomy ids that are associated with this workflow and used for filtering" + } + }, + "required": [ + "id", + "name" + ] + }, + "TaskType": { + "type": "string", + "enum": [ + "MANUAL", + "AUTOMATION", + "DECISION" + ] + }, + "Edge": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "from_id": { + "type": "string" + }, + "to_id": { + "type": "string" + }, + "condition_id": { + "type": "string" + } + }, + "required": [ + "id", + "from_id", + "to_id" + ] + }, + "Condition": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "logical_operator": { + "type": "string", + "enum": [ + "AND", + "OR" + ] + }, + "statements": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Statement" + } + } + }, + "required": [ + "id", + "logical_operator", + "statements" + ] + }, + "Statement": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "source": { + "$ref": "#/components/schemas/EvaluationSource" + }, + "operator": { + "$ref": "#/components/schemas/Operator" + }, + "values": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "id", + "source", + "operator", + "values" + ] + }, + "EvaluationSource": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The id of the action or trigger" + }, + "origin": { + "type": "string", + "enum": [ + "trigger", + "action" + ] + }, + "origin_type": { + "type": "string", + "enum": [ + "entity", + "workflow", + "journey_block" + ] + }, + "schema": { + "type": "string" + }, + "attribute": { + "type": "string" + }, + "attribute_type": { + "type": "string", + "enum": [ + "string", + "text", + "number", + "boolean", + "date", + "datetime", + "tags", + "country", + "email", + "phone", + "product", + "price", + "status", + "relation", + "multiselect", + "select", + "radio", + "relation_user", + "purpose", + "label" + ] + }, + "attribute_repeatable": { + "type": "boolean" + }, + "attribute_operation": { + "enum": [ + "all", + "updated", + "added", + "deleted" + ] + } + } + }, + "Operator": { + "type": "string", + "enum": [ + "equals", + "not_equals", + "any_of", + "none_of", + "contains", + "not_contains", + "starts_with", + "ends_with", + "greater_than", + "less_than", + "greater_than_or_equals", + "less_than_or_equals", + "is_empty", + "is_not_empty" + ] + }, + "DueDateConfig": { + "description": "Set due date for the task based on a dynamic condition", + "type": "object", + "properties": { + "duration": { + "type": "number" + }, + "unit": { + "type": "string", + "enum": [ + "minutes", + "hours", + "days", + "weeks", + "months" + ] + }, + "type": { + "type": "string", + "enum": [ + "WORKFLOW_STARTED", + "TASK_FINISHED" + ] + }, + "task_id": { + "type": "string" + } + }, + "required": [ + "duration", + "unit", + "type" + ] + }, + "EnableRequirement": { + "description": "describe the requirement for a task to be enabled", + "type": "object", + "properties": { + "task_id": { + "type": "string" + }, + "phase_id": { + "type": "string" + }, + "when": { + "type": "string", + "enum": [ + "TASK_FINISHED", + "PHASE_FINISHED" + ] + } + }, + "required": [ + "when" + ] + }, + "WorkflowDefinition": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "creationTime": { + "type": "string", + "description": "ISO String Date & Time", + "example": "2021-04-27T12:01:13.000Z" + }, + "enabled": { + "type": "boolean", + "description": "Whether the workflow is enabled or not", + "default": true + }, + "lastUpdateTime": { + "type": "string", + "description": "ISO String Date & Time", + "example": "2021-04-27T12:01:13.000Z" + }, + "dueDate": { + "type": "string", + "example": "2021-04-27T12:00:00.000Z" + }, + "dynamicDueDate": { + "$ref": "#/components/schemas/DynamicDueDate" + }, + "userIds": { + "type": "array", + "items": { + "type": "number" + }, + "deprecated": true, + "description": "This field is deprecated. Please use assignedTo" + }, + "assignedTo": { + "type": "array", + "items": { + "type": "string" + } + }, + "enableECPWorkflow": { + "type": "boolean", + "description": "Indicates whether this workflow is available for End Customer Portal or not. By default it's not." + }, + "flow": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Section" + }, + { + "$ref": "#/components/schemas/Step" + } + ] + } + }, + "closingReasons": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClosingReasonId" } }, "updateEntityAttributes": { @@ -1132,6 +1899,13 @@ }, "installer": { "$ref": "#/components/schemas/ECPDetails" + }, + "taxonomies": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Taxonomy ids that are associated with this workflow and used for filtering" } }, "required": [