@wiajs/req 1.7.10 → 1.7.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/node/req.cjs +1 -3
- package/dist/node/req.mjs +1 -1
- package/dist/web/req.mjs +1 -1
- package/index.d.cts +7 -3
- package/index.d.ts +7 -3
- package/lib/adapters/http.js +0 -1
- package/package.json +4 -4
- package/dist/req.js +0 -22155
- package/dist/req.min.js +0 -6
- package/dist/web/req.cjs +0 -23061
package/dist/node/req.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @wia/req v1.7.
|
|
2
|
+
* @wia/req v1.7.12
|
|
3
3
|
* (c) 2024 Sibyl Yu, Matt Zabriskie and contributors
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -2593,8 +2593,6 @@ const asyncDecorator =
|
|
|
2593
2593
|
(...args) =>
|
|
2594
2594
|
utils$1.asap(() => fn(...args));
|
|
2595
2595
|
|
|
2596
|
-
// import Agent from '../fea/agent.js'
|
|
2597
|
-
|
|
2598
2596
|
const log = log$1.log({env: `wia:req:${log$1.name((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('req.cjs', document.baseURI).href)))}`});
|
|
2599
2597
|
|
|
2600
2598
|
const isBrotliSupported = utils$1.isFunction(zlib.createBrotliDecompress);
|
package/dist/node/req.mjs
CHANGED
package/dist/web/req.mjs
CHANGED
package/index.d.cts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type Agent, {AgentOpts} from '@wiajs/agent';
|
|
2
|
+
|
|
1
3
|
interface RawAxiosHeaders {
|
|
2
4
|
[key: string]: axios.AxiosHeaderValue;
|
|
3
5
|
}
|
|
@@ -123,11 +125,11 @@ declare class Axios {
|
|
|
123
125
|
};
|
|
124
126
|
getUri(config?: axios.AxiosRequestConfig): string;
|
|
125
127
|
request<T = any, R = axios.AxiosResponse<T>, D = any>(config: axios.AxiosRequestConfig<D>): Promise<R>;
|
|
126
|
-
get<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, config?: axios.AxiosRequestConfig<D>): Promise<R>;
|
|
128
|
+
get<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, param?: D, config?: axios.AxiosRequestConfig<D>): Promise<R>;
|
|
129
|
+
post<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig<D>): Promise<R>;
|
|
127
130
|
delete<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, config?: axios.AxiosRequestConfig<D>): Promise<R>;
|
|
128
131
|
head<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, config?: axios.AxiosRequestConfig<D>): Promise<R>;
|
|
129
132
|
options<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, config?: axios.AxiosRequestConfig<D>): Promise<R>;
|
|
130
|
-
post<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig<D>): Promise<R>;
|
|
131
133
|
put<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig<D>): Promise<R>;
|
|
132
134
|
patch<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig<D>): Promise<R>;
|
|
133
135
|
postForm<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig<D>): Promise<R>;
|
|
@@ -403,7 +405,8 @@ declare namespace axios {
|
|
|
403
405
|
transport?: any;
|
|
404
406
|
httpAgent?: any;
|
|
405
407
|
httpsAgent?: any;
|
|
406
|
-
|
|
408
|
+
agent?: AgentOpts;
|
|
409
|
+
agents?: Agent;
|
|
407
410
|
cancelToken?: CancelToken;
|
|
408
411
|
decompress?: boolean;
|
|
409
412
|
transitional?: TransitionalOptions;
|
|
@@ -450,6 +453,7 @@ declare namespace axios {
|
|
|
450
453
|
}
|
|
451
454
|
|
|
452
455
|
interface AxiosResponse<T = any, D = any> {
|
|
456
|
+
body: T;
|
|
453
457
|
data: T;
|
|
454
458
|
status: number;
|
|
455
459
|
statusText: string;
|
package/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type Agent, {AgentOpts} from '@wiajs/agent';
|
|
2
|
+
|
|
1
3
|
// TypeScript Version: 4.7
|
|
2
4
|
export type AxiosHeaderValue = AxiosHeaders | string | string[] | number | boolean | null;
|
|
3
5
|
|
|
@@ -344,7 +346,8 @@ export interface AxiosRequestConfig<D = any> {
|
|
|
344
346
|
transport?: any;
|
|
345
347
|
httpAgent?: any;
|
|
346
348
|
httpsAgent?: any;
|
|
347
|
-
|
|
349
|
+
agent?: AgentOpts;
|
|
350
|
+
agents?: Agent;
|
|
348
351
|
cancelToken?: CancelToken;
|
|
349
352
|
decompress?: boolean;
|
|
350
353
|
transitional?: TransitionalOptions;
|
|
@@ -391,6 +394,7 @@ export interface CreateAxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>
|
|
|
391
394
|
}
|
|
392
395
|
|
|
393
396
|
export interface AxiosResponse<T = any, D = any> {
|
|
397
|
+
body: T;
|
|
394
398
|
data: T;
|
|
395
399
|
status: number;
|
|
396
400
|
statusText: string;
|
|
@@ -491,11 +495,11 @@ export class Axios {
|
|
|
491
495
|
};
|
|
492
496
|
getUri(config?: AxiosRequestConfig): string;
|
|
493
497
|
request<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>;
|
|
494
|
-
get<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
498
|
+
get<T = any, R = AxiosResponse<T>, D = any>(url: string, param?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
499
|
+
post<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
495
500
|
delete<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
496
501
|
head<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
497
502
|
options<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
498
|
-
post<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
499
503
|
put<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
500
504
|
patch<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
501
505
|
postForm<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
package/lib/adapters/http.js
CHANGED
|
@@ -24,7 +24,6 @@ import formDataToStream from '../helpers/formDataToStream.js';
|
|
|
24
24
|
import readBlob from '../helpers/readBlob.js';
|
|
25
25
|
import callbackify from '../helpers/callbackify.js';
|
|
26
26
|
import { progressEventReducer, progressEventDecorator, asyncDecorator } from '../helpers/progressEventReducer.js';
|
|
27
|
-
// import Agent from '../fea/agent.js'
|
|
28
27
|
const log = Log({
|
|
29
28
|
env: `wia:req:${name(import.meta.url)}`
|
|
30
29
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wiajs/req",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.12",
|
|
4
4
|
"description": "Promise And Stream based AXIOS client for the browser and node.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -142,9 +142,9 @@
|
|
|
142
142
|
"@rollup/plugin-alias": "^5.1.0"
|
|
143
143
|
},
|
|
144
144
|
"dependencies": {
|
|
145
|
-
"@wiajs/log": "^4.3.
|
|
146
|
-
"@wiajs/request": "^3.0.
|
|
147
|
-
"@wiajs/agent": "^1.0.
|
|
145
|
+
"@wiajs/log": "^4.3.19",
|
|
146
|
+
"@wiajs/request": "^3.0.20",
|
|
147
|
+
"@wiajs/agent": "^1.0.19",
|
|
148
148
|
"form-data": "^4.0.0",
|
|
149
149
|
"proxy-from-env": "^1.1.0"
|
|
150
150
|
},
|