2016-11-13 20:33:23 +01:00
|
|
|
'use strict';
|
|
|
|
|
2016-11-11 15:46:59 +01:00
|
|
|
const joi = require('joi');
|
|
|
|
|
|
|
|
const clientMetricsSchema = joi.object().keys({
|
|
|
|
appName: joi.string().required(),
|
|
|
|
instanceId: joi.string().required(),
|
2017-06-28 10:20:22 +02:00
|
|
|
bucket: joi.object().required().keys({
|
2016-11-11 15:46:59 +01:00
|
|
|
start: joi.date().required(),
|
|
|
|
stop: joi.date().required(),
|
|
|
|
toggles: joi.object(),
|
|
|
|
}),
|
|
|
|
});
|
|
|
|
|
|
|
|
const clientRegisterSchema = joi.object().keys({
|
|
|
|
appName: joi.string().required(),
|
|
|
|
instanceId: joi.string().required(),
|
2017-06-28 10:20:22 +02:00
|
|
|
strategies: joi.array().required().items(joi.string(), joi.any().strip()),
|
2016-11-11 15:46:59 +01:00
|
|
|
started: joi.date().required(),
|
|
|
|
interval: joi.number().required(),
|
|
|
|
});
|
|
|
|
|
2016-12-04 14:09:37 +01:00
|
|
|
module.exports = { clientMetricsSchema, clientRegisterSchema };
|