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,11 +1,11 @@
|
|
|
1
1
|
import { FieldAttributeToObject, InferAdditionalFieldsFromPluginOptions, RemoveFieldsWithReturnedFalse } from "../../db/field.mjs";
|
|
2
|
-
import { User } from "../../types/models.mjs";
|
|
3
|
-
import "../../types/index.mjs";
|
|
4
|
-
import "../../db/index.mjs";
|
|
2
|
+
import { User as User$1 } from "../../types/models.mjs";
|
|
5
3
|
import { OrganizationOptions } from "./types.mjs";
|
|
6
4
|
import { InferInvitation, InferMember, InferOrganization, InferOrganizationRolesFromOption, InferTeam, InvitationStatus, MemberInput, OrganizationInput, TeamInput, TeamMember } from "./schema.mjs";
|
|
7
5
|
import { AuthContext, GenericEndpointContext } from "@better-auth/core";
|
|
6
|
+
import * as _$_better_auth_core_db0 from "@better-auth/core/db";
|
|
8
7
|
import { WhereOperator } from "@better-auth/core/db/adapter";
|
|
8
|
+
|
|
9
9
|
//#region src/plugins/organization/adapter.d.ts
|
|
10
10
|
declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContext, options?: O | undefined) => {
|
|
11
11
|
findOrganizationBySlug: (slug: string) => Promise<InferOrganization<O> | null>;
|
|
@@ -44,9 +44,9 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
44
44
|
};
|
|
45
45
|
}) & (O["schema"] extends {
|
|
46
46
|
member?: {
|
|
47
|
-
additionalFields: infer Field extends Record<string,
|
|
47
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
48
48
|
} | undefined;
|
|
49
|
-
} ? FieldAttributeToObject<Field> : {}) extends
|
|
49
|
+
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never) & {
|
|
50
50
|
user: {
|
|
51
51
|
id: string;
|
|
52
52
|
name: string;
|
|
@@ -95,9 +95,9 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
95
95
|
};
|
|
96
96
|
}) & (O["schema"] extends {
|
|
97
97
|
member?: {
|
|
98
|
-
additionalFields: infer Field extends Record<string,
|
|
98
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
99
99
|
} | undefined;
|
|
100
|
-
} ? FieldAttributeToObject<Field> : {}) extends
|
|
100
|
+
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never) & {
|
|
101
101
|
user: {
|
|
102
102
|
id: string;
|
|
103
103
|
name: string;
|
|
@@ -139,10 +139,10 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
139
139
|
};
|
|
140
140
|
}) & (O["schema"] extends {
|
|
141
141
|
member?: {
|
|
142
|
-
additionalFields: infer Field extends Record<string,
|
|
142
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
143
143
|
} | undefined;
|
|
144
|
-
} ? FieldAttributeToObject<Field> : {}) extends
|
|
145
|
-
user: User;
|
|
144
|
+
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never) & {
|
|
145
|
+
user: User$1;
|
|
146
146
|
}, "user"> & {
|
|
147
147
|
user: {
|
|
148
148
|
id: string;
|
|
@@ -180,9 +180,9 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
180
180
|
};
|
|
181
181
|
}) & (O["schema"] extends {
|
|
182
182
|
member?: {
|
|
183
|
-
additionalFields: infer Field extends Record<string,
|
|
183
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
184
184
|
} | undefined;
|
|
185
|
-
} ? FieldAttributeToObject<Field> : {}) extends
|
|
185
|
+
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never) & {
|
|
186
186
|
user: {
|
|
187
187
|
id: string;
|
|
188
188
|
name: string;
|
|
@@ -226,10 +226,14 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
226
226
|
};
|
|
227
227
|
}) & (O["schema"] extends {
|
|
228
228
|
member?: {
|
|
229
|
-
additionalFields: infer Field extends Record<string,
|
|
229
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
230
230
|
} | undefined;
|
|
231
|
-
} ? FieldAttributeToObject<Field> : {}) extends
|
|
232
|
-
deleteMember: ({
|
|
231
|
+
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never) | null>;
|
|
232
|
+
deleteMember: ({
|
|
233
|
+
memberId,
|
|
234
|
+
organizationId,
|
|
235
|
+
userId: _userId
|
|
236
|
+
}: {
|
|
233
237
|
memberId: string;
|
|
234
238
|
organizationId: string;
|
|
235
239
|
userId?: string;
|
|
@@ -247,7 +251,10 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
247
251
|
userAgent?: string | null | undefined;
|
|
248
252
|
}>;
|
|
249
253
|
findOrganizationById: (organizationId: string) => Promise<InferOrganization<O> | null>;
|
|
250
|
-
checkMembership: ({
|
|
254
|
+
checkMembership: ({
|
|
255
|
+
userId,
|
|
256
|
+
organizationId
|
|
257
|
+
}: {
|
|
251
258
|
userId: string;
|
|
252
259
|
organizationId: string;
|
|
253
260
|
}) => Promise<((O["teams"] extends {
|
|
@@ -279,13 +286,18 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
279
286
|
};
|
|
280
287
|
}) & (O["schema"] extends {
|
|
281
288
|
member?: {
|
|
282
|
-
additionalFields: infer Field extends Record<string,
|
|
289
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
283
290
|
} | undefined;
|
|
284
|
-
} ? FieldAttributeToObject<Field> : {}) extends
|
|
291
|
+
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never) | null>;
|
|
285
292
|
/**
|
|
286
293
|
* @requires db
|
|
287
294
|
*/
|
|
288
|
-
findFullOrganization: ({
|
|
295
|
+
findFullOrganization: ({
|
|
296
|
+
organizationId,
|
|
297
|
+
isSlug,
|
|
298
|
+
includeTeams,
|
|
299
|
+
membersLimit
|
|
300
|
+
}: {
|
|
289
301
|
organizationId: string;
|
|
290
302
|
isSlug?: boolean | undefined;
|
|
291
303
|
includeTeams?: boolean | undefined;
|
|
@@ -299,9 +311,9 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
299
311
|
metadata?: any;
|
|
300
312
|
} & (O["schema"] extends {
|
|
301
313
|
organization?: {
|
|
302
|
-
additionalFields: infer Field extends Record<string,
|
|
314
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
303
315
|
} | undefined;
|
|
304
|
-
} ? FieldAttributeToObject<Field> : {}) extends
|
|
316
|
+
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never) & {
|
|
305
317
|
invitation: InferInvitation<O>[];
|
|
306
318
|
member: InferMember<O>[];
|
|
307
319
|
team: InferTeam<O>[] | undefined;
|
|
@@ -329,9 +341,9 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
329
341
|
createdAt: Date;
|
|
330
342
|
}) & (O["schema"] extends {
|
|
331
343
|
invitation?: {
|
|
332
|
-
additionalFields: infer Field extends Record<string,
|
|
344
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
333
345
|
} | undefined;
|
|
334
|
-
} ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends
|
|
346
|
+
} ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends infer T_1 ? { [K_1 in keyof T_1]: T_1[K_1] } : never)[];
|
|
335
347
|
members: (((O["teams"] extends {
|
|
336
348
|
enabled: true;
|
|
337
349
|
} ? {
|
|
@@ -361,9 +373,9 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
361
373
|
};
|
|
362
374
|
}) & (O["schema"] extends {
|
|
363
375
|
member?: {
|
|
364
|
-
additionalFields: infer Field extends Record<string,
|
|
376
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
365
377
|
} | undefined;
|
|
366
|
-
} ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends
|
|
378
|
+
} ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends infer T_2 ? { [K_2 in keyof T_2]: T_2[K_2] } : never) & {
|
|
367
379
|
user: {
|
|
368
380
|
id: string;
|
|
369
381
|
name: string;
|
|
@@ -379,9 +391,9 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
379
391
|
updatedAt?: Date | undefined;
|
|
380
392
|
} & (O["schema"] extends {
|
|
381
393
|
team?: {
|
|
382
|
-
additionalFields: infer Field extends Record<string,
|
|
394
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
383
395
|
} | undefined;
|
|
384
|
-
} ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends
|
|
396
|
+
} ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends infer T_3 ? { [K_3 in keyof T_3]: T_3[K_3] } : never)[] | undefined;
|
|
385
397
|
}) | null>;
|
|
386
398
|
listOrganizations: (userId: string) => Promise<InferOrganization<O>[]>;
|
|
387
399
|
createTeam: (data: TeamInput) => Promise<{
|
|
@@ -392,10 +404,14 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
392
404
|
updatedAt?: Date | undefined;
|
|
393
405
|
} & (O["schema"] extends {
|
|
394
406
|
team?: {
|
|
395
|
-
additionalFields: infer Field extends Record<string,
|
|
407
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
396
408
|
} | undefined;
|
|
397
|
-
} ? FieldAttributeToObject<Field> : {}) extends
|
|
398
|
-
findTeamById: <IncludeMembers extends boolean>({
|
|
409
|
+
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never>;
|
|
410
|
+
findTeamById: <IncludeMembers extends boolean>({
|
|
411
|
+
teamId,
|
|
412
|
+
organizationId,
|
|
413
|
+
includeTeamMembers
|
|
414
|
+
}: {
|
|
399
415
|
teamId: string;
|
|
400
416
|
organizationId?: string | undefined;
|
|
401
417
|
includeTeamMembers?: IncludeMembers | undefined;
|
|
@@ -414,9 +430,9 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
414
430
|
updatedAt?: Date | undefined;
|
|
415
431
|
} & (O["schema"] extends {
|
|
416
432
|
team?: {
|
|
417
|
-
additionalFields: infer Field extends Record<string,
|
|
433
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
418
434
|
} | undefined;
|
|
419
|
-
} ? FieldAttributeToObject<Field> : {}) extends
|
|
435
|
+
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never) & InferAdditionalFieldsFromPluginOptions<"team", O>) | null>;
|
|
420
436
|
deleteTeam: (teamId: string) => Promise<void>;
|
|
421
437
|
listTeams: (organizationId: string) => Promise<({
|
|
422
438
|
id: string;
|
|
@@ -426,10 +442,17 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
426
442
|
updatedAt?: Date | undefined;
|
|
427
443
|
} & (O["schema"] extends {
|
|
428
444
|
team?: {
|
|
429
|
-
additionalFields: infer Field extends Record<string,
|
|
445
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
430
446
|
} | undefined;
|
|
431
|
-
} ? FieldAttributeToObject<Field> : {}) extends
|
|
432
|
-
createTeamInvitation: ({
|
|
447
|
+
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never)[]>;
|
|
448
|
+
createTeamInvitation: ({
|
|
449
|
+
email,
|
|
450
|
+
role,
|
|
451
|
+
teamId,
|
|
452
|
+
organizationId,
|
|
453
|
+
inviterId,
|
|
454
|
+
expiresIn
|
|
455
|
+
}: {
|
|
433
456
|
email: string;
|
|
434
457
|
role: string;
|
|
435
458
|
teamId: string;
|
|
@@ -459,9 +482,9 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
459
482
|
createdAt: Date;
|
|
460
483
|
}) & (O["schema"] extends {
|
|
461
484
|
invitation?: {
|
|
462
|
-
additionalFields: infer Field extends Record<string,
|
|
485
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
463
486
|
} | undefined;
|
|
464
|
-
} ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends
|
|
487
|
+
} ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends infer T ? { [K in keyof T]: T[K] } : never>;
|
|
465
488
|
setActiveTeam: (sessionToken: string, teamId: string | null, ctx: GenericEndpointContext) => Promise<{
|
|
466
489
|
id: string;
|
|
467
490
|
createdAt: Date;
|
|
@@ -562,9 +585,9 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
562
585
|
createdAt: Date;
|
|
563
586
|
}) & (O["schema"] extends {
|
|
564
587
|
invitation?: {
|
|
565
|
-
additionalFields: infer Field extends Record<string,
|
|
588
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
566
589
|
} | undefined;
|
|
567
|
-
} ? FieldAttributeToObject<Field> : {}) extends
|
|
590
|
+
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never)[]>;
|
|
568
591
|
listUserInvitations: (email: string) => Promise<(Omit<((O["teams"] extends {
|
|
569
592
|
enabled: true;
|
|
570
593
|
} ? {
|
|
@@ -588,9 +611,9 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
588
611
|
createdAt: Date;
|
|
589
612
|
}) & (O["schema"] extends {
|
|
590
613
|
invitation?: {
|
|
591
|
-
additionalFields: infer Field extends Record<string,
|
|
614
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
592
615
|
} | undefined;
|
|
593
|
-
} ? FieldAttributeToObject<Field> : {}) extends
|
|
616
|
+
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never) & {
|
|
594
617
|
organization: InferOrganization<O, false>;
|
|
595
618
|
}, "organization"> & {
|
|
596
619
|
organizationName: ({
|
|
@@ -602,18 +625,21 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
602
625
|
metadata?: any;
|
|
603
626
|
} & (O["schema"] extends {
|
|
604
627
|
organization?: {
|
|
605
|
-
additionalFields: infer Field extends Record<string,
|
|
628
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
606
629
|
} | undefined;
|
|
607
630
|
} ? FieldAttributeToObject<Field> : {}))["name"];
|
|
608
631
|
})[]>;
|
|
609
|
-
createInvitation: ({
|
|
632
|
+
createInvitation: ({
|
|
633
|
+
invitation,
|
|
634
|
+
user
|
|
635
|
+
}: {
|
|
610
636
|
invitation: {
|
|
611
637
|
email: string;
|
|
612
638
|
role: string;
|
|
613
639
|
organizationId: string;
|
|
614
640
|
teamIds: string[];
|
|
615
641
|
} & Record<string, any>;
|
|
616
|
-
user: User;
|
|
642
|
+
user: User$1;
|
|
617
643
|
}) => Promise<(O["teams"] extends {
|
|
618
644
|
enabled: true;
|
|
619
645
|
} ? {
|
|
@@ -637,9 +663,9 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
637
663
|
createdAt: Date;
|
|
638
664
|
}) & (O["schema"] extends {
|
|
639
665
|
invitation?: {
|
|
640
|
-
additionalFields: infer Field extends Record<string,
|
|
666
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
641
667
|
} | undefined;
|
|
642
|
-
} ? FieldAttributeToObject<Field> : {}) extends
|
|
668
|
+
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never>;
|
|
643
669
|
findInvitationById: (id: string) => Promise<((O["teams"] extends {
|
|
644
670
|
enabled: true;
|
|
645
671
|
} ? {
|
|
@@ -663,9 +689,9 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
663
689
|
createdAt: Date;
|
|
664
690
|
}) & (O["schema"] extends {
|
|
665
691
|
invitation?: {
|
|
666
|
-
additionalFields: infer Field extends Record<string,
|
|
692
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
667
693
|
} | undefined;
|
|
668
|
-
} ? FieldAttributeToObject<Field> : {}) extends
|
|
694
|
+
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never) | null>;
|
|
669
695
|
findPendingInvitation: (data: {
|
|
670
696
|
email: string;
|
|
671
697
|
organizationId: string;
|
|
@@ -692,9 +718,9 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
692
718
|
createdAt: Date;
|
|
693
719
|
}) & (O["schema"] extends {
|
|
694
720
|
invitation?: {
|
|
695
|
-
additionalFields: infer Field extends Record<string,
|
|
721
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
696
722
|
} | undefined;
|
|
697
|
-
} ? FieldAttributeToObject<Field> : {}) extends
|
|
723
|
+
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never)[]>;
|
|
698
724
|
findPendingInvitations: (data: {
|
|
699
725
|
organizationId: string;
|
|
700
726
|
}) => Promise<((O["teams"] extends {
|
|
@@ -720,9 +746,9 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
720
746
|
createdAt: Date;
|
|
721
747
|
}) & (O["schema"] extends {
|
|
722
748
|
invitation?: {
|
|
723
|
-
additionalFields: infer Field extends Record<string,
|
|
749
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
724
750
|
} | undefined;
|
|
725
|
-
} ? FieldAttributeToObject<Field> : {}) extends
|
|
751
|
+
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never)[]>;
|
|
726
752
|
listInvitations: (data: {
|
|
727
753
|
organizationId: string;
|
|
728
754
|
}) => Promise<((O["teams"] extends {
|
|
@@ -748,9 +774,9 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
748
774
|
createdAt: Date;
|
|
749
775
|
}) & (O["schema"] extends {
|
|
750
776
|
invitation?: {
|
|
751
|
-
additionalFields: infer Field extends Record<string,
|
|
777
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
752
778
|
} | undefined;
|
|
753
|
-
} ? FieldAttributeToObject<Field> : {}) extends
|
|
779
|
+
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never)[]>;
|
|
754
780
|
updateInvitation: (data: {
|
|
755
781
|
invitationId: string;
|
|
756
782
|
status: "pending" | "accepted" | "canceled" | "rejected";
|
|
@@ -783,9 +809,9 @@ declare const getOrgAdapter: <O extends OrganizationOptions>(context: AuthContex
|
|
|
783
809
|
createdAt: Date;
|
|
784
810
|
}) & (O["schema"] extends {
|
|
785
811
|
invitation?: {
|
|
786
|
-
additionalFields: infer Field extends Record<string,
|
|
812
|
+
additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
|
|
787
813
|
} | undefined;
|
|
788
|
-
} ? FieldAttributeToObject<Field> : {}) extends
|
|
814
|
+
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never) | null>;
|
|
789
815
|
};
|
|
790
816
|
//#endregion
|
|
791
817
|
export { getOrgAdapter };
|