34 lines
1.3 KiB
JavaScript
34 lines
1.3 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.validarColuna = exports.tiposColunas = exports.zp_produto_conta = exports.validarZ = exports.PREFIXO = exports.zAmbiente = void 0;
|
|
var p_respostas_1 = require("p-respostas");
|
|
var zod_1 = require("zod");
|
|
exports.zAmbiente = zod_1.z.enum(["desenvolvimento", "producao"]);
|
|
exports.PREFIXO = "/pilao-de-dados";
|
|
var validarZ = function (zodType, objeto, mensagem) {
|
|
var validar = zodType.safeParse(objeto);
|
|
if (!validar.success) {
|
|
debugger;
|
|
return p_respostas_1.respostaComuns.erro(mensagem, validar.error.errors.map(function (e) { return "".concat(e.path, " ").concat(e.message); }));
|
|
}
|
|
return p_respostas_1.respostaComuns.valor(validar.data);
|
|
};
|
|
exports.validarZ = validarZ;
|
|
exports.zp_produto_conta = zod_1.z.object({
|
|
produto: zod_1.z.string(),
|
|
conta: zod_1.z.string(),
|
|
});
|
|
exports.tiposColunas = zod_1.z.enum([
|
|
"texto",
|
|
"numero",
|
|
"confirmacao",
|
|
"lista_texto",
|
|
"lista_numero",
|
|
]);
|
|
exports.validarColuna = {
|
|
texto: zod_1.z.string().nullable(),
|
|
numero: zod_1.z.number().nullable(),
|
|
confirmacao: zod_1.z.boolean().nullable(),
|
|
lista_texto: zod_1.z.array(zod_1.z.string()).nullable(),
|
|
lista_numero: zod_1.z.array(zod_1.z.number()).nullable(),
|
|
};
|