@kubb/plugin-axios 5.4.0 → 5.4.1
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/package.json +1 -1
- package/templates/axios.ts +7 -7
package/package.json
CHANGED
package/templates/axios.ts
CHANGED
|
@@ -225,12 +225,12 @@ export type RequestConfig<TBody = unknown, TRequest = AxiosRequestConfig, TRespo
|
|
|
225
225
|
baseURL?: string
|
|
226
226
|
url?: string
|
|
227
227
|
method?: 'GET' | 'PUT' | 'PATCH' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD'
|
|
228
|
-
path?:
|
|
228
|
+
path?: unknown
|
|
229
229
|
query?: unknown
|
|
230
230
|
params?: unknown
|
|
231
|
-
cookies?:
|
|
231
|
+
cookies?: unknown
|
|
232
232
|
body?: TBody
|
|
233
|
-
headers?:
|
|
233
|
+
headers?: unknown
|
|
234
234
|
styles?: Styles
|
|
235
235
|
signal?: AbortSignal
|
|
236
236
|
options?: AxiosOptions
|
|
@@ -526,7 +526,7 @@ async function resolveRequest<TBody, TRequest, TResponse>({
|
|
|
526
526
|
const { querySerializer, bodySerializer, pathSerializer } = resolveSerializers({ config, requestConfig })
|
|
527
527
|
const codecs = { ...config.codecs, ...requestConfig.codecs }
|
|
528
528
|
|
|
529
|
-
const headers = mergeHeaders(config.headers, applyHeaderStyles(requestConfig.headers, requestConfig.styles?.header))
|
|
529
|
+
const headers = mergeHeaders(config.headers, applyHeaderStyles(requestConfig.headers as HeadersInit | undefined, requestConfig.styles?.header))
|
|
530
530
|
const { request: requestContentTypeOption, response: responseContentType } = resolveContentType(requestConfig.contentType)
|
|
531
531
|
const requestContentType = requestContentTypeOption ?? getHeader(headers, 'content-type')
|
|
532
532
|
if (responseContentType && !hasHeader(headers, 'accept')) {
|
|
@@ -543,7 +543,7 @@ async function resolveRequest<TBody, TRequest, TResponse>({
|
|
|
543
543
|
})
|
|
544
544
|
|
|
545
545
|
if (requestConfig.cookies) {
|
|
546
|
-
const cookie = serializeCookies(requestConfig.cookies, requestConfig.styles?.cookie)
|
|
546
|
+
const cookie = serializeCookies(requestConfig.cookies as Record<string, unknown>, requestConfig.styles?.cookie)
|
|
547
547
|
if (cookie) headers['Cookie'] = [headers['Cookie'], cookie].filter(Boolean).join('; ')
|
|
548
548
|
}
|
|
549
549
|
|
|
@@ -570,7 +570,7 @@ async function resolveRequest<TBody, TRequest, TResponse>({
|
|
|
570
570
|
headers['Content-Type'] = 'application/json'
|
|
571
571
|
}
|
|
572
572
|
|
|
573
|
-
const pathParams = requestConfig.path ?? {}
|
|
573
|
+
const pathParams = (requestConfig.path ?? {}) as Record<string, unknown>
|
|
574
574
|
const url = (requestConfig.url ?? '').replace(/\{([^{}]+)\}/g, (_, key: string) =>
|
|
575
575
|
pathSerializer({ name: key, value: pathParams[key], options: requestConfig.styles?.path?.[key] }),
|
|
576
576
|
)
|
|
@@ -725,7 +725,7 @@ export function createClientCore<TRequest = AxiosRequestConfig, TResponse = Axio
|
|
|
725
725
|
const query: Record<string, unknown> = { ...((requestConfig.query ?? requestConfig.params) as Record<string, unknown> | undefined) }
|
|
726
726
|
return serializeUrl({
|
|
727
727
|
parts: [requestConfig.baseURL ?? config.baseURL, requestConfig.url],
|
|
728
|
-
pathParams: requestConfig.path ?? {},
|
|
728
|
+
pathParams: (requestConfig.path ?? {}) as Record<string, unknown>,
|
|
729
729
|
search: querySerializer(query, requestConfig.styles?.query),
|
|
730
730
|
pathSerializer,
|
|
731
731
|
pathStyles: requestConfig.styles?.path,
|