mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-25 06:14:59 +00:00
code: workflow,validate,update (2 files)
This commit is contained in:
43
dbal/ts/src/core/validation/validate-workflow-update.ts
Normal file
43
dbal/ts/src/core/validation/validate-workflow-update.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import type { Workflow } from '../types'
|
||||
import { isPlainObject } from './is-plain-object'
|
||||
import { isValidUuid } from './is-valid-uuid'
|
||||
|
||||
const triggerValues = ['manual', 'schedule', 'event', 'webhook'] as const
|
||||
|
||||
export function validateWorkflowUpdate(data: Partial<Workflow>): string[] {
|
||||
const errors: string[] = []
|
||||
|
||||
if (data.name !== undefined) {
|
||||
if (typeof data.name !== 'string' || data.name.length === 0 || data.name.length > 255) {
|
||||
errors.push('name must be 1-255 characters')
|
||||
}
|
||||
}
|
||||
|
||||
if (data.trigger !== undefined && !triggerValues.includes(data.trigger)) {
|
||||
errors.push('trigger must be one of manual, schedule, event, webhook')
|
||||
}
|
||||
|
||||
if (data.triggerConfig !== undefined && !isPlainObject(data.triggerConfig)) {
|
||||
errors.push('triggerConfig must be an object')
|
||||
}
|
||||
|
||||
if (data.steps !== undefined && !isPlainObject(data.steps)) {
|
||||
errors.push('steps must be an object')
|
||||
}
|
||||
|
||||
if (data.isActive !== undefined && typeof data.isActive !== 'boolean') {
|
||||
errors.push('isActive must be a boolean')
|
||||
}
|
||||
|
||||
if (data.createdBy !== undefined) {
|
||||
if (typeof data.createdBy !== 'string' || !isValidUuid(data.createdBy)) {
|
||||
errors.push('createdBy must be a valid UUID')
|
||||
}
|
||||
}
|
||||
|
||||
if (data.description !== undefined && typeof data.description !== 'string') {
|
||||
errors.push('description must be a string')
|
||||
}
|
||||
|
||||
return errors
|
||||
}
|
||||
3
frontends/nextjs/src/components/ui/scroll-area.ts
Normal file
3
frontends/nextjs/src/components/ui/scroll-area.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
// Re-export for backward compatibility
|
||||
// TODO: Update imports to use @/components/ui directly
|
||||
export { ScrollArea, ScrollBar, type ScrollAreaProps } from './atoms/ScrollArea'
|
||||
Reference in New Issue
Block a user