-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathschema.js
28 lines (27 loc) · 1018 Bytes
/
schema.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const Joi = require('@hapi/joi');
const cpus = require('os').cpus;
module.exports = Joi.object().keys({
imports: Joi.object().required().keys({
adminLookup: Joi.object().keys({
// default maxConcurrentReqs to # of cpus/cores * 10
maxConcurrentReqs: Joi.number().integer().default(cpus().length*10),
enabled: Joi.boolean().default(true),
missingMetafilesAreFatal: Joi.boolean().default(false),
usePostalCities: Joi.boolean().default(false),
postalCitiesDataPath: Joi.string(),
useEndonyms: Joi.boolean().default(false)
}).unknown(true),
whosonfirst: Joi.object().keys({
datapath: Joi.string().required(),
importPlace: [
Joi.number().integer(),
Joi.array().items(Joi.number().integer())
],
}).unknown(true),
services: Joi.object().keys({
pip: Joi.object().keys({
url: Joi.string().required()
}).unknown(true)
}).unknown(true)
}).or('whosonfirst', 'services.pip').unknown(true)
}).unknown(true);