kitcn 0.29.0 → 0.31.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.
Files changed (71) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/dist/aggregate/index.d.ts +2 -2
  3. package/dist/aggregate/index.js +1 -1
  4. package/dist/auth/generated/index.d.ts +1 -1
  5. package/dist/auth/generated/index.js +1 -1
  6. package/dist/auth/http/index.d.ts +1 -1
  7. package/dist/auth/index.d.ts +20 -20
  8. package/dist/auth/index.js +133 -9
  9. package/dist/auth/nextjs/index.d.ts +2 -2
  10. package/dist/auth/nextjs/index.js +3 -3
  11. package/dist/auth/start/server/index.d.ts +2 -2
  12. package/dist/auth/start/server/index.js +3 -3
  13. package/dist/{builder-CsAw-DK8.js → builder-Cyd5nCxZ.js} +2 -2
  14. package/dist/{caller-factory-D4pz5GcZ.js → caller-factory-C-N540BC.js} +3 -3
  15. package/dist/{capabilities-6PZBmvc8.d.ts → capabilities-DPB-JKlm.d.ts} +1 -1
  16. package/dist/cli.mjs +1 -1
  17. package/dist/{create-schema-orm-HcJzGCxj.js → create-schema-orm-CwJD930B.js} +1 -1
  18. package/dist/crpc/index.d.ts +2 -2
  19. package/dist/crpc/index.js +3 -3
  20. package/dist/{customFunctions-ivbc6-_g.js → customFunctions-X_B4kET8.js} +64 -1
  21. package/dist/{definitions-DS8ZDc74.js → definitions-3PX4ywR-.js} +2 -2
  22. package/dist/{extensions-Blzsyekm.js → extensions-Bp0XHanR.js} +1 -1
  23. package/dist/{generated-contract-disabled-CgYQZCw2.d.ts → generated-contract-disabled-CTUQ9nxL.d.ts} +70 -41
  24. package/dist/{generated-contract-disabled-_1Mjg9pW.js → generated-contract-disabled-RyPYlwq0.js} +1 -0
  25. package/dist/{http-types-90mapMP9.d.ts → http-types-BhhPZtwa.d.ts} +2 -2
  26. package/dist/{id-CuSfWa5q.js → id-BVdWER1U.js} +1 -1
  27. package/dist/{filter-expression-Dydt8wS0.js → index-utils-C1DyktHe.js} +95 -1
  28. package/dist/{local-env-Dk8RJvt5.mjs → local-env-DGSkmXQk.mjs} +6 -0
  29. package/dist/{middleware-CE_MC6Gi.d.ts → middleware-BBS7oLtT.d.ts} +1 -1
  30. package/dist/{middleware-BvnabcNq.js → middleware-D61Nm-iB.js} +1 -1
  31. package/dist/orm/aggregate-index/index.d.ts +1 -1
  32. package/dist/orm/aggregate-index/index.js +4 -3
  33. package/dist/orm/index.d.ts +4 -4
  34. package/dist/orm/index.js +44 -12
  35. package/dist/orm/migrations/index.d.ts +2 -2
  36. package/dist/orm/migrations/index.js +1 -1
  37. package/dist/plugins/index.d.ts +1 -1
  38. package/dist/plugins/index.js +1 -1
  39. package/dist/{procedure-caller-BR-Wb0si.js → procedure-caller-DgMiD0-a.js} +2 -2
  40. package/dist/{procedure-name-l2YusEZI.d.ts → procedure-name-DPYyLiVS.d.ts} +3 -3
  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-CcOvOf4K.js → runtime-BcvcfaP8.js} +2 -2
  46. package/dist/{schema-CzdjX7nx.js → schema-hL2FWCE7.js} +13 -97
  47. package/dist/server/index.d.ts +4 -4
  48. package/dist/server/index.js +4 -4
  49. package/dist/symbols-DDNAddkd.js +21 -0
  50. package/dist/{table-CX2lnX7e.js → table-d9o_n4R3.js} +2 -21
  51. package/dist/{token-B0NKKxqP.js → token-CuJopBdP.js} +1 -1
  52. package/dist/{types-In-ZZOsd.d.ts → types-BXpu7xIU.d.ts} +1 -1
  53. package/dist/watcher.mjs +1 -1
  54. package/dist/{where-clause-compiler-CX5-0M5p.d.ts → where-clause-compiler-Dddhscyy.d.ts} +65 -64
  55. package/package.json +1 -1
  56. package/skills/kitcn/references/features/orm.md +5 -0
  57. /package/dist/{api-entry-CkDpGYVg.js → api-entry-Buvjl9hn.js} +0 -0
  58. /package/dist/{context-utils-DwZ3Cam1.d.ts → context-utils-Cbv4r0AA.d.ts} +0 -0
  59. /package/dist/{convex-plugin-Dic0l-k8.js → convex-plugin-AbNQl1Sg.js} +0 -0
  60. /package/dist/{create-schema-ojI-OH_9.js → create-schema-BmVH4gPc.js} +0 -0
  61. /package/dist/{error-CMLeCadS.js → error-Dyqhgbf6.js} +0 -0
  62. /package/dist/{meta-utils-D2lqN2Lg.js → meta-utils-Cc7neQOB.js} +0 -0
  63. /package/dist/{query-context-DJONf8X5.d.ts → query-context-BkNjkDCk.d.ts} +0 -0
  64. /package/dist/{query-context-DOm5Xm3H.js → query-context-DdSg3fuk.js} +0 -0
  65. /package/dist/{query-options-DUiOj01a.js → query-options-DGG93--5.js} +0 -0
  66. /package/dist/{token-kQaqFby4.d.ts → token-tlbNKQS0.d.ts} +0 -0
  67. /package/dist/{transformer-D8wO-kEj.js → transformer-C8lVwHNT.js} +0 -0
  68. /package/dist/{types-eNzQmbqM.d.ts → types-Bkeicpo6.d.ts} +0 -0
  69. /package/dist/{types-MHYXboyy.d.ts → types-Bqi_ivSd.d.ts} +0 -0
  70. /package/dist/{types-Bf3XQex5.d.ts → types-ex0-J-SC.d.ts} +0 -0
  71. /package/dist/{validators-wOIjhkfN.d.ts → validators-0I-Ik1EN.d.ts} +0 -0
@@ -1,4 +1,4 @@
1
- import { $t as OrmLifecycleChange, A as CreateDatabaseOptions, Ar as $Type, B as getUniqueIndexes, Ct as OrderByClause, F as CascadeMode, Ft as ExtractTablesFromSchema, Gn as Columns, Gt as TablesRelationalConfig, Ht as RelationsBuilderConfigValue, I as DeleteMode, Kn as OrmRuntimeDefaults, L as SerializedFilterExpression, Mr as ColumnBuilder, Mt as VectorSearchProvider, N as OrmReader, Nr as ColumnBuilderBaseConfig, Or as SystemFieldAliases, P as OrmWriter, Pt as AnyRelationsBuilderConfig, Qn as OrmSchemaTriggers, R as getChecks, U as EdgeMetadata, Un as ConvexColumnBuilder, Ur as entityKind, Ut as RelationsConfigWithSchema, Vn as ConvexTextBuilderInitial, Wt as TableRelationalConfig, Xt as ConvexTable, Yn as OrmSchemaExtensionTriggers, Zn as OrmSchemaRelations, Zt as ConvexTableWithColumns, an as RlsPolicy, dt as InferInsertModel, kr as SystemFields, pt as InferSelectModel, qn as OrmSchemaExtensionRelations, r as OrmCapability, rr as FilterExpression$1, x as MigrationSet, z as getForeignKeys, zr as HasDefault, zt as RelationsBuilder } from "./capabilities-6PZBmvc8.js";
1
+ import { $t as OrmLifecycleChange, A as CreateDatabaseOptions, Ar as $Type, B as getUniqueIndexes, Ct as OrderByClause, F as CascadeMode, Ft as ExtractTablesFromSchema, Gn as Columns, Gt as TablesRelationalConfig, Ht as RelationsBuilderConfigValue, I as DeleteMode, Kn as OrmRuntimeDefaults, L as SerializedFilterExpression, Mr as ColumnBuilder, Mt as VectorSearchProvider, N as OrmReader, Nr as ColumnBuilderBaseConfig, Or as SystemFieldAliases, P as OrmWriter, Pt as AnyRelationsBuilderConfig, Qn as OrmSchemaTriggers, R as getChecks, U as EdgeMetadata, Un as ConvexColumnBuilder, Ur as entityKind, Ut as RelationsConfigWithSchema, Vn as ConvexTextBuilderInitial, Wt as TableRelationalConfig, Xt as ConvexTable, Yn as OrmSchemaExtensionTriggers, Zn as OrmSchemaRelations, Zt as ConvexTableWithColumns, an as RlsPolicy, dt as InferInsertModel, kr as SystemFields, pt as InferSelectModel, qn as OrmSchemaExtensionRelations, r as OrmCapability, rr as FilterExpression$1, x as MigrationSet, z as getForeignKeys, zr as HasDefault, zt as RelationsBuilder } from "./capabilities-DPB-JKlm.js";
2
2
  import * as convex_values0 from "convex/values";
