@lark-apaas/fullstack-nestjs-core 1.1.48-alpha.10 → 1.1.48-alpha.12
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 +4 -21
- package/dist/index.d.cts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +4 -21
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -34437,6 +34437,7 @@ 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");
|
|
34440
34441
|
var import_nestjs_trigger = require("@lark-apaas/nestjs-trigger");
|
|
34441
34442
|
var import_nestjs_common7 = require("@lark-apaas/nestjs-common");
|
|
34442
34443
|
var import_nestjs_capability = require("@lark-apaas/nestjs-capability");
|
|
@@ -35209,27 +35210,6 @@ var PlatformHttpClientService = class _PlatformHttpClientService {
|
|
|
35209
35210
|
"x-tt-env": ttEnv
|
|
35210
35211
|
};
|
|
35211
35212
|
}
|
|
35212
|
-
const userId = this.requestContext.get("userId");
|
|
35213
|
-
const tenantIdRaw = this.requestContext.get("tenantId");
|
|
35214
|
-
const contextClaims = {};
|
|
35215
|
-
if (userId) {
|
|
35216
|
-
contextClaims.user_id = userId;
|
|
35217
|
-
}
|
|
35218
|
-
if (tenantIdRaw !== void 0 && tenantIdRaw !== "") {
|
|
35219
|
-
const tenantIdNum = typeof tenantIdRaw === "number" ? tenantIdRaw : Number(tenantIdRaw);
|
|
35220
|
-
if (Number.isFinite(tenantIdNum)) {
|
|
35221
|
-
contextClaims.tenant_id = tenantIdNum;
|
|
35222
|
-
}
|
|
35223
|
-
}
|
|
35224
|
-
if (contextClaims.user_id !== void 0 || contextClaims.tenant_id !== void 0) {
|
|
35225
|
-
config.platformAuth = {
|
|
35226
|
-
...config.platformAuth,
|
|
35227
|
-
customClaims: {
|
|
35228
|
-
...contextClaims,
|
|
35229
|
-
...config.platformAuth?.customClaims || {}
|
|
35230
|
-
}
|
|
35231
|
-
};
|
|
35232
|
-
}
|
|
35233
35213
|
return config;
|
|
35234
35214
|
}, (error) => {
|
|
35235
35215
|
this.logger.error("Server SDK HTTP Request Error", error, "HttpService");
|
|
@@ -36392,6 +36372,9 @@ var PlatformModule = class _PlatformModule {
|
|
|
36392
36372
|
...options.authz || {}
|
|
36393
36373
|
}),
|
|
36394
36374
|
import_nestjs_trigger.AutomationModule.forRoot(),
|
|
36375
|
+
// 通用内网转发:自动注册 ALL /api/sdk_innerapi/anycross/forward?targetUrl=...
|
|
36376
|
+
// 业务方接入 PlatformModule 后零改动获得内网代理路由
|
|
36377
|
+
import_nestjs_http_forwarder.HttpForwarderModule.forRoot(options.httpForwarder),
|
|
36395
36378
|
import_nestjs_capability.CapabilityModule.forRoot({
|
|
36396
36379
|
capabilitiesDir: options.capabilitiesDir,
|
|
36397
36380
|
enableWatching: process.env.NODE_ENV === "development"
|
package/dist/index.d.cts
CHANGED
|
@@ -2,6 +2,7 @@ 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';
|
|
5
6
|
import { NestExpressApplication } from '@nestjs/platform-express';
|
|
6
7
|
import { PlatformHttpClient, RequestContextService, ObservableService } from '@lark-apaas/nestjs-common';
|
|
7
8
|
export { AutoTrace } from '@lark-apaas/nestjs-common';
|
|
@@ -78,6 +79,12 @@ interface PlatformModuleOptions {
|
|
|
78
79
|
* 可传入 permissionResolver 等选项,透传给 AuthZPaasModule.forRoot()
|
|
79
80
|
*/
|
|
80
81
|
authz?: AuthZPaasModuleOptions;
|
|
82
|
+
/**
|
|
83
|
+
* HttpForwarder 模块配置(默认自动启用,注册 ALL /api/sdk_innerapi/anycross/forward 路由)
|
|
84
|
+
* 透传给 HttpForwarderModule.forRoot();不传则使用模块默认值
|
|
85
|
+
* (requestTimeoutMs=30s, maxResponseBytes=10MB)。
|
|
86
|
+
*/
|
|
87
|
+
httpForwarder?: HttpForwarderModuleOptions;
|
|
81
88
|
}
|
|
82
89
|
|
|
83
90
|
declare class PlatformModule implements NestModule {
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ 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';
|
|
5
6
|
import { NestExpressApplication } from '@nestjs/platform-express';
|
|
6
7
|
import { PlatformHttpClient, RequestContextService, ObservableService } from '@lark-apaas/nestjs-common';
|
|
7
8
|
export { AutoTrace } from '@lark-apaas/nestjs-common';
|
|
@@ -78,6 +79,12 @@ interface PlatformModuleOptions {
|
|
|
78
79
|
* 可传入 permissionResolver 等选项,透传给 AuthZPaasModule.forRoot()
|
|
79
80
|
*/
|
|
80
81
|
authz?: AuthZPaasModuleOptions;
|
|
82
|
+
/**
|
|
83
|
+
* HttpForwarder 模块配置(默认自动启用,注册 ALL /api/sdk_innerapi/anycross/forward 路由)
|
|
84
|
+
* 透传给 HttpForwarderModule.forRoot();不传则使用模块默认值
|
|
85
|
+
* (requestTimeoutMs=30s, maxResponseBytes=10MB)。
|
|
86
|
+
*/
|
|
87
|
+
httpForwarder?: HttpForwarderModuleOptions;
|
|
81
88
|
}
|
|
82
89
|
|
|
83
90
|
declare class PlatformModule implements NestModule {
|
package/dist/index.js
CHANGED
|
@@ -34410,6 +34410,7 @@ 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";
|
|
34413
34414
|
import { AutomationModule } from "@lark-apaas/nestjs-trigger";
|
|
34414
34415
|
import { PLATFORM_HTTP_CLIENT as PLATFORM_HTTP_CLIENT4 } from "@lark-apaas/nestjs-common";
|
|
34415
34416
|
import { CapabilityModule } from "@lark-apaas/nestjs-capability";
|
|
@@ -35182,27 +35183,6 @@ var PlatformHttpClientService = class _PlatformHttpClientService {
|
|
|
35182
35183
|
"x-tt-env": ttEnv
|
|
35183
35184
|
};
|
|
35184
35185
|
}
|
|
35185
|
-
const userId = this.requestContext.get("userId");
|
|
35186
|
-
const tenantIdRaw = this.requestContext.get("tenantId");
|
|
35187
|
-
const contextClaims = {};
|
|
35188
|
-
if (userId) {
|
|
35189
|
-
contextClaims.user_id = userId;
|
|
35190
|
-
}
|
|
35191
|
-
if (tenantIdRaw !== void 0 && tenantIdRaw !== "") {
|
|
35192
|
-
const tenantIdNum = typeof tenantIdRaw === "number" ? tenantIdRaw : Number(tenantIdRaw);
|
|
35193
|
-
if (Number.isFinite(tenantIdNum)) {
|
|
35194
|
-
contextClaims.tenant_id = tenantIdNum;
|
|
35195
|
-
}
|
|
35196
|
-
}
|
|
35197
|
-
if (contextClaims.user_id !== void 0 || contextClaims.tenant_id !== void 0) {
|
|
35198
|
-
config.platformAuth = {
|
|
35199
|
-
...config.platformAuth,
|
|
35200
|
-
customClaims: {
|
|
35201
|
-
...contextClaims,
|
|
35202
|
-
...config.platformAuth?.customClaims || {}
|
|
35203
|
-
}
|
|
35204
|
-
};
|
|
35205
|
-
}
|
|
35206
35186
|
return config;
|
|
35207
35187
|
}, (error) => {
|
|
35208
35188
|
this.logger.error("Server SDK HTTP Request Error", error, "HttpService");
|
|
@@ -36365,6 +36345,9 @@ var PlatformModule = class _PlatformModule {
|
|
|
36365
36345
|
...options.authz || {}
|
|
36366
36346
|
}),
|
|
36367
36347
|
AutomationModule.forRoot(),
|
|
36348
|
+
// 通用内网转发:自动注册 ALL /api/sdk_innerapi/anycross/forward?targetUrl=...
|
|
36349
|
+
// 业务方接入 PlatformModule 后零改动获得内网代理路由
|
|
36350
|
+
HttpForwarderModule.forRoot(options.httpForwarder),
|
|
36368
36351
|
CapabilityModule.forRoot({
|
|
36369
36352
|
capabilitiesDir: options.capabilitiesDir,
|
|
36370
36353
|
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.48-alpha.
|
|
3
|
+
"version": "1.1.48-alpha.12",
|
|
4
4
|
"description": "FullStack Nestjs Core",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -46,6 +46,7 @@
|
|
|
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.19",
|
|
49
|
+
"@lark-apaas/nestjs-http-forwarder": "0.1.3-alpha.3",
|
|
49
50
|
"@lark-apaas/nestjs-logger": "^1.0.16",
|
|
50
51
|
"@lark-apaas/nestjs-observable": "^0.0.11",
|
|
51
52
|
"@lark-apaas/nestjs-openapi-devtools": "^1.0.10",
|