@kubb/plugin-axios 5.13.0-canary.20261105T162357 → 5.13.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.
@@ -0,0 +1,81 @@
1
+ import { n as __exportAll, r as __reExport, t as core_d_exports } from "./core-D6FAGTsL.js";
2
+ import { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse, InternalAxiosRequestConfig } from "axios";
3
+ declare namespace client_d_exports {
4
+ export { AxiosOptions, AxiosTransport, ClientConfig, ClientInstance, InterceptorChannel, InterceptorFn, Interceptors, NativeRequest, NativeResponse, Options, RequestConfig, ResolvedRequest, ResponseError, client, createAxiosTransport, createClient, createClientCore, defaultTransport };
5
+ }
6
+ /** The request and response objects of this transport, carried on every result and error. */
7
+ type NativeRequest = AxiosRequestConfig;
8
+ type NativeResponse = AxiosResponse;
9
+ /**
10
+ * Extra axios config the transport spreads onto every request, an escape hatch for per-call fields the runtime does not set itself such as `timeout`, `proxy`, and the progress callbacks.
11
+ */
12
+ type AxiosOptions = AxiosRequestConfig;
13
+ /** A transport as this client accepts it: an axios instance, which `createAxiosTransport` wraps, or a transport function. */
14
+ type AxiosTransport = AxiosInstance | core_d_exports.Transport;
15
+ type AxiosOverrides = {
16
+ options?: AxiosOptions;
17
+ transport?: AxiosTransport;
18
+ /**
19
+ * @deprecated Has no effect. The client splits success from error by status, so axios never throws on a status.
20
+ */
21
+ validateStatus?: (status: number) => boolean;
22
+ };
23
+ type RequestConfig<TBody = unknown, TRequest = NativeRequest, TResponse = NativeResponse> = Omit<core_d_exports.RequestConfig<TBody, TRequest, TResponse>, 'transport' | 'client'> & AxiosOverrides & {
24
+ client?: ClientInstance<TRequest, TResponse>;
25
+ };
26
+ type Options<TData extends core_d_exports.DataShape, ThrowOnError extends boolean = true, TRequest = NativeRequest, TResponse = NativeResponse> = Omit<core_d_exports.Options<TData, ThrowOnError, TRequest, TResponse>, 'transport' | 'client'> & AxiosOverrides & {
27
+ client?: ClientInstance<TRequest, TResponse>;
28
+ };
29
+ type ClientConfig<TRequest = NativeRequest, TResponse = NativeResponse> = Omit<core_d_exports.ClientConfig<TRequest, TResponse>, 'transport'> & AxiosOverrides;
30
+ type ResolvedRequest = core_d_exports.ResolvedRequest & {
31
+ options?: AxiosOptions;
32
+ };
33
+ type ResponseError<TError = unknown, TRequest = NativeRequest, TResponse = NativeResponse> = core_d_exports.ResponseError<TError, TRequest, TResponse>;
34
+ /** The core's `ResponseError` class, typed with this transport's request and response. `instanceof` and `ResponseError.is` both match what the client throws. */
35
+ declare const ResponseError: {
36
+ new <TError = unknown, TRequest = NativeRequest, TResponse = NativeResponse>(config: ConstructorParameters<typeof core_d_exports.ResponseError<TError, TRequest, TResponse>>[0]): core_d_exports.ResponseError<TError, TRequest, TResponse>;
37
+ is: typeof core_d_exports.ResponseError.is;
38
+ prototype: core_d_exports.ResponseError<unknown, NativeRequest, NativeResponse>;
39
+ };
40
+ /** An interceptor handler. It receives the native axios object; the second argument is kept for handlers written against earlier versions and is always `undefined`. */
41
+ type InterceptorFn<T> = (value: T, requestConfig?: RequestConfig) => T | Promise<T>;
42
+ /** Registers, removes, or replaces handlers on axios's own interceptor managers. */
43
+ type InterceptorChannel<T> = {
44
+ use: (fn: InterceptorFn<T>) => number;
45
+ eject: (id: number) => void;
46
+ update: (id: number, fn: InterceptorFn<T>) => void;
47
+ };
48
+ /** The interceptors of `defaultTransport`: request handlers see the `InternalAxiosRequestConfig`, response handlers the `AxiosResponse`, error handlers the `AxiosError`. */
49
+ type Interceptors = {
50
+ request: InterceptorChannel<InternalAxiosRequestConfig>;
51
+ response: InterceptorChannel<AxiosResponse>;
52
+ error: InterceptorChannel<AxiosError>;
53
+ };
54
+ type ClientInstance<TRequest = NativeRequest, TResponse = NativeResponse> = {
55
+ <TBody = unknown>(config: RequestConfig<TBody, TRequest, TResponse>): Promise<core_d_exports.CallResult<TRequest, TResponse>>;
56
+ getConfig: () => ClientConfig<TRequest, TResponse>;
57
+ setConfig: (config: ClientConfig<TRequest, TResponse>) => ClientConfig<TRequest, TResponse>;
58
+ getUrl: core_d_exports.ClientInstance<TRequest, TResponse>['getUrl'];
59
+ interceptors: Interceptors;
60
+ createClient: (config?: ClientConfig<TRequest, TResponse>) => ClientInstance<TRequest, TResponse>;
61
+ };
62
+ /**
63
+ * Turns an axios instance into a transport: each resolved request becomes one `instance.request` with the instance's
64
+ * defaults, adapter, and axios interceptors. Every status resolves, because the core splits success from error itself.
65
+ */
66
+ declare function createAxiosTransport(instance: AxiosInstance): core_d_exports.Transport;
67
+ /**
68
+ * The axios instance the generated `client` sends through when no transport is set. Set its defaults or register axios
69
+ * interceptors on it. Instances from `createClient()` get their own.
70
+ */
71
+ declare const defaultTransport: AxiosInstance;
72
+ /**
73
+ * Creates an isolated client. `defaultTransport` is the axios instance to send through, a transport function, or left out
74
+ * for a new `axios.create()`.
75
+ */
76
+ declare function createClientCore(options?: {
77
+ defaultTransport?: AxiosTransport;
78
+ } & ClientConfig): ClientInstance;
79
+ declare const client: ClientInstance<NativeRequest, NativeResponse>;
80
+ declare const createClient: (config?: ClientConfig) => ClientInstance<NativeRequest, NativeResponse>;
81
+ export { createClient as _, InterceptorChannel as a, NativeRequest as c, RequestConfig as d, ResolvedRequest as f, createAxiosTransport as g, client_d_exports as h, ClientInstance as i, NativeResponse as l, client as m, AxiosTransport as n, InterceptorFn as o, ResponseError as p, ClientConfig as r, Interceptors as s, AxiosOptions as t, Options as u, createClientCore as v, defaultTransport as y };
@@ -0,0 +1,2 @@
1
+ import * as import__kubb_plugin_client_templates_core_ts from "@kubb/plugin-client/templates/core.ts";
2
+ export { __exportAll as n, __reExport as r, core_d_exports as t };