This commit is contained in:
Luiz H. R. Silva 2024-07-03 13:25:13 -03:00
parent 2747b6d509
commit 34acfd3e71
11 changed files with 69 additions and 10 deletions

View file

@ -1,6 +1,19 @@
import type { tipoResposta } from "p-respostas";
import { z } from "zod";
import { type zp_produto_conta } from "./variaveis";
export declare const z_filtro: z.ZodObject<{
coluna: z.ZodString;
valor: z.ZodAny;
operador: z.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
}, "strip", z.ZodTypeAny, {
coluna: string;
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
valor?: any;
}, {
coluna: string;
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
valor?: any;
}>;
export declare const zp_serie_registrar: z.ZodObject<{
tabela: z.ZodString;
colanuEixoX: z.ZodString;

View file

@ -2,7 +2,7 @@ import node_fetch from "cross-fetch";
import { respostaComuns } from "p-respostas";
import { z } from "zod";
import { operadores_pilao, tiposSeriesAgregacoes, urlPilao, } from "./variaveis";
const filtro = z.object({
export const z_filtro = z.object({
coluna: z.string(),
valor: z.any(),
operador: operadores_pilao,
@ -12,7 +12,7 @@ export const zp_serie_registrar = z.object({
colanuEixoX: z.string(),
colunaAgrupamento: z.string().array().optional(),
agregacao: tiposSeriesAgregacoes,
filtros: filtro.array().optional(),
filtros: z_filtro.array().optional(),
});
export const serie_consultar = (cliente) => (parametros) => {
const dados = async () => {

View file

@ -138,4 +138,17 @@ export declare const pPilao: {
data: ("=" | "!=" | ">" | "<" | ">=" | "<=" | "∩")[];
mes: ("=" | "!=" | ">" | "<" | ">=" | "<=" | "∩")[];
};
z_filtro: import("zod").ZodObject<{
coluna: import("zod").ZodString;
valor: import("zod").ZodAny;
operador: import("zod").ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
}, "strip", import("zod").ZodTypeAny, {
coluna: string;
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
valor?: any;
}, {
coluna: string;
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
valor?: any;
}>;
};

View file

@ -2,7 +2,7 @@ import { deletar_registros, zp_deletar_registros } from "./_deletar_registros";
export { PREFIXO_PILAO, urlPilao } from "./variaveis";
import { enviar_registros, zp_enviar_registros, zp_registrar_base_dados, } from "./_enviar_registros";
import { operadores_permitidos_por_tipo, operadores_pilao, tiposSeriesAgregacoes, validarZ, zp_produto_conta, } from "./variaveis";
import { serie_consultar, zp_serie_registrar } from "./_serie_consultar";
import { serie_consultar, z_filtro, zp_serie_registrar, } from "./_serie_consultar";
export { tiposSeriesAgregacoes };
export const pPilao = {
zp_registrar_base_dados,
@ -16,4 +16,5 @@ export const pPilao = {
zp_deletar_registros,
operadores_pilao,
operadores_permitidos_por_tipo,
z_filtro,
};