remoção de pilão
This commit is contained in:
parent
f7a936e8dd
commit
02f9f3902b
21 changed files with 7 additions and 2641 deletions
|
|
@ -1,904 +1,5 @@
|
||||||
import * as p_respostas from 'p-respostas';
|
|
||||||
import { tipoResposta } from 'p-respostas';
|
|
||||||
import * as zod from 'zod';
|
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
import { tipoResposta } from 'p-respostas';
|
||||||
/** aplica a todas as consultas */
|
|
||||||
declare const z_padroes: z.ZodObject<{
|
|
||||||
tabela: z.ZodString;
|
|
||||||
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">>;
|
|
||||||
descricao_pelo_usuario: z.ZodOptional<z.ZodString>;
|
|
||||||
}, "strip", z.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
}>;
|
|
||||||
declare const visoes_pilao: {
|
|
||||||
z_contagem_em_barra_vertical: z.ZodObject<z.objectUtil.extendShape<{
|
|
||||||
colanuEixoX: z.ZodString;
|
|
||||||
colunaAgrupamento: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
||||||
}, {
|
|
||||||
tabela: z.ZodString;
|
|
||||||
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">>;
|
|
||||||
descricao_pelo_usuario: z.ZodOptional<z.ZodString>;
|
|
||||||
}>, "strip", z.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
colanuEixoX: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
colunaAgrupamento?: string[] | undefined;
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
colanuEixoX: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
colunaAgrupamento?: string[] | undefined;
|
|
||||||
}>;
|
|
||||||
z_contagem_em_pizza: z.ZodObject<z.objectUtil.extendShape<{
|
|
||||||
classes: z.ZodString;
|
|
||||||
}, {
|
|
||||||
tabela: z.ZodString;
|
|
||||||
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">>;
|
|
||||||
descricao_pelo_usuario: z.ZodOptional<z.ZodString>;
|
|
||||||
}>, "strip", z.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
classes: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
classes: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
}>;
|
|
||||||
z_tabela: z.ZodObject<z.objectUtil.extendShape<{
|
|
||||||
colunas: z.ZodArray<z.ZodString, "many">;
|
|
||||||
coluna_ordem: z.ZodOptional<z.ZodString>;
|
|
||||||
direcao_ordem: z.ZodOptional<z.ZodEnum<["asc", "desc", "1", "-1"]>>;
|
|
||||||
}, {
|
|
||||||
tabela: z.ZodString;
|
|
||||||
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">>;
|
|
||||||
descricao_pelo_usuario: z.ZodOptional<z.ZodString>;
|
|
||||||
}>, "strip", z.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
colunas: string[];
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
coluna_ordem?: string | undefined;
|
|
||||||
direcao_ordem?: "1" | "asc" | "desc" | "-1" | undefined;
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
colunas: string[];
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
coluna_ordem?: string | undefined;
|
|
||||||
direcao_ordem?: "1" | "asc" | "desc" | "-1" | undefined;
|
|
||||||
}>;
|
|
||||||
z_soma_em_barra_vertical: z.ZodObject<z.objectUtil.extendShape<{
|
|
||||||
colanuEixoX: z.ZodString;
|
|
||||||
colunaSoma: z.ZodString;
|
|
||||||
unidadeSoma: z.ZodOptional<z.ZodString>;
|
|
||||||
colunaAgrupamento: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
||||||
exibirComoPorcentagem: z.ZodOptional<z.ZodBoolean>;
|
|
||||||
}, {
|
|
||||||
tabela: z.ZodString;
|
|
||||||
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">>;
|
|
||||||
descricao_pelo_usuario: z.ZodOptional<z.ZodString>;
|
|
||||||
}>, "strip", z.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
colanuEixoX: string;
|
|
||||||
colunaSoma: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
colunaAgrupamento?: string[] | undefined;
|
|
||||||
unidadeSoma?: string | undefined;
|
|
||||||
exibirComoPorcentagem?: boolean | undefined;
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
colanuEixoX: string;
|
|
||||||
colunaSoma: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
colunaAgrupamento?: string[] | undefined;
|
|
||||||
unidadeSoma?: string | undefined;
|
|
||||||
exibirComoPorcentagem?: boolean | undefined;
|
|
||||||
}>;
|
|
||||||
};
|
|
||||||
|
|
||||||
declare const z_tipos_campos_reg_grafico: z.ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros", "ordem", "booleana"]>;
|
|
||||||
type tipo_estrutura_visao_grafico<T extends keyof typeof visoes_pilao> = {
|
|
||||||
/** Nome da Visão */
|
|
||||||
visao: T;
|
|
||||||
/** Rotulo */
|
|
||||||
rotulo: string;
|
|
||||||
/** Retorna a tabela Referente ao Registro */
|
|
||||||
tabela: (_: z.infer<(typeof visoes_pilao)[T]> & z.infer<typeof z_padroes>) => string;
|
|
||||||
/** Descrição */
|
|
||||||
descricao: (_: z.infer<(typeof visoes_pilao)[T]> & z.infer<typeof z_padroes>) => string;
|
|
||||||
/** Lista os campos e suas configurações */
|
|
||||||
campos: {
|
|
||||||
[c in keyof Required<z.infer<(typeof visoes_pilao)[T]> & z.infer<typeof z_padroes>>]: {
|
|
||||||
rotulo: string;
|
|
||||||
tipo_campo: z.infer<typeof z_tipos_campos_reg_grafico>;
|
|
||||||
order: number;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
declare const zp_deletar_registros: z.ZodObject<{
|
|
||||||
tabela: z.ZodString;
|
|
||||||
codigos: z.ZodArray<z.ZodString, "many">;
|
|
||||||
}, "strip", z.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
codigos: string[];
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
codigos: string[];
|
|
||||||
}>;
|
|
||||||
declare const PREFIXO_PILAO = "/pilao-de-dados";
|
|
||||||
declare const urlPilao: (emDesenvolvimento?: boolean | null | undefined) => {
|
|
||||||
api: string;
|
|
||||||
site: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
declare const zp_registrar_base_dados: z.ZodObject<{
|
|
||||||
tabela: z.ZodString;
|
|
||||||
colunas: z.ZodArray<z.ZodObject<{
|
|
||||||
coluna: z.ZodString;
|
|
||||||
tipo: z.ZodEnum<["texto", "numero", "confirmacao", "lista_texto", "lista_numero", "lista_mes", "lista_data", "mes", "data"]>;
|
|
||||||
}, "strip", z.ZodTypeAny, {
|
|
||||||
coluna: string;
|
|
||||||
tipo: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "lista_mes" | "lista_data" | "mes" | "data";
|
|
||||||
}, {
|
|
||||||
coluna: string;
|
|
||||||
tipo: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "lista_mes" | "lista_data" | "mes" | "data";
|
|
||||||
}>, "many">;
|
|
||||||
}, "strip", z.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
colunas: {
|
|
||||||
coluna: string;
|
|
||||||
tipo: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "lista_mes" | "lista_data" | "mes" | "data";
|
|
||||||
}[];
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
colunas: {
|
|
||||||
coluna: string;
|
|
||||||
tipo: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "lista_mes" | "lista_data" | "mes" | "data";
|
|
||||||
}[];
|
|
||||||
}>;
|
|
||||||
declare const zp_enviar_registros: z.ZodObject<{
|
|
||||||
tabela: z.ZodString;
|
|
||||||
registros: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
||||||
valor: z.ZodAny;
|
|
||||||
tipo: z.ZodNullable<z.ZodOptional<z.ZodEnum<["texto", "numero", "confirmacao", "lista_texto", "lista_numero", "lista_mes", "lista_data", "mes", "data"]>>>;
|
|
||||||
}, "strip", z.ZodTypeAny, {
|
|
||||||
valor?: any;
|
|
||||||
tipo?: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "lista_mes" | "lista_data" | "mes" | "data" | null | undefined;
|
|
||||||
}, {
|
|
||||||
valor?: any;
|
|
||||||
tipo?: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "lista_mes" | "lista_data" | "mes" | "data" | null | undefined;
|
|
||||||
}>>, "many">;
|
|
||||||
}, "strip", z.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
registros: Record<string, {
|
|
||||||
valor?: any;
|
|
||||||
tipo?: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "lista_mes" | "lista_data" | "mes" | "data" | null | undefined;
|
|
||||||
}>[];
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
registros: Record<string, {
|
|
||||||
valor?: any;
|
|
||||||
tipo?: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "lista_mes" | "lista_data" | "mes" | "data" | null | undefined;
|
|
||||||
}>[];
|
|
||||||
}>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {
|
|
||||||
* 'rota':{
|
|
||||||
* pr:{}// paramentros de entrada
|
|
||||||
* rs:{}// resposta
|
|
||||||
* }
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
type tipo_pilao_api = {
|
|
||||||
/** retorna da data e hora do servido em formato iso */
|
|
||||||
estado_servidor: {
|
|
||||||
pr: {};
|
|
||||||
rs: {
|
|
||||||
data_hora: string;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
tabelas: {
|
|
||||||
pr: {};
|
|
||||||
rs: z.infer<typeof zp_registrar_base_dados>[];
|
|
||||||
};
|
|
||||||
unicos: {
|
|
||||||
pr: {
|
|
||||||
tabela: string;
|
|
||||||
coluna: string;
|
|
||||||
};
|
|
||||||
rs: any[];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
type tipoConstrutorPilao = {
|
|
||||||
produto: string;
|
|
||||||
conta: string;
|
|
||||||
};
|
|
||||||
type z_tipagem_registros = {
|
|
||||||
z_contagem_em_barra_vertical: {
|
|
||||||
contagem: number;
|
|
||||||
[k: string]: any;
|
|
||||||
}[];
|
|
||||||
z_contagem_em_pizza: {
|
|
||||||
contagem: number;
|
|
||||||
[k: string]: any;
|
|
||||||
}[];
|
|
||||||
z_tabela: {
|
|
||||||
[k: string]: any;
|
|
||||||
}[];
|
|
||||||
z_soma_em_barra_vertical: {
|
|
||||||
soma: number;
|
|
||||||
[k: string]: any;
|
|
||||||
}[];
|
|
||||||
z_porcentagem_soma_em_barra_vertical: {
|
|
||||||
porcentagem: number;
|
|
||||||
[k: string]: any;
|
|
||||||
}[];
|
|
||||||
};
|
|
||||||
type tipoRetornoSerieconsulta<T extends keyof typeof visoes_pilao> = {
|
|
||||||
registros: z_tipagem_registros[T];
|
|
||||||
legenda: string;
|
|
||||||
serie: z.infer<(typeof visoes_pilao)[T]> & z.infer<typeof z_padroes>;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** Drive completo do piilão de dados */
|
|
||||||
|
|
||||||
declare enum pilao_enderecos {
|
|
||||||
"enviar-registros" = "enviar-registros",
|
|
||||||
"deletar-registros" = "deletar-registros",
|
|
||||||
"consultar-serie" = "consultar-serie",
|
|
||||||
laboratório = "laborat\u00F3rio"
|
|
||||||
}
|
|
||||||
type nomesVisoes = keyof typeof visoes_pilao;
|
|
||||||
type retornoSerieConsultar<T extends nomesVisoes> = {
|
|
||||||
dados: () => Promise<tipoResposta<tipoRetornoSerieconsulta<T>>>;
|
|
||||||
url: () => string;
|
|
||||||
};
|
|
||||||
declare class ClassPilao {
|
|
||||||
#private;
|
|
||||||
constructor({ conta, produto, emDesenvolvimento, ver_log, }: tipoConstrutorPilao & {
|
|
||||||
ver_log?: boolean;
|
|
||||||
emDesenvolvimento?: boolean;
|
|
||||||
});
|
|
||||||
rotaEnviarRegistros(): {
|
|
||||||
rota: string;
|
|
||||||
url: URL;
|
|
||||||
};
|
|
||||||
rotaDeletarRegistro(): {
|
|
||||||
rota: string;
|
|
||||||
url: URL;
|
|
||||||
};
|
|
||||||
rotaConsultarSerie(): {
|
|
||||||
rota: string;
|
|
||||||
url: URL;
|
|
||||||
};
|
|
||||||
rotaIframeSerie(tipoVisao: nomesVisoes | ":tipoVisao"): {
|
|
||||||
rota: string;
|
|
||||||
url: string;
|
|
||||||
};
|
|
||||||
rotaFuncaoApi(funcao: keyof tipo_pilao_api | ":funcao"): {
|
|
||||||
rota: string;
|
|
||||||
url: URL;
|
|
||||||
};
|
|
||||||
consultarApi<T extends keyof tipo_pilao_api>(funcao: T, parametros: tipo_pilao_api[T]["pr"]): Promise<tipoResposta<tipo_pilao_api[T]["rs"]>>;
|
|
||||||
get baseUrlApi(): "https://carro-de-boi.idz.one" | "http://localhost:5080";
|
|
||||||
get baseUrlSite(): "https://carro-de-boi.idz.one" | "http://localhost:5081";
|
|
||||||
validarCliente(_: any): tipoResposta<tipoConstrutorPilao>;
|
|
||||||
adicionarRegistroParaEnviar(tabela: string, ...registros: z.infer<typeof zp_enviar_registros>["registros"]): this;
|
|
||||||
adicionarCodigoParaDeletar(tabela: string, ...codigos: z.infer<typeof zp_deletar_registros>["codigos"]): this;
|
|
||||||
private processarRegistros;
|
|
||||||
enviarRegistros(): Promise<tipoResposta<true>>;
|
|
||||||
serieConsultar<T extends nomesVisoes>(tipoVisao: T, parametros_: z.infer<(typeof visoes_pilao)[T]> & z.infer<typeof z_padroes>, padroes?: Pick<z.infer<typeof z_padroes>, "descricao_pelo_usuario">): retornoSerieConsultar<T>;
|
|
||||||
urlLaboratorio(): {
|
|
||||||
rota: string;
|
|
||||||
url: string;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
declare const Pilao: (_: tipoConstrutorPilao & {
|
|
||||||
ver_log?: boolean;
|
|
||||||
emDesenvolvimento?: boolean;
|
|
||||||
}) => ClassPilao;
|
|
||||||
|
|
||||||
declare const pPilao: {
|
|
||||||
extruturas_de_campos: {
|
|
||||||
z_contagem_em_barra_vertical: tipo_estrutura_visao_grafico<"z_contagem_em_barra_vertical">;
|
|
||||||
z_contagem_em_pizza: tipo_estrutura_visao_grafico<"z_contagem_em_pizza">;
|
|
||||||
z_tabela: tipo_estrutura_visao_grafico<"z_tabela">;
|
|
||||||
z_soma_em_barra_vertical: tipo_estrutura_visao_grafico<"z_soma_em_barra_vertical">;
|
|
||||||
};
|
|
||||||
z_padroes: zod.ZodObject<{
|
|
||||||
tabela: zod.ZodString;
|
|
||||||
filtros: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
||||||
coluna: zod.ZodString;
|
|
||||||
valor: zod.ZodAny;
|
|
||||||
operador: zod.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}>, "many">>;
|
|
||||||
descricao_pelo_usuario: zod.ZodOptional<zod.ZodString>;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
}>;
|
|
||||||
pilao_enderecos: typeof pilao_enderecos;
|
|
||||||
z_contagem_em_barra_vertical: zod.ZodObject<zod.objectUtil.extendShape<{
|
|
||||||
colanuEixoX: zod.ZodString;
|
|
||||||
colunaAgrupamento: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
|
|
||||||
}, {
|
|
||||||
tabela: zod.ZodString;
|
|
||||||
filtros: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
||||||
coluna: zod.ZodString;
|
|
||||||
valor: zod.ZodAny;
|
|
||||||
operador: zod.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}>, "many">>;
|
|
||||||
descricao_pelo_usuario: zod.ZodOptional<zod.ZodString>;
|
|
||||||
}>, "strip", zod.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
colanuEixoX: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
colunaAgrupamento?: string[] | undefined;
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
colanuEixoX: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
colunaAgrupamento?: string[] | undefined;
|
|
||||||
}>;
|
|
||||||
z_contagem_em_pizza: zod.ZodObject<zod.objectUtil.extendShape<{
|
|
||||||
classes: zod.ZodString;
|
|
||||||
}, {
|
|
||||||
tabela: zod.ZodString;
|
|
||||||
filtros: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
||||||
coluna: zod.ZodString;
|
|
||||||
valor: zod.ZodAny;
|
|
||||||
operador: zod.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}>, "many">>;
|
|
||||||
descricao_pelo_usuario: zod.ZodOptional<zod.ZodString>;
|
|
||||||
}>, "strip", zod.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
classes: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
classes: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
}>;
|
|
||||||
z_tabela: zod.ZodObject<zod.objectUtil.extendShape<{
|
|
||||||
colunas: zod.ZodArray<zod.ZodString, "many">;
|
|
||||||
coluna_ordem: zod.ZodOptional<zod.ZodString>;
|
|
||||||
direcao_ordem: zod.ZodOptional<zod.ZodEnum<["asc", "desc", "1", "-1"]>>;
|
|
||||||
}, {
|
|
||||||
tabela: zod.ZodString;
|
|
||||||
filtros: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
||||||
coluna: zod.ZodString;
|
|
||||||
valor: zod.ZodAny;
|
|
||||||
operador: zod.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}>, "many">>;
|
|
||||||
descricao_pelo_usuario: zod.ZodOptional<zod.ZodString>;
|
|
||||||
}>, "strip", zod.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
colunas: string[];
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
coluna_ordem?: string | undefined;
|
|
||||||
direcao_ordem?: "1" | "asc" | "desc" | "-1" | undefined;
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
colunas: string[];
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
coluna_ordem?: string | undefined;
|
|
||||||
direcao_ordem?: "1" | "asc" | "desc" | "-1" | undefined;
|
|
||||||
}>;
|
|
||||||
z_soma_em_barra_vertical: zod.ZodObject<zod.objectUtil.extendShape<{
|
|
||||||
colanuEixoX: zod.ZodString;
|
|
||||||
colunaSoma: zod.ZodString;
|
|
||||||
unidadeSoma: zod.ZodOptional<zod.ZodString>;
|
|
||||||
colunaAgrupamento: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
|
|
||||||
exibirComoPorcentagem: zod.ZodOptional<zod.ZodBoolean>;
|
|
||||||
}, {
|
|
||||||
tabela: zod.ZodString;
|
|
||||||
filtros: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
||||||
coluna: zod.ZodString;
|
|
||||||
valor: zod.ZodAny;
|
|
||||||
operador: zod.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}>, "many">>;
|
|
||||||
descricao_pelo_usuario: zod.ZodOptional<zod.ZodString>;
|
|
||||||
}>, "strip", zod.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
colanuEixoX: string;
|
|
||||||
colunaSoma: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
colunaAgrupamento?: string[] | undefined;
|
|
||||||
unidadeSoma?: string | undefined;
|
|
||||||
exibirComoPorcentagem?: boolean | undefined;
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
colanuEixoX: string;
|
|
||||||
colunaSoma: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
colunaAgrupamento?: string[] | undefined;
|
|
||||||
unidadeSoma?: string | undefined;
|
|
||||||
exibirComoPorcentagem?: boolean | undefined;
|
|
||||||
}>;
|
|
||||||
zp_deletar_registros: zod.ZodObject<{
|
|
||||||
tabela: zod.ZodString;
|
|
||||||
codigos: zod.ZodArray<zod.ZodString, "many">;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
codigos: string[];
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
codigos: string[];
|
|
||||||
}>;
|
|
||||||
zp_registrar_base_dados: zod.ZodObject<{
|
|
||||||
tabela: zod.ZodString;
|
|
||||||
colunas: zod.ZodArray<zod.ZodObject<{
|
|
||||||
coluna: zod.ZodString;
|
|
||||||
tipo: zod.ZodEnum<["texto", "numero", "confirmacao", "lista_texto", "lista_numero", "lista_mes", "lista_data", "mes", "data"]>;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
coluna: string;
|
|
||||||
tipo: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "lista_mes" | "lista_data" | "mes" | "data";
|
|
||||||
}, {
|
|
||||||
coluna: string;
|
|
||||||
tipo: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "lista_mes" | "lista_data" | "mes" | "data";
|
|
||||||
}>, "many">;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
colunas: {
|
|
||||||
coluna: string;
|
|
||||||
tipo: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "lista_mes" | "lista_data" | "mes" | "data";
|
|
||||||
}[];
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
colunas: {
|
|
||||||
coluna: string;
|
|
||||||
tipo: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "lista_mes" | "lista_data" | "mes" | "data";
|
|
||||||
}[];
|
|
||||||
}>;
|
|
||||||
z_tipos_dados_registro: zod.ZodEnum<["texto", "numero", "confirmacao", "lista_texto", "lista_numero", "lista_mes", "lista_data", "mes", "data"]>;
|
|
||||||
zp_enviar_registros: zod.ZodObject<{
|
|
||||||
tabela: zod.ZodString;
|
|
||||||
registros: zod.ZodArray<zod.ZodRecord<zod.ZodString, zod.ZodObject<{
|
|
||||||
valor: zod.ZodAny;
|
|
||||||
tipo: zod.ZodNullable<zod.ZodOptional<zod.ZodEnum<["texto", "numero", "confirmacao", "lista_texto", "lista_numero", "lista_mes", "lista_data", "mes", "data"]>>>;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
valor?: any;
|
|
||||||
tipo?: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "lista_mes" | "lista_data" | "mes" | "data" | null | undefined;
|
|
||||||
}, {
|
|
||||||
valor?: any;
|
|
||||||
tipo?: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "lista_mes" | "lista_data" | "mes" | "data" | null | undefined;
|
|
||||||
}>>, "many">;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
registros: Record<string, {
|
|
||||||
valor?: any;
|
|
||||||
tipo?: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "lista_mes" | "lista_data" | "mes" | "data" | null | undefined;
|
|
||||||
}>[];
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
registros: Record<string, {
|
|
||||||
valor?: any;
|
|
||||||
tipo?: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "lista_mes" | "lista_data" | "mes" | "data" | null | undefined;
|
|
||||||
}>[];
|
|
||||||
}>;
|
|
||||||
zp_produto_conta: zod.ZodObject<{
|
|
||||||
produto: zod.ZodString;
|
|
||||||
conta: zod.ZodString;
|
|
||||||
emDesenvolvimento: zod.ZodOptional<zod.ZodBoolean>;
|
|
||||||
ver_log: zod.ZodOptional<zod.ZodBoolean>;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
produto: string;
|
|
||||||
conta: string;
|
|
||||||
emDesenvolvimento?: boolean | undefined;
|
|
||||||
ver_log?: boolean | undefined;
|
|
||||||
}, {
|
|
||||||
produto: string;
|
|
||||||
conta: string;
|
|
||||||
emDesenvolvimento?: boolean | undefined;
|
|
||||||
ver_log?: boolean | undefined;
|
|
||||||
}>;
|
|
||||||
validarZ: <T>(zodType: zod.ZodType<T, any>, objeto: any, mensagem: string) => p_respostas.tipoRespostaErro | p_respostas.tipoRespostaSucesso<T>;
|
|
||||||
operadores_pilao: zod.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
|
||||||
operadores_permitidos_por_tipo: {
|
|
||||||
texto: ("=" | "!=" | ">" | "<" | ">=" | "<=" | "∩")[];
|
|
||||||
numero: ("=" | "!=" | ">" | "<" | ">=" | "<=" | "∩")[];
|
|
||||||
confirmacao: ("=" | "!=" | ">" | "<" | ">=" | "<=" | "∩")[];
|
|
||||||
lista_texto: ("=" | "!=" | ">" | "<" | ">=" | "<=" | "∩")[];
|
|
||||||
lista_numero: ("=" | "!=" | ">" | "<" | ">=" | "<=" | "∩")[];
|
|
||||||
lista_mes: ("=" | "!=" | ">" | "<" | ">=" | "<=" | "∩")[];
|
|
||||||
lista_data: ("=" | "!=" | ">" | "<" | ">=" | "<=" | "∩")[];
|
|
||||||
mes: ("=" | "!=" | ">" | "<" | ">=" | "<=" | "∩")[];
|
|
||||||
data: ("=" | "!=" | ">" | "<" | ">=" | "<=" | "∩")[];
|
|
||||||
};
|
|
||||||
z_filtro: zod.ZodObject<{
|
|
||||||
coluna: zod.ZodString;
|
|
||||||
valor: zod.ZodAny;
|
|
||||||
operador: zod.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}>;
|
|
||||||
visoes_pilao: {
|
|
||||||
z_contagem_em_barra_vertical: zod.ZodObject<zod.objectUtil.extendShape<{
|
|
||||||
colanuEixoX: zod.ZodString;
|
|
||||||
colunaAgrupamento: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
|
|
||||||
}, {
|
|
||||||
tabela: zod.ZodString;
|
|
||||||
filtros: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
||||||
coluna: zod.ZodString;
|
|
||||||
valor: zod.ZodAny;
|
|
||||||
operador: zod.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}>, "many">>;
|
|
||||||
descricao_pelo_usuario: zod.ZodOptional<zod.ZodString>;
|
|
||||||
}>, "strip", zod.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
colanuEixoX: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
colunaAgrupamento?: string[] | undefined;
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
colanuEixoX: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
colunaAgrupamento?: string[] | undefined;
|
|
||||||
}>;
|
|
||||||
z_contagem_em_pizza: zod.ZodObject<zod.objectUtil.extendShape<{
|
|
||||||
classes: zod.ZodString;
|
|
||||||
}, {
|
|
||||||
tabela: zod.ZodString;
|
|
||||||
filtros: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
||||||
coluna: zod.ZodString;
|
|
||||||
valor: zod.ZodAny;
|
|
||||||
operador: zod.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}>, "many">>;
|
|
||||||
descricao_pelo_usuario: zod.ZodOptional<zod.ZodString>;
|
|
||||||
}>, "strip", zod.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
classes: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
classes: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
}>;
|
|
||||||
z_tabela: zod.ZodObject<zod.objectUtil.extendShape<{
|
|
||||||
colunas: zod.ZodArray<zod.ZodString, "many">;
|
|
||||||
coluna_ordem: zod.ZodOptional<zod.ZodString>;
|
|
||||||
direcao_ordem: zod.ZodOptional<zod.ZodEnum<["asc", "desc", "1", "-1"]>>;
|
|
||||||
}, {
|
|
||||||
tabela: zod.ZodString;
|
|
||||||
filtros: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
||||||
coluna: zod.ZodString;
|
|
||||||
valor: zod.ZodAny;
|
|
||||||
operador: zod.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}>, "many">>;
|
|
||||||
descricao_pelo_usuario: zod.ZodOptional<zod.ZodString>;
|
|
||||||
}>, "strip", zod.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
colunas: string[];
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
coluna_ordem?: string | undefined;
|
|
||||||
direcao_ordem?: "1" | "asc" | "desc" | "-1" | undefined;
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
colunas: string[];
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
coluna_ordem?: string | undefined;
|
|
||||||
direcao_ordem?: "1" | "asc" | "desc" | "-1" | undefined;
|
|
||||||
}>;
|
|
||||||
z_soma_em_barra_vertical: zod.ZodObject<zod.objectUtil.extendShape<{
|
|
||||||
colanuEixoX: zod.ZodString;
|
|
||||||
colunaSoma: zod.ZodString;
|
|
||||||
unidadeSoma: zod.ZodOptional<zod.ZodString>;
|
|
||||||
colunaAgrupamento: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
|
|
||||||
exibirComoPorcentagem: zod.ZodOptional<zod.ZodBoolean>;
|
|
||||||
}, {
|
|
||||||
tabela: zod.ZodString;
|
|
||||||
filtros: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
||||||
coluna: zod.ZodString;
|
|
||||||
valor: zod.ZodAny;
|
|
||||||
operador: zod.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}>, "many">>;
|
|
||||||
descricao_pelo_usuario: zod.ZodOptional<zod.ZodString>;
|
|
||||||
}>, "strip", zod.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
colanuEixoX: string;
|
|
||||||
colunaSoma: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
colunaAgrupamento?: string[] | undefined;
|
|
||||||
unidadeSoma?: string | undefined;
|
|
||||||
exibirComoPorcentagem?: boolean | undefined;
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
colanuEixoX: string;
|
|
||||||
colunaSoma: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
colunaAgrupamento?: string[] | undefined;
|
|
||||||
unidadeSoma?: string | undefined;
|
|
||||||
exibirComoPorcentagem?: boolean | undefined;
|
|
||||||
}>;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
/** Estrutura que deve ser aplicada para solictação de autenticação, deve ser feito via back */
|
/** Estrutura que deve ser aplicada para solictação de autenticação, deve ser feito via back */
|
||||||
declare const zAuntenticacaoResiduosSolicitar: z.ZodObject<{
|
declare const zAuntenticacaoResiduosSolicitar: z.ZodObject<{
|
||||||
|
|
@ -1058,4 +159,4 @@ declare const abrirNps: (emDesenvolvimento: boolean) => (parametros: tipo_proxim
|
||||||
declare const inquilinoStatus: z.ZodEnum<["ativo", "inativo"]>;
|
declare const inquilinoStatus: z.ZodEnum<["ativo", "inativo"]>;
|
||||||
declare const statusinquilino: z.ZodEnum<["ativo", "inativo"]>;
|
declare const statusinquilino: z.ZodEnum<["ativo", "inativo"]>;
|
||||||
|
|
||||||
export { ClassPilao, PREFIXO_PILAO, Pilao, abrirNps, inquilinoStatus, nomesSincronizacoes, type nomesVisoes, pPilao, pilao_enderecos, type retornoSerieConsultar, statusinquilino, type tipoConstrutorPilao, type tipoRetornoSerieconsulta, type tipo_pilao_api, type tipo_proxima_avaliacao, type tipo_zUsuarioSincronizar, urlPilao, zAuntenticacaoResiduosSolicitar, zEmpreendedorSincronizar, zEmpreendimentoSincronizar, zUsuarioSincronizar, type z_tipagem_registros };
|
export { abrirNps, inquilinoStatus, nomesSincronizacoes, statusinquilino, type tipo_proxima_avaliacao, type tipo_zUsuarioSincronizar, zAuntenticacaoResiduosSolicitar, zEmpreendedorSincronizar, zEmpreendimentoSincronizar, zUsuarioSincronizar };
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
903
dist-require/index.d.ts
vendored
903
dist-require/index.d.ts
vendored
|
|
@ -1,904 +1,5 @@
|
||||||
import * as p_respostas from 'p-respostas';
|
|
||||||
import { tipoResposta } from 'p-respostas';
|
|
||||||
import * as zod from 'zod';
|
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
import { tipoResposta } from 'p-respostas';
|
||||||
/** aplica a todas as consultas */
|
|
||||||
declare const z_padroes: z.ZodObject<{
|
|
||||||
tabela: z.ZodString;
|
|
||||||
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">>;
|
|
||||||
descricao_pelo_usuario: z.ZodOptional<z.ZodString>;
|
|
||||||
}, "strip", z.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
}>;
|
|
||||||
declare const visoes_pilao: {
|
|
||||||
z_contagem_em_barra_vertical: z.ZodObject<z.objectUtil.extendShape<{
|
|
||||||
colanuEixoX: z.ZodString;
|
|
||||||
colunaAgrupamento: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
||||||
}, {
|
|
||||||
tabela: z.ZodString;
|
|
||||||
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">>;
|
|
||||||
descricao_pelo_usuario: z.ZodOptional<z.ZodString>;
|
|
||||||
}>, "strip", z.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
colanuEixoX: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
colunaAgrupamento?: string[] | undefined;
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
colanuEixoX: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
colunaAgrupamento?: string[] | undefined;
|
|
||||||
}>;
|
|
||||||
z_contagem_em_pizza: z.ZodObject<z.objectUtil.extendShape<{
|
|
||||||
classes: z.ZodString;
|
|
||||||
}, {
|
|
||||||
tabela: z.ZodString;
|
|
||||||
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">>;
|
|
||||||
descricao_pelo_usuario: z.ZodOptional<z.ZodString>;
|
|
||||||
}>, "strip", z.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
classes: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
classes: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
}>;
|
|
||||||
z_tabela: z.ZodObject<z.objectUtil.extendShape<{
|
|
||||||
colunas: z.ZodArray<z.ZodString, "many">;
|
|
||||||
coluna_ordem: z.ZodOptional<z.ZodString>;
|
|
||||||
direcao_ordem: z.ZodOptional<z.ZodEnum<["asc", "desc", "1", "-1"]>>;
|
|
||||||
}, {
|
|
||||||
tabela: z.ZodString;
|
|
||||||
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">>;
|
|
||||||
descricao_pelo_usuario: z.ZodOptional<z.ZodString>;
|
|
||||||
}>, "strip", z.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
colunas: string[];
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
coluna_ordem?: string | undefined;
|
|
||||||
direcao_ordem?: "1" | "asc" | "desc" | "-1" | undefined;
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
colunas: string[];
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
coluna_ordem?: string | undefined;
|
|
||||||
direcao_ordem?: "1" | "asc" | "desc" | "-1" | undefined;
|
|
||||||
}>;
|
|
||||||
z_soma_em_barra_vertical: z.ZodObject<z.objectUtil.extendShape<{
|
|
||||||
colanuEixoX: z.ZodString;
|
|
||||||
colunaSoma: z.ZodString;
|
|
||||||
unidadeSoma: z.ZodOptional<z.ZodString>;
|
|
||||||
colunaAgrupamento: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
||||||
exibirComoPorcentagem: z.ZodOptional<z.ZodBoolean>;
|
|
||||||
}, {
|
|
||||||
tabela: z.ZodString;
|
|
||||||
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">>;
|
|
||||||
descricao_pelo_usuario: z.ZodOptional<z.ZodString>;
|
|
||||||
}>, "strip", z.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
colanuEixoX: string;
|
|
||||||
colunaSoma: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
colunaAgrupamento?: string[] | undefined;
|
|
||||||
unidadeSoma?: string | undefined;
|
|
||||||
exibirComoPorcentagem?: boolean | undefined;
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
colanuEixoX: string;
|
|
||||||
colunaSoma: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
colunaAgrupamento?: string[] | undefined;
|
|
||||||
unidadeSoma?: string | undefined;
|
|
||||||
exibirComoPorcentagem?: boolean | undefined;
|
|
||||||
}>;
|
|
||||||
};
|
|
||||||
|
|
||||||
declare const z_tipos_campos_reg_grafico: z.ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros", "ordem", "booleana"]>;
|
|
||||||
type tipo_estrutura_visao_grafico<T extends keyof typeof visoes_pilao> = {
|
|
||||||
/** Nome da Visão */
|
|
||||||
visao: T;
|
|
||||||
/** Rotulo */
|
|
||||||
rotulo: string;
|
|
||||||
/** Retorna a tabela Referente ao Registro */
|
|
||||||
tabela: (_: z.infer<(typeof visoes_pilao)[T]> & z.infer<typeof z_padroes>) => string;
|
|
||||||
/** Descrição */
|
|
||||||
descricao: (_: z.infer<(typeof visoes_pilao)[T]> & z.infer<typeof z_padroes>) => string;
|
|
||||||
/** Lista os campos e suas configurações */
|
|
||||||
campos: {
|
|
||||||
[c in keyof Required<z.infer<(typeof visoes_pilao)[T]> & z.infer<typeof z_padroes>>]: {
|
|
||||||
rotulo: string;
|
|
||||||
tipo_campo: z.infer<typeof z_tipos_campos_reg_grafico>;
|
|
||||||
order: number;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
declare const zp_deletar_registros: z.ZodObject<{
|
|
||||||
tabela: z.ZodString;
|
|
||||||
codigos: z.ZodArray<z.ZodString, "many">;
|
|
||||||
}, "strip", z.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
codigos: string[];
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
codigos: string[];
|
|
||||||
}>;
|
|
||||||
declare const PREFIXO_PILAO = "/pilao-de-dados";
|
|
||||||
declare const urlPilao: (emDesenvolvimento?: boolean | null | undefined) => {
|
|
||||||
api: string;
|
|
||||||
site: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
declare const zp_registrar_base_dados: z.ZodObject<{
|
|
||||||
tabela: z.ZodString;
|
|
||||||
colunas: z.ZodArray<z.ZodObject<{
|
|
||||||
coluna: z.ZodString;
|
|
||||||
tipo: z.ZodEnum<["texto", "numero", "confirmacao", "lista_texto", "lista_numero", "lista_mes", "lista_data", "mes", "data"]>;
|
|
||||||
}, "strip", z.ZodTypeAny, {
|
|
||||||
coluna: string;
|
|
||||||
tipo: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "lista_mes" | "lista_data" | "mes" | "data";
|
|
||||||
}, {
|
|
||||||
coluna: string;
|
|
||||||
tipo: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "lista_mes" | "lista_data" | "mes" | "data";
|
|
||||||
}>, "many">;
|
|
||||||
}, "strip", z.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
colunas: {
|
|
||||||
coluna: string;
|
|
||||||
tipo: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "lista_mes" | "lista_data" | "mes" | "data";
|
|
||||||
}[];
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
colunas: {
|
|
||||||
coluna: string;
|
|
||||||
tipo: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "lista_mes" | "lista_data" | "mes" | "data";
|
|
||||||
}[];
|
|
||||||
}>;
|
|
||||||
declare const zp_enviar_registros: z.ZodObject<{
|
|
||||||
tabela: z.ZodString;
|
|
||||||
registros: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
||||||
valor: z.ZodAny;
|
|
||||||
tipo: z.ZodNullable<z.ZodOptional<z.ZodEnum<["texto", "numero", "confirmacao", "lista_texto", "lista_numero", "lista_mes", "lista_data", "mes", "data"]>>>;
|
|
||||||
}, "strip", z.ZodTypeAny, {
|
|
||||||
valor?: any;
|
|
||||||
tipo?: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "lista_mes" | "lista_data" | "mes" | "data" | null | undefined;
|
|
||||||
}, {
|
|
||||||
valor?: any;
|
|
||||||
tipo?: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "lista_mes" | "lista_data" | "mes" | "data" | null | undefined;
|
|
||||||
}>>, "many">;
|
|
||||||
}, "strip", z.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
registros: Record<string, {
|
|
||||||
valor?: any;
|
|
||||||
tipo?: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "lista_mes" | "lista_data" | "mes" | "data" | null | undefined;
|
|
||||||
}>[];
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
registros: Record<string, {
|
|
||||||
valor?: any;
|
|
||||||
tipo?: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "lista_mes" | "lista_data" | "mes" | "data" | null | undefined;
|
|
||||||
}>[];
|
|
||||||
}>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {
|
|
||||||
* 'rota':{
|
|
||||||
* pr:{}// paramentros de entrada
|
|
||||||
* rs:{}// resposta
|
|
||||||
* }
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
type tipo_pilao_api = {
|
|
||||||
/** retorna da data e hora do servido em formato iso */
|
|
||||||
estado_servidor: {
|
|
||||||
pr: {};
|
|
||||||
rs: {
|
|
||||||
data_hora: string;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
tabelas: {
|
|
||||||
pr: {};
|
|
||||||
rs: z.infer<typeof zp_registrar_base_dados>[];
|
|
||||||
};
|
|
||||||
unicos: {
|
|
||||||
pr: {
|
|
||||||
tabela: string;
|
|
||||||
coluna: string;
|
|
||||||
};
|
|
||||||
rs: any[];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
type tipoConstrutorPilao = {
|
|
||||||
produto: string;
|
|
||||||
conta: string;
|
|
||||||
};
|
|
||||||
type z_tipagem_registros = {
|
|
||||||
z_contagem_em_barra_vertical: {
|
|
||||||
contagem: number;
|
|
||||||
[k: string]: any;
|
|
||||||
}[];
|
|
||||||
z_contagem_em_pizza: {
|
|
||||||
contagem: number;
|
|
||||||
[k: string]: any;
|
|
||||||
}[];
|
|
||||||
z_tabela: {
|
|
||||||
[k: string]: any;
|
|
||||||
}[];
|
|
||||||
z_soma_em_barra_vertical: {
|
|
||||||
soma: number;
|
|
||||||
[k: string]: any;
|
|
||||||
}[];
|
|
||||||
z_porcentagem_soma_em_barra_vertical: {
|
|
||||||
porcentagem: number;
|
|
||||||
[k: string]: any;
|
|
||||||
}[];
|
|
||||||
};
|
|
||||||
type tipoRetornoSerieconsulta<T extends keyof typeof visoes_pilao> = {
|
|
||||||
registros: z_tipagem_registros[T];
|
|
||||||
legenda: string;
|
|
||||||
serie: z.infer<(typeof visoes_pilao)[T]> & z.infer<typeof z_padroes>;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** Drive completo do piilão de dados */
|
|
||||||
|
|
||||||
declare enum pilao_enderecos {
|
|
||||||
"enviar-registros" = "enviar-registros",
|
|
||||||
"deletar-registros" = "deletar-registros",
|
|
||||||
"consultar-serie" = "consultar-serie",
|
|
||||||
laboratório = "laborat\u00F3rio"
|
|
||||||
}
|
|
||||||
type nomesVisoes = keyof typeof visoes_pilao;
|
|
||||||
type retornoSerieConsultar<T extends nomesVisoes> = {
|
|
||||||
dados: () => Promise<tipoResposta<tipoRetornoSerieconsulta<T>>>;
|
|
||||||
url: () => string;
|
|
||||||
};
|
|
||||||
declare class ClassPilao {
|
|
||||||
#private;
|
|
||||||
constructor({ conta, produto, emDesenvolvimento, ver_log, }: tipoConstrutorPilao & {
|
|
||||||
ver_log?: boolean;
|
|
||||||
emDesenvolvimento?: boolean;
|
|
||||||
});
|
|
||||||
rotaEnviarRegistros(): {
|
|
||||||
rota: string;
|
|
||||||
url: URL;
|
|
||||||
};
|
|
||||||
rotaDeletarRegistro(): {
|
|
||||||
rota: string;
|
|
||||||
url: URL;
|
|
||||||
};
|
|
||||||
rotaConsultarSerie(): {
|
|
||||||
rota: string;
|
|
||||||
url: URL;
|
|
||||||
};
|
|
||||||
rotaIframeSerie(tipoVisao: nomesVisoes | ":tipoVisao"): {
|
|
||||||
rota: string;
|
|
||||||
url: string;
|
|
||||||
};
|
|
||||||
rotaFuncaoApi(funcao: keyof tipo_pilao_api | ":funcao"): {
|
|
||||||
rota: string;
|
|
||||||
url: URL;
|
|
||||||
};
|
|
||||||
consultarApi<T extends keyof tipo_pilao_api>(funcao: T, parametros: tipo_pilao_api[T]["pr"]): Promise<tipoResposta<tipo_pilao_api[T]["rs"]>>;
|
|
||||||
get baseUrlApi(): "https://carro-de-boi.idz.one" | "http://localhost:5080";
|
|
||||||
get baseUrlSite(): "https://carro-de-boi.idz.one" | "http://localhost:5081";
|
|
||||||
validarCliente(_: any): tipoResposta<tipoConstrutorPilao>;
|
|
||||||
adicionarRegistroParaEnviar(tabela: string, ...registros: z.infer<typeof zp_enviar_registros>["registros"]): this;
|
|
||||||
adicionarCodigoParaDeletar(tabela: string, ...codigos: z.infer<typeof zp_deletar_registros>["codigos"]): this;
|
|
||||||
private processarRegistros;
|
|
||||||
enviarRegistros(): Promise<tipoResposta<true>>;
|
|
||||||
serieConsultar<T extends nomesVisoes>(tipoVisao: T, parametros_: z.infer<(typeof visoes_pilao)[T]> & z.infer<typeof z_padroes>, padroes?: Pick<z.infer<typeof z_padroes>, "descricao_pelo_usuario">): retornoSerieConsultar<T>;
|
|
||||||
urlLaboratorio(): {
|
|
||||||
rota: string;
|
|
||||||
url: string;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
declare const Pilao: (_: tipoConstrutorPilao & {
|
|
||||||
ver_log?: boolean;
|
|
||||||
emDesenvolvimento?: boolean;
|
|
||||||
}) => ClassPilao;
|
|
||||||
|
|
||||||
declare const pPilao: {
|
|
||||||
extruturas_de_campos: {
|
|
||||||
z_contagem_em_barra_vertical: tipo_estrutura_visao_grafico<"z_contagem_em_barra_vertical">;
|
|
||||||
z_contagem_em_pizza: tipo_estrutura_visao_grafico<"z_contagem_em_pizza">;
|
|
||||||
z_tabela: tipo_estrutura_visao_grafico<"z_tabela">;
|
|
||||||
z_soma_em_barra_vertical: tipo_estrutura_visao_grafico<"z_soma_em_barra_vertical">;
|
|
||||||
};
|
|
||||||
z_padroes: zod.ZodObject<{
|
|
||||||
tabela: zod.ZodString;
|
|
||||||
filtros: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
||||||
coluna: zod.ZodString;
|
|
||||||
valor: zod.ZodAny;
|
|
||||||
operador: zod.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}>, "many">>;
|
|
||||||
descricao_pelo_usuario: zod.ZodOptional<zod.ZodString>;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
}>;
|
|
||||||
pilao_enderecos: typeof pilao_enderecos;
|
|
||||||
z_contagem_em_barra_vertical: zod.ZodObject<zod.objectUtil.extendShape<{
|
|
||||||
colanuEixoX: zod.ZodString;
|
|
||||||
colunaAgrupamento: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
|
|
||||||
}, {
|
|
||||||
tabela: zod.ZodString;
|
|
||||||
filtros: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
||||||
coluna: zod.ZodString;
|
|
||||||
valor: zod.ZodAny;
|
|
||||||
operador: zod.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}>, "many">>;
|
|
||||||
descricao_pelo_usuario: zod.ZodOptional<zod.ZodString>;
|
|
||||||
}>, "strip", zod.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
colanuEixoX: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
colunaAgrupamento?: string[] | undefined;
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
colanuEixoX: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
colunaAgrupamento?: string[] | undefined;
|
|
||||||
}>;
|
|
||||||
z_contagem_em_pizza: zod.ZodObject<zod.objectUtil.extendShape<{
|
|
||||||
classes: zod.ZodString;
|
|
||||||
}, {
|
|
||||||
tabela: zod.ZodString;
|
|
||||||
filtros: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
||||||
coluna: zod.ZodString;
|
|
||||||
valor: zod.ZodAny;
|
|
||||||
operador: zod.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}>, "many">>;
|
|
||||||
descricao_pelo_usuario: zod.ZodOptional<zod.ZodString>;
|
|
||||||
}>, "strip", zod.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
classes: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
classes: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
}>;
|
|
||||||
z_tabela: zod.ZodObject<zod.objectUtil.extendShape<{
|
|
||||||
colunas: zod.ZodArray<zod.ZodString, "many">;
|
|
||||||
coluna_ordem: zod.ZodOptional<zod.ZodString>;
|
|
||||||
direcao_ordem: zod.ZodOptional<zod.ZodEnum<["asc", "desc", "1", "-1"]>>;
|
|
||||||
}, {
|
|
||||||
tabela: zod.ZodString;
|
|
||||||
filtros: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
||||||
coluna: zod.ZodString;
|
|
||||||
valor: zod.ZodAny;
|
|
||||||
operador: zod.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}>, "many">>;
|
|
||||||
descricao_pelo_usuario: zod.ZodOptional<zod.ZodString>;
|
|
||||||
}>, "strip", zod.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
colunas: string[];
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
coluna_ordem?: string | undefined;
|
|
||||||
direcao_ordem?: "1" | "asc" | "desc" | "-1" | undefined;
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
colunas: string[];
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
coluna_ordem?: string | undefined;
|
|
||||||
direcao_ordem?: "1" | "asc" | "desc" | "-1" | undefined;
|
|
||||||
}>;
|
|
||||||
z_soma_em_barra_vertical: zod.ZodObject<zod.objectUtil.extendShape<{
|
|
||||||
colanuEixoX: zod.ZodString;
|
|
||||||
colunaSoma: zod.ZodString;
|
|
||||||
unidadeSoma: zod.ZodOptional<zod.ZodString>;
|
|
||||||
colunaAgrupamento: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
|
|
||||||
exibirComoPorcentagem: zod.ZodOptional<zod.ZodBoolean>;
|
|
||||||
}, {
|
|
||||||
tabela: zod.ZodString;
|
|
||||||
filtros: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
||||||
coluna: zod.ZodString;
|
|
||||||
valor: zod.ZodAny;
|
|
||||||
operador: zod.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}>, "many">>;
|
|
||||||
descricao_pelo_usuario: zod.ZodOptional<zod.ZodString>;
|
|
||||||
}>, "strip", zod.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
colanuEixoX: string;
|
|
||||||
colunaSoma: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
colunaAgrupamento?: string[] | undefined;
|
|
||||||
unidadeSoma?: string | undefined;
|
|
||||||
exibirComoPorcentagem?: boolean | undefined;
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
colanuEixoX: string;
|
|
||||||
colunaSoma: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
colunaAgrupamento?: string[] | undefined;
|
|
||||||
unidadeSoma?: string | undefined;
|
|
||||||
exibirComoPorcentagem?: boolean | undefined;
|
|
||||||
}>;
|
|
||||||
zp_deletar_registros: zod.ZodObject<{
|
|
||||||
tabela: zod.ZodString;
|
|
||||||
codigos: zod.ZodArray<zod.ZodString, "many">;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
codigos: string[];
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
codigos: string[];
|
|
||||||
}>;
|
|
||||||
zp_registrar_base_dados: zod.ZodObject<{
|
|
||||||
tabela: zod.ZodString;
|
|
||||||
colunas: zod.ZodArray<zod.ZodObject<{
|
|
||||||
coluna: zod.ZodString;
|
|
||||||
tipo: zod.ZodEnum<["texto", "numero", "confirmacao", "lista_texto", "lista_numero", "lista_mes", "lista_data", "mes", "data"]>;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
coluna: string;
|
|
||||||
tipo: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "lista_mes" | "lista_data" | "mes" | "data";
|
|
||||||
}, {
|
|
||||||
coluna: string;
|
|
||||||
tipo: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "lista_mes" | "lista_data" | "mes" | "data";
|
|
||||||
}>, "many">;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
colunas: {
|
|
||||||
coluna: string;
|
|
||||||
tipo: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "lista_mes" | "lista_data" | "mes" | "data";
|
|
||||||
}[];
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
colunas: {
|
|
||||||
coluna: string;
|
|
||||||
tipo: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "lista_mes" | "lista_data" | "mes" | "data";
|
|
||||||
}[];
|
|
||||||
}>;
|
|
||||||
z_tipos_dados_registro: zod.ZodEnum<["texto", "numero", "confirmacao", "lista_texto", "lista_numero", "lista_mes", "lista_data", "mes", "data"]>;
|
|
||||||
zp_enviar_registros: zod.ZodObject<{
|
|
||||||
tabela: zod.ZodString;
|
|
||||||
registros: zod.ZodArray<zod.ZodRecord<zod.ZodString, zod.ZodObject<{
|
|
||||||
valor: zod.ZodAny;
|
|
||||||
tipo: zod.ZodNullable<zod.ZodOptional<zod.ZodEnum<["texto", "numero", "confirmacao", "lista_texto", "lista_numero", "lista_mes", "lista_data", "mes", "data"]>>>;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
valor?: any;
|
|
||||||
tipo?: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "lista_mes" | "lista_data" | "mes" | "data" | null | undefined;
|
|
||||||
}, {
|
|
||||||
valor?: any;
|
|
||||||
tipo?: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "lista_mes" | "lista_data" | "mes" | "data" | null | undefined;
|
|
||||||
}>>, "many">;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
registros: Record<string, {
|
|
||||||
valor?: any;
|
|
||||||
tipo?: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "lista_mes" | "lista_data" | "mes" | "data" | null | undefined;
|
|
||||||
}>[];
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
registros: Record<string, {
|
|
||||||
valor?: any;
|
|
||||||
tipo?: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "lista_mes" | "lista_data" | "mes" | "data" | null | undefined;
|
|
||||||
}>[];
|
|
||||||
}>;
|
|
||||||
zp_produto_conta: zod.ZodObject<{
|
|
||||||
produto: zod.ZodString;
|
|
||||||
conta: zod.ZodString;
|
|
||||||
emDesenvolvimento: zod.ZodOptional<zod.ZodBoolean>;
|
|
||||||
ver_log: zod.ZodOptional<zod.ZodBoolean>;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
produto: string;
|
|
||||||
conta: string;
|
|
||||||
emDesenvolvimento?: boolean | undefined;
|
|
||||||
ver_log?: boolean | undefined;
|
|
||||||
}, {
|
|
||||||
produto: string;
|
|
||||||
conta: string;
|
|
||||||
emDesenvolvimento?: boolean | undefined;
|
|
||||||
ver_log?: boolean | undefined;
|
|
||||||
}>;
|
|
||||||
validarZ: <T>(zodType: zod.ZodType<T, any>, objeto: any, mensagem: string) => p_respostas.tipoRespostaErro | p_respostas.tipoRespostaSucesso<T>;
|
|
||||||
operadores_pilao: zod.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
|
||||||
operadores_permitidos_por_tipo: {
|
|
||||||
texto: ("=" | "!=" | ">" | "<" | ">=" | "<=" | "∩")[];
|
|
||||||
numero: ("=" | "!=" | ">" | "<" | ">=" | "<=" | "∩")[];
|
|
||||||
confirmacao: ("=" | "!=" | ">" | "<" | ">=" | "<=" | "∩")[];
|
|
||||||
lista_texto: ("=" | "!=" | ">" | "<" | ">=" | "<=" | "∩")[];
|
|
||||||
lista_numero: ("=" | "!=" | ">" | "<" | ">=" | "<=" | "∩")[];
|
|
||||||
lista_mes: ("=" | "!=" | ">" | "<" | ">=" | "<=" | "∩")[];
|
|
||||||
lista_data: ("=" | "!=" | ">" | "<" | ">=" | "<=" | "∩")[];
|
|
||||||
mes: ("=" | "!=" | ">" | "<" | ">=" | "<=" | "∩")[];
|
|
||||||
data: ("=" | "!=" | ">" | "<" | ">=" | "<=" | "∩")[];
|
|
||||||
};
|
|
||||||
z_filtro: zod.ZodObject<{
|
|
||||||
coluna: zod.ZodString;
|
|
||||||
valor: zod.ZodAny;
|
|
||||||
operador: zod.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}>;
|
|
||||||
visoes_pilao: {
|
|
||||||
z_contagem_em_barra_vertical: zod.ZodObject<zod.objectUtil.extendShape<{
|
|
||||||
colanuEixoX: zod.ZodString;
|
|
||||||
colunaAgrupamento: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
|
|
||||||
}, {
|
|
||||||
tabela: zod.ZodString;
|
|
||||||
filtros: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
||||||
coluna: zod.ZodString;
|
|
||||||
valor: zod.ZodAny;
|
|
||||||
operador: zod.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}>, "many">>;
|
|
||||||
descricao_pelo_usuario: zod.ZodOptional<zod.ZodString>;
|
|
||||||
}>, "strip", zod.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
colanuEixoX: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
colunaAgrupamento?: string[] | undefined;
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
colanuEixoX: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
colunaAgrupamento?: string[] | undefined;
|
|
||||||
}>;
|
|
||||||
z_contagem_em_pizza: zod.ZodObject<zod.objectUtil.extendShape<{
|
|
||||||
classes: zod.ZodString;
|
|
||||||
}, {
|
|
||||||
tabela: zod.ZodString;
|
|
||||||
filtros: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
||||||
coluna: zod.ZodString;
|
|
||||||
valor: zod.ZodAny;
|
|
||||||
operador: zod.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}>, "many">>;
|
|
||||||
descricao_pelo_usuario: zod.ZodOptional<zod.ZodString>;
|
|
||||||
}>, "strip", zod.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
classes: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
classes: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
}>;
|
|
||||||
z_tabela: zod.ZodObject<zod.objectUtil.extendShape<{
|
|
||||||
colunas: zod.ZodArray<zod.ZodString, "many">;
|
|
||||||
coluna_ordem: zod.ZodOptional<zod.ZodString>;
|
|
||||||
direcao_ordem: zod.ZodOptional<zod.ZodEnum<["asc", "desc", "1", "-1"]>>;
|
|
||||||
}, {
|
|
||||||
tabela: zod.ZodString;
|
|
||||||
filtros: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
||||||
coluna: zod.ZodString;
|
|
||||||
valor: zod.ZodAny;
|
|
||||||
operador: zod.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}>, "many">>;
|
|
||||||
descricao_pelo_usuario: zod.ZodOptional<zod.ZodString>;
|
|
||||||
}>, "strip", zod.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
colunas: string[];
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
coluna_ordem?: string | undefined;
|
|
||||||
direcao_ordem?: "1" | "asc" | "desc" | "-1" | undefined;
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
colunas: string[];
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
coluna_ordem?: string | undefined;
|
|
||||||
direcao_ordem?: "1" | "asc" | "desc" | "-1" | undefined;
|
|
||||||
}>;
|
|
||||||
z_soma_em_barra_vertical: zod.ZodObject<zod.objectUtil.extendShape<{
|
|
||||||
colanuEixoX: zod.ZodString;
|
|
||||||
colunaSoma: zod.ZodString;
|
|
||||||
unidadeSoma: zod.ZodOptional<zod.ZodString>;
|
|
||||||
colunaAgrupamento: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
|
|
||||||
exibirComoPorcentagem: zod.ZodOptional<zod.ZodBoolean>;
|
|
||||||
}, {
|
|
||||||
tabela: zod.ZodString;
|
|
||||||
filtros: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
||||||
coluna: zod.ZodString;
|
|
||||||
valor: zod.ZodAny;
|
|
||||||
operador: zod.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
|
||||||
}, "strip", zod.ZodTypeAny, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}, {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}>, "many">>;
|
|
||||||
descricao_pelo_usuario: zod.ZodOptional<zod.ZodString>;
|
|
||||||
}>, "strip", zod.ZodTypeAny, {
|
|
||||||
tabela: string;
|
|
||||||
colanuEixoX: string;
|
|
||||||
colunaSoma: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
colunaAgrupamento?: string[] | undefined;
|
|
||||||
unidadeSoma?: string | undefined;
|
|
||||||
exibirComoPorcentagem?: boolean | undefined;
|
|
||||||
}, {
|
|
||||||
tabela: string;
|
|
||||||
colanuEixoX: string;
|
|
||||||
colunaSoma: string;
|
|
||||||
filtros?: {
|
|
||||||
coluna: string;
|
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
|
||||||
valor?: any;
|
|
||||||
}[] | undefined;
|
|
||||||
descricao_pelo_usuario?: string | undefined;
|
|
||||||
colunaAgrupamento?: string[] | undefined;
|
|
||||||
unidadeSoma?: string | undefined;
|
|
||||||
exibirComoPorcentagem?: boolean | undefined;
|
|
||||||
}>;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
/** Estrutura que deve ser aplicada para solictação de autenticação, deve ser feito via back */
|
/** Estrutura que deve ser aplicada para solictação de autenticação, deve ser feito via back */
|
||||||
declare const zAuntenticacaoResiduosSolicitar: z.ZodObject<{
|
declare const zAuntenticacaoResiduosSolicitar: z.ZodObject<{
|
||||||
|
|
@ -1058,4 +159,4 @@ declare const abrirNps: (emDesenvolvimento: boolean) => (parametros: tipo_proxim
|
||||||
declare const inquilinoStatus: z.ZodEnum<["ativo", "inativo"]>;
|
declare const inquilinoStatus: z.ZodEnum<["ativo", "inativo"]>;
|
||||||
declare const statusinquilino: z.ZodEnum<["ativo", "inativo"]>;
|
declare const statusinquilino: z.ZodEnum<["ativo", "inativo"]>;
|
||||||
|
|
||||||
export { ClassPilao, PREFIXO_PILAO, Pilao, abrirNps, inquilinoStatus, nomesSincronizacoes, type nomesVisoes, pPilao, pilao_enderecos, type retornoSerieConsultar, statusinquilino, type tipoConstrutorPilao, type tipoRetornoSerieconsulta, type tipo_pilao_api, type tipo_proxima_avaliacao, type tipo_zUsuarioSincronizar, urlPilao, zAuntenticacaoResiduosSolicitar, zEmpreendedorSincronizar, zEmpreendimentoSincronizar, zUsuarioSincronizar, type z_tipagem_registros };
|
export { abrirNps, inquilinoStatus, nomesSincronizacoes, statusinquilino, type tipo_proxima_avaliacao, type tipo_zUsuarioSincronizar, zAuntenticacaoResiduosSolicitar, zEmpreendedorSincronizar, zEmpreendimentoSincronizar, zUsuarioSincronizar };
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "p-drives",
|
"name": "p-drives",
|
||||||
"version": "0.230.0",
|
"version": "0.231.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
export * from "./pilao-de-dados"
|
|
||||||
export * from "./residuos"
|
export * from "./residuos"
|
||||||
export * from "./NPS"
|
export * from "./NPS"
|
||||||
export * from "./variaveis"
|
export * from "./variaveis"
|
||||||
|
|
|
||||||
|
|
@ -1,311 +0,0 @@
|
||||||
/** Drive completo do piilão de dados */
|
|
||||||
|
|
||||||
import crossFetch from "cross-fetch"
|
|
||||||
import { nomeVariavel } from "p-comuns"
|
|
||||||
|
|
||||||
import { respostaComuns, type tipoResposta } from "p-respostas"
|
|
||||||
import type { z } from "zod"
|
|
||||||
|
|
||||||
import type { zp_enviar_registros } from "../_enviar_registros"
|
|
||||||
import { PREFIXO_PILAO, type zp_deletar_registros } from "../variaveis"
|
|
||||||
|
|
||||||
import type { visoes_pilao, z_padroes } from "../visoes/listaDeVisoes"
|
|
||||||
import type { tipo_pilao_api } from "./pilao-api.ts"
|
|
||||||
import type { tipoConstrutorPilao, tipoRetornoSerieconsulta } from "./tipagem"
|
|
||||||
|
|
||||||
export enum pilao_enderecos {
|
|
||||||
"enviar-registros" = "enviar-registros",
|
|
||||||
"deletar-registros" = "deletar-registros",
|
|
||||||
"consultar-serie" = "consultar-serie",
|
|
||||||
laboratório = "laboratório",
|
|
||||||
}
|
|
||||||
|
|
||||||
export type nomesVisoes = keyof typeof visoes_pilao
|
|
||||||
|
|
||||||
export type retornoSerieConsultar<T extends nomesVisoes> = {
|
|
||||||
dados: () => Promise<tipoResposta<tipoRetornoSerieconsulta<T>>>
|
|
||||||
url: () => string
|
|
||||||
}
|
|
||||||
|
|
||||||
export class ClassPilao {
|
|
||||||
#produto: string
|
|
||||||
#conta: string
|
|
||||||
#emDesenvolvimento: boolean
|
|
||||||
#ver_log: boolean
|
|
||||||
#registrosParaEnvio: Record<
|
|
||||||
string,
|
|
||||||
z.infer<typeof zp_enviar_registros>["registros"]
|
|
||||||
> = {}
|
|
||||||
#codigosParaDeletar: Record<
|
|
||||||
string,
|
|
||||||
z.infer<typeof zp_deletar_registros>["codigos"]
|
|
||||||
> = {}
|
|
||||||
|
|
||||||
constructor({
|
|
||||||
conta,
|
|
||||||
produto,
|
|
||||||
emDesenvolvimento = false,
|
|
||||||
ver_log = false,
|
|
||||||
}: tipoConstrutorPilao & { ver_log?: boolean; emDesenvolvimento?: boolean }) {
|
|
||||||
this.#produto = produto
|
|
||||||
this.#conta = conta
|
|
||||||
this.#emDesenvolvimento = emDesenvolvimento
|
|
||||||
this.#ver_log = ver_log
|
|
||||||
}
|
|
||||||
|
|
||||||
#gerarUrlApi(acao: string): { rota: string; url: URL } {
|
|
||||||
const rota = `${PREFIXO_PILAO}/api/${acao}/${this.#produto}/${this.#conta}`
|
|
||||||
const url = new URL(`${this.baseUrlApi}${rota}`)
|
|
||||||
return { rota, url }
|
|
||||||
}
|
|
||||||
|
|
||||||
#gerarUrlDrive(acao: string): { rota: string; url: URL } {
|
|
||||||
const rota = `${PREFIXO_PILAO}/${acao}/${this.#produto}/${this.#conta}`
|
|
||||||
const url = new URL(`${this.baseUrlApi}${rota}`)
|
|
||||||
return { rota, url }
|
|
||||||
}
|
|
||||||
|
|
||||||
rotaEnviarRegistros() {
|
|
||||||
return this.#gerarUrlDrive(pilao_enderecos["enviar-registros"])
|
|
||||||
}
|
|
||||||
|
|
||||||
rotaDeletarRegistro() {
|
|
||||||
return this.#gerarUrlDrive(pilao_enderecos["deletar-registros"])
|
|
||||||
}
|
|
||||||
|
|
||||||
rotaConsultarSerie() {
|
|
||||||
return this.#gerarUrlDrive(pilao_enderecos["consultar-serie"])
|
|
||||||
}
|
|
||||||
|
|
||||||
rotaIframeSerie(tipoVisao: nomesVisoes | ":tipoVisao") {
|
|
||||||
const rota = `${PREFIXO_PILAO}/${pilao_enderecos["consultar-serie"]}/${this.#produto}/${this.#conta}/${tipoVisao}`
|
|
||||||
const url = `${this.baseUrlSite}${rota}`
|
|
||||||
return { rota, url }
|
|
||||||
}
|
|
||||||
|
|
||||||
rotaFuncaoApi(funcao: keyof tipo_pilao_api | ":funcao") {
|
|
||||||
return this.#gerarUrlApi(funcao)
|
|
||||||
}
|
|
||||||
|
|
||||||
async consultarApi<T extends keyof tipo_pilao_api>(
|
|
||||||
funcao: T,
|
|
||||||
parametros: tipo_pilao_api[T]["pr"],
|
|
||||||
): Promise<tipoResposta<tipo_pilao_api[T]["rs"]>> {
|
|
||||||
try {
|
|
||||||
const response = await crossFetch(this.rotaFuncaoApi(funcao).url, {
|
|
||||||
body: JSON.stringify(parametros),
|
|
||||||
method: "POST",
|
|
||||||
headers: { "Content-Type": "application/json" },
|
|
||||||
})
|
|
||||||
|
|
||||||
const texto = await response.text()
|
|
||||||
|
|
||||||
try {
|
|
||||||
const json = JSON.parse(texto)
|
|
||||||
return json
|
|
||||||
} catch {
|
|
||||||
return respostaComuns.erro("Consulta não retornou json válido", [texto])
|
|
||||||
}
|
|
||||||
} catch (erro) {
|
|
||||||
console.error(erro)
|
|
||||||
return respostaComuns.erroInterno({
|
|
||||||
erro,
|
|
||||||
local: nomeVariavel({ ClassPilao }),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
get baseUrlApi() {
|
|
||||||
return this.#emDesenvolvimento
|
|
||||||
? "http://localhost:5080"
|
|
||||||
: "https://carro-de-boi.idz.one"
|
|
||||||
}
|
|
||||||
|
|
||||||
get baseUrlSite() {
|
|
||||||
return this.#emDesenvolvimento
|
|
||||||
? "http://localhost:5081"
|
|
||||||
: "https://carro-de-boi.idz.one"
|
|
||||||
}
|
|
||||||
|
|
||||||
validarCliente(_: any): tipoResposta<tipoConstrutorPilao> {
|
|
||||||
if (!_?.conta) return respostaComuns.erro("Conta não informada")
|
|
||||||
if (!_?.produto) return respostaComuns.erro("Produto não informado")
|
|
||||||
return respostaComuns.valor(_)
|
|
||||||
}
|
|
||||||
|
|
||||||
adicionarRegistroParaEnviar(
|
|
||||||
tabela: string,
|
|
||||||
...registros: z.infer<typeof zp_enviar_registros>["registros"]
|
|
||||||
) {
|
|
||||||
this.#registrosParaEnvio[tabela] = [
|
|
||||||
...(this.#registrosParaEnvio[tabela] || []),
|
|
||||||
...registros,
|
|
||||||
]
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
|
|
||||||
adicionarCodigoParaDeletar(
|
|
||||||
tabela: string,
|
|
||||||
...codigos: z.infer<typeof zp_deletar_registros>["codigos"]
|
|
||||||
) {
|
|
||||||
this.#codigosParaDeletar[tabela] = [
|
|
||||||
...(this.#codigosParaDeletar[tabela] || []),
|
|
||||||
...codigos,
|
|
||||||
]
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
|
|
||||||
private async processarRegistros(
|
|
||||||
url: string,
|
|
||||||
registros: any[],
|
|
||||||
tabela: string,
|
|
||||||
acao: string,
|
|
||||||
): Promise<tipoResposta<true>> {
|
|
||||||
const tamanhoBlocos = 1000
|
|
||||||
while (registros.length > 0) {
|
|
||||||
const bloco = registros
|
|
||||||
.splice(0, tamanhoBlocos)
|
|
||||||
.map((r) =>
|
|
||||||
Object.fromEntries(
|
|
||||||
Object.entries(r).map(([k, v]) => [k, v === undefined ? null : v]),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
const resp = await crossFetch(url, {
|
|
||||||
method: "POST",
|
|
||||||
body: JSON.stringify({ tabela, registros: bloco }),
|
|
||||||
headers: { "Content-Type": "application/json" },
|
|
||||||
})
|
|
||||||
.then(async (r) => {
|
|
||||||
const texto = await r.text()
|
|
||||||
try {
|
|
||||||
const json = JSON.parse(texto)
|
|
||||||
return json
|
|
||||||
} catch {
|
|
||||||
return respostaComuns.erro("Consulta não retornou json válido", [
|
|
||||||
texto,
|
|
||||||
])
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch((e) =>
|
|
||||||
respostaComuns.erro(`Erro ao ${acao} registros`, [e.message]),
|
|
||||||
)
|
|
||||||
|
|
||||||
if (resp.eErro) return resp
|
|
||||||
}
|
|
||||||
return respostaComuns.valor(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
async #salvarEnviarRegistros(): Promise<tipoResposta<true>> {
|
|
||||||
for (const tabela of Object.keys(this.#registrosParaEnvio)) {
|
|
||||||
const registros = this.#registrosParaEnvio[tabela] || []
|
|
||||||
const url = this.rotaEnviarRegistros().url
|
|
||||||
if (this.#ver_log)
|
|
||||||
console.log(
|
|
||||||
`[PILÃO]: Enviando ${registros.length} registros na tabela "${tabela}" para "${url}".`,
|
|
||||||
)
|
|
||||||
const resp = await this.processarRegistros(
|
|
||||||
url.href,
|
|
||||||
registros,
|
|
||||||
tabela,
|
|
||||||
"enviar",
|
|
||||||
)
|
|
||||||
if (resp.eErro) return resp
|
|
||||||
this.#registrosParaEnvio[tabela] = []
|
|
||||||
}
|
|
||||||
return respostaComuns.valor(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
async #salvarDeletarRegistros(): Promise<tipoResposta<true>> {
|
|
||||||
for (const tabela of Object.keys(this.#codigosParaDeletar)) {
|
|
||||||
const codigos = [...(this.#codigosParaDeletar[tabela] || [])]
|
|
||||||
const url = this.rotaDeletarRegistro().url
|
|
||||||
const resp = await this.processarRegistros(
|
|
||||||
url.href,
|
|
||||||
codigos,
|
|
||||||
tabela,
|
|
||||||
"deletar",
|
|
||||||
)
|
|
||||||
if (resp.eErro) return resp
|
|
||||||
}
|
|
||||||
return respostaComuns.valor(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
async enviarRegistros(): Promise<tipoResposta<true>> {
|
|
||||||
const re = await this.#salvarEnviarRegistros()
|
|
||||||
if (re.eErro) return re
|
|
||||||
const rd = await this.#salvarDeletarRegistros()
|
|
||||||
if (rd.eErro) return rd
|
|
||||||
return respostaComuns.valor(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
serieConsultar<T extends nomesVisoes>(
|
|
||||||
tipoVisao: T,
|
|
||||||
parametros_: z.infer<(typeof visoes_pilao)[T]> & z.infer<typeof z_padroes>,
|
|
||||||
padroes?: Pick<z.infer<typeof z_padroes>, "descricao_pelo_usuario">,
|
|
||||||
): retornoSerieConsultar<T> {
|
|
||||||
const parametros = {
|
|
||||||
...parametros_,
|
|
||||||
...Object.fromEntries(
|
|
||||||
Object.entries(padroes || {}).filter(([_, v]) => v !== undefined),
|
|
||||||
),
|
|
||||||
}
|
|
||||||
|
|
||||||
const dados = async (): Promise<
|
|
||||||
tipoResposta<tipoRetornoSerieconsulta<T>>
|
|
||||||
> => {
|
|
||||||
const url = this.rotaConsultarSerie().url
|
|
||||||
url.searchParams.set("visao", tipoVisao)
|
|
||||||
const resp = await crossFetch(url.toString(), {
|
|
||||||
method: "POST",
|
|
||||||
body: JSON.stringify(parametros),
|
|
||||||
headers: { "Content-Type": "application/json" },
|
|
||||||
})
|
|
||||||
.then(async (r) => {
|
|
||||||
const texto = await r.text()
|
|
||||||
|
|
||||||
try {
|
|
||||||
const json = JSON.parse(texto)
|
|
||||||
return json
|
|
||||||
} catch {
|
|
||||||
return respostaComuns.erro("Consulta não retornou json válido", [
|
|
||||||
texto,
|
|
||||||
])
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch((e) =>
|
|
||||||
respostaComuns.erro("Erro ao enviar registros", [e.message]),
|
|
||||||
)
|
|
||||||
|
|
||||||
if (this.#ver_log)
|
|
||||||
console.log(
|
|
||||||
`[PILÃO]: buscar dados de "${JSON.stringify(parametros)}" para "${url}".`,
|
|
||||||
)
|
|
||||||
return resp
|
|
||||||
}
|
|
||||||
|
|
||||||
const url = (): string => {
|
|
||||||
const vUrl = this.rotaIframeSerie(tipoVisao).url
|
|
||||||
const serie = encodeURIComponent(JSON.stringify(parametros, null, 2))
|
|
||||||
if (this.#ver_log)
|
|
||||||
console.log(
|
|
||||||
`[PILÃO]: Serie Consultar url de "${JSON.stringify(serie)}" para "${vUrl}".`,
|
|
||||||
)
|
|
||||||
return `${vUrl}?serie=${serie}`
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
dados,
|
|
||||||
url,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
urlLaboratorio() {
|
|
||||||
const rota = `${PREFIXO_PILAO}/${pilao_enderecos}/${this.#produto}/${this.#conta}`
|
|
||||||
const url = `${this.baseUrlSite}${rota}`
|
|
||||||
return { rota, url }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export const Pilao = (
|
|
||||||
_: tipoConstrutorPilao & { ver_log?: boolean; emDesenvolvimento?: boolean },
|
|
||||||
) => new ClassPilao(_)
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
import type { z } from "zod"
|
|
||||||
import type { zp_registrar_base_dados } from "../_enviar_registros"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {
|
|
||||||
* 'rota':{
|
|
||||||
* pr:{}// paramentros de entrada
|
|
||||||
* rs:{}// resposta
|
|
||||||
* }
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
export type tipo_pilao_api = {
|
|
||||||
/** retorna da data e hora do servido em formato iso */
|
|
||||||
estado_servidor: {
|
|
||||||
pr: {}
|
|
||||||
rs: {
|
|
||||||
data_hora: string
|
|
||||||
}
|
|
||||||
}
|
|
||||||
tabelas: {
|
|
||||||
pr: {}
|
|
||||||
rs: z.infer<typeof zp_registrar_base_dados>[]
|
|
||||||
}
|
|
||||||
|
|
||||||
unicos: {
|
|
||||||
pr: {
|
|
||||||
tabela: string
|
|
||||||
coluna: string
|
|
||||||
}
|
|
||||||
rs: any[]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
import type { z } from "zod"
|
|
||||||
import type { visoes_pilao, z_padroes } from "../visoes/listaDeVisoes"
|
|
||||||
|
|
||||||
export type tipoConstrutorPilao = { produto: string; conta: string }
|
|
||||||
|
|
||||||
export type z_tipagem_registros = {
|
|
||||||
z_contagem_em_barra_vertical: { contagem: number; [k: string]: any }[]
|
|
||||||
z_contagem_em_pizza: { contagem: number; [k: string]: any }[]
|
|
||||||
z_tabela: { [k: string]: any }[]
|
|
||||||
z_soma_em_barra_vertical: { soma: number; [k: string]: any }[]
|
|
||||||
z_porcentagem_soma_em_barra_vertical: {
|
|
||||||
porcentagem: number
|
|
||||||
[k: string]: any
|
|
||||||
}[]
|
|
||||||
}
|
|
||||||
|
|
||||||
export type tipoRetornoSerieconsulta<T extends keyof typeof visoes_pilao> = {
|
|
||||||
registros: z_tipagem_registros[T]
|
|
||||||
legenda: string
|
|
||||||
serie: z.infer<(typeof visoes_pilao)[T]> & z.infer<typeof z_padroes>
|
|
||||||
}
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
import { z } from "zod"
|
|
||||||
import { z_tipos_dados_registro } from "./variaveis"
|
|
||||||
|
|
||||||
export const zp_registrar_base_dados = z.object({
|
|
||||||
tabela: z.string(),
|
|
||||||
colunas: z.array(
|
|
||||||
z.object({
|
|
||||||
coluna: z.string(),
|
|
||||||
tipo: z_tipos_dados_registro,
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
})
|
|
||||||
|
|
||||||
//enviar registros para base de dados
|
|
||||||
export const zp_enviar_registros = z.object({
|
|
||||||
tabela: z.string(),
|
|
||||||
registros: z.array(
|
|
||||||
z.record(
|
|
||||||
z.string(),
|
|
||||||
z.object({
|
|
||||||
valor: z.any(),
|
|
||||||
tipo: z_tipos_dados_registro.optional().nullable(),
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
})
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
import { z } from "zod"
|
|
||||||
import { operadores_pilao } from "./variaveis"
|
|
||||||
|
|
||||||
export const z_filtro = z.object({
|
|
||||||
coluna: z.string(),
|
|
||||||
valor: z.any(),
|
|
||||||
operador: operadores_pilao,
|
|
||||||
})
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
export { PREFIXO_PILAO, urlPilao } from "./variaveis"
|
|
||||||
import {
|
|
||||||
zp_enviar_registros,
|
|
||||||
zp_registrar_base_dados,
|
|
||||||
} from "./_enviar_registros"
|
|
||||||
import {
|
|
||||||
operadores_permitidos_por_tipo,
|
|
||||||
operadores_pilao,
|
|
||||||
validarZ,
|
|
||||||
z_tipos_dados_registro,
|
|
||||||
zp_deletar_registros,
|
|
||||||
zp_produto_conta,
|
|
||||||
} from "./variaveis"
|
|
||||||
|
|
||||||
export * from "./Pilao"
|
|
||||||
export * from "./Pilao/pilao-api"
|
|
||||||
export * from "./Pilao/tipagem"
|
|
||||||
|
|
||||||
import { pilao_enderecos } from "./Pilao"
|
|
||||||
import { z_filtro } from "./_serie_consultar"
|
|
||||||
import { extruturas_de_campos } from "./visoes"
|
|
||||||
import { visoes_pilao, z_padroes } from "./visoes/listaDeVisoes"
|
|
||||||
|
|
||||||
export const pPilao = {
|
|
||||||
zp_deletar_registros,
|
|
||||||
zp_registrar_base_dados,
|
|
||||||
z_tipos_dados_registro,
|
|
||||||
zp_enviar_registros,
|
|
||||||
|
|
||||||
zp_produto_conta,
|
|
||||||
validarZ,
|
|
||||||
|
|
||||||
operadores_pilao,
|
|
||||||
operadores_permitidos_por_tipo,
|
|
||||||
z_filtro,
|
|
||||||
visoes_pilao,
|
|
||||||
...visoes_pilao,
|
|
||||||
extruturas_de_campos,
|
|
||||||
z_padroes,
|
|
||||||
pilao_enderecos,
|
|
||||||
}
|
|
||||||
|
|
@ -1,83 +0,0 @@
|
||||||
import { respostaComuns } from "p-respostas"
|
|
||||||
import { z } from "zod"
|
|
||||||
|
|
||||||
export const zp_deletar_registros = z.object({
|
|
||||||
tabela: z.string(),
|
|
||||||
codigos: z.array(z.string()),
|
|
||||||
})
|
|
||||||
|
|
||||||
export const zAmbiente = z.enum(["desenvolvimento", "producao"])
|
|
||||||
|
|
||||||
export const PREFIXO_PILAO = "/pilao-de-dados"
|
|
||||||
|
|
||||||
export const validarZ = <T>(
|
|
||||||
zodType: z.ZodType<T, any>,
|
|
||||||
objeto: any,
|
|
||||||
mensagem: string,
|
|
||||||
) => {
|
|
||||||
const validar = zodType.safeParse(objeto)
|
|
||||||
if (!validar.success) {
|
|
||||||
return respostaComuns.erro(
|
|
||||||
mensagem,
|
|
||||||
validar.error.errors.map((e) => `${e.path} ${e.message}`),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return respostaComuns.valor(validar.data)
|
|
||||||
}
|
|
||||||
|
|
||||||
export const zp_produto_conta = z.object({
|
|
||||||
produto: z.string(),
|
|
||||||
conta: z.string(),
|
|
||||||
emDesenvolvimento: z.boolean().optional(),
|
|
||||||
ver_log: z.boolean().optional(),
|
|
||||||
})
|
|
||||||
|
|
||||||
export const z_tipos_dados_registro = z.enum([
|
|
||||||
"texto",
|
|
||||||
"numero",
|
|
||||||
"confirmacao",
|
|
||||||
"lista_texto",
|
|
||||||
"lista_numero",
|
|
||||||
"lista_mes",
|
|
||||||
"lista_data",
|
|
||||||
"mes",
|
|
||||||
"data",
|
|
||||||
])
|
|
||||||
|
|
||||||
export const operadores_pilao = z.enum(["=", "!=", ">", "<", ">=", "<=", "∩"])
|
|
||||||
|
|
||||||
export const operadores_permitidos_por_tipo: {
|
|
||||||
[key in z.infer<typeof z_tipos_dados_registro>]: z.infer<
|
|
||||||
typeof operadores_pilao
|
|
||||||
>[]
|
|
||||||
} = {
|
|
||||||
confirmacao: ["=", "!="],
|
|
||||||
data: ["=", "!=", ">", "<", ">=", "<="],
|
|
||||||
lista_numero: ["∩"],
|
|
||||||
lista_texto: ["∩"],
|
|
||||||
lista_mes: ["∩"],
|
|
||||||
lista_data: ["∩"],
|
|
||||||
mes: ["=", "!=", ">", "<", ">=", "<="],
|
|
||||||
numero: ["=", "!=", ">", "<", ">=", "<="],
|
|
||||||
texto: ["=", "!="],
|
|
||||||
}
|
|
||||||
|
|
||||||
export const z_validar_colunna_base_dados = {
|
|
||||||
texto: z.string().nullable(),
|
|
||||||
numero: z.number().nullable(),
|
|
||||||
confirmacao: z.boolean().nullable(),
|
|
||||||
lista_texto: z.array(z.string()).nullable(),
|
|
||||||
lista_numero: z.array(z.number()).nullable(),
|
|
||||||
}
|
|
||||||
|
|
||||||
export const urlPilao = (emDesenvolvimento?: boolean | null | undefined) => ({
|
|
||||||
api:
|
|
||||||
(emDesenvolvimento
|
|
||||||
? "http://127.0.0.1:5080"
|
|
||||||
: "https://carro-de-boi.idz.one") + PREFIXO_PILAO,
|
|
||||||
|
|
||||||
site:
|
|
||||||
(emDesenvolvimento
|
|
||||||
? "http://127.0.0.1:5081"
|
|
||||||
: "https://carro-de-boi.idz.one") + PREFIXO_PILAO,
|
|
||||||
})
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
import type { visoes_pilao } from "../listaDeVisoes"
|
|
||||||
import type { tipo_estrutura_visao_grafico } from "../tipagem"
|
|
||||||
import { z_contagem_em_barra_vertical } from "./z_contagem_em_barra_vertical"
|
|
||||||
import { z_contagem_em_pizza } from "./z_contagem_em_pizza"
|
|
||||||
import { z_soma_em_barra_vertical } from "./z_soma_em_barra_vertical"
|
|
||||||
import { z_tabela } from "./z_tabela"
|
|
||||||
|
|
||||||
/** Cria a estrutura de campos para insersão de dados */
|
|
||||||
export const extruturas_de_campos: {
|
|
||||||
[T in keyof typeof visoes_pilao]: tipo_estrutura_visao_grafico<T>
|
|
||||||
} = {
|
|
||||||
z_contagem_em_barra_vertical,
|
|
||||||
z_contagem_em_pizza,
|
|
||||||
z_soma_em_barra_vertical,
|
|
||||||
z_tabela,
|
|
||||||
}
|
|
||||||
|
|
@ -1,56 +0,0 @@
|
||||||
// usar describe para definir o tipo de campo para render do componente
|
|
||||||
|
|
||||||
import type { tipo_estrutura_visao_grafico } from "../tipagem"
|
|
||||||
|
|
||||||
/** Cria a estrutura de campos para insersão de dados */
|
|
||||||
export const z_contagem_em_barra_vertical: tipo_estrutura_visao_grafico<"z_contagem_em_barra_vertical"> =
|
|
||||||
{
|
|
||||||
visao: "z_contagem_em_barra_vertical",
|
|
||||||
rotulo: "Contagem em Barra Vertical",
|
|
||||||
tabela: ({ tabela }) => tabela,
|
|
||||||
descricao: ({
|
|
||||||
tabela,
|
|
||||||
descricao_pelo_usuario,
|
|
||||||
colanuEixoX,
|
|
||||||
filtros,
|
|
||||||
colunaAgrupamento,
|
|
||||||
}) => {
|
|
||||||
if (String(descricao_pelo_usuario || "").trim())
|
|
||||||
return String(descricao_pelo_usuario || "").trim()
|
|
||||||
|
|
||||||
return `Contagem de ${tabela} por ${colanuEixoX}${
|
|
||||||
!filtros?.length
|
|
||||||
? ""
|
|
||||||
: `, quando ${filtros
|
|
||||||
.map(
|
|
||||||
({ coluna, operador, valor }) =>
|
|
||||||
`${coluna} ${operador} ${valor}`,
|
|
||||||
)
|
|
||||||
.join(", ")}`
|
|
||||||
}${
|
|
||||||
!colunaAgrupamento?.length
|
|
||||||
? ""
|
|
||||||
: `, agrupado por ${colunaAgrupamento.join(", ")}`
|
|
||||||
}.`
|
|
||||||
},
|
|
||||||
campos: {
|
|
||||||
tabela: { rotulo: "Tabela", tipo_campo: "tabela", order: 1 },
|
|
||||||
|
|
||||||
colanuEixoX: {
|
|
||||||
rotulo: "Coluna do Eixo X",
|
|
||||||
tipo_campo: "coluna",
|
|
||||||
order: 2,
|
|
||||||
},
|
|
||||||
colunaAgrupamento: {
|
|
||||||
rotulo: "Colunas de Agrupamento",
|
|
||||||
tipo_campo: "lista_colunas",
|
|
||||||
order: 3,
|
|
||||||
},
|
|
||||||
descricao_pelo_usuario: {
|
|
||||||
rotulo: "Descrição (opcional)",
|
|
||||||
tipo_campo: "texto",
|
|
||||||
order: 4,
|
|
||||||
},
|
|
||||||
filtros: { rotulo: "Filtros", tipo_campo: "lista_filtros", order: 5 },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
||||||
// usar describe para definir o tipo de campo para render do componente
|
|
||||||
|
|
||||||
import type { tipo_estrutura_visao_grafico } from "../tipagem"
|
|
||||||
|
|
||||||
/** Cria a estrutura de campos para insersão de dados */
|
|
||||||
export const z_contagem_em_pizza: tipo_estrutura_visao_grafico<"z_contagem_em_pizza"> =
|
|
||||||
{
|
|
||||||
visao: "z_contagem_em_pizza",
|
|
||||||
rotulo: "Contagem em Pizza",
|
|
||||||
tabela: ({ tabela }) => tabela,
|
|
||||||
descricao: ({ tabela, descricao_pelo_usuario, classes, filtros }) => {
|
|
||||||
if (String(descricao_pelo_usuario || "").trim())
|
|
||||||
return String(descricao_pelo_usuario || "").trim()
|
|
||||||
|
|
||||||
return `Contagem de ${tabela} por ${classes}${
|
|
||||||
!filtros?.length
|
|
||||||
? ""
|
|
||||||
: `, quando ${filtros
|
|
||||||
.map(
|
|
||||||
({ coluna, operador, valor }) =>
|
|
||||||
`${coluna} ${operador} ${valor}`,
|
|
||||||
)
|
|
||||||
.join(", ")}`
|
|
||||||
}.`
|
|
||||||
},
|
|
||||||
campos: {
|
|
||||||
tabela: { rotulo: "Tabela", tipo_campo: "tabela", order: 1 },
|
|
||||||
classes: { rotulo: "Classes", tipo_campo: "coluna", order: 2 },
|
|
||||||
descricao_pelo_usuario: {
|
|
||||||
rotulo: "Descrição (opcional)",
|
|
||||||
tipo_campo: "texto",
|
|
||||||
order: 3,
|
|
||||||
},
|
|
||||||
filtros: { rotulo: "Filtros", tipo_campo: "lista_filtros", order: 4 },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
@ -1,74 +0,0 @@
|
||||||
// usar describe para definir o tipo de campo para render do componente
|
|
||||||
|
|
||||||
import type { tipo_estrutura_visao_grafico } from "../tipagem"
|
|
||||||
|
|
||||||
/** Cria a estrutura de campos para insersão de dados */
|
|
||||||
export const z_soma_em_barra_vertical: tipo_estrutura_visao_grafico<"z_soma_em_barra_vertical"> =
|
|
||||||
{
|
|
||||||
visao: "z_soma_em_barra_vertical",
|
|
||||||
rotulo: "Soma em Barra Vertical",
|
|
||||||
tabela: ({ tabela }) => tabela,
|
|
||||||
descricao: ({
|
|
||||||
descricao_pelo_usuario,
|
|
||||||
colanuEixoX,
|
|
||||||
filtros,
|
|
||||||
colunaAgrupamento,
|
|
||||||
colunaSoma,
|
|
||||||
exibirComoPorcentagem,
|
|
||||||
}) => {
|
|
||||||
if (String(descricao_pelo_usuario || "").trim())
|
|
||||||
return String(descricao_pelo_usuario || "").trim()
|
|
||||||
|
|
||||||
return `${exibirComoPorcentagem ? "Porcentagem " : "Soma"} de ${colunaSoma} por ${colanuEixoX}${
|
|
||||||
!filtros?.length
|
|
||||||
? ""
|
|
||||||
: `, quando ${filtros
|
|
||||||
.map(
|
|
||||||
({ coluna, operador, valor }) =>
|
|
||||||
`${coluna} ${operador} ${valor}`,
|
|
||||||
)
|
|
||||||
.join(", ")}`
|
|
||||||
}${
|
|
||||||
!colunaAgrupamento?.length
|
|
||||||
? ""
|
|
||||||
: `, agrupado por ${colunaAgrupamento.join(", ")}`
|
|
||||||
}.`
|
|
||||||
},
|
|
||||||
campos: {
|
|
||||||
tabela: { rotulo: "Tabela", tipo_campo: "tabela", order: 1 },
|
|
||||||
|
|
||||||
colunaSoma: {
|
|
||||||
rotulo: "Coluna de Somatória",
|
|
||||||
tipo_campo: "coluna",
|
|
||||||
order: 2,
|
|
||||||
},
|
|
||||||
|
|
||||||
unidadeSoma: {
|
|
||||||
rotulo: "Unidade de Somatória",
|
|
||||||
tipo_campo: "texto",
|
|
||||||
order: 3,
|
|
||||||
},
|
|
||||||
|
|
||||||
colanuEixoX: {
|
|
||||||
rotulo: "Coluna do Eixo X",
|
|
||||||
tipo_campo: "coluna",
|
|
||||||
order: 4,
|
|
||||||
},
|
|
||||||
colunaAgrupamento: {
|
|
||||||
rotulo: "Colunas de Agrupamento",
|
|
||||||
tipo_campo: "lista_colunas",
|
|
||||||
order: 5,
|
|
||||||
},
|
|
||||||
descricao_pelo_usuario: {
|
|
||||||
rotulo: "Descrição (opcional)",
|
|
||||||
tipo_campo: "texto",
|
|
||||||
order: 6,
|
|
||||||
},
|
|
||||||
exibirComoPorcentagem: {
|
|
||||||
rotulo: "Exibir como porcentagem",
|
|
||||||
order: 7,
|
|
||||||
tipo_campo: "booleana",
|
|
||||||
},
|
|
||||||
filtros: { rotulo: "Filtros", tipo_campo: "lista_filtros", order: 8 },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
@ -1,45 +0,0 @@
|
||||||
// usar describe para definir o tipo de campo para render do componente
|
|
||||||
|
|
||||||
import type { tipo_estrutura_visao_grafico } from "../tipagem"
|
|
||||||
|
|
||||||
/** Cria a estrutura de campos para insersão de dados */
|
|
||||||
export const z_tabela: tipo_estrutura_visao_grafico<"z_tabela"> = {
|
|
||||||
visao: "z_tabela",
|
|
||||||
rotulo: "Tabela",
|
|
||||||
tabela: ({ tabela }) => tabela,
|
|
||||||
descricao: ({ tabela, descricao_pelo_usuario, filtros }) => {
|
|
||||||
if (String(descricao_pelo_usuario || "").trim())
|
|
||||||
return String(descricao_pelo_usuario || "").trim()
|
|
||||||
|
|
||||||
return `Consulta na ${tabela} ${
|
|
||||||
!filtros?.length
|
|
||||||
? ""
|
|
||||||
: `, quando ${filtros
|
|
||||||
.map(
|
|
||||||
({ coluna, operador, valor }) => `${coluna} ${operador} ${valor}`,
|
|
||||||
)
|
|
||||||
.join(", ")}`
|
|
||||||
}.`
|
|
||||||
},
|
|
||||||
campos: {
|
|
||||||
tabela: { rotulo: "Tabela", tipo_campo: "tabela", order: 1 },
|
|
||||||
colunas: { rotulo: "Colunas", tipo_campo: "lista_colunas", order: 2 },
|
|
||||||
descricao_pelo_usuario: {
|
|
||||||
rotulo: "Descrição (opcional)",
|
|
||||||
tipo_campo: "texto",
|
|
||||||
order: 3,
|
|
||||||
},
|
|
||||||
coluna_ordem: {
|
|
||||||
rotulo: "Coluna de Ordem",
|
|
||||||
tipo_campo: "coluna",
|
|
||||||
order: 4,
|
|
||||||
},
|
|
||||||
direcao_ordem: {
|
|
||||||
rotulo: "Direção de Ordem",
|
|
||||||
tipo_campo: "ordem",
|
|
||||||
order: 5,
|
|
||||||
},
|
|
||||||
|
|
||||||
filtros: { rotulo: "Filtros", tipo_campo: "lista_filtros", order: 6 },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
export * from "./estrutura_de_campos"
|
|
||||||
|
|
@ -1,47 +0,0 @@
|
||||||
import { z } from "zod"
|
|
||||||
import { z_filtro } from "../_serie_consultar"
|
|
||||||
|
|
||||||
/** aplica a todas as consultas */
|
|
||||||
export const z_padroes = z.object({
|
|
||||||
tabela: z.string(),
|
|
||||||
filtros: z_filtro.array().optional(),
|
|
||||||
descricao_pelo_usuario: z.string().optional(),
|
|
||||||
})
|
|
||||||
|
|
||||||
export const z_contagem_em_barra_vertical = z
|
|
||||||
.object({
|
|
||||||
colanuEixoX: z.string(),
|
|
||||||
colunaAgrupamento: z.string().array().optional(),
|
|
||||||
})
|
|
||||||
.extend(z_padroes.shape)
|
|
||||||
|
|
||||||
export const z_soma_em_barra_vertical = z
|
|
||||||
.object({
|
|
||||||
colanuEixoX: z.string(),
|
|
||||||
colunaSoma: z.string(),
|
|
||||||
unidadeSoma: z.string().optional(),
|
|
||||||
colunaAgrupamento: z.string().array().optional(),
|
|
||||||
exibirComoPorcentagem: z.boolean().optional(),
|
|
||||||
})
|
|
||||||
.extend(z_padroes.shape)
|
|
||||||
|
|
||||||
export const z_contagem_em_pizza = z
|
|
||||||
.object({
|
|
||||||
classes: z.string(),
|
|
||||||
})
|
|
||||||
.extend(z_padroes.shape)
|
|
||||||
|
|
||||||
export const z_tabela = z
|
|
||||||
.object({
|
|
||||||
colunas: z.string().array(),
|
|
||||||
coluna_ordem: z.string().optional(),
|
|
||||||
direcao_ordem: z.enum(["asc", "desc", "1", "-1"]).optional(),
|
|
||||||
})
|
|
||||||
.extend(z_padroes.shape)
|
|
||||||
|
|
||||||
export const visoes_pilao = {
|
|
||||||
z_contagem_em_barra_vertical,
|
|
||||||
z_contagem_em_pizza,
|
|
||||||
z_tabela,
|
|
||||||
z_soma_em_barra_vertical,
|
|
||||||
}
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
||||||
import { z } from "zod"
|
|
||||||
import type { visoes_pilao, z_padroes } from "./listaDeVisoes"
|
|
||||||
|
|
||||||
export const z_tipos_campos_reg_grafico = z.enum([
|
|
||||||
"tabela",
|
|
||||||
"coluna",
|
|
||||||
"texto",
|
|
||||||
"lista_colunas",
|
|
||||||
"lista_filtros",
|
|
||||||
"ordem",
|
|
||||||
"booleana",
|
|
||||||
])
|
|
||||||
|
|
||||||
export type tipo_estrutura_visao_grafico<T extends keyof typeof visoes_pilao> =
|
|
||||||
{
|
|
||||||
/** Nome da Visão */
|
|
||||||
visao: T
|
|
||||||
/** Rotulo */
|
|
||||||
rotulo: string
|
|
||||||
/** Retorna a tabela Referente ao Registro */
|
|
||||||
tabela: (
|
|
||||||
_: z.infer<(typeof visoes_pilao)[T]> & z.infer<typeof z_padroes>,
|
|
||||||
) => string
|
|
||||||
/** Descrição */
|
|
||||||
descricao: (
|
|
||||||
_: z.infer<(typeof visoes_pilao)[T]> & z.infer<typeof z_padroes>,
|
|
||||||
) => string
|
|
||||||
/** Lista os campos e suas configurações */
|
|
||||||
campos: {
|
|
||||||
[c in keyof Required<
|
|
||||||
z.infer<(typeof visoes_pilao)[T]> & z.infer<typeof z_padroes>
|
|
||||||
>]: {
|
|
||||||
rotulo: string
|
|
||||||
tipo_campo: z.infer<typeof z_tipos_campos_reg_grafico>
|
|
||||||
order: number
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue