@kubb/plugin-react-query 5.8.0-canary.20261029T082701 → 5.8.0-canary.20261029T083215
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 +22 -94
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +0 -26
- package/dist/index.d.ts +0 -26
- package/dist/index.js +22 -94
- package/dist/index.js.map +1 -1
- package/docs/options.md +0 -2
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -510,7 +510,7 @@ var compatibility = {
|
|
|
510
510
|
"node": ">=22.22"
|
|
511
511
|
};
|
|
512
512
|
// package.json
|
|
513
|
-
var version = "5.8.0-canary.
|
|
513
|
+
var version = "5.8.0-canary.20261029T083215";
|
|
514
514
|
// ../../internals/client/src/resolveOperationTypes.ts
|
|
515
515
|
/**
|
|
516
516
|
* A `plugin-ts` shaped resolver whose operation type names point at the types `pluginZod({ inferred })`
|
|
@@ -1375,20 +1375,13 @@ function createQueryResolver(variant = "") {
|
|
|
1375
1375
|
key: operationKey(node, "query", variant, "keyTypeName"),
|
|
1376
1376
|
name
|
|
1377
1377
|
});
|
|
1378
|
-
},
|
|
1379
|
-
clientName(node) {
|
|
1380
|
-
const name = `${this.name(node.operationId)}${variant}`;
|
|
1381
|
-
return this.resolveName({
|
|
1382
|
-
key: operationKey(node, "query", variant, "clientName"),
|
|
1383
|
-
name
|
|
1384
|
-
});
|
|
1385
1378
|
}
|
|
1386
1379
|
};
|
|
1387
1380
|
}
|
|
1388
1381
|
/**
|
|
1389
1382
|
* Builds the shared mutation namespace. Spread the result into
|
|
1390
1383
|
* `createResolver` and add plugin-specific methods (`optionsName`,
|
|
1391
|
-
* `
|
|
1384
|
+
* `argTypeName`) next to it.
|
|
1392
1385
|
*
|
|
1393
1386
|
* @example
|
|
1394
1387
|
* ```ts
|
|
@@ -1604,93 +1597,35 @@ const hookOptionsGenerator = (0, kubb_kit.defineGenerator)({
|
|
|
1604
1597
|
const nodeMutation = "mutation" in opOverrides ? opOverrides.mutation : mutation;
|
|
1605
1598
|
const nodeInfinite = "infinite" in opOverrides ? opOverrides.infinite : infinite;
|
|
1606
1599
|
const nodeInfiniteOptions = nodeInfinite && typeof nodeInfinite === "object" ? nodeInfinite : null;
|
|
1607
|
-
const { isQuery
|
|
1608
|
-
query: nodeQuery
|
|
1600
|
+
const { isQuery, isMutation } = classifyOperation(node, {
|
|
1601
|
+
query: nodeQuery,
|
|
1609
1602
|
mutation: nodeMutation
|
|
1610
1603
|
});
|
|
1611
|
-
const
|
|
1612
|
-
const
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
}));
|
|
1627
|
-
hookOptions[queryHookName] = `Partial<ReturnType<typeof ${queryOptionsName}>>`;
|
|
1628
|
-
if (isSuspenseOp) {
|
|
1629
|
-
const suspenseOptionsName = resolver.suspenseQuery.optionsName(node);
|
|
1630
|
-
const suspenseHookName = resolver.suspenseQuery.name(node);
|
|
1631
|
-
const suspenseHookFile = resolver.file({
|
|
1632
|
-
...operationFileEntry(node, suspenseHookName),
|
|
1633
|
-
root,
|
|
1634
|
-
output,
|
|
1635
|
-
group: group ?? void 0
|
|
1636
|
-
});
|
|
1637
|
-
imports.push(/* @__PURE__ */ (0, kubb_jsx_jsx_runtime.jsx)(kubb_jsx.File.Import, {
|
|
1638
|
-
name: [suspenseOptionsName],
|
|
1639
|
-
root: hookOptionsFile.path,
|
|
1640
|
-
path: suspenseHookFile.path
|
|
1641
|
-
}));
|
|
1642
|
-
hookOptions[suspenseHookName] = `Partial<ReturnType<typeof ${suspenseOptionsName}>>`;
|
|
1643
|
-
}
|
|
1644
|
-
if (isInfiniteOp) {
|
|
1645
|
-
if (matchesInfinite(node, nodeInfiniteOptions)) {
|
|
1646
|
-
const infiniteOptionsName = resolver.infiniteQuery.optionsName(node);
|
|
1647
|
-
const infiniteHookName = resolver.infiniteQuery.name(node);
|
|
1648
|
-
const infiniteHookFile = resolver.file({
|
|
1649
|
-
...operationFileEntry(node, infiniteHookName),
|
|
1650
|
-
root,
|
|
1651
|
-
output,
|
|
1652
|
-
group: group ?? void 0
|
|
1653
|
-
});
|
|
1654
|
-
imports.push(/* @__PURE__ */ (0, kubb_jsx_jsx_runtime.jsx)(kubb_jsx.File.Import, {
|
|
1655
|
-
name: [infiniteOptionsName],
|
|
1656
|
-
root: hookOptionsFile.path,
|
|
1657
|
-
path: infiniteHookFile.path
|
|
1658
|
-
}));
|
|
1659
|
-
hookOptions[infiniteHookName] = `Partial<ReturnType<typeof ${infiniteOptionsName}>>`;
|
|
1660
|
-
if (isSuspenseOp) {
|
|
1661
|
-
const suspenseInfiniteOptionsName = resolver.suspenseInfiniteQuery.optionsName(node);
|
|
1662
|
-
const suspenseInfiniteHookName = resolver.suspenseInfiniteQuery.name(node);
|
|
1663
|
-
const suspenseInfiniteHookFile = resolver.file({
|
|
1664
|
-
...operationFileEntry(node, suspenseInfiniteHookName),
|
|
1665
|
-
root,
|
|
1666
|
-
output,
|
|
1667
|
-
group: group ?? void 0
|
|
1668
|
-
});
|
|
1669
|
-
imports.push(/* @__PURE__ */ (0, kubb_jsx_jsx_runtime.jsx)(kubb_jsx.File.Import, {
|
|
1670
|
-
name: [suspenseInfiniteOptionsName],
|
|
1671
|
-
root: hookOptionsFile.path,
|
|
1672
|
-
path: suspenseInfiniteHookFile.path
|
|
1673
|
-
}));
|
|
1674
|
-
hookOptions[suspenseInfiniteHookName] = `Partial<ReturnType<typeof ${suspenseInfiniteOptionsName}>>`;
|
|
1675
|
-
}
|
|
1676
|
-
}
|
|
1677
|
-
}
|
|
1678
|
-
}
|
|
1679
|
-
if (isMutationOp) {
|
|
1680
|
-
const mutationOptionsName = resolver.mutation.optionsName(node);
|
|
1681
|
-
const mutationHookName = resolver.mutation.name(node);
|
|
1682
|
-
const mutationHookFile = resolver.file({
|
|
1683
|
-
...operationFileEntry(node, mutationHookName),
|
|
1604
|
+
const isSuspense = !!suspense;
|
|
1605
|
+
const isInfinite = isQuery && !!nodeInfiniteOptions && matchesInfinite(node, nodeInfiniteOptions);
|
|
1606
|
+
const namespaces = [
|
|
1607
|
+
[resolver.query, isQuery],
|
|
1608
|
+
[resolver.suspenseQuery, isQuery && isSuspense],
|
|
1609
|
+
[resolver.infiniteQuery, isInfinite],
|
|
1610
|
+
[resolver.suspenseInfiniteQuery, isInfinite && isSuspense],
|
|
1611
|
+
[resolver.mutation, isMutation]
|
|
1612
|
+
];
|
|
1613
|
+
for (const [ns, enabled] of namespaces) {
|
|
1614
|
+
if (!enabled) continue;
|
|
1615
|
+
const optionsName = ns.optionsName(node);
|
|
1616
|
+
const hookName = ns.name(node);
|
|
1617
|
+
const hookFile = resolver.file({
|
|
1618
|
+
...operationFileEntry(node, hookName),
|
|
1684
1619
|
root,
|
|
1685
1620
|
output,
|
|
1686
1621
|
group: group ?? void 0
|
|
1687
1622
|
});
|
|
1688
1623
|
imports.push(/* @__PURE__ */ (0, kubb_jsx_jsx_runtime.jsx)(kubb_jsx.File.Import, {
|
|
1689
|
-
name: [
|
|
1624
|
+
name: [optionsName],
|
|
1690
1625
|
root: hookOptionsFile.path,
|
|
1691
|
-
path:
|
|
1626
|
+
path: hookFile.path
|
|
1692
1627
|
}));
|
|
1693
|
-
hookOptions[
|
|
1628
|
+
hookOptions[hookName] = `Partial<ReturnType<typeof ${optionsName}>>`;
|
|
1694
1629
|
}
|
|
1695
1630
|
}
|
|
1696
1631
|
return /* @__PURE__ */ (0, kubb_jsx_jsx_runtime.jsxs)(kubb_jsx.File, {
|
|
@@ -2310,13 +2245,6 @@ const resolverReactQuery = (0, kubb_kit.createResolver)({
|
|
|
2310
2245
|
key: operationKey(node, "mutation", "optionsName"),
|
|
2311
2246
|
name
|
|
2312
2247
|
});
|
|
2313
|
-
},
|
|
2314
|
-
typeName(node) {
|
|
2315
|
-
const name = capitalize(this.name(node.operationId));
|
|
2316
|
-
return this.resolveName({
|
|
2317
|
-
key: operationKey(node, "mutation", "typeName"),
|
|
2318
|
-
name
|
|
2319
|
-
});
|
|
2320
2248
|
}
|
|
2321
2249
|
},
|
|
2322
2250
|
hook: {
|