@ekhein/http-request 1.0.19 → 1.0.20
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/http-request.d.ts +1 -1
- package/dist/index.js +0 -1
- package/package.json +3 -2
- package/types/axios.d.ts +0 -5
- package/types/http-request.d.ts +0 -48
package/dist/http-request.d.ts
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ekhein/http-request",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.20",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "ekhein",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
|
+
"types": "./types/index.d.ts",
|
|
7
8
|
"files": [
|
|
8
|
-
"dist"
|
|
9
|
+
"dist"
|
|
9
10
|
],
|
|
10
11
|
"scripts": {
|
|
11
12
|
"build": "tsc"
|
package/types/axios.d.ts
DELETED
package/types/http-request.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { JSDOM } from 'jsdom';
|
|
2
|
-
import { CookieJar } from 'tough-cookie';
|
|
3
|
-
import { AxiosRequestConfig, InternalAxiosRequestConfig, AxiosResponse, AxiosRequestHeaders } from 'axios';
|
|
4
|
-
|
|
5
|
-
export interface HttpLiuGuanProxy {
|
|
6
|
-
adcode?: string
|
|
7
|
-
visitorId?: string
|
|
8
|
-
unbindTime?: string
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface HttpPhone4GProxy {
|
|
12
|
-
clientIp: string
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface HttpServiceTypes {
|
|
16
|
-
NATIVE: 1
|
|
17
|
-
SEKIRO: 2
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface ExtendInternalAxiosRequestConfig extends HttpRequestConfig, InternalAxiosRequestConfig {
|
|
21
|
-
headers: AxiosRequestHeaders;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface ExtendAxiosResponse extends AxiosResponse {
|
|
25
|
-
config: ExtendInternalAxiosRequestConfig
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface ExtendAxiosRequestConfig extends Record<string, any> {
|
|
29
|
-
form?: any
|
|
30
|
-
body?: any
|
|
31
|
-
html?: boolean
|
|
32
|
-
resolveBodyOnly?: boolean
|
|
33
|
-
serviceType?: HttpServiceTypes[keyof HttpServiceTypes]
|
|
34
|
-
useProxy?: boolean | HttpLiuGuanProxy | HttpPhone4GProxy
|
|
35
|
-
jar?: CookieJar
|
|
36
|
-
interceptorHooks?: {
|
|
37
|
-
requestInterceptor?: (config: ExtendInternalAxiosRequestConfig) => ExtendInternalAxiosRequestConfig | Promise<ExtendInternalAxiosRequestConfig>
|
|
38
|
-
requestInterceptorCatch?: (error: any) => any
|
|
39
|
-
respondInterceptor?: (response: ExtendAxiosResponse) => ExtendAxiosResponse | Promise<ExtendAxiosResponse | any>
|
|
40
|
-
respondInterceptorCatch?: (error: any) => any
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export interface HttpRequestConfig extends ExtendAxiosRequestConfig, AxiosRequestConfig {}
|
|
45
|
-
|
|
46
|
-
export interface HttpResponse extends ExtendAxiosResponse {}
|
|
47
|
-
|
|
48
|
-
export interface HTMLResponse extends JSDOM {}
|