@lark-apaas/fullstack-nestjs-core 1.1.48-alpha.13 → 1.1.48-alpha.14
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 +1 -13
- package/dist/index.d.cts +0 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.js +1 -13
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -34651,7 +34651,6 @@ var ViewContextMiddleware = class _ViewContextMiddleware {
|
|
|
34651
34651
|
const { userId, tenantId, appId, loginUrl, userType } = req.userContext;
|
|
34652
34652
|
const csrfToken = req.csrfToken;
|
|
34653
34653
|
const environment = mapToWindowEnvironment(process.env.FORCE_FRAMEWORK_ENVIRONMENT);
|
|
34654
|
-
const basename = resolveBasename(req, appId);
|
|
34655
34654
|
const appPublishedData = await this.getAppPublished(appId);
|
|
34656
34655
|
const appInfo = appPublishedData?.app_info ?? null;
|
|
34657
34656
|
req.__platform_data__ = {
|
|
@@ -34666,8 +34665,7 @@ var ViewContextMiddleware = class _ViewContextMiddleware {
|
|
|
34666
34665
|
tenantId,
|
|
34667
34666
|
environment,
|
|
34668
34667
|
showBadge: appInfo?.show_badge !== false,
|
|
34669
|
-
appPublished: appPublishedData ?? null
|
|
34670
|
-
basename
|
|
34668
|
+
appPublished: appPublishedData ?? null
|
|
34671
34669
|
};
|
|
34672
34670
|
res.locals = {
|
|
34673
34671
|
...res.locals ?? {},
|
|
@@ -34701,16 +34699,6 @@ function mapToWindowEnvironment(input) {
|
|
|
34701
34699
|
return "online";
|
|
34702
34700
|
}
|
|
34703
34701
|
__name(mapToWindowEnvironment, "mapToWindowEnvironment");
|
|
34704
|
-
var CUSTOM_DOMAINS = new Set((process.env.CUSTOM_DOMAINS || "").split(",").map((d) => d.trim()).filter(Boolean));
|
|
34705
|
-
function resolveBasename(req, appId) {
|
|
34706
|
-
const headerValue = req.headers["x-app-basename"];
|
|
34707
|
-
if (typeof headerValue === "string" && headerValue) return headerValue;
|
|
34708
|
-
if (CUSTOM_DOMAINS.size > 0 && CUSTOM_DOMAINS.has(req.hostname)) {
|
|
34709
|
-
return "/";
|
|
34710
|
-
}
|
|
34711
|
-
return appId ? `/app/${appId}` : "/";
|
|
34712
|
-
}
|
|
34713
|
-
__name(resolveBasename, "resolveBasename");
|
|
34714
34702
|
|
|
34715
34703
|
// src/middlewares/csrf_token/index.ts
|
|
34716
34704
|
var import_common4 = require("@nestjs/common");
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -34624,7 +34624,6 @@ var ViewContextMiddleware = class _ViewContextMiddleware {
|
|
|
34624
34624
|
const { userId, tenantId, appId, loginUrl, userType } = req.userContext;
|
|
34625
34625
|
const csrfToken = req.csrfToken;
|
|
34626
34626
|
const environment = mapToWindowEnvironment(process.env.FORCE_FRAMEWORK_ENVIRONMENT);
|
|
34627
|
-
const basename = resolveBasename(req, appId);
|
|
34628
34627
|
const appPublishedData = await this.getAppPublished(appId);
|
|
34629
34628
|
const appInfo = appPublishedData?.app_info ?? null;
|
|
34630
34629
|
req.__platform_data__ = {
|
|
@@ -34639,8 +34638,7 @@ var ViewContextMiddleware = class _ViewContextMiddleware {
|
|
|
34639
34638
|
tenantId,
|
|
34640
34639
|
environment,
|
|
34641
34640
|
showBadge: appInfo?.show_badge !== false,
|
|
34642
|
-
appPublished: appPublishedData ?? null
|
|
34643
|
-
basename
|
|
34641
|
+
appPublished: appPublishedData ?? null
|
|
34644
34642
|
};
|
|
34645
34643
|
res.locals = {
|
|
34646
34644
|
...res.locals ?? {},
|
|
@@ -34674,16 +34672,6 @@ function mapToWindowEnvironment(input) {
|
|
|
34674
34672
|
return "online";
|
|
34675
34673
|
}
|
|
34676
34674
|
__name(mapToWindowEnvironment, "mapToWindowEnvironment");
|
|
34677
|
-
var CUSTOM_DOMAINS = new Set((process.env.CUSTOM_DOMAINS || "").split(",").map((d) => d.trim()).filter(Boolean));
|
|
34678
|
-
function resolveBasename(req, appId) {
|
|
34679
|
-
const headerValue = req.headers["x-app-basename"];
|
|
34680
|
-
if (typeof headerValue === "string" && headerValue) return headerValue;
|
|
34681
|
-
if (CUSTOM_DOMAINS.size > 0 && CUSTOM_DOMAINS.has(req.hostname)) {
|
|
34682
|
-
return "/";
|
|
34683
|
-
}
|
|
34684
|
-
return appId ? `/app/${appId}` : "/";
|
|
34685
|
-
}
|
|
34686
|
-
__name(resolveBasename, "resolveBasename");
|
|
34687
34675
|
|
|
34688
34676
|
// src/middlewares/csrf_token/index.ts
|
|
34689
34677
|
import { Injectable as Injectable4 } from "@nestjs/common";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lark-apaas/fullstack-nestjs-core",
|
|
3
|
-
"version": "1.1.48-alpha.
|
|
3
|
+
"version": "1.1.48-alpha.14",
|
|
4
4
|
"description": "FullStack Nestjs Core",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@lark-apaas/nestjs-authzpaas": "^0.1.8",
|
|
46
46
|
"@lark-apaas/nestjs-capability": "^0.1.13",
|
|
47
47
|
"@lark-apaas/nestjs-common": "^0.1.8",
|
|
48
|
-
"@lark-apaas/nestjs-datapaas": "
|
|
48
|
+
"@lark-apaas/nestjs-datapaas": "1.0.20-alpha.2",
|
|
49
49
|
"@lark-apaas/nestjs-logger": "^1.0.16",
|
|
50
50
|
"@lark-apaas/nestjs-observable": "^0.0.11",
|
|
51
51
|
"@lark-apaas/nestjs-openapi-devtools": "^1.0.10",
|