2014-08-27 15:24:03 -04:00
|
|
|
c = require 'schemas/schemas'
|
|
|
|
|
2014-09-23 21:21:27 -04:00
|
|
|
goalStatesSchema =
|
2014-08-27 15:24:03 -04:00
|
|
|
type: 'object'
|
|
|
|
additionalProperties:
|
|
|
|
type: 'object'
|
|
|
|
required: ['status']
|
|
|
|
properties:
|
|
|
|
status:
|
|
|
|
oneOf: [
|
|
|
|
{type: 'null'}
|
|
|
|
{type: 'string', enum: ['success', 'failure', 'incomplete']}
|
|
|
|
]
|
|
|
|
keyFrame:
|
|
|
|
oneOf: [
|
|
|
|
{type: 'integer', minimum: 0}
|
|
|
|
{type: 'string', enum: ['end']}
|
|
|
|
]
|
2014-08-27 19:31:39 -04:00
|
|
|
team: {type: ['null', 'string', 'undefined']}
|
2014-08-27 15:24:03 -04:00
|
|
|
|
|
|
|
worldUpdatedEventSchema = c.object {required: ['world', 'firstWorld', 'goalStates', 'team', 'firstChangedFrame']},
|
|
|
|
world: {type: 'object'}
|
|
|
|
firstWorld: {type: 'boolean'}
|
|
|
|
goalStates: goalStatesSchema
|
|
|
|
team: {type: 'string'}
|
|
|
|
firstChangedFrame: {type: 'integer', minimum: 0}
|
2014-11-18 15:40:28 -05:00
|
|
|
finished: {type: 'boolean'}
|
2016-04-25 20:03:08 -04:00
|
|
|
god: {type: 'object'}
|
2014-08-27 15:24:03 -04:00
|
|
|
|
|
|
|
module.exports =
|
2015-11-29 15:30:19 -05:00
|
|
|
'god:user-code-problem': c.object {required: ['problem', 'god']},
|
|
|
|
god: {type: 'object'}
|
2014-08-27 15:24:03 -04:00
|
|
|
problem: {type: 'object'}
|
|
|
|
|
2015-11-29 15:30:19 -05:00
|
|
|
'god:non-user-code-problem': c.object {required: ['problem', 'god']},
|
|
|
|
god: {type: 'object'}
|
2014-08-27 15:24:03 -04:00
|
|
|
problem: {type: 'object'}
|
|
|
|
|
2015-11-29 15:30:19 -05:00
|
|
|
'god:infinite-loop': c.object {required: ['firstWorld', 'god']},
|
|
|
|
god: {type: 'object'}
|
2014-08-27 15:24:03 -04:00
|
|
|
firstWorld: {type: 'boolean'}
|
2015-04-25 20:29:02 -04:00
|
|
|
nonUserCodeProblem: {type: 'boolean'}
|
2014-08-27 15:24:03 -04:00
|
|
|
|
|
|
|
'god:new-world-created': worldUpdatedEventSchema
|
|
|
|
|
|
|
|
'god:streaming-world-updated': worldUpdatedEventSchema
|
|
|
|
|
2015-11-29 15:30:19 -05:00
|
|
|
'god:goals-calculated': c.object {required: ['goalStates', 'god']},
|
|
|
|
god: {type: 'object'}
|
2014-08-27 15:24:03 -04:00
|
|
|
goalStates: goalStatesSchema
|
2014-09-23 21:21:27 -04:00
|
|
|
preload: {type: 'boolean'}
|
|
|
|
overallStatus: {type: ['string', 'null'], enum: ['success', 'failure', 'incomplete', null]}
|
2016-04-07 22:06:57 -04:00
|
|
|
totalFrames: {type: ['integer', 'undefined']}
|
|
|
|
lastFrameHash: {type: ['number', 'undefined']}
|
2014-08-27 15:24:03 -04:00
|
|
|
|
2015-11-29 15:30:19 -05:00
|
|
|
'god:world-load-progress-changed': c.object {required: ['progress', 'god']},
|
|
|
|
god: {type: 'object'}
|
2014-08-27 15:24:03 -04:00
|
|
|
progress: {type: 'number', minimum: 0, maximum: 1}
|
|
|
|
|
2015-11-29 15:30:19 -05:00
|
|
|
'god:debug-world-load-progress-changed': c.object {required: ['progress', 'god']},
|
|
|
|
god: {type: 'object'}
|
2014-08-27 15:24:03 -04:00
|
|
|
progress: {type: 'number', minimum: 0, maximum: 1}
|
|
|
|
|
2015-11-29 15:30:19 -05:00
|
|
|
'god:debug-value-return': c.object {required: ['key', 'god']},
|
|
|
|
god: {type: 'object'}
|
2014-08-27 15:24:03 -04:00
|
|
|
key: {type: 'string'}
|
2014-08-28 12:27:42 -04:00
|
|
|
value: {}
|