@ngn-net/nestjs-telescope 0.1.8 → 0.1.10
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)()),
|
package/dist/telescope.module.js
CHANGED
|
@@ -87,15 +87,23 @@ let TelescopeModule = TelescopeModule_1 = class TelescopeModule {
|
|
|
87
87
|
];
|
|
88
88
|
// Always registered watchers (no external peer dependencies needed)
|
|
89
89
|
const watchersToRegister = [
|
|
90
|
-
{ type: entry_type_enum_1.EntryType.REQUEST, watcher: http_request_watcher_1.HttpRequestWatcher },
|
|
90
|
+
{ type: entry_type_enum_1.EntryType.REQUEST, watcher: http_request_watcher_1.HttpRequestWatcher, isInterceptor: true },
|
|
91
91
|
{ type: entry_type_enum_1.EntryType.QUERY, watcher: query_watcher_1.QueryWatcher },
|
|
92
92
|
{ type: entry_type_enum_1.EntryType.LOG, watcher: log_watcher_1.LogWatcher },
|
|
93
|
-
{ type: entry_type_enum_1.EntryType.EXCEPTION, watcher: exception_watcher_1.ExceptionWatcher },
|
|
93
|
+
{ type: entry_type_enum_1.EntryType.EXCEPTION, watcher: exception_watcher_1.ExceptionWatcher, isInterceptor: true },
|
|
94
94
|
{ type: entry_type_enum_1.EntryType.REDIS, watcher: redis_watcher_1.RedisWatcher },
|
|
95
95
|
];
|
|
96
96
|
for (const item of watchersToRegister) {
|
|
97
97
|
if (!options.enabledEntryTypes || options.enabledEntryTypes.includes(item.type)) {
|
|
98
|
-
|
|
98
|
+
if (item.isInterceptor) {
|
|
99
|
+
providers.push({
|
|
100
|
+
provide: core_1.APP_INTERCEPTOR,
|
|
101
|
+
useClass: item.watcher,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
providers.push(item.watcher);
|
|
106
|
+
}
|
|
99
107
|
}
|
|
100
108
|
}
|
|
101
109
|
// Optional dependencies checking:
|