Open Source Web Application Framework for ASP.NET Core
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

58 lines
2.2 KiB

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "script-background-job-descriptor.schema.json",
"title": "Script Background Job Descriptor",
"description": "Defines a named JavaScript background job handler.",
"markdownDescription": "AI guidance: use background jobs for asynchronous work that is explicitly enqueued by code/scripts, such as notifications, imports, or long-running recalculations. `name` is the job identifier used by enqueue calls. Keep scripts retry-safe and idempotent because background jobs may run more than once after failures.",
"type": "object",
"properties": {
"$schema": {
"type": "string",
"description": "Optional schema reference used when this descriptor is stored as a model descriptor file."
},
"name": {
"type": "string",
"description": "Unique identifier for the background job. Scripts/enqueuers reference this name.",
"minLength": 1
},
"app": {
"type": "string",
"description": "Name of the low-code app that owns this job. Omit for the default app. Must match an apps[].name.",
"minLength": 1,
"pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
},
"javascript": {
"type": "string",
"description": "JavaScript code to execute when the job is enqueued/run. Use context payload/job arguments where available and keep retry-safe.",
"minLength": 1
},
"description": {
"type": "string",
"description": "Optional description for designer documentation and model health context."
},
"extendsLowerLayer": {
"type": "boolean",
"description": "When true, this descriptor overrides selected fields of a job with the same name defined in a lower model layer; javascript becomes optional.",
"default": false
},
"metadata": {
"$ref": "descriptor-metadata.schema.json"
}
},
"required": ["name"],
"if": {
"properties": { "extendsLowerLayer": { "const": true } },
"required": ["extendsLowerLayer"]
},
"then": {},
"else": {
"required": ["javascript"]
},
"additionalProperties": false,
"examples": [
{
"name": "SendEventReminder",
"javascript": "context.log('Sending event reminder job.');"
}
]
}