{ "$id": "schedule-schema", "title": "Schedule Triggers Schema", "description": "Schema for a Schedule Trigger", "allOf": [ { "$ref": "#/definitions/invariantProperties" }, { "$ref": "#/definitions/covariantProperties" } ], "definitions": { "invariantProperties": { "type": "object", "properties": { "_id": { "$ref": "common-ops-schema#/definitions/ObjectId" }, "created": { "$ref": "common-ops-schema#/definitions/ISODate" }, "createdBy": { "$ref": "common-ops-schema#/definitions/userAccount" }, "lastUpdated": { "$ref": "common-ops-schema#/definitions/ISODate" }, "lastUpdatedBy": { "$ref": "common-ops-schema#/definitions/userAccount" }, "name": { "$ref": "common-ops-schema#/definitions/name" }, "type": { "const": "schedule" }, "enabled": { "$ref": "common-ops-schema#/definitions/enabled" }, "actionType": { "$ref": "common-ops-schema#/definitions/actionType" }, "actionId": { "$ref": "common-ops-schema#/definitions/ObjectId" }, "formId": { "oneOf": [ { "$ref": "common-ops-schema#/definitions/ObjectId" }, { "type": "null" } ] }, "formData": { "oneOf": [ { "type": "object" }, { "type": "null" } ] }, "firstRunAt": { "description": "A timestamp in milliseconds for the first scheduled run of this job.", "type": "integer", "minimum": 0 }, "lastExecuted": { "description": "A timestamp in milliseconds of the time this job was last executed.", "oneOf": [ { "type": "integer", "minimum": 0 }, { "type": "null" } ] }, "nextRunAt": { "description": "A timestamp in milliseconds for the next scheduled run of this job.", "oneOf": [ { "type": "integer", "minimum": 0 }, { "type": "null" } ] }, "repeatInterval": { "description": "The interval between repeated jobs in milliseconds. This is calculated from repeatUnit and repeatFrequency.", "oneOf": [ { "type": "integer", "minimum": 0 }, { "type": "null" } ] }, "processMissedRuns": { "description": "Describes how any missed job runs should be processed. A missed run is a job that was supposed to be ran at least 'n' seconds ago, but did not due to some issue with IAP (busy process, IAP was down, etc). 'none' means do not run any missed jobs. 'last' means only run the last missed job.", "type": "string", "enum": [ "none", "last" ] }, "waitFlag": { "description": "backend use only", "type": "boolean" }, "repeatUnit": { "description": "The unit that describes how often a job repeats. This value with repeatFrequency is used to calculate repeatInterval.", "type": [ "string", "null" ] }, "repeatFrequency": { "description": "The number of units that describes how often to repeat. This value with repeatUnit is used to calculate repeatInterval.", "oneOf": [ { "type": "integer", "minimum": 0 }, { "type": "null" } ] } }, "required": [ "name", "type", "enabled", "actionType", "actionId", "firstRunAt", "processMissedRuns" ], "additionalProperties": false }, "covariantProperties": { "type": "object", "additionalProperties": true, "oneOf": [ { "properties": { "repeatUnit": { "type": "null" }, "repeatFrequency": { "type": "null" } } }, { "properties": { "repeatUnit": { "type": "string", "enum": [ "minute", "hour", "day", "week" ] }, "repeatFrequency": { "oneOf": [ { "type": "integer", "minimum": 0 }, { "type": "null" } ] } }, "required": [ "repeatUnit" ] }, { "properties": { "repeatUnit": { "const": "second" }, "repeatFrequency": { "oneOf": [ { "type": "integer", "minimum": 0, "multipleOf": 10 }, { "type": "null" } ] } }, "required": [ "repeatUnit", "repeatFrequency" ] } ] } } }