kitcn 0.34.0 → 0.34.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # kitcn
2
2
 
3
+ ## 0.34.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#504](https://github.com/udecode/kitcn/pull/504) [`28b6682`](https://github.com/udecode/kitcn/commit/28b66826db4b344df64da5283e8b9e5f307016fd) Thanks [@ghandic](https://github.com/ghandic)! - ## Patches
8
+
9
+ - Fix `kitcn migrate up`, `migrate down`, `deploy` and `dev` so each migration step runs with its own `batchSize`. The CLI sends a batch size only when `--migrations-batch-size` or `batchSize` in the `kitcn.json` migrations config sets one, and a step without `batchSize` runs 128 documents per batch.
10
+
3
11
  ## 0.34.0
4
12
 
5
13
  ### Minor Changes
@@ -1,5 +1,5 @@
1
1
  import { Vn as ConvexTextBuilderInitial, Zt as ConvexTableWithColumns } from "../capabilities-Bxzoofl4.js";
2
- import { C as ConvexNumberBuilderInitial, E as ConvexIdBuilderInitial, N as ConvexCustomBuilderInitial } from "../where-clause-compiler-dGV0ALDz.js";
2
+ import { C as ConvexNumberBuilderInitial, E as ConvexIdBuilderInitial, N as ConvexCustomBuilderInitial } from "../where-clause-compiler-ChAN1JQa.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";
@@ -1,2 +1,2 @@
1
- import { C as GenericAuthTriggerHandlers, S as GenericAuthTriggerChange, T as defineAuth, b as GenericAuthBeforeResult, i as getGeneratedAuthDisabledReason, n as GeneratedAuthDisabledReasonKind, r as createDisabledAuthRuntime, t as AuthRuntime, w as GenericAuthTriggers, x as GenericAuthDefinition, y as BetterAuthOptionsWithoutDatabase } from "../../generated-contract-disabled-78J7oFCT.js";
1
+ import { C as GenericAuthTriggerHandlers, S as GenericAuthTriggerChange, T as defineAuth, b as GenericAuthBeforeResult, i as getGeneratedAuthDisabledReason, n as GeneratedAuthDisabledReasonKind, r as createDisabledAuthRuntime, t as AuthRuntime, w as GenericAuthTriggers, x as GenericAuthDefinition, y as BetterAuthOptionsWithoutDatabase } from "../../generated-contract-disabled-DcgLIEHK.js";
2
2
  export { type AuthRuntime, BetterAuthOptionsWithoutDatabase, type GeneratedAuthDisabledReasonKind, GenericAuthBeforeResult, GenericAuthDefinition, GenericAuthTriggerChange, GenericAuthTriggerHandlers, GenericAuthTriggers, createDisabledAuthRuntime, defineAuth, getGeneratedAuthDisabledReason };
@@ -1,7 +1,7 @@
1
1
  import { a as QueryCtxWithPreferredOrmQueryTable, n as LookupByIdResultByCtx, t as DocByCtx } from "../query-context-BkNjkDCk.js";
2
2
  import { t as GetAuth } from "../types-ex0-J-SC.js";
3
3
  import { t as GenericCtx } from "../context-utils-Cbv4r0AA.js";
