@estgbue/mezgeb 0.0.27 → 0.0.29

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.
@@ -10,7 +10,7 @@ exports.auditLoggerConfig = {
10
10
  urls: [process.env.RMQ_URL],
11
11
  queue: mezgeb_enum_1.AuditLoggerRMQQueue,
12
12
  prefetchCount: 1,
13
- noAck: false,
13
+ noAck: true,
14
14
  isGlobalPrefetchCount: true,
15
15
  socketOptions: {
16
16
  frameMax: 16384,
@@ -1,3 +1,6 @@
1
+ import { DynamicModule } from '@nestjs/common';
1
2
  export declare class AuditClientModule {
3
+ constructor();
4
+ static register(connectionName?: string): DynamicModule;
2
5
  }
3
6
  //# sourceMappingURL=client.module.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.module.d.ts","sourceRoot":"","sources":["../../../libs/mezgeb/src/mezgeb/client/client.module.ts"],"names":[],"mappings":"AAUA,qBAqBa,iBAAiB;CAAI"}
1
+ {"version":3,"file":"client.module.d.ts","sourceRoot":"","sources":["../../../libs/mezgeb/src/mezgeb/client/client.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAU,MAAM,gBAAgB,CAAC;AAUvD,qBAqBa,iBAAiB;;IAI5B,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,aAAa;CAuBxD"}
@@ -5,6 +5,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
6
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
7
  };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var AuditClientModule_1;
8
12
  Object.defineProperty(exports, "__esModule", { value: true });
9
13
  exports.AuditClientModule = void 0;
10
14
  const common_1 = require("@nestjs/common");
@@ -15,10 +19,36 @@ const mezgeb_enum_1 = require("../mezgeb.enum");
15
19
  const client_audit_interceptor_1 = require("./client-audit.interceptor");
16
20
  const client_logger_config_1 = require("./client.logger.config");
17
21
  const client_subscriber_1 = require("./client.subscriber");
18
- let AuditClientModule = class AuditClientModule {
22
+ let AuditClientModule = AuditClientModule_1 = class AuditClientModule {
23
+ constructor() {
24
+ console.log('Audit Client Module initialized');
25
+ }
26
+ static register(connectionName) {
27
+ return {
28
+ module: AuditClientModule_1,
29
+ imports: [
30
+ microservices_1.ClientsModule.register([client_logger_config_1.auditLoggerConfig]),
31
+ typeorm_1.TypeOrmModule.forFeature([], connectionName),
32
+ ],
33
+ providers: [
34
+ core_1.Reflector,
35
+ {
36
+ provide: core_1.APP_INTERCEPTOR,
37
+ useClass: client_audit_interceptor_1.ClientLoggerInterceptor,
38
+ },
39
+ {
40
+ provide: mezgeb_enum_1.AuditDatasource,
41
+ useFactory: (dataSource) => dataSource,
42
+ inject: [(0, typeorm_1.getDataSourceToken)(connectionName)],
43
+ },
44
+ client_subscriber_1.ClientSubscriber,
45
+ ],
46
+ exports: [],
47
+ };
48
+ }
19
49
  };
20
50
  exports.AuditClientModule = AuditClientModule;
21
- exports.AuditClientModule = AuditClientModule = __decorate([
51
+ exports.AuditClientModule = AuditClientModule = AuditClientModule_1 = __decorate([
22
52
  (0, common_1.Module)({
23
53
  imports: [
24
54
  microservices_1.ClientsModule.register([client_logger_config_1.auditLoggerConfig]),
@@ -37,5 +67,6 @@ exports.AuditClientModule = AuditClientModule = __decorate([
37
67
  },
38
68
  client_subscriber_1.ClientSubscriber,
39
69
  ],
40
- })
70
+ }),
71
+ __metadata("design:paramtypes", [])
41
72
  ], AuditClientModule);
@@ -1,3 +1,4 @@
1
1
  export declare class AuditListenerModule {
2
+ constructor();
2
3
  }
3
4
  //# sourceMappingURL=audit.module.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"audit.module.d.ts","sourceRoot":"","sources":["../../../libs/mezgeb/src/mezgeb/listener/audit.module.ts"],"names":[],"mappings":"AASA,qBAUa,mBAAmB;CAAG"}
1
+ {"version":3,"file":"audit.module.d.ts","sourceRoot":"","sources":["../../../libs/mezgeb/src/mezgeb/listener/audit.module.ts"],"names":[],"mappings":"AASA,qBAUa,mBAAmB;;CAI/B"}
@@ -5,6 +5,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
6
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
7
  };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
8
11
  Object.defineProperty(exports, "__esModule", { value: true });
9
12
  exports.AuditListenerModule = void 0;
10
13
  const common_1 = require("@nestjs/common");
@@ -16,6 +19,9 @@ const audit_log_command_service_1 = require("./services/audit-log-command.servic
16
19
  const audit_log_entity_1 = require("./entities/audit-log.entity");
17
20
  const audit_log_command_entity_1 = require("./entities/audit-log-command.entity");
18
21
  let AuditListenerModule = class AuditListenerModule {
22
+ constructor() {
23
+ common_1.Logger.log('Audit Listener Module initialized');
24
+ }
19
25
  };
20
26
  exports.AuditListenerModule = AuditListenerModule;
21
27
  exports.AuditListenerModule = AuditListenerModule = __decorate([
@@ -28,5 +34,6 @@ exports.AuditListenerModule = AuditListenerModule = __decorate([
28
34
  audit_log_command_controller_1.AuditLogCommandController,
29
35
  ],
30
36
  providers: [audit_log_service_1.AuditLogService, audit_log_command_service_1.AuditLogCommandService,],
31
- })
37
+ }),
38
+ __metadata("design:paramtypes", [])
32
39
  ], AuditListenerModule);
@@ -1 +1 @@
1
- {"version":3,"file":"audit-log.entity.d.ts","sourceRoot":"","sources":["../../../../libs/mezgeb/src/mezgeb/listener/entities/audit-log.entity.ts"],"names":[],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AM,EAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAC;IAGzC,IAAI,EAAE,GAAG,CAAC;IAGV,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAC;CAC9B"}
@@ -73,5 +73,5 @@ __decorate([
73
73
  __metadata("design:type", Array)
74
74
  ], AuditLog.prototype, "commands", void 0);
75
75
  exports.AuditLog = AuditLog = __decorate([
76
- (0, typeorm_1.Entity)({ name: 'audit_logs' })
76
+ (0, typeorm_1.Entity)({ name: mezgeb_enum_1.AuditTableName, schema: mezgeb_enum_1.AuditTableSchema })
77
77
  ], AuditLog);
@@ -1 +1 @@
1
- {"version":3,"file":"audit-log-command.service.d.ts","sourceRoot":"","sources":["../../../../libs/mezgeb/src/mezgeb/listener/services/audit-log-command.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAEL,cAAc,EACd,YAAY,EAEb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAEvE,qBACa,sBAAsB;IAG/B,OAAO,CAAC,kBAAkB;IAE1B,OAAO,CAAC,yBAAyB;gBAFzB,kBAAkB,EAAE,UAAU,CAAC,QAAQ,CAAC,EAExC,yBAAyB,EAAE,UAAU,CAAC,eAAe,CAAC;IAG1D,MAAM,CAAC,QAAQ,EAAE,cAAc;IAS/B,MAAM,CAAC,QAAQ,EAAE,YAAY;IAqD7B,MAAM,CAAC,QAAQ,EAAE,YAAY;IAsB7B,YAAY,CAChB,MAAM,EAAE,GAAG,EACX,MAAM,EAAE,cAAc,GAAG,cAAc,EACvC,eAAe,EAAE,MAAM,EACvB,UAAU,EAAE,MAAM;IA0CpB,OAAO,CAAC,sBAAsB;IAI9B,sBAAsB,CAAC,IAAI,EAAE,MAAM;IAsB7B,YAAY,CAChB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,QAAQ,GAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAO;YAwCnC,YAAY;YAqBZ,gBAAgB;IAmD9B,OAAO,CAAC,UAAU;CAWnB"}
1
+ {"version":3,"file":"audit-log-command.service.d.ts","sourceRoot":"","sources":["../../../../libs/mezgeb/src/mezgeb/listener/services/audit-log-command.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAEL,cAAc,EACd,YAAY,EAEb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAEvE,qBACa,sBAAsB;IAG/B,OAAO,CAAC,kBAAkB;IAE1B,OAAO,CAAC,yBAAyB;gBAFzB,kBAAkB,EAAE,UAAU,CAAC,QAAQ,CAAC,EAExC,yBAAyB,EAAE,UAAU,CAAC,eAAe,CAAC;IAG1D,MAAM,CAAC,QAAQ,EAAE,cAAc;IAS/B,MAAM,CAAC,QAAQ,EAAE,YAAY;IAqD7B,MAAM,CAAC,QAAQ,EAAE,YAAY;IAsB7B,YAAY,CAChB,MAAM,EAAE,GAAG,EACX,MAAM,EAAE,cAAc,GAAG,cAAc,EACvC,eAAe,EAAE,MAAM,EACvB,UAAU,EAAE,MAAM;IA0CpB,OAAO,CAAC,sBAAsB;IAI9B,sBAAsB,CAAC,IAAI,EAAE,MAAM;IAsB7B,YAAY,CAChB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,QAAQ,GAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAO;YAwCnC,YAAY;YAqBZ,gBAAgB;IAsD9B,OAAO,CAAC,UAAU;CAWnB"}
@@ -197,8 +197,9 @@ let AuditLogCommandService = class AuditLogCommandService {
197
197
  allMatches.forEach((match, index) => {
198
198
  const cleanedMatch = match.replace(/"/g, '').trim();
199
199
  if (cleanedMatch.startsWith('(')) {
200
+ const paramKey = `param${index}`;
200
201
  const paramList = cleanedMatch.match(/\$?\d+/g) || [];
201
- whereParams[`param${index}`] = paramList.map((param) => parseInt(param.replace('$', ''), 10));
202
+ whereParams[paramKey] = paramList.map((param) => parseInt(param.replace('$', ''), 10));
202
203
  }
203
204
  else {
204
205
  const [key, param] = cleanedMatch
@@ -18,4 +18,6 @@ export declare const RollbackRequestAudit = "rollback-request-audit";
18
18
  export declare const RecordInsertion = "record-insertion";
19
19
  export declare const RecordUpdate = "record-update";
20
20
  export declare const RecordDeletion = "record-delete";
21
+ export declare const AuditTableName: string;
22
+ export declare const AuditTableSchema: string;
21
23
  //# sourceMappingURL=mezgeb.enum.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mezgeb.enum.d.ts","sourceRoot":"","sources":["../../libs/mezgeb/src/mezgeb/mezgeb.enum.ts"],"names":[],"mappings":"AAAA,oBAAY,sBAAsB;IAChC,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,KAAK,UAAU;CAChB;AAGD,eAAO,MAAM,eAAe,qBAAqB,CAAC;AAClD,eAAO,MAAM,0BAA0B,4BAA4B,CAAC;AACpE,eAAO,MAAM,mBAAmB,UAAU,CAAC;AAC3C,eAAO,MAAM,mBAAmB,oBAAoB,CAAC;AACrD,eAAO,MAAM,uBAAuB,yBAAyB,CAAC;AAC9D,eAAO,MAAM,mBAAmB,eAAe,CAAC;AAEhD,eAAO,MAAM,oBAAoB,2BAA2B,CAAC;AAC7D,eAAO,MAAM,kBAAkB,yBAAyB,CAAC;AACzD,eAAO,MAAM,oBAAoB,2BAA2B,CAAC;AAC7D,eAAO,MAAM,eAAe,qBAAqB,CAAC;AAClD,eAAO,MAAM,YAAY,kBAAkB,CAAC;AAC5C,eAAO,MAAM,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"mezgeb.enum.d.ts","sourceRoot":"","sources":["../../libs/mezgeb/src/mezgeb/mezgeb.enum.ts"],"names":[],"mappings":"AAAA,oBAAY,sBAAsB;IAChC,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,KAAK,UAAU;CAChB;AAGD,eAAO,MAAM,eAAe,qBAAqB,CAAC;AAClD,eAAO,MAAM,0BAA0B,4BAA4B,CAAC;AACpE,eAAO,MAAM,mBAAmB,UAAU,CAAC;AAC3C,eAAO,MAAM,mBAAmB,oBAAoB,CAAC;AACrD,eAAO,MAAM,uBAAuB,yBAAyB,CAAC;AAC9D,eAAO,MAAM,mBAAmB,eAAe,CAAC;AAEhD,eAAO,MAAM,oBAAoB,2BAA2B,CAAC;AAC7D,eAAO,MAAM,kBAAkB,yBAAyB,CAAC;AACzD,eAAO,MAAM,oBAAoB,2BAA2B,CAAC;AAC7D,eAAO,MAAM,eAAe,qBAAqB,CAAC;AAClD,eAAO,MAAM,YAAY,kBAAkB,CAAC;AAC5C,eAAO,MAAM,cAAc,kBAAkB,CAAC;AAE9C,eAAO,MAAM,cAAc,QAA8C,CAAC;AAC1E,eAAO,MAAM,gBAAgB,QAA0C,CAAA"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
+ var _a, _b;
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RecordDeletion = exports.RecordUpdate = exports.RecordInsertion = exports.RollbackRequestAudit = exports.CommitRequestAudit = exports.RegisterRequestAudit = exports.DeadAuditRoutingKey = exports.AuditDeadLetterExchange = exports.AuditLoggerRMQTopic = exports.AuditLoggerRMQQueue = exports.ClientLoggerInterceptorKey = exports.AuditDatasource = exports.EAuditLogRequestMethod = void 0;
4
+ exports.AuditTableSchema = exports.AuditTableName = exports.RecordDeletion = exports.RecordUpdate = exports.RecordInsertion = exports.RollbackRequestAudit = exports.CommitRequestAudit = exports.RegisterRequestAudit = exports.DeadAuditRoutingKey = exports.AuditDeadLetterExchange = exports.AuditLoggerRMQTopic = exports.AuditLoggerRMQQueue = exports.ClientLoggerInterceptorKey = exports.AuditDatasource = exports.EAuditLogRequestMethod = void 0;
4
5
  var EAuditLogRequestMethod;
5
6
  (function (EAuditLogRequestMethod) {
6
7
  EAuditLogRequestMethod["GET"] = "GET";
@@ -22,3 +23,5 @@ exports.RollbackRequestAudit = 'rollback-request-audit';
22
23
  exports.RecordInsertion = 'record-insertion';
23
24
  exports.RecordUpdate = 'record-update';
24
25
  exports.RecordDeletion = 'record-delete';
26
+ exports.AuditTableName = (_a = process.env.AUDIT_LOG_TABLE) !== null && _a !== void 0 ? _a : 'audit_logs';
27
+ exports.AuditTableSchema = (_b = process.env.AUDIT_LOC_SCHEMA) !== null && _b !== void 0 ? _b : "audit";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@estgbue/mezgeb",
3
- "version": "0.0.27",
3
+ "version": "0.0.29",
4
4
  "main": "./src/index",
5
5
  "exports": {
6
6
  ".": "./dist/index.js"