Compare commits

...

3 commits

Author SHA1 Message Date
f0c9f770aa pacote 2026-04-13 15:56:45 -03:00
95ceb92d9c merge 2026-04-13 15:56:34 -03:00
b60bd3eef6 tipagem audioria 2026-04-13 15:55:48 -03:00
7 changed files with 70 additions and 2 deletions

16
dist-back/auditoria.js Normal file
View 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);

View file

@ -16,6 +16,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
var index_exports = {};
module.exports = __toCommonJS(index_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("./constantes"), 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:
0 && (module.exports = {
...require("./aleatorio"),
...require("./auditoria"),
...require("./cacheMemoria"),
...require("./constantes"),
...require("./consulta"),

View file

@ -13,6 +13,27 @@ import { v4 } from 'uuid';
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 */
declare const cacheM: <T>(chave: any, valor?: T, validadeSeg?: number) => T | undefined;
declare const verCacheM: () => {
@ -537,4 +558,4 @@ declare const nomeVariavel: (v: {
[key: string]: any;
}) => 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 };

View file

@ -44,4 +44,4 @@
"uuid": "^11.1.0",
"zod": "4.1.4"
}
}
}

Binary file not shown.

28
src/auditoria.ts Normal file
View 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
}

View file

@ -1,4 +1,5 @@
export * from "./aleatorio"
export * from "./auditoria"
export * from "./cacheMemoria"
export * from "./constantes"
export * from "./consulta"