4
- import { C as GenericAuthTriggerHandlers, S as GenericAuthTriggerChange, T as defineAuth, _ as updateManyHandler, a as AuthFunctions, b as GenericAuthBeforeResult, c as consumeOneHandler, d as createHandler, f as deleteManyHandler, g as incrementOneHandler, h as findOneHandler, i as getGeneratedAuthDisabledReason, l as countHandler, m as findManyHandler, n as GeneratedAuthDisabledReasonKind, o as Triggers, p as deleteOneHandler, r as createDisabledAuthRuntime, s as createClient, t as AuthRuntime, u as createApi, v as updateOneHandler, w as GenericAuthTriggers, x as GenericAuthDefinition, y as BetterAuthOptionsWithoutDatabase } from "../generated-contract-disabled-78J7oFCT.js";
4
+ import { C as GenericAuthTriggerHandlers, S as GenericAuthTriggerChange, T as defineAuth, _ as updateManyHandler, a as AuthFunctions, b as GenericAuthBeforeResult, c as consumeOneHandler, d as createHandler, f as deleteManyHandler, g as incrementOneHandler, h as findOneHandler, i as getGeneratedAuthDisabledReason, l as countHandler, m as findManyHandler, n as GeneratedAuthDisabledReasonKind, o as Triggers, p as deleteOneHandler, r as createDisabledAuthRuntime, s as createClient, t as AuthRuntime, u as createApi, v as updateOneHandler, w as GenericAuthTriggers, x as GenericAuthDefinition, y as BetterAuthOptionsWithoutDatabase } from "../generated-contract-disabled-DcgLIEHK.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";
@@ -132,8 +132,8 @@ declare const adapterArgsValidator: convex_values0.VObject<{
132
132
  offset?: number | undefined;
133
133
  select?: string[] | undefined;
134
134
  sortBy?: {
135
- direction: "asc" | "desc";
136
135
  field: string;
136
+ direction: "asc" | "desc";
137
137
  } | undefined;
138
138
  model: string;
139
139
  }, {
@@ -142,12 +142,12 @@ declare const adapterArgsValidator: convex_values0.VObject<{
142
142
  offset: convex_values0.VFloat64<number | undefined, "optional">;
143
143
  select: convex_values0.VArray<string[] | undefined, convex_values0.VString<string, "required">, "optional">;
144
144
  sortBy: convex_values0.VObject<{
145
- direction: "asc" | "desc";
146
145
  field: string;
146
+ direction: "asc" | "desc";
147
147
  } | undefined, {
148
148
  direction: convex_values0.VUnion<"asc" | "desc", [convex_values0.VLiteral<"asc", "required">, convex_values0.VLiteral<"desc", "required">], "required", never>;
149
149
  field: convex_values0.VString<string, "required">;
150
- }, "optional", "direction" | "field">;
150
+ }, "optional", "field" | "direction">;
151
151
  where: convex_values0.VArray<{
152
152
  mode?: "sensitive" | "insensitive" | undefined;
153
153
  connector?: "AND" | "OR" | undefined;
@@ -167,7 +167,7 @@ declare const adapterArgsValidator: convex_values0.VObject<{
167
167
  operator: convex_values0.VUnion<"lt" | "lte" | "gt" | "gte" | "eq" | "in" | "not_in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined, [convex_values0.VLiteral<"lt", "required">, convex_values0.VLiteral<"lte", "required">, convex_values0.VLiteral<"gt", "required">, convex_values0.VLiteral<"gte", "required">, convex_values0.VLiteral<"eq", "required">, convex_values0.VLiteral<"in", "required">, convex_values0.VLiteral<"not_in", "required">, convex_values0.VLiteral<"ne", "required">, convex_values0.VLiteral<"contains", "required">, convex_values0.VLiteral<"starts_with", "required">, convex_values0.VLiteral<"ends_with", "required">], "optional", never>;
168
168
  value: convex_values0.VUnion<string | number | boolean | string[] | number[] | null, [convex_values0.VString<string, "required">, convex_values0.VFloat64<number, "required">, convex_values0.VBoolean<boolean, "required">, convex_values0.VArray<string[], convex_values0.VString<string, "required">, "required">, convex_values0.VArray<number[], convex_values0.VFloat64<number, "required">, "required">, convex_values0.VNull<null, "required">], "required", never>;
169
169
  }, "required", "mode" | "connector" | "field" | "operator" | "value">, "optional">;
170
- }, "required", "model" | "where" | "limit" | "offset" | "select" | "sortBy" | "sortBy.direction" | "sortBy.field">;
170
+ }, "required", "model" | "where" | "limit" | "offset" | "select" | "sortBy" | "sortBy.field" | "sortBy.direction">;
171
171
  declare const hasUniqueFields: (betterAuthSchema: BetterAuthDBSchema, model: string, input: Record<string, any>) => boolean;
172
172
  declare const checkUniqueFields: <Schema extends SchemaDefinition<any, any>>(ctx: GenericQueryCtx<GenericDataModel>, schema: Schema, betterAuthSchema: BetterAuthDBSchema, table: string, input: Record<string, any>, doc?: Record<string, any>) => Promise<void>;
