@hey-api/openapi-ts 0.83.1 → 0.84.0
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/README.md +1 -1
- package/dist/chunk-ZXJLXXXN.js +54 -0
- package/dist/chunk-ZXJLXXXN.js.map +1 -0
- package/dist/clients/axios/client.ts +1 -1
- package/dist/clients/axios/types.ts +1 -1
- package/dist/clients/axios/utils.ts +11 -3
- package/dist/index.cjs +74 -80
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -6
- package/dist/index.d.ts +18 -6
- package/dist/index.js +12 -15
- package/dist/index.js.map +1 -1
- package/dist/internal.cjs +23 -26
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +2 -2
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +1 -1
- package/dist/{types.d-CRtO-Prt.d.cts → types.d-ClTVswi2.d.cts} +2225 -2247
- package/dist/{types.d-CRtO-Prt.d.ts → types.d-ClTVswi2.d.ts} +2225 -2247
- package/package.json +10 -10
- package/dist/chunk-3AYBIZLR.js +0 -57
- package/dist/chunk-3AYBIZLR.js.map +0 -1
|
@@ -78,7 +78,7 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
78
78
|
const { auth, ...optsWithoutAuth } = opts;
|
|
79
79
|
const response = await _axios({
|
|
80
80
|
...optsWithoutAuth,
|
|
81
|
-
baseURL:
|
|
81
|
+
baseURL: '', // the baseURL is already included in `url`
|
|
82
82
|
data: getValidRequestBody(opts),
|
|
83
83
|
headers: opts.headers as RawAxiosRequestHeaders,
|
|
84
84
|
// let `paramsSerializer()` handle query params if it exists
|
|
@@ -123,9 +123,16 @@ export const setAuthParams = async ({
|
|
|
123
123
|
}
|
|
124
124
|
};
|
|
125
125
|
|
|
126
|
-
export const buildUrl: Client['buildUrl'] = (options) =>
|
|
127
|
-
|
|
128
|
-
|
|
126
|
+
export const buildUrl: Client['buildUrl'] = (options) => {
|
|
127
|
+
const instanceBaseUrl = options.axios?.defaults?.baseURL;
|
|
128
|
+
|
|
129
|
+
const baseUrl =
|
|
130
|
+
!!options.baseURL && typeof options.baseURL === 'string'
|
|
131
|
+
? options.baseURL
|
|
132
|
+
: instanceBaseUrl;
|
|
133
|
+
|
|
134
|
+
return getUrl({
|
|
135
|
+
baseUrl: baseUrl as string,
|
|
129
136
|
path: options.path,
|
|
130
137
|
// let `paramsSerializer()` handle query params if it exists
|
|
131
138
|
query: !options.paramsSerializer ? options.query : undefined,
|
|
@@ -135,6 +142,7 @@ export const buildUrl: Client['buildUrl'] = (options) =>
|
|
|
135
142
|
: createQuerySerializer(options.querySerializer),
|
|
136
143
|
url: options.url,
|
|
137
144
|
});
|
|
145
|
+
};
|
|
138
146
|
|
|
139
147
|
export const mergeConfigs = (a: Config, b: Config): Config => {
|
|
140
148
|
const config = { ...a, ...b };
|