@xylabs/axios 5.0.30 → 5.0.32
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/neutral/AxiosJson.d.ts +5 -16
- package/dist/neutral/AxiosJson.d.ts.map +1 -1
- package/dist/neutral/index.mjs +14 -48
- package/dist/neutral/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/AxiosJson.ts +21 -69
|
@@ -1,26 +1,15 @@
|
|
|
1
1
|
import type { Logger } from '@xylabs/logger';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AxiosResponse, RawAxiosRequestConfig } from 'axios';
|
|
3
|
+
import { Axios } from 'axios';
|
|
3
4
|
export type RawAxiosJsonRequestConfig<D = any> = RawAxiosRequestConfig<D> & {
|
|
4
5
|
compressLength?: number;
|
|
5
6
|
};
|
|
6
|
-
export declare class AxiosJson {
|
|
7
|
+
export declare class AxiosJson extends Axios {
|
|
7
8
|
static defaultLogger?: Logger;
|
|
8
|
-
private axios;
|
|
9
9
|
constructor(config?: RawAxiosJsonRequestConfig);
|
|
10
|
+
static axiosConfig({ compressLength, headers, ...config }?: RawAxiosJsonRequestConfig): RawAxiosJsonRequestConfig;
|
|
11
|
+
static create(config?: RawAxiosJsonRequestConfig): Axios;
|
|
10
12
|
static finalPath(response: AxiosResponse): any;
|
|
11
|
-
private static axiosConfig;
|
|
12
13
|
private static buildHeaders;
|
|
13
|
-
delete<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
14
|
-
get<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
15
|
-
getUri(config?: AxiosRequestConfig): string;
|
|
16
|
-
head<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
17
|
-
options<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
18
|
-
patch<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
19
|
-
patchForm<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
20
|
-
post<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
21
|
-
postForm<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
22
|
-
put<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
23
|
-
putForm<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
24
|
-
request<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>;
|
|
25
14
|
}
|
|
26
15
|
//# sourceMappingURL=AxiosJson.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AxiosJson.d.ts","sourceRoot":"","sources":["../../src/AxiosJson.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AxiosJson.d.ts","sourceRoot":"","sources":["../../src/AxiosJson.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAA;AACjE,OAAO,EAAE,KAAK,EAAgB,MAAM,OAAO,CAAA;AAI3C,MAAM,MAAM,yBAAyB,CAAC,CAAC,GAAG,GAAG,IAAI,qBAAqB,CAAC,CAAC,CAAC,GAAG;IAAE,cAAc,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAEvG,qBAAa,SAAU,SAAQ,KAAK;IAClC,MAAM,CAAC,aAAa,CAAC,EAAE,MAAM,CAAA;gBAEjB,MAAM,CAAC,EAAE,yBAAyB;IAI9C,MAAM,CAAC,WAAW,CAAC,EACjB,cAAc,EAAE,OAAO,EAAE,GAAG,MAAM,EACnC,GAAE,yBAA8B,GAAG,yBAAyB;IAsB7D,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,yBAAyB;IAIhD,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,aAAa;IAYxC,OAAO,CAAC,MAAM,CAAC,YAAY;CAO5B"}
|
package/dist/neutral/index.mjs
CHANGED
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
// src/AxiosJson.ts
|
|
2
2
|
import { Axios, AxiosHeaders } from "axios";
|
|
3
3
|
import { gzip } from "pako";
|
|
4
|
-
var AxiosJson = class _AxiosJson {
|
|
4
|
+
var AxiosJson = class _AxiosJson extends Axios {
|
|
5
5
|
static defaultLogger;
|
|
6
|
-
axios = new Axios(_AxiosJson.axiosConfig());
|
|
7
6
|
constructor(config) {
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
static finalPath(response) {
|
|
11
|
-
if (response.request.path) {
|
|
12
|
-
return response.request.path.split("/").pop();
|
|
13
|
-
} else if (response.request.responseURL) {
|
|
14
|
-
return response.request.responseURL.split("/").pop();
|
|
15
|
-
} else {
|
|
16
|
-
this.defaultLogger?.warn("Failed to get final path from response");
|
|
17
|
-
}
|
|
7
|
+
super(_AxiosJson.axiosConfig(config));
|
|
18
8
|
}
|
|
19
9
|
static axiosConfig({
|
|
20
10
|
compressLength,
|
|
@@ -41,6 +31,18 @@ var AxiosJson = class _AxiosJson {
|
|
|
41
31
|
...config
|
|
42
32
|
};
|
|
43
33
|
}
|
|
34
|
+
static create(config) {
|
|
35
|
+
return new Axios(this.axiosConfig(config));
|
|
36
|
+
}
|
|
37
|
+
static finalPath(response) {
|
|
38
|
+
if (response.request.path) {
|
|
39
|
+
return response.request.path.split("/").pop();
|
|
40
|
+
} else if (response.request.responseURL) {
|
|
41
|
+
return response.request.responseURL.split("/").pop();
|
|
42
|
+
} else {
|
|
43
|
+
this.defaultLogger?.warn("Failed to get final path from response");
|
|
44
|
+
}
|
|
45
|
+
}
|
|
44
46
|
static buildHeaders(headers) {
|
|
45
47
|
const axiosHeaders = new AxiosHeaders();
|
|
46
48
|
axiosHeaders.set("Accept", "application/json, text/plain, *.*");
|
|
@@ -48,42 +50,6 @@ var AxiosJson = class _AxiosJson {
|
|
|
48
50
|
for (const [key, value] of Object.entries(headers ?? {})) axiosHeaders.set(key, value);
|
|
49
51
|
return axiosHeaders;
|
|
50
52
|
}
|
|
51
|
-
delete(url, config) {
|
|
52
|
-
return this.axios.delete(url, config);
|
|
53
|
-
}
|
|
54
|
-
get(url, config) {
|
|
55
|
-
return this.axios.get(url, config);
|
|
56
|
-
}
|
|
57
|
-
getUri(config) {
|
|
58
|
-
return this.axios.getUri(config);
|
|
59
|
-
}
|
|
60
|
-
head(url, config) {
|
|
61
|
-
return this.axios.head(url, config);
|
|
62
|
-
}
|
|
63
|
-
options(url, config) {
|
|
64
|
-
return this.axios.options(url, config);
|
|
65
|
-
}
|
|
66
|
-
patch(url, data, config) {
|
|
67
|
-
return this.axios.patch(url, data, config);
|
|
68
|
-
}
|
|
69
|
-
patchForm(url, data, config) {
|
|
70
|
-
return this.axios.patch(url, data, config);
|
|
71
|
-
}
|
|
72
|
-
post(url, data, config) {
|
|
73
|
-
return this.axios.post(url, data, config);
|
|
74
|
-
}
|
|
75
|
-
postForm(url, data, config) {
|
|
76
|
-
return this.axios.post(url, data, config);
|
|
77
|
-
}
|
|
78
|
-
put(url, data, config) {
|
|
79
|
-
return this.axios.put(url, data, config);
|
|
80
|
-
}
|
|
81
|
-
putForm(url, data, config) {
|
|
82
|
-
return this.axios.put(url, data, config);
|
|
83
|
-
}
|
|
84
|
-
request(config) {
|
|
85
|
-
return this.axios.request(config);
|
|
86
|
-
}
|
|
87
53
|
};
|
|
88
54
|
|
|
89
55
|
// src/AxiosJsonUncompressed.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/AxiosJson.ts","../../src/AxiosJsonUncompressed.ts","../../src/index.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../../src/AxiosJson.ts","../../src/AxiosJsonUncompressed.ts","../../src/index.ts"],"sourcesContent":["import type { Logger } from '@xylabs/logger'\nimport type { AxiosResponse, RawAxiosRequestConfig } from 'axios'\nimport { Axios, AxiosHeaders } from 'axios'\nimport { gzip } from 'pako'\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type RawAxiosJsonRequestConfig<D = any> = RawAxiosRequestConfig<D> & { compressLength?: number }\n\nexport class AxiosJson extends Axios {\n static defaultLogger?: Logger\n\n constructor(config?: RawAxiosJsonRequestConfig) {\n super(AxiosJson.axiosConfig(config))\n }\n\n static axiosConfig({\n compressLength, headers, ...config\n }: RawAxiosJsonRequestConfig = {}): RawAxiosJsonRequestConfig {\n return {\n headers: this.buildHeaders(headers),\n transformRequest: (data, headers) => {\n const json = JSON.stringify(data)\n if (headers !== undefined && data && json.length > (compressLength ?? 1024)) {\n headers.set('Content-Encoding', 'gzip')\n return gzip(json).buffer\n }\n return json\n },\n transformResponse: (data) => {\n try {\n return JSON.parse(data)\n } catch {\n return null\n }\n },\n ...config,\n }\n }\n\n static create(config?: RawAxiosJsonRequestConfig) {\n return new Axios(this.axiosConfig(config))\n }\n\n static finalPath(response: AxiosResponse) {\n if (response.request.path) {\n // nodejs\n return response.request.path.split('/').pop()\n } else if (response.request.responseURL) {\n // browser\n return response.request.responseURL.split('/').pop()\n } else {\n this.defaultLogger?.warn('Failed to get final path from response')\n }\n }\n\n private static buildHeaders(headers: RawAxiosJsonRequestConfig['headers']) {\n const axiosHeaders = new AxiosHeaders()\n axiosHeaders.set('Accept', 'application/json, text/plain, *.*')\n axiosHeaders.set('Content-Type', 'application/json')\n for (const [key, value] of Object.entries(headers ?? {})) axiosHeaders.set(key, value)\n return axiosHeaders\n }\n}\n","import type { Logger } from '@xylabs/logger'\nimport type { AxiosRequestConfig, AxiosResponse } from 'axios'\nimport { Axios, AxiosHeaders } from 'axios'\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type AxiosJsonRequestUncompressedConfig<D = any> = AxiosRequestConfig<D>\n\nexport class AxiosJsonUncompressed extends Axios {\n static defaultLogger?: Logger\n\n constructor(config?: AxiosJsonRequestUncompressedConfig) {\n super(AxiosJsonUncompressed.axiosConfig(config))\n }\n\n static create(config?: AxiosJsonRequestUncompressedConfig) {\n return new this(config) as Axios\n }\n\n static finalPath(response: AxiosResponse) {\n if (response.request.path) {\n // nodejs\n return response.request.path.split('/').pop()\n } else if (response.request.responseURL) {\n // browser\n return response.request.responseURL.split('/').pop()\n } else {\n this.defaultLogger?.warn('Failed to get final path from response')\n }\n }\n\n private static axiosConfig({ headers, ...config }: AxiosJsonRequestUncompressedConfig = {}): AxiosJsonRequestUncompressedConfig {\n return {\n headers: this.buildHeaders(headers),\n transformRequest: (data) => {\n const json = JSON.stringify(data)\n return JSON.stringify(json)\n },\n transformResponse: (data) => {\n try {\n return JSON.parse(data)\n } catch {\n return null\n }\n },\n ...config,\n }\n }\n\n private static buildHeaders(headers: AxiosJsonRequestUncompressedConfig['headers']) {\n const axiosHeaders = new AxiosHeaders()\n axiosHeaders.set('Accept', 'application/json, text/plain, *.*')\n axiosHeaders.set('Content-Type', 'application/json')\n for (const [key, value] of Object.entries(headers ?? {})) axiosHeaders.set(key, value)\n return axiosHeaders\n }\n}\n","import { AxiosJson } from './AxiosJson.ts'\nimport { AxiosJsonUncompressed } from './AxiosJsonUncompressed.ts'\n\nexport * from './AxiosJson.ts'\nexport * from './AxiosJsonUncompressed.ts'\nexport { gzip } from 'pako'\n\nexport const axios = new AxiosJson()\nexport const axiosUncompressed = new AxiosJsonUncompressed()\n"],"mappings":";AAEA,SAAS,OAAO,oBAAoB;AACpC,SAAS,YAAY;AAKd,IAAM,YAAN,MAAM,mBAAkB,MAAM;AAAA,EACnC,OAAO;AAAA,EAEP,YAAY,QAAoC;AAC9C,UAAM,WA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QAAQ,IAAI,UAAU;AAC5B,IAAM,oBAAoB,IAAI,sBAAsB;","names":["headers","Axios","AxiosHeaders","gzip"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xylabs/axios",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.32",
|
|
4
4
|
"description": "Base functionality used throughout XY Labs TypeScript/JavaScript libraries",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"axios",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"src"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@xylabs/logger": "~5.0.
|
|
45
|
+
"@xylabs/logger": "~5.0.32",
|
|
46
46
|
"pako": "~2.1.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
package/src/AxiosJson.ts
CHANGED
|
@@ -1,35 +1,19 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
1
|
import type { Logger } from '@xylabs/logger'
|
|
3
|
-
import type {
|
|
4
|
-
AxiosRequestConfig, AxiosResponse, RawAxiosRequestConfig,
|
|
5
|
-
} from 'axios'
|
|
2
|
+
import type { AxiosResponse, RawAxiosRequestConfig } from 'axios'
|
|
6
3
|
import { Axios, AxiosHeaders } from 'axios'
|
|
7
4
|
import { gzip } from 'pako'
|
|
8
5
|
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
7
|
export type RawAxiosJsonRequestConfig<D = any> = RawAxiosRequestConfig<D> & { compressLength?: number }
|
|
10
8
|
|
|
11
|
-
export class AxiosJson {
|
|
9
|
+
export class AxiosJson extends Axios {
|
|
12
10
|
static defaultLogger?: Logger
|
|
13
11
|
|
|
14
|
-
private axios: Axios = new Axios(AxiosJson.axiosConfig())
|
|
15
|
-
|
|
16
12
|
constructor(config?: RawAxiosJsonRequestConfig) {
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
static finalPath(response: AxiosResponse) {
|
|
21
|
-
if (response.request.path) {
|
|
22
|
-
// nodejs
|
|
23
|
-
return response.request.path.split('/').pop()
|
|
24
|
-
} else if (response.request.responseURL) {
|
|
25
|
-
// browser
|
|
26
|
-
return response.request.responseURL.split('/').pop()
|
|
27
|
-
} else {
|
|
28
|
-
this.defaultLogger?.warn('Failed to get final path from response')
|
|
29
|
-
}
|
|
13
|
+
super(AxiosJson.axiosConfig(config))
|
|
30
14
|
}
|
|
31
15
|
|
|
32
|
-
|
|
16
|
+
static axiosConfig({
|
|
33
17
|
compressLength, headers, ...config
|
|
34
18
|
}: RawAxiosJsonRequestConfig = {}): RawAxiosJsonRequestConfig {
|
|
35
19
|
return {
|
|
@@ -53,6 +37,22 @@ export class AxiosJson {
|
|
|
53
37
|
}
|
|
54
38
|
}
|
|
55
39
|
|
|
40
|
+
static create(config?: RawAxiosJsonRequestConfig) {
|
|
41
|
+
return new Axios(this.axiosConfig(config))
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
static finalPath(response: AxiosResponse) {
|
|
45
|
+
if (response.request.path) {
|
|
46
|
+
// nodejs
|
|
47
|
+
return response.request.path.split('/').pop()
|
|
48
|
+
} else if (response.request.responseURL) {
|
|
49
|
+
// browser
|
|
50
|
+
return response.request.responseURL.split('/').pop()
|
|
51
|
+
} else {
|
|
52
|
+
this.defaultLogger?.warn('Failed to get final path from response')
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
56
|
private static buildHeaders(headers: RawAxiosJsonRequestConfig['headers']) {
|
|
57
57
|
const axiosHeaders = new AxiosHeaders()
|
|
58
58
|
axiosHeaders.set('Accept', 'application/json, text/plain, *.*')
|
|
@@ -60,52 +60,4 @@ export class AxiosJson {
|
|
|
60
60
|
for (const [key, value] of Object.entries(headers ?? {})) axiosHeaders.set(key, value)
|
|
61
61
|
return axiosHeaders
|
|
62
62
|
}
|
|
63
|
-
|
|
64
|
-
delete<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R> {
|
|
65
|
-
return this.axios.delete<T, R, D>(url, config)
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
get<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R> {
|
|
69
|
-
return this.axios.get<T, R, D>(url, config)
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
getUri(config?: AxiosRequestConfig): string {
|
|
73
|
-
return this.axios.getUri(config)
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
head<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R> {
|
|
77
|
-
return this.axios.head<T, R, D>(url, config)
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
options<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R> {
|
|
81
|
-
return this.axios.options<T, R, D>(url, config)
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
patch<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R> {
|
|
85
|
-
return this.axios.patch<T, R, D>(url, data, config)
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
patchForm<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R> {
|
|
89
|
-
return this.axios.patch<T, R, D>(url, data, config)
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
post<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R> {
|
|
93
|
-
return this.axios.post<T, R, D>(url, data, config)
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
postForm<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R> {
|
|
97
|
-
return this.axios.post<T, R, D>(url, data, config)
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
put<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R> {
|
|
101
|
-
return this.axios.put<T, R, D>(url, data, config)
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
putForm<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R> {
|
|
105
|
-
return this.axios.put<T, R, D>(url, data, config)
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
request<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R> {
|
|
109
|
-
return this.axios.request<T, R, D>(config)
|
|
110
|
-
}
|
|
111
63
|
}
|