kitcn 0.12.27 → 0.13.0
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-CXmrWqdi.mjs} +122 -48
- 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/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/orm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as vectorIndex, B as ConvexColumnBuilder, C as RlsPolicy, D as rankIndex, E as index, F as arrayOf, I as custom, L as json, M as createSystemFields, N as integer, O as searchIndex, P as id, R as objectOf, S as TablePolymorphic, T as aggregateIndex, V as entityKind, _ as OrmSchemaRelations, a as deletion, b as TableDeleteConfig, c as Columns, d as OrmSchemaDefinition, f as OrmSchemaExtensionRelations, g as OrmSchemaOptions, h as OrmSchemaExtensions, i as convexTable, j as text, k as uniqueIndex, l as EnableRLS, m as OrmSchemaExtensionTriggers, o as discriminator, p as OrmSchemaExtensionTables, s as Brand, t as DirectAggregate, u as OrmContext, v as OrmSchemaTriggers, w as rlsPolicy, x as TableName, y as RlsPolicies, z as unionOf } from "../runtime-
|
|
2
|
-
import { a as pretendRequired, i as pretend, n as deprecated } from "../validators-
|
|
3
|
-
import { A as ne, C as inArray, D as like, E as isNull, F as notLike, I as or, L as startsWith, M as notBetween, N as notIlike, O as lt, P as notInArray, S as ilike, T as isNotNull, _ as endsWith, a as mergedStream, b as gt, c as isUnsetToken, d as arrayContained, f as arrayContains, g as contains, h as column, i as getIndexFields, j as not, k as lte, l as unsetToken, m as between, n as EmptyStream, o as stream, p as arrayOverlaps, r as QueryStream, s as streamIndexRange, t as getByIdWithOrmQueryFallback, u as and, v as eq, w as isFieldReference, x as gte, y as fieldRef } from "../query-context-
|
|
1
|
+
import { A as vectorIndex, B as ConvexColumnBuilder, C as RlsPolicy, D as rankIndex, E as index, F as arrayOf, I as custom, L as json, M as createSystemFields, N as integer, O as searchIndex, P as id, R as objectOf, S as TablePolymorphic, T as aggregateIndex, V as entityKind, _ as OrmSchemaRelations, a as deletion, b as TableDeleteConfig, c as Columns, d as OrmSchemaDefinition, f as OrmSchemaExtensionRelations, g as OrmSchemaOptions, h as OrmSchemaExtensions, i as convexTable, j as text, k as uniqueIndex, l as EnableRLS, m as OrmSchemaExtensionTriggers, o as discriminator, p as OrmSchemaExtensionTables, s as Brand, t as DirectAggregate, u as OrmContext, v as OrmSchemaTriggers, w as rlsPolicy, x as TableName, y as RlsPolicies, z as unionOf } from "../runtime-i6t-HoZn.js";
|
|
2
|
+
import { a as pretendRequired, i as pretend, n as deprecated } from "../validators-C7LelqTN.js";
|
|
3
|
+
import { A as ne, C as inArray, D as like, E as isNull, F as notLike, I as or, L as startsWith, M as notBetween, N as notIlike, O as lt, P as notInArray, S as ilike, T as isNotNull, _ as endsWith, a as mergedStream, b as gt, c as isUnsetToken, d as arrayContained, f as arrayContains, g as contains, h as column, i as getIndexFields, j as not, k as lte, l as unsetToken, m as between, n as EmptyStream, o as stream, p as arrayOverlaps, r as QueryStream, s as streamIndexRange, t as getByIdWithOrmQueryFallback, u as and, v as eq, w as isFieldReference, x as gte, y as fieldRef } from "../query-context-ydn9kb6P.js";
|
|
4
4
|
import { v } from "convex/values";
|
|
5
5
|
import { defineSchema as defineSchema$1, internalActionGeneric, internalMutationGeneric } from "convex/server";
|
|
6
6
|
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as PluginConfigureResolver, i as PluginConfigureInput, n as PluginApiScope, o as definePlugin, r as PluginConfigureContext, s as resolvePluginOptions, t as Plugin } from "../middleware-
|
|
1
|
+
import { a as PluginConfigureResolver, i as PluginConfigureInput, n as PluginApiScope, o as definePlugin, r as PluginConfigureContext, s as resolvePluginOptions, t as Plugin } from "../middleware-DrtexzF3.js";
|
|
2
2
|
export { type Plugin, type PluginApiScope, type PluginConfigureContext, type PluginConfigureInput, type PluginConfigureResolver, definePlugin, resolvePluginOptions };
|
package/dist/plugins/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as decodeWire, o as encodeWire } from "./transformer-
|
|
2
|
-
import { _ as CRPCError } from "./builder-
|
|
1
|
+
import { i as decodeWire, o as encodeWire } from "./transformer-C6pGVHqx.js";
|
|
2
|
+
import { _ as CRPCError } from "./builder-DBgto1yn.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
|
|
5
5
|
//#region src/server/env.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as VRequired } from "./validators-
|
|
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-
|
|
3
|
-
import { g as UnsetMarker, i as IntersectIfDefined, o as MiddlewareBuilder, p as Overwrite$1, s as MiddlewareFunction, t as AnyMiddleware } from "./types-
|
|
1
|
+
import { t as VRequired } from "./validators-BhsByJeg.js";
|
|
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-zsMHb_QN.js";
|
|
3
|
+
import { g as UnsetMarker, i as IntersectIfDefined, o as MiddlewareBuilder, p as Overwrite$1, s as MiddlewareFunction, t as AnyMiddleware } from "./types-CnTpHR1F.js";
|
|
4
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 { ActionBuilder, ArgsArrayToObject, DefaultFunctionArgs, FunctionReference, FunctionReturnType, FunctionVisibility, GenericActionCtx, GenericDataModel, GenericMutationCtx, GenericQueryCtx, MutationBuilder, QueryBuilder, RegisteredAction, RegisteredMutation, RegisteredQuery, TableNamesInDataModel } from "convex/server";
|
|
6
6
|
import { z } from "zod";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as MiddlewareBuilder } from "../types-
|
|
2
|
-
import { t as Plugin } from "../middleware-
|
|
1
|
+
import { o as MiddlewareBuilder } from "../types-CnTpHR1F.js";
|
|
2
|
+
import { t as Plugin } from "../middleware-DrtexzF3.js";
|
|
3
3
|
import * as convex_server0 from "convex/server";
|
|
4
4
|
|
|
5
5
|
//#region src/ratelimit/duration.d.ts
|
package/dist/ratelimit/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { u as requireMutationCtx } from "../api-entry-
|
|
2
|
-
import { _ as CRPCError } from "../builder-
|
|
3
|
-
import { t as definePlugin } from "../middleware-
|
|
1
|
+
import { u as requireMutationCtx } from "../api-entry-N3nBOlI2.js";
|
|
2
|
+
import { _ as CRPCError } from "../builder-DBgto1yn.js";
|
|
3
|
+
import { t as definePlugin } from "../middleware-Bg-PdtrI.js";
|
|
4
4
|
import { v } from "convex/values";
|
|
5
5
|
import { mutationGeneric, queryGeneric } from "convex/server";
|
|
6
6
|
|
package/dist/react/index.d.ts
CHANGED
|
@@ -41,7 +41,10 @@ declare function isAuthMutationError(error: unknown): error is AuthMutationError
|
|
|
41
41
|
//#endregion
|
|
42
42
|
//#region src/react/auth-mutations.d.ts
|
|
43
43
|
type MutationOptionsHook<TData, TVariables = void> = (options?: Omit<UseMutationOptions<TData, DefaultError, TVariables>, 'mutationFn'>) => UseMutationOptions<TData, DefaultError, TVariables>;
|
|
44
|
-
type AnyFn = (...args:
|
|
44
|
+
type AnyFn = (...args: unknown[]) => Promise<unknown>;
|
|
45
|
+
type MutationArgsWithFetchOptions = {
|
|
46
|
+
fetchOptions?: Record<string, unknown>;
|
|
47
|
+
};
|
|
45
48
|
type AuthClient = {
|
|
46
49
|
$store?: {
|
|
47
50
|
atoms?: {
|
|
@@ -68,21 +71,16 @@ type AuthClient = {
|
|
|
68
71
|
};
|
|
69
72
|
};
|
|
70
73
|
getSession?: AnyFn;
|
|
71
|
-
signOut
|
|
72
|
-
signIn
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
signOut?: AnyFn;
|
|
75
|
+
signIn?: {
|
|
76
|
+
anonymous?: AnyFn;
|
|
77
|
+
social?: AnyFn;
|
|
78
|
+
email?: AnyFn;
|
|
75
79
|
};
|
|
76
|
-
signUp
|
|
77
|
-
email
|
|
80
|
+
signUp?: {
|
|
81
|
+
email?: AnyFn;
|
|
78
82
|
};
|
|
79
83
|
};
|
|
80
|
-
type AuthMutationsResult<T extends AuthClient> = {
|
|
81
|
-
useSignOutMutationOptions: MutationOptionsHook<Awaited<ReturnType<T['signOut']>>, Parameters<T['signOut']>[0] | void>;
|
|
82
|
-
useSignInSocialMutationOptions: MutationOptionsHook<Awaited<ReturnType<T['signIn']['social']>>, Parameters<T['signIn']['social']>[0]>;
|
|
83
|
-
useSignInMutationOptions: MutationOptionsHook<Awaited<ReturnType<T['signIn']['email']>>, Parameters<T['signIn']['email']>[0]>;
|
|
84
|
-
useSignUpMutationOptions: MutationOptionsHook<Awaited<ReturnType<T['signUp']['email']>>, Parameters<T['signUp']['email']>[0]>;
|
|
85
|
-
};
|
|
86
84
|
/**
|
|
87
85
|
* Create mutation option hooks from a better-auth client.
|
|
88
86
|
*
|
|
@@ -106,7 +104,13 @@ type AuthMutationsResult<T extends AuthClient> = {
|
|
|
106
104
|
* }));
|
|
107
105
|
* ```
|
|
108
106
|
*/
|
|
109
|
-
|
|
107
|
+
type AuthMutationsResult = {
|
|
108
|
+
useSignOutMutationOptions: MutationOptionsHook<unknown, MutationArgsWithFetchOptions | void>;
|
|
109
|
+
useSignInSocialMutationOptions: MutationOptionsHook<unknown, unknown>;
|
|
110
|
+
useSignInMutationOptions: MutationOptionsHook<unknown, unknown>;
|
|
111
|
+
useSignUpMutationOptions: MutationOptionsHook<unknown, unknown>;
|
|
112
|
+
};
|
|
113
|
+
declare function createAuthMutations(authClient: AuthClient): AuthMutationsResult;
|
|
110
114
|
//#endregion
|
|
111
115
|
//#region src/react/auth-store.d.ts
|
|
112
116
|
type FetchAccessTokenFn = (args: {
|
package/dist/react/index.js
CHANGED
|
@@ -1388,6 +1388,12 @@ const seedReturnedToken = (store, value) => {
|
|
|
1388
1388
|
store.set("sessionSyncGraceUntil", Date.now() + AUTH_SESSION_SYNC_GRACE_MS);
|
|
1389
1389
|
if (decodeJwtExp(token) === null) writeAuthSessionFallbackToken(token);
|
|
1390
1390
|
};
|
|
1391
|
+
const toAuthMutationError = (error) => new AuthMutationError({
|
|
1392
|
+
code: error?.code,
|
|
1393
|
+
message: error?.message,
|
|
1394
|
+
status: error?.status ?? 500,
|
|
1395
|
+
statusText: error?.statusText ?? "AUTH_ERROR"
|
|
1396
|
+
});
|
|
1391
1397
|
const syncSessionAtom = (authClient, sessionData) => {
|
|
1392
1398
|
const sessionAtom = authClient.$store?.atoms?.session;
|
|
1393
1399
|
if (typeof sessionAtom?.get !== "function" || typeof sessionAtom.set !== "function") return;
|
|
@@ -1422,29 +1428,6 @@ const withDisabledSessionSignal = (args) => {
|
|
|
1422
1428
|
}
|
|
1423
1429
|
};
|
|
1424
1430
|
};
|
|
1425
|
-
/**
|
|
1426
|
-
* Create mutation option hooks from a better-auth client.
|
|
1427
|
-
*
|
|
1428
|
-
* @example
|
|
1429
|
-
* ```tsx
|
|
1430
|
-
* // lib/auth-client.ts
|
|
1431
|
-
* import { createAuthMutations } from 'kitcn/react';
|
|
1432
|
-
*
|
|
1433
|
-
* export const authClient = createAuthClient({...});
|
|
1434
|
-
*
|
|
1435
|
-
* export const {
|
|
1436
|
-
* useSignOutMutationOptions,
|
|
1437
|
-
* useSignInSocialMutationOptions,
|
|
1438
|
-
* useSignInMutationOptions,
|
|
1439
|
-
* useSignUpMutationOptions,
|
|
1440
|
-
* } = createAuthMutations(authClient);
|
|
1441
|
-
*
|
|
1442
|
-
* // components/header.tsx
|
|
1443
|
-
* const signOutMutation = useMutation(useSignOutMutationOptions({
|
|
1444
|
-
* onSuccess: () => router.push('/login'),
|
|
1445
|
-
* }));
|
|
1446
|
-
* ```
|
|
1447
|
-
*/
|
|
1448
1431
|
function createAuthMutations(authClient) {
|
|
1449
1432
|
const useSignOutMutationOptions = ((options) => {
|
|
1450
1433
|
const convexQueryClient = useConvexQueryClient();
|
|
@@ -1452,10 +1435,11 @@ function createAuthMutations(authClient) {
|
|
|
1452
1435
|
return {
|
|
1453
1436
|
...options,
|
|
1454
1437
|
mutationFn: async (args) => {
|
|
1438
|
+
if (typeof authClient.signOut !== "function") throw new Error("Auth client does not expose signOut");
|
|
1455
1439
|
authStoreApi.set("isAuthenticated", false);
|
|
1456
1440
|
convexQueryClient?.unsubscribeAuthQueries();
|
|
1457
1441
|
const res = await authClient.signOut(args);
|
|
1458
|
-
if (res?.error) throw
|
|
1442
|
+
if (res?.error) throw toAuthMutationError(res.error);
|
|
1459
1443
|
authStoreApi.set("token", null);
|
|
1460
1444
|
authStoreApi.set("expiresAt", null);
|
|
1461
1445
|
authStoreApi.set("sessionSyncGraceUntil", null);
|
|
@@ -1471,8 +1455,9 @@ function createAuthMutations(authClient) {
|
|
|
1471
1455
|
return {
|
|
1472
1456
|
...options,
|
|
1473
1457
|
mutationFn: async (args) => {
|
|
1458
|
+
if (typeof authClient.signIn?.social !== "function") throw new Error("Auth client does not expose signIn.social");
|
|
1474
1459
|
const res = await authClient.signIn.social(withDisabledSessionSignal(args));
|
|
1475
|
-
if (res?.error) throw
|
|
1460
|
+
if (res?.error) throw toAuthMutationError(res.error);
|
|
1476
1461
|
seedReturnedToken(authStoreApi, res);
|
|
1477
1462
|
await hydrateReturnedSession(authClient, res);
|
|
1478
1463
|
await ensureAuth(authStoreApi);
|
|
@@ -1488,8 +1473,9 @@ function createAuthMutations(authClient) {
|
|
|
1488
1473
|
return {
|
|
1489
1474
|
...options,
|
|
1490
1475
|
mutationFn: async (args) => {
|
|
1476
|
+
if (typeof authClient.signIn?.email !== "function") throw new Error("Auth client does not expose signIn.email");
|
|
1491
1477
|
const res = await authClient.signIn.email(withDisabledSessionSignal(args));
|
|
1492
|
-
if (res?.error) throw
|
|
1478
|
+
if (res?.error) throw toAuthMutationError(res.error);
|
|
1493
1479
|
seedReturnedToken(authStoreApi, res);
|
|
1494
1480
|
await hydrateReturnedSession(authClient, res);
|
|
1495
1481
|
await ensureAuth(authStoreApi);
|
|
@@ -1505,8 +1491,9 @@ function createAuthMutations(authClient) {
|
|
|
1505
1491
|
return {
|
|
1506
1492
|
...options,
|
|
1507
1493
|
mutationFn: async (args) => {
|
|
1494
|
+
if (typeof authClient.signUp?.email !== "function") throw new Error("Auth client does not expose signUp.email");
|
|
1508
1495
|
const res = await authClient.signUp.email(withDisabledSessionSignal(args));
|
|
1509
|
-
if (res?.error) throw
|
|
1496
|
+
if (res?.error) throw toAuthMutationError(res.error);
|
|
1510
1497
|
seedReturnedToken(authStoreApi, res);
|
|
1511
1498
|
await hydrateReturnedSession(authClient, res);
|
|
1512
1499
|
await ensureAuth(authStoreApi);
|
package/dist/rsc/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as DeepPartial, o as Simplify, r as DistributiveOmit } from "../types-
|
|
2
|
-
import { C as HttpProcedure, d as CRPCHttpRouter, j as DataTransformerOptions, p as HttpRouterRecord } from "../http-types-
|
|
3
|
-
import { g as UnsetMarker } from "../types-
|
|
4
|
-
import { A as HttpInputArgs, C as ReservedMutationOptions$1, S as ReservedInfiniteQueryOptions, T as StaticQueryOptsParam, _ as IsPaginated, b as PaginatedFnMeta, c as ConvexMutationKey, d as ConvexQueryMeta, f as EmptyObject, g as InfiniteQueryInput, l as ConvexQueryHookOptions, m as FUNC_REF_SYMBOL, o as ConvexActionKey, p as ExtractPaginatedItem, s as ConvexInfiniteQueryMeta, u as ConvexQueryKey, w as ReservedQueryOptions$1, y as MutationVariables } from "../types-
|
|
1
|
+
import { n as DeepPartial, o as Simplify, r as DistributiveOmit } from "../types-DF2cg_w0.js";
|
|
2
|
+
import { C as HttpProcedure, d as CRPCHttpRouter, j as DataTransformerOptions, p as HttpRouterRecord } from "../http-types-zsMHb_QN.js";
|
|
3
|
+
import { g as UnsetMarker } from "../types-CnTpHR1F.js";
|
|
4
|
+
import { A as HttpInputArgs, C as ReservedMutationOptions$1, S as ReservedInfiniteQueryOptions, T as StaticQueryOptsParam, _ as IsPaginated, b as PaginatedFnMeta, c as ConvexMutationKey, d as ConvexQueryMeta, f as EmptyObject, g as InfiniteQueryInput, l as ConvexQueryHookOptions, m as FUNC_REF_SYMBOL, o as ConvexActionKey, p as ExtractPaginatedItem, s as ConvexInfiniteQueryMeta, u as ConvexQueryKey, w as ReservedQueryOptions$1, y as MutationVariables } from "../types-YHpe0rsb.js";
|
|
5
5
|
import { FunctionArgs, FunctionReference, FunctionReturnType } from "convex/server";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
import { DefaultError, QueryFilters, SkipToken, UseMutationOptions, UseQueryOptions } from "@tanstack/react-query";
|
package/dist/rsc/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as defaultIsUnauthorized } from "../error-
|
|
2
|
-
import { n as getFuncRef, r as getFunctionMeta, t as buildMetaIndex } from "../meta-utils-
|
|
3
|
-
import { i as decodeWire, s as getTransformer } from "../transformer-
|
|
4
|
-
import { n as convexInfiniteQueryOptions, r as convexQuery } from "../query-options-
|
|
1
|
+
import { n as defaultIsUnauthorized } from "../error-Bvo7YEhk.js";
|
|
2
|
+
import { n as getFuncRef, r as getFunctionMeta, t as buildMetaIndex } from "../meta-utils-D9K4fICl.js";
|
|
3
|
+
import { i as decodeWire, s as getTransformer } from "../transformer-C6pGVHqx.js";
|
|
4
|
+
import { n as convexInfiniteQueryOptions, r as convexQuery } from "../query-options-C96zLANM.js";
|
|
5
5
|
import { convexToJson } from "convex/values";
|
|
6
6
|
import { getFunctionName } from "convex/server";
|
|
7
7
|
import { fetchAction, fetchQuery } from "convex/nextjs";
|
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 };
|