@xyo-network/axios
Advanced tools
Comparing version 2.43.3 to 2.43.4
@@ -32,5 +32,6 @@ "use strict"; | ||
static buildHeaders(headers) { | ||
const axiosHeaders = Object.assign({}, headers); | ||
axiosHeaders['Accept'] = 'application/json, text/plain, *.*'; | ||
axiosHeaders['Content-Type'] = 'application/json'; | ||
const axiosHeaders = new axios_1.AxiosHeaders(); | ||
Object.entries(headers !== null && headers !== void 0 ? headers : {}).forEach(([key, value]) => axiosHeaders.set(key, value)); | ||
axiosHeaders.set('Accept', 'application/json, text/plain, *.*'); | ||
axiosHeaders.set('Content-Type', 'application/json'); | ||
return axiosHeaders; | ||
@@ -37,0 +38,0 @@ } |
@@ -27,3 +27,3 @@ { | ||
"character": 2, | ||
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/395bc6c9e/packages/sdk/packages/axios/src/AxiosJson.ts#L8" | ||
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/2601bd8c6/packages/sdk/packages/axios/src/AxiosJson.ts#L8" | ||
} | ||
@@ -90,3 +90,3 @@ ], | ||
"character": 17, | ||
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/395bc6c9e/packages/sdk/packages/axios/src/AxiosJson.ts#L12" | ||
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/2601bd8c6/packages/sdk/packages/axios/src/AxiosJson.ts#L12" | ||
} | ||
@@ -151,3 +151,3 @@ ], | ||
"character": 17, | ||
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/395bc6c9e/packages/sdk/packages/axios/src/AxiosJson.ts#L36" | ||
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/2601bd8c6/packages/sdk/packages/axios/src/AxiosJson.ts#L36" | ||
} | ||
@@ -168,35 +168,48 @@ ], | ||
"kindString": "Parameter", | ||
"flags": { | ||
"isOptional": true | ||
}, | ||
"flags": {}, | ||
"type": { | ||
"type": "reference", | ||
"typeArguments": [ | ||
"type": "union", | ||
"types": [ | ||
{ | ||
"type": "intersection", | ||
"types": [ | ||
"type": "intrinsic", | ||
"name": "undefined" | ||
}, | ||
{ | ||
"type": "reference", | ||
"name": "AxiosHeaders", | ||
"qualifiedName": "AxiosHeaders", | ||
"package": "axios" | ||
}, | ||
{ | ||
"type": "reference", | ||
"typeArguments": [ | ||
{ | ||
"type": "reference", | ||
"name": "RawAxiosHeaders", | ||
"qualifiedName": "RawAxiosHeaders", | ||
"package": "axios" | ||
}, | ||
{ | ||
"type": "reference", | ||
"name": "MethodsHeaders", | ||
"qualifiedName": "MethodsHeaders", | ||
"package": "axios" | ||
}, | ||
{ | ||
"type": "reference", | ||
"name": "CommonHeaders", | ||
"qualifiedName": "CommonHeaders", | ||
"package": "axios" | ||
"type": "intersection", | ||
"types": [ | ||
{ | ||
"type": "reference", | ||
"name": "RawAxiosHeaders", | ||
"qualifiedName": "RawAxiosHeaders", | ||
"package": "axios" | ||
}, | ||
{ | ||
"type": "reference", | ||
"name": "MethodsHeaders", | ||
"qualifiedName": "MethodsHeaders", | ||
"package": "axios" | ||
}, | ||
{ | ||
"type": "reference", | ||
"name": "CommonHeaders", | ||
"qualifiedName": "CommonHeaders", | ||
"package": "axios" | ||
} | ||
] | ||
} | ||
] | ||
], | ||
"name": "Partial", | ||
"qualifiedName": "Partial", | ||
"package": "typescript" | ||
} | ||
], | ||
"name": "Partial", | ||
"qualifiedName": "Partial", | ||
"package": "typescript" | ||
] | ||
} | ||
@@ -207,38 +220,5 @@ } | ||
"type": "reference", | ||
"typeArguments": [ | ||
{ | ||
"type": "reference", | ||
"typeArguments": [ | ||
{ | ||
"type": "intersection", | ||
"types": [ | ||
{ | ||
"type": "reference", | ||
"name": "RawAxiosHeaders", | ||
"qualifiedName": "RawAxiosHeaders", | ||
"package": "axios" | ||
}, | ||
{ | ||
"type": "reference", | ||
"name": "MethodsHeaders", | ||
"qualifiedName": "MethodsHeaders", | ||
"package": "axios" | ||
}, | ||
{ | ||
"type": "reference", | ||
"name": "CommonHeaders", | ||
"qualifiedName": "CommonHeaders", | ||
"package": "axios" | ||
} | ||
] | ||
} | ||
], | ||
"name": "Partial", | ||
"qualifiedName": "Partial", | ||
"package": "typescript" | ||
} | ||
], | ||
"name": "Partial", | ||
"qualifiedName": "Partial", | ||
"package": "typescript" | ||
"name": "AxiosHeaders", | ||
"qualifiedName": "AxiosHeaders", | ||
"package": "axios" | ||
} | ||
@@ -269,3 +249,3 @@ } | ||
"character": 13, | ||
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/395bc6c9e/packages/sdk/packages/axios/src/AxiosJson.ts#L7" | ||
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/2601bd8c6/packages/sdk/packages/axios/src/AxiosJson.ts#L7" | ||
} | ||
@@ -293,3 +273,3 @@ ], | ||
"character": 12, | ||
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/395bc6c9e/packages/sdk/packages/axios/src/AxiosJson.ts#L5" | ||
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/2601bd8c6/packages/sdk/packages/axios/src/AxiosJson.ts#L5" | ||
} | ||
@@ -348,3 +328,3 @@ ], | ||
"character": 72, | ||
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/395bc6c9e/packages/sdk/packages/axios/src/AxiosJson.ts#L5" | ||
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/2601bd8c6/packages/sdk/packages/axios/src/AxiosJson.ts#L5" | ||
} | ||
@@ -371,3 +351,3 @@ ], | ||
"character": 70, | ||
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/395bc6c9e/packages/sdk/packages/axios/src/AxiosJson.ts#L5" | ||
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/2601bd8c6/packages/sdk/packages/axios/src/AxiosJson.ts#L5" | ||
} | ||
@@ -400,5 +380,5 @@ ] | ||
"character": 0, | ||
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/395bc6c9e/packages/sdk/packages/axios/src/index.ts#L1" | ||
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/2601bd8c6/packages/sdk/packages/axios/src/index.ts#L1" | ||
} | ||
] | ||
} |
@@ -1,2 +0,2 @@ | ||
import { Axios } from 'axios'; | ||
import { Axios, AxiosHeaders } from 'axios'; | ||
import { gzip } from 'pako'; | ||
@@ -32,5 +32,6 @@ export class AxiosJson extends Axios { | ||
static buildHeaders(headers) { | ||
const axiosHeaders = { ...headers }; | ||
axiosHeaders['Accept'] = 'application/json, text/plain, *.*'; | ||
axiosHeaders['Content-Type'] = 'application/json'; | ||
const axiosHeaders = new AxiosHeaders(); | ||
Object.entries(headers ?? {}).forEach(([key, value]) => axiosHeaders.set(key, value)); | ||
axiosHeaders.set('Accept', 'application/json, text/plain, *.*'); | ||
axiosHeaders.set('Content-Type', 'application/json'); | ||
return axiosHeaders; | ||
@@ -37,0 +38,0 @@ } |
@@ -13,3 +13,3 @@ { | ||
"dependencies": { | ||
"axios": "~1.2.1", | ||
"axios": "~1.2.2", | ||
"pako": "^2.1.0" | ||
@@ -20,3 +20,3 @@ }, | ||
"@types/pako": "^2.0.0", | ||
"@xylabs/ts-scripts-yarn3": "^2.11.16" | ||
"@xylabs/ts-scripts-yarn3": "^2.12.0" | ||
}, | ||
@@ -55,3 +55,3 @@ "browser": "dist/esm/index.js", | ||
"types": "dist/esm/index.d.ts", | ||
"version": "2.43.3" | ||
"version": "2.43.4" | ||
} |
@@ -1,2 +0,2 @@ | ||
import { Axios, AxiosRequestConfig, RawAxiosRequestHeaders } from 'axios' | ||
import { Axios, AxiosHeaders, AxiosRequestConfig } from 'axios' | ||
import { gzip } from 'pako' | ||
@@ -36,8 +36,9 @@ | ||
private static buildHeaders(headers?: RawAxiosRequestHeaders): Partial<RawAxiosRequestHeaders> { | ||
const axiosHeaders: RawAxiosRequestHeaders = { ...headers } | ||
axiosHeaders['Accept'] = 'application/json, text/plain, *.*' | ||
axiosHeaders['Content-Type'] = 'application/json' | ||
private static buildHeaders(headers: AxiosRequestConfig['headers']) { | ||
const axiosHeaders = new AxiosHeaders() | ||
Object.entries(headers ?? {}).forEach(([key, value]) => axiosHeaders.set(key, value)) | ||
axiosHeaders.set('Accept', 'application/json, text/plain, *.*') | ||
axiosHeaders.set('Content-Type', 'application/json') | ||
return axiosHeaders | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31222
545
Updatedaxios@~1.2.2