kitcn 0.33.0 → 0.33.1

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.
Files changed (38) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/aggregate/index.d.ts +1 -1
  3. package/dist/auth/generated/index.d.ts +1 -1
  4. package/dist/auth/index.d.ts +20 -20
  5. package/dist/auth/nextjs/index.d.ts +2 -2
  6. package/dist/auth/start/server/index.d.ts +2 -2
  7. package/dist/{builder-Cyd5nCxZ.js → builder-DDYTlmTB.js} +12 -3
  8. package/dist/caller-factory-C3pcbzo0.d.ts +140 -0
  9. package/dist/crpc/index.d.ts +3 -2
  10. package/dist/{generated-contract-disabled-PdNGvNYP.d.ts → generated-contract-disabled-B_EaHGCP.d.ts} +42 -42
  11. package/dist/{http-types-BhhPZtwa.d.ts → http-types-8FBr10yl.d.ts} +3 -79
  12. package/dist/{middleware-BBS7oLtT.d.ts → middleware-D2hKJuSZ.d.ts} +1 -1
  13. package/dist/{middleware-D61Nm-iB.js → middleware-LvZov-hA.js} +1 -1
  14. package/dist/orm/index.d.ts +1 -1
  15. package/dist/orm/migrations/index.d.ts +1 -1
  16. package/dist/plugins/index.d.ts +1 -1
  17. package/dist/plugins/index.js +1 -1
  18. package/dist/{procedure-caller-DgMiD0-a.js → procedure-caller-DgGF_hA8.js} +1 -1
  19. package/dist/{procedure-name-DPYyLiVS.d.ts → procedure-name-kn-awLk1.d.ts} +12 -142
  20. package/dist/ratelimit/index.d.ts +2 -2
  21. package/dist/ratelimit/index.js +2 -2
  22. package/dist/react/index.d.ts +5 -6
  23. package/dist/react/index.js +20 -66
  24. package/dist/rsc/index.d.ts +4 -3
  25. package/dist/server/index.d.ts +5 -4
  26. package/dist/server/index.js +2 -2
  27. package/dist/solid/index.d.ts +5 -6
  28. package/dist/solid/index.js +20 -66
  29. package/dist/transformer-BEkxlnss.d.ts +78 -0
  30. package/dist/{types-BXpu7xIU.d.ts → types-Cl0utsTL.d.ts} +4 -3
  31. package/dist/{where-clause-compiler-DrV6lQg0.d.ts → where-clause-compiler-CoPVAVDO.d.ts} +135 -135
  32. package/package.json +1 -1
  33. package/skills/kitcn/SKILL.md +2 -1
  34. package/skills/kitcn/references/features/auth-admin.md +1 -0
  35. package/skills/kitcn/references/features/react.md +4 -5
  36. /package/dist/{context-utils-Cbv4r0AA.d.ts → context-utils-ax351iFc.d.ts} +0 -0
  37. /package/dist/{token-tlbNKQS0.d.ts → token-CZpDQUHd.d.ts} +0 -0
  38. /package/dist/{types-Bkeicpo6.d.ts → types-CzGsrLrY.d.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kitcn",
3
- "version": "0.33.0",
3
+ "version": "0.33.1",
4
4
  "description": "kitcn - React Query integration and CLI tools for Convex",
5
5
  "keywords": [
6
6
  "convex",
@@ -34,7 +34,7 @@ Only remember these non-parity deltas:
34
34
  2. No `z.void()` outputs; omit `.output(...)` for no-value mutations.
35
35
  3. `.output(...)` parses the handler's value as-is and substitutes nothing: a handler must return the schema's *input* type, so `z.string().nullable()` needs an explicit `null` (`?? null`), not `undefined`. Model absent values as `.nullable()`, never a top-level `.optional()` — Convex wires `undefined` as `null` and cannot express top-level optionality, so `.output(z.string().optional())` publishes `v.string()` and the deployment rejects the `null` whenever the handler returns `undefined`. `.optional()` inside an object is fine. The low-level `returns:` option on `zCustomQuery`/`zCustomMutation`/`zCustomAction` differs — it substitutes `null` for `undefined` before parsing.
36
36
  4. Stacked `.input(...)` calls merge input shapes.
37
- 5. `.paginated({ limit, item })` must be before `.query()` and auto-adds `input.cursor` + `input.limit`, output `{ page, continueCursor, isDone }`.
37
+ 5. `.paginated({ limit, item })` must be before `.query()` and adds `input.cursor`, `input.endCursor`, and `input.limit`; pass all three to ORM cursor queries so live splits stay bounded.
38
38
  6. Metadata is codegen’d onto `@convex/api` leaves (`api.namespace.fn.meta`) so never put secrets in `.meta(...)`; chaining `.meta(...)` is shallow merge and supports `defaultMeta`.
39
39
  7. Auth metadata drives client behavior: `auth: "optional"` waits for auth load then runs, `auth: "required"` waits then skips when logged out.
40
40
  8. `ctx.orm` enforces constraints + RLS; `ctx.db` bypasses them.
@@ -245,6 +245,7 @@ export const listProjects = authQuery
245
245
  where: { ownerId: ctx.userId },
246
246
  orderBy: { updatedAt: "desc" },
247
247
  cursor: input.cursor,
248
+ endCursor: input.endCursor,
248
249
  limit: input.limit,
249
250
  })
250
251
  );
@@ -265,6 +265,7 @@ export const getAllUsers = authQuery
265
265
  .query(async ({ ctx, input }) => {
266
266
  const result = await ctx.orm.query.user.findMany({
267
267
  cursor: input.cursor,
268
+ endCursor: input.endCursor,
268
269
  limit: input.limit,
269
270
  });
270
271
 
@@ -374,20 +374,19 @@ export const list = publicQuery
374
374
  .input(z.object({ userId: z.string().optional() }))
375
375
  .paginated({ limit: 20, item: SessionSchema })
376
376
  .query(async ({ ctx, input }) => {
377
- // input.cursor and input.limit auto-added
378
377
  return ctx.orm.query.session.findMany({
379
378
  where: input.userId ? { userId: input.userId } : undefined,
380
379
  orderBy: { createdAt: 'desc' },
381
380
  cursor: input.cursor,
381
+ endCursor: input.endCursor,
382
382
  limit: input.limit,
383
383
  });
384
- // output auto-wrapped as { continueCursor, isDone, page }
385
384
  });
386
385
  ```
387
386
 
388
387
  `.paginated({ limit, item })`:
389
- - Adds `cursor` (string|null) and `limit` (number) to input
390
- - Auto-sets output schema: `{ continueCursor: string, isDone: boolean, page: T[] }`
388
+ - Adds `cursor`, optional `endCursor`, and `limit` to input
389
+ - Accepts the full Convex page result, including `pageStatus` and `splitCursor`
391
390
  - Must be called before `.query()`
392
391
 
393
392
  ### Return Value
@@ -414,7 +413,7 @@ const { data, isPlaceholderData } = useInfiniteQuery(
414
413
 
415
414
  ### Real-time & Error Recovery
416
415
 
417
- Each page maintains its own WebSocket subscription. Auto-recovers on `InvalidCursor` (resets to page 0) and `splitCursor` (auto-splits page). Pagination state persists in `queryClient` for scroll restoration.
416
+ Each page maintains its own WebSocket subscription. Split pages use `endCursor` to keep adjacent subscriptions bounded. An `InvalidCursor` on a loaded page resets the list cleanly to page 0. Pagination state persists in `queryClient` for scroll restoration.
418
417
 
419
418
  ---
420
419