This commit is contained in:
2026-05-13 19:58:16 +03:00
commit f5adeb292b
78 changed files with 12024 additions and 0 deletions

24
lib/factory/channel.js Normal file
View File

@@ -0,0 +1,24 @@
const Joi = require('joi')
const validate = require('./validate')
//
// Define the schema
//
const schema = {
team: Joi.string(),
name: Joi.string().regex(/^[a-z0-9_-]+$/),
display_name: Joi.string(),
header: Joi.string().allow('').optional(),
purpose: Joi.string().allow('').optional(),
type: Joi.string().valid('O', 'P')
}
//
// Generate a valid object
//
module.exports = function (props) {
return {
type: 'channel',
channel: validate(schema, props)
}
}