better-auth 1.6.25 → 1.6.27
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/api/index.d.mts +74 -73
- package/dist/api/middlewares/authorization.d.mts +4 -4
- package/dist/api/middlewares/origin-check.d.mts +3 -3
- package/dist/api/rate-limiter/index.mjs +3 -3
- package/dist/api/routes/account.d.mts +6 -6
- package/dist/api/routes/email-verification.d.mts +1 -1
- package/dist/api/routes/password.d.mts +4 -4
- package/dist/api/routes/session.d.mts +16 -16
- package/dist/api/routes/session.mjs +2 -3
- package/dist/api/routes/sign-in.d.mts +1 -1
- package/dist/api/routes/sign-up.d.mts +1 -1
- package/dist/api/routes/update-session.d.mts +2 -2
- package/dist/api/routes/update-user.d.mts +11 -11
- package/dist/client/session-atom.mjs +33 -44
- package/dist/db/internal-adapter.mjs +23 -21
- package/dist/integrations/next-js.d.mts +2 -2
- package/dist/integrations/next-js.mjs +16 -2
- package/dist/integrations/svelte-kit.d.mts +1 -1
- package/dist/integrations/tanstack-start-solid.d.mts +1 -1
- package/dist/integrations/tanstack-start.d.mts +1 -1
- package/dist/package.mjs +1 -1
- package/dist/plugins/admin/admin.d.mts +25 -25
- package/dist/plugins/anonymous/index.d.mts +3 -3
- package/dist/plugins/anonymous/index.mjs +0 -1
- package/dist/plugins/bearer/index.d.mts +3 -3
- package/dist/plugins/custom-session/index.d.mts +1 -1
- package/dist/plugins/email-otp/index.d.mts +6 -6
- package/dist/plugins/email-otp/index.mjs +1 -1
- package/dist/plugins/email-otp/routes.mjs +9 -4
- package/dist/plugins/generic-oauth/index.d.mts +2 -2
- package/dist/plugins/jwt/adapter.mjs +5 -4
- package/dist/plugins/jwt/client.d.mts +4 -2
- package/dist/plugins/jwt/client.mjs +1 -1
- package/dist/plugins/jwt/index.d.mts +3 -3
- package/dist/plugins/last-login-method/index.d.mts +2 -2
- package/dist/plugins/magic-link/index.d.mts +2 -2
- package/dist/plugins/mcp/index.d.mts +3 -3
- package/dist/plugins/multi-session/index.d.mts +3 -3
- package/dist/plugins/oauth-popup/index.d.mts +1 -1
- package/dist/plugins/oauth-proxy/index.d.mts +3 -3
- package/dist/plugins/oauth-proxy/index.mjs +13 -3
- package/dist/plugins/oidc-provider/index.d.mts +6 -6
- package/dist/plugins/one-tap/client.d.mts +4 -3
- package/dist/plugins/one-tap/client.mjs +1 -1
- package/dist/plugins/one-time-token/index.d.mts +3 -3
- package/dist/plugins/organization/organization.d.mts +28 -4
- package/dist/plugins/organization/routes/crud-access-control.d.mts +140 -20
- package/dist/plugins/organization/routes/crud-invites.d.mts +149 -29
- package/dist/plugins/organization/routes/crud-members.d.mts +150 -30
- package/dist/plugins/organization/routes/crud-org.d.mts +96 -24
- package/dist/plugins/organization/routes/crud-team.d.mts +207 -39
- package/dist/plugins/phone-number/index.d.mts +1 -1
- package/dist/plugins/two-factor/backup-codes/index.d.mts +2 -2
- package/dist/plugins/two-factor/index.d.mts +10 -10
- package/dist/plugins/two-factor/totp/index.d.mts +2 -2
- package/dist/plugins/username/index.d.mts +1 -1
- package/package.json +15 -14
|
@@ -7,7 +7,7 @@ const jwtClient = (options) => {
|
|
|
7
7
|
version: PACKAGE_VERSION,
|
|
8
8
|
$InferServerPlugin: {},
|
|
9
9
|
pathMethods: { [jwksPath]: "GET" },
|
|
10
|
-
getActions: ($fetch) => ({ jwks: async (fetchOptions) => {
|
|
10
|
+
getActions: ($fetch, _$store, _options) => ({ jwks: async (fetchOptions) => {
|
|
11
11
|
return await $fetch(jwksPath, {
|
|
12
12
|
method: "GET",
|
|
13
13
|
...fetchOptions
|
|
@@ -97,7 +97,7 @@ declare const jwt: <O extends JwtOptions>(options?: O) => {
|
|
|
97
97
|
getToken: import("better-call").StrictEndpoint<"/token", {
|
|
98
98
|
method: "GET";
|
|
99
99
|
requireHeaders: true;
|
|
100
|
-
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
100
|
+
use: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
101
101
|
session: {
|
|
102
102
|
session: Record<string, any> & {
|
|
103
103
|
id: string;
|
|
@@ -119,7 +119,7 @@ declare const jwt: <O extends JwtOptions>(options?: O) => {
|
|
|
119
119
|
image?: string | null | undefined;
|
|
120
120
|
};
|
|
121
121
|
};
|
|
122
|
-
}
|
|
122
|
+
}>>[];
|
|
123
123
|
metadata: {
|
|
124
124
|
openapi: {
|
|
125
125
|
operationId: string;
|
|
@@ -191,7 +191,7 @@ declare const jwt: <O extends JwtOptions>(options?: O) => {
|
|
|
191
191
|
hooks: {
|
|
192
192
|
after: {
|
|
193
193
|
matcher(context: import("@better-auth/core").HookEndpointContext): boolean;
|
|
194
|
-
handler: (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void
|
|
194
|
+
handler: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void>>;
|
|
195
195
|
}[];
|
|
196
196
|
};
|
|
197
197
|
schema: {
|
|
@@ -72,7 +72,7 @@ declare const lastLoginMethod: <O extends LastLoginMethodOptions>(userConfig?: O
|
|
|
72
72
|
image?: string | null | undefined;
|
|
73
73
|
} & Record<string, unknown>, context: GenericEndpointContext | null): Promise<{
|
|
74
74
|
data: {
|
|
75
|
-
lastLoginMethod:
|
|
75
|
+
lastLoginMethod: string;
|
|
76
76
|
id: string;
|
|
77
77
|
createdAt: Date;
|
|
78
78
|
updatedAt: Date;
|
|
@@ -104,7 +104,7 @@ declare const lastLoginMethod: <O extends LastLoginMethodOptions>(userConfig?: O
|
|
|
104
104
|
hooks: {
|
|
105
105
|
after: {
|
|
106
106
|
matcher(): true;
|
|
107
|
-
handler: (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void
|
|
107
|
+
handler: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void>>;
|
|
108
108
|
}[];
|
|
109
109
|
};
|
|
110
110
|
schema: O["storeInDatabase"] extends true ? {
|
|
@@ -91,7 +91,7 @@ declare const magicLink: (options: MagicLinkOptions) => {
|
|
|
91
91
|
signInMagicLink: import("better-call").StrictEndpoint<"/sign-in/magic-link", {
|
|
92
92
|
method: "POST";
|
|
93
93
|
requireHeaders: true;
|
|
94
|
-
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void
|
|
94
|
+
use: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void>>[];
|
|
95
95
|
body: z.ZodObject<{
|
|
96
96
|
email: z.ZodEmail;
|
|
97
97
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -149,7 +149,7 @@ declare const magicLink: (options: MagicLinkOptions) => {
|
|
|
149
149
|
errorCallbackURL: z.ZodOptional<z.ZodString>;
|
|
150
150
|
newUserCallbackURL: z.ZodOptional<z.ZodString>;
|
|
151
151
|
}, z.core.$strip>;
|
|
152
|
-
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void
|
|
152
|
+
use: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void>>[];
|
|
153
153
|
requireHeaders: true;
|
|
154
154
|
metadata: {
|
|
155
155
|
openapi: {
|
|
@@ -30,7 +30,7 @@ declare const mcp: (options: MCPOptions) => {
|
|
|
30
30
|
hooks: {
|
|
31
31
|
after: {
|
|
32
32
|
matcher(): true;
|
|
33
|
-
handler: (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void
|
|
33
|
+
handler: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void>>;
|
|
34
34
|
}[];
|
|
35
35
|
};
|
|
36
36
|
endpoints: {
|
|
@@ -41,7 +41,7 @@ declare const mcp: (options: MCPOptions) => {
|
|
|
41
41
|
accept: z.ZodBoolean;
|
|
42
42
|
consent_code: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
43
43
|
}, z.core.$strip>;
|
|
44
|
-
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
44
|
+
use: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
45
45
|
session: {
|
|
46
46
|
session: Record<string, any> & {
|
|
47
47
|
id: string;
|
|
@@ -63,7 +63,7 @@ declare const mcp: (options: MCPOptions) => {
|
|
|
63
63
|
image?: string | null | undefined;
|
|
64
64
|
};
|
|
65
65
|
};
|
|
66
|
-
}
|
|
66
|
+
}>>[];
|
|
67
67
|
metadata: {
|
|
68
68
|
openapi: {
|
|
69
69
|
description: string;
|
|
@@ -144,7 +144,7 @@ declare const multiSession: (options?: MultiSessionConfig | undefined) => {
|
|
|
144
144
|
sessionToken: z.ZodString;
|
|
145
145
|
}, z.core.$strip>;
|
|
146
146
|
requireHeaders: true;
|
|
147
|
-
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
147
|
+
use: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
148
148
|
session: {
|
|
149
149
|
session: Record<string, any> & {
|
|
150
150
|
id: string;
|
|
@@ -166,7 +166,7 @@ declare const multiSession: (options?: MultiSessionConfig | undefined) => {
|
|
|
166
166
|
image?: string | null | undefined;
|
|
167
167
|
};
|
|
168
168
|
};
|
|
169
|
-
}
|
|
169
|
+
}>>[];
|
|
170
170
|
metadata: {
|
|
171
171
|
openapi: {
|
|
172
172
|
description: string;
|
|
@@ -196,7 +196,7 @@ declare const multiSession: (options?: MultiSessionConfig | undefined) => {
|
|
|
196
196
|
hooks: {
|
|
197
197
|
after: {
|
|
198
198
|
matcher: (context: import("@better-auth/core").HookEndpointContext) => boolean;
|
|
199
|
-
handler: (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void
|
|
199
|
+
handler: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void>>;
|
|
200
200
|
}[];
|
|
201
201
|
};
|
|
202
202
|
options: MultiSessionConfig | undefined;
|
|
@@ -55,7 +55,7 @@ declare const oauthPopup: () => {
|
|
|
55
55
|
hooks: {
|
|
56
56
|
after: {
|
|
57
57
|
matcher(context: import("@better-auth/core").HookEndpointContext): boolean;
|
|
58
|
-
handler: (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void
|
|
58
|
+
handler: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void>>;
|
|
59
59
|
}[];
|
|
60
60
|
};
|
|
61
61
|
};
|
|
@@ -62,7 +62,7 @@ declare const oAuthProxy: <O extends OAuthProxyOptions>(opts?: O) => {
|
|
|
62
62
|
callbackURL: z.ZodString;
|
|
63
63
|
profile: z.ZodOptional<z.ZodString>;
|
|
64
64
|
}, z.core.$strip>;
|
|
65
|
-
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void
|
|
65
|
+
use: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void>>[];
|
|
66
66
|
metadata: {
|
|
67
67
|
openapi: {
|
|
68
68
|
operationId: string;
|
|
@@ -98,11 +98,11 @@ declare const oAuthProxy: <O extends OAuthProxyOptions>(opts?: O) => {
|
|
|
98
98
|
hooks: {
|
|
99
99
|
before: {
|
|
100
100
|
matcher(context: import("@better-auth/core").HookEndpointContext): boolean;
|
|
101
|
-
handler: (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void
|
|
101
|
+
handler: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void>>;
|
|
102
102
|
}[];
|
|
103
103
|
after: {
|
|
104
104
|
matcher(context: import("@better-auth/core").HookEndpointContext): boolean;
|
|
105
|
-
handler: (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void
|
|
105
|
+
handler: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void>>;
|
|
106
106
|
}[];
|
|
107
107
|
};
|
|
108
108
|
};
|
|
@@ -10,6 +10,7 @@ import { parseGenericState } from "../../state.mjs";
|
|
|
10
10
|
import { PACKAGE_VERSION } from "../../version.mjs";
|
|
11
11
|
import { parseJSON } from "../../client/parser.mjs";
|
|
12
12
|
import { checkSkipProxy, resolveCurrentURL, stripTrailingSlash } from "./utils.mjs";
|
|
13
|
+
import { safeJSONParse } from "@better-auth/core/utils/json";
|
|
13
14
|
import { defu as defu$1 } from "defu";
|
|
14
15
|
import { createAuthEndpoint, createAuthMiddleware } from "@better-auth/core/api";
|
|
15
16
|
import * as z from "zod";
|
|
@@ -29,7 +30,8 @@ const oauthProxyQuerySchema = z.object({
|
|
|
29
30
|
});
|
|
30
31
|
const oauthCallbackQuerySchema = z.object({
|
|
31
32
|
code: z.string().optional(),
|
|
32
|
-
error: z.string().optional()
|
|
33
|
+
error: z.string().optional(),
|
|
34
|
+
user: z.string().optional()
|
|
33
35
|
});
|
|
34
36
|
const oAuthProxy = (opts) => {
|
|
35
37
|
const maxAge = opts?.maxAge ?? 60;
|
|
@@ -170,7 +172,7 @@ const oAuthProxy = (opts) => {
|
|
|
170
172
|
ctx.context.logger.warn("Invalid OAuth callback query", query.error);
|
|
171
173
|
return;
|
|
172
174
|
}
|
|
173
|
-
const { code, error } = query.data;
|
|
175
|
+
const { code, error, user: userData } = query.data;
|
|
174
176
|
let stateData;
|
|
175
177
|
try {
|
|
176
178
|
stateData = parseJSON(await symmetricDecrypt({
|
|
@@ -209,7 +211,15 @@ const oAuthProxy = (opts) => {
|
|
|
209
211
|
throw redirectOnError(ctx, errorURL, "invalid_code");
|
|
210
212
|
}
|
|
211
213
|
if (!tokens) throw redirectOnError(ctx, errorURL, "invalid_code");
|
|
212
|
-
const
|
|
214
|
+
const parsedUserData = userData ? safeJSONParse(userData) : null;
|
|
215
|
+
const userInfo = (await provider.getUserInfo({
|
|
216
|
+
...tokens,
|
|
217
|
+
/**
|
|
218
|
+
* The user object from the provider
|
|
219
|
+
* This is only available for some providers like Apple
|
|
220
|
+
*/
|
|
221
|
+
user: parsedUserData ?? void 0
|
|
222
|
+
}))?.user;
|
|
213
223
|
if (!userInfo) {
|
|
214
224
|
ctx.context.logger.error("Unable to get user info from provider");
|
|
215
225
|
throw redirectOnError(ctx, errorURL, "unable_to_get_user_info");
|
|
@@ -39,10 +39,10 @@ declare const oidcProvider: (options: OIDCOptions) => {
|
|
|
39
39
|
hooks: {
|
|
40
40
|
after: {
|
|
41
41
|
matcher(): true;
|
|
42
|
-
handler: (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<Response | {
|
|
42
|
+
handler: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<Response | {
|
|
43
43
|
redirect: boolean;
|
|
44
44
|
url: string;
|
|
45
|
-
} | undefined
|
|
45
|
+
} | undefined>>;
|
|
46
46
|
}[];
|
|
47
47
|
};
|
|
48
48
|
endpoints: {
|
|
@@ -87,7 +87,7 @@ declare const oidcProvider: (options: OIDCOptions) => {
|
|
|
87
87
|
accept: z.ZodBoolean;
|
|
88
88
|
consent_code: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
89
89
|
}, z.core.$strip>;
|
|
90
|
-
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
90
|
+
use: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
91
91
|
session: {
|
|
92
92
|
session: Record<string, any> & {
|
|
93
93
|
id: string;
|
|
@@ -109,7 +109,7 @@ declare const oidcProvider: (options: OIDCOptions) => {
|
|
|
109
109
|
image?: string | null | undefined;
|
|
110
110
|
};
|
|
111
111
|
};
|
|
112
|
-
}
|
|
112
|
+
}>>[];
|
|
113
113
|
metadata: {
|
|
114
114
|
openapi: {
|
|
115
115
|
description: string;
|
|
@@ -415,7 +415,7 @@ declare const oidcProvider: (options: OIDCOptions) => {
|
|
|
415
415
|
}>;
|
|
416
416
|
getOAuthClient: import("better-call").StrictEndpoint<"/oauth2/client/:id", {
|
|
417
417
|
method: "GET";
|
|
418
|
-
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
418
|
+
use: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
419
419
|
session: {
|
|
420
420
|
session: Record<string, any> & {
|
|
421
421
|
id: string;
|
|
@@ -437,7 +437,7 @@ declare const oidcProvider: (options: OIDCOptions) => {
|
|
|
437
437
|
image?: string | null | undefined;
|
|
438
438
|
};
|
|
439
439
|
};
|
|
440
|
-
}
|
|
440
|
+
}>>[];
|
|
441
441
|
metadata: {
|
|
442
442
|
openapi: {
|
|
443
443
|
description: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ClientFetchOption } from "@better-auth/core";
|
|
1
|
+
import { BetterAuthClientOptions, ClientFetchOption, ClientStore } from "@better-auth/core";
|
|
2
|
+
import { BetterFetch } from "@better-fetch/fetch";
|
|
2
3
|
//#region src/plugins/one-tap/client.d.ts
|
|
3
4
|
declare global {
|
|
4
5
|
interface Window {
|
|
@@ -162,10 +163,10 @@ declare const oneTapClient: (options: GoogleOneTapOptions) => {
|
|
|
162
163
|
onResponse(ctx: import("@better-fetch/fetch").ResponseContext): Promise<void>;
|
|
163
164
|
};
|
|
164
165
|
}[];
|
|
165
|
-
getActions: ($fetch:
|
|
166
|
+
getActions: ($fetch: BetterFetch, _$store: ClientStore, _options: BetterAuthClientOptions | undefined) => {
|
|
166
167
|
oneTap: (opts?: GoogleOneTapActionOptions | undefined, fetchOptions?: ClientFetchOption | undefined) => Promise<void>;
|
|
167
168
|
};
|
|
168
|
-
getAtoms($fetch:
|
|
169
|
+
getAtoms($fetch: BetterFetch): {};
|
|
169
170
|
};
|
|
170
171
|
//#endregion
|
|
171
172
|
export { GoogleOneTapActionOptions, GoogleOneTapOptions, GsiButtonConfiguration, oneTapClient };
|
|
@@ -26,7 +26,7 @@ const oneTapClient = (options) => {
|
|
|
26
26
|
navigator.credentials.preventSilentAccess();
|
|
27
27
|
} }
|
|
28
28
|
}],
|
|
29
|
-
getActions: ($fetch, _) => {
|
|
29
|
+
getActions: ($fetch, _$store, _options) => {
|
|
30
30
|
return { oneTap: async (opts, fetchOptions) => {
|
|
31
31
|
if (isRequestInProgress) {
|
|
32
32
|
console.warn("A Google One Tap request is already in progress. Please wait.");
|
|
@@ -68,7 +68,7 @@ declare const oneTimeToken: (options?: OneTimeTokenOptions | undefined) => {
|
|
|
68
68
|
*/
|
|
69
69
|
generateOneTimeToken: import("better-call").StrictEndpoint<"/one-time-token/generate", {
|
|
70
70
|
method: "GET";
|
|
71
|
-
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
71
|
+
use: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
72
72
|
session: {
|
|
73
73
|
session: Record<string, any> & {
|
|
74
74
|
id: string;
|
|
@@ -90,7 +90,7 @@ declare const oneTimeToken: (options?: OneTimeTokenOptions | undefined) => {
|
|
|
90
90
|
image?: string | null | undefined;
|
|
91
91
|
};
|
|
92
92
|
};
|
|
93
|
-
}
|
|
93
|
+
}>>[];
|
|
94
94
|
}, {
|
|
95
95
|
token: string;
|
|
96
96
|
}>;
|
|
@@ -122,7 +122,7 @@ declare const oneTimeToken: (options?: OneTimeTokenOptions | undefined) => {
|
|
|
122
122
|
hooks: {
|
|
123
123
|
after: {
|
|
124
124
|
matcher: () => true;
|
|
125
|
-
handler: (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void
|
|
125
|
+
handler: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void>>;
|
|
126
126
|
}[];
|
|
127
127
|
};
|
|
128
128
|
options: OneTimeTokenOptions | undefined;
|
|
@@ -104,8 +104,8 @@ declare const createHasPermission: <O extends OrganizationOptions>(options: O) =
|
|
|
104
104
|
}, z.core.$strip>, z.ZodObject<{
|
|
105
105
|
permissions: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
|
|
106
106
|
}, z.core.$strip>]>>;
|
|
107
|
-
use:
|
|
108
|
-
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
107
|
+
use: import("better-call").Middleware<{
|
|
108
|
+
use: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
109
109
|
session: {
|
|
110
110
|
session: Record<string, any> & {
|
|
111
111
|
id: string;
|
|
@@ -127,7 +127,31 @@ declare const createHasPermission: <O extends OrganizationOptions>(options: O) =
|
|
|
127
127
|
image?: string | null | undefined;
|
|
128
128
|
};
|
|
129
129
|
};
|
|
130
|
-
}
|
|
130
|
+
}>>[];
|
|
131
|
+
}, (inputContext: import("better-call").MiddlewareInputContext<{
|
|
132
|
+
use: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
133
|
+
session: {
|
|
134
|
+
session: Record<string, any> & {
|
|
135
|
+
id: string;
|
|
136
|
+
createdAt: Date;
|
|
137
|
+
updatedAt: Date;
|
|
138
|
+
userId: string;
|
|
139
|
+
expiresAt: Date;
|
|
140
|
+
token: string;
|
|
141
|
+
ipAddress?: string | null | undefined;
|
|
142
|
+
userAgent?: string | null | undefined;
|
|
143
|
+
};
|
|
144
|
+
user: Record<string, any> & {
|
|
145
|
+
id: string;
|
|
146
|
+
createdAt: Date;
|
|
147
|
+
updatedAt: Date;
|
|
148
|
+
email: string;
|
|
149
|
+
emailVerified: boolean;
|
|
150
|
+
name: string;
|
|
151
|
+
image?: string | null | undefined;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
}>>[];
|
|
131
155
|
}>) => Promise<{
|
|
132
156
|
session: {
|
|
133
157
|
session: {
|
|
@@ -153,7 +177,7 @@ declare const createHasPermission: <O extends OrganizationOptions>(options: O) =
|
|
|
153
177
|
image?: string | null | undefined;
|
|
154
178
|
};
|
|
155
179
|
};
|
|
156
|
-
}
|
|
180
|
+
}>>[];
|
|
157
181
|
metadata: {
|
|
158
182
|
$Infer: {
|
|
159
183
|
body: {
|
|
@@ -31,8 +31,8 @@ declare const createOrgRole: <O extends OrganizationOptions>(options: O) => impo
|
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
33
|
requireHeaders: true;
|
|
34
|
-
use:
|
|
35
|
-
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
34
|
+
use: import("better-call").Middleware<{
|
|
35
|
+
use: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
36
36
|
session: {
|
|
37
37
|
session: Record<string, any> & {
|
|
38
38
|
id: string;
|
|
@@ -54,7 +54,31 @@ declare const createOrgRole: <O extends OrganizationOptions>(options: O) => impo
|
|
|
54
54
|
image?: string | null | undefined;
|
|
55
55
|
};
|
|
56
56
|
};
|
|
57
|
-
}
|
|
57
|
+
}>>[];
|
|
58
|
+
}, (inputContext: import("better-call").MiddlewareInputContext<{
|
|
59
|
+
use: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
60
|
+
session: {
|
|
61
|
+
session: Record<string, any> & {
|
|
62
|
+
id: string;
|
|
63
|
+
createdAt: Date;
|
|
64
|
+
updatedAt: Date;
|
|
65
|
+
userId: string;
|
|
66
|
+
expiresAt: Date;
|
|
67
|
+
token: string;
|
|
68
|
+
ipAddress?: string | null | undefined;
|
|
69
|
+
userAgent?: string | null | undefined;
|
|
70
|
+
};
|
|
71
|
+
user: Record<string, any> & {
|
|
72
|
+
id: string;
|
|
73
|
+
createdAt: Date;
|
|
74
|
+
updatedAt: Date;
|
|
75
|
+
email: string;
|
|
76
|
+
emailVerified: boolean;
|
|
77
|
+
name: string;
|
|
78
|
+
image?: string | null | undefined;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
}>>[];
|
|
58
82
|
}>) => Promise<{
|
|
59
83
|
session: {
|
|
60
84
|
session: {
|
|
@@ -80,7 +104,7 @@ declare const createOrgRole: <O extends OrganizationOptions>(options: O) => impo
|
|
|
80
104
|
image?: string | null | undefined;
|
|
81
105
|
};
|
|
82
106
|
};
|
|
83
|
-
}
|
|
107
|
+
}>>[];
|
|
84
108
|
}, {
|
|
85
109
|
success: boolean;
|
|
86
110
|
roleData: {
|
|
@@ -103,8 +127,8 @@ declare const deleteOrgRole: <O extends OrganizationOptions>(options: O) => impo
|
|
|
103
127
|
roleId: z.ZodString;
|
|
104
128
|
}, z.core.$strip>]>>;
|
|
105
129
|
requireHeaders: true;
|
|
106
|
-
use:
|
|
107
|
-
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
130
|
+
use: import("better-call").Middleware<{
|
|
131
|
+
use: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
108
132
|
session: {
|
|
109
133
|
session: Record<string, any> & {
|
|
110
134
|
id: string;
|
|
@@ -126,7 +150,31 @@ declare const deleteOrgRole: <O extends OrganizationOptions>(options: O) => impo
|
|
|
126
150
|
image?: string | null | undefined;
|
|
127
151
|
};
|
|
128
152
|
};
|
|
129
|
-
}
|
|
153
|
+
}>>[];
|
|
154
|
+
}, (inputContext: import("better-call").MiddlewareInputContext<{
|
|
155
|
+
use: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
156
|
+
session: {
|
|
157
|
+
session: Record<string, any> & {
|
|
158
|
+
id: string;
|
|
159
|
+
createdAt: Date;
|
|
160
|
+
updatedAt: Date;
|
|
161
|
+
userId: string;
|
|
162
|
+
expiresAt: Date;
|
|
163
|
+
token: string;
|
|
164
|
+
ipAddress?: string | null | undefined;
|
|
165
|
+
userAgent?: string | null | undefined;
|
|
166
|
+
};
|
|
167
|
+
user: Record<string, any> & {
|
|
168
|
+
id: string;
|
|
169
|
+
createdAt: Date;
|
|
170
|
+
updatedAt: Date;
|
|
171
|
+
email: string;
|
|
172
|
+
emailVerified: boolean;
|
|
173
|
+
name: string;
|
|
174
|
+
image?: string | null | undefined;
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
}>>[];
|
|
130
178
|
}>) => Promise<{
|
|
131
179
|
session: {
|
|
132
180
|
session: {
|
|
@@ -152,7 +200,7 @@ declare const deleteOrgRole: <O extends OrganizationOptions>(options: O) => impo
|
|
|
152
200
|
image?: string | null | undefined;
|
|
153
201
|
};
|
|
154
202
|
};
|
|
155
|
-
}
|
|
203
|
+
}>>[];
|
|
156
204
|
metadata: {
|
|
157
205
|
$Infer: {
|
|
158
206
|
body: {
|
|
@@ -168,8 +216,8 @@ declare const deleteOrgRole: <O extends OrganizationOptions>(options: O) => impo
|
|
|
168
216
|
declare const listOrgRoles: <O extends OrganizationOptions>(options: O) => import("better-call").StrictEndpoint<"/organization/list-roles", {
|
|
169
217
|
method: "GET";
|
|
170
218
|
requireHeaders: true;
|
|
171
|
-
use:
|
|
172
|
-
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
219
|
+
use: import("better-call").Middleware<{
|
|
220
|
+
use: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
173
221
|
session: {
|
|
174
222
|
session: Record<string, any> & {
|
|
175
223
|
id: string;
|
|
@@ -191,7 +239,31 @@ declare const listOrgRoles: <O extends OrganizationOptions>(options: O) => impor
|
|
|
191
239
|
image?: string | null | undefined;
|
|
192
240
|
};
|
|
193
241
|
};
|
|
194
|
-
}
|
|
242
|
+
}>>[];
|
|
243
|
+
}, (inputContext: import("better-call").MiddlewareInputContext<{
|
|
244
|
+
use: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
245
|
+
session: {
|
|
246
|
+
session: Record<string, any> & {
|
|
247
|
+
id: string;
|
|
248
|
+
createdAt: Date;
|
|
249
|
+
updatedAt: Date;
|
|
250
|
+
userId: string;
|
|
251
|
+
expiresAt: Date;
|
|
252
|
+
token: string;
|
|
253
|
+
ipAddress?: string | null | undefined;
|
|
254
|
+
userAgent?: string | null | undefined;
|
|
255
|
+
};
|
|
256
|
+
user: Record<string, any> & {
|
|
257
|
+
id: string;
|
|
258
|
+
createdAt: Date;
|
|
259
|
+
updatedAt: Date;
|
|
260
|
+
email: string;
|
|
261
|
+
emailVerified: boolean;
|
|
262
|
+
name: string;
|
|
263
|
+
image?: string | null | undefined;
|
|
264
|
+
};
|
|
265
|
+
};
|
|
266
|
+
}>>[];
|
|
195
267
|
}>) => Promise<{
|
|
196
268
|
session: {
|
|
197
269
|
session: {
|
|
@@ -217,7 +289,7 @@ declare const listOrgRoles: <O extends OrganizationOptions>(options: O) => impor
|
|
|
217
289
|
image?: string | null | undefined;
|
|
218
290
|
};
|
|
219
291
|
};
|
|
220
|
-
}
|
|
292
|
+
}>>[];
|
|
221
293
|
query: z.ZodOptional<z.ZodObject<{
|
|
222
294
|
organizationId: z.ZodOptional<z.ZodString>;
|
|
223
295
|
}, z.core.$strip>>;
|
|
@@ -232,8 +304,32 @@ declare const listOrgRoles: <O extends OrganizationOptions>(options: O) => impor
|
|
|
232
304
|
declare const getOrgRole: <O extends OrganizationOptions>(options: O) => import("better-call").StrictEndpoint<"/organization/get-role", {
|
|
233
305
|
method: "GET";
|
|
234
306
|
requireHeaders: true;
|
|
235
|
-
use:
|
|
236
|
-
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
307
|
+
use: import("better-call").Middleware<{
|
|
308
|
+
use: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
309
|
+
session: {
|
|
310
|
+
session: Record<string, any> & {
|
|
311
|
+
id: string;
|
|
312
|
+
createdAt: Date;
|
|
313
|
+
updatedAt: Date;
|
|
314
|
+
userId: string;
|
|
315
|
+
expiresAt: Date;
|
|
316
|
+
token: string;
|
|
317
|
+
ipAddress?: string | null | undefined;
|
|
318
|
+
userAgent?: string | null | undefined;
|
|
319
|
+
};
|
|
320
|
+
user: Record<string, any> & {
|
|
321
|
+
id: string;
|
|
322
|
+
createdAt: Date;
|
|
323
|
+
updatedAt: Date;
|
|
324
|
+
email: string;
|
|
325
|
+
emailVerified: boolean;
|
|
326
|
+
name: string;
|
|
327
|
+
image?: string | null | undefined;
|
|
328
|
+
};
|
|
329
|
+
};
|
|
330
|
+
}>>[];
|
|
331
|
+
}, (inputContext: import("better-call").MiddlewareInputContext<{
|
|
332
|
+
use: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
237
333
|
session: {
|
|
238
334
|
session: Record<string, any> & {
|
|
239
335
|
id: string;
|
|
@@ -255,7 +351,7 @@ declare const getOrgRole: <O extends OrganizationOptions>(options: O) => import(
|
|
|
255
351
|
image?: string | null | undefined;
|
|
256
352
|
};
|
|
257
353
|
};
|
|
258
|
-
}
|
|
354
|
+
}>>[];
|
|
259
355
|
}>) => Promise<{
|
|
260
356
|
session: {
|
|
261
357
|
session: {
|
|
@@ -281,7 +377,7 @@ declare const getOrgRole: <O extends OrganizationOptions>(options: O) => import(
|
|
|
281
377
|
image?: string | null | undefined;
|
|
282
378
|
};
|
|
283
379
|
};
|
|
284
|
-
}
|
|
380
|
+
}>>[];
|
|
285
381
|
query: z.ZodOptional<z.ZodIntersection<z.ZodObject<{
|
|
286
382
|
organizationId: z.ZodOptional<z.ZodString>;
|
|
287
383
|
}, z.core.$strip>, z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -333,8 +429,32 @@ declare const updateOrgRole: <O extends OrganizationOptions>(options: O) => impo
|
|
|
333
429
|
};
|
|
334
430
|
};
|
|
335
431
|
requireHeaders: true;
|
|
336
|
-
use:
|
|
337
|
-
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
432
|
+
use: import("better-call").Middleware<{
|
|
433
|
+
use: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
434
|
+
session: {
|
|
435
|
+
session: Record<string, any> & {
|
|
436
|
+
id: string;
|
|
437
|
+
createdAt: Date;
|
|
438
|
+
updatedAt: Date;
|
|
439
|
+
userId: string;
|
|
440
|
+
expiresAt: Date;
|
|
441
|
+
token: string;
|
|
442
|
+
ipAddress?: string | null | undefined;
|
|
443
|
+
userAgent?: string | null | undefined;
|
|
444
|
+
};
|
|
445
|
+
user: Record<string, any> & {
|
|
446
|
+
id: string;
|
|
447
|
+
createdAt: Date;
|
|
448
|
+
updatedAt: Date;
|
|
449
|
+
email: string;
|
|
450
|
+
emailVerified: boolean;
|
|
451
|
+
name: string;
|
|
452
|
+
image?: string | null | undefined;
|
|
453
|
+
};
|
|
454
|
+
};
|
|
455
|
+
}>>[];
|
|
456
|
+
}, (inputContext: import("better-call").MiddlewareInputContext<{
|
|
457
|
+
use: import("better-call").Middleware<import("better-call").MiddlewareOptions, (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
338
458
|
session: {
|
|
339
459
|
session: Record<string, any> & {
|
|
340
460
|
id: string;
|
|
@@ -356,7 +476,7 @@ declare const updateOrgRole: <O extends OrganizationOptions>(options: O) => impo
|
|
|
356
476
|
image?: string | null | undefined;
|
|
357
477
|
};
|
|
358
478
|
};
|
|
359
|
-
}
|
|
479
|
+
}>>[];
|
|
360
480
|
}>) => Promise<{
|
|
361
481
|
session: {
|
|
362
482
|
session: {
|
|
@@ -382,7 +502,7 @@ declare const updateOrgRole: <O extends OrganizationOptions>(options: O) => impo
|
|
|
382
502
|
image?: string | null | undefined;
|
|
383
503
|
};
|
|
384
504
|
};
|
|
385
|
-
}
|
|
505
|
+
}>>[];
|
|
386
506
|
}, {
|
|
387
507
|
success: boolean;
|
|
388
508
|
roleData: OrganizationRole & InferAdditionalFieldsFromPluginOptions<"organizationRole", O, false>;
|