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
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
import { FieldAttributeToObject, InferAdditionalFieldsFromPluginOptions } from "../../../db/field.mjs";
|
|
2
2
|
import { PrettifyDeep } from "../../../types/helper.mjs";
|
|
3
3
|
import { Role } from "../../access/types.mjs";
|
|
4
|
-
import "../../../db/index.mjs";
|
|
5
4
|
import { OrganizationOptions } from "../types.mjs";
|
|
6
5
|
import { teamSchema } from "../schema.mjs";
|
|
7
|
-
import "../../index.mjs";
|
|
8
6
|
import { defaultRoles } from "../access/statement.mjs";
|
|
9
|
-
import "
|
|
7
|
+
import * as _$_better_auth_core0 from "@better-auth/core";
|
|
8
|
+
import * as _$_better_auth_core_db0 from "@better-auth/core/db";
|
|
9
|
+
import * as _$better_call0 from "better-call";
|
|
10
10
|
import * as z from "zod";
|
|
11
|
+
|
|
11
12
|
//#region src/plugins/organization/routes/crud-team.d.ts
|
|
12
13
|
declare const teamBaseSchema: z.ZodObject<{
|
|
13
14
|
name: z.ZodString;
|
|
14
15
|
organizationId: z.ZodOptional<z.ZodString>;
|
|
15
16
|
}, z.core.$strip>;
|
|
16
|
-
declare const createTeam: <O extends OrganizationOptions>(options: O) =>
|
|
17
|
+
declare const createTeam: <O extends OrganizationOptions>(options: O) => _$better_call0.StrictEndpoint<"/organization/create-team", {
|
|
17
18
|
method: "POST";
|
|
18
19
|
body: z.ZodObject<{
|
|
19
20
|
name: z.ZodString;
|
|
20
21
|
organizationId: z.ZodOptional<z.ZodString>;
|
|
21
22
|
}, z.core.$strip>;
|
|
22
|
-
use: (
|
|
23
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
23
24
|
orgOptions: OrganizationOptions;
|
|
24
25
|
roles: typeof defaultRoles & {
|
|
25
26
|
[key: string]: Role<{}>;
|
|
26
27
|
};
|
|
27
|
-
getSession: (context:
|
|
28
|
+
getSession: (context: _$_better_auth_core0.GenericEndpointContext) => Promise<{
|
|
28
29
|
session: {
|
|
29
30
|
id: string;
|
|
30
31
|
createdAt: Date;
|
|
@@ -48,7 +49,7 @@ declare const createTeam: <O extends OrganizationOptions>(options: O) => import(
|
|
|
48
49
|
image?: string | null | undefined;
|
|
49
50
|
};
|
|
50
51
|
}>;
|
|
51
|
-
}
|
|
52
|
+
}>>[];
|
|
52
53
|
metadata: {
|
|
53
54
|
$Infer: {
|
|
54
55
|
body: z.infer<typeof teamBaseSchema> & InferAdditionalFieldsFromPluginOptions<"team", O>;
|
|
@@ -102,21 +103,21 @@ declare const createTeam: <O extends OrganizationOptions>(options: O) => import(
|
|
|
102
103
|
updatedAt?: Date | undefined;
|
|
103
104
|
} & (O["schema"] extends {
|
|
104
105
|
team?: {
|
|
105
|
-
additionalFields: infer Field extends Record<string,
|
|
106
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
106
107
|
} | undefined;
|
|
107
|
-
} ? FieldAttributeToObject<Field> : {}) extends
|
|
108
|
-
declare const removeTeam: <O extends OrganizationOptions>(options: O) =>
|
|
108
|
+
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never>;
|
|
109
|
+
declare const removeTeam: <O extends OrganizationOptions>(options: O) => _$better_call0.StrictEndpoint<"/organization/remove-team", {
|
|
109
110
|
method: "POST";
|
|
110
111
|
body: z.ZodObject<{
|
|
111
112
|
teamId: z.ZodString;
|
|
112
113
|
organizationId: z.ZodOptional<z.ZodString>;
|
|
113
114
|
}, z.core.$strip>;
|
|
114
|
-
use: (
|
|
115
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
115
116
|
orgOptions: OrganizationOptions;
|
|
116
117
|
roles: typeof defaultRoles & {
|
|
117
118
|
[key: string]: Role<{}>;
|
|
118
119
|
};
|
|
119
|
-
getSession: (context:
|
|
120
|
+
getSession: (context: _$_better_auth_core0.GenericEndpointContext) => Promise<{
|
|
120
121
|
session: {
|
|
121
122
|
id: string;
|
|
122
123
|
createdAt: Date;
|
|
@@ -140,7 +141,7 @@ declare const removeTeam: <O extends OrganizationOptions>(options: O) => import(
|
|
|
140
141
|
image?: string | null | undefined;
|
|
141
142
|
};
|
|
142
143
|
}>;
|
|
143
|
-
}
|
|
144
|
+
}>>[];
|
|
144
145
|
metadata: {
|
|
145
146
|
openapi: {
|
|
146
147
|
description: string;
|
|
@@ -169,7 +170,7 @@ declare const removeTeam: <O extends OrganizationOptions>(options: O) => import(
|
|
|
169
170
|
}, {
|
|
170
171
|
message: string;
|
|
171
172
|
}>;
|
|
172
|
-
declare const updateTeam: <O extends OrganizationOptions>(options: O) =>
|
|
173
|
+
declare const updateTeam: <O extends OrganizationOptions>(options: O) => _$better_call0.StrictEndpoint<"/organization/update-team", {
|
|
173
174
|
method: "POST";
|
|
174
175
|
body: z.ZodObject<{
|
|
175
176
|
teamId: z.ZodString;
|
|
@@ -182,12 +183,12 @@ declare const updateTeam: <O extends OrganizationOptions>(options: O) => import(
|
|
|
182
183
|
}, z.core.$strip>;
|
|
183
184
|
}, z.core.$strip>;
|
|
184
185
|
requireHeaders: true;
|
|
185
|
-
use: ((
|
|
186
|
+
use: (_$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
186
187
|
orgOptions: OrganizationOptions;
|
|
187
188
|
roles: typeof defaultRoles & {
|
|
188
189
|
[key: string]: Role<{}>;
|
|
189
190
|
};
|
|
190
|
-
getSession: (context:
|
|
191
|
+
getSession: (context: _$_better_auth_core0.GenericEndpointContext) => Promise<{
|
|
191
192
|
session: {
|
|
192
193
|
id: string;
|
|
193
194
|
createdAt: Date;
|
|
@@ -211,8 +212,8 @@ declare const updateTeam: <O extends OrganizationOptions>(options: O) => import(
|
|
|
211
212
|
image?: string | null | undefined;
|
|
212
213
|
};
|
|
213
214
|
}>;
|
|
214
|
-
}
|
|
215
|
-
use: (
|
|
215
|
+
}>> | _$better_call0.Middleware<{
|
|
216
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
216
217
|
session: {
|
|
217
218
|
session: Record<string, any> & {
|
|
218
219
|
id: string;
|
|
@@ -234,7 +235,31 @@ declare const updateTeam: <O extends OrganizationOptions>(options: O) => import(
|
|
|
234
235
|
image?: string | null | undefined;
|
|
235
236
|
};
|
|
236
237
|
};
|
|
237
|
-
}
|
|
238
|
+
}>>[];
|
|
239
|
+
}, (inputContext: _$better_call0.MiddlewareInputContext<{
|
|
240
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
241
|
+
session: {
|
|
242
|
+
session: Record<string, any> & {
|
|
243
|
+
id: string;
|
|
244
|
+
createdAt: Date;
|
|
245
|
+
updatedAt: Date;
|
|
246
|
+
userId: string;
|
|
247
|
+
expiresAt: Date;
|
|
248
|
+
token: string;
|
|
249
|
+
ipAddress?: string | null | undefined;
|
|
250
|
+
userAgent?: string | null | undefined;
|
|
251
|
+
};
|
|
252
|
+
user: Record<string, any> & {
|
|
253
|
+
id: string;
|
|
254
|
+
createdAt: Date;
|
|
255
|
+
updatedAt: Date;
|
|
256
|
+
email: string;
|
|
257
|
+
emailVerified: boolean;
|
|
258
|
+
name: string;
|
|
259
|
+
image?: string | null | undefined;
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
}>>[];
|
|
238
263
|
}>) => Promise<{
|
|
239
264
|
session: {
|
|
240
265
|
session: {
|
|
@@ -260,7 +285,7 @@ declare const updateTeam: <O extends OrganizationOptions>(options: O) => import(
|
|
|
260
285
|
image?: string | null | undefined;
|
|
261
286
|
};
|
|
262
287
|
};
|
|
263
|
-
}
|
|
288
|
+
}>>)[];
|
|
264
289
|
metadata: {
|
|
265
290
|
$Infer: {
|
|
266
291
|
body: {
|
|
@@ -317,10 +342,10 @@ declare const updateTeam: <O extends OrganizationOptions>(options: O) => import(
|
|
|
317
342
|
updatedAt?: Date | undefined;
|
|
318
343
|
} & (O["schema"] extends {
|
|
319
344
|
team?: {
|
|
320
|
-
additionalFields: infer Field extends Record<string,
|
|
345
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
321
346
|
} | undefined;
|
|
322
|
-
} ? FieldAttributeToObject<Field> : {}) extends
|
|
323
|
-
declare const listOrganizationTeams: <O extends OrganizationOptions>(options: O) =>
|
|
347
|
+
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never) & InferAdditionalFieldsFromPluginOptions<"team", O, true>) | null>;
|
|
348
|
+
declare const listOrganizationTeams: <O extends OrganizationOptions>(options: O) => _$better_call0.StrictEndpoint<"/organization/list-teams", {
|
|
324
349
|
method: "GET";
|
|
325
350
|
query: z.ZodOptional<z.ZodObject<{
|
|
326
351
|
organizationId: z.ZodOptional<z.ZodString>;
|
|
@@ -372,12 +397,12 @@ declare const listOrganizationTeams: <O extends OrganizationOptions>(options: O)
|
|
|
372
397
|
};
|
|
373
398
|
};
|
|
374
399
|
requireHeaders: true;
|
|
375
|
-
use: ((
|
|
400
|
+
use: (_$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
376
401
|
orgOptions: OrganizationOptions;
|
|
377
402
|
roles: typeof defaultRoles & {
|
|
378
403
|
[key: string]: Role<{}>;
|
|
379
404
|
};
|
|
380
|
-
getSession: (context:
|
|
405
|
+
getSession: (context: _$_better_auth_core0.GenericEndpointContext) => Promise<{
|
|
381
406
|
session: {
|
|
382
407
|
id: string;
|
|
383
408
|
createdAt: Date;
|
|
@@ -401,8 +426,32 @@ declare const listOrganizationTeams: <O extends OrganizationOptions>(options: O)
|
|
|
401
426
|
image?: string | null | undefined;
|
|
402
427
|
};
|
|
403
428
|
}>;
|
|
404
|
-
}
|
|
405
|
-
use: (
|
|
429
|
+
}>> | _$better_call0.Middleware<{
|
|
430
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
431
|
+
session: {
|
|
432
|
+
session: Record<string, any> & {
|
|
433
|
+
id: string;
|
|
434
|
+
createdAt: Date;
|
|
435
|
+
updatedAt: Date;
|
|
436
|
+
userId: string;
|
|
437
|
+
expiresAt: Date;
|
|
438
|
+
token: string;
|
|
439
|
+
ipAddress?: string | null | undefined;
|
|
440
|
+
userAgent?: string | null | undefined;
|
|
441
|
+
};
|
|
442
|
+
user: Record<string, any> & {
|
|
443
|
+
id: string;
|
|
444
|
+
createdAt: Date;
|
|
445
|
+
updatedAt: Date;
|
|
446
|
+
email: string;
|
|
447
|
+
emailVerified: boolean;
|
|
448
|
+
name: string;
|
|
449
|
+
image?: string | null | undefined;
|
|
450
|
+
};
|
|
451
|
+
};
|
|
452
|
+
}>>[];
|
|
453
|
+
}, (inputContext: _$better_call0.MiddlewareInputContext<{
|
|
454
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
406
455
|
session: {
|
|
407
456
|
session: Record<string, any> & {
|
|
408
457
|
id: string;
|
|
@@ -424,7 +473,7 @@ declare const listOrganizationTeams: <O extends OrganizationOptions>(options: O)
|
|
|
424
473
|
image?: string | null | undefined;
|
|
425
474
|
};
|
|
426
475
|
};
|
|
427
|
-
}
|
|
476
|
+
}>>[];
|
|
428
477
|
}>) => Promise<{
|
|
429
478
|
session: {
|
|
430
479
|
session: {
|
|
@@ -450,7 +499,7 @@ declare const listOrganizationTeams: <O extends OrganizationOptions>(options: O)
|
|
|
450
499
|
image?: string | null | undefined;
|
|
451
500
|
};
|
|
452
501
|
};
|
|
453
|
-
}
|
|
502
|
+
}>>)[];
|
|
454
503
|
}, ({
|
|
455
504
|
id: string;
|
|
456
505
|
name: string;
|
|
@@ -459,21 +508,21 @@ declare const listOrganizationTeams: <O extends OrganizationOptions>(options: O)
|
|
|
459
508
|
updatedAt?: Date | undefined;
|
|
460
509
|
} & (O["schema"] extends {
|
|
461
510
|
team?: {
|
|
462
|
-
additionalFields: infer Field extends Record<string,
|
|
511
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
463
512
|
} | undefined;
|
|
464
|
-
} ? FieldAttributeToObject<Field> : {}) extends
|
|
465
|
-
declare const setActiveTeam: <O extends OrganizationOptions>(options: O) =>
|
|
513
|
+
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never)[]>;
|
|
514
|
+
declare const setActiveTeam: <O extends OrganizationOptions>(options: O) => _$better_call0.StrictEndpoint<"/organization/set-active-team", {
|
|
466
515
|
method: "POST";
|
|
467
516
|
body: z.ZodObject<{
|
|
468
517
|
teamId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
469
518
|
}, z.core.$strip>;
|
|
470
519
|
requireHeaders: true;
|
|
471
|
-
use: ((
|
|
520
|
+
use: (_$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
472
521
|
orgOptions: OrganizationOptions;
|
|
473
522
|
roles: typeof defaultRoles & {
|
|
474
523
|
[key: string]: Role<{}>;
|
|
475
524
|
};
|
|
476
|
-
getSession: (context:
|
|
525
|
+
getSession: (context: _$_better_auth_core0.GenericEndpointContext) => Promise<{
|
|
477
526
|
session: {
|
|
478
527
|
id: string;
|
|
479
528
|
createdAt: Date;
|
|
@@ -497,8 +546,8 @@ declare const setActiveTeam: <O extends OrganizationOptions>(options: O) => impo
|
|
|
497
546
|
image?: string | null | undefined;
|
|
498
547
|
};
|
|
499
548
|
}>;
|
|
500
|
-
}
|
|
501
|
-
use: (
|
|
549
|
+
}>> | _$better_call0.Middleware<{
|
|
550
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
502
551
|
session: {
|
|
503
552
|
session: Record<string, any> & {
|
|
504
553
|
id: string;
|
|
@@ -520,7 +569,31 @@ declare const setActiveTeam: <O extends OrganizationOptions>(options: O) => impo
|
|
|
520
569
|
image?: string | null | undefined;
|
|
521
570
|
};
|
|
522
571
|
};
|
|
523
|
-
}
|
|
572
|
+
}>>[];
|
|
573
|
+
}, (inputContext: _$better_call0.MiddlewareInputContext<{
|
|
574
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
575
|
+
session: {
|
|
576
|
+
session: Record<string, any> & {
|
|
577
|
+
id: string;
|
|
578
|
+
createdAt: Date;
|
|
579
|
+
updatedAt: Date;
|
|
580
|
+
userId: string;
|
|
581
|
+
expiresAt: Date;
|
|
582
|
+
token: string;
|
|
583
|
+
ipAddress?: string | null | undefined;
|
|
584
|
+
userAgent?: string | null | undefined;
|
|
585
|
+
};
|
|
586
|
+
user: Record<string, any> & {
|
|
587
|
+
id: string;
|
|
588
|
+
createdAt: Date;
|
|
589
|
+
updatedAt: Date;
|
|
590
|
+
email: string;
|
|
591
|
+
emailVerified: boolean;
|
|
592
|
+
name: string;
|
|
593
|
+
image?: string | null | undefined;
|
|
594
|
+
};
|
|
595
|
+
};
|
|
596
|
+
}>>[];
|
|
524
597
|
}>) => Promise<{
|
|
525
598
|
session: {
|
|
526
599
|
session: {
|
|
@@ -546,7 +619,7 @@ declare const setActiveTeam: <O extends OrganizationOptions>(options: O) => impo
|
|
|
546
619
|
image?: string | null | undefined;
|
|
547
620
|
};
|
|
548
621
|
};
|
|
549
|
-
}
|
|
622
|
+
}>>)[];
|
|
550
623
|
metadata: {
|
|
551
624
|
openapi: {
|
|
552
625
|
description: string;
|
|
@@ -573,7 +646,7 @@ declare const setActiveTeam: <O extends OrganizationOptions>(options: O) => impo
|
|
|
573
646
|
createdAt: Date;
|
|
574
647
|
updatedAt?: Date | undefined;
|
|
575
648
|
} | null>;
|
|
576
|
-
declare const listUserTeams: <O extends OrganizationOptions>(options: O) =>
|
|
649
|
+
declare const listUserTeams: <O extends OrganizationOptions>(options: O) => _$better_call0.StrictEndpoint<"/organization/list-user-teams", {
|
|
577
650
|
method: "GET";
|
|
578
651
|
metadata: {
|
|
579
652
|
openapi: {
|
|
@@ -599,12 +672,12 @@ declare const listUserTeams: <O extends OrganizationOptions>(options: O) => impo
|
|
|
599
672
|
};
|
|
600
673
|
};
|
|
601
674
|
requireHeaders: true;
|
|
602
|
-
use: ((
|
|
675
|
+
use: (_$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
603
676
|
orgOptions: OrganizationOptions;
|
|
604
677
|
roles: typeof defaultRoles & {
|
|
605
678
|
[key: string]: Role<{}>;
|
|
606
679
|
};
|
|
607
|
-
getSession: (context:
|
|
680
|
+
getSession: (context: _$_better_auth_core0.GenericEndpointContext) => Promise<{
|
|
608
681
|
session: {
|
|
609
682
|
id: string;
|
|
610
683
|
createdAt: Date;
|
|
@@ -628,8 +701,8 @@ declare const listUserTeams: <O extends OrganizationOptions>(options: O) => impo
|
|
|
628
701
|
image?: string | null | undefined;
|
|
629
702
|
};
|
|
630
703
|
}>;
|
|
631
|
-
}
|
|
632
|
-
use: (
|
|
704
|
+
}>> | _$better_call0.Middleware<{
|
|
705
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
633
706
|
session: {
|
|
634
707
|
session: Record<string, any> & {
|
|
635
708
|
id: string;
|
|
@@ -651,7 +724,31 @@ declare const listUserTeams: <O extends OrganizationOptions>(options: O) => impo
|
|
|
651
724
|
image?: string | null | undefined;
|
|
652
725
|
};
|
|
653
726
|
};
|
|
654
|
-
}
|
|
727
|
+
}>>[];
|
|
728
|
+
}, (inputContext: _$better_call0.MiddlewareInputContext<{
|
|
729
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
730
|
+
session: {
|
|
731
|
+
session: Record<string, any> & {
|
|
732
|
+
id: string;
|
|
733
|
+
createdAt: Date;
|
|
734
|
+
updatedAt: Date;
|
|
735
|
+
userId: string;
|
|
736
|
+
expiresAt: Date;
|
|
737
|
+
token: string;
|
|
738
|
+
ipAddress?: string | null | undefined;
|
|
739
|
+
userAgent?: string | null | undefined;
|
|
740
|
+
};
|
|
741
|
+
user: Record<string, any> & {
|
|
742
|
+
id: string;
|
|
743
|
+
createdAt: Date;
|
|
744
|
+
updatedAt: Date;
|
|
745
|
+
email: string;
|
|
746
|
+
emailVerified: boolean;
|
|
747
|
+
name: string;
|
|
748
|
+
image?: string | null | undefined;
|
|
749
|
+
};
|
|
750
|
+
};
|
|
751
|
+
}>>[];
|
|
655
752
|
}>) => Promise<{
|
|
656
753
|
session: {
|
|
657
754
|
session: {
|
|
@@ -677,7 +774,7 @@ declare const listUserTeams: <O extends OrganizationOptions>(options: O) => impo
|
|
|
677
774
|
image?: string | null | undefined;
|
|
678
775
|
};
|
|
679
776
|
};
|
|
680
|
-
}
|
|
777
|
+
}>>)[];
|
|
681
778
|
}, {
|
|
682
779
|
id: string;
|
|
683
780
|
name: string;
|
|
@@ -685,7 +782,7 @@ declare const listUserTeams: <O extends OrganizationOptions>(options: O) => impo
|
|
|
685
782
|
createdAt: Date;
|
|
686
783
|
updatedAt?: Date | undefined;
|
|
687
784
|
}[]>;
|
|
688
|
-
declare const listTeamMembers: <O extends OrganizationOptions>(options: O) =>
|
|
785
|
+
declare const listTeamMembers: <O extends OrganizationOptions>(options: O) => _$better_call0.StrictEndpoint<"/organization/list-team-members", {
|
|
689
786
|
method: "GET";
|
|
690
787
|
query: z.ZodOptional<z.ZodObject<{
|
|
691
788
|
teamId: z.ZodOptional<z.ZodString>;
|
|
@@ -733,12 +830,12 @@ declare const listTeamMembers: <O extends OrganizationOptions>(options: O) => im
|
|
|
733
830
|
};
|
|
734
831
|
};
|
|
735
832
|
requireHeaders: true;
|
|
736
|
-
use: ((
|
|
833
|
+
use: (_$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
737
834
|
orgOptions: OrganizationOptions;
|
|
738
835
|
roles: typeof defaultRoles & {
|
|
739
836
|
[key: string]: Role<{}>;
|
|
740
837
|
};
|
|
741
|
-
getSession: (context:
|
|
838
|
+
getSession: (context: _$_better_auth_core0.GenericEndpointContext) => Promise<{
|
|
742
839
|
session: {
|
|
743
840
|
id: string;
|
|
744
841
|
createdAt: Date;
|
|
@@ -762,8 +859,8 @@ declare const listTeamMembers: <O extends OrganizationOptions>(options: O) => im
|
|
|
762
859
|
image?: string | null | undefined;
|
|
763
860
|
};
|
|
764
861
|
}>;
|
|
765
|
-
}
|
|
766
|
-
use: (
|
|
862
|
+
}>> | _$better_call0.Middleware<{
|
|
863
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
767
864
|
session: {
|
|
768
865
|
session: Record<string, any> & {
|
|
769
866
|
id: string;
|
|
@@ -785,7 +882,31 @@ declare const listTeamMembers: <O extends OrganizationOptions>(options: O) => im
|
|
|
785
882
|
image?: string | null | undefined;
|
|
786
883
|
};
|
|
787
884
|
};
|
|
788
|
-
}
|
|
885
|
+
}>>[];
|
|
886
|
+
}, (inputContext: _$better_call0.MiddlewareInputContext<{
|
|
887
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
888
|
+
session: {
|
|
889
|
+
session: Record<string, any> & {
|
|
890
|
+
id: string;
|
|
891
|
+
createdAt: Date;
|
|
892
|
+
updatedAt: Date;
|
|
893
|
+
userId: string;
|
|
894
|
+
expiresAt: Date;
|
|
895
|
+
token: string;
|
|
896
|
+
ipAddress?: string | null | undefined;
|
|
897
|
+
userAgent?: string | null | undefined;
|
|
898
|
+
};
|
|
899
|
+
user: Record<string, any> & {
|
|
900
|
+
id: string;
|
|
901
|
+
createdAt: Date;
|
|
902
|
+
updatedAt: Date;
|
|
903
|
+
email: string;
|
|
904
|
+
emailVerified: boolean;
|
|
905
|
+
name: string;
|
|
906
|
+
image?: string | null | undefined;
|
|
907
|
+
};
|
|
908
|
+
};
|
|
909
|
+
}>>[];
|
|
789
910
|
}>) => Promise<{
|
|
790
911
|
session: {
|
|
791
912
|
session: {
|
|
@@ -811,14 +932,14 @@ declare const listTeamMembers: <O extends OrganizationOptions>(options: O) => im
|
|
|
811
932
|
image?: string | null | undefined;
|
|
812
933
|
};
|
|
813
934
|
};
|
|
814
|
-
}
|
|
935
|
+
}>>)[];
|
|
815
936
|
}, {
|
|
816
937
|
id: string;
|
|
817
938
|
teamId: string;
|
|
818
939
|
userId: string;
|
|
819
940
|
createdAt: Date;
|
|
820
941
|
}[]>;
|
|
821
|
-
declare const addTeamMember: <O extends OrganizationOptions>(options: O) =>
|
|
942
|
+
declare const addTeamMember: <O extends OrganizationOptions>(options: O) => _$better_call0.StrictEndpoint<"/organization/add-team-member", {
|
|
822
943
|
method: "POST";
|
|
823
944
|
body: z.ZodObject<{
|
|
824
945
|
teamId: z.ZodString;
|
|
@@ -864,12 +985,12 @@ declare const addTeamMember: <O extends OrganizationOptions>(options: O) => impo
|
|
|
864
985
|
};
|
|
865
986
|
};
|
|
866
987
|
requireHeaders: true;
|
|
867
|
-
use: ((
|
|
988
|
+
use: (_$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
868
989
|
orgOptions: OrganizationOptions;
|
|
869
990
|
roles: typeof defaultRoles & {
|
|
870
991
|
[key: string]: Role<{}>;
|
|
871
992
|
};
|
|
872
|
-
getSession: (context:
|
|
993
|
+
getSession: (context: _$_better_auth_core0.GenericEndpointContext) => Promise<{
|
|
873
994
|
session: {
|
|
874
995
|
id: string;
|
|
875
996
|
createdAt: Date;
|
|
@@ -893,8 +1014,8 @@ declare const addTeamMember: <O extends OrganizationOptions>(options: O) => impo
|
|
|
893
1014
|
image?: string | null | undefined;
|
|
894
1015
|
};
|
|
895
1016
|
}>;
|
|
896
|
-
}
|
|
897
|
-
use: (
|
|
1017
|
+
}>> | _$better_call0.Middleware<{
|
|
1018
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
898
1019
|
session: {
|
|
899
1020
|
session: Record<string, any> & {
|
|
900
1021
|
id: string;
|
|
@@ -916,7 +1037,31 @@ declare const addTeamMember: <O extends OrganizationOptions>(options: O) => impo
|
|
|
916
1037
|
image?: string | null | undefined;
|
|
917
1038
|
};
|
|
918
1039
|
};
|
|
919
|
-
}
|
|
1040
|
+
}>>[];
|
|
1041
|
+
}, (inputContext: _$better_call0.MiddlewareInputContext<{
|
|
1042
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
1043
|
+
session: {
|
|
1044
|
+
session: Record<string, any> & {
|
|
1045
|
+
id: string;
|
|
1046
|
+
createdAt: Date;
|
|
1047
|
+
updatedAt: Date;
|
|
1048
|
+
userId: string;
|
|
1049
|
+
expiresAt: Date;
|
|
1050
|
+
token: string;
|
|
1051
|
+
ipAddress?: string | null | undefined;
|
|
1052
|
+
userAgent?: string | null | undefined;
|
|
1053
|
+
};
|
|
1054
|
+
user: Record<string, any> & {
|
|
1055
|
+
id: string;
|
|
1056
|
+
createdAt: Date;
|
|
1057
|
+
updatedAt: Date;
|
|
1058
|
+
email: string;
|
|
1059
|
+
emailVerified: boolean;
|
|
1060
|
+
name: string;
|
|
1061
|
+
image?: string | null | undefined;
|
|
1062
|
+
};
|
|
1063
|
+
};
|
|
1064
|
+
}>>[];
|
|
920
1065
|
}>) => Promise<{
|
|
921
1066
|
session: {
|
|
922
1067
|
session: {
|
|
@@ -942,14 +1087,14 @@ declare const addTeamMember: <O extends OrganizationOptions>(options: O) => impo
|
|
|
942
1087
|
image?: string | null | undefined;
|
|
943
1088
|
};
|
|
944
1089
|
};
|
|
945
|
-
}
|
|
1090
|
+
}>>)[];
|
|
946
1091
|
}, {
|
|
947
1092
|
id: string;
|
|
948
1093
|
teamId: string;
|
|
949
1094
|
userId: string;
|
|
950
1095
|
createdAt: Date;
|
|
951
1096
|
}>;
|
|
952
|
-
declare const removeTeamMember: <O extends OrganizationOptions>(options: O) =>
|
|
1097
|
+
declare const removeTeamMember: <O extends OrganizationOptions>(options: O) => _$better_call0.StrictEndpoint<"/organization/remove-team-member", {
|
|
953
1098
|
method: "POST";
|
|
954
1099
|
body: z.ZodObject<{
|
|
955
1100
|
teamId: z.ZodString;
|
|
@@ -982,12 +1127,12 @@ declare const removeTeamMember: <O extends OrganizationOptions>(options: O) => i
|
|
|
982
1127
|
};
|
|
983
1128
|
};
|
|
984
1129
|
requireHeaders: true;
|
|
985
|
-
use: ((
|
|
1130
|
+
use: (_$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
986
1131
|
orgOptions: OrganizationOptions;
|
|
987
1132
|
roles: typeof defaultRoles & {
|
|
988
1133
|
[key: string]: Role<{}>;
|
|
989
1134
|
};
|
|
990
|
-
getSession: (context:
|
|
1135
|
+
getSession: (context: _$_better_auth_core0.GenericEndpointContext) => Promise<{
|
|
991
1136
|
session: {
|
|
992
1137
|
id: string;
|
|
993
1138
|
createdAt: Date;
|
|
@@ -1011,8 +1156,32 @@ declare const removeTeamMember: <O extends OrganizationOptions>(options: O) => i
|
|
|
1011
1156
|
image?: string | null | undefined;
|
|
1012
1157
|
};
|
|
1013
1158
|
}>;
|
|
1014
|
-
}
|
|
1015
|
-
use: (
|
|
1159
|
+
}>> | _$better_call0.Middleware<{
|
|
1160
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
1161
|
+
session: {
|
|
1162
|
+
session: Record<string, any> & {
|
|
1163
|
+
id: string;
|
|
1164
|
+
createdAt: Date;
|
|
1165
|
+
updatedAt: Date;
|
|
1166
|
+
userId: string;
|
|
1167
|
+
expiresAt: Date;
|
|
1168
|
+
token: string;
|
|
1169
|
+
ipAddress?: string | null | undefined;
|
|
1170
|
+
userAgent?: string | null | undefined;
|
|
1171
|
+
};
|
|
1172
|
+
user: Record<string, any> & {
|
|
1173
|
+
id: string;
|
|
1174
|
+
createdAt: Date;
|
|
1175
|
+
updatedAt: Date;
|
|
1176
|
+
email: string;
|
|
1177
|
+
emailVerified: boolean;
|
|
1178
|
+
name: string;
|
|
1179
|
+
image?: string | null | undefined;
|
|
1180
|
+
};
|
|
1181
|
+
};
|
|
1182
|
+
}>>[];
|
|
1183
|
+
}, (inputContext: _$better_call0.MiddlewareInputContext<{
|
|
1184
|
+
use: _$better_call0.Middleware<_$better_call0.MiddlewareOptions, (inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
1016
1185
|
session: {
|
|
1017
1186
|
session: Record<string, any> & {
|
|
1018
1187
|
id: string;
|
|
@@ -1034,7 +1203,7 @@ declare const removeTeamMember: <O extends OrganizationOptions>(options: O) => i
|
|
|
1034
1203
|
image?: string | null | undefined;
|
|
1035
1204
|
};
|
|
1036
1205
|
};
|
|
1037
|
-
}
|
|
1206
|
+
}>>[];
|
|
1038
1207
|
}>) => Promise<{
|
|
1039
1208
|
session: {
|
|
1040
1209
|
session: {
|
|
@@ -1060,7 +1229,7 @@ declare const removeTeamMember: <O extends OrganizationOptions>(options: O) => i
|
|
|
1060
1229
|
image?: string | null | undefined;
|
|
1061
1230
|
};
|
|
1062
1231
|
};
|
|
1063
|
-
}
|
|
1232
|
+
}>>)[];
|
|
1064
1233
|
}, {
|
|
1065
1234
|
message: string;
|
|
1066
1235
|
}>;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { FieldAttributeToObject, RemoveFieldsWithReturnedFalse } from "../../db/field.mjs";
|
|
2
|
-
import "../../db/index.mjs";
|
|
3
2
|
import { OrganizationOptions } from "./types.mjs";
|
|
4
3
|
import { BetterAuthPluginDBSchema, DBFieldAttribute } from "@better-auth/core/db";
|
|
5
4
|
import { Prettify } from "better-call";
|
|
6
5
|
import * as z from "zod";
|
|
6
|
+
|
|
7
7
|
//#region src/plugins/organization/schema.d.ts
|
|
8
8
|
type InferSchema<Schema extends BetterAuthPluginDBSchema, TableName extends string, DefaultFields> = {
|
|
9
9
|
modelName: Schema[TableName] extends {
|
|
10
10
|
modelName: infer M;
|
|
11
11
|
} ? M extends string ? M : string : string;
|
|
12
|
-
fields: { [K in keyof DefaultFields]: DefaultFields[K]
|
|
12
|
+
fields: { [K in keyof DefaultFields]: DefaultFields[K] } & (Schema[TableName] extends {
|
|
13
13
|
additionalFields: infer F;
|
|
14
14
|
} ? F : {});
|
|
15
15
|
};
|
|
@@ -315,11 +315,11 @@ type CustomRolesSchema<O> = O extends {
|
|
|
315
315
|
type InferOrganizationZodRolesFromOption<O extends OrganizationOptions | undefined> = CustomRolesSchema<O>;
|
|
316
316
|
type InferOrganizationRolesFromOption<O extends OrganizationOptions | undefined> = O extends {
|
|
317
317
|
roles: any;
|
|
318
|
-
} ? keyof O["roles"] extends
|
|
318
|
+
} ? keyof O["roles"] extends infer K extends string ? K : "admin" | "member" | "owner" : "admin" | "member" | "owner";
|
|
319
319
|
type InvitationStatus = "pending" | "accepted" | "rejected" | "canceled";
|
|
320
320
|
type InferAdditionalFieldsOutput<SchemaName extends string, Options extends OrganizationOptions, isClientSide extends boolean> = Options["schema"] extends { [key in SchemaName]?: {
|
|
321
321
|
additionalFields: infer Field extends Record<string, DBFieldAttribute>;
|
|
322
|
-
}
|
|
322
|
+
} } ? isClientSide extends true ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : FieldAttributeToObject<Field> : {};
|
|
323
323
|
type InferMember<O extends OrganizationOptions, isClientSide extends boolean = true> = Prettify<(O["teams"] extends {
|
|
324
324
|
enabled: true;
|
|
325
325
|
} ? {
|