diff --git a/lib/entities/workflow-definition.ts b/lib/entities/workflow-definition.ts index e3b3f93ce..31b0e024d 100644 --- a/lib/entities/workflow-definition.ts +++ b/lib/entities/workflow-definition.ts @@ -106,12 +106,31 @@ export type WorkflowDefinitionSysProps = Pick< isLocked: boolean } +export type WorkflowVariablePresetValue = { + variable: Link<'WorkflowVariable'> + value: string | Link<'User'> | Link<'Team'> +} + +export type WorkflowVariablePreset = { + id?: string + name: string + variableValues: WorkflowVariablePresetValue[] +} + +export type WorkflowVariable = { + id: string + name: string + type: 'subject' | 'locale' +} + export type WorkflowDefinitionValidationLink = { type: 'Link' validations: Array<{ linkContentType: string[] }> linkType: 'Entry' + variables?: WorkflowVariable[] + variableValuePresets?: WorkflowVariablePreset[] } export type WorkflowDefinitionProps = { diff --git a/lib/entities/workflow.ts b/lib/entities/workflow.ts index cbbb01330..9f745676e 100644 --- a/lib/entities/workflow.ts +++ b/lib/entities/workflow.ts @@ -26,6 +26,7 @@ export type WorkflowSysProps = Pick< deletedAt?: string entity: Link<'Entry'> workflowDefinition: Link<'WorkflowDefinition'> + variableValuePreset?: Link<'WorkflowVariableValuePreset'> } export type WorkflowProps = { @@ -36,6 +37,7 @@ export type WorkflowProps = { export type CreateWorkflowProps = Omit & { entity: Link<'Entry'> workflowDefinition: Link<'WorkflowDefinition'> + variableValuePreset?: Link<'WorkflowVariableValuePreset'> } export type UpdateWorkflowProps = Omit & { sys: Pick diff --git a/lib/export-types.ts b/lib/export-types.ts index 20635fd17..54464fb4d 100644 --- a/lib/export-types.ts +++ b/lib/export-types.ts @@ -252,6 +252,9 @@ export type { WorkflowDefinitionSysProps, // Property: appliesTo WorkflowDefinitionValidationLink, + WorkflowVariable, + WorkflowVariablePreset, + WorkflowVariablePresetValue, // Property: step.actions WorkflowStepAction, WorkflowStepActionType,