build
This commit is contained in:
parent
9aa20d03a1
commit
1361effbf6
16 changed files with 47 additions and 234 deletions
46
dist-import/pilao-de-dados/_serie_consultar.d.ts
vendored
46
dist-import/pilao-de-dados/_serie_consultar.d.ts
vendored
|
|
@ -1,6 +1,7 @@
|
|||
import type { tipoResposta } from "p-respostas";
|
||||
import { z } from "zod";
|
||||
import { type zp_produto_conta } from "./variaveis";
|
||||
import type { visoes } from "./visoes";
|
||||
export declare const z_filtro: z.ZodObject<{
|
||||
coluna: z.ZodString;
|
||||
valor: z.ZodAny;
|
||||
|
|
@ -14,50 +15,13 @@ export declare const z_filtro: z.ZodObject<{
|
|||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}>;
|
||||
export declare const zp_serie_registrar: z.ZodObject<{
|
||||
tabela: z.ZodString;
|
||||
colanuEixoX: z.ZodString;
|
||||
colunaAgrupamento: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
agregacao: z.ZodEnum<["contagem", "somatoria"]>;
|
||||
filtros: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
coluna: z.ZodString;
|
||||
valor: z.ZodAny;
|
||||
operador: z.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}>, "many">>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
agregacao: "contagem" | "somatoria";
|
||||
colunaAgrupamento?: string[] | undefined;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
}, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
agregacao: "contagem" | "somatoria";
|
||||
colunaAgrupamento?: string[] | undefined;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
}>;
|
||||
export declare const serie_consultar: (cliente: z.infer<typeof zp_produto_conta>) => (parametros: z.infer<typeof zp_serie_registrar>) => {
|
||||
export declare const serie_consultar: (cliente: z.infer<typeof zp_produto_conta>) => <T extends keyof typeof visoes>(tipoVisao: T, parametros: z.infer<(typeof visoes)[T]>) => {
|
||||
dados: () => Promise<tipoResposta<{
|
||||
registros: any[];
|
||||
legenda: string;
|
||||
serie: z.infer<typeof zp_serie_registrar>;
|
||||
serie: {
|
||||
[key: string]: any;
|
||||
};
|
||||
}>>;
|
||||
url: () => string;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,22 +1,15 @@
|
|||
import node_fetch from "cross-fetch";
|
||||
import { respostaComuns } from "p-respostas";
|
||||
import { z } from "zod";
|
||||
import { operadores_pilao, tiposSeriesAgregacoes, urlPilao, } from "./variaveis";
|
||||
import { operadores_pilao, urlPilao } from "./variaveis";
|
||||
export const z_filtro = z.object({
|
||||
coluna: z.string(),
|
||||
valor: z.any(),
|
||||
operador: operadores_pilao,
|
||||
});
|
||||
export const zp_serie_registrar = z.object({
|
||||
tabela: z.string(),
|
||||
colanuEixoX: z.string(),
|
||||
colunaAgrupamento: z.string().array().optional(),
|
||||
agregacao: tiposSeriesAgregacoes,
|
||||
filtros: z_filtro.array().optional(),
|
||||
});
|
||||
export const serie_consultar = (cliente) => (parametros) => {
|
||||
export const serie_consultar = (cliente) => (tipoVisao, parametros) => {
|
||||
const dados = async () => {
|
||||
const url = new URL(`${urlPilao(cliente.emDesenvolvimento).api}/${tiposSeriesAgregacoes.enum.contagem}/${cliente.produto}/${cliente.conta}`);
|
||||
const url = new URL(`${urlPilao(cliente.emDesenvolvimento).api}/${tipoVisao}/${cliente.produto}/${cliente.conta}`);
|
||||
const resp = await node_fetch(url.toString(), {
|
||||
method: "POST",
|
||||
body: JSON.stringify(parametros),
|
||||
|
|
@ -28,7 +21,7 @@ export const serie_consultar = (cliente) => (parametros) => {
|
|||
return resp;
|
||||
};
|
||||
const url = () => {
|
||||
const vUrl = new URL(`${urlPilao(cliente.emDesenvolvimento).site}/${tiposSeriesAgregacoes.enum.contagem}/${cliente.produto}/${cliente.conta}`);
|
||||
const vUrl = new URL(`${urlPilao(cliente.emDesenvolvimento).site}/${tipoVisao}/${cliente.produto}/${cliente.conta}`);
|
||||
const serie = encodeURIComponent(JSON.stringify(parametros, null, 2));
|
||||
return `${vUrl.href}?serie=${serie}`;
|
||||
};
|
||||
|
|
|
|||
50
dist-import/pilao-de-dados/index.d.ts
vendored
50
dist-import/pilao-de-dados/index.d.ts
vendored
|
|
@ -1,9 +1,8 @@
|
|||
import { zp_deletar_registros } from "./_deletar_registros";
|
||||
export { PREFIXO_PILAO, urlPilao } from "./variaveis";
|
||||
import { zp_enviar_registros } from "./_enviar_registros";
|
||||
import { tiposSeriesAgregacoes, zp_produto_conta } from "./variaveis";
|
||||
import { zp_serie_registrar } from "./_serie_consultar";
|
||||
export { tiposSeriesAgregacoes };
|
||||
import { zp_produto_conta } from "./variaveis";
|
||||
import { visoes } from "./visoes";
|
||||
export declare const pPilao: {
|
||||
extruturas_de_campos: {
|
||||
z_contagem_em_barra_vertical: {
|
||||
|
|
@ -232,50 +231,13 @@ export declare const pPilao: {
|
|||
tipo?: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "data" | "mes" | null | undefined;
|
||||
}>[];
|
||||
}>;
|
||||
zp_serie_registrar: import("zod").ZodObject<{
|
||||
tabela: import("zod").ZodString;
|
||||
colanuEixoX: import("zod").ZodString;
|
||||
colunaAgrupamento: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
||||
agregacao: import("zod").ZodEnum<["contagem", "somatoria"]>;
|
||||
filtros: import("zod").ZodOptional<import("zod").ZodArray<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;
|
||||
}>, "many">>;
|
||||
}, "strip", import("zod").ZodTypeAny, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
agregacao: "contagem" | "somatoria";
|
||||
colunaAgrupamento?: string[] | undefined;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
}, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
agregacao: "contagem" | "somatoria";
|
||||
colunaAgrupamento?: string[] | undefined;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
}>;
|
||||
serie_consultar: (cliente: import("zod").TypeOf<typeof zp_produto_conta>) => (parametros: import("zod").TypeOf<typeof zp_serie_registrar>) => {
|
||||
serie_consultar: (cliente: import("zod").TypeOf<typeof zp_produto_conta>) => <T extends keyof typeof visoes>(tipoVisao: T, parametros: import("zod").TypeOf<(typeof visoes)[T]>) => {
|
||||
dados: () => Promise<import("p-respostas").tipoResposta<{
|
||||
registros: any[];
|
||||
legenda: string;
|
||||
serie: import("zod").TypeOf<typeof zp_serie_registrar>;
|
||||
serie: {
|
||||
[key: string]: any;
|
||||
};
|
||||
}>>;
|
||||
url: () => string;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,15 +1,13 @@
|
|||
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, z_filtro, zp_serie_registrar, } from "./_serie_consultar";
|
||||
import { operadores_permitidos_por_tipo, operadores_pilao, validarZ, zp_produto_conta, } from "./variaveis";
|
||||
import { serie_consultar, z_filtro } from "./_serie_consultar";
|
||||
import { extruturas_de_campos, visoes } from "./visoes";
|
||||
export { tiposSeriesAgregacoes };
|
||||
export const pPilao = {
|
||||
zp_registrar_base_dados,
|
||||
enviar_registros,
|
||||
zp_enviar_registros,
|
||||
zp_serie_registrar,
|
||||
serie_consultar,
|
||||
zp_produto_conta,
|
||||
validarZ,
|
||||
|
|
|
|||
1
dist-import/pilao-de-dados/variaveis.d.ts
vendored
1
dist-import/pilao-de-dados/variaveis.d.ts
vendored
|
|
@ -20,7 +20,6 @@ export declare const operadores_pilao: z.ZodEnum<["=", "!=", ">", "<", ">=", "<=
|
|||
export declare const operadores_permitidos_por_tipo: {
|
||||
[key in z.infer<typeof z_tipo_coluna_base_dados>]: z.infer<typeof operadores_pilao>[];
|
||||
};
|
||||
export declare const tiposSeriesAgregacoes: z.ZodEnum<["contagem", "somatoria"]>;
|
||||
export declare const z_validar_colunna_base_dados: {
|
||||
texto: z.ZodNullable<z.ZodString>;
|
||||
numero: z.ZodNullable<z.ZodNumber>;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ export const operadores_permitidos_por_tipo = {
|
|||
numero: ["=", "!=", ">", "<", ">=", "<="],
|
||||
texto: ["=", "!="],
|
||||
};
|
||||
export const tiposSeriesAgregacoes = z.enum(["contagem", "somatoria"]);
|
||||
export const z_validar_colunna_base_dados = {
|
||||
texto: z.string().nullable(),
|
||||
numero: z.number().nullable(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue