melhorias de tipagem

This commit is contained in:
Luiz Silva 2025-08-20 12:09:18 -03:00
parent d53450b686
commit 6480b90500
10 changed files with 54 additions and 21 deletions

View file

@ -26,7 +26,7 @@ const produto_betha_meio_ambiente = new import_tipagem.ProdutoQuipo({
chave_produto: "betha-meio-ambiente",
titulo: "Betha Meio Ambiente",
descricao: "Betha Meio Ambiente: Software de gest\xE3o de processos ambientais para \xF3rg\xE3os p\xFAblicos da Betha Sistemas.",
url_produto: ({ inquilino, base_url, vinculo }) => `${base_url}/${inquilino}${vinculo == "anonimo" ? "" : `/${vinculo}#/admin`}`
url_produto: ({ inquilino, base_url, vinculo }) => `${base_url}/${inquilino}${vinculo == import_tipagem.opcoesVinculosGovEnum.anonimo ? "" : `/${vinculo}#/admin`}`
});
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {

View file

@ -26,7 +26,7 @@ const produto_e_licencie_gov = new import_tipagem.ProdutoQuipo({
chave_produto: "e-licencie-gov",
titulo: "e-licencie.gov",
descricao: "e-licencie.gov: Software de gest\xE3o de processos e dados ambientais.",
url_produto: ({ inquilino, base_url, vinculo }) => `${base_url}/${inquilino}${vinculo == "anonimo" ? "" : `/${vinculo}#/admin`}`
url_produto: ({ inquilino, base_url, vinculo }) => `${base_url}/${inquilino}${vinculo == import_tipagem.opcoesVinculosGovEnum.anonimo ? "" : `/${vinculo}#/admin`}`
});
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {

View file

@ -23,6 +23,8 @@ __export(produtos_exports, {
listaProdutos: () => listaProdutos,
opcoesVinculos: () => import_tipagem.opcoesVinculos,
opcoesVinculosGov: () => import_tipagem.opcoesVinculosGov,
opcoesVinculosGovDescricao: () => import_tipagem.opcoesVinculosGovDescricao,
opcoesVinculosGovEnum: () => import_tipagem.opcoesVinculosGovEnum,
produto_betha_meio_ambiente: () => import_betha_meio_ambiente.produto_betha_meio_ambiente,
produto_e_licencie: () => import_e_licencie.produto_e_licencie,
produto_e_licencie_gov: () => import_e_licencie_gov.produto_e_licencie_gov,
@ -49,6 +51,8 @@ const listaProdutos = {
listaProdutos,
opcoesVinculos,
opcoesVinculosGov,
opcoesVinculosGovDescricao,
opcoesVinculosGovEnum,
produto_betha_meio_ambiente,
produto_e_licencie,
produto_e_licencie_gov,

View file

@ -23,6 +23,8 @@ __export(tipagem_exports, {
chaves_produto: () => chaves_produto,
opcoesVinculos: () => opcoesVinculos,
opcoesVinculosGov: () => opcoesVinculosGov,
opcoesVinculosGovDescricao: () => opcoesVinculosGovDescricao,
opcoesVinculosGovEnum: () => opcoesVinculosGovEnum,
opcoesVinculosSuporte: () => opcoesVinculosSuporte,
provedoresGov: () => provedoresGov,
tiposAcesso: () => tiposAcesso,
@ -36,21 +38,28 @@ var chaves_produto = /* @__PURE__ */ ((chaves_produto2) => {
chaves_produto2["e-licencie"] = "e-licencie";
return chaves_produto2;
})(chaves_produto || {});
const opcoesVinculosGov = {
var opcoesVinculosGovEnum = /* @__PURE__ */ ((opcoesVinculosGovEnum2) => {
opcoesVinculosGovEnum2["governo"] = "governo";
opcoesVinculosGovEnum2["sociedade"] = "sociedade";
opcoesVinculosGovEnum2["anonimo"] = "anonimo";
return opcoesVinculosGovEnum2;
})(opcoesVinculosGovEnum || {});
const opcoesVinculosGovDescricao = {
governo: "Governo",
sociedade: "Sociedade",
anonimo: "An\xF4nimo"
};
const opcoesVinculosGov = opcoesVinculosGovDescricao;
const opcoesVinculosSuporte = {
"suporte-1": "Suporte Prim\xE1rio"
};
const opcoesVinculos = {
["suporte" /* suporte */]: opcoesVinculosSuporte,
["betha-meio-ambiente" /* betha-meio-ambiente */]: opcoesVinculosGov,
["e-licencie-gov" /* e-licencie-gov */]: opcoesVinculosGov,
["betha-meio-ambiente" /* betha-meio-ambiente */]: opcoesVinculosGovDescricao,
["e-licencie-gov" /* e-licencie-gov */]: opcoesVinculosGovDescricao,
["e-licencie" /* e-licencie */]: {}
};
const tiposAcesso = opcoesVinculosGov;
const tiposAcesso = opcoesVinculosGovDescricao;
const provedoresGov = {
/** Sistema de login da Beta */
"betha-sistemas": "Betha Sistemas",
@ -85,6 +94,8 @@ var versao_usuarios = /* @__PURE__ */ ((versao_usuarios2) => {
chaves_produto,
opcoesVinculos,
opcoesVinculosGov,
opcoesVinculosGovDescricao,
opcoesVinculosGovEnum,
opcoesVinculosSuporte,
provedoresGov,
tiposAcesso,

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,6 @@
{
"name": "p-autenticacao-drive",
"version": "1.37.0",
"version": "1.38.0",
"description": "",
"main": "./src/index.ts",
"exports": {

View file

@ -1,4 +1,4 @@
import { type opcoesVinculosGov, ProdutoQuipo } from "./tipagem"
import { opcoesVinculosGovEnum, ProdutoQuipo } from "./tipagem"
export const produto_betha_meio_ambiente = new ProdutoQuipo({
chave_produto: "betha-meio-ambiente",
@ -8,8 +8,6 @@ export const produto_betha_meio_ambiente = new ProdutoQuipo({
url_produto: ({ inquilino, base_url, vinculo }) =>
`${base_url}/${inquilino}${
vinculo == ("anonimo" satisfies keyof typeof opcoesVinculosGov)
? ""
: `/${vinculo}#/admin`
vinculo == (opcoesVinculosGovEnum.anonimo) ? "" : `/${vinculo}#/admin`
}`,
})

View file

@ -1,4 +1,4 @@
import { type opcoesVinculosGov, ProdutoQuipo } from "./tipagem"
import { opcoesVinculosGovEnum, ProdutoQuipo } from "./tipagem"
export const produto_e_licencie_gov = new ProdutoQuipo({
chave_produto: "e-licencie-gov",
titulo: "e-licencie.gov",
@ -6,8 +6,6 @@ export const produto_e_licencie_gov = new ProdutoQuipo({
"e-licencie.gov: Software de gestão de processos e dados ambientais.",
url_produto: ({ inquilino, base_url, vinculo }) =>
`${base_url}/${inquilino}${
vinculo == ("anonimo" satisfies keyof typeof opcoesVinculosGov)
? ""
: `/${vinculo}#/admin`
vinculo == (opcoesVinculosGovEnum.anonimo) ? "" : `/${vinculo}#/admin`
}`,
})

View file

@ -7,6 +7,8 @@ import {
chaves_produto,
opcoesVinculos,
opcoesVinculosGov,
opcoesVinculosGovDescricao,
opcoesVinculosGovEnum,
Produto,
provedoresGov,
versao_usuarios,
@ -25,6 +27,8 @@ export {
Produto,
chaves_produto,
opcoesVinculosGov,
opcoesVinculosGovDescricao,
opcoesVinculosGovEnum,
opcoesVinculos,
provedoresGov,
produto_betha_meio_ambiente,

View file

@ -6,11 +6,25 @@ export enum chaves_produto {
"e-licencie" = "e-licencie",
}
export const opcoesVinculosGov = {
export enum opcoesVinculosGovEnum {
governo = "governo",
sociedade = "sociedade",
anonimo = "anonimo",
}
export const opcoesVinculosGovDescricao: {
[k in opcoesVinculosGovEnum]: string
} = {
governo: "Governo",
sociedade: "Sociedade",
anonimo: "Anônimo",
} as const
}
/**
* @deprecated Esta função será removida em futuras versões.
* opcoesVinculosGovEnum ou opcoesVinculosGovDescricao
*/
export const opcoesVinculosGov = opcoesVinculosGovDescricao
export const opcoesVinculosSuporte = {
"suporte-1": "Suporte Primário",
@ -18,12 +32,16 @@ export const opcoesVinculosSuporte = {
export const opcoesVinculos = {
[chaves_produto.suporte]: opcoesVinculosSuporte,
[chaves_produto["betha-meio-ambiente"]]: opcoesVinculosGov,
[chaves_produto["e-licencie-gov"]]: opcoesVinculosGov,
[chaves_produto["betha-meio-ambiente"]]: opcoesVinculosGovDescricao,
[chaves_produto["e-licencie-gov"]]: opcoesVinculosGovDescricao,
[chaves_produto["e-licencie"]]: {},
} as const
export const tiposAcesso = opcoesVinculosGov
/**
* @deprecated Esta função será removida em futuras versões.
* opcoesVinculosGovEnum ou opcoesVinculosGovDescricao
*/
export const tiposAcesso = opcoesVinculosGovDescricao
export const provedoresGov = {
/** Sistema de login da Beta */