replicação v1 dayjs
This commit is contained in:
parent
d5237fbf6e
commit
9a332853b6
30 changed files with 128 additions and 1301 deletions
|
|
@ -1,29 +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 aleatorio_exports = {};
|
|
||||||
__export(aleatorio_exports, {
|
|
||||||
aleatorio: () => aleatorio
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(aleatorio_exports);
|
|
||||||
const alfabeto = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");
|
|
||||||
const aleatorio = (tamanho) => `eli-${Array.from({ length: tamanho || 8 }).map(() => alfabeto[(999 * Math.random() | 0) % alfabeto.length]).join("")}`;
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
aleatorio
|
|
||||||
});
|
|
||||||
|
|
@ -1,53 +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 cacheMemoria_exports = {};
|
|
||||||
__export(cacheMemoria_exports, {
|
|
||||||
cacheM: () => cacheM,
|
|
||||||
cacheMFixo: () => cacheMFixo,
|
|
||||||
cacheMemoria: () => cacheMemoria,
|
|
||||||
verCacheM: () => verCacheM
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(cacheMemoria_exports);
|
|
||||||
const _cache = {};
|
|
||||||
globalThis.cacheMemoria_cache = _cache;
|
|
||||||
const cacheM = (chave, valor, validadeSeg) => {
|
|
||||||
const txChave = typeof chave == "string" ? chave : typeof chave == "number" ? String(chave) : encodeURIComponent(JSON.stringify(chave));
|
|
||||||
const validade = validadeSeg && (/* @__PURE__ */ new Date()).getTime() + validadeSeg * 1e3;
|
|
||||||
if (valor !== void 0) {
|
|
||||||
_cache[txChave] = {
|
|
||||||
valor,
|
|
||||||
validade
|
|
||||||
};
|
|
||||||
}
|
|
||||||
const busca = _cache[txChave];
|
|
||||||
if (busca?.validade && busca.validade < (/* @__PURE__ */ new Date()).getTime()) {
|
|
||||||
return void 0;
|
|
||||||
}
|
|
||||||
return busca?.valor;
|
|
||||||
};
|
|
||||||
const verCacheM = () => _cache;
|
|
||||||
const cacheMemoria = cacheM;
|
|
||||||
const cacheMFixo = (chave) => (valor) => cacheM(chave, valor);
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
cacheM,
|
|
||||||
cacheMFixo,
|
|
||||||
cacheMemoria,
|
|
||||||
verCacheM
|
|
||||||
});
|
|
||||||
|
|
@ -1,53 +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 constantes_exports = {};
|
|
||||||
__export(constantes_exports, {
|
|
||||||
camposComuns: () => camposComuns,
|
|
||||||
tipoUsuarioResiduos: () => tipoUsuarioResiduos,
|
|
||||||
tx: () => tx,
|
|
||||||
uuid_null: () => uuid_null
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(constantes_exports);
|
|
||||||
const uuid_null = "00000000-0000-0000-0000-000000000000";
|
|
||||||
var camposComuns = /* @__PURE__ */ ((camposComuns2) => {
|
|
||||||
camposComuns2["codigo"] = "codigo";
|
|
||||||
camposComuns2["excluido"] = "excluido";
|
|
||||||
camposComuns2["data_hora_criacao"] = "data_hora_criacao";
|
|
||||||
camposComuns2["data_hora_atualizacao"] = "data_hora_atualizacao";
|
|
||||||
camposComuns2["codigo_usuario_criacao"] = "codigo_usuario_criacao";
|
|
||||||
camposComuns2["codigo_usuario_atualizacao"] = "codigo_usuario_atualizacao";
|
|
||||||
camposComuns2["versao"] = "versao";
|
|
||||||
return camposComuns2;
|
|
||||||
})(camposComuns || {});
|
|
||||||
var tx = /* @__PURE__ */ ((tx2) => {
|
|
||||||
tx2["token"] = "token";
|
|
||||||
return tx2;
|
|
||||||
})(tx || {});
|
|
||||||
var tipoUsuarioResiduos = /* @__PURE__ */ ((tipoUsuarioResiduos2) => {
|
|
||||||
tipoUsuarioResiduos2["Usuario"] = "usuario";
|
|
||||||
tipoUsuarioResiduos2["Fornecedor"] = "fornecedor";
|
|
||||||
return tipoUsuarioResiduos2;
|
|
||||||
})(tipoUsuarioResiduos || {});
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
camposComuns,
|
|
||||||
tipoUsuarioResiduos,
|
|
||||||
tx,
|
|
||||||
uuid_null
|
|
||||||
});
|
|
||||||
|
|
@ -1,69 +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 consulta_exports = {};
|
|
||||||
__export(consulta_exports, {
|
|
||||||
operadores: () => operadores,
|
|
||||||
zFiltro: () => zFiltro,
|
|
||||||
zOperadores: () => zOperadores
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(consulta_exports);
|
|
||||||
var import_zod = __toESM(require("zod"), 1);
|
|
||||||
var operadores = /* @__PURE__ */ ((operadores2) => {
|
|
||||||
operadores2["="] = "=";
|
|
||||||
operadores2["!="] = "!=";
|
|
||||||
operadores2[">"] = ">";
|
|
||||||
operadores2[">="] = ">=";
|
|
||||||
operadores2["<"] = "<";
|
|
||||||
operadores2["<="] = "<=";
|
|
||||||
operadores2["like"] = "like";
|
|
||||||
operadores2["in"] = "in";
|
|
||||||
return operadores2;
|
|
||||||
})(operadores || {});
|
|
||||||
const zOperadores = import_zod.default.enum([
|
|
||||||
"=",
|
|
||||||
"!=",
|
|
||||||
">",
|
|
||||||
">=",
|
|
||||||
"<",
|
|
||||||
"<=",
|
|
||||||
"like",
|
|
||||||
"in"
|
|
||||||
]);
|
|
||||||
const zFiltro = import_zod.default.object({
|
|
||||||
coluna: import_zod.default.string(),
|
|
||||||
valor: import_zod.default.any(),
|
|
||||||
operador: zOperadores,
|
|
||||||
ou: import_zod.default.boolean().optional()
|
|
||||||
});
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
operadores,
|
|
||||||
zFiltro,
|
|
||||||
zOperadores
|
|
||||||
});
|
|
||||||
|
|
@ -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 dayjs_exports = {};
|
|
||||||
__export(dayjs_exports, {
|
|
||||||
dayjsbr: () => import_dayjs.default
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(dayjs_exports);
|
|
||||||
var import_dayjs = __toESM(require("dayjs"), 1);
|
|
||||||
var import_pt_br = require("dayjs/locale/pt-br");
|
|
||||||
var import_duration = __toESM(require("dayjs/plugin/duration"), 1);
|
|
||||||
var import_isSameOrAfter = __toESM(require("dayjs/plugin/isSameOrAfter"), 1);
|
|
||||||
var import_isSameOrBefore = __toESM(require("dayjs/plugin/isSameOrBefore"), 1);
|
|
||||||
var import_minMax = __toESM(require("dayjs/plugin/minMax"), 1);
|
|
||||||
var import_relativeTime = __toESM(require("dayjs/plugin/relativeTime"), 1);
|
|
||||||
var import_timezone = __toESM(require("dayjs/plugin/timezone"), 1);
|
|
||||||
var import_utc = __toESM(require("dayjs/plugin/utc"), 1);
|
|
||||||
var import_weekOfYear = __toESM(require("dayjs/plugin/weekOfYear"), 1);
|
|
||||||
import_dayjs.default.extend(import_utc.default);
|
|
||||||
import_dayjs.default.extend(import_timezone.default);
|
|
||||||
import_dayjs.default.extend(import_weekOfYear.default);
|
|
||||||
import_dayjs.default.extend(import_isSameOrBefore.default);
|
|
||||||
import_dayjs.default.extend(import_isSameOrAfter.default);
|
|
||||||
import_dayjs.default.extend(import_minMax.default);
|
|
||||||
import_dayjs.default.extend(import_relativeTime.default);
|
|
||||||
import_dayjs.default.extend(import_duration.default);
|
|
||||||
import_dayjs.default.locale("pt-br");
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
dayjsbr
|
|
||||||
});
|
|
||||||
|
|
@ -1,22 +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 ecosistema_exports = {};
|
|
||||||
module.exports = __toCommonJS(ecosistema_exports);
|
|
||||||
__reExport(ecosistema_exports, require("./urls"), module.exports);
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
...require("./urls")
|
|
||||||
});
|
|
||||||
|
|
@ -1,28 +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 urls_exports = {};
|
|
||||||
__export(urls_exports, {
|
|
||||||
cdn_carro_de_boi: () => cdn_carro_de_boi
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(urls_exports);
|
|
||||||
const cdn_carro_de_boi = "https://carro-de-boi-idz-one.b-cdn.net";
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
cdn_carro_de_boi
|
|
||||||
});
|
|
||||||
|
|
@ -1,186 +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 extensoes_exports = {};
|
|
||||||
__export(extensoes_exports, {
|
|
||||||
extensoes: () => extensoes,
|
|
||||||
tipoArquivo: () => tipoArquivo
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(extensoes_exports);
|
|
||||||
const extensoes = [
|
|
||||||
{
|
|
||||||
ext: "gif",
|
|
||||||
tipo: "imagem",
|
|
||||||
mime: "image/gif"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ext: "jpg",
|
|
||||||
tipo: "imagem",
|
|
||||||
mime: "image/jpeg"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ext: "jpeg",
|
|
||||||
tipo: "imagem",
|
|
||||||
mime: "image/jpeg"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ext: "png",
|
|
||||||
tipo: "imagem",
|
|
||||||
mime: "image/png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ext: "bmp",
|
|
||||||
tipo: "imagem",
|
|
||||||
mime: "image/bmp"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ext: "webp",
|
|
||||||
tipo: "imagem",
|
|
||||||
mime: "image/webp"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ext: "tiff",
|
|
||||||
tipo: "imagem",
|
|
||||||
mime: "image/tiff"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ext: "svg",
|
|
||||||
tipo: "imagem",
|
|
||||||
mime: "image/svg+xml"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ext: "ico",
|
|
||||||
tipo: "imagem",
|
|
||||||
mime: "image/x-icon"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ext: "pdf",
|
|
||||||
tipo: "documento",
|
|
||||||
mime: "application/pdf"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ext: "doc",
|
|
||||||
tipo: "documento",
|
|
||||||
mime: "application/msword"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ext: "docx",
|
|
||||||
tipo: "documento",
|
|
||||||
mime: "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ext: "xls",
|
|
||||||
tipo: "documento",
|
|
||||||
mime: "application/vnd.ms-excel"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ext: "xlsx",
|
|
||||||
tipo: "documento",
|
|
||||||
mime: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ext: "ppt",
|
|
||||||
tipo: "documento",
|
|
||||||
mime: "application/vnd.ms-powerpoint"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ext: "pptx",
|
|
||||||
tipo: "documento",
|
|
||||||
mime: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ext: "txt",
|
|
||||||
tipo: "documento",
|
|
||||||
mime: "text/plain"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ext: "odt",
|
|
||||||
tipo: "documento",
|
|
||||||
mime: "application/vnd.oasis.opendocument.text"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ext: "ods",
|
|
||||||
tipo: "documento",
|
|
||||||
mime: "application/vnd.oasis.opendocument.spreadsheet"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ext: "rtf",
|
|
||||||
tipo: "documento",
|
|
||||||
mime: "application/rtf"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ext: "csv",
|
|
||||||
tipo: "documento",
|
|
||||||
mime: "text/csv"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ext: "mp4",
|
|
||||||
tipo: "v\xEDdeo",
|
|
||||||
mime: "video/mp4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ext: "avi",
|
|
||||||
tipo: "v\xEDdeo",
|
|
||||||
mime: "video/x-msvideo"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ext: "mkv",
|
|
||||||
tipo: "v\xEDdeo",
|
|
||||||
mime: "video/x-matroska"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ext: "mov",
|
|
||||||
tipo: "v\xEDdeo",
|
|
||||||
mime: "video/quicktime"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ext: "wmv",
|
|
||||||
tipo: "v\xEDdeo",
|
|
||||||
mime: "video/x-ms-wmv"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ext: "flv",
|
|
||||||
tipo: "v\xEDdeo",
|
|
||||||
mime: "video/x-flv"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ext: "webm",
|
|
||||||
tipo: "v\xEDdeo",
|
|
||||||
mime: "video/webm"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ext: "3gp",
|
|
||||||
tipo: "v\xEDdeo",
|
|
||||||
mime: "video/3gpp"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ext: "mpeg",
|
|
||||||
tipo: "v\xEDdeo",
|
|
||||||
mime: "video/mpeg"
|
|
||||||
}
|
|
||||||
];
|
|
||||||
const tipoArquivo = (nomeArquivo) => {
|
|
||||||
const extArquivo = String(nomeArquivo || "").toLocaleLowerCase().split(".").pop();
|
|
||||||
const extensao = extensoes.find((extensao2) => extensao2.ext === extArquivo);
|
|
||||||
return extensao?.tipo || "outros";
|
|
||||||
};
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
extensoes,
|
|
||||||
tipoArquivo
|
|
||||||
});
|
|
||||||
|
|
@ -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 graficosPilao_exports = {};
|
|
||||||
__export(graficosPilao_exports, {
|
|
||||||
graficos_pilao: () => graficos_pilao
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(graficosPilao_exports);
|
|
||||||
const graficos_pilao = {
|
|
||||||
Condicionantes: {
|
|
||||||
grafico: "condicionantes-criadas",
|
|
||||||
titulo: "Condicionantes Criadas"
|
|
||||||
},
|
|
||||||
Licen\u00E7as: {
|
|
||||||
grafico: "licencas-criadas",
|
|
||||||
titulo: "Licen\xE7as Criadas"
|
|
||||||
}
|
|
||||||
};
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
graficos_pilao
|
|
||||||
});
|
|
||||||
|
|
@ -1,54 +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("./aleatorio"), module.exports);
|
|
||||||
__reExport(index_exports, require("./cacheMemoria"), module.exports);
|
|
||||||
__reExport(index_exports, require("./constantes"), module.exports);
|
|
||||||
__reExport(index_exports, require("./consulta"), module.exports);
|
|
||||||
__reExport(index_exports, require("./dayjs"), module.exports);
|
|
||||||
__reExport(index_exports, require("./ecosistema"), module.exports);
|
|
||||||
__reExport(index_exports, require("./extensoes"), module.exports);
|
|
||||||
__reExport(index_exports, require("./graficosPilao"), module.exports);
|
|
||||||
__reExport(index_exports, require("./local"), module.exports);
|
|
||||||
__reExport(index_exports, require("./logger"), module.exports);
|
|
||||||
__reExport(index_exports, require("./postgres"), module.exports);
|
|
||||||
__reExport(index_exports, require("./testes-de-variaveis"), module.exports);
|
|
||||||
__reExport(index_exports, require("./texto_busca"), module.exports);
|
|
||||||
__reExport(index_exports, require("./tipagemRotas"), module.exports);
|
|
||||||
__reExport(index_exports, require("./unidades_medida"), module.exports);
|
|
||||||
__reExport(index_exports, require("./uuid"), module.exports);
|
|
||||||
__reExport(index_exports, require("./variaveisComuns"), module.exports);
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
...require("./aleatorio"),
|
|
||||||
...require("./cacheMemoria"),
|
|
||||||
...require("./constantes"),
|
|
||||||
...require("./consulta"),
|
|
||||||
...require("./dayjs"),
|
|
||||||
...require("./ecosistema"),
|
|
||||||
...require("./extensoes"),
|
|
||||||
...require("./graficosPilao"),
|
|
||||||
...require("./local"),
|
|
||||||
...require("./logger"),
|
|
||||||
...require("./postgres"),
|
|
||||||
...require("./testes-de-variaveis"),
|
|
||||||
...require("./texto_busca"),
|
|
||||||
...require("./tipagemRotas"),
|
|
||||||
...require("./unidades_medida"),
|
|
||||||
...require("./uuid"),
|
|
||||||
...require("./variaveisComuns")
|
|
||||||
});
|
|
||||||
|
|
@ -1,63 +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 __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 import_node_fs = __toESM(require("node:fs"), 1);
|
|
||||||
var import_node_path = __toESM(require("node:path"), 1);
|
|
||||||
const mesclar = (entrada, novo) => {
|
|
||||||
const saida = { ...entrada || {} };
|
|
||||||
for (const [k, v] of Object.entries(novo)) {
|
|
||||||
if (v && typeof v === "object" && !Array.isArray(v)) {
|
|
||||||
saida[k] = mesclar(saida[k], v);
|
|
||||||
} else {
|
|
||||||
saida[k] = v;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return saida;
|
|
||||||
};
|
|
||||||
const abrirJson = (caminho) => {
|
|
||||||
try {
|
|
||||||
return JSON.parse(import_node_fs.default.readFileSync(caminho, "utf-8"));
|
|
||||||
} catch {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const settings_json = {
|
|
||||||
"editor.defaultFormatter": "biomejs.biome",
|
|
||||||
"[javascript]": { "editor.defaultFormatter": "biomejs.biome" },
|
|
||||||
"[javascriptreact]": { "editor.defaultFormatter": "biomejs.biome" },
|
|
||||||
"[typescript]": { "editor.defaultFormatter": "biomejs.biome" },
|
|
||||||
"[typescriptreact]": { "editor.defaultFormatter": "biomejs.biome" },
|
|
||||||
"[json]": { "editor.defaultFormatter": "biomejs.biome" },
|
|
||||||
"[jsonc]": { "editor.defaultFormatter": "biomejs.biome" },
|
|
||||||
"[vue]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
|
|
||||||
"editor.codeActionsOnSave": {
|
|
||||||
"source.organizeImports.biome": "always",
|
|
||||||
"source.fixAll.biome": "always"
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const caminhoSeting = import_node_path.default.join(process.cwd(), ".vscode/settings.json");
|
|
||||||
import_node_fs.default.mkdirSync(import_node_path.default.dirname(caminhoSeting), { recursive: true });
|
|
||||||
const atual = abrirJson(caminhoSeting);
|
|
||||||
const final = mesclar(atual, settings_json);
|
|
||||||
import_node_fs.default.writeFileSync(caminhoSeting, JSON.stringify(final, null, 2), "utf8");
|
|
||||||
console.log(`\u2705 Configura\xE7\xF5es salvas em ${caminhoSeting}`);
|
|
||||||
|
|
@ -1,46 +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 local_exports = {};
|
|
||||||
__export(local_exports, {
|
|
||||||
localValor: () => localValor
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(local_exports);
|
|
||||||
const localValor = (chave_, valor) => {
|
|
||||||
const localStorage = globalThis.localStorage;
|
|
||||||
if (typeof localStorage == "undefined") return null;
|
|
||||||
const chave = typeof chave_ === "string" ? chave_ : encodeURIComponent(JSON.stringify(chave_));
|
|
||||||
try {
|
|
||||||
if (valor !== void 0) {
|
|
||||||
localStorage.setItem(chave, JSON.stringify(valor));
|
|
||||||
}
|
|
||||||
const v2 = localStorage.getItem(chave);
|
|
||||||
if (v2 === null) return null;
|
|
||||||
try {
|
|
||||||
return JSON.parse(v2);
|
|
||||||
} catch {
|
|
||||||
return v2;
|
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
localValor
|
|
||||||
});
|
|
||||||
|
|
@ -1,106 +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 logger_exports = {};
|
|
||||||
__export(logger_exports, {
|
|
||||||
defineCwd: () => defineCwd,
|
|
||||||
logger: () => logger,
|
|
||||||
postLogger: () => postLogger
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(logger_exports);
|
|
||||||
var import_cross_fetch = __toESM(require("cross-fetch"), 1);
|
|
||||||
var import_variaveisComuns = require("./variaveisComuns");
|
|
||||||
const LOKI_BASE_URL = "https://log.idz.one";
|
|
||||||
const LOKI_ENDPOINT = "/loki/api/v1/push";
|
|
||||||
const postLogger = async ({
|
|
||||||
objeto
|
|
||||||
}) => {
|
|
||||||
const response = await (0, import_cross_fetch.default)(`${LOKI_BASE_URL}${LOKI_ENDPOINT}`, {
|
|
||||||
method: "POST",
|
|
||||||
headers: { "Content-Type": "application/json" },
|
|
||||||
body: JSON.stringify(objeto)
|
|
||||||
}).catch((a) => a);
|
|
||||||
if (!response.ok) {
|
|
||||||
return [objeto, `Erro ${response.status}: ${await response?.text?.()}`];
|
|
||||||
}
|
|
||||||
return [objeto];
|
|
||||||
};
|
|
||||||
let cwd = "";
|
|
||||||
const defineCwd = (novoCwd) => {
|
|
||||||
cwd = novoCwd;
|
|
||||||
};
|
|
||||||
const logger = ({ app: app_e, eProducao, parametros: parametrosAmbiente }) => ({ inquilino, usuario, parametros: parametrosSessao }) => async (level, mensagem, op_tipoLog) => {
|
|
||||||
let {
|
|
||||||
__filename,
|
|
||||||
detalhes,
|
|
||||||
local,
|
|
||||||
parametros: parametrosLog
|
|
||||||
} = op_tipoLog || {};
|
|
||||||
const app = `${eProducao ? "" : "DEV-"}${app_e}`;
|
|
||||||
if (cwd && __filename) {
|
|
||||||
__filename = __filename.replace(cwd, "");
|
|
||||||
}
|
|
||||||
if (local) {
|
|
||||||
detalhes = [`${(0, import_variaveisComuns.nomeVariavel)({ local })}="${local}"`, ...detalhes || []];
|
|
||||||
}
|
|
||||||
if (__filename) {
|
|
||||||
detalhes = [
|
|
||||||
`${(0, import_variaveisComuns.nomeVariavel)({ __filename })}="${__filename}"`,
|
|
||||||
...detalhes || []
|
|
||||||
];
|
|
||||||
}
|
|
||||||
const timestamp = `${Date.now()}000000`;
|
|
||||||
const mainLog = detalhes?.length ? `${mensagem} | ${detalhes.map((d) => JSON.stringify(d)).join(" | ")}` : mensagem;
|
|
||||||
const payload = {
|
|
||||||
stream: {
|
|
||||||
app,
|
|
||||||
inquilino,
|
|
||||||
usuario,
|
|
||||||
level,
|
|
||||||
...parametrosAmbiente || {},
|
|
||||||
...parametrosSessao || {},
|
|
||||||
...parametrosLog || {}
|
|
||||||
},
|
|
||||||
values: [
|
|
||||||
[
|
|
||||||
timestamp,
|
|
||||||
mainLog
|
|
||||||
// Linha de log direta
|
|
||||||
]
|
|
||||||
]
|
|
||||||
};
|
|
||||||
const objeto = { streams: [payload] };
|
|
||||||
const response = await postLogger({ objeto });
|
|
||||||
return response;
|
|
||||||
};
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
defineCwd,
|
|
||||||
logger,
|
|
||||||
postLogger
|
|
||||||
});
|
|
||||||
|
|
@ -1,47 +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 postgres_exports = {};
|
|
||||||
__export(postgres_exports, {
|
|
||||||
objetoPg: () => objetoPg,
|
|
||||||
paraObjetoRegistroPg: () => paraObjetoRegistroPg,
|
|
||||||
pgObjeto: () => pgObjeto
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(postgres_exports);
|
|
||||||
const paraObjetoRegistroPg = (entrada) => {
|
|
||||||
try {
|
|
||||||
return Object.fromEntries(
|
|
||||||
Object.entries(entrada).map(([k, v]) => [
|
|
||||||
k,
|
|
||||||
v === void 0 || v == null ? v : typeof v == "string" || typeof v == "number" || typeof v == "boolean" ? v : JSON.stringify(v, null, 2)
|
|
||||||
])
|
|
||||||
);
|
|
||||||
} catch (error) {
|
|
||||||
throw new Error(
|
|
||||||
`Erro na fun\xE7\xE3o paraObjetoRegistroPg: ${error.message} ${error.stack}`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const pgObjeto = paraObjetoRegistroPg;
|
|
||||||
const objetoPg = paraObjetoRegistroPg;
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
objetoPg,
|
|
||||||
paraObjetoRegistroPg,
|
|
||||||
pgObjeto
|
|
||||||
});
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
"use strict";
|
|
||||||
var import_cacheMemoria = require("./cacheMemoria");
|
|
||||||
var import_texto_busca = require("./texto_busca");
|
|
||||||
console.log("Vari\xE1veis funcionando", import_texto_busca.texto_busca);
|
|
||||||
(0, import_cacheMemoria.cacheM)(1, { Jaca: Promise.resolve() });
|
|
||||||
console.log("cache:", (0, import_cacheMemoria.cacheM)(1));
|
|
||||||
|
|
@ -1,24 +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 testes_de_variaveis_exports = {};
|
|
||||||
module.exports = __toCommonJS(testes_de_variaveis_exports);
|
|
||||||
__reExport(testes_de_variaveis_exports, require("./umaFuncao"), module.exports);
|
|
||||||
__reExport(testes_de_variaveis_exports, require("./umaVariavel"), module.exports);
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
...require("./umaFuncao"),
|
|
||||||
...require("./umaVariavel")
|
|
||||||
});
|
|
||||||
|
|
@ -1,28 +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 umaFuncao_exports = {};
|
|
||||||
__export(umaFuncao_exports, {
|
|
||||||
umaFuncao: () => umaFuncao
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(umaFuncao_exports);
|
|
||||||
const umaFuncao = () => "Ol\xE1 Mundo! (fun\xE7\xE3o)";
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
umaFuncao
|
|
||||||
});
|
|
||||||
|
|
@ -1,28 +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 umaVariavel_exports = {};
|
|
||||||
__export(umaVariavel_exports, {
|
|
||||||
umaVariavel: () => umaVariavel
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(umaVariavel_exports);
|
|
||||||
const umaVariavel = "Ol\xE1 Mundo! (vari\xE1vel)";
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
umaVariavel
|
|
||||||
});
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
"use strict";
|
|
||||||
var import_vitest = require("vitest");
|
|
||||||
var import_tipagemRotas = require("../tipagemRotas");
|
|
||||||
(0, import_vitest.describe)("TipagemRotas", () => {
|
|
||||||
(0, import_vitest.it)("deve montar _partesCaminho a partir de string ou array, normalizando barras", () => {
|
|
||||||
const r1 = new import_tipagemRotas.TipagemRotas({ caminho: "aplicacao/func" });
|
|
||||||
(0, import_vitest.expect)(r1.caminho).toBe("/aplicacao/func");
|
|
||||||
const r2 = new import_tipagemRotas.TipagemRotas({
|
|
||||||
caminho: ["aplicacao", "func"]
|
|
||||||
});
|
|
||||||
(0, import_vitest.expect)(r2.caminho).toBe("/aplicacao/func");
|
|
||||||
const r3 = new import_tipagemRotas.TipagemRotas({ caminho: "/a//b///c/" });
|
|
||||||
(0, import_vitest.expect)(r3.caminho).toBe("/a/b/c");
|
|
||||||
});
|
|
||||||
(0, import_vitest.it)("Valores de entrada com mesmo valor dos valores de sa\xEDda", () => {
|
|
||||||
const r1 = new import_tipagemRotas.TipagemRotas({ caminho: "aplicacao/func" });
|
|
||||||
const objetoEntrada = { idade: 21, nome: "Jo\xE3o" };
|
|
||||||
const rota = r1.endereco(objetoEntrada);
|
|
||||||
const parametros = r1.parametros(rota);
|
|
||||||
(0, import_vitest.expect)(parametros.nome).toBe(objetoEntrada.nome);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
@ -1,30 +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 texto_busca_exports = {};
|
|
||||||
__export(texto_busca_exports, {
|
|
||||||
texto_busca: () => texto_busca
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(texto_busca_exports);
|
|
||||||
const texto_busca = (...texto) => texto.map(
|
|
||||||
(txt) => txt === null || txt === void 0 ? "" : String(txt).normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/\s+/g, " ").toLowerCase()
|
|
||||||
).join(" ");
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
texto_busca
|
|
||||||
});
|
|
||||||
|
|
@ -1,118 +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 tipagemRotas_exports = {};
|
|
||||||
__export(tipagemRotas_exports, {
|
|
||||||
TipagemRotas: () => TipagemRotas
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(tipagemRotas_exports);
|
|
||||||
class TipagemRotas {
|
|
||||||
/** Ao criar novo obijeto de tipagem de rota é necessário passar o caminho parcial
|
|
||||||
** export const mCaminho = new TipagemRotas<{q:string}>("aplicacao","funcionalidade")
|
|
||||||
*/
|
|
||||||
constructor({
|
|
||||||
caminho,
|
|
||||||
acaoIr,
|
|
||||||
rotulo
|
|
||||||
}) {
|
|
||||||
this._partesCaminho = [];
|
|
||||||
this._acaoIr = acaoIr;
|
|
||||||
this._partesCaminho = (Array.isArray(caminho) ? caminho : [caminho]).filter(Boolean).map((a) => String(a)).flatMap((a) => a.split("/")).filter(Boolean);
|
|
||||||
this.rotulo = rotulo;
|
|
||||||
}
|
|
||||||
/** Retorna o caminho completo da rota
|
|
||||||
** console.log(mCaminho.caminho)
|
|
||||||
** "/caminho"
|
|
||||||
*/
|
|
||||||
get caminho() {
|
|
||||||
const ret = `/${this._partesCaminho.join("/")}`;
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
/** Define o caminho completo da rota
|
|
||||||
** mCaminho.caminho = "/novoCaminho"
|
|
||||||
** console.log(mCaminho.caminho)
|
|
||||||
** "/novoCaminho"
|
|
||||||
** */
|
|
||||||
set caminho(caminhoParcial) {
|
|
||||||
this._partesCaminho = caminhoParcial.split("/").filter((parte) => parte);
|
|
||||||
}
|
|
||||||
/** Retorna o caminho completo da rota com a query
|
|
||||||
** console.log(mCaminho.resolve({q:"query"}))
|
|
||||||
** "http://localhost:3000/caminho?q=query"
|
|
||||||
*/
|
|
||||||
endereco(query, usarComoHash) {
|
|
||||||
const url = new URL(
|
|
||||||
typeof window !== "undefined" ? window.location.href : "http://localhost"
|
|
||||||
);
|
|
||||||
url.pathname = this.caminho;
|
|
||||||
url.search = "";
|
|
||||||
const queryKeys = Object.entries(query);
|
|
||||||
for (const [key, value] of queryKeys) {
|
|
||||||
url.searchParams.set(String(key), JSON.stringify(value));
|
|
||||||
}
|
|
||||||
url.hash = "";
|
|
||||||
if (usarComoHash) {
|
|
||||||
url.hash = `#${url.search}`;
|
|
||||||
url.search = "";
|
|
||||||
}
|
|
||||||
return url.href;
|
|
||||||
}
|
|
||||||
/** Vai para a url
|
|
||||||
** mCaminho.ir({q:"query"})
|
|
||||||
** window.location.href = "http://localhost:3000/caminho?q=query"
|
|
||||||
*/
|
|
||||||
ir(query) {
|
|
||||||
if (this._acaoIr) {
|
|
||||||
this._acaoIr(this.endereco({ ...query }));
|
|
||||||
} else {
|
|
||||||
if (typeof window != "undefined") {
|
|
||||||
window.location.href = this.endereco({ ...query });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/** Retorna os parametros da url
|
|
||||||
** console.log(mCaminho.parametros())
|
|
||||||
** {q:"query"}
|
|
||||||
*/
|
|
||||||
parametros(urlEntrada) {
|
|
||||||
const url = urlEntrada ? new URL(urlEntrada) : new URL(
|
|
||||||
typeof window !== "undefined" ? window.location.href : "http://localhost"
|
|
||||||
);
|
|
||||||
const query = url.searchParams;
|
|
||||||
let queryObj = Object.fromEntries(query.entries());
|
|
||||||
const hash = url.hash;
|
|
||||||
if (hash) {
|
|
||||||
const hashObj = Object.fromEntries(
|
|
||||||
new URLSearchParams(hash.slice(1)).entries()
|
|
||||||
);
|
|
||||||
queryObj = { ...queryObj, ...hashObj };
|
|
||||||
}
|
|
||||||
for (const chave in queryObj) {
|
|
||||||
try {
|
|
||||||
queryObj[chave] = JSON.parse(queryObj[chave]);
|
|
||||||
} catch {
|
|
||||||
console.log(`[${chave}|${queryObj[chave]}] n\xE3o \xE9 um json v\xE1lido.`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return queryObj;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
TipagemRotas
|
|
||||||
});
|
|
||||||
|
|
@ -1,82 +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 unidades_medida_exports = {};
|
|
||||||
__export(unidades_medida_exports, {
|
|
||||||
siglas_unidades_medida: () => siglas_unidades_medida,
|
|
||||||
unidades_medida: () => unidades_medida
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(unidades_medida_exports);
|
|
||||||
var siglas_unidades_medida = /* @__PURE__ */ ((siglas_unidades_medida2) => {
|
|
||||||
siglas_unidades_medida2["UN"] = "UN";
|
|
||||||
siglas_unidades_medida2["KG"] = "KG";
|
|
||||||
siglas_unidades_medida2["TON"] = "TON";
|
|
||||||
siglas_unidades_medida2["g"] = "g";
|
|
||||||
siglas_unidades_medida2["M\xB3"] = "M\xB3";
|
|
||||||
siglas_unidades_medida2["Lt"] = "Lt";
|
|
||||||
return siglas_unidades_medida2;
|
|
||||||
})(siglas_unidades_medida || {});
|
|
||||||
const unidades_medida = [
|
|
||||||
{
|
|
||||||
sigla_unidade: "KG",
|
|
||||||
nome: "Quilograma",
|
|
||||||
sigla_normalizada: "KG",
|
|
||||||
normalizar: (valor) => valor,
|
|
||||||
tipo: "massa"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sigla_unidade: "g",
|
|
||||||
nome: "Grama",
|
|
||||||
sigla_normalizada: "KG",
|
|
||||||
normalizar: (valor) => valor / 1e3,
|
|
||||||
tipo: "massa"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sigla_unidade: "TON",
|
|
||||||
nome: "Tonelada",
|
|
||||||
sigla_normalizada: "KG",
|
|
||||||
normalizar: (valor) => valor * 1e3,
|
|
||||||
tipo: "massa"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sigla_unidade: "Lt",
|
|
||||||
nome: "Litro",
|
|
||||||
sigla_normalizada: "Lt",
|
|
||||||
normalizar: (valor) => valor,
|
|
||||||
tipo: "volume"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sigla_unidade: "M\xB3",
|
|
||||||
nome: "Metro C\xFAbico",
|
|
||||||
sigla_normalizada: "Lt",
|
|
||||||
normalizar: (valor) => valor * 1e3,
|
|
||||||
tipo: "volume"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sigla_unidade: "UN",
|
|
||||||
nome: "Unidade",
|
|
||||||
sigla_normalizada: "UN",
|
|
||||||
normalizar: (valor) => valor,
|
|
||||||
tipo: "unidade"
|
|
||||||
}
|
|
||||||
];
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
siglas_unidades_medida,
|
|
||||||
unidades_medida
|
|
||||||
});
|
|
||||||
|
|
@ -1,51 +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, {
|
|
||||||
erUuid: () => erUuid,
|
|
||||||
uuid: () => uuid,
|
|
||||||
uuidV3: () => uuidV3,
|
|
||||||
uuidV4: () => uuidV4,
|
|
||||||
validarUuid: () => validarUuid
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(uuid_exports);
|
|
||||||
var import_uuid = require("uuid");
|
|
||||||
const erUuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
||||||
const validarUuid = (uuid2) => {
|
|
||||||
const retorno = erUuid.test(String(uuid2 || ""));
|
|
||||||
return retorno;
|
|
||||||
};
|
|
||||||
const uuidV3 = (chave, grupo) => {
|
|
||||||
return (0, import_uuid.v3)(
|
|
||||||
// Converte a chave para string (de forma segura)
|
|
||||||
typeof chave === "string" ? chave : typeof chave === "number" ? String(chave) : JSON.stringify(chave),
|
|
||||||
// Se um grupo foi fornecido, gera um UUID v3 recursivamente com base nele, senão usa NIL
|
|
||||||
grupo ? uuidV3(grupo) : import_uuid.NIL
|
|
||||||
);
|
|
||||||
};
|
|
||||||
const uuidV4 = import_uuid.v4;
|
|
||||||
const uuid = uuidV4;
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
erUuid,
|
|
||||||
uuid,
|
|
||||||
uuidV3,
|
|
||||||
uuidV4,
|
|
||||||
validarUuid
|
|
||||||
});
|
|
||||||
|
|
@ -1,33 +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 variaveisComuns_exports = {};
|
|
||||||
__export(variaveisComuns_exports, {
|
|
||||||
esperar: () => esperar,
|
|
||||||
nomeVariavel: () => nomeVariavel
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(variaveisComuns_exports);
|
|
||||||
const esperar = (ms) => new Promise(
|
|
||||||
(resolve) => setTimeout(() => resolve(true), ms)
|
|
||||||
);
|
|
||||||
const nomeVariavel = (v) => Object.keys(v).join("/");
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
esperar,
|
|
||||||
nomeVariavel
|
|
||||||
});
|
|
||||||
File diff suppressed because one or more lines are too long
2
dist/index.cjs
vendored
Normal file
2
dist/index.cjs
vendored
Normal file
File diff suppressed because one or more lines are too long
0
dist-front/index.d.ts → dist/index.d.ts
vendored
0
dist-front/index.d.ts → dist/index.d.ts
vendored
23
dist/index.global.js
vendored
Normal file
23
dist/index.global.js
vendored
Normal file
File diff suppressed because one or more lines are too long
14
package.json
14
package.json
|
|
@ -1,16 +1,15 @@
|
||||||
{
|
{
|
||||||
|
|
||||||
"name": "p-comuns",
|
"name": "p-comuns",
|
||||||
"version": "0.247.6",
|
"version": "0.252.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "./dist-back/index.js",
|
"main": "dist/index.cjs",
|
||||||
"module": "./dist-front/index.mjs",
|
"module": "./dist-front/index.mjs",
|
||||||
"types": "./dist-front/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"biome": "pnpm exec biome check --write",
|
"biome": "pnpm exec biome check --write",
|
||||||
"check": "pnpm run biome && npx tsc --noEmit",
|
"check": "pnpm run biome && npx tsc --noEmit",
|
||||||
"build": "npm --no-git-tag-version version minor && pnpm run biome && tsup --config ./tsup/tsup.config.ts",
|
"build": "npm --no-git-tag-version version minor && pnpm run biome && tsup --config ./tsup/tsup.config.ouro.ts",
|
||||||
"teste": "npx vitest run src/testes/TipagemRotas.test.ts"
|
"teste": "npx vitest run src/testes/TipagemRotas.test.ts"
|
||||||
},
|
},
|
||||||
"author": {
|
"author": {
|
||||||
|
|
@ -31,5 +30,8 @@
|
||||||
"tsup": "8.5.0",
|
"tsup": "8.5.0",
|
||||||
"typescript": "~5.9.3",
|
"typescript": "~5.9.3",
|
||||||
"vitest": "^3.2.4"
|
"vitest": "^3.2.4"
|
||||||
}
|
},
|
||||||
|
"browser": "dist/index.global.js",
|
||||||
|
"unpkg": "dist/index.global.js",
|
||||||
|
"jsdelivr": "dist/index.global.js"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
72
tsup/tsup.config.ouro.ts
Normal file
72
tsup/tsup.config.ouro.ts
Normal file
|
|
@ -0,0 +1,72 @@
|
||||||
|
// tsup.config.ts
|
||||||
|
import { defineConfig } from 'tsup'
|
||||||
|
import fs from 'node:fs'
|
||||||
|
import path from 'node:path'
|
||||||
|
|
||||||
|
// --- 0) Atualiza package.json antes do build (determinístico) ---
|
||||||
|
const pkgPath = path.resolve('package.json')
|
||||||
|
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'))
|
||||||
|
|
||||||
|
// Define os campos ao estilo “dayjs-like”: 1 entry CJS + 1 bundle global
|
||||||
|
const nextPkg = {
|
||||||
|
...pkg,
|
||||||
|
main: 'dist/index.cjs', // Node / SSR (require)
|
||||||
|
types: 'dist/index.d.ts', // Tipos
|
||||||
|
// NÃO usar "module" aqui (muitos bundlers esperam ESM) — deixa sem.
|
||||||
|
browser: 'dist/index.global.js', // Browser sem bundler (<script>)
|
||||||
|
unpkg: 'dist/index.global.js', // CDN unpkg
|
||||||
|
jsdelivr: 'dist/index.global.js', // CDN jsDelivr
|
||||||
|
// Remove conflitos:
|
||||||
|
type: undefined as unknown as string,
|
||||||
|
exports: undefined as unknown as Record<string, unknown>,
|
||||||
|
}
|
||||||
|
// Remove chaves undefined de fato
|
||||||
|
Object.keys(nextPkg).forEach((k) => {
|
||||||
|
// @ts-ignore
|
||||||
|
if (nextPkg[k] === undefined) delete (nextPkg as any)[k]
|
||||||
|
})
|
||||||
|
fs.writeFileSync(pkgPath, JSON.stringify(nextPkg, null, 2) + '\n')
|
||||||
|
|
||||||
|
// --- 1) Externals automáticos (não embutir deps/peerDeps) ---
|
||||||
|
const external = [
|
||||||
|
...Object.keys(pkg.dependencies ?? {}),
|
||||||
|
...Object.keys(pkg.peerDependencies ?? {}),
|
||||||
|
]
|
||||||
|
|
||||||
|
// --- 2) Configuração tsup: CJS + IIFE (global) ---
|
||||||
|
export default defineConfig([
|
||||||
|
// 2.1) Bundle CJS para Node/SSR (gera dist/index.cjs + dist/index.d.ts)
|
||||||
|
{
|
||||||
|
entry: { index: 'src/index.ts' },
|
||||||
|
outDir: 'dist',
|
||||||
|
format: ['cjs'],
|
||||||
|
dts: true, // tipos aqui (um só lugar)
|
||||||
|
platform: 'neutral', // evita polyfills de node
|
||||||
|
target: 'es2018',
|
||||||
|
treeshake: true,
|
||||||
|
sourcemap: false,
|
||||||
|
minify: true,
|
||||||
|
clean: true, // limpa dist apenas nesta job
|
||||||
|
external,
|
||||||
|
skipNodeModulesBundle: true,
|
||||||
|
outExtension: () => ({ js: '.cjs' }),
|
||||||
|
},
|
||||||
|
|
||||||
|
// 2.2) Bundle global para browser (IIFE) → dist/index.global.js
|
||||||
|
{
|
||||||
|
entry: { index: 'src/index.ts' },
|
||||||
|
outDir: 'dist',
|
||||||
|
format: ['iife'],
|
||||||
|
dts: false, // tipos já emitidos na primeira
|
||||||
|
platform: 'browser',
|
||||||
|
target: 'es2015',
|
||||||
|
globalName: 'PComuns', // expõe window.PComuns
|
||||||
|
treeshake: true,
|
||||||
|
sourcemap: false,
|
||||||
|
minify: true,
|
||||||
|
clean: false,
|
||||||
|
external, // mantém deps externas se houver
|
||||||
|
skipNodeModulesBundle: true,
|
||||||
|
outExtension: () => ({ js: '.global.js' }),
|
||||||
|
},
|
||||||
|
])
|
||||||
Loading…
Add table
Add a link
Reference in a new issue