build
This commit is contained in:
parent
20fb47126d
commit
ccc6e94e8c
12 changed files with 21 additions and 291 deletions
|
|
@ -42,49 +42,6 @@ declare const ztokenQuipo: z.ZodObject<{
|
|||
type tipos_de_acesso_quipo = z.infer<typeof ztokenQuipo>["tipo_de_acesso"];
|
||||
type tipoTokenQuipo = z.infer<typeof ztokenQuipo>;
|
||||
|
||||
declare const zAmbiente: z.ZodEnum<["desenvolvimento", "producao"]>;
|
||||
|
||||
type tipoUsuarioExterno = {
|
||||
_nome: string;
|
||||
_email: string;
|
||||
_telefone: string;
|
||||
vinculo: string;
|
||||
$cliente: string;
|
||||
chave_produto: string;
|
||||
codigo: string;
|
||||
_cpf: string;
|
||||
};
|
||||
|
||||
/** todas as rotas de comunicação com autenticador partem dessa variável */
|
||||
declare const pAutenticacao: {
|
||||
validarToken: ({ ambiente, post, }: {
|
||||
ambiente: zod.TypeOf<typeof zAmbiente>;
|
||||
post: {
|
||||
token: string;
|
||||
};
|
||||
}) => Promise<"valido" | "erro">;
|
||||
urlAutenticacao: (ambiente: zod.TypeOf<typeof zAmbiente>) => string;
|
||||
codigoContaSite: ({ ambiente, post, }: {
|
||||
ambiente: zod.TypeOf<typeof zAmbiente>;
|
||||
post: {
|
||||
site: string;
|
||||
};
|
||||
}) => Promise<p_respostas.tipoResposta<string>>;
|
||||
usuarios_quipo: ({ token_produto, ambiente, tipo, }: {
|
||||
ambiente: zod.TypeOf<typeof zAmbiente>;
|
||||
token_produto: string;
|
||||
tipo: tipos_de_acesso_quipo;
|
||||
}) => Promise<p_respostas.tipoResposta<tipoUsuarioExterno[]>>;
|
||||
usuarios_quipo_vincular: ({ token_produto, ambiente, $cliente, vinculo, codigo_usuario, email, }: {
|
||||
ambiente: zod.TypeOf<typeof zAmbiente>;
|
||||
token_produto: string;
|
||||
$cliente: string;
|
||||
vinculo: string;
|
||||
codigo_usuario?: string;
|
||||
email: string;
|
||||
}) => Promise<p_respostas.tipoResposta<string>>;
|
||||
};
|
||||
|
||||
/** aplica a todas as consultas */
|
||||
declare const z_padroes: z.ZodObject<{
|
||||
tabela: z.ZodString;
|
||||
|
|
@ -333,23 +290,23 @@ declare const zp_registrar_base_dados: z.ZodObject<{
|
|||
coluna: z.ZodString;
|
||||
tipo: z.ZodEnum<["texto", "numero", "confirmacao", "lista_texto", "lista_numero", "lista_mes", "lista_data", "mes", "data"]>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
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";
|
||||
}, {
|
||||
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: {
|
||||
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";
|
||||
}[];
|
||||
}, {
|
||||
tabela: string;
|
||||
colunas: {
|
||||
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";
|
||||
}[];
|
||||
}>;
|
||||
declare const zp_enviar_registros: z.ZodObject<{
|
||||
|
|
@ -722,23 +679,23 @@ declare const pPilao: {
|
|||
coluna: zod.ZodString;
|
||||
tipo: zod.ZodEnum<["texto", "numero", "confirmacao", "lista_texto", "lista_numero", "lista_mes", "lista_data", "mes", "data"]>;
|
||||
}, "strip", zod.ZodTypeAny, {
|
||||
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";
|
||||
}, {
|
||||
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: {
|
||||
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";
|
||||
}[];
|
||||
}, {
|
||||
tabela: string;
|
||||
colunas: {
|
||||
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";
|
||||
}[];
|
||||
}>;
|
||||
z_tipos_dados_registro: zod.ZodEnum<["texto", "numero", "confirmacao", "lista_texto", "lista_numero", "lista_mes", "lista_data", "mes", "data"]>;
|
||||
|
|
@ -1140,4 +1097,4 @@ declare const abrirNps: (emDesenvolvimento: boolean) => (parametros: tipo_proxim
|
|||
declare const $clienteStatus: z.ZodEnum<["ativo", "inativo"]>;
|
||||
declare const status$cliente: z.ZodEnum<["ativo", "inativo"]>;
|
||||
|
||||
export { $clienteStatus, ClassPilao, PREFIXO_PILAO, Pilao, abrirNps, nomesSincronizacoes, type nomesVisoes, pAutenticacao, pPilao, pilao_enderecos, type retornoSerieConsultar, status$cliente, type tipoConstrutorPilao, type tipoRetornoSerieconsulta, type tipoTokenQuipo, type tipoUsuarioExterno, type tipo_pilao_api, type tipo_proxima_avaliacao, type tipo_zUsuarioSincronizar, tipos_acesso_quipo, type tipos_de_acesso_quipo, urlPilao, zAuntenticacaoResiduosSolicitar, zEmpreendedorSincronizar, zEmpreendimentoSincronizar, zUsuarioSincronizar, type z_tipagem_registros, ztokenQuipo };
|
||||
export { $clienteStatus, ClassPilao, PREFIXO_PILAO, Pilao, abrirNps, nomesSincronizacoes, type nomesVisoes, pPilao, pilao_enderecos, type retornoSerieConsultar, status$cliente, type tipoConstrutorPilao, type tipoRetornoSerieconsulta, type tipoTokenQuipo, type tipo_pilao_api, type tipo_proxima_avaliacao, type tipo_zUsuarioSincronizar, tipos_acesso_quipo, type tipos_de_acesso_quipo, urlPilao, zAuntenticacaoResiduosSolicitar, zEmpreendedorSincronizar, zEmpreendimentoSincronizar, zUsuarioSincronizar, type z_tipagem_registros, ztokenQuipo };
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
61
dist-require/index.d.ts
vendored
61
dist-require/index.d.ts
vendored
|
|
@ -42,49 +42,6 @@ declare const ztokenQuipo: z.ZodObject<{
|
|||
type tipos_de_acesso_quipo = z.infer<typeof ztokenQuipo>["tipo_de_acesso"];
|
||||
type tipoTokenQuipo = z.infer<typeof ztokenQuipo>;
|
||||
|
||||
declare const zAmbiente: z.ZodEnum<["desenvolvimento", "producao"]>;
|
||||
|
||||
type tipoUsuarioExterno = {
|
||||
_nome: string;
|
||||
_email: string;
|
||||
_telefone: string;
|
||||
vinculo: string;
|
||||
$cliente: string;
|
||||
chave_produto: string;
|
||||
codigo: string;
|
||||
_cpf: string;
|
||||
};
|
||||
|
||||
/** todas as rotas de comunicação com autenticador partem dessa variável */
|
||||
declare const pAutenticacao: {
|
||||
validarToken: ({ ambiente, post, }: {
|
||||
ambiente: zod.TypeOf<typeof zAmbiente>;
|
||||
post: {
|
||||
token: string;
|
||||
};
|
||||
}) => Promise<"valido" | "erro">;
|
||||
urlAutenticacao: (ambiente: zod.TypeOf<typeof zAmbiente>) => string;
|
||||
codigoContaSite: ({ ambiente, post, }: {
|
||||
ambiente: zod.TypeOf<typeof zAmbiente>;
|
||||
post: {
|
||||
site: string;
|
||||
};
|
||||
}) => Promise<p_respostas.tipoResposta<string>>;
|
||||
usuarios_quipo: ({ token_produto, ambiente, tipo, }: {
|
||||
ambiente: zod.TypeOf<typeof zAmbiente>;
|
||||
token_produto: string;
|
||||
tipo: tipos_de_acesso_quipo;
|
||||
}) => Promise<p_respostas.tipoResposta<tipoUsuarioExterno[]>>;
|
||||
usuarios_quipo_vincular: ({ token_produto, ambiente, $cliente, vinculo, codigo_usuario, email, }: {
|
||||
ambiente: zod.TypeOf<typeof zAmbiente>;
|
||||
token_produto: string;
|
||||
$cliente: string;
|
||||
vinculo: string;
|
||||
codigo_usuario?: string;
|
||||
email: string;
|
||||
}) => Promise<p_respostas.tipoResposta<string>>;
|
||||
};
|
||||
|
||||
/** aplica a todas as consultas */
|
||||
declare const z_padroes: z.ZodObject<{
|
||||
tabela: z.ZodString;
|
||||
|
|
@ -333,23 +290,23 @@ declare const zp_registrar_base_dados: z.ZodObject<{
|
|||
coluna: z.ZodString;
|
||||
tipo: z.ZodEnum<["texto", "numero", "confirmacao", "lista_texto", "lista_numero", "lista_mes", "lista_data", "mes", "data"]>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
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";
|
||||
}, {
|
||||
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: {
|
||||
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";
|
||||
}[];
|
||||
}, {
|
||||
tabela: string;
|
||||
colunas: {
|
||||
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";
|
||||
}[];
|
||||
}>;
|
||||
declare const zp_enviar_registros: z.ZodObject<{
|
||||
|
|
@ -722,23 +679,23 @@ declare const pPilao: {
|
|||
coluna: zod.ZodString;
|
||||
tipo: zod.ZodEnum<["texto", "numero", "confirmacao", "lista_texto", "lista_numero", "lista_mes", "lista_data", "mes", "data"]>;
|
||||
}, "strip", zod.ZodTypeAny, {
|
||||
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";
|
||||
}, {
|
||||
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: {
|
||||
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";
|
||||
}[];
|
||||
}, {
|
||||
tabela: string;
|
||||
colunas: {
|
||||
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";
|
||||
}[];
|
||||
}>;
|
||||
z_tipos_dados_registro: zod.ZodEnum<["texto", "numero", "confirmacao", "lista_texto", "lista_numero", "lista_mes", "lista_data", "mes", "data"]>;
|
||||
|
|
@ -1140,4 +1097,4 @@ declare const abrirNps: (emDesenvolvimento: boolean) => (parametros: tipo_proxim
|
|||
declare const $clienteStatus: z.ZodEnum<["ativo", "inativo"]>;
|
||||
declare const status$cliente: z.ZodEnum<["ativo", "inativo"]>;
|
||||
|
||||
export { $clienteStatus, ClassPilao, PREFIXO_PILAO, Pilao, abrirNps, nomesSincronizacoes, type nomesVisoes, pAutenticacao, pPilao, pilao_enderecos, type retornoSerieConsultar, status$cliente, type tipoConstrutorPilao, type tipoRetornoSerieconsulta, type tipoTokenQuipo, type tipoUsuarioExterno, type tipo_pilao_api, type tipo_proxima_avaliacao, type tipo_zUsuarioSincronizar, tipos_acesso_quipo, type tipos_de_acesso_quipo, urlPilao, zAuntenticacaoResiduosSolicitar, zEmpreendedorSincronizar, zEmpreendimentoSincronizar, zUsuarioSincronizar, type z_tipagem_registros, ztokenQuipo };
|
||||
export { $clienteStatus, ClassPilao, PREFIXO_PILAO, Pilao, abrirNps, nomesSincronizacoes, type nomesVisoes, pPilao, pilao_enderecos, type retornoSerieConsultar, status$cliente, type tipoConstrutorPilao, type tipoRetornoSerieconsulta, type tipoTokenQuipo, type tipo_pilao_api, type tipo_proxima_avaliacao, type tipo_zUsuarioSincronizar, tipos_acesso_quipo, type tipos_de_acesso_quipo, urlPilao, zAuntenticacaoResiduosSolicitar, zEmpreendedorSincronizar, zEmpreendimentoSincronizar, zUsuarioSincronizar, type z_tipagem_registros, ztokenQuipo };
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "p-drives",
|
||||
"version": "0.223.0",
|
||||
"version": "0.225.0",
|
||||
"description": "",
|
||||
"main": "src/index.ts",
|
||||
"exports": {
|
||||
|
|
|
|||
|
|
@ -1,33 +0,0 @@
|
|||
import { respostaComuns, type tipoResposta } from "p-respostas"
|
||||
import type { z } from "zod"
|
||||
import type { zAmbiente } from "../ts/ambiente"
|
||||
import { urlAutenticacao } from "./_urlAutenticacao"
|
||||
type tipoPostCodigoContaSite = { site: string }
|
||||
import node_fetch from "cross-fetch"
|
||||
|
||||
export const codigoContaSite = async ({
|
||||
ambiente,
|
||||
post,
|
||||
}: {
|
||||
ambiente: z.infer<typeof zAmbiente>
|
||||
post: tipoPostCodigoContaSite
|
||||
}): Promise<tipoResposta<string>> => {
|
||||
const url = `${urlAutenticacao(ambiente)}/api/codigo_prefeitura_site`
|
||||
|
||||
try {
|
||||
const resp = await node_fetch(url, {
|
||||
method: "POST",
|
||||
body: JSON.stringify(post),
|
||||
headers: { "Content-Type": "application/json" },
|
||||
})
|
||||
.then((r) => r.json())
|
||||
.catch((e) =>
|
||||
respostaComuns.erro("Erro ao enviar registros", [e.message]),
|
||||
)
|
||||
.then((r) => r as tipoResposta<string>)
|
||||
|
||||
return resp
|
||||
} catch (e) {
|
||||
return respostaComuns.erro(`erro ao buscar código do site: ${e}`)
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
import type { z } from "zod"
|
||||
import type { zAmbiente } from "../ts/ambiente"
|
||||
|
||||
export const urlAutenticacao = (ambiente: z.infer<typeof zAmbiente>) =>
|
||||
`${
|
||||
ambiente == "producao"
|
||||
? "https://carro-de-boi.idz.one"
|
||||
: "http://localhost:5030"
|
||||
}/autenticacao`
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
import node_fetch from "cross-fetch"
|
||||
import { respostaComuns, type tipoResposta } from "p-respostas"
|
||||
import type { z } from "zod"
|
||||
import type { tipos_de_acesso_quipo } from "../tokenQuipo"
|
||||
import type { zAmbiente } from "../ts/ambiente"
|
||||
import { urlAutenticacao } from "./_urlAutenticacao"
|
||||
|
||||
export type tipoUsuarioExterno = {
|
||||
_nome: string
|
||||
_email: string
|
||||
_telefone: string
|
||||
vinculo: string
|
||||
$cliente: string
|
||||
chave_produto: string
|
||||
codigo: string
|
||||
_cpf: string
|
||||
}
|
||||
|
||||
export const usuarios_quipo = async ({
|
||||
token_produto,
|
||||
ambiente,
|
||||
tipo,
|
||||
}: {
|
||||
ambiente: z.infer<typeof zAmbiente>
|
||||
token_produto: string
|
||||
tipo: tipos_de_acesso_quipo
|
||||
}): Promise<tipoResposta<tipoUsuarioExterno[]>> => {
|
||||
const url = `${urlAutenticacao(ambiente)}/api/usuarios_quipo`
|
||||
|
||||
if (!token_produto) return respostaComuns.erro("token_produto não informado")
|
||||
|
||||
const headers = {
|
||||
token: token_produto,
|
||||
"Content-Type": "application/json",
|
||||
}
|
||||
|
||||
return node_fetch(url, {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ tipo }),
|
||||
headers,
|
||||
})
|
||||
.then((r) => r.json())
|
||||
.catch((e) =>
|
||||
respostaComuns.erro(`Erro ao buscar usuários quipo governo ${e.message}`),
|
||||
)
|
||||
.then((r) => r as tipoResposta<tipoUsuarioExterno[]>)
|
||||
}
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
import node_fetch from "cross-fetch"
|
||||
import { respostaComuns, type tipoResposta } from "p-respostas"
|
||||
import type { z } from "zod"
|
||||
import type { zAmbiente } from "../ts/ambiente"
|
||||
import { urlAutenticacao } from "./_urlAutenticacao"
|
||||
|
||||
export const usuarios_quipo_vincular = async ({
|
||||
token_produto,
|
||||
ambiente,
|
||||
$cliente,
|
||||
vinculo,
|
||||
codigo_usuario,
|
||||
email,
|
||||
}: {
|
||||
ambiente: z.infer<typeof zAmbiente>
|
||||
token_produto: string
|
||||
$cliente: string
|
||||
vinculo: string
|
||||
codigo_usuario?: string
|
||||
email: string
|
||||
}): Promise<tipoResposta<string>> => {
|
||||
const url = `${urlAutenticacao(ambiente)}/api/vinculos__criar`
|
||||
|
||||
if (!token_produto) return respostaComuns.erro("token_produto não informado")
|
||||
const headers = {
|
||||
token: token_produto,
|
||||
"Content-Type": "application/json",
|
||||
}
|
||||
|
||||
const parametros = {
|
||||
vinculos: { $cliente, codigo_usuario, vinculo },
|
||||
email: email,
|
||||
}
|
||||
return await node_fetch(url, {
|
||||
headers,
|
||||
body: JSON.stringify(parametros),
|
||||
method: "POST",
|
||||
})
|
||||
.then(async (r) => await r.json())
|
||||
.catch((e) =>
|
||||
respostaComuns.erro(`Erro ao criar vinculo de usuario ${e.message}`),
|
||||
)
|
||||
}
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
import type { tipoResposta } from "p-respostas"
|
||||
import { urlAutenticacao } from "./_urlAutenticacao"
|
||||
type tipoPostValidarTokem = { token: string }
|
||||
import node_fetch from "cross-fetch"
|
||||
import type { z } from "zod"
|
||||
import type { zAmbiente } from "../ts/ambiente"
|
||||
|
||||
/** faz a validação do token */
|
||||
export const validarToken = async ({
|
||||
ambiente,
|
||||
post,
|
||||
}: {
|
||||
ambiente: z.infer<typeof zAmbiente>
|
||||
post: tipoPostValidarTokem
|
||||
}): Promise<"valido" | "erro"> => {
|
||||
const url = `${urlAutenticacao(ambiente)}/api/validar_token`
|
||||
|
||||
try {
|
||||
const resposta = await node_fetch(url, {
|
||||
method: "POST",
|
||||
body: JSON.stringify(post),
|
||||
headers: { "Content-Type": "application/json" },
|
||||
})
|
||||
.then((r) => r.json())
|
||||
.then((r) => r as tipoResposta<any>)
|
||||
.then((resposta) =>
|
||||
resposta.eCerto ? ("valido" as const) : ("erro" as const),
|
||||
)
|
||||
.catch(() => "erro" as const)
|
||||
|
||||
return resposta
|
||||
} catch (_e) {
|
||||
return "erro"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
import { codigoContaSite } from "./_codigoContaSite"
|
||||
import { urlAutenticacao } from "./_urlAutenticacao"
|
||||
import { type tipoUsuarioExterno, usuarios_quipo } from "./_usuarios_quipo"
|
||||
import { usuarios_quipo_vincular } from "./_usuarios_quipo_vincular"
|
||||
import { validarToken } from "./_validarToken"
|
||||
|
||||
export type { tipoUsuarioExterno }
|
||||
|
||||
/** todas as rotas de comunicação com autenticador partem dessa variável */
|
||||
export const pAutenticacao = {
|
||||
validarToken,
|
||||
urlAutenticacao,
|
||||
codigoContaSite,
|
||||
usuarios_quipo,
|
||||
usuarios_quipo_vincular,
|
||||
}
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
export * from "./tokenQuipo"
|
||||
export * from "./autenticacao"
|
||||
export * from "./pilao-de-dados"
|
||||
export * from "./residuos"
|
||||
export * from "./NPS"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue