Files
twenty/packages/twenty-cli/schemas/trigger.schema.json
T
martmullandGitHub 6fdd7894a1 Add serverless function in twenty-cli (#14819)
- add serverlessFunction schema in twenty-cli
- add trigger schema in twenty-cli
- update serverless function code save and get
- sync serverless function
2025-10-01 22:11:03 +02:00

44 lines
1.2 KiB
JSON

{
"$id": "https://raw.githubusercontent.com/twentyhq/twenty/main/packages/twenty-cli/schemas/trigger.schema.json",
"type": "object",
"required": ["universalIdentifier", "type"],
"properties": {
"$schema": {
"type": "string",
"description": "JSON Schema reference for validation and IDE support"
},
"universalIdentifier": {
"type": "string",
"description": "Unique identifier (UUID format recommended)",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
},
"type": { "enum": ["cron", "databaseEvent", "route"] },
"schedule": { "type": "string" },
"eventName": { "type": "string" },
"path": { "type": "string" },
"httpMethod": { "enum": ["GET", "POST", "PUT", "PATCH", "DELETE"] },
"isAuthRequired": { "type": "boolean" }
},
"allOf": [
{
"if": { "properties": { "type": { "const": "cron" } } },
"then": { "required": ["schedule"] }
},
{
"if": { "properties": { "type": { "const": "databaseEvent" } } },
"then": { "required": ["eventName"] }
},
{
"if": { "properties": { "type": { "const": "route" } } },
"then": { "required": ["path", "httpMethod", "isAuthRequired"] }
}
]
}