@lark-apaas/fullstack-nestjs-core 1.1.48-alpha.11 → 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 +5 -37
- package/dist/index.d.cts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +5 -37
- package/package.json +3 -2
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");
|
|
@@ -35082,9 +35083,6 @@ var PlatformHttpClientService = class _PlatformHttpClientService {
|
|
|
35082
35083
|
...baseConfig,
|
|
35083
35084
|
platform: {
|
|
35084
35085
|
enabled: true
|
|
35085
|
-
},
|
|
35086
|
-
preInterceptors: {
|
|
35087
|
-
request: this.createClaimsPreInterceptors()
|
|
35088
35086
|
}
|
|
35089
35087
|
});
|
|
35090
35088
|
this.protectedClient = new ProtectedHttpClient(this.client);
|
|
@@ -35159,10 +35157,7 @@ var PlatformHttpClientService = class _PlatformHttpClientService {
|
|
|
35159
35157
|
};
|
|
35160
35158
|
return new import_http_client.HttpClient({
|
|
35161
35159
|
...mergedConfig,
|
|
35162
|
-
platform: mergedPlatform
|
|
35163
|
-
preInterceptors: {
|
|
35164
|
-
request: this.createClaimsPreInterceptors()
|
|
35165
|
-
}
|
|
35160
|
+
platform: mergedPlatform
|
|
35166
35161
|
});
|
|
35167
35162
|
}
|
|
35168
35163
|
/**
|
|
@@ -35190,36 +35185,6 @@ var PlatformHttpClientService = class _PlatformHttpClientService {
|
|
|
35190
35185
|
this.registerInterceptorsForClient(client);
|
|
35191
35186
|
return client;
|
|
35192
35187
|
}
|
|
35193
|
-
createClaimsPreInterceptors() {
|
|
35194
|
-
return [
|
|
35195
|
-
{
|
|
35196
|
-
onFulfilled: /* @__PURE__ */ __name((config) => {
|
|
35197
|
-
const userId = this.requestContext.get("userId");
|
|
35198
|
-
const tenantId = this.requestContext.get("tenantId");
|
|
35199
|
-
const contextClaims = {};
|
|
35200
|
-
if (userId) {
|
|
35201
|
-
contextClaims.user_id = userId;
|
|
35202
|
-
}
|
|
35203
|
-
if (tenantId) {
|
|
35204
|
-
contextClaims.tenant_id = tenantId;
|
|
35205
|
-
}
|
|
35206
|
-
if (contextClaims.user_id === void 0 && contextClaims.tenant_id === void 0) {
|
|
35207
|
-
return config;
|
|
35208
|
-
}
|
|
35209
|
-
return {
|
|
35210
|
-
...config,
|
|
35211
|
-
platformAuth: {
|
|
35212
|
-
...config.platformAuth,
|
|
35213
|
-
customClaims: {
|
|
35214
|
-
...contextClaims,
|
|
35215
|
-
...config.platformAuth?.customClaims || {}
|
|
35216
|
-
}
|
|
35217
|
-
}
|
|
35218
|
-
};
|
|
35219
|
-
}, "onFulfilled")
|
|
35220
|
-
}
|
|
35221
|
-
];
|
|
35222
|
-
}
|
|
35223
35188
|
/**
|
|
35224
35189
|
* 注册全局拦截器(用于单例实例)
|
|
35225
35190
|
*/
|
|
@@ -36407,6 +36372,9 @@ var PlatformModule = class _PlatformModule {
|
|
|
36407
36372
|
...options.authz || {}
|
|
36408
36373
|
}),
|
|
36409
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),
|
|
36410
36378
|
import_nestjs_capability.CapabilityModule.forRoot({
|
|
36411
36379
|
capabilitiesDir: options.capabilitiesDir,
|
|
36412
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 {
|
|
@@ -385,7 +392,6 @@ declare class PlatformHttpClientService {
|
|
|
385
392
|
* ```
|
|
386
393
|
*/
|
|
387
394
|
createWithGlobalInterceptors(options?: PlatformHttpClientOptions): HttpClient;
|
|
388
|
-
private createClaimsPreInterceptors;
|
|
389
395
|
/**
|
|
390
396
|
* 注册全局拦截器(用于单例实例)
|
|
391
397
|
*/
|
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 {
|
|
@@ -385,7 +392,6 @@ declare class PlatformHttpClientService {
|
|
|
385
392
|
* ```
|
|
386
393
|
*/
|
|
387
394
|
createWithGlobalInterceptors(options?: PlatformHttpClientOptions): HttpClient;
|
|
388
|
-
private createClaimsPreInterceptors;
|
|
389
395
|
/**
|
|
390
396
|
* 注册全局拦截器(用于单例实例)
|
|
391
397
|
*/
|
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";
|
|
@@ -35055,9 +35056,6 @@ var PlatformHttpClientService = class _PlatformHttpClientService {
|
|
|
35055
35056
|
...baseConfig,
|
|
35056
35057
|
platform: {
|
|
35057
35058
|
enabled: true
|
|
35058
|
-
},
|
|
35059
|
-
preInterceptors: {
|
|
35060
|
-
request: this.createClaimsPreInterceptors()
|
|
35061
35059
|
}
|
|
35062
35060
|
});
|
|
35063
35061
|
this.protectedClient = new ProtectedHttpClient(this.client);
|
|
@@ -35132,10 +35130,7 @@ var PlatformHttpClientService = class _PlatformHttpClientService {
|
|
|
35132
35130
|
};
|
|
35133
35131
|
return new HttpClient({
|
|
35134
35132
|
...mergedConfig,
|
|
35135
|
-
platform: mergedPlatform
|
|
35136
|
-
preInterceptors: {
|
|
35137
|
-
request: this.createClaimsPreInterceptors()
|
|
35138
|
-
}
|
|
35133
|
+
platform: mergedPlatform
|
|
35139
35134
|
});
|
|
35140
35135
|
}
|
|
35141
35136
|
/**
|
|
@@ -35163,36 +35158,6 @@ var PlatformHttpClientService = class _PlatformHttpClientService {
|
|
|
35163
35158
|
this.registerInterceptorsForClient(client);
|
|
35164
35159
|
return client;
|
|
35165
35160
|
}
|
|
35166
|
-
createClaimsPreInterceptors() {
|
|
35167
|
-
return [
|
|
35168
|
-
{
|
|
35169
|
-
onFulfilled: /* @__PURE__ */ __name((config) => {
|
|
35170
|
-
const userId = this.requestContext.get("userId");
|
|
35171
|
-
const tenantId = this.requestContext.get("tenantId");
|
|
35172
|
-
const contextClaims = {};
|
|
35173
|
-
if (userId) {
|
|
35174
|
-
contextClaims.user_id = userId;
|
|
35175
|
-
}
|
|
35176
|
-
if (tenantId) {
|
|
35177
|
-
contextClaims.tenant_id = tenantId;
|
|
35178
|
-
}
|
|
35179
|
-
if (contextClaims.user_id === void 0 && contextClaims.tenant_id === void 0) {
|
|
35180
|
-
return config;
|
|
35181
|
-
}
|
|
35182
|
-
return {
|
|
35183
|
-
...config,
|
|
35184
|
-
platformAuth: {
|
|
35185
|
-
...config.platformAuth,
|
|
35186
|
-
customClaims: {
|
|
35187
|
-
...contextClaims,
|
|
35188
|
-
...config.platformAuth?.customClaims || {}
|
|
35189
|
-
}
|
|
35190
|
-
}
|
|
35191
|
-
};
|
|
35192
|
-
}, "onFulfilled")
|
|
35193
|
-
}
|
|
35194
|
-
];
|
|
35195
|
-
}
|
|
35196
35161
|
/**
|
|
35197
35162
|
* 注册全局拦截器(用于单例实例)
|
|
35198
35163
|
*/
|
|
@@ -36380,6 +36345,9 @@ var PlatformModule = class _PlatformModule {
|
|
|
36380
36345
|
...options.authz || {}
|
|
36381
36346
|
}),
|
|
36382
36347
|
AutomationModule.forRoot(),
|
|
36348
|
+
// 通用内网转发:自动注册 ALL /api/sdk_innerapi/anycross/forward?targetUrl=...
|
|
36349
|
+
// 业务方接入 PlatformModule 后零改动获得内网代理路由
|
|
36350
|
+
HttpForwarderModule.forRoot(options.httpForwarder),
|
|
36383
36351
|
CapabilityModule.forRoot({
|
|
36384
36352
|
capabilitiesDir: options.capabilitiesDir,
|
|
36385
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",
|
|
@@ -40,12 +40,13 @@
|
|
|
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.5",
|
|
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.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",
|