@lark-apaas/fullstack-nestjs-core 1.1.50-alpha.2 → 1.1.50-alpha.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 +7 -8
- package/dist/index.d.cts +2 -7
- package/dist/index.d.ts +2 -7
- package/dist/index.js +7 -8
- package/package.json +2 -3
package/dist/index.cjs
CHANGED
|
@@ -34437,7 +34437,6 @@ var import_axios2 = require("@nestjs/axios");
|
|
|
34437
34437
|
var import_nestjs_logger2 = require("@lark-apaas/nestjs-logger");
|
|
34438
34438
|
var import_nestjs_datapaas = require("@lark-apaas/nestjs-datapaas");
|
|
34439
34439
|
var import_nestjs_authnpaas = require("@lark-apaas/nestjs-authnpaas");
|
|
34440
|
-
var import_nestjs_http_forwarder = require("@lark-apaas/nestjs-http-forwarder");
|
|
34441
34440
|
var import_nestjs_trigger = require("@lark-apaas/nestjs-trigger");
|
|
34442
34441
|
var import_nestjs_common7 = require("@lark-apaas/nestjs-common");
|
|
34443
34442
|
var import_nestjs_capability = require("@lark-apaas/nestjs-capability");
|
|
@@ -34554,7 +34553,7 @@ CsrfMiddleware = _ts_decorate2([
|
|
|
34554
34553
|
(0, import_common2.Injectable)()
|
|
34555
34554
|
], CsrfMiddleware);
|
|
34556
34555
|
|
|
34557
|
-
// src/middlewares/view-context/
|
|
34556
|
+
// src/middlewares/view-context/middleware.ts
|
|
34558
34557
|
var import_common3 = require("@nestjs/common");
|
|
34559
34558
|
var import_nestjs_common = require("@lark-apaas/nestjs-common");
|
|
34560
34559
|
|
|
@@ -34601,7 +34600,7 @@ function safeEscape(s) {
|
|
|
34601
34600
|
}
|
|
34602
34601
|
__name(safeEscape, "safeEscape");
|
|
34603
34602
|
|
|
34604
|
-
// src/middlewares/view-context/
|
|
34603
|
+
// src/middlewares/view-context/middleware.ts
|
|
34605
34604
|
function _ts_decorate3(decorators, target, key, desc) {
|
|
34606
34605
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
34607
34606
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -34652,6 +34651,7 @@ var ViewContextMiddleware = class _ViewContextMiddleware {
|
|
|
34652
34651
|
const { userId, tenantId, appId, loginUrl, userType } = req.userContext;
|
|
34653
34652
|
const csrfToken = req.csrfToken;
|
|
34654
34653
|
const environment = mapToWindowEnvironment(process.env.FORCE_FRAMEWORK_ENVIRONMENT);
|
|
34654
|
+
const basename = req.headers["x-miaoda-custom-host"] ? "/" : `/app/${appId || ""}`;
|
|
34655
34655
|
const appPublishedData = await this.getAppPublished(appId);
|
|
34656
34656
|
const appInfo = appPublishedData?.app_info ?? null;
|
|
34657
34657
|
req.__platform_data__ = {
|
|
@@ -34666,7 +34666,8 @@ var ViewContextMiddleware = class _ViewContextMiddleware {
|
|
|
34666
34666
|
tenantId,
|
|
34667
34667
|
environment,
|
|
34668
34668
|
showBadge: appInfo?.show_badge !== false,
|
|
34669
|
-
appPublished: appPublishedData ?? null
|
|
34669
|
+
appPublished: appPublishedData ?? null,
|
|
34670
|
+
basename
|
|
34670
34671
|
};
|
|
34671
34672
|
res.locals = {
|
|
34672
34673
|
...res.locals ?? {},
|
|
@@ -34679,7 +34680,8 @@ var ViewContextMiddleware = class _ViewContextMiddleware {
|
|
|
34679
34680
|
appName: safeEscape(appInfo?.app_name ?? "\u5999\u642D\u5E94\u7528"),
|
|
34680
34681
|
appAvatar: appInfo?.app_avatar ?? "",
|
|
34681
34682
|
appDescription: safeEscape(appInfo?.app_description ?? ""),
|
|
34682
|
-
environment
|
|
34683
|
+
environment,
|
|
34684
|
+
basename
|
|
34683
34685
|
};
|
|
34684
34686
|
next();
|
|
34685
34687
|
}
|
|
@@ -36404,9 +36406,6 @@ var PlatformModule = class _PlatformModule {
|
|
|
36404
36406
|
...options.authz || {}
|
|
36405
36407
|
}),
|
|
36406
36408
|
import_nestjs_trigger.AutomationModule.forRoot(),
|
|
36407
|
-
// 通用内网转发:自动注册 ALL /api/sdk_innerapi/anycross/forward?targetUrl=...
|
|
36408
|
-
// 业务方接入 PlatformModule 后零改动获得内网代理路由
|
|
36409
|
-
import_nestjs_http_forwarder.HttpForwarderModule.forRoot(options.httpForwarder),
|
|
36410
36409
|
import_nestjs_capability.CapabilityModule.forRoot({
|
|
36411
36410
|
capabilitiesDir: options.capabilitiesDir,
|
|
36412
36411
|
enableWatching: process.env.NODE_ENV === "development"
|
package/dist/index.d.cts
CHANGED
|
@@ -2,7 +2,6 @@ import { NestModule, DynamicModule, MiddlewareConsumer, OnModuleInit, NestMiddle
|
|
|
2
2
|
import { HttpClientConfig, PlatformPluginOptions, HttpClient } from '@lark-apaas/http-client';
|
|
3
3
|
import { AuthZPaasModuleOptions } from '@lark-apaas/nestjs-authzpaas';
|
|
4
4
|
export { AddMembersParams, AuthZPaasModule, AuthorizationSDK, Can, CanRole, ChatSimpleDTO, CommonParam, CreateRoleParams, CreateRoleResponse, DepartmentDTO, DepartmentEntity, DepartmentSimpleDTO, FilterParams, ForceRoleDTO, I18nText, IPermissionResolver, ListMembersParams, ListMembersResponse, ListRolesParams, MemberMutationData, MemberType, PERMISSION_RESOLVER_TOKEN, PermissionPoint, PermissionRequirement, PresetGroupDTO, RemoveMembersParams, RoleMemberDTO, SearchChatEntity, SearchParams, SearchResponse, SearchResult, SearchUserEntity, UpdateRoleParams, UserSimpleDTO } from '@lark-apaas/nestjs-authzpaas';
|
|
5
|
-
import { HttpForwarderModuleOptions } from '@lark-apaas/nestjs-http-forwarder';
|
|
6
5
|
import { NestExpressApplication } from '@nestjs/platform-express';
|
|
7
6
|
import { PlatformHttpClient, RequestContextService, ObservableService } from '@lark-apaas/nestjs-common';
|
|
8
7
|
export { AutoTrace } from '@lark-apaas/nestjs-common';
|
|
@@ -24,6 +23,8 @@ declare global {
|
|
|
24
23
|
userId?: string;
|
|
25
24
|
tenantId?: number;
|
|
26
25
|
csrfToken?: string;
|
|
26
|
+
/** React Router basename,由 ViewContextMiddleware 注入;自定义域名场景下 = / 或 /<alias>,默认域名 = /app/<appId> */
|
|
27
|
+
basename?: string;
|
|
27
28
|
[key: string]: unknown;
|
|
28
29
|
};
|
|
29
30
|
userContext: {
|
|
@@ -79,12 +80,6 @@ interface PlatformModuleOptions {
|
|
|
79
80
|
* 可传入 permissionResolver 等选项,透传给 AuthZPaasModule.forRoot()
|
|
80
81
|
*/
|
|
81
82
|
authz?: AuthZPaasModuleOptions;
|
|
82
|
-
/**
|
|
83
|
-
* HttpForwarder 模块配置(默认自动启用,注册 ALL /api/sdk_innerapi/anycross/forward 路由)
|
|
84
|
-
* 透传给 HttpForwarderModule.forRoot();不传则使用模块默认值
|
|
85
|
-
* (requestTimeoutMs=30s, maxResponseBytes=10MB)。
|
|
86
|
-
*/
|
|
87
|
-
httpForwarder?: HttpForwarderModuleOptions;
|
|
88
83
|
}
|
|
89
84
|
|
|
90
85
|
declare class PlatformModule implements NestModule {
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { NestModule, DynamicModule, MiddlewareConsumer, OnModuleInit, NestMiddle
|
|
|
2
2
|
import { HttpClientConfig, PlatformPluginOptions, HttpClient } from '@lark-apaas/http-client';
|
|
3
3
|
import { AuthZPaasModuleOptions } from '@lark-apaas/nestjs-authzpaas';
|
|
4
4
|
export { AddMembersParams, AuthZPaasModule, AuthorizationSDK, Can, CanRole, ChatSimpleDTO, CommonParam, CreateRoleParams, CreateRoleResponse, DepartmentDTO, DepartmentEntity, DepartmentSimpleDTO, FilterParams, ForceRoleDTO, I18nText, IPermissionResolver, ListMembersParams, ListMembersResponse, ListRolesParams, MemberMutationData, MemberType, PERMISSION_RESOLVER_TOKEN, PermissionPoint, PermissionRequirement, PresetGroupDTO, RemoveMembersParams, RoleMemberDTO, SearchChatEntity, SearchParams, SearchResponse, SearchResult, SearchUserEntity, UpdateRoleParams, UserSimpleDTO } from '@lark-apaas/nestjs-authzpaas';
|
|
5
|
-
import { HttpForwarderModuleOptions } from '@lark-apaas/nestjs-http-forwarder';
|
|
6
5
|
import { NestExpressApplication } from '@nestjs/platform-express';
|
|
7
6
|
import { PlatformHttpClient, RequestContextService, ObservableService } from '@lark-apaas/nestjs-common';
|
|
8
7
|
export { AutoTrace } from '@lark-apaas/nestjs-common';
|
|
@@ -24,6 +23,8 @@ declare global {
|
|
|
24
23
|
userId?: string;
|
|
25
24
|
tenantId?: number;
|
|
26
25
|
csrfToken?: string;
|
|
26
|
+
/** React Router basename,由 ViewContextMiddleware 注入;自定义域名场景下 = / 或 /<alias>,默认域名 = /app/<appId> */
|
|
27
|
+
basename?: string;
|
|
27
28
|
[key: string]: unknown;
|
|
28
29
|
};
|
|
29
30
|
userContext: {
|
|
@@ -79,12 +80,6 @@ interface PlatformModuleOptions {
|
|
|
79
80
|
* 可传入 permissionResolver 等选项,透传给 AuthZPaasModule.forRoot()
|
|
80
81
|
*/
|
|
81
82
|
authz?: AuthZPaasModuleOptions;
|
|
82
|
-
/**
|
|
83
|
-
* HttpForwarder 模块配置(默认自动启用,注册 ALL /api/sdk_innerapi/anycross/forward 路由)
|
|
84
|
-
* 透传给 HttpForwarderModule.forRoot();不传则使用模块默认值
|
|
85
|
-
* (requestTimeoutMs=30s, maxResponseBytes=10MB)。
|
|
86
|
-
*/
|
|
87
|
-
httpForwarder?: HttpForwarderModuleOptions;
|
|
88
83
|
}
|
|
89
84
|
|
|
90
85
|
declare class PlatformModule implements NestModule {
|
package/dist/index.js
CHANGED
|
@@ -34410,7 +34410,6 @@ import { HttpModule } from "@nestjs/axios";
|
|
|
34410
34410
|
import { LoggerModule, AppLogger as AppLogger2, LoggerContextMiddleware } from "@lark-apaas/nestjs-logger";
|
|
34411
34411
|
import { DataPaasModule, SqlExecutionContextMiddleware } from "@lark-apaas/nestjs-datapaas";
|
|
34412
34412
|
import { AuthNPaasModule } from "@lark-apaas/nestjs-authnpaas";
|
|
34413
|
-
import { HttpForwarderModule } from "@lark-apaas/nestjs-http-forwarder";
|
|
34414
34413
|
import { AutomationModule } from "@lark-apaas/nestjs-trigger";
|
|
34415
34414
|
import { PLATFORM_HTTP_CLIENT as PLATFORM_HTTP_CLIENT4 } from "@lark-apaas/nestjs-common";
|
|
34416
34415
|
import { CapabilityModule } from "@lark-apaas/nestjs-capability";
|
|
@@ -34527,7 +34526,7 @@ CsrfMiddleware = _ts_decorate2([
|
|
|
34527
34526
|
Injectable2()
|
|
34528
34527
|
], CsrfMiddleware);
|
|
34529
34528
|
|
|
34530
|
-
// src/middlewares/view-context/
|
|
34529
|
+
// src/middlewares/view-context/middleware.ts
|
|
34531
34530
|
import { Inject, Injectable as Injectable3, Logger } from "@nestjs/common";
|
|
34532
34531
|
import { PLATFORM_HTTP_CLIENT } from "@lark-apaas/nestjs-common";
|
|
34533
34532
|
|
|
@@ -34574,7 +34573,7 @@ function safeEscape(s) {
|
|
|
34574
34573
|
}
|
|
34575
34574
|
__name(safeEscape, "safeEscape");
|
|
34576
34575
|
|
|
34577
|
-
// src/middlewares/view-context/
|
|
34576
|
+
// src/middlewares/view-context/middleware.ts
|
|
34578
34577
|
function _ts_decorate3(decorators, target, key, desc) {
|
|
34579
34578
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
34580
34579
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -34625,6 +34624,7 @@ var ViewContextMiddleware = class _ViewContextMiddleware {
|
|
|
34625
34624
|
const { userId, tenantId, appId, loginUrl, userType } = req.userContext;
|
|
34626
34625
|
const csrfToken = req.csrfToken;
|
|
34627
34626
|
const environment = mapToWindowEnvironment(process.env.FORCE_FRAMEWORK_ENVIRONMENT);
|
|
34627
|
+
const basename = req.headers["x-miaoda-custom-host"] ? "/" : `/app/${appId || ""}`;
|
|
34628
34628
|
const appPublishedData = await this.getAppPublished(appId);
|
|
34629
34629
|
const appInfo = appPublishedData?.app_info ?? null;
|
|
34630
34630
|
req.__platform_data__ = {
|
|
@@ -34639,7 +34639,8 @@ var ViewContextMiddleware = class _ViewContextMiddleware {
|
|
|
34639
34639
|
tenantId,
|
|
34640
34640
|
environment,
|
|
34641
34641
|
showBadge: appInfo?.show_badge !== false,
|
|
34642
|
-
appPublished: appPublishedData ?? null
|
|
34642
|
+
appPublished: appPublishedData ?? null,
|
|
34643
|
+
basename
|
|
34643
34644
|
};
|
|
34644
34645
|
res.locals = {
|
|
34645
34646
|
...res.locals ?? {},
|
|
@@ -34652,7 +34653,8 @@ var ViewContextMiddleware = class _ViewContextMiddleware {
|
|
|
34652
34653
|
appName: safeEscape(appInfo?.app_name ?? "\u5999\u642D\u5E94\u7528"),
|
|
34653
34654
|
appAvatar: appInfo?.app_avatar ?? "",
|
|
34654
34655
|
appDescription: safeEscape(appInfo?.app_description ?? ""),
|
|
34655
|
-
environment
|
|
34656
|
+
environment,
|
|
34657
|
+
basename
|
|
34656
34658
|
};
|
|
34657
34659
|
next();
|
|
34658
34660
|
}
|
|
@@ -36377,9 +36379,6 @@ var PlatformModule = class _PlatformModule {
|
|
|
36377
36379
|
...options.authz || {}
|
|
36378
36380
|
}),
|
|
36379
36381
|
AutomationModule.forRoot(),
|
|
36380
|
-
// 通用内网转发:自动注册 ALL /api/sdk_innerapi/anycross/forward?targetUrl=...
|
|
36381
|
-
// 业务方接入 PlatformModule 后零改动获得内网代理路由
|
|
36382
|
-
HttpForwarderModule.forRoot(options.httpForwarder),
|
|
36383
36382
|
CapabilityModule.forRoot({
|
|
36384
36383
|
capabilitiesDir: options.capabilitiesDir,
|
|
36385
36384
|
enableWatching: process.env.NODE_ENV === "development"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lark-apaas/fullstack-nestjs-core",
|
|
3
|
-
"version": "1.1.50-alpha.
|
|
3
|
+
"version": "1.1.50-alpha.4",
|
|
4
4
|
"description": "FullStack Nestjs Core",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -40,13 +40,12 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@lark-apaas/file-service": "^0.1.2",
|
|
43
|
-
"@lark-apaas/http-client": "^0.1.
|
|
43
|
+
"@lark-apaas/http-client": "^0.1.6",
|
|
44
44
|
"@lark-apaas/nestjs-authnpaas": "^1.0.3",
|
|
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
48
|
"@lark-apaas/nestjs-datapaas": "^1.0.20",
|
|
49
|
-
"@lark-apaas/nestjs-http-forwarder": "0.1.3-alpha.6",
|
|
50
49
|
"@lark-apaas/nestjs-logger": "^1.0.16",
|
|
51
50
|
"@lark-apaas/nestjs-observable": "^0.0.11",
|
|
52
51
|
"@lark-apaas/nestjs-openapi-devtools": "^1.0.10",
|