@cv.vg/schemas
Advanced tools
Comparing version 0.1.0-dev.3 to 0.1.0-dev.4
33
main.js
/** @param {import('joi')} Joi */ | ||
module.exports = ({ Joi }) => { | ||
const | ||
params = Joi.object({ | ||
createParams = Joi.object({ | ||
isDeletable: Joi.boolean(), | ||
@@ -11,4 +11,4 @@ webhookSecretType: Joi.string().valid('header', 'param'), | ||
.and('webhookSecretType', 'webhookSecretKey', 'webhookSecretValue'), | ||
body = Joi.object({ | ||
conditions: Joi.array().items(Joi.object({ | ||
createBody = Joi.object({ | ||
conditions: Joi.object({ | ||
userAgent: Joi.string(), | ||
@@ -18,3 +18,3 @@ ip: Joi.string(), | ||
expiration: Joi.number().integer().min(Date.now()) | ||
}).min(1)).min(1), | ||
}).min(1), | ||
configs: Joi.array().items(Joi.link('#config')).min(1), | ||
@@ -39,14 +39,23 @@ isRandom: Joi.boolean(), | ||
.id('config'), | ||
schemas = Joi.object({ | ||
params, | ||
body | ||
createSchema = Joi.object({ | ||
params: createParams, | ||
body: createBody | ||
}) | ||
.and('params.webhookSecretType', 'body.webhook'); | ||
.and('params.webhookSecretType', 'body.webhook'), | ||
deleteSchema = Joi.object({ | ||
params: Joi.any(), | ||
body: Joi.object({ | ||
message: Joi.string().max(255).required() | ||
}) | ||
}); | ||
Object.assign( | ||
schemas, { | ||
params, | ||
body | ||
createSchema, { | ||
params: createParams, | ||
body: createBody | ||
} | ||
); | ||
return schemas; | ||
return { | ||
createSchema, | ||
deleteSchema | ||
}; | ||
}; |
{ | ||
"name": "@cv.vg/schemas", | ||
"version": "0.1.0-dev.3", | ||
"version": "0.1.0-dev.4", | ||
"main": "main.js", | ||
@@ -5,0 +5,0 @@ "repository": "ssh://kaki@git.kaki87.net:3021/cv.vg/schemas.git", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2299
57