Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions lib/entities/workflow-definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 2 additions & 0 deletions lib/entities/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export type WorkflowSysProps = Pick<
deletedAt?: string
entity: Link<'Entry'>
workflowDefinition: Link<'WorkflowDefinition'>
variableValuePreset?: Link<'WorkflowVariableValuePreset'>
}

export type WorkflowProps = {
Expand All @@ -36,6 +37,7 @@ export type WorkflowProps = {
export type CreateWorkflowProps = Omit<WorkflowProps, 'sys'> & {
entity: Link<'Entry'>
workflowDefinition: Link<'WorkflowDefinition'>
variableValuePreset?: Link<'WorkflowVariableValuePreset'>
}
export type UpdateWorkflowProps = Omit<WorkflowProps, 'sys'> & {
sys: Pick<WorkflowSysProps, 'version'>
Expand Down
3 changes: 3 additions & 0 deletions lib/export-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@ export type {
WorkflowDefinitionSysProps,
// Property: appliesTo
WorkflowDefinitionValidationLink,
WorkflowVariable,
WorkflowVariablePreset,
WorkflowVariablePresetValue,
// Property: step.actions
WorkflowStepAction,
WorkflowStepActionType,
Expand Down