@lark-apaas/fullstack-nestjs-core 1.1.4-alpha.4 → 1.1.4
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/dist/index.cjs +85 -26
- package/dist/index.d.cts +0 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.js +78 -18
- package/package.json +5 -7
package/dist/index.cjs
CHANGED
|
@@ -44,15 +44,12 @@ __export(index_exports, {
|
|
|
44
44
|
module.exports = __toCommonJS(index_exports);
|
|
45
45
|
|
|
46
46
|
// src/modules/platform/module.ts
|
|
47
|
-
var
|
|
48
|
-
var
|
|
49
|
-
var import_nestjs_common = require("@lark-apaas/nestjs-common");
|
|
47
|
+
var import_common6 = require("@nestjs/common");
|
|
48
|
+
var import_core2 = require("@nestjs/core");
|
|
50
49
|
var import_config2 = require("@nestjs/config");
|
|
51
|
-
var import_nestjs_observable = require("@lark-apaas/nestjs-observable");
|
|
52
50
|
var import_nestjs_logger = require("@lark-apaas/nestjs-logger");
|
|
53
51
|
var import_nestjs_datapaas = require("@lark-apaas/nestjs-datapaas");
|
|
54
52
|
var import_nestjs_authnpaas = require("@lark-apaas/nestjs-authnpaas");
|
|
55
|
-
var import_nestjs_trigger = require("@lark-apaas/nestjs-trigger");
|
|
56
53
|
|
|
57
54
|
// src/middlewares/user-context/index.ts
|
|
58
55
|
var import_common = require("@nestjs/common");
|
|
@@ -99,8 +96,7 @@ var UserContextMiddleware = class {
|
|
|
99
96
|
env: webUser?.env ?? "runtime",
|
|
100
97
|
userName: webUser?.user_name?.zh_cn ?? "",
|
|
101
98
|
userNameEn: webUser?.user_name?.en_us ?? "",
|
|
102
|
-
userNameI18n: webUser?.user_name ?? {}
|
|
103
|
-
isSystemAccount: webUser?.is_system_account ?? false
|
|
99
|
+
userNameI18n: webUser?.user_name ?? {}
|
|
104
100
|
};
|
|
105
101
|
next();
|
|
106
102
|
}
|
|
@@ -310,7 +306,9 @@ var app_config_default = (0, import_config.registerAs)(NAMESPACE, () => {
|
|
|
310
306
|
};
|
|
311
307
|
});
|
|
312
308
|
|
|
313
|
-
// src/
|
|
309
|
+
// src/middlewares/debug/index.ts
|
|
310
|
+
var import_common5 = require("@nestjs/common");
|
|
311
|
+
var import_core = require("@nestjs/core");
|
|
314
312
|
function _ts_decorate5(decorators, target, key, desc) {
|
|
315
313
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
316
314
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -318,6 +316,73 @@ function _ts_decorate5(decorators, target, key, desc) {
|
|
|
318
316
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
319
317
|
}
|
|
320
318
|
__name(_ts_decorate5, "_ts_decorate");
|
|
319
|
+
function _ts_metadata(k, v) {
|
|
320
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
321
|
+
}
|
|
322
|
+
__name(_ts_metadata, "_ts_metadata");
|
|
323
|
+
var processStartTimestamp = Date.now();
|
|
324
|
+
var FrameworkDebugMiddleware = class {
|
|
325
|
+
static {
|
|
326
|
+
__name(this, "FrameworkDebugMiddleware");
|
|
327
|
+
}
|
|
328
|
+
httpAdapterHost;
|
|
329
|
+
constructor(httpAdapterHost) {
|
|
330
|
+
this.httpAdapterHost = httpAdapterHost;
|
|
331
|
+
}
|
|
332
|
+
use(_req, res) {
|
|
333
|
+
res.json(this.getDebugInfo());
|
|
334
|
+
}
|
|
335
|
+
getDebugInfo() {
|
|
336
|
+
const routes = this.getRoutes();
|
|
337
|
+
const uptimeSeconds = Math.floor(process.uptime());
|
|
338
|
+
return {
|
|
339
|
+
["\u8DEF\u7531\u914D\u7F6E"]: routes,
|
|
340
|
+
["\u8FDB\u7A0B\u5B58\u6D3B\u65F6\u95F4\uFF08\u79D2\uFF09"]: uptimeSeconds,
|
|
341
|
+
["\u8FDB\u7A0B\u542F\u52A8\u65F6\u95F4\uFF08\u79D2\uFF09"]: new Date(processStartTimestamp).toISOString(),
|
|
342
|
+
["\u8FD0\u884C\u65F6\u7248\u672C"]: process.versions
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
getRoutes() {
|
|
346
|
+
const server = this.httpAdapterHost.httpAdapter;
|
|
347
|
+
const router = server.getInstance()._router;
|
|
348
|
+
if (!router) {
|
|
349
|
+
return {
|
|
350
|
+
error: "Router \u4E0D\u53EF\u7528"
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
const routes = [];
|
|
354
|
+
router.stack.forEach((middleware, index) => {
|
|
355
|
+
if (middleware.route) {
|
|
356
|
+
routes.push({
|
|
357
|
+
order: String(index),
|
|
358
|
+
path: middleware.route.path,
|
|
359
|
+
method: middleware.method,
|
|
360
|
+
regexp: middleware.regexp?.toString()
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
return {
|
|
365
|
+
total: routes.length,
|
|
366
|
+
routes
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
FrameworkDebugMiddleware = _ts_decorate5([
|
|
371
|
+
(0, import_common5.Injectable)(),
|
|
372
|
+
_ts_metadata("design:type", Function),
|
|
373
|
+
_ts_metadata("design:paramtypes", [
|
|
374
|
+
typeof import_core.HttpAdapterHost === "undefined" ? Object : import_core.HttpAdapterHost
|
|
375
|
+
])
|
|
376
|
+
], FrameworkDebugMiddleware);
|
|
377
|
+
|
|
378
|
+
// src/modules/platform/module.ts
|
|
379
|
+
function _ts_decorate6(decorators, target, key, desc) {
|
|
380
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
381
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
382
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
383
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
384
|
+
}
|
|
385
|
+
__name(_ts_decorate6, "_ts_decorate");
|
|
321
386
|
var PLATFORM_MODULE_OPTIONS = "PLATFORM_MODULE_OPTIONS";
|
|
322
387
|
var PlatformModule = class _PlatformModule {
|
|
323
388
|
static {
|
|
@@ -339,9 +404,7 @@ var PlatformModule = class _PlatformModule {
|
|
|
339
404
|
app_config_default
|
|
340
405
|
]
|
|
341
406
|
}),
|
|
342
|
-
import_nestjs_common.CommonModule,
|
|
343
407
|
import_nestjs_logger.LoggerModule,
|
|
344
|
-
import_nestjs_observable.NestjsObservableModule.forRoot(),
|
|
345
408
|
import_nestjs_datapaas.DataPaasModule.forRootAsync({
|
|
346
409
|
imports: [
|
|
347
410
|
import_config2.ConfigModule,
|
|
@@ -356,10 +419,10 @@ var PlatformModule = class _PlatformModule {
|
|
|
356
419
|
const appLogger = args[1];
|
|
357
420
|
const drizzleLogger = {
|
|
358
421
|
logQuery(query, params) {
|
|
359
|
-
appLogger.log?.("SQL Query
|
|
422
|
+
appLogger.log?.("SQL Query", {
|
|
360
423
|
query,
|
|
361
424
|
params
|
|
362
|
-
}
|
|
425
|
+
}, "Database");
|
|
363
426
|
}
|
|
364
427
|
};
|
|
365
428
|
return {
|
|
@@ -368,12 +431,7 @@ var PlatformModule = class _PlatformModule {
|
|
|
368
431
|
};
|
|
369
432
|
}, "useFactory")
|
|
370
433
|
}),
|
|
371
|
-
import_nestjs_authnpaas.AuthNPaasModule.forRoot()
|
|
372
|
-
import_nestjs_trigger.AutomationModule.forRoot({
|
|
373
|
-
imports: [
|
|
374
|
-
import_nestjs_logger.LoggerModule
|
|
375
|
-
]
|
|
376
|
-
})
|
|
434
|
+
import_nestjs_authnpaas.AuthNPaasModule.forRoot()
|
|
377
435
|
],
|
|
378
436
|
providers: [
|
|
379
437
|
{
|
|
@@ -381,8 +439,8 @@ var PlatformModule = class _PlatformModule {
|
|
|
381
439
|
useValue: options
|
|
382
440
|
},
|
|
383
441
|
{
|
|
384
|
-
provide:
|
|
385
|
-
useValue: new
|
|
442
|
+
provide: import_core2.APP_PIPE,
|
|
443
|
+
useValue: new import_common6.ValidationPipe({
|
|
386
444
|
transform: true,
|
|
387
445
|
transformOptions: {
|
|
388
446
|
enableImplicitConversion: true
|
|
@@ -402,6 +460,9 @@ var PlatformModule = class _PlatformModule {
|
|
|
402
460
|
configure(consumer) {
|
|
403
461
|
const options = _PlatformModule.moduleOptions;
|
|
404
462
|
consumer.apply(apiResponseInterceptor).forRoutes("/api/*");
|
|
463
|
+
if (process.env.NODE_ENV === "development") {
|
|
464
|
+
consumer.apply(FrameworkDebugMiddleware).forRoutes("/api/__framework__/debug");
|
|
465
|
+
}
|
|
405
466
|
consumer.apply(UserContextMiddleware, import_nestjs_logger.LoggerContextMiddleware, import_nestjs_datapaas.SqlExecutionContextMiddleware).forRoutes("/*");
|
|
406
467
|
consumer.apply(CsrfTokenMiddleware, ViewContextMiddleware).exclude("/api/(.*)").forRoutes("*");
|
|
407
468
|
if (options.enableCsrf !== false) {
|
|
@@ -416,9 +477,9 @@ var PlatformModule = class _PlatformModule {
|
|
|
416
477
|
}
|
|
417
478
|
}
|
|
418
479
|
};
|
|
419
|
-
PlatformModule =
|
|
420
|
-
(0,
|
|
421
|
-
(0,
|
|
480
|
+
PlatformModule = _ts_decorate6([
|
|
481
|
+
(0, import_common6.Global)(),
|
|
482
|
+
(0, import_common6.Module)({})
|
|
422
483
|
], PlatformModule);
|
|
423
484
|
|
|
424
485
|
// src/setup.ts
|
|
@@ -451,7 +512,6 @@ __name(configureApp, "configureApp");
|
|
|
451
512
|
var import_nestjs_openapi_devtools2 = require("@lark-apaas/nestjs-openapi-devtools");
|
|
452
513
|
__reExport(index_exports, require("@lark-apaas/nestjs-authnpaas"), module.exports);
|
|
453
514
|
__reExport(index_exports, require("@lark-apaas/nestjs-datapaas"), module.exports);
|
|
454
|
-
__reExport(index_exports, require("@lark-apaas/nestjs-trigger"), module.exports);
|
|
455
515
|
// Annotate the CommonJS export names for ESM import in node:
|
|
456
516
|
0 && (module.exports = {
|
|
457
517
|
CsrfMiddleware,
|
|
@@ -463,6 +523,5 @@ __reExport(index_exports, require("@lark-apaas/nestjs-trigger"), module.exports)
|
|
|
463
523
|
ViewContextMiddleware,
|
|
464
524
|
configureApp,
|
|
465
525
|
...require("@lark-apaas/nestjs-authnpaas"),
|
|
466
|
-
...require("@lark-apaas/nestjs-datapaas")
|
|
467
|
-
...require("@lark-apaas/nestjs-trigger")
|
|
526
|
+
...require("@lark-apaas/nestjs-datapaas")
|
|
468
527
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -4,7 +4,6 @@ export { DevToolsModule, DevToolsOptions, DevToolsV2Module, DevToolsV2Options }
|
|
|
4
4
|
import { Request, Response, NextFunction } from 'express';
|
|
5
5
|
export * from '@lark-apaas/nestjs-authnpaas';
|
|
6
6
|
export * from '@lark-apaas/nestjs-datapaas';
|
|
7
|
-
export * from '@lark-apaas/nestjs-trigger';
|
|
8
7
|
|
|
9
8
|
declare global {
|
|
10
9
|
namespace Express {
|
|
@@ -25,7 +24,6 @@ declare global {
|
|
|
25
24
|
userName?: string; // 默认中文名
|
|
26
25
|
userNameEn?: string; // 冗余一份英文名
|
|
27
26
|
userNameI18n?: Record<string, string>; // 带多语的用户名
|
|
28
|
-
isSystemAccount?: boolean; // trigger 场景写入值为 true,user 访问场景不写入
|
|
29
27
|
},
|
|
30
28
|
csrfToken?: string;
|
|
31
29
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ export { DevToolsModule, DevToolsOptions, DevToolsV2Module, DevToolsV2Options }
|
|
|
4
4
|
import { Request, Response, NextFunction } from 'express';
|
|
5
5
|
export * from '@lark-apaas/nestjs-authnpaas';
|
|
6
6
|
export * from '@lark-apaas/nestjs-datapaas';
|
|
7
|
-
export * from '@lark-apaas/nestjs-trigger';
|
|
8
7
|
|
|
9
8
|
declare global {
|
|
10
9
|
namespace Express {
|
|
@@ -25,7 +24,6 @@ declare global {
|
|
|
25
24
|
userName?: string; // 默认中文名
|
|
26
25
|
userNameEn?: string; // 冗余一份英文名
|
|
27
26
|
userNameI18n?: Record<string, string>; // 带多语的用户名
|
|
28
|
-
isSystemAccount?: boolean; // trigger 场景写入值为 true,user 访问场景不写入
|
|
29
27
|
},
|
|
30
28
|
csrfToken?: string;
|
|
31
29
|
}
|
package/dist/index.js
CHANGED
|
@@ -4,13 +4,10 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
|
|
|
4
4
|
// src/modules/platform/module.ts
|
|
5
5
|
import { Global, Module, ValidationPipe } from "@nestjs/common";
|
|
6
6
|
import { APP_PIPE } from "@nestjs/core";
|
|
7
|
-
import { CommonModule } from "@lark-apaas/nestjs-common";
|
|
8
7
|
import { ConfigModule, ConfigService } from "@nestjs/config";
|
|
9
|
-
import { NestjsObservableModule as ObservableModule } from "@lark-apaas/nestjs-observable";
|
|
10
8
|
import { LoggerModule, AppLogger, LoggerContextMiddleware } from "@lark-apaas/nestjs-logger";
|
|
11
9
|
import { DataPaasModule, SqlExecutionContextMiddleware } from "@lark-apaas/nestjs-datapaas";
|
|
12
10
|
import { AuthNPaasModule } from "@lark-apaas/nestjs-authnpaas";
|
|
13
|
-
import { AutomationModule } from "@lark-apaas/nestjs-trigger";
|
|
14
11
|
|
|
15
12
|
// src/middlewares/user-context/index.ts
|
|
16
13
|
import { Injectable } from "@nestjs/common";
|
|
@@ -57,8 +54,7 @@ var UserContextMiddleware = class {
|
|
|
57
54
|
env: webUser?.env ?? "runtime",
|
|
58
55
|
userName: webUser?.user_name?.zh_cn ?? "",
|
|
59
56
|
userNameEn: webUser?.user_name?.en_us ?? "",
|
|
60
|
-
userNameI18n: webUser?.user_name ?? {}
|
|
61
|
-
isSystemAccount: webUser?.is_system_account ?? false
|
|
57
|
+
userNameI18n: webUser?.user_name ?? {}
|
|
62
58
|
};
|
|
63
59
|
next();
|
|
64
60
|
}
|
|
@@ -268,7 +264,9 @@ var app_config_default = registerAs(NAMESPACE, () => {
|
|
|
268
264
|
};
|
|
269
265
|
});
|
|
270
266
|
|
|
271
|
-
// src/
|
|
267
|
+
// src/middlewares/debug/index.ts
|
|
268
|
+
import { Injectable as Injectable5 } from "@nestjs/common";
|
|
269
|
+
import { HttpAdapterHost } from "@nestjs/core";
|
|
272
270
|
function _ts_decorate5(decorators, target, key, desc) {
|
|
273
271
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
274
272
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -276,6 +274,73 @@ function _ts_decorate5(decorators, target, key, desc) {
|
|
|
276
274
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
277
275
|
}
|
|
278
276
|
__name(_ts_decorate5, "_ts_decorate");
|
|
277
|
+
function _ts_metadata(k, v) {
|
|
278
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
279
|
+
}
|
|
280
|
+
__name(_ts_metadata, "_ts_metadata");
|
|
281
|
+
var processStartTimestamp = Date.now();
|
|
282
|
+
var FrameworkDebugMiddleware = class {
|
|
283
|
+
static {
|
|
284
|
+
__name(this, "FrameworkDebugMiddleware");
|
|
285
|
+
}
|
|
286
|
+
httpAdapterHost;
|
|
287
|
+
constructor(httpAdapterHost) {
|
|
288
|
+
this.httpAdapterHost = httpAdapterHost;
|
|
289
|
+
}
|
|
290
|
+
use(_req, res) {
|
|
291
|
+
res.json(this.getDebugInfo());
|
|
292
|
+
}
|
|
293
|
+
getDebugInfo() {
|
|
294
|
+
const routes = this.getRoutes();
|
|
295
|
+
const uptimeSeconds = Math.floor(process.uptime());
|
|
296
|
+
return {
|
|
297
|
+
["\u8DEF\u7531\u914D\u7F6E"]: routes,
|
|
298
|
+
["\u8FDB\u7A0B\u5B58\u6D3B\u65F6\u95F4\uFF08\u79D2\uFF09"]: uptimeSeconds,
|
|
299
|
+
["\u8FDB\u7A0B\u542F\u52A8\u65F6\u95F4\uFF08\u79D2\uFF09"]: new Date(processStartTimestamp).toISOString(),
|
|
300
|
+
["\u8FD0\u884C\u65F6\u7248\u672C"]: process.versions
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
getRoutes() {
|
|
304
|
+
const server = this.httpAdapterHost.httpAdapter;
|
|
305
|
+
const router = server.getInstance()._router;
|
|
306
|
+
if (!router) {
|
|
307
|
+
return {
|
|
308
|
+
error: "Router \u4E0D\u53EF\u7528"
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
const routes = [];
|
|
312
|
+
router.stack.forEach((middleware, index) => {
|
|
313
|
+
if (middleware.route) {
|
|
314
|
+
routes.push({
|
|
315
|
+
order: String(index),
|
|
316
|
+
path: middleware.route.path,
|
|
317
|
+
method: middleware.method,
|
|
318
|
+
regexp: middleware.regexp?.toString()
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
return {
|
|
323
|
+
total: routes.length,
|
|
324
|
+
routes
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
FrameworkDebugMiddleware = _ts_decorate5([
|
|
329
|
+
Injectable5(),
|
|
330
|
+
_ts_metadata("design:type", Function),
|
|
331
|
+
_ts_metadata("design:paramtypes", [
|
|
332
|
+
typeof HttpAdapterHost === "undefined" ? Object : HttpAdapterHost
|
|
333
|
+
])
|
|
334
|
+
], FrameworkDebugMiddleware);
|
|
335
|
+
|
|
336
|
+
// src/modules/platform/module.ts
|
|
337
|
+
function _ts_decorate6(decorators, target, key, desc) {
|
|
338
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
339
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
340
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
341
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
342
|
+
}
|
|
343
|
+
__name(_ts_decorate6, "_ts_decorate");
|
|
279
344
|
var PLATFORM_MODULE_OPTIONS = "PLATFORM_MODULE_OPTIONS";
|
|
280
345
|
var PlatformModule = class _PlatformModule {
|
|
281
346
|
static {
|
|
@@ -297,9 +362,7 @@ var PlatformModule = class _PlatformModule {
|
|
|
297
362
|
app_config_default
|
|
298
363
|
]
|
|
299
364
|
}),
|
|
300
|
-
CommonModule,
|
|
301
365
|
LoggerModule,
|
|
302
|
-
ObservableModule.forRoot(),
|
|
303
366
|
DataPaasModule.forRootAsync({
|
|
304
367
|
imports: [
|
|
305
368
|
ConfigModule,
|
|
@@ -314,10 +377,10 @@ var PlatformModule = class _PlatformModule {
|
|
|
314
377
|
const appLogger = args[1];
|
|
315
378
|
const drizzleLogger = {
|
|
316
379
|
logQuery(query, params) {
|
|
317
|
-
appLogger.log?.("SQL Query
|
|
380
|
+
appLogger.log?.("SQL Query", {
|
|
318
381
|
query,
|
|
319
382
|
params
|
|
320
|
-
}
|
|
383
|
+
}, "Database");
|
|
321
384
|
}
|
|
322
385
|
};
|
|
323
386
|
return {
|
|
@@ -326,12 +389,7 @@ var PlatformModule = class _PlatformModule {
|
|
|
326
389
|
};
|
|
327
390
|
}, "useFactory")
|
|
328
391
|
}),
|
|
329
|
-
AuthNPaasModule.forRoot()
|
|
330
|
-
AutomationModule.forRoot({
|
|
331
|
-
imports: [
|
|
332
|
-
LoggerModule
|
|
333
|
-
]
|
|
334
|
-
})
|
|
392
|
+
AuthNPaasModule.forRoot()
|
|
335
393
|
],
|
|
336
394
|
providers: [
|
|
337
395
|
{
|
|
@@ -360,6 +418,9 @@ var PlatformModule = class _PlatformModule {
|
|
|
360
418
|
configure(consumer) {
|
|
361
419
|
const options = _PlatformModule.moduleOptions;
|
|
362
420
|
consumer.apply(apiResponseInterceptor).forRoutes("/api/*");
|
|
421
|
+
if (process.env.NODE_ENV === "development") {
|
|
422
|
+
consumer.apply(FrameworkDebugMiddleware).forRoutes("/api/__framework__/debug");
|
|
423
|
+
}
|
|
363
424
|
consumer.apply(UserContextMiddleware, LoggerContextMiddleware, SqlExecutionContextMiddleware).forRoutes("/*");
|
|
364
425
|
consumer.apply(CsrfTokenMiddleware, ViewContextMiddleware).exclude("/api/(.*)").forRoutes("*");
|
|
365
426
|
if (options.enableCsrf !== false) {
|
|
@@ -374,7 +435,7 @@ var PlatformModule = class _PlatformModule {
|
|
|
374
435
|
}
|
|
375
436
|
}
|
|
376
437
|
};
|
|
377
|
-
PlatformModule =
|
|
438
|
+
PlatformModule = _ts_decorate6([
|
|
378
439
|
Global(),
|
|
379
440
|
Module({})
|
|
380
441
|
], PlatformModule);
|
|
@@ -409,7 +470,6 @@ __name(configureApp, "configureApp");
|
|
|
409
470
|
import { DevToolsModule, DevToolsV2Module as DevToolsV2Module2 } from "@lark-apaas/nestjs-openapi-devtools";
|
|
410
471
|
export * from "@lark-apaas/nestjs-authnpaas";
|
|
411
472
|
export * from "@lark-apaas/nestjs-datapaas";
|
|
412
|
-
export * from "@lark-apaas/nestjs-trigger";
|
|
413
473
|
export {
|
|
414
474
|
CsrfMiddleware,
|
|
415
475
|
CsrfTokenMiddleware,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lark-apaas/fullstack-nestjs-core",
|
|
3
|
-
"version": "1.1.4
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "FullStack Nestjs Core",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -39,13 +39,10 @@
|
|
|
39
39
|
"prepublishOnly": "npm run build"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@lark-apaas/nestjs-authnpaas": "
|
|
43
|
-
"@lark-apaas/nestjs-
|
|
44
|
-
"@lark-apaas/nestjs-
|
|
45
|
-
"@lark-apaas/nestjs-logger": "1.0.2-alpha.14",
|
|
46
|
-
"@lark-apaas/nestjs-observable": "0.0.1-alpha.9",
|
|
42
|
+
"@lark-apaas/nestjs-authnpaas": "1.0.2",
|
|
43
|
+
"@lark-apaas/nestjs-datapaas": "^1.0.5",
|
|
44
|
+
"@lark-apaas/nestjs-logger": "^1.0.2",
|
|
47
45
|
"@lark-apaas/nestjs-openapi-devtools": "^1.0.9",
|
|
48
|
-
"@lark-apaas/nestjs-trigger": "0.0.1-alpha.2",
|
|
49
46
|
"cookie-parser": "^1.4.7"
|
|
50
47
|
},
|
|
51
48
|
"devDependencies": {
|
|
@@ -62,6 +59,7 @@
|
|
|
62
59
|
},
|
|
63
60
|
"peerDependencies": {
|
|
64
61
|
"@nestjs/common": "^10.4.20",
|
|
62
|
+
"@nestjs/core": "^10.4.20",
|
|
65
63
|
"@nestjs/platform-express": "^10.4.20",
|
|
66
64
|
"@nestjs/swagger": "^7.4.2",
|
|
67
65
|
"class-transformer": "^0.5.1",
|