@lenne.tech/nest-server 11.42.6 → 11.42.7
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.
- package/.claude/rules/configurable-features.md +1 -0
- package/FRAMEWORK-API.md +1 -1
- package/dist/core/common/helpers/swagger.helper.d.ts +11 -0
- package/dist/core/common/helpers/swagger.helper.js +362 -0
- package/dist/core/common/helpers/swagger.helper.js.map +1 -0
- package/dist/core/common/interfaces/swagger-setup-options.interface.d.ts +33 -0
- package/dist/core/common/interfaces/swagger-setup-options.interface.js +3 -0
- package/dist/core/common/interfaces/swagger-setup-options.interface.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/main.js +8 -14
- package/dist/main.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/migration-guides/11.42.5-to-11.42.6.md +16 -0
- package/migration-guides/11.42.6-to-11.42.7.md +115 -0
- package/package.json +4 -4
- package/src/core/common/helpers/swagger.helper.ts +529 -0
- package/src/core/common/interfaces/swagger-setup-options.interface.ts +131 -0
- package/src/index.ts +2 -0
- package/src/main.ts +9 -15
package/src/main.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { NestFactory } from '@nestjs/core';
|
|
2
2
|
import { NestExpressApplication } from '@nestjs/platform-express';
|
|
3
|
-
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
|
|
4
3
|
import { exec } from 'child_process';
|
|
5
4
|
import compression = require('compression');
|
|
6
5
|
import cookieParser = require('cookie-parser');
|
|
@@ -11,6 +10,7 @@ import { buildCorsConfig, isCookiesEnabled, isCorsDisabled } from './core/common
|
|
|
11
10
|
import { HttpExceptionLogFilter } from './core/common/filters/http-exception-log.filter';
|
|
12
11
|
import { installGracefulShutdown } from './core/common/helpers/graceful-shutdown.helper';
|
|
13
12
|
import { handleFatalBootstrapError, installProcessDiagnostics } from './core/common/helpers/process-diagnostics.helper';
|
|
13
|
+
import { setupSwagger } from './core/common/helpers/swagger.helper';
|
|
14
14
|
import { CorePersistenceModel } from './core/common/models/core-persistence.model';
|
|
15
15
|
import { CoreAuthModel } from './core/modules/auth/core-auth.model';
|
|
16
16
|
import { CoreUserModel } from './core/modules/user/core-user.model';
|
|
@@ -96,21 +96,15 @@ async function bootstrap() {
|
|
|
96
96
|
// to avoid open CORS with credentials). Callers should configure appUrl/baseUrl/allowedOrigins.
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
// Swagger documentation
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
.addBearerAuth()
|
|
105
|
-
.build();
|
|
106
|
-
const documentFactory = () =>
|
|
107
|
-
SwaggerModule.createDocument(server, config, {
|
|
108
|
-
autoTagControllers: true,
|
|
109
|
-
deepScanRoutes: true,
|
|
99
|
+
// Swagger documentation: security, API-token scopes and the tenant header are read from the same
|
|
100
|
+
// decorators the guards read (see setupSwagger), so "Authorize" applies to every route.
|
|
101
|
+
setupSwagger(server, {
|
|
102
|
+
description: 'API lenne.Tech Nest Server',
|
|
103
|
+
documentOptions: {
|
|
110
104
|
extraModels: [CoreUserModel, CoreAuthModel, Auth, User, PersistenceModel, CorePersistenceModel, FilterArgs],
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
|
|
105
|
+
},
|
|
106
|
+
title: 'Nest Server API',
|
|
107
|
+
version: '1.0.0',
|
|
114
108
|
});
|
|
115
109
|
|
|
116
110
|
// Drain the event loop on SIGTERM/SIGINT so the process actually exits.
|