@ngn-net/nestjs-telescope 0.3.14 → 0.3.16

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.
@@ -20,6 +20,13 @@ export interface TelescopeOptions {
20
20
  uiMiddleware?: any[];
21
21
  /** MongoDB URI for Telescope's dedicated connection (default: 'mongodb://localhost:27017/telescope') */
22
22
  mongoUri?: string;
23
+ /**
24
+ * Global prefix of the host NestJS application (e.g. 'api' if you use app.setGlobalPrefix('api')).
25
+ * When set, the dashboard static files will be served at /{globalPrefix}/{path}
26
+ * so the UI and API routes resolve correctly.
27
+ * Default: '' (no global prefix)
28
+ */
29
+ globalPrefix?: string;
23
30
  }
24
31
  export interface TelescopeOptionsFactory {
25
32
  createTelescopeOptions(): Promise<TelescopeOptions> | TelescopeOptions;
@@ -106,9 +106,10 @@ let TelescopeModule = TelescopeModule_1 = class TelescopeModule {
106
106
  if (options.enableDashboard !== false) {
107
107
  const staticPath = (0, path_1.join)(__dirname, '..', 'ui');
108
108
  const routePath = options.path || constants_1.DEFAULT_TELESCOPE_PATH;
109
+ const globalPrefix = options.globalPrefix ? `/${options.globalPrefix}` : '';
109
110
  imports.push(serve_static_1.ServeStaticModule.forRoot({
110
111
  rootPath: staticPath,
111
- serveRoot: `/${routePath}`,
112
+ serveRoot: `${globalPrefix}/${routePath}`,
112
113
  }));
113
114
  }
114
115
  const providers = [
@@ -164,10 +165,11 @@ let TelescopeModule = TelescopeModule_1 = class TelescopeModule {
164
165
  }
165
166
  const staticPath = (0, path_1.join)(__dirname, '..', 'ui');
166
167
  const routePath = telescopeOpts.path || constants_1.DEFAULT_TELESCOPE_PATH;
168
+ const globalPrefix = telescopeOpts.globalPrefix ? `/${telescopeOpts.globalPrefix}` : '';
167
169
  return [
168
170
  {
169
171
  rootPath: staticPath,
170
- serveRoot: `/${routePath}`,
172
+ serveRoot: `${globalPrefix}/${routePath}`,
171
173
  },
172
174
  ];
173
175
  },
@@ -896,7 +896,15 @@
896
896
  const [totalEntries, setTotalEntries] = useState(0);
897
897
  const [perPage, setPerPage] = useState(50);
898
898
 
899
- const prefixPath = window.location.pathname.split('/api')[0].split('/')[1] || 'telescope';
899
+ const prefixPath = (() => {
900
+ const path = window.location.pathname;
901
+ // Detect the telescope base path from the URL
902
+ // e.g. /telescope → 'telescope', /api/telescope → 'api/telescope'
903
+ const segments = path.split('/').filter(Boolean);
904
+ const telescopeIdx = segments.findIndex(s => s === 'telescope');
905
+ if (telescopeIdx === -1) return 'telescope';
906
+ return segments.slice(0, telescopeIdx + 1).join('/');
907
+ })();
900
908
 
901
909
  // Load entries when dependencies change
902
910
  useEffect(() => {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@ngn-net/nestjs-telescope",
3
- "version": "0.3.14",
4
- "builtAt": "2026-06-13T11:29:51.036Z"
3
+ "version": "0.3.16",
4
+ "builtAt": "2026-06-14T13:06:23.738Z"
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngn-net/nestjs-telescope",
3
- "version": "0.3.14",
3
+ "version": "0.3.16",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -21,29 +21,29 @@
21
21
  "prepare": "npm run build"
22
22
  },
23
23
  "dependencies": {
24
- "@nestjs/mongoose": "^11",
25
- "@nestjs/serve-static": "^5.0.5",
24
+ "@nestjs/mongoose": ">=10",
25
+ "@nestjs/serve-static": ">=4",
26
26
  "class-transformer": "^0.5",
27
27
  "class-validator": "^0.14",
28
- "mongoose": "^8",
28
+ "mongoose": ">=7",
29
29
  "passport-jwt": "^4",
30
30
  "reflect-metadata": "^0.2"
31
31
  },
32
32
  "peerDependencies": {
33
- "@golevelup/nestjs-rabbitmq": "^9",
34
- "@nestjs/bullmq": "^11",
35
- "@nestjs/cache-manager": "^3",
36
- "@nestjs/common": "^11",
37
- "@nestjs/core": "^11",
38
- "@nestjs/event-emitter": "^2",
39
- "@nestjs/jwt": "^11",
40
- "@nestjs/passport": "^11",
41
- "@nestjs/schedule": "^4",
42
- "@nestjs/typeorm": "^11",
43
- "bullmq": "^5",
44
- "cache-manager": "^5",
45
- "nodemailer": "^6",
46
- "typeorm": "^0.3"
33
+ "@golevelup/nestjs-rabbitmq": ">=3",
34
+ "@nestjs/bullmq": ">=10",
35
+ "@nestjs/cache-manager": ">=2",
36
+ "@nestjs/common": ">=9",
37
+ "@nestjs/core": ">=9",
38
+ "@nestjs/event-emitter": ">=1",
39
+ "@nestjs/jwt": ">=10",
40
+ "@nestjs/passport": ">=9",
41
+ "@nestjs/schedule": ">=2",
42
+ "@nestjs/typeorm": ">=9",
43
+ "bullmq": ">=5",
44
+ "cache-manager": ">=4",
45
+ "nodemailer": ">=6",
46
+ "typeorm": ">=0.3"
47
47
  },
48
48
  "peerDependenciesMeta": {
49
49
  "@golevelup/nestjs-rabbitmq": {
package/ui/index.html CHANGED
@@ -896,7 +896,15 @@
896
896
  const [totalEntries, setTotalEntries] = useState(0);
897
897
  const [perPage, setPerPage] = useState(50);
898
898
 
899
- const prefixPath = window.location.pathname.split('/api')[0].split('/')[1] || 'telescope';
899
+ const prefixPath = (() => {
900
+ const path = window.location.pathname;
901
+ // Detect the telescope base path from the URL
902
+ // e.g. /telescope → 'telescope', /api/telescope → 'api/telescope'
903
+ const segments = path.split('/').filter(Boolean);
904
+ const telescopeIdx = segments.findIndex(s => s === 'telescope');
905
+ if (telescopeIdx === -1) return 'telescope';
906
+ return segments.slice(0, telescopeIdx + 1).join('/');
907
+ })();
900
908
 
901
909
  // Load entries when dependencies change
902
910
  useEffect(() => {