Files
loop-etl-rocketchat/lib/factory/directChannel.js
2026-05-13 20:03:28 +03:00

21 lines
374 B
JavaScript

const Joi = require('joi')
const validate = require('./validate')
//
// Define the schema
//
const schema = {
header: Joi.string().allow('').optional(),
members: Joi.array().items(Joi.string()).min(2).max(8)
}
//
// Generate a valid object
//
module.exports = function (props) {
return {
type: 'direct_channel',
direct_channel: validate(schema, props)
}
}