kitcn 0.24.0 → 0.25.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 (78) hide show
  1. package/dist/aggregate/index.d.ts +11 -1
  2. package/dist/aggregate/index.js +1 -1
  3. package/dist/auth/generated/index.d.ts +1 -1
  4. package/dist/auth/generated/index.js +1 -1
  5. package/dist/auth/http/index.d.ts +1 -1
  6. package/dist/auth/index.d.ts +4 -4
  7. package/dist/auth/index.js +10 -9
  8. package/dist/auth/nextjs/index.d.ts +2 -2
  9. package/dist/auth/nextjs/index.js +3 -3
  10. package/dist/auth/start/server/index.d.ts +1 -1
  11. package/dist/auth/start/server/index.js +1 -1
  12. package/dist/{builder-CsxVc5xC.js → builder-C6JSHkRK.js} +9 -3
  13. package/dist/{caller-factory-CWa0ELLD.js → caller-factory-Dd3H7j3V.js} +3 -3
  14. package/dist/{where-clause-compiler-DW6jy2er.d.ts → capabilities-Bem7xvGK.d.ts} +2958 -4145
  15. package/dist/cli.mjs +94 -58
  16. package/dist/{convex-plugin-D8B0oCFq.js → convex-plugin-DfOhBU9g.js} +1 -1
  17. package/dist/{create-schema-orm-B3f2Kc8O.js → create-schema-orm-Bu2JCiBS.js} +1 -1
  18. package/dist/crpc/index.d.ts +2 -2
  19. package/dist/crpc/index.js +3 -3
  20. package/dist/{customFunctions-DxEEO4Dq.js → customFunctions-ivbc6-_g.js} +2 -2
  21. package/dist/definitions-Dzk8mSTL.js +215 -0
  22. package/dist/extensions-Blzsyekm.js +55 -0
  23. package/dist/filter-expression-Dydt8wS0.js +402 -0
  24. package/dist/{generated-contract-disabled-B-nmd7Ne.d.ts → generated-contract-disabled-BEc4d98x.d.ts} +2 -2
  25. package/dist/{http-types-DXOgaerG.d.ts → http-types-90mapMP9.d.ts} +2 -2
  26. package/dist/id-CuSfWa5q.js +37 -0
  27. package/dist/{local-env-yFKub75x.mjs → local-env-Dkh4a_BK.mjs} +2244 -2113
  28. package/dist/{middleware-Br5zubu7.d.ts → middleware-CE_MC6Gi.d.ts} +1 -1
  29. package/dist/{middleware-DUd1Sj39.js → middleware-CdqNVyp8.js} +1 -1
  30. package/dist/orm/aggregate-index/index.d.ts +20 -0
  31. package/dist/orm/aggregate-index/index.js +2136 -0
  32. package/dist/orm/index.d.ts +5 -4
  33. package/dist/orm/index.js +127 -4292
  34. package/dist/orm/migrations/index.d.ts +3 -0
  35. package/dist/orm/migrations/index.js +506 -0
  36. package/dist/plugins/index.d.ts +1 -1
  37. package/dist/plugins/index.js +1 -1
  38. package/dist/{procedure-caller-DQxnLBS_.js → procedure-caller-CgLWu5F9.js} +2 -2
  39. package/dist/{procedure-name-C20pFZnk.d.ts → procedure-name-Bjw1JDIS.d.ts} +7 -4
  40. package/dist/{query-context-BzihIpnM.js → query-context-DOm5Xm3H.js} +1 -402
  41. package/dist/ratelimit/index.d.ts +2 -2
  42. package/dist/ratelimit/index.js +3 -3
  43. package/dist/rsc/index.d.ts +4 -4
  44. package/dist/rsc/index.js +4 -4
  45. package/dist/runtime-BdqTbgKh.js +1080 -0
  46. package/dist/schema-BQd2Xrfb.js +1411 -0
  47. package/dist/server/index.d.ts +4 -4
  48. package/dist/server/index.js +4 -4
  49. package/dist/{runtime-6DJxpDfb.js → table-CX2lnX7e.js} +3 -1095
  50. package/dist/{token-xlpENMVn.js → token-DcV_0fkF.js} +1 -1
  51. package/dist/{types-BHR7ZKKD.d.ts → types-In-ZZOsd.d.ts} +1 -1
  52. package/dist/{validators-C7LelqTN.js → validators-CIoUYCqO.js} +2 -1
  53. package/dist/{validators-BhsByJeg.d.ts → validators-wOIjhkfN.d.ts} +7 -1
  54. package/dist/watcher.mjs +1 -1
  55. package/dist/where-clause-compiler-Dmq4HMrK.d.ts +2089 -0
  56. package/package.json +6 -4
  57. package/skills/kitcn/SKILL.md +19 -18
  58. package/skills/kitcn/references/features/aggregates.md +21 -0
  59. package/skills/kitcn/references/features/auth-organizations.md +3 -3
  60. package/skills/kitcn/references/features/auth-polar.md +2 -1
  61. package/skills/kitcn/references/features/auth.md +8 -1
  62. package/skills/kitcn/references/setup/auth.md +52 -42
  63. package/skills/kitcn/references/setup/index.md +1 -1
  64. package/skills/kitcn/references/setup/server.md +2 -1
  65. /package/dist/{api-entry-N3nBOlI2.js → api-entry-CkDpGYVg.js} +0 -0
  66. /package/dist/{context-utils-BBUtBqjN.d.ts → context-utils-DwZ3Cam1.d.ts} +0 -0
  67. /package/dist/{create-schema-BXrKE2YY.js → create-schema-BRFjdgRr.js} +0 -0
  68. /package/dist/{error-Bvo7YEhk.js → error-CMLeCadS.js} +0 -0
  69. /package/dist/{generated-contract-disabled-BXaz7JCE.js → generated-contract-disabled-CZa0iyV0.js} +0 -0
  70. /package/dist/{meta-utils-D9K4fICl.js → meta-utils-D2lqN2Lg.js} +0 -0
  71. /package/dist/{query-context-CNo9ffvI.d.ts → query-context-DJONf8X5.d.ts} +0 -0
  72. /package/dist/{query-options-CzRV4G4N.js → query-options-DUiOj01a.js} +0 -0
  73. /package/dist/{token-B9Bjcqug.d.ts → token-kQaqFby4.d.ts} +0 -0
  74. /package/dist/{transformer-yZuBWo8v.js → transformer-D8wO-kEj.js} +0 -0
  75. /package/dist/{types-BCl8gfGy.d.ts → types-Bf3XQex5.d.ts} +0 -0
  76. /package/dist/{types-DF2cg_w0.d.ts → types-MHYXboyy.d.ts} +0 -0
  77. /package/dist/{types-CnTpHR1F.d.ts → types-eNzQmbqM.d.ts} +0 -0
  78. /package/dist/{upstream-BR6sBLg3.js → upstream-BCgGZX6q.js} +0 -0
