@flusys/nestjs-core 7.0.2 → 8.0.0-beta.1
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/README.md +2 -2
- package/config/index.d.ts +1 -1
- package/constants/index.d.ts +1 -1
- package/docs/docs.config.d.ts +1 -1
- package/docs/index.d.ts +1 -1
- package/fesm/229.js +729 -0
- package/fesm/config/index.js +126 -1
- package/fesm/constants/index.js +29 -1
- package/fesm/docs/index.js +288 -1
- package/fesm/index.js +124 -5
- package/fesm/interfaces/index.js +18 -4
- package/fesm/migration/cli.js +19 -2
- package/fesm/migration/index.js +45 -3
- package/fesm/runtime.js +85 -0
- package/fesm/utils/index.js +131 -1
- package/index.d.ts +5 -5
- package/interfaces/app-config.interfaces.d.ts +2 -1
- package/interfaces/database.interface.d.ts +1 -0
- package/interfaces/index.d.ts +4 -4
- package/interfaces/migration.interface.d.ts +2 -2
- package/migration/cli.d.ts +0 -1
- package/migration/datasource.factory.d.ts +1 -1
- package/migration/index.d.ts +3 -3
- package/migration/migration.cli.d.ts +1 -1
- package/migration/migration.runner.d.ts +1 -1
- package/package.json +25 -33
- package/utils/datasource-config.builder.d.ts +2 -2
- package/utils/index.d.ts +1 -1
- package/cjs/config/env-config.service.js +0 -162
- package/cjs/config/env-config.service.spec.js +0 -325
- package/cjs/config/index.js +0 -18
- package/cjs/constants/database.constants.js +0 -20
- package/cjs/constants/index.js +0 -18
- package/cjs/docs/docs.config.js +0 -276
- package/cjs/docs/docs.config.spec.js +0 -923
- package/cjs/docs/index.js +0 -18
- package/cjs/index.js +0 -23
- package/cjs/interfaces/app-config.interfaces.js +0 -4
- package/cjs/interfaces/base-entity.interface.js +0 -9
- package/cjs/interfaces/database.interface.js +0 -4
- package/cjs/interfaces/index.js +0 -21
- package/cjs/interfaces/migration.interface.js +0 -4
- package/cjs/migration/cli.js +0 -10
- package/cjs/migration/datasource.factory.js +0 -43
- package/cjs/migration/datasource.factory.spec.js +0 -113
- package/cjs/migration/index.js +0 -45
- package/cjs/migration/migration.cli.js +0 -231
- package/cjs/migration/migration.cli.spec.js +0 -293
- package/cjs/migration/migration.runner.js +0 -276
- package/cjs/migration/migration.runner.spec.js +0 -268
- package/cjs/utils/datasource-config.builder.js +0 -103
- package/cjs/utils/datasource-config.builder.spec.js +0 -232
- package/cjs/utils/index.js +0 -18
- package/fesm/config/env-config.service.js +0 -112
- package/fesm/config/env-config.service.spec.js +0 -321
- package/fesm/constants/database.constants.js +0 -2
- package/fesm/docs/docs.config.js +0 -258
- package/fesm/docs/docs.config.spec.js +0 -919
- package/fesm/interfaces/app-config.interfaces.js +0 -1
- package/fesm/interfaces/base-entity.interface.js +0 -6
- package/fesm/interfaces/database.interface.js +0 -1
- package/fesm/interfaces/migration.interface.js +0 -1
- package/fesm/migration/datasource.factory.js +0 -25
- package/fesm/migration/datasource.factory.spec.js +0 -109
- package/fesm/migration/migration.cli.js +0 -180
- package/fesm/migration/migration.cli.spec.js +0 -289
- package/fesm/migration/migration.runner.js +0 -202
- package/fesm/migration/migration.runner.spec.js +0 -264
- package/fesm/utils/datasource-config.builder.js +0 -84
- package/fesm/utils/datasource-config.builder.spec.js +0 -228
package/fesm/config/index.js
CHANGED
|
@@ -1 +1,126 @@
|
|
|
1
|
-
|
|
1
|
+
import * as __rspack_external_dotenv from "dotenv";
|
|
2
|
+
export const __rspack_esm_id = 565;
|
|
3
|
+
export const __rspack_esm_ids = [565];
|
|
4
|
+
export const __webpack_modules__ = {
|
|
5
|
+
892(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
6
|
+
|
|
7
|
+
// EXPORTS
|
|
8
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
9
|
+
K: () => (/* reexport */ envConfig)
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
;// CONCATENATED MODULE: external "dotenv"
|
|
13
|
+
|
|
14
|
+
;// CONCATENATED MODULE: ./projects/nestjs-core/src/config/env-config.service.ts
|
|
15
|
+
|
|
16
|
+
__rspack_external_dotenv.config();
|
|
17
|
+
let EnvConfigService = class EnvConfigService {
|
|
18
|
+
env;
|
|
19
|
+
restrictedKeys = {
|
|
20
|
+
FRONTEND_URL: 'getFrontendUrl',
|
|
21
|
+
ALLOW_ORIGINS: 'getOrigins',
|
|
22
|
+
PORT: 'getPort',
|
|
23
|
+
MODE: 'isProduction',
|
|
24
|
+
DB_TYPE: 'getTypeOrmConfig',
|
|
25
|
+
DB_HOST: 'getTypeOrmConfig',
|
|
26
|
+
DB_PORT: 'getTypeOrmConfig',
|
|
27
|
+
DB_USER: 'getTypeOrmConfig',
|
|
28
|
+
DB_PASSWORD: 'getTypeOrmConfig',
|
|
29
|
+
DB_NAME: 'getTypeOrmConfig'
|
|
30
|
+
};
|
|
31
|
+
constructor(env){
|
|
32
|
+
this.env = env;
|
|
33
|
+
}
|
|
34
|
+
getValue(key, throwOnMissing = true) {
|
|
35
|
+
const value = this.env[key];
|
|
36
|
+
if (!value && throwOnMissing) {
|
|
37
|
+
throw new Error(`Config error - missing env.${key}`);
|
|
38
|
+
}
|
|
39
|
+
return value ?? '';
|
|
40
|
+
}
|
|
41
|
+
tryGetValue(key, throwOnMissing = false) {
|
|
42
|
+
if (this.restrictedKeys[key]) {
|
|
43
|
+
throw new Error(`Access denied for env key "${key}". Use the method \`${this.restrictedKeys[key]}()\` instead.`);
|
|
44
|
+
}
|
|
45
|
+
return this.getValue(key, throwOnMissing);
|
|
46
|
+
}
|
|
47
|
+
getNumber(key, throwOnMissing = true) {
|
|
48
|
+
return Number(this.getValue(key, throwOnMissing));
|
|
49
|
+
}
|
|
50
|
+
getBoolean(key, throwOnMissing = true) {
|
|
51
|
+
return this.getValue(key, throwOnMissing).toLowerCase() === 'true';
|
|
52
|
+
}
|
|
53
|
+
getPort() {
|
|
54
|
+
return this.getNumber('PORT', false) || 3000;
|
|
55
|
+
}
|
|
56
|
+
isProduction() {
|
|
57
|
+
return this.getValue('MODE', false).toUpperCase() !== 'DEV';
|
|
58
|
+
}
|
|
59
|
+
getOrigins() {
|
|
60
|
+
const origins = this.getValue('ALLOW_ORIGINS');
|
|
61
|
+
return origins ? origins.split(',').map((o)=>o.trim()) : [];
|
|
62
|
+
}
|
|
63
|
+
getTypeOrmConfig() {
|
|
64
|
+
const type = this.getValue('DB_TYPE', false) || 'mysql';
|
|
65
|
+
const defaultPort = type === 'postgres' ? 5432 : 3306;
|
|
66
|
+
return {
|
|
67
|
+
type,
|
|
68
|
+
host: this.getValue('DB_HOST', false) || 'localhost',
|
|
69
|
+
port: this.getNumber('DB_PORT', false) || defaultPort,
|
|
70
|
+
username: this.getValue('DB_USER', false) || 'root',
|
|
71
|
+
password: this.getValue('DB_PASSWORD', false) || '',
|
|
72
|
+
database: this.getValue('DB_NAME', false) || 'flusys_main'
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
getJwtConfig() {
|
|
76
|
+
return {
|
|
77
|
+
secret: this.getValue('JWT_SECRET'),
|
|
78
|
+
expiration: this.getValue('JWT_EXPIRATION', false) || '1h',
|
|
79
|
+
refreshSecret: this.getValue('REFRESH_TOKEN_SECRET'),
|
|
80
|
+
refreshExpiration: this.getValue('REFRESH_TOKEN_EXPIRATION', false) || '7d'
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
getRedisUrl() {
|
|
84
|
+
return this.getValue('REDIS_URL', false) || 'redis://localhost:6379';
|
|
85
|
+
}
|
|
86
|
+
getMailConfig() {
|
|
87
|
+
return {
|
|
88
|
+
MAIL_FROM: this.getValue('MAIL_FROM', false) || '',
|
|
89
|
+
MAIL_APP_PASSWORD: this.getValue('MAIL_APP_PASSWORD', false) || ''
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
getTenantId() {
|
|
93
|
+
return this.getValue('TENANT_ID', false) || null;
|
|
94
|
+
}
|
|
95
|
+
useTenantMode() {
|
|
96
|
+
return this.getValue('USE_TENANT_MODE', false).toLowerCase() === 'true';
|
|
97
|
+
}
|
|
98
|
+
getLogConfig() {
|
|
99
|
+
return {
|
|
100
|
+
dir: this.getValue('LOG_DIR', false) || 'logs',
|
|
101
|
+
level: this.getValue('LOG_LEVEL', false) || (this.isProduction() ? 'info' : 'debug'),
|
|
102
|
+
maxSize: this.getValue('LOG_MAX_SIZE', false) || '20m',
|
|
103
|
+
maxFiles: this.getValue('LOG_MAX_FILES', false) || '14d',
|
|
104
|
+
disableHttpLogging: this.getValue('DISABLE_HTTP_LOGGING', false).toLowerCase() === 'true'
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
getEnv() {
|
|
108
|
+
return process.env;
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
const envConfig = new EnvConfigService(process.env);
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
;// CONCATENATED MODULE: ./projects/nestjs-core/src/config/index.ts
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
},
|
|
119
|
+
|
|
120
|
+
};
|
|
121
|
+
import { __webpack_require__ } from '../runtime.js';
|
|
122
|
+
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
|
|
123
|
+
import * as __rspack_chunk_1 from './index.js';
|
|
124
|
+
__webpack_require__.C(__rspack_chunk_1);
|
|
125
|
+
var __webpack_exports__ = __webpack_exec__(892);var __webpack_exports__envConfig = __webpack_exports__.K;
|
|
126
|
+
export { __webpack_exports__envConfig as envConfig };
|
package/fesm/constants/index.js
CHANGED
|
@@ -1 +1,29 @@
|
|
|
1
|
-
export
|
|
1
|
+
export const __rspack_esm_id = 268;
|
|
2
|
+
export const __rspack_esm_ids = [268];
|
|
3
|
+
export const __webpack_modules__ = {
|
|
4
|
+
474(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
5
|
+
|
|
6
|
+
// EXPORTS
|
|
7
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
8
|
+
l: () => (/* reexport */ DEFAULT_TENANT_HEADER),
|
|
9
|
+
g: () => (/* reexport */ MODULE_OPTIONS)
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
;// CONCATENATED MODULE: ./projects/nestjs-core/src/constants/database.constants.ts
|
|
13
|
+
const MODULE_OPTIONS = Symbol('MODULE_OPTIONS');
|
|
14
|
+
const DEFAULT_TENANT_HEADER = 'x-tenant-id';
|
|
15
|
+
|
|
16
|
+
;// CONCATENATED MODULE: ./projects/nestjs-core/src/constants/index.ts
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
};
|
|
23
|
+
import { __webpack_require__ } from '../runtime.js';
|
|
24
|
+
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
|
|
25
|
+
import * as __rspack_chunk_1 from './index.js';
|
|
26
|
+
__webpack_require__.C(__rspack_chunk_1);
|
|
27
|
+
var __webpack_exports__ = __webpack_exec__(474);var __webpack_exports__DEFAULT_TENANT_HEADER = __webpack_exports__.l;
|
|
28
|
+
var __webpack_exports__MODULE_OPTIONS = __webpack_exports__.g;
|
|
29
|
+
export { __webpack_exports__DEFAULT_TENANT_HEADER as DEFAULT_TENANT_HEADER, __webpack_exports__MODULE_OPTIONS as MODULE_OPTIONS };
|
package/fesm/docs/index.js
CHANGED
|
@@ -1 +1,288 @@
|
|
|
1
|
-
|
|
1
|
+
import { DocumentBuilder, SwaggerModule } from "@nestjs/swagger";
|
|
2
|
+
export const __rspack_esm_id = 428;
|
|
3
|
+
export const __rspack_esm_ids = [428];
|
|
4
|
+
export const __webpack_modules__ = {
|
|
5
|
+
21(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
6
|
+
|
|
7
|
+
// EXPORTS
|
|
8
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
9
|
+
T: () => (/* reexport */ setupModuleSwaggerDocs),
|
|
10
|
+
P: () => (/* reexport */ setupSwaggerDocs)
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
;// CONCATENATED MODULE: external "@nestjs/swagger"
|
|
14
|
+
|
|
15
|
+
;// CONCATENATED MODULE: ./projects/nestjs-core/src/docs/docs.config.ts
|
|
16
|
+
|
|
17
|
+
function filterSchemaProperties(document, exclusions) {
|
|
18
|
+
if (!exclusions?.length || !document.components?.schemas) {
|
|
19
|
+
return document;
|
|
20
|
+
}
|
|
21
|
+
const schemas = {
|
|
22
|
+
...document.components.schemas
|
|
23
|
+
};
|
|
24
|
+
for (const exclusion of exclusions){
|
|
25
|
+
const schema = schemas[exclusion.schemaName];
|
|
26
|
+
if (schema && typeof schema === 'object' && 'properties' in schema) {
|
|
27
|
+
const filteredProperties = {
|
|
28
|
+
...schema.properties
|
|
29
|
+
};
|
|
30
|
+
for (const prop of exclusion.properties){
|
|
31
|
+
delete filteredProperties[prop];
|
|
32
|
+
}
|
|
33
|
+
// Also remove from required array if present
|
|
34
|
+
const filteredRequired = schema.required?.filter((r)=>!exclusion.properties.includes(r));
|
|
35
|
+
schemas[exclusion.schemaName] = {
|
|
36
|
+
...schema,
|
|
37
|
+
properties: filteredProperties,
|
|
38
|
+
...filteredRequired?.length ? {
|
|
39
|
+
required: filteredRequired
|
|
40
|
+
} : {}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
...document,
|
|
46
|
+
components: {
|
|
47
|
+
...document.components,
|
|
48
|
+
schemas
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function filterQueryParameters(document, exclusions) {
|
|
53
|
+
if (!exclusions?.length || !document.paths) {
|
|
54
|
+
return document;
|
|
55
|
+
}
|
|
56
|
+
const filteredPaths = {};
|
|
57
|
+
for (const [path, pathItem] of Object.entries(document.paths)){
|
|
58
|
+
const filteredPathItem = {};
|
|
59
|
+
for (const [method, operation] of Object.entries(pathItem)){
|
|
60
|
+
// Skip non-operation properties
|
|
61
|
+
if (!operation || typeof operation !== 'object') {
|
|
62
|
+
filteredPathItem[method] = operation;
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
// Check if this endpoint matches any exclusion pattern
|
|
66
|
+
const matchingExclusions = exclusions.filter((exclusion)=>{
|
|
67
|
+
const pathMatches = pathMatchesPattern(path, exclusion.pathPattern);
|
|
68
|
+
const methodMatches = !exclusion.method || exclusion.method === method;
|
|
69
|
+
return pathMatches && methodMatches;
|
|
70
|
+
});
|
|
71
|
+
if (matchingExclusions.length > 0) {
|
|
72
|
+
// Collect all parameters to exclude
|
|
73
|
+
const paramsToExclude = new Set();
|
|
74
|
+
matchingExclusions.forEach((exclusion)=>{
|
|
75
|
+
exclusion.parameters.forEach((param)=>paramsToExclude.add(param));
|
|
76
|
+
});
|
|
77
|
+
// Filter out excluded query parameters
|
|
78
|
+
const filteredOperation = {
|
|
79
|
+
...operation
|
|
80
|
+
};
|
|
81
|
+
if (Array.isArray(filteredOperation.parameters)) {
|
|
82
|
+
filteredOperation.parameters = filteredOperation.parameters.filter((param)=>{
|
|
83
|
+
return !(param.in === 'query' && paramsToExclude.has(param.name));
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
filteredPathItem[method] = filteredOperation;
|
|
87
|
+
} else {
|
|
88
|
+
filteredPathItem[method] = operation;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
filteredPaths[path] = filteredPathItem;
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
...document,
|
|
95
|
+
paths: filteredPaths
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function filterExamples(document, exclusions) {
|
|
99
|
+
if (!exclusions?.length || !document.paths) {
|
|
100
|
+
return document;
|
|
101
|
+
}
|
|
102
|
+
const filteredPaths = {};
|
|
103
|
+
for (const [path, pathItem] of Object.entries(document.paths)){
|
|
104
|
+
const filteredPathItem = {};
|
|
105
|
+
for (const [method, operation] of Object.entries(pathItem)){
|
|
106
|
+
// Skip non-operation properties
|
|
107
|
+
if (!operation || typeof operation !== 'object') {
|
|
108
|
+
filteredPathItem[method] = operation;
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
// Check if this endpoint matches any exclusion pattern
|
|
112
|
+
const matchingExclusions = exclusions.filter((exclusion)=>{
|
|
113
|
+
const pathMatches = pathMatchesPattern(path, exclusion.pathPattern);
|
|
114
|
+
const methodMatches = !exclusion.method || exclusion.method === method;
|
|
115
|
+
return pathMatches && methodMatches;
|
|
116
|
+
});
|
|
117
|
+
if (matchingExclusions.length > 0) {
|
|
118
|
+
// Collect all examples to exclude
|
|
119
|
+
const examplesToExclude = new Set();
|
|
120
|
+
matchingExclusions.forEach((exclusion)=>{
|
|
121
|
+
exclusion.examples.forEach((example)=>examplesToExclude.add(example));
|
|
122
|
+
});
|
|
123
|
+
// Deep clone the operation to avoid mutating original
|
|
124
|
+
const filteredOperation = JSON.parse(JSON.stringify(operation));
|
|
125
|
+
// Filter examples from responses
|
|
126
|
+
if (filteredOperation.responses) {
|
|
127
|
+
for (const [statusCode, response] of Object.entries(filteredOperation.responses)){
|
|
128
|
+
const responseObj = response;
|
|
129
|
+
if (responseObj?.content) {
|
|
130
|
+
const content = responseObj.content;
|
|
131
|
+
for (const [mediaType, mediaTypeObj] of Object.entries(content)){
|
|
132
|
+
const media = mediaTypeObj;
|
|
133
|
+
if (media?.examples && typeof media.examples === 'object') {
|
|
134
|
+
const examples = media.examples;
|
|
135
|
+
for (const exampleName of examplesToExclude){
|
|
136
|
+
delete examples[exampleName];
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
filteredPathItem[method] = filteredOperation;
|
|
144
|
+
} else {
|
|
145
|
+
filteredPathItem[method] = operation;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
filteredPaths[path] = filteredPathItem;
|
|
149
|
+
}
|
|
150
|
+
return {
|
|
151
|
+
...document,
|
|
152
|
+
paths: filteredPaths
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
function pathMatchesPattern(path, pattern) {
|
|
156
|
+
// Convert wildcard pattern to regex
|
|
157
|
+
const regexPattern = pattern.replace(/\*/g, '[^/]+') // * matches any characters except /
|
|
158
|
+
.replace(/\*\*/g, '.*'); // ** matches any characters including /
|
|
159
|
+
const regex = new RegExp(`^${regexPattern}$`);
|
|
160
|
+
return regex.test(path);
|
|
161
|
+
}
|
|
162
|
+
function filterPaths(document, excludePaths) {
|
|
163
|
+
if (!excludePaths?.length || !document.paths) {
|
|
164
|
+
return document;
|
|
165
|
+
}
|
|
166
|
+
const filteredPaths = {};
|
|
167
|
+
for (const [path, pathItem] of Object.entries(document.paths)){
|
|
168
|
+
const isExcluded = excludePaths.some((pattern)=>pathMatchesPattern(path, pattern));
|
|
169
|
+
if (!isExcluded) {
|
|
170
|
+
filteredPaths[path] = pathItem;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return {
|
|
174
|
+
...document,
|
|
175
|
+
paths: filteredPaths
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
function filterDocumentByTags(document, excludeTags) {
|
|
179
|
+
if (!excludeTags?.length) {
|
|
180
|
+
return document;
|
|
181
|
+
}
|
|
182
|
+
const excludeTagsSet = new Set(excludeTags.map((tag)=>tag.toLowerCase()));
|
|
183
|
+
// Filter out paths that have any of the excluded tags
|
|
184
|
+
const filteredPaths = {};
|
|
185
|
+
for (const [path, pathItem] of Object.entries(document.paths)){
|
|
186
|
+
const filteredPathItem = {};
|
|
187
|
+
for (const [method, operation] of Object.entries(pathItem)){
|
|
188
|
+
// Skip non-operation properties like 'parameters'
|
|
189
|
+
if (!operation || typeof operation !== 'object' || !('tags' in operation)) {
|
|
190
|
+
filteredPathItem[method] = operation;
|
|
191
|
+
continue;
|
|
192
|
+
}
|
|
193
|
+
const operationTags = operation.tags || [];
|
|
194
|
+
const hasExcludedTag = operationTags.some((tag)=>excludeTagsSet.has(tag.toLowerCase()));
|
|
195
|
+
if (!hasExcludedTag) {
|
|
196
|
+
filteredPathItem[method] = operation;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
// Only include path if it has at least one operation
|
|
200
|
+
const hasOperations = Object.keys(filteredPathItem).some((key)=>[
|
|
201
|
+
'get',
|
|
202
|
+
'post',
|
|
203
|
+
'put',
|
|
204
|
+
'patch',
|
|
205
|
+
'delete',
|
|
206
|
+
'options',
|
|
207
|
+
'head'
|
|
208
|
+
].includes(key));
|
|
209
|
+
if (hasOperations) {
|
|
210
|
+
filteredPaths[path] = filteredPathItem;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
// Filter out excluded tags from the tags array
|
|
214
|
+
const filteredTags = document.tags?.filter((tag)=>!excludeTagsSet.has(tag.name.toLowerCase()));
|
|
215
|
+
return {
|
|
216
|
+
...document,
|
|
217
|
+
paths: filteredPaths,
|
|
218
|
+
tags: filteredTags
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
function setupModuleSwaggerDocs(app, configs) {
|
|
222
|
+
configs.forEach((config)=>{
|
|
223
|
+
const builder = new DocumentBuilder().setTitle(config.title).setDescription(config.description).setVersion(config.version || '1.0');
|
|
224
|
+
// Add bearer auth
|
|
225
|
+
if (config.bearerAuth) {
|
|
226
|
+
builder.addBearerAuth();
|
|
227
|
+
}
|
|
228
|
+
// Add custom global headers
|
|
229
|
+
if (config.globalHeaders?.length) {
|
|
230
|
+
config.globalHeaders.forEach((header)=>{
|
|
231
|
+
builder.addGlobalParameters({
|
|
232
|
+
name: header.name,
|
|
233
|
+
in: 'header',
|
|
234
|
+
description: header.description,
|
|
235
|
+
required: header.required ?? false,
|
|
236
|
+
schema: {
|
|
237
|
+
type: 'string',
|
|
238
|
+
example: header.example || ''
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
// Only filter by modules if specified
|
|
244
|
+
const createDocOptions = config.modules?.length ? {
|
|
245
|
+
include: config.modules
|
|
246
|
+
} : {};
|
|
247
|
+
let document = SwaggerModule.createDocument(app, builder.build(), createDocOptions);
|
|
248
|
+
// Filter out excluded paths
|
|
249
|
+
if (config.excludePaths?.length) {
|
|
250
|
+
document = filterPaths(document, config.excludePaths);
|
|
251
|
+
}
|
|
252
|
+
// Filter out excluded tags
|
|
253
|
+
if (config.excludeTags?.length) {
|
|
254
|
+
document = filterDocumentByTags(document, config.excludeTags);
|
|
255
|
+
}
|
|
256
|
+
// Filter out excluded schema properties
|
|
257
|
+
if (config.excludeSchemaProperties?.length) {
|
|
258
|
+
document = filterSchemaProperties(document, config.excludeSchemaProperties);
|
|
259
|
+
}
|
|
260
|
+
// Filter out excluded query parameters
|
|
261
|
+
if (config.excludeQueryParameters?.length) {
|
|
262
|
+
document = filterQueryParameters(document, config.excludeQueryParameters);
|
|
263
|
+
}
|
|
264
|
+
// Filter out excluded examples
|
|
265
|
+
if (config.excludeExamples?.length) {
|
|
266
|
+
document = filterExamples(document, config.excludeExamples);
|
|
267
|
+
}
|
|
268
|
+
SwaggerModule.setup(config.path, app, document);
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
function setupSwaggerDocs(app, ...modules) {
|
|
272
|
+
setupModuleSwaggerDocs(app, modules);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
;// CONCATENATED MODULE: ./projects/nestjs-core/src/docs/index.ts
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
},
|
|
280
|
+
|
|
281
|
+
};
|
|
282
|
+
import { __webpack_require__ } from '../runtime.js';
|
|
283
|
+
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
|
|
284
|
+
import * as __rspack_chunk_1 from './index.js';
|
|
285
|
+
__webpack_require__.C(__rspack_chunk_1);
|
|
286
|
+
var __webpack_exports__ = __webpack_exec__(21);var __webpack_exports__setupModuleSwaggerDocs = __webpack_exports__.T;
|
|
287
|
+
var __webpack_exports__setupSwaggerDocs = __webpack_exports__.P;
|
|
288
|
+
export { __webpack_exports__setupModuleSwaggerDocs as setupModuleSwaggerDocs, __webpack_exports__setupSwaggerDocs as setupSwaggerDocs };
|
package/fesm/index.js
CHANGED
|
@@ -1,10 +1,129 @@
|
|
|
1
|
+
export const __rspack_esm_id = 410;
|
|
2
|
+
export const __rspack_esm_ids = [410];
|
|
3
|
+
export const __webpack_modules__ = {
|
|
4
|
+
474(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
5
|
+
|
|
6
|
+
// EXPORTS
|
|
7
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
8
|
+
l: () => (/* reexport */ DEFAULT_TENANT_HEADER),
|
|
9
|
+
g: () => (/* reexport */ MODULE_OPTIONS)
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
;// CONCATENATED MODULE: ./projects/nestjs-core/src/constants/database.constants.ts
|
|
13
|
+
const MODULE_OPTIONS = Symbol('MODULE_OPTIONS');
|
|
14
|
+
const DEFAULT_TENANT_HEADER = 'x-tenant-id';
|
|
15
|
+
|
|
16
|
+
;// CONCATENATED MODULE: ./projects/nestjs-core/src/constants/index.ts
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
},
|
|
21
|
+
59(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
22
|
+
/* import */ var _constants_index_js__rspack_import_0 = __webpack_require__(474);
|
|
23
|
+
/* import */ var _utils_index_js__rspack_import_1 = __webpack_require__(313);
|
|
24
|
+
/* import */ var _migration_index_js__rspack_import_2 = __webpack_require__(256);
|
|
25
|
+
/* import */ var _config_index_js__rspack_import_3 = __webpack_require__(892);
|
|
1
26
|
// Interfaces
|
|
2
|
-
|
|
27
|
+
|
|
3
28
|
// Constants
|
|
4
|
-
|
|
29
|
+
|
|
5
30
|
// Utilities
|
|
6
|
-
|
|
31
|
+
|
|
7
32
|
// Migration
|
|
8
|
-
|
|
33
|
+
|
|
9
34
|
// Config
|
|
10
|
-
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
38
|
+
$7: () => (/* reexport safe */ _migration_index_js__rspack_import_2.$7),
|
|
39
|
+
$N: () => (/* reexport safe */ _migration_index_js__rspack_import_2.$N),
|
|
40
|
+
KJ: () => (/* reexport safe */ _config_index_js__rspack_import_3.K),
|
|
41
|
+
LH: () => (/* reexport safe */ _utils_index_js__rspack_import_1.LH),
|
|
42
|
+
Md: () => (/* reexport safe */ _utils_index_js__rspack_import_1.Md),
|
|
43
|
+
Mg: () => (/* reexport safe */ _migration_index_js__rspack_import_2.Mg),
|
|
44
|
+
O7: () => (/* reexport safe */ _migration_index_js__rspack_import_2.O7),
|
|
45
|
+
Q0: () => (/* reexport safe */ _utils_index_js__rspack_import_1.Q0),
|
|
46
|
+
QP: () => (/* reexport safe */ _utils_index_js__rspack_import_1.QP),
|
|
47
|
+
SP: () => (/* reexport safe */ _utils_index_js__rspack_import_1.SP),
|
|
48
|
+
XR: () => (/* reexport safe */ _migration_index_js__rspack_import_2.XR),
|
|
49
|
+
gZ: () => (/* reexport safe */ _constants_index_js__rspack_import_0.g),
|
|
50
|
+
iL: () => (/* reexport safe */ _migration_index_js__rspack_import_2.iL),
|
|
51
|
+
jr: () => (/* reexport safe */ _utils_index_js__rspack_import_1.jr),
|
|
52
|
+
lq: () => (/* reexport safe */ _constants_index_js__rspack_import_0.l),
|
|
53
|
+
ul: () => (/* reexport safe */ _utils_index_js__rspack_import_1.ul),
|
|
54
|
+
vI: () => (/* reexport safe */ _migration_index_js__rspack_import_2.vI),
|
|
55
|
+
vd: () => (/* reexport safe */ _migration_index_js__rspack_import_2.vd),
|
|
56
|
+
wX: () => (/* reexport safe */ _migration_index_js__rspack_import_2.wX),
|
|
57
|
+
ws: () => (/* reexport safe */ _migration_index_js__rspack_import_2.ws)
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
},
|
|
62
|
+
256(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
63
|
+
/* import */ var _datasource_factory_js__rspack_import_0 = __webpack_require__(193);
|
|
64
|
+
/* import */ var _migration_cli_js__rspack_import_1 = __webpack_require__(164);
|
|
65
|
+
/* import */ var _migration_runner_js__rspack_import_2 = __webpack_require__(654);
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
71
|
+
$7: () => (/* reexport safe */ _migration_runner_js__rspack_import_2.$7),
|
|
72
|
+
$N: () => (/* reexport safe */ _migration_runner_js__rspack_import_2.$N),
|
|
73
|
+
Mg: () => (/* reexport safe */ _migration_runner_js__rspack_import_2.Mg),
|
|
74
|
+
O7: () => (/* reexport safe */ _datasource_factory_js__rspack_import_0.O),
|
|
75
|
+
XR: () => (/* reexport safe */ _migration_runner_js__rspack_import_2.XR),
|
|
76
|
+
iL: () => (/* reexport safe */ _migration_runner_js__rspack_import_2.iL),
|
|
77
|
+
vI: () => (/* reexport safe */ _migration_runner_js__rspack_import_2.vI),
|
|
78
|
+
vd: () => (/* reexport safe */ _migration_runner_js__rspack_import_2.vd),
|
|
79
|
+
wX: () => (/* reexport safe */ _migration_cli_js__rspack_import_1.w),
|
|
80
|
+
ws: () => (/* reexport safe */ _datasource_factory_js__rspack_import_0.w)
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
},
|
|
85
|
+
313(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
86
|
+
/* import */ var _datasource_config_builder_js__rspack_import_0 = __webpack_require__(722);
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
90
|
+
LH: () => (/* reexport safe */ _datasource_config_builder_js__rspack_import_0.LH),
|
|
91
|
+
Md: () => (/* reexport safe */ _datasource_config_builder_js__rspack_import_0.Md),
|
|
92
|
+
Q0: () => (/* reexport safe */ _datasource_config_builder_js__rspack_import_0.Q0),
|
|
93
|
+
QP: () => (/* reexport safe */ _datasource_config_builder_js__rspack_import_0.QP),
|
|
94
|
+
SP: () => (/* reexport safe */ _datasource_config_builder_js__rspack_import_0.SP),
|
|
95
|
+
jr: () => (/* reexport safe */ _datasource_config_builder_js__rspack_import_0.jr),
|
|
96
|
+
ul: () => (/* reexport safe */ _datasource_config_builder_js__rspack_import_0.ul)
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
};
|
|
103
|
+
import { __webpack_require__ } from './runtime.js';
|
|
104
|
+
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
|
|
105
|
+
import * as __rspack_chunk_1 from './229.js';
|
|
106
|
+
__webpack_require__.C(__rspack_chunk_1);
|
|
107
|
+
import * as __rspack_chunk_2 from './index.js';
|
|
108
|
+
__webpack_require__.C(__rspack_chunk_2);
|
|
109
|
+
var __webpack_exports__ = __webpack_exec__(59);var __webpack_exports__DEFAULT_TENANT_HEADER = __webpack_exports__.lq;
|
|
110
|
+
var __webpack_exports__MODULE_OPTIONS = __webpack_exports__.gZ;
|
|
111
|
+
var __webpack_exports__buildDataSourceOptions = __webpack_exports__.QP;
|
|
112
|
+
var __webpack_exports__createMigrationDataSource = __webpack_exports__.O7;
|
|
113
|
+
var __webpack_exports__ensureMigrationsFolder = __webpack_exports__.Mg;
|
|
114
|
+
var __webpack_exports__envConfig = __webpack_exports__.KJ;
|
|
115
|
+
var __webpack_exports__generateMigration = __webpack_exports__.iL;
|
|
116
|
+
var __webpack_exports__getActiveTenants = __webpack_exports__.SP;
|
|
117
|
+
var __webpack_exports__getDatabaseForTenant = __webpack_exports__.LH;
|
|
118
|
+
var __webpack_exports__getMigrationsFolderPath = __webpack_exports__.jr;
|
|
119
|
+
var __webpack_exports__getMigrationsGlobPattern = __webpack_exports__.Q0;
|
|
120
|
+
var __webpack_exports__initializeDataSource = __webpack_exports__.ws;
|
|
121
|
+
var __webpack_exports__migrationStatus = __webpack_exports__.vd;
|
|
122
|
+
var __webpack_exports__resetDatabase = __webpack_exports__.$7;
|
|
123
|
+
var __webpack_exports__resolveDatabaseConnection = __webpack_exports__.ul;
|
|
124
|
+
var __webpack_exports__resolveEntities = __webpack_exports__.Md;
|
|
125
|
+
var __webpack_exports__revertMigration = __webpack_exports__.$N;
|
|
126
|
+
var __webpack_exports__runForAllTenants = __webpack_exports__.XR;
|
|
127
|
+
var __webpack_exports__runMigrationCli = __webpack_exports__.wX;
|
|
128
|
+
var __webpack_exports__runMigrations = __webpack_exports__.vI;
|
|
129
|
+
export { __webpack_exports__DEFAULT_TENANT_HEADER as DEFAULT_TENANT_HEADER, __webpack_exports__MODULE_OPTIONS as MODULE_OPTIONS, __webpack_exports__buildDataSourceOptions as buildDataSourceOptions, __webpack_exports__createMigrationDataSource as createMigrationDataSource, __webpack_exports__ensureMigrationsFolder as ensureMigrationsFolder, __webpack_exports__envConfig as envConfig, __webpack_exports__generateMigration as generateMigration, __webpack_exports__getActiveTenants as getActiveTenants, __webpack_exports__getDatabaseForTenant as getDatabaseForTenant, __webpack_exports__getMigrationsFolderPath as getMigrationsFolderPath, __webpack_exports__getMigrationsGlobPattern as getMigrationsGlobPattern, __webpack_exports__initializeDataSource as initializeDataSource, __webpack_exports__migrationStatus as migrationStatus, __webpack_exports__resetDatabase as resetDatabase, __webpack_exports__resolveDatabaseConnection as resolveDatabaseConnection, __webpack_exports__resolveEntities as resolveEntities, __webpack_exports__revertMigration as revertMigration, __webpack_exports__runForAllTenants as runForAllTenants, __webpack_exports__runMigrationCli as runMigrationCli, __webpack_exports__runMigrations as runMigrations };
|
package/fesm/interfaces/index.js
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
|
|
1
|
+
export const __rspack_esm_id = 471;
|
|
2
|
+
export const __rspack_esm_ids = [471];
|
|
3
|
+
export const __webpack_modules__ = {
|
|
4
|
+
284() {
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
};
|
|
14
|
+
import { __webpack_require__ } from '../runtime.js';
|
|
15
|
+
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
|
|
16
|
+
import * as __rspack_chunk_1 from './index.js';
|
|
17
|
+
__webpack_require__.C(__rspack_chunk_1);
|
|
18
|
+
var __webpack_exports__ = __webpack_exec__(284);
|
package/fesm/migration/cli.js
CHANGED
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
export const __rspack_esm_id = 367;
|
|
3
|
+
export const __rspack_esm_ids = [367];
|
|
4
|
+
export const __webpack_modules__ = {
|
|
5
|
+
350(__unused_rspack_module, __unused_rspack___webpack_exports__, __webpack_require__) {
|
|
6
|
+
/* import */ var _migration_cli_js__rspack_import_0 = __webpack_require__(164);
|
|
7
|
+
|
|
8
|
+
(0,_migration_cli_js__rspack_import_0/* .runMigrationCli */.w)().catch((err)=>{
|
|
4
9
|
console.error('CLI Error:', err.message);
|
|
5
10
|
process.exit(1);
|
|
6
11
|
});
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
};
|
|
17
|
+
import { __webpack_require__ } from '../runtime.js';
|
|
18
|
+
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
|
|
19
|
+
import * as __rspack_chunk_1 from '../229.js';
|
|
20
|
+
__webpack_require__.C(__rspack_chunk_1);
|
|
21
|
+
import * as __rspack_chunk_2 from './cli.js';
|
|
22
|
+
__webpack_require__.C(__rspack_chunk_2);
|
|
23
|
+
var __webpack_exports__ = __webpack_exec__(350);
|