@ngn-net/nestjs-telescope 0.3.16 → 0.3.18

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.
@@ -53,6 +53,39 @@ let TelescopeModule = TelescopeModule_1 = class TelescopeModule {
53
53
  this.options = options;
54
54
  const path = this.options.path || constants_1.DEFAULT_TELESCOPE_PATH;
55
55
  Reflect.defineMetadata('path', path, telescope_controller_1.TelescopeController);
56
+ try {
57
+ const appConfig = this.moduleRef.get(core_1.ApplicationConfig, { strict: false });
58
+ if (appConfig) {
59
+ const originalGet = appConfig.getGlobalPrefixOptions.bind(appConfig);
60
+ appConfig.getGlobalPrefixOptions = () => {
61
+ const originalOptions = originalGet() || {};
62
+ const exclude = originalOptions.exclude ? [...originalOptions.exclude] : [];
63
+ const hasBaseExclude = exclude.some((r) => typeof r === 'string' ? r === path : r.path === path);
64
+ const hasWildcardExclude = exclude.some((r) => typeof r === 'string' ? r === `${path}/(.*)` : r.path === `${path}/(.*)`);
65
+ if (!hasBaseExclude) {
66
+ exclude.push({
67
+ path,
68
+ requestMethod: common_1.RequestMethod.ALL,
69
+ pathRegex: new RegExp('^\\/' + path + '\\/?$'),
70
+ });
71
+ }
72
+ if (!hasWildcardExclude) {
73
+ exclude.push({
74
+ path: `${path}/(.*)`,
75
+ requestMethod: common_1.RequestMethod.ALL,
76
+ pathRegex: new RegExp('^\\/' + path + '\\/(.*)'),
77
+ });
78
+ }
79
+ return {
80
+ ...originalOptions,
81
+ exclude,
82
+ };
83
+ };
84
+ }
85
+ }
86
+ catch (e) {
87
+ common_1.Logger.warn('Telescope was unable to automatically exclude its routes from the global prefix.', e);
88
+ }
56
89
  }
57
90
  onModuleInit() {
58
91
  const hasDependency = (type, packageName) => {
@@ -106,10 +139,9 @@ let TelescopeModule = TelescopeModule_1 = class TelescopeModule {
106
139
  if (options.enableDashboard !== false) {
107
140
  const staticPath = (0, path_1.join)(__dirname, '..', 'ui');
108
141
  const routePath = options.path || constants_1.DEFAULT_TELESCOPE_PATH;
109
- const globalPrefix = options.globalPrefix ? `/${options.globalPrefix}` : '';
110
142
  imports.push(serve_static_1.ServeStaticModule.forRoot({
111
143
  rootPath: staticPath,
112
- serveRoot: `${globalPrefix}/${routePath}`,
144
+ serveRoot: `/${routePath}`,
113
145
  }));
114
146
  }
115
147
  const providers = [
@@ -165,11 +197,10 @@ let TelescopeModule = TelescopeModule_1 = class TelescopeModule {
165
197
  }
166
198
  const staticPath = (0, path_1.join)(__dirname, '..', 'ui');
167
199
  const routePath = telescopeOpts.path || constants_1.DEFAULT_TELESCOPE_PATH;
168
- const globalPrefix = telescopeOpts.globalPrefix ? `/${telescopeOpts.globalPrefix}` : '';
169
200
  return [
170
201
  {
171
202
  rootPath: staticPath,
172
- serveRoot: `${globalPrefix}/${routePath}`,
203
+ serveRoot: `/${routePath}`,
173
204
  },
174
205
  ];
175
206
  },
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@ngn-net/nestjs-telescope",
3
- "version": "0.3.16",
4
- "builtAt": "2026-06-14T13:06:23.738Z"
3
+ "version": "0.3.18",
4
+ "builtAt": "2026-06-14T14:40:49.160Z"
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngn-net/nestjs-telescope",
3
- "version": "0.3.16",
3
+ "version": "0.3.18",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -99,4 +99,4 @@
99
99
  "typeorm": "^0.3",
100
100
  "typescript": "^5"
101
101
  }
102
- }
102
+ }