@@ -1,4 +1,5 @@
1
- import { C as ConvexNumberBuilderInitial, E as ConvexIdBuilderInitial, N as ConvexCustomBuilderInitial, dn as ConvexTableWithColumns, tr as ConvexTextBuilderInitial } from "../where-clause-compiler-DW6jy2er.js";
1
+ import { Bn as ConvexTextBuilderInitial, Xt as ConvexTableWithColumns } from "../capabilities-Bem7xvGK.js";
2
+ import { C as ConvexNumberBuilderInitial, E as ConvexIdBuilderInitial, N as ConvexCustomBuilderInitial } from "../where-clause-compiler-Dmq4HMrK.js";
2
3
  import * as convex_values0 from "convex/values";
3
4
  import { GenericId, Infer, Value } from "convex/values";
4
5
  import { DocumentByName, GenericDataModel, GenericDatabaseReader, GenericDatabaseWriter, TableNamesInDataModel } from "convex/server";
@@ -81,6 +82,15 @@ declare const aggregateStorageTables: {
81
82
  fieldName: "aggregateName";
82
83
  };
83
84
  };
85
+ deletionStack: ConvexCustomBuilderInitial<"", convex_values0.VArray<convex_values0.GenericId<"aggregate_rank_node">[], convex_values0.VId<convex_values0.GenericId<"aggregate_rank_node">, "required">, "required">> & {
86
+ _: {
87
+ tableName: "aggregate_rank_tree";
88
+ };
89
+ } & {
90
+ _: {
91
+ fieldName: "deletionStack";
92
+ };
93
+ };
84
94
  maxNodeSize: ConvexNumberBuilderInitial<""> & {
85
95
  _: {
86
96
  notNull: true;
@@ -1,4 +1,4 @@
1
- import { n as TableAggregate$1, r as aggregateStorageTables, t as DirectAggregate$1 } from "../runtime-6DJxpDfb.js";
1
+ import { n as TableAggregate$1, r as aggregateStorageTables, t as DirectAggregate$1 } from "../runtime-BdqTbgKh.js";
2
2
 
3
3
  //#region src/aggregate/index.ts
4
4
  const wrapTriggerFactory = (methodName, factory) => ((...args) => {
@@ -1,2 +1,2 @@
1
- import { S as defineAuth, _ as GenericAuthBeforeResult, b as GenericAuthTriggerHandlers, g as BetterAuthOptionsWithoutDatabase, i as getGeneratedAuthDisabledReason, n as GeneratedAuthDisabledReasonKind, r as createDisabledAuthRuntime, t as AuthRuntime, v as GenericAuthDefinition, x as GenericAuthTriggers, y as GenericAuthTriggerChange } from "../../generated-contract-disabled-B-nmd7Ne.js";
1
+ import { S as defineAuth, _ as GenericAuthBeforeResult, b as GenericAuthTriggerHandlers, g as BetterAuthOptionsWithoutDatabase, i as getGeneratedAuthDisabledReason, n as GeneratedAuthDisabledReasonKind, r as createDisabledAuthRuntime, t as AuthRuntime, v as GenericAuthDefinition, x as GenericAuthTriggers, y as GenericAuthTriggerChange } from "../../generated-contract-disabled-BEc4d98x.js";
2
2
  export { type AuthRuntime, BetterAuthOptionsWithoutDatabase, type GeneratedAuthDisabledReasonKind, GenericAuthBeforeResult, GenericAuthDefinition, GenericAuthTriggerChange, GenericAuthTriggerHandlers, GenericAuthTriggers, createDisabledAuthRuntime, defineAuth, getGeneratedAuthDisabledReason };
@@ -1,3 +1,3 @@
1
- import { i as defineAuth, n as createDisabledAuthRuntime, r as getGeneratedAuthDisabledReason } from "../../generated-contract-disabled-BXaz7JCE.js";
1
+ import { i as defineAuth, n as createDisabledAuthRuntime, r as getGeneratedAuthDisabledReason } from "../../generated-contract-disabled-CZa0iyV0.js";
2
2
 
3
3
  export { createDisabledAuthRuntime, defineAuth, getGeneratedAuthDisabledReason };
@@ -1,4 +1,4 @@
1
- import { t as GetAuth } from "../../types-BCl8gfGy.js";
1
+ import { t as GetAuth } from "../../types-Bf3XQex5.js";
2
2
  import { HttpRouter } from "convex/server";
3
3
  import { MiddlewareHandler } from "hono";
4
4
  import { BaseURLConfig, BetterAuthOptions } from "better-auth";
@@ -1,7 +1,7 @@
1
- import { a as QueryCtxWithPreferredOrmQueryTable, n as LookupByIdResultByCtx, t as DocByCtx } from "../query-context-CNo9ffvI.js";
2
- import { t as GetAuth } from "../types-BCl8gfGy.js";
3
- import { t as GenericCtx } from "../context-utils-BBUtBqjN.js";
4
- import { S as defineAuth, _ as GenericAuthBeforeResult, a as AuthFunctions, b as GenericAuthTriggerHandlers, c as createApi, d as deleteOneHandler, f as findManyHandler, g as BetterAuthOptionsWithoutDatabase, h as updateOneHandler, i as getGeneratedAuthDisabledReason, l as createHandler, m as updateManyHandler, n as GeneratedAuthDisabledReasonKind, o as Triggers, p as findOneHandler, r as createDisabledAuthRuntime, s as createClient, t as AuthRuntime, u as deleteManyHandler, v as GenericAuthDefinition, x as GenericAuthTriggers, y as GenericAuthTriggerChange } from "../generated-contract-disabled-B-nmd7Ne.js";
1
+ import { a as QueryCtxWithPreferredOrmQueryTable, n as LookupByIdResultByCtx, t as DocByCtx } from "../query-context-DJONf8X5.js";
2
+ import { t as GetAuth } from "../types-Bf3XQex5.js";
3
+ import { t as GenericCtx } from "../context-utils-DwZ3Cam1.js";
4
+ import { S as defineAuth, _ as GenericAuthBeforeResult, a as AuthFunctions, b as GenericAuthTriggerHandlers, c as createApi, d as deleteOneHandler, f as findManyHandler, g as BetterAuthOptionsWithoutDatabase, h as updateOneHandler, i as getGeneratedAuthDisabledReason, l as createHandler, m as updateManyHandler, n as GeneratedAuthDisabledReasonKind, o as Triggers, p as findOneHandler, r as createDisabledAuthRuntime, s as createClient, t as AuthRuntime, u as deleteManyHandler, v as GenericAuthDefinition, x as GenericAuthTriggers, y as GenericAuthTriggerChange } from "../generated-contract-disabled-BEc4d98x.js";
5
5
  import * as convex_values0 from "convex/values";
6
6
  import { Infer } from "convex/values";
7
7
  import { AuthConfig, DocumentByName, GenericDataModel, GenericMutationCtx, GenericQueryCtx, GenericSchema, PaginationOptions, PaginationResult, SchemaDefinition, TableNamesInDataModel } from "convex/server";
@@ -1,10 +1,11 @@
1
- import { n as asyncMap } from "../upstream-BR6sBLg3.js";
2
- import { r as partial } from "../validators-C7LelqTN.js";
3
- import { i as defineAuth, n as createDisabledAuthRuntime, r as getGeneratedAuthDisabledReason, t as DEFAULT_AUTH_DEFINITION_PATH } from "../generated-contract-disabled-BXaz7JCE.js";
4
- import { n as createGeneratedFunctionReference, o as isQueryCtx, s as isRunMutationCtx } from "../api-entry-N3nBOlI2.js";
5
- import { n as customCtx, r as customMutation } from "../customFunctions-DxEEO4Dq.js";
6
- import { o as mergedStream, s as stream, t as getByIdWithOrmQueryFallback, u as unsetToken, y as eq } from "../query-context-BzihIpnM.js";
7
- import { n as convex } from "../convex-plugin-D8B0oCFq.js";
1
+ import { n as asyncMap } from "../upstream-BCgGZX6q.js";
2
+ import { r as partial } from "../validators-CIoUYCqO.js";
3
+ import { i as defineAuth, n as createDisabledAuthRuntime, r as getGeneratedAuthDisabledReason, t as DEFAULT_AUTH_DEFINITION_PATH } from "../generated-contract-disabled-CZa0iyV0.js";
4
+ import { n as createGeneratedFunctionReference, o as isQueryCtx, s as isRunMutationCtx } from "../api-entry-CkDpGYVg.js";
5
+ import { n as customCtx, r as customMutation } from "../customFunctions-ivbc6-_g.js";
6
+ import { l as eq } from "../filter-expression-Dydt8wS0.js";
7
+ import { o as mergedStream, s as stream, t as getByIdWithOrmQueryFallback, u as unsetToken } from "../query-context-DOm5Xm3H.js";
8
+ import { n as convex } from "../convex-plugin-DfOhBU9g.js";
8
9
  import { v } from "convex/values";
9
10
  import { internalActionGeneric, internalMutationGeneric, internalQueryGeneric, paginationOptsValidator } from "convex/server";
10
11
  import { createAdapterFactory } from "better-auth/adapters";
@@ -898,13 +899,13 @@ const ORM_SCHEMA_OPTIONS = Symbol.for("kitcn:OrmSchemaOptions");
898
899
  const hasOrmSchemaMetadata = (schema) => !!schema && typeof schema === "object" && ORM_SCHEMA_OPTIONS in schema;
899
900
  const createAuthSchema = async ({ file, schema, tables }) => {
900
901
  if (hasOrmSchemaMetadata(schema)) {
901
- const { createSchemaOrm } = await import("../create-schema-orm-B3f2Kc8O.js");
902
+ const { createSchemaOrm } = await import("../create-schema-orm-Bu2JCiBS.js");
902
903
  return createSchemaOrm({
903
904
  file,
904
905
  tables
905
906
  });
906
907
  }
907
- const { createSchema } = await import("../create-schema-BXrKE2YY.js");
908
+ const { createSchema } = await import("../create-schema-BRFjdgRr.js");
908
909
  return createSchema({
909
910
  file,
910
911
  tables
@@ -1,5 +1,5 @@
1
- import { H as ConvexContext, W as LazyCaller } from "../../procedure-name-C20pFZnk.js";
2
- import { t as GetTokenOptions } from "../../token-B9Bjcqug.js";
1
+ import { H as ConvexContext, W as LazyCaller } from "../../procedure-name-Bjw1JDIS.js";
2
+ import { t as GetTokenOptions } from "../../token-kQaqFby4.js";
3
3
 
4
4
  //#region src/auth-nextjs/index.d.ts
5
5
  /** Auth options for server-side calls. */
@@ -1,6 +1,6 @@
1
- import { t as getToken } from "../../token-xlpENMVn.js";
2
- import { n as defaultIsUnauthorized } from "../../error-Bvo7YEhk.js";
3
- import { t as createCallerFactory } from "../../caller-factory-CWa0ELLD.js";
1
+ import { t as getToken } from "../../token-DcV_0fkF.js";
2
+ import { n as defaultIsUnauthorized } from "../../error-CMLeCadS.js";
3
+ import { t as createCallerFactory } from "../../caller-factory-Dd3H7j3V.js";
4
4
 
5
5
  //#region src/auth-nextjs/index.ts
6
6
  /** biome-ignore-all lint/suspicious/noExplicitAny: lib */
@@ -1,4 +1,4 @@
1
- import { t as GetTokenOptions } from "../../../token-B9Bjcqug.js";
1
+ import { t as GetTokenOptions } from "../../../token-kQaqFby4.js";
2
2
  import { FunctionReference, FunctionReturnType, OptionalRestArgs } from "convex/server";
3
3
 
4
4
  //#region src/auth-start/server.d.ts
@@ -1,4 +1,4 @@
1
- import { t as getToken } from "../../../token-xlpENMVn.js";
1
+ import { t as getToken } from "../../../token-DcV_0fkF.js";
2
2
  import { stripIndent } from "common-tags";
3
3
  import { getRequestHeaders } from "@tanstack/react-start/server";
4
4
  import { ConvexHttpClient } from "convex/browser";
@@ -1,6 +1,6 @@
1
- import { o as vRequired, t as addFieldsToValidator } from "./validators-C7LelqTN.js";
2
- import { n as customCtx, t as NoOp } from "./customFunctions-DxEEO4Dq.js";
3
- import { s as getTransformer } from "./transformer-yZuBWo8v.js";
1
+ import { o as vRequired, t as addFieldsToValidator } from "./validators-CIoUYCqO.js";
2
+ import { n as customCtx, t as NoOp } from "./customFunctions-ivbc6-_g.js";
3
+ import { s as getTransformer } from "./transformer-D8wO-kEj.js";
4
4
  import { ConvexError, v } from "convex/values";
5
5
  import { HttpRouter, actionGeneric, httpActionGeneric, internalActionGeneric, internalMutationGeneric, internalQueryGeneric, mutationGeneric, queryGeneric } from "convex/server";
6
6
  import { z } from "zod";
@@ -386,6 +386,9 @@ function zodToConvexFields(fields) {
386
386
  function zodOutputToConvexFields(fields) {
387
387
  return Object.fromEntries(Object.entries(fields).map(([k, v]) => [k, zodOutputToConvex(v)]));
388
388
  }
389
+ function isCommitTsPlaceholder(value) {
390
+ return typeof value === "object" && value !== null && Object.getPrototypeOf(value)?.constructor?.name === "CommitTsPlaceholder";
391
+ }
389
392
  /**
390
393
  * Turns a Convex validator into a Zod validator.
391
394
  *
@@ -418,6 +421,9 @@ function convexToZod(convexValidator) {
418
421
  case "int64":
419
422
  zodValidator = z$1.bigint();
420
423
  break;
424
+ case "commitTs":
425
+ zodValidator = z$1.union([z$1.bigint(), z$1.custom(isCommitTsPlaceholder)]);
426
+ break;
421
427
  case "boolean":
422
428
  zodValidator = z$1.boolean();
423
429
  break;
@@ -1,6 +1,6 @@
1
- import { n as defaultIsUnauthorized } from "./error-Bvo7YEhk.js";
2
- import { i as getFunctionType, n as getFuncRef, t as buildMetaIndex } from "./meta-utils-D9K4fICl.js";
3
- import { s as getTransformer } from "./transformer-yZuBWo8v.js";
1
+ import { n as defaultIsUnauthorized } from "./error-CMLeCadS.js";
2
+ import { i as getFunctionType, n as getFuncRef, t as buildMetaIndex } from "./meta-utils-D2lqN2Lg.js";
3
+ import { s as getTransformer } from "./transformer-D8wO-kEj.js";
4
4
  import { fetchAction, fetchMutation, fetchQuery } from "convex/nextjs";
5
5
 
6
6
  //#region src/server/caller.ts