mirror of
https://github.com/Crosstalk-Solutions/project-nomad.git
synced 2026-03-28 03:29:25 +01:00
- system.ts: Add maxLength(100) and alphanumeric/hyphen/underscore regex to service_name fields - system.ts: Add maxLength(50) and semver/Docker tag regex to target_version field - rag.ts: Add maxLength(500) to filePath field - rag_controller.ts: Add 50MB file upload size limit and validation error handling - settings_controller.ts: Validate getSetting() key parameter against KV_STORE_SCHEMA at runtime https://claude.ai/code/session_01JFvpTYgm8GiE4vJ4cJKsFx
34 lines
965 B
TypeScript
34 lines
965 B
TypeScript
import vine from '@vinejs/vine'
|
|
|
|
export const installServiceValidator = vine.compile(
|
|
vine.object({
|
|
service_name: vine.string().trim().maxLength(100).regex(/^[a-zA-Z0-9_-]+$/),
|
|
})
|
|
)
|
|
|
|
export const affectServiceValidator = vine.compile(
|
|
vine.object({
|
|
service_name: vine.string().trim().maxLength(100).regex(/^[a-zA-Z0-9_-]+$/),
|
|
action: vine.enum(['start', 'stop', 'restart']),
|
|
})
|
|
)
|
|
|
|
export const subscribeToReleaseNotesValidator = vine.compile(
|
|
vine.object({
|
|
email: vine.string().email().trim(),
|
|
})
|
|
)
|
|
|
|
export const checkLatestVersionValidator = vine.compile(
|
|
vine.object({
|
|
force: vine.boolean().optional(), // Optional flag to force bypassing cache and checking for updates immediately
|
|
})
|
|
)
|
|
|
|
export const updateServiceValidator = vine.compile(
|
|
vine.object({
|
|
service_name: vine.string().trim().maxLength(100).regex(/^[a-zA-Z0-9_-]+$/),
|
|
target_version: vine.string().trim().maxLength(50).regex(/^[a-zA-Z0-9._-]+$/),
|
|
})
|
|
)
|