@kubb/plugin-axios 5.4.1 → 5.5.0-canary.20260911T102437

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-axios",
3
- "version": "5.4.1",
3
+ "version": "5.5.0-canary.20260911T102437",
4
4
  "description": "Generate a slim, type-safe HTTP client with Kubb based on axios.",
5
5
  "keywords": [
6
6
  "api-client",
@@ -65,12 +65,12 @@
65
65
  "registry": "https://registry.npmjs.org/"
66
66
  },
67
67
  "dependencies": {
68
- "@kubb/plugin-ts": "^5.0.2",
69
- "@kubb/plugin-zod": "^5.1.5"
68
+ "@kubb/plugin-ts": "^5.1.0-canary.20260911T102437",
69
+ "@kubb/plugin-zod": "^5.2.0-canary.20260911T102437"
70
70
  },
71
71
  "devDependencies": {
72
- "@internals/client": "0.0.0",
73
- "@internals/shared": "0.0.0",
72
+ "@internals/client": "0.1.0-canary.20260911T102437",
73
+ "@internals/shared": "0.1.0-canary.20260911T102437",
74
74
  "axios": "^1.20.0",
75
75
  "kubb": "^5.2.0",
76
76
  "typescript": "^6.0.3"
@@ -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?: unknown
228
+ path?: Record<string, unknown>
229
229
  query?: unknown
230
230
  params?: unknown
231
- cookies?: unknown
231
+ cookies?: Record<string, unknown>
232
232
  body?: TBody
233
- headers?: unknown
233
+ headers?: HeadersInit
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 as HeadersInit | undefined, requestConfig.styles?.header))
529
+ const headers = mergeHeaders(config.headers, applyHeaderStyles(requestConfig.headers, 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 as Record<string, unknown>, requestConfig.styles?.cookie)
546
+ const cookie = serializeCookies(requestConfig.cookies, 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 ?? {}) as Record<string, unknown>
573
+ const pathParams = requestConfig.path ?? {}
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 ?? {}) as Record<string, unknown>,
728
+ pathParams: requestConfig.path ?? {},
729
729
  search: querySerializer(query, requestConfig.styles?.query),
730
730
  pathSerializer,
731
731
  pathStyles: requestConfig.styles?.path,