mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 21:25:26 +00:00
Added relevace() method to set beacons and locations; Added schemas for beaconsDict and locationsDict
This commit is contained in:
18
schema.js
18
schema.js
@@ -30,6 +30,20 @@ let field = Joi.object().keys({
|
||||
value: Joi.string().required()
|
||||
});
|
||||
|
||||
let beaconsDict = Joi.object().keys({
|
||||
major: Joi.number().integer().positive().max(65536),
|
||||
minor: Joi.number().integer().positive().max(65536),
|
||||
proximityUUID: Joi.string().required(),
|
||||
relevantText: Joi.string()
|
||||
});
|
||||
|
||||
let locationsDict = Joi.object().keys({
|
||||
altitude: Joi.number(),
|
||||
latitude: Joi.number().required(),
|
||||
longitude: Joi.number().required(),
|
||||
relevantText: Joi.string()
|
||||
});
|
||||
|
||||
let struct = {
|
||||
auxiliaryFields: Joi.array().items(field),
|
||||
backFields: Joi.array().items(field),
|
||||
@@ -49,7 +63,9 @@ module.exports = {
|
||||
barcode,
|
||||
field,
|
||||
basicStructure,
|
||||
boardingStructure
|
||||
boardingStructure,
|
||||
beaconsDict,
|
||||
locationsDict
|
||||
},
|
||||
isValid: (opts, schemaName, debug = false) => {
|
||||
let validation = Joi.validate(opts, schemaName);
|
||||
|
||||
Reference in New Issue
Block a user