2016-11-13 20:33:23 +01:00
|
|
|
'use strict';
|
|
|
|
|
2016-11-11 15:46:59 +01:00
|
|
|
const joi = require('joi');
|
|
|
|
|
2017-08-04 11:24:58 +02:00
|
|
|
const countSchema = joi.object().options({ stripUnknown: true }).keys({
|
|
|
|
yes: joi.number().required().min(0).default(0),
|
|
|
|
no: joi.number().required().min(0).default(0),
|
|
|
|
});
|
|
|
|
|
2017-06-29 11:10:24 +02:00
|
|
|
const clientMetricsSchema = joi.object().options({ stripUnknown: true }).keys({
|
2016-11-11 15:46:59 +01:00
|
|
|
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(),
|
2017-08-04 11:24:58 +02:00
|
|
|
toggles: joi.object().pattern(/.*/, countSchema),
|
2016-11-11 15:46:59 +01:00
|
|
|
}),
|
|
|
|
});
|
|
|
|
|
2017-06-28 23:13:29 +02:00
|
|
|
module.exports = { clientMetricsSchema };
|