3
3
  import { GenericId, Validator, Value } from "convex/values";
4
4
  import { DefineSchemaOptions, GenericDatabaseReader, GenericDatabaseWriter, GenericSchema, SchedulableFunctionReference, Scheduler, SchemaDefinition, internalActionGeneric, internalMutationGeneric, internalQueryGeneric } from "convex/server";
@@ -111,15 +111,6 @@ declare const migrationStorageTables: {
111
111
  fieldName: "direction";
112
112
  };
113
113
  };
114
- cursor: ConvexTextBuilderInitial<""> & {
115
- _: {
116
- tableName: "migration_state";
117
- };
118
- } & {
119
- _: {
120
- fieldName: "cursor";
121
- };
122
- };
123
114
  migrationId: ConvexTextBuilderInitial<""> & {
124
115
  _: {
125
116
  notNull: true;
@@ -168,6 +159,15 @@ declare const migrationStorageTables: {
168
159
  fieldName: "runId";
169
160
  };
170
161
  };
162
+ cursor: ConvexTextBuilderInitial<""> & {
163
+ _: {
164
+ tableName: "migration_state";
165
+ };
166
+ } & {
167
+ _: {
168
+ fieldName: "cursor";
169
+ };
170
+ };
171
171
  processed: ConvexNumberBuilderInitial<""> & {
172
172
  _: {
173
173
  notNull: true;
@@ -427,6 +427,7 @@ type ScheduledMutationBatchArgs = {
427
427
  update?: Record<string, unknown>;
428
428
  deleteMode?: DeleteMode;
429
429
  cascadeMode?: CascadeMode;
430
+ softCascadeCursorVersion?: 1;
430
431
  foreignIndexName?: string;
431
432
  foreignSourceColumns?: string[];
432
433
  targetValues?: unknown;
@@ -1010,7 +1011,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1010
1011
  readonly aggregate_bucket: ConvexTableWithColumns<{
1011
1012
  name: "aggregate_bucket";
1012
1013
  columns: {
1013
- updatedAt: ConvexNumberBuilderInitial<""> & {
1014
+ count: ConvexNumberBuilderInitial<""> & {
1014
1015
  _: {
1015
1016
  notNull: true;
1016
1017
  };
@@ -1020,10 +1021,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1020
1021
  };
1021
1022
  } & {
1022
1023
  _: {
1023
- fieldName: "updatedAt";
1024
+ fieldName: "count";
1024
1025
  };
1025
1026
  };
1026
- count: ConvexNumberBuilderInitial<""> & {
1027
+ updatedAt: ConvexNumberBuilderInitial<""> & {
1027
1028
  _: {
1028
1029
  notNull: true;
1029
1030
  };
@@ -1033,10 +1034,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1033
1034
  };
1034
1035
  } & {
1035
1036
  _: {
1036
- fieldName: "count";
1037
+ fieldName: "updatedAt";
1037
1038
  };
1038
1039
  };
1039
- tableKey: ConvexTextBuilderInitial<""> & {
1040
+ indexName: ConvexTextBuilderInitial<""> & {
1040
1041
  _: {
1041
1042
  notNull: true;
1042
1043
  };
@@ -1046,10 +1047,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1046
1047
  };
1047
1048
  } & {
1048
1049
  _: {
1049
- fieldName: "tableKey";
1050
+ fieldName: "indexName";
1050
1051
  };
1051
1052
  };
1052
- indexName: ConvexTextBuilderInitial<""> & {
1053
+ tableKey: ConvexTextBuilderInitial<""> & {
1053
1054
  _: {
1054
1055
  notNull: true;
1055
1056
  };
@@ -1059,7 +1060,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1059
1060
  };
1060
1061
  } & {
1061
1062
  _: {
1062
- fieldName: "indexName";
1063
+ fieldName: "tableKey";
1063
1064
  };
1064
1065
  };
1065
1066
  keyHash: ConvexTextBuilderInitial<""> & {
@@ -1135,7 +1136,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1135
1136
  readonly aggregate_member: ConvexTableWithColumns<{
1136
1137
  name: "aggregate_member";
1137
1138
  columns: {
1138
- kind: ConvexTextBuilderInitial<""> & {
1139
+ updatedAt: ConvexNumberBuilderInitial<""> & {
1139
1140
  _: {
1140
1141
  notNull: true;
1141
1142
  };
@@ -1145,10 +1146,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1145
1146
  };
1146
1147
  } & {
1147
1148
  _: {
1148
- fieldName: "kind";
1149
+ fieldName: "updatedAt";
1149
1150
  };
1150
1151
  };
1151
- updatedAt: ConvexNumberBuilderInitial<""> & {
1152
+ kind: ConvexTextBuilderInitial<""> & {
1152
1153
  _: {
1153
1154
  notNull: true;
1154
1155
  };
@@ -1158,10 +1159,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1158
1159
  };
1159
1160
  } & {
1160
1161
  _: {
1161
- fieldName: "updatedAt";
1162
+ fieldName: "kind";
1162
1163
  };
1163
1164
  };
1164
- tableKey: ConvexTextBuilderInitial<""> & {
1165
+ indexName: ConvexTextBuilderInitial<""> & {
1165
1166
  _: {
1166
1167
  notNull: true;
1167
1168
  };
@@ -1171,10 +1172,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1171
1172
  };
1172
1173
  } & {
1173
1174
  _: {
1174
- fieldName: "tableKey";
1175
+ fieldName: "indexName";
1175
1176
  };
1176
1177
  };
1177
- indexName: ConvexTextBuilderInitial<""> & {
1178
+ tableKey: ConvexTextBuilderInitial<""> & {
1178
1179
  _: {
1179
1180
  notNull: true;
1180
1181
  };
@@ -1184,7 +1185,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1184
1185
  };
1185
1186
  } & {
1186
1187
  _: {
1187
- fieldName: "indexName";
1188
+ fieldName: "tableKey";
1188
1189
  };
1189
1190
  };
1190
1191
  keyHash: ConvexTextBuilderInitial<""> & {
@@ -1325,11 +1326,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1325
1326
  readonly aggregate_extrema: ConvexTableWithColumns<{
1326
1327
  name: "aggregate_extrema";
1327
1328
  columns: {
1328
- value: ConvexCustomBuilderInitial<"", convex_values0.VAny<any, "required", string>> & {
1329
- _: {
1330
- $type: convex_values0.Value;
1331
- };
1332
- } & {
1329
+ count: ConvexNumberBuilderInitial<""> & {
1333
1330
  _: {
1334
1331
  notNull: true;
1335
1332
  };
@@ -1339,10 +1336,14 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1339
1336
  };
1340
1337
  } & {
1341
1338
  _: {
1342
- fieldName: "value";
1339
+ fieldName: "count";
1343
1340
  };
1344
1341
  };
1345
- updatedAt: ConvexNumberBuilderInitial<""> & {
1342
+ value: ConvexCustomBuilderInitial<"", convex_values0.VAny<any, "required", string>> & {
1343
+ _: {
1344
+ $type: convex_values0.Value;
1345
+ };
1346
+ } & {
1346
1347
  _: {
1347
1348
  notNull: true;
1348
1349
  };
@@ -1352,10 +1353,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1352
1353
  };
1353
1354
  } & {
1354
1355
  _: {
1355
- fieldName: "updatedAt";
1356
+ fieldName: "value";
1356
1357
  };
1357
1358
  };
1358
- count: ConvexNumberBuilderInitial<""> & {
1359
+ updatedAt: ConvexNumberBuilderInitial<""> & {
1359
1360
  _: {
1360
1361
  notNull: true;
1361
1362
  };
@@ -1365,10 +1366,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1365
1366
  };
1366
1367
  } & {
1367
1368
  _: {
1368
- fieldName: "count";
1369
+ fieldName: "updatedAt";
1369
1370
  };
1370
1371
  };
1371
- tableKey: ConvexTextBuilderInitial<""> & {
1372
+ indexName: ConvexTextBuilderInitial<""> & {
1372
1373
  _: {
1373
1374
  notNull: true;
1374
1375
  };
@@ -1378,10 +1379,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1378
1379
  };
1379
1380
  } & {
1380
1381
  _: {
1381
- fieldName: "tableKey";
1382
+ fieldName: "indexName";
1382
1383
  };
1383
1384
  };
1384
- indexName: ConvexTextBuilderInitial<""> & {
1385
+ tableKey: ConvexTextBuilderInitial<""> & {
1385
1386
  _: {
1386
1387
  notNull: true;
1387
1388
  };
@@ -1391,7 +1392,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1391
1392
  };
1392
1393
  } & {
1393
1394
  _: {
1394
- fieldName: "indexName";
1395
+ fieldName: "tableKey";
1395
1396
  };
1396
1397
  };
1397
1398
  keyHash: ConvexTextBuilderInitial<""> & {
@@ -1591,19 +1592,6 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1591
1592
  fieldName: "status";
1592
1593
  };
1593
1594
  };
1594
- kind: ConvexTextBuilderInitial<""> & {
1595
- _: {
1596
- notNull: true;
1597
- };
1598
- } & {
1599
- _: {
1600
- tableName: "aggregate_state";
1601
- };
1602
- } & {
1603
- _: {
1604
- fieldName: "kind";
1605
- };
1606
- };
1607
1595
  cursor: ConvexTextBuilderInitial<""> & {
1608
1596
  _: {
1609
1597
  tableName: "aggregate_state";
@@ -1670,7 +1658,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1670
1658
  fieldName: "lastError";
1671
1659
  };
1672
1660
  };
1673
- tableKey: ConvexTextBuilderInitial<""> & {
1661
+ kind: ConvexTextBuilderInitial<""> & {
1674
1662
  _: {
1675
1663
  notNull: true;
1676
1664
  };
@@ -1680,7 +1668,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1680
1668
  };
1681
1669
  } & {
1682
1670
  _: {
1683
- fieldName: "tableKey";
1671
+ fieldName: "kind";
1684
1672
  };
1685
1673
  };
1686
1674
  indexName: ConvexTextBuilderInitial<""> & {
@@ -1722,6 +1710,19 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1722
1710
  fieldName: "metricDefinitionHash";
1723
1711
  };
1724
1712
  };
1713
+ tableKey: ConvexTextBuilderInitial<""> & {
1714
+ _: {
1715
+ notNull: true;
1716
+ };
1717
+ } & {
1718
+ _: {
1719
+ tableName: "aggregate_state";
1720
+ };
1721
+ } & {
1722
+ _: {
1723
+ fieldName: "tableKey";
1724
+ };
1725
+ };
1725
1726
  };
1726
1727
  }, {
1727
1728
  by_creation_time: ["_creationTime"];
@@ -1755,15 +1756,6 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1755
1756
  fieldName: "direction";
1756
1757
  };
1757
1758
  };
1758
- cursor: ConvexTextBuilderInitial<""> & {
1759
- _: {
1760
- tableName: "migration_state";
1761
- };
1762
- } & {
1763
- _: {
1764
- fieldName: "cursor";
1765
- };
1766
- };
1767
1759
  migrationId: ConvexTextBuilderInitial<""> & {
1768
1760
  _: {
1769
1761
  notNull: true;
@@ -1812,6 +1804,15 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1812
1804
  fieldName: "runId";
1813
1805
  };
1814
1806
  };
1807
+ cursor: ConvexTextBuilderInitial<""> & {
1808
+ _: {
1809
+ tableName: "migration_state";
1810
+ };
1811
+ } & {
1812
+ _: {
1813
+ fieldName: "cursor";
1814
+ };
1815
+ };
1815
1816
  processed: ConvexNumberBuilderInitial<""> & {
1816
1817
  _: {
1817
1818
  notNull: true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kitcn",
3
- "version": "0.29.0",
3
+ "version": "0.31.0",
4
4
  "description": "kitcn - React Query integration and CLI tools for Convex",
5
5
  "keywords": [
6
6
  "convex",
@@ -89,6 +89,11 @@ import { foreignKey } from "kitcn/orm";
89
89
  (t) => [foreignKey({ columns: [t.userSlug], foreignColumns: [users.slug] })];
90
90
  ```
91
91
 
92
+ Delta from parity: async soft cascade requires an exact child index on the
93
+ referencing columns. `index("by_author").on(t.authorId)` qualifies;
94
+ `index("by_author_rank").on(t.authorId, t.rank)` does not, because a mutable
95
+ trailing field cannot provide stable continuation across scheduled mutations.
96
+
92
97
  ### Check Constraints
93
98
 
94
99
  ```ts
File without changes