kitcn 0.12.11 → 0.12.13
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/dist/aggregate/index.d.ts +1 -1
- package/dist/auth/generated/index.d.ts +1 -1
- package/dist/auth/index.d.ts +7 -7
- package/dist/{backend-core-DUsUG58E.mjs → backend-core-By8TtoIo.mjs} +169 -27
- package/dist/cli.mjs +114 -6
- package/dist/{generated-contract-disabled-Cf7sqlVD.d.ts → generated-contract-disabled-ngvXLZ4i.d.ts} +1 -1
- package/dist/orm/index.d.ts +1 -1
- package/dist/watcher.mjs +1 -1
- package/dist/{where-clause-compiler-DJ2S06w0.d.ts → where-clause-compiler-CuH2JNxb.d.ts} +73 -73
- package/package.json +1 -1
- package/skills/convex/references/features/auth.md +2 -0
- package/skills/convex/references/setup/auth.md +7 -1
- package/skills/convex/references/setup/index.md +5 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as ConvexNumberBuilderInitial, E as ConvexIdBuilderInitial, N as ConvexCustomBuilderInitial, dn as ConvexTableWithColumns, tr as ConvexTextBuilderInitial } from "../where-clause-compiler-
|
|
1
|
+
import { C as ConvexNumberBuilderInitial, E as ConvexIdBuilderInitial, N as ConvexCustomBuilderInitial, dn as ConvexTableWithColumns, tr as ConvexTextBuilderInitial } from "../where-clause-compiler-CuH2JNxb.js";
|
|
2
2
|
import * as convex_values0 from "convex/values";
|
|
3
3
|
import { GenericId, Infer, Value } from "convex/values";
|
|
4
4
|
import { DocumentByName, GenericDataModel, GenericDatabaseReader, GenericDatabaseWriter, TableNamesInDataModel } from "convex/server";
|
|
@@ -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-
|
|
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-ngvXLZ4i.js";
|
|
2
2
|
export { type AuthRuntime, BetterAuthOptionsWithoutDatabase, type GeneratedAuthDisabledReasonKind, GenericAuthBeforeResult, GenericAuthDefinition, GenericAuthTriggerChange, GenericAuthTriggerHandlers, GenericAuthTriggers, createDisabledAuthRuntime, defineAuth, getGeneratedAuthDisabledReason };
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as QueryCtxWithPreferredOrmQueryTable, n as LookupByIdResultByCtx, t as DocByCtx } from "../query-context-CFZqIvD7.js";
|
|
2
2
|
import { t as GetAuth } from "../types-BiJE7qxR.js";
|
|
3
3
|
import { t as GenericCtx } from "../context-utils-HPC5nXzx.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-
|
|
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-ngvXLZ4i.js";
|
|
5
5
|
import * as convex_values0 from "convex/values";
|
|
6
6
|
import { Infer } from "convex/values";
|
|
7
7
|
import { DocumentByName, GenericDataModel, GenericMutationCtx, GenericQueryCtx, GenericSchema, PaginationOptions, PaginationResult, SchemaDefinition, TableNamesInDataModel } from "convex/server";
|
|
@@ -112,7 +112,7 @@ declare const adapterWhereValidator: convex_values0.VObject<{
|
|
|
112
112
|
field: convex_values0.VString<string, "required">;
|
|
113
113
|
operator: convex_values0.VUnion<"eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "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>;
|
|
114
114
|
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>;
|
|
115
|
-
}, "required", "
|
|
115
|
+
}, "required", "operator" | "value" | "field" | "connector">;
|
|
116
116
|
declare const adapterArgsValidator: convex_values0.VObject<{
|
|
117
117
|
limit?: number | undefined;
|
|
118
118
|
where?: {
|
|
@@ -124,8 +124,8 @@ declare const adapterArgsValidator: convex_values0.VObject<{
|
|
|
124
124
|
select?: string[] | undefined;
|
|
125
125
|
offset?: number | undefined;
|
|
126
126
|
sortBy?: {
|
|
127
|
-
direction: "asc" | "desc";
|
|
128
127
|
field: string;
|
|
128
|
+
direction: "asc" | "desc";
|
|
129
129
|
} | undefined;
|
|
130
130
|
model: string;
|
|
131
131
|
}, {
|
|
@@ -134,12 +134,12 @@ declare const adapterArgsValidator: convex_values0.VObject<{
|
|
|
134
134
|
offset: convex_values0.VFloat64<number | undefined, "optional">;
|
|
135
135
|
select: convex_values0.VArray<string[] | undefined, convex_values0.VString<string, "required">, "optional">;
|
|
136
136
|
sortBy: convex_values0.VObject<{
|
|
137
|
-
direction: "asc" | "desc";
|
|
138
137
|
field: string;
|
|
138
|
+
direction: "asc" | "desc";
|
|
139
139
|
} | undefined, {
|
|
140
140
|
direction: convex_values0.VUnion<"asc" | "desc", [convex_values0.VLiteral<"asc", "required">, convex_values0.VLiteral<"desc", "required">], "required", never>;
|
|
141
141
|
field: convex_values0.VString<string, "required">;
|
|
142
|
-
}, "optional", "
|
|
142
|
+
}, "optional", "field" | "direction">;
|
|
143
143
|
where: convex_values0.VArray<{
|
|
144
144
|
operator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
145
145
|
connector?: "AND" | "OR" | undefined;
|
|
@@ -155,8 +155,8 @@ declare const adapterArgsValidator: convex_values0.VObject<{
|
|
|
155
155
|
field: convex_values0.VString<string, "required">;
|
|
156
156
|
operator: convex_values0.VUnion<"eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "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>;
|
|
157
157
|
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>;
|
|
158
|
-
}, "required", "
|
|
159
|
-
}, "required", "limit" | "where" | "model" | "select" | "offset" | "sortBy" | "sortBy.
|
|
158
|
+
}, "required", "operator" | "value" | "field" | "connector">, "optional">;
|
|
159
|
+
}, "required", "limit" | "where" | "model" | "select" | "offset" | "sortBy" | "sortBy.field" | "sortBy.direction">;
|
|
160
160
|
declare const hasUniqueFields: (betterAuthSchema: BetterAuthDBSchema, model: string, input: Record<string, any>) => boolean;
|
|
161
161
|
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>;
|
|
162
162
|
declare const selectFields: <T extends TableNamesInDataModel<GenericDataModel>, D extends DocumentByName<GenericDataModel, T>>(doc: D | null, select?: string[]) => D | null;
|
|
@@ -7,12 +7,12 @@ import { createHash, randomBytes } from "node:crypto";
|
|
|
7
7
|
import { confirm, isCancel, multiselect, select, spinner } from "@clack/prompts";
|
|
8
8
|
import { parse } from "dotenv";
|
|
9
9
|
import { execa } from "execa";
|
|
10
|
-
import { createJiti } from "jiti";
|
|
11
10
|
import { v } from "convex/values";
|
|
12
11
|
import "convex/server";
|
|
13
12
|
import { createInterface } from "node:readline/promises";
|
|
14
13
|
import { build } from "esbuild";
|
|
15
14
|
import { createColors } from "picocolors";
|
|
15
|
+
import { createJiti } from "jiti";
|
|
16
16
|
import os from "node:os";
|
|
17
17
|
import { parse as parse$1 } from "@babel/parser";
|
|
18
18
|
|
|
@@ -2195,6 +2195,161 @@ const highlighter = {
|
|
|
2195
2195
|
}
|
|
2196
2196
|
};
|
|
2197
2197
|
|
|
2198
|
+
//#endregion
|
|
2199
|
+
//#region src/cli/utils/project-jiti.ts
|
|
2200
|
+
const JITI_EXPORT_CONDITION_PRIORITY = [
|
|
2201
|
+
"bun",
|
|
2202
|
+
"import",
|
|
2203
|
+
"module",
|
|
2204
|
+
"default",
|
|
2205
|
+
"require"
|
|
2206
|
+
];
|
|
2207
|
+
const SERVER_PARSER_SHIM_SOURCE = `const createProcedureBuilder = () => {
|
|
2208
|
+
const builder = {
|
|
2209
|
+
internal() {
|
|
2210
|
+
return builder;
|
|
2211
|
+
},
|
|
2212
|
+
use() {
|
|
2213
|
+
return builder;
|
|
2214
|
+
},
|
|
2215
|
+
meta() {
|
|
2216
|
+
return builder;
|
|
2217
|
+
},
|
|
2218
|
+
input() {
|
|
2219
|
+
return builder;
|
|
2220
|
+
},
|
|
2221
|
+
output() {
|
|
2222
|
+
return builder;
|
|
2223
|
+
},
|
|
2224
|
+
query(handler) {
|
|
2225
|
+
return {
|
|
2226
|
+
_crpcMeta: { type: "query" },
|
|
2227
|
+
_handler: handler,
|
|
2228
|
+
};
|
|
2229
|
+
},
|
|
2230
|
+
mutation(handler) {
|
|
2231
|
+
return {
|
|
2232
|
+
_crpcMeta: { type: "mutation" },
|
|
2233
|
+
_handler: handler,
|
|
2234
|
+
};
|
|
2235
|
+
},
|
|
2236
|
+
action(handler) {
|
|
2237
|
+
return {
|
|
2238
|
+
_crpcMeta: { type: "action" },
|
|
2239
|
+
_handler: handler,
|
|
2240
|
+
};
|
|
2241
|
+
},
|
|
2242
|
+
};
|
|
2243
|
+
|
|
2244
|
+
return builder;
|
|
2245
|
+
};
|
|
2246
|
+
|
|
2247
|
+
export const initCRPC = {
|
|
2248
|
+
meta() {
|
|
2249
|
+
return this;
|
|
2250
|
+
},
|
|
2251
|
+
dataModel() {
|
|
2252
|
+
return this;
|
|
2253
|
+
},
|
|
2254
|
+
context() {
|
|
2255
|
+
return this;
|
|
2256
|
+
},
|
|
2257
|
+
create() {
|
|
2258
|
+
return {
|
|
2259
|
+
query: createProcedureBuilder(),
|
|
2260
|
+
mutation: createProcedureBuilder(),
|
|
2261
|
+
action: createProcedureBuilder(),
|
|
2262
|
+
httpAction: createProcedureBuilder(),
|
|
2263
|
+
router: (record = {}) => record,
|
|
2264
|
+
};
|
|
2265
|
+
},
|
|
2266
|
+
};
|
|
2267
|
+
|
|
2268
|
+
export class CRPCError extends Error {
|
|
2269
|
+
constructor(options = {}) {
|
|
2270
|
+
super(options.message ?? options.code ?? "CRPC error");
|
|
2271
|
+
this.code = options.code;
|
|
2272
|
+
}
|
|
2273
|
+
}
|
|
2274
|
+
|
|
2275
|
+
export const createEnv = ({ schema }) => () =>
|
|
2276
|
+
typeof schema?.parse === "function" ? schema.parse(process.env) : process.env;
|
|
2277
|
+
export const createHttpRouter = (_app, httpRouter) => httpRouter ?? {};
|
|
2278
|
+
export const createCallerFactory = () => () => ({});
|
|
2279
|
+
export const createApiLeaf = (fnOrRoot, pathOrMeta, maybeMeta) => {
|
|
2280
|
+
const meta = maybeMeta ?? pathOrMeta;
|
|
2281
|
+
const fn = Array.isArray(pathOrMeta)
|
|
2282
|
+
? pathOrMeta.reduce((current, segment) => current?.[segment], fnOrRoot)
|
|
2283
|
+
: fnOrRoot;
|
|
2284
|
+
return Object.assign(fn ?? {}, meta ?? {}, { functionRef: fn });
|
|
2285
|
+
};
|
|
2286
|
+
export const createGeneratedFunctionReference = (name) => ({
|
|
2287
|
+
[Symbol.for("functionName")]: name,
|
|
2288
|
+
});
|
|
2289
|
+
export const typedProcedureResolver = (_functionRef, resolver) => resolver;
|
|
2290
|
+
export const createGeneratedRegistryRuntime = () => ({
|
|
2291
|
+
getCallerFactory() {
|
|
2292
|
+
return () => ({});
|
|
2293
|
+
},
|
|
2294
|
+
getHandlerFactory() {
|
|
2295
|
+
return () => ({});
|
|
2296
|
+
},
|
|
2297
|
+
});
|
|
2298
|
+
`;
|
|
2299
|
+
const resolveJitiExportTarget = (target) => {
|
|
2300
|
+
if (typeof target === "string") return target;
|
|
2301
|
+
if (Array.isArray(target)) {
|
|
2302
|
+
for (const entry of target) {
|
|
2303
|
+
const resolved = resolveJitiExportTarget(entry);
|
|
2304
|
+
if (resolved) return resolved;
|
|
2305
|
+
}
|
|
2306
|
+
return null;
|
|
2307
|
+
}
|
|
2308
|
+
if (!target || typeof target !== "object") return null;
|
|
2309
|
+
const record = target;
|
|
2310
|
+
for (const condition of JITI_EXPORT_CONDITION_PRIORITY) {
|
|
2311
|
+
const resolved = resolveJitiExportTarget(record[condition]);
|
|
2312
|
+
if (resolved) return resolved;
|
|
2313
|
+
}
|
|
2314
|
+
for (const value of Object.values(record)) {
|
|
2315
|
+
const resolved = resolveJitiExportTarget(value);
|
|
2316
|
+
if (resolved) return resolved;
|
|
2317
|
+
}
|
|
2318
|
+
return null;
|
|
2319
|
+
};
|
|
2320
|
+
const buildLocalPackageExportAliases = (cwd, packageName) => {
|
|
2321
|
+
const packageDir = path.join(cwd, "node_modules", ...packageName.split("/"));
|
|
2322
|
+
const packageJsonPath = path.join(packageDir, "package.json");
|
|
2323
|
+
if (!fs.existsSync(packageJsonPath)) return {};
|
|
2324
|
+
const exportsField = JSON.parse(fs.readFileSync(packageJsonPath, "utf8")).exports;
|
|
2325
|
+
if (!exportsField || typeof exportsField !== "object" || Array.isArray(exportsField)) return {};
|
|
2326
|
+
const aliases = {};
|
|
2327
|
+
for (const [exportKey, exportTarget] of Object.entries(exportsField)) {
|
|
2328
|
+
const resolvedTarget = resolveJitiExportTarget(exportTarget);
|
|
2329
|
+
if (!resolvedTarget || !resolvedTarget.startsWith("./")) continue;
|
|
2330
|
+
const specifier = exportKey === "." ? packageName : exportKey.startsWith("./") ? `${packageName}${exportKey.slice(1)}` : null;
|
|
2331
|
+
if (!specifier) continue;
|
|
2332
|
+
aliases[specifier] = path.join(packageDir, resolvedTarget);
|
|
2333
|
+
}
|
|
2334
|
+
return aliases;
|
|
2335
|
+
};
|
|
2336
|
+
const ensureServerParserShim = (cwd) => {
|
|
2337
|
+
const shimDir = path.join(cwd, "node_modules", ".kitcn");
|
|
2338
|
+
const shimPath = path.join(shimDir, "project-jiti-server-shim.mjs");
|
|
2339
|
+
fs.mkdirSync(shimDir, { recursive: true });
|
|
2340
|
+
if (!fs.existsSync(shimPath) || fs.readFileSync(shimPath, "utf8") !== SERVER_PARSER_SHIM_SOURCE) fs.writeFileSync(shimPath, SERVER_PARSER_SHIM_SOURCE, "utf8");
|
|
2341
|
+
return shimPath;
|
|
2342
|
+
};
|
|
2343
|
+
const createProjectJiti = (cwd = process.cwd()) => createJiti(cwd, {
|
|
2344
|
+
interopDefault: true,
|
|
2345
|
+
moduleCache: false,
|
|
2346
|
+
alias: {
|
|
2347
|
+
...buildLocalPackageExportAliases(cwd, "kitcn"),
|
|
2348
|
+
...buildLocalPackageExportAliases(cwd, "convex"),
|
|
2349
|
+
"kitcn/server": ensureServerParserShim(cwd)
|
|
2350
|
+
}
|
|
2351
|
+
});
|
|
2352
|
+
|
|
2198
2353
|
//#endregion
|
|
2199
2354
|
//#region src/cli/analyze.ts
|
|
2200
2355
|
const MB = 1024 * 1024;
|
|
@@ -2427,10 +2582,7 @@ const listConvexHandlerExports = async (entryPoint, jitiInstance) => {
|
|
|
2427
2582
|
const scanHandlerExportsByEntry = async (entryPoints) => {
|
|
2428
2583
|
globalThis.__KITCN_CODEGEN__ = true;
|
|
2429
2584
|
try {
|
|
2430
|
-
const jitiInstance =
|
|
2431
|
-
interopDefault: true,
|
|
2432
|
-
moduleCache: false
|
|
2433
|
-
});
|
|
2585
|
+
const jitiInstance = createProjectJiti();
|
|
2434
2586
|
const results = await Promise.all(entryPoints.map(async (entryPoint) => ({
|
|
2435
2587
|
entryPoint,
|
|
2436
2588
|
exportNames: await listConvexHandlerExports(entryPoint, jitiInstance)
|
|
@@ -4166,10 +4318,7 @@ async function resolveSchemaMetadataForCodegen(functionsDir, debug) {
|
|
|
4166
4318
|
hasRelations: false,
|
|
4167
4319
|
hasTriggers: false
|
|
4168
4320
|
};
|
|
4169
|
-
const jitiInstance =
|
|
4170
|
-
interopDefault: true,
|
|
4171
|
-
moduleCache: false
|
|
4172
|
-
});
|
|
4321
|
+
const jitiInstance = createProjectJiti();
|
|
4173
4322
|
try {
|
|
4174
4323
|
const schemaModule = await jitiInstance.import(schemaPath);
|
|
4175
4324
|
const schemaValue = schemaModule && typeof schemaModule === "object" ? schemaModule.default ?? schemaModule : null;
|
|
@@ -4803,10 +4952,7 @@ async function generateMeta(sharedDir, options) {
|
|
|
4803
4952
|
if (generateApi) {
|
|
4804
4953
|
globalThis.__KITCN_CODEGEN__ = true;
|
|
4805
4954
|
try {
|
|
4806
|
-
const jitiInstance =
|
|
4807
|
-
interopDefault: true,
|
|
4808
|
-
moduleCache: false
|
|
4809
|
-
});
|
|
4955
|
+
const jitiInstance = createProjectJiti();
|
|
4810
4956
|
const files = listFilesRecursive(functionsDir).filter((file) => file.endsWith(".ts") && isValidConvexFile(file));
|
|
4811
4957
|
const existingRuntimeFilesBeforeParse = new Set(listGeneratedRuntimeFiles(functionsDir));
|
|
4812
4958
|
const runtimePlaceholderModules = [...new Set([
|
|
@@ -6465,10 +6611,7 @@ const readPluginRootSchemaOwnership = (value) => {
|
|
|
6465
6611
|
const resolveSchemaInstalledPlugins = async (functionsDir) => {
|
|
6466
6612
|
const schemaPath = getSchemaFilePath(functionsDir);
|
|
6467
6613
|
if (!fs.existsSync(schemaPath)) return [];
|
|
6468
|
-
const jiti =
|
|
6469
|
-
interopDefault: true,
|
|
6470
|
-
moduleCache: false
|
|
6471
|
-
});
|
|
6614
|
+
const jiti = createProjectJiti();
|
|
6472
6615
|
try {
|
|
6473
6616
|
const schemaModule = await jiti.import(schemaPath);
|
|
6474
6617
|
const schemaValue = schemaModule && typeof schemaModule === "object" ? schemaModule.default ?? schemaModule : null;
|
|
@@ -9072,10 +9215,7 @@ const loadAuthOptionsFromDefinition = async (authDefinitionPath) => {
|
|
|
9072
9215
|
fs.writeFileSync(tempAuthPath, authSource.replaceAll(GENERATED_AUTH_IMPORT_RE, `./generated/${tempGeneratedAuthBase}`), "utf8");
|
|
9073
9216
|
}
|
|
9074
9217
|
try {
|
|
9075
|
-
const authModule = await
|
|
9076
|
-
interopDefault: true,
|
|
9077
|
-
moduleCache: false
|
|
9078
|
-
}).import(importPath);
|
|
9218
|
+
const authModule = await createProjectJiti().import(importPath);
|
|
9079
9219
|
const authDefinition = authModule && typeof authModule === "object" ? authModule.default : null;
|
|
9080
9220
|
if (typeof authDefinition !== "function") return null;
|
|
9081
9221
|
const authOptions = authDefinition({});
|
|
@@ -12327,6 +12467,11 @@ const CONVEX_DEPLOYMENT_ENV_KEYS = [
|
|
|
12327
12467
|
"CONVEX_SELF_HOSTED_ADMIN_KEY"
|
|
12328
12468
|
];
|
|
12329
12469
|
const LOCAL_CONVEX_DEPLOYMENT_PREFIXES = ["local:", "anonymous:"];
|
|
12470
|
+
const LOCAL_CONVEX_DEPLOYMENT_VALUES = ["anonymous-agent"];
|
|
12471
|
+
function isLocalConvexDeploymentValue(deployment) {
|
|
12472
|
+
if (!deployment) return false;
|
|
12473
|
+
return LOCAL_CONVEX_DEPLOYMENT_VALUES.includes(deployment) || LOCAL_CONVEX_DEPLOYMENT_PREFIXES.some((prefix) => deployment.startsWith(prefix));
|
|
12474
|
+
}
|
|
12330
12475
|
function createBackendCommandEnv(overrides) {
|
|
12331
12476
|
const clearedDeploymentEnv = Object.fromEntries(CONVEX_DEPLOYMENT_ENV_KEYS.map((key) => [key, void 0]));
|
|
12332
12477
|
return {
|
|
@@ -12337,7 +12482,7 @@ function createBackendCommandEnv(overrides) {
|
|
|
12337
12482
|
}
|
|
12338
12483
|
function hasRemoteConvexDeploymentEnv(env) {
|
|
12339
12484
|
const deployment = env.CONVEX_DEPLOYMENT?.trim();
|
|
12340
|
-
if (deployment && !
|
|
12485
|
+
if (deployment && !isLocalConvexDeploymentValue(deployment)) return true;
|
|
12341
12486
|
return Boolean(env.CONVEX_DEPLOY_KEY?.trim() || env.CONVEX_SELF_HOSTED_URL?.trim() || env.CONVEX_SELF_HOSTED_ADMIN_KEY?.trim());
|
|
12342
12487
|
}
|
|
12343
12488
|
function readConvexTargetEnvFile(args, cwd = process.cwd()) {
|
|
@@ -13727,10 +13872,7 @@ function buildAggregateFingerprintPayload(tables) {
|
|
|
13727
13872
|
async function computeAggregateIndexFingerprint(functionsDir) {
|
|
13728
13873
|
const schemaPath = join(functionsDir, "schema.ts");
|
|
13729
13874
|
if (!fs.existsSync(schemaPath)) return null;
|
|
13730
|
-
const schemaModule = await
|
|
13731
|
-
interopDefault: true,
|
|
13732
|
-
moduleCache: false
|
|
13733
|
-
}).import(schemaPath);
|
|
13875
|
+
const schemaModule = await createProjectJiti().import(schemaPath);
|
|
13734
13876
|
if (!schemaModule || typeof schemaModule !== "object") return null;
|
|
13735
13877
|
const schemaValue = resolveSchemaDefaultExport(schemaModule);
|
|
13736
13878
|
if (!schemaValue) return null;
|
|
@@ -14926,4 +15068,4 @@ function isEntryPoint(entry, filename) {
|
|
|
14926
15068
|
}
|
|
14927
15069
|
|
|
14928
15070
|
//#endregion
|
|
14929
|
-
export {
|
|
15071
|
+
export { resolvePluginPreset as $, resolveConfiguredBackend as A, runConvexInitIfNeeded as B, isInitialized as C, getConvexConfig as Ct, readPackageVersions as D, parseInitCommandArgs as E, runAfterScaffoldScript as F, trackProcess as G, runInitCommandFlow as H, runAggregateBackfillFlow as I, collectPluginScaffoldTemplates as J, withWorkingDirectory as K, runAggregatePruneFlow as L, resolveInitProjectDir as M, resolveMigrationConfig as N, resolveBackfillConfig as O, resolveRunDeps as P, resolveAddTemplateDefaults as Q, runBackendFunction as R, isEntryPoint as S, generateMeta as St, parseBackendRunJson as T, highlighter as Tt, runMigrationCreate as U, runDevSchemaBackfillIfNeeded as V, runMigrationFlow as W, promptForPluginSelection as X, filterScaffoldTemplatePathMap as Y, promptForScaffoldTemplateSelection as Z, formatInfoOutput as _, inspectPluginDependencyInstall as _t, cleanup as a, isSupportedPluginKey as at, hasRemoteConvexDeploymentEnv as b, serializeEnvValue as bt, createCommandEnv as c, assertSchemaFileExists as ct, extractBackfillCliOptions as d, getSchemaFilePath as dt, resolvePresetScaffoldTemplates as et, extractConcaveRunTargetArgs as f, readPluginLockfile as ft, formatDocsOutput as g, applyPluginDependencyInstall as gt, extractResetCliOptions as h, applyPlanningDependencyInstall as ht, buildInitializationPlan as i, getSupportedPluginKeys as it, resolveDocTopic as j, resolveCodegenTrimSegments as k, ensureConvexGitignoreEntry as l, collectInstalledPluginKeys as lt, extractMigrationDownOptions as m, applyDependencyHintsInstall as mt, applyPluginInstallPlanFiles as n, resolveTemplatesByIdOrThrow as nt, createBackendAdapter as o, buildPluginInstallPlan as ot, extractMigrationCliOptions as p, resolveSchemaInstalledPlugins as pt, createSpinner as q, assertNoRemovedDevPreRunFlag as r, getPluginCatalogEntry as rt, createBackendCommandEnv as s, resolvePluginScaffoldRoots as st, applyDependencyInstallPlan as t, resolveTemplateSelectionSource as tt, extractBackendRunTargetArgs as u, getPluginLockfilePath as ut, getAggregateBackfillDeploymentKey as v, resolveProjectScaffoldContext as vt, parseArgs as w, logger as wt, isConvexDevPreRunConflictFlag as x, stripConvexCommandNoise as xt, getDevAggregateBackfillStatePath as y, resolveAuthEnvState as yt, runConfiguredCodegen as z };
|
package/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { $ as
|
|
2
|
+
import { $ as resolvePluginPreset, A as resolveConfiguredBackend, B as runConvexInitIfNeeded, C as isInitialized, D as readPackageVersions, E as parseInitCommandArgs, F as runAfterScaffoldScript, G as trackProcess, H as runInitCommandFlow, I as runAggregateBackfillFlow, J as collectPluginScaffoldTemplates, K as withWorkingDirectory, L as runAggregatePruneFlow, M as resolveInitProjectDir, N as resolveMigrationConfig, O as resolveBackfillConfig, P as resolveRunDeps, Q as resolveAddTemplateDefaults, R as runBackendFunction, S as isEntryPoint, T as parseBackendRunJson, Tt as highlighter, U as runMigrationCreate, V as runDevSchemaBackfillIfNeeded, W as runMigrationFlow, X as promptForPluginSelection, Y as filterScaffoldTemplatePathMap, Z as promptForScaffoldTemplateSelection, _ as formatInfoOutput, _t as inspectPluginDependencyInstall, a as cleanup, at as isSupportedPluginKey, b as hasRemoteConvexDeploymentEnv, bt as serializeEnvValue, c as createCommandEnv, ct as assertSchemaFileExists, d as extractBackfillCliOptions, dt as getSchemaFilePath, et as resolvePresetScaffoldTemplates, f as extractConcaveRunTargetArgs, ft as readPluginLockfile, g as formatDocsOutput, gt as applyPluginDependencyInstall, h as extractResetCliOptions, ht as applyPlanningDependencyInstall, i as buildInitializationPlan, it as getSupportedPluginKeys, j as resolveDocTopic, k as resolveCodegenTrimSegments, l as ensureConvexGitignoreEntry, lt as collectInstalledPluginKeys, m as extractMigrationDownOptions, mt as applyDependencyHintsInstall, n as applyPluginInstallPlanFiles, nt as resolveTemplatesByIdOrThrow, o as createBackendAdapter, ot as buildPluginInstallPlan, p as extractMigrationCliOptions, pt as resolveSchemaInstalledPlugins, q as createSpinner, r as assertNoRemovedDevPreRunFlag, rt as getPluginCatalogEntry, s as createBackendCommandEnv, st as resolvePluginScaffoldRoots, t as applyDependencyInstallPlan, tt as resolveTemplateSelectionSource, u as extractBackendRunTargetArgs, ut as getPluginLockfilePath, v as getAggregateBackfillDeploymentKey, vt as resolveProjectScaffoldContext, w as parseArgs, wt as logger, x as isConvexDevPreRunConflictFlag, xt as stripConvexCommandNoise, y as getDevAggregateBackfillStatePath, yt as resolveAuthEnvState, z as runConfiguredCodegen } from "./backend-core-By8TtoIo.mjs";
|
|
3
3
|
import fs, { existsSync, readFileSync } from "node:fs";
|
|
4
4
|
import path, { delimiter, dirname, join, relative, resolve } from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
@@ -322,7 +322,7 @@ const serializeDryRunPlan = (plan) => {
|
|
|
322
322
|
//#region src/cli/commands/dev.ts
|
|
323
323
|
const __filename$1 = fileURLToPath(import.meta.url);
|
|
324
324
|
const __dirname = dirname(__filename$1);
|
|
325
|
-
const HELP_FLAGS$
|
|
325
|
+
const HELP_FLAGS$11 = new Set(["--help", "-h"]);
|
|
326
326
|
const LOCAL_CONCAVE_HOST = "127.0.0.1";
|
|
327
327
|
const LOCAL_CONCAVE_DEV_PORT = 3210;
|
|
328
328
|
const LOCAL_CONCAVE_SITE_PORT = 3211;
|
|
@@ -652,6 +652,12 @@ function resolveImplicitConvexRemoteDeploymentEnv(cwd = process.cwd()) {
|
|
|
652
652
|
CONVEX_SELF_HOSTED_ADMIN_KEY: parsed.CONVEX_SELF_HOSTED_ADMIN_KEY
|
|
653
653
|
};
|
|
654
654
|
}
|
|
655
|
+
function resolveImplicitConvexAnonymousAgentMode(cwd = process.cwd()) {
|
|
656
|
+
const envLocalPath = join(cwd, ".env.local");
|
|
657
|
+
if (!fs.existsSync(envLocalPath)) return;
|
|
658
|
+
const deployment = parseEnv(fs.readFileSync(envLocalPath, "utf8")).CONVEX_DEPLOYMENT?.trim();
|
|
659
|
+
if (deployment === "anonymous-agent" || deployment?.startsWith("anonymous:")) return "anonymous";
|
|
660
|
+
}
|
|
655
661
|
function resolveConvexEnvFileCommandEnv(args, cwd = process.cwd()) {
|
|
656
662
|
let envFilePath = null;
|
|
657
663
|
for (let i = 0; i < args.length; i += 1) {
|
|
@@ -851,7 +857,7 @@ Options:
|
|
|
851
857
|
--no-migrations-wait Skip waiting for migration completion`;
|
|
852
858
|
const handleDevCommand = async (argv, deps) => {
|
|
853
859
|
const parsed = parseArgs(argv);
|
|
854
|
-
if (HELP_FLAGS$
|
|
860
|
+
if (HELP_FLAGS$11.has(argv[0] ?? "") || HELP_FLAGS$11.has(parsed.restArgs[0] ?? "")) {
|
|
855
861
|
logger.write(DEV_HELP_TEXT);
|
|
856
862
|
return 0;
|
|
857
863
|
}
|
|
@@ -874,6 +880,7 @@ const handleDevCommand = async (argv, deps) => {
|
|
|
874
880
|
const explicitConvexTargetArgs = extractBackendRunTargetArgs("convex", convexDevArgs);
|
|
875
881
|
const explicitConvexCommandEnv = resolveConvexEnvFileCommandEnv(convexDevArgs);
|
|
876
882
|
const implicitConvexCommandEnv = backend === "convex" && explicitConvexTargetArgs.length === 0 && explicitConvexCommandEnv === null ? resolveImplicitConvexRemoteDeploymentEnv() : null;
|
|
883
|
+
const implicitConvexAgentMode = backend === "convex" && explicitConvexTargetArgs.length === 0 && !explicitConvexCommandEnv?.CONVEX_AGENT_MODE && !implicitConvexCommandEnv?.CONVEX_AGENT_MODE ? resolveImplicitConvexAnonymousAgentMode() : void 0;
|
|
877
884
|
const effectiveConvexCommandEnv = explicitConvexCommandEnv ?? implicitConvexCommandEnv;
|
|
878
885
|
const preRunFunction = config.dev.preRun;
|
|
879
886
|
if (bootstrap && backend !== "convex") throw new Error("`kitcn dev --bootstrap` is only supported for backend convex.");
|
|
@@ -919,7 +926,8 @@ const handleDevCommand = async (argv, deps) => {
|
|
|
919
926
|
echoOutput: false,
|
|
920
927
|
env: {
|
|
921
928
|
...localNodeEnvOverrides,
|
|
922
|
-
...effectiveConvexCommandEnv
|
|
929
|
+
...effectiveConvexCommandEnv,
|
|
930
|
+
...implicitConvexAgentMode ? { CONVEX_AGENT_MODE: implicitConvexAgentMode } : {}
|
|
923
931
|
},
|
|
924
932
|
targetArgs
|
|
925
933
|
});
|
|
@@ -970,6 +978,7 @@ const handleDevCommand = async (argv, deps) => {
|
|
|
970
978
|
env: createBackendCommandEnv({
|
|
971
979
|
...localNodeEnvOverrides,
|
|
972
980
|
...effectiveConvexCommandEnv,
|
|
981
|
+
...implicitConvexAgentMode ? { CONVEX_AGENT_MODE: implicitConvexAgentMode } : {},
|
|
973
982
|
...concaveLocalDevContract?.backendEnv
|
|
974
983
|
}),
|
|
975
984
|
reject: false
|
|
@@ -1169,7 +1178,7 @@ const handleDevCommand = async (argv, deps) => {
|
|
|
1169
1178
|
|
|
1170
1179
|
//#endregion
|
|
1171
1180
|
//#region src/cli/commands/add.ts
|
|
1172
|
-
const HELP_FLAGS$
|
|
1181
|
+
const HELP_FLAGS$10 = new Set(["--help", "-h"]);
|
|
1173
1182
|
const RAW_CONVEX_AUTH_PRESET = "convex";
|
|
1174
1183
|
const AUTH_SCHEMA_ONLY_SCOPE = "schema";
|
|
1175
1184
|
const AUTH_SCHEMA_FLAG = "--schema";
|
|
@@ -1340,7 +1349,7 @@ const assertRawConvexAuthDeploymentReady = () => {
|
|
|
1340
1349
|
};
|
|
1341
1350
|
const handleAddCommand = async (argv, deps = {}) => {
|
|
1342
1351
|
const parsed = parseArgs(argv);
|
|
1343
|
-
if (HELP_FLAGS$
|
|
1352
|
+
if (HELP_FLAGS$10.has(argv[0] ?? "") || HELP_FLAGS$10.has(parsed.restArgs[0] ?? "")) {
|
|
1344
1353
|
logger.write(ADD_HELP_TEXT);
|
|
1345
1354
|
return 0;
|
|
1346
1355
|
}
|
|
@@ -1599,6 +1608,102 @@ const handleAnalyzeCommand = async (argv, deps = {}) => {
|
|
|
1599
1608
|
return runAnalyze(parsed.restArgs);
|
|
1600
1609
|
};
|
|
1601
1610
|
|
|
1611
|
+
//#endregion
|
|
1612
|
+
//#region src/cli/commands/auth.ts
|
|
1613
|
+
const HELP_FLAGS$9 = new Set(["--help", "-h"]);
|
|
1614
|
+
const AUTH_JWKS_FUNCTION = "generated/auth:getLatestJwks";
|
|
1615
|
+
const AUTH_ROTATE_KEYS_FUNCTION = "generated/auth:rotateKeys";
|
|
1616
|
+
const AUTH_HELP_TEXT = `Usage: kitcn auth jwks [options]
|
|
1617
|
+
|
|
1618
|
+
Commands:
|
|
1619
|
+
jwks Print a manual JWKS env payload from the auth runtime
|
|
1620
|
+
|
|
1621
|
+
Options:
|
|
1622
|
+
--rotate Rotate auth keys before fetching JWKS
|
|
1623
|
+
--json Machine-readable output
|
|
1624
|
+
|
|
1625
|
+
Target options:
|
|
1626
|
+
Convex: --prod --deployment-name <name> --preview-name <name> --env-file <path> --component <name>
|
|
1627
|
+
Concave: --url <url> --port <port> --component <name>`;
|
|
1628
|
+
const parseAuthCommandArgs = (args) => {
|
|
1629
|
+
const subcommand = args[0];
|
|
1630
|
+
if (!subcommand) throw new Error("Missing auth command. Usage: `kitcn auth jwks`.");
|
|
1631
|
+
if (subcommand !== "jwks") throw new Error(`Unknown auth command "${subcommand}". Supported commands: jwks.`);
|
|
1632
|
+
let json = false;
|
|
1633
|
+
let rotate = false;
|
|
1634
|
+
const targetRemainder = [];
|
|
1635
|
+
for (const arg of args.slice(1)) {
|
|
1636
|
+
if (arg === "--json") {
|
|
1637
|
+
json = true;
|
|
1638
|
+
continue;
|
|
1639
|
+
}
|
|
1640
|
+
if (arg === "--rotate") {
|
|
1641
|
+
rotate = true;
|
|
1642
|
+
continue;
|
|
1643
|
+
}
|
|
1644
|
+
targetRemainder.push(arg);
|
|
1645
|
+
}
|
|
1646
|
+
return {
|
|
1647
|
+
json,
|
|
1648
|
+
rotate,
|
|
1649
|
+
subcommand,
|
|
1650
|
+
targetRemainder
|
|
1651
|
+
};
|
|
1652
|
+
};
|
|
1653
|
+
const formatRelativePath = (cwd, filePath) => path.relative(cwd, filePath).replaceAll("\\", "/") || ".";
|
|
1654
|
+
const assertAuthRuntimeReady = (sharedDir) => {
|
|
1655
|
+
const cwd = process.cwd();
|
|
1656
|
+
const authState = resolveAuthEnvState({
|
|
1657
|
+
cwd,
|
|
1658
|
+
sharedDir
|
|
1659
|
+
});
|
|
1660
|
+
if (!authState.installed) throw new Error(`Auth JWKS export requires auth scaffold at ${formatRelativePath(cwd, authState.definitionPath)}. Install auth first.`);
|
|
1661
|
+
if (!authState.runtimeReady) throw new Error(`Auth JWKS export requires generated auth runtime at ${formatRelativePath(cwd, authState.generatedPath)}. Run \`kitcn codegen\` or \`kitcn dev --bootstrap\` first.`);
|
|
1662
|
+
};
|
|
1663
|
+
const parseRunValue = (stdout) => {
|
|
1664
|
+
const parsed = parseBackendRunJson(stdout);
|
|
1665
|
+
return typeof parsed === "string" ? parsed : JSON.stringify(parsed);
|
|
1666
|
+
};
|
|
1667
|
+
const handleAuthCommand = async (argv, deps = {}) => {
|
|
1668
|
+
const parsed = parseArgs(argv);
|
|
1669
|
+
if (argv.length === 0 || HELP_FLAGS$9.has(argv[0] ?? "") || parsed.restArgs.length === 0 || parsed.restArgs.some((arg) => HELP_FLAGS$9.has(arg))) {
|
|
1670
|
+
logger.write(AUTH_HELP_TEXT);
|
|
1671
|
+
return 0;
|
|
1672
|
+
}
|
|
1673
|
+
const authArgs = parseAuthCommandArgs(parsed.restArgs);
|
|
1674
|
+
const { execa: execaFn, loadCliConfig: loadCliConfigFn, realConcave: realConcavePath, realConvex: realConvexPath } = resolveRunDeps(deps);
|
|
1675
|
+
const config = loadCliConfigFn(parsed.configPath);
|
|
1676
|
+
const backend = resolveConfiguredBackend({
|
|
1677
|
+
backendArg: parsed.backend,
|
|
1678
|
+
config
|
|
1679
|
+
});
|
|
1680
|
+
const backendAdapter = createBackendAdapter({
|
|
1681
|
+
backend,
|
|
1682
|
+
realConvexPath,
|
|
1683
|
+
realConcavePath
|
|
1684
|
+
});
|
|
1685
|
+
assertAuthRuntimeReady(parsed.sharedDir ?? config.paths.shared);
|
|
1686
|
+
const targetArgs = extractBackendRunTargetArgs(backend, authArgs.targetRemainder);
|
|
1687
|
+
if (authArgs.rotate) {
|
|
1688
|
+
const rotateResult = await runBackendFunction(execaFn, backendAdapter, AUTH_ROTATE_KEYS_FUNCTION, {}, targetArgs, { echoOutput: false });
|
|
1689
|
+
if (rotateResult.exitCode !== 0) return rotateResult.exitCode;
|
|
1690
|
+
}
|
|
1691
|
+
const jwksResult = await runBackendFunction(execaFn, backendAdapter, AUTH_JWKS_FUNCTION, {}, targetArgs, { echoOutput: false });
|
|
1692
|
+
if (jwksResult.exitCode !== 0) return jwksResult.exitCode;
|
|
1693
|
+
const jwks = parseRunValue(jwksResult.stdout);
|
|
1694
|
+
const envLine = `JWKS=${serializeEnvValue(jwks)}`;
|
|
1695
|
+
if (authArgs.json) console.info(JSON.stringify({
|
|
1696
|
+
backend,
|
|
1697
|
+
command: "auth",
|
|
1698
|
+
envLine,
|
|
1699
|
+
jwks,
|
|
1700
|
+
rotated: authArgs.rotate,
|
|
1701
|
+
subcommand: authArgs.subcommand
|
|
1702
|
+
}));
|
|
1703
|
+
else console.info(envLine);
|
|
1704
|
+
return 0;
|
|
1705
|
+
};
|
|
1706
|
+
|
|
1602
1707
|
//#endregion
|
|
1603
1708
|
//#region src/cli/commands/codegen.ts
|
|
1604
1709
|
const HELP_FLAGS$8 = new Set(["--help", "-h"]);
|
|
@@ -2553,6 +2658,7 @@ const COMMAND_HELP = {
|
|
|
2553
2658
|
view: VIEW_HELP_TEXT,
|
|
2554
2659
|
info: INFO_HELP_TEXT,
|
|
2555
2660
|
docs: DOCS_HELP_TEXT,
|
|
2661
|
+
auth: AUTH_HELP_TEXT,
|
|
2556
2662
|
dev: DEV_HELP_TEXT,
|
|
2557
2663
|
verify: VERIFY_HELP_TEXT,
|
|
2558
2664
|
codegen: CODEGEN_HELP_TEXT,
|
|
@@ -2565,6 +2671,7 @@ const COMMAND_HANDLERS = {
|
|
|
2565
2671
|
view: handleViewCommand,
|
|
2566
2672
|
info: handleInfoCommand,
|
|
2567
2673
|
docs: handleDocsCommand,
|
|
2674
|
+
auth: handleAuthCommand,
|
|
2568
2675
|
verify: handleVerifyCommand,
|
|
2569
2676
|
codegen: handleCodegenCommand,
|
|
2570
2677
|
env: handleEnvCommand,
|
|
@@ -2601,6 +2708,7 @@ Commands:
|
|
|
2601
2708
|
view [plugin] Inspect a plugin install plan without writing
|
|
2602
2709
|
info Inspect project + installed plugin state
|
|
2603
2710
|
docs <topic...> Show docs links for CLI and plugins
|
|
2711
|
+
auth Auth runtime helpers
|
|
2604
2712
|
env Manage Convex environment variables
|
|
2605
2713
|
deploy Deploy with migrations/backfill flows
|
|
2606
2714
|
migrate Migration lifecycle commands
|
package/dist/{generated-contract-disabled-Cf7sqlVD.d.ts → generated-contract-disabled-ngvXLZ4i.d.ts}
RENAMED
|
@@ -226,8 +226,8 @@ declare const createApi: <Schema extends SchemaDefinition<any, any>, DataModel e
|
|
|
226
226
|
}[] | undefined;
|
|
227
227
|
offset?: number | undefined;
|
|
228
228
|
sortBy?: {
|
|
229
|
-
direction: "asc" | "desc";
|
|
230
229
|
field: string;
|
|
230
|
+
direction: "asc" | "desc";
|
|
231
231
|
} | undefined;
|
|
232
232
|
paginationOpts: {
|
|
233
233
|
id?: number;
|
package/dist/orm/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as GenericOrmCtx$1, $n as unique, $r as endsWith, $t as ManyConfig, A as ConvexDateMode, An as ConvexRankIndexBuilder, Ar as ReturningResult, At as MigrationManifestEntry, B as ConvexBytesBuilderInitial, Bn as rankIndex, Br as OrmSchemaRelations, Bt as defineMigration, C as ConvexNumberBuilderInitial, Ci as ColumnBuilderWithTableName, Cn as RlsRole, Cr as MutationReturning, Ct as MigrationStatusArgs, D as id, Di as IsPrimaryKey, Dn as ConvexAggregateIndexBuilderOn, Dr as PaginatedResult, Dt as MigrationDoc, E as ConvexIdBuilderInitial, Ei as HasDefault, En as ConvexAggregateIndexBuilder, Er as OrderDirection, Et as MigrationDirection, F as custom, Fn as ConvexVectorIndexBuilder, Fr as unsetToken, Ft as MigrationStateMap, G as ConvexBigIntBuilder, Gn as ConvexCheckConfig, Gr as ExpressionVisitor, Gt as OrmReader$1, H as ConvexBooleanBuilder, Hn as uniqueIndex, Hr as TableName, Ht as detectMigrationDrift, I as json, In as ConvexVectorIndexBuilderOn, Ir as Brand, It as MigrationStep, J as CountBackfillChunkArgs, Jn as ConvexUniqueConstraintBuilder, Jr as LogicalExpression, Jt as RlsMode, K as ConvexBigIntBuilderInitial, Kn as ConvexForeignKeyBuilder, Kr as FieldReference, Kt as OrmWriter$1, L as objectOf, Ln as ConvexVectorIndexConfig, Lr as Columns, Lt as MigrationTableName, M as ConvexCustomBuilder, Mn as ConvexSearchIndexBuilder, Mr as UpdateSet, Mt as MigrationPlan, N as ConvexCustomBuilderInitial, Nn as ConvexSearchIndexBuilderOn, Nr as VectorQueryConfig, Nt as MigrationRunStatus, O as ConvexDateBuilder, Oi as IsUnique, On as ConvexIndexBuilder, Or as PredicateWhereIndexConfig, Ot as MigrationDocContext, P as arrayOf, Pn as ConvexSearchIndexConfig, Pr as VectorSearchProvider, Pt as MigrationSet, Q as GenericOrm$1, Qn as foreignKey, Qr as contains, Qt as ExtractTablesWithRelations, R as unionOf, Rn as aggregateIndex, Rr as OrmSchemaExtensionTables, Rt as MigrationWriteMode, S as ConvexNumberBuilder, Si as ColumnBuilderTypeConfig, Sn as rlsPolicy, Sr as MutationResult, St as MigrationRunChunkArgs, T as ConvexIdBuilder, Ti as DrizzleEntity, Tn as rlsRole, Tr as OrderByClause, Tt as MigrationDefinition, U as ConvexBooleanBuilderInitial, Un as vectorIndex, Ur as SystemFields, Ut as DatabaseWithMutations, V as bytes, Vn as searchIndex, Vr as OrmSchemaTriggers, Vt as defineMigrationSet, W as boolean, Wn as ConvexCheckBuilder, Wr as BinaryExpression, Wt as DatabaseWithQuery, X as CountBackfillStatusArgs, Xn as ConvexUniqueConstraintConfig, Xr as and, Xt as extractRelationsConfig, Y as CountBackfillKickoffArgs, Yn as ConvexUniqueConstraintBuilderOn, Yr as UnaryExpression, Yt as EdgeMetadata, Z as CreateOrmOptions, Zn as check, Zr as between, Zt as ExtractTablesFromSchema, _ as ConvexTimestampMode, _i as startsWith, _n as deletion, _r as MutationExecuteConfig, _t as OrmTriggerContext, a as requireSchemaRelations, ai as inArray, an as TablesRelationalConfig, ar as AggregateResult, at as OrmWriterCtx, b as ConvexTextEnumBuilderInitial, bi as ColumnBuilderBaseConfig, bn as RlsPolicyConfig, br as MutationPaginateConfig, bt as MigrationCancelArgs, c as TableConfigResult, ci as isNull, cn as ConvexDeletionBuilder, cr as CountConfig, ct as ScheduledMutationBatchArgs, d as OrmNotFoundError, di as lte, dn as ConvexTableWithColumns, dr as FilterOperators, dt as scheduledDeleteFactory, ei as eq, en as OneConfig, er as ConvexTextBuilder, et as OrmApiResult, f as ConvexVectorBuilder, fi as ne, fn as DiscriminatorBuilderConfig, fr as GetColumnData, ft as SchemaExtension, g as ConvexTimestampBuilderInitial, gi as or, gn as convexTable, gr as InsertValue, gt as OrmTriggerChange, h as ConvexTimestampBuilder, hi as notInArray, hn as TableConfig, hr as InferSelectModel, ht as OrmTableTriggers, i as getSchemaTriggers, ii as ilike, in as TableRelationalConfig, ir as AggregateFieldValue, it as OrmReaderCtx, j as date, jn as ConvexRankIndexBuilderOn, jr as ReturningSelection, jt as MigrationMigrateOne, k as ConvexDateBuilderInitial, ki as NotNull, kn as ConvexIndexBuilderOn, kr as ReturningAll, kt as MigrationDriftIssue, l as getTableColumns, li as like, ln as ConvexDeletionConfig, lr as CountResult, lt as scheduledMutationBatchFactory, m as vector, mi as notBetween, mn as OrmLifecycleOperation, mr as InferModelFromColumns, mt as OrmBeforeResult, n as defineSchema, ni as gt, nn as RelationsBuilderColumnBase, nr as text, nt as OrmClientWithApi$1, o as asc, oi as isFieldReference, on as defineRelations, or as BuildQueryResult, ot as ResolveOrmSchema, p as ConvexVectorBuilderInitial, pi as not, pn as OrmLifecycleChange, pr as InferInsertModel, pt as defineSchemaExtension, q as bigint, qn as ConvexForeignKeyConfig, qr as FilterExpression, qt as RlsContext, r as getSchemaRelations, ri as gte, rn as RelationsBuilderColumnConfig, rr as AggregateConfig, rt as OrmFunctions, s as desc, si as isNotNull, sn as defineRelationsPart, sr as BuildRelationResult, st as createOrm, t as WhereClauseResult, ti as fieldRef, tn as RelationsBuilder, tr as ConvexTextBuilderInitial, tt as OrmClientBase$1, u as getTableConfig, ui as lt, un as ConvexTable, ur as DBQueryConfig, ut as ScheduledDeleteArgs, v as timestamp, vi as AnyColumn, vn as discriminator, vr as MutationExecuteResult, vt as OrmTriggers, w as integer, wi as ColumnDataType, wn as RlsRoleConfig, wr as MutationRunMode, wt as MigrationAppliedState, x as textEnum, xi as ColumnBuilderRuntimeConfig, xn as RlsPolicyToOption, xr as MutationPaginatedResult, xt as MigrationRunArgs, y as ConvexTextEnumBuilder, yi as ColumnBuilder, yn as RlsPolicy, yr as MutationExecutionMode, yt as defineTriggers, z as ConvexBytesBuilder, zn as index, zr as OrmSchemaExtensions, zt as buildMigrationPlan } from "../where-clause-compiler-
|
|
1
|
+
import { $ as GenericOrmCtx$1, $n as unique, $r as endsWith, $t as ManyConfig, A as ConvexDateMode, An as ConvexRankIndexBuilder, Ar as ReturningResult, At as MigrationManifestEntry, B as ConvexBytesBuilderInitial, Bn as rankIndex, Br as OrmSchemaRelations, Bt as defineMigration, C as ConvexNumberBuilderInitial, Ci as ColumnBuilderWithTableName, Cn as RlsRole, Cr as MutationReturning, Ct as MigrationStatusArgs, D as id, Di as IsPrimaryKey, Dn as ConvexAggregateIndexBuilderOn, Dr as PaginatedResult, Dt as MigrationDoc, E as ConvexIdBuilderInitial, Ei as HasDefault, En as ConvexAggregateIndexBuilder, Er as OrderDirection, Et as MigrationDirection, F as custom, Fn as ConvexVectorIndexBuilder, Fr as unsetToken, Ft as MigrationStateMap, G as ConvexBigIntBuilder, Gn as ConvexCheckConfig, Gr as ExpressionVisitor, Gt as OrmReader$1, H as ConvexBooleanBuilder, Hn as uniqueIndex, Hr as TableName, Ht as detectMigrationDrift, I as json, In as ConvexVectorIndexBuilderOn, Ir as Brand, It as MigrationStep, J as CountBackfillChunkArgs, Jn as ConvexUniqueConstraintBuilder, Jr as LogicalExpression, Jt as RlsMode, K as ConvexBigIntBuilderInitial, Kn as ConvexForeignKeyBuilder, Kr as FieldReference, Kt as OrmWriter$1, L as objectOf, Ln as ConvexVectorIndexConfig, Lr as Columns, Lt as MigrationTableName, M as ConvexCustomBuilder, Mn as ConvexSearchIndexBuilder, Mr as UpdateSet, Mt as MigrationPlan, N as ConvexCustomBuilderInitial, Nn as ConvexSearchIndexBuilderOn, Nr as VectorQueryConfig, Nt as MigrationRunStatus, O as ConvexDateBuilder, Oi as IsUnique, On as ConvexIndexBuilder, Or as PredicateWhereIndexConfig, Ot as MigrationDocContext, P as arrayOf, Pn as ConvexSearchIndexConfig, Pr as VectorSearchProvider, Pt as MigrationSet, Q as GenericOrm$1, Qn as foreignKey, Qr as contains, Qt as ExtractTablesWithRelations, R as unionOf, Rn as aggregateIndex, Rr as OrmSchemaExtensionTables, Rt as MigrationWriteMode, S as ConvexNumberBuilder, Si as ColumnBuilderTypeConfig, Sn as rlsPolicy, Sr as MutationResult, St as MigrationRunChunkArgs, T as ConvexIdBuilder, Ti as DrizzleEntity, Tn as rlsRole, Tr as OrderByClause, Tt as MigrationDefinition, U as ConvexBooleanBuilderInitial, Un as vectorIndex, Ur as SystemFields, Ut as DatabaseWithMutations, V as bytes, Vn as searchIndex, Vr as OrmSchemaTriggers, Vt as defineMigrationSet, W as boolean, Wn as ConvexCheckBuilder, Wr as BinaryExpression, Wt as DatabaseWithQuery, X as CountBackfillStatusArgs, Xn as ConvexUniqueConstraintConfig, Xr as and, Xt as extractRelationsConfig, Y as CountBackfillKickoffArgs, Yn as ConvexUniqueConstraintBuilderOn, Yr as UnaryExpression, Yt as EdgeMetadata, Z as CreateOrmOptions, Zn as check, Zr as between, Zt as ExtractTablesFromSchema, _ as ConvexTimestampMode, _i as startsWith, _n as deletion, _r as MutationExecuteConfig, _t as OrmTriggerContext, a as requireSchemaRelations, ai as inArray, an as TablesRelationalConfig, ar as AggregateResult, at as OrmWriterCtx, b as ConvexTextEnumBuilderInitial, bi as ColumnBuilderBaseConfig, bn as RlsPolicyConfig, br as MutationPaginateConfig, bt as MigrationCancelArgs, c as TableConfigResult, ci as isNull, cn as ConvexDeletionBuilder, cr as CountConfig, ct as ScheduledMutationBatchArgs, d as OrmNotFoundError, di as lte, dn as ConvexTableWithColumns, dr as FilterOperators, dt as scheduledDeleteFactory, ei as eq, en as OneConfig, er as ConvexTextBuilder, et as OrmApiResult, f as ConvexVectorBuilder, fi as ne, fn as DiscriminatorBuilderConfig, fr as GetColumnData, ft as SchemaExtension, g as ConvexTimestampBuilderInitial, gi as or, gn as convexTable, gr as InsertValue, gt as OrmTriggerChange, h as ConvexTimestampBuilder, hi as notInArray, hn as TableConfig, hr as InferSelectModel, ht as OrmTableTriggers, i as getSchemaTriggers, ii as ilike, in as TableRelationalConfig, ir as AggregateFieldValue, it as OrmReaderCtx, j as date, jn as ConvexRankIndexBuilderOn, jr as ReturningSelection, jt as MigrationMigrateOne, k as ConvexDateBuilderInitial, ki as NotNull, kn as ConvexIndexBuilderOn, kr as ReturningAll, kt as MigrationDriftIssue, l as getTableColumns, li as like, ln as ConvexDeletionConfig, lr as CountResult, lt as scheduledMutationBatchFactory, m as vector, mi as notBetween, mn as OrmLifecycleOperation, mr as InferModelFromColumns, mt as OrmBeforeResult, n as defineSchema, ni as gt, nn as RelationsBuilderColumnBase, nr as text, nt as OrmClientWithApi$1, o as asc, oi as isFieldReference, on as defineRelations, or as BuildQueryResult, ot as ResolveOrmSchema, p as ConvexVectorBuilderInitial, pi as not, pn as OrmLifecycleChange, pr as InferInsertModel, pt as defineSchemaExtension, q as bigint, qn as ConvexForeignKeyConfig, qr as FilterExpression, qt as RlsContext, r as getSchemaRelations, ri as gte, rn as RelationsBuilderColumnConfig, rr as AggregateConfig, rt as OrmFunctions, s as desc, si as isNotNull, sn as defineRelationsPart, sr as BuildRelationResult, st as createOrm, t as WhereClauseResult, ti as fieldRef, tn as RelationsBuilder, tr as ConvexTextBuilderInitial, tt as OrmClientBase$1, u as getTableConfig, ui as lt, un as ConvexTable, ur as DBQueryConfig, ut as ScheduledDeleteArgs, v as timestamp, vi as AnyColumn, vn as discriminator, vr as MutationExecuteResult, vt as OrmTriggers, w as integer, wi as ColumnDataType, wn as RlsRoleConfig, wr as MutationRunMode, wt as MigrationAppliedState, x as textEnum, xi as ColumnBuilderRuntimeConfig, xn as RlsPolicyToOption, xr as MutationPaginatedResult, xt as MigrationRunArgs, y as ConvexTextEnumBuilder, yi as ColumnBuilder, yn as RlsPolicy, yr as MutationExecutionMode, yt as defineTriggers, z as ConvexBytesBuilder, zn as index, zr as OrmSchemaExtensions, zt as buildMigrationPlan } from "../where-clause-compiler-CuH2JNxb.js";
|
|
2
2
|
import { i as pretendRequired, n as deprecated, r as pretend } from "../validators-vzRKjBJC.js";
|
|
3
3
|
import { a as QueryCtxWithPreferredOrmQueryTable, i as QueryCtxWithOrmQueryTable, n as LookupByIdResultByCtx, o as getByIdWithOrmQueryFallback, r as QueryCtxWithOptionalOrmQueryTable, t as DocByCtx } from "../query-context-CFZqIvD7.js";
|
|
4
4
|
import { DefineSchemaOptions, GenericDatabaseReader, GenericDatabaseWriter, GenericSchema, SchemaDefinition } from "convex/server";
|
package/dist/watcher.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { A as resolveConfiguredBackend, Ct as getConvexConfig, P as resolveRunDeps, St as generateMeta, wt as logger } from "./backend-core-By8TtoIo.mjs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
|
|
@@ -3717,6 +3717,19 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
3717
3717
|
readonly aggregate_bucket: ConvexTableWithColumns<{
|
|
3718
3718
|
name: "aggregate_bucket";
|
|
3719
3719
|
columns: {
|
|
3720
|
+
count: ConvexNumberBuilderInitial<""> & {
|
|
3721
|
+
_: {
|
|
3722
|
+
notNull: true;
|
|
3723
|
+
};
|
|
3724
|
+
} & {
|
|
3725
|
+
_: {
|
|
3726
|
+
tableName: "aggregate_bucket";
|
|
3727
|
+
};
|
|
3728
|
+
} & {
|
|
3729
|
+
_: {
|
|
3730
|
+
fieldName: "count";
|
|
3731
|
+
};
|
|
3732
|
+
};
|
|
3720
3733
|
tableKey: ConvexTextBuilderInitial<""> & {
|
|
3721
3734
|
_: {
|
|
3722
3735
|
notNull: true;
|
|
@@ -3786,19 +3799,6 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
3786
3799
|
fieldName: "keyParts";
|
|
3787
3800
|
};
|
|
3788
3801
|
};
|
|
3789
|
-
count: ConvexNumberBuilderInitial<""> & {
|
|
3790
|
-
_: {
|
|
3791
|
-
notNull: true;
|
|
3792
|
-
};
|
|
3793
|
-
} & {
|
|
3794
|
-
_: {
|
|
3795
|
-
tableName: "aggregate_bucket";
|
|
3796
|
-
};
|
|
3797
|
-
} & {
|
|
3798
|
-
_: {
|
|
3799
|
-
fieldName: "count";
|
|
3800
|
-
};
|
|
3801
|
-
};
|
|
3802
3802
|
sumValues: (NotNull<$Type<ConvexCustomBuilderInitial<"", convex_values0.VRecord<Record<string, any>, convex_values0.VString<string, "required">, convex_values0.VId<any, any> | convex_values0.VString<any, any> | convex_values0.VFloat64<any, any> | convex_values0.VInt64<any, any> | convex_values0.VBoolean<any, any> | convex_values0.VNull<any, any> | convex_values0.VAny<any, any, string> | convex_values0.VLiteral<any, any> | convex_values0.VBytes<any, any> | convex_values0.VObject<any, Record<string, convex_values0.Validator<any, convex_values0.OptionalProperty, any>>, any, any> | convex_values0.VArray<any, convex_values0.Validator<any, "required", any>, any> | convex_values0.VRecord<any, convex_values0.Validator<string, "required", any>, convex_values0.Validator<any, "required", any>, any, any> | convex_values0.VUnion<any, convex_values0.Validator<any, "required", any>[], any, any>, "required", string>>, Record<string, number>>> | NotNull<$Type<ConvexCustomBuilderInitial<"", convex_values0.VId<any, any> | convex_values0.VString<any, any> | convex_values0.VFloat64<any, any> | convex_values0.VInt64<any, any> | convex_values0.VBoolean<any, any> | convex_values0.VNull<any, any> | convex_values0.VAny<any, any, string> | convex_values0.VLiteral<any, any> | convex_values0.VBytes<any, any> | convex_values0.VObject<any, Record<string, convex_values0.Validator<any, convex_values0.OptionalProperty, any>>, any, any> | convex_values0.VArray<any, convex_values0.Validator<any, "required", any>, any> | convex_values0.VRecord<any, convex_values0.Validator<string, "required", any>, convex_values0.Validator<any, "required", any>, any, any> | convex_values0.VUnion<any, convex_values0.Validator<any, "required", any>[], any, any>>, Record<string, number>>>) & {
|
|
3803
3803
|
_: {
|
|
3804
3804
|
tableName: "aggregate_bucket";
|
|
@@ -3826,7 +3826,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
3826
3826
|
readonly aggregate_member: ConvexTableWithColumns<{
|
|
3827
3827
|
name: "aggregate_member";
|
|
3828
3828
|
columns: {
|
|
3829
|
-
|
|
3829
|
+
kind: ConvexTextBuilderInitial<""> & {
|
|
3830
3830
|
_: {
|
|
3831
3831
|
notNull: true;
|
|
3832
3832
|
};
|
|
@@ -3836,10 +3836,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
3836
3836
|
};
|
|
3837
3837
|
} & {
|
|
3838
3838
|
_: {
|
|
3839
|
-
fieldName: "
|
|
3839
|
+
fieldName: "kind";
|
|
3840
3840
|
};
|
|
3841
3841
|
};
|
|
3842
|
-
|
|
3842
|
+
tableKey: ConvexTextBuilderInitial<""> & {
|
|
3843
3843
|
_: {
|
|
3844
3844
|
notNull: true;
|
|
3845
3845
|
};
|
|
@@ -3849,7 +3849,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
3849
3849
|
};
|
|
3850
3850
|
} & {
|
|
3851
3851
|
_: {
|
|
3852
|
-
fieldName: "
|
|
3852
|
+
fieldName: "tableKey";
|
|
3853
3853
|
};
|
|
3854
3854
|
};
|
|
3855
3855
|
indexName: ConvexTextBuilderInitial<""> & {
|
|
@@ -3992,7 +3992,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
3992
3992
|
readonly aggregate_extrema: ConvexTableWithColumns<{
|
|
3993
3993
|
name: "aggregate_extrema";
|
|
3994
3994
|
columns: {
|
|
3995
|
-
|
|
3995
|
+
count: ConvexNumberBuilderInitial<""> & {
|
|
3996
3996
|
_: {
|
|
3997
3997
|
notNull: true;
|
|
3998
3998
|
};
|
|
@@ -4002,10 +4002,14 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
4002
4002
|
};
|
|
4003
4003
|
} & {
|
|
4004
4004
|
_: {
|
|
4005
|
-
fieldName: "
|
|
4005
|
+
fieldName: "count";
|
|
4006
4006
|
};
|
|
4007
4007
|
};
|
|
4008
|
-
|
|
4008
|
+
value: ConvexCustomBuilderInitial<"", convex_values0.VAny<any, "required", string>> & {
|
|
4009
|
+
_: {
|
|
4010
|
+
$type: convex_values0.Value;
|
|
4011
|
+
};
|
|
4012
|
+
} & {
|
|
4009
4013
|
_: {
|
|
4010
4014
|
notNull: true;
|
|
4011
4015
|
};
|
|
@@ -4015,10 +4019,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
4015
4019
|
};
|
|
4016
4020
|
} & {
|
|
4017
4021
|
_: {
|
|
4018
|
-
fieldName: "
|
|
4022
|
+
fieldName: "value";
|
|
4019
4023
|
};
|
|
4020
4024
|
};
|
|
4021
|
-
|
|
4025
|
+
tableKey: ConvexTextBuilderInitial<""> & {
|
|
4022
4026
|
_: {
|
|
4023
4027
|
notNull: true;
|
|
4024
4028
|
};
|
|
@@ -4028,14 +4032,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
4028
4032
|
};
|
|
4029
4033
|
} & {
|
|
4030
4034
|
_: {
|
|
4031
|
-
fieldName: "
|
|
4035
|
+
fieldName: "tableKey";
|
|
4032
4036
|
};
|
|
4033
4037
|
};
|
|
4034
|
-
|
|
4035
|
-
_: {
|
|
4036
|
-
$type: convex_values0.Value;
|
|
4037
|
-
};
|
|
4038
|
-
} & {
|
|
4038
|
+
indexName: ConvexTextBuilderInitial<""> & {
|
|
4039
4039
|
_: {
|
|
4040
4040
|
notNull: true;
|
|
4041
4041
|
};
|
|
@@ -4045,10 +4045,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
4045
4045
|
};
|
|
4046
4046
|
} & {
|
|
4047
4047
|
_: {
|
|
4048
|
-
fieldName: "
|
|
4048
|
+
fieldName: "indexName";
|
|
4049
4049
|
};
|
|
4050
4050
|
};
|
|
4051
|
-
|
|
4051
|
+
updatedAt: ConvexNumberBuilderInitial<""> & {
|
|
4052
4052
|
_: {
|
|
4053
4053
|
notNull: true;
|
|
4054
4054
|
};
|
|
@@ -4058,10 +4058,10 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
4058
4058
|
};
|
|
4059
4059
|
} & {
|
|
4060
4060
|
_: {
|
|
4061
|
-
fieldName: "
|
|
4061
|
+
fieldName: "updatedAt";
|
|
4062
4062
|
};
|
|
4063
4063
|
};
|
|
4064
|
-
|
|
4064
|
+
keyHash: ConvexTextBuilderInitial<""> & {
|
|
4065
4065
|
_: {
|
|
4066
4066
|
notNull: true;
|
|
4067
4067
|
};
|
|
@@ -4071,7 +4071,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
4071
4071
|
};
|
|
4072
4072
|
} & {
|
|
4073
4073
|
_: {
|
|
4074
|
-
fieldName: "
|
|
4074
|
+
fieldName: "keyHash";
|
|
4075
4075
|
};
|
|
4076
4076
|
};
|
|
4077
4077
|
fieldName: ConvexTextBuilderInitial<""> & {
|
|
@@ -4244,7 +4244,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
4244
4244
|
readonly aggregate_state: ConvexTableWithColumns<{
|
|
4245
4245
|
name: "aggregate_state";
|
|
4246
4246
|
columns: {
|
|
4247
|
-
|
|
4247
|
+
kind: ConvexTextBuilderInitial<""> & {
|
|
4248
4248
|
_: {
|
|
4249
4249
|
notNull: true;
|
|
4250
4250
|
};
|
|
@@ -4254,10 +4254,19 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
4254
4254
|
};
|
|
4255
4255
|
} & {
|
|
4256
4256
|
_: {
|
|
4257
|
-
fieldName: "
|
|
4257
|
+
fieldName: "kind";
|
|
4258
4258
|
};
|
|
4259
4259
|
};
|
|
4260
|
-
|
|
4260
|
+
cursor: ConvexTextBuilderInitial<""> & {
|
|
4261
|
+
_: {
|
|
4262
|
+
tableName: "aggregate_state";
|
|
4263
|
+
};
|
|
4264
|
+
} & {
|
|
4265
|
+
_: {
|
|
4266
|
+
fieldName: "cursor";
|
|
4267
|
+
};
|
|
4268
|
+
};
|
|
4269
|
+
tableKey: ConvexTextBuilderInitial<""> & {
|
|
4261
4270
|
_: {
|
|
4262
4271
|
notNull: true;
|
|
4263
4272
|
};
|
|
@@ -4267,7 +4276,7 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
4267
4276
|
};
|
|
4268
4277
|
} & {
|
|
4269
4278
|
_: {
|
|
4270
|
-
fieldName: "
|
|
4279
|
+
fieldName: "tableKey";
|
|
4271
4280
|
};
|
|
4272
4281
|
};
|
|
4273
4282
|
indexName: ConvexTextBuilderInitial<""> & {
|
|
@@ -4322,15 +4331,6 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
4322
4331
|
fieldName: "status";
|
|
4323
4332
|
};
|
|
4324
4333
|
};
|
|
4325
|
-
cursor: ConvexTextBuilderInitial<""> & {
|
|
4326
|
-
_: {
|
|
4327
|
-
tableName: "aggregate_state";
|
|
4328
|
-
};
|
|
4329
|
-
} & {
|
|
4330
|
-
_: {
|
|
4331
|
-
fieldName: "cursor";
|
|
4332
|
-
};
|
|
4333
|
-
};
|
|
4334
4334
|
processed: ConvexNumberBuilderInitial<""> & {
|
|
4335
4335
|
_: {
|
|
4336
4336
|
notNull: true;
|
|
@@ -4398,26 +4398,35 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
4398
4398
|
readonly migration_state: ConvexTableWithColumns<{
|
|
4399
4399
|
name: "migration_state";
|
|
4400
4400
|
columns: {
|
|
4401
|
-
|
|
4401
|
+
direction: ConvexTextBuilderInitial<""> & {
|
|
4402
4402
|
_: {
|
|
4403
|
-
|
|
4403
|
+
tableName: "migration_state";
|
|
4404
4404
|
};
|
|
4405
4405
|
} & {
|
|
4406
|
+
_: {
|
|
4407
|
+
fieldName: "direction";
|
|
4408
|
+
};
|
|
4409
|
+
};
|
|
4410
|
+
cursor: ConvexTextBuilderInitial<""> & {
|
|
4406
4411
|
_: {
|
|
4407
4412
|
tableName: "migration_state";
|
|
4408
4413
|
};
|
|
4409
4414
|
} & {
|
|
4410
4415
|
_: {
|
|
4411
|
-
fieldName: "
|
|
4416
|
+
fieldName: "cursor";
|
|
4412
4417
|
};
|
|
4413
4418
|
};
|
|
4414
|
-
|
|
4419
|
+
status: ConvexTextBuilderInitial<""> & {
|
|
4420
|
+
_: {
|
|
4421
|
+
notNull: true;
|
|
4422
|
+
};
|
|
4423
|
+
} & {
|
|
4415
4424
|
_: {
|
|
4416
4425
|
tableName: "migration_state";
|
|
4417
4426
|
};
|
|
4418
4427
|
} & {
|
|
4419
4428
|
_: {
|
|
4420
|
-
fieldName: "
|
|
4429
|
+
fieldName: "status";
|
|
4421
4430
|
};
|
|
4422
4431
|
};
|
|
4423
4432
|
processed: ConvexNumberBuilderInitial<""> & {
|
|
@@ -4512,15 +4521,6 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
4512
4521
|
fieldName: "applied";
|
|
4513
4522
|
};
|
|
4514
4523
|
};
|
|
4515
|
-
direction: ConvexTextBuilderInitial<""> & {
|
|
4516
|
-
_: {
|
|
4517
|
-
tableName: "migration_state";
|
|
4518
|
-
};
|
|
4519
|
-
} & {
|
|
4520
|
-
_: {
|
|
4521
|
-
fieldName: "direction";
|
|
4522
|
-
};
|
|
4523
|
-
};
|
|
4524
4524
|
runId: ConvexTextBuilderInitial<""> & {
|
|
4525
4525
|
_: {
|
|
4526
4526
|
tableName: "migration_state";
|
|
@@ -4552,6 +4552,19 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
4552
4552
|
readonly migration_run: ConvexTableWithColumns<{
|
|
4553
4553
|
name: "migration_run";
|
|
4554
4554
|
columns: {
|
|
4555
|
+
direction: ConvexTextBuilderInitial<""> & {
|
|
4556
|
+
_: {
|
|
4557
|
+
notNull: true;
|
|
4558
|
+
};
|
|
4559
|
+
} & {
|
|
4560
|
+
_: {
|
|
4561
|
+
tableName: "migration_run";
|
|
4562
|
+
};
|
|
4563
|
+
} & {
|
|
4564
|
+
_: {
|
|
4565
|
+
fieldName: "direction";
|
|
4566
|
+
};
|
|
4567
|
+
};
|
|
4555
4568
|
status: ConvexTextBuilderInitial<""> & {
|
|
4556
4569
|
_: {
|
|
4557
4570
|
notNull: true;
|
|
@@ -4609,19 +4622,6 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
4609
4622
|
fieldName: "lastError";
|
|
4610
4623
|
};
|
|
4611
4624
|
};
|
|
4612
|
-
direction: ConvexTextBuilderInitial<""> & {
|
|
4613
|
-
_: {
|
|
4614
|
-
notNull: true;
|
|
4615
|
-
};
|
|
4616
|
-
} & {
|
|
4617
|
-
_: {
|
|
4618
|
-
tableName: "migration_run";
|
|
4619
|
-
};
|
|
4620
|
-
} & {
|
|
4621
|
-
_: {
|
|
4622
|
-
fieldName: "direction";
|
|
4623
|
-
};
|
|
4624
|
-
};
|
|
4625
4625
|
runId: ConvexTextBuilderInitial<""> & {
|
|
4626
4626
|
_: {
|
|
4627
4627
|
notNull: true;
|
package/package.json
CHANGED
|
@@ -206,8 +206,10 @@ Local Convex:
|
|
|
206
206
|
Remote / repair:
|
|
207
207
|
1. Use `npx kitcn env push` when the target deployment is already active.
|
|
208
208
|
2. Use `npx kitcn env push --prod` for production sync.
|
|
209
|
+
3. Use `npx kitcn auth jwks` when you need a manual static `JWKS` payload, including backend `concave`.
|
|
209
210
|
|
|
210
211
|
Key rotation: `npx kitcn env push --rotate` (invalidates all tokens).
|
|
212
|
+
Manual rotation/export: `npx kitcn auth jwks --rotate`.
|
|
211
213
|
|
|
212
214
|
---
|
|
213
215
|
|
|
@@ -277,10 +277,16 @@ Use this to sync static `JWKS` onto the target deployment too.
|
|
|
277
277
|
```bash
|
|
278
278
|
bunx kitcn env push --prod
|
|
279
279
|
bunx kitcn env push --rotate
|
|
280
|
+
|
|
281
|
+
# Manual static JWKS payload, including backend concave
|
|
282
|
+
bunx kitcn auth jwks
|
|
283
|
+
bunx kitcn auth jwks --rotate
|
|
280
284
|
```
|
|
281
285
|
|
|
282
286
|
Use `--prod` for production and `--rotate` when you want fresh keys plus fresh
|
|
283
|
-
`JWKS`.
|
|
287
|
+
`JWKS`. `kitcn auth jwks` prints a manual `JWKS=...` line when you need to set
|
|
288
|
+
the env value yourself instead of using `env push`. See `/docs/cli/backend#env`
|
|
289
|
+
and `/docs/cli/backend#auth` for the full command surface.
|
|
284
290
|
|
|
285
291
|
Rotate later:
|
|
286
292
|
|
|
@@ -612,6 +612,8 @@ bunx kitcn codegen
|
|
|
612
612
|
bunx kitcn env push
|
|
613
613
|
bunx kitcn env push --prod
|
|
614
614
|
bunx kitcn env push --rotate
|
|
615
|
+
bunx kitcn auth jwks
|
|
616
|
+
bunx kitcn auth jwks --rotate
|
|
615
617
|
# deploy with automatic aggregate backfill:
|
|
616
618
|
bunx kitcn deploy --prod
|
|
617
619
|
# aggregate index management:
|
|
@@ -623,7 +625,9 @@ bunx kitcn analyze
|
|
|
623
625
|
|
|
624
626
|
On backend `convex`, `kitcn dev` watches `convex/.env` during a local
|
|
625
627
|
dev session and auto-pushes later edits. Keep `env push` for `--prod`,
|
|
626
|
-
`--rotate`, or explicit repair against an already active deployment.
|
|
628
|
+
`--rotate`, or explicit repair against an already active deployment. Use
|
|
629
|
+
`auth jwks` when you need a manual static `JWKS` payload, especially on backend
|
|
630
|
+
`concave`.
|
|
627
631
|
|
|
628
632
|
### 11.2 Phase A gate: non-auth baseline (required before auth work)
|
|
629
633
|
|