kitcn 0.27.1 → 0.27.2

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 CHANGED
@@ -1,5 +1,27 @@
1
1
  # kitcn
2
2
 
3
+ ## 0.27.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#397](https://github.com/udecode/kitcn/pull/397) [`c90f821`](https://github.com/udecode/kitcn/commit/c90f821e9d416303147b93cc3a1b14a5ccff1fed) Thanks [@MikeyZhang75](https://github.com/MikeyZhang75)! - ## Patches
8
+
9
+ - Fix organization permission checks returning a false "not a member" once an
10
+ organization grows past ~200 members. The generated auth schema now indexes
11
+ the composite lookups the organization plugin actually issues:
12
+ `member` by `organizationId` + `userId` and by `organizationId` + `role`,
13
+ `teamMember` by `teamId` + `userId`, `invitation` by
14
+ `organizationId` + `status` and by `email` + `organizationId` + `status`, and
15
+ `organizationRole` by `organizationId` + `role`. Every index that was emitted
16
+ before is still emitted, so this is additive — rerun
17
+ `npx kitcn add auth --schema --yes` to pick the new ones up.
18
+
19
+ - Fix `findOne` reporting "not found" when the scan budget ran out before
20
+ reaching a matching row. Single-document reads now page until they match a row
21
+ or exhaust the query, so an unindexed lookup is slow and warns rather than
22
+ silently wrong. Watch for `Querying without an index on table "..."` in your
23
+ logs and add the index it names.
24
+
3
25
  ## 0.27.1
4
26
 
5
27
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  import { Bn as ConvexTextBuilderInitial, Xt as ConvexTableWithColumns } from "../capabilities-CLCYgRdY.js";
2
- import { C as ConvexNumberBuilderInitial, E as ConvexIdBuilderInitial, N as ConvexCustomBuilderInitial } from "../where-clause-compiler-CErbOMvj.js";
2
+ import { C as ConvexNumberBuilderInitial, E as ConvexIdBuilderInitial, N as ConvexCustomBuilderInitial } from "../where-clause-compiler-ChMQ575O.js";
3
3
  import * as convex_values0 from "convex/values";
4
4
  import { GenericId, Infer, Value } from "convex/values";
5
5
  import { DocumentByName, GenericDataModel, GenericDatabaseReader, GenericDatabaseWriter, TableNamesInDataModel } from "convex/server";
@@ -298,13 +298,22 @@ const paginate = async (ctx, schema, betterAuthSchema, args) => {
298
298
  page: result.page.map((doc) => selectFields(doc, args.select))
299
299
  };
300
300
  };
301
- const listOne = async (ctx, schema, betterAuthSchema, args) => (await paginate(ctx, schema, betterAuthSchema, {
302
- ...args,
303
- paginationOpts: {
304
- cursor: null,
305
- numItems: 1
301
+ const listOne = async (ctx, schema, betterAuthSchema, args) => {
302
+ let cursor = null;
303
+ for (;;) {
304
+ const result = await paginate(ctx, schema, betterAuthSchema, {
305
+ ...args,
306
+ paginationOpts: {
307
+ cursor,
308
+ numItems: 1
309
+ }
310
+ });
311
+ if (result.page.length > 0) return result.page[0];
312
+ if (result.isDone) return null;
313
+ if (result.continueCursor === cursor) throw new Error(`Pagination made no forward progress reading one ${args.model}`);
314
+ cursor = result.continueCursor;
306
315
  }
307
- })).page[0];
316
+ };
308
317
 
309
318
  //#endregion
310
319
  //#region src/auth/create-api.ts
@@ -899,13 +908,13 @@ const ORM_SCHEMA_OPTIONS = Symbol.for("kitcn:OrmSchemaOptions");
899
908
  const hasOrmSchemaMetadata = (schema) => !!schema && typeof schema === "object" && ORM_SCHEMA_OPTIONS in schema;
900
909
  const createAuthSchema = async ({ file, schema, tables }) => {
901
910
  if (hasOrmSchemaMetadata(schema)) {
902
- const { createSchemaOrm } = await import("../create-schema-orm-Bu2JCiBS.js");
911
+ const { createSchemaOrm } = await import("../create-schema-orm-C3y6GLwQ.js");
903
912
  return createSchemaOrm({
904
913
  file,
905
914
  tables
906
915
  });
907
916
  }
908
- const { createSchema } = await import("../create-schema-BRFjdgRr.js");
917
+ const { createSchema } = await import("../create-schema-DqhLA_UF.js");
909
918
  return createSchema({
910
919
  file,
911
920
  tables
package/dist/cli.mjs CHANGED
@@ -5669,11 +5669,28 @@ const indexFields = {
5669
5669
  ["accountId", "providerId"],
5670
5670
  ["providerId", "userId"]
5671
5671
  ],
5672
+ invitation: [
5673
+ "email",
5674
+ [
5675
+ "email",
5676
+ "organizationId",
5677
+ "status"
5678
+ ],
5679
+ "organizationId",
5680
+ ["organizationId", "status"]
5681
+ ],
5682
+ member: [
5683
+ "organizationId",
5684
+ ["organizationId", "role"],
5685
+ ["organizationId", "userId"]
5686
+ ],
5672
5687
  oauthConsent: [["clientId", "userId"]],
5688
+ organizationRole: ["organizationId", ["organizationId", "role"]],
5673
5689
  passkey: ["credentialID"],
5674
5690
  ratelimit: ["key"],
5675
5691
  rateLimit: ["key"],
5676
5692
  session: ["expiresAt", ["expiresAt", "userId"]],
5693
+ teamMember: ["teamId", ["teamId", "userId"]],
5677
5694
  user: [["email", "name"], "name"],
5678
5695
  verification: ["expiresAt", "identifier"]
5679
5696
  };
@@ -5,11 +5,28 @@ const indexFields = {
5
5
  ["accountId", "providerId"],
6
6
  ["providerId", "userId"]
7
7
  ],
8
+ invitation: [
9
+ "email",
10
+ [
11
+ "email",
12
+ "organizationId",
13
+ "status"
14
+ ],
15
+ "organizationId",
16
+ ["organizationId", "status"]
17
+ ],
18
+ member: [
19
+ "organizationId",
20
+ ["organizationId", "role"],
21
+ ["organizationId", "userId"]
22
+ ],
8
23
  oauthConsent: [["clientId", "userId"]],
24
+ organizationRole: ["organizationId", ["organizationId", "role"]],
9
25
  passkey: ["credentialID"],
10
26
  ratelimit: ["key"],
11
27
  rateLimit: ["key"],
12
28
  session: ["expiresAt", ["expiresAt", "userId"]],
29
+ teamMember: ["teamId", ["teamId", "userId"]],
13
30
  user: [["email", "name"], "name"],
14
31
  verification: ["expiresAt", "identifier"]
15
32
  };
@@ -1,4 +1,4 @@
1
- import { augmentBetterAuthTables, indexFields } from "./create-schema-BRFjdgRr.js";
1
+ import { augmentBetterAuthTables, indexFields } from "./create-schema-DqhLA_UF.js";
2
2
 
3
3
  //#region src/auth/create-schema-orm.ts
4
4
  const specialFields = (tables) => Object.fromEntries(Object.entries(tables).map(([key, table]) => {
@@ -1,5 +1,5 @@
1
1
  import { $n as BinaryExpression, $t as OrmLifecycleOperation, A as DatabaseWithMutations, An as ConvexCheckConfig, Ar as AnyColumn, At as VectorQueryConfig, B as RlsContext, Bn as ConvexTextBuilderInitial, Br as IsUnique, Bt as RelationsBuilderColumnConfig, C as MigrationTableName, Cn as aggregateIndex, Cr as notBetween, Ct as OrderDirection, D as defineMigrationSet, Dn as uniqueIndex, Dt as ReturningResult, E as defineMigration, En as searchIndex, Er as startsWith, Et as ReturningAll, Fn as ConvexUniqueConstraintConfig, Fr as ColumnBuilderWithTableName, Ft as ExtractTablesWithRelations, Gt as defineRelations, H as EdgeMetadata, In as check, Ir as ColumnDataType, It as ManyConfig, Jt as ConvexDeletionConfig, Kt as defineRelationsPart, Ln as foreignKey, Lr as DrizzleEntity, Lt as OneConfig, M as OrmReader$1, Mn as ConvexForeignKeyConfig, Mr as ColumnBuilderBaseConfig, Mt as unsetToken, N as OrmWriter$1, Nn as ConvexUniqueConstraintBuilder, Nr as ColumnBuilderRuntimeConfig, O as detectMigrationDrift, On as vectorIndex, Or as SystemFields, Ot as ReturningSelection, Pn as ConvexUniqueConstraintBuilderOn, Pr as ColumnBuilderTypeConfig, Pt as ExtractTablesFromSchema, Qn as TableName, Qt as OrmLifecycleChange, Rn as unique, Rr as HasDefault, Rt as RelationsBuilder, S as MigrationStep, Sn as ConvexVectorIndexConfig, Sr as not, St as OrderByClause, T as buildMigrationPlan, Tn as rankIndex, Tr as or, Tt as PredicateWhereIndexConfig, U as extractRelationsConfig, Un as Brand, Ut as TableRelationalConfig, V as RlsMode, Vn as text, Vr as NotNull, Wn as Columns, Wt as TablesRelationalConfig, Xn as OrmSchemaRelations, Xt as ConvexTableWithColumns, Yn as OrmSchemaExtensions, Yt as ConvexTable, Zn as OrmSchemaTriggers, Zt as DiscriminatorBuilderConfig, _ as MigrationMigrateOne, _n as ConvexSearchIndexBuilder, _r as isNull, _t as MutationPaginateConfig, an as RlsPolicyConfig, ar as and, at as CountConfig, b as MigrationSet, bn as ConvexVectorIndexBuilder, br as lte, bt as MutationReturning, cn as RlsRole, cr as endsWith, ct as FilterOperators, d as MigrationDefinition, dn as ConvexAggregateIndexBuilder, dr as gt, dt as InferModelFromColumns, en as TableConfig, er as ExpressionVisitor, et as AggregateConfig, f as MigrationDirection, fn as ConvexAggregateIndexBuilderOn, fr as gte, ft as InferSelectModel, g as MigrationManifestEntry, gn as ConvexRankIndexBuilderOn, gr as isNotNull, gt as MutationExecutionMode, h as MigrationDriftIssue, hn as ConvexRankIndexBuilder, hr as isFieldReference, ht as MutationExecuteResult, i as OrmMigrationCapability, in as RlsPolicy, ir as UnaryExpression, it as BuildRelationResult, j as DatabaseWithQuery, jn as ConvexForeignKeyBuilder, jr as ColumnBuilder, jt as VectorSearchProvider, kn as ConvexCheckBuilder, kt as UpdateSet, ln as RlsRoleConfig, lr as eq, lt as GetColumnData, m as MigrationDocContext, mn as ConvexIndexBuilderOn, mr as inArray, mt as MutationExecuteConfig, n as OrmCapabilities, nn as deletion, nr as FilterExpression, nt as AggregateResult, on as RlsPolicyToOption, or as between, ot as CountResult, p as MigrationDoc, pn as ConvexIndexBuilder, pr as ilike, pt as InsertValue, qn as OrmSchemaExtensionTables, qt as ConvexDeletionBuilder, r as OrmCapability, rn as discriminator, rr as LogicalExpression, rt as BuildQueryResult, sn as rlsPolicy, sr as contains, st as DBQueryConfig, t as OrmAggregateCapability, tn as convexTable, tr as FieldReference, tt as AggregateFieldValue, u as MigrationAppliedState, un as rlsRole, ur as fieldRef, ut as InferInsertModel, v as MigrationPlan, vn as ConvexSearchIndexBuilderOn, vr as like, vt as MutationPaginatedResult, w as MigrationWriteMode, wn as index, wr as notInArray, wt as PaginatedResult, x as MigrationStateMap, xn as ConvexVectorIndexBuilderOn, xr as ne, xt as MutationRunMode, y as MigrationRunStatus, yn as ConvexSearchIndexConfig, yr as lt, yt as MutationResult, zn as ConvexTextBuilder, zr as IsPrimaryKey, zt as RelationsBuilderColumnBase } from "../capabilities-CLCYgRdY.js";
2
- import { $ as OrmClientWithApi$1, A as ConvexDateMode, B as ConvexBytesBuilderInitial, C as ConvexNumberBuilderInitial, D as id, E as ConvexIdBuilderInitial, F as custom, G as ConvexBigIntBuilder, H as ConvexBooleanBuilder, I as json, J as CreateOrmOptions, K as ConvexBigIntBuilderInitial, L as objectOf, M as ConvexCustomBuilder, N as ConvexCustomBuilderInitial, O as ConvexDateBuilder, P as arrayOf, Q as OrmClientBase$1, R as unionOf, S as ConvexNumberBuilder, St as defineTriggers, T as ConvexIdBuilder, U as ConvexBooleanBuilderInitial, V as bytes, W as boolean, X as GenericOrmCtx$1, Y as GenericOrm$1, Z as OrmApiResult, _ as ConvexTimestampMode, _t as OrmBeforeResult, a as requireSchemaRelations, at as ScheduledMutationBatchArgs, b as ConvexTextEnumBuilderInitial, bt as OrmTriggerContext, c as TableConfigResult, ct as scheduledDeleteFactory, d as OrmNotFoundError, et as OrmFunctions, f as ConvexVectorBuilder, g as ConvexTimestampBuilderInitial, gt as defineSchemaExtension, h as ConvexTimestampBuilder, ht as SchemaExtension, i as getSchemaTriggers, it as createOrm, j as date, k as ConvexDateBuilderInitial, l as getTableColumns, m as vector, n as defineSchema, nt as OrmWriterCtx, o as asc, ot as scheduledMutationBatchFactory, p as ConvexVectorBuilderInitial, q as bigint, r as getSchemaRelations, rt as ResolveOrmSchema, s as desc, st as ScheduledDeleteArgs, t as WhereClauseResult, tt as OrmReaderCtx, u as getTableConfig, v as timestamp, vt as OrmTableTriggers, w as integer, x as textEnum, xt as OrmTriggers, y as ConvexTextEnumBuilder, yt as OrmTriggerChange, z as ConvexBytesBuilder } from "../where-clause-compiler-CErbOMvj.js";
2
+ import { $ as OrmClientWithApi$1, A as ConvexDateMode, B as ConvexBytesBuilderInitial, C as ConvexNumberBuilderInitial, D as id, E as ConvexIdBuilderInitial, F as custom, G as ConvexBigIntBuilder, H as ConvexBooleanBuilder, I as json, J as CreateOrmOptions, K as ConvexBigIntBuilderInitial, L as objectOf, M as ConvexCustomBuilder, N as ConvexCustomBuilderInitial, O as ConvexDateBuilder, P as arrayOf, Q as OrmClientBase$1, R as unionOf, S as ConvexNumberBuilder, St as defineTriggers, T as ConvexIdBuilder, U as ConvexBooleanBuilderInitial, V as bytes, W as boolean, X as GenericOrmCtx$1, Y as GenericOrm$1, Z as OrmApiResult, _ as ConvexTimestampMode, _t as OrmBeforeResult, a as requireSchemaRelations, at as ScheduledMutationBatchArgs, b as ConvexTextEnumBuilderInitial, bt as OrmTriggerContext, c as TableConfigResult, ct as scheduledDeleteFactory, d as OrmNotFoundError, et as OrmFunctions, f as ConvexVectorBuilder, g as ConvexTimestampBuilderInitial, gt as defineSchemaExtension, h as ConvexTimestampBuilder, ht as SchemaExtension, i as getSchemaTriggers, it as createOrm, j as date, k as ConvexDateBuilderInitial, l as getTableColumns, m as vector, n as defineSchema, nt as OrmWriterCtx, o as asc, ot as scheduledMutationBatchFactory, p as ConvexVectorBuilderInitial, q as bigint, r as getSchemaRelations, rt as ResolveOrmSchema, s as desc, st as ScheduledDeleteArgs, t as WhereClauseResult, tt as OrmReaderCtx, u as getTableConfig, v as timestamp, vt as OrmTableTriggers, w as integer, x as textEnum, xt as OrmTriggers, y as ConvexTextEnumBuilder, yt as OrmTriggerChange, z as ConvexBytesBuilder } from "../where-clause-compiler-ChMQ575O.js";
3
3
  import { i as pretendRequired, n as deprecated, r as pretend } from "../validators-wOIjhkfN.js";
4
4
  import { a as QueryCtxWithPreferredOrmQueryTable, i as QueryCtxWithOrmQueryTable, n as LookupByIdResultByCtx, o as getByIdWithOrmQueryFallback, r as QueryCtxWithOptionalOrmQueryTable, t as DocByCtx } from "../query-context-DJONf8X5.js";
5
5
  import { DefineSchemaOptions, GenericDatabaseReader, GenericDatabaseWriter, GenericSchema, SchemaDefinition } from "convex/server";
@@ -1,3 +1,3 @@
1
1
  import { C as MigrationTableName, D as defineMigrationSet, E as defineMigration, O as detectMigrationDrift, S as MigrationStep, T as buildMigrationPlan, _ as MigrationMigrateOne, a as MigrationCancelArgs, b as MigrationSet, c as MigrationStatusArgs, d as MigrationDefinition, f as MigrationDirection, g as MigrationManifestEntry, h as MigrationDriftIssue, l as createMigrationHandlers, m as MigrationDocContext, o as MigrationRunArgs, p as MigrationDoc, s as MigrationRunChunkArgs, u as MigrationAppliedState, v as MigrationPlan, w as MigrationWriteMode, x as MigrationStateMap, y as MigrationRunStatus } from "../../capabilities-CLCYgRdY.js";
2
- import { Ct as migrationCapability, dt as MIGRATION_STORAGE_TABLE_NAMES, ft as injectMigrationStorageTables, lt as MIGRATION_RUN_TABLE, mt as migrationStorageTables, pt as migrationExtension, ut as MIGRATION_STATE_TABLE } from "../../where-clause-compiler-CErbOMvj.js";
2
+ import { Ct as migrationCapability, dt as MIGRATION_STORAGE_TABLE_NAMES, ft as injectMigrationStorageTables, lt as MIGRATION_RUN_TABLE, mt as migrationStorageTables, pt as migrationExtension, ut as MIGRATION_STATE_TABLE } from "../../where-clause-compiler-ChMQ575O.js";
3
3
  export { MIGRATION_RUN_TABLE, MIGRATION_STATE_TABLE, MIGRATION_STORAGE_TABLE_NAMES, type MigrationAppliedState, type MigrationCancelArgs, type MigrationDefinition, type MigrationDirection, type MigrationDoc, type MigrationDocContext, type MigrationDriftIssue, type MigrationManifestEntry, type MigrationMigrateOne, type MigrationPlan, type MigrationRunArgs, type MigrationRunChunkArgs, type MigrationRunStatus, type MigrationSet, type MigrationStateMap, type MigrationStatusArgs, type MigrationStep, type MigrationTableName, type MigrationWriteMode, buildMigrationPlan, createMigrationHandlers, defineMigration, defineMigrationSet, detectMigrationDrift, injectMigrationStorageTables, migrationCapability, migrationExtension, migrationStorageTables };
@@ -120,6 +120,19 @@ declare const migrationStorageTables: {
120
120
  fieldName: "direction";
121
121
  };
122
122
  };
123
+ updatedAt: ConvexNumberBuilderInitial<""> & {
124
+ _: {
125
+ notNull: true;
126
+ };
127
+ } & {
128
+ _: {
129
+ tableName: "migration_state";
130
+ };
131
+ } & {
132
+ _: {
133
+ fieldName: "updatedAt";
134
+ };
135
+ };
123
136
  migrationId: ConvexTextBuilderInitial<""> & {
124
137
  _: {
125
138
  notNull: true;
@@ -190,19 +203,6 @@ declare const migrationStorageTables: {
190
203
  fieldName: "startedAt";
191
204
  };
192
205
  };
193
- updatedAt: ConvexNumberBuilderInitial<""> & {
194
- _: {
195
- notNull: true;
196
- };
197
- } & {
198
- _: {
199
- tableName: "migration_state";
200
- };
201
- } & {
202
- _: {
203
- fieldName: "updatedAt";
204
- };
205
- };
206
206
  completedAt: ConvexNumberBuilderInitial<""> & {
207
207
  _: {
208
208
  tableName: "migration_state";
@@ -269,7 +269,7 @@ declare const migrationStorageTables: {
269
269
  fieldName: "direction";
270
270
  };
271
271
  };
272
- runId: ConvexTextBuilderInitial<""> & {
272
+ updatedAt: ConvexNumberBuilderInitial<""> & {
273
273
  _: {
274
274
  notNull: true;
275
275
  };
@@ -279,10 +279,10 @@ declare const migrationStorageTables: {
279
279
  };
280
280
  } & {
281
281
  _: {
282
- fieldName: "runId";
282
+ fieldName: "updatedAt";
283
283
  };
284
284
  };
285
- startedAt: ConvexNumberBuilderInitial<""> & {
285
+ runId: ConvexTextBuilderInitial<""> & {
286
286
  _: {
287
287
  notNull: true;
288
288
  };
@@ -292,10 +292,10 @@ declare const migrationStorageTables: {
292
292
  };
293
293
  } & {
294
294
  _: {
295
- fieldName: "startedAt";
295
+ fieldName: "runId";
296
296
  };
297
297
  };
298
- updatedAt: ConvexNumberBuilderInitial<""> & {
298
+ startedAt: ConvexNumberBuilderInitial<""> & {
299
299
  _: {
300
300
  notNull: true;
301
301
  };
@@ -305,7 +305,7 @@ declare const migrationStorageTables: {
305
305
  };
306
306
  } & {
307
307
  _: {
308
- fieldName: "updatedAt";
308
+ fieldName: "startedAt";
309
309
  };
310
310
  };
311
311
  completedAt: ConvexNumberBuilderInitial<""> & {
@@ -1008,7 +1008,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1008
1008
  readonly aggregate_bucket: ConvexTableWithColumns<{
1009
1009
  name: "aggregate_bucket";
1010
1010
  columns: {
1011
- updatedAt: ConvexNumberBuilderInitial<""> & {
1011
+ count: ConvexNumberBuilderInitial<""> & {
1012
1012
  _: {
1013
1013
  notNull: true;
1014
1014
  };
@@ -1018,10 +1018,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1018
1018
  };
1019
1019
  } & {
1020
1020
  _: {
1021
- fieldName: "updatedAt";
1021
+ fieldName: "count";
1022
1022
  };
1023
1023
  };
1024
- count: ConvexNumberBuilderInitial<""> & {
1024
+ updatedAt: ConvexNumberBuilderInitial<""> & {
1025
1025
  _: {
1026
1026
  notNull: true;
1027
1027
  };
@@ -1031,7 +1031,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1031
1031
  };
1032
1032
  } & {
1033
1033
  _: {
1034
- fieldName: "count";
1034
+ fieldName: "updatedAt";
1035
1035
  };
1036
1036
  };
1037
1037
  tableKey: ConvexTextBuilderInitial<""> & {
@@ -1340,7 +1340,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1340
1340
  fieldName: "value";
1341
1341
  };
1342
1342
  };
1343
- updatedAt: ConvexNumberBuilderInitial<""> & {
1343
+ count: ConvexNumberBuilderInitial<""> & {
1344
1344
  _: {
1345
1345
  notNull: true;
1346
1346
  };
@@ -1350,10 +1350,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1350
1350
  };
1351
1351
  } & {
1352
1352
  _: {
1353
- fieldName: "updatedAt";
1353
+ fieldName: "count";
1354
1354
  };
1355
1355
  };
1356
- count: ConvexNumberBuilderInitial<""> & {
1356
+ updatedAt: ConvexNumberBuilderInitial<""> & {
1357
1357
  _: {
1358
1358
  notNull: true;
1359
1359
  };
@@ -1363,7 +1363,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1363
1363
  };
1364
1364
  } & {
1365
1365
  _: {
1366
- fieldName: "count";
1366
+ fieldName: "updatedAt";
1367
1367
  };
1368
1368
  };
1369
1369
  tableKey: ConvexTextBuilderInitial<""> & {
@@ -1611,7 +1611,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1611
1611
  fieldName: "cursor";
1612
1612
  };
1613
1613
  };
1614
- processed: ConvexNumberBuilderInitial<""> & {
1614
+ updatedAt: ConvexNumberBuilderInitial<""> & {
1615
1615
  _: {
1616
1616
  notNull: true;
1617
1617
  };
@@ -1621,10 +1621,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1621
1621
  };
1622
1622
  } & {
1623
1623
  _: {
1624
- fieldName: "processed";
1624
+ fieldName: "updatedAt";
1625
1625
  };
1626
1626
  };
1627
- startedAt: ConvexNumberBuilderInitial<""> & {
1627
+ processed: ConvexNumberBuilderInitial<""> & {
1628
1628
  _: {
1629
1629
  notNull: true;
1630
1630
  };
@@ -1634,10 +1634,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1634
1634
  };
1635
1635
  } & {
1636
1636
  _: {
1637
- fieldName: "startedAt";
1637
+ fieldName: "processed";
1638
1638
  };
1639
1639
  };
1640
- updatedAt: ConvexNumberBuilderInitial<""> & {
1640
+ startedAt: ConvexNumberBuilderInitial<""> & {
1641
1641
  _: {
1642
1642
  notNull: true;
1643
1643
  };
@@ -1647,7 +1647,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1647
1647
  };
1648
1648
  } & {
1649
1649
  _: {
1650
- fieldName: "updatedAt";
1650
+ fieldName: "startedAt";
1651
1651
  };
1652
1652
  };
1653
1653
  completedAt: ConvexNumberBuilderInitial<""> & {
@@ -1762,6 +1762,19 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1762
1762
  fieldName: "direction";
1763
1763
  };
1764
1764
  };
1765
+ updatedAt: ConvexNumberBuilderInitial<""> & {
1766
+ _: {
1767
+ notNull: true;
1768
+ };
1769
+ } & {
1770
+ _: {
1771
+ tableName: "migration_state";
1772
+ };
1773
+ } & {
1774
+ _: {
1775
+ fieldName: "updatedAt";
1776
+ };
1777
+ };
1765
1778
  migrationId: ConvexTextBuilderInitial<""> & {
1766
1779
  _: {
1767
1780
  notNull: true;
@@ -1832,19 +1845,6 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1832
1845
  fieldName: "startedAt";
1833
1846
  };
1834
1847
  };
1835
- updatedAt: ConvexNumberBuilderInitial<""> & {
1836
- _: {
1837
- notNull: true;
1838
- };
1839
- } & {
1840
- _: {
1841
- tableName: "migration_state";
1842
- };
1843
- } & {
1844
- _: {
1845
- fieldName: "updatedAt";
1846
- };
1847
- };
1848
1848
  completedAt: ConvexNumberBuilderInitial<""> & {
1849
1849
  _: {
1850
1850
  tableName: "migration_state";
@@ -1911,7 +1911,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1911
1911
  fieldName: "direction";
1912
1912
  };
1913
1913
  };
1914
- runId: ConvexTextBuilderInitial<""> & {
1914
+ updatedAt: ConvexNumberBuilderInitial<""> & {
1915
1915
  _: {
1916
1916
  notNull: true;
1917
1917
  };
@@ -1921,10 +1921,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1921
1921
  };
1922
1922
  } & {
1923
1923
  _: {
1924
- fieldName: "runId";
1924
+ fieldName: "updatedAt";
1925
1925
  };
1926
1926
  };
1927
- startedAt: ConvexNumberBuilderInitial<""> & {
1927
+ runId: ConvexTextBuilderInitial<""> & {
1928
1928
  _: {
1929
1929
  notNull: true;
1930
1930
  };
@@ -1934,10 +1934,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1934
1934
  };
1935
1935
  } & {
1936
1936
  _: {
1937
- fieldName: "startedAt";
1937
+ fieldName: "runId";
1938
1938
  };
1939
1939
  };
1940
- updatedAt: ConvexNumberBuilderInitial<""> & {
1940
+ startedAt: ConvexNumberBuilderInitial<""> & {
1941
1941
  _: {
1942
1942
  notNull: true;
1943
1943
  };
@@ -1947,7 +1947,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1947
1947
  };
1948
1948
  } & {
1949
1949
  _: {
1950
- fieldName: "updatedAt";
1950
+ fieldName: "startedAt";
1951
1951
  };
1952
1952
  };
1953
1953
  completedAt: ConvexNumberBuilderInitial<""> & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kitcn",
3
- "version": "0.27.1",
3
+ "version": "0.27.2",
4
4
  "description": "kitcn - React Query integration and CLI tools for Convex",
5
5
  "keywords": [
6
6
  "convex",
@@ -110,6 +110,7 @@ export const member = convexTable(
110
110
  },
111
111
  (t) => [
112
112
  index("userId").on(t.userId),
113
+ index("organizationId").on(t.organizationId),
113
114
  index("organizationId_userId").on(t.organizationId, t.userId),
114
115
  index("organizationId_role").on(t.organizationId, t.role),
115
116
  // Backs `member.count({ where: { organizationId } })` for seat limits.
@@ -131,6 +132,7 @@ export const invitation = convexTable(
131
132
  (t) => [
132
133
  index("email").on(t.email),
133
134
  index("status").on(t.status),
135
+ index("organizationId").on(t.organizationId),
134
136
  index("email_organizationId_status").on(
135
137
  t.email,
136
138
  t.organizationId,
@@ -178,7 +180,11 @@ export const teamMember = convexTable(
178
180
  userId: id("user").notNull(),
179
181
  createdAt: timestamp(),
180
182
  },
181
- (t) => [index("teamId").on(t.teamId), index("userId").on(t.userId)]
183
+ (t) => [
184
+ index("teamId").on(t.teamId),
185
+ index("userId").on(t.userId),
186
+ index("teamId_userId").on(t.teamId, t.userId),
187
+ ]
182
188
  );
183
189
  ```
184
190