Compare commits
3 commits
0a6ce2e323
...
f0c9f770aa
| Author | SHA1 | Date | |
|---|---|---|---|
| f0c9f770aa | |||
| 95ceb92d9c | |||
| b60bd3eef6 |
7 changed files with 70 additions and 2 deletions
16
dist-back/auditoria.js
Normal file
16
dist-back/auditoria.js
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
"use strict";
|
||||||
|
var __defProp = Object.defineProperty;
|
||||||
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||||
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||||
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||||
|
var __copyProps = (to, from, except, desc) => {
|
||||||
|
if (from && typeof from === "object" || typeof from === "function") {
|
||||||
|
for (let key of __getOwnPropNames(from))
|
||||||
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||||
|
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||||
|
}
|
||||||
|
return to;
|
||||||
|
};
|
||||||
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||||
|
var auditoria_exports = {};
|
||||||
|
module.exports = __toCommonJS(auditoria_exports);
|
||||||
|
|
@ -16,6 +16,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
||||||
var index_exports = {};
|
var index_exports = {};
|
||||||
module.exports = __toCommonJS(index_exports);
|
module.exports = __toCommonJS(index_exports);
|
||||||
__reExport(index_exports, require("./aleatorio"), module.exports);
|
__reExport(index_exports, require("./aleatorio"), module.exports);
|
||||||
|
__reExport(index_exports, require("./auditoria"), module.exports);
|
||||||
__reExport(index_exports, require("./cacheMemoria"), module.exports);
|
__reExport(index_exports, require("./cacheMemoria"), module.exports);
|
||||||
__reExport(index_exports, require("./constantes"), module.exports);
|
__reExport(index_exports, require("./constantes"), module.exports);
|
||||||
__reExport(index_exports, require("./consulta"), module.exports);
|
__reExport(index_exports, require("./consulta"), module.exports);
|
||||||
|
|
@ -38,6 +39,7 @@ __reExport(index_exports, require("./variaveisComuns"), module.exports);
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
// Annotate the CommonJS export names for ESM import in node:
|
||||||
0 && (module.exports = {
|
0 && (module.exports = {
|
||||||
...require("./aleatorio"),
|
...require("./aleatorio"),
|
||||||
|
...require("./auditoria"),
|
||||||
...require("./cacheMemoria"),
|
...require("./cacheMemoria"),
|
||||||
...require("./constantes"),
|
...require("./constantes"),
|
||||||
...require("./consulta"),
|
...require("./consulta"),
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,27 @@ import { v4 } from 'uuid';
|
||||||
|
|
||||||
declare const aleatorio: (tamanho?: number) => string;
|
declare const aleatorio: (tamanho?: number) => string;
|
||||||
|
|
||||||
|
type TipoPayloadAuditoria = {
|
||||||
|
/** UUID do usuario da acao (pode ser null se for processo do sistema que não registrou) */
|
||||||
|
usuario_criacao: string | null;
|
||||||
|
/** Timestamp ou data de criacao / execucao */
|
||||||
|
data_criacao: string | Date;
|
||||||
|
/** Nome exato da tabela no banco que originou o registro */
|
||||||
|
tabela_origem: string;
|
||||||
|
/** Código único (UUID) do registro na tabela original */
|
||||||
|
codigo_origem: string;
|
||||||
|
/** JSON contendo o snapshot das colunas novas / editadas */
|
||||||
|
novo: Record<string, any>;
|
||||||
|
/** JSON contendo o snapshot das colunas antes da edição */
|
||||||
|
anterior: Record<string, any>;
|
||||||
|
/** Hash ou controle de versao do item, usualmente preenchido por new.ver_seg */
|
||||||
|
__versao: string;
|
||||||
|
/** Tipo de operação que gerou a auditoria */
|
||||||
|
acao: "criar" | "atualizar" | "deletar" | string;
|
||||||
|
/** Versão do sistema no momento em que a ação ocorreu */
|
||||||
|
versao_sistema: string;
|
||||||
|
};
|
||||||
|
|
||||||
/** gerar uma função de cache para uso em memoria */
|
/** gerar uma função de cache para uso em memoria */
|
||||||
declare const cacheM: <T>(chave: any, valor?: T, validadeSeg?: number) => T | undefined;
|
declare const cacheM: <T>(chave: any, valor?: T, validadeSeg?: number) => T | undefined;
|
||||||
declare const verCacheM: () => {
|
declare const verCacheM: () => {
|
||||||
|
|
@ -537,4 +558,4 @@ declare const nomeVariavel: (v: {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}) => string;
|
}) => string;
|
||||||
|
|
||||||
export { Produtos, TipagemRotas, agrupadores26, aleatorio, cacheM, cacheMFixo, cacheMemoria, camposComuns, criarFiltro26, defineDayjsBr, erUuid, esperar, extensoes, type interfaceConsulta, link_paiol, localValor, nomeVariavel, objetoPg, operadores, operadores26, paraObjetoRegistroPg, pgObjeto, siglas_unidades_medida, texto_busca, tipoArquivo, type tipoFiltro, type tipoFiltro26, tipoUsuarioResiduos, tiposSituacoesElicencie, tx, umaFuncao, umaVariavel, unidades_medida, uuid, uuidV3, uuidV4, uuid_null, validarUuid, verCacheM, zFiltro, zFiltro26, zOperadores };
|
export { Produtos, TipagemRotas, type TipoLoggerSessao, type TipoPayloadAuditoria, aleatorio, cacheM, cacheMFixo, cacheMemoria, camposComuns, dayjsbr, defineCwd, erUuid, esperar, extensoes, type interfaceConsulta, link_paiol, localValor, logger, nomeVariavel, objetoPg, operadores, paraObjetoRegistroPg, pgObjeto, postLogger, siglas_unidades_medida, texto_busca, tipoArquivo, type tipoFiltro, type tipoLogger, type tipoLoggerLog, type tipoLokiObjeto, tipoUsuarioResiduos, tx, umaFuncao, umaVariavel, unidades_medida, uuid, uuidV3, uuidV4, uuid_null, validarUuid, verCacheM, zFiltro, zOperadores };
|
||||||
BIN
pacote.tgz
BIN
pacote.tgz
Binary file not shown.
28
src/auditoria.ts
Normal file
28
src/auditoria.ts
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
export type TipoPayloadAuditoria = {
|
||||||
|
/** UUID do usuario da acao (pode ser null se for processo do sistema que não registrou) */
|
||||||
|
usuario_criacao: string | null
|
||||||
|
|
||||||
|
/** Timestamp ou data de criacao / execucao */
|
||||||
|
data_criacao: string | Date
|
||||||
|
|
||||||
|
/** Nome exato da tabela no banco que originou o registro */
|
||||||
|
tabela_origem: string
|
||||||
|
|
||||||
|
/** Código único (UUID) do registro na tabela original */
|
||||||
|
codigo_origem: string
|
||||||
|
|
||||||
|
/** JSON contendo o snapshot das colunas novas / editadas */
|
||||||
|
novo: Record<string, any>
|
||||||
|
|
||||||
|
/** JSON contendo o snapshot das colunas antes da edição */
|
||||||
|
anterior: Record<string, any>
|
||||||
|
|
||||||
|
/** Hash ou controle de versao do item, usualmente preenchido por new.ver_seg */
|
||||||
|
__versao: string
|
||||||
|
|
||||||
|
/** Tipo de operação que gerou a auditoria */
|
||||||
|
acao: "criar" | "atualizar" | "deletar" | string
|
||||||
|
|
||||||
|
/** Versão do sistema no momento em que a ação ocorreu */
|
||||||
|
versao_sistema: string
|
||||||
|
}
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
export * from "./aleatorio"
|
export * from "./aleatorio"
|
||||||
|
export * from "./auditoria"
|
||||||
export * from "./cacheMemoria"
|
export * from "./cacheMemoria"
|
||||||
export * from "./constantes"
|
export * from "./constantes"
|
||||||
export * from "./consulta"
|
export * from "./consulta"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue