@kubb/plugin-fetch 5.5.11 → 5.5.12
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.12";
|
|
1491
1491
|
//#endregion
|
|
1492
1492
|
//#region src/templates.ts
|
|
1493
1493
|
/** Absolute path to the fetch 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 PluginFetch =
|
|
191
|
+
type PluginFetch = PluginType<'plugin-fetch', 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.12";
|
|
1465
1465
|
//#endregion
|
|
1466
1466
|
//#region src/templates.ts
|
|
1467
1467
|
/** Absolute path to the fetch 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-fetch/guides/interceptors)
|
|
77
|
-
- [Set the base URL](https://kubb.dev/extensions/kubb-labs/plugin-fetch/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-fetch/guides/authentication)
|
|
63
|
-
- [Use a custom transport](https://kubb.dev/extensions/kubb-labs/plugin-fetch/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-fetch/guides/error-handling)
|
|
145
|
-
- [Configure serialization](https://kubb.dev/extensions/kubb-labs/plugin-fetch/guides/serialization)
|
|
146
|
-
- [Set the base URL](https://kubb.dev/extensions/kubb-labs/plugin-fetch/guides/base-url)
|
|
147
|
-
- [Server-sent events](https://kubb.dev/extensions/kubb-labs/plugin-fetch/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-fetch/guides/calling-operations)
|
|
123
|
-
- [Configure serialization](https://kubb.dev/extensions/kubb-labs/plugin-fetch/guides/serialization)
|
|
124
|
-
- [Add interceptors](https://kubb.dev/extensions/kubb-labs/plugin-fetch/guides/interceptors)
|
|
@@ -70,9 +70,3 @@ client.interceptors.request.eject(id)
|
|
|
70
70
|
## Where to set them
|
|
71
71
|
|
|
72
72
|
Register handlers on the shared `client` for all operations, or on a separate `createClient` instance for isolated calls. Interceptors are instance-level settings.
|
|
73
|
-
|
|
74
|
-
## See also
|
|
75
|
-
|
|
76
|
-
- [Handle errors](https://kubb.dev/extensions/kubb-labs/plugin-fetch/guides/error-handling)
|
|
77
|
-
- [Authenticate requests](https://kubb.dev/extensions/kubb-labs/plugin-fetch/guides/authentication)
|
|
78
|
-
- [Use a custom transport](https://kubb.dev/extensions/kubb-labs/plugin-fetch/guides/transport)
|
|
@@ -112,9 +112,3 @@ pluginFetch({ 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-fetch/guides/calling-operations)
|
|
119
|
-
- [Handle errors](https://kubb.dev/extensions/kubb-labs/plugin-fetch/guides/error-handling)
|
|
120
|
-
- [Server-sent events](https://kubb.dev/extensions/kubb-labs/plugin-fetch/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-fetch/guides/calling-operations)
|
|
99
|
-
- [Handle errors](https://kubb.dev/extensions/kubb-labs/plugin-fetch/guides/error-handling)
|
package/docs/guides/transport.md
CHANGED
|
@@ -63,9 +63,3 @@ Pass the isolated client per operation or to a query plugin.
|
|
|
63
63
|
## Where to set it
|
|
64
64
|
|
|
65
65
|
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.
|
|
66
|
-
|
|
67
|
-
## See also
|
|
68
|
-
|
|
69
|
-
- [Add interceptors](https://kubb.dev/extensions/kubb-labs/plugin-fetch/guides/interceptors)
|
|
70
|
-
- [Set the base URL](https://kubb.dev/extensions/kubb-labs/plugin-fetch/guides/base-url)
|
|
71
|
-
- [Call operations](https://kubb.dev/extensions/kubb-labs/plugin-fetch/guides/calling-operations)
|
package/kubb-extension.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-fetch",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.12",
|
|
4
4
|
"description": "Generate a slim, type-safe HTTP client with Kubb based on the native Fetch api.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api-client",
|
|
@@ -68,17 +68,17 @@
|
|
|
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
|
-
"kubb": "^5.
|
|
77
|
+
"kubb": "^5.9.2",
|
|
78
78
|
"typescript": "^6.0.3"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
81
|
-
"kubb": "^5.
|
|
81
|
+
"kubb": "^5.9.2"
|
|
82
82
|
},
|
|
83
83
|
"engines": {
|
|
84
84
|
"node": ">=22"
|
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 PluginFetch =
|
|
11
|
+
export type PluginFetch = PluginType<'plugin-fetch', Options, ResolvedOptions, ResolverClient>
|
|
12
12
|
|
|
13
13
|
declare global {
|
|
14
14
|
namespace Kubb {
|