build
This commit is contained in:
parent
9aa20d03a1
commit
1361effbf6
16 changed files with 47 additions and 234 deletions
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.serie_consultar = exports.zp_serie_registrar = exports.z_filtro = void 0;
|
||||
exports.serie_consultar = exports.z_filtro = void 0;
|
||||
const cross_fetch_1 = __importDefault(require("cross-fetch"));
|
||||
const p_respostas_1 = require("p-respostas");
|
||||
const zod_1 = require("zod");
|
||||
|
|
@ -13,16 +13,9 @@ exports.z_filtro = zod_1.z.object({
|
|||
valor: zod_1.z.any(),
|
||||
operador: variaveis_1.operadores_pilao,
|
||||
});
|
||||
exports.zp_serie_registrar = zod_1.z.object({
|
||||
tabela: zod_1.z.string(),
|
||||
colanuEixoX: zod_1.z.string(),
|
||||
colunaAgrupamento: zod_1.z.string().array().optional(),
|
||||
agregacao: variaveis_1.tiposSeriesAgregacoes,
|
||||
filtros: exports.z_filtro.array().optional(),
|
||||
});
|
||||
const serie_consultar = (cliente) => (parametros) => {
|
||||
const serie_consultar = (cliente) => (tipoVisao, parametros) => {
|
||||
const dados = async () => {
|
||||
const url = new URL(`${(0, variaveis_1.urlPilao)(cliente.emDesenvolvimento).api}/${variaveis_1.tiposSeriesAgregacoes.enum.contagem}/${cliente.produto}/${cliente.conta}`);
|
||||
const url = new URL(`${(0, variaveis_1.urlPilao)(cliente.emDesenvolvimento).api}/${tipoVisao}/${cliente.produto}/${cliente.conta}`);
|
||||
const resp = await (0, cross_fetch_1.default)(url.toString(), {
|
||||
method: "POST",
|
||||
body: JSON.stringify(parametros),
|
||||
|
|
@ -34,7 +27,7 @@ const serie_consultar = (cliente) => (parametros) => {
|
|||
return resp;
|
||||
};
|
||||
const url = () => {
|
||||
const vUrl = new URL(`${(0, variaveis_1.urlPilao)(cliente.emDesenvolvimento).site}/${variaveis_1.tiposSeriesAgregacoes.enum.contagem}/${cliente.produto}/${cliente.conta}`);
|
||||
const vUrl = new URL(`${(0, variaveis_1.urlPilao)(cliente.emDesenvolvimento).site}/${tipoVisao}/${cliente.produto}/${cliente.conta}`);
|
||||
const serie = encodeURIComponent(JSON.stringify(parametros, null, 2));
|
||||
return `${vUrl.href}?serie=${serie}`;
|
||||
};
|
||||
|
|
|
|||
50
dist-require/pilao-de-dados/index.d.ts
vendored
50
dist-require/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,20 +1,18 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.pPilao = exports.tiposSeriesAgregacoes = exports.urlPilao = exports.PREFIXO_PILAO = void 0;
|
||||
exports.pPilao = exports.urlPilao = exports.PREFIXO_PILAO = void 0;
|
||||
const _deletar_registros_1 = require("./_deletar_registros");
|
||||
var variaveis_1 = require("./variaveis");
|
||||
Object.defineProperty(exports, "PREFIXO_PILAO", { enumerable: true, get: function () { return variaveis_1.PREFIXO_PILAO; } });
|
||||
Object.defineProperty(exports, "urlPilao", { enumerable: true, get: function () { return variaveis_1.urlPilao; } });
|
||||
const _enviar_registros_1 = require("./_enviar_registros");
|
||||
const variaveis_2 = require("./variaveis");
|
||||
Object.defineProperty(exports, "tiposSeriesAgregacoes", { enumerable: true, get: function () { return variaveis_2.tiposSeriesAgregacoes; } });
|
||||
const _serie_consultar_1 = require("./_serie_consultar");
|
||||
const visoes_1 = require("./visoes");
|
||||
exports.pPilao = {
|
||||
zp_registrar_base_dados: _enviar_registros_1.zp_registrar_base_dados,
|
||||
enviar_registros: _enviar_registros_1.enviar_registros,
|
||||
zp_enviar_registros: _enviar_registros_1.zp_enviar_registros,
|
||||
zp_serie_registrar: _serie_consultar_1.zp_serie_registrar,
|
||||
serie_consultar: _serie_consultar_1.serie_consultar,
|
||||
zp_produto_conta: variaveis_2.zp_produto_conta,
|
||||
validarZ: variaveis_2.validarZ,
|
||||
|
|
|
|||
1
dist-require/pilao-de-dados/variaveis.d.ts
vendored
1
dist-require/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>;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.urlPilao = exports.z_validar_colunna_base_dados = exports.tiposSeriesAgregacoes = exports.operadores_permitidos_por_tipo = exports.operadores_pilao = exports.z_tipo_coluna_base_dados = exports.zp_produto_conta = exports.validarZ = exports.PREFIXO_PILAO = exports.zAmbiente = void 0;
|
||||
exports.urlPilao = exports.z_validar_colunna_base_dados = exports.operadores_permitidos_por_tipo = exports.operadores_pilao = exports.z_tipo_coluna_base_dados = exports.zp_produto_conta = exports.validarZ = exports.PREFIXO_PILAO = exports.zAmbiente = void 0;
|
||||
const p_respostas_1 = require("p-respostas");
|
||||
const zod_1 = require("zod");
|
||||
exports.zAmbiente = zod_1.z.enum(["desenvolvimento", "producao"]);
|
||||
|
|
@ -37,7 +37,6 @@ exports.operadores_permitidos_por_tipo = {
|
|||
numero: ["=", "!=", ">", "<", ">=", "<="],
|
||||
texto: ["=", "!="],
|
||||
};
|
||||
exports.tiposSeriesAgregacoes = zod_1.z.enum(["contagem", "somatoria"]);
|
||||
exports.z_validar_colunna_base_dados = {
|
||||
texto: zod_1.z.string().nullable(),
|
||||
numero: zod_1.z.number().nullable(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue