better-auth 1.6.26 → 1.6.28
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/adapters/index.d.mts +6 -1
- package/dist/api/dispatch.d.mts +1 -0
- package/dist/api/index.d.mts +508 -505
- package/dist/api/middlewares/authorization.d.mts +10 -14
- package/dist/api/middlewares/authorization.mjs +1 -2
- package/dist/api/middlewares/index.d.mts +1 -2
- package/dist/api/middlewares/origin-check.d.mts +5 -3
- package/dist/api/routes/account.d.mts +16 -13
- package/dist/api/routes/callback.d.mts +3 -1
- package/dist/api/routes/email-verification.d.mts +8 -4
- package/dist/api/routes/error.d.mts +3 -1
- package/dist/api/routes/index.d.mts +1 -2
- package/dist/api/routes/ok.d.mts +3 -1
- package/dist/api/routes/password.d.mts +10 -8
- package/dist/api/routes/session.d.mts +32 -30
- package/dist/api/routes/session.mjs +2 -3
- package/dist/api/routes/sign-in.d.mts +5 -3
- package/dist/api/routes/sign-out.d.mts +3 -1
- package/dist/api/routes/sign-up.d.mts +4 -3
- package/dist/api/routes/update-session.d.mts +5 -4
- package/dist/api/routes/update-user.d.mts +19 -18
- package/dist/auth/full.d.mts +1 -1
- package/dist/auth/minimal.d.mts +1 -1
- package/dist/client/config.d.mts +14 -12
- package/dist/client/config.mjs +2 -2
- package/dist/client/equality.d.mts +1 -0
- package/dist/client/index.d.mts +5 -6
- package/dist/client/lynx/index.d.mts +5 -4
- package/dist/client/lynx/lynx-store.d.mts +2 -1
- package/dist/client/parser.d.mts +3 -7
- package/dist/client/path-to-object.d.mts +4 -3
- package/dist/client/plugins/index.d.mts +1 -1
- package/dist/client/plugins/infer-plugin.d.mts +1 -0
- package/dist/client/query.d.mts +1 -0
- package/dist/client/react/index.d.mts +5 -4
- package/dist/client/react/react-store.d.mts +2 -1
- package/dist/client/session-atom.mjs +59 -46
- package/dist/client/session-refresh.d.mts +1 -0
- package/dist/client/solid/index.d.mts +5 -4
- package/dist/client/svelte/index.d.mts +5 -4
- package/dist/client/types.d.mts +2 -2
- package/dist/client/vanilla.d.mts +2 -1
- package/dist/client/vue/index.d.mts +5 -4
- package/dist/context/create-context.mjs +3 -3
- package/dist/context/helpers.mjs +2 -2
- package/dist/cookies/index.d.mts +7 -6
- package/dist/cookies/session-store.d.mts +0 -1
- package/dist/cookies/session-store.mjs +1 -2
- package/dist/crypto/index.d.mts +9 -2
- package/dist/crypto/jwt.d.mts +1 -0
- package/dist/crypto/password.d.mts +5 -1
- package/dist/db/adapter-base.d.mts +1 -0
- package/dist/db/adapter-kysely.d.mts +1 -0
- package/dist/db/field-converter.d.mts +1 -0
- package/dist/db/field.d.mts +10 -9
- package/dist/db/get-migration.d.mts +1 -0
- package/dist/db/get-schema.d.mts +1 -0
- package/dist/db/internal-adapter.d.mts +1 -0
- package/dist/db/internal-adapter.mjs +1 -2
- package/dist/db/revoke-unproven-account-access.d.mts +1 -0
- package/dist/db/schema.d.mts +2 -2
- package/dist/db/to-zod.d.mts +7 -3
- package/dist/db/with-hooks.d.mts +1 -0
- package/dist/index.d.mts +3 -4
- package/dist/integrations/next-js.d.mts +7 -4
- package/dist/integrations/node.d.mts +3 -2
- package/dist/integrations/svelte-kit.d.mts +9 -2
- package/dist/integrations/tanstack-start-solid.d.mts +5 -2
- package/dist/integrations/tanstack-start.d.mts +5 -2
- package/dist/oauth2/link-account.d.mts +1 -1
- package/dist/oauth2/state.d.mts +1 -0
- package/dist/oauth2/utils.d.mts +1 -0
- package/dist/package.mjs +1 -1
- package/dist/plugins/access/access.d.mts +1 -0
- package/dist/plugins/access/types.d.mts +5 -4
- package/dist/plugins/additional-fields/client.d.mts +1 -0
- package/dist/plugins/admin/access/statement.d.mts +0 -1
- package/dist/plugins/admin/admin.d.mts +137 -132
- package/dist/plugins/admin/client.d.mts +30 -30
- package/dist/plugins/admin/client.mjs +1 -1
- package/dist/plugins/admin/error-codes.d.mts +25 -23
- package/dist/plugins/admin/index.d.mts +1 -1
- package/dist/plugins/admin/schema.d.mts +1 -1
- package/dist/plugins/admin/types.d.mts +2 -3
- package/dist/plugins/anonymous/client.d.mts +11 -9
- package/dist/plugins/anonymous/client.mjs +1 -1
- package/dist/plugins/anonymous/error-codes.d.mts +10 -8
- package/dist/plugins/anonymous/index.d.mts +19 -15
- package/dist/plugins/anonymous/types.d.mts +1 -1
- package/dist/plugins/bearer/index.d.mts +8 -5
- package/dist/plugins/captcha/index.d.mts +8 -5
- package/dist/plugins/captcha/types.d.mts +1 -0
- package/dist/plugins/custom-session/client.d.mts +1 -0
- package/dist/plugins/custom-session/index.d.mts +12 -7
- package/dist/plugins/device-authorization/client.d.mts +1 -0
- package/dist/plugins/device-authorization/index.d.mts +22 -19
- package/dist/plugins/email-otp/client.d.mts +6 -4
- package/dist/plugins/email-otp/client.mjs +1 -1
- package/dist/plugins/email-otp/error-codes.d.mts +5 -3
- package/dist/plugins/email-otp/index.d.mts +76 -69
- package/dist/plugins/email-otp/types.d.mts +1 -0
- package/dist/plugins/generic-oauth/client.d.mts +11 -10
- package/dist/plugins/generic-oauth/client.mjs +1 -1
- package/dist/plugins/generic-oauth/error-codes.d.mts +10 -8
- package/dist/plugins/generic-oauth/index.d.mts +45 -41
- package/dist/plugins/generic-oauth/providers/auth0.d.mts +1 -0
- package/dist/plugins/generic-oauth/providers/gumroad.d.mts +1 -0
- package/dist/plugins/generic-oauth/providers/hubspot.d.mts +1 -0
- package/dist/plugins/generic-oauth/providers/index.d.mts +1 -2
- package/dist/plugins/generic-oauth/providers/keycloak.d.mts +1 -0
- package/dist/plugins/generic-oauth/providers/line.d.mts +1 -0
- package/dist/plugins/generic-oauth/providers/microsoft-entra-id.d.mts +1 -0
- package/dist/plugins/generic-oauth/providers/okta.d.mts +1 -0
- package/dist/plugins/generic-oauth/providers/patreon.d.mts +1 -0
- package/dist/plugins/generic-oauth/providers/slack.d.mts +1 -0
- package/dist/plugins/generic-oauth/providers/yandex.d.mts +1 -0
- package/dist/plugins/generic-oauth/types.d.mts +2 -1
- package/dist/plugins/haveibeenpwned/index.d.mts +6 -3
- package/dist/plugins/index.d.mts +1 -4
- package/dist/plugins/jwt/client.d.mts +2 -1
- package/dist/plugins/jwt/index.d.mts +12 -9
- package/dist/plugins/jwt/sign.d.mts +2 -2
- package/dist/plugins/jwt/types.d.mts +1 -1
- package/dist/plugins/jwt/utils.d.mts +4 -2
- package/dist/plugins/jwt/verify.d.mts +1 -0
- package/dist/plugins/last-login-method/index.d.mts +6 -3
- package/dist/plugins/magic-link/client.d.mts +1 -0
- package/dist/plugins/magic-link/index.d.mts +6 -4
- package/dist/plugins/mcp/client/adapters.d.mts +1 -0
- package/dist/plugins/mcp/client/index.mjs +2 -4
- package/dist/plugins/mcp/index.d.mts +12 -11
- package/dist/plugins/multi-session/client.d.mts +4 -2
- package/dist/plugins/multi-session/client.mjs +1 -1
- package/dist/plugins/multi-session/error-codes.d.mts +3 -1
- package/dist/plugins/multi-session/index.d.mts +12 -8
- package/dist/plugins/oauth-popup/client.d.mts +12 -6
- package/dist/plugins/oauth-popup/client.mjs +3 -5
- package/dist/plugins/oauth-popup/error-codes.d.mts +6 -4
- package/dist/plugins/oauth-popup/index.d.mts +12 -8
- package/dist/plugins/oauth-popup/index.mjs +1 -1
- package/dist/plugins/oauth-popup/types.d.mts +2 -1
- package/dist/plugins/oauth-proxy/index.d.mts +9 -6
- package/dist/plugins/oauth-proxy/index.mjs +2 -2
- package/dist/plugins/oidc-provider/client.d.mts +2 -1
- package/dist/plugins/oidc-provider/index.d.mts +20 -18
- package/dist/plugins/oidc-provider/schema.d.mts +1 -0
- package/dist/plugins/oidc-provider/types.d.mts +1 -1
- package/dist/plugins/one-tap/client.d.mts +3 -1
- package/dist/plugins/one-tap/index.d.mts +3 -1
- package/dist/plugins/one-time-token/client.d.mts +2 -1
- package/dist/plugins/one-time-token/index.d.mts +7 -6
- package/dist/plugins/open-api/generator.d.mts +1 -0
- package/dist/plugins/open-api/generator.mjs +5 -5
- package/dist/plugins/open-api/index.d.mts +5 -3
- package/dist/plugins/organization/access/statement.d.mts +0 -1
- package/dist/plugins/organization/adapter.d.mts +82 -56
- package/dist/plugins/organization/client.d.mts +103 -104
- package/dist/plugins/organization/client.mjs +4 -7
- package/dist/plugins/organization/error-codes.d.mts +61 -59
- package/dist/plugins/organization/has-permission.d.mts +1 -0
- package/dist/plugins/organization/has-permission.mjs +1 -1
- package/dist/plugins/organization/index.d.mts +1 -1
- package/dist/plugins/organization/organization.d.mts +33 -9
- package/dist/plugins/organization/organization.mjs +1 -1
- package/dist/plugins/organization/permission.d.mts +2 -2
- package/dist/plugins/organization/routes/crud-access-control.d.mts +147 -27
- package/dist/plugins/organization/routes/crud-invites.d.mts +186 -65
- package/dist/plugins/organization/routes/crud-invites.mjs +1 -1
- package/dist/plugins/organization/routes/crud-members.d.mts +178 -56
- package/dist/plugins/organization/routes/crud-members.mjs +1 -1
- package/dist/plugins/organization/routes/crud-org.d.mts +130 -57
- package/dist/plugins/organization/routes/crud-team.d.mts +235 -66
- package/dist/plugins/organization/schema.d.mts +4 -4
- package/dist/plugins/organization/schema.mjs +1 -1
- package/dist/plugins/organization/types.d.mts +14 -14
- package/dist/plugins/phone-number/client.d.mts +15 -13
- package/dist/plugins/phone-number/client.mjs +1 -1
- package/dist/plugins/phone-number/error-codes.d.mts +14 -12
- package/dist/plugins/phone-number/index.d.mts +47 -41
- package/dist/plugins/phone-number/types.d.mts +1 -1
- package/dist/plugins/siwe/client.d.mts +1 -0
- package/dist/plugins/siwe/index.d.mts +5 -4
- package/dist/plugins/test-utils/index.d.mts +4 -2
- package/dist/plugins/test-utils/types.d.mts +0 -1
- package/dist/plugins/two-factor/backup-codes/index.d.mts +7 -5
- package/dist/plugins/two-factor/backup-codes/index.mjs +1 -1
- package/dist/plugins/two-factor/client.d.mts +15 -12
- package/dist/plugins/two-factor/client.mjs +1 -1
- package/dist/plugins/two-factor/error-code.d.mts +12 -10
- package/dist/plugins/two-factor/index.d.mts +36 -32
- package/dist/plugins/two-factor/otp/index.d.mts +4 -2
- package/dist/plugins/two-factor/totp/index.d.mts +7 -5
- package/dist/plugins/two-factor/types.d.mts +1 -1
- package/dist/plugins/username/client.d.mts +11 -9
- package/dist/plugins/username/client.mjs +1 -1
- package/dist/plugins/username/error-codes.d.mts +10 -8
- package/dist/plugins/username/index.d.mts +22 -17
- package/dist/plugins/username/schema.d.mts +5 -3
- package/dist/state.d.mts +1 -0
- package/dist/test-utils/test-instance.d.mts +3 -5
- package/dist/types/adapter.d.mts +1 -1
- package/dist/types/api.d.mts +2 -1
- package/dist/types/auth.d.mts +1 -0
- package/dist/types/helper.d.mts +5 -5
- package/dist/types/index.d.mts +2 -2
- package/dist/types/models.d.mts +1 -0
- package/dist/types/plugins.d.mts +3 -2
- package/dist/utils/index.d.mts +1 -2
- package/dist/utils/url.d.mts +1 -0
- package/package.json +12 -11
package/dist/db/to-zod.d.mts
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { DBFieldAttribute } from "@better-auth/core/db";
|
|
2
2
|
import * as z from "zod";
|
|
3
|
+
|
|
3
4
|
//#region src/db/to-zod.d.ts
|
|
4
|
-
declare function toZodSchema<Fields extends Record<string, DBFieldAttribute | never>, IsClientSide extends boolean>({
|
|
5
|
+
declare function toZodSchema<Fields extends Record<string, DBFieldAttribute | never>, IsClientSide extends boolean>({
|
|
6
|
+
fields,
|
|
7
|
+
isClientSide
|
|
8
|
+
}: {
|
|
5
9
|
fields: Fields;
|
|
6
10
|
/**
|
|
7
11
|
* If true, then any fields that have `input: false` will be removed from the schema to prevent user input.
|
|
8
12
|
*/
|
|
9
13
|
isClientSide: IsClientSide;
|
|
10
|
-
}): z.ZodObject<RemoveNeverProps<{ [key in keyof Fields]: FieldAttributeToSchema<Fields[key], IsClientSide
|
|
14
|
+
}): z.ZodObject<RemoveNeverProps<{ [key in keyof Fields]: FieldAttributeToSchema<Fields[key], IsClientSide> }>, z.core.$strip>;
|
|
11
15
|
type FieldAttributeToSchema<Field extends DBFieldAttribute | Record<string, never>, isClientSide extends boolean = false> = Field extends {
|
|
12
16
|
type: any;
|
|
13
17
|
} ? GetInput<isClientSide, Field, GetRequired<Field, GetType<Field>>> : Record<string, never>;
|
|
@@ -26,6 +30,6 @@ type GetRequired<F extends DBFieldAttribute, Schema extends z.core.SomeType> = F
|
|
|
26
30
|
type GetInput<isClientSide extends boolean, Field extends DBFieldAttribute, Schema extends z.core.SomeType> = Field extends {
|
|
27
31
|
input: false;
|
|
28
32
|
} ? isClientSide extends true ? never : Schema : Schema;
|
|
29
|
-
type RemoveNeverProps<T> = { [K in keyof T as [T[K]] extends [never] ? never : K]: T[K]
|
|
33
|
+
type RemoveNeverProps<T> = { [K in keyof T as [T[K]] extends [never] ? never : K]: T[K] };
|
|
30
34
|
//#endregion
|
|
31
35
|
export { FieldAttributeToSchema, toZodSchema };
|
package/dist/db/with-hooks.d.mts
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -11,7 +11,6 @@ import { generateState, parseState } from "./oauth2/state.mjs";
|
|
|
11
11
|
import { StateData, generateGenericState, parseGenericState } from "./state.mjs";
|
|
12
12
|
import { HIDE_METADATA } from "./utils/hide-metadata.mjs";
|
|
13
13
|
import { getBaseURL, getHost, getHostFromSource, getOrigin, getProtocol, getProtocolFromSource, isDynamicBaseURLConfig, isRequestLike, matchesHostPattern, resolveBaseURL, resolveDynamicBaseURL, trimTrailingSlashes } from "./utils/url.mjs";
|
|
14
|
-
import "./utils/index.mjs";
|
|
15
14
|
import { APIError } from "./api/index.mjs";
|
|
16
15
|
import { StandardSchemaV1 } from "@better-auth/core";
|
|
17
16
|
import { getCurrentAdapter } from "@better-auth/core/context";
|
|
@@ -26,6 +25,6 @@ export * from "@better-auth/core/utils/error-codes";
|
|
|
26
25
|
export * from "@better-auth/core/utils/id";
|
|
27
26
|
export * from "@better-auth/core/utils/json";
|
|
28
27
|
export * from "@better-auth/core/social-providers";
|
|
29
|
-
export
|
|
30
|
-
export
|
|
31
|
-
export { APIError,
|
|
28
|
+
export * from "better-call";
|
|
29
|
+
export * from "zod";
|
|
30
|
+
export { APIError, Account, AdditionalSessionFieldsInput, AdditionalUserFieldsInput, Auth, BetterAuthAdvancedOptions, BetterAuthClientOptions, BetterAuthClientPlugin, BetterAuthCookies, BetterAuthOptions, BetterAuthPlugin, BetterAuthRateLimitOptions, ClientAtomListener, ClientStore, DBAdapter, DBAdapterInstance, DBAdapterSchemaCreation, DBTransactionAdapter, ExtractPluginField, FilteredAPI, HIDE_METADATA, HasRequiredKeys, InferAPI, InferActions, InferAdditionalFromClient, InferClientAPI, InferErrorCodes, InferOptionSchema, InferPluginContext, InferPluginErrorCodes, InferPluginFieldFromTuple, InferPluginIDs, InferPluginTypes, InferSessionAPI, InferSessionFromClient, InferUserFromClient, IsAny, IsSignal, type JSONWebKeySet, type JWTPayload, JoinConfig, JoinOption, OverrideMerge, Prettify, PrettifyDeep, RateLimit, RequiredKeysOf, Session, SessionQueryParams, type StandardSchemaV1, StateData, StoreIdentifierOption, StripEmptyObjects, type TelemetryEvent, UnionToIntersection, User, Verification, Where, betterAuth, createTelemetry, generateGenericState, generateState, getBaseURL, getCurrentAdapter, getHost, getHostFromSource, getOrigin, getProtocol, getProtocolFromSource, getTelemetryAuthConfig, isDynamicBaseURLConfig, isRequestLike, matchesHostPattern, parseGenericState, parseState, resolveBaseURL, resolveDynamicBaseURL, trimTrailingSlashes };
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import * as _$_better_auth_core0 from "@better-auth/core";
|
|
2
|
+
import * as _$better_call0 from "better-call";
|
|
3
|
+
|
|
1
4
|
//#region src/integrations/next-js.d.ts
|
|
2
5
|
declare function toNextJsHandler(auth: {
|
|
3
6
|
handler: (request: Request) => Promise<Response>;
|
|
@@ -13,12 +16,12 @@ declare const nextCookies: () => {
|
|
|
13
16
|
version: string;
|
|
14
17
|
hooks: {
|
|
15
18
|
before: {
|
|
16
|
-
matcher(ctx:
|
|
17
|
-
handler: (inputContext:
|
|
19
|
+
matcher(ctx: _$_better_auth_core0.HookEndpointContext): boolean;
|
|
20
|
+
handler: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<void>>;
|
|
18
21
|
}[];
|
|
19
22
|
after: {
|
|
20
|
-
matcher(ctx:
|
|
21
|
-
handler: (inputContext:
|
|
23
|
+
matcher(ctx: _$_better_auth_core0.HookEndpointContext): true;
|
|
24
|
+
handler: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<void>>;
|
|
22
25
|
}[];
|
|
23
26
|
};
|
|
24
27
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Auth } from "../types/auth.mjs";
|
|
2
|
-
import "
|
|
2
|
+
import * as _$node_http0 from "node:http";
|
|
3
3
|
import { IncomingHttpHeaders } from "node:http";
|
|
4
|
+
|
|
4
5
|
//#region src/integrations/node.d.ts
|
|
5
6
|
declare const toNodeHandler: (auth: {
|
|
6
7
|
handler: Auth["handler"];
|
|
7
|
-
} | Auth["handler"]) => (req:
|
|
8
|
+
} | Auth["handler"]) => (req: _$node_http0.IncomingMessage, res: _$node_http0.ServerResponse) => Promise<void>;
|
|
8
9
|
declare function fromNodeHeaders(nodeHeaders: IncomingHttpHeaders): Headers;
|
|
9
10
|
//#endregion
|
|
10
11
|
export { fromNodeHeaders, toNodeHandler };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { BetterAuthOptions } from "../types/index.mjs";
|
|
2
|
+
import * as _$better_call0 from "better-call";
|
|
2
3
|
import { RequestEvent } from "@sveltejs/kit";
|
|
4
|
+
|
|
3
5
|
//#region src/integrations/svelte-kit.d.ts
|
|
4
6
|
declare const toSvelteKitHandler: (auth: {
|
|
5
7
|
handler: (request: Request) => Response | Promise<Response>;
|
|
@@ -7,7 +9,12 @@ declare const toSvelteKitHandler: (auth: {
|
|
|
7
9
|
}) => (event: {
|
|
8
10
|
request: Request;
|
|
9
11
|
}) => Response | Promise<Response>;
|
|
10
|
-
declare const svelteKitHandler: ({
|
|
12
|
+
declare const svelteKitHandler: ({
|
|
13
|
+
auth,
|
|
14
|
+
event,
|
|
15
|
+
resolve,
|
|
16
|
+
building
|
|
17
|
+
}: {
|
|
11
18
|
auth: {
|
|
12
19
|
handler: (request: Request) => Response | Promise<Response>;
|
|
13
20
|
options: BetterAuthOptions;
|
|
@@ -23,7 +30,7 @@ declare const sveltekitCookies: (getRequestEvent: () => RequestEvent<any, any>)
|
|
|
23
30
|
hooks: {
|
|
24
31
|
after: {
|
|
25
32
|
matcher(): true;
|
|
26
|
-
handler: (inputContext:
|
|
33
|
+
handler: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<void>>;
|
|
27
34
|
}[];
|
|
28
35
|
};
|
|
29
36
|
};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import * as _$_better_auth_core0 from "@better-auth/core";
|
|
2
|
+
import * as _$better_call0 from "better-call";
|
|
3
|
+
|
|
1
4
|
//#region src/integrations/tanstack-start-solid.d.ts
|
|
2
5
|
/**
|
|
3
6
|
* TanStack Start cookie plugin for Solid.js.
|
|
@@ -21,8 +24,8 @@ declare const tanstackStartCookies: () => {
|
|
|
21
24
|
version: string;
|
|
22
25
|
hooks: {
|
|
23
26
|
after: {
|
|
24
|
-
matcher(ctx:
|
|
25
|
-
handler: (inputContext:
|
|
27
|
+
matcher(ctx: _$_better_auth_core0.HookEndpointContext): true;
|
|
28
|
+
handler: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<void>>;
|
|
26
29
|
}[];
|
|
27
30
|
};
|
|
28
31
|
};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import * as _$_better_auth_core0 from "@better-auth/core";
|
|
2
|
+
import * as _$better_call0 from "better-call";
|
|
3
|
+
|
|
1
4
|
//#region src/integrations/tanstack-start.d.ts
|
|
2
5
|
/**
|
|
3
6
|
* TanStack Start cookie plugin for React.
|
|
@@ -21,8 +24,8 @@ declare const tanstackStartCookies: () => {
|
|
|
21
24
|
version: string;
|
|
22
25
|
hooks: {
|
|
23
26
|
after: {
|
|
24
|
-
matcher(ctx:
|
|
25
|
-
handler: (inputContext:
|
|
27
|
+
matcher(ctx: _$_better_auth_core0.HookEndpointContext): true;
|
|
28
|
+
handler: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<void>>;
|
|
26
29
|
}[];
|
|
27
30
|
};
|
|
28
31
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Account, User } from "../types/models.mjs";
|
|
2
|
-
import "../types/index.mjs";
|
|
3
2
|
import { GenericEndpointContext } from "@better-auth/core";
|
|
3
|
+
|
|
4
4
|
//#region src/oauth2/link-account.d.ts
|
|
5
5
|
declare function handleOAuthUserInfo(c: GenericEndpointContext, opts: {
|
|
6
6
|
userInfo: Omit<User, "createdAt" | "updatedAt">;
|
package/dist/oauth2/state.d.mts
CHANGED
package/dist/oauth2/utils.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AuthContext } from "@better-auth/core";
|
|
2
|
+
|
|
2
3
|
//#region src/oauth2/utils.d.ts
|
|
3
4
|
declare function decryptOAuthToken(token: string, ctx: AuthContext): string | Promise<string>;
|
|
4
5
|
declare function setTokenUtil(token: string | null | undefined, ctx: AuthContext): string | Promise<string> | null | undefined;
|
package/dist/package.mjs
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { AuthorizeResponse, createAccessControl } from "./access.mjs";
|
|
2
2
|
import { LiteralString } from "@better-auth/core";
|
|
3
|
+
|
|
3
4
|
//#region src/plugins/access/types.d.ts
|
|
4
5
|
type ArrayElement<T> = T extends readonly (infer E)[] ? E : never;
|
|
5
6
|
type SubArray<T extends unknown[] | readonly unknown[] | any[]> = T[number][] | ReadonlyArray<T[number]>;
|
|
6
|
-
type Subset<K extends keyof R, R extends Record<string | LiteralString, readonly string[] | readonly LiteralString[]>> = { [P in K]: SubArray<R[P]
|
|
7
|
+
type Subset<K extends keyof R, R extends Record<string | LiteralString, readonly string[] | readonly LiteralString[]>> = { [P in K]: SubArray<R[P]> };
|
|
7
8
|
type Statements = {
|
|
8
9
|
readonly [resource: string]: readonly LiteralString[];
|
|
9
10
|
};
|
|
10
|
-
type RoleStatements<TStatements extends Statements> = { readonly [P in keyof TStatements]?: SubArray<TStatements[P]
|
|
11
|
+
type RoleStatements<TStatements extends Statements> = { readonly [P in keyof TStatements]?: SubArray<TStatements[P]> };
|
|
11
12
|
type RoleInput<TStatements extends Statements, TRoleStatements extends Statements> = TRoleStatements & (string extends keyof TRoleStatements ? {} : RoleStatements<TStatements> & Record<Exclude<keyof TRoleStatements, keyof TStatements>, never>);
|
|
12
|
-
type ExactRoleStatements<TStatements extends Statements> = { readonly [P in keyof TStatements]: readonly [...TStatements[P]]
|
|
13
|
+
type ExactRoleStatements<TStatements extends Statements> = { readonly [P in keyof TStatements]: readonly [...TStatements[P]] };
|
|
13
14
|
type AccessControl<TStatements extends Statements = Statements> = ReturnType<typeof createAccessControl<TStatements>>;
|
|
14
15
|
type RoleAuthorizeRequest<TStatements extends Statements> = { [P in keyof TStatements]?: SubArray<TStatements[P]> | {
|
|
15
16
|
actions: SubArray<TStatements[P]>;
|
|
16
17
|
connector: "OR" | "AND";
|
|
17
|
-
}
|
|
18
|
+
} };
|
|
18
19
|
type Role<TRoleStatements extends Statements = Record<string, any>, TAuthorizeStatements extends Statements = TRoleStatements> = {
|
|
19
20
|
authorize: (request: RoleAuthorizeRequest<TAuthorizeStatements>, connector?: ("OR" | "AND") | undefined) => AuthorizeResponse;
|
|
20
21
|
statements: TRoleStatements;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ExactRoleStatements, Role, RoleInput, Statements } from "../../access/types.mjs";
|
|
2
|
-
import "../../index.mjs";
|
|
3
2
|
//#region src/plugins/admin/access/statement.d.ts
|
|
4
3
|
declare const defaultStatements: {
|
|
5
4
|
readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "impersonate-admins", "delete", "set-password", "set-email", "get", "update"];
|