feat: Ability to change subscription status in workflows

This commit is contained in:
Dries Augustyns
2026-05-09 08:43:05 +02:00
parent 2ea1802290
commit fadc19d139
4 changed files with 103 additions and 24 deletions
+11 -3
View File
@@ -334,9 +334,17 @@ export const WorkflowStepConfigSchemas = {
headers: z.record(z.string()).optional(),
body: jsonSchema.optional(),
}),
updateContact: z.object({
updates: z.record(z.any()),
}),
updateContact: z
.object({
updates: z.record(z.any()).optional(),
subscriptionAction: z.enum(['none', 'subscribe', 'unsubscribe']).optional(),
})
.refine(
value =>
(value.updates && Object.keys(value.updates).length > 0) ||
(value.subscriptionAction && value.subscriptionAction !== 'none'),
{message: 'Provide at least one field to update or a subscription action'},
),
};
export const DomainSchemas = {