@icd-iot-aicf/nestjs-logger 2.3.0 → 3.0.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.
- package/SNAPSHOT_GUIDE.md +154 -0
- package/migration/log-snapshot-v3.e2e-spec.ts +364 -0
- package/package.json +1 -1
- package/dist/app.module.d.ts +0 -2
- package/dist/app.module.js +0 -23
- package/dist/app.module.js.map +0 -1
- package/dist/app.service.d.ts +0 -3
- package/dist/app.service.js +0 -20
- package/dist/app.service.js.map +0 -1
- package/dist/common/async-storage/external-transaction-info.d.ts +0 -11
- package/dist/common/async-storage/external-transaction-info.js +0 -6
- package/dist/common/async-storage/external-transaction-info.js.map +0 -1
- package/dist/common/async-storage/summaryEndpoint-info.d.ts +0 -4
- package/dist/common/async-storage/summaryEndpoint-info.js +0 -10
- package/dist/common/async-storage/summaryEndpoint-info.js.map +0 -1
- package/dist/common/async-storage/tracnsaction-info.d.ts +0 -14
- package/dist/common/async-storage/tracnsaction-info.js +0 -6
- package/dist/common/async-storage/tracnsaction-info.js.map +0 -1
- package/dist/common/dto/result.dto.d.ts +0 -18
- package/dist/common/dto/result.dto.js +0 -12
- package/dist/common/dto/result.dto.js.map +0 -1
- package/dist/common/helper/error.d.ts +0 -4
- package/dist/common/helper/error.js +0 -15
- package/dist/common/helper/error.js.map +0 -1
- package/dist/common/helper/response.d.ts +0 -38
- package/dist/common/helper/response.js +0 -212
- package/dist/common/helper/response.js.map +0 -1
- package/dist/common/helper/tools.d.ts +0 -8
- package/dist/common/helper/tools.js +0 -98
- package/dist/common/helper/tools.js.map +0 -1
- package/dist/common/helper/tools.service.d.ts +0 -12
- package/dist/common/helper/tools.service.js +0 -148
- package/dist/common/helper/tools.service.js.map +0 -1
- package/dist/common/internal-logs-info.module.d.ts +0 -3
- package/dist/common/internal-logs-info.module.js +0 -29
- package/dist/common/internal-logs-info.module.js.map +0 -1
- package/dist/common/service/common/context.service.d.ts +0 -6
- package/dist/common/service/common/context.service.js +0 -34
- package/dist/common/service/common/context.service.js.map +0 -1
- package/dist/common/service/logger-debug/logger-debug-lib.service.d.ts +0 -6
- package/dist/common/service/logger-debug/logger-debug-lib.service.js +0 -35
- package/dist/common/service/logger-debug/logger-debug-lib.service.js.map +0 -1
- package/dist/config/app-log-config.module.d.ts +0 -5
- package/dist/config/app-log-config.module.js +0 -38
- package/dist/config/app-log-config.module.js.map +0 -1
- package/dist/config/app-log-config.service.d.ts +0 -6
- package/dist/config/app-log-config.service.js +0 -32
- package/dist/config/app-log-config.service.js.map +0 -1
- package/dist/config/configurations.d.ts +0 -23
- package/dist/config/configurations.js +0 -15
- package/dist/config/configurations.js.map +0 -1
- package/dist/index.d.ts +0 -23
- package/dist/index.js +0 -40
- package/dist/index.js.map +0 -1
- package/dist/logger/aicf/dtos/aicf-manual.dto.d.ts +0 -128
- package/dist/logger/aicf/dtos/aicf-manual.dto.js +0 -214
- package/dist/logger/aicf/dtos/aicf-manual.dto.js.map +0 -1
- package/dist/logger/aicf/dtos/aicf.dto.d.ts +0 -208
- package/dist/logger/aicf/dtos/aicf.dto.js +0 -177
- package/dist/logger/aicf/dtos/aicf.dto.js.map +0 -1
- package/dist/logger/aicf/interceptors/aicf-amqp.interceptor.d.ts +0 -7
- package/dist/logger/aicf/interceptors/aicf-amqp.interceptor.js +0 -78
- package/dist/logger/aicf/interceptors/aicf-amqp.interceptor.js.map +0 -1
- package/dist/logger/aicf/interceptors/aicf.interceptor.d.ts +0 -9
- package/dist/logger/aicf/interceptors/aicf.interceptor.js +0 -38
- package/dist/logger/aicf/interceptors/aicf.interceptor.js.map +0 -1
- package/dist/logger/aicf/middleware/aicf.middleware.d.ts +0 -13
- package/dist/logger/aicf/middleware/aicf.middleware.js +0 -125
- package/dist/logger/aicf/middleware/aicf.middleware.js.map +0 -1
- package/dist/logger/aicf/services/aicf-endpoint.service.d.ts +0 -13
- package/dist/logger/aicf/services/aicf-endpoint.service.js +0 -116
- package/dist/logger/aicf/services/aicf-endpoint.service.js.map +0 -1
- package/dist/logger/cloudron/decorators/cloudron.decorators.d.ts +0 -0
- package/dist/logger/cloudron/decorators/cloudron.decorators.js +0 -1
- package/dist/logger/cloudron/decorators/cloudron.decorators.js.map +0 -1
- package/dist/logger/cloudron/dtos/cauldron-manual.dto.d.ts +0 -120
- package/dist/logger/cloudron/dtos/cauldron-manual.dto.js +0 -179
- package/dist/logger/cloudron/dtos/cauldron-manual.dto.js.map +0 -1
- package/dist/logger/cloudron/dtos/cauldron.dto.d.ts +0 -182
- package/dist/logger/cloudron/dtos/cauldron.dto.js +0 -114
- package/dist/logger/cloudron/dtos/cauldron.dto.js.map +0 -1
- package/dist/logger/cloudron/global/cloudron.global.d.ts +0 -0
- package/dist/logger/cloudron/global/cloudron.global.js +0 -1
- package/dist/logger/cloudron/global/cloudron.global.js.map +0 -1
- package/dist/logger/cloudron/intercepters/cloudron.interceptor.d.ts +0 -11
- package/dist/logger/cloudron/intercepters/cloudron.interceptor.js +0 -41
- package/dist/logger/cloudron/intercepters/cloudron.interceptor.js.map +0 -1
- package/dist/logger/cloudron/middleware/cloudron.middleware.d.ts +0 -15
- package/dist/logger/cloudron/middleware/cloudron.middleware.js +0 -106
- package/dist/logger/cloudron/middleware/cloudron.middleware.js.map +0 -1
- package/dist/logger/cloudron/services/cloudron-details-logs.service.d.ts +0 -15
- package/dist/logger/cloudron/services/cloudron-details-logs.service.js +0 -127
- package/dist/logger/cloudron/services/cloudron-details-logs.service.js.map +0 -1
- package/dist/logger/cloudron/services/cloudron-summary-logs.service.d.ts +0 -6
- package/dist/logger/cloudron/services/cloudron-summary-logs.service.js +0 -43
- package/dist/logger/cloudron/services/cloudron-summary-logs.service.js.map +0 -1
- package/dist/logger/core/database/hook-ingress.database.d.ts +0 -8
- package/dist/logger/core/database/hook-ingress.database.js +0 -215
- package/dist/logger/core/database/hook-ingress.database.js.map +0 -1
- package/dist/logger/core/decorators/customDecorators.d.ts +0 -20
- package/dist/logger/core/decorators/customDecorators.js +0 -92
- package/dist/logger/core/decorators/customDecorators.js.map +0 -1
- package/dist/logger/core/dtos/core.dto.d.ts +0 -86
- package/dist/logger/core/dtos/core.dto.js +0 -9
- package/dist/logger/core/dtos/core.dto.js.map +0 -1
- package/dist/logger/core/dtos/log-entry-class.d.ts +0 -11
- package/dist/logger/core/dtos/log-entry-class.js +0 -15
- package/dist/logger/core/dtos/log-entry-class.js.map +0 -1
- package/dist/logger/core/enum/enum.d.ts +0 -75
- package/dist/logger/core/enum/enum.js +0 -307
- package/dist/logger/core/enum/enum.js.map +0 -1
- package/dist/logger/core/functions/error-reponse.d.ts +0 -2
- package/dist/logger/core/functions/error-reponse.js +0 -26
- package/dist/logger/core/functions/error-reponse.js.map +0 -1
- package/dist/logger/core/functions/global-function.d.ts +0 -43
- package/dist/logger/core/functions/global-function.js +0 -180
- package/dist/logger/core/functions/global-function.js.map +0 -1
- package/dist/logger/core/guard/logger.guard.d.ts +0 -8
- package/dist/logger/core/guard/logger.guard.js +0 -44
- package/dist/logger/core/guard/logger.guard.js.map +0 -1
- package/dist/logger/core/interceptors/amqp.interceptor.d.ts +0 -6
- package/dist/logger/core/interceptors/amqp.interceptor.js +0 -46
- package/dist/logger/core/interceptors/amqp.interceptor.js.map +0 -1
- package/dist/logger/core/interceptors/core-logs.interceptor.d.ts +0 -18
- package/dist/logger/core/interceptors/core-logs.interceptor.js +0 -70
- package/dist/logger/core/interceptors/core-logs.interceptor.js.map +0 -1
- package/dist/logger/core/interceptors/http.interceptor.d.ts +0 -5
- package/dist/logger/core/interceptors/http.interceptor.js +0 -30
- package/dist/logger/core/interceptors/http.interceptor.js.map +0 -1
- package/dist/logger/core/interceptors/interceptors.d.ts +0 -3
- package/dist/logger/core/interceptors/interceptors.js +0 -20
- package/dist/logger/core/interceptors/interceptors.js.map +0 -1
- package/dist/logger/core/middleware/http-logs-middleware.service.d.ts +0 -19
- package/dist/logger/core/middleware/http-logs-middleware.service.js +0 -61
- package/dist/logger/core/middleware/http-logs-middleware.service.js.map +0 -1
- package/dist/logger/core/module/amqp/amqp.module.d.ts +0 -2
- package/dist/logger/core/module/amqp/amqp.module.js +0 -43
- package/dist/logger/core/module/amqp/amqp.module.js.map +0 -1
- package/dist/logger/core/pipes/index.d.ts +0 -1
- package/dist/logger/core/pipes/index.js +0 -18
- package/dist/logger/core/pipes/index.js.map +0 -1
- package/dist/logger/core/pipes/masking-logs/masking-logs.pipe.d.ts +0 -5
- package/dist/logger/core/pipes/masking-logs/masking-logs.pipe.js +0 -38
- package/dist/logger/core/pipes/masking-logs/masking-logs.pipe.js.map +0 -1
- package/dist/logger/core/services/summary-flush.service.d.ts +0 -8
- package/dist/logger/core/services/summary-flush.service.js +0 -31
- package/dist/logger/core/services/summary-flush.service.js.map +0 -1
- package/dist/logger/esb/dtos/logger.esb.dto.d.ts +0 -136
- package/dist/logger/esb/dtos/logger.esb.dto.js +0 -99
- package/dist/logger/esb/dtos/logger.esb.dto.js.map +0 -1
- package/dist/logger/esb/intercepters/esb.interceptor.d.ts +0 -9
- package/dist/logger/esb/intercepters/esb.interceptor.js +0 -36
- package/dist/logger/esb/intercepters/esb.interceptor.js.map +0 -1
- package/dist/logger/esb/middleware/esb.middleware.d.ts +0 -10
- package/dist/logger/esb/middleware/esb.middleware.js +0 -64
- package/dist/logger/esb/middleware/esb.middleware.js.map +0 -1
- package/dist/logger/esb/services/external-logs-esb.service.d.ts +0 -10
- package/dist/logger/esb/services/external-logs-esb.service.js +0 -98
- package/dist/logger/esb/services/external-logs-esb.service.js.map +0 -1
- package/dist/logger/logger.middleware.d.ts +0 -0
- package/dist/logger/logger.middleware.js +0 -1
- package/dist/logger/logger.middleware.js.map +0 -1
- package/dist/logger/logger.module.d.ts +0 -2
- package/dist/logger/logger.module.js +0 -59
- package/dist/logger/logger.module.js.map +0 -1
- package/dist/logger/logger.service.d.ts +0 -12
- package/dist/logger/logger.service.js +0 -129
- package/dist/logger/logger.service.js.map +0 -1
- package/dist/main.d.ts +0 -2
- package/dist/main.js +0 -15
- package/dist/main.js.map +0 -1
- package/dist/metrics/metrics-manual.service.d.ts +0 -12
- package/dist/metrics/metrics-manual.service.js +0 -45
- package/dist/metrics/metrics-manual.service.js.map +0 -1
- package/dist/metrics/metrics.middleware.d.ts +0 -14
- package/dist/metrics/metrics.middleware.js +0 -74
- package/dist/metrics/metrics.middleware.js.map +0 -1
- package/dist/metrics/metrics.module.d.ts +0 -6
- package/dist/metrics/metrics.module.js +0 -42
- package/dist/metrics/metrics.module.js.map +0 -1
- package/dist/metrics/metrics.service.d.ts +0 -11
- package/dist/metrics/metrics.service.js +0 -112
- package/dist/metrics/metrics.service.js.map +0 -1
- package/dist/tsconfig.build.tsbuildinfo +0 -1
- package/dist/utils/tools.d.ts +0 -50
- package/dist/utils/tools.js +0 -266
- package/dist/utils/tools.js.map +0 -1
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# Log Snapshot — Pre-Upgrade Baseline Guide
|
|
2
|
+
|
|
3
|
+
> **AI Agent Instructions:** Read this file before doing anything in this worktree.
|
|
4
|
+
> Your job is to capture a snapshot of the current v3 log format so it can be compared against v4 after upgrading.
|
|
5
|
+
> Follow the steps below in order. Do not skip any step.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Context
|
|
10
|
+
|
|
11
|
+
This worktree is pinned to **v3** (`main` branch) of `@icd-iot-aicf/nestjs-logger`.
|
|
12
|
+
|
|
13
|
+
The goal is to capture a **baseline snapshot** of what the log output looks like right now — before upgrading to v4.
|
|
14
|
+
After upgrading, the same test file will be run against v4 output and Jest will diff the two, showing exactly what changed.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Step 1 — Install dependencies
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
> If `@nestjs/testing` or `supertest` are missing, install them:
|
|
25
|
+
> ```bash
|
|
26
|
+
> npm install --save-dev @nestjs/testing supertest
|
|
27
|
+
> ```
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Step 2 — Verify the Jest E2E config supports ESM (uuid)
|
|
32
|
+
|
|
33
|
+
Open `test/jest-e2e.json` and confirm it contains `transformIgnorePatterns`:
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"transformIgnorePatterns": ["node_modules/(?!(uuid)/)"]
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
If it is missing, add it — otherwise the test will fail with a `SyntaxError: Unexpected token 'export'` from the `uuid` package.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Step 3 — Copy the snapshot script into the test folder
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
cp migration/log-snapshot-v3.e2e-spec.ts test/log-snapshot.e2e-spec.ts
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
> **Why rename it?** Jest keys snapshots by the test file name.
|
|
52
|
+
> Using `log-snapshot.e2e-spec.ts` in both v3 and v4 means the same `.snap` file is used for comparison after upgrading.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Step 4 — Capture the v3 baseline snapshot
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npx jest --config ./test/jest-e2e.json --testPathPatterns=log-snapshot --updateSnapshot
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
This will:
|
|
63
|
+
- Spin up a minimal NestJS app using the v3 library
|
|
64
|
+
- Fire test HTTP requests
|
|
65
|
+
- Record the exact log structure and field values into `test/__snapshots__/log-snapshot.e2e-spec.ts.snap`
|
|
66
|
+
|
|
67
|
+
✅ Expected output: all tests pass, snapshot file created/updated.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Step 5 — Commit the snapshot
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
git add test/__snapshots__/log-snapshot.e2e-spec.ts.snap
|
|
75
|
+
git commit -m "test: capture v3 log format baseline snapshot"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
> This snapshot is the source of truth for comparison. Keep it committed.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Step 6 — Upgrade to v4
|
|
83
|
+
|
|
84
|
+
> ✅ Baseline captured. You are now ready to upgrade.
|
|
85
|
+
|
|
86
|
+
### 6.1 — Install v4
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
npm install @icd-iot-aicf/nestjs-logger@latest
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Or for the experimental release:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
npm install @icd-iot-aicf/nestjs-logger@experimental
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
### 6.2 — Apply breaking changes
|
|
101
|
+
|
|
102
|
+
The full breaking-changes list and rename guide is in `v3-to-v4-migration.md` (available in the v4 package repo).
|
|
103
|
+
Key things to check:
|
|
104
|
+
|
|
105
|
+
| Area | What changed |
|
|
106
|
+
|------|-------------|
|
|
107
|
+
| Middleware name | `HTTPLogsMiddleware` → `HttpLogsMiddleware` |
|
|
108
|
+
| Interceptor return types | `responseInterceptor` / `errorInterceptor` are now `void` |
|
|
109
|
+
| Error log HTTP status | `responseLogError` now handles HTTP status codes in addition to error codes |
|
|
110
|
+
| Module import | Review `AppLogConfigModule.forRoot()` options for any renamed fields |
|
|
111
|
+
|
|
112
|
+
> **Tip:** Feed `v3-to-v4-migration.md` to your AI coding assistant and ask it to apply all changes automatically.
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
### 6.3 — Compare log output against the baseline
|
|
117
|
+
|
|
118
|
+
After upgrading and fixing any TypeScript errors, run:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
npx jest --config ./test/jest-e2e.json --testPathPatterns=log-snapshot
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Jest will compare v4 output against this snapshot and report any differences.
|
|
125
|
+
|
|
126
|
+
**Reading the diff:**
|
|
127
|
+
```
|
|
128
|
+
- (minus) = what v3 produced ← the baseline
|
|
129
|
+
+ (plus) = what v4 produces ← the new output
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
### 6.4 — Accept or investigate differences
|
|
135
|
+
|
|
136
|
+
**If the diff matches expected breaking changes** (field renames from the table above) — accept and move on:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
npx jest --config ./test/jest-e2e.json --testPathPatterns=log-snapshot --updateSnapshot
|
|
140
|
+
git add test/__snapshots__/log-snapshot.e2e-spec.ts.snap
|
|
141
|
+
git commit -m "test: update log format snapshot for v4"
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**If the diff shows unexpected differences** — field names that should not have changed, missing fields, or wrong values — do **not** accept the snapshot. Report the diff to the library team before proceeding.
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Files in this worktree
|
|
149
|
+
|
|
150
|
+
| File | Purpose |
|
|
151
|
+
|------|---------|
|
|
152
|
+
| `migration/log-snapshot-v3.e2e-spec.ts` | The v3 snapshot test script — copy to `test/` before running |
|
|
153
|
+
| `test/log-snapshot.e2e-spec.ts` | Where the script lives after Step 3 |
|
|
154
|
+
| `test/__snapshots__/log-snapshot.e2e-spec.ts.snap` | Auto-generated baseline — commit this after Step 4 |
|
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Log Snapshot — v3 Baseline Capture Script
|
|
3
|
+
*
|
|
4
|
+
* ╔══════════════════════════════════════════════════════════════════╗
|
|
5
|
+
* ║ COPY THIS FILE INTO YOUR PROJECT'S test/ FOLDER BEFORE ║
|
|
6
|
+
* ║ UPGRADING TO v4, THEN RUN: ║
|
|
7
|
+
* ║ ║
|
|
8
|
+
* ║ npx jest --testPathPatterns=log-snapshot --updateSnapshot ║
|
|
9
|
+
* ║ ║
|
|
10
|
+
* ║ This saves a baseline snapshot of your v3 log format. ║
|
|
11
|
+
* ║ After upgrading to v4, run the same file from the v4 package ║
|
|
12
|
+
* ║ (test/log-snapshot.e2e-spec.ts) to compare what changed. ║
|
|
13
|
+
* ╚══════════════════════════════════════════════════════════════════╝
|
|
14
|
+
*
|
|
15
|
+
* REQUIREMENTS (add to your project if missing):
|
|
16
|
+
* npm install --save-dev @nestjs/testing supertest
|
|
17
|
+
*
|
|
18
|
+
* ADD THIS JEST CONFIG to your jest-e2e.json (or equivalent):
|
|
19
|
+
* "transformIgnorePatterns": ["node_modules/(?!(uuid)/)"]
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import { Test, TestingModule } from '@nestjs/testing';
|
|
23
|
+
import {
|
|
24
|
+
Controller,
|
|
25
|
+
Get,
|
|
26
|
+
INestApplication,
|
|
27
|
+
MiddlewareConsumer,
|
|
28
|
+
Module,
|
|
29
|
+
NestModule,
|
|
30
|
+
} from '@nestjs/common';
|
|
31
|
+
import request from 'supertest';
|
|
32
|
+
|
|
33
|
+
// ── v3 imports (these names change in v4 — do NOT update before snapshotting) ──
|
|
34
|
+
import {
|
|
35
|
+
AppLogConfigModule,
|
|
36
|
+
LoggerModule,
|
|
37
|
+
HTTPLogsMiddleware, // renamed to HttpLogsMiddleware in v4
|
|
38
|
+
FORMAT_TYPE,
|
|
39
|
+
CustomLoggerService,
|
|
40
|
+
RecordName,
|
|
41
|
+
HttpAction,
|
|
42
|
+
DBAction,
|
|
43
|
+
LogicAction,
|
|
44
|
+
ExceptionAction,
|
|
45
|
+
} from '@icd-iot-aicf/nestjs-logger';
|
|
46
|
+
|
|
47
|
+
// ── Normalisation ──────────────────────────────────────────────────────────────
|
|
48
|
+
|
|
49
|
+
const DYNAMIC_FIELDS = new Set([
|
|
50
|
+
'timestamp',
|
|
51
|
+
'systemTimestamp',
|
|
52
|
+
'reqTimestamp',
|
|
53
|
+
'resTimestamp',
|
|
54
|
+
'transactionId',
|
|
55
|
+
'sessionId',
|
|
56
|
+
'tid',
|
|
57
|
+
'subSessionId',
|
|
58
|
+
'serviceStartTime',
|
|
59
|
+
'serviceEndTime',
|
|
60
|
+
'serviceTime',
|
|
61
|
+
'usageTime',
|
|
62
|
+
'startTime',
|
|
63
|
+
'endTime',
|
|
64
|
+
'processTime',
|
|
65
|
+
'instance',
|
|
66
|
+
'containerId',
|
|
67
|
+
'message',
|
|
68
|
+
]);
|
|
69
|
+
|
|
70
|
+
function normalizeLog(log: any): any {
|
|
71
|
+
if (typeof log !== 'object' || log === null) return log;
|
|
72
|
+
if (Array.isArray(log)) return log.map(normalizeLog);
|
|
73
|
+
|
|
74
|
+
const result: Record<string, any> = {};
|
|
75
|
+
for (const [key, value] of Object.entries(log)) {
|
|
76
|
+
if (DYNAMIC_FIELDS.has(key)) {
|
|
77
|
+
result[key] = '[NORMALIZED]';
|
|
78
|
+
} else if (typeof value === 'string') {
|
|
79
|
+
result[key] = normalizeString(value);
|
|
80
|
+
} else {
|
|
81
|
+
result[key] = normalizeLog(value);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return result;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function normalizeString(value: string): string {
|
|
88
|
+
try {
|
|
89
|
+
const parsed = JSON.parse(value);
|
|
90
|
+
if (typeof parsed === 'object' && parsed !== null) {
|
|
91
|
+
return JSON.stringify(normalizeLog(parsed));
|
|
92
|
+
}
|
|
93
|
+
} catch {
|
|
94
|
+
/* not JSON */
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return value
|
|
98
|
+
.replace(/\b(\d{1,3}\.){3}\d{1,3}:\d+\b/g, '[HOST]')
|
|
99
|
+
.replace(/\blocalhost:\d+\b/g, '[HOST]')
|
|
100
|
+
.replace(
|
|
101
|
+
/[a-z0-9_-]+_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi,
|
|
102
|
+
'[AUTO-TXN]',
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function captureSnapshot(calls: jest.MockContext<any, any[]>['calls']) {
|
|
107
|
+
return {
|
|
108
|
+
count: calls.length,
|
|
109
|
+
logs: calls.map(([arg]) => normalizeLog(arg)),
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// ── Shared test controller ─────────────────────────────────────────────────────
|
|
114
|
+
|
|
115
|
+
@Controller('snapshot')
|
|
116
|
+
class SnapshotController {
|
|
117
|
+
@Get('success')
|
|
118
|
+
@RecordName('SuccessEndpoint')
|
|
119
|
+
success() {
|
|
120
|
+
return { resultCode: '20000', resultDescription: 'SUCCESS', httpCode: 200 };
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
@Get('not-found')
|
|
124
|
+
@RecordName('NotFoundEndpoint')
|
|
125
|
+
notFound() {
|
|
126
|
+
return {
|
|
127
|
+
resultCode: '40400',
|
|
128
|
+
resultDescription: 'DATA_NOT_FOUND',
|
|
129
|
+
httpCode: 404,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
@Get('no-headers')
|
|
134
|
+
noHeaders() {
|
|
135
|
+
return { ok: true };
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const waitForFinish = (ms = 80) => new Promise((r) => setTimeout(r, ms));
|
|
140
|
+
|
|
141
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
142
|
+
// IMPORTANT: describe() and it() names below MUST match the v4 snapshot file
|
|
143
|
+
// exactly — Jest uses these names as snapshot keys for comparison.
|
|
144
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
145
|
+
|
|
146
|
+
describe('Log Snapshot — AICF format', () => {
|
|
147
|
+
let app: INestApplication;
|
|
148
|
+
let logSpy: jest.SpyInstance;
|
|
149
|
+
|
|
150
|
+
beforeAll(async () => {
|
|
151
|
+
@Module({
|
|
152
|
+
imports: [
|
|
153
|
+
AppLogConfigModule.forRoot({
|
|
154
|
+
appName: 'snapshot-app',
|
|
155
|
+
componentName: 'snapshot-comp',
|
|
156
|
+
format: FORMAT_TYPE.AICF,
|
|
157
|
+
}),
|
|
158
|
+
LoggerModule,
|
|
159
|
+
],
|
|
160
|
+
controllers: [SnapshotController],
|
|
161
|
+
})
|
|
162
|
+
class AicfSnapshotModule implements NestModule {
|
|
163
|
+
configure(consumer: MiddlewareConsumer) {
|
|
164
|
+
// v3 name — this is what changes in v4 (HttpLogsMiddleware)
|
|
165
|
+
consumer.apply(HTTPLogsMiddleware).forRoutes('*');
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const moduleFixture: TestingModule = await Test.createTestingModule({
|
|
170
|
+
imports: [AicfSnapshotModule],
|
|
171
|
+
}).compile();
|
|
172
|
+
|
|
173
|
+
app = moduleFixture.createNestApplication();
|
|
174
|
+
await app.init();
|
|
175
|
+
|
|
176
|
+
logSpy = jest.spyOn(app.get(CustomLoggerService), 'log');
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
afterAll(async () => await app.close());
|
|
180
|
+
beforeEach(() => logSpy.mockClear());
|
|
181
|
+
|
|
182
|
+
it('GET /snapshot/success — log count + structure', async () => {
|
|
183
|
+
await request(app.getHttpServer())
|
|
184
|
+
.get('/snapshot/success')
|
|
185
|
+
.set('x-ais-orderref', 'SNAP-AICF-001');
|
|
186
|
+
await waitForFinish();
|
|
187
|
+
const snapshot = captureSnapshot(logSpy.mock.calls);
|
|
188
|
+
expect(snapshot.count).toMatchSnapshot('log count');
|
|
189
|
+
expect(snapshot.logs).toMatchSnapshot('log structure');
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
it('GET /snapshot/not-found — log count + structure', async () => {
|
|
193
|
+
await request(app.getHttpServer())
|
|
194
|
+
.get('/snapshot/not-found')
|
|
195
|
+
.set('x-ais-orderref', 'SNAP-AICF-002');
|
|
196
|
+
await waitForFinish();
|
|
197
|
+
const snapshot = captureSnapshot(logSpy.mock.calls);
|
|
198
|
+
expect(snapshot.count).toMatchSnapshot('log count');
|
|
199
|
+
expect(snapshot.logs).toMatchSnapshot('log structure');
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
it('GET /snapshot/no-headers — log count + structure (missing correlation headers)', async () => {
|
|
203
|
+
await request(app.getHttpServer()).get('/snapshot/no-headers');
|
|
204
|
+
await waitForFinish();
|
|
205
|
+
const snapshot = captureSnapshot(logSpy.mock.calls);
|
|
206
|
+
expect(snapshot.count).toMatchSnapshot('log count');
|
|
207
|
+
expect(snapshot.logs).toMatchSnapshot('log structure');
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
it('HttpAction.GET — DTO field structure', () => {
|
|
211
|
+
const dto = HttpAction.GET({
|
|
212
|
+
requestObject: {
|
|
213
|
+
url: '/api/users/1',
|
|
214
|
+
headers: { 'x-ais-orderref': 'SNAP-ACT-001' },
|
|
215
|
+
queryString: {},
|
|
216
|
+
routeParameters: {},
|
|
217
|
+
payload: {},
|
|
218
|
+
},
|
|
219
|
+
responseObject: { httpStatusCode: 200, headers: {}, payload: { id: 1 } },
|
|
220
|
+
});
|
|
221
|
+
expect(normalizeLog(dto)).toMatchSnapshot();
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
it('HttpAction.POST — DTO field structure', () => {
|
|
225
|
+
const dto = HttpAction.POST({
|
|
226
|
+
requestObject: {
|
|
227
|
+
url: '/api/users',
|
|
228
|
+
headers: {},
|
|
229
|
+
queryString: {},
|
|
230
|
+
routeParameters: {},
|
|
231
|
+
payload: { name: 'test-user' },
|
|
232
|
+
},
|
|
233
|
+
responseObject: { httpStatusCode: 201, headers: {}, payload: { id: 99 } },
|
|
234
|
+
});
|
|
235
|
+
expect(normalizeLog(dto)).toMatchSnapshot();
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
it('DBAction.READ — DTO field structure', () => {
|
|
239
|
+
const dto = DBAction.READ({
|
|
240
|
+
requestObject: { method: 'findOne', payload: { id: 1 } },
|
|
241
|
+
responseObject: {
|
|
242
|
+
httpStatusCode: 200,
|
|
243
|
+
headers: {},
|
|
244
|
+
payload: { name: 'item' },
|
|
245
|
+
},
|
|
246
|
+
});
|
|
247
|
+
expect(normalizeLog(dto)).toMatchSnapshot();
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
it('DBAction.CREATE — DTO field structure', () => {
|
|
251
|
+
const dto = DBAction.CREATE({
|
|
252
|
+
requestObject: { method: 'insertOne', payload: { name: 'new-item' } },
|
|
253
|
+
});
|
|
254
|
+
expect(normalizeLog(dto)).toMatchSnapshot();
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
it('LogicAction.FUNCTION — DTO field structure', () => {
|
|
258
|
+
const dto = LogicAction.FUNCTION({ message: 'Processing data' });
|
|
259
|
+
expect(normalizeLog(dto)).toMatchSnapshot();
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
it('LogicAction.CHECKPOINT — DTO field structure', () => {
|
|
263
|
+
const dto = LogicAction.CHECKPOINT({ message: 'Step completed' });
|
|
264
|
+
expect(normalizeLog(dto)).toMatchSnapshot();
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
it('ExceptionAction.LOG — DTO field structure', () => {
|
|
268
|
+
const dto = ExceptionAction.LOG({ message: 'Unexpected error occurred' });
|
|
269
|
+
expect(normalizeLog(dto)).toMatchSnapshot();
|
|
270
|
+
});
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
describe('Log Snapshot — Cloudron format', () => {
|
|
274
|
+
let app: INestApplication;
|
|
275
|
+
let logSpy: jest.SpyInstance;
|
|
276
|
+
|
|
277
|
+
beforeAll(async () => {
|
|
278
|
+
@Module({
|
|
279
|
+
imports: [
|
|
280
|
+
AppLogConfigModule.forRoot({
|
|
281
|
+
appName: 'snapshot-app',
|
|
282
|
+
componentName: 'snapshot-comp',
|
|
283
|
+
format: FORMAT_TYPE.CLOUDRON,
|
|
284
|
+
}),
|
|
285
|
+
LoggerModule,
|
|
286
|
+
],
|
|
287
|
+
controllers: [SnapshotController],
|
|
288
|
+
})
|
|
289
|
+
class CloudronSnapshotModule implements NestModule {
|
|
290
|
+
configure(consumer: MiddlewareConsumer) {
|
|
291
|
+
consumer.apply(HTTPLogsMiddleware).forRoutes('*');
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
const moduleFixture: TestingModule = await Test.createTestingModule({
|
|
296
|
+
imports: [CloudronSnapshotModule],
|
|
297
|
+
}).compile();
|
|
298
|
+
|
|
299
|
+
app = moduleFixture.createNestApplication();
|
|
300
|
+
await app.init();
|
|
301
|
+
|
|
302
|
+
logSpy = jest.spyOn(app.get(CustomLoggerService), 'log');
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
afterAll(async () => await app.close());
|
|
306
|
+
beforeEach(() => logSpy.mockClear());
|
|
307
|
+
|
|
308
|
+
it('GET /snapshot/success — log count + structure', async () => {
|
|
309
|
+
await request(app.getHttpServer())
|
|
310
|
+
.get('/snapshot/success')
|
|
311
|
+
.set('x-ais-orderref', 'SNAP-CLDRON-001');
|
|
312
|
+
await waitForFinish();
|
|
313
|
+
const snapshot = captureSnapshot(logSpy.mock.calls);
|
|
314
|
+
expect(snapshot.count).toMatchSnapshot('log count');
|
|
315
|
+
expect(snapshot.logs).toMatchSnapshot('log structure');
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
it('GET /snapshot/not-found — log count + structure', async () => {
|
|
319
|
+
await request(app.getHttpServer())
|
|
320
|
+
.get('/snapshot/not-found')
|
|
321
|
+
.set('x-ais-orderref', 'SNAP-CLDRON-002');
|
|
322
|
+
await waitForFinish();
|
|
323
|
+
const snapshot = captureSnapshot(logSpy.mock.calls);
|
|
324
|
+
expect(snapshot.count).toMatchSnapshot('log count');
|
|
325
|
+
expect(snapshot.logs).toMatchSnapshot('log structure');
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
it('GET /snapshot/no-headers — log count + structure (missing correlation headers)', async () => {
|
|
329
|
+
await request(app.getHttpServer()).get('/snapshot/no-headers');
|
|
330
|
+
await waitForFinish();
|
|
331
|
+
const snapshot = captureSnapshot(logSpy.mock.calls);
|
|
332
|
+
expect(snapshot.count).toMatchSnapshot('log count');
|
|
333
|
+
expect(snapshot.logs).toMatchSnapshot('log structure');
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
it('HttpAction.GET — DTO field structure', () => {
|
|
337
|
+
const dto = HttpAction.GET({
|
|
338
|
+
requestObject: {
|
|
339
|
+
url: '/api/resource/1',
|
|
340
|
+
headers: { 'x-ais-orderref': 'SNAP-C-ACT-001' },
|
|
341
|
+
queryString: {},
|
|
342
|
+
routeParameters: {},
|
|
343
|
+
payload: {},
|
|
344
|
+
},
|
|
345
|
+
responseObject: { httpStatusCode: 200, headers: {}, payload: {} },
|
|
346
|
+
});
|
|
347
|
+
expect(normalizeLog(dto)).toMatchSnapshot();
|
|
348
|
+
});
|
|
349
|
+
|
|
350
|
+
it('DBAction.UPDATE — DTO field structure', () => {
|
|
351
|
+
const dto = DBAction.UPDATE({
|
|
352
|
+
requestObject: {
|
|
353
|
+
method: 'updateOne',
|
|
354
|
+
payload: { id: 1, name: 'updated' },
|
|
355
|
+
},
|
|
356
|
+
});
|
|
357
|
+
expect(normalizeLog(dto)).toMatchSnapshot();
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
it('LogicAction.FUNCTION — DTO field structure', () => {
|
|
361
|
+
const dto = LogicAction.FUNCTION({ message: 'Processing' });
|
|
362
|
+
expect(normalizeLog(dto)).toMatchSnapshot();
|
|
363
|
+
});
|
|
364
|
+
});
|
package/package.json
CHANGED
package/dist/app.module.d.ts
DELETED
package/dist/app.module.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
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
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.AppModule = void 0;
|
|
10
|
-
const common_1 = require("@nestjs/common");
|
|
11
|
-
const app_service_1 = require("./app.service");
|
|
12
|
-
let AppModule = class AppModule {
|
|
13
|
-
};
|
|
14
|
-
exports.AppModule = AppModule;
|
|
15
|
-
exports.AppModule = AppModule = __decorate([
|
|
16
|
-
(0, common_1.Module)({
|
|
17
|
-
imports: [],
|
|
18
|
-
controllers: [],
|
|
19
|
-
providers: [app_service_1.AppService],
|
|
20
|
-
exports: [],
|
|
21
|
-
})
|
|
22
|
-
], AppModule);
|
|
23
|
-
//# sourceMappingURL=app.module.js.map
|
package/dist/app.module.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,+CAA2C;AAgBpC,IAAM,SAAS,GAAf,MAAM,SAAS;CAIrB,CAAA;AAJY,8BAAS;oBAAT,SAAS;IAdrB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,EAQR;QACD,WAAW,EAAE,EAAE;QACf,SAAS,EAAE,CAAC,wBAAU,CAAC;QACvB,OAAO,EAAE,EAAE;KACZ,CAAC;GACW,SAAS,CAIrB"}
|
package/dist/app.service.d.ts
DELETED
package/dist/app.service.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
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
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.AppService = void 0;
|
|
10
|
-
const common_1 = require("@nestjs/common");
|
|
11
|
-
let AppService = class AppService {
|
|
12
|
-
getHello() {
|
|
13
|
-
return 'Hello World!';
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
exports.AppService = AppService;
|
|
17
|
-
exports.AppService = AppService = __decorate([
|
|
18
|
-
(0, common_1.Injectable)()
|
|
19
|
-
], AppService);
|
|
20
|
-
//# sourceMappingURL=app.service.js.map
|
package/dist/app.service.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app.service.js","sourceRoot":"","sources":["../src/app.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAGrC,IAAM,UAAU,GAAhB,MAAM,UAAU;IACrB,QAAQ;QACN,OAAO,cAAc,CAAC;IACxB,CAAC;CACF,CAAA;AAJY,gCAAU;qBAAV,UAAU;IADtB,IAAA,mBAAU,GAAE;GACA,UAAU,CAItB"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { AsyncLocalStorage } from 'async_hooks';
|
|
2
|
-
import { ACTION_TYPE } from '../../logger/aicf/dtos/aicf.dto';
|
|
3
|
-
export declare const externalTransactionInfoLocal: AsyncLocalStorage<ExternalTransactionStore>;
|
|
4
|
-
export interface ExternalTransactionStore {
|
|
5
|
-
dependency: string;
|
|
6
|
-
subSessionId: string;
|
|
7
|
-
serviceStartTime: number;
|
|
8
|
-
action: ACTION_TYPE | '';
|
|
9
|
-
subAction: string;
|
|
10
|
-
isUsed: boolean;
|
|
11
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.externalTransactionInfoLocal = void 0;
|
|
4
|
-
const async_hooks_1 = require("async_hooks");
|
|
5
|
-
exports.externalTransactionInfoLocal = new async_hooks_1.AsyncLocalStorage();
|
|
6
|
-
//# sourceMappingURL=external-transaction-info.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"external-transaction-info.js","sourceRoot":"","sources":["../../../src/common/async-storage/external-transaction-info.ts"],"names":[],"mappings":";;;AAAA,6CAAgD;AAGnC,QAAA,4BAA4B,GACvC,IAAI,+BAAiB,EAA4B,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { AsyncLocalStorage } from 'async_hooks';
|
|
2
|
-
import { EndpointDetail } from '../../logger/cloudron/dtos/cauldron.dto';
|
|
3
|
-
export declare const summaryInfoLocal: AsyncLocalStorage<EndpointDetail[]>;
|
|
4
|
-
export declare function pushSummaryInfo(endpointDetail: EndpointDetail): void;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.summaryInfoLocal = void 0;
|
|
4
|
-
exports.pushSummaryInfo = pushSummaryInfo;
|
|
5
|
-
const async_hooks_1 = require("async_hooks");
|
|
6
|
-
exports.summaryInfoLocal = new async_hooks_1.AsyncLocalStorage();
|
|
7
|
-
function pushSummaryInfo(endpointDetail) {
|
|
8
|
-
exports.summaryInfoLocal.getStore().push(endpointDetail);
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=summaryEndpoint-info.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"summaryEndpoint-info.js","sourceRoot":"","sources":["../../../src/common/async-storage/summaryEndpoint-info.ts"],"names":[],"mappings":";;;AAKA,0CAEC;AAPD,6CAAgD;AAGnC,QAAA,gBAAgB,GAAG,IAAI,+BAAiB,EAAoB,CAAC;AAE1E,SAAgB,eAAe,CAAC,cAA8B;IAC5D,wBAAgB,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { AsyncLocalStorage } from 'async_hooks';
|
|
2
|
-
export declare const transactionInfoLocalStorage: AsyncLocalStorage<TransactionInfoStorage>;
|
|
3
|
-
export interface TransactionInfoStorage {
|
|
4
|
-
recordName: string;
|
|
5
|
-
transactionId: string;
|
|
6
|
-
sessionId: string;
|
|
7
|
-
originSession: string;
|
|
8
|
-
serviceStartTime: number;
|
|
9
|
-
requestObject: object;
|
|
10
|
-
responseObject?: object;
|
|
11
|
-
action: string;
|
|
12
|
-
maskingLogData: boolean;
|
|
13
|
-
specificKeyMasking: string[];
|
|
14
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.transactionInfoLocalStorage = void 0;
|
|
4
|
-
const async_hooks_1 = require("async_hooks");
|
|
5
|
-
exports.transactionInfoLocalStorage = new async_hooks_1.AsyncLocalStorage();
|
|
6
|
-
//# sourceMappingURL=tracnsaction-info.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tracnsaction-info.js","sourceRoot":"","sources":["../../../src/common/async-storage/tracnsaction-info.ts"],"names":[],"mappings":";;;AAAA,6CAAgD;AAEnC,QAAA,2BAA2B,GACtC,IAAI,+BAAiB,EAA0B,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export interface CommonOperationStatus {
|
|
2
|
-
resultCode: string;
|
|
3
|
-
httpCode: number;
|
|
4
|
-
resultDescription: string;
|
|
5
|
-
}
|
|
6
|
-
export declare class ErrorInfomation {
|
|
7
|
-
resultCode: string;
|
|
8
|
-
resultDescription: string;
|
|
9
|
-
message: object | string;
|
|
10
|
-
details: string;
|
|
11
|
-
constructor(commonOperationStatus: CommonOperationStatus, message: object | string);
|
|
12
|
-
}
|
|
13
|
-
export interface DetailsFlushService<Req, Res> {
|
|
14
|
-
request?: Req | any;
|
|
15
|
-
response?: Res | any;
|
|
16
|
-
serviceEndTime?: number;
|
|
17
|
-
resultCodeFormat: CommonOperationStatus;
|
|
18
|
-
}
|