feat: operadores de consulta zod

This commit is contained in:
marcio 2025-09-18 08:32:06 -03:00
parent d72455e06b
commit cd90eeaa3e
5 changed files with 82 additions and 5 deletions

View file

@ -1,7 +1,9 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
@ -15,12 +17,23 @@ var __copyProps = (to, from, except, desc) => {
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var consulta_exports = {};
__export(consulta_exports, {
operadores: () => operadores
operadores: () => operadores,
zFiltro: () => zFiltro,
zOperadores: () => zOperadores
});
module.exports = __toCommonJS(consulta_exports);
var import_zod = __toESM(require("zod"));
var operadores = /* @__PURE__ */ ((operadores2) => {
operadores2["="] = "=";
operadores2["!="] = "!=";
@ -32,7 +45,25 @@ var operadores = /* @__PURE__ */ ((operadores2) => {
operadores2["in"] = "in";
return operadores2;
})(operadores || {});
const zOperadores = import_zod.default.enum([
"=",
"!=",
">",
">=",
"<",
"<=",
"like",
"in"
]);
const zFiltro = import_zod.default.object({
coluna: import_zod.default.string(),
valor: import_zod.default.any(),
operador: zOperadores,
ou: import_zod.default.boolean().optional()
});
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
operadores
operadores,
zFiltro,
zOperadores
});