kitcn 0.12.27 → 0.13.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/dist/aggregate/index.d.ts +1 -1
- package/dist/aggregate/index.js +1 -1
- package/dist/auth/client/index.d.ts +312 -4
- package/dist/auth/client/index.js +17 -5
- package/dist/auth/config/index.d.ts +1 -1
- package/dist/auth/generated/index.d.ts +1 -1
- package/dist/auth/generated/index.js +1 -1
- package/dist/auth/http/index.d.ts +12 -9
- package/dist/auth/http/index.js +35 -6
- package/dist/auth/index.d.ts +292 -8
- package/dist/auth/index.js +29 -23
- package/dist/auth/nextjs/index.d.ts +4 -3
- package/dist/auth/nextjs/index.js +9 -4
- package/dist/auth/start/index.d.ts +13 -3
- package/dist/auth/start/index.js +97 -8
- package/dist/{backend-core-DqCCa0nr.mjs → backend-core-yq-eWLRJ.mjs} +140 -54
- package/dist/{builder-Cb6gloDB.js → builder-DBgto1yn.js} +4 -3
- package/dist/{caller-factory-cTXNvYdz.js → caller-factory-NEfgD5E0.js} +3 -3
- package/dist/cli.mjs +26 -26
- package/dist/convex-plugin-C3N9BB-J.js +275 -0
- package/dist/convex-plugin-tWTDqoKJ.mjs +276 -0
- package/dist/{create-schema-orm-DOyiNDCx.js → create-schema-orm-B3f2Kc8O.js} +1 -1
- package/dist/crpc/index.d.ts +2 -2
- package/dist/crpc/index.js +3 -3
- package/dist/{customFunctions-C0voKmtx.js → customFunctions-DxEEO4Dq.js} +2 -1
- package/dist/{generated-contract-disabled-21YxPk5W.d.ts → generated-contract-disabled-C_-KWRfT.d.ts} +4 -2
- package/dist/{http-types-BLFA9zS7.d.ts → http-types-zsMHb_QN.d.ts} +2 -2
- package/dist/{middleware-DkIhQXwg.js → middleware-Bg-PdtrI.js} +1 -1
- package/dist/{middleware-nS_qXecO.d.ts → middleware-DrtexzF3.d.ts} +1 -1
- package/dist/orm/index.d.ts +3 -3
- package/dist/orm/index.js +3 -3
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.js +1 -1
- package/dist/{procedure-caller-AjLfkHyF.js → procedure-caller-DplSC7Us.js} +2 -2
- package/dist/{procedure-name-D-fDCBlo.d.ts → procedure-name-BCRBr6Po.d.ts} +3 -3
- package/dist/ratelimit/index.d.ts +2 -2
- package/dist/ratelimit/index.js +3 -3
- package/dist/react/index.d.ts +18 -14
- package/dist/react/index.js +14 -27
- package/dist/rsc/index.d.ts +4 -4
- package/dist/rsc/index.js +4 -4
- package/dist/{runtime-CtvJPkur.js → runtime-i6t-HoZn.js} +1 -1
- package/dist/server/index.d.ts +4 -4
- package/dist/server/index.js +4 -4
- package/dist/solid/index.d.ts +300 -4
- package/dist/token-B9Bjcqug.d.ts +13 -0
- package/dist/token-tpipF-7y.js +47 -0
- package/dist/{types-C6pQrnzD.d.ts → types-YHpe0rsb.d.ts} +1 -1
- package/dist/upstream-BR6sBLg3.js +84 -0
- package/dist/upstream-BUCdbLok.mjs +26 -0
- package/dist/{validators-B7oIJCAp.js → validators-C7LelqTN.js} +2 -84
- package/dist/watcher.mjs +1 -1
- package/dist/{where-clause-compiler-DdjN63Io.d.ts → where-clause-compiler-TMppDl9g.d.ts} +51 -51
- package/package.json +5 -4
- package/skills/convex/references/features/auth.md +20 -0
- package/skills/convex/references/features/orm.md +9 -0
- package/skills/convex/references/setup/auth.md +2 -0
- package/skills/convex/references/setup/index.md +5 -5
- package/skills/convex/references/setup/server.md +1 -1
- /package/dist/{api-entry-BUAh_K4k.js → api-entry-N3nBOlI2.js} +0 -0
- /package/dist/{context-utils-BvWW0Ilq.d.ts → context-utils-OMkMGhBk.d.ts} +0 -0
- /package/dist/{create-schema-odyF4kCy.js → create-schema-BXrKE2YY.js} +0 -0
- /package/dist/{error-BZEnI7Sq.js → error-Bvo7YEhk.js} +0 -0
- /package/dist/{generated-contract-disabled-Cih4eITO.js → generated-contract-disabled-BXaz7JCE.js} +0 -0
- /package/dist/{meta-utils-0Pu0Nrap.js → meta-utils-D9K4fICl.js} +0 -0
- /package/dist/{query-context-CFZqIvD7.d.ts → query-context-CNo9ffvI.d.ts} +0 -0
- /package/dist/{query-context-B8o6-8kC.js → query-context-ydn9kb6P.js} +0 -0
- /package/dist/{query-options-Dw7cOyXl.js → query-options-C96zLANM.js} +0 -0
- /package/dist/{transformer-DtDhR3Lc.js → transformer-C6pGVHqx.js} +0 -0
- /package/dist/{types-BiJE7qxR.d.ts → types-BCl8gfGy.d.ts} +0 -0
- /package/dist/{types-a-RHmrDZ.d.ts → types-CnTpHR1F.d.ts} +0 -0
- /package/dist/{types-BTb_4BaU.d.ts → types-DF2cg_w0.d.ts} +0 -0
- /package/dist/{validators-vzRKjBJC.d.ts → validators-BhsByJeg.d.ts} +0 -0
package/dist/server/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as CRPCFunctionTypeHint, A as CRPCError, B as createEnv, C as createProcedureHandlerFactory, Ct as zid, D as WithHttpRouter, Dt as zodToConvexFields, E as typedProcedureResolver, Et as zodToConvex, F as getCRPCErrorFromUnknown, G as CallerMeta, H as createCallerFactory, I as getHTTPStatusCodeFromError, J as createServerCaller, K as CallerOpts, L as isCRPCError, M as CRPCErrorData, N as CRPC_ERROR_CODES_BY_KEY, O as inferApiInputs, P as CRPC_ERROR_CODE_TO_HTTP, Q as ActionProcedureBuilder, R as toCRPCError, S as createProcedureCallerFactory, St as zCustomQuery, T as getGeneratedFunctionReference, Tt as zodOutputToConvexFields, U as LazyCaller, V as ConvexContext, W as createLazyCaller, X as createGeneratedFunctionReference, Y as createApiLeaf, Z as getGeneratedValue, _ as ProcedureSchedulableCallerFromRegistry, _t as convexToZod, a as CreateProcedureCallerFactoryOptions, at as HttpProcedureBuilder, b as createGenericCallerFactory, bt as zCustomAction, c as GeneratedRegistryCallerFactory, ct as handleHttpError, d as GeneratedRegistryHandlerForContext, dt as ConvexValidatorFromZodOutput, et as MutationProcedureBuilder, f as ProcedureActionCallerFromRegistry, ft as CustomBuilder, g as ProcedureFromFunctionReference, gt as ZodValidatorFromConvex, h as ProcedureDefinition, ht as ZodFromValidatorBase, i as registerProcedureNameLookup, it as initCRPC, j as CRPCErrorCode, k as inferApiOutputs, l as GeneratedRegistryCallerForContext, lt as matchPathParams, m as ProcedureCallerFromRegistry, mt as Zid, n as ProcedureNameLookup, nt as QueryProcedureBuilder, o as GeneratedProcedureRegistry, ot as createHttpProcedureBuilder, p as ProcedureCaller, pt as ZCustomCtx, q as ServerCaller, r as inferProcedureNameFromCallsite, rt as createMiddlewareFactory, s as GeneratedProcedureRegistryEntry, st as extractPathParams, t as ProcedureNameEntry, tt as ProcedureBuilder, u as GeneratedRegistryHandlerFactory, ut as ConvexValidatorFromZod, v as ProcedureScheduleCallerFromRegistry, vt as convexToZodFields, w as defineProcedure, wt as zodOutputToConvex, x as createGenericHandlerFactory, xt as zCustomMutation, y as createGeneratedRegistryRuntime, yt as withSystemFields, z as CreateEnvOptions } from "../procedure-name-
|
|
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-
|
|
3
|
-
import { a as MergeZodObjects, c as MiddlewareMarker, d as MiddlewareProcedureType, f as MiddlewareResult, g as UnsetMarker, h as Simplify, i as IntersectIfDefined, l as MiddlewareNext, m as ResolveIfSet, n as AnyMiddlewareBuilder, o as MiddlewareBuilder, p as Overwrite, r as GetRawInputFn, s as MiddlewareFunction, t as AnyMiddleware, u as MiddlewareProcedureInfo } from "../types-
|
|
4
|
-
import { a as isMutationCtx, c as isSchedulerCtx, d as requireQueryCtx, f as requireRunMutationCtx, i as isActionCtx, l as requireActionCtx, n as RunMutationCtx, o as isQueryCtx, p as requireSchedulerCtx, r as SchedulerCtx, s as isRunMutationCtx, t as GenericCtx, u as requireMutationCtx } from "../context-utils-
|
|
1
|
+
import { $ as CRPCFunctionTypeHint, A as CRPCError, B as createEnv, C as createProcedureHandlerFactory, Ct as zid, D as WithHttpRouter, Dt as zodToConvexFields, E as typedProcedureResolver, Et as zodToConvex, F as getCRPCErrorFromUnknown, G as CallerMeta, H as createCallerFactory, I as getHTTPStatusCodeFromError, J as createServerCaller, K as CallerOpts, L as isCRPCError, M as CRPCErrorData, N as CRPC_ERROR_CODES_BY_KEY, O as inferApiInputs, P as CRPC_ERROR_CODE_TO_HTTP, Q as ActionProcedureBuilder, R as toCRPCError, S as createProcedureCallerFactory, St as zCustomQuery, T as getGeneratedFunctionReference, Tt as zodOutputToConvexFields, U as LazyCaller, V as ConvexContext, W as createLazyCaller, X as createGeneratedFunctionReference, Y as createApiLeaf, Z as getGeneratedValue, _ as ProcedureSchedulableCallerFromRegistry, _t as convexToZod, a as CreateProcedureCallerFactoryOptions, at as HttpProcedureBuilder, b as createGenericCallerFactory, bt as zCustomAction, c as GeneratedRegistryCallerFactory, ct as handleHttpError, d as GeneratedRegistryHandlerForContext, dt as ConvexValidatorFromZodOutput, et as MutationProcedureBuilder, f as ProcedureActionCallerFromRegistry, ft as CustomBuilder, g as ProcedureFromFunctionReference, gt as ZodValidatorFromConvex, h as ProcedureDefinition, ht as ZodFromValidatorBase, i as registerProcedureNameLookup, it as initCRPC, j as CRPCErrorCode, k as inferApiOutputs, l as GeneratedRegistryCallerForContext, lt as matchPathParams, m as ProcedureCallerFromRegistry, mt as Zid, n as ProcedureNameLookup, nt as QueryProcedureBuilder, o as GeneratedProcedureRegistry, ot as createHttpProcedureBuilder, p as ProcedureCaller, pt as ZCustomCtx, q as ServerCaller, r as inferProcedureNameFromCallsite, rt as createMiddlewareFactory, s as GeneratedProcedureRegistryEntry, st as extractPathParams, t as ProcedureNameEntry, tt as ProcedureBuilder, u as GeneratedRegistryHandlerFactory, ut as ConvexValidatorFromZod, v as ProcedureScheduleCallerFromRegistry, vt as convexToZodFields, w as defineProcedure, wt as zodOutputToConvex, x as createGenericHandlerFactory, xt as zCustomMutation, y as createGeneratedRegistryRuntime, yt as withSystemFields, z as CreateEnvOptions } from "../procedure-name-BCRBr6Po.js";
|
|
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-zsMHb_QN.js";
|
|
3
|
+
import { a as MergeZodObjects, c as MiddlewareMarker, d as MiddlewareProcedureType, f as MiddlewareResult, g as UnsetMarker, h as Simplify, i as IntersectIfDefined, l as MiddlewareNext, m as ResolveIfSet, n as AnyMiddlewareBuilder, o as MiddlewareBuilder, p as Overwrite, r as GetRawInputFn, s as MiddlewareFunction, t as AnyMiddleware, u as MiddlewareProcedureInfo } from "../types-CnTpHR1F.js";
|
|
4
|
+
import { a as isMutationCtx, c as isSchedulerCtx, d as requireQueryCtx, f as requireRunMutationCtx, i as isActionCtx, l as requireActionCtx, n as RunMutationCtx, o as isQueryCtx, p as requireSchedulerCtx, r as SchedulerCtx, s as isRunMutationCtx, t as GenericCtx, u as requireMutationCtx } from "../context-utils-OMkMGhBk.js";
|
|
5
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, MiddlewareProcedureInfo, MiddlewareProcedureType, MiddlewareResult, MutationProcedureBuilder, Overwrite, ProcedureActionCallerFromRegistry, ProcedureBuilder, ProcedureCaller, ProcedureCallerFromRegistry, ProcedureDefinition, ProcedureFromFunctionReference, ProcedureMeta, ProcedureNameEntry, ProcedureNameLookup, ProcedureSchedulableCallerFromRegistry, ProcedureScheduleCallerFromRegistry, QueryProcedureBuilder, ResolveIfSet, RunMutationCtx, SchedulerCtx, 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, inferProcedureNameFromCallsite, initCRPC, isActionCtx, isCRPCError, isMutationCtx, isQueryCtx, isRunMutationCtx, isSchedulerCtx, matchPathParams, registerProcedureNameLookup, requireActionCtx, requireMutationCtx, requireQueryCtx, requireRunMutationCtx, requireSchedulerCtx, toCRPCError, typedProcedureResolver, withSystemFields, zCustomAction, zCustomMutation, zCustomQuery, zid, zodOutputToConvex, zodOutputToConvexFields, zodToConvex, zodToConvexFields };
|
package/dist/server/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as isMutationCtx, c as isSchedulerCtx, d as requireQueryCtx, f as requireRunMutationCtx, i as isActionCtx, l as requireActionCtx, n as createGeneratedFunctionReference, o as isQueryCtx, p as requireSchedulerCtx, r as getGeneratedValue, s as isRunMutationCtx, t as createApiLeaf, u as requireMutationCtx } from "../api-entry-
|
|
2
|
-
import { n as createLazyCaller, r as createServerCaller, t as createCallerFactory } from "../caller-factory-
|
|
3
|
-
import { A as zid, C as toCRPCError, D as zCustomAction, E as withSystemFields, M as zodOutputToConvexFields, N as zodToConvex, O as zCustomMutation, P as zodToConvexFields, S as isCRPCError, T as convexToZodFields, _ as CRPCError, a as createMiddlewareFactory, b as getCRPCErrorFromUnknown, c as registerProcedureNameLookup, d as createHttpRouterFactory, f as extractRouteMap, g as matchPathParams, h as handleHttpError, i as QueryProcedureBuilder, j as zodOutputToConvex, k as zCustomQuery, l as HttpRouterWithHono, m as extractPathParams, n as MutationProcedureBuilder, o as initCRPC, p as createHttpProcedureBuilder, r as ProcedureBuilder, s as inferProcedureNameFromCallsite, t as ActionProcedureBuilder, u as createHttpRouter, v as CRPC_ERROR_CODES_BY_KEY, w as convexToZod, x as getHTTPStatusCodeFromError, y as CRPC_ERROR_CODE_TO_HTTP } 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-
|
|
1
|
+
import { a as isMutationCtx, c as isSchedulerCtx, d as requireQueryCtx, f as requireRunMutationCtx, i as isActionCtx, l as requireActionCtx, n as createGeneratedFunctionReference, o as isQueryCtx, p as requireSchedulerCtx, r as getGeneratedValue, s as isRunMutationCtx, t as createApiLeaf, u as requireMutationCtx } from "../api-entry-N3nBOlI2.js";
|
|
2
|
+
import { n as createLazyCaller, r as createServerCaller, t as createCallerFactory } from "../caller-factory-NEfgD5E0.js";
|
|
3
|
+
import { A as zid, C as toCRPCError, D as zCustomAction, E as withSystemFields, M as zodOutputToConvexFields, N as zodToConvex, O as zCustomMutation, P as zodToConvexFields, S as isCRPCError, T as convexToZodFields, _ as CRPCError, a as createMiddlewareFactory, b as getCRPCErrorFromUnknown, c as registerProcedureNameLookup, d as createHttpRouterFactory, f as extractRouteMap, g as matchPathParams, h as handleHttpError, i as QueryProcedureBuilder, j as zodOutputToConvex, k as zCustomQuery, l as HttpRouterWithHono, m as extractPathParams, n as MutationProcedureBuilder, o as initCRPC, p as createHttpProcedureBuilder, r as ProcedureBuilder, s as inferProcedureNameFromCallsite, t as ActionProcedureBuilder, u as createHttpRouter, v as CRPC_ERROR_CODES_BY_KEY, w as convexToZod, x as getHTTPStatusCodeFromError, y as CRPC_ERROR_CODE_TO_HTTP } from "../builder-DBgto1yn.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-DplSC7Us.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, inferProcedureNameFromCallsite, initCRPC, isActionCtx, isCRPCError, isMutationCtx, isQueryCtx, isRunMutationCtx, isSchedulerCtx, matchPathParams, registerProcedureNameLookup, requireActionCtx, requireMutationCtx, requireQueryCtx, requireRunMutationCtx, requireSchedulerCtx, toCRPCError, typedProcedureResolver, withSystemFields, zCustomAction, zCustomMutation, zCustomQuery, zid, zodOutputToConvex, zodOutputToConvexFields, zodToConvex, zodToConvexFields };
|
package/dist/solid/index.d.ts
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import { FunctionArgs, FunctionReference, FunctionReturnType } from "convex/server";
|
|
1
|
+
import { AuthConfig, FunctionArgs, FunctionReference, FunctionReturnType } from "convex/server";
|
|
2
2
|
import * as solid_js0 from "solid-js";
|
|
3
3
|
import { JSX, ParentProps } from "solid-js";
|
|
4
4
|
import { DefaultError, QueryCache, QueryClient, QueryFilters, QueryFunction, QueryFunctionContext, QueryKey, SkipToken, SolidMutationOptions, SolidQueryOptions } from "@tanstack/solid-query";
|
|
5
5
|
import { AuthTokenFetcher, ConvexClient, ConvexHttpClient } from "convex/browser";
|
|
6
6
|
import { z } from "zod";
|
|
7
|
-
import
|
|
8
|
-
import { BetterAuthClientPlugin } from "better-auth";
|
|
7
|
+
import * as better_auth0 from "better-auth";
|
|
8
|
+
import { BetterAuthClientPlugin, Session, User } from "better-auth";
|
|
9
9
|
import { createAuthClient } from "better-auth/solid";
|
|
10
|
+
import * as better_auth_api0 from "better-auth/api";
|
|
11
|
+
import * as better_auth_plugins_oidc_provider0 from "better-auth/plugins/oidc-provider";
|
|
12
|
+
import * as jose from "jose";
|
|
13
|
+
import { BetterAuthOptions } from "better-auth/minimal";
|
|
10
14
|
|
|
11
15
|
//#region src/crpc/types.d.ts
|
|
12
16
|
/** Symbol key for attaching FunctionReference to options (non-serializable) */
|
|
@@ -889,9 +893,301 @@ declare function createCRPCContext<TApi extends Record<string, unknown>>(options
|
|
|
889
893
|
} : VanillaCRPCClient<TApi>;
|
|
890
894
|
};
|
|
891
895
|
//#endregion
|
|
896
|
+
//#region src/auth/internal/convex-plugin.d.ts
|
|
897
|
+
declare const convex$1: (opts: {
|
|
898
|
+
authConfig: AuthConfig;
|
|
899
|
+
jwks?: string;
|
|
900
|
+
jwksRotateOnTokenGenerationError?: boolean;
|
|
901
|
+
jwt?: {
|
|
902
|
+
definePayload?: (session: {
|
|
903
|
+
session: Session & Record<string, any>;
|
|
904
|
+
user: User & Record<string, any>;
|
|
905
|
+
}) => Promise<Record<string, any>> | Record<string, any> | undefined;
|
|
906
|
+
expirationSeconds?: number;
|
|
907
|
+
};
|
|
908
|
+
/**
|
|
909
|
+
* @deprecated Use jwt.expirationSeconds instead.
|
|
910
|
+
*/
|
|
911
|
+
jwtExpirationSeconds?: number;
|
|
912
|
+
options?: BetterAuthOptions;
|
|
913
|
+
}) => {
|
|
914
|
+
id: "convex";
|
|
915
|
+
init: (ctx: better_auth0.AuthContext) => void;
|
|
916
|
+
hooks: {
|
|
917
|
+
before: ({
|
|
918
|
+
matcher(context: better_auth0.HookEndpointContext): boolean;
|
|
919
|
+
handler: (inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<{
|
|
920
|
+
context: {
|
|
921
|
+
headers: Headers;
|
|
922
|
+
};
|
|
923
|
+
} | undefined>;
|
|
924
|
+
} | {
|
|
925
|
+
matcher: (ctx: better_auth0.HookEndpointContext) => boolean;
|
|
926
|
+
handler: (inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<{
|
|
927
|
+
context: better_auth0.MiddlewareContext<better_auth0.MiddlewareOptions, {
|
|
928
|
+
returned?: unknown | undefined;
|
|
929
|
+
responseHeaders?: Headers | undefined;
|
|
930
|
+
} & better_auth0.PluginContext<BetterAuthOptions> & better_auth0.InfoContext & {
|
|
931
|
+
options: BetterAuthOptions;
|
|
932
|
+
trustedOrigins: string[];
|
|
933
|
+
trustedProviders: string[];
|
|
934
|
+
isTrustedOrigin: (url: string, settings?: {
|
|
935
|
+
allowRelativePaths: boolean;
|
|
936
|
+
}) => boolean;
|
|
937
|
+
oauthConfig: {
|
|
938
|
+
skipStateCookieCheck?: boolean | undefined;
|
|
939
|
+
storeStateStrategy: "database" | "cookie";
|
|
940
|
+
};
|
|
941
|
+
newSession: {
|
|
942
|
+
session: {
|
|
943
|
+
id: string;
|
|
944
|
+
createdAt: Date;
|
|
945
|
+
updatedAt: Date;
|
|
946
|
+
userId: string;
|
|
947
|
+
expiresAt: Date;
|
|
948
|
+
token: string;
|
|
949
|
+
ipAddress?: string | null | undefined;
|
|
950
|
+
userAgent?: string | null | undefined;
|
|
951
|
+
} & Record<string, any>;
|
|
952
|
+
user: {
|
|
953
|
+
id: string;
|
|
954
|
+
createdAt: Date;
|
|
955
|
+
updatedAt: Date;
|
|
956
|
+
email: string;
|
|
957
|
+
emailVerified: boolean;
|
|
958
|
+
name: string;
|
|
959
|
+
image?: string | null | undefined;
|
|
960
|
+
} & Record<string, any>;
|
|
961
|
+
} | null;
|
|
962
|
+
session: {
|
|
963
|
+
session: {
|
|
964
|
+
id: string;
|
|
965
|
+
createdAt: Date;
|
|
966
|
+
updatedAt: Date;
|
|
967
|
+
userId: string;
|
|
968
|
+
expiresAt: Date;
|
|
969
|
+
token: string;
|
|
970
|
+
ipAddress?: string | null | undefined;
|
|
971
|
+
userAgent?: string | null | undefined;
|
|
972
|
+
} & Record<string, any>;
|
|
973
|
+
user: {
|
|
974
|
+
id: string;
|
|
975
|
+
createdAt: Date;
|
|
976
|
+
updatedAt: Date;
|
|
977
|
+
email: string;
|
|
978
|
+
emailVerified: boolean;
|
|
979
|
+
name: string;
|
|
980
|
+
image?: string | null | undefined;
|
|
981
|
+
} & Record<string, any>;
|
|
982
|
+
} | null;
|
|
983
|
+
setNewSession: (session: {
|
|
984
|
+
session: {
|
|
985
|
+
id: string;
|
|
986
|
+
createdAt: Date;
|
|
987
|
+
updatedAt: Date;
|
|
988
|
+
userId: string;
|
|
989
|
+
expiresAt: Date;
|
|
990
|
+
token: string;
|
|
991
|
+
ipAddress?: string | null | undefined;
|
|
992
|
+
userAgent?: string | null | undefined;
|
|
993
|
+
} & Record<string, any>;
|
|
994
|
+
user: {
|
|
995
|
+
id: string;
|
|
996
|
+
createdAt: Date;
|
|
997
|
+
updatedAt: Date;
|
|
998
|
+
email: string;
|
|
999
|
+
emailVerified: boolean;
|
|
1000
|
+
name: string;
|
|
1001
|
+
image?: string | null | undefined;
|
|
1002
|
+
} & Record<string, any>;
|
|
1003
|
+
} | null) => void;
|
|
1004
|
+
socialProviders: better_auth0.OAuthProvider[];
|
|
1005
|
+
authCookies: better_auth0.BetterAuthCookies;
|
|
1006
|
+
logger: ReturnType<(options?: better_auth0.Logger | undefined) => better_auth0.InternalLogger>;
|
|
1007
|
+
rateLimit: {
|
|
1008
|
+
enabled: boolean;
|
|
1009
|
+
window: number;
|
|
1010
|
+
max: number;
|
|
1011
|
+
storage: "memory" | "database" | "secondary-storage";
|
|
1012
|
+
} & Omit<better_auth0.BetterAuthRateLimitOptions, "enabled" | "window" | "max" | "storage">;
|
|
1013
|
+
adapter: better_auth0.DBAdapter<BetterAuthOptions>;
|
|
1014
|
+
internalAdapter: better_auth0.InternalAdapter<BetterAuthOptions>;
|
|
1015
|
+
createAuthCookie: (cookieName: string, overrideAttributes?: Partial<better_auth0.CookieOptions> | undefined) => better_auth0.BetterAuthCookie;
|
|
1016
|
+
secret: string;
|
|
1017
|
+
secretConfig: string | better_auth0.SecretConfig;
|
|
1018
|
+
sessionConfig: {
|
|
1019
|
+
updateAge: number;
|
|
1020
|
+
expiresIn: number;
|
|
1021
|
+
freshAge: number;
|
|
1022
|
+
cookieRefreshCache: false | {
|
|
1023
|
+
enabled: true;
|
|
1024
|
+
updateAge: number;
|
|
1025
|
+
};
|
|
1026
|
+
};
|
|
1027
|
+
generateId: (options: {
|
|
1028
|
+
model: better_auth0.ModelNames;
|
|
1029
|
+
size?: number | undefined;
|
|
1030
|
+
}) => string | false;
|
|
1031
|
+
secondaryStorage: better_auth0.SecondaryStorage | undefined;
|
|
1032
|
+
password: {
|
|
1033
|
+
hash: (password: string) => Promise<string>;
|
|
1034
|
+
verify: (data: {
|
|
1035
|
+
password: string;
|
|
1036
|
+
hash: string;
|
|
1037
|
+
}) => Promise<boolean>;
|
|
1038
|
+
config: {
|
|
1039
|
+
minPasswordLength: number;
|
|
1040
|
+
maxPasswordLength: number;
|
|
1041
|
+
};
|
|
1042
|
+
checkPassword: (userId: string, ctx: better_auth0.GenericEndpointContext<BetterAuthOptions>) => Promise<boolean>;
|
|
1043
|
+
};
|
|
1044
|
+
tables: better_auth0.BetterAuthDBSchema;
|
|
1045
|
+
runMigrations: () => Promise<void>;
|
|
1046
|
+
publishTelemetry: (event: {
|
|
1047
|
+
type: string;
|
|
1048
|
+
anonymousId?: string | undefined;
|
|
1049
|
+
payload: Record<string, any>;
|
|
1050
|
+
}) => Promise<void>;
|
|
1051
|
+
skipOriginCheck: boolean | string[];
|
|
1052
|
+
skipCSRFCheck: boolean;
|
|
1053
|
+
runInBackground: (promise: Promise<unknown>) => void;
|
|
1054
|
+
runInBackgroundOrAwait: (promise: Promise<unknown> | void) => better_auth0.Awaitable<unknown>;
|
|
1055
|
+
}>;
|
|
1056
|
+
}>;
|
|
1057
|
+
})[];
|
|
1058
|
+
after: {
|
|
1059
|
+
matcher: (context: better_auth0.HookEndpointContext) => boolean;
|
|
1060
|
+
handler: better_auth_api0.AuthMiddleware;
|
|
1061
|
+
}[];
|
|
1062
|
+
};
|
|
1063
|
+
endpoints: {
|
|
1064
|
+
getOpenIdConfig: better_auth0.StrictEndpoint<"/convex/.well-known/openid-configuration", {
|
|
1065
|
+
method: "GET";
|
|
1066
|
+
metadata: {
|
|
1067
|
+
isAction: false;
|
|
1068
|
+
};
|
|
1069
|
+
}, better_auth_plugins_oidc_provider0.OIDCMetadata>;
|
|
1070
|
+
getJwks: better_auth0.StrictEndpoint<"/convex/jwks", {
|
|
1071
|
+
method: "GET";
|
|
1072
|
+
metadata: {
|
|
1073
|
+
openapi: {
|
|
1074
|
+
description: string;
|
|
1075
|
+
responses: {
|
|
1076
|
+
'200': {
|
|
1077
|
+
description: string;
|
|
1078
|
+
};
|
|
1079
|
+
};
|
|
1080
|
+
};
|
|
1081
|
+
};
|
|
1082
|
+
}, jose.JSONWebKeySet>;
|
|
1083
|
+
getLatestJwks: better_auth0.StrictEndpoint<"/convex/latest-jwks", {
|
|
1084
|
+
isAction: boolean;
|
|
1085
|
+
method: "POST";
|
|
1086
|
+
metadata: {
|
|
1087
|
+
SERVER_ONLY: true;
|
|
1088
|
+
openapi: {
|
|
1089
|
+
description: string;
|
|
1090
|
+
};
|
|
1091
|
+
};
|
|
1092
|
+
}, any[]>;
|
|
1093
|
+
rotateKeys: better_auth0.StrictEndpoint<"/convex/rotate-keys", {
|
|
1094
|
+
isAction: boolean;
|
|
1095
|
+
method: "POST";
|
|
1096
|
+
metadata: {
|
|
1097
|
+
SERVER_ONLY: true;
|
|
1098
|
+
openapi: {
|
|
1099
|
+
description: string;
|
|
1100
|
+
};
|
|
1101
|
+
};
|
|
1102
|
+
}, any[]>;
|
|
1103
|
+
getToken: better_auth0.StrictEndpoint<"/convex/token", {
|
|
1104
|
+
method: "GET";
|
|
1105
|
+
requireHeaders: true;
|
|
1106
|
+
use: ((inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<{
|
|
1107
|
+
session: {
|
|
1108
|
+
session: Record<string, any> & {
|
|
1109
|
+
id: string;
|
|
1110
|
+
createdAt: Date;
|
|
1111
|
+
updatedAt: Date;
|
|
1112
|
+
userId: string;
|
|
1113
|
+
expiresAt: Date;
|
|
1114
|
+
token: string;
|
|
1115
|
+
ipAddress?: string | null | undefined;
|
|
1116
|
+
userAgent?: string | null | undefined;
|
|
1117
|
+
};
|
|
1118
|
+
user: Record<string, any> & {
|
|
1119
|
+
id: string;
|
|
1120
|
+
createdAt: Date;
|
|
1121
|
+
updatedAt: Date;
|
|
1122
|
+
email: string;
|
|
1123
|
+
emailVerified: boolean;
|
|
1124
|
+
name: string;
|
|
1125
|
+
image?: string | null | undefined;
|
|
1126
|
+
};
|
|
1127
|
+
};
|
|
1128
|
+
}>)[];
|
|
1129
|
+
metadata: {
|
|
1130
|
+
openapi: {
|
|
1131
|
+
description: string;
|
|
1132
|
+
};
|
|
1133
|
+
};
|
|
1134
|
+
}, {
|
|
1135
|
+
token: string;
|
|
1136
|
+
}>;
|
|
1137
|
+
};
|
|
1138
|
+
schema: {
|
|
1139
|
+
jwks: {
|
|
1140
|
+
fields: {
|
|
1141
|
+
publicKey: {
|
|
1142
|
+
type: "string";
|
|
1143
|
+
required: true;
|
|
1144
|
+
};
|
|
1145
|
+
privateKey: {
|
|
1146
|
+
type: "string";
|
|
1147
|
+
required: true;
|
|
1148
|
+
};
|
|
1149
|
+
createdAt: {
|
|
1150
|
+
type: "date";
|
|
1151
|
+
required: true;
|
|
1152
|
+
};
|
|
1153
|
+
expiresAt: {
|
|
1154
|
+
type: "date";
|
|
1155
|
+
required: false;
|
|
1156
|
+
};
|
|
1157
|
+
};
|
|
1158
|
+
};
|
|
1159
|
+
user: {
|
|
1160
|
+
readonly fields: {
|
|
1161
|
+
readonly userId: {
|
|
1162
|
+
readonly type: "string";
|
|
1163
|
+
readonly required: false;
|
|
1164
|
+
readonly input: false;
|
|
1165
|
+
};
|
|
1166
|
+
};
|
|
1167
|
+
};
|
|
1168
|
+
};
|
|
1169
|
+
};
|
|
1170
|
+
//#endregion
|
|
1171
|
+
//#region src/auth/internal/convex-client.d.ts
|
|
1172
|
+
declare const convexClient: () => {
|
|
1173
|
+
id: "convex";
|
|
1174
|
+
$InferServerPlugin: ReturnType<typeof convex$1>;
|
|
1175
|
+
};
|
|
1176
|
+
//#endregion
|
|
892
1177
|
//#region src/solid/types.d.ts
|
|
893
|
-
type CrossDomainClient = ReturnType<typeof crossDomainClient>;
|
|
894
1178
|
type ConvexClient$1 = ReturnType<typeof convexClient>;
|
|
1179
|
+
type CrossDomainClient = BetterAuthClientPlugin & {
|
|
1180
|
+
id: 'cross-domain';
|
|
1181
|
+
getActions: (...args: never[]) => {
|
|
1182
|
+
crossDomain: {
|
|
1183
|
+
oneTimeToken: {
|
|
1184
|
+
verify: (args: unknown) => Promise<unknown>;
|
|
1185
|
+
};
|
|
1186
|
+
};
|
|
1187
|
+
getCookie: () => string;
|
|
1188
|
+
notifySessionSignal: () => void;
|
|
1189
|
+
};
|
|
1190
|
+
};
|
|
895
1191
|
type PluginsWithCrossDomain = (CrossDomainClient | ConvexClient$1 | BetterAuthClientPlugin)[];
|
|
896
1192
|
type PluginsWithoutCrossDomain = (ConvexClient$1 | BetterAuthClientPlugin)[];
|
|
897
1193
|
type AuthClientWithPlugins<Plugins extends PluginsWithCrossDomain | PluginsWithoutCrossDomain> = ReturnType<typeof createAuthClient<BetterAuthClientPlugin & {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/auth/internal/token.d.ts
|
|
2
|
+
type GetTokenOptions = {
|
|
3
|
+
basePath?: string;
|
|
4
|
+
cookiePrefix?: string;
|
|
5
|
+
forceRefresh?: boolean;
|
|
6
|
+
jwtCache?: {
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
expirationToleranceSeconds?: number;
|
|
9
|
+
isAuthError: (error: unknown) => boolean;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { GetTokenOptions as t };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { t as JWT_COOKIE_NAME } from "./convex-plugin-C3N9BB-J.js";
|
|
2
|
+
import { betterFetch } from "@better-fetch/fetch";
|
|
3
|
+
import { getSessionCookie } from "better-auth/cookies";
|
|
4
|
+
import * as jose from "jose";
|
|
5
|
+
|
|
6
|
+
//#region src/auth/internal/token-utils.ts
|
|
7
|
+
const TRAILING_SLASH_RE = /\/$/;
|
|
8
|
+
const resolveConvexTokenPath = (basePath) => {
|
|
9
|
+
return `${basePath && basePath !== "/" ? basePath.replace(TRAILING_SLASH_RE, "") : "/api/auth"}/convex/token`;
|
|
10
|
+
};
|
|
11
|
+
const isTokenExpired = (exp, expirationToleranceSeconds = 60, now = Math.floor(Date.now() / 1e3)) => {
|
|
12
|
+
if (!exp) return true;
|
|
13
|
+
return now >= exp - expirationToleranceSeconds;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/auth/internal/token.ts
|
|
18
|
+
const getToken = async (siteUrl, headers, opts) => {
|
|
19
|
+
const fetchToken = async () => {
|
|
20
|
+
const { data } = await betterFetch(resolveConvexTokenPath(opts?.basePath), {
|
|
21
|
+
baseURL: siteUrl,
|
|
22
|
+
headers
|
|
23
|
+
});
|
|
24
|
+
return {
|
|
25
|
+
isFresh: true,
|
|
26
|
+
token: data?.token
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
if (!opts?.jwtCache?.enabled || opts.forceRefresh) return await fetchToken();
|
|
30
|
+
const token = getSessionCookie(new Headers(headers), {
|
|
31
|
+
cookieName: JWT_COOKIE_NAME,
|
|
32
|
+
cookiePrefix: opts?.cookiePrefix
|
|
33
|
+
});
|
|
34
|
+
if (!token) return await fetchToken();
|
|
35
|
+
try {
|
|
36
|
+
if (!isTokenExpired(jose.decodeJwt(token)?.exp, opts?.jwtCache?.expirationToleranceSeconds ?? 60)) return {
|
|
37
|
+
isFresh: false,
|
|
38
|
+
token
|
|
39
|
+
};
|
|
40
|
+
} catch (error) {
|
|
41
|
+
console.error("Error decoding JWT", error);
|
|
42
|
+
}
|
|
43
|
+
return await fetchToken();
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
//#endregion
|
|
47
|
+
export { getToken as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as CombinedDataTransformer, n as HttpClientError } from "./http-types-
|
|
1
|
+
import { O as CombinedDataTransformer, n as HttpClientError } from "./http-types-zsMHb_QN.js";
|
|
2
2
|
import { FunctionArgs, FunctionReference, FunctionReturnType } from "convex/server";
|
|
3
3
|
|
|
4
4
|
//#region src/crpc/http-client.d.ts
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
//#region src/internal/upstream/index.ts
|
|
2
|
+
/** biome-ignore-all lint: vendored upstream helper source */
|
|
3
|
+
/**
|
|
4
|
+
* Vendored from upstream helper repository at commit c5e52c8.
|
|
5
|
+
* Source path: packages/convex_helpers/index.ts
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* asyncMap returns the results of applying an async function over an list.
|
|
9
|
+
*
|
|
10
|
+
* The list can even be a promise, or an iterable like a Set.
|
|
11
|
+
* @param list - Iterable object of items, e.g. an Array, Set, Object.keys
|
|
12
|
+
* @param asyncTransform
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
async function asyncMap(list, asyncTransform) {
|
|
16
|
+
const promises = [];
|
|
17
|
+
let index = 0;
|
|
18
|
+
list = await list;
|
|
19
|
+
for (const item of list) {
|
|
20
|
+
promises.push(asyncTransform(item, index));
|
|
21
|
+
index += 1;
|
|
22
|
+
}
|
|
23
|
+
return Promise.all(promises);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* pick helps you pick keys from an object more concisely.
|
|
27
|
+
*
|
|
28
|
+
* e.g. `pick({a: v.string(), b: v.number()}, ["a"])` is equivalent to
|
|
29
|
+
* `{a: v.string()}`
|
|
30
|
+
* The alternative could be something like:
|
|
31
|
+
* ```js
|
|
32
|
+
* const obj = { a: v.string(), b: v.number() };
|
|
33
|
+
* // pick does the following
|
|
34
|
+
* const { a } = obj;
|
|
35
|
+
* const onlyA = { a };
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @param obj The object to pick from. Often like { a: v.string() }
|
|
39
|
+
* @param keys The keys to pick from the object.
|
|
40
|
+
* @returns A new object with only the keys you picked and their values.
|
|
41
|
+
*/
|
|
42
|
+
function pick(obj, keys) {
|
|
43
|
+
return Object.fromEntries(Object.entries(obj).filter(([k]) => keys.includes(k)));
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* omit helps you omit keys from an object more concisely.
|
|
47
|
+
*
|
|
48
|
+
* e.g. `omit({a: v.string(), b: v.number()}, ["a"])` is equivalent to
|
|
49
|
+
* `{b: v.number()}`
|
|
50
|
+
*
|
|
51
|
+
* The alternative could be something like:
|
|
52
|
+
* ```js
|
|
53
|
+
* const obj = { a: v.string(), b: v.number() };
|
|
54
|
+
* // omit does the following
|
|
55
|
+
* const { a, ...rest } = obj;
|
|
56
|
+
* const withoutA = rest;
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* @param obj The object to return a copy of without the specified keys.
|
|
60
|
+
* @param keys The keys to omit from the object.
|
|
61
|
+
* @returns A new object with the keys you omitted removed.
|
|
62
|
+
*/
|
|
63
|
+
function omit(obj, keys) {
|
|
64
|
+
return Object.fromEntries(Object.entries(obj).filter(([k]) => !keys.includes(k)));
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* A utility to validate truthiness at runtime, providing a type guard
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* const x: string | null = getValue();
|
|
72
|
+
* assert(x);
|
|
73
|
+
* // x is now of type string
|
|
74
|
+
* ```
|
|
75
|
+
* You can also provide a function, to avoid doing expensive string templating.
|
|
76
|
+
* @param arg A value to assert the truthiness of.
|
|
77
|
+
* @param message An optional message to throw if the value is not truthy, or a function to generate the message.
|
|
78
|
+
*/
|
|
79
|
+
function assert(value, message) {
|
|
80
|
+
if (!value) throw new Error(typeof message === "function" ? message() : message);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
//#endregion
|
|
84
|
+
export { pick as i, asyncMap as n, omit as r, assert as t };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
//#region src/internal/upstream/index.ts
|
|
3
|
+
/**
|
|
4
|
+
* omit helps you omit keys from an object more concisely.
|
|
5
|
+
*
|
|
6
|
+
* e.g. `omit({a: v.string(), b: v.number()}, ["a"])` is equivalent to
|
|
7
|
+
* `{b: v.number()}`
|
|
8
|
+
*
|
|
9
|
+
* The alternative could be something like:
|
|
10
|
+
* ```js
|
|
11
|
+
* const obj = { a: v.string(), b: v.number() };
|
|
12
|
+
* // omit does the following
|
|
13
|
+
* const { a, ...rest } = obj;
|
|
14
|
+
* const withoutA = rest;
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @param obj The object to return a copy of without the specified keys.
|
|
18
|
+
* @param keys The keys to omit from the object.
|
|
19
|
+
* @returns A new object with the keys you omitted removed.
|
|
20
|
+
*/
|
|
21
|
+
function omit(obj, keys) {
|
|
22
|
+
return Object.fromEntries(Object.entries(obj).filter(([k]) => !keys.includes(k)));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
export { omit as t };
|
|
@@ -1,88 +1,6 @@
|
|
|
1
|
+
import { t as assert } from "./upstream-BR6sBLg3.js";
|
|
1
2
|
import { asObjectValidator, v } from "convex/values";
|
|
2
3
|
|
|
3
|
-
//#region src/internal/upstream/index.ts
|
|
4
|
-
/** biome-ignore-all lint: vendored upstream helper source */
|
|
5
|
-
/**
|
|
6
|
-
* Vendored from upstream helper repository at commit c5e52c8.
|
|
7
|
-
* Source path: packages/convex_helpers/index.ts
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* asyncMap returns the results of applying an async function over an list.
|
|
11
|
-
*
|
|
12
|
-
* The list can even be a promise, or an iterable like a Set.
|
|
13
|
-
* @param list - Iterable object of items, e.g. an Array, Set, Object.keys
|
|
14
|
-
* @param asyncTransform
|
|
15
|
-
* @returns
|
|
16
|
-
*/
|
|
17
|
-
async function asyncMap(list, asyncTransform) {
|
|
18
|
-
const promises = [];
|
|
19
|
-
let index = 0;
|
|
20
|
-
list = await list;
|
|
21
|
-
for (const item of list) {
|
|
22
|
-
promises.push(asyncTransform(item, index));
|
|
23
|
-
index += 1;
|
|
24
|
-
}
|
|
25
|
-
return Promise.all(promises);
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* pick helps you pick keys from an object more concisely.
|
|
29
|
-
*
|
|
30
|
-
* e.g. `pick({a: v.string(), b: v.number()}, ["a"])` is equivalent to
|
|
31
|
-
* `{a: v.string()}`
|
|
32
|
-
* The alternative could be something like:
|
|
33
|
-
* ```js
|
|
34
|
-
* const obj = { a: v.string(), b: v.number() };
|
|
35
|
-
* // pick does the following
|
|
36
|
-
* const { a } = obj;
|
|
37
|
-
* const onlyA = { a };
|
|
38
|
-
* ```
|
|
39
|
-
*
|
|
40
|
-
* @param obj The object to pick from. Often like { a: v.string() }
|
|
41
|
-
* @param keys The keys to pick from the object.
|
|
42
|
-
* @returns A new object with only the keys you picked and their values.
|
|
43
|
-
*/
|
|
44
|
-
function pick(obj, keys) {
|
|
45
|
-
return Object.fromEntries(Object.entries(obj).filter(([k]) => keys.includes(k)));
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* omit helps you omit keys from an object more concisely.
|
|
49
|
-
*
|
|
50
|
-
* e.g. `omit({a: v.string(), b: v.number()}, ["a"])` is equivalent to
|
|
51
|
-
* `{b: v.number()}`
|
|
52
|
-
*
|
|
53
|
-
* The alternative could be something like:
|
|
54
|
-
* ```js
|
|
55
|
-
* const obj = { a: v.string(), b: v.number() };
|
|
56
|
-
* // omit does the following
|
|
57
|
-
* const { a, ...rest } = obj;
|
|
58
|
-
* const withoutA = rest;
|
|
59
|
-
* ```
|
|
60
|
-
*
|
|
61
|
-
* @param obj The object to return a copy of without the specified keys.
|
|
62
|
-
* @param keys The keys to omit from the object.
|
|
63
|
-
* @returns A new object with the keys you omitted removed.
|
|
64
|
-
*/
|
|
65
|
-
function omit(obj, keys) {
|
|
66
|
-
return Object.fromEntries(Object.entries(obj).filter(([k]) => !keys.includes(k)));
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* A utility to validate truthiness at runtime, providing a type guard
|
|
70
|
-
*
|
|
71
|
-
* @example
|
|
72
|
-
* ```ts
|
|
73
|
-
* const x: string | null = getValue();
|
|
74
|
-
* assert(x);
|
|
75
|
-
* // x is now of type string
|
|
76
|
-
* ```
|
|
77
|
-
* You can also provide a function, to avoid doing expensive string templating.
|
|
78
|
-
* @param arg A value to assert the truthiness of.
|
|
79
|
-
* @param message An optional message to throw if the value is not truthy, or a function to generate the message.
|
|
80
|
-
*/
|
|
81
|
-
function assert(value, message) {
|
|
82
|
-
if (!value) throw new Error(typeof message === "function" ? message() : message);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
//#endregion
|
|
86
4
|
//#region src/internal/upstream/validators.ts
|
|
87
5
|
function partial(fieldsOrObjOrUnion) {
|
|
88
6
|
if (fieldsOrObjOrUnion.isConvexValidator) {
|
|
@@ -276,4 +194,4 @@ function vRequired(validator) {
|
|
|
276
194
|
}
|
|
277
195
|
|
|
278
196
|
//#endregion
|
|
279
|
-
export { pretendRequired as a,
|
|
197
|
+
export { pretendRequired as a, pretend as i, deprecated as n, vRequired as o, partial as r, addFieldsToValidator as t };
|
package/dist/watcher.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { Dt as logger, Et as getConvexConfig, F as resolveRunDeps, Tt as generateMeta, j as resolveConfiguredBackend, q as withLocalCodegenEnv } from "./backend-core-yq-eWLRJ.mjs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
|