isolamento de pacote
This commit is contained in:
commit
f34b66cbe4
96 changed files with 2285 additions and 0 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
node_modules
|
||||||
|
pacotes
|
||||||
5
.vscode/settings.json
vendored
Normal file
5
.vscode/settings.json
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"[javascript]": {
|
||||||
|
"editor.defaultFormatter": "biomejs.biome"
|
||||||
|
}
|
||||||
|
}
|
||||||
3
README.md
Normal file
3
README.md
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
Vaŕiáves e fuções para serem compartilhadas com outras aplicações
|
||||||
|
|
||||||
|
Evitar importar pacotes nessa aplicação
|
||||||
7
biome.json
Normal file
7
biome.json
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"$schema": "node_modules/@biomejs/biome/configuration_schema.json",
|
||||||
|
"extends": ["node_modules/p-comuns/Documentos/biome.json"],
|
||||||
|
"files": {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
82
bun.lock
Normal file
82
bun.lock
Normal file
|
|
@ -0,0 +1,82 @@
|
||||||
|
{
|
||||||
|
"lockfileVersion": 1,
|
||||||
|
"workspaces": {
|
||||||
|
"": {
|
||||||
|
"name": "p-autenticacao-drive",
|
||||||
|
"dependencies": {
|
||||||
|
"cross-fetch": "^4.1.0",
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@biomejs/biome": "^2.0.6",
|
||||||
|
"@types/node": "^20.16.1",
|
||||||
|
"check-node-version": "^4.2.1",
|
||||||
|
"typescript": "5.5.4",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"overrides": {
|
||||||
|
"p-comuns": "git+https://git2.idz.one/luiz/_comuns.git#master",
|
||||||
|
"p-respostas": "git+https://git2.idz.one/luiz/_respostas.git#master",
|
||||||
|
},
|
||||||
|
"packages": {
|
||||||
|
"@biomejs/biome": ["@biomejs/biome@2.0.6", "", { "optionalDependencies": { "@biomejs/cli-darwin-arm64": "2.0.6", "@biomejs/cli-darwin-x64": "2.0.6", "@biomejs/cli-linux-arm64": "2.0.6", "@biomejs/cli-linux-arm64-musl": "2.0.6", "@biomejs/cli-linux-x64": "2.0.6", "@biomejs/cli-linux-x64-musl": "2.0.6", "@biomejs/cli-win32-arm64": "2.0.6", "@biomejs/cli-win32-x64": "2.0.6" }, "bin": { "biome": "bin/biome" } }, "sha512-RRP+9cdh5qwe2t0gORwXaa27oTOiQRQvrFf49x2PA1tnpsyU7FIHX4ZOFMtBC4QNtyWsN7Dqkf5EDbg4X+9iqA=="],
|
||||||
|
|
||||||
|
"@biomejs/cli-darwin-arm64": ["@biomejs/cli-darwin-arm64@2.0.6", "", { "os": "darwin", "cpu": "arm64" }, "sha512-AzdiNNjNzsE6LfqWyBvcL29uWoIuZUkndu+wwlXW13EKcBHbbKjNQEZIJKYDc6IL+p7bmWGx3v9ZtcRyIoIz5A=="],
|
||||||
|
|
||||||
|
"@biomejs/cli-darwin-x64": ["@biomejs/cli-darwin-x64@2.0.6", "", { "os": "darwin", "cpu": "x64" }, "sha512-wJjjP4E7bO4WJmiQaLnsdXMa516dbtC6542qeRkyJg0MqMXP0fvs4gdsHhZ7p9XWTAmGIjZHFKXdsjBvKGIJJQ=="],
|
||||||
|
|
||||||
|
"@biomejs/cli-linux-arm64": ["@biomejs/cli-linux-arm64@2.0.6", "", { "os": "linux", "cpu": "arm64" }, "sha512-ZSVf6TYo5rNMUHIW1tww+rs/krol7U5A1Is/yzWyHVZguuB0lBnIodqyFuwCNqG9aJGyk7xIMS8HG0qGUPz0SA=="],
|
||||||
|
|
||||||
|
"@biomejs/cli-linux-arm64-musl": ["@biomejs/cli-linux-arm64-musl@2.0.6", "", { "os": "linux", "cpu": "arm64" }, "sha512-CVPEMlin3bW49sBqLBg2x016Pws7eUXA27XYDFlEtponD0luYjg2zQaMJ2nOqlkKG9fqzzkamdYxHdMDc2gZFw=="],
|
||||||
|
|
||||||
|
"@biomejs/cli-linux-x64": ["@biomejs/cli-linux-x64@2.0.6", "", { "os": "linux", "cpu": "x64" }, "sha512-geM1MkHTV1Kh2Cs/Xzot9BOF3WBacihw6bkEmxkz4nSga8B9/hWy5BDiOG3gHDGIBa8WxT0nzsJs2f/hPqQIQw=="],
|
||||||
|
|
||||||
|
"@biomejs/cli-linux-x64-musl": ["@biomejs/cli-linux-x64-musl@2.0.6", "", { "os": "linux", "cpu": "x64" }, "sha512-mKHE/e954hR/hSnAcJSjkf4xGqZc/53Kh39HVW1EgO5iFi0JutTN07TSjEMg616julRtfSNJi0KNyxvc30Y4rQ=="],
|
||||||
|
|
||||||
|
"@biomejs/cli-win32-arm64": ["@biomejs/cli-win32-arm64@2.0.6", "", { "os": "win32", "cpu": "arm64" }, "sha512-290V4oSFoKaprKE1zkYVsDfAdn0An5DowZ+GIABgjoq1ndhvNxkJcpxPsiYtT7slbVe3xmlT0ncdfOsN7KruzA=="],
|
||||||
|
|
||||||
|
"@biomejs/cli-win32-x64": ["@biomejs/cli-win32-x64@2.0.6", "", { "os": "win32", "cpu": "x64" }, "sha512-bfM1Bce0d69Ao7pjTjUS+AWSZ02+5UHdiAP85Th8e9yV5xzw6JrHXbL5YWlcEKQ84FIZMdDc7ncuti1wd2sdbw=="],
|
||||||
|
|
||||||
|
"@types/node": ["@types/node@20.19.4", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-OP+We5WV8Xnbuvw0zC2m4qfB/BJvjyCwtNjhHdJxV1639SGSKrLmJkc3fMnp2Qy8nJyHp8RO6umxELN/dS1/EA=="],
|
||||||
|
|
||||||
|
"ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="],
|
||||||
|
|
||||||
|
"chalk": ["chalk@3.0.0", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg=="],
|
||||||
|
|
||||||
|
"check-node-version": ["check-node-version@4.2.1", "", { "dependencies": { "chalk": "^3.0.0", "map-values": "^1.0.1", "minimist": "^1.2.0", "object-filter": "^1.0.2", "run-parallel": "^1.1.4", "semver": "^6.3.0" }, "bin": { "check-node-version": "bin.js" } }, "sha512-YYmFYHV/X7kSJhuN/QYHUu998n/TRuDe8UenM3+m5NrkiH670lb9ILqHIvBencvJc4SDh+XcbXMR4b+TtubJiw=="],
|
||||||
|
|
||||||
|
"color-convert": ["color-convert@2.0.1", "", { "dependencies": { "color-name": "~1.1.4" } }, "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="],
|
||||||
|
|
||||||
|
"color-name": ["color-name@1.1.4", "", {}, "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="],
|
||||||
|
|
||||||
|
"cross-fetch": ["cross-fetch@4.1.0", "", { "dependencies": { "node-fetch": "^2.7.0" } }, "sha512-uKm5PU+MHTootlWEY+mZ4vvXoCn4fLQxT9dSc1sXVMSFkINTJVN8cAQROpwcKm8bJ/c7rgZVIBWzH5T78sNZZw=="],
|
||||||
|
|
||||||
|
"has-flag": ["has-flag@4.0.0", "", {}, "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="],
|
||||||
|
|
||||||
|
"map-values": ["map-values@1.0.1", "", {}, "sha512-BbShUnr5OartXJe1GeccAWtfro11hhgNJg6G9/UtWKjVGvV5U4C09cg5nk8JUevhXODaXY+hQ3xxMUKSs62ONQ=="],
|
||||||
|
|
||||||
|
"minimist": ["minimist@1.2.8", "", {}, "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA=="],
|
||||||
|
|
||||||
|
"node-fetch": ["node-fetch@2.7.0", "", { "dependencies": { "whatwg-url": "^5.0.0" }, "peerDependencies": { "encoding": "^0.1.0" }, "optionalPeers": ["encoding"] }, "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A=="],
|
||||||
|
|
||||||
|
"object-filter": ["object-filter@1.0.2", "", {}, "sha512-NahvP2vZcy1ZiiYah30CEPw0FpDcSkSePJBMpzl5EQgCmISijiGuJm3SPYp7U+Lf2TljyaIw3E5EgkEx/TNEVA=="],
|
||||||
|
|
||||||
|
"queue-microtask": ["queue-microtask@1.2.3", "", {}, "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A=="],
|
||||||
|
|
||||||
|
"run-parallel": ["run-parallel@1.2.0", "", { "dependencies": { "queue-microtask": "^1.2.2" } }, "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA=="],
|
||||||
|
|
||||||
|
"semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="],
|
||||||
|
|
||||||
|
"supports-color": ["supports-color@7.2.0", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="],
|
||||||
|
|
||||||
|
"tr46": ["tr46@0.0.3", "", {}, "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="],
|
||||||
|
|
||||||
|
"typescript": ["typescript@5.5.4", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q=="],
|
||||||
|
|
||||||
|
"undici-types": ["undici-types@6.21.0", "", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="],
|
||||||
|
|
||||||
|
"webidl-conversions": ["webidl-conversions@3.0.1", "", {}, "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="],
|
||||||
|
|
||||||
|
"whatwg-url": ["whatwg-url@5.0.0", "", { "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" } }, "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw=="],
|
||||||
|
}
|
||||||
|
}
|
||||||
9
dist-import/autenticacao/_codigoContaSite.d.ts
vendored
Normal file
9
dist-import/autenticacao/_codigoContaSite.d.ts
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
import { type tipoResposta } from "p-respostas";
|
||||||
|
type tipoPostCodigoContaSite = {
|
||||||
|
site: string;
|
||||||
|
};
|
||||||
|
export declare const codigoContaSite: ({ url_api_autenticacao, post, }: {
|
||||||
|
url_api_autenticacao: string;
|
||||||
|
post: tipoPostCodigoContaSite;
|
||||||
|
}) => Promise<tipoResposta<string>>;
|
||||||
|
export {};
|
||||||
19
dist-import/autenticacao/_codigoContaSite.js
Normal file
19
dist-import/autenticacao/_codigoContaSite.js
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
import { respostaComuns } from "p-respostas";
|
||||||
|
import node_fetch from "cross-fetch";
|
||||||
|
export const codigoContaSite = async ({ url_api_autenticacao, post, }) => {
|
||||||
|
const url = `${url_api_autenticacao}/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);
|
||||||
|
return resp;
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
return respostaComuns.erro(`erro ao buscar código do site: ${e}`);
|
||||||
|
}
|
||||||
|
};
|
||||||
17
dist-import/autenticacao/_usuarios_quipo.d.ts
vendored
Normal file
17
dist-import/autenticacao/_usuarios_quipo.d.ts
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
import { type tipoResposta } from "p-respostas";
|
||||||
|
import type { tipo_usuarios__listar_retorno } from "../lista-usuarios";
|
||||||
|
export type tipoUsuarioExterno = {
|
||||||
|
_nome: string;
|
||||||
|
_email: string;
|
||||||
|
_telefone: string;
|
||||||
|
vinculo: string;
|
||||||
|
inquilino: string;
|
||||||
|
chave_produto: string;
|
||||||
|
codigo: string;
|
||||||
|
_cpf: string;
|
||||||
|
};
|
||||||
|
export declare const usuarios_quipo: ({ token_produto, url_api_autenticacao, inquilino, }: {
|
||||||
|
url_api_autenticacao: string;
|
||||||
|
token_produto: string;
|
||||||
|
inquilino: string;
|
||||||
|
}) => Promise<tipoResposta<tipo_usuarios__listar_retorno[]>>;
|
||||||
19
dist-import/autenticacao/_usuarios_quipo.js
Normal file
19
dist-import/autenticacao/_usuarios_quipo.js
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
import node_fetch from "cross-fetch";
|
||||||
|
import { respostaComuns } from "p-respostas";
|
||||||
|
export const usuarios_quipo = async ({ token_produto, url_api_autenticacao, inquilino, }) => {
|
||||||
|
const url = `${url_api_autenticacao}/api/usuarios__listar`;
|
||||||
|
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({ inquilino }),
|
||||||
|
headers,
|
||||||
|
})
|
||||||
|
.then((r) => r.json())
|
||||||
|
.catch((e) => respostaComuns.erro(`Erro ao buscar usuários quipo governo ${e.message}`))
|
||||||
|
.then((r) => r);
|
||||||
|
};
|
||||||
9
dist-import/autenticacao/_usuarios_quipo_vincular.d.ts
vendored
Normal file
9
dist-import/autenticacao/_usuarios_quipo_vincular.d.ts
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
import { type tipoResposta } from "p-respostas";
|
||||||
|
export declare const usuarios_quipo_vincular: ({ token_produto, url_api_autenticacao, inquilino_codigo, vinculo, usuario_codigo, email, }: {
|
||||||
|
url_api_autenticacao: string;
|
||||||
|
token_produto: string;
|
||||||
|
inquilino_codigo: string;
|
||||||
|
vinculo: string;
|
||||||
|
usuario_codigo?: string;
|
||||||
|
email: string;
|
||||||
|
}) => Promise<tipoResposta<string>>;
|
||||||
22
dist-import/autenticacao/_usuarios_quipo_vincular.js
Normal file
22
dist-import/autenticacao/_usuarios_quipo_vincular.js
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
import node_fetch from "cross-fetch";
|
||||||
|
import { respostaComuns } from "p-respostas";
|
||||||
|
export const usuarios_quipo_vincular = async ({ token_produto, url_api_autenticacao, inquilino_codigo, vinculo, usuario_codigo, email, }) => {
|
||||||
|
const url = `${url_api_autenticacao}/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: { inquilino_codigo, usuario_codigo, 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}`));
|
||||||
|
};
|
||||||
9
dist-import/autenticacao/_validarToken.d.ts
vendored
Normal file
9
dist-import/autenticacao/_validarToken.d.ts
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
type tipoPostValidarTokem = {
|
||||||
|
token: string;
|
||||||
|
};
|
||||||
|
/** faz a validação do token */
|
||||||
|
export declare const validarToken: ({ url_api_autenticacao, post, }: {
|
||||||
|
url_api_autenticacao: string;
|
||||||
|
post: tipoPostValidarTokem;
|
||||||
|
}) => Promise<"valido" | "erro">;
|
||||||
|
export {};
|
||||||
20
dist-import/autenticacao/_validarToken.js
Normal file
20
dist-import/autenticacao/_validarToken.js
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
import node_fetch from "cross-fetch";
|
||||||
|
/** faz a validação do token */
|
||||||
|
export const validarToken = async ({ url_api_autenticacao, post, }) => {
|
||||||
|
const url = `${url_api_autenticacao}/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)
|
||||||
|
.then((resposta) => resposta.eCerto ? "valido" : "erro")
|
||||||
|
.catch(() => "erro");
|
||||||
|
return resposta;
|
||||||
|
}
|
||||||
|
catch (_e) {
|
||||||
|
return "erro";
|
||||||
|
}
|
||||||
|
};
|
||||||
30
dist-import/autenticacao/index.d.ts
vendored
Normal file
30
dist-import/autenticacao/index.d.ts
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
import { type tipoUsuarioExterno } from "./_usuarios_quipo";
|
||||||
|
export type { tipoUsuarioExterno };
|
||||||
|
/** todas as rotas de comunicação com autenticador partem dessa variável */
|
||||||
|
export declare const pAutenticacao: {
|
||||||
|
validarToken: ({ url_api_autenticacao, post, }: {
|
||||||
|
url_api_autenticacao: string;
|
||||||
|
post: {
|
||||||
|
token: string;
|
||||||
|
};
|
||||||
|
}) => Promise<"valido" | "erro">;
|
||||||
|
codigoContaSite: ({ url_api_autenticacao, post, }: {
|
||||||
|
url_api_autenticacao: string;
|
||||||
|
post: {
|
||||||
|
site: string;
|
||||||
|
};
|
||||||
|
}) => Promise<import("p-respostas").tipoResposta<string>>;
|
||||||
|
usuarios_quipo: ({ token_produto, url_api_autenticacao, inquilino, }: {
|
||||||
|
url_api_autenticacao: string;
|
||||||
|
token_produto: string;
|
||||||
|
inquilino: string;
|
||||||
|
}) => Promise<import("p-respostas").tipoResposta<import("..").tipo_usuarios__listar_retorno[]>>;
|
||||||
|
usuarios_quipo_vincular: ({ token_produto, url_api_autenticacao, inquilino_codigo, vinculo, usuario_codigo, email, }: {
|
||||||
|
url_api_autenticacao: string;
|
||||||
|
token_produto: string;
|
||||||
|
inquilino_codigo: string;
|
||||||
|
vinculo: string;
|
||||||
|
usuario_codigo?: string;
|
||||||
|
email: string;
|
||||||
|
}) => Promise<import("p-respostas").tipoResposta<string>>;
|
||||||
|
};
|
||||||
11
dist-import/autenticacao/index.js
Normal file
11
dist-import/autenticacao/index.js
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
import { codigoContaSite } from "./_codigoContaSite";
|
||||||
|
import { usuarios_quipo } from "./_usuarios_quipo";
|
||||||
|
import { usuarios_quipo_vincular } from "./_usuarios_quipo_vincular";
|
||||||
|
import { validarToken } from "./_validarToken";
|
||||||
|
/** todas as rotas de comunicação com autenticador partem dessa variável */
|
||||||
|
export const pAutenticacao = {
|
||||||
|
validarToken,
|
||||||
|
codigoContaSite,
|
||||||
|
usuarios_quipo,
|
||||||
|
usuarios_quipo_vincular,
|
||||||
|
};
|
||||||
6
dist-import/index.d.ts
vendored
Normal file
6
dist-import/index.d.ts
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
export * from "./autenticacao";
|
||||||
|
export * from "./lista-prefeituras";
|
||||||
|
export * from "./lista-usuarios";
|
||||||
|
export * from "./lista-vinculos";
|
||||||
|
export * from "./produtos";
|
||||||
|
export * from "./tokens";
|
||||||
6
dist-import/index.js
Normal file
6
dist-import/index.js
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
export * from "./autenticacao";
|
||||||
|
export * from "./lista-prefeituras";
|
||||||
|
export * from "./lista-usuarios";
|
||||||
|
export * from "./lista-vinculos";
|
||||||
|
export * from "./produtos";
|
||||||
|
export * from "./tokens";
|
||||||
12
dist-import/lista-prefeituras.d.ts
vendored
Normal file
12
dist-import/lista-prefeituras.d.ts
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
import { type tipoResposta } from "p-respostas";
|
||||||
|
import type { chaves_produto } from "./produtos/tipagem";
|
||||||
|
export type tipoRetornoListarPrefeitrua = {
|
||||||
|
nome: string;
|
||||||
|
inquilino: string;
|
||||||
|
base_url: string;
|
||||||
|
produto: keyof typeof chaves_produto;
|
||||||
|
};
|
||||||
|
export declare const tx_listar_prefeituras: "listar_prefeituras";
|
||||||
|
export declare const listarPrefeituras: ({ url_api_autenticacao, }: {
|
||||||
|
url_api_autenticacao: string;
|
||||||
|
}) => Promise<tipoResposta<tipoRetornoListarPrefeitrua[]>>;
|
||||||
21
dist-import/lista-prefeituras.js
Normal file
21
dist-import/lista-prefeituras.js
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
import cFetch from "cross-fetch";
|
||||||
|
import { respostaComuns } from "p-respostas";
|
||||||
|
export const tx_listar_prefeituras = "listar_prefeituras";
|
||||||
|
export const listarPrefeituras = async ({ url_api_autenticacao, }) => {
|
||||||
|
const url = `${url_api_autenticacao}/api/${tx_listar_prefeituras}`;
|
||||||
|
return cFetch(url)
|
||||||
|
.then(async (a) => {
|
||||||
|
const texto = await a.text();
|
||||||
|
try {
|
||||||
|
const res = JSON.parse(texto);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
return respostaComuns.erro(`Erro ao listar cidades: ${error.message}`, [
|
||||||
|
texto,
|
||||||
|
error,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => respostaComuns.erro(`Erro ao listar cidades: ${error.message}`, [error]));
|
||||||
|
};
|
||||||
20
dist-import/lista-usuarios.d.ts
vendored
Normal file
20
dist-import/lista-usuarios.d.ts
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
import { type tipoResposta } from "p-respostas";
|
||||||
|
export declare const tx_usuarios__listar: "usuarios__listar";
|
||||||
|
export type tipo_usuarios__listar_retorno = {
|
||||||
|
inquilino: string;
|
||||||
|
vinculo: string;
|
||||||
|
codigo: string;
|
||||||
|
cpf: string;
|
||||||
|
data_hora_atualizacao: string;
|
||||||
|
email: string;
|
||||||
|
id_betha_sistema: string;
|
||||||
|
nome: string;
|
||||||
|
telefone: string;
|
||||||
|
};
|
||||||
|
export type tipo_usuarios__listar_parametros = {
|
||||||
|
inquilino?: string;
|
||||||
|
};
|
||||||
|
export declare const listarUsuarios: ({ token, url_api_autenticacao, }: {
|
||||||
|
url_api_autenticacao: string;
|
||||||
|
token: string;
|
||||||
|
}, parametros: tipo_usuarios__listar_parametros) => Promise<tipoResposta<tipo_usuarios__listar_retorno[]>>;
|
||||||
22
dist-import/lista-usuarios.js
Normal file
22
dist-import/lista-usuarios.js
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
import cFetch from "cross-fetch";
|
||||||
|
import { respostaComuns } from "p-respostas";
|
||||||
|
export const tx_usuarios__listar = "usuarios__listar";
|
||||||
|
export const listarUsuarios = async ({ token, url_api_autenticacao, }, parametros) => {
|
||||||
|
const url = `${url_api_autenticacao}/api/${tx_usuarios__listar}`;
|
||||||
|
return cFetch(url, {
|
||||||
|
headers: { token, "Content-Type": "application/json" },
|
||||||
|
body: JSON.stringify(parametros),
|
||||||
|
method: "post",
|
||||||
|
})
|
||||||
|
.then(async (a) => {
|
||||||
|
const texto = await a.text();
|
||||||
|
try {
|
||||||
|
const res = JSON.parse(texto);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
return respostaComuns.erro(`Erro ao listar usuários: ${error.message}`, [texto, error]);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => respostaComuns.erro(`Erro ao listar usuários: ${error.message}`, [error]));
|
||||||
|
};
|
||||||
16
dist-import/lista-vinculos.d.ts
vendored
Normal file
16
dist-import/lista-vinculos.d.ts
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
import { type tipoResposta } from "p-respostas";
|
||||||
|
export declare const tx_vinculos__listar: "vinculos__listar";
|
||||||
|
export type tipo_retorno_vinculo_listas = {
|
||||||
|
codigo: string;
|
||||||
|
usuario_codigo: string;
|
||||||
|
inquilino: string;
|
||||||
|
vinculo: string;
|
||||||
|
chave_produto: string;
|
||||||
|
_usuario_nome: string;
|
||||||
|
_inquilino_nome: string;
|
||||||
|
_inquilino_base_url: string;
|
||||||
|
};
|
||||||
|
export declare const listarVinculos: ({ token, url_api_autenticacao, }: {
|
||||||
|
url_api_autenticacao: string;
|
||||||
|
token: string;
|
||||||
|
}) => Promise<tipoResposta<tipo_retorno_vinculo_listas[]>>;
|
||||||
25
dist-import/lista-vinculos.js
Normal file
25
dist-import/lista-vinculos.js
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
import cFetch from "cross-fetch";
|
||||||
|
import { respostaComuns } from "p-respostas";
|
||||||
|
export const tx_vinculos__listar = "vinculos__listar";
|
||||||
|
export const listarVinculos = async ({ token, url_api_autenticacao, }) => {
|
||||||
|
const url = `${url_api_autenticacao}/api/${tx_vinculos__listar}`;
|
||||||
|
return cFetch(url, {
|
||||||
|
headers: { token, "Content-Type": "application/json" },
|
||||||
|
body: "{}",
|
||||||
|
method: "post",
|
||||||
|
})
|
||||||
|
.then(async (a) => {
|
||||||
|
const texto = await a.text();
|
||||||
|
try {
|
||||||
|
const res = JSON.parse(texto);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
return respostaComuns.erro(`Erro ao listar cidades: ${error.message}`, [
|
||||||
|
texto,
|
||||||
|
error,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => respostaComuns.erro(`Erro ao listar cidades: ${error.message}`, [error]));
|
||||||
|
};
|
||||||
2
dist-import/produtos/_betha-meio-ambiente.d.ts
vendored
Normal file
2
dist-import/produtos/_betha-meio-ambiente.d.ts
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
import { ProdutoQuipo } from "./tipagem";
|
||||||
|
export declare const produto_betha_meio_ambiente: ProdutoQuipo<"betha-meio-ambiente">;
|
||||||
9
dist-import/produtos/_betha-meio-ambiente.js
Normal file
9
dist-import/produtos/_betha-meio-ambiente.js
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
import { ProdutoQuipo } from "./tipagem";
|
||||||
|
export const produto_betha_meio_ambiente = new ProdutoQuipo({
|
||||||
|
chave_produto: "betha-meio-ambiente",
|
||||||
|
titulo: "Betha Meio Ambiente",
|
||||||
|
descricao: "Betha Meio Ambiente: Software de gestão de processos ambientais para órgãos públicos da Betha Sistemas.",
|
||||||
|
url_produto: ({ inquilino, base_url, vinculo }) => `${base_url}/${inquilino}${vinculo == "anonimo"
|
||||||
|
? ""
|
||||||
|
: `/${vinculo}#/admin`}`,
|
||||||
|
});
|
||||||
2
dist-import/produtos/_e-licencie-gov.d.ts
vendored
Normal file
2
dist-import/produtos/_e-licencie-gov.d.ts
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
import { ProdutoQuipo } from "./tipagem";
|
||||||
|
export declare const produto_e_licencie_gov: ProdutoQuipo<"e-licencie-gov">;
|
||||||
10
dist-import/produtos/_e-licencie-gov.js
Normal file
10
dist-import/produtos/_e-licencie-gov.js
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
import { produto_betha_meio_ambiente } from "./_betha-meio-ambiente";
|
||||||
|
import { ProdutoQuipo } from "./tipagem";
|
||||||
|
export const produto_e_licencie_gov = new ProdutoQuipo({
|
||||||
|
...produto_betha_meio_ambiente,
|
||||||
|
titulo: "e-Licencie Gov",
|
||||||
|
chave_produto: "e-licencie-gov",
|
||||||
|
url_produto: ({ inquilino, base_url, vinculo }) => `${base_url}/${inquilino}${vinculo == "anonimo"
|
||||||
|
? ""
|
||||||
|
: `/${vinculo}#/admin`}`,
|
||||||
|
});
|
||||||
2
dist-import/produtos/_e-licencie.d.ts
vendored
Normal file
2
dist-import/produtos/_e-licencie.d.ts
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
import { Produto } from "./tipagem";
|
||||||
|
export declare const produto_e_licencie: Produto<"e-licencie">;
|
||||||
7
dist-import/produtos/_e-licencie.js
Normal file
7
dist-import/produtos/_e-licencie.js
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
import { Produto } from "./tipagem";
|
||||||
|
export const produto_e_licencie = new Produto({
|
||||||
|
chave_produto: "e-licencie",
|
||||||
|
titulo: "e-Licencie",
|
||||||
|
descricao: "e-Licencie: Software de gestão de processos e dados ambientais.",
|
||||||
|
url_produto: ({ base_url }) => base_url,
|
||||||
|
});
|
||||||
2
dist-import/produtos/_suporte.d.ts
vendored
Normal file
2
dist-import/produtos/_suporte.d.ts
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
import { Produto } from "./tipagem";
|
||||||
|
export declare const produto_suporte: Produto<"suporte">;
|
||||||
7
dist-import/produtos/_suporte.js
Normal file
7
dist-import/produtos/_suporte.js
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
import { Produto } from "./tipagem";
|
||||||
|
export const produto_suporte = new Produto({
|
||||||
|
chave_produto: "suporte",
|
||||||
|
titulo: "Suporte",
|
||||||
|
descricao: "Gestão de contas e usuários dos produtos da e-licencie",
|
||||||
|
url_produto: ({ base_url }) => base_url,
|
||||||
|
});
|
||||||
31
dist-import/produtos/doc.d.ts
vendored
Normal file
31
dist-import/produtos/doc.d.ts
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
/**
|
||||||
|
|
||||||
|
Produtos existentes:
|
||||||
|
|
||||||
|
Atenticacao:
|
||||||
|
Acesso a gestão de produtos
|
||||||
|
Apenas uma conta com o código autenticao
|
||||||
|
/autenticacao
|
||||||
|
|
||||||
|
Betha Meio Ambiente:
|
||||||
|
Acesso a gestão da aplicação Quipo
|
||||||
|
Acesso pode ser sociedade ou governo
|
||||||
|
/quipo
|
||||||
|
Possue limite de acesso a módulos:
|
||||||
|
Licenciamento
|
||||||
|
Fiscalização
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
e-licencie GOV:
|
||||||
|
Acesso a gestão da aplicação Quipo
|
||||||
|
Acesso pode ser sociedade ou governo
|
||||||
|
/quipo
|
||||||
|
|
||||||
|
|
||||||
|
e-licencie:
|
||||||
|
Acesso a Aplicação e-licencie
|
||||||
|
Adminstrador e Não adminstrasdor
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
32
dist-import/produtos/doc.js
Normal file
32
dist-import/produtos/doc.js
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
"use strict";
|
||||||
|
/**
|
||||||
|
|
||||||
|
Produtos existentes:
|
||||||
|
|
||||||
|
Atenticacao:
|
||||||
|
Acesso a gestão de produtos
|
||||||
|
Apenas uma conta com o código autenticao
|
||||||
|
/autenticacao
|
||||||
|
|
||||||
|
Betha Meio Ambiente:
|
||||||
|
Acesso a gestão da aplicação Quipo
|
||||||
|
Acesso pode ser sociedade ou governo
|
||||||
|
/quipo
|
||||||
|
Possue limite de acesso a módulos:
|
||||||
|
Licenciamento
|
||||||
|
Fiscalização
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
e-licencie GOV:
|
||||||
|
Acesso a gestão da aplicação Quipo
|
||||||
|
Acesso pode ser sociedade ou governo
|
||||||
|
/quipo
|
||||||
|
|
||||||
|
|
||||||
|
e-licencie:
|
||||||
|
Acesso a Aplicação e-licencie
|
||||||
|
Adminstrador e Não adminstrasdor
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
9
dist-import/produtos/index.d.ts
vendored
Normal file
9
dist-import/produtos/index.d.ts
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
import { produto_betha_meio_ambiente } from "./_betha-meio-ambiente";
|
||||||
|
import { produto_e_licencie } from "./_e-licencie";
|
||||||
|
import { produto_e_licencie_gov } from "./_e-licencie-gov";
|
||||||
|
import { produto_suporte } from "./_suporte";
|
||||||
|
import { chaves_produto, opcoesVinculos, opcoesVinculosGov, Produto, provedoresGov, versao_usuarios } from "./tipagem";
|
||||||
|
export declare const listaProdutos: {
|
||||||
|
[k in keyof typeof chaves_produto]: Produto<k>;
|
||||||
|
};
|
||||||
|
export { Produto, chaves_produto, opcoesVinculosGov, opcoesVinculos, provedoresGov, produto_betha_meio_ambiente, produto_e_licencie, produto_e_licencie_gov, produto_suporte, versao_usuarios, };
|
||||||
12
dist-import/produtos/index.js
Normal file
12
dist-import/produtos/index.js
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
import { produto_betha_meio_ambiente } from "./_betha-meio-ambiente";
|
||||||
|
import { produto_e_licencie } from "./_e-licencie";
|
||||||
|
import { produto_e_licencie_gov } from "./_e-licencie-gov";
|
||||||
|
import { produto_suporte } from "./_suporte";
|
||||||
|
import { chaves_produto, opcoesVinculos, opcoesVinculosGov, Produto, provedoresGov, versao_usuarios, } from "./tipagem";
|
||||||
|
export const listaProdutos = {
|
||||||
|
"betha-meio-ambiente": produto_betha_meio_ambiente,
|
||||||
|
"e-licencie": produto_e_licencie,
|
||||||
|
"e-licencie-gov": produto_e_licencie_gov,
|
||||||
|
suporte: produto_suporte,
|
||||||
|
};
|
||||||
|
export { Produto, chaves_produto, opcoesVinculosGov, opcoesVinculos, provedoresGov, produto_betha_meio_ambiente, produto_e_licencie, produto_e_licencie_gov, produto_suporte, versao_usuarios, };
|
||||||
94
dist-import/produtos/tipagem.d.ts
vendored
Normal file
94
dist-import/produtos/tipagem.d.ts
vendored
Normal file
|
|
@ -0,0 +1,94 @@
|
||||||
|
/** Lista dos produtos da e-licencie */
|
||||||
|
export declare enum chaves_produto {
|
||||||
|
suporte = "suporte",
|
||||||
|
"betha-meio-ambiente" = "betha-meio-ambiente",
|
||||||
|
"e-licencie-gov" = "e-licencie-gov",
|
||||||
|
"e-licencie" = "e-licencie"
|
||||||
|
}
|
||||||
|
export declare const opcoesVinculosGov: {
|
||||||
|
readonly governo: "Governo";
|
||||||
|
readonly sociedade: "Sociedade";
|
||||||
|
readonly anonimo: "Anônimo";
|
||||||
|
};
|
||||||
|
export declare const opcoesVinculosSuporte: {
|
||||||
|
readonly "suporte-1": "Suporte Primário";
|
||||||
|
};
|
||||||
|
export declare const opcoesVinculos: {
|
||||||
|
readonly suporte: {
|
||||||
|
readonly "suporte-1": "Suporte Primário";
|
||||||
|
};
|
||||||
|
readonly "betha-meio-ambiente": {
|
||||||
|
readonly governo: "Governo";
|
||||||
|
readonly sociedade: "Sociedade";
|
||||||
|
readonly anonimo: "Anônimo";
|
||||||
|
};
|
||||||
|
readonly "e-licencie-gov": {
|
||||||
|
readonly governo: "Governo";
|
||||||
|
readonly sociedade: "Sociedade";
|
||||||
|
readonly anonimo: "Anônimo";
|
||||||
|
};
|
||||||
|
readonly "e-licencie": {};
|
||||||
|
};
|
||||||
|
export declare const tiposAcesso: {
|
||||||
|
readonly governo: "Governo";
|
||||||
|
readonly sociedade: "Sociedade";
|
||||||
|
readonly anonimo: "Anônimo";
|
||||||
|
};
|
||||||
|
export declare const provedoresGov: {
|
||||||
|
/** Sistema de login da Beta */
|
||||||
|
readonly "betha-sistemas": "Betha Sistemas";
|
||||||
|
/** sistema de login do altenticado */
|
||||||
|
readonly "e-licencie": "e-licencie";
|
||||||
|
};
|
||||||
|
type extruturaTokenBase = {
|
||||||
|
inquilino_codigo: string;
|
||||||
|
usuario_codigo: string;
|
||||||
|
usuario_nome: string;
|
||||||
|
codigo_acesso_produto: string;
|
||||||
|
codigo_autenticacao: string;
|
||||||
|
};
|
||||||
|
type extrutruaraTokenQuipo = extruturaTokenBase & {
|
||||||
|
inquilino_nome: string;
|
||||||
|
tipo_de_acesso: keyof typeof opcoesVinculosGov;
|
||||||
|
provedor: keyof typeof provedoresGov;
|
||||||
|
};
|
||||||
|
export declare class Produto<C extends keyof typeof chaves_produto> {
|
||||||
|
/** Chave do produto*/
|
||||||
|
chave_produto: C;
|
||||||
|
/** Titulo do produto */
|
||||||
|
titulo: string;
|
||||||
|
/** Descrição do módulo */
|
||||||
|
descricao: string;
|
||||||
|
/** URL base do módulo */
|
||||||
|
url_produto: (_: {
|
||||||
|
inquilino: string;
|
||||||
|
base_url: string;
|
||||||
|
vinculo: string;
|
||||||
|
}) => string;
|
||||||
|
constructor(_: {
|
||||||
|
/** Chave do produto*/ chave_produto: C;
|
||||||
|
/** Titulo do produto */
|
||||||
|
titulo: string;
|
||||||
|
/** Descrição do módulo */
|
||||||
|
descricao: string;
|
||||||
|
/** URL base do módulo */
|
||||||
|
url_produto: (_: {
|
||||||
|
inquilino: string;
|
||||||
|
base_url: string;
|
||||||
|
vinculo: string;
|
||||||
|
}) => string;
|
||||||
|
});
|
||||||
|
extruturaToken(_: extruturaTokenBase): extruturaTokenBase & {
|
||||||
|
chave_produto: C;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
export declare class ProdutoQuipo<C extends keyof typeof chaves_produto> extends Produto<C> {
|
||||||
|
extruturaToken(_: extrutruaraTokenQuipo): extrutruaraTokenQuipo & {
|
||||||
|
chave_produto: C;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
export declare enum versao_usuarios {
|
||||||
|
versao_usuarios_autenticacao = "versao_usuarios_autenticacao",
|
||||||
|
versao_usuarios_quipo = "versao_usuarios_quipo"
|
||||||
|
}
|
||||||
|
export {};
|
||||||
50
dist-import/produtos/tipagem.js
Normal file
50
dist-import/produtos/tipagem.js
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
/** Lista dos produtos da e-licencie */
|
||||||
|
export var chaves_produto;
|
||||||
|
(function (chaves_produto) {
|
||||||
|
chaves_produto["suporte"] = "suporte";
|
||||||
|
chaves_produto["betha-meio-ambiente"] = "betha-meio-ambiente";
|
||||||
|
chaves_produto["e-licencie-gov"] = "e-licencie-gov";
|
||||||
|
chaves_produto["e-licencie"] = "e-licencie";
|
||||||
|
})(chaves_produto || (chaves_produto = {}));
|
||||||
|
export const opcoesVinculosGov = {
|
||||||
|
governo: "Governo",
|
||||||
|
sociedade: "Sociedade",
|
||||||
|
anonimo: "Anônimo",
|
||||||
|
};
|
||||||
|
export const opcoesVinculosSuporte = {
|
||||||
|
"suporte-1": "Suporte Primário",
|
||||||
|
};
|
||||||
|
export const opcoesVinculos = {
|
||||||
|
[chaves_produto.suporte]: opcoesVinculosSuporte,
|
||||||
|
[chaves_produto["betha-meio-ambiente"]]: opcoesVinculosGov,
|
||||||
|
[chaves_produto["e-licencie-gov"]]: opcoesVinculosGov,
|
||||||
|
[chaves_produto["e-licencie"]]: {},
|
||||||
|
};
|
||||||
|
export const tiposAcesso = opcoesVinculosGov;
|
||||||
|
export const provedoresGov = {
|
||||||
|
/** Sistema de login da Beta */
|
||||||
|
"betha-sistemas": "Betha Sistemas",
|
||||||
|
/** sistema de login do altenticado */
|
||||||
|
"e-licencie": "e-licencie",
|
||||||
|
};
|
||||||
|
export class Produto {
|
||||||
|
constructor(_) {
|
||||||
|
this.chave_produto = _.chave_produto;
|
||||||
|
this.titulo = _.titulo;
|
||||||
|
this.descricao = _.descricao;
|
||||||
|
this.url_produto = _.url_produto;
|
||||||
|
}
|
||||||
|
extruturaToken(_) {
|
||||||
|
return { ..._, chave_produto: this.chave_produto };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export class ProdutoQuipo extends Produto {
|
||||||
|
extruturaToken(_) {
|
||||||
|
return { ..._, chave_produto: this.chave_produto };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export var versao_usuarios;
|
||||||
|
(function (versao_usuarios) {
|
||||||
|
versao_usuarios["versao_usuarios_autenticacao"] = "versao_usuarios_autenticacao";
|
||||||
|
versao_usuarios["versao_usuarios_quipo"] = "versao_usuarios_quipo";
|
||||||
|
})(versao_usuarios || (versao_usuarios = {}));
|
||||||
10
dist-import/tokens/index.d.ts
vendored
Normal file
10
dist-import/tokens/index.d.ts
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
import type { provedoresGov } from "../produtos";
|
||||||
|
export type tipoUsuarioTokenAutneticacao = {
|
||||||
|
usuario_codigo: string;
|
||||||
|
usuario_nome: string;
|
||||||
|
usuario_email: string;
|
||||||
|
usuario_cpf: string;
|
||||||
|
autenticacao_codigo: string;
|
||||||
|
eSuporte: boolean;
|
||||||
|
autenticacao_provedor: keyof typeof provedoresGov;
|
||||||
|
};
|
||||||
1
dist-import/tokens/index.js
Normal file
1
dist-import/tokens/index.js
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
export {};
|
||||||
9
dist-require/autenticacao/_codigoContaSite.d.ts
vendored
Normal file
9
dist-require/autenticacao/_codigoContaSite.d.ts
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
import { type tipoResposta } from "p-respostas";
|
||||||
|
type tipoPostCodigoContaSite = {
|
||||||
|
site: string;
|
||||||
|
};
|
||||||
|
export declare const codigoContaSite: ({ url_api_autenticacao, post, }: {
|
||||||
|
url_api_autenticacao: string;
|
||||||
|
post: tipoPostCodigoContaSite;
|
||||||
|
}) => Promise<tipoResposta<string>>;
|
||||||
|
export {};
|
||||||
26
dist-require/autenticacao/_codigoContaSite.js
Normal file
26
dist-require/autenticacao/_codigoContaSite.js
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
"use strict";
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.codigoContaSite = void 0;
|
||||||
|
const p_respostas_1 = require("p-respostas");
|
||||||
|
const cross_fetch_1 = __importDefault(require("cross-fetch"));
|
||||||
|
const codigoContaSite = async ({ url_api_autenticacao, post, }) => {
|
||||||
|
const url = `${url_api_autenticacao}/api/codigo_prefeitura_site`;
|
||||||
|
try {
|
||||||
|
const resp = await (0, cross_fetch_1.default)(url, {
|
||||||
|
method: "POST",
|
||||||
|
body: JSON.stringify(post),
|
||||||
|
headers: { "Content-Type": "application/json" },
|
||||||
|
})
|
||||||
|
.then((r) => r.json())
|
||||||
|
.catch((e) => p_respostas_1.respostaComuns.erro("Erro ao enviar registros", [e.message]))
|
||||||
|
.then((r) => r);
|
||||||
|
return resp;
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
return p_respostas_1.respostaComuns.erro(`erro ao buscar código do site: ${e}`);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
exports.codigoContaSite = codigoContaSite;
|
||||||
17
dist-require/autenticacao/_usuarios_quipo.d.ts
vendored
Normal file
17
dist-require/autenticacao/_usuarios_quipo.d.ts
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
import { type tipoResposta } from "p-respostas";
|
||||||
|
import type { tipo_usuarios__listar_retorno } from "../lista-usuarios";
|
||||||
|
export type tipoUsuarioExterno = {
|
||||||
|
_nome: string;
|
||||||
|
_email: string;
|
||||||
|
_telefone: string;
|
||||||
|
vinculo: string;
|
||||||
|
inquilino: string;
|
||||||
|
chave_produto: string;
|
||||||
|
codigo: string;
|
||||||
|
_cpf: string;
|
||||||
|
};
|
||||||
|
export declare const usuarios_quipo: ({ token_produto, url_api_autenticacao, inquilino, }: {
|
||||||
|
url_api_autenticacao: string;
|
||||||
|
token_produto: string;
|
||||||
|
inquilino: string;
|
||||||
|
}) => Promise<tipoResposta<tipo_usuarios__listar_retorno[]>>;
|
||||||
26
dist-require/autenticacao/_usuarios_quipo.js
Normal file
26
dist-require/autenticacao/_usuarios_quipo.js
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
"use strict";
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.usuarios_quipo = void 0;
|
||||||
|
const cross_fetch_1 = __importDefault(require("cross-fetch"));
|
||||||
|
const p_respostas_1 = require("p-respostas");
|
||||||
|
const usuarios_quipo = async ({ token_produto, url_api_autenticacao, inquilino, }) => {
|
||||||
|
const url = `${url_api_autenticacao}/api/usuarios__listar`;
|
||||||
|
if (!token_produto)
|
||||||
|
return p_respostas_1.respostaComuns.erro("token_produto não informado");
|
||||||
|
const headers = {
|
||||||
|
token: token_produto,
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
};
|
||||||
|
return (0, cross_fetch_1.default)(url, {
|
||||||
|
method: "POST",
|
||||||
|
body: JSON.stringify({ inquilino }),
|
||||||
|
headers,
|
||||||
|
})
|
||||||
|
.then((r) => r.json())
|
||||||
|
.catch((e) => p_respostas_1.respostaComuns.erro(`Erro ao buscar usuários quipo governo ${e.message}`))
|
||||||
|
.then((r) => r);
|
||||||
|
};
|
||||||
|
exports.usuarios_quipo = usuarios_quipo;
|
||||||
9
dist-require/autenticacao/_usuarios_quipo_vincular.d.ts
vendored
Normal file
9
dist-require/autenticacao/_usuarios_quipo_vincular.d.ts
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
import { type tipoResposta } from "p-respostas";
|
||||||
|
export declare const usuarios_quipo_vincular: ({ token_produto, url_api_autenticacao, inquilino_codigo, vinculo, usuario_codigo, email, }: {
|
||||||
|
url_api_autenticacao: string;
|
||||||
|
token_produto: string;
|
||||||
|
inquilino_codigo: string;
|
||||||
|
vinculo: string;
|
||||||
|
usuario_codigo?: string;
|
||||||
|
email: string;
|
||||||
|
}) => Promise<tipoResposta<string>>;
|
||||||
29
dist-require/autenticacao/_usuarios_quipo_vincular.js
Normal file
29
dist-require/autenticacao/_usuarios_quipo_vincular.js
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
"use strict";
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.usuarios_quipo_vincular = void 0;
|
||||||
|
const cross_fetch_1 = __importDefault(require("cross-fetch"));
|
||||||
|
const p_respostas_1 = require("p-respostas");
|
||||||
|
const usuarios_quipo_vincular = async ({ token_produto, url_api_autenticacao, inquilino_codigo, vinculo, usuario_codigo, email, }) => {
|
||||||
|
const url = `${url_api_autenticacao}/api/vinculos__criar`;
|
||||||
|
if (!token_produto)
|
||||||
|
return p_respostas_1.respostaComuns.erro("token_produto não informado");
|
||||||
|
const headers = {
|
||||||
|
token: token_produto,
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
};
|
||||||
|
const parametros = {
|
||||||
|
vinculos: { inquilino_codigo, usuario_codigo, vinculo },
|
||||||
|
email: email,
|
||||||
|
};
|
||||||
|
return await (0, cross_fetch_1.default)(url, {
|
||||||
|
headers,
|
||||||
|
body: JSON.stringify(parametros),
|
||||||
|
method: "POST",
|
||||||
|
})
|
||||||
|
.then(async (r) => await r.json())
|
||||||
|
.catch((e) => p_respostas_1.respostaComuns.erro(`Erro ao criar vinculo de usuario ${e.message}`));
|
||||||
|
};
|
||||||
|
exports.usuarios_quipo_vincular = usuarios_quipo_vincular;
|
||||||
9
dist-require/autenticacao/_validarToken.d.ts
vendored
Normal file
9
dist-require/autenticacao/_validarToken.d.ts
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
type tipoPostValidarTokem = {
|
||||||
|
token: string;
|
||||||
|
};
|
||||||
|
/** faz a validação do token */
|
||||||
|
export declare const validarToken: ({ url_api_autenticacao, post, }: {
|
||||||
|
url_api_autenticacao: string;
|
||||||
|
post: tipoPostValidarTokem;
|
||||||
|
}) => Promise<"valido" | "erro">;
|
||||||
|
export {};
|
||||||
27
dist-require/autenticacao/_validarToken.js
Normal file
27
dist-require/autenticacao/_validarToken.js
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
"use strict";
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.validarToken = void 0;
|
||||||
|
const cross_fetch_1 = __importDefault(require("cross-fetch"));
|
||||||
|
/** faz a validação do token */
|
||||||
|
const validarToken = async ({ url_api_autenticacao, post, }) => {
|
||||||
|
const url = `${url_api_autenticacao}/api/validar_token`;
|
||||||
|
try {
|
||||||
|
const resposta = await (0, cross_fetch_1.default)(url, {
|
||||||
|
method: "POST",
|
||||||
|
body: JSON.stringify(post),
|
||||||
|
headers: { "Content-Type": "application/json" },
|
||||||
|
})
|
||||||
|
.then((r) => r.json())
|
||||||
|
.then((r) => r)
|
||||||
|
.then((resposta) => resposta.eCerto ? "valido" : "erro")
|
||||||
|
.catch(() => "erro");
|
||||||
|
return resposta;
|
||||||
|
}
|
||||||
|
catch (_e) {
|
||||||
|
return "erro";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
exports.validarToken = validarToken;
|
||||||
30
dist-require/autenticacao/index.d.ts
vendored
Normal file
30
dist-require/autenticacao/index.d.ts
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
import { type tipoUsuarioExterno } from "./_usuarios_quipo";
|
||||||
|
export type { tipoUsuarioExterno };
|
||||||
|
/** todas as rotas de comunicação com autenticador partem dessa variável */
|
||||||
|
export declare const pAutenticacao: {
|
||||||
|
validarToken: ({ url_api_autenticacao, post, }: {
|
||||||
|
url_api_autenticacao: string;
|
||||||
|
post: {
|
||||||
|
token: string;
|
||||||
|
};
|
||||||
|
}) => Promise<"valido" | "erro">;
|
||||||
|
codigoContaSite: ({ url_api_autenticacao, post, }: {
|
||||||
|
url_api_autenticacao: string;
|
||||||
|
post: {
|
||||||
|
site: string;
|
||||||
|
};
|
||||||
|
}) => Promise<import("p-respostas").tipoResposta<string>>;
|
||||||
|
usuarios_quipo: ({ token_produto, url_api_autenticacao, inquilino, }: {
|
||||||
|
url_api_autenticacao: string;
|
||||||
|
token_produto: string;
|
||||||
|
inquilino: string;
|
||||||
|
}) => Promise<import("p-respostas").tipoResposta<import("..").tipo_usuarios__listar_retorno[]>>;
|
||||||
|
usuarios_quipo_vincular: ({ token_produto, url_api_autenticacao, inquilino_codigo, vinculo, usuario_codigo, email, }: {
|
||||||
|
url_api_autenticacao: string;
|
||||||
|
token_produto: string;
|
||||||
|
inquilino_codigo: string;
|
||||||
|
vinculo: string;
|
||||||
|
usuario_codigo?: string;
|
||||||
|
email: string;
|
||||||
|
}) => Promise<import("p-respostas").tipoResposta<string>>;
|
||||||
|
};
|
||||||
14
dist-require/autenticacao/index.js
Normal file
14
dist-require/autenticacao/index.js
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.pAutenticacao = void 0;
|
||||||
|
const _codigoContaSite_1 = require("./_codigoContaSite");
|
||||||
|
const _usuarios_quipo_1 = require("./_usuarios_quipo");
|
||||||
|
const _usuarios_quipo_vincular_1 = require("./_usuarios_quipo_vincular");
|
||||||
|
const _validarToken_1 = require("./_validarToken");
|
||||||
|
/** todas as rotas de comunicação com autenticador partem dessa variável */
|
||||||
|
exports.pAutenticacao = {
|
||||||
|
validarToken: _validarToken_1.validarToken,
|
||||||
|
codigoContaSite: _codigoContaSite_1.codigoContaSite,
|
||||||
|
usuarios_quipo: _usuarios_quipo_1.usuarios_quipo,
|
||||||
|
usuarios_quipo_vincular: _usuarios_quipo_vincular_1.usuarios_quipo_vincular,
|
||||||
|
};
|
||||||
6
dist-require/index.d.ts
vendored
Normal file
6
dist-require/index.d.ts
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
export * from "./autenticacao";
|
||||||
|
export * from "./lista-prefeituras";
|
||||||
|
export * from "./lista-usuarios";
|
||||||
|
export * from "./lista-vinculos";
|
||||||
|
export * from "./produtos";
|
||||||
|
export * from "./tokens";
|
||||||
22
dist-require/index.js
Normal file
22
dist-require/index.js
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
"use strict";
|
||||||
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
|
if (k2 === undefined) k2 = k;
|
||||||
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
|
}) : (function(o, m, k, k2) {
|
||||||
|
if (k2 === undefined) k2 = k;
|
||||||
|
o[k2] = m[k];
|
||||||
|
}));
|
||||||
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||||
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
__exportStar(require("./autenticacao"), exports);
|
||||||
|
__exportStar(require("./lista-prefeituras"), exports);
|
||||||
|
__exportStar(require("./lista-usuarios"), exports);
|
||||||
|
__exportStar(require("./lista-vinculos"), exports);
|
||||||
|
__exportStar(require("./produtos"), exports);
|
||||||
|
__exportStar(require("./tokens"), exports);
|
||||||
12
dist-require/lista-prefeituras.d.ts
vendored
Normal file
12
dist-require/lista-prefeituras.d.ts
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
import { type tipoResposta } from "p-respostas";
|
||||||
|
import type { chaves_produto } from "./produtos/tipagem";
|
||||||
|
export type tipoRetornoListarPrefeitrua = {
|
||||||
|
nome: string;
|
||||||
|
inquilino: string;
|
||||||
|
base_url: string;
|
||||||
|
produto: keyof typeof chaves_produto;
|
||||||
|
};
|
||||||
|
export declare const tx_listar_prefeituras: "listar_prefeituras";
|
||||||
|
export declare const listarPrefeituras: ({ url_api_autenticacao, }: {
|
||||||
|
url_api_autenticacao: string;
|
||||||
|
}) => Promise<tipoResposta<tipoRetornoListarPrefeitrua[]>>;
|
||||||
28
dist-require/lista-prefeituras.js
Normal file
28
dist-require/lista-prefeituras.js
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
"use strict";
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.listarPrefeituras = exports.tx_listar_prefeituras = void 0;
|
||||||
|
const cross_fetch_1 = __importDefault(require("cross-fetch"));
|
||||||
|
const p_respostas_1 = require("p-respostas");
|
||||||
|
exports.tx_listar_prefeituras = "listar_prefeituras";
|
||||||
|
const listarPrefeituras = async ({ url_api_autenticacao, }) => {
|
||||||
|
const url = `${url_api_autenticacao}/api/${exports.tx_listar_prefeituras}`;
|
||||||
|
return (0, cross_fetch_1.default)(url)
|
||||||
|
.then(async (a) => {
|
||||||
|
const texto = await a.text();
|
||||||
|
try {
|
||||||
|
const res = JSON.parse(texto);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
return p_respostas_1.respostaComuns.erro(`Erro ao listar cidades: ${error.message}`, [
|
||||||
|
texto,
|
||||||
|
error,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => p_respostas_1.respostaComuns.erro(`Erro ao listar cidades: ${error.message}`, [error]));
|
||||||
|
};
|
||||||
|
exports.listarPrefeituras = listarPrefeituras;
|
||||||
20
dist-require/lista-usuarios.d.ts
vendored
Normal file
20
dist-require/lista-usuarios.d.ts
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
import { type tipoResposta } from "p-respostas";
|
||||||
|
export declare const tx_usuarios__listar: "usuarios__listar";
|
||||||
|
export type tipo_usuarios__listar_retorno = {
|
||||||
|
inquilino: string;
|
||||||
|
vinculo: string;
|
||||||
|
codigo: string;
|
||||||
|
cpf: string;
|
||||||
|
data_hora_atualizacao: string;
|
||||||
|
email: string;
|
||||||
|
id_betha_sistema: string;
|
||||||
|
nome: string;
|
||||||
|
telefone: string;
|
||||||
|
};
|
||||||
|
export type tipo_usuarios__listar_parametros = {
|
||||||
|
inquilino?: string;
|
||||||
|
};
|
||||||
|
export declare const listarUsuarios: ({ token, url_api_autenticacao, }: {
|
||||||
|
url_api_autenticacao: string;
|
||||||
|
token: string;
|
||||||
|
}, parametros: tipo_usuarios__listar_parametros) => Promise<tipoResposta<tipo_usuarios__listar_retorno[]>>;
|
||||||
29
dist-require/lista-usuarios.js
Normal file
29
dist-require/lista-usuarios.js
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
"use strict";
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.listarUsuarios = exports.tx_usuarios__listar = void 0;
|
||||||
|
const cross_fetch_1 = __importDefault(require("cross-fetch"));
|
||||||
|
const p_respostas_1 = require("p-respostas");
|
||||||
|
exports.tx_usuarios__listar = "usuarios__listar";
|
||||||
|
const listarUsuarios = async ({ token, url_api_autenticacao, }, parametros) => {
|
||||||
|
const url = `${url_api_autenticacao}/api/${exports.tx_usuarios__listar}`;
|
||||||
|
return (0, cross_fetch_1.default)(url, {
|
||||||
|
headers: { token, "Content-Type": "application/json" },
|
||||||
|
body: JSON.stringify(parametros),
|
||||||
|
method: "post",
|
||||||
|
})
|
||||||
|
.then(async (a) => {
|
||||||
|
const texto = await a.text();
|
||||||
|
try {
|
||||||
|
const res = JSON.parse(texto);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
return p_respostas_1.respostaComuns.erro(`Erro ao listar usuários: ${error.message}`, [texto, error]);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => p_respostas_1.respostaComuns.erro(`Erro ao listar usuários: ${error.message}`, [error]));
|
||||||
|
};
|
||||||
|
exports.listarUsuarios = listarUsuarios;
|
||||||
16
dist-require/lista-vinculos.d.ts
vendored
Normal file
16
dist-require/lista-vinculos.d.ts
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
import { type tipoResposta } from "p-respostas";
|
||||||
|
export declare const tx_vinculos__listar: "vinculos__listar";
|
||||||
|
export type tipo_retorno_vinculo_listas = {
|
||||||
|
codigo: string;
|
||||||
|
usuario_codigo: string;
|
||||||
|
inquilino: string;
|
||||||
|
vinculo: string;
|
||||||
|
chave_produto: string;
|
||||||
|
_usuario_nome: string;
|
||||||
|
_inquilino_nome: string;
|
||||||
|
_inquilino_base_url: string;
|
||||||
|
};
|
||||||
|
export declare const listarVinculos: ({ token, url_api_autenticacao, }: {
|
||||||
|
url_api_autenticacao: string;
|
||||||
|
token: string;
|
||||||
|
}) => Promise<tipoResposta<tipo_retorno_vinculo_listas[]>>;
|
||||||
32
dist-require/lista-vinculos.js
Normal file
32
dist-require/lista-vinculos.js
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
"use strict";
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.listarVinculos = exports.tx_vinculos__listar = void 0;
|
||||||
|
const cross_fetch_1 = __importDefault(require("cross-fetch"));
|
||||||
|
const p_respostas_1 = require("p-respostas");
|
||||||
|
exports.tx_vinculos__listar = "vinculos__listar";
|
||||||
|
const listarVinculos = async ({ token, url_api_autenticacao, }) => {
|
||||||
|
const url = `${url_api_autenticacao}/api/${exports.tx_vinculos__listar}`;
|
||||||
|
return (0, cross_fetch_1.default)(url, {
|
||||||
|
headers: { token, "Content-Type": "application/json" },
|
||||||
|
body: "{}",
|
||||||
|
method: "post",
|
||||||
|
})
|
||||||
|
.then(async (a) => {
|
||||||
|
const texto = await a.text();
|
||||||
|
try {
|
||||||
|
const res = JSON.parse(texto);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
return p_respostas_1.respostaComuns.erro(`Erro ao listar cidades: ${error.message}`, [
|
||||||
|
texto,
|
||||||
|
error,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => p_respostas_1.respostaComuns.erro(`Erro ao listar cidades: ${error.message}`, [error]));
|
||||||
|
};
|
||||||
|
exports.listarVinculos = listarVinculos;
|
||||||
2
dist-require/produtos/_betha-meio-ambiente.d.ts
vendored
Normal file
2
dist-require/produtos/_betha-meio-ambiente.d.ts
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
import { ProdutoQuipo } from "./tipagem";
|
||||||
|
export declare const produto_betha_meio_ambiente: ProdutoQuipo<"betha-meio-ambiente">;
|
||||||
12
dist-require/produtos/_betha-meio-ambiente.js
Normal file
12
dist-require/produtos/_betha-meio-ambiente.js
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.produto_betha_meio_ambiente = void 0;
|
||||||
|
const tipagem_1 = require("./tipagem");
|
||||||
|
exports.produto_betha_meio_ambiente = new tipagem_1.ProdutoQuipo({
|
||||||
|
chave_produto: "betha-meio-ambiente",
|
||||||
|
titulo: "Betha Meio Ambiente",
|
||||||
|
descricao: "Betha Meio Ambiente: Software de gestão de processos ambientais para órgãos públicos da Betha Sistemas.",
|
||||||
|
url_produto: ({ inquilino, base_url, vinculo }) => `${base_url}/${inquilino}${vinculo == "anonimo"
|
||||||
|
? ""
|
||||||
|
: `/${vinculo}#/admin`}`,
|
||||||
|
});
|
||||||
2
dist-require/produtos/_e-licencie-gov.d.ts
vendored
Normal file
2
dist-require/produtos/_e-licencie-gov.d.ts
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
import { ProdutoQuipo } from "./tipagem";
|
||||||
|
export declare const produto_e_licencie_gov: ProdutoQuipo<"e-licencie-gov">;
|
||||||
13
dist-require/produtos/_e-licencie-gov.js
Normal file
13
dist-require/produtos/_e-licencie-gov.js
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.produto_e_licencie_gov = void 0;
|
||||||
|
const _betha_meio_ambiente_1 = require("./_betha-meio-ambiente");
|
||||||
|
const tipagem_1 = require("./tipagem");
|
||||||
|
exports.produto_e_licencie_gov = new tipagem_1.ProdutoQuipo({
|
||||||
|
..._betha_meio_ambiente_1.produto_betha_meio_ambiente,
|
||||||
|
titulo: "e-Licencie Gov",
|
||||||
|
chave_produto: "e-licencie-gov",
|
||||||
|
url_produto: ({ inquilino, base_url, vinculo }) => `${base_url}/${inquilino}${vinculo == "anonimo"
|
||||||
|
? ""
|
||||||
|
: `/${vinculo}#/admin`}`,
|
||||||
|
});
|
||||||
2
dist-require/produtos/_e-licencie.d.ts
vendored
Normal file
2
dist-require/produtos/_e-licencie.d.ts
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
import { Produto } from "./tipagem";
|
||||||
|
export declare const produto_e_licencie: Produto<"e-licencie">;
|
||||||
10
dist-require/produtos/_e-licencie.js
Normal file
10
dist-require/produtos/_e-licencie.js
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.produto_e_licencie = void 0;
|
||||||
|
const tipagem_1 = require("./tipagem");
|
||||||
|
exports.produto_e_licencie = new tipagem_1.Produto({
|
||||||
|
chave_produto: "e-licencie",
|
||||||
|
titulo: "e-Licencie",
|
||||||
|
descricao: "e-Licencie: Software de gestão de processos e dados ambientais.",
|
||||||
|
url_produto: ({ base_url }) => base_url,
|
||||||
|
});
|
||||||
2
dist-require/produtos/_suporte.d.ts
vendored
Normal file
2
dist-require/produtos/_suporte.d.ts
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
import { Produto } from "./tipagem";
|
||||||
|
export declare const produto_suporte: Produto<"suporte">;
|
||||||
10
dist-require/produtos/_suporte.js
Normal file
10
dist-require/produtos/_suporte.js
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.produto_suporte = void 0;
|
||||||
|
const tipagem_1 = require("./tipagem");
|
||||||
|
exports.produto_suporte = new tipagem_1.Produto({
|
||||||
|
chave_produto: "suporte",
|
||||||
|
titulo: "Suporte",
|
||||||
|
descricao: "Gestão de contas e usuários dos produtos da e-licencie",
|
||||||
|
url_produto: ({ base_url }) => base_url,
|
||||||
|
});
|
||||||
31
dist-require/produtos/doc.d.ts
vendored
Normal file
31
dist-require/produtos/doc.d.ts
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
/**
|
||||||
|
|
||||||
|
Produtos existentes:
|
||||||
|
|
||||||
|
Atenticacao:
|
||||||
|
Acesso a gestão de produtos
|
||||||
|
Apenas uma conta com o código autenticao
|
||||||
|
/autenticacao
|
||||||
|
|
||||||
|
Betha Meio Ambiente:
|
||||||
|
Acesso a gestão da aplicação Quipo
|
||||||
|
Acesso pode ser sociedade ou governo
|
||||||
|
/quipo
|
||||||
|
Possue limite de acesso a módulos:
|
||||||
|
Licenciamento
|
||||||
|
Fiscalização
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
e-licencie GOV:
|
||||||
|
Acesso a gestão da aplicação Quipo
|
||||||
|
Acesso pode ser sociedade ou governo
|
||||||
|
/quipo
|
||||||
|
|
||||||
|
|
||||||
|
e-licencie:
|
||||||
|
Acesso a Aplicação e-licencie
|
||||||
|
Adminstrador e Não adminstrasdor
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
32
dist-require/produtos/doc.js
Normal file
32
dist-require/produtos/doc.js
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
"use strict";
|
||||||
|
/**
|
||||||
|
|
||||||
|
Produtos existentes:
|
||||||
|
|
||||||
|
Atenticacao:
|
||||||
|
Acesso a gestão de produtos
|
||||||
|
Apenas uma conta com o código autenticao
|
||||||
|
/autenticacao
|
||||||
|
|
||||||
|
Betha Meio Ambiente:
|
||||||
|
Acesso a gestão da aplicação Quipo
|
||||||
|
Acesso pode ser sociedade ou governo
|
||||||
|
/quipo
|
||||||
|
Possue limite de acesso a módulos:
|
||||||
|
Licenciamento
|
||||||
|
Fiscalização
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
e-licencie GOV:
|
||||||
|
Acesso a gestão da aplicação Quipo
|
||||||
|
Acesso pode ser sociedade ou governo
|
||||||
|
/quipo
|
||||||
|
|
||||||
|
|
||||||
|
e-licencie:
|
||||||
|
Acesso a Aplicação e-licencie
|
||||||
|
Adminstrador e Não adminstrasdor
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
9
dist-require/produtos/index.d.ts
vendored
Normal file
9
dist-require/produtos/index.d.ts
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
import { produto_betha_meio_ambiente } from "./_betha-meio-ambiente";
|
||||||
|
import { produto_e_licencie } from "./_e-licencie";
|
||||||
|
import { produto_e_licencie_gov } from "./_e-licencie-gov";
|
||||||
|
import { produto_suporte } from "./_suporte";
|
||||||
|
import { chaves_produto, opcoesVinculos, opcoesVinculosGov, Produto, provedoresGov, versao_usuarios } from "./tipagem";
|
||||||
|
export declare const listaProdutos: {
|
||||||
|
[k in keyof typeof chaves_produto]: Produto<k>;
|
||||||
|
};
|
||||||
|
export { Produto, chaves_produto, opcoesVinculosGov, opcoesVinculos, provedoresGov, produto_betha_meio_ambiente, produto_e_licencie, produto_e_licencie_gov, produto_suporte, versao_usuarios, };
|
||||||
24
dist-require/produtos/index.js
Normal file
24
dist-require/produtos/index.js
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.versao_usuarios = exports.produto_suporte = exports.produto_e_licencie_gov = exports.produto_e_licencie = exports.produto_betha_meio_ambiente = exports.provedoresGov = exports.opcoesVinculos = exports.opcoesVinculosGov = exports.chaves_produto = exports.Produto = exports.listaProdutos = void 0;
|
||||||
|
const _betha_meio_ambiente_1 = require("./_betha-meio-ambiente");
|
||||||
|
Object.defineProperty(exports, "produto_betha_meio_ambiente", { enumerable: true, get: function () { return _betha_meio_ambiente_1.produto_betha_meio_ambiente; } });
|
||||||
|
const _e_licencie_1 = require("./_e-licencie");
|
||||||
|
Object.defineProperty(exports, "produto_e_licencie", { enumerable: true, get: function () { return _e_licencie_1.produto_e_licencie; } });
|
||||||
|
const _e_licencie_gov_1 = require("./_e-licencie-gov");
|
||||||
|
Object.defineProperty(exports, "produto_e_licencie_gov", { enumerable: true, get: function () { return _e_licencie_gov_1.produto_e_licencie_gov; } });
|
||||||
|
const _suporte_1 = require("./_suporte");
|
||||||
|
Object.defineProperty(exports, "produto_suporte", { enumerable: true, get: function () { return _suporte_1.produto_suporte; } });
|
||||||
|
const tipagem_1 = require("./tipagem");
|
||||||
|
Object.defineProperty(exports, "chaves_produto", { enumerable: true, get: function () { return tipagem_1.chaves_produto; } });
|
||||||
|
Object.defineProperty(exports, "opcoesVinculos", { enumerable: true, get: function () { return tipagem_1.opcoesVinculos; } });
|
||||||
|
Object.defineProperty(exports, "opcoesVinculosGov", { enumerable: true, get: function () { return tipagem_1.opcoesVinculosGov; } });
|
||||||
|
Object.defineProperty(exports, "Produto", { enumerable: true, get: function () { return tipagem_1.Produto; } });
|
||||||
|
Object.defineProperty(exports, "provedoresGov", { enumerable: true, get: function () { return tipagem_1.provedoresGov; } });
|
||||||
|
Object.defineProperty(exports, "versao_usuarios", { enumerable: true, get: function () { return tipagem_1.versao_usuarios; } });
|
||||||
|
exports.listaProdutos = {
|
||||||
|
"betha-meio-ambiente": _betha_meio_ambiente_1.produto_betha_meio_ambiente,
|
||||||
|
"e-licencie": _e_licencie_1.produto_e_licencie,
|
||||||
|
"e-licencie-gov": _e_licencie_gov_1.produto_e_licencie_gov,
|
||||||
|
suporte: _suporte_1.produto_suporte,
|
||||||
|
};
|
||||||
94
dist-require/produtos/tipagem.d.ts
vendored
Normal file
94
dist-require/produtos/tipagem.d.ts
vendored
Normal file
|
|
@ -0,0 +1,94 @@
|
||||||
|
/** Lista dos produtos da e-licencie */
|
||||||
|
export declare enum chaves_produto {
|
||||||
|
suporte = "suporte",
|
||||||
|
"betha-meio-ambiente" = "betha-meio-ambiente",
|
||||||
|
"e-licencie-gov" = "e-licencie-gov",
|
||||||
|
"e-licencie" = "e-licencie"
|
||||||
|
}
|
||||||
|
export declare const opcoesVinculosGov: {
|
||||||
|
readonly governo: "Governo";
|
||||||
|
readonly sociedade: "Sociedade";
|
||||||
|
readonly anonimo: "Anônimo";
|
||||||
|
};
|
||||||
|
export declare const opcoesVinculosSuporte: {
|
||||||
|
readonly "suporte-1": "Suporte Primário";
|
||||||
|
};
|
||||||
|
export declare const opcoesVinculos: {
|
||||||
|
readonly suporte: {
|
||||||
|
readonly "suporte-1": "Suporte Primário";
|
||||||
|
};
|
||||||
|
readonly "betha-meio-ambiente": {
|
||||||
|
readonly governo: "Governo";
|
||||||
|
readonly sociedade: "Sociedade";
|
||||||
|
readonly anonimo: "Anônimo";
|
||||||
|
};
|
||||||
|
readonly "e-licencie-gov": {
|
||||||
|
readonly governo: "Governo";
|
||||||
|
readonly sociedade: "Sociedade";
|
||||||
|
readonly anonimo: "Anônimo";
|
||||||
|
};
|
||||||
|
readonly "e-licencie": {};
|
||||||
|
};
|
||||||
|
export declare const tiposAcesso: {
|
||||||
|
readonly governo: "Governo";
|
||||||
|
readonly sociedade: "Sociedade";
|
||||||
|
readonly anonimo: "Anônimo";
|
||||||
|
};
|
||||||
|
export declare const provedoresGov: {
|
||||||
|
/** Sistema de login da Beta */
|
||||||
|
readonly "betha-sistemas": "Betha Sistemas";
|
||||||
|
/** sistema de login do altenticado */
|
||||||
|
readonly "e-licencie": "e-licencie";
|
||||||
|
};
|
||||||
|
type extruturaTokenBase = {
|
||||||
|
inquilino_codigo: string;
|
||||||
|
usuario_codigo: string;
|
||||||
|
usuario_nome: string;
|
||||||
|
codigo_acesso_produto: string;
|
||||||
|
codigo_autenticacao: string;
|
||||||
|
};
|
||||||
|
type extrutruaraTokenQuipo = extruturaTokenBase & {
|
||||||
|
inquilino_nome: string;
|
||||||
|
tipo_de_acesso: keyof typeof opcoesVinculosGov;
|
||||||
|
provedor: keyof typeof provedoresGov;
|
||||||
|
};
|
||||||
|
export declare class Produto<C extends keyof typeof chaves_produto> {
|
||||||
|
/** Chave do produto*/
|
||||||
|
chave_produto: C;
|
||||||
|
/** Titulo do produto */
|
||||||
|
titulo: string;
|
||||||
|
/** Descrição do módulo */
|
||||||
|
descricao: string;
|
||||||
|
/** URL base do módulo */
|
||||||
|
url_produto: (_: {
|
||||||
|
inquilino: string;
|
||||||
|
base_url: string;
|
||||||
|
vinculo: string;
|
||||||
|
}) => string;
|
||||||
|
constructor(_: {
|
||||||
|
/** Chave do produto*/ chave_produto: C;
|
||||||
|
/** Titulo do produto */
|
||||||
|
titulo: string;
|
||||||
|
/** Descrição do módulo */
|
||||||
|
descricao: string;
|
||||||
|
/** URL base do módulo */
|
||||||
|
url_produto: (_: {
|
||||||
|
inquilino: string;
|
||||||
|
base_url: string;
|
||||||
|
vinculo: string;
|
||||||
|
}) => string;
|
||||||
|
});
|
||||||
|
extruturaToken(_: extruturaTokenBase): extruturaTokenBase & {
|
||||||
|
chave_produto: C;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
export declare class ProdutoQuipo<C extends keyof typeof chaves_produto> extends Produto<C> {
|
||||||
|
extruturaToken(_: extrutruaraTokenQuipo): extrutruaraTokenQuipo & {
|
||||||
|
chave_produto: C;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
export declare enum versao_usuarios {
|
||||||
|
versao_usuarios_autenticacao = "versao_usuarios_autenticacao",
|
||||||
|
versao_usuarios_quipo = "versao_usuarios_quipo"
|
||||||
|
}
|
||||||
|
export {};
|
||||||
55
dist-require/produtos/tipagem.js
Normal file
55
dist-require/produtos/tipagem.js
Normal file
|
|
@ -0,0 +1,55 @@
|
||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.versao_usuarios = exports.ProdutoQuipo = exports.Produto = exports.provedoresGov = exports.tiposAcesso = exports.opcoesVinculos = exports.opcoesVinculosSuporte = exports.opcoesVinculosGov = exports.chaves_produto = void 0;
|
||||||
|
/** Lista dos produtos da e-licencie */
|
||||||
|
var chaves_produto;
|
||||||
|
(function (chaves_produto) {
|
||||||
|
chaves_produto["suporte"] = "suporte";
|
||||||
|
chaves_produto["betha-meio-ambiente"] = "betha-meio-ambiente";
|
||||||
|
chaves_produto["e-licencie-gov"] = "e-licencie-gov";
|
||||||
|
chaves_produto["e-licencie"] = "e-licencie";
|
||||||
|
})(chaves_produto || (exports.chaves_produto = chaves_produto = {}));
|
||||||
|
exports.opcoesVinculosGov = {
|
||||||
|
governo: "Governo",
|
||||||
|
sociedade: "Sociedade",
|
||||||
|
anonimo: "Anônimo",
|
||||||
|
};
|
||||||
|
exports.opcoesVinculosSuporte = {
|
||||||
|
"suporte-1": "Suporte Primário",
|
||||||
|
};
|
||||||
|
exports.opcoesVinculos = {
|
||||||
|
[chaves_produto.suporte]: exports.opcoesVinculosSuporte,
|
||||||
|
[chaves_produto["betha-meio-ambiente"]]: exports.opcoesVinculosGov,
|
||||||
|
[chaves_produto["e-licencie-gov"]]: exports.opcoesVinculosGov,
|
||||||
|
[chaves_produto["e-licencie"]]: {},
|
||||||
|
};
|
||||||
|
exports.tiposAcesso = exports.opcoesVinculosGov;
|
||||||
|
exports.provedoresGov = {
|
||||||
|
/** Sistema de login da Beta */
|
||||||
|
"betha-sistemas": "Betha Sistemas",
|
||||||
|
/** sistema de login do altenticado */
|
||||||
|
"e-licencie": "e-licencie",
|
||||||
|
};
|
||||||
|
class Produto {
|
||||||
|
constructor(_) {
|
||||||
|
this.chave_produto = _.chave_produto;
|
||||||
|
this.titulo = _.titulo;
|
||||||
|
this.descricao = _.descricao;
|
||||||
|
this.url_produto = _.url_produto;
|
||||||
|
}
|
||||||
|
extruturaToken(_) {
|
||||||
|
return { ..._, chave_produto: this.chave_produto };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.Produto = Produto;
|
||||||
|
class ProdutoQuipo extends Produto {
|
||||||
|
extruturaToken(_) {
|
||||||
|
return { ..._, chave_produto: this.chave_produto };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.ProdutoQuipo = ProdutoQuipo;
|
||||||
|
var versao_usuarios;
|
||||||
|
(function (versao_usuarios) {
|
||||||
|
versao_usuarios["versao_usuarios_autenticacao"] = "versao_usuarios_autenticacao";
|
||||||
|
versao_usuarios["versao_usuarios_quipo"] = "versao_usuarios_quipo";
|
||||||
|
})(versao_usuarios || (exports.versao_usuarios = versao_usuarios = {}));
|
||||||
10
dist-require/tokens/index.d.ts
vendored
Normal file
10
dist-require/tokens/index.d.ts
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
import type { provedoresGov } from "../produtos";
|
||||||
|
export type tipoUsuarioTokenAutneticacao = {
|
||||||
|
usuario_codigo: string;
|
||||||
|
usuario_nome: string;
|
||||||
|
usuario_email: string;
|
||||||
|
usuario_cpf: string;
|
||||||
|
autenticacao_codigo: string;
|
||||||
|
eSuporte: boolean;
|
||||||
|
autenticacao_provedor: keyof typeof provedoresGov;
|
||||||
|
};
|
||||||
2
dist-require/tokens/index.js
Normal file
2
dist-require/tokens/index.js
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
42
package.json
Normal file
42
package.json
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
{
|
||||||
|
"name": "p-autenticacao-drive",
|
||||||
|
"version": "1.22.0",
|
||||||
|
"description": "",
|
||||||
|
"main": "src/index.ts",
|
||||||
|
"packageManager": "pnpm@9.15.4",
|
||||||
|
"exports": {
|
||||||
|
".": {
|
||||||
|
"import": "./dist-import/index.js",
|
||||||
|
"require": "./dist-require/index.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"at": "pnpm up @biomejs/biome typescript",
|
||||||
|
"build-back": "rm -fr dist-require && tsc --project ./tsconfig-back.json",
|
||||||
|
"build-front": "rm -fr dist-import && tsc --project ./tsconfig-front.json",
|
||||||
|
"build": "pnpm run biome && pnpm run build-back && pnpm run build-front",
|
||||||
|
"pacote": "npm --no-git-tag-version version minor && sh ./pacote.sh",
|
||||||
|
"biome": "npx @biomejs/biome check --write ./src && npx @biomejs/biome check --write ./package.json",
|
||||||
|
"nodev": "check-node-version --node '>= 20'"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"cross-fetch": "^4.1.0"
|
||||||
|
},
|
||||||
|
"overrides": {
|
||||||
|
"p-comuns": "git+https://git2.idz.one/e-licencie/_comuns.git#master",
|
||||||
|
"p-respostas": "git+https://git2.idz.one/e-licencie/_respostas.git#master"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@biomejs/biome": "^2.0.6",
|
||||||
|
"@types/node": "^20.16.1",
|
||||||
|
"check-node-version": "^4.2.1",
|
||||||
|
"typescript": "5.5.4"
|
||||||
|
},
|
||||||
|
"keywords": [],
|
||||||
|
"author": {
|
||||||
|
"name": "AZTECA SOFTWARE LTDA",
|
||||||
|
"email": "ti@e-licencie.com.br",
|
||||||
|
"url": "https://e-licencie.com.br"
|
||||||
|
},
|
||||||
|
"license": "ISC"
|
||||||
|
}
|
||||||
27
pacote.sh
Normal file
27
pacote.sh
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Diretório onde o pacote será salvo
|
||||||
|
PACOTE_DIR="./pacotes"
|
||||||
|
|
||||||
|
# Criar o diretório se não existir
|
||||||
|
mkdir -p $PACOTE_DIR
|
||||||
|
|
||||||
|
# Executar build e empacotar o pacote
|
||||||
|
echo "🚀 Gerando pacote..."
|
||||||
|
pnpm run build && pnpm pack --pack-destination $PACOTE_DIR
|
||||||
|
|
||||||
|
# Obtém o último arquivo .tgz gerado
|
||||||
|
PACOTE_FILE=$(ls -t $PACOTE_DIR/*.tgz | head -n 1)
|
||||||
|
|
||||||
|
# URL do servidor onde o arquivo será enviado
|
||||||
|
UPLOAD_URL="https://e-licencie.com.br/pacotes/"
|
||||||
|
|
||||||
|
# Verifica se o arquivo existe antes de enviar
|
||||||
|
if [ -f "$PACOTE_FILE" ]; then
|
||||||
|
echo "📤 Enviando pacote: $PACOTE_FILE para $UPLOAD_URL"
|
||||||
|
curl -X POST -F "file=@$PACOTE_FILE" "$UPLOAD_URL"
|
||||||
|
echo ""
|
||||||
|
else
|
||||||
|
echo "❌ Erro: Nenhum arquivo encontrado em $PACOTE_DIR"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
298
pnpm-lock.yaml
generated
Normal file
298
pnpm-lock.yaml
generated
Normal file
|
|
@ -0,0 +1,298 @@
|
||||||
|
lockfileVersion: '9.0'
|
||||||
|
|
||||||
|
settings:
|
||||||
|
autoInstallPeers: true
|
||||||
|
excludeLinksFromLockfile: false
|
||||||
|
|
||||||
|
importers:
|
||||||
|
|
||||||
|
.:
|
||||||
|
dependencies:
|
||||||
|
cross-fetch:
|
||||||
|
specifier: ^4.1.0
|
||||||
|
version: 4.1.0
|
||||||
|
p-comuns:
|
||||||
|
specifier: git+https://git2.idz.one/luiz/_comuns.git
|
||||||
|
version: git+https://git2.idz.one/luiz/_comuns.git#0011c9b222deaeb60932191cc1995412a0ba06dd
|
||||||
|
p-respostas:
|
||||||
|
specifier: git+https://git2.idz.one/luiz/_respostas.git
|
||||||
|
version: git+https://git2.idz.one/luiz/_respostas.git#a00d459a800f6238ba00fbcdcbceaa2fe666d42b
|
||||||
|
devDependencies:
|
||||||
|
'@biomejs/biome':
|
||||||
|
specifier: ^2.0.6
|
||||||
|
version: 2.0.6
|
||||||
|
'@types/node':
|
||||||
|
specifier: ^20.16.1
|
||||||
|
version: 20.19.2
|
||||||
|
check-node-version:
|
||||||
|
specifier: ^4.2.1
|
||||||
|
version: 4.2.1
|
||||||
|
typescript:
|
||||||
|
specifier: 5.5.4
|
||||||
|
version: 5.5.4
|
||||||
|
|
||||||
|
packages:
|
||||||
|
|
||||||
|
'@biomejs/biome@2.0.6':
|
||||||
|
resolution: {integrity: sha512-RRP+9cdh5qwe2t0gORwXaa27oTOiQRQvrFf49x2PA1tnpsyU7FIHX4ZOFMtBC4QNtyWsN7Dqkf5EDbg4X+9iqA==}
|
||||||
|
engines: {node: '>=14.21.3'}
|
||||||
|
hasBin: true
|
||||||
|
|
||||||
|
'@biomejs/cli-darwin-arm64@2.0.6':
|
||||||
|
resolution: {integrity: sha512-AzdiNNjNzsE6LfqWyBvcL29uWoIuZUkndu+wwlXW13EKcBHbbKjNQEZIJKYDc6IL+p7bmWGx3v9ZtcRyIoIz5A==}
|
||||||
|
engines: {node: '>=14.21.3'}
|
||||||
|
cpu: [arm64]
|
||||||
|
os: [darwin]
|
||||||
|
|
||||||
|
'@biomejs/cli-darwin-x64@2.0.6':
|
||||||
|
resolution: {integrity: sha512-wJjjP4E7bO4WJmiQaLnsdXMa516dbtC6542qeRkyJg0MqMXP0fvs4gdsHhZ7p9XWTAmGIjZHFKXdsjBvKGIJJQ==}
|
||||||
|
engines: {node: '>=14.21.3'}
|
||||||
|
cpu: [x64]
|
||||||
|
os: [darwin]
|
||||||
|
|
||||||
|
'@biomejs/cli-linux-arm64-musl@2.0.6':
|
||||||
|
resolution: {integrity: sha512-CVPEMlin3bW49sBqLBg2x016Pws7eUXA27XYDFlEtponD0luYjg2zQaMJ2nOqlkKG9fqzzkamdYxHdMDc2gZFw==}
|
||||||
|
engines: {node: '>=14.21.3'}
|
||||||
|
cpu: [arm64]
|
||||||
|
os: [linux]
|
||||||
|
|
||||||
|
'@biomejs/cli-linux-arm64@2.0.6':
|
||||||
|
resolution: {integrity: sha512-ZSVf6TYo5rNMUHIW1tww+rs/krol7U5A1Is/yzWyHVZguuB0lBnIodqyFuwCNqG9aJGyk7xIMS8HG0qGUPz0SA==}
|
||||||
|
engines: {node: '>=14.21.3'}
|
||||||
|
cpu: [arm64]
|
||||||
|
os: [linux]
|
||||||
|
|
||||||
|
'@biomejs/cli-linux-x64-musl@2.0.6':
|
||||||
|
resolution: {integrity: sha512-mKHE/e954hR/hSnAcJSjkf4xGqZc/53Kh39HVW1EgO5iFi0JutTN07TSjEMg616julRtfSNJi0KNyxvc30Y4rQ==}
|
||||||
|
engines: {node: '>=14.21.3'}
|
||||||
|
cpu: [x64]
|
||||||
|
os: [linux]
|
||||||
|
|
||||||
|
'@biomejs/cli-linux-x64@2.0.6':
|
||||||
|
resolution: {integrity: sha512-geM1MkHTV1Kh2Cs/Xzot9BOF3WBacihw6bkEmxkz4nSga8B9/hWy5BDiOG3gHDGIBa8WxT0nzsJs2f/hPqQIQw==}
|
||||||
|
engines: {node: '>=14.21.3'}
|
||||||
|
cpu: [x64]
|
||||||
|
os: [linux]
|
||||||
|
|
||||||
|
'@biomejs/cli-win32-arm64@2.0.6':
|
||||||
|
resolution: {integrity: sha512-290V4oSFoKaprKE1zkYVsDfAdn0An5DowZ+GIABgjoq1ndhvNxkJcpxPsiYtT7slbVe3xmlT0ncdfOsN7KruzA==}
|
||||||
|
engines: {node: '>=14.21.3'}
|
||||||
|
cpu: [arm64]
|
||||||
|
os: [win32]
|
||||||
|
|
||||||
|
'@biomejs/cli-win32-x64@2.0.6':
|
||||||
|
resolution: {integrity: sha512-bfM1Bce0d69Ao7pjTjUS+AWSZ02+5UHdiAP85Th8e9yV5xzw6JrHXbL5YWlcEKQ84FIZMdDc7ncuti1wd2sdbw==}
|
||||||
|
engines: {node: '>=14.21.3'}
|
||||||
|
cpu: [x64]
|
||||||
|
os: [win32]
|
||||||
|
|
||||||
|
'@types/node@20.19.2':
|
||||||
|
resolution: {integrity: sha512-9pLGGwdzOUBDYi0GNjM97FIA+f92fqSke6joWeBjWXllfNxZBs7qeMF7tvtOIsbY45xkWkxrdwUfUf3MnQa9gA==}
|
||||||
|
|
||||||
|
ansi-styles@4.3.0:
|
||||||
|
resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==}
|
||||||
|
engines: {node: '>=8'}
|
||||||
|
|
||||||
|
chalk@3.0.0:
|
||||||
|
resolution: {integrity: sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==}
|
||||||
|
engines: {node: '>=8'}
|
||||||
|
|
||||||
|
check-node-version@4.2.1:
|
||||||
|
resolution: {integrity: sha512-YYmFYHV/X7kSJhuN/QYHUu998n/TRuDe8UenM3+m5NrkiH670lb9ILqHIvBencvJc4SDh+XcbXMR4b+TtubJiw==}
|
||||||
|
engines: {node: '>=8.3.0'}
|
||||||
|
hasBin: true
|
||||||
|
|
||||||
|
color-convert@2.0.1:
|
||||||
|
resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==}
|
||||||
|
engines: {node: '>=7.0.0'}
|
||||||
|
|
||||||
|
color-name@1.1.4:
|
||||||
|
resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==}
|
||||||
|
|
||||||
|
cross-fetch@4.1.0:
|
||||||
|
resolution: {integrity: sha512-uKm5PU+MHTootlWEY+mZ4vvXoCn4fLQxT9dSc1sXVMSFkINTJVN8cAQROpwcKm8bJ/c7rgZVIBWzH5T78sNZZw==}
|
||||||
|
|
||||||
|
has-flag@4.0.0:
|
||||||
|
resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}
|
||||||
|
engines: {node: '>=8'}
|
||||||
|
|
||||||
|
map-values@1.0.1:
|
||||||
|
resolution: {integrity: sha512-BbShUnr5OartXJe1GeccAWtfro11hhgNJg6G9/UtWKjVGvV5U4C09cg5nk8JUevhXODaXY+hQ3xxMUKSs62ONQ==}
|
||||||
|
|
||||||
|
minimist@1.2.8:
|
||||||
|
resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}
|
||||||
|
|
||||||
|
node-fetch@2.7.0:
|
||||||
|
resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==}
|
||||||
|
engines: {node: 4.x || >=6.0.0}
|
||||||
|
peerDependencies:
|
||||||
|
encoding: ^0.1.0
|
||||||
|
peerDependenciesMeta:
|
||||||
|
encoding:
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
object-filter@1.0.2:
|
||||||
|
resolution: {integrity: sha512-NahvP2vZcy1ZiiYah30CEPw0FpDcSkSePJBMpzl5EQgCmISijiGuJm3SPYp7U+Lf2TljyaIw3E5EgkEx/TNEVA==}
|
||||||
|
|
||||||
|
p-comuns@git+https://git2.idz.one/luiz/_comuns.git#0011c9b222deaeb60932191cc1995412a0ba06dd:
|
||||||
|
resolution: {commit: 0011c9b222deaeb60932191cc1995412a0ba06dd, repo: https://git2.idz.one/luiz/_comuns.git, type: git}
|
||||||
|
version: 0.119.0
|
||||||
|
|
||||||
|
p-respostas@git+https://git2.idz.one/luiz/_respostas.git#a00d459a800f6238ba00fbcdcbceaa2fe666d42b:
|
||||||
|
resolution: {commit: a00d459a800f6238ba00fbcdcbceaa2fe666d42b, repo: https://git2.idz.one/luiz/_respostas.git, type: git}
|
||||||
|
version: 0.36.0
|
||||||
|
|
||||||
|
queue-microtask@1.2.3:
|
||||||
|
resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
|
||||||
|
|
||||||
|
run-parallel@1.2.0:
|
||||||
|
resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==}
|
||||||
|
|
||||||
|
semver@6.3.1:
|
||||||
|
resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==}
|
||||||
|
hasBin: true
|
||||||
|
|
||||||
|
supports-color@7.2.0:
|
||||||
|
resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==}
|
||||||
|
engines: {node: '>=8'}
|
||||||
|
|
||||||
|
tr46@0.0.3:
|
||||||
|
resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==}
|
||||||
|
|
||||||
|
typescript@5.5.4:
|
||||||
|
resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==}
|
||||||
|
engines: {node: '>=14.17'}
|
||||||
|
hasBin: true
|
||||||
|
|
||||||
|
undici-types@6.21.0:
|
||||||
|
resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==}
|
||||||
|
|
||||||
|
webidl-conversions@3.0.1:
|
||||||
|
resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}
|
||||||
|
|
||||||
|
whatwg-url@5.0.0:
|
||||||
|
resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==}
|
||||||
|
|
||||||
|
zod@3.24.1:
|
||||||
|
resolution: {integrity: sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==}
|
||||||
|
|
||||||
|
snapshots:
|
||||||
|
|
||||||
|
'@biomejs/biome@2.0.6':
|
||||||
|
optionalDependencies:
|
||||||
|
'@biomejs/cli-darwin-arm64': 2.0.6
|
||||||
|
'@biomejs/cli-darwin-x64': 2.0.6
|
||||||
|
'@biomejs/cli-linux-arm64': 2.0.6
|
||||||
|
'@biomejs/cli-linux-arm64-musl': 2.0.6
|
||||||
|
'@biomejs/cli-linux-x64': 2.0.6
|
||||||
|
'@biomejs/cli-linux-x64-musl': 2.0.6
|
||||||
|
'@biomejs/cli-win32-arm64': 2.0.6
|
||||||
|
'@biomejs/cli-win32-x64': 2.0.6
|
||||||
|
|
||||||
|
'@biomejs/cli-darwin-arm64@2.0.6':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@biomejs/cli-darwin-x64@2.0.6':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@biomejs/cli-linux-arm64-musl@2.0.6':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@biomejs/cli-linux-arm64@2.0.6':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@biomejs/cli-linux-x64-musl@2.0.6':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@biomejs/cli-linux-x64@2.0.6':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@biomejs/cli-win32-arm64@2.0.6':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@biomejs/cli-win32-x64@2.0.6':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@types/node@20.19.2':
|
||||||
|
dependencies:
|
||||||
|
undici-types: 6.21.0
|
||||||
|
|
||||||
|
ansi-styles@4.3.0:
|
||||||
|
dependencies:
|
||||||
|
color-convert: 2.0.1
|
||||||
|
|
||||||
|
chalk@3.0.0:
|
||||||
|
dependencies:
|
||||||
|
ansi-styles: 4.3.0
|
||||||
|
supports-color: 7.2.0
|
||||||
|
|
||||||
|
check-node-version@4.2.1:
|
||||||
|
dependencies:
|
||||||
|
chalk: 3.0.0
|
||||||
|
map-values: 1.0.1
|
||||||
|
minimist: 1.2.8
|
||||||
|
object-filter: 1.0.2
|
||||||
|
run-parallel: 1.2.0
|
||||||
|
semver: 6.3.1
|
||||||
|
|
||||||
|
color-convert@2.0.1:
|
||||||
|
dependencies:
|
||||||
|
color-name: 1.1.4
|
||||||
|
|
||||||
|
color-name@1.1.4: {}
|
||||||
|
|
||||||
|
cross-fetch@4.1.0:
|
||||||
|
dependencies:
|
||||||
|
node-fetch: 2.7.0
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- encoding
|
||||||
|
|
||||||
|
has-flag@4.0.0: {}
|
||||||
|
|
||||||
|
map-values@1.0.1: {}
|
||||||
|
|
||||||
|
minimist@1.2.8: {}
|
||||||
|
|
||||||
|
node-fetch@2.7.0:
|
||||||
|
dependencies:
|
||||||
|
whatwg-url: 5.0.0
|
||||||
|
|
||||||
|
object-filter@1.0.2: {}
|
||||||
|
|
||||||
|
p-comuns@git+https://git2.idz.one/luiz/_comuns.git#0011c9b222deaeb60932191cc1995412a0ba06dd:
|
||||||
|
dependencies:
|
||||||
|
cross-fetch: 4.1.0
|
||||||
|
zod: 3.24.1
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- encoding
|
||||||
|
|
||||||
|
p-respostas@git+https://git2.idz.one/luiz/_respostas.git#a00d459a800f6238ba00fbcdcbceaa2fe666d42b:
|
||||||
|
dependencies:
|
||||||
|
zod: 3.24.1
|
||||||
|
|
||||||
|
queue-microtask@1.2.3: {}
|
||||||
|
|
||||||
|
run-parallel@1.2.0:
|
||||||
|
dependencies:
|
||||||
|
queue-microtask: 1.2.3
|
||||||
|
|
||||||
|
semver@6.3.1: {}
|
||||||
|
|
||||||
|
supports-color@7.2.0:
|
||||||
|
dependencies:
|
||||||
|
has-flag: 4.0.0
|
||||||
|
|
||||||
|
tr46@0.0.3: {}
|
||||||
|
|
||||||
|
typescript@5.5.4: {}
|
||||||
|
|
||||||
|
undici-types@6.21.0: {}
|
||||||
|
|
||||||
|
webidl-conversions@3.0.1: {}
|
||||||
|
|
||||||
|
whatwg-url@5.0.0:
|
||||||
|
dependencies:
|
||||||
|
tr46: 0.0.3
|
||||||
|
webidl-conversions: 3.0.1
|
||||||
|
|
||||||
|
zod@3.24.1: {}
|
||||||
32
src/autenticacao/_codigoContaSite.ts
Normal file
32
src/autenticacao/_codigoContaSite.ts
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
import { respostaComuns, type tipoResposta } from "p-respostas"
|
||||||
|
|
||||||
|
type tipoPostCodigoContaSite = { site: string }
|
||||||
|
|
||||||
|
import node_fetch from "cross-fetch"
|
||||||
|
|
||||||
|
export const codigoContaSite = async ({
|
||||||
|
url_api_autenticacao,
|
||||||
|
post,
|
||||||
|
}: {
|
||||||
|
url_api_autenticacao: string
|
||||||
|
post: tipoPostCodigoContaSite
|
||||||
|
}): Promise<tipoResposta<string>> => {
|
||||||
|
const url = `${url_api_autenticacao}/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}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
44
src/autenticacao/_usuarios_quipo.ts
Normal file
44
src/autenticacao/_usuarios_quipo.ts
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
import node_fetch from "cross-fetch"
|
||||||
|
import { respostaComuns, type tipoResposta } from "p-respostas"
|
||||||
|
import type { tipo_usuarios__listar_retorno } from "../lista-usuarios"
|
||||||
|
|
||||||
|
export type tipoUsuarioExterno = {
|
||||||
|
_nome: string
|
||||||
|
_email: string
|
||||||
|
_telefone: string
|
||||||
|
vinculo: string
|
||||||
|
inquilino: string
|
||||||
|
chave_produto: string
|
||||||
|
codigo: string
|
||||||
|
_cpf: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export const usuarios_quipo = async ({
|
||||||
|
token_produto,
|
||||||
|
url_api_autenticacao,
|
||||||
|
inquilino,
|
||||||
|
}: {
|
||||||
|
url_api_autenticacao: string
|
||||||
|
token_produto: string
|
||||||
|
inquilino: string
|
||||||
|
}): Promise<tipoResposta<tipo_usuarios__listar_retorno[]>> => {
|
||||||
|
const url = `${url_api_autenticacao}/api/usuarios__listar`
|
||||||
|
|
||||||
|
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({ inquilino }),
|
||||||
|
headers,
|
||||||
|
})
|
||||||
|
.then((r) => r.json())
|
||||||
|
.catch((e) =>
|
||||||
|
respostaComuns.erro(`Erro ao buscar usuários quipo governo ${e.message}`),
|
||||||
|
)
|
||||||
|
.then((r) => r as tipoResposta<tipo_usuarios__listar_retorno[]>)
|
||||||
|
}
|
||||||
40
src/autenticacao/_usuarios_quipo_vincular.ts
Normal file
40
src/autenticacao/_usuarios_quipo_vincular.ts
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
import node_fetch from "cross-fetch"
|
||||||
|
import { respostaComuns, type tipoResposta } from "p-respostas"
|
||||||
|
|
||||||
|
export const usuarios_quipo_vincular = async ({
|
||||||
|
token_produto,
|
||||||
|
url_api_autenticacao,
|
||||||
|
inquilino_codigo,
|
||||||
|
vinculo,
|
||||||
|
usuario_codigo,
|
||||||
|
email,
|
||||||
|
}: {
|
||||||
|
url_api_autenticacao: string
|
||||||
|
token_produto: string
|
||||||
|
inquilino_codigo: string
|
||||||
|
vinculo: string
|
||||||
|
usuario_codigo?: string
|
||||||
|
email: string
|
||||||
|
}): Promise<tipoResposta<string>> => {
|
||||||
|
const url = `${url_api_autenticacao}/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: { inquilino_codigo, usuario_codigo, 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}`),
|
||||||
|
)
|
||||||
|
}
|
||||||
34
src/autenticacao/_validarToken.ts
Normal file
34
src/autenticacao/_validarToken.ts
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
import type { tipoResposta } from "p-respostas"
|
||||||
|
|
||||||
|
type tipoPostValidarTokem = { token: string }
|
||||||
|
|
||||||
|
import node_fetch from "cross-fetch"
|
||||||
|
|
||||||
|
/** faz a validação do token */
|
||||||
|
export const validarToken = async ({
|
||||||
|
url_api_autenticacao,
|
||||||
|
post,
|
||||||
|
}: {
|
||||||
|
url_api_autenticacao: string
|
||||||
|
post: tipoPostValidarTokem
|
||||||
|
}): Promise<"valido" | "erro"> => {
|
||||||
|
const url = `${url_api_autenticacao}/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"
|
||||||
|
}
|
||||||
|
}
|
||||||
14
src/autenticacao/index.ts
Normal file
14
src/autenticacao/index.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
import { codigoContaSite } from "./_codigoContaSite"
|
||||||
|
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,
|
||||||
|
codigoContaSite,
|
||||||
|
usuarios_quipo,
|
||||||
|
usuarios_quipo_vincular,
|
||||||
|
}
|
||||||
6
src/index.ts
Normal file
6
src/index.ts
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
export * from "./autenticacao"
|
||||||
|
export * from "./lista-prefeituras"
|
||||||
|
export * from "./lista-usuarios"
|
||||||
|
export * from "./lista-vinculos"
|
||||||
|
export * from "./produtos"
|
||||||
|
export * from "./tokens"
|
||||||
40
src/lista-prefeituras.ts
Normal file
40
src/lista-prefeituras.ts
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
import cFetch from "cross-fetch"
|
||||||
|
import { respostaComuns, type tipoResposta } from "p-respostas"
|
||||||
|
import type { chaves_produto } from "./produtos/tipagem"
|
||||||
|
|
||||||
|
export type tipoRetornoListarPrefeitrua = {
|
||||||
|
nome: string
|
||||||
|
inquilino: string
|
||||||
|
base_url: string
|
||||||
|
produto: keyof typeof chaves_produto
|
||||||
|
}
|
||||||
|
|
||||||
|
export const tx_listar_prefeituras = "listar_prefeituras" as const
|
||||||
|
|
||||||
|
export const listarPrefeituras = async ({
|
||||||
|
url_api_autenticacao,
|
||||||
|
}: {
|
||||||
|
url_api_autenticacao: string
|
||||||
|
}): Promise<tipoResposta<tipoRetornoListarPrefeitrua[]>> => {
|
||||||
|
const url = `${url_api_autenticacao}/api/${tx_listar_prefeituras}`
|
||||||
|
|
||||||
|
return cFetch(url)
|
||||||
|
.then(async (a) => {
|
||||||
|
const texto = await a.text()
|
||||||
|
|
||||||
|
try {
|
||||||
|
const res: tipoResposta<tipoRetornoListarPrefeitrua[]> =
|
||||||
|
JSON.parse(texto)
|
||||||
|
|
||||||
|
return res
|
||||||
|
} catch (error: any) {
|
||||||
|
return respostaComuns.erro(`Erro ao listar cidades: ${error.message}`, [
|
||||||
|
texto,
|
||||||
|
error,
|
||||||
|
])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) =>
|
||||||
|
respostaComuns.erro(`Erro ao listar cidades: ${error.message}`, [error]),
|
||||||
|
)
|
||||||
|
}
|
||||||
54
src/lista-usuarios.ts
Normal file
54
src/lista-usuarios.ts
Normal file
|
|
@ -0,0 +1,54 @@
|
||||||
|
import cFetch from "cross-fetch"
|
||||||
|
import { respostaComuns, type tipoResposta } from "p-respostas"
|
||||||
|
|
||||||
|
export const tx_usuarios__listar = "usuarios__listar" as const
|
||||||
|
|
||||||
|
export type tipo_usuarios__listar_retorno = {
|
||||||
|
inquilino: string
|
||||||
|
vinculo: string
|
||||||
|
codigo: string
|
||||||
|
cpf: string
|
||||||
|
data_hora_atualizacao: string
|
||||||
|
email: string
|
||||||
|
id_betha_sistema: string
|
||||||
|
nome: string
|
||||||
|
telefone: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type tipo_usuarios__listar_parametros = {
|
||||||
|
inquilino?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export const listarUsuarios = async (
|
||||||
|
{
|
||||||
|
token,
|
||||||
|
url_api_autenticacao,
|
||||||
|
}: { url_api_autenticacao: string; token: string },
|
||||||
|
parametros: tipo_usuarios__listar_parametros,
|
||||||
|
): Promise<tipoResposta<tipo_usuarios__listar_retorno[]>> => {
|
||||||
|
const url = `${url_api_autenticacao}/api/${tx_usuarios__listar}`
|
||||||
|
|
||||||
|
return cFetch(url, {
|
||||||
|
headers: { token, "Content-Type": "application/json" },
|
||||||
|
body: JSON.stringify(parametros),
|
||||||
|
method: "post",
|
||||||
|
})
|
||||||
|
.then(async (a) => {
|
||||||
|
const texto = await a.text()
|
||||||
|
|
||||||
|
try {
|
||||||
|
const res: tipoResposta<tipo_usuarios__listar_retorno[]> =
|
||||||
|
JSON.parse(texto)
|
||||||
|
|
||||||
|
return res
|
||||||
|
} catch (error: any) {
|
||||||
|
return respostaComuns.erro(
|
||||||
|
`Erro ao listar usuários: ${error.message}`,
|
||||||
|
[texto, error],
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) =>
|
||||||
|
respostaComuns.erro(`Erro ao listar usuários: ${error.message}`, [error]),
|
||||||
|
)
|
||||||
|
}
|
||||||
48
src/lista-vinculos.ts
Normal file
48
src/lista-vinculos.ts
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
import cFetch from "cross-fetch"
|
||||||
|
import { respostaComuns, type tipoResposta } from "p-respostas"
|
||||||
|
|
||||||
|
export const tx_vinculos__listar = "vinculos__listar" as const
|
||||||
|
export type tipo_retorno_vinculo_listas = {
|
||||||
|
codigo: string
|
||||||
|
usuario_codigo: string
|
||||||
|
inquilino: string
|
||||||
|
vinculo: string
|
||||||
|
chave_produto: string
|
||||||
|
_usuario_nome: string
|
||||||
|
_inquilino_nome: string
|
||||||
|
_inquilino_base_url: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export const listarVinculos = async ({
|
||||||
|
token,
|
||||||
|
url_api_autenticacao,
|
||||||
|
}: {
|
||||||
|
url_api_autenticacao: string
|
||||||
|
token: string
|
||||||
|
}): Promise<tipoResposta<tipo_retorno_vinculo_listas[]>> => {
|
||||||
|
const url = `${url_api_autenticacao}/api/${tx_vinculos__listar}`
|
||||||
|
|
||||||
|
return cFetch(url, {
|
||||||
|
headers: { token, "Content-Type": "application/json" },
|
||||||
|
body: "{}",
|
||||||
|
method: "post",
|
||||||
|
})
|
||||||
|
.then(async (a) => {
|
||||||
|
const texto = await a.text()
|
||||||
|
|
||||||
|
try {
|
||||||
|
const res: tipoResposta<tipo_retorno_vinculo_listas[]> =
|
||||||
|
JSON.parse(texto)
|
||||||
|
|
||||||
|
return res
|
||||||
|
} catch (error: any) {
|
||||||
|
return respostaComuns.erro(`Erro ao listar cidades: ${error.message}`, [
|
||||||
|
texto,
|
||||||
|
error,
|
||||||
|
])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) =>
|
||||||
|
respostaComuns.erro(`Erro ao listar cidades: ${error.message}`, [error]),
|
||||||
|
)
|
||||||
|
}
|
||||||
15
src/produtos/_betha-meio-ambiente.ts
Normal file
15
src/produtos/_betha-meio-ambiente.ts
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
import { type opcoesVinculosGov, ProdutoQuipo } from "./tipagem"
|
||||||
|
|
||||||
|
export const produto_betha_meio_ambiente = new ProdutoQuipo({
|
||||||
|
chave_produto: "betha-meio-ambiente",
|
||||||
|
titulo: "Betha Meio Ambiente",
|
||||||
|
descricao:
|
||||||
|
"Betha Meio Ambiente: Software de gestão de processos ambientais para órgãos públicos da Betha Sistemas.",
|
||||||
|
|
||||||
|
url_produto: ({ inquilino, base_url, vinculo }) =>
|
||||||
|
`${base_url}/${inquilino}${
|
||||||
|
vinculo == ("anonimo" satisfies keyof typeof opcoesVinculosGov)
|
||||||
|
? ""
|
||||||
|
: `/${vinculo}#/admin`
|
||||||
|
}`,
|
||||||
|
})
|
||||||
13
src/produtos/_e-licencie-gov.ts
Normal file
13
src/produtos/_e-licencie-gov.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
import { produto_betha_meio_ambiente } from "./_betha-meio-ambiente"
|
||||||
|
import { type opcoesVinculosGov, ProdutoQuipo } from "./tipagem"
|
||||||
|
export const produto_e_licencie_gov = new ProdutoQuipo({
|
||||||
|
...produto_betha_meio_ambiente,
|
||||||
|
titulo: "e-Licencie Gov",
|
||||||
|
chave_produto: "e-licencie-gov",
|
||||||
|
url_produto: ({ inquilino, base_url, vinculo }) =>
|
||||||
|
`${base_url}/${inquilino}${
|
||||||
|
vinculo == ("anonimo" satisfies keyof typeof opcoesVinculosGov)
|
||||||
|
? ""
|
||||||
|
: `/${vinculo}#/admin`
|
||||||
|
}`,
|
||||||
|
})
|
||||||
8
src/produtos/_e-licencie.ts
Normal file
8
src/produtos/_e-licencie.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
import { Produto } from "./tipagem"
|
||||||
|
|
||||||
|
export const produto_e_licencie = new Produto({
|
||||||
|
chave_produto: "e-licencie",
|
||||||
|
titulo: "e-Licencie",
|
||||||
|
descricao: "e-Licencie: Software de gestão de processos e dados ambientais.",
|
||||||
|
url_produto: ({ base_url }) => base_url,
|
||||||
|
})
|
||||||
9
src/produtos/_suporte.ts
Normal file
9
src/produtos/_suporte.ts
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
import { Produto } from "./tipagem"
|
||||||
|
|
||||||
|
export const produto_suporte = new Produto({
|
||||||
|
chave_produto: "suporte",
|
||||||
|
titulo: "Suporte",
|
||||||
|
descricao: "Gestão de contas e usuários dos produtos da e-licencie",
|
||||||
|
|
||||||
|
url_produto: ({ base_url }) => base_url,
|
||||||
|
})
|
||||||
31
src/produtos/doc.ts
Normal file
31
src/produtos/doc.ts
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
/**
|
||||||
|
|
||||||
|
Produtos existentes:
|
||||||
|
|
||||||
|
Atenticacao:
|
||||||
|
Acesso a gestão de produtos
|
||||||
|
Apenas uma conta com o código autenticao
|
||||||
|
/autenticacao
|
||||||
|
|
||||||
|
Betha Meio Ambiente:
|
||||||
|
Acesso a gestão da aplicação Quipo
|
||||||
|
Acesso pode ser sociedade ou governo
|
||||||
|
/quipo
|
||||||
|
Possue limite de acesso a módulos:
|
||||||
|
Licenciamento
|
||||||
|
Fiscalização
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
e-licencie GOV:
|
||||||
|
Acesso a gestão da aplicação Quipo
|
||||||
|
Acesso pode ser sociedade ou governo
|
||||||
|
/quipo
|
||||||
|
|
||||||
|
|
||||||
|
e-licencie:
|
||||||
|
Acesso a Aplicação e-licencie
|
||||||
|
Adminstrador e Não adminstrasdor
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
35
src/produtos/index.ts
Normal file
35
src/produtos/index.ts
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
import { produto_betha_meio_ambiente } from "./_betha-meio-ambiente"
|
||||||
|
import { produto_e_licencie } from "./_e-licencie"
|
||||||
|
|
||||||
|
import { produto_e_licencie_gov } from "./_e-licencie-gov"
|
||||||
|
import { produto_suporte } from "./_suporte"
|
||||||
|
import {
|
||||||
|
chaves_produto,
|
||||||
|
opcoesVinculos,
|
||||||
|
opcoesVinculosGov,
|
||||||
|
Produto,
|
||||||
|
provedoresGov,
|
||||||
|
versao_usuarios,
|
||||||
|
} from "./tipagem"
|
||||||
|
|
||||||
|
export const listaProdutos: {
|
||||||
|
[k in keyof typeof chaves_produto]: Produto<k>
|
||||||
|
} = {
|
||||||
|
"betha-meio-ambiente": produto_betha_meio_ambiente,
|
||||||
|
"e-licencie": produto_e_licencie,
|
||||||
|
"e-licencie-gov": produto_e_licencie_gov,
|
||||||
|
suporte: produto_suporte,
|
||||||
|
}
|
||||||
|
|
||||||
|
export {
|
||||||
|
Produto,
|
||||||
|
chaves_produto,
|
||||||
|
opcoesVinculosGov,
|
||||||
|
opcoesVinculos,
|
||||||
|
provedoresGov,
|
||||||
|
produto_betha_meio_ambiente,
|
||||||
|
produto_e_licencie,
|
||||||
|
produto_e_licencie_gov,
|
||||||
|
produto_suporte,
|
||||||
|
versao_usuarios,
|
||||||
|
}
|
||||||
102
src/produtos/tipagem.ts
Normal file
102
src/produtos/tipagem.ts
Normal file
|
|
@ -0,0 +1,102 @@
|
||||||
|
/** Lista dos produtos da e-licencie */
|
||||||
|
export enum chaves_produto {
|
||||||
|
suporte = "suporte",
|
||||||
|
"betha-meio-ambiente" = "betha-meio-ambiente",
|
||||||
|
"e-licencie-gov" = "e-licencie-gov",
|
||||||
|
"e-licencie" = "e-licencie",
|
||||||
|
}
|
||||||
|
|
||||||
|
export const opcoesVinculosGov = {
|
||||||
|
governo: "Governo",
|
||||||
|
sociedade: "Sociedade",
|
||||||
|
anonimo: "Anônimo",
|
||||||
|
} as const
|
||||||
|
|
||||||
|
export const opcoesVinculosSuporte = {
|
||||||
|
"suporte-1": "Suporte Primário",
|
||||||
|
} as const
|
||||||
|
|
||||||
|
export const opcoesVinculos = {
|
||||||
|
[chaves_produto.suporte]: opcoesVinculosSuporte,
|
||||||
|
[chaves_produto["betha-meio-ambiente"]]: opcoesVinculosGov,
|
||||||
|
[chaves_produto["e-licencie-gov"]]: opcoesVinculosGov,
|
||||||
|
[chaves_produto["e-licencie"]]: {},
|
||||||
|
} as const
|
||||||
|
|
||||||
|
export const tiposAcesso = opcoesVinculosGov
|
||||||
|
|
||||||
|
export const provedoresGov = {
|
||||||
|
/** Sistema de login da Beta */
|
||||||
|
"betha-sistemas": "Betha Sistemas",
|
||||||
|
/** sistema de login do altenticado */
|
||||||
|
"e-licencie": "e-licencie",
|
||||||
|
} as const
|
||||||
|
|
||||||
|
type extruturaTokenBase = {
|
||||||
|
inquilino_codigo: string
|
||||||
|
usuario_codigo: string
|
||||||
|
usuario_nome: string
|
||||||
|
codigo_acesso_produto: string
|
||||||
|
codigo_autenticacao: string
|
||||||
|
}
|
||||||
|
|
||||||
|
type extrutruaraTokenQuipo = extruturaTokenBase & {
|
||||||
|
inquilino_nome: string
|
||||||
|
tipo_de_acesso: keyof typeof opcoesVinculosGov
|
||||||
|
provedor: keyof typeof provedoresGov
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Produto<C extends keyof typeof chaves_produto> {
|
||||||
|
/** Chave do produto*/
|
||||||
|
chave_produto: C
|
||||||
|
/** Titulo do produto */
|
||||||
|
titulo: string
|
||||||
|
/** Descrição do módulo */
|
||||||
|
descricao: string
|
||||||
|
/** URL base do módulo */
|
||||||
|
url_produto: (_: {
|
||||||
|
inquilino: string
|
||||||
|
base_url: string
|
||||||
|
vinculo: string
|
||||||
|
}) => string
|
||||||
|
|
||||||
|
constructor(_: {
|
||||||
|
/** Chave do produto*/ chave_produto: C
|
||||||
|
/** Titulo do produto */
|
||||||
|
titulo: string
|
||||||
|
/** Descrição do módulo */
|
||||||
|
descricao: string
|
||||||
|
/** URL base do módulo */
|
||||||
|
url_produto: (_: {
|
||||||
|
inquilino: string
|
||||||
|
base_url: string
|
||||||
|
vinculo: string
|
||||||
|
}) => string
|
||||||
|
}) {
|
||||||
|
this.chave_produto = _.chave_produto
|
||||||
|
this.titulo = _.titulo
|
||||||
|
this.descricao = _.descricao
|
||||||
|
this.url_produto = _.url_produto
|
||||||
|
}
|
||||||
|
|
||||||
|
extruturaToken(
|
||||||
|
_: extruturaTokenBase,
|
||||||
|
): extruturaTokenBase & { chave_produto: C } {
|
||||||
|
return { ..._, chave_produto: this.chave_produto }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class ProdutoQuipo<
|
||||||
|
C extends keyof typeof chaves_produto,
|
||||||
|
> extends Produto<C> {
|
||||||
|
extruturaToken(
|
||||||
|
_: extrutruaraTokenQuipo,
|
||||||
|
): extrutruaraTokenQuipo & { chave_produto: C } {
|
||||||
|
return { ..._, chave_produto: this.chave_produto }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum versao_usuarios {
|
||||||
|
versao_usuarios_autenticacao = "versao_usuarios_autenticacao",
|
||||||
|
versao_usuarios_quipo = "versao_usuarios_quipo",
|
||||||
|
}
|
||||||
11
src/tokens/index.ts
Normal file
11
src/tokens/index.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
import type { provedoresGov } from "../produtos"
|
||||||
|
|
||||||
|
export type tipoUsuarioTokenAutneticacao = {
|
||||||
|
usuario_codigo: string
|
||||||
|
usuario_nome: string
|
||||||
|
usuario_email: string
|
||||||
|
usuario_cpf: string
|
||||||
|
autenticacao_codigo: string
|
||||||
|
eSuporte: boolean
|
||||||
|
autenticacao_provedor: keyof typeof provedoresGov
|
||||||
|
}
|
||||||
7
tsconfig-back.json
Normal file
7
tsconfig-back.json
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"extends": "./tsconfig",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "./dist-require",
|
||||||
|
"module": "commonjs"
|
||||||
|
}
|
||||||
|
}
|
||||||
7
tsconfig-front.json
Normal file
7
tsconfig-front.json
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"extends": "./tsconfig",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "./dist-import",
|
||||||
|
"module": "ES6"
|
||||||
|
}
|
||||||
|
}
|
||||||
25
tsconfig.json
Normal file
25
tsconfig.json
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
/* Linguagem e Ambiente */
|
||||||
|
"target": "ES2020", /* Define a versão do JavaScript para o código emitido. */
|
||||||
|
"lib": ["dom.iterable"], /* Especifica as bibliotecas padrão a serem incluídas, como DOM para iteradores. */
|
||||||
|
"experimentalDecorators": true, /* Habilita o suporte experimental a decoradores. */
|
||||||
|
"emitDecoratorMetadata": true, /* Emite metadados de tipos de design para declarações decoradas. */
|
||||||
|
|
||||||
|
/* Módulos */
|
||||||
|
"moduleResolution": "node", /* Define como o TypeScript resolve módulos. */
|
||||||
|
"rootDir": "./src", /* Define a pasta raiz para os arquivos de origem. */
|
||||||
|
|
||||||
|
/* Emissão */
|
||||||
|
"declaration": true, /* Gera arquivos .d.ts para os arquivos TypeScript. */
|
||||||
|
|
||||||
|
/* Interoperabilidade de Módulos */
|
||||||
|
"esModuleInterop": true, /* Habilita a compatibilidade com módulos CommonJS ao importar. */
|
||||||
|
"forceConsistentCasingInFileNames": true,/* Garante consistência na diferenciação entre maiúsculas e minúsculas em nomes de arquivos. */
|
||||||
|
|
||||||
|
/* Verificação de Tipos */
|
||||||
|
"strict": true, /* Habilita todas as opções de verificação estrita de tipos. */
|
||||||
|
"skipLibCheck": true /* Ignora a verificação de tipos em arquivos de declaração de bibliotecas. */
|
||||||
|
},
|
||||||
|
"include": ["src/**/*"] /* Inclui todos os arquivos TypeScript dentro da pasta src. */
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue