ajuste de libs
This commit is contained in:
parent
caf3f59453
commit
547f693652
22 changed files with 236 additions and 306 deletions
|
|
@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
import { respostaComuns } from "p-respostas";
|
||||
import { urlAutenticacao } from "./_urlAutenticacao";
|
||||
import node_fetch from "cross-fetch";
|
||||
export const codigoContaSite = ({ ambiente, post, }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
export const codigoContaSite = (_a) => __awaiter(void 0, [_a], void 0, function* ({ ambiente, post, }) {
|
||||
const url = `${urlAutenticacao(ambiente)}/api/codigo_prefeitura_site`;
|
||||
try {
|
||||
const resp = yield node_fetch(url, {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
import node_fetch from "cross-fetch";
|
||||
import { respostaComuns } from "p-respostas";
|
||||
import { urlAutenticacao } from "./_urlAutenticacao";
|
||||
export const usuarios_quipo_governo = ({ token_produto, ambiente, }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
export const usuarios_quipo_governo = (_a) => __awaiter(void 0, [_a], void 0, function* ({ token_produto, ambiente, }) {
|
||||
const url = `${urlAutenticacao(ambiente)}/api/usuarios_quipo_governo`;
|
||||
if (!token_produto)
|
||||
return respostaComuns.erro("token_produto não informado");
|
||||
|
|
|
|||
|
|
@ -6,6 +6,6 @@ export declare const usuarios_quipo_vincular: ({ token_produto, ambiente, conta,
|
|||
token_produto: string;
|
||||
conta: string;
|
||||
vinculo: string;
|
||||
codigo_usuario?: string | undefined;
|
||||
codigo_usuario?: string;
|
||||
email: string;
|
||||
}) => Promise<tipoResposta<string>>;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
import node_fetch from "cross-fetch";
|
||||
import { respostaComuns } from "p-respostas";
|
||||
import { urlAutenticacao } from "./_urlAutenticacao";
|
||||
export const usuarios_quipo_vincular = ({ token_produto, ambiente, conta, vinculo, codigo_usuario, email, }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
export const usuarios_quipo_vincular = (_a) => __awaiter(void 0, [_a], void 0, function* ({ token_produto, ambiente, conta, vinculo, codigo_usuario, email, }) {
|
||||
const url = `${urlAutenticacao(ambiente)}/api/vinculos__criar`;
|
||||
if (!token_produto)
|
||||
return respostaComuns.erro("token_produto não informado");
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
import { urlAutenticacao } from "./_urlAutenticacao";
|
||||
import node_fetch from "cross-fetch";
|
||||
/** faz a validação do token */
|
||||
export const validarToken = ({ ambiente, post, }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
export const validarToken = (_a) => __awaiter(void 0, [_a], void 0, function* ({ ambiente, post, }) {
|
||||
const url = `${urlAutenticacao(ambiente)}/api/validar_token`;
|
||||
try {
|
||||
const resposta = yield node_fetch(url, {
|
||||
|
|
|
|||
13
dist-import/autenticacao/index.d.ts
vendored
13
dist-import/autenticacao/index.d.ts
vendored
|
|
@ -3,29 +3,28 @@ export type { tipoUsuarioExterno };
|
|||
/** todas as rotas de comunicação com autenticador partem dessa variável */
|
||||
export declare const pAutenticacao: {
|
||||
validarToken: ({ ambiente, post, }: {
|
||||
/** todas as rotas de comunicação com autenticador partem dessa variável */
|
||||
ambiente: "desenvolvimento" | "producao";
|
||||
ambiente: import("zod").TypeOf<typeof import("../ts/ambiente").zAmbiente>;
|
||||
post: {
|
||||
token: string;
|
||||
};
|
||||
}) => Promise<"valido" | "erro">;
|
||||
urlAutenticacao: (ambiente: "desenvolvimento" | "producao") => string;
|
||||
urlAutenticacao: (ambiente: import("zod").TypeOf<typeof import("../ts/ambiente").zAmbiente>) => string;
|
||||
codigoContaSite: ({ ambiente, post, }: {
|
||||
ambiente: "desenvolvimento" | "producao";
|
||||
ambiente: import("zod").TypeOf<typeof import("../ts/ambiente").zAmbiente>;
|
||||
post: {
|
||||
site: string;
|
||||
};
|
||||
}) => Promise<import("p-respostas").tipoResposta<string>>;
|
||||
usuarios_quipo_governo: ({ token_produto, ambiente, }: {
|
||||
ambiente: "desenvolvimento" | "producao";
|
||||
ambiente: import("zod").TypeOf<typeof import("../ts/ambiente").zAmbiente>;
|
||||
token_produto: string;
|
||||
}) => Promise<import("p-respostas").tipoResposta<tipoUsuarioExterno[]>>;
|
||||
usuarios_quipo_vincular: ({ token_produto, ambiente, conta, vinculo, codigo_usuario, email, }: {
|
||||
ambiente: "desenvolvimento" | "producao";
|
||||
ambiente: import("zod").TypeOf<typeof import("../ts/ambiente").zAmbiente>;
|
||||
token_produto: string;
|
||||
conta: string;
|
||||
vinculo: string;
|
||||
codigo_usuario?: string | undefined;
|
||||
codigo_usuario?: string;
|
||||
email: string;
|
||||
}) => Promise<import("p-respostas").tipoResposta<string>>;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ export const zp_deletar_registros = z.object({
|
|||
tabela: z.string(),
|
||||
codigos: z.array(z.string()),
|
||||
});
|
||||
export const deletar_registros = ({ conta, produto, emDesenvolvimento }) => ({ codigos, tabela, }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
export const deletar_registros = ({ conta, produto, emDesenvolvimento }) => (_a) => __awaiter(void 0, [_a], void 0, function* ({ codigos, tabela, }) {
|
||||
const url = new URL(`${baseUrlPilao(emDesenvolvimento)}${PREFIXO}/${Object.keys({ deletar_registros })[0]}/${produto}/${conta}`);
|
||||
const tamanhoBlocos = 1000;
|
||||
while (codigos.length > 0) {
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ export const zp_enviar_registros = z.object({
|
|||
tipo: z_tipo_coluna_base_dados.optional().nullable(),
|
||||
}))),
|
||||
});
|
||||
export const enviar_registros = ({ conta, produto, emDesenvolvimento }) => ({ registros, tabela, }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
export const enviar_registros = ({ conta, produto, emDesenvolvimento }) => (_a) => __awaiter(void 0, [_a], void 0, function* ({ registros, tabela, }) {
|
||||
const url = new URL(`${baseUrlPilao(emDesenvolvimento)}${PREFIXO}/${Object.keys({ enviar_registros })[0]}/${produto}/${conta}`);
|
||||
const tamanhoBlocos = 1000;
|
||||
while (registros.length > 0) {
|
||||
|
|
|
|||
46
dist-import/pilao-de-dados/index.d.ts
vendored
46
dist-import/pilao-de-dados/index.d.ts
vendored
|
|
@ -1,4 +1,7 @@
|
|||
import { tiposSeriesAgregacoes } from "./variaveis";
|
||||
import { zp_deletar_registros } from "./_deletar_registros";
|
||||
import { zp_enviar_registros } from "./_enviar_registros";
|
||||
import { tiposSeriesAgregacoes, zp_produto_conta } from "./variaveis";
|
||||
import { zp_serie_registrar } from "./_serie_consultar";
|
||||
export { tiposSeriesAgregacoes };
|
||||
export declare const pPilao: {
|
||||
zp_registrar_base_dados: import("zod").ZodObject<{
|
||||
|
|
@ -26,17 +29,7 @@ export declare const pPilao: {
|
|||
tipo: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "data" | "mes";
|
||||
}[];
|
||||
}>;
|
||||
enviar_registros: ({ conta, produto, emDesenvolvimento }: {
|
||||
conta: string;
|
||||
produto: string;
|
||||
emDesenvolvimento?: boolean | undefined;
|
||||
}) => ({ registros, tabela, }: {
|
||||
tabela: string;
|
||||
registros: Record<string, {
|
||||
valor?: any;
|
||||
tipo?: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "data" | "mes" | null | undefined;
|
||||
}>[];
|
||||
}) => Promise<import("p-respostas").tipoResposta<true>>;
|
||||
enviar_registros: ({ conta, produto, emDesenvolvimento }: import("zod").TypeOf<typeof zp_produto_conta>) => ({ registros, tabela, }: import("zod").TypeOf<typeof zp_enviar_registros>) => Promise<import("p-respostas").tipoResposta<true>>;
|
||||
zp_enviar_registros: import("zod").ZodObject<{
|
||||
tabela: import("zod").ZodString;
|
||||
registros: import("zod").ZodArray<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
|
||||
|
|
@ -78,25 +71,11 @@ export declare const pPilao: {
|
|||
agregacao: "contagem" | "somatoria";
|
||||
colunaAgrupamento?: string[] | undefined;
|
||||
}>;
|
||||
serie_consultar: (cliente: {
|
||||
conta: string;
|
||||
produto: string;
|
||||
emDesenvolvimento?: boolean | undefined;
|
||||
}) => (parametros: {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
agregacao: "contagem" | "somatoria";
|
||||
colunaAgrupamento?: string[] | undefined;
|
||||
}) => {
|
||||
serie_consultar: (cliente: import("zod").TypeOf<typeof zp_produto_conta>) => (parametros: import("zod").TypeOf<typeof zp_serie_registrar>) => {
|
||||
dados: () => Promise<import("p-respostas").tipoResposta<{
|
||||
registros: any[];
|
||||
legenda: string;
|
||||
serie: {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
agregacao: "contagem" | "somatoria";
|
||||
colunaAgrupamento?: string[] | undefined;
|
||||
};
|
||||
serie: import("zod").TypeOf<typeof zp_serie_registrar>;
|
||||
}>>;
|
||||
url: () => string;
|
||||
};
|
||||
|
|
@ -113,15 +92,8 @@ export declare const pPilao: {
|
|||
produto: string;
|
||||
emDesenvolvimento?: boolean | undefined;
|
||||
}>;
|
||||
validarZ: <T>(zodType: import("zod").ZodType<T, any, T>, objeto: any, mensagem: string) => import("p-respostas").tipoRespostaErro | import("p-respostas").tipoRespostaSucesso<T>;
|
||||
deletar_registros: ({ conta, produto, emDesenvolvimento }: {
|
||||
conta: string;
|
||||
produto: string;
|
||||
emDesenvolvimento?: boolean | undefined;
|
||||
}) => ({ codigos, tabela, }: {
|
||||
tabela: string;
|
||||
codigos: string[];
|
||||
}) => Promise<import("p-respostas").tipoResposta<true>>;
|
||||
validarZ: <T>(zodType: import("zod").ZodType<T, any>, objeto: any, mensagem: string) => import("p-respostas").tipoRespostaErro | import("p-respostas").tipoRespostaSucesso<T>;
|
||||
deletar_registros: ({ conta, produto, emDesenvolvimento }: import("zod").TypeOf<typeof zp_produto_conta>) => ({ codigos, tabela, }: import("zod").TypeOf<typeof zp_deletar_registros>) => Promise<import("p-respostas").tipoResposta<true>>;
|
||||
zp_deletar_registros: import("zod").ZodObject<{
|
||||
tabela: import("zod").ZodString;
|
||||
codigos: import("zod").ZodArray<import("zod").ZodString, "many">;
|
||||
|
|
|
|||
2
dist-import/pilao-de-dados/variaveis.d.ts
vendored
2
dist-import/pilao-de-dados/variaveis.d.ts
vendored
|
|
@ -1,7 +1,7 @@
|
|||
import { z } from "zod";
|
||||
export declare const zAmbiente: z.ZodEnum<["desenvolvimento", "producao"]>;
|
||||
export declare const PREFIXO = "/pilao-de-dados";
|
||||
export declare const validarZ: <T>(zodType: z.ZodType<T, any, T>, objeto: any, mensagem: string) => import("p-respostas").tipoRespostaErro | import("p-respostas").tipoRespostaSucesso<T>;
|
||||
export declare const validarZ: <T>(zodType: z.ZodType<T, any>, objeto: any, mensagem: string) => import("p-respostas").tipoRespostaErro | import("p-respostas").tipoRespostaSucesso<T>;
|
||||
export declare const zp_produto_conta: z.ZodObject<{
|
||||
produto: z.ZodString;
|
||||
conta: z.ZodString;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue