@kubb/plugin-vue-query 5.12.0-canary.20261119T200322 → 5.12.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 +9 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -23
- package/dist/index.js.map +1 -1
- package/docs/options.md +2 -2
- package/package.json +11 -11
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FileNode, Macro, OperationNode, StatusCode } from "@kubb/ast";
|
|
2
|
-
import { Exclude, Group, Include, Output, OutputOptions, Override, PluginType, Resolver,
|
|
2
|
+
import { Exclude, Group, Include, Output, OutputOptions, Override, PluginType, Resolver, ResolverInput } from "@kubb/kit";
|
|
3
3
|
import { ResolverTs } from "@kubb/plugin-ts";
|
|
4
4
|
/**
|
|
5
5
|
* The client selector accepted by a consumer's `client` option. Each calls a registered contract
|
|
@@ -387,7 +387,7 @@ type Options = PluginOptions<ResolvedOptions> & {
|
|
|
387
387
|
/**
|
|
388
388
|
* Override how composable names and file paths are built.
|
|
389
389
|
*/
|
|
390
|
-
resolver?:
|
|
390
|
+
resolver?: ResolverInput<ResolverVueQuery>;
|
|
391
391
|
/**
|
|
392
392
|
* Set to `true` to also generate `use*` composable functions. By default only the
|
|
393
393
|
* `queryOptions`, `queryKey`, and `mutationKey` helpers are emitted.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FileNode, Macro, OperationNode, StatusCode } from "@kubb/ast";
|
|
2
|
-
import { Exclude, Group, Include, Output, OutputOptions, Override, PluginType, Resolver,
|
|
2
|
+
import { Exclude, Group, Include, Output, OutputOptions, Override, PluginType, Resolver, ResolverInput } from "@kubb/kit";
|
|
3
3
|
import { ResolverTs } from "@kubb/plugin-ts";
|
|
4
4
|
/**
|
|
5
5
|
* The client selector accepted by a consumer's `client` option. Each calls a registered contract
|
|
@@ -387,7 +387,7 @@ type Options = PluginOptions<ResolvedOptions> & {
|
|
|
387
387
|
/**
|
|
388
388
|
* Override how composable names and file paths are built.
|
|
389
389
|
*/
|
|
390
|
-
resolver?:
|
|
390
|
+
resolver?: ResolverInput<ResolverVueQuery>;
|
|
391
391
|
/**
|
|
392
392
|
* Set to `true` to also generate `use*` composable functions. By default only the
|
|
393
393
|
* `queryOptions`, `queryKey`, and `mutationKey` helpers are emitted.
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Diagnostics, Resolver, Url, addGenerator, casing, createResolver, defineExtension, defineGenerator, setMacros, setResolver, useConfig } from "@kubb/kit";
|
|
1
|
+
import { Diagnostics, Resolver, Url, addGenerator, casing, createResolver, defineExtension, defineGenerator, operationKey, setMacros, setResolver, useConfig } from "@kubb/kit";
|
|
2
2
|
import { createFunctionParameter, createFunctionParameters, createObjectBindingPattern, createTypeLiteral, functionPrinter, pluginTsName } from "@kubb/plugin-ts";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { ast, ref } from "@kubb/ast";
|
|
@@ -10,7 +10,7 @@ var compatibility = {
|
|
|
10
10
|
"node": ">=22.22"
|
|
11
11
|
};
|
|
12
12
|
// package.json
|
|
13
|
-
var version = "5.12.0
|
|
13
|
+
var version = "5.12.0";
|
|
14
14
|
// ../../internals/client/src/resolveClient.ts
|
|
15
15
|
/**
|
|
16
16
|
* Resolves which client plugin a consumer (react-query, vue-query, swr, mcp) should call for an
|
|
@@ -654,26 +654,6 @@ function resolveOperationTypeNames(node, resolver, options = {}) {
|
|
|
654
654
|
function resolveOperationName(name) {
|
|
655
655
|
return this.memo(`operation:${name}`, () => ensureValidVarName(casing.camel(name)));
|
|
656
656
|
}
|
|
657
|
-
/**
|
|
658
|
-
* Builds the allocation key for a declaration an operation owns. `scope` names which declaration
|
|
659
|
-
* it is, so two of them never share an allocation even when a custom resolver gives both the same
|
|
660
|
-
* name. Leave `scope` empty for the operation's own declaration.
|
|
661
|
-
*
|
|
662
|
-
* The key starts from the operation's input `pointer`, which macros keep, so a plugin whose macro
|
|
663
|
-
* rewrites the method or path still resolves another plugin's names for the same operation.
|
|
664
|
-
*
|
|
665
|
-
* @example
|
|
666
|
-
* ```ts
|
|
667
|
-
* resolver.resolveName({ key: operationKey(node, 'response', 'status', 404), name })
|
|
668
|
-
* ```
|
|
669
|
-
*/
|
|
670
|
-
function operationKey(node, ...scope) {
|
|
671
|
-
return [
|
|
672
|
-
"operation",
|
|
673
|
-
...node.pointer ? [node.pointer] : [node.method, node.path],
|
|
674
|
-
...scope.map(String)
|
|
675
|
-
];
|
|
676
|
-
}
|
|
677
657
|
// ../../internals/client/src/resolveClientOperation.ts
|
|
678
658
|
function isRelativeImport(importPath) {
|
|
679
659
|
return importPath.startsWith(".");
|
|
@@ -2128,7 +2108,7 @@ const pluginVueQuery = defineExtension({
|
|
|
2128
2108
|
path: "hooks",
|
|
2129
2109
|
barrel: { type: "named" }
|
|
2130
2110
|
}, group, exclude = [], include, override = [], infinite = false, mutation = {}, query = {}, mutationKey = mutationKeyTransformer, queryKey = queryKeyTransformer, hooks = false, client, returnType = "data", resolver: userResolver, macros: userMacros } = options;
|
|
2131
|
-
const resolver = userResolver ? Resolver.merge(resolverVueQuery, userResolver) : resolverVueQuery;
|
|
2111
|
+
const resolver = userResolver ? Resolver.merge(resolverVueQuery, ...[userResolver].flat()) : resolverVueQuery;
|
|
2132
2112
|
setResolver(resolver);
|
|
2133
2113
|
if (userMacros?.length) setMacros(userMacros);
|
|
2134
2114
|
addGenerator(queryGenerator, infiniteQueryGenerator, mutationGenerator);
|