@lark-apaas/fullstack-nestjs-core 1.1.12-alpha.1 → 1.1.12-alpha.2
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 +37 -30
- package/dist/index.js +37 -30
- package/package.json +5 -3
package/dist/index.cjs
CHANGED
|
@@ -170,6 +170,7 @@ CsrfMiddleware = _ts_decorate2([
|
|
|
170
170
|
// src/middlewares/view-context/index.ts
|
|
171
171
|
var import_common3 = require("@nestjs/common");
|
|
172
172
|
var import_nestjs_common = require("@lark-apaas/nestjs-common");
|
|
173
|
+
var import_serialize_javascript = __toESM(require("serialize-javascript"), 1);
|
|
173
174
|
function _ts_decorate3(decorators, target, key, desc) {
|
|
174
175
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
175
176
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -225,9 +226,9 @@ var ViewContextMiddleware = class _ViewContextMiddleware {
|
|
|
225
226
|
csrfToken: csrfToken ?? "",
|
|
226
227
|
userId: userId ?? "",
|
|
227
228
|
appId: appId ?? "",
|
|
228
|
-
appName: appInfo?.app_name ?? "",
|
|
229
|
+
appName: (0, import_serialize_javascript.default)(appInfo?.app_name ?? ""),
|
|
229
230
|
appAvatar: appInfo?.app_avatar ?? "",
|
|
230
|
-
appDescription: appInfo?.app_description ?? "",
|
|
231
|
+
appDescription: (0, import_serialize_javascript.default)(appInfo?.app_description ?? ""),
|
|
231
232
|
tenantId
|
|
232
233
|
};
|
|
233
234
|
res.locals = {
|
|
@@ -236,9 +237,9 @@ var ViewContextMiddleware = class _ViewContextMiddleware {
|
|
|
236
237
|
userId: userId ?? "",
|
|
237
238
|
tenantId: tenantId ?? "",
|
|
238
239
|
appId: appId ?? "",
|
|
239
|
-
appName: appInfo?.app_name ?? "\u5999\u642D\u5E94\u7528",
|
|
240
|
+
appName: (0, import_serialize_javascript.default)(appInfo?.app_name ?? "\u5999\u642D\u5E94\u7528"),
|
|
240
241
|
appAvatar: appInfo?.app_avatar ?? "",
|
|
241
|
-
appDescription: appInfo?.app_description ?? ""
|
|
242
|
+
appDescription: (0, import_serialize_javascript.default)(appInfo?.app_description ?? "")
|
|
242
243
|
};
|
|
243
244
|
next();
|
|
244
245
|
}
|
|
@@ -716,6 +717,9 @@ PlatformHttpClientService = _ts_decorate8([
|
|
|
716
717
|
_ts_metadata5("design:paramtypes", [])
|
|
717
718
|
], PlatformHttpClientService);
|
|
718
719
|
|
|
720
|
+
// src/modules/platform/config/feature-switch.ts
|
|
721
|
+
var DISABLE_DATAPASS = process.env.DISABLE_DATAPASS === "true";
|
|
722
|
+
|
|
719
723
|
// src/modules/platform/module.ts
|
|
720
724
|
function _ts_decorate9(decorators, target, key, desc) {
|
|
721
725
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -752,32 +756,35 @@ var PlatformModule = class _PlatformModule {
|
|
|
752
756
|
timeout: 5e3,
|
|
753
757
|
maxRedirects: 5
|
|
754
758
|
}),
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
759
|
+
// 读取环境变量判断是否启用 DataPaasModule
|
|
760
|
+
...DISABLE_DATAPASS ? [] : [
|
|
761
|
+
import_nestjs_datapaas.DataPaasModule.forRootAsync({
|
|
762
|
+
imports: [
|
|
763
|
+
import_config2.ConfigModule,
|
|
764
|
+
import_nestjs_logger2.LoggerModule
|
|
765
|
+
],
|
|
766
|
+
inject: [
|
|
767
|
+
import_config2.ConfigService,
|
|
768
|
+
import_nestjs_logger2.AppLogger
|
|
769
|
+
],
|
|
770
|
+
useFactory: /* @__PURE__ */ __name(async (...args) => {
|
|
771
|
+
const configService = args[0];
|
|
772
|
+
const appLogger = args[1];
|
|
773
|
+
const drizzleLogger = {
|
|
774
|
+
logQuery(query, params) {
|
|
775
|
+
appLogger.log?.("SQL Query " + JSON.stringify({
|
|
776
|
+
query,
|
|
777
|
+
params
|
|
778
|
+
}), "Database");
|
|
779
|
+
}
|
|
780
|
+
};
|
|
781
|
+
return {
|
|
782
|
+
connectionString: configService.get("app.databaseUrl") ?? "",
|
|
783
|
+
logger: drizzleLogger
|
|
784
|
+
};
|
|
785
|
+
}, "useFactory")
|
|
786
|
+
})
|
|
787
|
+
],
|
|
781
788
|
import_nestjs_authnpaas.AuthNPaasModule.forRoot(),
|
|
782
789
|
import_nestjs_trigger.AutomationModule.forRoot()
|
|
783
790
|
],
|
package/dist/index.js
CHANGED
|
@@ -128,6 +128,7 @@ CsrfMiddleware = _ts_decorate2([
|
|
|
128
128
|
// src/middlewares/view-context/index.ts
|
|
129
129
|
import { Inject, Injectable as Injectable3, Logger } from "@nestjs/common";
|
|
130
130
|
import { PLATFORM_HTTP_CLIENT } from "@lark-apaas/nestjs-common";
|
|
131
|
+
import serialize from "serialize-javascript";
|
|
131
132
|
function _ts_decorate3(decorators, target, key, desc) {
|
|
132
133
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
133
134
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -183,9 +184,9 @@ var ViewContextMiddleware = class _ViewContextMiddleware {
|
|
|
183
184
|
csrfToken: csrfToken ?? "",
|
|
184
185
|
userId: userId ?? "",
|
|
185
186
|
appId: appId ?? "",
|
|
186
|
-
appName: appInfo?.app_name ?? "",
|
|
187
|
+
appName: serialize(appInfo?.app_name ?? ""),
|
|
187
188
|
appAvatar: appInfo?.app_avatar ?? "",
|
|
188
|
-
appDescription: appInfo?.app_description ?? "",
|
|
189
|
+
appDescription: serialize(appInfo?.app_description ?? ""),
|
|
189
190
|
tenantId
|
|
190
191
|
};
|
|
191
192
|
res.locals = {
|
|
@@ -194,9 +195,9 @@ var ViewContextMiddleware = class _ViewContextMiddleware {
|
|
|
194
195
|
userId: userId ?? "",
|
|
195
196
|
tenantId: tenantId ?? "",
|
|
196
197
|
appId: appId ?? "",
|
|
197
|
-
appName: appInfo?.app_name ?? "\u5999\u642D\u5E94\u7528",
|
|
198
|
+
appName: serialize(appInfo?.app_name ?? "\u5999\u642D\u5E94\u7528"),
|
|
198
199
|
appAvatar: appInfo?.app_avatar ?? "",
|
|
199
|
-
appDescription: appInfo?.app_description ?? ""
|
|
200
|
+
appDescription: serialize(appInfo?.app_description ?? "")
|
|
200
201
|
};
|
|
201
202
|
next();
|
|
202
203
|
}
|
|
@@ -674,6 +675,9 @@ PlatformHttpClientService = _ts_decorate8([
|
|
|
674
675
|
_ts_metadata5("design:paramtypes", [])
|
|
675
676
|
], PlatformHttpClientService);
|
|
676
677
|
|
|
678
|
+
// src/modules/platform/config/feature-switch.ts
|
|
679
|
+
var DISABLE_DATAPASS = process.env.DISABLE_DATAPASS === "true";
|
|
680
|
+
|
|
677
681
|
// src/modules/platform/module.ts
|
|
678
682
|
function _ts_decorate9(decorators, target, key, desc) {
|
|
679
683
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -710,32 +714,35 @@ var PlatformModule = class _PlatformModule {
|
|
|
710
714
|
timeout: 5e3,
|
|
711
715
|
maxRedirects: 5
|
|
712
716
|
}),
|
|
713
|
-
DataPaasModule
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
717
|
+
// 读取环境变量判断是否启用 DataPaasModule
|
|
718
|
+
...DISABLE_DATAPASS ? [] : [
|
|
719
|
+
DataPaasModule.forRootAsync({
|
|
720
|
+
imports: [
|
|
721
|
+
ConfigModule,
|
|
722
|
+
LoggerModule
|
|
723
|
+
],
|
|
724
|
+
inject: [
|
|
725
|
+
ConfigService,
|
|
726
|
+
AppLogger2
|
|
727
|
+
],
|
|
728
|
+
useFactory: /* @__PURE__ */ __name(async (...args) => {
|
|
729
|
+
const configService = args[0];
|
|
730
|
+
const appLogger = args[1];
|
|
731
|
+
const drizzleLogger = {
|
|
732
|
+
logQuery(query, params) {
|
|
733
|
+
appLogger.log?.("SQL Query " + JSON.stringify({
|
|
734
|
+
query,
|
|
735
|
+
params
|
|
736
|
+
}), "Database");
|
|
737
|
+
}
|
|
738
|
+
};
|
|
739
|
+
return {
|
|
740
|
+
connectionString: configService.get("app.databaseUrl") ?? "",
|
|
741
|
+
logger: drizzleLogger
|
|
742
|
+
};
|
|
743
|
+
}, "useFactory")
|
|
744
|
+
})
|
|
745
|
+
],
|
|
739
746
|
AuthNPaasModule.forRoot(),
|
|
740
747
|
AutomationModule.forRoot()
|
|
741
748
|
],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lark-apaas/fullstack-nestjs-core",
|
|
3
|
-
"version": "1.1.12-alpha.
|
|
3
|
+
"version": "1.1.12-alpha.2",
|
|
4
4
|
"description": "FullStack Nestjs Core",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -42,14 +42,15 @@
|
|
|
42
42
|
"@lark-apaas/http-client": "0.1.2",
|
|
43
43
|
"@lark-apaas/nestjs-authnpaas": "^1.0.2",
|
|
44
44
|
"@lark-apaas/nestjs-common": "^0.1.0",
|
|
45
|
-
"@lark-apaas/nestjs-datapaas": "^1.0.
|
|
45
|
+
"@lark-apaas/nestjs-datapaas": "^1.0.7",
|
|
46
46
|
"@lark-apaas/nestjs-logger": "^1.0.4",
|
|
47
47
|
"@lark-apaas/nestjs-observable": "^0.0.1",
|
|
48
48
|
"@lark-apaas/nestjs-openapi-devtools": "^1.0.9",
|
|
49
49
|
"@lark-apaas/nestjs-trigger": "^0.0.1",
|
|
50
50
|
"@nestjs/axios": "^4.0.1",
|
|
51
51
|
"axios": "^1.13.2",
|
|
52
|
-
"cookie-parser": "^1.4.7"
|
|
52
|
+
"cookie-parser": "^1.4.7",
|
|
53
|
+
"serialize-javascript": "^7.0.2"
|
|
53
54
|
},
|
|
54
55
|
"devDependencies": {
|
|
55
56
|
"@nestjs/common": "^10.4.20",
|
|
@@ -57,6 +58,7 @@
|
|
|
57
58
|
"@nestjs/swagger": "^7.4.2",
|
|
58
59
|
"@types/cookie-parser": "^1.4.9",
|
|
59
60
|
"@types/express": "^5.0.3",
|
|
61
|
+
"@types/serialize-javascript": "^5.0.4",
|
|
60
62
|
"class-transformer": "^0.5.1",
|
|
61
63
|
"class-validator": "^0.14.2",
|
|
62
64
|
"drizzle-orm": "0.44.6",
|