@zola_do/audit 0.2.18 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const ZOLA_AUDIT_EVENT_SCHEMA_VERSION: "1.0";
|
|
2
|
+
export type ZolaAuditEventAction = 'http.request' | 'entity.create' | 'entity.update' | 'entity.delete' | 'query.execute' | string;
|
|
3
|
+
export type ZolaAuditEventContract = {
|
|
4
|
+
schemaVersion: typeof ZOLA_AUDIT_EVENT_SCHEMA_VERSION;
|
|
5
|
+
eventType: ZolaAuditEventAction;
|
|
6
|
+
occurredAt: string;
|
|
7
|
+
application?: string;
|
|
8
|
+
module?: string;
|
|
9
|
+
requestId?: string;
|
|
10
|
+
actorId?: string;
|
|
11
|
+
actor?: unknown;
|
|
12
|
+
entityType?: string;
|
|
13
|
+
entityId?: string;
|
|
14
|
+
statusCode?: number;
|
|
15
|
+
ipAddress?: string;
|
|
16
|
+
metadata?: Record<string, unknown>;
|
|
17
|
+
};
|
|
18
|
+
export declare function createZolaAuditEvent(event: Omit<ZolaAuditEventContract, 'schemaVersion' | 'occurredAt'> & {
|
|
19
|
+
occurredAt?: string;
|
|
20
|
+
}): ZolaAuditEventContract;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ZOLA_AUDIT_EVENT_SCHEMA_VERSION = void 0;
|
|
4
|
+
exports.createZolaAuditEvent = createZolaAuditEvent;
|
|
5
|
+
exports.ZOLA_AUDIT_EVENT_SCHEMA_VERSION = '1.0';
|
|
6
|
+
function createZolaAuditEvent(event) {
|
|
7
|
+
var _a;
|
|
8
|
+
return Object.assign({ schemaVersion: exports.ZOLA_AUDIT_EVENT_SCHEMA_VERSION, occurredAt: (_a = event.occurredAt) !== null && _a !== void 0 ? _a : new Date().toISOString() }, event);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=audit-event-contract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit-event-contract.js","sourceRoot":"","sources":["../src/audit-event-contract.ts"],"names":[],"mappings":";;;AA0BA,oDAUC;AApCY,QAAA,+BAA+B,GAAG,KAAc,CAAC;AA0B9D,SAAgB,oBAAoB,CAClC,KAEC;;IAED,uBACE,aAAa,EAAE,uCAA+B,EAC9C,UAAU,EAAE,MAAA,KAAK,CAAC,UAAU,mCAAI,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,IACrD,KAAK,EACR;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -27,4 +27,5 @@ __exportStar(require("./event-audit.decorator"), exports);
|
|
|
27
27
|
__exportStar(require("./ignore-logger.decorator"), exports);
|
|
28
28
|
__exportStar(require("./request-id.interceptor"), exports);
|
|
29
29
|
__exportStar(require("./validate-audit-env.helper"), exports);
|
|
30
|
+
__exportStar(require("./audit-event-contract"), exports);
|
|
30
31
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,sDAAoC;AACpC,6DAA2C;AAC3C,sDAAoC;AACpC,8CAA4B;AAC5B,wDAAsC;AACtC,iDAA+B;AAC/B,yDAAuC;AACvC,qDAAmC;AACnC,0DAAwC;AACxC,4DAA0C;AAC1C,2DAAyC;AACzC,8DAA4C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,sDAAoC;AACpC,6DAA2C;AAC3C,sDAAoC;AACpC,8CAA4B;AAC5B,wDAAsC;AACtC,iDAA+B;AAC/B,yDAAuC;AACvC,qDAAmC;AACnC,0DAAwC;AACxC,4DAA0C;AAC1C,2DAAyC;AACzC,8DAA4C;AAC5C,yDAAuC"}
|