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

23 lines
362 B
JavaScript

const Joi = require('joi')
const validate = require('./validate')
const postPartial = require('./postPartial')
//
// Define the schema
//
const schema = {
team: Joi.string(),
channel: Joi.string(),
...postPartial,
}
//
// Generate a valid object
//
module.exports = function (props) {
return {
type: 'post',
post: validate(schema, props)
}
}