@autofleet/shtinker 0.0.9 → 0.0.11

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.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import AuditLogger from './audit-logger';
2
2
  import { AuditLoggerOptions } from './types';
3
3
  export declare const enableAuditing: (options: AuditLoggerOptions) => void;
4
- export declare const setAuditContext: (entityType: string, entityId: string, action: string) => (req: any, res: any, next: any) => Promise<any>;
4
+ export declare const setAuditContext: (entityType: string, action: string) => (req: any, res: any, next: any) => Promise<any>;
5
5
  export * from './types';
6
6
  export * from './const';
7
7
  export default AuditLogger;
package/dist/index.js CHANGED
@@ -38,13 +38,12 @@ const enableAuditing = (options) => {
38
38
  auditLogger.registerHooks();
39
39
  };
40
40
  exports.enableAuditing = enableAuditing;
41
- const setAuditContext = (entityType, entityId, action) => (req, res, next) => __awaiter(void 0, void 0, void 0, function* () {
41
+ const setAuditContext = (entityType, action) => (req, res, next) => __awaiter(void 0, void 0, void 0, function* () {
42
42
  const currentTrace = (0, zehut_1.getCurrentPayload)();
43
43
  if (currentTrace) {
44
44
  const user = currentTrace.context.get(const_1.USER_CONTEXT_KEY);
45
45
  const auditLogContext = {
46
46
  entityType,
47
- entityId,
48
47
  action,
49
48
  endpoint: req.url,
50
49
  method: req.method,
package/dist/types.d.ts CHANGED
@@ -8,7 +8,6 @@ export type AuditLoggerOptions = {
8
8
  };
9
9
  export interface AuditLogContext {
10
10
  entityType: string;
11
- entityId: string;
12
11
  action: string;
13
12
  performedBy: string;
14
13
  endpoint: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autofleet/shtinker",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -14,7 +14,6 @@ export const enableAuditing = (options: AuditLoggerOptions) => {
14
14
 
15
15
  export const setAuditContext = (
16
16
  entityType: string,
17
- entityId: string,
18
17
  action: string,
19
18
  ) => async (req: any, res: any, next: any): Promise<any> => {
20
19
  const currentTrace = getCurrentTrace();
@@ -22,7 +21,6 @@ export const setAuditContext = (
22
21
  const user = currentTrace.context.get(USER_CONTEXT_KEY);
23
22
  const auditLogContext: AuditLogContext = {
24
23
  entityType,
25
- entityId,
26
24
  action,
27
25
  endpoint: req.url,
28
26
  method: req.method,
package/src/types.ts CHANGED
@@ -10,7 +10,6 @@ export type AuditLoggerOptions = {
10
10
 
11
11
  export interface AuditLogContext {
12
12
  entityType: string;
13
- entityId: string;
14
13
  action: string;
15
14
  performedBy: string;
16
15
  endpoint: string;