This commit is contained in:
parent
c4cd7b35fc
commit
de02d51100
32
index.d.ts
vendored
32
index.d.ts
vendored
@ -68,6 +68,35 @@ interface PostHookData {
|
||||
data?: CollectionDocument
|
||||
}
|
||||
|
||||
interface JobConfig {
|
||||
/**
|
||||
* meta object
|
||||
*/
|
||||
meta?: any
|
||||
|
||||
/**
|
||||
* cron job interval specification
|
||||
*/
|
||||
cron?: string
|
||||
|
||||
/**
|
||||
* job program type
|
||||
*/
|
||||
type: "javascript"
|
||||
|
||||
/**
|
||||
* jobs program file
|
||||
*/
|
||||
file?: string
|
||||
}
|
||||
|
||||
interface JobData {
|
||||
/**
|
||||
* job is object of job config
|
||||
*/
|
||||
job?: JobConfig
|
||||
}
|
||||
|
||||
interface DbPackage {
|
||||
/**
|
||||
* read results from a collection
|
||||
@ -529,7 +558,8 @@ interface PdfPackage {
|
||||
export interface HookContext
|
||||
extends GetHookData,
|
||||
GetHookGetOnlyData,
|
||||
PostHookData {
|
||||
PostHookData,
|
||||
JobData {
|
||||
request(): {
|
||||
method: string
|
||||
remoteAddr: string
|
||||
|
@ -34,6 +34,21 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"jobs": {
|
||||
"type": "array",
|
||||
"description": "list of jobs in this project",
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$comment": "for include tag",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"$ref": "job.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": ["namespace"]
|
||||
|
27
schemas/api-config/job.json
Normal file
27
schemas/api-config/job.json
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "JSON Schema WMBasic cronjob configuration",
|
||||
"description": "WMBasic cronjob linter",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"meta": {
|
||||
"type": "object",
|
||||
"description": "meta object used to pass parameters to identify cronjob",
|
||||
"additionalProperties": true
|
||||
},
|
||||
"cron": {
|
||||
"type": "string",
|
||||
"description": "cronjob time/interval specification"
|
||||
},
|
||||
"type": {
|
||||
"const": "javascript",
|
||||
"description": "type of job"
|
||||
},
|
||||
"file": {
|
||||
"type": "string",
|
||||
"description": "javascript file relative to config.yml"
|
||||
}
|
||||
},
|
||||
"required": ["type", "file"]
|
||||
}
|
Loading…
Reference in New Issue
Block a user