UNPKG

@ovotech/genesys-web-messaging-tester-cli

Version:
28 lines (27 loc) 973 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.validateProjectLocationConfig = void 0; const joi_1 = __importDefault(require("joi")); const schema = joi_1.default.object() .keys({ location: joi_1.default.string().required().messages({ 'any.required': 'GCP Vertex AI location not defined in config or environment variable', }), project: joi_1.default.string().required().messages({ 'any.required': 'GCP Vertex AI project not defined in config or environment variable', }), }) .required(); function validateProjectLocationConfig(config) { const { error, value } = schema.validate(config); if (error) { return { error }; } else { return { value }; } } exports.validateProjectLocationConfig = validateProjectLocationConfig;