@estgbue/mezgeb 0.0.32 → 0.0.34
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/mezgeb/client/client.module.d.ts +1 -8
- package/dist/mezgeb/client/client.module.d.ts.map +1 -1
- package/dist/mezgeb/client/client.module.js +27 -28
- package/dist/mezgeb/listener/entities/audit-log-command.entity.js +8 -8
- package/dist/mezgeb/listener/entities/audit-log.entity.js +9 -9
- package/package.json +1 -1
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import { DynamicModule } from '@nestjs/common';
|
|
2
|
-
export interface AuditClientModuleOptions {
|
|
3
|
-
/** Optional TypeORM connection name; defaults to the default connection. */
|
|
4
|
-
connectionName?: string;
|
|
5
|
-
/** Custom DataSource injection token; overrides connectionName when provided. */
|
|
6
|
-
dataSourceToken?: string | symbol;
|
|
7
|
-
}
|
|
8
1
|
export declare class AuditClientModule {
|
|
9
|
-
|
|
2
|
+
constructor();
|
|
10
3
|
}
|
|
11
4
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"client.module.d.ts","sourceRoot":"","sources":["../../../libs/mezgeb/src/mezgeb/client/client.module.ts"],"names":[],"mappings":"AAUA,qBAqBa,iBAAiB;;CAI5B"}
|
|
@@ -5,7 +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
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
9
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
12
|
exports.AuditClientModule = void 0;
|
|
11
13
|
const common_1 = require("@nestjs/common");
|
|
@@ -16,34 +18,31 @@ const mezgeb_enum_1 = require("../mezgeb.enum");
|
|
|
16
18
|
const client_audit_interceptor_1 = require("./client-audit.interceptor");
|
|
17
19
|
const client_logger_config_1 = require("./client.logger.config");
|
|
18
20
|
const client_subscriber_1 = require("./client.subscriber");
|
|
19
|
-
let AuditClientModule =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const dataSourceToken = (_a = options.dataSourceToken) !== null && _a !== void 0 ? _a : (0, typeorm_1.getDataSourceToken)(options.connectionName);
|
|
23
|
-
return {
|
|
24
|
-
module: AuditClientModule_1,
|
|
25
|
-
imports: [
|
|
26
|
-
microservices_1.ClientsModule.register([client_logger_config_1.auditLoggerConfig]),
|
|
27
|
-
typeorm_1.TypeOrmModule.forFeature([], options.connectionName),
|
|
28
|
-
],
|
|
29
|
-
providers: [
|
|
30
|
-
core_1.Reflector,
|
|
31
|
-
{
|
|
32
|
-
provide: core_1.APP_INTERCEPTOR,
|
|
33
|
-
useClass: client_audit_interceptor_1.ClientLoggerInterceptor,
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
provide: mezgeb_enum_1.AuditDatasource,
|
|
37
|
-
useFactory: (dataSource) => dataSource,
|
|
38
|
-
inject: [dataSourceToken],
|
|
39
|
-
},
|
|
40
|
-
client_subscriber_1.ClientSubscriber,
|
|
41
|
-
],
|
|
42
|
-
exports: [mezgeb_enum_1.AuditDatasource],
|
|
43
|
-
};
|
|
21
|
+
let AuditClientModule = class AuditClientModule {
|
|
22
|
+
constructor() {
|
|
23
|
+
common_1.Logger.log('Audit Client Module initialized');
|
|
44
24
|
}
|
|
45
25
|
};
|
|
46
26
|
exports.AuditClientModule = AuditClientModule;
|
|
47
|
-
exports.AuditClientModule = AuditClientModule =
|
|
48
|
-
(0, common_1.Module)({
|
|
27
|
+
exports.AuditClientModule = AuditClientModule = __decorate([
|
|
28
|
+
(0, common_1.Module)({
|
|
29
|
+
imports: [
|
|
30
|
+
microservices_1.ClientsModule.register([client_logger_config_1.auditLoggerConfig]),
|
|
31
|
+
typeorm_1.TypeOrmModule.forFeature([]), // 👈 required even if no entities
|
|
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)()],
|
|
43
|
+
},
|
|
44
|
+
client_subscriber_1.ClientSubscriber,
|
|
45
|
+
],
|
|
46
|
+
}),
|
|
47
|
+
__metadata("design:paramtypes", [])
|
|
49
48
|
], AuditClientModule);
|
|
@@ -21,11 +21,11 @@ __decorate([
|
|
|
21
21
|
__metadata("design:type", String)
|
|
22
22
|
], AuditLogCommand.prototype, "id", void 0);
|
|
23
23
|
__decorate([
|
|
24
|
-
(0, typeorm_1.Column)({ type: 'timestamptz', default: () => 'CURRENT_TIMESTAMP' }),
|
|
24
|
+
(0, typeorm_1.Column)({ type: 'timestamptz', default: () => 'CURRENT_TIMESTAMP', name: 'created_at' }),
|
|
25
25
|
__metadata("design:type", Date)
|
|
26
26
|
], AuditLogCommand.prototype, "createdAt", void 0);
|
|
27
27
|
__decorate([
|
|
28
|
-
(0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
|
|
28
|
+
(0, typeorm_1.Column)({ type: 'timestamptz', nullable: true, name: 'deleted_at' }),
|
|
29
29
|
__metadata("design:type", Date)
|
|
30
30
|
], AuditLogCommand.prototype, "deletedAt", void 0);
|
|
31
31
|
__decorate([
|
|
@@ -33,11 +33,11 @@ __decorate([
|
|
|
33
33
|
__metadata("design:type", Object)
|
|
34
34
|
], AuditLogCommand.prototype, "entity", void 0);
|
|
35
35
|
__decorate([
|
|
36
|
-
(0, typeorm_1.Column)({ type: 'text' }),
|
|
36
|
+
(0, typeorm_1.Column)({ type: 'text', name: 'entity_id' }),
|
|
37
37
|
__metadata("design:type", String)
|
|
38
38
|
], AuditLogCommand.prototype, "entityId", void 0);
|
|
39
39
|
__decorate([
|
|
40
|
-
(0, typeorm_1.Column)(),
|
|
40
|
+
(0, typeorm_1.Column)({ name: 'entity_name' }),
|
|
41
41
|
__metadata("design:type", String)
|
|
42
42
|
], AuditLogCommand.prototype, "entityName", void 0);
|
|
43
43
|
__decorate([
|
|
@@ -65,23 +65,23 @@ __decorate([
|
|
|
65
65
|
__metadata("design:type", String)
|
|
66
66
|
], AuditLogCommand.prototype, "status", void 0);
|
|
67
67
|
__decorate([
|
|
68
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
68
|
+
(0, typeorm_1.Column)({ nullable: true, name: 'parent_id' }),
|
|
69
69
|
__metadata("design:type", String)
|
|
70
70
|
], AuditLogCommand.prototype, "parentId", void 0);
|
|
71
71
|
__decorate([
|
|
72
72
|
(0, typeorm_1.OneToOne)(() => AuditLogCommand, (auditLog) => auditLog.parent),
|
|
73
|
-
(0, typeorm_1.JoinColumn)({ name: '
|
|
73
|
+
(0, typeorm_1.JoinColumn)({ name: 'parent_id' }),
|
|
74
74
|
__metadata("design:type", AuditLogCommand)
|
|
75
75
|
], AuditLogCommand.prototype, "parent", void 0);
|
|
76
76
|
__decorate([
|
|
77
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
77
|
+
(0, typeorm_1.Column)({ nullable: true, name: 'audit_log_id' }),
|
|
78
78
|
__metadata("design:type", String)
|
|
79
79
|
], AuditLogCommand.prototype, "auditLogId", void 0);
|
|
80
80
|
__decorate([
|
|
81
81
|
(0, typeorm_1.ManyToOne)(() => audit_log_entity_1.AuditLog, (auditLog) => auditLog.commands, {
|
|
82
82
|
onDelete: 'CASCADE',
|
|
83
83
|
}),
|
|
84
|
-
(0, typeorm_1.JoinColumn)({ name: '
|
|
84
|
+
(0, typeorm_1.JoinColumn)({ name: 'audit_log_id' }),
|
|
85
85
|
__metadata("design:type", audit_log_entity_1.AuditLog)
|
|
86
86
|
], AuditLogCommand.prototype, "auditLog", void 0);
|
|
87
87
|
exports.AuditLogCommand = AuditLogCommand = __decorate([
|
|
@@ -21,15 +21,15 @@ __decorate([
|
|
|
21
21
|
__metadata("design:type", String)
|
|
22
22
|
], AuditLog.prototype, "id", void 0);
|
|
23
23
|
__decorate([
|
|
24
|
-
(0, typeorm_1.CreateDateColumn)({ type: 'timestamptz', default: () => 'CURRENT_TIMESTAMP' }),
|
|
24
|
+
(0, typeorm_1.CreateDateColumn)({ type: 'timestamptz', default: () => 'CURRENT_TIMESTAMP', name: 'created_at' }),
|
|
25
25
|
__metadata("design:type", Date)
|
|
26
26
|
], AuditLog.prototype, "createdAt", void 0);
|
|
27
27
|
__decorate([
|
|
28
|
-
(0, typeorm_1.UpdateDateColumn)({ type: 'timestamptz', default: () => 'CURRENT_TIMESTAMP' }),
|
|
28
|
+
(0, typeorm_1.UpdateDateColumn)({ type: 'timestamptz', default: () => 'CURRENT_TIMESTAMP', name: 'updated_at' }),
|
|
29
29
|
__metadata("design:type", Date)
|
|
30
30
|
], AuditLog.prototype, "updatedAt", void 0);
|
|
31
31
|
__decorate([
|
|
32
|
-
(0, typeorm_1.Column)({ type: 'varchar' }),
|
|
32
|
+
(0, typeorm_1.Column)({ type: 'varchar', name: 'request_method' }),
|
|
33
33
|
__metadata("design:type", String)
|
|
34
34
|
], AuditLog.prototype, "requestMethod", void 0);
|
|
35
35
|
__decorate([
|
|
@@ -41,23 +41,23 @@ __decorate([
|
|
|
41
41
|
__metadata("design:type", String)
|
|
42
42
|
], AuditLog.prototype, "module", void 0);
|
|
43
43
|
__decorate([
|
|
44
|
-
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
|
|
44
|
+
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true, name: 'request_body' }),
|
|
45
45
|
__metadata("design:type", Object)
|
|
46
46
|
], AuditLog.prototype, "requestBody", void 0);
|
|
47
47
|
__decorate([
|
|
48
|
-
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
|
|
48
|
+
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true, name: 'request_header' }),
|
|
49
49
|
__metadata("design:type", Object)
|
|
50
50
|
], AuditLog.prototype, "requestHeader", void 0);
|
|
51
51
|
__decorate([
|
|
52
|
-
(0, typeorm_1.Column)(),
|
|
52
|
+
(0, typeorm_1.Column)({ name: 'status_code' }),
|
|
53
53
|
__metadata("design:type", Number)
|
|
54
54
|
], AuditLog.prototype, "statusCode", void 0);
|
|
55
55
|
__decorate([
|
|
56
|
-
(0, typeorm_1.Column)(),
|
|
56
|
+
(0, typeorm_1.Column)({ name: 'ip_address' }),
|
|
57
57
|
__metadata("design:type", String)
|
|
58
58
|
], AuditLog.prototype, "ipAddress", void 0);
|
|
59
59
|
__decorate([
|
|
60
|
-
(0, typeorm_1.Column)(),
|
|
60
|
+
(0, typeorm_1.Column)({ name: 'execution_time' }),
|
|
61
61
|
__metadata("design:type", Number)
|
|
62
62
|
], AuditLog.prototype, "executionTime", void 0);
|
|
63
63
|
__decorate([
|
|
@@ -65,7 +65,7 @@ __decorate([
|
|
|
65
65
|
__metadata("design:type", String)
|
|
66
66
|
], AuditLog.prototype, "status", void 0);
|
|
67
67
|
__decorate([
|
|
68
|
-
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
|
|
68
|
+
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true, name: 'user' }),
|
|
69
69
|
__metadata("design:type", Object)
|
|
70
70
|
], AuditLog.prototype, "user", void 0);
|
|
71
71
|
__decorate([
|