@gopowerteam/request 0.1.7 → 0.1.9
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/adapters/index.cjs
CHANGED
|
@@ -61,11 +61,11 @@ var _RequestService = class {
|
|
|
61
61
|
execResponsePlugin(leftcycle, plugins = [], options, response) {
|
|
62
62
|
plugins.forEach((plugin) => {
|
|
63
63
|
const leftcycleFn = plugin[leftcycle];
|
|
64
|
-
leftcycleFn && leftcycleFn(response, options);
|
|
64
|
+
leftcycleFn && leftcycleFn.bind(plugin)(response, options);
|
|
65
65
|
});
|
|
66
66
|
_RequestService.config.plugins.forEach((plugin) => {
|
|
67
67
|
const leftcycleFn = plugin[leftcycle];
|
|
68
|
-
leftcycleFn && leftcycleFn(response, options);
|
|
68
|
+
leftcycleFn && leftcycleFn.bind(plugin)(response, options);
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
71
|
parseRequestPath(path, paramsPath) {
|
|
@@ -128,6 +128,7 @@ __publicField(RequestService, "config");
|
|
|
128
128
|
__publicField(RequestService, "instance");
|
|
129
129
|
|
|
130
130
|
// src/adapters/axios.adapter.ts
|
|
131
|
+
var qs = __toESM(require("qs"), 1);
|
|
131
132
|
var _AxiosAdapter = class {
|
|
132
133
|
getAxiosInstance() {
|
|
133
134
|
if (!_AxiosAdapter.axiosInstance) {
|
|
@@ -135,6 +136,18 @@ var _AxiosAdapter = class {
|
|
|
135
136
|
timeout: RequestService.config.timeout,
|
|
136
137
|
headers: {
|
|
137
138
|
"Content-Type": "application/json"
|
|
139
|
+
},
|
|
140
|
+
paramsSerializer: {
|
|
141
|
+
encode: (params) => qs.stringify(
|
|
142
|
+
params,
|
|
143
|
+
RequestService.config.qs || {
|
|
144
|
+
arrayFormat: "indices",
|
|
145
|
+
skipNulls: true,
|
|
146
|
+
allowDots: true,
|
|
147
|
+
encodeValuesOnly: true,
|
|
148
|
+
encode: true
|
|
149
|
+
}
|
|
150
|
+
)
|
|
138
151
|
}
|
|
139
152
|
});
|
|
140
153
|
}
|
package/dist/adapters/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RequestService,
|
|
3
3
|
__publicField
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-WMRFSSUJ.js";
|
|
5
5
|
|
|
6
6
|
// src/adapters/axios.adapter.ts
|
|
7
7
|
import axios from "axios";
|
|
8
|
+
import * as qs from "qs";
|
|
8
9
|
var _AxiosAdapter = class {
|
|
9
10
|
getAxiosInstance() {
|
|
10
11
|
if (!_AxiosAdapter.axiosInstance) {
|
|
@@ -12,6 +13,18 @@ var _AxiosAdapter = class {
|
|
|
12
13
|
timeout: RequestService.config.timeout,
|
|
13
14
|
headers: {
|
|
14
15
|
"Content-Type": "application/json"
|
|
16
|
+
},
|
|
17
|
+
paramsSerializer: {
|
|
18
|
+
encode: (params) => qs.stringify(
|
|
19
|
+
params,
|
|
20
|
+
RequestService.config.qs || {
|
|
21
|
+
arrayFormat: "indices",
|
|
22
|
+
skipNulls: true,
|
|
23
|
+
allowDots: true,
|
|
24
|
+
encodeValuesOnly: true,
|
|
25
|
+
encode: true
|
|
26
|
+
}
|
|
27
|
+
)
|
|
15
28
|
}
|
|
16
29
|
});
|
|
17
30
|
}
|
|
@@ -36,11 +36,11 @@ var _RequestService = class {
|
|
|
36
36
|
execResponsePlugin(leftcycle, plugins = [], options, response) {
|
|
37
37
|
plugins.forEach((plugin) => {
|
|
38
38
|
const leftcycleFn = plugin[leftcycle];
|
|
39
|
-
leftcycleFn && leftcycleFn(response, options);
|
|
39
|
+
leftcycleFn && leftcycleFn.bind(plugin)(response, options);
|
|
40
40
|
});
|
|
41
41
|
_RequestService.config.plugins.forEach((plugin) => {
|
|
42
42
|
const leftcycleFn = plugin[leftcycle];
|
|
43
|
-
leftcycleFn && leftcycleFn(response, options);
|
|
43
|
+
leftcycleFn && leftcycleFn.bind(plugin)(response, options);
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
parseRequestPath(path, paramsPath) {
|
package/dist/index.cjs
CHANGED
|
@@ -63,11 +63,11 @@ var _RequestService = class {
|
|
|
63
63
|
execResponsePlugin(leftcycle, plugins = [], options, response) {
|
|
64
64
|
plugins.forEach((plugin) => {
|
|
65
65
|
const leftcycleFn = plugin[leftcycle];
|
|
66
|
-
leftcycleFn && leftcycleFn(response, options);
|
|
66
|
+
leftcycleFn && leftcycleFn.bind(plugin)(response, options);
|
|
67
67
|
});
|
|
68
68
|
_RequestService.config.plugins.forEach((plugin) => {
|
|
69
69
|
const leftcycleFn = plugin[leftcycle];
|
|
70
|
-
leftcycleFn && leftcycleFn(response, options);
|
|
70
|
+
leftcycleFn && leftcycleFn.bind(plugin)(response, options);
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
73
|
parseRequestPath(path, paramsPath) {
|
package/dist/index.js
CHANGED
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.9",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -12,10 +12,6 @@
|
|
|
12
12
|
"gopowerteam",
|
|
13
13
|
"request"
|
|
14
14
|
],
|
|
15
|
-
"scripts": {
|
|
16
|
-
"test": "jest --coverage",
|
|
17
|
-
"build": "tsup"
|
|
18
|
-
},
|
|
19
15
|
"main": "./dist/index.cjs",
|
|
20
16
|
"module": "./dist/index.js",
|
|
21
17
|
"types": "./dist/index.d.ts",
|
|
@@ -45,5 +41,9 @@
|
|
|
45
41
|
"dependencies": {
|
|
46
42
|
"axios": "^1.1.2",
|
|
47
43
|
"qs": "^6.11.0"
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"test": "jest --coverage",
|
|
47
|
+
"build": "tsup"
|
|
48
48
|
}
|
|
49
|
-
}
|
|
49
|
+
}
|