@gopowerteam/request 0.1.17 → 0.1.19
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 +2 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/package.json +1 -2
package/dist/index.cjs
CHANGED
|
@@ -175,12 +175,13 @@ var _RequestService = class {
|
|
|
175
175
|
* @param {RequestPlugin[]} plugins 请求插件
|
|
176
176
|
* @returns
|
|
177
177
|
*/
|
|
178
|
-
async send(options,
|
|
178
|
+
async send(options, requestPlugins = []) {
|
|
179
179
|
if (!_RequestService.config) {
|
|
180
180
|
throw new Error("\u8BF7\u68C0\u67E5\u8BF7\u6C42\u914D\u7F6E\u662F\u5426\u5B8C\u6210");
|
|
181
181
|
}
|
|
182
182
|
let hasException = false;
|
|
183
183
|
const adapter = this.getRequestAdapter();
|
|
184
|
+
const plugins = requestPlugins.filter(Boolean);
|
|
184
185
|
const extraParams = await this.execRequestPlugin(plugins, options);
|
|
185
186
|
const response = await this.startRequest(adapter, options, extraParams).then((response2) => adapter.transformResponse(response2)).catch((exception) => {
|
|
186
187
|
hasException = true;
|
package/dist/index.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ declare class RequestService {
|
|
|
49
49
|
* @param {RequestPlugin[]} plugins 请求插件
|
|
50
50
|
* @returns
|
|
51
51
|
*/
|
|
52
|
-
send(options: RequestSendOptions,
|
|
52
|
+
send(options: RequestSendOptions, requestPlugins?: (RequestPlugin | undefined)[]): Promise<any>;
|
|
53
53
|
/**
|
|
54
54
|
* 生成请求路径
|
|
55
55
|
* @param {RequestSendOptions} options 请求选项
|
package/dist/index.js
CHANGED
|
@@ -134,12 +134,13 @@ var _RequestService = class {
|
|
|
134
134
|
* @param {RequestPlugin[]} plugins 请求插件
|
|
135
135
|
* @returns
|
|
136
136
|
*/
|
|
137
|
-
async send(options,
|
|
137
|
+
async send(options, requestPlugins = []) {
|
|
138
138
|
if (!_RequestService.config) {
|
|
139
139
|
throw new Error("\u8BF7\u68C0\u67E5\u8BF7\u6C42\u914D\u7F6E\u662F\u5426\u5B8C\u6210");
|
|
140
140
|
}
|
|
141
141
|
let hasException = false;
|
|
142
142
|
const adapter = this.getRequestAdapter();
|
|
143
|
+
const plugins = requestPlugins.filter(Boolean);
|
|
143
144
|
const extraParams = await this.execRequestPlugin(plugins, options);
|
|
144
145
|
const response = await this.startRequest(adapter, options, extraParams).then((response2) => adapter.transformResponse(response2)).catch((exception) => {
|
|
145
146
|
hasException = true;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gopowerteam/request",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.19",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -33,7 +33,6 @@
|
|
|
33
33
|
"@types/qs": "^6.9.7",
|
|
34
34
|
"jest": "^29.4.3",
|
|
35
35
|
"ts-jest": "^29.0.5",
|
|
36
|
-
"ts-node": "^10.9.1",
|
|
37
36
|
"tsup": "^6.6.3",
|
|
38
37
|
"typescript": "^4.9.5"
|
|
39
38
|
},
|