@ngn-net/nestjs-telescope 0.3.15 → 0.3.17
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;
|
package/dist/telescope.module.js
CHANGED
|
@@ -53,6 +53,31 @@ 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({ path, requestMethod: common_1.RequestMethod.ALL });
|
|
67
|
+
}
|
|
68
|
+
if (!hasWildcardExclude) {
|
|
69
|
+
exclude.push({ path: `${path}/(.*)`, requestMethod: common_1.RequestMethod.ALL });
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
...originalOptions,
|
|
73
|
+
exclude,
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
catch (e) {
|
|
79
|
+
common_1.Logger.warn('Telescope was unable to automatically exclude its routes from the global prefix.', e);
|
|
80
|
+
}
|
|
56
81
|
}
|
|
57
82
|
onModuleInit() {
|
|
58
83
|
const hasDependency = (type, packageName) => {
|
package/dist/ui/manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngn-net/nestjs-telescope",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.17",
|
|
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": "
|
|
25
|
-
"@nestjs/serve-static": "
|
|
24
|
+
"@nestjs/mongoose": ">=10",
|
|
25
|
+
"@nestjs/serve-static": ">=4",
|
|
26
26
|
"class-transformer": "^0.5",
|
|
27
27
|
"class-validator": "^0.14",
|
|
28
|
-
"mongoose": "
|
|
28
|
+
"mongoose": ">=7",
|
|
29
29
|
"passport-jwt": "^4",
|
|
30
30
|
"reflect-metadata": "^0.2"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@golevelup/nestjs-rabbitmq": "
|
|
34
|
-
"@nestjs/bullmq": "
|
|
35
|
-
"@nestjs/cache-manager": "
|
|
36
|
-
"@nestjs/common": "
|
|
37
|
-
"@nestjs/core": "
|
|
38
|
-
"@nestjs/event-emitter": "
|
|
39
|
-
"@nestjs/jwt": "
|
|
40
|
-
"@nestjs/passport": "
|
|
41
|
-
"@nestjs/schedule": "
|
|
42
|
-
"@nestjs/typeorm": "
|
|
43
|
-
"bullmq": "
|
|
44
|
-
"cache-manager": "
|
|
45
|
-
"nodemailer": "
|
|
46
|
-
"typeorm": "
|
|
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": {
|
|
@@ -99,4 +99,4 @@
|
|
|
99
99
|
"typeorm": "^0.3",
|
|
100
100
|
"typescript": "^5"
|
|
101
101
|
}
|
|
102
|
-
}
|
|
102
|
+
}
|