173
173
  /**
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { C as Columns, D as TableName, E as RlsPolicies, O as createSystemFields, S as getRankIndexes, T as OrmSchemaExtensions, _ as loadEsbuild, a as generateMeta, b as getAggregateIndexes, c as resolveSchemaDefaultExport, f as createProjectJiti, g as loadDotenv, h as loadClackPrompts, i as resolveConfiguredBackend, l as schemaDeclaresAggregateIndexes, m as loadBabelParser, n as withLocalCodegenEnv, o as getConvexConfig, p as CRPC_BUILDER_STUB_SOURCE, r as loadCliConfig, s as collectSchemaTables, t as getLocalBackendEnvVars, u as logger, v as highlighter, w as EnableRLS, x as getIndexes, y as isColorEnabled } from "./local-env-wuMk1Mo7.mjs";
2
+ import { C as Columns, D as TableName, E as RlsPolicies, O as createSystemFields, S as getRankIndexes, T as OrmSchemaExtensions, _ as loadEsbuild, a as generateMeta, b as getAggregateIndexes, c as resolveSchemaDefaultExport, f as createProjectJiti, g as loadDotenv, h as loadClackPrompts, i as resolveConfiguredBackend, l as schemaDeclaresAggregateIndexes, m as loadBabelParser, n as withLocalCodegenEnv, o as getConvexConfig, p as CRPC_BUILDER_STUB_SOURCE, r as loadCliConfig, s as collectSchemaTables, t as getLocalBackendEnvVars, u as logger, v as highlighter, w as EnableRLS, x as getIndexes, y as isColorEnabled } from "./local-env-SOUm4WE1.mjs";
3
3
  import { createRequire } from "node:module";
4
4
  import fs, { existsSync, readFileSync } from "node:fs";
5
5
  import path, { basename, delimiter, dirname, extname, isAbsolute, join, posix, relative, resolve, sep } from "node:path";
@@ -13299,7 +13299,6 @@ function resolveMigrationConfig(base, overrides) {
13299
13299
  const resolvedBase = base ?? {
13300
13300
  enabled: "auto",
13301
13301
  wait: true,
13302
- batchSize: 256,
13303
13302
  timeoutMs: 9e5,
13304
13303
  pollIntervalMs: 1e3,
13305
13304
  strict: false,
@@ -13605,7 +13604,7 @@ async function runMigrationFlow(params) {
13605
13604
  if (!backendUsesMigrations()) return 0;
13606
13605
  const kickoff = await runBackendFunction(execaFn, backendAdapter, "generated/server:migrationRun", {
13607
13606
  direction,
13608
- batchSize: migrationConfig.batchSize,
13607
+ ...migrationConfig.batchSize !== void 0 ? { batchSize: migrationConfig.batchSize } : {},
13609
13608
  allowDrift: migrationConfig.allowDrift,
13610
13609
  ...steps !== void 0 ? { steps } : {},
13611
13610
  ...to !== void 0 ? { to } : {}
@@ -291,8 +291,8 @@ declare const createApi: <Schema extends SchemaDefinition<any, any>, DataModel e
291
291
  offset?: number | undefined;
292
292
  select?: string[] | undefined;
293
293
  sortBy?: {
294
- direction: "asc" | "desc";
295
294
  field: string;
295
+ direction: "asc" | "desc";
296
296
  } | undefined;
297
297
  model: string;
298
298
  paginationOpts: {
@@ -4668,7 +4668,6 @@ function createDefaultConfig() {
4668
4668
  migrations: {
4669
4669
  enabled: "auto",
4670
4670
  wait: true,
4671
- batchSize: 256,
4672
4671
  pollIntervalMs: 1e3,
4673
4672
  timeoutMs: 9e5,
4674
4673
  strict: false,
@@ -4693,7 +4692,6 @@ function createDefaultConfig() {
4693
4692
  migrations: {
4694
4693
  enabled: "auto",
4695
4694
  wait: true,
4696
- batchSize: 256,
4697
4695
  pollIntervalMs: 1e3,
4698
4696
  timeoutMs: 9e5,
4699
4697
  strict: true,
@@ -1,5 +1,5 @@
1
1
  import { $n as TableName, $t as OrmLifecycleChange, An as ConvexCheckBuilder, At as UpdateSet, Bn as ConvexTextBuilder, Br as IsPrimaryKey, Bt as RelationsBuilderColumnBase, C as MigrationStep, Cn as ConvexVectorIndexConfig, Cr as not, Ct as OrderByClause, D as defineMigration, Dn as searchIndex, Dr as startsWith, Dt as ReturningAll, E as buildMigrationPlan, En as rankIndex, Er as or, Et as PredicateWhereIndexConfig, Fn as ConvexUniqueConstraintBuilderOn, Fr as ColumnBuilderTypeConfig, Ft as ExtractTablesFromSchema, Gn as Columns, Gt as TablesRelationalConfig, H as RlsMode, Hn as text, Hr as NotNull, In as ConvexUniqueConstraintConfig, Ir as ColumnBuilderWithTableName, It as ExtractTablesWithRelations, Jn as OrmSchemaExtensionTables, Jt as ConvexDeletionBuilder, Kt as defineRelations, Ln as check, Lr as ColumnDataType, Lt as ManyConfig, M as DatabaseWithQuery, Mn as ConvexForeignKeyBuilder, Mr as ColumnBuilder, Mt as VectorSearchProvider, N as OrmReader$1, Nn as ConvexForeignKeyConfig, Nr as ColumnBuilderBaseConfig, Nt as unsetToken, O as defineMigrationSet, On as uniqueIndex, Ot as ReturningResult, P as OrmWriter$1, Pn as ConvexUniqueConstraintBuilder, Pr as ColumnBuilderRuntimeConfig, Qn as OrmSchemaTriggers, Qt as DiscriminatorBuilderConfig, Rn as foreignKey, Rr as DrizzleEntity, Rt as OneConfig, S as MigrationStateMap, Sn as ConvexVectorIndexBuilderOn, Sr as ne, St as MutationRunMode, T as MigrationWriteMode, Tn as index, Tr as notInArray, Tt as PaginatedResult, U as EdgeMetadata, V as RlsContext, Vn as ConvexTextBuilderInitial, Vr as IsUnique, Vt as RelationsBuilderColumnConfig, W as extractRelationsConfig, Wn as Brand, Wt as TableRelationalConfig, Xn as OrmSchemaExtensions, Xt as ConvexTable, Yt as ConvexDeletionConfig, Zn as OrmSchemaRelations, Zt as ConvexTableWithColumns, _ as MigrationManifestEntry, _n as ConvexRankIndexBuilderOn, _r as isNotNull, _t as MutationExecutionMode, an as RlsPolicy, ar as UnaryExpression, at as BuildRelationResult, b as MigrationRunStatus, bn as ConvexSearchIndexConfig, br as lt, bt as MutationResult, cn as rlsPolicy, cr as contains, ct as DBQueryConfig, d as MigrationAppliedState, dn as rlsRole, dr as fieldRef, dt as InferInsertModel, en as OrmLifecycleOperation, er as BinaryExpression, f as MigrationDefinition, fn as ConvexAggregateIndexBuilder, fr as gt, ft as InferModelFromColumns, g as MigrationDriftIssue, gn as ConvexRankIndexBuilder, gr as isFieldReference, gt as MutationExecuteResult, h as MigrationDocContext, hn as ConvexIndexBuilderOn, hr as inArray, ht as MutationExecuteConfig, i as OrmMigrationCapability, in as discriminator, ir as LogicalExpression, it as BuildQueryResult, j as DatabaseWithMutations, jn as ConvexCheckConfig, jr as AnyColumn, jt as VectorQueryConfig, k as detectMigrationDrift, kn as vectorIndex, kr as SystemFields, kt as ReturningSelection, ln as RlsRole, lr as endsWith, lt as FilterOperators, m as MigrationDoc, mn as ConvexIndexBuilder, mr as ilike, mt as InsertValue, n as OrmCapabilities, nn as convexTable, nr as FieldReference, nt as AggregateFieldValue, on as RlsPolicyConfig, or as and, ot as CountConfig, p as MigrationDirection, pn as ConvexAggregateIndexBuilderOn, pr as gte, pt as InferSelectModel, qt as defineRelationsPart, r as OrmCapability, rn as deletion, rr as FilterExpression, rt as AggregateResult, sn as RlsPolicyToOption, sr as between, st as CountResult, t as OrmAggregateCapability, tn as TableConfig, tr as ExpressionVisitor, tt as AggregateConfig, un as RlsRoleConfig, ur as eq, ut as GetColumnData, v as MigrationMigrateOne, vn as ConvexSearchIndexBuilder, vr as isNull, vt as MutationPaginateConfig, w as MigrationTableName, wn as aggregateIndex, wr as notBetween, wt as OrderDirection, x as MigrationSet, xn as ConvexVectorIndexBuilder, xr as lte, xt as MutationReturning, y as MigrationPlan, yn as ConvexSearchIndexBuilderOn, yr as like, yt as MutationPaginatedResult, zn as unique, zr as HasDefault, zt as RelationsBuilder } from "../capabilities-Bxzoofl4.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-dGV0ALDz.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-ChAN1JQa.js";
3
3
  import { i as pretendRequired, n as deprecated, r as pretend } from "../validators-VXKPVvVp.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-BkNjkDCk.js";
5
5
  import { DefineSchemaOptions, GenericDatabaseReader, GenericDatabaseWriter, GenericSchema, SchemaDefinition } from "convex/server";
@@ -1,3 +1,3 @@
1
1
  import { C as MigrationStep, D as defineMigration, E as buildMigrationPlan, O as defineMigrationSet, S as MigrationStateMap, T as MigrationWriteMode, _ as MigrationManifestEntry, a as MAX_STATUS_RUN_LIMIT, b as MigrationRunStatus, c as MigrationRunChunkArgs, d as MigrationAppliedState, f as MigrationDefinition, g as MigrationDriftIssue, h as MigrationDocContext, k as detectMigrationDrift, l as MigrationStatusArgs, m as MigrationDoc, o as MigrationCancelArgs, p as MigrationDirection, s as MigrationRunArgs, u as createMigrationHandlers, v as MigrationMigrateOne, w as MigrationTableName, x as MigrationSet, y as MigrationPlan } from "../../capabilities-Bxzoofl4.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-dGV0ALDz.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-ChAN1JQa.js";
3
3
  export { MAX_STATUS_RUN_LIMIT, 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 };
package/dist/watcher.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { a as generateMeta, d as PARSE_SNAPSHOT_SUFFIX, i as resolveConfiguredBackend, n as withLocalCodegenEnv, o as getConvexConfig, r as loadCliConfig, u as logger } from "./local-env-wuMk1Mo7.mjs";
2
+ import { a as generateMeta, d as PARSE_SNAPSHOT_SUFFIX, i as resolveConfiguredBackend, n as withLocalCodegenEnv, o as getConvexConfig, r as loadCliConfig, u as logger } from "./local-env-SOUm4WE1.mjs";
3
3
  import path from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
5
 
@@ -102,20 +102,25 @@ declare const migrationStorageTables: {
102
102
  fieldName: "status";
103
103
  };
104
104
  };
105
- migrationId: ConvexTextBuilderInitial<""> & {
105
+ direction: ConvexTextBuilderInitial<""> & {
106
106
  _: {
107
- notNull: true;
107
+ tableName: "migration_state";
108
108
  };
109
109
  } & {
110
+ _: {
111
+ fieldName: "direction";
112
+ };
113
+ };
114
+ cursor: ConvexTextBuilderInitial<""> & {
110
115
  _: {
111
116
  tableName: "migration_state";
112
117
  };
113
118
  } & {
114
119
  _: {
115
- fieldName: "migrationId";
120
+ fieldName: "cursor";
116
121
  };
117
122
  };
118
- checksum: ConvexTextBuilderInitial<""> & {
123
+ migrationId: ConvexTextBuilderInitial<""> & {
119
124
  _: {
120
125
  notNull: true;
121
126
  };
@@ -125,10 +130,10 @@ declare const migrationStorageTables: {
125
130
  };
126
131
  } & {
127
132
  _: {
128
- fieldName: "checksum";
133
+ fieldName: "migrationId";
129
134
  };
130
135
  };
131
- applied: ConvexBooleanBuilderInitial<""> & {
136
+ checksum: ConvexTextBuilderInitial<""> & {
132
137
  _: {
133
138
  notNull: true;
134
139
  };
@@ -138,34 +143,29 @@ declare const migrationStorageTables: {
138
143
  };
139
144
  } & {
140
145
  _: {
141
- fieldName: "applied";
146
+ fieldName: "checksum";
142
147
  };
143
148
  };
144
- direction: ConvexTextBuilderInitial<""> & {
149
+ applied: ConvexBooleanBuilderInitial<""> & {
145
150
  _: {
146
- tableName: "migration_state";
151
+ notNull: true;
147
152
  };
148
153
  } & {
149
- _: {
150
- fieldName: "direction";
151
- };
152
- };
153
- runId: ConvexTextBuilderInitial<""> & {
154
154
  _: {
155
155
  tableName: "migration_state";
156
156
  };
157
157
  } & {
158
158
  _: {
159
- fieldName: "runId";
159
+ fieldName: "applied";
160
160
  };
161
161
  };
162
- cursor: ConvexTextBuilderInitial<""> & {
162
+ runId: ConvexTextBuilderInitial<""> & {
163
163
  _: {
164
164
  tableName: "migration_state";
165
165
  };
166
166
  } & {
167
167
  _: {
168
- fieldName: "cursor";
168
+ fieldName: "runId";
169
169
  };
170
170
  };
171
171
  processed: ConvexNumberBuilderInitial<""> & {
@@ -1037,7 +1037,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1037
1037
  fieldName: "count";
1038
1038
  };
1039
1039
  };
1040
- indexName: ConvexTextBuilderInitial<""> & {
1040
+ tableKey: ConvexTextBuilderInitial<""> & {
1041
1041
  _: {
1042
1042
  notNull: true;
1043
1043
  };
@@ -1047,10 +1047,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1047
1047
  };
1048
1048
  } & {
1049
1049
  _: {
1050
- fieldName: "indexName";
1050
+ fieldName: "tableKey";
1051
1051
  };
1052
1052
  };
1053
- tableKey: ConvexTextBuilderInitial<""> & {
1053
+ indexName: ConvexTextBuilderInitial<""> & {
1054
1054
  _: {
1055
1055
  notNull: true;
1056
1056
  };
@@ -1060,7 +1060,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1060
1060
  };
1061
1061
  } & {
1062
1062
  _: {
1063
- fieldName: "tableKey";
1063
+ fieldName: "indexName";
1064
1064
  };
1065
1065
  };
1066
1066
  keyHash: ConvexTextBuilderInitial<""> & {
@@ -1136,7 +1136,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1136
1136
  readonly aggregate_member: ConvexTableWithColumns<{
1137
1137
  name: "aggregate_member";
1138
1138
  columns: {
1139
- updatedAt: ConvexNumberBuilderInitial<""> & {
1139
+ kind: ConvexTextBuilderInitial<""> & {
1140
1140
  _: {
1141
1141
  notNull: true;
1142
1142
  };
@@ -1146,10 +1146,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1146
1146
  };
1147
1147
  } & {
1148
1148
  _: {
1149
- fieldName: "updatedAt";
1149
+ fieldName: "kind";
1150
1150
  };
1151
1151
  };
1152
- kind: ConvexTextBuilderInitial<""> & {
1152
+ updatedAt: ConvexNumberBuilderInitial<""> & {
1153
1153
  _: {
1154
1154
  notNull: true;
1155
1155
  };
@@ -1159,10 +1159,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1159
1159
  };
1160
1160
  } & {
1161
1161
  _: {
1162
- fieldName: "kind";
1162
+ fieldName: "updatedAt";
1163
1163
  };
1164
1164
  };
1165
- indexName: ConvexTextBuilderInitial<""> & {
1165
+ tableKey: ConvexTextBuilderInitial<""> & {
1166
1166
  _: {
1167
1167
  notNull: true;
1168
1168
  };
@@ -1172,10 +1172,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1172
1172
  };
1173
1173
  } & {
1174
1174
  _: {
1175
- fieldName: "indexName";
1175
+ fieldName: "tableKey";
1176
1176
  };
1177
1177
  };
1178
- tableKey: ConvexTextBuilderInitial<""> & {
1178
+ indexName: ConvexTextBuilderInitial<""> & {
1179
1179
  _: {
1180
1180
  notNull: true;
1181
1181
  };
@@ -1185,7 +1185,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1185
1185
  };
1186
1186
  } & {
1187
1187
  _: {
1188
- fieldName: "tableKey";
1188
+ fieldName: "indexName";
1189
1189
  };
1190
1190
  };
1191
1191
  keyHash: ConvexTextBuilderInitial<""> & {
@@ -1326,7 +1326,11 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1326
1326
  readonly aggregate_extrema: ConvexTableWithColumns<{
1327
1327
  name: "aggregate_extrema";
1328
1328
  columns: {
1329
- updatedAt: ConvexNumberBuilderInitial<""> & {
1329
+ value: ConvexCustomBuilderInitial<"", convex_values0.VAny<any, "required", string>> & {
1330
+ _: {
1331
+ $type: convex_values0.Value;
1332
+ };
1333
+ } & {
1330
1334
  _: {
1331
1335
  notNull: true;
1332
1336
  };
@@ -1336,14 +1340,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1336
1340
  };
1337
1341
  } & {
1338
1342
  _: {
1339
- fieldName: "updatedAt";
1343
+ fieldName: "value";
1340
1344
  };
1341
1345
  };
1342
- value: ConvexCustomBuilderInitial<"", convex_values0.VAny<any, "required", string>> & {
1343
- _: {
1344
- $type: convex_values0.Value;
1345
- };
1346
- } & {
1346
+ updatedAt: ConvexNumberBuilderInitial<""> & {
1347
1347
  _: {
1348
1348
  notNull: true;
1349
1349
  };
@@ -1353,7 +1353,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1353
1353
  };
1354
1354
  } & {
1355
1355
  _: {
1356
- fieldName: "value";
1356
+ fieldName: "updatedAt";
1357
1357
  };
1358
1358
  };
1359
1359
  count: ConvexNumberBuilderInitial<""> & {
@@ -1369,7 +1369,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1369
1369
  fieldName: "count";
1370
1370
  };
1371
1371
  };
1372
- indexName: ConvexTextBuilderInitial<""> & {
1372
+ tableKey: ConvexTextBuilderInitial<""> & {
1373
1373
  _: {
1374
1374
  notNull: true;
1375
1375
  };
@@ -1379,10 +1379,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1379
1379
  };
1380
1380
  } & {
1381
1381
  _: {
1382
- fieldName: "indexName";
1382
+ fieldName: "tableKey";
1383
1383
  };
1384
1384
  };
1385
- tableKey: ConvexTextBuilderInitial<""> & {
1385
+ indexName: ConvexTextBuilderInitial<""> & {
1386
1386
  _: {
1387
1387
  notNull: true;
1388
1388
  };
@@ -1392,7 +1392,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1392
1392
  };
1393
1393
  } & {
1394
1394
  _: {
1395
- fieldName: "tableKey";
1395
+ fieldName: "indexName";
1396
1396
  };
1397
1397
  };
1398
1398
  keyHash: ConvexTextBuilderInitial<""> & {
@@ -1596,6 +1596,19 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1596
1596
  fieldName: "status";
1597
1597
  };
1598
1598
  };
1599
+ kind: ConvexTextBuilderInitial<""> & {
1600
+ _: {
1601
+ notNull: true;
1602
+ };
1603
+ } & {
1604
+ _: {
1605
+ tableName: "aggregate_state";
1606
+ };
1607
+ } & {
1608
+ _: {
1609
+ fieldName: "kind";
1610
+ };
1611
+ };
1599
1612
  cursor: ConvexTextBuilderInitial<""> & {
1600
1613
  _: {
1601
1614
  tableName: "aggregate_state";
@@ -1662,7 +1675,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1662
1675
  fieldName: "lastError";
1663
1676
  };
1664
1677
  };
1665
- kind: ConvexTextBuilderInitial<""> & {
1678
+ tableKey: ConvexTextBuilderInitial<""> & {
1666
1679
  _: {
1667
1680
  notNull: true;
1668
1681
  };
@@ -1672,7 +1685,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1672
1685
  };
1673
1686
  } & {
1674
1687
  _: {
1675
- fieldName: "kind";
1688
+ fieldName: "tableKey";
1676
1689
  };
1677
1690
  };
1678
1691
  indexName: ConvexTextBuilderInitial<""> & {
@@ -1714,19 +1727,6 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1714
1727
  fieldName: "metricDefinitionHash";
1715
1728
  };
1716
1729
  };
1717
- tableKey: ConvexTextBuilderInitial<""> & {
1718
- _: {
1719
- notNull: true;
1720
- };
1721
- } & {
1722
- _: {
1723
- tableName: "aggregate_state";
1724
- };
1725
- } & {
1726
- _: {
1727
- fieldName: "tableKey";
1728
- };
1729
- };
1730
1730
  };
1731
1731
  }, {
1732
1732
  by_creation_time: ["_creationTime"];
@@ -1751,20 +1751,25 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1751
1751
  fieldName: "status";
1752
1752
  };
1753
1753
  };
1754
- migrationId: ConvexTextBuilderInitial<""> & {
1754
+ direction: ConvexTextBuilderInitial<""> & {
1755
1755
  _: {
1756
- notNull: true;
1756
+ tableName: "migration_state";
1757
1757
  };
1758
1758
  } & {
1759
+ _: {
1760
+ fieldName: "direction";
1761
+ };
1762
+ };
1763
+ cursor: ConvexTextBuilderInitial<""> & {
1759
1764
  _: {
1760
1765
  tableName: "migration_state";
1761
1766
  };
1762
1767
  } & {
1763
1768
  _: {
1764
- fieldName: "migrationId";
1769
+ fieldName: "cursor";
1765
1770
  };
1766
1771
  };
1767
- checksum: ConvexTextBuilderInitial<""> & {
1772
+ migrationId: ConvexTextBuilderInitial<""> & {
1768
1773
  _: {
1769
1774
  notNull: true;
1770
1775
  };
@@ -1774,10 +1779,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1774
1779
  };
1775
1780
  } & {
1776
1781
  _: {
1777
- fieldName: "checksum";
1782
+ fieldName: "migrationId";
1778
1783
  };
1779
1784
  };
1780
- applied: ConvexBooleanBuilderInitial<""> & {
1785
+ checksum: ConvexTextBuilderInitial<""> & {
1781
1786
  _: {
1782
1787
  notNull: true;
1783
1788
  };
@@ -1787,34 +1792,29 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
1787
1792
  };
1788
1793
  } & {
1789
1794
  _: {
1790
- fieldName: "applied";
1795
+ fieldName: "checksum";
1791
1796
  };
1792
1797
  };
1793
- direction: ConvexTextBuilderInitial<""> & {
1798
+ applied: ConvexBooleanBuilderInitial<""> & {
1794
1799
  _: {
1795
- tableName: "migration_state";
1800
+ notNull: true;
1796
1801
  };
1797
1802
  } & {
1798
- _: {
1799
- fieldName: "direction";
1800
- };
1801
- };
1802
- runId: ConvexTextBuilderInitial<""> & {
1803
1803
  _: {
1804
1804
  tableName: "migration_state";
1805
1805
  };
1806
1806
  } & {
1807
1807
  _: {
1808
- fieldName: "runId";
1808
+ fieldName: "applied";
1809
1809
  };
1810
1810
  };
1811
- cursor: ConvexTextBuilderInitial<""> & {
1811
+ runId: ConvexTextBuilderInitial<""> & {
1812
1812
  _: {
1813
1813
  tableName: "migration_state";
1814
1814
  };
1815
1815
  } & {
1816
1816
  _: {
1817
- fieldName: "cursor";
1817
+ fieldName: "runId";
1818
1818
  };
1819
1819
  };
1820
1820
  processed: ConvexNumberBuilderInitial<""> & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kitcn",
3
- "version": "0.34.0",
3
+ "version": "0.34.1",
4
4
  "description": "kitcn - React Query integration and CLI tools for Convex",
5
5
  "keywords": [
6
6
  "convex",
@@ -56,7 +56,7 @@ export const migration = defineMigration({
56
56
  |-------|------|---------|-------------|
57
57
  | `table` | `string` | — | Table to iterate |
58
58
  | `migrateOne` | `(ctx, doc) => patch \| void` | — | Per-document transform |
59
- | `batchSize` | `number` | `128` (runtime) / `256` (CLI) | Docs per batch |
59
+ | `batchSize` | `number` | `128` | Docs per batch; `--migrations-batch-size` or `kitcn.json` migrations `batchSize` overrides it for every step |
60
60
  | `writeMode` | `'safe_bypass' \| 'normal'` | `'safe_bypass'` | Bypass or run ORM rules/triggers |
61
61
 
62
62
  ### `migrateOne` Context
@@ -105,7 +105,6 @@ Config in `kitcn.json`:
105
105
  "migrations": {
106
106
  "enabled": "auto",
107
107
  "wait": true,
108
- "batchSize": 256,
109
108
  "pollIntervalMs": 1000,
110
109
  "timeoutMs": 900000,
111
110
  "strict": true,