@ngn-net/nestjs-telescope 0.1.7 → 0.1.9
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.
|
@@ -16,5 +16,6 @@ export declare class TelescopeController {
|
|
|
16
16
|
clearEntries(): Promise<{
|
|
17
17
|
success: boolean;
|
|
18
18
|
}>;
|
|
19
|
+
serveDashboard(req: Request, res: Response): void | Response<any, Record<string, any>>;
|
|
19
20
|
serveStatic(req: Request, res: Response): void | Response<any, Record<string, any>>;
|
|
20
21
|
}
|
|
@@ -65,6 +65,10 @@ let TelescopeController = class TelescopeController {
|
|
|
65
65
|
await this.repo.clearAll();
|
|
66
66
|
return { success: true };
|
|
67
67
|
}
|
|
68
|
+
// Serve the dashboard on the base path without trailing slash
|
|
69
|
+
serveDashboard(req, res) {
|
|
70
|
+
return this.serveStatic(req, res);
|
|
71
|
+
}
|
|
68
72
|
// Fallback wildcard to serve static assets and UI dashboard
|
|
69
73
|
serveStatic(req, res) {
|
|
70
74
|
const rawPath = req.path;
|
|
@@ -138,6 +142,14 @@ __decorate([
|
|
|
138
142
|
__metadata("design:paramtypes", []),
|
|
139
143
|
__metadata("design:returntype", Promise)
|
|
140
144
|
], TelescopeController.prototype, "clearEntries", null);
|
|
145
|
+
__decorate([
|
|
146
|
+
(0, common_1.Get)(),
|
|
147
|
+
__param(0, (0, common_1.Req)()),
|
|
148
|
+
__param(1, (0, common_1.Res)()),
|
|
149
|
+
__metadata("design:type", Function),
|
|
150
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
151
|
+
__metadata("design:returntype", void 0)
|
|
152
|
+
], TelescopeController.prototype, "serveDashboard", null);
|
|
141
153
|
__decorate([
|
|
142
154
|
(0, common_1.Get)('*'),
|
|
143
155
|
__param(0, (0, common_1.Req)()),
|
|
@@ -94,6 +94,10 @@ let TelescopeService = class TelescopeService {
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
+
catch (err) {
|
|
98
|
+
// Gracefully catch all database/metadata errors to protect host app stability.
|
|
99
|
+
// Avoid using console.log here as it might trigger infinite recursion in LogWatcher.
|
|
100
|
+
}
|
|
97
101
|
finally {
|
|
98
102
|
this.recording = false;
|
|
99
103
|
}
|