@lark-apaas/fullstack-nestjs-core 1.1.18-alpha.0 → 1.1.18-alpha.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/dist/index.cjs +14 -7
- package/dist/index.d.cts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +14 -6
- package/package.json +1 -2
package/dist/index.cjs
CHANGED
|
@@ -55,7 +55,6 @@ var import_nestjs_logger2 = require("@lark-apaas/nestjs-logger");
|
|
|
55
55
|
var import_nestjs_datapaas = require("@lark-apaas/nestjs-datapaas");
|
|
56
56
|
var import_nestjs_authnpaas = require("@lark-apaas/nestjs-authnpaas");
|
|
57
57
|
var import_nestjs_trigger = require("@lark-apaas/nestjs-trigger");
|
|
58
|
-
var import_nestjs_integration = require("@lark-apaas/nestjs-integration");
|
|
59
58
|
var import_nestjs_common4 = require("@lark-apaas/nestjs-common");
|
|
60
59
|
var import_nestjs_capability = require("@lark-apaas/nestjs-capability");
|
|
61
60
|
|
|
@@ -268,6 +267,7 @@ var ViewContextMiddleware = class _ViewContextMiddleware {
|
|
|
268
267
|
const { userId, tenantId, appId } = req.userContext;
|
|
269
268
|
const csrfToken = req.csrfToken;
|
|
270
269
|
const appInfo = await this.getAppInfo(appId);
|
|
270
|
+
const environment = mapToWindowEnvironment(process.env.FORCE_FRAMEWORK_ENVIRONMENT);
|
|
271
271
|
req.__platform_data__ = {
|
|
272
272
|
csrfToken: csrfToken ?? "",
|
|
273
273
|
userId: userId ?? "",
|
|
@@ -275,7 +275,8 @@ var ViewContextMiddleware = class _ViewContextMiddleware {
|
|
|
275
275
|
appName: safeEscape(appInfo?.app_name ?? "\u5999\u642D\u5E94\u7528"),
|
|
276
276
|
appAvatar: appInfo?.app_avatar ?? "",
|
|
277
277
|
appDescription: safeEscape(appInfo?.app_description ?? ""),
|
|
278
|
-
tenantId
|
|
278
|
+
tenantId,
|
|
279
|
+
environment
|
|
279
280
|
};
|
|
280
281
|
res.locals = {
|
|
281
282
|
...res.locals ?? {},
|
|
@@ -285,7 +286,8 @@ var ViewContextMiddleware = class _ViewContextMiddleware {
|
|
|
285
286
|
appId: appId ?? "",
|
|
286
287
|
appName: safeEscape(appInfo?.app_name ?? "\u5999\u642D\u5E94\u7528"),
|
|
287
288
|
appAvatar: appInfo?.app_avatar ?? "",
|
|
288
|
-
appDescription: safeEscape(appInfo?.app_description ?? "")
|
|
289
|
+
appDescription: safeEscape(appInfo?.app_description ?? ""),
|
|
290
|
+
environment
|
|
289
291
|
};
|
|
290
292
|
next();
|
|
291
293
|
}
|
|
@@ -298,6 +300,14 @@ ViewContextMiddleware = _ts_decorate3([
|
|
|
298
300
|
typeof PlatformHttpClient === "undefined" ? Object : PlatformHttpClient
|
|
299
301
|
])
|
|
300
302
|
], ViewContextMiddleware);
|
|
303
|
+
function mapToWindowEnvironment(input) {
|
|
304
|
+
const value = (input || "").trim().toLowerCase();
|
|
305
|
+
if (value === "boe") return "staging";
|
|
306
|
+
if (value === "pre") return "gray";
|
|
307
|
+
if (value === "online") return "online";
|
|
308
|
+
return "online";
|
|
309
|
+
}
|
|
310
|
+
__name(mapToWindowEnvironment, "mapToWindowEnvironment");
|
|
301
311
|
|
|
302
312
|
// src/middlewares/csrf_token/index.ts
|
|
303
313
|
var import_common4 = require("@nestjs/common");
|
|
@@ -842,8 +852,7 @@ var PlatformModule = class _PlatformModule {
|
|
|
842
852
|
import_nestjs_capability.CapabilityModule.forRoot({
|
|
843
853
|
capabilitiesDir: options.capabilitiesDir,
|
|
844
854
|
enableWatching: process.env.NODE_ENV === "development"
|
|
845
|
-
})
|
|
846
|
-
import_nestjs_integration.IntegrationModule
|
|
855
|
+
})
|
|
847
856
|
],
|
|
848
857
|
providers: [
|
|
849
858
|
{
|
|
@@ -951,7 +960,6 @@ var import_nestjs_openapi_devtools2 = require("@lark-apaas/nestjs-openapi-devtoo
|
|
|
951
960
|
__reExport(index_exports, require("@lark-apaas/nestjs-authnpaas"), module.exports);
|
|
952
961
|
__reExport(index_exports, require("@lark-apaas/nestjs-capability"), module.exports);
|
|
953
962
|
__reExport(index_exports, require("@lark-apaas/nestjs-datapaas"), module.exports);
|
|
954
|
-
__reExport(index_exports, require("@lark-apaas/nestjs-integration"), module.exports);
|
|
955
963
|
__reExport(index_exports, require("@lark-apaas/nestjs-observable"), module.exports);
|
|
956
964
|
__reExport(index_exports, require("@lark-apaas/nestjs-trigger"), module.exports);
|
|
957
965
|
var import_nestjs_common5 = require("@lark-apaas/nestjs-common");
|
|
@@ -969,7 +977,6 @@ var import_nestjs_common5 = require("@lark-apaas/nestjs-common");
|
|
|
969
977
|
...require("@lark-apaas/nestjs-authnpaas"),
|
|
970
978
|
...require("@lark-apaas/nestjs-capability"),
|
|
971
979
|
...require("@lark-apaas/nestjs-datapaas"),
|
|
972
|
-
...require("@lark-apaas/nestjs-integration"),
|
|
973
980
|
...require("@lark-apaas/nestjs-observable"),
|
|
974
981
|
...require("@lark-apaas/nestjs-trigger")
|
|
975
982
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -8,7 +8,6 @@ export { AutoTrace } from '@lark-apaas/nestjs-common';
|
|
|
8
8
|
export * from '@lark-apaas/nestjs-authnpaas';
|
|
9
9
|
export * from '@lark-apaas/nestjs-capability';
|
|
10
10
|
export * from '@lark-apaas/nestjs-datapaas';
|
|
11
|
-
export * from '@lark-apaas/nestjs-integration';
|
|
12
11
|
export * from '@lark-apaas/nestjs-observable';
|
|
13
12
|
export * from '@lark-apaas/nestjs-trigger';
|
|
14
13
|
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ export { AutoTrace } from '@lark-apaas/nestjs-common';
|
|
|
8
8
|
export * from '@lark-apaas/nestjs-authnpaas';
|
|
9
9
|
export * from '@lark-apaas/nestjs-capability';
|
|
10
10
|
export * from '@lark-apaas/nestjs-datapaas';
|
|
11
|
-
export * from '@lark-apaas/nestjs-integration';
|
|
12
11
|
export * from '@lark-apaas/nestjs-observable';
|
|
13
12
|
export * from '@lark-apaas/nestjs-trigger';
|
|
14
13
|
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,6 @@ import { LoggerModule, AppLogger as AppLogger2, LoggerContextMiddleware } from "
|
|
|
12
12
|
import { DataPaasModule, SqlExecutionContextMiddleware } from "@lark-apaas/nestjs-datapaas";
|
|
13
13
|
import { AuthNPaasModule } from "@lark-apaas/nestjs-authnpaas";
|
|
14
14
|
import { AutomationModule } from "@lark-apaas/nestjs-trigger";
|
|
15
|
-
import { IntegrationModule } from "@lark-apaas/nestjs-integration";
|
|
16
15
|
import { PLATFORM_HTTP_CLIENT as PLATFORM_HTTP_CLIENT2 } from "@lark-apaas/nestjs-common";
|
|
17
16
|
import { CapabilityModule } from "@lark-apaas/nestjs-capability";
|
|
18
17
|
|
|
@@ -225,6 +224,7 @@ var ViewContextMiddleware = class _ViewContextMiddleware {
|
|
|
225
224
|
const { userId, tenantId, appId } = req.userContext;
|
|
226
225
|
const csrfToken = req.csrfToken;
|
|
227
226
|
const appInfo = await this.getAppInfo(appId);
|
|
227
|
+
const environment = mapToWindowEnvironment(process.env.FORCE_FRAMEWORK_ENVIRONMENT);
|
|
228
228
|
req.__platform_data__ = {
|
|
229
229
|
csrfToken: csrfToken ?? "",
|
|
230
230
|
userId: userId ?? "",
|
|
@@ -232,7 +232,8 @@ var ViewContextMiddleware = class _ViewContextMiddleware {
|
|
|
232
232
|
appName: safeEscape(appInfo?.app_name ?? "\u5999\u642D\u5E94\u7528"),
|
|
233
233
|
appAvatar: appInfo?.app_avatar ?? "",
|
|
234
234
|
appDescription: safeEscape(appInfo?.app_description ?? ""),
|
|
235
|
-
tenantId
|
|
235
|
+
tenantId,
|
|
236
|
+
environment
|
|
236
237
|
};
|
|
237
238
|
res.locals = {
|
|
238
239
|
...res.locals ?? {},
|
|
@@ -242,7 +243,8 @@ var ViewContextMiddleware = class _ViewContextMiddleware {
|
|
|
242
243
|
appId: appId ?? "",
|
|
243
244
|
appName: safeEscape(appInfo?.app_name ?? "\u5999\u642D\u5E94\u7528"),
|
|
244
245
|
appAvatar: appInfo?.app_avatar ?? "",
|
|
245
|
-
appDescription: safeEscape(appInfo?.app_description ?? "")
|
|
246
|
+
appDescription: safeEscape(appInfo?.app_description ?? ""),
|
|
247
|
+
environment
|
|
246
248
|
};
|
|
247
249
|
next();
|
|
248
250
|
}
|
|
@@ -255,6 +257,14 @@ ViewContextMiddleware = _ts_decorate3([
|
|
|
255
257
|
typeof PlatformHttpClient === "undefined" ? Object : PlatformHttpClient
|
|
256
258
|
])
|
|
257
259
|
], ViewContextMiddleware);
|
|
260
|
+
function mapToWindowEnvironment(input) {
|
|
261
|
+
const value = (input || "").trim().toLowerCase();
|
|
262
|
+
if (value === "boe") return "staging";
|
|
263
|
+
if (value === "pre") return "gray";
|
|
264
|
+
if (value === "online") return "online";
|
|
265
|
+
return "online";
|
|
266
|
+
}
|
|
267
|
+
__name(mapToWindowEnvironment, "mapToWindowEnvironment");
|
|
258
268
|
|
|
259
269
|
// src/middlewares/csrf_token/index.ts
|
|
260
270
|
import { Injectable as Injectable4 } from "@nestjs/common";
|
|
@@ -799,8 +809,7 @@ var PlatformModule = class _PlatformModule {
|
|
|
799
809
|
CapabilityModule.forRoot({
|
|
800
810
|
capabilitiesDir: options.capabilitiesDir,
|
|
801
811
|
enableWatching: process.env.NODE_ENV === "development"
|
|
802
|
-
})
|
|
803
|
-
IntegrationModule
|
|
812
|
+
})
|
|
804
813
|
],
|
|
805
814
|
providers: [
|
|
806
815
|
{
|
|
@@ -908,7 +917,6 @@ import { DevToolsModule, DevToolsV2Module as DevToolsV2Module2 } from "@lark-apa
|
|
|
908
917
|
export * from "@lark-apaas/nestjs-authnpaas";
|
|
909
918
|
export * from "@lark-apaas/nestjs-capability";
|
|
910
919
|
export * from "@lark-apaas/nestjs-datapaas";
|
|
911
|
-
export * from "@lark-apaas/nestjs-integration";
|
|
912
920
|
export * from "@lark-apaas/nestjs-observable";
|
|
913
921
|
export * from "@lark-apaas/nestjs-trigger";
|
|
914
922
|
import { AutoTrace } from "@lark-apaas/nestjs-common";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lark-apaas/fullstack-nestjs-core",
|
|
3
|
-
"version": "1.1.18-alpha.
|
|
3
|
+
"version": "1.1.18-alpha.1",
|
|
4
4
|
"description": "FullStack Nestjs Core",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -44,7 +44,6 @@
|
|
|
44
44
|
"@lark-apaas/nestjs-capability": "^0.1.2",
|
|
45
45
|
"@lark-apaas/nestjs-common": "^0.1.2",
|
|
46
46
|
"@lark-apaas/nestjs-datapaas": "^1.0.8",
|
|
47
|
-
"@lark-apaas/nestjs-integration": "0.0.1-alpha.2",
|
|
48
47
|
"@lark-apaas/nestjs-logger": "^1.0.8",
|
|
49
48
|
"@lark-apaas/nestjs-observable": "^0.0.3",
|
|
50
49
|
"@lark-apaas/nestjs-openapi-devtools": "^1.0.9",
|