@kubb/plugin-axios 5.5.12 → 5.5.13
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/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/docs/guides/authentication.md +0 -5
- package/docs/guides/base-url.md +0 -5
- package/docs/guides/calling-operations.md +0 -7
- package/docs/guides/error-handling.md +0 -6
- package/docs/guides/interceptors.md +0 -6
- package/docs/guides/serialization.md +0 -6
- package/docs/guides/server-sent-events.md +0 -5
- package/docs/guides/transport.md +0 -6
- package/kubb-extension.json +1 -0
- package/package.json +5 -5
- package/src/types.ts +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1487,7 +1487,7 @@ var compatibility = {
|
|
|
1487
1487
|
};
|
|
1488
1488
|
//#endregion
|
|
1489
1489
|
//#region package.json
|
|
1490
|
-
var version = "5.5.
|
|
1490
|
+
var version = "5.5.13";
|
|
1491
1491
|
//#endregion
|
|
1492
1492
|
//#region src/templates.ts
|
|
1493
1493
|
/** Absolute path to the axios client template, copied into `.kubb/client.ts`. */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __name } from "./rolldown-runtime-C0LytTxp.js";
|
|
2
|
-
import { Exclude, Group, Include, Output, OutputOptions, Override,
|
|
2
|
+
import { Exclude, Group, Include, Output, OutputOptions, Override, PluginType, Resolver, ResolverPatch, ast } from "kubb/kit";
|
|
3
3
|
import "kubb/jsx";
|
|
4
4
|
import "@kubb/plugin-zod";
|
|
5
5
|
//#region ../../internals/client/src/types.d.ts
|
|
@@ -188,7 +188,7 @@ type ResolvedOptions = {
|
|
|
188
188
|
* resolved-options shape with the other client plugins; only the plugin name and transport
|
|
189
189
|
* differ.
|
|
190
190
|
*/
|
|
191
|
-
type PluginAxios =
|
|
191
|
+
type PluginAxios = PluginType<'plugin-axios', Options, ResolvedOptions, ResolverClient>;
|
|
192
192
|
declare global {
|
|
193
193
|
namespace Kubb {
|
|
194
194
|
interface PluginRegistry {
|
package/dist/index.js
CHANGED
|
@@ -1461,7 +1461,7 @@ var compatibility = {
|
|
|
1461
1461
|
};
|
|
1462
1462
|
//#endregion
|
|
1463
1463
|
//#region package.json
|
|
1464
|
-
var version = "5.5.
|
|
1464
|
+
var version = "5.5.13";
|
|
1465
1465
|
//#endregion
|
|
1466
1466
|
//#region src/templates.ts
|
|
1467
1467
|
/** Absolute path to the axios client template, copied into `.kubb/client.ts`. */
|
|
@@ -70,8 +70,3 @@ const { data } = await getPetById({ path: { petId: 1 }, client: tenant })
|
|
|
70
70
|
To override the client for one request, pass `auth` on that single call, which suits a one-off token refresh. An explicit `headers` value you set on a call always wins over the resolved token.
|
|
71
71
|
|
|
72
72
|
For authentication outside OpenAPI security schemes, use an async request interceptor to sign requests or supply custom headers.
|
|
73
|
-
|
|
74
|
-
## See also
|
|
75
|
-
|
|
76
|
-
- [Add interceptors](https://kubb.dev/extensions/kubb-labs/plugin-axios/guides/interceptors)
|
|
77
|
-
- [Set the base URL](https://kubb.dev/extensions/kubb-labs/plugin-axios/guides/base-url)
|
package/docs/guides/base-url.md
CHANGED
|
@@ -56,8 +56,3 @@ const { data } = await getPetById({ path: { petId: 1 }, baseURL: 'https://localh
|
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
A `baseURL` set on the call wins over `createClient`, which wins over `setConfig`, which wins over the build-time value.
|
|
59
|
-
|
|
60
|
-
## See also
|
|
61
|
-
|
|
62
|
-
- [Authenticate requests](https://kubb.dev/extensions/kubb-labs/plugin-axios/guides/authentication)
|
|
63
|
-
- [Use a custom transport](https://kubb.dev/extensions/kubb-labs/plugin-axios/guides/transport)
|
|
@@ -138,10 +138,3 @@ const url = client.getUrl({
|
|
|
138
138
|
})
|
|
139
139
|
// https://api.example.com/v1/pets/1?fields=name
|
|
140
140
|
```
|
|
141
|
-
|
|
142
|
-
## See also
|
|
143
|
-
|
|
144
|
-
- [Handle errors](https://kubb.dev/extensions/kubb-labs/plugin-axios/guides/error-handling)
|
|
145
|
-
- [Configure serialization](https://kubb.dev/extensions/kubb-labs/plugin-axios/guides/serialization)
|
|
146
|
-
- [Set the base URL](https://kubb.dev/extensions/kubb-labs/plugin-axios/guides/base-url)
|
|
147
|
-
- [Server-sent events](https://kubb.dev/extensions/kubb-labs/plugin-axios/guides/server-sent-events)
|
|
@@ -116,9 +116,3 @@ A `ParseError` reports schema validation issues. A `ResponseError` reports a non
|
|
|
116
116
|
|
|
117
117
|
Calling `.unwrap()` on a `throwOnError: false` call turns that same `error` into a rejection, so a
|
|
118
118
|
`try`/`catch` works there too.
|
|
119
|
-
|
|
120
|
-
## See also
|
|
121
|
-
|
|
122
|
-
- [Call operations](https://kubb.dev/extensions/kubb-labs/plugin-axios/guides/calling-operations)
|
|
123
|
-
- [Configure serialization](https://kubb.dev/extensions/kubb-labs/plugin-axios/guides/serialization)
|
|
124
|
-
- [Add interceptors](https://kubb.dev/extensions/kubb-labs/plugin-axios/guides/interceptors)
|
|
@@ -74,9 +74,3 @@ Interceptors registered through `client.interceptors` also follow a custom trans
|
|
|
74
74
|
instance and attach to the new one, and their IDs stay valid for `eject` and `update`. Clearing the
|
|
75
75
|
transport (`client.setConfig({ transport: undefined })`) moves them back to the client's base
|
|
76
76
|
instance. A per-call `transport` still bypasses client interceptors.
|
|
77
|
-
|
|
78
|
-
## See also
|
|
79
|
-
|
|
80
|
-
- [Handle errors](https://kubb.dev/extensions/kubb-labs/plugin-axios/guides/error-handling)
|
|
81
|
-
- [Authenticate requests](https://kubb.dev/extensions/kubb-labs/plugin-axios/guides/authentication)
|
|
82
|
-
- [Use a custom transport](https://kubb.dev/extensions/kubb-labs/plugin-axios/guides/transport)
|
|
@@ -112,9 +112,3 @@ pluginAxios({ validator: { request: 'zod', response: 'zod' } })
|
|
|
112
112
|
With a validator set, Kubb passes the matching schema to each generated call, and the runtime
|
|
113
113
|
parses the body through it. A body that does not match throws a `ParseError` with the schema's
|
|
114
114
|
`issues`.
|
|
115
|
-
|
|
116
|
-
## See also
|
|
117
|
-
|
|
118
|
-
- [Call operations](https://kubb.dev/extensions/kubb-labs/plugin-axios/guides/calling-operations)
|
|
119
|
-
- [Handle errors](https://kubb.dev/extensions/kubb-labs/plugin-axios/guides/error-handling)
|
|
120
|
-
- [Server-sent events](https://kubb.dev/extensions/kubb-labs/plugin-axios/guides/server-sent-events)
|
|
@@ -92,8 +92,3 @@ try {
|
|
|
92
92
|
> [!NOTE]
|
|
93
93
|
> A drop mid-stream ends the `for await` loop. Track the last event's `id` if you need to reconnect
|
|
94
94
|
> from where the stream stopped.
|
|
95
|
-
|
|
96
|
-
## See also
|
|
97
|
-
|
|
98
|
-
- [Call operations](https://kubb.dev/extensions/kubb-labs/plugin-axios/guides/calling-operations)
|
|
99
|
-
- [Handle errors](https://kubb.dev/extensions/kubb-labs/plugin-axios/guides/error-handling)
|
package/docs/guides/transport.md
CHANGED
|
@@ -42,9 +42,3 @@ Every generated function now sends through your instance, so its timeout, header
|
|
|
42
42
|
## Where to set it
|
|
43
43
|
|
|
44
44
|
Use `client.setConfig({ transport })` for shared configuration, `createClient({ transport })` for an isolated instance, or pass `transport` on an operation to override it for one call.
|
|
45
|
-
|
|
46
|
-
## See also
|
|
47
|
-
|
|
48
|
-
- [Add interceptors](https://kubb.dev/extensions/kubb-labs/plugin-axios/guides/interceptors)
|
|
49
|
-
- [Set the base URL](https://kubb.dev/extensions/kubb-labs/plugin-axios/guides/base-url)
|
|
50
|
-
- [Call operations](https://kubb.dev/extensions/kubb-labs/plugin-axios/guides/calling-operations)
|
package/kubb-extension.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-axios",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.13",
|
|
4
4
|
"description": "Generate a slim, type-safe HTTP client with Kubb based on axios.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api-client",
|
|
@@ -68,19 +68,19 @@
|
|
|
68
68
|
"registry": "https://registry.npmjs.org/"
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@kubb/plugin-ts": "^5.0.
|
|
72
|
-
"@kubb/plugin-zod": "^5.4.
|
|
71
|
+
"@kubb/plugin-ts": "^5.0.11",
|
|
72
|
+
"@kubb/plugin-zod": "^5.4.9"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@internals/client": "0.0.0",
|
|
76
76
|
"@internals/shared": "0.0.0",
|
|
77
77
|
"axios": "^1.20.0",
|
|
78
|
-
"kubb": "^5.
|
|
78
|
+
"kubb": "^5.9.2",
|
|
79
79
|
"typescript": "^6.0.3"
|
|
80
80
|
},
|
|
81
81
|
"peerDependencies": {
|
|
82
82
|
"axios": "^1.20.0",
|
|
83
|
-
"kubb": "^5.
|
|
83
|
+
"kubb": "^5.9.2"
|
|
84
84
|
},
|
|
85
85
|
"peerDependenciesMeta": {
|
|
86
86
|
"axios": {
|
package/src/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PluginType } from 'kubb/kit'
|
|
2
2
|
import type { Options, ResolvedOptions, ResolverClient } from '@internals/client'
|
|
3
3
|
|
|
4
4
|
export type { Options, ResolvedOptions, ResolverClient } from '@internals/client'
|
|
@@ -8,7 +8,7 @@ export type { Options, ResolvedOptions, ResolverClient } from '@internals/client
|
|
|
8
8
|
* resolved-options shape with the other client plugins; only the plugin name and transport
|
|
9
9
|
* differ.
|
|
10
10
|
*/
|
|
11
|
-
export type PluginAxios =
|
|
11
|
+
export type PluginAxios = PluginType<'plugin-axios', Options, ResolvedOptions, ResolverClient>
|
|
12
12
|
|
|
13
13
|
declare global {
|
|
14
14
|
namespace Kubb {
|