@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.cjs
CHANGED
|
@@ -36,7 +36,7 @@ var compatibility = {
|
|
|
36
36
|
"node": ">=22.22"
|
|
37
37
|
};
|
|
38
38
|
// package.json
|
|
39
|
-
var version = "5.12.0
|
|
39
|
+
var version = "5.12.0";
|
|
40
40
|
// ../../internals/client/src/resolveClient.ts
|
|
41
41
|
/**
|
|
42
42
|
* Resolves which client plugin a consumer (react-query, vue-query, swr, mcp) should call for an
|
|
@@ -680,26 +680,6 @@ function resolveOperationTypeNames(node, resolver, options = {}) {
|
|
|
680
680
|
function resolveOperationName(name) {
|
|
681
681
|
return this.memo(`operation:${name}`, () => ensureValidVarName(_kubb_kit.casing.camel(name)));
|
|
682
682
|
}
|
|
683
|
-
/**
|
|
684
|
-
* Builds the allocation key for a declaration an operation owns. `scope` names which declaration
|
|
685
|
-
* it is, so two of them never share an allocation even when a custom resolver gives both the same
|
|
686
|
-
* name. Leave `scope` empty for the operation's own declaration.
|
|
687
|
-
*
|
|
688
|
-
* The key starts from the operation's input `pointer`, which macros keep, so a plugin whose macro
|
|
689
|
-
* rewrites the method or path still resolves another plugin's names for the same operation.
|
|
690
|
-
*
|
|
691
|
-
* @example
|
|
692
|
-
* ```ts
|
|
693
|
-
* resolver.resolveName({ key: operationKey(node, 'response', 'status', 404), name })
|
|
694
|
-
* ```
|
|
695
|
-
*/
|
|
696
|
-
function operationKey(node, ...scope) {
|
|
697
|
-
return [
|
|
698
|
-
"operation",
|
|
699
|
-
...node.pointer ? [node.pointer] : [node.method, node.path],
|
|
700
|
-
...scope.map(String)
|
|
701
|
-
];
|
|
702
|
-
}
|
|
703
683
|
// ../../internals/client/src/resolveClientOperation.ts
|
|
704
684
|
function isRelativeImport(importPath) {
|
|
705
685
|
return importPath.startsWith(".");
|
|
@@ -751,7 +731,7 @@ function resolveClientOperation(options) {
|
|
|
751
731
|
const name = resolver.name(node.operationId);
|
|
752
732
|
return {
|
|
753
733
|
name: resolver.resolveName({
|
|
754
|
-
key: operationKey(node),
|
|
734
|
+
key: (0, _kubb_kit.operationKey)(node),
|
|
755
735
|
name
|
|
756
736
|
}),
|
|
757
737
|
path: file.path,
|
|
@@ -1462,28 +1442,28 @@ function createQueryResolver(variant = "") {
|
|
|
1462
1442
|
name(node) {
|
|
1463
1443
|
const name = `use${_kubb_kit.casing.capitalize(this.name(node.operationId))}${variant}`;
|
|
1464
1444
|
return this.resolveName({
|
|
1465
|
-
key: operationKey(node, "query", variant, "name"),
|
|
1445
|
+
key: (0, _kubb_kit.operationKey)(node, "query", variant, "name"),
|
|
1466
1446
|
name
|
|
1467
1447
|
});
|
|
1468
1448
|
},
|
|
1469
1449
|
optionsName(node) {
|
|
1470
1450
|
const name = `${this.name(node.operationId)}${variant}QueryOptions`;
|
|
1471
1451
|
return this.resolveName({
|
|
1472
|
-
key: operationKey(node, "query", variant, "optionsName"),
|
|
1452
|
+
key: (0, _kubb_kit.operationKey)(node, "query", variant, "optionsName"),
|
|
1473
1453
|
name
|
|
1474
1454
|
});
|
|
1475
1455
|
},
|
|
1476
1456
|
keyName(node) {
|
|
1477
1457
|
const name = `${this.name(node.operationId)}${variant}QueryKey`;
|
|
1478
1458
|
return this.resolveName({
|
|
1479
|
-
key: operationKey(node, "query", variant, "keyName"),
|
|
1459
|
+
key: (0, _kubb_kit.operationKey)(node, "query", variant, "keyName"),
|
|
1480
1460
|
name
|
|
1481
1461
|
});
|
|
1482
1462
|
},
|
|
1483
1463
|
keyTypeName(node) {
|
|
1484
1464
|
const name = `${_kubb_kit.casing.capitalize(this.name(node.operationId))}${variant}QueryKey`;
|
|
1485
1465
|
return this.resolveName({
|
|
1486
|
-
key: operationKey(node, "query", variant, "keyTypeName"),
|
|
1466
|
+
key: (0, _kubb_kit.operationKey)(node, "query", variant, "keyTypeName"),
|
|
1487
1467
|
name
|
|
1488
1468
|
});
|
|
1489
1469
|
}
|
|
@@ -1504,14 +1484,14 @@ function createMutationResolver() {
|
|
|
1504
1484
|
name(node) {
|
|
1505
1485
|
const name = `use${_kubb_kit.casing.capitalize(this.name(node.operationId))}`;
|
|
1506
1486
|
return this.resolveName({
|
|
1507
|
-
key: operationKey(node, "mutation", "name"),
|
|
1487
|
+
key: (0, _kubb_kit.operationKey)(node, "mutation", "name"),
|
|
1508
1488
|
name
|
|
1509
1489
|
});
|
|
1510
1490
|
},
|
|
1511
1491
|
keyName(node) {
|
|
1512
1492
|
const name = `${this.name(node.operationId)}MutationKey`;
|
|
1513
1493
|
return this.resolveName({
|
|
1514
|
-
key: operationKey(node, "mutation", "keyName"),
|
|
1494
|
+
key: (0, _kubb_kit.operationKey)(node, "mutation", "keyName"),
|
|
1515
1495
|
name
|
|
1516
1496
|
});
|
|
1517
1497
|
}
|
|
@@ -2154,7 +2134,7 @@ const pluginVueQuery = (0, _kubb_kit.defineExtension)({
|
|
|
2154
2134
|
path: "hooks",
|
|
2155
2135
|
barrel: { type: "named" }
|
|
2156
2136
|
}, group, exclude = [], include, override = [], infinite = false, mutation = {}, query = {}, mutationKey = mutationKeyTransformer, queryKey = queryKeyTransformer, hooks = false, client, returnType = "data", resolver: userResolver, macros: userMacros } = options;
|
|
2157
|
-
const resolver = userResolver ? _kubb_kit.Resolver.merge(resolverVueQuery, userResolver) : resolverVueQuery;
|
|
2137
|
+
const resolver = userResolver ? _kubb_kit.Resolver.merge(resolverVueQuery, ...[userResolver].flat()) : resolverVueQuery;
|
|
2158
2138
|
(0, _kubb_kit.setResolver)(resolver);
|
|
2159
2139
|
if (userMacros?.length) (0, _kubb_kit.setMacros)(userMacros);
|
|
2160
2140
|
(0, _kubb_kit.addGenerator)(queryGenerator, infiniteQueryGenerator, mutationGenerator);
|