@zola_do/audit 0.2.5 → 0.2.6
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/README.md +353 -34
- package/dist/audit-logger.interceptor.d.ts +4 -1
- package/dist/audit-logger.interceptor.js +21 -2
- package/dist/audit-logger.interceptor.js.map +1 -1
- package/dist/audit-module-options.d.ts +5 -0
- package/dist/audit-module-options.js +3 -0
- package/dist/audit-module-options.js.map +1 -0
- package/dist/audit.constants.d.ts +1 -0
- package/dist/audit.constants.js +5 -0
- package/dist/audit.constants.js.map +1 -0
- package/dist/audit.module.d.ts +3 -2
- package/dist/audit.module.js +17 -10
- package/dist/audit.module.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
# @zola_do/audit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@zola_do/audit)
|
|
4
|
+
[](https://www.npmjs.com/package/@zola_do/audit)
|
|
5
|
+
[](https://opensource.org/licenses/ISC)
|
|
6
|
+
|
|
7
|
+
RabbitMQ-based audit logging for NestJS applications with entity change tracking and request auditing.
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
`@zola_do/audit` provides comprehensive audit logging capabilities:
|
|
12
|
+
|
|
13
|
+
- **Request Auditing** — Automatic logging of HTTP requests
|
|
14
|
+
- **Event Auditing** — Mark RPC events with `@AuditRmqEvent()`
|
|
15
|
+
- **Entity Auditing** — TypeORM subscriber for INSERT/UPDATE/DELETE
|
|
16
|
+
- **Conditional Loading** — Gracefully degrades without RabbitMQ
|
|
17
|
+
- **User Context** — Captures user and organization from request
|
|
4
18
|
|
|
5
19
|
## Installation
|
|
6
20
|
|
|
@@ -12,23 +26,31 @@ npm install @zola_do/audit
|
|
|
12
26
|
npm install @zola_do/nestjs-shared
|
|
13
27
|
```
|
|
14
28
|
|
|
15
|
-
###
|
|
29
|
+
### Required Dependencies
|
|
16
30
|
|
|
17
|
-
|
|
31
|
+
For full audit functionality:
|
|
18
32
|
|
|
19
33
|
```bash
|
|
20
34
|
npm install @nestjs/microservices amqplib
|
|
21
35
|
```
|
|
22
36
|
|
|
23
|
-
**Note:**
|
|
37
|
+
**Note:** The module loads successfully without these dependencies but audit features are disabled with a development warning.
|
|
24
38
|
|
|
25
|
-
##
|
|
39
|
+
## Quick Start
|
|
40
|
+
|
|
41
|
+
### 1. Configure Environment
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# .env
|
|
45
|
+
RMQ_URL=amqp://user:pass@localhost:5672
|
|
46
|
+
APPLICATION_NAME=my-app
|
|
47
|
+
```
|
|
26
48
|
|
|
27
|
-
### Module
|
|
49
|
+
### 2. Register Module
|
|
28
50
|
|
|
29
51
|
```typescript
|
|
30
|
-
import { Module } from
|
|
31
|
-
import { AuditModule } from
|
|
52
|
+
import { Module } from "@nestjs/common";
|
|
53
|
+
import { AuditModule } from "@zola_do/audit";
|
|
32
54
|
|
|
33
55
|
@Module({
|
|
34
56
|
imports: [AuditModule],
|
|
@@ -36,61 +58,358 @@ import { AuditModule } from '@zola_do/audit';
|
|
|
36
58
|
export class AppModule {}
|
|
37
59
|
```
|
|
38
60
|
|
|
39
|
-
###
|
|
40
|
-
|
|
41
|
-
Use `@AuditRmqEvent()` to mark controller methods for audit logging:
|
|
61
|
+
### 3. Mark Routes for Audit
|
|
42
62
|
|
|
43
63
|
```typescript
|
|
44
|
-
import { Controller, Post, Body } from
|
|
45
|
-
import { AuditRmqEvent } from
|
|
64
|
+
import { Controller, Post, Body } from "@nestjs/common";
|
|
65
|
+
import { AuditRmqEvent } from "@zola_do/audit";
|
|
66
|
+
|
|
67
|
+
@Controller("orders")
|
|
68
|
+
export class OrdersController {
|
|
69
|
+
@Post()
|
|
70
|
+
@AuditRmqEvent()
|
|
71
|
+
createOrder(@Body() dto: CreateOrderDto) {
|
|
72
|
+
// This request is logged to RabbitMQ
|
|
73
|
+
return this.orderService.create(dto);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Audit Architecture
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
┌─────────────────────────────────────────────────────────────────────┐
|
|
82
|
+
│ Audit Flow │
|
|
83
|
+
├─────────────────────────────────────────────────────────────────────┤
|
|
84
|
+
│ │
|
|
85
|
+
│ HTTP Request │
|
|
86
|
+
│ │ │
|
|
87
|
+
│ ▼ │
|
|
88
|
+
│ ┌─────────────┐ │
|
|
89
|
+
│ │ JwtGuard │──► request.user │
|
|
90
|
+
│ └─────────────┘ │
|
|
91
|
+
│ │ │
|
|
92
|
+
│ ▼ │
|
|
93
|
+
│ ┌─────────────────────────────────────────┐ │
|
|
94
|
+
│ │ AuditLoggerInterceptor (Global) │ │
|
|
95
|
+
│ │ │ │
|
|
96
|
+
│ │ Checks @AuditRmqEvent() metadata │ │
|
|
97
|
+
│ └─────────────────────────────────────────┘ │
|
|
98
|
+
│ │ │
|
|
99
|
+
│ │ @AuditRmqEvent() found │
|
|
100
|
+
│ ▼ │
|
|
101
|
+
│ ┌─────────────┐ │
|
|
102
|
+
│ │ Publish to │ │
|
|
103
|
+
│ │ RabbitMQ │─────► Exchange: audit.events │
|
|
104
|
+
│ └─────────────┘ Queue: audit.logs │
|
|
105
|
+
│ │
|
|
106
|
+
└─────────────────────────────────────────────────────────────────────┘
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Decorators
|
|
110
|
+
|
|
111
|
+
### @AuditRmqEvent()
|
|
112
|
+
|
|
113
|
+
Marks a controller method for audit logging:
|
|
46
114
|
|
|
47
|
-
|
|
115
|
+
```typescript
|
|
116
|
+
@Controller("orders")
|
|
48
117
|
export class OrdersController {
|
|
49
118
|
@Post()
|
|
50
119
|
@AuditRmqEvent()
|
|
51
120
|
createOrder(@Body() dto: CreateOrderDto) {
|
|
52
|
-
//
|
|
121
|
+
// Logs: { userId, organization, method, path, body, timestamp }
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
@Put(":id")
|
|
125
|
+
@AuditRmqEvent({ action: "UPDATE_ORDER" })
|
|
126
|
+
updateOrder(@Param("id") id: string, @Body() dto: UpdateOrderDto) {
|
|
127
|
+
// Logs with custom action name
|
|
53
128
|
}
|
|
54
129
|
}
|
|
55
130
|
```
|
|
56
131
|
|
|
57
|
-
###
|
|
132
|
+
### @IgnoreLogger()
|
|
58
133
|
|
|
59
|
-
|
|
134
|
+
Excludes specific routes from audit logging:
|
|
60
135
|
|
|
61
136
|
```typescript
|
|
62
|
-
|
|
137
|
+
@Controller()
|
|
138
|
+
export class HealthController {
|
|
139
|
+
@Get("health")
|
|
140
|
+
@IgnoreLogger()
|
|
141
|
+
healthCheck() {
|
|
142
|
+
return { status: "ok" };
|
|
143
|
+
}
|
|
63
144
|
|
|
64
|
-
@Get(
|
|
65
|
-
@IgnoreLogger()
|
|
66
|
-
|
|
67
|
-
|
|
145
|
+
@Get("metrics")
|
|
146
|
+
@IgnoreLogger()
|
|
147
|
+
metrics() {
|
|
148
|
+
return { requests: 1000 };
|
|
149
|
+
}
|
|
68
150
|
}
|
|
69
151
|
```
|
|
70
152
|
|
|
71
|
-
|
|
153
|
+
## Entity Auditing
|
|
154
|
+
|
|
155
|
+
The `AuditSubscriber` automatically tracks entity changes:
|
|
72
156
|
|
|
73
|
-
|
|
157
|
+
```typescript
|
|
158
|
+
import { Module } from "@nestjs/common";
|
|
159
|
+
import { TypeOrmModule } from "@nestjs/typeorm";
|
|
160
|
+
import { AuditSubscriber } from "@zola_do/audit";
|
|
161
|
+
|
|
162
|
+
@Module({
|
|
163
|
+
imports: [
|
|
164
|
+
TypeOrmModule.forRoot({
|
|
165
|
+
subscribers: [AuditSubscriber],
|
|
166
|
+
}),
|
|
167
|
+
],
|
|
168
|
+
})
|
|
169
|
+
export class AppModule {}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Tracked Events
|
|
173
|
+
|
|
174
|
+
| Event | Description |
|
|
175
|
+
| -------- | --------------- |
|
|
176
|
+
| `INSERT` | Entity created |
|
|
177
|
+
| `UPDATE` | Entity modified |
|
|
178
|
+
| `DELETE` | Entity deleted |
|
|
179
|
+
|
|
180
|
+
### Audit Data Structure
|
|
181
|
+
|
|
182
|
+
```typescript
|
|
183
|
+
interface AuditLog {
|
|
184
|
+
id: string;
|
|
185
|
+
userId?: string;
|
|
186
|
+
organizationId?: string;
|
|
187
|
+
action: string;
|
|
188
|
+
entity: string;
|
|
189
|
+
entityId: string;
|
|
190
|
+
oldValues?: Record<string, any>;
|
|
191
|
+
newValues?: Record<string, any>;
|
|
192
|
+
timestamp: Date;
|
|
193
|
+
requestPath?: string;
|
|
194
|
+
requestMethod?: string;
|
|
195
|
+
}
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## Configuration
|
|
199
|
+
|
|
200
|
+
### RabbitMQ Config
|
|
201
|
+
|
|
202
|
+
```typescript
|
|
203
|
+
import { auditLoggerConfig } from "@zola_do/audit";
|
|
204
|
+
|
|
205
|
+
// Uses RMQ_URL from environment
|
|
206
|
+
export const rmqConfig = auditLoggerConfig;
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### Manual Audit Publishing
|
|
210
|
+
|
|
211
|
+
```typescript
|
|
212
|
+
import { Injectable } from "@nestjs/common";
|
|
213
|
+
import { ClientProxy } from "@nestjs/microservices";
|
|
214
|
+
import { Inject } from "@nestjs/common";
|
|
215
|
+
import { AUDIT_RMQ_EVENT } from "@zola_do/audit";
|
|
216
|
+
|
|
217
|
+
@Injectable()
|
|
218
|
+
export class OrderService {
|
|
219
|
+
constructor(
|
|
220
|
+
@Inject("AUDIT_CLIENT") private readonly auditClient: ClientProxy,
|
|
221
|
+
) {}
|
|
222
|
+
|
|
223
|
+
async createOrder(dto: CreateOrderDto, user: any) {
|
|
224
|
+
const order = await this.orderRepo.save(dto);
|
|
225
|
+
|
|
226
|
+
// Publish audit event
|
|
227
|
+
this.auditClient.emit(AUDIT_RMQ_EVENT, {
|
|
228
|
+
userId: user.id,
|
|
229
|
+
organizationId: user.organizationId,
|
|
230
|
+
action: "ORDER_CREATED",
|
|
231
|
+
entity: "Order",
|
|
232
|
+
entityId: order.id,
|
|
233
|
+
newValues: order,
|
|
234
|
+
timestamp: new Date(),
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
return order;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
```
|
|
74
241
|
|
|
75
242
|
## Environment Variables
|
|
76
243
|
|
|
77
|
-
| Variable
|
|
78
|
-
|
|
79
|
-
| `RMQ_URL`
|
|
244
|
+
| Variable | Description | Required |
|
|
245
|
+
| ------------------ | ----------------------- | ------------------------ |
|
|
246
|
+
| `RMQ_URL` | RabbitMQ connection URL | Yes (for audit features) |
|
|
247
|
+
| `APPLICATION_NAME` | App name for audit logs | No |
|
|
80
248
|
|
|
81
|
-
##
|
|
249
|
+
## Conditional Loading
|
|
82
250
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
251
|
+
The module gracefully handles missing dependencies:
|
|
252
|
+
|
|
253
|
+
```typescript
|
|
254
|
+
// If amqplib or @nestjs/microservices not installed:
|
|
255
|
+
@Module({
|
|
256
|
+
providers: [AuditModule],
|
|
257
|
+
exports: [AuditModule],
|
|
258
|
+
})
|
|
259
|
+
export class AuditModule {
|
|
260
|
+
// AuditLoggerInterceptor NOT registered
|
|
261
|
+
// Warning in development: "Audit logging disabled - missing dependencies"
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// If dependencies installed:
|
|
265
|
+
@Module({
|
|
266
|
+
providers: [AuditLoggerInterceptor, AuditSubscriber],
|
|
267
|
+
exports: [AuditModule],
|
|
268
|
+
})
|
|
269
|
+
export class AuditModule {
|
|
270
|
+
// Full audit functionality enabled
|
|
271
|
+
}
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
## DTOs
|
|
275
|
+
|
|
276
|
+
### CreateAuditLogDto
|
|
277
|
+
|
|
278
|
+
```typescript
|
|
279
|
+
interface CreateAuditLogDto {
|
|
280
|
+
userId?: string;
|
|
281
|
+
organizationId?: string;
|
|
282
|
+
action: string;
|
|
283
|
+
entity: string;
|
|
284
|
+
entityId: string;
|
|
285
|
+
oldValues?: Record<string, any>;
|
|
286
|
+
newValues?: Record<string, any>;
|
|
287
|
+
requestPath?: string;
|
|
288
|
+
requestMethod?: string;
|
|
289
|
+
metadata?: Record<string, any>;
|
|
290
|
+
}
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### CreateEventDTO
|
|
294
|
+
|
|
295
|
+
```typescript
|
|
296
|
+
interface CreateEventDTO {
|
|
297
|
+
userId?: string;
|
|
298
|
+
organizationId?: string;
|
|
299
|
+
eventName: string;
|
|
300
|
+
eventData: Record<string, any>;
|
|
301
|
+
timestamp?: Date;
|
|
302
|
+
}
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
## API Reference
|
|
306
|
+
|
|
307
|
+
### Module
|
|
308
|
+
|
|
309
|
+
```typescript
|
|
310
|
+
@Module({
|
|
311
|
+
imports: [AuditModule],
|
|
312
|
+
// Or register subscriber globally
|
|
313
|
+
})
|
|
314
|
+
export class AppModule {}
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
### Decorators
|
|
318
|
+
|
|
319
|
+
| Decorator | Description |
|
|
320
|
+
| ---------------------------- | ---------------------- |
|
|
321
|
+
| `@AuditRmqEvent()` | Mark for audit logging |
|
|
322
|
+
| `@AuditRmqEvent({ action })` | Custom action name |
|
|
323
|
+
| `@IgnoreLogger()` | Exclude from audit |
|
|
324
|
+
|
|
325
|
+
### Exports
|
|
326
|
+
|
|
327
|
+
```typescript
|
|
328
|
+
// All exports from index.ts
|
|
329
|
+
import {
|
|
330
|
+
AuditModule,
|
|
331
|
+
AuditRmqEvent,
|
|
332
|
+
AUDIT_RMQ_EVENT,
|
|
333
|
+
IgnoreLogger,
|
|
334
|
+
IGNORE_AUDIT_LOGGER,
|
|
335
|
+
AuditLoggerInterceptor,
|
|
336
|
+
AuditSubscriber,
|
|
337
|
+
auditLoggerConfig,
|
|
338
|
+
} from "@zola_do/audit";
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
## Best Practices
|
|
342
|
+
|
|
343
|
+
### 1. Audit Sensitive Operations
|
|
344
|
+
|
|
345
|
+
```typescript
|
|
346
|
+
@Post(':id/approve')
|
|
347
|
+
@AuditRmqEvent({ action: 'ORDER_APPROVED' })
|
|
348
|
+
async approveOrder(@Param('id') id: string) {
|
|
349
|
+
return this.orderService.approve(id);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
@Post(':id/reject')
|
|
353
|
+
@AuditRmqEvent({ action: 'ORDER_REJECTED' })
|
|
354
|
+
async rejectOrder(@Param('id') id: string) {
|
|
355
|
+
return this.orderService.reject(id);
|
|
356
|
+
}
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
### 2. Exclude Health Checks
|
|
360
|
+
|
|
361
|
+
```typescript
|
|
362
|
+
@Controller()
|
|
363
|
+
export class HealthController {
|
|
364
|
+
@Get()
|
|
365
|
+
@IgnoreLogger() // Don't audit health checks
|
|
366
|
+
health() {
|
|
367
|
+
return { status: "ok" };
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
### 3. Use Custom User Extraction
|
|
373
|
+
|
|
374
|
+
The interceptor extracts user from `request.user` (populated by JwtGuard):
|
|
375
|
+
|
|
376
|
+
```typescript
|
|
377
|
+
// Ensure your JwtStrategy sets user object
|
|
378
|
+
class JwtStrategy extends PassportStrategy(Strategy) {
|
|
379
|
+
async validate(payload: any) {
|
|
380
|
+
return {
|
|
381
|
+
id: payload.sub,
|
|
382
|
+
email: payload.email,
|
|
383
|
+
organizationId: payload.organization?.organizationId,
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
## Troubleshooting
|
|
390
|
+
|
|
391
|
+
### Q: Audit events not being published?
|
|
392
|
+
|
|
393
|
+
1. Check `RMQ_URL` is configured
|
|
394
|
+
2. Verify RabbitMQ is running
|
|
395
|
+
3. Check for `Audit logging disabled` warning in logs
|
|
396
|
+
|
|
397
|
+
### Q: UserId is undefined in audit?
|
|
398
|
+
|
|
399
|
+
Ensure `JwtGuard` or `AuthorizationModule` is enabled and populates `request.user`.
|
|
400
|
+
|
|
401
|
+
### Q: Module loading fails?
|
|
402
|
+
|
|
403
|
+
Install optional dependencies or ignore the warning - the module still loads without audit functionality.
|
|
89
404
|
|
|
90
405
|
## Related Packages
|
|
91
406
|
|
|
92
407
|
- [@zola_do/authorization](../authorization) — User context for audit
|
|
93
408
|
|
|
409
|
+
## License
|
|
410
|
+
|
|
411
|
+
ISC
|
|
412
|
+
|
|
94
413
|
## Community
|
|
95
414
|
|
|
96
415
|
- [Contributing](../../CONTRIBUTING.md)
|
|
@@ -3,15 +3,18 @@ import { Reflector } from '@nestjs/core';
|
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
4
|
import { ClientProxy } from '@nestjs/microservices';
|
|
5
5
|
import { DataSource } from 'typeorm';
|
|
6
|
+
import type { AuditLogSink } from './audit-module-options';
|
|
6
7
|
export declare class AuditLoggerInterceptor implements NestInterceptor {
|
|
7
8
|
private reflector;
|
|
8
9
|
private readonly connection;
|
|
9
10
|
private readonly rmsRMQClient;
|
|
10
|
-
|
|
11
|
+
private readonly extraSinks;
|
|
12
|
+
constructor(reflector: Reflector, connection: DataSource, rmsRMQClient: ClientProxy, extraSinks?: AuditLogSink[]);
|
|
11
13
|
intercept(context: ExecutionContext, next: CallHandler): Observable<any>;
|
|
12
14
|
private handleRequestAuditInitiation;
|
|
13
15
|
private handleEventAuditInitiation;
|
|
14
16
|
private handleTransaction;
|
|
15
17
|
private mapHeaders;
|
|
16
18
|
private mapCookies;
|
|
19
|
+
private notifyExtraSinks;
|
|
17
20
|
}
|
|
@@ -22,11 +22,13 @@ const crypto_1 = require("crypto");
|
|
|
22
22
|
const event_audit_decorator_1 = require("./event-audit.decorator");
|
|
23
23
|
const audit_logger_enum_1 = require("./audit-logger.enum");
|
|
24
24
|
const ignore_logger_decorator_1 = require("./ignore-logger.decorator");
|
|
25
|
+
const audit_constants_1 = require("./audit.constants");
|
|
25
26
|
let AuditLoggerInterceptor = class AuditLoggerInterceptor {
|
|
26
|
-
constructor(reflector, connection, rmsRMQClient) {
|
|
27
|
+
constructor(reflector, connection, rmsRMQClient, extraSinks = []) {
|
|
27
28
|
this.reflector = reflector;
|
|
28
29
|
this.connection = connection;
|
|
29
30
|
this.rmsRMQClient = rmsRMQClient;
|
|
31
|
+
this.extraSinks = extraSinks;
|
|
30
32
|
}
|
|
31
33
|
intercept(context, next) {
|
|
32
34
|
const auditRmqEvent = this.reflector.getAllAndOverride(event_audit_decorator_1.AUDIT_RMQ_EVENT, [context.getHandler(), context.getClass()]);
|
|
@@ -78,6 +80,7 @@ let AuditLoggerInterceptor = class AuditLoggerInterceptor {
|
|
|
78
80
|
executionTime: 0,
|
|
79
81
|
user: userPayload,
|
|
80
82
|
};
|
|
83
|
+
this.notifyExtraSinks(log);
|
|
81
84
|
this.rmsRMQClient.emit(audit_logger_enum_1.RegisterRequestAudit, log);
|
|
82
85
|
}
|
|
83
86
|
handleEventAuditInitiation(context, next, requestId) {
|
|
@@ -96,6 +99,7 @@ let AuditLoggerInterceptor = class AuditLoggerInterceptor {
|
|
|
96
99
|
executionTime: 0,
|
|
97
100
|
user: userPayload,
|
|
98
101
|
};
|
|
102
|
+
this.notifyExtraSinks(log);
|
|
99
103
|
this.rmsRMQClient.emit(audit_logger_enum_1.RegisterRequestAudit, log);
|
|
100
104
|
}
|
|
101
105
|
handleTransaction(type, statusCode, requestId, startTime, remark) {
|
|
@@ -118,13 +122,28 @@ let AuditLoggerInterceptor = class AuditLoggerInterceptor {
|
|
|
118
122
|
return acc;
|
|
119
123
|
}, []);
|
|
120
124
|
}
|
|
125
|
+
notifyExtraSinks(log) {
|
|
126
|
+
var _a;
|
|
127
|
+
if (!((_a = this.extraSinks) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
for (const sink of this.extraSinks) {
|
|
131
|
+
try {
|
|
132
|
+
void Promise.resolve(sink(log)).catch(() => undefined);
|
|
133
|
+
}
|
|
134
|
+
catch (_b) {
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
121
138
|
};
|
|
122
139
|
exports.AuditLoggerInterceptor = AuditLoggerInterceptor;
|
|
123
140
|
exports.AuditLoggerInterceptor = AuditLoggerInterceptor = __decorate([
|
|
124
141
|
(0, common_1.Injectable)(),
|
|
125
142
|
__param(2, (0, common_1.Inject)(audit_logger_enum_1.AuditLoggerRMQClient)),
|
|
143
|
+
__param(3, (0, common_1.Optional)()),
|
|
144
|
+
__param(3, (0, common_1.Inject)(audit_constants_1.AUDIT_EXTRA_SINKS)),
|
|
126
145
|
__metadata("design:paramtypes", [core_1.Reflector,
|
|
127
146
|
typeorm_1.DataSource,
|
|
128
|
-
microservices_1.ClientProxy])
|
|
147
|
+
microservices_1.ClientProxy, Array])
|
|
129
148
|
], AuditLoggerInterceptor);
|
|
130
149
|
//# sourceMappingURL=audit-logger.interceptor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-logger.interceptor.js","sourceRoot":"","sources":["../src/audit-logger.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"audit-logger.interceptor.js","sourceRoot":"","sources":["../src/audit-logger.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAOwB;AACxB,uCAAyC;AACzC,+BAA6D;AAC7D,yDAAoD;AACpD,qCAAqC;AACrC,mCAAoC;AAEpC,mEAA0D;AAC1D,2DAM6B;AA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O,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE;YAC9C,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;YAC3D,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACd,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,EAAE,CAAC,CAAC;IACT,CAAC;IAEO,gBAAgB,CAAC,GAAsB;;QAC7C,IAAI,CAAC,CAAA,MAAA,IAAI,CAAC,UAAU,0CAAE,MAAM,CAAA,EAAE,CAAC;YAC7B,OAAO;QACT,CAAC;QACD,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACnC,IAAI,CAAC;gBACH,KAAK,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;YACzD,CAAC;YAAC,WAAM,CAAC;YAET,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAA;AA3KY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,mBAAU,GAAE;IAKR,WAAA,IAAA,eAAM,EAAC,wCAAoB,CAAC,CAAA;IAE5B,WAAA,IAAA,iBAAQ,GAAE,CAAA;IACV,WAAA,IAAA,eAAM,EAAC,mCAAiB,CAAC,CAAA;qCALP,gBAAS;QACC,oBAAU;QAER,2BAAW;GALjC,sBAAsB,CA2KlC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit-module-options.js","sourceRoot":"","sources":["../src/audit-module-options.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AUDIT_EXTRA_SINKS: unique symbol;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit.constants.js","sourceRoot":"","sources":["../src/audit.constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC"}
|
package/dist/audit.module.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DynamicModule } from '@nestjs/common';
|
|
2
|
+
import type { AuditModuleRootOptions } from './audit-module-options';
|
|
2
3
|
export declare class AuditModule {
|
|
3
|
-
static forRoot(): DynamicModule;
|
|
4
|
-
static forRootAsync(): DynamicModule;
|
|
4
|
+
static forRoot(options?: AuditModuleRootOptions): DynamicModule;
|
|
5
|
+
static forRootAsync(options?: AuditModuleRootOptions): DynamicModule;
|
|
5
6
|
}
|
package/dist/audit.module.js
CHANGED
|
@@ -8,12 +8,15 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var AuditModule_1;
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.AuditModule = void 0;
|
|
11
|
-
const common_1 = require("@nestjs/common");
|
|
12
11
|
const audit_subscriber_1 = require("./audit.subscriber");
|
|
13
12
|
const audit_logger_interceptor_1 = require("./audit-logger.interceptor");
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
14
|
const core_1 = require("@nestjs/core");
|
|
15
15
|
const microservices_1 = require("@nestjs/microservices");
|
|
16
|
+
const typeorm_1 = require("typeorm");
|
|
16
17
|
const audit_logger_config_1 = require("./audit.logger.config");
|
|
18
|
+
const audit_constants_1 = require("./audit.constants");
|
|
19
|
+
const audit_logger_enum_1 = require("./audit-logger.enum");
|
|
17
20
|
function isAmqplibAvailable() {
|
|
18
21
|
try {
|
|
19
22
|
require.resolve('amqplib');
|
|
@@ -32,19 +35,23 @@ function isMicroservicesAvailable() {
|
|
|
32
35
|
return false;
|
|
33
36
|
}
|
|
34
37
|
}
|
|
35
|
-
function createAuditModuleConfig() {
|
|
38
|
+
function createAuditModuleConfig(options = {}) {
|
|
39
|
+
var _a;
|
|
36
40
|
const imports = [];
|
|
37
|
-
const providers = [
|
|
38
|
-
audit_subscriber_1.AuditSubscriber,
|
|
39
|
-
];
|
|
41
|
+
const providers = [audit_subscriber_1.AuditSubscriber];
|
|
40
42
|
const hasAmqplib = isAmqplibAvailable();
|
|
41
43
|
const hasMicroservices = isMicroservicesAvailable();
|
|
42
44
|
if (hasAmqplib && hasMicroservices) {
|
|
43
45
|
try {
|
|
44
46
|
imports.push(microservices_1.ClientsModule.register([audit_logger_config_1.auditLoggerConfig]));
|
|
47
|
+
providers.push({
|
|
48
|
+
provide: audit_constants_1.AUDIT_EXTRA_SINKS,
|
|
49
|
+
useValue: (_a = options.extraSinks) !== null && _a !== void 0 ? _a : [],
|
|
50
|
+
});
|
|
45
51
|
providers.push({
|
|
46
52
|
provide: core_1.APP_INTERCEPTOR,
|
|
47
|
-
|
|
53
|
+
useFactory: (reflector, connection, rmsRMQClient, extraSinks) => new audit_logger_interceptor_1.AuditLoggerInterceptor(reflector, connection, rmsRMQClient, extraSinks),
|
|
54
|
+
inject: [core_1.Reflector, typeorm_1.DataSource, audit_logger_enum_1.AuditLoggerRMQClient, audit_constants_1.AUDIT_EXTRA_SINKS],
|
|
48
55
|
});
|
|
49
56
|
}
|
|
50
57
|
catch (error) {
|
|
@@ -70,8 +77,8 @@ function createAuditModuleConfig() {
|
|
|
70
77
|
}
|
|
71
78
|
const moduleConfig = createAuditModuleConfig();
|
|
72
79
|
let AuditModule = AuditModule_1 = class AuditModule {
|
|
73
|
-
static forRoot() {
|
|
74
|
-
const config = createAuditModuleConfig();
|
|
80
|
+
static forRoot(options = {}) {
|
|
81
|
+
const config = createAuditModuleConfig(options);
|
|
75
82
|
return {
|
|
76
83
|
module: AuditModule_1,
|
|
77
84
|
imports: config.imports,
|
|
@@ -79,8 +86,8 @@ let AuditModule = AuditModule_1 = class AuditModule {
|
|
|
79
86
|
exports: config.providers,
|
|
80
87
|
};
|
|
81
88
|
}
|
|
82
|
-
static forRootAsync() {
|
|
83
|
-
return AuditModule_1.forRoot();
|
|
89
|
+
static forRootAsync(options = {}) {
|
|
90
|
+
return AuditModule_1.forRoot(options);
|
|
84
91
|
}
|
|
85
92
|
};
|
|
86
93
|
exports.AuditModule = AuditModule;
|
package/dist/audit.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit.module.js","sourceRoot":"","sources":["../src/audit.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"audit.module.js","sourceRoot":"","sources":["../src/audit.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,yDAAqD;AACrD,yEAAoE;AACpE,2CAAuD;AACvD,uCAA0D;AAC1D,yDAAmE;AACnE,qCAAqC;AACrC,+DAA0D;AAC1D,uDAAsD;AACtD,2DAA2D;AAM3D,SAAS,kBAAkB;IACzB,IAAI,CAAC;QACH,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAKD,SAAS,wBAAwB;IAC/B,IAAI,CAAC;QACH,OAAO,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC;QACzC,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,SAAS,uBAAuB,CAC9B,UAAkC,EAAE;;IAEpC,MAAM,OAAO,GAAU,EAAE,CAAC;IAC1B,MAAM,SAAS,GAAU,CAAC,kCAAe,CAAC,CAAC;IAE3C,MAAM,UAAU,GAAG,kBAAkB,EAAE,CAAC;IACxC,MAAM,gBAAgB,GAAG,wBAAwB,EAAE,CAAC;IAEpD,IAAI,UAAU,IAAI,gBAAgB,EAAE,CAAC;QACnC,IAAI,CAAC;YACH,OAAO,CAAC,IAAI,CAAC,6BAA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,WAAW,mBAAjB,MAAM,WAAW;IACtB,MAAM,CAAC,OAAO,CAAC,UAAkC,EAAE;QACjD,MAAM,MAAM,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAC;QAChD,OAAO;YACL,MAAM,EAAE,aAAW;YACnB,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,OAAO,EAAE,MAAM,CAAC,SAAS;SAC1B,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,YAAY,CACjB,UAAkC,EAAE;QAEpC,OAAO,aAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;CACF,CAAA;AAhBY,kCAAW;sBAAX,WAAW;IALvB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,YAAY,CAAC,OAAO;QAC7B,SAAS,EAAE,YAAY,CAAC,SAAS;QACjC,OAAO,EAAE,YAAY,CAAC,SAAS;KAChC,CAAC;GACW,WAAW,CAgBvB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export * from './audit-logger.type';
|
|
|
5
5
|
export * from './audit.dto';
|
|
6
6
|
export * from './audit.logger.config';
|
|
7
7
|
export * from './audit.module';
|
|
8
|
+
export * from './audit-module-options';
|
|
8
9
|
export * from './audit.subscriber';
|
|
9
10
|
export * from './event-audit.decorator';
|
|
10
11
|
export * from './ignore-logger.decorator';
|
package/dist/index.js
CHANGED
|
@@ -21,6 +21,7 @@ __exportStar(require("./audit-logger.type"), exports);
|
|
|
21
21
|
__exportStar(require("./audit.dto"), exports);
|
|
22
22
|
__exportStar(require("./audit.logger.config"), exports);
|
|
23
23
|
__exportStar(require("./audit.module"), exports);
|
|
24
|
+
__exportStar(require("./audit-module-options"), exports);
|
|
24
25
|
__exportStar(require("./audit.subscriber"), exports);
|
|
25
26
|
__exportStar(require("./event-audit.decorator"), exports);
|
|
26
27
|
__exportStar(require("./ignore-logger.decorator"), exports);
|
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,qDAAmC;AACnC,0DAAwC;AACxC,4DAA0C"}
|
|
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"}
|