kitcn 0.12.16 → 0.12.18
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/client/index.js +82 -1
- package/dist/auth/generated/index.d.ts +1 -1
- package/dist/auth/index.d.ts +12 -12
- package/dist/auth/nextjs/index.d.ts +1 -1
- package/dist/auth/start/index.d.ts +7 -1
- package/dist/auth/start/index.js +37 -0
- package/dist/{auth-store-Cljlmdmi.js → auth-store-C0iMu34r.js} +53 -1
- package/dist/{backend-core-DA9iT-To.mjs → backend-core-CGjsBIOp.mjs} +159 -169
- package/dist/{builder-CBdG5W6A.js → builder-Bh18Y2t0.js} +1 -0
- package/dist/cli.mjs +8 -6
- package/dist/{generated-contract-disabled-ngvXLZ4i.d.ts → generated-contract-disabled-Dzx2IRId.d.ts} +29 -29
- package/dist/{middleware-C2qTZ3V7.js → middleware-C5P1Q29c.js} +1 -1
- package/dist/orm/index.d.ts +1 -1
- package/dist/plugins/index.js +1 -1
- package/dist/{procedure-caller-MWcxhQDv.js → procedure-caller-DL0Ubgky.js} +1 -1
- package/dist/{procedure-caller-C15h5Iel.d.ts → procedure-caller-DloN1DNv.d.ts} +6 -4
- package/dist/ratelimit/index.js +2 -2
- package/dist/react/index.js +7 -2
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +2 -2
- package/dist/watcher.mjs +1 -1
- package/dist/{where-clause-compiler-CuH2JNxb.d.ts → where-clause-compiler-Dw3EVdi6.d.ts} +30 -30
- package/package.json +1 -1
- package/skills/convex/SKILL.md +4 -1
- package/skills/convex/references/features/react.md +18 -3
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-Dw3EVdi6.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/plugins/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as VRequired } from "./validators-vzRKjBJC.js";
|
|
2
2
|
import { C as HttpProcedure, D as ProcedureMeta, R as getTransformer, S as HttpMethod, c as InferHttpInput, d as CRPCHttpRouter, j as DataTransformerOptions, l as InferHttpOutput, p as HttpRouterRecord, w as HttpProcedureBuilderDef, x as HttpHandlerOpts } from "./http-types-BS63Nsug.js";
|
|
3
3
|
import { d as Overwrite$1, i as IntersectIfDefined, m as UnsetMarker, o as MiddlewareBuilder, s as MiddlewareFunction, t as AnyMiddleware } from "./types-BqUIoMfT.js";
|
|
4
|
-
import { ConvexError, GenericId, GenericValidator, ObjectType, OptionalProperty, PropertyValidators, VAny, VArray, VBoolean, VBytes, VFloat64, VId, VInt64, VLiteral, VNull, VObject, VOptional, VRecord, VString, VUnion, Validator } from "convex/values";
|
|
4
|
+
import { ConvexError, GenericId, GenericValidator, ObjectType, OptionalProperty, PropertyValidators, VAny, VArray, VBoolean, VBytes, VFloat64, VId, VInt64, VLiteral, VNull, VObject, VOptional, VRecord, VString, VUnion, Validator, Value as Value$1 } from "convex/values";
|
|
5
5
|
import * as convex_server0 from "convex/server";
|
|
6
6
|
import { ActionBuilder, ArgsArrayToObject, DefaultFunctionArgs, FunctionReference, FunctionReturnType, FunctionVisibility, GenericActionCtx, GenericDataModel, GenericMutationCtx, GenericQueryCtx, MutationBuilder, QueryBuilder, RegisteredAction, RegisteredMutation, RegisteredQuery, TableNamesInDataModel } from "convex/server";
|
|
7
7
|
import { z } from "zod";
|
|
@@ -1250,10 +1250,11 @@ declare const CRPC_ERROR_CODES_BY_KEY: {
|
|
|
1250
1250
|
type CRPCErrorCode = keyof typeof CRPC_ERROR_CODES_BY_KEY;
|
|
1251
1251
|
/** Map error codes to HTTP status codes */
|
|
1252
1252
|
declare const CRPC_ERROR_CODE_TO_HTTP: Record<CRPCErrorCode, number>;
|
|
1253
|
-
type
|
|
1253
|
+
type CRPCErrorBaseData = {
|
|
1254
1254
|
code: CRPCErrorCode;
|
|
1255
1255
|
message: string;
|
|
1256
1256
|
};
|
|
1257
|
+
type CRPCErrorData<TData extends Record<string, Value$1 | undefined> = Record<string, never>> = CRPCErrorBaseData & TData;
|
|
1257
1258
|
/**
|
|
1258
1259
|
* tRPC-style error extending ConvexError
|
|
1259
1260
|
*
|
|
@@ -1266,13 +1267,14 @@ type CRPCErrorData = {
|
|
|
1266
1267
|
* });
|
|
1267
1268
|
* ```
|
|
1268
1269
|
*/
|
|
1269
|
-
declare class CRPCError extends ConvexError<CRPCErrorData
|
|
1270
|
+
declare class CRPCError<TData extends Record<string, Value$1 | undefined> = Record<string, never>> extends ConvexError<CRPCErrorData<TData>> {
|
|
1270
1271
|
readonly code: CRPCErrorCode;
|
|
1271
1272
|
readonly cause?: Error;
|
|
1272
1273
|
constructor(opts: {
|
|
1273
1274
|
code: CRPCErrorCode;
|
|
1274
1275
|
message?: string;
|
|
1275
1276
|
cause?: unknown;
|
|
1277
|
+
data?: TData;
|
|
1276
1278
|
});
|
|
1277
1279
|
}
|
|
1278
1280
|
/**
|
|
@@ -1464,4 +1466,4 @@ type GeneratedRegistrySource<TCallerRegistry extends GeneratedProcedureRegistry,
|
|
|
1464
1466
|
type GeneratedRegistryRuntimeResult<TQueryCtx, TMutationCtx, TCallerRegistry extends GeneratedProcedureRegistry, TActionCtx, THandlerRegistry extends GeneratedProcedureRegistry | undefined> = THandlerRegistry extends GeneratedProcedureRegistry ? GeneratedRegistryRuntimeWithHandler<TQueryCtx, TMutationCtx, TCallerRegistry, Exclude<THandlerRegistry, undefined>, TActionCtx> : GeneratedRegistryRuntime<TQueryCtx, TMutationCtx, TCallerRegistry, TActionCtx>;
|
|
1465
1467
|
declare function createGeneratedRegistryRuntime<TQueryCtx, TMutationCtx, TCallerRegistry extends GeneratedProcedureRegistry, TActionCtx = never, THandlerRegistry extends GeneratedProcedureRegistry | undefined = undefined>(createRegistryOrRegistry: GeneratedRegistrySource<TCallerRegistry, THandlerRegistry>): GeneratedRegistryRuntimeResult<TQueryCtx, TMutationCtx, TCallerRegistry, TActionCtx, THandlerRegistry>;
|
|
1466
1468
|
//#endregion
|
|
1467
|
-
export {
|
|
1469
|
+
export { createMiddlewareFactory as $, CRPC_ERROR_CODE_TO_HTTP as A, createLazyCaller as B, WithHttpRouter as C, zodToConvexFields as Ct, CRPCErrorCode as D, CRPCError as E, CreateEnvOptions as F, createApiLeaf as G, CallerOpts as H, createEnv as I, ActionProcedureBuilder as J, createGeneratedFunctionReference as K, ConvexContext as L, getHTTPStatusCodeFromError as M, isCRPCError as N, CRPCErrorData as O, toCRPCError as P, QueryProcedureBuilder as Q, createCallerFactory as R, typedProcedureResolver as S, zodToConvex as St, inferApiOutputs as T, ServerCaller as U, CallerMeta as V, createServerCaller as W, MutationProcedureBuilder as X, CRPCFunctionTypeHint as Y, ProcedureBuilder as Z, createGenericHandlerFactory as _, zCustomMutation as _t, GeneratedRegistryCallerForContext as a, matchPathParams as at, defineProcedure as b, zodOutputToConvex as bt, ProcedureActionCallerFromRegistry as c, CustomBuilder as ct, ProcedureDefinition as d, ZodFromValidatorBase as dt, initCRPC as et, ProcedureFromFunctionReference as f, ZodValidatorFromConvex as ft, createGenericCallerFactory as g, zCustomAction as gt, createGeneratedRegistryRuntime as h, withSystemFields as ht, GeneratedRegistryCallerFactory as i, handleHttpError as it, getCRPCErrorFromUnknown as j, CRPC_ERROR_CODES_BY_KEY as k, ProcedureCaller as l, ZCustomCtx as lt, ProcedureScheduleCallerFromRegistry as m, convexToZodFields as mt, GeneratedProcedureRegistry as n, createHttpProcedureBuilder as nt, GeneratedRegistryHandlerFactory as o, ConvexValidatorFromZod as ot, ProcedureSchedulableCallerFromRegistry as p, convexToZod as pt, getGeneratedValue as q, GeneratedProcedureRegistryEntry as r, extractPathParams as rt, GeneratedRegistryHandlerForContext as s, ConvexValidatorFromZodOutput as st, CreateProcedureCallerFactoryOptions as t, HttpProcedureBuilder as tt, ProcedureCallerFromRegistry as u, Zid as ut, createProcedureCallerFactory as v, zCustomQuery as vt, inferApiInputs as w, getGeneratedFunctionReference as x, zodOutputToConvexFields as xt, createProcedureHandlerFactory as y, zid as yt, LazyCaller as z };
|
package/dist/ratelimit/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { l as requireMutationCtx } from "../api-entry-BckXqaLb.js";
|
|
2
|
-
import { h as CRPCError } from "../builder-
|
|
3
|
-
import { t as definePlugin } from "../middleware-
|
|
2
|
+
import { h as CRPCError } from "../builder-Bh18Y2t0.js";
|
|
3
|
+
import { t as definePlugin } from "../middleware-C5P1Q29c.js";
|
|
4
4
|
import { v } from "convex/values";
|
|
5
5
|
import { mutationGeneric, queryGeneric } from "convex/server";
|
|
6
6
|
|
package/dist/react/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
2
|
+
import { D as CRPCClientError, E as writeAuthSessionFallbackToken, O as defaultIsUnauthorized, S as clearAuthSessionFallback, T as writeAuthSessionFallbackData, _ as useConvexAuthBridge, a as ConvexProviderWithAuth, b as useMaybeAuth, c as MaybeUnauthenticated, d as isSessionSyncGraceActive, f as useAuth, g as useAuthValue, h as useAuthStore, i as ConvexAuthBridge, k as isCRPCClientError, l as Unauthenticated, m as useAuthState, n as AuthProvider, o as FetchAccessTokenContext, p as useAuthGuard, r as Authenticated, s as MaybeAuthenticated, t as AUTH_SESSION_SYNC_GRACE_MS, u as decodeJwtExp, v as useFetchAccessToken, x as useSafeConvexAuth, y as useIsAuth } from "../auth-store-C0iMu34r.js";
|
|
3
3
|
import { ConvexProvider, ConvexReactClient, ConvexReactClient as ConvexReactClient$1, useAction, useConvex, useMutation } from "convex/react";
|
|
4
4
|
import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -1386,6 +1386,7 @@ const seedReturnedToken = (store, value) => {
|
|
|
1386
1386
|
store.set("token", token);
|
|
1387
1387
|
store.set("expiresAt", decodeJwtExp(token));
|
|
1388
1388
|
store.set("sessionSyncGraceUntil", Date.now() + AUTH_SESSION_SYNC_GRACE_MS);
|
|
1389
|
+
if (decodeJwtExp(token) === null) writeAuthSessionFallbackToken(token);
|
|
1389
1390
|
};
|
|
1390
1391
|
const syncSessionAtom = (authClient, sessionData) => {
|
|
1391
1392
|
const sessionAtom = authClient.$store?.atoms?.session;
|
|
@@ -1406,7 +1407,10 @@ const hydrateReturnedSession = async (authClient, value) => {
|
|
|
1406
1407
|
credentials: "omit",
|
|
1407
1408
|
headers: { Authorization: `Bearer ${token}` }
|
|
1408
1409
|
} });
|
|
1409
|
-
if (session?.data)
|
|
1410
|
+
if (session?.data) {
|
|
1411
|
+
syncSessionAtom(authClient, session.data);
|
|
1412
|
+
writeAuthSessionFallbackData(session.data);
|
|
1413
|
+
}
|
|
1410
1414
|
};
|
|
1411
1415
|
const withDisabledSessionSignal = (args) => {
|
|
1412
1416
|
const record = args && typeof args === "object" ? args : {};
|
|
@@ -1455,6 +1459,7 @@ function createAuthMutations(authClient) {
|
|
|
1455
1459
|
authStoreApi.set("token", null);
|
|
1456
1460
|
authStoreApi.set("expiresAt", null);
|
|
1457
1461
|
authStoreApi.set("sessionSyncGraceUntil", null);
|
|
1462
|
+
clearAuthSessionFallback();
|
|
1458
1463
|
await convexQueryClient?.resetAuthQueries();
|
|
1459
1464
|
return res;
|
|
1460
1465
|
}
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as createMiddlewareFactory, A as CRPC_ERROR_CODE_TO_HTTP, B as createLazyCaller, C as WithHttpRouter, Ct as zodToConvexFields, D as CRPCErrorCode, E as CRPCError, F as CreateEnvOptions, G as createApiLeaf, H as CallerOpts, I as createEnv, J as ActionProcedureBuilder, K as createGeneratedFunctionReference, L as ConvexContext, M as getHTTPStatusCodeFromError, N as isCRPCError, O as CRPCErrorData, P as toCRPCError, Q as QueryProcedureBuilder, R as createCallerFactory, S as typedProcedureResolver, St as zodToConvex, T as inferApiOutputs, U as ServerCaller, V as CallerMeta, W as createServerCaller, X as MutationProcedureBuilder, Y as CRPCFunctionTypeHint, Z as ProcedureBuilder, _ as createGenericHandlerFactory, _t as zCustomMutation, a as GeneratedRegistryCallerForContext, at as matchPathParams, b as defineProcedure, bt as zodOutputToConvex, c as ProcedureActionCallerFromRegistry, ct as CustomBuilder, d as ProcedureDefinition, dt as ZodFromValidatorBase, et as initCRPC, f as ProcedureFromFunctionReference, ft as ZodValidatorFromConvex, g as createGenericCallerFactory, gt as zCustomAction, h as createGeneratedRegistryRuntime, ht as withSystemFields, i as GeneratedRegistryCallerFactory, it as handleHttpError, j as getCRPCErrorFromUnknown, k as CRPC_ERROR_CODES_BY_KEY, l as ProcedureCaller, lt as ZCustomCtx, m as ProcedureScheduleCallerFromRegistry, mt as convexToZodFields, n as GeneratedProcedureRegistry, nt as createHttpProcedureBuilder, o as GeneratedRegistryHandlerFactory, ot as ConvexValidatorFromZod, p as ProcedureSchedulableCallerFromRegistry, pt as convexToZod, q as getGeneratedValue, r as GeneratedProcedureRegistryEntry, rt as extractPathParams, s as GeneratedRegistryHandlerForContext, st as ConvexValidatorFromZodOutput, t as CreateProcedureCallerFactoryOptions, tt as HttpProcedureBuilder, u as ProcedureCallerFromRegistry, ut as Zid, v as createProcedureCallerFactory, vt as zCustomQuery, w as inferApiInputs, x as getGeneratedFunctionReference, xt as zodOutputToConvexFields, y as createProcedureHandlerFactory, yt as zid, z as LazyCaller } from "../procedure-caller-DloN1DNv.js";
|
|
2
2
|
import { C as HttpProcedure, D as ProcedureMeta, E as InferHttpInput, S as HttpMethod, T as HttpRouteDefinition, _ as extractRouteMap, b as HttpActionHandler, d as CRPCHttpRouter, f as HttpRouterDef, g as createHttpRouterFactory, h as createHttpRouter, m as HttpRouterWithHono, p as HttpRouterRecord, v as CRPCHonoHandler, w as HttpProcedureBuilderDef, x as HttpHandlerOpts, y as HttpActionConstructor } from "../http-types-BS63Nsug.js";
|
|
3
3
|
import { a as MergeZodObjects, c as MiddlewareMarker, d as Overwrite, f as ResolveIfSet, i as IntersectIfDefined, l as MiddlewareNext, m as UnsetMarker, n as AnyMiddlewareBuilder, o as MiddlewareBuilder, p as Simplify, r as GetRawInputFn, s as MiddlewareFunction, t as AnyMiddleware, u as MiddlewareResult } from "../types-BqUIoMfT.js";
|
|
4
4
|
import { a as isQueryCtx, c as requireMutationCtx, i as isMutationCtx, l as requireQueryCtx, n as RunMutationCtx, o as isRunMutationCtx, r as isActionCtx, s as requireActionCtx, t as GenericCtx, u as requireRunMutationCtx } from "../context-utils-HPC5nXzx.js";
|
|
5
|
-
export { ActionProcedureBuilder, AnyMiddleware, AnyMiddlewareBuilder, CRPCError, CRPCErrorCode, CRPCFunctionTypeHint, CRPCHonoHandler, CRPCHttpRouter, CRPC_ERROR_CODES_BY_KEY, CRPC_ERROR_CODE_TO_HTTP, CallerMeta, CallerOpts, ConvexContext, ConvexValidatorFromZod, ConvexValidatorFromZodOutput, CreateEnvOptions, CreateProcedureCallerFactoryOptions, CustomBuilder, GeneratedProcedureRegistry, GeneratedProcedureRegistryEntry, GeneratedRegistryCallerFactory, GeneratedRegistryCallerForContext, GeneratedRegistryHandlerFactory, GeneratedRegistryHandlerForContext, GenericCtx, GetRawInputFn, HttpActionConstructor, HttpActionHandler, HttpHandlerOpts, HttpMethod, HttpProcedure, HttpProcedureBuilder, HttpProcedureBuilderDef, HttpRouteDefinition, HttpRouterDef, HttpRouterRecord, HttpRouterWithHono, InferHttpInput, IntersectIfDefined, LazyCaller, MergeZodObjects, MiddlewareBuilder, MiddlewareFunction, MiddlewareMarker, MiddlewareNext, MiddlewareResult, MutationProcedureBuilder, Overwrite, ProcedureActionCallerFromRegistry, ProcedureBuilder, ProcedureCaller, ProcedureCallerFromRegistry, ProcedureDefinition, ProcedureFromFunctionReference, ProcedureMeta, ProcedureSchedulableCallerFromRegistry, ProcedureScheduleCallerFromRegistry, QueryProcedureBuilder, ResolveIfSet, RunMutationCtx, ServerCaller, Simplify, UnsetMarker, WithHttpRouter, ZCustomCtx, Zid, ZodFromValidatorBase, ZodValidatorFromConvex, convexToZod, convexToZodFields, createApiLeaf, createCallerFactory, createEnv, createGeneratedFunctionReference, createGeneratedRegistryRuntime, createGenericCallerFactory, createGenericHandlerFactory, createHttpProcedureBuilder, createHttpRouter, createHttpRouterFactory, createLazyCaller, createMiddlewareFactory, createProcedureCallerFactory, createProcedureHandlerFactory, createServerCaller, defineProcedure, extractPathParams, extractRouteMap, getCRPCErrorFromUnknown, getGeneratedFunctionReference, getGeneratedValue, getHTTPStatusCodeFromError, handleHttpError, inferApiInputs, inferApiOutputs, initCRPC, isActionCtx, isCRPCError, isMutationCtx, isQueryCtx, isRunMutationCtx, matchPathParams, requireActionCtx, requireMutationCtx, requireQueryCtx, requireRunMutationCtx, toCRPCError, typedProcedureResolver, withSystemFields, zCustomAction, zCustomMutation, zCustomQuery, zid, zodOutputToConvex, zodOutputToConvexFields, zodToConvex, zodToConvexFields };
|
|
5
|
+
export { ActionProcedureBuilder, AnyMiddleware, AnyMiddlewareBuilder, CRPCError, CRPCErrorCode, CRPCErrorData, CRPCFunctionTypeHint, CRPCHonoHandler, CRPCHttpRouter, CRPC_ERROR_CODES_BY_KEY, CRPC_ERROR_CODE_TO_HTTP, CallerMeta, CallerOpts, ConvexContext, ConvexValidatorFromZod, ConvexValidatorFromZodOutput, CreateEnvOptions, CreateProcedureCallerFactoryOptions, CustomBuilder, GeneratedProcedureRegistry, GeneratedProcedureRegistryEntry, GeneratedRegistryCallerFactory, GeneratedRegistryCallerForContext, GeneratedRegistryHandlerFactory, GeneratedRegistryHandlerForContext, GenericCtx, GetRawInputFn, HttpActionConstructor, HttpActionHandler, HttpHandlerOpts, HttpMethod, HttpProcedure, HttpProcedureBuilder, HttpProcedureBuilderDef, HttpRouteDefinition, HttpRouterDef, HttpRouterRecord, HttpRouterWithHono, InferHttpInput, IntersectIfDefined, LazyCaller, MergeZodObjects, MiddlewareBuilder, MiddlewareFunction, MiddlewareMarker, MiddlewareNext, MiddlewareResult, MutationProcedureBuilder, Overwrite, ProcedureActionCallerFromRegistry, ProcedureBuilder, ProcedureCaller, ProcedureCallerFromRegistry, ProcedureDefinition, ProcedureFromFunctionReference, ProcedureMeta, ProcedureSchedulableCallerFromRegistry, ProcedureScheduleCallerFromRegistry, QueryProcedureBuilder, ResolveIfSet, RunMutationCtx, ServerCaller, Simplify, UnsetMarker, WithHttpRouter, ZCustomCtx, Zid, ZodFromValidatorBase, ZodValidatorFromConvex, convexToZod, convexToZodFields, createApiLeaf, createCallerFactory, createEnv, createGeneratedFunctionReference, createGeneratedRegistryRuntime, createGenericCallerFactory, createGenericHandlerFactory, createHttpProcedureBuilder, createHttpRouter, createHttpRouterFactory, createLazyCaller, createMiddlewareFactory, createProcedureCallerFactory, createProcedureHandlerFactory, createServerCaller, defineProcedure, extractPathParams, extractRouteMap, getCRPCErrorFromUnknown, getGeneratedFunctionReference, getGeneratedValue, getHTTPStatusCodeFromError, handleHttpError, inferApiInputs, inferApiOutputs, initCRPC, isActionCtx, isCRPCError, isMutationCtx, isQueryCtx, isRunMutationCtx, matchPathParams, requireActionCtx, requireMutationCtx, requireQueryCtx, requireRunMutationCtx, toCRPCError, typedProcedureResolver, withSystemFields, zCustomAction, zCustomMutation, zCustomQuery, zid, zodOutputToConvex, zodOutputToConvexFields, zodToConvex, zodToConvexFields };
|
package/dist/server/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as isMutationCtx, c as requireActionCtx, d as requireRunMutationCtx, i as isActionCtx, l as requireMutationCtx, n as createGeneratedFunctionReference, o as isQueryCtx, r as getGeneratedValue, s as isRunMutationCtx, t as createApiLeaf, u as requireQueryCtx } from "../api-entry-BckXqaLb.js";
|
|
2
2
|
import { n as createLazyCaller, r as createServerCaller, t as createCallerFactory } from "../caller-factory-cTXNvYdz.js";
|
|
3
|
-
import { A as zodOutputToConvexFields, C as convexToZodFields, D as zCustomQuery, E as zCustomMutation, M as zodToConvexFields, O as zid, S as convexToZod, T as zCustomAction, _ as CRPC_ERROR_CODE_TO_HTTP, a as createMiddlewareFactory, b as isCRPCError, c as createHttpRouter, d as createHttpProcedureBuilder, f as extractPathParams, g as CRPC_ERROR_CODES_BY_KEY, h as CRPCError, i as QueryProcedureBuilder, j as zodToConvex, k as zodOutputToConvex, l as createHttpRouterFactory, m as matchPathParams, n as MutationProcedureBuilder, o as initCRPC, p as handleHttpError, r as ProcedureBuilder, s as HttpRouterWithHono, t as ActionProcedureBuilder, u as extractRouteMap, v as getCRPCErrorFromUnknown, w as withSystemFields, x as toCRPCError, y as getHTTPStatusCodeFromError } from "../builder-
|
|
4
|
-
import { a as createProcedureHandlerFactory, c as typedProcedureResolver, i as createProcedureCallerFactory, l as createEnv, n as createGenericCallerFactory, o as defineProcedure, r as createGenericHandlerFactory, s as getGeneratedFunctionReference, t as createGeneratedRegistryRuntime } from "../procedure-caller-
|
|
3
|
+
import { A as zodOutputToConvexFields, C as convexToZodFields, D as zCustomQuery, E as zCustomMutation, M as zodToConvexFields, O as zid, S as convexToZod, T as zCustomAction, _ as CRPC_ERROR_CODE_TO_HTTP, a as createMiddlewareFactory, b as isCRPCError, c as createHttpRouter, d as createHttpProcedureBuilder, f as extractPathParams, g as CRPC_ERROR_CODES_BY_KEY, h as CRPCError, i as QueryProcedureBuilder, j as zodToConvex, k as zodOutputToConvex, l as createHttpRouterFactory, m as matchPathParams, n as MutationProcedureBuilder, o as initCRPC, p as handleHttpError, r as ProcedureBuilder, s as HttpRouterWithHono, t as ActionProcedureBuilder, u as extractRouteMap, v as getCRPCErrorFromUnknown, w as withSystemFields, x as toCRPCError, y as getHTTPStatusCodeFromError } from "../builder-Bh18Y2t0.js";
|
|
4
|
+
import { a as createProcedureHandlerFactory, c as typedProcedureResolver, i as createProcedureCallerFactory, l as createEnv, n as createGenericCallerFactory, o as defineProcedure, r as createGenericHandlerFactory, s as getGeneratedFunctionReference, t as createGeneratedRegistryRuntime } from "../procedure-caller-DL0Ubgky.js";
|
|
5
5
|
|
|
6
6
|
export { ActionProcedureBuilder, CRPCError, CRPC_ERROR_CODES_BY_KEY, CRPC_ERROR_CODE_TO_HTTP, HttpRouterWithHono, MutationProcedureBuilder, ProcedureBuilder, QueryProcedureBuilder, convexToZod, convexToZodFields, createApiLeaf, createCallerFactory, createEnv, createGeneratedFunctionReference, createGeneratedRegistryRuntime, createGenericCallerFactory, createGenericHandlerFactory, createHttpProcedureBuilder, createHttpRouter, createHttpRouterFactory, createLazyCaller, createMiddlewareFactory, createProcedureCallerFactory, createProcedureHandlerFactory, createServerCaller, defineProcedure, extractPathParams, extractRouteMap, getCRPCErrorFromUnknown, getGeneratedFunctionReference, getGeneratedValue, getHTTPStatusCodeFromError, handleHttpError, initCRPC, isActionCtx, isCRPCError, isMutationCtx, isQueryCtx, isRunMutationCtx, matchPathParams, requireActionCtx, requireMutationCtx, requireQueryCtx, requireRunMutationCtx, toCRPCError, typedProcedureResolver, withSystemFields, zCustomAction, zCustomMutation, zCustomQuery, zid, zodOutputToConvex, zodOutputToConvexFields, zodToConvex, zodToConvexFields };
|
package/dist/watcher.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { A as resolveConfiguredBackend, Ct as
|
|
2
|
+
import { A as resolveConfiguredBackend, Ct as generateMeta, P as resolveRunDeps, Tt as logger, wt as getConvexConfig } from "./backend-core-CGjsBIOp.mjs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
|
|
@@ -3717,19 +3717,6 @@ 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
|
-
};
|
|
3733
3720
|
tableKey: ConvexTextBuilderInitial<""> & {
|
|
3734
3721
|
_: {
|
|
3735
3722
|
notNull: true;
|
|
@@ -3799,6 +3786,19 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
3799
3786
|
fieldName: "keyParts";
|
|
3800
3787
|
};
|
|
3801
3788
|
};
|
|
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";
|
|
@@ -3992,19 +3992,6 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
3992
3992
|
readonly aggregate_extrema: ConvexTableWithColumns<{
|
|
3993
3993
|
name: "aggregate_extrema";
|
|
3994
3994
|
columns: {
|
|
3995
|
-
count: ConvexNumberBuilderInitial<""> & {
|
|
3996
|
-
_: {
|
|
3997
|
-
notNull: true;
|
|
3998
|
-
};
|
|
3999
|
-
} & {
|
|
4000
|
-
_: {
|
|
4001
|
-
tableName: "aggregate_extrema";
|
|
4002
|
-
};
|
|
4003
|
-
} & {
|
|
4004
|
-
_: {
|
|
4005
|
-
fieldName: "count";
|
|
4006
|
-
};
|
|
4007
|
-
};
|
|
4008
3995
|
value: ConvexCustomBuilderInitial<"", convex_values0.VAny<any, "required", string>> & {
|
|
4009
3996
|
_: {
|
|
4010
3997
|
$type: convex_values0.Value;
|
|
@@ -4074,6 +4061,19 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
4074
4061
|
fieldName: "keyHash";
|
|
4075
4062
|
};
|
|
4076
4063
|
};
|
|
4064
|
+
count: ConvexNumberBuilderInitial<""> & {
|
|
4065
|
+
_: {
|
|
4066
|
+
notNull: true;
|
|
4067
|
+
};
|
|
4068
|
+
} & {
|
|
4069
|
+
_: {
|
|
4070
|
+
tableName: "aggregate_extrema";
|
|
4071
|
+
};
|
|
4072
|
+
} & {
|
|
4073
|
+
_: {
|
|
4074
|
+
fieldName: "count";
|
|
4075
|
+
};
|
|
4076
|
+
};
|
|
4077
4077
|
fieldName: ConvexTextBuilderInitial<""> & {
|
|
4078
4078
|
_: {
|
|
4079
4079
|
notNull: true;
|
|
@@ -4398,22 +4398,22 @@ declare const BUILTIN_SCHEMA_EXTENSIONS: readonly [SchemaExtension<{
|
|
|
4398
4398
|
readonly migration_state: ConvexTableWithColumns<{
|
|
4399
4399
|
name: "migration_state";
|
|
4400
4400
|
columns: {
|
|
4401
|
-
|
|
4401
|
+
cursor: ConvexTextBuilderInitial<""> & {
|
|
4402
4402
|
_: {
|
|
4403
4403
|
tableName: "migration_state";
|
|
4404
4404
|
};
|
|
4405
4405
|
} & {
|
|
4406
4406
|
_: {
|
|
4407
|
-
fieldName: "
|
|
4407
|
+
fieldName: "cursor";
|
|
4408
4408
|
};
|
|
4409
4409
|
};
|
|
4410
|
-
|
|
4410
|
+
direction: ConvexTextBuilderInitial<""> & {
|
|
4411
4411
|
_: {
|
|
4412
4412
|
tableName: "migration_state";
|
|
4413
4413
|
};
|
|
4414
4414
|
} & {
|
|
4415
4415
|
_: {
|
|
4416
|
-
fieldName: "
|
|
4416
|
+
fieldName: "direction";
|
|
4417
4417
|
};
|
|
4418
4418
|
};
|
|
4419
4419
|
status: ConvexTextBuilderInitial<""> & {
|
package/package.json
CHANGED
package/skills/convex/SKILL.md
CHANGED
|
@@ -54,7 +54,7 @@ Only remember these non-parity deltas:
|
|
|
54
54
|
19. On the kitcn auth client path, use `createAuthMutations(authClient)` wrappers so logout unsubscribes auth queries before sign out. Raw Convex preset keeps a smaller plain `authClient`.
|
|
55
55
|
20. **NEVER** use `ctx.runQuery`/`ctx.runMutation`/`ctx.runAction` directly for module-to-module calls. Use `create<Module>Handler(ctx)` or `create<Module>Caller(ctx)` from `convex/functions/generated/<module>.runtime` instead.
|
|
56
56
|
21. **`create<Module>Handler(ctx)`** — default choice for queries/mutations. Bypasses input validation, middleware, output validation → zero overhead. Query/mutation ctx only. Import from `./generated/<module>.runtime`.
|
|
57
|
-
22. **`create<Module>Caller(ctx)`** — use in actions and HTTP routes (where handler is unavailable). Goes through validation + middleware. Root caller exposes query+mutation procedures. In `ActionCtx`, action procedures are under `caller.actions.*`; scheduling is under `caller.schedule.now|after|at` with `caller.schedule.cancel(id)`. Import from `./generated/<module>.runtime`. Each caller/handler eagerly loads every procedure in its module (no lazy loading) — split large modules to keep bundles lean.
|
|
57
|
+
22. **`create<Module>Caller(ctx)`** — use in actions and HTTP routes (where handler is unavailable). Goes through validation + middleware. Root caller exposes query+mutation procedures. In `ActionCtx`, action procedures are under `caller.actions.*`; scheduling is under `caller.schedule.now|after|at` with `caller.schedule.cancel(id)`. If your code widened `ctx` to a union like `MutationCtx | ActionCtx`, narrow it before accessing `caller.actions.*` (for example with `requireActionCtx(ctx)`). Import from `./generated/<module>.runtime`. Each caller/handler eagerly loads every procedure in its module (no lazy loading) — split large modules to keep bundles lean.
|
|
58
58
|
23. API types (`Api`, `ApiInputs`, `ApiOutputs`, `Select`, `Insert`, `TableName`) import from `@convex/api` — no manual `inferApiInputs<typeof api>`.
|
|
59
59
|
24. HTTP router must export as `httpRouter` (not `appRouter`) for codegen.
|
|
60
60
|
25. Server wiring imports come from `convex/functions/generated/` directory: `getAuth`, `defineAuth` from `generated/auth`; `initCRPC`, `QueryCtx`, `MutationCtx`, `OrmCtx` from `generated/server`; `create<Module>Caller`, `create<Module>Handler` from `generated/<module>.runtime`. No manual `convex/lib/orm.ts`.
|
|
@@ -317,6 +317,9 @@ Use this map consistently:
|
|
|
317
317
|
5. `CONFLICT`: duplicate or conflicting write.
|
|
318
318
|
6. `TOO_MANY_REQUESTS`: rate limit.
|
|
319
319
|
7. `INTERNAL_SERVER_ERROR`: unexpected failures only.
|
|
320
|
+
8. Add small custom `data` payloads on `CRPCError` when the client needs
|
|
321
|
+
domain metadata like conflicting ids. Read them on the client from
|
|
322
|
+
`error.data`.
|
|
320
323
|
|
|
321
324
|
Required tests:
|
|
322
325
|
|
|
@@ -418,11 +418,21 @@ Each page maintains its own WebSocket subscription. Auto-recovers on `InvalidCur
|
|
|
418
418
|
|
|
419
419
|
### Server Errors
|
|
420
420
|
|
|
421
|
-
`CRPCError` thrown server-side → arrives as `ConvexError` on client. Access
|
|
421
|
+
`CRPCError` thrown server-side → arrives as `ConvexError` on client. Access
|
|
422
|
+
the built-in fields and any custom payload via `error.data`:
|
|
422
423
|
|
|
423
424
|
```ts
|
|
424
|
-
// Server:
|
|
425
|
+
// Server:
|
|
426
|
+
throw new CRPCError({
|
|
427
|
+
code: 'CONFLICT',
|
|
428
|
+
message: 'Domain already exists',
|
|
429
|
+
data: { existingSiteId: 'site_123' },
|
|
430
|
+
});
|
|
431
|
+
|
|
425
432
|
// Client:
|
|
433
|
+
error.data?.message; // 'Domain already exists'
|
|
434
|
+
error.data?.existingSiteId; // 'site_123'
|
|
435
|
+
|
|
426
436
|
const { error, isError } = useQuery(crpc.posts.get.queryOptions({ id }));
|
|
427
437
|
if (isError) toast.error(error.data?.message ?? 'Something went wrong');
|
|
428
438
|
|
|
@@ -430,7 +440,12 @@ if (isError) toast.error(error.data?.message ?? 'Something went wrong');
|
|
|
430
440
|
crpc.posts.create.mutationOptions({ onError: (error) => toast.error(error.data?.message ?? 'Failed') });
|
|
431
441
|
|
|
432
442
|
// Try/catch:
|
|
433
|
-
const error = err as Error & {
|
|
443
|
+
const error = err as Error & {
|
|
444
|
+
data?: {
|
|
445
|
+
message?: string;
|
|
446
|
+
existingSiteId?: string;
|
|
447
|
+
};
|
|
448
|
+
};
|
|
434
449
|
```
|
|
435
450
|
|
|
436
451
|
### Client Errors
|