@dudousxd/nestjs-inertia-codegen 1.0.6 → 2.0.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/CHANGELOG.md +20 -0
- package/dist/cli/main.cjs +4 -2
- package/dist/cli/main.cjs.map +1 -1
- package/dist/cli/main.js +4 -2
- package/dist/cli/main.js.map +1 -1
- package/dist/index.cjs +4 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -345,15 +345,17 @@ function emitApiObjectBlock(tree, indent) {
|
|
|
345
345
|
if (method === "GET") {
|
|
346
346
|
const typeAccess = buildRouterTypeAccess(c.name);
|
|
347
347
|
lines.push(`${pad}${objKey}: {`);
|
|
348
|
+
lines.push(`${pad} queryKey: (query?: ${typeAccess}['query']) => query !== undefined ? [${flatName}, query] as const : [${flatName}] as const,`);
|
|
348
349
|
lines.push(`${pad} queryOptions: (query?: ${typeAccess}['query']) =>`);
|
|
349
350
|
lines.push(`${pad} queryOptions({`);
|
|
350
|
-
lines.push(`${pad} queryKey: [${flatName}, query],`);
|
|
351
|
+
lines.push(`${pad} queryKey: query !== undefined ? [${flatName}, query] : [${flatName}],`);
|
|
351
352
|
lines.push(`${pad} queryFn: () => fetcher.get<${typeAccess}['response']>(route(${flatName} as never) || ${safePath}, { query }),`);
|
|
352
353
|
lines.push(`${pad} }),`);
|
|
353
354
|
lines.push(`${pad}},`);
|
|
354
355
|
} else {
|
|
355
356
|
const typeAccess = buildRouterTypeAccess(c.name);
|
|
356
357
|
lines.push(`${pad}${objKey}: {`);
|
|
358
|
+
lines.push(`${pad} queryKey: () => [${flatName}] as const,`);
|
|
357
359
|
lines.push(`${pad} mutationOptions: () => ({`);
|
|
358
360
|
lines.push(`${pad} mutationFn: (body: ${typeAccess}['body']) => fetcher.${fetcherMethod}<${typeAccess}['response']>(route(${flatName} as never) || ${safePath}, { body }),`);
|
|
359
361
|
lines.push(`${pad} }),`);
|
|
@@ -1453,7 +1455,7 @@ async function watch(config, onChange) {
|
|
|
1453
1455
|
__name(watch, "watch");
|
|
1454
1456
|
|
|
1455
1457
|
// src/index.ts
|
|
1456
|
-
var VERSION = "
|
|
1458
|
+
var VERSION = "2.0.0";
|
|
1457
1459
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1458
1460
|
0 && (module.exports = {
|
|
1459
1461
|
CodegenError,
|