@lark-apaas/fullstack-nestjs-core 1.1.48-alpha.0 → 1.1.48-alpha.10
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 +8 -18
- package/dist/index.d.cts +0 -3
- package/dist/index.d.ts +0 -3
- package/dist/index.js +9 -19
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -35073,9 +35073,6 @@ var PlatformHttpClientService = class _PlatformHttpClientService {
|
|
|
35073
35073
|
client;
|
|
35074
35074
|
protectedClient;
|
|
35075
35075
|
logger = new import_common8.Logger(_PlatformHttpClientService.name);
|
|
35076
|
-
defaultPlatformConfig = {
|
|
35077
|
-
enabled: true
|
|
35078
|
-
};
|
|
35079
35076
|
constructor(requestContext) {
|
|
35080
35077
|
this.requestContext = requestContext;
|
|
35081
35078
|
const baseConfig = {
|
|
@@ -35083,11 +35080,12 @@ var PlatformHttpClientService = class _PlatformHttpClientService {
|
|
|
35083
35080
|
};
|
|
35084
35081
|
this.client = new import_http_client.HttpClient({
|
|
35085
35082
|
...baseConfig,
|
|
35086
|
-
|
|
35083
|
+
platform: {
|
|
35084
|
+
enabled: true
|
|
35085
|
+
}
|
|
35087
35086
|
});
|
|
35088
35087
|
this.protectedClient = new ProtectedHttpClient(this.client);
|
|
35089
35088
|
this.registerGlobalInterceptors();
|
|
35090
|
-
this.registerPlatformPluginForClient(this.client, this.defaultPlatformConfig);
|
|
35091
35089
|
}
|
|
35092
35090
|
/**
|
|
35093
35091
|
* 获取受保护的 HttpClient 实例(推荐)
|
|
@@ -35153,10 +35151,13 @@ var PlatformHttpClientService = class _PlatformHttpClientService {
|
|
|
35153
35151
|
...options?.config
|
|
35154
35152
|
};
|
|
35155
35153
|
const mergedPlatform = {
|
|
35156
|
-
|
|
35154
|
+
enabled: true,
|
|
35157
35155
|
...options?.platform
|
|
35158
35156
|
};
|
|
35159
|
-
return
|
|
35157
|
+
return new import_http_client.HttpClient({
|
|
35158
|
+
...mergedConfig,
|
|
35159
|
+
platform: mergedPlatform
|
|
35160
|
+
});
|
|
35160
35161
|
}
|
|
35161
35162
|
/**
|
|
35162
35163
|
* 创建一个带全局拦截器的独立 HttpClient 实例
|
|
@@ -35189,17 +35190,6 @@ var PlatformHttpClientService = class _PlatformHttpClientService {
|
|
|
35189
35190
|
registerGlobalInterceptors() {
|
|
35190
35191
|
this.registerInterceptorsForClient(this.client);
|
|
35191
35192
|
}
|
|
35192
|
-
createClientWithPlatform(config, platform) {
|
|
35193
|
-
const client = new import_http_client.HttpClient({
|
|
35194
|
-
...config,
|
|
35195
|
-
baseURL: (0, import_http_client.resolvePlatformBaseURL)(platform)
|
|
35196
|
-
});
|
|
35197
|
-
this.registerPlatformPluginForClient(client, platform);
|
|
35198
|
-
return client;
|
|
35199
|
-
}
|
|
35200
|
-
registerPlatformPluginForClient(client, platform) {
|
|
35201
|
-
(0, import_http_client.registerPlatformPlugin)(client.interceptors, platform);
|
|
35202
|
-
}
|
|
35203
35193
|
/**
|
|
35204
35194
|
* 为指定的 HttpClient 实例注册标准拦截器
|
|
35205
35195
|
*
|
package/dist/index.d.cts
CHANGED
|
@@ -308,7 +308,6 @@ declare class PlatformHttpClientService {
|
|
|
308
308
|
private readonly client;
|
|
309
309
|
private readonly protectedClient;
|
|
310
310
|
private readonly logger;
|
|
311
|
-
private readonly defaultPlatformConfig;
|
|
312
311
|
constructor(requestContext: RequestContextService);
|
|
313
312
|
/**
|
|
314
313
|
* 获取受保护的 HttpClient 实例(推荐)
|
|
@@ -390,8 +389,6 @@ declare class PlatformHttpClientService {
|
|
|
390
389
|
* 注册全局拦截器(用于单例实例)
|
|
391
390
|
*/
|
|
392
391
|
private registerGlobalInterceptors;
|
|
393
|
-
private createClientWithPlatform;
|
|
394
|
-
private registerPlatformPluginForClient;
|
|
395
392
|
/**
|
|
396
393
|
* 为指定的 HttpClient 实例注册标准拦截器
|
|
397
394
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -308,7 +308,6 @@ declare class PlatformHttpClientService {
|
|
|
308
308
|
private readonly client;
|
|
309
309
|
private readonly protectedClient;
|
|
310
310
|
private readonly logger;
|
|
311
|
-
private readonly defaultPlatformConfig;
|
|
312
311
|
constructor(requestContext: RequestContextService);
|
|
313
312
|
/**
|
|
314
313
|
* 获取受保护的 HttpClient 实例(推荐)
|
|
@@ -390,8 +389,6 @@ declare class PlatformHttpClientService {
|
|
|
390
389
|
* 注册全局拦截器(用于单例实例)
|
|
391
390
|
*/
|
|
392
391
|
private registerGlobalInterceptors;
|
|
393
|
-
private createClientWithPlatform;
|
|
394
|
-
private registerPlatformPluginForClient;
|
|
395
392
|
/**
|
|
396
393
|
* 为指定的 HttpClient 实例注册标准拦截器
|
|
397
394
|
*
|
package/dist/index.js
CHANGED
|
@@ -34998,7 +34998,7 @@ FrameworkDebugMiddleware = _ts_decorate7([
|
|
|
34998
34998
|
|
|
34999
34999
|
// src/services/platform-http-client.service.ts
|
|
35000
35000
|
import { Injectable as Injectable8, Logger as Logger2 } from "@nestjs/common";
|
|
35001
|
-
import { HttpClient
|
|
35001
|
+
import { HttpClient } from "@lark-apaas/http-client";
|
|
35002
35002
|
import { RequestContextService as RequestContextService2 } from "@lark-apaas/nestjs-common";
|
|
35003
35003
|
function _ts_decorate8(decorators, target, key, desc) {
|
|
35004
35004
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -35046,9 +35046,6 @@ var PlatformHttpClientService = class _PlatformHttpClientService {
|
|
|
35046
35046
|
client;
|
|
35047
35047
|
protectedClient;
|
|
35048
35048
|
logger = new Logger2(_PlatformHttpClientService.name);
|
|
35049
|
-
defaultPlatformConfig = {
|
|
35050
|
-
enabled: true
|
|
35051
|
-
};
|
|
35052
35049
|
constructor(requestContext) {
|
|
35053
35050
|
this.requestContext = requestContext;
|
|
35054
35051
|
const baseConfig = {
|
|
@@ -35056,11 +35053,12 @@ var PlatformHttpClientService = class _PlatformHttpClientService {
|
|
|
35056
35053
|
};
|
|
35057
35054
|
this.client = new HttpClient({
|
|
35058
35055
|
...baseConfig,
|
|
35059
|
-
|
|
35056
|
+
platform: {
|
|
35057
|
+
enabled: true
|
|
35058
|
+
}
|
|
35060
35059
|
});
|
|
35061
35060
|
this.protectedClient = new ProtectedHttpClient(this.client);
|
|
35062
35061
|
this.registerGlobalInterceptors();
|
|
35063
|
-
this.registerPlatformPluginForClient(this.client, this.defaultPlatformConfig);
|
|
35064
35062
|
}
|
|
35065
35063
|
/**
|
|
35066
35064
|
* 获取受保护的 HttpClient 实例(推荐)
|
|
@@ -35126,10 +35124,13 @@ var PlatformHttpClientService = class _PlatformHttpClientService {
|
|
|
35126
35124
|
...options?.config
|
|
35127
35125
|
};
|
|
35128
35126
|
const mergedPlatform = {
|
|
35129
|
-
|
|
35127
|
+
enabled: true,
|
|
35130
35128
|
...options?.platform
|
|
35131
35129
|
};
|
|
35132
|
-
return
|
|
35130
|
+
return new HttpClient({
|
|
35131
|
+
...mergedConfig,
|
|
35132
|
+
platform: mergedPlatform
|
|
35133
|
+
});
|
|
35133
35134
|
}
|
|
35134
35135
|
/**
|
|
35135
35136
|
* 创建一个带全局拦截器的独立 HttpClient 实例
|
|
@@ -35162,17 +35163,6 @@ var PlatformHttpClientService = class _PlatformHttpClientService {
|
|
|
35162
35163
|
registerGlobalInterceptors() {
|
|
35163
35164
|
this.registerInterceptorsForClient(this.client);
|
|
35164
35165
|
}
|
|
35165
|
-
createClientWithPlatform(config, platform) {
|
|
35166
|
-
const client = new HttpClient({
|
|
35167
|
-
...config,
|
|
35168
|
-
baseURL: resolvePlatformBaseURL(platform)
|
|
35169
|
-
});
|
|
35170
|
-
this.registerPlatformPluginForClient(client, platform);
|
|
35171
|
-
return client;
|
|
35172
|
-
}
|
|
35173
|
-
registerPlatformPluginForClient(client, platform) {
|
|
35174
|
-
registerPlatformPlugin(client.interceptors, platform);
|
|
35175
|
-
}
|
|
35176
35166
|
/**
|
|
35177
35167
|
* 为指定的 HttpClient 实例注册标准拦截器
|
|
35178
35168
|
*
|