feat: Add Be and tbd skill, also added Roadmap file

This commit is contained in:
2026-05-10 16:32:12 -04:00
parent 3500ade13f
commit 0bb8885802
29587 changed files with 10611695 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
// This is an example of a survey to obtain the reputation of Parisians
// It contains examples of how to conditionally require keys based on values of other keys
var Joi = require("../");
// This is a valid value for integer rating 1 - 5
var intRating = Joi.number().integer().min(1).max(5);
var schema = Joi.object().keys({
// Do you know any French people? yes or no (required)
q1: Joi.boolean().required(),
// Do you know any Parisians? yes or no (required if answered yes in q1)
q2: Joi.boolean()
.when('q1', { is: true, then: Joi.required() }),
// How many french in paris do you know? 1-6, 6-10, 11-50 or 50+ (required if answered yes in q2)
q3: Joi.string()
.when('q2', { is: true, then: Joi.valid('1-5', '6-10', '11-50', '50+').required() }),
// Rate 20% of most friendly Parisians, from how many people you know answered in q3, individually on 1-5 rating
q4: Joi.array()
.when('q3', {is: '1-5', then: Joi.array().min(0).max(1).includes(intRating).required() })
.when('q3', {is: '6-10', then: Joi.array().min(1).max(2).includes(intRating).required() })
.when('q3', {is: '11-50', then: Joi.array().min(2).max(10).includes(intRating).required() })
.when('q3', {is: '50+' , then: Joi.array().min(10).includes(intRating).required() }),
// Rate remaining 80% of Parisians, from how many people you know answered in q3, individually on 1-5 rating
q5: Joi.array()
.when('q3', {is: '1-5', then: Joi.array().min(1).max(4).includes(intRating).required() })
.when('q3', {is: '6-10', then: Joi.array().min(4).max(8).includes(intRating).required() })
.when('q3', {is: '11-50', then: Joi.array().min(8).max(40).includes(intRating).required() })
.when('q3', {is: '50+' , then: Joi.array().min(40).includes(intRating).required().required() }),
// Rate the reputation of Parisians in general, 1-5 rating
q6: intRating.required()
});
var response = {
q1: true,
q2: true,
q3: '1-5',
q4: [5],
q4: [1],
q6: 2
};
Joi.assert(response, schema);

22
Skills/@be/node_modules/joi/examples/customMessage.js generated vendored Normal file
View File

@@ -0,0 +1,22 @@
var Joi = require('../');
var schema = Joi.object().options({ abortEarly: false }).keys({
email: Joi.string().email().required().label('User Email'),
password: Joi.string().min(8).required(),
password_confirmation: Joi.any().valid(Joi.ref('password')).required().options({ language: { any: { allowOnly: 'must match password' }, label: 'Password Confirmation' } }).label('This label is not used because language.label takes precedence'),
first_name: Joi.string().required(),
last_name: Joi.string().required(),
company: Joi.string().optional()
});
var data = {
email: 'not_a_valid_email_to_show_custom_label',
password: 'abcd1234',
password_confirmation: 'abc1',
first_name: 'Joe',
last_name: 'Doe'
};
Joi.assert(data, schema);

17
Skills/@be/node_modules/joi/examples/multipleWhen.js generated vendored Normal file
View File

@@ -0,0 +1,17 @@
var Joi = require('../');
var schema = {
type: Joi.string().required(),
subtype: Joi.alternatives()
.when('type', {is: 'video', then: Joi.valid('mp4', 'wav')})
.when('type', {is: 'audio', then: Joi.valid('mp3')})
.when('type', {is: 'image', then: Joi.valid('jpg', 'png')})
.when('type', {is: 'pdf' , then: Joi.valid('document')})
};
Joi.assert({ type: 'video', subtype: 'mp4' }, schema); // Pass
Joi.assert({ type: 'video', subtype: 'wav' }, schema); // Pass
Joi.assert({ type: 'other', subtype: 'something' }, schema); // Fail
Joi.assert({ type: 'audio', subtype: 'mp4' }, schema); // Fail