import type { BasicMetaSysProps, DefaultElements, GetSpaceEnvironmentParams, GetWorkflowDefinitionParams, Link, MakeRequest, PaginationQueryOptions, SysLink } from '../common-types'; type NonEmptyArray = [T, ...T[]]; export type WorkflowStepPermissionActors = 'all' | NonEmptyArray | Link<'Team'>>; export declare enum WorkflowStepPermissionType { EntityPermission = "entity_permission", WorkflowPermission = "workflow_permission" } export declare enum WorkflowStepPermissionAction { Edit = "edit", Publish = "publish", Delete = "delete" } export declare enum WorkflowStepPermissionEffect { Allow = "allow", Deny = "deny" } export interface WorkflowStepPermission { type: WorkflowStepPermissionType; configuration: { actors: WorkflowStepPermissionActors; action: WorkflowStepPermissionAction; effect: WorkflowStepPermissionEffect; }; } export declare enum WorkflowStepActionType { App = "app", Email = "email", Task = "task" } export type WorkflowStepAction = WorkflowStepEmailAction | WorkflowStepTaskAction | WorkflowStepAppAction; export type WorkflowStepEmailActionRecipient = string | Link<'User'> | Link<'Team'>; export type WorkflowStepEmailAction = { type: 'email'; configuration: { recipients: WorkflowStepEmailActionRecipient[]; }; }; export type WorkflowStepTaskAction = { type: 'task'; configuration: { assignee: Link<'User'> | Link<'Team'>; body: string; dueDate?: number; }; }; export type WorkflowStepAppAction = { type: 'app'; appId: string; appActionId: string; configuration?: { body?: Record; headers?: Record; }; }; export type WorkflowStepProps = { id: string; name: string; description?: string; actions?: WorkflowStepAction[]; annotations?: string[]; permissions?: WorkflowStepPermission[]; }; export type UpdateWorkflowStepProps = WorkflowStepProps; export type CreateWorkflowStepProps = Omit; export type WorkflowDefinitionSysProps = Pick & { type: 'WorkflowDefinition'; space: SysLink; environment: SysLink; isLocked: boolean; }; export type WorkflowDefinitionValidationLink = { type: 'Link'; validations: Array<{ linkContentType: string[]; }>; linkType: 'Entry'; }; export type WorkflowDefinitionProps = { sys: WorkflowDefinitionSysProps; name: string; description?: string; appliesTo?: WorkflowDefinitionValidationLink[]; steps: WorkflowStepProps[]; startOnEntityCreation?: boolean; flowType?: 'no_restriction' | 'strict_neighbor'; }; export type CreateWorkflowDefinitionProps = Omit & { steps: CreateWorkflowStepProps[]; }; export type UpdateWorkflowDefinitionProps = Omit & { sys: Pick; steps: Array; }; export type CreateWorkflowDefinitionParams = GetSpaceEnvironmentParams; export type UpdateWorkflowDefinitionParams = GetWorkflowDefinitionParams; export type DeleteWorkflowDefinitionParams = GetWorkflowDefinitionParams & { version: number; }; type WorkflowDefinitionApi = { update(): Promise; delete(): Promise; }; export interface WorkflowDefinition extends WorkflowDefinitionProps, DefaultElements, WorkflowDefinitionApi { } export type WorkflowDefinitionQueryOptions = Omit; /** * @private */ export default function createWorkflowDefinitionApi(makeRequest: MakeRequest): WorkflowDefinitionApi; /** * @private */ export declare function wrapWorkflowDefinition(makeRequest: MakeRequest, data: WorkflowDefinitionProps): WorkflowDefinition; /** * @private */ export declare const wrapWorkflowDefinitionCollection: (makeRequest: MakeRequest, data: import("../common-types").CollectionProp) => import("../common-types").Collection; export {};