@kubb/plugin-vue-query 5.11.0-canary.20261117T231551 → 5.11.0
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 +10 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +10 -7
- package/dist/index.js.map +1 -1
- package/docs/guides/calling-operations.md +1 -1
- package/docs/options.md +8 -4
- package/docs/overview.md +2 -2
- package/kubb-extension.json +5 -1
- package/package.json +9 -9
package/dist/index.cjs
CHANGED
|
@@ -35,14 +35,14 @@ var compatibility = {
|
|
|
35
35
|
"node": ">=22.22"
|
|
36
36
|
};
|
|
37
37
|
// package.json
|
|
38
|
-
var version = "5.11.0
|
|
38
|
+
var version = "5.11.0";
|
|
39
39
|
// ../../internals/client/src/resolveClient.ts
|
|
40
40
|
/**
|
|
41
41
|
* Resolves which client plugin a consumer (react-query, vue-query, swr, mcp) should call for an
|
|
42
42
|
* operation, shared so the selection rules and diagnostics stay in one place.
|
|
43
43
|
*
|
|
44
44
|
* Every client runtime lives in a dedicated client plugin, so a consumer always calls a registered
|
|
45
|
-
* contract client plugin (plugin-fetch, plugin-axios, or plugin-client) and never emits its own
|
|
45
|
+
* contract client plugin (plugin-fetch, plugin-axios, plugin-ky, or plugin-client) and never emits its own
|
|
46
46
|
* inline client:
|
|
47
47
|
*
|
|
48
48
|
* - `contract` — a registered contract client plugin owns the `<op>` functions and the consumer
|
|
@@ -50,20 +50,23 @@ var version = "5.11.0-canary.20261117T231551";
|
|
|
50
50
|
* - `error` — no client plugin is registered, several are registered without a selector, the
|
|
51
51
|
* requested one is missing, or `client` is not a known selector.
|
|
52
52
|
*
|
|
53
|
-
* The `client` string selects explicitly (`'fetch'` / `'axios'` / `'client'`); when it is unset a
|
|
53
|
+
* The `client` string selects explicitly (`'fetch'` / `'axios'` / `'ky'` / `'client'`); when it is unset a
|
|
54
54
|
* lone registered contract client plugin is picked up automatically.
|
|
55
55
|
*/
|
|
56
56
|
const pluginFetchName = "plugin-fetch";
|
|
57
57
|
const pluginAxiosName = "plugin-axios";
|
|
58
|
+
const pluginKyName = "plugin-ky";
|
|
58
59
|
const pluginClientName = "plugin-client";
|
|
59
60
|
const selectorToPlugin = {
|
|
60
61
|
fetch: pluginFetchName,
|
|
61
62
|
axios: pluginAxiosName,
|
|
63
|
+
ky: pluginKyName,
|
|
62
64
|
client: pluginClientName
|
|
63
65
|
};
|
|
64
66
|
const contractPlugins = [
|
|
65
67
|
pluginFetchName,
|
|
66
68
|
pluginAxiosName,
|
|
69
|
+
pluginKyName,
|
|
67
70
|
pluginClientName
|
|
68
71
|
];
|
|
69
72
|
/**
|
|
@@ -84,7 +87,7 @@ const contractPlugins = [
|
|
|
84
87
|
function resolveClient(options) {
|
|
85
88
|
const { client, pluginNames } = options;
|
|
86
89
|
const has = (name) => pluginNames.includes(name);
|
|
87
|
-
if (client
|
|
90
|
+
if (client !== void 0 && Object.hasOwn(selectorToPlugin, client)) {
|
|
88
91
|
const pluginName = selectorToPlugin[client];
|
|
89
92
|
if (!has(pluginName)) return {
|
|
90
93
|
kind: "error",
|
|
@@ -100,7 +103,7 @@ function resolveClient(options) {
|
|
|
100
103
|
if (client !== void 0) return {
|
|
101
104
|
kind: "error",
|
|
102
105
|
code: _kubb_kit.Diagnostics.code.invalidPluginOptions,
|
|
103
|
-
message: `Option \`client\` is ${typeof client === "string" ? `'${client}'` : String(client)}, but it must be one of 'fetch', 'axios', 'client'.`,
|
|
106
|
+
message: `Option \`client\` is ${typeof client === "string" ? `'${client}'` : String(client)}, but it must be one of 'fetch', 'axios', 'ky', 'client'.`,
|
|
104
107
|
help: "Set `client` to one of those values, or drop it to use the registered client plugin."
|
|
105
108
|
};
|
|
106
109
|
const registered = contractPlugins.filter(has);
|
|
@@ -112,13 +115,13 @@ function resolveClient(options) {
|
|
|
112
115
|
kind: "error",
|
|
113
116
|
code: _kubb_kit.Diagnostics.code.invalidPluginOptions,
|
|
114
117
|
message: `Multiple client plugins are registered (${registered.map((name) => `\`@kubb/${name}\``).join(", ")}) and \`client\` is not set.`,
|
|
115
|
-
help: "Set `client: 'fetch' | 'axios' | 'client'` to choose which client the hooks call, or register a single client plugin."
|
|
118
|
+
help: "Set `client: 'fetch' | 'axios' | 'ky' | 'client'` to choose which client the hooks call, or register a single client plugin."
|
|
116
119
|
};
|
|
117
120
|
return {
|
|
118
121
|
kind: "error",
|
|
119
122
|
code: _kubb_kit.Diagnostics.code.missingDependency,
|
|
120
123
|
message: "No client plugin is registered.",
|
|
121
|
-
help: "Add `@kubb/plugin-fetch`, `@kubb/plugin-axios`, or `@kubb/plugin-client` to `plugins` so the generated code has an HTTP client to call."
|
|
124
|
+
help: "Add `@kubb/plugin-fetch`, `@kubb/plugin-axios`, `@kubb/plugin-ky`, or `@kubb/plugin-client` to `plugins` so the generated code has an HTTP client to call."
|
|
122
125
|
};
|
|
123
126
|
}
|
|
124
127
|
/**
|