kitcn 0.0.1 → 0.12.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/bin/intent.js +3 -0
- package/dist/aggregate/index.d.ts +388 -0
- package/dist/aggregate/index.js +37 -0
- package/dist/api-entry-BckXqaLb.js +66 -0
- package/dist/auth/client/index.d.ts +37 -0
- package/dist/auth/client/index.js +217 -0
- package/dist/auth/config/index.d.ts +45 -0
- package/dist/auth/config/index.js +24 -0
- package/dist/auth/generated/index.d.ts +2 -0
- package/dist/auth/generated/index.js +3 -0
- package/dist/auth/http/index.d.ts +64 -0
- package/dist/auth/http/index.js +461 -0
- package/dist/auth/index.d.ts +221 -0
- package/dist/auth/index.js +1398 -0
- package/dist/auth/nextjs/index.d.ts +50 -0
- package/dist/auth/nextjs/index.js +81 -0
- package/dist/auth-store-Cljlmdmi.js +197 -0
- package/dist/builder-CBdG5W6A.js +1974 -0
- package/dist/caller-factory-cTXNvYdz.js +216 -0
- package/dist/cli.mjs +13264 -0
- package/dist/codegen-lF80HSWu.mjs +3416 -0
- package/dist/context-utils-HPC5nXzx.d.ts +17 -0
- package/dist/create-schema-odyF4kCy.js +156 -0
- package/dist/create-schema-orm-DOyiNDCx.js +246 -0
- package/dist/crpc/index.d.ts +105 -0
- package/dist/crpc/index.js +169 -0
- package/dist/customFunctions-C0voKmtx.js +144 -0
- package/dist/error-BZEnI7Sq.js +41 -0
- package/dist/generated-contract-disabled-Cih4eITO.js +50 -0
- package/dist/generated-contract-disabled-D-sOFy92.d.ts +354 -0
- package/dist/http-types-DqJubRPJ.d.ts +292 -0
- package/dist/meta-utils-0Pu0Nrap.js +117 -0
- package/dist/middleware-BUybuv9n.d.ts +34 -0
- package/dist/middleware-C2qTZ3V7.js +84 -0
- package/dist/orm/index.d.ts +17 -0
- package/dist/orm/index.js +10713 -0
- package/dist/plugins/index.d.ts +2 -0
- package/dist/plugins/index.js +3 -0
- package/dist/procedure-caller-DtxLmGwA.d.ts +1467 -0
- package/dist/procedure-caller-MWcxhQDv.js +349 -0
- package/dist/query-context-B8o6-8kC.js +1518 -0
- package/dist/query-context-CFZqIvD7.d.ts +42 -0
- package/dist/query-options-Dw7cOyXl.js +121 -0
- package/dist/ratelimit/index.d.ts +269 -0
- package/dist/ratelimit/index.js +856 -0
- package/dist/ratelimit/react/index.d.ts +76 -0
- package/dist/ratelimit/react/index.js +183 -0
- package/dist/react/index.d.ts +1284 -0
- package/dist/react/index.js +2526 -0
- package/dist/rsc/index.d.ts +276 -0
- package/dist/rsc/index.js +233 -0
- package/dist/runtime-CtvJPkur.js +2453 -0
- package/dist/server/index.d.ts +5 -0
- package/dist/server/index.js +6 -0
- package/dist/solid/index.d.ts +1221 -0
- package/dist/solid/index.js +2940 -0
- package/dist/transformer-DtDhR3Lc.js +194 -0
- package/dist/types-BTb_4BaU.d.ts +42 -0
- package/dist/types-BiJE7qxR.d.ts +4 -0
- package/dist/types-DEJpkIhw.d.ts +88 -0
- package/dist/types-HhO_R6pd.d.ts +213 -0
- package/dist/validators-B7oIJCAp.js +279 -0
- package/dist/validators-vzRKjBJC.d.ts +88 -0
- package/dist/watcher.mjs +96 -0
- package/dist/where-clause-compiler-DdjN63Io.d.ts +4756 -0
- package/package.json +107 -34
- package/skills/convex/SKILL.md +486 -0
- package/skills/convex/references/features/aggregates.md +353 -0
- package/skills/convex/references/features/auth-admin.md +446 -0
- package/skills/convex/references/features/auth-organizations.md +1141 -0
- package/skills/convex/references/features/auth-polar.md +579 -0
- package/skills/convex/references/features/auth.md +470 -0
- package/skills/convex/references/features/create-plugins.md +153 -0
- package/skills/convex/references/features/http.md +676 -0
- package/skills/convex/references/features/migrations.md +162 -0
- package/skills/convex/references/features/orm.md +1166 -0
- package/skills/convex/references/features/react.md +657 -0
- package/skills/convex/references/features/scheduling.md +267 -0
- package/skills/convex/references/features/testing.md +209 -0
- package/skills/convex/references/setup/auth.md +501 -0
- package/skills/convex/references/setup/biome.md +190 -0
- package/skills/convex/references/setup/doc-guidelines.md +145 -0
- package/skills/convex/references/setup/index.md +761 -0
- package/skills/convex/references/setup/next.md +116 -0
- package/skills/convex/references/setup/react.md +175 -0
- package/skills/convex/references/setup/server.md +473 -0
- package/skills/convex/references/setup/start.md +67 -0
- package/LICENSE +0 -21
- package/README.md +0 -0
- package/dist/index.d.mts +0 -5
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs +0 -6
- package/dist/index.mjs.map +0 -1
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
//#region src/shared/meta-utils.ts
|
|
2
|
+
const metaCache = /* @__PURE__ */ new WeakMap();
|
|
3
|
+
const nonMetaLeafKeys = new Set(["functionRef", "ref"]);
|
|
4
|
+
function isRecord(value) {
|
|
5
|
+
return typeof value === "object" && value !== null;
|
|
6
|
+
}
|
|
7
|
+
function isFunctionType(value) {
|
|
8
|
+
return value === "query" || value === "mutation" || value === "action";
|
|
9
|
+
}
|
|
10
|
+
function isMetaScalar(value) {
|
|
11
|
+
return typeof value === "string" || typeof value === "number" || typeof value === "boolean";
|
|
12
|
+
}
|
|
13
|
+
function extractLeafMeta(value) {
|
|
14
|
+
const type = value.type;
|
|
15
|
+
if (!isFunctionType(type)) return;
|
|
16
|
+
const result = { type };
|
|
17
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
18
|
+
if (key === "type" || nonMetaLeafKeys.has(key) || key.startsWith("_")) continue;
|
|
19
|
+
if (entry === void 0) continue;
|
|
20
|
+
if (isMetaScalar(entry)) result[key] = entry;
|
|
21
|
+
}
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
function getHttpRoutes(api) {
|
|
25
|
+
const routes = api._http;
|
|
26
|
+
if (!isRecord(routes)) return;
|
|
27
|
+
const normalized = {};
|
|
28
|
+
for (const [routeKey, routeValue] of Object.entries(routes)) {
|
|
29
|
+
if (!isRecord(routeValue)) continue;
|
|
30
|
+
const routePath = routeValue.path;
|
|
31
|
+
const routeMethod = routeValue.method;
|
|
32
|
+
if (typeof routePath === "string" && typeof routeMethod === "string") normalized[routeKey] = {
|
|
33
|
+
path: routePath,
|
|
34
|
+
method: routeMethod
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
return normalized;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Build a metadata index from merged API leaves.
|
|
41
|
+
* Supports both generated `api` objects and plain metadata fixtures.
|
|
42
|
+
*/
|
|
43
|
+
function buildMetaIndex(api) {
|
|
44
|
+
const cached = metaCache.get(api);
|
|
45
|
+
if (cached) return cached;
|
|
46
|
+
const meta = {};
|
|
47
|
+
const httpRoutes = getHttpRoutes(api);
|
|
48
|
+
if (httpRoutes) meta._http = httpRoutes;
|
|
49
|
+
const walk = (node, path) => {
|
|
50
|
+
for (const [key, value] of Object.entries(node)) {
|
|
51
|
+
if (key.startsWith("_")) continue;
|
|
52
|
+
if (!isRecord(value)) continue;
|
|
53
|
+
const leafMeta = extractLeafMeta(value);
|
|
54
|
+
if (leafMeta) {
|
|
55
|
+
if (path.length === 0) continue;
|
|
56
|
+
const namespace = path.join("/");
|
|
57
|
+
meta[namespace] ??= {};
|
|
58
|
+
meta[namespace][key] = leafMeta;
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
walk(value, [...path, key]);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
walk(api, []);
|
|
65
|
+
metaCache.set(api, meta);
|
|
66
|
+
return meta;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Get a function reference from the API object by traversing the path.
|
|
70
|
+
*/
|
|
71
|
+
function getFuncRef(api, path) {
|
|
72
|
+
let current = api;
|
|
73
|
+
for (const key of path) if (current && typeof current === "object") {
|
|
74
|
+
const next = current[key];
|
|
75
|
+
if (next === void 0) throw new Error(`Invalid path: ${path.join(".")}`);
|
|
76
|
+
current = next;
|
|
77
|
+
} else throw new Error(`Invalid path: ${path.join(".")}`);
|
|
78
|
+
if (current && typeof current === "object") {
|
|
79
|
+
const maybeFunctionRef = current.functionRef;
|
|
80
|
+
if (maybeFunctionRef && typeof maybeFunctionRef === "object") return maybeFunctionRef;
|
|
81
|
+
}
|
|
82
|
+
if (!current || typeof current !== "object") throw new Error(`Invalid function reference at path: ${path.join(".")}`);
|
|
83
|
+
return current;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Get function type from meta using path.
|
|
87
|
+
* Supports nested paths like ['items', 'queries', 'list'] → namespace='items/queries', fn='list'
|
|
88
|
+
*
|
|
89
|
+
* @param path - Path segments like ['todos', 'create'] or ['items', 'queries', 'list']
|
|
90
|
+
* @param meta - The meta object from codegen
|
|
91
|
+
* @returns Function type or 'query' as default
|
|
92
|
+
*/
|
|
93
|
+
function getFunctionType(path, source) {
|
|
94
|
+
if (path.length < 2) return "query";
|
|
95
|
+
const meta = buildMetaIndex(source);
|
|
96
|
+
const fnName = path.at(-1);
|
|
97
|
+
const fnType = meta[path.slice(0, -1).join("/")]?.[fnName]?.type;
|
|
98
|
+
if (fnType === "query" || fnType === "mutation" || fnType === "action") return fnType;
|
|
99
|
+
return "query";
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Get function metadata from meta using path.
|
|
103
|
+
* Supports nested paths like ['items', 'queries', 'list'] → namespace='items/queries', fn='list'
|
|
104
|
+
*
|
|
105
|
+
* @param path - Path segments like ['todos', 'create'] or ['items', 'queries', 'list']
|
|
106
|
+
* @param meta - The meta object from codegen
|
|
107
|
+
* @returns Function metadata or undefined
|
|
108
|
+
*/
|
|
109
|
+
function getFunctionMeta(path, source) {
|
|
110
|
+
if (path.length < 2) return;
|
|
111
|
+
const meta = buildMetaIndex(source);
|
|
112
|
+
const fnName = path.at(-1);
|
|
113
|
+
return meta[path.slice(0, -1).join("/")]?.[fnName];
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
//#endregion
|
|
117
|
+
export { getFunctionType as i, getFuncRef as n, getFunctionMeta as r, buildMetaIndex as t };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { o as MiddlewareBuilder } from "./types-DEJpkIhw.js";
|
|
2
|
+
|
|
3
|
+
//#region src/plugins/middleware.d.ts
|
|
4
|
+
declare const PLUGIN_CONFIG_RESOLVERS: unique symbol;
|
|
5
|
+
type PluginConfigureContext<TCtx = unknown> = {
|
|
6
|
+
ctx: TCtx;
|
|
7
|
+
};
|
|
8
|
+
type PluginConfigureResolver<TOptions, TCtx = unknown> = (args: PluginConfigureContext<TCtx>) => TOptions | undefined;
|
|
9
|
+
type PluginConfigureInput<TOptions, TCtx = unknown> = TOptions | PluginConfigureResolver<TOptions, TCtx>;
|
|
10
|
+
type PluginApiScope<TKey extends string, TApi extends object> = {
|
|
11
|
+
api: Record<string, unknown> & Record<TKey, TApi>;
|
|
12
|
+
};
|
|
13
|
+
type PluginMiddlewareHelpers<TKey extends string, TApi extends object> = {
|
|
14
|
+
middleware: () => MiddlewareBuilder<any, any, PluginApiScope<TKey, TApi>, unknown>;
|
|
15
|
+
};
|
|
16
|
+
type PluginMiddlewareFactory = (...args: never[]) => MiddlewareBuilder<any, any, any, unknown>;
|
|
17
|
+
type PluginNamedMiddlewareFactories = Record<string, PluginMiddlewareFactory>;
|
|
18
|
+
type PluginExtensionFactories = PluginNamedMiddlewareFactories & {
|
|
19
|
+
middleware?: PluginMiddlewareFactory;
|
|
20
|
+
};
|
|
21
|
+
type Plugin<TKey extends string = string, TOptions = undefined, TApi extends object = {}, TCtx = unknown, TMiddlewares extends PluginNamedMiddlewareFactories = {}> = {
|
|
22
|
+
readonly key: TKey;
|
|
23
|
+
readonly configure: <TNextCtx = TCtx>(input: PluginConfigureInput<TOptions, TNextCtx>) => Plugin<TKey, TOptions, TApi, TNextCtx, TMiddlewares>;
|
|
24
|
+
readonly middleware: () => MiddlewareBuilder<any, any, PluginApiScope<TKey, TApi>, unknown>;
|
|
25
|
+
readonly extend: <TNextExtensions extends PluginExtensionFactories>(build: (helpers: PluginMiddlewareHelpers<TKey, TApi>) => TNextExtensions) => Plugin<TKey, TOptions, TApi, TCtx, TMiddlewares & Omit<TNextExtensions, 'middleware'>>;
|
|
26
|
+
readonly [PLUGIN_CONFIG_RESOLVERS]?: readonly PluginConfigureResolver<TOptions, TCtx>[];
|
|
27
|
+
} & TMiddlewares;
|
|
28
|
+
declare function resolvePluginOptions<TPlugin extends Plugin<any, any, any, any>, TCtx = unknown>(plugin: TPlugin, args: PluginConfigureContext<TCtx>): TPlugin extends Plugin<any, infer TOptions, any, any> ? TOptions | undefined : never;
|
|
29
|
+
declare function definePlugin<TKey extends string, TOptions = undefined, TApi extends object = {}>(key: TKey, provide: (args: {
|
|
30
|
+
ctx: unknown;
|
|
31
|
+
options?: TOptions;
|
|
32
|
+
}) => TApi): Plugin<TKey, TOptions, TApi, unknown, {}>;
|
|
33
|
+
//#endregion
|
|
34
|
+
export { PluginConfigureResolver as a, PluginConfigureInput as i, PluginApiScope as n, definePlugin as o, PluginConfigureContext as r, resolvePluginOptions as s, Plugin as t };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { a as createMiddlewareFactory } from "./builder-CBdG5W6A.js";
|
|
2
|
+
|
|
3
|
+
//#region src/plugins/middleware.ts
|
|
4
|
+
const PLUGIN_CONFIG_RESOLVERS = Symbol.for("kitcn:PluginConfigResolvers");
|
|
5
|
+
function isPlainObject(value) {
|
|
6
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
7
|
+
}
|
|
8
|
+
function mergeOptions(currentOptions, nextOptions) {
|
|
9
|
+
if (nextOptions === void 0) return currentOptions;
|
|
10
|
+
if (currentOptions === void 0) return nextOptions;
|
|
11
|
+
if (isPlainObject(currentOptions) && isPlainObject(nextOptions)) return {
|
|
12
|
+
...currentOptions,
|
|
13
|
+
...nextOptions
|
|
14
|
+
};
|
|
15
|
+
return nextOptions;
|
|
16
|
+
}
|
|
17
|
+
function toConfigureResolver(input) {
|
|
18
|
+
if (typeof input === "function") return input;
|
|
19
|
+
return () => input;
|
|
20
|
+
}
|
|
21
|
+
function resolvePluginOptions(plugin, args) {
|
|
22
|
+
const resolvers = plugin[PLUGIN_CONFIG_RESOLVERS];
|
|
23
|
+
if (!resolvers || resolvers.length === 0) return;
|
|
24
|
+
let resolvedOptions;
|
|
25
|
+
for (const resolver of resolvers) resolvedOptions = mergeOptions(resolvedOptions, resolver(args));
|
|
26
|
+
return resolvedOptions;
|
|
27
|
+
}
|
|
28
|
+
function createConfiguredPlugin(definition, resolvers, extensionBuilders = []) {
|
|
29
|
+
let plugin;
|
|
30
|
+
const createBaseMiddleware = () => {
|
|
31
|
+
return createMiddlewareFactory()(async ({ ctx, next }) => {
|
|
32
|
+
const options = resolvePluginOptions(plugin, { ctx });
|
|
33
|
+
const providedApi = definition.provide({
|
|
34
|
+
ctx,
|
|
35
|
+
options
|
|
36
|
+
});
|
|
37
|
+
const nextApi = {
|
|
38
|
+
...isPlainObject(ctx.api) ? ctx.api ?? {} : {},
|
|
39
|
+
[definition.key]: providedApi
|
|
40
|
+
};
|
|
41
|
+
return next({ ctx: {
|
|
42
|
+
...ctx,
|
|
43
|
+
api: nextApi
|
|
44
|
+
} });
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
const middlewareHelpers = { middleware: createBaseMiddleware };
|
|
48
|
+
let middlewareOverride;
|
|
49
|
+
const basePlugin = {
|
|
50
|
+
key: definition.key,
|
|
51
|
+
configure: (input) => createConfiguredPlugin(definition, [...resolvers, toConfigureResolver(input)], extensionBuilders),
|
|
52
|
+
middleware: () => middlewareOverride ? middlewareOverride() : createBaseMiddleware(),
|
|
53
|
+
extend: (build) => createConfiguredPlugin(definition, resolvers, [...extensionBuilders, build]),
|
|
54
|
+
[PLUGIN_CONFIG_RESOLVERS]: resolvers
|
|
55
|
+
};
|
|
56
|
+
const middlewarePresets = {};
|
|
57
|
+
for (const build of extensionBuilders) {
|
|
58
|
+
const builtExtensions = build(middlewareHelpers);
|
|
59
|
+
for (const [name, preset] of Object.entries(builtExtensions)) {
|
|
60
|
+
if (typeof preset !== "function") throw new Error(`Duplicate plugin middleware "${name}" on plugin "${definition.key}".`);
|
|
61
|
+
if (name === "middleware") {
|
|
62
|
+
if (middlewareOverride) throw new Error(`Duplicate plugin middleware override on plugin "${definition.key}".`);
|
|
63
|
+
middlewareOverride = preset;
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
if (name in middlewarePresets || name in basePlugin) throw new Error(`Duplicate plugin middleware "${name}" on plugin "${definition.key}".`);
|
|
67
|
+
middlewarePresets[name] = preset;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
plugin = {
|
|
71
|
+
...basePlugin,
|
|
72
|
+
...middlewarePresets
|
|
73
|
+
};
|
|
74
|
+
return Object.freeze(plugin);
|
|
75
|
+
}
|
|
76
|
+
function definePlugin(key, provide) {
|
|
77
|
+
return createConfiguredPlugin({
|
|
78
|
+
key,
|
|
79
|
+
provide
|
|
80
|
+
}, []);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
//#endregion
|
|
84
|
+
export { resolvePluginOptions as n, definePlugin as t };
|
|
@@ -0,0 +1,17 @@
|
|
|
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-DdjN63Io.js";
|
|
2
|
+
import { i as pretendRequired, n as deprecated, r as pretend } from "../validators-vzRKjBJC.js";
|
|
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
|
+
import { DefineSchemaOptions, GenericDatabaseReader, GenericDatabaseWriter, GenericSchema, SchemaDefinition } from "convex/server";
|
|
5
|
+
|
|
6
|
+
//#region src/orm/index.d.ts
|
|
7
|
+
type OrmCtxBase = {
|
|
8
|
+
db: GenericDatabaseReader<any> | GenericDatabaseWriter<any>;
|
|
9
|
+
};
|
|
10
|
+
type OrmReader<TSchema extends object> = OrmReader$1<ResolveOrmSchema<TSchema> & TablesRelationalConfig>;
|
|
11
|
+
type OrmWriter<TSchema extends object> = OrmWriter$1<ResolveOrmSchema<TSchema> & TablesRelationalConfig>;
|
|
12
|
+
type GenericOrm<Ctx extends OrmCtxBase, TSchema extends object> = GenericOrm$1<Ctx, ResolveOrmSchema<TSchema> & TablesRelationalConfig>;
|
|
13
|
+
type GenericOrmCtx<Ctx extends OrmCtxBase, TSchema extends object> = GenericOrmCtx$1<Ctx, ResolveOrmSchema<TSchema> & TablesRelationalConfig>;
|
|
14
|
+
type OrmClientBase<TSchema extends object> = OrmClientBase$1<ResolveOrmSchema<TSchema> & TablesRelationalConfig>;
|
|
15
|
+
type OrmClientWithApi<TSchema extends object> = OrmClientWithApi$1<ResolveOrmSchema<TSchema> & TablesRelationalConfig>;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { type AggregateConfig, type AggregateFieldValue, type AggregateResult, type AnyColumn, type BinaryExpression, Brand, type BuildQueryResult, type BuildRelationResult, type ColumnBuilder, type ColumnBuilderBaseConfig, type ColumnBuilderRuntimeConfig, type ColumnBuilderTypeConfig, type ColumnBuilderWithTableName, type ColumnDataType, Columns, type ConvexAggregateIndexBuilder, type ConvexAggregateIndexBuilderOn, type ConvexBigIntBuilder, type ConvexBigIntBuilderInitial, type ConvexBooleanBuilder, type ConvexBooleanBuilderInitial, type ConvexBytesBuilder, type ConvexBytesBuilderInitial, type ConvexCheckBuilder, type ConvexCheckConfig, type ConvexCustomBuilder, type ConvexCustomBuilderInitial, type ConvexDateBuilder, type ConvexDateBuilderInitial, type ConvexDateMode, type ConvexDeletionBuilder, type ConvexDeletionConfig, type ConvexForeignKeyBuilder, type ConvexForeignKeyConfig, type ConvexIdBuilder, type ConvexIdBuilderInitial, type ConvexIndexBuilder, type ConvexIndexBuilderOn, type ConvexNumberBuilder, type ConvexNumberBuilderInitial, type ConvexRankIndexBuilder, type ConvexRankIndexBuilderOn, type ConvexSearchIndexBuilder, type ConvexSearchIndexBuilderOn, type ConvexSearchIndexConfig, type ConvexTable, type ConvexTableWithColumns, type ConvexTextBuilder, type ConvexTextBuilderInitial, type ConvexTextEnumBuilder, type ConvexTextEnumBuilderInitial, type ConvexTimestampBuilder, type ConvexTimestampBuilderInitial, type ConvexTimestampMode, type ConvexUniqueConstraintBuilder, type ConvexUniqueConstraintBuilderOn, type ConvexUniqueConstraintConfig, type ConvexVectorBuilder, type ConvexVectorBuilderInitial, type ConvexVectorIndexBuilder, type ConvexVectorIndexBuilderOn, type ConvexVectorIndexConfig, type CountBackfillChunkArgs, type CountBackfillKickoffArgs, type CountBackfillStatusArgs, type CountConfig, type CountResult, type CreateOrmOptions, type DBQueryConfig, type DatabaseWithMutations, type DatabaseWithQuery, type DefineSchemaOptions, type DiscriminatorBuilderConfig, type DocByCtx, type DrizzleEntity, type EdgeMetadata, type ExpressionVisitor, type ExtractTablesFromSchema, type ExtractTablesWithRelations, type FieldReference, type FilterExpression, type FilterOperators, GenericOrm, GenericOrmCtx, type GenericSchema, type GetColumnData, type HasDefault, type InferInsertModel, type InferModelFromColumns, type InferSelectModel, type InsertValue, type IsPrimaryKey, type IsUnique, type LogicalExpression, type LookupByIdResultByCtx, type ManyConfig, 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, type MutationExecuteConfig, type MutationExecuteResult, type MutationExecutionMode, type MutationPaginateConfig, type MutationPaginatedResult, type MutationResult, type MutationReturning, type MutationRunMode, type NotNull, type OneConfig, type OrderByClause, type OrderDirection, type OrmApiResult, type OrmBeforeResult, OrmClientBase, OrmClientWithApi, type OrmFunctions, type OrmLifecycleChange, type OrmLifecycleOperation, OrmNotFoundError, OrmReader, type OrmReaderCtx, OrmSchemaExtensionTables, OrmSchemaExtensions, OrmSchemaRelations, OrmSchemaTriggers, type OrmTableTriggers, type OrmTriggerChange, type OrmTriggerContext, type OrmTriggers, OrmWriter, type OrmWriterCtx, type PaginatedResult, type PredicateWhereIndexConfig, type QueryCtxWithOptionalOrmQueryTable, type QueryCtxWithOrmQueryTable, type QueryCtxWithPreferredOrmQueryTable, type RelationsBuilder, type RelationsBuilderColumnBase, type RelationsBuilderColumnConfig, type ResolveOrmSchema, type ReturningAll, type ReturningResult, type ReturningSelection, type RlsContext, type RlsMode, RlsPolicy, type RlsPolicyConfig, type RlsPolicyToOption, RlsRole, type RlsRoleConfig, type ScheduledDeleteArgs, type ScheduledMutationBatchArgs, type SchemaDefinition, type SchemaExtension, type SystemFields, type TableConfig, type TableConfigResult, TableName, type TableRelationalConfig, type TablesRelationalConfig, type UnaryExpression, type UpdateSet, type VectorQueryConfig, type VectorSearchProvider, type WhereClauseResult, aggregateIndex, and, arrayOf, asc, between, bigint, boolean, buildMigrationPlan, bytes, check, contains, convexTable, createOrm, custom, date, defineMigration, defineMigrationSet, defineRelations, defineRelationsPart, defineSchema, defineSchemaExtension, defineTriggers, deletion, deprecated, desc, detectMigrationDrift, discriminator, endsWith, eq, extractRelationsConfig, fieldRef, foreignKey, getByIdWithOrmQueryFallback, getSchemaRelations, getSchemaTriggers, getTableColumns, getTableConfig, gt, gte, id, ilike, inArray, index, integer, isFieldReference, isNotNull, isNull, json, like, lt, lte, ne, not, notBetween, notInArray, objectOf, or, pretend, pretendRequired, rankIndex, requireSchemaRelations, rlsPolicy, rlsRole, scheduledDeleteFactory, scheduledMutationBatchFactory, searchIndex, startsWith, text, textEnum, timestamp, unionOf, unique, uniqueIndex, unsetToken, vector, vectorIndex };
|