@quantcdn/quant-client 4.21.1 → 4.21.2
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/common.ts +4 -2
- package/dist/api.d.ts +251 -251
- package/dist/common.js +2 -0
- package/dist/esm/api.d.ts +251 -251
- package/dist/esm/common.js +2 -0
- package/package.json +3 -3
package/common.ts
CHANGED
|
@@ -143,8 +143,10 @@ export const toPathString = function (url: URL) {
|
|
|
143
143
|
* @export
|
|
144
144
|
*/
|
|
145
145
|
export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
|
|
146
|
-
return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
146
|
+
return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH): Promise<R> => {
|
|
147
147
|
const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url};
|
|
148
|
-
|
|
148
|
+
// axios >=1.20 widens request()'s return type (AxiosResponseResult); the
|
|
149
|
+
// SDK contract is still Promise<R>, so bridge the typing here. Runtime is unchanged.
|
|
150
|
+
return axios.request<T, R>(axiosRequestArgs) as unknown as Promise<R>;
|
|
149
151
|
};
|
|
150
152
|
}
|