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 type { tipoResposta } from "p-respostas";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { type zp_produto_conta } from "./variaveis";
|
import { type zp_produto_conta } from "./variaveis";
|
||||||
|
import type { visoes } from "./visoes";
|
||||||
export declare const z_filtro: z.ZodObject<{
|
export declare const z_filtro: z.ZodObject<{
|
||||||
coluna: z.ZodString;
|
coluna: z.ZodString;
|
||||||
valor: z.ZodAny;
|
valor: z.ZodAny;
|
||||||
|
|
@ -14,50 +15,13 @@ export declare const z_filtro: z.ZodObject<{
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||||
valor?: any;
|
valor?: any;
|
||||||
}>;
|
}>;
|
||||||
export declare const zp_serie_registrar: z.ZodObject<{
|
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]>) => {
|
||||||
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>) => {
|
|
||||||
dados: () => Promise<tipoResposta<{
|
dados: () => Promise<tipoResposta<{
|
||||||
registros: any[];
|
registros: any[];
|
||||||
legenda: string;
|
legenda: string;
|
||||||
serie: z.infer<typeof zp_serie_registrar>;
|
serie: {
|
||||||
|
[key: string]: any;
|
||||||
|
};
|
||||||
}>>;
|
}>>;
|
||||||
url: () => string;
|
url: () => string;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,15 @@
|
||||||
import node_fetch from "cross-fetch";
|
import node_fetch from "cross-fetch";
|
||||||
import { respostaComuns } from "p-respostas";
|
import { respostaComuns } from "p-respostas";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { operadores_pilao, tiposSeriesAgregacoes, urlPilao, } from "./variaveis";
|
import { operadores_pilao, urlPilao } from "./variaveis";
|
||||||
export const z_filtro = z.object({
|
export const z_filtro = z.object({
|
||||||
coluna: z.string(),
|
coluna: z.string(),
|
||||||
valor: z.any(),
|
valor: z.any(),
|
||||||
operador: operadores_pilao,
|
operador: operadores_pilao,
|
||||||
});
|
});
|
||||||
export const zp_serie_registrar = z.object({
|
export const serie_consultar = (cliente) => (tipoVisao, parametros) => {
|
||||||
tabela: z.string(),
|
|
||||||
colanuEixoX: z.string(),
|
|
||||||
colunaAgrupamento: z.string().array().optional(),
|
|
||||||
agregacao: tiposSeriesAgregacoes,
|
|
||||||
filtros: z_filtro.array().optional(),
|
|
||||||
});
|
|
||||||
export const serie_consultar = (cliente) => (parametros) => {
|
|
||||||
const dados = async () => {
|
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(), {
|
const resp = await node_fetch(url.toString(), {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify(parametros),
|
body: JSON.stringify(parametros),
|
||||||
|
|
@ -28,7 +21,7 @@ export const serie_consultar = (cliente) => (parametros) => {
|
||||||
return resp;
|
return resp;
|
||||||
};
|
};
|
||||||
const url = () => {
|
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));
|
const serie = encodeURIComponent(JSON.stringify(parametros, null, 2));
|
||||||
return `${vUrl.href}?serie=${serie}`;
|
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";
|
import { zp_deletar_registros } from "./_deletar_registros";
|
||||||
export { PREFIXO_PILAO, urlPilao } from "./variaveis";
|
export { PREFIXO_PILAO, urlPilao } from "./variaveis";
|
||||||
import { zp_enviar_registros } from "./_enviar_registros";
|
import { zp_enviar_registros } from "./_enviar_registros";
|
||||||
import { tiposSeriesAgregacoes, zp_produto_conta } from "./variaveis";
|
import { zp_produto_conta } from "./variaveis";
|
||||||
import { zp_serie_registrar } from "./_serie_consultar";
|
import { visoes } from "./visoes";
|
||||||
export { tiposSeriesAgregacoes };
|
|
||||||
export declare const pPilao: {
|
export declare const pPilao: {
|
||||||
extruturas_de_campos: {
|
extruturas_de_campos: {
|
||||||
z_contagem_em_barra_vertical: {
|
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;
|
tipo?: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "data" | "mes" | null | undefined;
|
||||||
}>[];
|
}>[];
|
||||||
}>;
|
}>;
|
||||||
zp_serie_registrar: import("zod").ZodObject<{
|
serie_consultar: (cliente: import("zod").TypeOf<typeof zp_produto_conta>) => <T extends keyof typeof visoes>(tipoVisao: T, parametros: import("zod").TypeOf<(typeof visoes)[T]>) => {
|
||||||
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>) => {
|
|
||||||
dados: () => Promise<import("p-respostas").tipoResposta<{
|
dados: () => Promise<import("p-respostas").tipoResposta<{
|
||||||
registros: any[];
|
registros: any[];
|
||||||
legenda: string;
|
legenda: string;
|
||||||
serie: import("zod").TypeOf<typeof zp_serie_registrar>;
|
serie: {
|
||||||
|
[key: string]: any;
|
||||||
|
};
|
||||||
}>>;
|
}>>;
|
||||||
url: () => string;
|
url: () => string;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,13 @@
|
||||||
import { deletar_registros, zp_deletar_registros } from "./_deletar_registros";
|
import { deletar_registros, zp_deletar_registros } from "./_deletar_registros";
|
||||||
export { PREFIXO_PILAO, urlPilao } from "./variaveis";
|
export { PREFIXO_PILAO, urlPilao } from "./variaveis";
|
||||||
import { enviar_registros, zp_enviar_registros, zp_registrar_base_dados, } from "./_enviar_registros";
|
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 { operadores_permitidos_por_tipo, operadores_pilao, validarZ, zp_produto_conta, } from "./variaveis";
|
||||||
import { serie_consultar, z_filtro, zp_serie_registrar, } from "./_serie_consultar";
|
import { serie_consultar, z_filtro } from "./_serie_consultar";
|
||||||
import { extruturas_de_campos, visoes } from "./visoes";
|
import { extruturas_de_campos, visoes } from "./visoes";
|
||||||
export { tiposSeriesAgregacoes };
|
|
||||||
export const pPilao = {
|
export const pPilao = {
|
||||||
zp_registrar_base_dados,
|
zp_registrar_base_dados,
|
||||||
enviar_registros,
|
enviar_registros,
|
||||||
zp_enviar_registros,
|
zp_enviar_registros,
|
||||||
zp_serie_registrar,
|
|
||||||
serie_consultar,
|
serie_consultar,
|
||||||
zp_produto_conta,
|
zp_produto_conta,
|
||||||
validarZ,
|
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: {
|
export declare const operadores_permitidos_por_tipo: {
|
||||||
[key in z.infer<typeof z_tipo_coluna_base_dados>]: z.infer<typeof operadores_pilao>[];
|
[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: {
|
export declare const z_validar_colunna_base_dados: {
|
||||||
texto: z.ZodNullable<z.ZodString>;
|
texto: z.ZodNullable<z.ZodString>;
|
||||||
numero: z.ZodNullable<z.ZodNumber>;
|
numero: z.ZodNullable<z.ZodNumber>;
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@ export const operadores_permitidos_por_tipo = {
|
||||||
numero: ["=", "!=", ">", "<", ">=", "<="],
|
numero: ["=", "!=", ">", "<", ">=", "<="],
|
||||||
texto: ["=", "!="],
|
texto: ["=", "!="],
|
||||||
};
|
};
|
||||||
export const tiposSeriesAgregacoes = z.enum(["contagem", "somatoria"]);
|
|
||||||
export const z_validar_colunna_base_dados = {
|
export const z_validar_colunna_base_dados = {
|
||||||
texto: z.string().nullable(),
|
texto: z.string().nullable(),
|
||||||
numero: z.number().nullable(),
|
numero: z.number().nullable(),
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import type { tipoResposta } from "p-respostas";
|
import type { tipoResposta } from "p-respostas";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { type zp_produto_conta } from "./variaveis";
|
import { type zp_produto_conta } from "./variaveis";
|
||||||
|
import type { visoes } from "./visoes";
|
||||||
export declare const z_filtro: z.ZodObject<{
|
export declare const z_filtro: z.ZodObject<{
|
||||||
coluna: z.ZodString;
|
coluna: z.ZodString;
|
||||||
valor: z.ZodAny;
|
valor: z.ZodAny;
|
||||||
|
|
@ -14,50 +15,13 @@ export declare const z_filtro: z.ZodObject<{
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||||
valor?: any;
|
valor?: any;
|
||||||
}>;
|
}>;
|
||||||
export declare const zp_serie_registrar: z.ZodObject<{
|
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]>) => {
|
||||||
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>) => {
|
|
||||||
dados: () => Promise<tipoResposta<{
|
dados: () => Promise<tipoResposta<{
|
||||||
registros: any[];
|
registros: any[];
|
||||||
legenda: string;
|
legenda: string;
|
||||||
serie: z.infer<typeof zp_serie_registrar>;
|
serie: {
|
||||||
|
[key: string]: any;
|
||||||
|
};
|
||||||
}>>;
|
}>>;
|
||||||
url: () => string;
|
url: () => string;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
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 cross_fetch_1 = __importDefault(require("cross-fetch"));
|
||||||
const p_respostas_1 = require("p-respostas");
|
const p_respostas_1 = require("p-respostas");
|
||||||
const zod_1 = require("zod");
|
const zod_1 = require("zod");
|
||||||
|
|
@ -13,16 +13,9 @@ exports.z_filtro = zod_1.z.object({
|
||||||
valor: zod_1.z.any(),
|
valor: zod_1.z.any(),
|
||||||
operador: variaveis_1.operadores_pilao,
|
operador: variaveis_1.operadores_pilao,
|
||||||
});
|
});
|
||||||
exports.zp_serie_registrar = zod_1.z.object({
|
const serie_consultar = (cliente) => (tipoVisao, parametros) => {
|
||||||
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 dados = async () => {
|
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(), {
|
const resp = await (0, cross_fetch_1.default)(url.toString(), {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify(parametros),
|
body: JSON.stringify(parametros),
|
||||||
|
|
@ -34,7 +27,7 @@ const serie_consultar = (cliente) => (parametros) => {
|
||||||
return resp;
|
return resp;
|
||||||
};
|
};
|
||||||
const url = () => {
|
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));
|
const serie = encodeURIComponent(JSON.stringify(parametros, null, 2));
|
||||||
return `${vUrl.href}?serie=${serie}`;
|
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";
|
import { zp_deletar_registros } from "./_deletar_registros";
|
||||||
export { PREFIXO_PILAO, urlPilao } from "./variaveis";
|
export { PREFIXO_PILAO, urlPilao } from "./variaveis";
|
||||||
import { zp_enviar_registros } from "./_enviar_registros";
|
import { zp_enviar_registros } from "./_enviar_registros";
|
||||||
import { tiposSeriesAgregacoes, zp_produto_conta } from "./variaveis";
|
import { zp_produto_conta } from "./variaveis";
|
||||||
import { zp_serie_registrar } from "./_serie_consultar";
|
import { visoes } from "./visoes";
|
||||||
export { tiposSeriesAgregacoes };
|
|
||||||
export declare const pPilao: {
|
export declare const pPilao: {
|
||||||
extruturas_de_campos: {
|
extruturas_de_campos: {
|
||||||
z_contagem_em_barra_vertical: {
|
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;
|
tipo?: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "data" | "mes" | null | undefined;
|
||||||
}>[];
|
}>[];
|
||||||
}>;
|
}>;
|
||||||
zp_serie_registrar: import("zod").ZodObject<{
|
serie_consultar: (cliente: import("zod").TypeOf<typeof zp_produto_conta>) => <T extends keyof typeof visoes>(tipoVisao: T, parametros: import("zod").TypeOf<(typeof visoes)[T]>) => {
|
||||||
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>) => {
|
|
||||||
dados: () => Promise<import("p-respostas").tipoResposta<{
|
dados: () => Promise<import("p-respostas").tipoResposta<{
|
||||||
registros: any[];
|
registros: any[];
|
||||||
legenda: string;
|
legenda: string;
|
||||||
serie: import("zod").TypeOf<typeof zp_serie_registrar>;
|
serie: {
|
||||||
|
[key: string]: any;
|
||||||
|
};
|
||||||
}>>;
|
}>>;
|
||||||
url: () => string;
|
url: () => string;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,18 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
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");
|
const _deletar_registros_1 = require("./_deletar_registros");
|
||||||
var variaveis_1 = require("./variaveis");
|
var variaveis_1 = require("./variaveis");
|
||||||
Object.defineProperty(exports, "PREFIXO_PILAO", { enumerable: true, get: function () { return variaveis_1.PREFIXO_PILAO; } });
|
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; } });
|
Object.defineProperty(exports, "urlPilao", { enumerable: true, get: function () { return variaveis_1.urlPilao; } });
|
||||||
const _enviar_registros_1 = require("./_enviar_registros");
|
const _enviar_registros_1 = require("./_enviar_registros");
|
||||||
const variaveis_2 = require("./variaveis");
|
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 _serie_consultar_1 = require("./_serie_consultar");
|
||||||
const visoes_1 = require("./visoes");
|
const visoes_1 = require("./visoes");
|
||||||
exports.pPilao = {
|
exports.pPilao = {
|
||||||
zp_registrar_base_dados: _enviar_registros_1.zp_registrar_base_dados,
|
zp_registrar_base_dados: _enviar_registros_1.zp_registrar_base_dados,
|
||||||
enviar_registros: _enviar_registros_1.enviar_registros,
|
enviar_registros: _enviar_registros_1.enviar_registros,
|
||||||
zp_enviar_registros: _enviar_registros_1.zp_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,
|
serie_consultar: _serie_consultar_1.serie_consultar,
|
||||||
zp_produto_conta: variaveis_2.zp_produto_conta,
|
zp_produto_conta: variaveis_2.zp_produto_conta,
|
||||||
validarZ: variaveis_2.validarZ,
|
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: {
|
export declare const operadores_permitidos_por_tipo: {
|
||||||
[key in z.infer<typeof z_tipo_coluna_base_dados>]: z.infer<typeof operadores_pilao>[];
|
[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: {
|
export declare const z_validar_colunna_base_dados: {
|
||||||
texto: z.ZodNullable<z.ZodString>;
|
texto: z.ZodNullable<z.ZodString>;
|
||||||
numero: z.ZodNullable<z.ZodNumber>;
|
numero: z.ZodNullable<z.ZodNumber>;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
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 p_respostas_1 = require("p-respostas");
|
||||||
const zod_1 = require("zod");
|
const zod_1 = require("zod");
|
||||||
exports.zAmbiente = zod_1.z.enum(["desenvolvimento", "producao"]);
|
exports.zAmbiente = zod_1.z.enum(["desenvolvimento", "producao"]);
|
||||||
|
|
@ -37,7 +37,6 @@ exports.operadores_permitidos_por_tipo = {
|
||||||
numero: ["=", "!=", ">", "<", ">=", "<="],
|
numero: ["=", "!=", ">", "<", ">=", "<="],
|
||||||
texto: ["=", "!="],
|
texto: ["=", "!="],
|
||||||
};
|
};
|
||||||
exports.tiposSeriesAgregacoes = zod_1.z.enum(["contagem", "somatoria"]);
|
|
||||||
exports.z_validar_colunna_base_dados = {
|
exports.z_validar_colunna_base_dados = {
|
||||||
texto: zod_1.z.string().nullable(),
|
texto: zod_1.z.string().nullable(),
|
||||||
numero: zod_1.z.number().nullable(),
|
numero: zod_1.z.number().nullable(),
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "p-drives",
|
"name": "p-drives",
|
||||||
"version": "0.123.0",
|
"version": "0.124.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,8 @@ import node_fetch from "cross-fetch"
|
||||||
import type { tipoResposta } from "p-respostas"
|
import type { tipoResposta } from "p-respostas"
|
||||||
import { respostaComuns } from "p-respostas"
|
import { respostaComuns } from "p-respostas"
|
||||||
import { z } from "zod"
|
import { z } from "zod"
|
||||||
import {
|
import { operadores_pilao, urlPilao, type zp_produto_conta } from "./variaveis"
|
||||||
operadores_pilao,
|
import type { visoes } from "./visoes"
|
||||||
tiposSeriesAgregacoes,
|
|
||||||
urlPilao,
|
|
||||||
type zp_produto_conta,
|
|
||||||
} from "./variaveis"
|
|
||||||
|
|
||||||
export const z_filtro = z.object({
|
export const z_filtro = z.object({
|
||||||
coluna: z.string(),
|
coluna: z.string(),
|
||||||
|
|
@ -15,27 +11,24 @@ export const z_filtro = z.object({
|
||||||
operador: operadores_pilao,
|
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 =
|
export const serie_consultar =
|
||||||
(cliente: z.infer<typeof zp_produto_conta>) =>
|
(cliente: z.infer<typeof zp_produto_conta>) =>
|
||||||
(parametros: z.infer<typeof zp_serie_registrar>) => {
|
<T extends keyof typeof visoes>(
|
||||||
|
tipoVisao: T,
|
||||||
|
parametros: z.infer<(typeof visoes)[T]>,
|
||||||
|
) => {
|
||||||
const dados = async (): Promise<
|
const dados = async (): Promise<
|
||||||
tipoResposta<{
|
tipoResposta<{
|
||||||
registros: any[]
|
registros: any[]
|
||||||
legenda: string
|
legenda: string
|
||||||
serie: z.infer<typeof zp_serie_registrar>
|
serie: {
|
||||||
|
[key: string]: any
|
||||||
|
}
|
||||||
}>
|
}>
|
||||||
> => {
|
> => {
|
||||||
const url = new URL(
|
const url = new URL(
|
||||||
`${urlPilao(cliente.emDesenvolvimento).api}/${
|
`${urlPilao(cliente.emDesenvolvimento).api}/${
|
||||||
tiposSeriesAgregacoes.enum.contagem
|
tipoVisao
|
||||||
}/${cliente.produto}/${cliente.conta}`,
|
}/${cliente.produto}/${cliente.conta}`,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -55,7 +48,7 @@ export const serie_consultar =
|
||||||
|
|
||||||
const url = (): string => {
|
const url = (): string => {
|
||||||
const vUrl = new URL(
|
const vUrl = new URL(
|
||||||
`${urlPilao(cliente.emDesenvolvimento).site}/${tiposSeriesAgregacoes.enum.contagem}/${cliente.produto}/${cliente.conta}`,
|
`${urlPilao(cliente.emDesenvolvimento).site}/${tipoVisao}/${cliente.produto}/${cliente.conta}`,
|
||||||
)
|
)
|
||||||
|
|
||||||
const serie = encodeURIComponent(JSON.stringify(parametros, null, 2))
|
const serie = encodeURIComponent(JSON.stringify(parametros, null, 2))
|
||||||
|
|
|
||||||
|
|
@ -8,25 +8,17 @@ import {
|
||||||
import {
|
import {
|
||||||
operadores_permitidos_por_tipo,
|
operadores_permitidos_por_tipo,
|
||||||
operadores_pilao,
|
operadores_pilao,
|
||||||
tiposSeriesAgregacoes,
|
|
||||||
validarZ,
|
validarZ,
|
||||||
zp_produto_conta,
|
zp_produto_conta,
|
||||||
} from "./variaveis"
|
} from "./variaveis"
|
||||||
|
|
||||||
import {
|
import { serie_consultar, z_filtro } from "./_serie_consultar"
|
||||||
serie_consultar,
|
|
||||||
z_filtro,
|
|
||||||
zp_serie_registrar,
|
|
||||||
} from "./_serie_consultar"
|
|
||||||
import { extruturas_de_campos, visoes } from "./visoes"
|
import { extruturas_de_campos, visoes } from "./visoes"
|
||||||
|
|
||||||
export { tiposSeriesAgregacoes }
|
|
||||||
|
|
||||||
export const pPilao = {
|
export const pPilao = {
|
||||||
zp_registrar_base_dados,
|
zp_registrar_base_dados,
|
||||||
enviar_registros,
|
enviar_registros,
|
||||||
zp_enviar_registros,
|
zp_enviar_registros,
|
||||||
zp_serie_registrar,
|
|
||||||
serie_consultar,
|
serie_consultar,
|
||||||
zp_produto_conta,
|
zp_produto_conta,
|
||||||
validarZ,
|
validarZ,
|
||||||
|
|
|
||||||
|
|
@ -52,8 +52,6 @@ export const operadores_permitidos_por_tipo: {
|
||||||
texto: ["=", "!="],
|
texto: ["=", "!="],
|
||||||
}
|
}
|
||||||
|
|
||||||
export const tiposSeriesAgregacoes = z.enum(["contagem", "somatoria"])
|
|
||||||
|
|
||||||
export const z_validar_colunna_base_dados = {
|
export const z_validar_colunna_base_dados = {
|
||||||
texto: z.string().nullable(),
|
texto: z.string().nullable(),
|
||||||
numero: z.number().nullable(),
|
numero: z.number().nullable(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue