"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateInput = void 0;
const jsonschema_1 = require("jsonschema");
async function validateInput(data, schema, message) {
    const a = (0, jsonschema_1.validate)(data, schema, { required: true });
    if (a.valid === false) {
        throw { message, reason: a.errors.map(e => `${e.message}`).join(', ') };
    }
    return true;
}
exports.validateInput = validateInput;
