nestjs-profiler 1.0.24 → 1.0.26
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 +167 -5
- package/collectors/event-collector.d.ts +18 -0
- package/collectors/event-collector.js +254 -0
- package/collectors/event-collector.js.map +1 -0
- package/common/profiler-options.interface.d.ts +8 -0
- package/common/profiler.model.d.ts +25 -0
- package/controllers/profiler.controller.d.ts +22 -1
- package/controllers/profiler.controller.js +161 -15
- package/controllers/profiler.controller.js.map +1 -1
- package/middleware/profiler-auth.middleware.d.ts +10 -0
- package/middleware/profiler-auth.middleware.js +110 -0
- package/middleware/profiler-auth.middleware.js.map +1 -0
- package/package.json +2 -2
- package/profiler.module.js +82 -0
- package/profiler.module.js.map +1 -1
- package/services/code-quality.service.d.ts +65 -0
- package/services/code-quality.service.js +216 -0
- package/services/code-quality.service.js.map +1 -0
- package/services/entity-explorer.service.d.ts +1 -1
- package/services/entity-explorer.service.js +7 -7
- package/services/entity-explorer.service.js.map +1 -1
- package/services/health.service.d.ts +59 -0
- package/services/health.service.js +190 -0
- package/services/health.service.js.map +1 -0
- package/services/profiler.service.d.ts +10 -1
- package/services/profiler.service.js +103 -35
- package/services/profiler.service.js.map +1 -1
- package/services/route-explorer.service.d.ts +23 -1
- package/services/route-explorer.service.js +136 -10
- package/services/route-explorer.service.js.map +1 -1
- package/services/template-builder.service.d.ts +3 -0
- package/services/template-builder.service.js +191 -84
- package/services/template-builder.service.js.map +1 -1
- package/services/view.service.d.ts +1 -1
- package/services/view.service.js +34 -23
- package/services/view.service.js.map +1 -1
- package/views/code-quality.html +573 -0
- package/views/events.html +763 -0
- package/views/health.html +468 -0
- package/views/layout.html +50 -10
- package/views/login.html +277 -0
- package/views/routes.html +405 -37
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export interface EslintMessage {
|
|
2
|
+
ruleId: string | null;
|
|
3
|
+
severity: 1 | 2;
|
|
4
|
+
message: string;
|
|
5
|
+
line: number;
|
|
6
|
+
column: number;
|
|
7
|
+
endLine?: number;
|
|
8
|
+
endColumn?: number;
|
|
9
|
+
suggestions?: Array<{
|
|
10
|
+
desc: string;
|
|
11
|
+
}>;
|
|
12
|
+
fixable: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface EslintFileResult {
|
|
15
|
+
filePath: string;
|
|
16
|
+
messages: EslintMessage[];
|
|
17
|
+
errorCount: number;
|
|
18
|
+
warningCount: number;
|
|
19
|
+
fixableErrorCount: number;
|
|
20
|
+
fixableWarningCount: number;
|
|
21
|
+
}
|
|
22
|
+
export interface TscError {
|
|
23
|
+
filePath: string;
|
|
24
|
+
line: number;
|
|
25
|
+
column: number;
|
|
26
|
+
severity: 'error' | 'warning';
|
|
27
|
+
code: string;
|
|
28
|
+
message: string;
|
|
29
|
+
}
|
|
30
|
+
export interface RuleSummary {
|
|
31
|
+
ruleId: string;
|
|
32
|
+
count: number;
|
|
33
|
+
severity: number;
|
|
34
|
+
files: string[];
|
|
35
|
+
}
|
|
36
|
+
export interface CodeQualityReport {
|
|
37
|
+
eslint: {
|
|
38
|
+
available: boolean;
|
|
39
|
+
results: EslintFileResult[];
|
|
40
|
+
totalErrors: number;
|
|
41
|
+
totalWarnings: number;
|
|
42
|
+
totalFixable: number;
|
|
43
|
+
filesAffected: number;
|
|
44
|
+
topRules: RuleSummary[];
|
|
45
|
+
error?: string;
|
|
46
|
+
};
|
|
47
|
+
tsc: {
|
|
48
|
+
available: boolean;
|
|
49
|
+
errors: TscError[];
|
|
50
|
+
totalErrors: number;
|
|
51
|
+
totalWarnings: number;
|
|
52
|
+
error?: string;
|
|
53
|
+
};
|
|
54
|
+
scannedAt: number;
|
|
55
|
+
fromCache?: boolean;
|
|
56
|
+
}
|
|
57
|
+
export declare class CodeQualityService {
|
|
58
|
+
private readonly logger;
|
|
59
|
+
private cachedReport;
|
|
60
|
+
runCheck(force?: boolean): Promise<CodeQualityReport>;
|
|
61
|
+
private runEslint;
|
|
62
|
+
private processEslintResults;
|
|
63
|
+
private runTsc;
|
|
64
|
+
private parseTscOutput;
|
|
65
|
+
}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
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;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
var CodeQualityService_1;
|
|
42
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
+
exports.CodeQualityService = void 0;
|
|
44
|
+
const common_1 = require("@nestjs/common");
|
|
45
|
+
const child_process_1 = require("child_process");
|
|
46
|
+
const util_1 = require("util");
|
|
47
|
+
const path = __importStar(require("path"));
|
|
48
|
+
const fs = __importStar(require("fs"));
|
|
49
|
+
const execAsync = (0, util_1.promisify)(child_process_1.exec);
|
|
50
|
+
const CACHE_TTL_MS = 5 * 60 * 1000;
|
|
51
|
+
let CodeQualityService = CodeQualityService_1 = class CodeQualityService {
|
|
52
|
+
constructor() {
|
|
53
|
+
this.logger = new common_1.Logger(CodeQualityService_1.name);
|
|
54
|
+
this.cachedReport = null;
|
|
55
|
+
}
|
|
56
|
+
async runCheck(force = false) {
|
|
57
|
+
if (!force && this.cachedReport) {
|
|
58
|
+
const age = Date.now() - this.cachedReport.scannedAt;
|
|
59
|
+
if (age < CACHE_TTL_MS) {
|
|
60
|
+
return { ...this.cachedReport, fromCache: true };
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const cwd = process.cwd();
|
|
64
|
+
const [eslintResult, tscResult] = await Promise.all([
|
|
65
|
+
this.runEslint(cwd),
|
|
66
|
+
this.runTsc(cwd),
|
|
67
|
+
]);
|
|
68
|
+
const report = {
|
|
69
|
+
eslint: eslintResult,
|
|
70
|
+
tsc: tscResult,
|
|
71
|
+
scannedAt: Date.now(),
|
|
72
|
+
};
|
|
73
|
+
this.cachedReport = report;
|
|
74
|
+
return report;
|
|
75
|
+
}
|
|
76
|
+
async runEslint(cwd) {
|
|
77
|
+
const localBin = path.join(cwd, 'node_modules', '.bin', 'eslint');
|
|
78
|
+
const bin = fs.existsSync(localBin) ? localBin : 'npx eslint';
|
|
79
|
+
const target = fs.existsSync(path.join(cwd, 'src')) ? 'src' : '.';
|
|
80
|
+
const ignores = ['dist', 'build', 'coverage', '.next', 'out']
|
|
81
|
+
.map(d => `--ignore-pattern '${d}/**'`)
|
|
82
|
+
.join(' ');
|
|
83
|
+
const cmd = `${bin} --format json ${ignores} ${target}`;
|
|
84
|
+
const execOpts = { cwd, timeout: 120_000, maxBuffer: 100 * 1024 * 1024, env: process.env };
|
|
85
|
+
try {
|
|
86
|
+
const { stdout } = await execAsync(cmd, execOpts);
|
|
87
|
+
const results = JSON.parse(stdout);
|
|
88
|
+
return this.processEslintResults(results, cwd);
|
|
89
|
+
}
|
|
90
|
+
catch (e) {
|
|
91
|
+
if (e.stdout) {
|
|
92
|
+
try {
|
|
93
|
+
const results = JSON.parse(e.stdout);
|
|
94
|
+
return this.processEslintResults(results, cwd);
|
|
95
|
+
}
|
|
96
|
+
catch { }
|
|
97
|
+
}
|
|
98
|
+
this.logger.warn(`ESLint failed: ${e.message}`);
|
|
99
|
+
return {
|
|
100
|
+
available: false,
|
|
101
|
+
results: [],
|
|
102
|
+
totalErrors: 0,
|
|
103
|
+
totalWarnings: 0,
|
|
104
|
+
totalFixable: 0,
|
|
105
|
+
filesAffected: 0,
|
|
106
|
+
topRules: [],
|
|
107
|
+
error: e.message,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
processEslintResults(raw, cwd) {
|
|
112
|
+
const results = raw
|
|
113
|
+
.filter(r => r.messages && r.messages.length > 0)
|
|
114
|
+
.map(r => ({
|
|
115
|
+
filePath: path.relative(cwd, r.filePath),
|
|
116
|
+
messages: r.messages.map(m => ({
|
|
117
|
+
ruleId: m.ruleId || null,
|
|
118
|
+
severity: m.severity,
|
|
119
|
+
message: m.message,
|
|
120
|
+
line: m.line,
|
|
121
|
+
column: m.column,
|
|
122
|
+
endLine: m.endLine,
|
|
123
|
+
endColumn: m.endColumn,
|
|
124
|
+
fixable: !!m.fix,
|
|
125
|
+
suggestions: m.suggestions?.map((s) => ({ desc: s.desc })),
|
|
126
|
+
})),
|
|
127
|
+
errorCount: r.errorCount,
|
|
128
|
+
warningCount: r.warningCount,
|
|
129
|
+
fixableErrorCount: r.fixableErrorCount || 0,
|
|
130
|
+
fixableWarningCount: r.fixableWarningCount || 0,
|
|
131
|
+
}));
|
|
132
|
+
const totalErrors = results.reduce((s, r) => s + r.errorCount, 0);
|
|
133
|
+
const totalWarnings = results.reduce((s, r) => s + r.warningCount, 0);
|
|
134
|
+
const totalFixable = results.reduce((s, r) => s + r.fixableErrorCount + r.fixableWarningCount, 0);
|
|
135
|
+
const ruleMap = new Map();
|
|
136
|
+
results.forEach(r => {
|
|
137
|
+
r.messages.forEach(m => {
|
|
138
|
+
if (!m.ruleId)
|
|
139
|
+
return;
|
|
140
|
+
const entry = ruleMap.get(m.ruleId) || { count: 0, severity: m.severity, files: new Set() };
|
|
141
|
+
entry.count++;
|
|
142
|
+
entry.severity = Math.max(entry.severity, m.severity);
|
|
143
|
+
entry.files.add(r.filePath);
|
|
144
|
+
ruleMap.set(m.ruleId, entry);
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
const topRules = Array.from(ruleMap.entries())
|
|
148
|
+
.map(([ruleId, { count, severity, files }]) => ({ ruleId, count, severity, files: Array.from(files) }))
|
|
149
|
+
.sort((a, b) => b.severity - a.severity || b.count - a.count)
|
|
150
|
+
.slice(0, 30);
|
|
151
|
+
return {
|
|
152
|
+
available: true,
|
|
153
|
+
results,
|
|
154
|
+
totalErrors,
|
|
155
|
+
totalWarnings,
|
|
156
|
+
totalFixable,
|
|
157
|
+
filesAffected: results.length,
|
|
158
|
+
topRules,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
async runTsc(cwd) {
|
|
162
|
+
if (!fs.existsSync(path.join(cwd, 'tsconfig.json'))) {
|
|
163
|
+
return { available: false, errors: [], totalErrors: 0, totalWarnings: 0, error: 'No tsconfig.json found' };
|
|
164
|
+
}
|
|
165
|
+
try {
|
|
166
|
+
const localTsc = path.join(cwd, 'node_modules', '.bin', 'tsc');
|
|
167
|
+
const tscBin = fs.existsSync(localTsc) ? localTsc : 'npx tsc';
|
|
168
|
+
const { stdout } = await execAsync(`${tscBin} --noEmit 2>&1 || true`, { cwd, timeout: 120_000, maxBuffer: 100 * 1024 * 1024, env: process.env });
|
|
169
|
+
const errors = this.parseTscOutput(stdout, cwd);
|
|
170
|
+
return {
|
|
171
|
+
available: true,
|
|
172
|
+
errors,
|
|
173
|
+
totalErrors: errors.filter(e => e.severity === 'error').length,
|
|
174
|
+
totalWarnings: errors.filter(e => e.severity === 'warning').length,
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
catch (e) {
|
|
178
|
+
const out = e.stdout || e.stderr || '';
|
|
179
|
+
if (out) {
|
|
180
|
+
const errors = this.parseTscOutput(out, cwd);
|
|
181
|
+
return {
|
|
182
|
+
available: true,
|
|
183
|
+
errors,
|
|
184
|
+
totalErrors: errors.filter(e => e.severity === 'error').length,
|
|
185
|
+
totalWarnings: errors.filter(e => e.severity === 'warning').length,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
return { available: false, errors: [], totalErrors: 0, totalWarnings: 0, error: e.message };
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
parseTscOutput(output, cwd) {
|
|
192
|
+
const errors = [];
|
|
193
|
+
const pattern = /^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+(TS\d+):\s+(.+)$/gm;
|
|
194
|
+
let match;
|
|
195
|
+
while ((match = pattern.exec(output)) !== null) {
|
|
196
|
+
const [, filePath, line, col, severity, code, message] = match;
|
|
197
|
+
try {
|
|
198
|
+
errors.push({
|
|
199
|
+
filePath: path.relative(cwd, path.resolve(cwd, filePath.trim())),
|
|
200
|
+
line: parseInt(line),
|
|
201
|
+
column: parseInt(col),
|
|
202
|
+
severity: severity,
|
|
203
|
+
code,
|
|
204
|
+
message: message.trim(),
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
catch { }
|
|
208
|
+
}
|
|
209
|
+
return errors;
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
exports.CodeQualityService = CodeQualityService;
|
|
213
|
+
exports.CodeQualityService = CodeQualityService = CodeQualityService_1 = __decorate([
|
|
214
|
+
(0, common_1.Injectable)()
|
|
215
|
+
], CodeQualityService);
|
|
216
|
+
//# sourceMappingURL=code-quality.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-quality.service.js","sourceRoot":"","sources":["../../../libs/nestjs-profiler/src/services/code-quality.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,iDAAqC;AACrC,+BAAiC;AACjC,2CAA6B;AAC7B,uCAAyB;AAEzB,MAAM,SAAS,GAAG,IAAA,gBAAS,EAAC,oBAAI,CAAC,CAAC;AAElC,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AA8D5B,IAAM,kBAAkB,0BAAxB,MAAM,kBAAkB;IAAxB;QACc,WAAM,GAAG,IAAI,eAAM,CAAC,oBAAkB,CAAC,IAAI,CAAC,CAAC;QACtD,iBAAY,GAA6B,IAAI,CAAC;IA4K1D,CAAC;IA1KG,KAAK,CAAC,QAAQ,CAAC,KAAK,GAAG,KAAK;QACxB,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YAC9B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC;YACrD,IAAI,GAAG,GAAG,YAAY,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AAG,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC;YAC/D,IAAI,CAAC;gBACD,MAAM,CAAC,IAAI,CAAC;oBACR,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;oBAChE,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;oBACpB,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC;oBACrB,QAAQ,EAAE,QAA+B;oBACzC,IAAI;oBACJ,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE;iBAC1B,CAAC,CAAC;YACP,CAAC;YAAC,MAAM,CAAC,CAA8B,CAAC;QAC5C,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ,CAAA;AA9KY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;GACA,kBAAkB,CA8K9B"}
|
|
@@ -8,13 +8,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
+
var EntityExplorerService_1;
|
|
11
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
13
|
exports.EntityExplorerService = void 0;
|
|
13
14
|
const common_1 = require("@nestjs/common");
|
|
14
|
-
let EntityExplorerService = class EntityExplorerService {
|
|
15
|
-
constructor() {
|
|
16
|
-
this.entities = [];
|
|
17
|
-
}
|
|
15
|
+
let EntityExplorerService = EntityExplorerService_1 = class EntityExplorerService {
|
|
16
|
+
constructor() { }
|
|
18
17
|
initialize(modulesContainer) {
|
|
19
18
|
try {
|
|
20
19
|
this.scan(modulesContainer);
|
|
@@ -24,7 +23,7 @@ let EntityExplorerService = class EntityExplorerService {
|
|
|
24
23
|
}
|
|
25
24
|
}
|
|
26
25
|
getEntities() {
|
|
27
|
-
return
|
|
26
|
+
return EntityExplorerService_1._entities;
|
|
28
27
|
}
|
|
29
28
|
scan(modulesContainer) {
|
|
30
29
|
if (!modulesContainer)
|
|
@@ -49,7 +48,7 @@ let EntityExplorerService = class EntityExplorerService {
|
|
|
49
48
|
const key = `${d.connection}:${d.name}`;
|
|
50
49
|
unique.set(key, d);
|
|
51
50
|
});
|
|
52
|
-
|
|
51
|
+
EntityExplorerService_1._entities = Array.from(unique.values()).sort((a, b) => a.name.localeCompare(b.name));
|
|
53
52
|
}
|
|
54
53
|
isTypeOrmDataSource(instance) {
|
|
55
54
|
return (instance &&
|
|
@@ -104,7 +103,8 @@ let EntityExplorerService = class EntityExplorerService {
|
|
|
104
103
|
}
|
|
105
104
|
};
|
|
106
105
|
exports.EntityExplorerService = EntityExplorerService;
|
|
107
|
-
|
|
106
|
+
EntityExplorerService._entities = [];
|
|
107
|
+
exports.EntityExplorerService = EntityExplorerService = EntityExplorerService_1 = __decorate([
|
|
108
108
|
(0, common_1.Injectable)(),
|
|
109
109
|
__metadata("design:paramtypes", [])
|
|
110
110
|
], EntityExplorerService);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-explorer.service.js","sourceRoot":"","sources":["../../../libs/nestjs-profiler/src/services/entity-explorer.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"entity-explorer.service.js","sourceRoot":"","sources":["../../../libs/nestjs-profiler/src/services/entity-explorer.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAA4C;AAYrC,IAAM,qBAAqB,6BAA3B,MAAM,qBAAqB;IAG9B,gBAAgB,CAAC;IAKjB,UAAU,CAAC,gBAAqB;QAC5B,IAAI,CAAC;YACD,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAChC,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACT,OAAO,CAAC,KAAK,CAAC,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: {
|
|
5
|
+
info: number;
|
|
6
|
+
low: number;
|
|
7
|
+
moderate: number;
|
|
8
|
+
high: number;
|
|
9
|
+
critical: number;
|
|
10
|
+
total: number;
|
|
11
|
+
};
|
|
12
|
+
dependencies: {
|
|
13
|
+
total: number;
|
|
14
|
+
prod: number;
|
|
15
|
+
dev: number;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export interface AuditVulnerability {
|
|
20
|
+
name: string;
|
|
21
|
+
severity: 'info' | 'low' | 'moderate' | 'high' | 'critical';
|
|
22
|
+
isDirect: boolean;
|
|
23
|
+
via: any[];
|
|
24
|
+
effects: string[];
|
|
25
|
+
range: string;
|
|
26
|
+
nodes: string[];
|
|
27
|
+
fixAvailable: boolean | {
|
|
28
|
+
name: string;
|
|
29
|
+
version: string;
|
|
30
|
+
isSemVerMajor: boolean;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export interface OutdatedPackage {
|
|
34
|
+
current: string;
|
|
35
|
+
wanted: string;
|
|
36
|
+
latest: string;
|
|
37
|
+
dependent: string;
|
|
38
|
+
location?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface HealthReport {
|
|
41
|
+
audit: AuditResult | null;
|
|
42
|
+
outdated: Record<string, OutdatedPackage>;
|
|
43
|
+
nodeVersion: string;
|
|
44
|
+
npmVersion: string;
|
|
45
|
+
engines: Record<string, string> | null;
|
|
46
|
+
packageManager: 'npm' | 'yarn' | 'pnpm';
|
|
47
|
+
scannedAt: number;
|
|
48
|
+
error?: string;
|
|
49
|
+
}
|
|
50
|
+
export declare class HealthService {
|
|
51
|
+
private readonly logger;
|
|
52
|
+
private cachedReport;
|
|
53
|
+
runHealthCheck(force?: boolean): Promise<HealthReport>;
|
|
54
|
+
private runAudit;
|
|
55
|
+
private runOutdated;
|
|
56
|
+
private detectPackageManager;
|
|
57
|
+
private getEngines;
|
|
58
|
+
private getNpmVersion;
|
|
59
|
+
}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
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;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
var HealthService_1;
|
|
42
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
+
exports.HealthService = void 0;
|
|
44
|
+
const common_1 = require("@nestjs/common");
|
|
45
|
+
const child_process_1 = require("child_process");
|
|
46
|
+
const util_1 = require("util");
|
|
47
|
+
const path = __importStar(require("path"));
|
|
48
|
+
const fs = __importStar(require("fs"));
|
|
49
|
+
const execAsync = (0, util_1.promisify)(child_process_1.exec);
|
|
50
|
+
const CACHE_TTL_MS = 5 * 60 * 1000;
|
|
51
|
+
let HealthService = HealthService_1 = class HealthService {
|
|
52
|
+
constructor() {
|
|
53
|
+
this.logger = new common_1.Logger(HealthService_1.name);
|
|
54
|
+
this.cachedReport = null;
|
|
55
|
+
}
|
|
56
|
+
async runHealthCheck(force = false) {
|
|
57
|
+
if (!force && this.cachedReport) {
|
|
58
|
+
const age = Date.now() - this.cachedReport.scannedAt;
|
|
59
|
+
if (age < CACHE_TTL_MS) {
|
|
60
|
+
return { ...this.cachedReport, fromCache: true };
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const cwd = process.cwd();
|
|
64
|
+
const packageManager = this.detectPackageManager(cwd);
|
|
65
|
+
const engines = this.getEngines(cwd);
|
|
66
|
+
const npmVersion = await this.getNpmVersion();
|
|
67
|
+
const [auditResult, outdatedResult] = await Promise.all([
|
|
68
|
+
this.runAudit(cwd, packageManager),
|
|
69
|
+
this.runOutdated(cwd, packageManager),
|
|
70
|
+
]);
|
|
71
|
+
const report = {
|
|
72
|
+
audit: auditResult.data,
|
|
73
|
+
outdated: outdatedResult,
|
|
74
|
+
nodeVersion: process.version,
|
|
75
|
+
npmVersion,
|
|
76
|
+
engines,
|
|
77
|
+
packageManager,
|
|
78
|
+
scannedAt: Date.now(),
|
|
79
|
+
error: auditResult.error,
|
|
80
|
+
};
|
|
81
|
+
this.cachedReport = report;
|
|
82
|
+
return report;
|
|
83
|
+
}
|
|
84
|
+
async runAudit(cwd, pm) {
|
|
85
|
+
const cmd = pm === 'yarn'
|
|
86
|
+
? 'yarn audit --json'
|
|
87
|
+
: 'npm audit --json --no-update-notifier --registry https://registry.npmjs.org';
|
|
88
|
+
const execOpts = { cwd, timeout: 60_000, env: process.env };
|
|
89
|
+
try {
|
|
90
|
+
const { stdout } = await execAsync(cmd, execOpts);
|
|
91
|
+
return { data: JSON.parse(stdout) };
|
|
92
|
+
}
|
|
93
|
+
catch (e) {
|
|
94
|
+
if (e.stdout) {
|
|
95
|
+
try {
|
|
96
|
+
return { data: JSON.parse(e.stdout) };
|
|
97
|
+
}
|
|
98
|
+
catch { }
|
|
99
|
+
}
|
|
100
|
+
const raw = [e.stderr, e.stdout, e.message]
|
|
101
|
+
.filter(Boolean)
|
|
102
|
+
.join('\n');
|
|
103
|
+
const clean = raw
|
|
104
|
+
.split('\n')
|
|
105
|
+
.filter(l => {
|
|
106
|
+
if (!l.trim())
|
|
107
|
+
return false;
|
|
108
|
+
if (l.includes('npm error') || l.includes('npm ERR!') || /\bError\b/.test(l))
|
|
109
|
+
return true;
|
|
110
|
+
if (l.includes('NODE_TLS_REJECT_UNAUTHORIZED'))
|
|
111
|
+
return false;
|
|
112
|
+
if (l.includes('Warning:'))
|
|
113
|
+
return false;
|
|
114
|
+
if (l.includes('npm warn'))
|
|
115
|
+
return false;
|
|
116
|
+
if (l.includes('node --trace-warnings'))
|
|
117
|
+
return false;
|
|
118
|
+
if (l.startsWith('Command failed:'))
|
|
119
|
+
return false;
|
|
120
|
+
return true;
|
|
121
|
+
})
|
|
122
|
+
.slice(0, 5)
|
|
123
|
+
.join('\n')
|
|
124
|
+
.trim();
|
|
125
|
+
let hint = '';
|
|
126
|
+
if (raw.includes('403') || raw.includes('blocked') || raw.includes('Forbidden')) {
|
|
127
|
+
hint = 'Registry blocked the audit request. The profiler retries with the public registry automatically — if this persists, check network/proxy settings.';
|
|
128
|
+
}
|
|
129
|
+
else if (raw.includes('ENOTFOUND') || raw.includes('ECONNREFUSED') || raw.includes('ETIMEDOUT')) {
|
|
130
|
+
hint = 'Could not reach the npm registry. Check your network or proxy settings.';
|
|
131
|
+
}
|
|
132
|
+
else if (raw.includes('ELOCKFILECONFLICT') || raw.includes('package-lock')) {
|
|
133
|
+
hint = 'Lock file issue. Try running npm install first.';
|
|
134
|
+
}
|
|
135
|
+
else if (raw.includes('not found') || raw.includes('not recognized')) {
|
|
136
|
+
hint = 'npm not found in PATH.';
|
|
137
|
+
}
|
|
138
|
+
this.logger.warn(`npm audit failed: ${clean || raw.slice(0, 200)}`);
|
|
139
|
+
return { data: null, error: hint || clean || 'npm audit failed' };
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
async runOutdated(cwd, pm) {
|
|
143
|
+
const cmd = pm === 'yarn' ? 'yarn outdated --json' : 'npm outdated --json';
|
|
144
|
+
const execOpts = { cwd, timeout: 30_000, env: process.env };
|
|
145
|
+
try {
|
|
146
|
+
const { stdout } = await execAsync(cmd, execOpts);
|
|
147
|
+
return stdout ? JSON.parse(stdout) : {};
|
|
148
|
+
}
|
|
149
|
+
catch (e) {
|
|
150
|
+
if (e.stdout) {
|
|
151
|
+
try {
|
|
152
|
+
return JSON.parse(e.stdout);
|
|
153
|
+
}
|
|
154
|
+
catch { }
|
|
155
|
+
}
|
|
156
|
+
return {};
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
detectPackageManager(cwd) {
|
|
160
|
+
if (fs.existsSync(path.join(cwd, 'pnpm-lock.yaml')))
|
|
161
|
+
return 'pnpm';
|
|
162
|
+
if (fs.existsSync(path.join(cwd, 'yarn.lock')))
|
|
163
|
+
return 'yarn';
|
|
164
|
+
return 'npm';
|
|
165
|
+
}
|
|
166
|
+
getEngines(cwd) {
|
|
167
|
+
try {
|
|
168
|
+
const pkgPath = path.join(cwd, 'package.json');
|
|
169
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
|
170
|
+
return pkg.engines || null;
|
|
171
|
+
}
|
|
172
|
+
catch {
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
async getNpmVersion() {
|
|
177
|
+
try {
|
|
178
|
+
const { stdout } = await execAsync('npm --version', { timeout: 5_000 });
|
|
179
|
+
return stdout.trim();
|
|
180
|
+
}
|
|
181
|
+
catch {
|
|
182
|
+
return 'unknown';
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
exports.HealthService = HealthService;
|
|
187
|
+
exports.HealthService = HealthService = HealthService_1 = __decorate([
|
|
188
|
+
(0, common_1.Injectable)()
|
|
189
|
+
], HealthService);
|
|
190
|
+
//# sourceMappingURL=health.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.service.js","sourceRoot":"","sources":["../../../libs/nestjs-profiler/src/services/health.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,iDAAqC;AACrC,+BAAiC;AACjC,2CAA6B;AAC7B,uCAAyB;AAEzB,MAAM,SAAS,GAAG,IAAA,gBAAS,EAAC,oBAAI,CAAC,CAAC;AAoDlC,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAG5B,IAAM,aAAa,qBAAnB,MAAM,aAAa;IAAnB;QACc,WAAM,GAAG,IAAI,eAAM,CAAC,eAAa,CAAC,IAAI,CAAC,CAAC;QACjD,iBAAY,GAAwB,IAAI,CAAC;IAgJrD,CAAC;IA9IG,KAAK,CAAC,cAAc,CAAC,KAAK,GAAG,KAAK;QAE9B,IAAI,CAAC,KAAK,IAAI,I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GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;YAC1D,OAAO,GAAG,CAAC,OAAO,IAAI,IAAI,CAAC;QAC/B,CAAC;QAAC,MAAM,CAAC;YACL,OAAO,IAAI,CAAC;QAChB,CAAC;IACL,CAAC;IAEO,KAAK,CAAC,aAAa;QACvB,IAAI,CAAC;YACD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,SAAS,CAAC,eAAe,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;YACxE,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;QACzB,CAAC;QAAC,MAAM,CAAC;YACL,OAAO,SAAS,CAAC;QACrB,CAAC;IACL,CAAC;CACJ,CAAA;AAlJY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;GACA,aAAa,CAkJzB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from 'events';
|
|
2
|
-
import { RequestProfile, QueryProfile, LogProfile, HttpCallProfile } from '../common/profiler.model';
|
|
2
|
+
import { RequestProfile, QueryProfile, LogProfile, HttpCallProfile, EventProfile, EventListenerTrace } from '../common/profiler.model';
|
|
3
3
|
import type { ProfilerOptions } from '../common/profiler-options.interface';
|
|
4
4
|
import type { ProfilerStorage } from '../storage/profiler-storage.interface';
|
|
5
5
|
export declare class ProfilerService {
|
|
@@ -8,6 +8,8 @@ export declare class ProfilerService {
|
|
|
8
8
|
private readonly als;
|
|
9
9
|
private readonly logger;
|
|
10
10
|
readonly logEmitter: EventEmitter<[never]>;
|
|
11
|
+
private readonly eventMap;
|
|
12
|
+
private readonly eventOrder;
|
|
11
13
|
constructor(options: ProfilerOptions, storage: ProfilerStorage);
|
|
12
14
|
isEnabled(): boolean;
|
|
13
15
|
startRequest(): RequestProfile | null;
|
|
@@ -70,4 +72,11 @@ export declare class ProfilerService {
|
|
|
70
72
|
}>;
|
|
71
73
|
getHttpCallsList(): Promise<any[]>;
|
|
72
74
|
getCacheList(): Promise<any[]>;
|
|
75
|
+
addEvent(event: EventProfile): void;
|
|
76
|
+
finalizeEvent(id: string, status: 'success' | 'error', error?: string): void;
|
|
77
|
+
addListenerTrace(eventId: string | undefined, trace: EventListenerTrace): void;
|
|
78
|
+
linkChildEvent(parentId: string, childId: string): void;
|
|
79
|
+
getCurrentRequestId(): string | undefined;
|
|
80
|
+
getEventsList(): EventProfile[];
|
|
81
|
+
getRootEvents(): EventProfile[];
|
|
73
82
|
}
|