1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00
unleash.unleash/lib/routes/metrics-schema.js

27 lines
707 B
JavaScript
Raw Normal View History

'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(),
bucket: joi.object().required()
.keys({
start: joi.date().required(),
stop: joi.date().required(),
toggles: joi.object(),
}),
});
const clientRegisterSchema = joi.object().keys({
appName: joi.string().required(),
instanceId: joi.string().required(),
strategies: joi.array()
.required()
.items(joi.string(), joi.any().strip()),
started: joi.date().required(),
interval: joi.number().required(),
});
2016-12-04 14:09:37 +01:00
module.exports = { clientMetricsSchema, clientRegisterSchema };