implementado tsup
This commit is contained in:
parent
7bddbd5c72
commit
8efeb59716
131 changed files with 2216 additions and 1476 deletions
30
dist-back/aleatorio.cjs
Normal file
30
dist-back/aleatorio.cjs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
"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
|
||||
});
|
||||
//# sourceMappingURL=aleatorio.cjs.map
|
||||
1
dist-back/aleatorio.cjs.map
Normal file
1
dist-back/aleatorio.cjs.map
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../src/aleatorio.ts"],"sourcesContent":["const alfabeto = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\".split(\"\")\n\nexport const aleatorio = (tamanho?: number) =>\n `eli-${Array.from({ length: tamanho || 8 })\n .map(() => alfabeto[((999 * Math.random()) | 0) % alfabeto.length])\n .join(\"\")}`\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAAM,WAAW,6BAA6B,MAAM,EAAE;AAE/C,MAAM,YAAY,CAAC,YACxB,OAAO,MAAM,KAAK,EAAE,QAAQ,WAAW,EAAE,CAAC,EACvC,IAAI,MAAM,UAAW,MAAM,KAAK,OAAO,IAAK,KAAK,SAAS,MAAM,CAAC,EACjE,KAAK,EAAE,CAAC;","names":[]}
|
||||
54
dist-back/constantes.cjs
Normal file
54
dist-back/constantes.cjs
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
"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
|
||||
});
|
||||
//# sourceMappingURL=constantes.cjs.map
|
||||
1
dist-back/constantes.cjs.map
Normal file
1
dist-back/constantes.cjs.map
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../src/constantes.ts"],"sourcesContent":["export const uuid_null = \"00000000-0000-0000-0000-000000000000\"\n\n/** Colunas Presentes n maioria das tabelas */\nexport enum camposComuns {\n codigo = \"codigo\",\n excluido = \"excluido\",\n data_hora_criacao = \"data_hora_criacao\",\n data_hora_atualizacao = \"data_hora_atualizacao\",\n codigo_usuario_criacao = \"codigo_usuario_criacao\",\n codigo_usuario_atualizacao = \"codigo_usuario_atualizacao\",\n versao = \"versao\",\n}\n\n/** Palavras comumente usadas */\nexport enum tx {\n token = \"token\",\n}\n\nexport enum tipoUsuarioResiduos {\n Usuario = \"usuario\",\n Fornecedor = \"fornecedor\",\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,YAAY;AAGlB,IAAK,eAAL,kBAAKA,kBAAL;AACL,EAAAA,cAAA,YAAS;AACT,EAAAA,cAAA,cAAW;AACX,EAAAA,cAAA,uBAAoB;AACpB,EAAAA,cAAA,2BAAwB;AACxB,EAAAA,cAAA,4BAAyB;AACzB,EAAAA,cAAA,gCAA6B;AAC7B,EAAAA,cAAA,YAAS;AAPC,SAAAA;AAAA,GAAA;AAWL,IAAK,KAAL,kBAAKC,QAAL;AACL,EAAAA,IAAA,WAAQ;AADE,SAAAA;AAAA,GAAA;AAIL,IAAK,sBAAL,kBAAKC,yBAAL;AACL,EAAAA,qBAAA,aAAU;AACV,EAAAA,qBAAA,gBAAa;AAFH,SAAAA;AAAA,GAAA;","names":["camposComuns","tx","tipoUsuarioResiduos"]}
|
||||
39
dist-back/consulta.cjs
Normal file
39
dist-back/consulta.cjs
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
"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 consulta_exports = {};
|
||||
__export(consulta_exports, {
|
||||
operadores: () => operadores
|
||||
});
|
||||
module.exports = __toCommonJS(consulta_exports);
|
||||
var operadores = /* @__PURE__ */ ((operadores2) => {
|
||||
operadores2["="] = "=";
|
||||
operadores2["!="] = "!=";
|
||||
operadores2[">"] = ">";
|
||||
operadores2[">="] = ">=";
|
||||
operadores2["<"] = "<";
|
||||
operadores2["<="] = "<=";
|
||||
operadores2["like"] = "like";
|
||||
operadores2["in"] = "in";
|
||||
return operadores2;
|
||||
})(operadores || {});
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
operadores
|
||||
});
|
||||
//# sourceMappingURL=consulta.cjs.map
|
||||
1
dist-back/consulta.cjs.map
Normal file
1
dist-back/consulta.cjs.map
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../src/consulta.ts"],"sourcesContent":["export enum operadores {\n \"=\" = \"=\",\n \"!=\" = \"!=\",\n \">\" = \">\",\n \">=\" = \">=\",\n \"<\" = \"<\",\n \"<=\" = \"<=\",\n like = \"like\",\n in = \"in\",\n}\n\nexport type tipoFiltro = {\n coluna: string\n valor: any\n operador: keyof typeof operadores | operadores\n ou?: boolean\n}\n\nexport type interfaceConsulta = {\n offset?: number\n limit?: number\n filtros?: tipoFiltro[]\n ordem?: string\n ordemTipo?: \"asc\" | \"desc\"\n colunas?: string[]\n apenasConsulta?: boolean\n apenasContagem?: boolean\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAK,aAAL,kBAAKA,gBAAL;AACL,EAAAA,YAAA,OAAM;AACN,EAAAA,YAAA,QAAO;AACP,EAAAA,YAAA,OAAM;AACN,EAAAA,YAAA,QAAO;AACP,EAAAA,YAAA,OAAM;AACN,EAAAA,YAAA,QAAO;AACP,EAAAA,YAAA,UAAO;AACP,EAAAA,YAAA,QAAK;AARK,SAAAA;AAAA,GAAA;","names":["operadores"]}
|
||||
23
dist-back/ecosistema/index.cjs
Normal file
23
dist-back/ecosistema/index.cjs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
"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")
|
||||
});
|
||||
//# sourceMappingURL=index.cjs.map
|
||||
1
dist-back/ecosistema/index.cjs.map
Normal file
1
dist-back/ecosistema/index.cjs.map
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../src/ecosistema/index.ts"],"sourcesContent":["export * from \"./urls\"\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,+BAAc,mBAAd;","names":[]}
|
||||
29
dist-back/ecosistema/urls.cjs
Normal file
29
dist-back/ecosistema/urls.cjs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
"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
|
||||
});
|
||||
//# sourceMappingURL=urls.cjs.map
|
||||
1
dist-back/ecosistema/urls.cjs.map
Normal file
1
dist-back/ecosistema/urls.cjs.map
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../src/ecosistema/urls.ts"],"sourcesContent":["export const cdn_carro_de_boi = \"https://carro-de-boi-idz-one.b-cdn.net\"\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,mBAAmB;","names":[]}
|
||||
187
dist-back/extensoes.cjs
Normal file
187
dist-back/extensoes.cjs
Normal file
|
|
@ -0,0 +1,187 @@
|
|||
"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
|
||||
});
|
||||
//# sourceMappingURL=extensoes.cjs.map
|
||||
1
dist-back/extensoes.cjs.map
Normal file
1
dist-back/extensoes.cjs.map
Normal file
File diff suppressed because one or more lines are too long
43
dist-back/index.cjs
Normal file
43
dist-back/index.cjs
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
"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("./constantes"), module.exports);
|
||||
__reExport(index_exports, require("./consulta"), module.exports);
|
||||
__reExport(index_exports, require("./ecosistema"), module.exports);
|
||||
__reExport(index_exports, require("./extensoes"), module.exports);
|
||||
__reExport(index_exports, require("./logger"), 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("./constantes"),
|
||||
...require("./consulta"),
|
||||
...require("./ecosistema"),
|
||||
...require("./extensoes"),
|
||||
...require("./logger"),
|
||||
...require("./texto_busca"),
|
||||
...require("./tipagemRotas"),
|
||||
...require("./unidades_medida"),
|
||||
...require("./uuid"),
|
||||
...require("./variaveisComuns")
|
||||
});
|
||||
//# sourceMappingURL=index.cjs.map
|
||||
1
dist-back/index.cjs.map
Normal file
1
dist-back/index.cjs.map
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from \"./aleatorio\"\nexport * from \"./constantes\"\nexport * from \"./consulta\"\nexport * from \"./ecosistema\"\nexport * from \"./extensoes\"\nexport * from \"./logger\"\nexport * from \"./texto_busca\"\nexport * from \"./tipagemRotas\"\nexport * from \"./unidades_medida\"\nexport * from \"./uuid\"\nexport * from \"./variaveisComuns\"\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,wBAAd;AACA,0BAAc,yBADd;AAEA,0BAAc,uBAFd;AAGA,0BAAc,yBAHd;AAIA,0BAAc,wBAJd;AAKA,0BAAc,qBALd;AAMA,0BAAc,0BANd;AAOA,0BAAc,2BAPd;AAQA,0BAAc,8BARd;AASA,0BAAc,mBATd;AAUA,0BAAc,8BAVd;","names":[]}
|
||||
107
dist-back/logger.cjs
Normal file
107
dist-back/logger.cjs
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
"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"));
|
||||
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
|
||||
});
|
||||
//# sourceMappingURL=logger.cjs.map
|
||||
1
dist-back/logger.cjs.map
Normal file
1
dist-back/logger.cjs.map
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../src/logger.ts"],"sourcesContent":["import crossFetch from \"cross-fetch\"\nimport { nomeVariavel } from \"./variaveisComuns\"\n\nconst LOKI_BASE_URL = \"https://log.idz.one\"\nconst LOKI_ENDPOINT = \"/loki/api/v1/push\"\nexport type tipoLokiObjeto = {\n streams: {\n stream: {\n [k: string]: string\n }\n values: [string, string][]\n }[]\n}\n\nexport const postLogger = async ({\n objeto,\n}: {\n objeto: tipoLokiObjeto\n}): Promise<[objeto: tipoLokiObjeto, erro?: string]> => {\n const response = await crossFetch(`${LOKI_BASE_URL}${LOKI_ENDPOINT}`, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(objeto),\n }).catch((a) => a)\n if (!response.ok) {\n return [objeto, `Erro ${response.status}: ${await response?.text?.()}`]\n }\n return [objeto]\n}\n\nlet cwd = \"\"\n\n/** define a localização da pasta do projeto */\nexport const defineCwd = (novoCwd: string) => {\n cwd = novoCwd\n}\n\ntype tipoLevel = \"info\" | \"warn\" | \"error\"\n\ntype tipoOpSessao = {\n inquilino: string\n usuario: string\n parametros?: { [k: string]: string }\n}\n\ntype tipoLog = {\n detalhes?: unknown[]\n __filename?: string\n local?: string\n parametros?: { [k: string]: string }\n}\n\nexport type tipoLoggerLog = (\n level: tipoLevel,\n mensagem: string,\n op_tipoLog?: tipoLog,\n) => Promise<[objeto: tipoLokiObjeto, erro?: string]>\n\nexport type TipoLoggerSessao = (sess: tipoOpSessao) => tipoLoggerLog\n\nexport type tipoLogger = (amb: {\n app: string\n eProducao: boolean\n parametros?: {\n [k: string]: string\n }\n}) => TipoLoggerSessao\n\nexport const logger: tipoLogger =\n ({ app: app_e, eProducao, parametros: parametrosAmbiente }) =>\n ({ inquilino, usuario, parametros: parametrosSessao }) =>\n async (level, mensagem, op_tipoLog) => {\n let {\n __filename,\n detalhes,\n local,\n parametros: parametrosLog,\n } = op_tipoLog || {}\n\n const app = `${eProducao ? \"\" : \"DEV-\"}${app_e}`\n\n if (cwd && __filename) {\n __filename = __filename.replace(cwd, \"\")\n }\n\n if (local) {\n detalhes = [`${nomeVariavel({ local })}=\"${local}\"`, ...(detalhes || [])]\n }\n\n if (__filename) {\n detalhes = [\n `${nomeVariavel({ __filename })}=\"${__filename}\"`,\n ...(detalhes || []),\n ]\n }\n\n const timestamp = `${Date.now()}000000`\n\n const mainLog = detalhes?.length\n ? `${mensagem} | ${detalhes.map((d) => JSON.stringify(d)).join(\" | \")}`\n : mensagem\n\n const payload: tipoLokiObjeto[\"streams\"][number] = {\n stream: {\n app,\n inquilino,\n usuario,\n level,\n ...(parametrosAmbiente || {}),\n ...(parametrosSessao || {}),\n ...(parametrosLog || {}),\n },\n values: [\n [\n timestamp,\n mainLog, // Linha de log direta\n ],\n ],\n }\n\n const objeto: tipoLokiObjeto = { streams: [payload] }\n\n const response = await postLogger({ objeto })\n\n return response\n }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAuB;AACvB,6BAA6B;AAE7B,MAAM,gBAAgB;AACtB,MAAM,gBAAgB;AAUf,MAAM,aAAa,OAAO;AAAA,EAC/B;AACF,MAEwD;AACtD,QAAM,WAAW,UAAM,mBAAAA,SAAW,GAAG,aAAa,GAAG,aAAa,IAAI;AAAA,IACpE,QAAQ;AAAA,IACR,SAAS,EAAE,gBAAgB,mBAAmB;AAAA,IAC9C,MAAM,KAAK,UAAU,MAAM;AAAA,EAC7B,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC;AACjB,MAAI,CAAC,SAAS,IAAI;AAChB,WAAO,CAAC,QAAQ,QAAQ,SAAS,MAAM,KAAK,MAAM,UAAU,OAAO,CAAC,EAAE;AAAA,EACxE;AACA,SAAO,CAAC,MAAM;AAChB;AAEA,IAAI,MAAM;AAGH,MAAM,YAAY,CAAC,YAAoB;AAC5C,QAAM;AACR;AAiCO,MAAM,SACX,CAAC,EAAE,KAAK,OAAO,WAAW,YAAY,mBAAmB,MACzD,CAAC,EAAE,WAAW,SAAS,YAAY,iBAAiB,MACpD,OAAO,OAAO,UAAU,eAAe;AACrC,MAAI;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY;AAAA,EACd,IAAI,cAAc,CAAC;AAEnB,QAAM,MAAM,GAAG,YAAY,KAAK,MAAM,GAAG,KAAK;AAE9C,MAAI,OAAO,YAAY;AACrB,iBAAa,WAAW,QAAQ,KAAK,EAAE;AAAA,EACzC;AAEA,MAAI,OAAO;AACT,eAAW,CAAC,OAAG,qCAAa,EAAE,MAAM,CAAC,CAAC,KAAK,KAAK,KAAK,GAAI,YAAY,CAAC,CAAE;AAAA,EAC1E;AAEA,MAAI,YAAY;AACd,eAAW;AAAA,MACT,OAAG,qCAAa,EAAE,WAAW,CAAC,CAAC,KAAK,UAAU;AAAA,MAC9C,GAAI,YAAY,CAAC;AAAA,IACnB;AAAA,EACF;AAEA,QAAM,YAAY,GAAG,KAAK,IAAI,CAAC;AAE/B,QAAM,UAAU,UAAU,SACtB,GAAG,QAAQ,MAAM,SAAS,IAAI,CAAC,MAAM,KAAK,UAAU,CAAC,CAAC,EAAE,KAAK,KAAK,CAAC,KACnE;AAEJ,QAAM,UAA6C;AAAA,IACjD,QAAQ;AAAA,MACN;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAI,sBAAsB,CAAC;AAAA,MAC3B,GAAI,oBAAoB,CAAC;AAAA,MACzB,GAAI,iBAAiB,CAAC;AAAA,IACxB;AAAA,IACA,QAAQ;AAAA,MACN;AAAA,QACE;AAAA,QACA;AAAA;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,QAAM,SAAyB,EAAE,SAAS,CAAC,OAAO,EAAE;AAEpD,QAAM,WAAW,MAAM,WAAW,EAAE,OAAO,CAAC;AAE5C,SAAO;AACT;","names":["crossFetch"]}
|
||||
12
dist-back/teste.cjs
Normal file
12
dist-back/teste.cjs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
"use strict";
|
||||
var import_logger = require("./logger");
|
||||
const l = (0, import_logger.logger)({ app: "teste", eProducao: true });
|
||||
const lg = l({
|
||||
inquilino: "conta_1",
|
||||
usuario: "pedrinho"
|
||||
});
|
||||
lg("error", "Deu Ruim").then((a) => console.log(JSON.stringify(a)));
|
||||
lg("info", "Deu Bom", { __filename }).then(
|
||||
(a) => console.log(JSON.stringify(a))
|
||||
);
|
||||
//# sourceMappingURL=teste.cjs.map
|
||||
1
dist-back/teste.cjs.map
Normal file
1
dist-back/teste.cjs.map
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../src/teste.ts"],"sourcesContent":["import { logger } from \"./logger\"\n\nconst l = logger({ app: \"teste\", eProducao: true })\n\nconst lg = l({\n inquilino: \"conta_1\",\n usuario: \"pedrinho\",\n})\n\nlg(\"error\", \"Deu Ruim\").then((a) => console.log(JSON.stringify(a)))\nlg(\"info\", \"Deu Bom\", { __filename }).then((a) =>\n console.log(JSON.stringify(a)),\n)\n"],"mappings":";AAAA,oBAAuB;AAEvB,MAAM,QAAI,sBAAO,EAAE,KAAK,SAAS,WAAW,KAAK,CAAC;AAElD,MAAM,KAAK,EAAE;AAAA,EACX,WAAW;AAAA,EACX,SAAS;AACX,CAAC;AAED,GAAG,SAAS,UAAU,EAAE,KAAK,CAAC,MAAM,QAAQ,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC;AAClE,GAAG,QAAQ,WAAW,EAAE,WAAW,CAAC,EAAE;AAAA,EAAK,CAAC,MAC1C,QAAQ,IAAI,KAAK,UAAU,CAAC,CAAC;AAC/B;","names":[]}
|
||||
31
dist-back/texto_busca.cjs
Normal file
31
dist-back/texto_busca.cjs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
"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
|
||||
});
|
||||
//# sourceMappingURL=texto_busca.cjs.map
|
||||
1
dist-back/texto_busca.cjs.map
Normal file
1
dist-back/texto_busca.cjs.map
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../src/texto_busca.ts"],"sourcesContent":["/** gerar o texto de busca removendo caracteres especies e caixa alta */\n\nexport const texto_busca = (...texto: any[]): string =>\n texto\n .map((txt) =>\n txt === null || txt === undefined\n ? \"\"\n : String(txt)\n .normalize(\"NFD\")\n .replace(/[\\u0300-\\u036f]/g, \"\")\n .replace(/\\s+/g, \" \")\n .toLowerCase(),\n )\n .join(\" \")\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,cAAc,IAAI,UAC7B,MACG;AAAA,EAAI,CAAC,QACJ,QAAQ,QAAQ,QAAQ,SACpB,KACA,OAAO,GAAG,EACP,UAAU,KAAK,EACf,QAAQ,oBAAoB,EAAE,EAC9B,QAAQ,QAAQ,GAAG,EACnB,YAAY;AACrB,EACC,KAAK,GAAG;","names":[]}
|
||||
113
dist-back/tipagemRotas.cjs
Normal file
113
dist-back/tipagemRotas.cjs
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
"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
|
||||
}) {
|
||||
this._partesCaminho = [];
|
||||
this._acaoIr = acaoIr;
|
||||
this._partesCaminho = (Array.isArray(caminho) ? caminho : [caminho]).flatMap((a) => a.split("/")).filter(Boolean);
|
||||
}
|
||||
/** 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),
|
||||
value === void 0 || value === null ? "" : 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"}
|
||||
*/
|
||||
get parametros() {
|
||||
const url = new URL(
|
||||
typeof window !== "undefined" ? window.location.href : "http://localhost"
|
||||
);
|
||||
const query = url.searchParams;
|
||||
const queryObj = Object.fromEntries(query.entries());
|
||||
const hash = url.hash;
|
||||
if (hash) {
|
||||
const hashObj = Object.fromEntries(
|
||||
new URLSearchParams(hash.slice(1)).entries()
|
||||
);
|
||||
return { ...queryObj, ...hashObj };
|
||||
}
|
||||
return queryObj;
|
||||
}
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
TipagemRotas
|
||||
});
|
||||
//# sourceMappingURL=tipagemRotas.cjs.map
|
||||
1
dist-back/tipagemRotas.cjs.map
Normal file
1
dist-back/tipagemRotas.cjs.map
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../src/tipagemRotas.ts"],"sourcesContent":["/** Gerar uma classe que facilita a gestão de rotas com a tipagem das querys\n *\n * Definições:\n *\n * caminho = \"/aplicacao/funcionalidade\"\n *\n * endereco = \"http://localhost:3000/aplicacao/funcionalidade\"\n *\n * parametros = {nome:\"José\"}\n */\n\nexport class TipagemRotas<T extends { [q: string]: string | undefined }> {\n _partesCaminho: string[] = []\n _acaoIr?: (endereco: string) => undefined\n\n /** Ao criar novo obijeto de tipagem de rota é necessário passar o caminho parcial\n ** export const mCaminho = new TipagemRotas<{q:string}>(\"aplicacao\",\"funcionalidade\")\n */\n constructor({\n caminho,\n acaoIr,\n }: {\n caminho: string[] | string\n acaoIr?: undefined | ((endereco: string) => undefined)\n }) {\n this._acaoIr = acaoIr\n\n this._partesCaminho = (Array.isArray(caminho) ? caminho : [caminho])\n .flatMap((a) => a.split(\"/\"))\n .filter(Boolean)\n }\n\n /** Retorna o caminho completo da rota\n ** console.log(mCaminho.caminho)\n ** \"/caminho\"\n */\n get caminho() {\n const ret = `/${this._partesCaminho.join(\"/\")}`\n return ret\n }\n /** Define o caminho completo da rota\n ** mCaminho.caminho = \"/novoCaminho\"\n ** console.log(mCaminho.caminho)\n ** \"/novoCaminho\"\n ** */\n set caminho(caminhoParcial: string) {\n this._partesCaminho = caminhoParcial.split(\"/\").filter((parte) => parte)\n }\n\n /** Retorna o caminho completo da rota com a query\n ** console.log(mCaminho.resolve({q:\"query\"}))\n ** \"http://localhost:3000/caminho?q=query\"\n */\n\n endereco(query: T, usarComoHash?: boolean) {\n const url = new URL(\n typeof window !== \"undefined\" ? window.location.href : \"http://localhost\",\n )\n\n url.pathname = this.caminho\n\n url.search = \"\"\n\n const queryKeys = Object.entries(query)\n\n for (const [key, value] of queryKeys) {\n url.searchParams.set(\n String(key),\n value === undefined || value === null ? \"\" : value,\n )\n }\n\n url.hash = \"\"\n\n if (usarComoHash) {\n url.hash = `#${url.search}`\n url.search = \"\"\n }\n\n return url.href\n }\n\n /** Vai para a url\n ** mCaminho.ir({q:\"query\"})\n ** window.location.href = \"http://localhost:3000/caminho?q=query\"\n */\n ir(query: T) {\n if (this._acaoIr) {\n this._acaoIr(this.endereco(query))\n } else {\n if (typeof window != \"undefined\") {\n window.location.href = this.endereco(query)\n }\n }\n }\n\n /** Retorna os parametros da url\n ** console.log(mCaminho.parametros())\n ** {q:\"query\"}\n */\n\n get parametros() {\n const url = new URL(\n typeof window !== \"undefined\" ? window.location.href : \"http://localhost\",\n )\n const query = url.searchParams\n const queryObj = Object.fromEntries(query.entries())\n\n // pegar hash\n const hash = url.hash\n if (hash) {\n const hashObj = Object.fromEntries(\n new URLSearchParams(hash.slice(1)).entries(),\n )\n return { ...queryObj, ...hashObj } as T\n }\n\n return queryObj as Partial<T>\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWO,MAAM,aAA4D;AAAA;AAAA;AAAA;AAAA,EAOvE,YAAY;AAAA,IACV;AAAA,IACA;AAAA,EACF,GAGG;AAZH,0BAA2B,CAAC;AAa1B,SAAK,UAAU;AAEf,SAAK,kBAAkB,MAAM,QAAQ,OAAO,IAAI,UAAU,CAAC,OAAO,GAC/D,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,EAC3B,OAAO,OAAO;AAAA,EACnB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,UAAU;AACZ,UAAM,MAAM,IAAI,KAAK,eAAe,KAAK,GAAG,CAAC;AAC7C,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,QAAQ,gBAAwB;AAClC,SAAK,iBAAiB,eAAe,MAAM,GAAG,EAAE,OAAO,CAAC,UAAU,KAAK;AAAA,EACzE;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,SAAS,OAAU,cAAwB;AACzC,UAAM,MAAM,IAAI;AAAA,MACd,OAAO,WAAW,cAAc,OAAO,SAAS,OAAO;AAAA,IACzD;AAEA,QAAI,WAAW,KAAK;AAEpB,QAAI,SAAS;AAEb,UAAM,YAAY,OAAO,QAAQ,KAAK;AAEtC,eAAW,CAAC,KAAK,KAAK,KAAK,WAAW;AACpC,UAAI,aAAa;AAAA,QACf,OAAO,GAAG;AAAA,QACV,UAAU,UAAa,UAAU,OAAO,KAAK;AAAA,MAC/C;AAAA,IACF;AAEA,QAAI,OAAO;AAEX,QAAI,cAAc;AAChB,UAAI,OAAO,IAAI,IAAI,MAAM;AACzB,UAAI,SAAS;AAAA,IACf;AAEA,WAAO,IAAI;AAAA,EACb;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,GAAG,OAAU;AACX,QAAI,KAAK,SAAS;AAChB,WAAK,QAAQ,KAAK,SAAS,KAAK,CAAC;AAAA,IACnC,OAAO;AACL,UAAI,OAAO,UAAU,aAAa;AAChC,eAAO,SAAS,OAAO,KAAK,SAAS,KAAK;AAAA,MAC5C;AAAA,IACF;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,IAAI,aAAa;AACf,UAAM,MAAM,IAAI;AAAA,MACd,OAAO,WAAW,cAAc,OAAO,SAAS,OAAO;AAAA,IACzD;AACA,UAAM,QAAQ,IAAI;AAClB,UAAM,WAAW,OAAO,YAAY,MAAM,QAAQ,CAAC;AAGnD,UAAM,OAAO,IAAI;AACjB,QAAI,MAAM;AACR,YAAM,UAAU,OAAO;AAAA,QACrB,IAAI,gBAAgB,KAAK,MAAM,CAAC,CAAC,EAAE,QAAQ;AAAA,MAC7C;AACA,aAAO,EAAE,GAAG,UAAU,GAAG,QAAQ;AAAA,IACnC;AAEA,WAAO;AAAA,EACT;AACF;","names":[]}
|
||||
55
dist-back/tsup/tsup.config.back.cjs
Normal file
55
dist-back/tsup/tsup.config.back.cjs
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
"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 tsup_config_back_exports = {};
|
||||
__export(tsup_config_back_exports, {
|
||||
default: () => tsup_config_back_default,
|
||||
tsup_config_back: () => tsup_config_back
|
||||
});
|
||||
module.exports = __toCommonJS(tsup_config_back_exports);
|
||||
var import_tsup = require("tsup");
|
||||
const tsup_config_back = {
|
||||
entry: ["src/**/*.ts"],
|
||||
// Inclui todos os arquivos TypeScript na pasta src
|
||||
format: "cjs",
|
||||
// Gera módulos CommonJS, padrão para Node.js
|
||||
target: "node20",
|
||||
// Compila para o ambiente Node.js versão 20 (ou sua versão alvo)
|
||||
outDir: "dist-back",
|
||||
// Diretório de saída para os arquivos transpilados
|
||||
clean: true,
|
||||
// Limpa o diretório de saída antes de cada build
|
||||
bundle: false,
|
||||
// ESSENCIAL: Mantém a estrutura de arquivos e pastas original
|
||||
splitting: false,
|
||||
// Desnecessário quando bundle é false
|
||||
dts: false,
|
||||
// RECOMENDADO: Gera arquivos de declaração TypeScript (.d.ts)
|
||||
// legacyOutput e outExtension foram removidos por não serem necessários
|
||||
sourcemap: true,
|
||||
// Recomendado para depuração
|
||||
minify: false,
|
||||
// Geralmente não minificamos o código do backend em produção, mas você pode mudar
|
||||
outExtension: () => ({ js: ".cjs" })
|
||||
};
|
||||
var tsup_config_back_default = (0, import_tsup.defineConfig)(tsup_config_back);
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
tsup_config_back
|
||||
});
|
||||
//# sourceMappingURL=tsup.config.back.cjs.map
|
||||
1
dist-back/tsup/tsup.config.back.cjs.map
Normal file
1
dist-back/tsup/tsup.config.back.cjs.map
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../src/tsup/tsup.config.back.ts"],"sourcesContent":["// tsup.config.ts (Configuração Ajustada para Back-end)\nimport { defineConfig, type Options } from \"tsup\"\n\n// Definimos as opções em uma constante para clareza, como você fez.\n// Exportamos para que possam ser reutilizadas ou inspecionadas.\nexport const tsup_config_back: Options = {\n entry: [\"src/**/*.ts\"], // Inclui todos os arquivos TypeScript na pasta src\n format: \"cjs\", // Gera módulos CommonJS, padrão para Node.js\n target: \"node20\", // Compila para o ambiente Node.js versão 20 (ou sua versão alvo)\n outDir: \"dist-back\", // Diretório de saída para os arquivos transpilados\n clean: true, // Limpa o diretório de saída antes de cada build\n bundle: false, // ESSENCIAL: Mantém a estrutura de arquivos e pastas original\n splitting: false, // Desnecessário quando bundle é false\n dts: false, // RECOMENDADO: Gera arquivos de declaração TypeScript (.d.ts)\n // legacyOutput e outExtension foram removidos por não serem necessários\n sourcemap: true, // Recomendado para depuração\n minify: false, // Geralmente não minificamos o código do backend em produção, mas você pode mudar\n outExtension: () => ({ js: \".cjs\" }),\n}\n\n// Exporta a configuração padrão usando defineConfig\nexport default defineConfig(tsup_config_back)\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAA2C;AAIpC,MAAM,mBAA4B;AAAA,EACvC,OAAO,CAAC,aAAa;AAAA;AAAA,EACrB,QAAQ;AAAA;AAAA,EACR,QAAQ;AAAA;AAAA,EACR,QAAQ;AAAA;AAAA,EACR,OAAO;AAAA;AAAA,EACP,QAAQ;AAAA;AAAA,EACR,WAAW;AAAA;AAAA,EACX,KAAK;AAAA;AAAA;AAAA,EAEL,WAAW;AAAA;AAAA,EACX,QAAQ;AAAA;AAAA,EACR,cAAc,OAAO,EAAE,IAAI,OAAO;AACpC;AAGA,IAAO,+BAAQ,0BAAa,gBAAgB;","names":[]}
|
||||
28
dist-back/tsup/tsup.config.cjs
Normal file
28
dist-back/tsup/tsup.config.cjs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
"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 tsup_config_exports = {};
|
||||
__export(tsup_config_exports, {
|
||||
default: () => tsup_config_default
|
||||
});
|
||||
module.exports = __toCommonJS(tsup_config_exports);
|
||||
var import_tsup = require("tsup");
|
||||
var import_tsup_config = require("./tsup.config.back");
|
||||
var import_tsup_config2 = require("./tsup.config.front");
|
||||
var tsup_config_default = (0, import_tsup.defineConfig)([import_tsup_config.tsup_config_back, import_tsup_config2.tsup_config_front]);
|
||||
//# sourceMappingURL=tsup.config.cjs.map
|
||||
1
dist-back/tsup/tsup.config.cjs.map
Normal file
1
dist-back/tsup/tsup.config.cjs.map
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../src/tsup/tsup.config.ts"],"sourcesContent":["// tsup.config.ts (Configuração Ajustada para Back-end)\nimport { defineConfig, type Options } from \"tsup\"\nimport { tsup_config_back } from \"./tsup.config.back\"\nimport { tsup_config_front } from \"./tsup.config.front\"\n\n// Exporta a configuração padrão usando defineConfig\nexport default defineConfig([tsup_config_back, tsup_config_front])\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAA2C;AAC3C,yBAAiC;AACjC,IAAAA,sBAAkC;AAGlC,IAAO,0BAAQ,0BAAa,CAAC,qCAAkB,qCAAiB,CAAC;","names":["import_tsup_config"]}
|
||||
55
dist-back/tsup/tsup.config.front.cjs
Normal file
55
dist-back/tsup/tsup.config.front.cjs
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
"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 tsup_config_front_exports = {};
|
||||
__export(tsup_config_front_exports, {
|
||||
default: () => tsup_config_front_default,
|
||||
tsup_config_front: () => tsup_config_front
|
||||
});
|
||||
module.exports = __toCommonJS(tsup_config_front_exports);
|
||||
var import_tsup = require("tsup");
|
||||
const tsup_config_front = {
|
||||
entry: ["src/**/*.ts", "src/**/*.tsx"],
|
||||
// Adicionado .tsx para compatibilidade, se aplicável
|
||||
format: "esm",
|
||||
// Gera módulos ES para import/export no navegador
|
||||
target: "es2022",
|
||||
// Ou 'esnext' para os recursos mais recentes
|
||||
outDir: "dist-front",
|
||||
// Diretório de saída para os arquivos transpilados
|
||||
clean: true,
|
||||
// Limpa o diretório de saída antes de cada build
|
||||
bundle: false,
|
||||
// ESSENCIAL: Mantém a estrutura de arquivos e pastas original
|
||||
splitting: false,
|
||||
// Desnecessário quando bundle é false
|
||||
dts: false,
|
||||
// Não gera arquivos de declaração TypeScript (.d.ts) para uso em front-end JS
|
||||
// legacyOutput e outExtension foram removidos por não serem necessários
|
||||
sourcemap: true,
|
||||
// Recomendado para depuração no navegador
|
||||
minify: true,
|
||||
// Recomendado para builds de produção
|
||||
outExtension: () => ({ js: ".mjs" })
|
||||
};
|
||||
var tsup_config_front_default = (0, import_tsup.defineConfig)(tsup_config_front);
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
tsup_config_front
|
||||
});
|
||||
//# sourceMappingURL=tsup.config.front.cjs.map
|
||||
1
dist-back/tsup/tsup.config.front.cjs.map
Normal file
1
dist-back/tsup/tsup.config.front.cjs.map
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../src/tsup/tsup.config.front.ts"],"sourcesContent":["// tsup.config.ts (Configuração Ajustada para Back-end)\nimport { defineConfig, type Options } from \"tsup\"\n\n// Definimos as opções em uma constante para clareza, como você fez.\n// Exportamos para que possam ser reutilizadas ou inspecionadas.\nexport const tsup_config_front: Options = {\n entry: [\"src/**/*.ts\", \"src/**/*.tsx\"], // Adicionado .tsx para compatibilidade, se aplicável\n format: \"esm\", // Gera módulos ES para import/export no navegador\n target: \"es2022\", // Ou 'esnext' para os recursos mais recentes\n outDir: \"dist-front\", // Diretório de saída para os arquivos transpilados\n clean: true, // Limpa o diretório de saída antes de cada build\n bundle: false, // ESSENCIAL: Mantém a estrutura de arquivos e pastas original\n splitting: false, // Desnecessário quando bundle é false\n dts: false, // Não gera arquivos de declaração TypeScript (.d.ts) para uso em front-end JS\n // legacyOutput e outExtension foram removidos por não serem necessários\n sourcemap: true, // Recomendado para depuração no navegador\n minify: true, // Recomendado para builds de produção\n outExtension: () => ({ js: \".mjs\" }),\n}\n\n// Exporta a configuração padrão usando defineConfig\nexport default defineConfig(tsup_config_front)\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAA2C;AAIpC,MAAM,oBAA6B;AAAA,EACxC,OAAO,CAAC,eAAe,cAAc;AAAA;AAAA,EACrC,QAAQ;AAAA;AAAA,EACR,QAAQ;AAAA;AAAA,EACR,QAAQ;AAAA;AAAA,EACR,OAAO;AAAA;AAAA,EACP,QAAQ;AAAA;AAAA,EACR,WAAW;AAAA;AAAA,EACX,KAAK;AAAA;AAAA;AAAA,EAEL,WAAW;AAAA;AAAA,EACX,QAAQ;AAAA;AAAA,EACR,cAAc,OAAO,EAAE,IAAI,OAAO;AACpC;AAGA,IAAO,gCAAQ,0BAAa,iBAAiB;","names":[]}
|
||||
83
dist-back/unidades_medida.cjs
Normal file
83
dist-back/unidades_medida.cjs
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
"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
|
||||
});
|
||||
//# sourceMappingURL=unidades_medida.cjs.map
|
||||
1
dist-back/unidades_medida.cjs.map
Normal file
1
dist-back/unidades_medida.cjs.map
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../src/unidades_medida.ts"],"sourcesContent":["/**\n * Essa variável se conecta a tabela_lidades\n *\n * onde sigla se conecta com sigla\n *\n * Usuário terá mais opções de unidades, quando fazer o envio para o mtr, usar a opção fornecida pelo usuarios, caso não tenha\n * usar a normalizada\n */\n\nexport enum siglas_unidades_medida {\n UN = \"UN\",\n\n KG = \"KG\",\n TON = \"TON\",\n g = \"g\",\n\n \"M³\" = \"M³\",\n Lt = \"Lt\",\n}\n\nexport const unidades_medida: {\n sigla_unidade: keyof typeof siglas_unidades_medida\n nome: string\n sigla_normalizada: keyof typeof siglas_unidades_medida\n normalizar: (valor: number) => number\n tipo: \"massa\" | \"volume\" | \"comprimento\" | \"unidade\"\n}[] = [\n {\n sigla_unidade: \"KG\",\n nome: \"Quilograma\",\n sigla_normalizada: \"KG\",\n normalizar: (valor: number) => valor,\n tipo: \"massa\",\n },\n {\n sigla_unidade: \"g\",\n nome: \"Grama\",\n sigla_normalizada: \"KG\",\n normalizar: (valor: number) => valor / 1000,\n tipo: \"massa\",\n },\n {\n sigla_unidade: \"TON\",\n nome: \"Tonelada\",\n sigla_normalizada: \"KG\",\n normalizar: (valor: number) => valor * 1000,\n tipo: \"massa\",\n },\n {\n sigla_unidade: \"Lt\",\n nome: \"Litro\",\n sigla_normalizada: \"Lt\",\n normalizar: (valor: number) => valor,\n tipo: \"volume\",\n },\n {\n sigla_unidade: \"M³\",\n nome: \"Metro Cúbico\",\n sigla_normalizada: \"Lt\",\n normalizar: (valor: number) => valor * 1000,\n tipo: \"volume\",\n },\n {\n sigla_unidade: \"UN\",\n nome: \"Unidade\",\n sigla_normalizada: \"UN\",\n normalizar: (valor: number) => valor,\n tipo: \"unidade\",\n },\n]\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASO,IAAK,yBAAL,kBAAKA,4BAAL;AACL,EAAAA,wBAAA,QAAK;AAEL,EAAAA,wBAAA,QAAK;AACL,EAAAA,wBAAA,SAAM;AACN,EAAAA,wBAAA,OAAI;AAEJ,EAAAA,wBAAA,WAAO;AACP,EAAAA,wBAAA,QAAK;AARK,SAAAA;AAAA,GAAA;AAWL,MAAM,kBAMP;AAAA,EACJ;AAAA,IACE,eAAe;AAAA,IACf,MAAM;AAAA,IACN,mBAAmB;AAAA,IACnB,YAAY,CAAC,UAAkB;AAAA,IAC/B,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,eAAe;AAAA,IACf,MAAM;AAAA,IACN,mBAAmB;AAAA,IACnB,YAAY,CAAC,UAAkB,QAAQ;AAAA,IACvC,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,eAAe;AAAA,IACf,MAAM;AAAA,IACN,mBAAmB;AAAA,IACnB,YAAY,CAAC,UAAkB,QAAQ;AAAA,IACvC,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,eAAe;AAAA,IACf,MAAM;AAAA,IACN,mBAAmB;AAAA,IACnB,YAAY,CAAC,UAAkB;AAAA,IAC/B,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,eAAe;AAAA,IACf,MAAM;AAAA,IACN,mBAAmB;AAAA,IACnB,YAAY,CAAC,UAAkB,QAAQ;AAAA,IACvC,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,eAAe;AAAA,IACf,MAAM;AAAA,IACN,mBAAmB;AAAA,IACnB,YAAY,CAAC,UAAkB;AAAA,IAC/B,MAAM;AAAA,EACR;AACF;","names":["siglas_unidades_medida"]}
|
||||
37
dist-back/uuid.cjs
Normal file
37
dist-back/uuid.cjs
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
"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, {
|
||||
uuid: () => uuid
|
||||
});
|
||||
module.exports = __toCommonJS(uuid_exports);
|
||||
const letras = "0123456789abcdef".split("");
|
||||
const uuid = () => {
|
||||
letras.sort(() => Math.random() - 0.5);
|
||||
const modelo = "xxxxxxxx-xxxx-4xxx-xxxx-xxxxxxxxxxxx".split("");
|
||||
const retorno = modelo.map(
|
||||
(letra) => letra === "x" ? letras[(1e3 * Math.random() | 0) % letras.length] : letra
|
||||
).join("");
|
||||
return retorno;
|
||||
};
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
uuid
|
||||
});
|
||||
//# sourceMappingURL=uuid.cjs.map
|
||||
1
dist-back/uuid.cjs.map
Normal file
1
dist-back/uuid.cjs.map
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../src/uuid.ts"],"sourcesContent":["//Gerar uma uuid V4\nconst letras = \"0123456789abcdef\".split(\"\")\nexport const uuid = () => {\n letras.sort(() => Math.random() - 0.5)\n const modelo = \"xxxxxxxx-xxxx-4xxx-xxxx-xxxxxxxxxxxx\".split(\"\")\n const retorno = modelo\n .map((letra) =>\n letra === \"x\"\n ? letras[((1000 * Math.random()) | 0) % letras.length]\n : letra,\n )\n .join(\"\")\n\n return retorno\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,MAAM,SAAS,mBAAmB,MAAM,EAAE;AACnC,MAAM,OAAO,MAAM;AACxB,SAAO,KAAK,MAAM,KAAK,OAAO,IAAI,GAAG;AACrC,QAAM,SAAS,uCAAuC,MAAM,EAAE;AAC9D,QAAM,UAAU,OACb;AAAA,IAAI,CAAC,UACJ,UAAU,MACN,QAAS,MAAO,KAAK,OAAO,IAAK,KAAK,OAAO,MAAM,IACnD;AAAA,EACN,EACC,KAAK,EAAE;AAEV,SAAO;AACT;","names":[]}
|
||||
34
dist-back/variaveisComuns.cjs
Normal file
34
dist-back/variaveisComuns.cjs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
"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
|
||||
});
|
||||
//# sourceMappingURL=variaveisComuns.cjs.map
|
||||
1
dist-back/variaveisComuns.cjs.map
Normal file
1
dist-back/variaveisComuns.cjs.map
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../src/variaveisComuns.ts"],"sourcesContent":["export const esperar = (ms: number): Promise<true> =>\n new Promise((resolve: (r: true) => void) =>\n setTimeout(() => resolve(true), ms),\n )\n/**\n * Usado para retronat o no de uma variável, deve ser usado dentro de um objeto\n * const nomex = {a: 1, b: 2}\n * nomeVariavel({nomex}) // retorna \"nomex\"\n * @param v\n * @returns\n */\nexport const nomeVariavel = (v: { [key: string]: any }) =>\n Object.keys(v).join(\"/\")\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,UAAU,CAAC,OACtB,IAAI;AAAA,EAAQ,CAAC,YACX,WAAW,MAAM,QAAQ,IAAI,GAAG,EAAE;AACpC;AAQK,MAAM,eAAe,CAAC,MAC3B,OAAO,KAAK,CAAC,EAAE,KAAK,GAAG;","names":[]}
|
||||
Loading…
Add table
Add a link
Reference in a new issue