diff --git a/.gitignore b/.gitignore index 234ef2d..d0d97fc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,8 @@ node_modules -pacotes \ No newline at end of file +pacotes + +# Builds e compilados +dist/ +dist-*/ +**/dist/ +**/dist-*/ \ No newline at end of file diff --git a/dist-back/autenticacao/_codigoContaSite.js b/dist-back/autenticacao/_codigoContaSite.js deleted file mode 100644 index a07441c..0000000 --- a/dist-back/autenticacao/_codigoContaSite.js +++ /dev/null @@ -1,56 +0,0 @@ -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var codigoContaSite_exports = {}; -__export(codigoContaSite_exports, { - codigoContaSite: () => codigoContaSite -}); -module.exports = __toCommonJS(codigoContaSite_exports); -var import_p_respostas = require("p-respostas"); -var import_cross_fetch = __toESM(require("cross-fetch")); -var import_site_autenticacao = require("../utilitarios/site_autenticacao"); -const codigoContaSite = async ({ - base_url_autenticacao, - post -}) => { - const url = `${(0, import_site_autenticacao.site_autenticacao)(base_url_autenticacao)}/api/codigo_prefeitura_site`; - try { - const resp = await (0, import_cross_fetch.default)(url, { - method: "POST", - body: JSON.stringify(post), - headers: { "Content-Type": "application/json" } - }).then((r) => r.json()).catch((e) => import_p_respostas.respostaComuns.erro("Erro ao enviar registros", [e.message])).then((r) => r); - return resp; - } catch (e) { - return import_p_respostas.respostaComuns.erro(`erro ao buscar c\xF3digo do site: ${e}`); - } -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - codigoContaSite -}); diff --git a/dist-back/autenticacao/_usuarios_quipo.js b/dist-back/autenticacao/_usuarios_quipo.js deleted file mode 100644 index f8463be..0000000 --- a/dist-back/autenticacao/_usuarios_quipo.js +++ /dev/null @@ -1,57 +0,0 @@ -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var usuarios_quipo_exports = {}; -__export(usuarios_quipo_exports, { - usuarios_quipo: () => usuarios_quipo -}); -module.exports = __toCommonJS(usuarios_quipo_exports); -var import_cross_fetch = __toESM(require("cross-fetch")); -var import_p_respostas = require("p-respostas"); -var import_site_autenticacao = require("../utilitarios/site_autenticacao"); -const usuarios_quipo = async ({ - token_produto, - base_url_autenticacao, - inquilino -}) => { - const url = `${(0, import_site_autenticacao.site_autenticacao)(base_url_autenticacao)}/api/usuarios__listar`; - if (!token_produto) return import_p_respostas.respostaComuns.erro("token_produto n\xE3o informado"); - const headers = { - token: token_produto, - "Content-Type": "application/json" - }; - return (0, import_cross_fetch.default)(url, { - method: "POST", - body: JSON.stringify({ inquilino }), - headers - }).then((r) => r.json()).catch((e) => import_p_respostas.respostaComuns.erro(`Erro ao buscar usu\xE1rios quipo governo ${e.message}`)).then((r) => r); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - usuarios_quipo -}); diff --git a/dist-back/autenticacao/_usuarios_quipo_vincular.js b/dist-back/autenticacao/_usuarios_quipo_vincular.js deleted file mode 100644 index d31a89f..0000000 --- a/dist-back/autenticacao/_usuarios_quipo_vincular.js +++ /dev/null @@ -1,64 +0,0 @@ -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var usuarios_quipo_vincular_exports = {}; -__export(usuarios_quipo_vincular_exports, { - usuarios_quipo_vincular: () => usuarios_quipo_vincular -}); -module.exports = __toCommonJS(usuarios_quipo_vincular_exports); -var import_cross_fetch = __toESM(require("cross-fetch")); -var import_p_respostas = require("p-respostas"); -var import_site_autenticacao = require("../utilitarios/site_autenticacao"); -const usuarios_quipo_vincular = async ({ - token_produto, - base_url_autenticacao, - inquilino_codigo, - vinculo, - usuario_codigo, - email -}) => { - const url = `${(0, import_site_autenticacao.site_autenticacao)(base_url_autenticacao)}/api/vinculos__criar`; - if (!token_produto) return import_p_respostas.respostaComuns.erro("token_produto n\xE3o informado"); - const headers = { - token: token_produto, - "Content-Type": "application/json" - }; - const parametros = { - vinculos: { inquilino_codigo, usuario_codigo, vinculo }, - email - }; - return await (0, import_cross_fetch.default)(url, { - headers, - body: JSON.stringify(parametros), - method: "POST" - }).then(async (r) => await r.json()).catch((e) => import_p_respostas.respostaComuns.erro(`Erro ao criar vinculo de usuario ${e.message}`)); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - usuarios_quipo_vincular -}); diff --git a/dist-back/autenticacao/_validarToken.js b/dist-back/autenticacao/_validarToken.js deleted file mode 100644 index 4c06eab..0000000 --- a/dist-back/autenticacao/_validarToken.js +++ /dev/null @@ -1,56 +0,0 @@ -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var validarToken_exports = {}; -__export(validarToken_exports, { - validarToken: () => validarToken -}); -module.exports = __toCommonJS(validarToken_exports); -var import_p_respostas = require("p-respostas"); -var import_cross_fetch = __toESM(require("cross-fetch")); -var import_site_autenticacao = require("../utilitarios/site_autenticacao"); -const validarToken = async ({ - base_url_autenticacao, - post -}) => { - const url = `${(0, import_site_autenticacao.site_autenticacao)(base_url_autenticacao)}/api/validar_token`; - try { - const resposta = await (0, import_cross_fetch.default)(url, { - method: "POST", - body: JSON.stringify(post), - headers: { "Content-Type": "application/json" } - }).then((r) => r.json()).then((r) => r).catch((err) => import_p_respostas.respostaComuns.erro(`Erro: ${err.message}`)); - return resposta; - } catch (err) { - return import_p_respostas.respostaComuns.erro(`Erro: ${err.message}`); - } -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - validarToken -}); diff --git a/dist-back/autenticacao/index.js b/dist-back/autenticacao/index.js deleted file mode 100644 index b79d499..0000000 --- a/dist-back/autenticacao/index.js +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var autenticacao_exports = {}; -__export(autenticacao_exports, { - pAutenticacao: () => pAutenticacao -}); -module.exports = __toCommonJS(autenticacao_exports); -var import_codigoContaSite = require("./_codigoContaSite"); -var import_usuarios_quipo = require("./_usuarios_quipo"); -var import_usuarios_quipo_vincular = require("./_usuarios_quipo_vincular"); -var import_validarToken = require("./_validarToken"); -const pAutenticacao = { - validarToken: import_validarToken.validarToken, - codigoContaSite: import_codigoContaSite.codigoContaSite, - usuarios_quipo: import_usuarios_quipo.usuarios_quipo, - usuarios_quipo_vincular: import_usuarios_quipo_vincular.usuarios_quipo_vincular -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - pAutenticacao -}); diff --git a/dist-back/index.js b/dist-back/index.js deleted file mode 100644 index 17f277a..0000000 --- a/dist-back/index.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var index_exports = {}; -module.exports = __toCommonJS(index_exports); -__reExport(index_exports, require("./autenticacao"), module.exports); -__reExport(index_exports, require("./lista-prefeituras"), module.exports); -__reExport(index_exports, require("./lista-usuarios"), module.exports); -__reExport(index_exports, require("./lista-vinculos"), module.exports); -__reExport(index_exports, require("./produtos"), module.exports); -__reExport(index_exports, require("./tokens"), module.exports); -__reExport(index_exports, require("./utilitarios/site_autenticacao"), module.exports); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - ...require("./autenticacao"), - ...require("./lista-prefeituras"), - ...require("./lista-usuarios"), - ...require("./lista-vinculos"), - ...require("./produtos"), - ...require("./tokens"), - ...require("./utilitarios/site_autenticacao") -}); diff --git a/dist-back/lista-prefeituras.js b/dist-back/lista-prefeituras.js deleted file mode 100644 index e288fb3..0000000 --- a/dist-back/lista-prefeituras.js +++ /dev/null @@ -1,57 +0,0 @@ -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var lista_prefeituras_exports = {}; -__export(lista_prefeituras_exports, { - listarPrefeituras: () => listarPrefeituras, - tx_listar_prefeituras: () => tx_listar_prefeituras -}); -module.exports = __toCommonJS(lista_prefeituras_exports); -var import_cross_fetch = __toESM(require("cross-fetch")); -var import_p_respostas = require("p-respostas"); -var import_site_autenticacao = require("./utilitarios/site_autenticacao"); -const tx_listar_prefeituras = "listar_prefeituras"; -const listarPrefeituras = async ({ - base_url_autenticacao -}) => { - const url = `${(0, import_site_autenticacao.site_autenticacao)(base_url_autenticacao)}/api/${tx_listar_prefeituras}`; - return (0, import_cross_fetch.default)(url).then(async (a) => { - const texto = await a.text(); - try { - const res = JSON.parse(texto); - return res; - } catch (error) { - return import_p_respostas.respostaComuns.erro(`Erro ao listar cidades: ${error.message}`, [texto, error]); - } - }).catch((error) => import_p_respostas.respostaComuns.erro(`Erro ao listar cidades: ${error.message}`, [error])); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - listarPrefeituras, - tx_listar_prefeituras -}); diff --git a/dist-back/lista-usuarios.js b/dist-back/lista-usuarios.js deleted file mode 100644 index 21b8160..0000000 --- a/dist-back/lista-usuarios.js +++ /dev/null @@ -1,59 +0,0 @@ -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var lista_usuarios_exports = {}; -__export(lista_usuarios_exports, { - listarUsuarios: () => listarUsuarios, - tx_usuarios__listar: () => tx_usuarios__listar -}); -module.exports = __toCommonJS(lista_usuarios_exports); -var import_cross_fetch = __toESM(require("cross-fetch")); -var import_p_respostas = require("p-respostas"); -var import_site_autenticacao = require("./utilitarios/site_autenticacao"); -const tx_usuarios__listar = "usuarios__listar"; -const listarUsuarios = async ({ token, base_url_autenticacao }, parametros) => { - const url = `${(0, import_site_autenticacao.site_autenticacao)(base_url_autenticacao)}/api/${tx_usuarios__listar}`; - return (0, import_cross_fetch.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 import_p_respostas.respostaComuns.erro(`Erro ao listar usu\xE1rios: ${error.message}`, [texto, error]); - } - }).catch((error) => import_p_respostas.respostaComuns.erro(`Erro ao listar usu\xE1rios: ${error.message}`, [error])); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - listarUsuarios, - tx_usuarios__listar -}); diff --git a/dist-back/lista-vinculos.js b/dist-back/lista-vinculos.js deleted file mode 100644 index 695b0bc..0000000 --- a/dist-back/lista-vinculos.js +++ /dev/null @@ -1,83 +0,0 @@ -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var lista_vinculos_exports = {}; -__export(lista_vinculos_exports, { - listarVinculos: () => listarVinculos, - tx_vinculos__listar: () => tx_vinculos__listar -}); -module.exports = __toCommonJS(lista_vinculos_exports); -var import_cross_fetch = __toESM(require("cross-fetch")); -var import_p_comuns = require("p-comuns"); -var import_p_respostas = require("p-respostas"); -var import_uuid = require("./plugins/uuid"); -var import_site_autenticacao = require("./utilitarios/site_autenticacao"); -const tx_vinculos__listar = "vinculos__listar"; -const listarVinculos = async ({ - token, - base_url_autenticacao, - desativarCache -}) => { - const chaveCache = (0, import_uuid.uuidV3)({ token, base_url_autenticacao }); - if (!desativarCache) { - const valorCache = (0, import_p_comuns.cacheM)(chaveCache); - if (valorCache) return valorCache; - } - const res = (async () => { - const url = `${(0, import_site_autenticacao.site_autenticacao)(base_url_autenticacao)}/api/${tx_vinculos__listar}`; - return (0, import_cross_fetch.default)(url, { - headers: { token, "Content-Type": "application/json" }, - body: "{}", - method: "post" - }).then(async (a) => { - const texto = await a.text(); - try { - const res2 = JSON.parse(texto); - return res2; - } catch (error) { - return import_p_respostas.respostaComuns.erro(`Erro ao listar cidades: ${error.message}`, [texto, error]); - } - }).catch((error) => import_p_respostas.respostaComuns.erro(`Erro ao listar cidades: ${error.message}`, [error])); - })(); - (0, import_p_comuns.cacheM)( - chaveCache, - res.then((a) => { - try { - } catch { - } - return a; - }), - 10 - ); - return res; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - listarVinculos, - tx_vinculos__listar -}); diff --git a/dist-back/plugins/uuid.js b/dist-back/plugins/uuid.js deleted file mode 100644 index d5200b2..0000000 --- a/dist-back/plugins/uuid.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var uuid_exports = {}; -__export(uuid_exports, { - uuidV3: () => uuidV3, - uuidV4: () => uuidV4 -}); -module.exports = __toCommonJS(uuid_exports); -var import_uuid = require("uuid"); -const uuidV3 = (qualquerCoisa) => (0, import_uuid.v3)( - typeof qualquerCoisa == "string" ? qualquerCoisa : typeof qualquerCoisa == "number" ? String(qualquerCoisa) : JSON.stringify(qualquerCoisa), - import_uuid.NIL -); -const uuidV4 = import_uuid.v4; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - uuidV3, - uuidV4 -}); diff --git a/dist-back/produtos/_betha-meio-ambiente.js b/dist-back/produtos/_betha-meio-ambiente.js deleted file mode 100644 index a03db3e..0000000 --- a/dist-back/produtos/_betha-meio-ambiente.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var betha_meio_ambiente_exports = {}; -__export(betha_meio_ambiente_exports, { - produto_betha_meio_ambiente: () => produto_betha_meio_ambiente -}); -module.exports = __toCommonJS(betha_meio_ambiente_exports); -var import_tipagem = require("./tipagem"); -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 }) => { - const base = (base_url || "").replace(/\/+$/, ""); - const prefixo = base ? `${base}/${inquilino}` : `/${inquilino}`; - return vinculo === import_tipagem.opcoesVinculosGovEnum.anonimo ? `${prefixo}/` : `${prefixo}/quipo/${vinculo}/#/admin`; - } -}); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - produto_betha_meio_ambiente -}); diff --git a/dist-back/produtos/_e-licencie-gov.js b/dist-back/produtos/_e-licencie-gov.js deleted file mode 100644 index 5e8e887..0000000 --- a/dist-back/produtos/_e-licencie-gov.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var e_licencie_gov_exports = {}; -__export(e_licencie_gov_exports, { - produto_e_licencie_gov: () => produto_e_licencie_gov -}); -module.exports = __toCommonJS(e_licencie_gov_exports); -var import_tipagem = require("./tipagem"); -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 }) => { - const base = (base_url || "").replace(/\/+$/, ""); - const prefixo = base ? `${base}/${inquilino}` : `/${inquilino}`; - return vinculo === import_tipagem.opcoesVinculosGovEnum.anonimo ? `${prefixo}/` : `${prefixo}/quipo/${vinculo}/#/admin`; - } -}); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - produto_e_licencie_gov -}); diff --git a/dist-back/produtos/_e-licencie.js b/dist-back/produtos/_e-licencie.js deleted file mode 100644 index 2dc56f2..0000000 --- a/dist-back/produtos/_e-licencie.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var e_licencie_exports = {}; -__export(e_licencie_exports, { - produto_e_licencie: () => produto_e_licencie -}); -module.exports = __toCommonJS(e_licencie_exports); -var import_tipagem = require("./tipagem"); -const produto_e_licencie = new import_tipagem.Produto({ - chave_produto: "e-licencie", - titulo: "e-licencie", - descricao: "e-licencie: Software de gest\xE3o de processos e dados ambientais.", - url_produto: ({ base_url }) => base_url -}); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - produto_e_licencie -}); diff --git a/dist-back/produtos/_suporte.js b/dist-back/produtos/_suporte.js deleted file mode 100644 index 519aa17..0000000 --- a/dist-back/produtos/_suporte.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var suporte_exports = {}; -__export(suporte_exports, { - produto_suporte: () => produto_suporte -}); -module.exports = __toCommonJS(suporte_exports); -var import_tipagem = require("./tipagem"); -const produto_suporte = new import_tipagem.Produto({ - chave_produto: "suporte", - titulo: "Suporte", - descricao: "Gest\xE3o de contas e usu\xE1rios dos produtos da e-licencie", - url_produto: ({ base_url }) => base_url -}); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - produto_suporte -}); diff --git a/dist-back/produtos/doc.js b/dist-back/produtos/doc.js deleted file mode 100644 index 3918c74..0000000 --- a/dist-back/produtos/doc.js +++ /dev/null @@ -1 +0,0 @@ -"use strict"; diff --git a/dist-back/produtos/index.js b/dist-back/produtos/index.js deleted file mode 100644 index cbebf78..0000000 --- a/dist-back/produtos/index.js +++ /dev/null @@ -1,62 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var produtos_exports = {}; -__export(produtos_exports, { - Produto: () => import_tipagem.Produto, - chaves_produto: () => import_tipagem.chaves_produto, - 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, - produto_suporte: () => import_suporte.produto_suporte, - provedoresGov: () => import_tipagem.provedoresGov, - versao_usuarios: () => import_tipagem.versao_usuarios -}); -module.exports = __toCommonJS(produtos_exports); -var import_betha_meio_ambiente = require("./_betha-meio-ambiente"); -var import_e_licencie = require("./_e-licencie"); -var import_e_licencie_gov = require("./_e-licencie-gov"); -var import_suporte = require("./_suporte"); -var import_tipagem = require("./tipagem"); -const listaProdutos = { - "betha-meio-ambiente": import_betha_meio_ambiente.produto_betha_meio_ambiente, - "e-licencie": import_e_licencie.produto_e_licencie, - "e-licencie-gov": import_e_licencie_gov.produto_e_licencie_gov, - suporte: import_suporte.produto_suporte -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Produto, - chaves_produto, - listaProdutos, - opcoesVinculos, - opcoesVinculosGov, - opcoesVinculosGovDescricao, - opcoesVinculosGovEnum, - produto_betha_meio_ambiente, - produto_e_licencie, - produto_e_licencie_gov, - produto_suporte, - provedoresGov, - versao_usuarios -}); diff --git a/dist-back/produtos/tipagem.js b/dist-back/produtos/tipagem.js deleted file mode 100644 index d99f44b..0000000 --- a/dist-back/produtos/tipagem.js +++ /dev/null @@ -1,103 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var tipagem_exports = {}; -__export(tipagem_exports, { - Produto: () => Produto, - ProdutoQuipo: () => ProdutoQuipo, - chaves_produto: () => chaves_produto, - opcoesVinculos: () => opcoesVinculos, - opcoesVinculosGov: () => opcoesVinculosGov, - opcoesVinculosGovDescricao: () => opcoesVinculosGovDescricao, - opcoesVinculosGovEnum: () => opcoesVinculosGovEnum, - opcoesVinculosSuporte: () => opcoesVinculosSuporte, - provedoresGov: () => provedoresGov, - tiposAcesso: () => tiposAcesso, - versao_usuarios: () => versao_usuarios -}); -module.exports = __toCommonJS(tipagem_exports); -var chaves_produto = /* @__PURE__ */ ((chaves_produto2) => { - chaves_produto2["suporte"] = "suporte"; - chaves_produto2["betha-meio-ambiente"] = "betha-meio-ambiente"; - chaves_produto2["e-licencie-gov"] = "e-licencie-gov"; - chaves_produto2["e-licencie"] = "e-licencie"; - return chaves_produto2; -})(chaves_produto || {}); -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 */]: opcoesVinculosGovDescricao, - ["e-licencie-gov" /* e-licencie-gov */]: opcoesVinculosGovDescricao, - ["e-licencie" /* e-licencie */]: {} -}; -const tiposAcesso = opcoesVinculosGovDescricao; -const 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 }; - } -} -class ProdutoQuipo extends Produto { - extruturaToken(_) { - return { ..._, chave_produto: this.chave_produto }; - } -} -var versao_usuarios = /* @__PURE__ */ ((versao_usuarios2) => { - versao_usuarios2["versao_usuarios_autenticacao"] = "versao_usuarios_autenticacao"; - versao_usuarios2["versao_usuarios_quipo"] = "versao_usuarios_quipo"; - return versao_usuarios2; -})(versao_usuarios || {}); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Produto, - ProdutoQuipo, - chaves_produto, - opcoesVinculos, - opcoesVinculosGov, - opcoesVinculosGovDescricao, - opcoesVinculosGovEnum, - opcoesVinculosSuporte, - provedoresGov, - tiposAcesso, - versao_usuarios -}); diff --git a/dist-back/tokens/index.js b/dist-back/tokens/index.js deleted file mode 100644 index f990b9a..0000000 --- a/dist-back/tokens/index.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var tokens_exports = {}; -module.exports = __toCommonJS(tokens_exports); diff --git a/dist-back/utilitarios/site_autenticacao.js b/dist-back/utilitarios/site_autenticacao.js deleted file mode 100644 index 1dc934e..0000000 --- a/dist-back/utilitarios/site_autenticacao.js +++ /dev/null @@ -1,44 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var site_autenticacao_exports = {}; -__export(site_autenticacao_exports, { - site_autenticacao: () => site_autenticacao, - site_autenticacao_login: () => site_autenticacao_login, - tx__token__: () => tx__token__, - tx_redirecionar: () => tx_redirecionar -}); -module.exports = __toCommonJS(site_autenticacao_exports); -const site_autenticacao = (base_url_autenticacao) => `${(() => { - const x = new URL(base_url_autenticacao); - return x.origin; -})()}/autenticacao`; -const tx_redirecionar = "redirecionar"; -const tx__token__ = "__token__"; -const site_autenticacao_login = (base_url_autenticacao, redirecionar) => { - const url = new URL(site_autenticacao(base_url_autenticacao)); - redirecionar && url.searchParams.set(tx_redirecionar, redirecionar); - return url.href; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - site_autenticacao, - site_autenticacao_login, - tx__token__, - tx_redirecionar -}); diff --git a/dist-front/index.d.mts b/dist-front/index.d.mts deleted file mode 100644 index 26f2d92..0000000 --- a/dist-front/index.d.mts +++ /dev/null @@ -1,230 +0,0 @@ -import * as p_respostas from 'p-respostas'; -import { tipoResposta } from 'p-respostas'; - -declare const tx_usuarios__listar: "usuarios__listar"; -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; -}; -type tipo_usuarios__listar_parametros = { - inquilino?: string; -}; -declare const listarUsuarios: ({ token, base_url_autenticacao }: { - base_url_autenticacao: string; - token: string; -}, parametros: tipo_usuarios__listar_parametros) => Promise>; - -type tipoUsuarioExterno = { - _nome: string; - _email: string; - _telefone: string; - vinculo: string; - inquilino: string; - chave_produto: string; - codigo: string; - _cpf: string; -}; - -/** todas as rotas de comunicação com autenticador partem dessa variável */ -declare const pAutenticacao: { - validarToken: ({ base_url_autenticacao, post, }: { - base_url_autenticacao: string; - post: { - token: string; - }; - }) => Promise>; - codigoContaSite: ({ base_url_autenticacao, post, }: { - base_url_autenticacao: string; - post: { - site: string; - }; - }) => Promise>; - usuarios_quipo: ({ token_produto, base_url_autenticacao, inquilino, }: { - base_url_autenticacao: string; - token_produto: string; - inquilino: string; - }) => Promise>; - usuarios_quipo_vincular: ({ token_produto, base_url_autenticacao, inquilino_codigo, vinculo, usuario_codigo, email, }: { - base_url_autenticacao: string; - token_produto: string; - inquilino_codigo: string; - vinculo: string; - usuario_codigo?: string; - email: string; - }) => Promise>; -}; - -/** Lista dos produtos da e-licencie */ -declare enum chaves_produto { - suporte = "suporte", - "betha-meio-ambiente" = "betha-meio-ambiente", - "e-licencie-gov" = "e-licencie-gov", - "e-licencie" = "e-licencie" -} -declare enum opcoesVinculosGovEnum { - governo = "governo", - sociedade = "sociedade", - anonimo = "anonimo" -} -declare const opcoesVinculosGovDescricao: { - [k in opcoesVinculosGovEnum]: string; -}; -/** - * @deprecated Esta função será removida em futuras versões. - * opcoesVinculosGovEnum ou opcoesVinculosGovDescricao - */ -declare const opcoesVinculosGov: { - governo: string; - sociedade: string; - anonimo: string; -}; -declare const opcoesVinculos: { - readonly suporte: { - readonly "suporte-1": "Suporte Primário"; - }; - readonly "betha-meio-ambiente": { - governo: string; - sociedade: string; - anonimo: string; - }; - readonly "e-licencie-gov": { - governo: string; - sociedade: string; - anonimo: string; - }; - readonly "e-licencie": {}; -}; -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; -}; -declare class 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; - }; -} -declare class ProdutoQuipo extends Produto { - extruturaToken(_: extrutruaraTokenQuipo): extrutruaraTokenQuipo & { - chave_produto: C; - }; -} -declare enum versao_usuarios { - versao_usuarios_autenticacao = "versao_usuarios_autenticacao", - versao_usuarios_quipo = "versao_usuarios_quipo" -} - -type tipoRetornoListarPrefeitrua = { - nome: string; - inquilino: string; - base_url: string; - produto: keyof typeof chaves_produto; -}; -declare const tx_listar_prefeituras: "listar_prefeituras"; -declare const listarPrefeituras: ({ base_url_autenticacao, }: { - base_url_autenticacao: string; -}) => Promise>; - -declare const tx_vinculos__listar: "vinculos__listar"; -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; -}; -declare const listarVinculos: ({ token, base_url_autenticacao, desativarCache, }: { - /** http://site.com */ - base_url_autenticacao: string; - token: string; - /** por padrão será 10 segundos */ - desativarCache?: boolean; -}) => Promise>; - -declare const produto_betha_meio_ambiente: ProdutoQuipo<"betha-meio-ambiente">; - -declare const produto_e_licencie: Produto<"e-licencie">; - -declare const produto_e_licencie_gov: ProdutoQuipo<"e-licencie-gov">; - -declare const produto_suporte: Produto<"suporte">; - -declare const listaProdutos: { - [k in keyof typeof chaves_produto]: Produto; -}; - -type tipoUsuarioTokenAutneticacao = { - usuario_codigo: string; - usuario_nome: string; - usuario_email: string; - usuario_cpf: string; - autenticacao_codigo: string; - eSuporte: boolean; - autenticacao_provedor: keyof typeof provedoresGov; -}; - -/** - * - * @param base_url_autenticacao http://bolinhas.com - * @returns http://bolinhas.com/autenticacao - */ -declare const site_autenticacao: (base_url_autenticacao: string) => string; -declare const tx_redirecionar = "redirecionar"; -declare const tx__token__ = "__token__"; -/** - * - * @param base_url_autenticacao http://bolinhas.com - * @param redirecionar http://pedrinhas.com?token=__token__ - * @returns http://bolinhas.com?redirecionar=http%3A%2F%2Fpedrinhas.com%3Ftoken%3D__token__ - */ -declare const site_autenticacao_login: (base_url_autenticacao: string, redirecionar?: string) => string; - -export { Produto, chaves_produto, listaProdutos, listarPrefeituras, listarUsuarios, listarVinculos, opcoesVinculos, opcoesVinculosGov, opcoesVinculosGovDescricao, opcoesVinculosGovEnum, pAutenticacao, produto_betha_meio_ambiente, produto_e_licencie, produto_e_licencie_gov, produto_suporte, provedoresGov, site_autenticacao, site_autenticacao_login, type tipoRetornoListarPrefeitrua, type tipoUsuarioExterno, type tipoUsuarioTokenAutneticacao, type tipo_retorno_vinculo_listas, type tipo_usuarios__listar_parametros, type tipo_usuarios__listar_retorno, tx__token__, tx_listar_prefeituras, tx_redirecionar, tx_usuarios__listar, tx_vinculos__listar, versao_usuarios }; diff --git a/dist-front/index.mjs b/dist-front/index.mjs deleted file mode 100644 index 1d27af7..0000000 --- a/dist-front/index.mjs +++ /dev/null @@ -1 +0,0 @@ -import{respostaComuns as g}from"p-respostas";import j from"cross-fetch";var a=o=>`${new URL(o).origin}/autenticacao`,G="redirecionar",X="__token__",Y=(o,t)=>{let e=new URL(a(o));return t&&e.searchParams.set(G,t),e.href};var f=async({base_url_autenticacao:o,post:t})=>{let e=`${a(o)}/api/codigo_prefeitura_site`;try{return await j(e,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}}).then(r=>r.json()).catch(r=>g.erro("Erro ao enviar registros",[r.message])).then(r=>r)}catch(i){return g.erro(`erro ao buscar c\xF3digo do site: ${i}`)}};import N from"cross-fetch";import{respostaComuns as h}from"p-respostas";var x=async({token_produto:o,base_url_autenticacao:t,inquilino:e})=>{let i=`${a(t)}/api/usuarios__listar`;if(!o)return h.erro("token_produto n\xE3o informado");let r={token:o,"Content-Type":"application/json"};return N(i,{method:"POST",body:JSON.stringify({inquilino:e}),headers:r}).then(s=>s.json()).catch(s=>h.erro(`Erro ao buscar usu\xE1rios quipo governo ${s.message}`)).then(s=>s)};import J from"cross-fetch";import{respostaComuns as v}from"p-respostas";var y=async({token_produto:o,base_url_autenticacao:t,inquilino_codigo:e,vinculo:i,usuario_codigo:r,email:s})=>{let n=`${a(t)}/api/vinculos__criar`;return o?await J(n,{headers:{token:o,"Content-Type":"application/json"},body:JSON.stringify({vinculos:{inquilino_codigo:e,usuario_codigo:r,vinculo:i},email:s}),method:"POST"}).then(async l=>await l.json()).catch(l=>v.erro(`Erro ao criar vinculo de usuario ${l.message}`)):v.erro("token_produto n\xE3o informado")};import{respostaComuns as b}from"p-respostas";import U from"cross-fetch";var $=async({base_url_autenticacao:o,post:t})=>{let e=`${a(o)}/api/validar_token`;try{return await U(e,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}}).then(r=>r.json()).then(r=>r).catch(r=>b.erro(`Erro: ${r.message}`))}catch(i){return b.erro(`Erro: ${i.message}`)}};var bo={validarToken:$,codigoContaSite:f,usuarios_quipo:x,usuarios_quipo_vincular:y};import A from"cross-fetch";import{respostaComuns as k}from"p-respostas";var B="listar_prefeituras",Ro=async({base_url_autenticacao:o})=>{let t=`${a(o)}/api/${B}`;return A(t).then(async e=>{let i=await e.text();try{return JSON.parse(i)}catch(r){return k.erro(`Erro ao listar cidades: ${r.message}`,[i,r])}}).catch(e=>k.erro(`Erro ao listar cidades: ${e.message}`,[e]))};import L from"cross-fetch";import{respostaComuns as P}from"p-respostas";var Q="usuarios__listar",Vo=async({token:o,base_url_autenticacao:t},e)=>{let i=`${a(t)}/api/${Q}`;return L(i,{headers:{token:o,"Content-Type":"application/json"},body:JSON.stringify(e),method:"post"}).then(async r=>{let s=await r.text();try{return JSON.parse(s)}catch(n){return P.erro(`Erro ao listar usu\xE1rios: ${n.message}`,[s,n])}}).catch(r=>P.erro(`Erro ao listar usu\xE1rios: ${r.message}`,[r]))};import D from"cross-fetch";import{cacheM as R}from"p-comuns";import{respostaComuns as T}from"p-respostas";import{NIL as F,v3 as M,v4 as Go}from"uuid";var S=o=>M(typeof o=="string"?o:typeof o=="number"?String(o):JSON.stringify(o),F);var z="vinculos__listar",Lo=async({token:o,base_url_autenticacao:t,desativarCache:e})=>{let i=S({token:o,base_url_autenticacao:t});if(!e){let s=R(i);if(s)return s}let r=(async()=>{let s=`${a(t)}/api/${z}`;return D(s,{headers:{token:o,"Content-Type":"application/json"},body:"{}",method:"post"}).then(async n=>{let d=await n.text();try{return JSON.parse(d)}catch(u){return T.erro(`Erro ao listar cidades: ${u.message}`,[d,u])}}).catch(n=>T.erro(`Erro ao listar cidades: ${n.message}`,[n]))})();return R(i,r.then(s=>s),10),r};var C=(t=>(t.suporte="suporte",t["betha-meio-ambiente"]="betha-meio-ambiente",t["e-licencie-gov"]="e-licencie-gov",t["e-licencie"]="e-licencie",t))(C||{}),m=(i=>(i.governo="governo",i.sociedade="sociedade",i.anonimo="anonimo",i))(m||{}),_={governo:"Governo",sociedade:"Sociedade",anonimo:"An\xF4nimo"},I=_,H={"suporte-1":"Suporte Prim\xE1rio"},K={suporte:H,"betha-meio-ambiente":_,"e-licencie-gov":_,"e-licencie":{}};var W={"betha-sistemas":"Betha Sistemas","e-licencie":"e-licencie"},c=class{constructor(t){this.chave_produto=t.chave_produto,this.titulo=t.titulo,this.descricao=t.descricao,this.url_produto=t.url_produto}extruturaToken(t){return{...t,chave_produto:this.chave_produto}}},p=class extends c{extruturaToken(t){return{...t,chave_produto:this.chave_produto}}},E=(e=>(e.versao_usuarios_autenticacao="versao_usuarios_autenticacao",e.versao_usuarios_quipo="versao_usuarios_quipo",e))(E||{});var w=new p({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:o,base_url:t,vinculo:e})=>{let i=(t||"").replace(/\/+$/,""),r=i?`${i}/${o}`:`/${o}`;return e==="anonimo"?`${r}/`:`${r}/quipo/${e}/#/admin`}});var V=new c({chave_produto:"e-licencie",titulo:"e-licencie",descricao:"e-licencie: Software de gest\xE3o de processos e dados ambientais.",url_produto:({base_url:o})=>o});var O=new p({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:o,base_url:t,vinculo:e})=>{let i=(t||"").replace(/\/+$/,""),r=i?`${i}/${o}`:`/${o}`;return e==="anonimo"?`${r}/`:`${r}/quipo/${e}/#/admin`}});var q=new c({chave_produto:"suporte",titulo:"Suporte",descricao:"Gest\xE3o de contas e usu\xE1rios dos produtos da e-licencie",url_produto:({base_url:o})=>o});var et={"betha-meio-ambiente":w,"e-licencie":V,"e-licencie-gov":O,suporte:q};export{c as Produto,C as chaves_produto,et as listaProdutos,Ro as listarPrefeituras,Vo as listarUsuarios,Lo as listarVinculos,K as opcoesVinculos,I as opcoesVinculosGov,_ as opcoesVinculosGovDescricao,m as opcoesVinculosGovEnum,bo as pAutenticacao,w as produto_betha_meio_ambiente,V as produto_e_licencie,O as produto_e_licencie_gov,q as produto_suporte,W as provedoresGov,a as site_autenticacao,Y as site_autenticacao_login,X as tx__token__,B as tx_listar_prefeituras,G as tx_redirecionar,Q as tx_usuarios__listar,z as tx_vinculos__listar,E as versao_usuarios};