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.
Files changed (210) hide show
  1. package/dist/adapters/index.d.mts +6 -1
  2. package/dist/api/dispatch.d.mts +1 -0
  3. package/dist/api/index.d.mts +508 -505
  4. package/dist/api/middlewares/authorization.d.mts +10 -14
  5. package/dist/api/middlewares/authorization.mjs +1 -2
  6. package/dist/api/middlewares/index.d.mts +1 -2
  7. package/dist/api/middlewares/origin-check.d.mts +5 -3
  8. package/dist/api/routes/account.d.mts +16 -13
  9. package/dist/api/routes/callback.d.mts +3 -1
  10. package/dist/api/routes/email-verification.d.mts +8 -4
  11. package/dist/api/routes/error.d.mts +3 -1
  12. package/dist/api/routes/index.d.mts +1 -2
  13. package/dist/api/routes/ok.d.mts +3 -1
  14. package/dist/api/routes/password.d.mts +10 -8
  15. package/dist/api/routes/session.d.mts +32 -30
  16. package/dist/api/routes/session.mjs +2 -3
  17. package/dist/api/routes/sign-in.d.mts +5 -3
  18. package/dist/api/routes/sign-out.d.mts +3 -1
  19. package/dist/api/routes/sign-up.d.mts +4 -3
  20. package/dist/api/routes/update-session.d.mts +5 -4
  21. package/dist/api/routes/update-user.d.mts +19 -18
  22. package/dist/auth/full.d.mts +1 -1
  23. package/dist/auth/minimal.d.mts +1 -1
  24. package/dist/client/config.d.mts +14 -12
  25. package/dist/client/config.mjs +2 -2
  26. package/dist/client/equality.d.mts +1 -0
  27. package/dist/client/index.d.mts +5 -6
  28. package/dist/client/lynx/index.d.mts +5 -4
  29. package/dist/client/lynx/lynx-store.d.mts +2 -1
  30. package/dist/client/parser.d.mts +3 -7
  31. package/dist/client/path-to-object.d.mts +4 -3
  32. package/dist/client/plugins/index.d.mts +1 -1
  33. package/dist/client/plugins/infer-plugin.d.mts +1 -0
  34. package/dist/client/query.d.mts +1 -0
  35. package/dist/client/react/index.d.mts +5 -4
  36. package/dist/client/react/react-store.d.mts +2 -1
  37. package/dist/client/session-atom.mjs +59 -46
  38. package/dist/client/session-refresh.d.mts +1 -0
  39. package/dist/client/solid/index.d.mts +5 -4
  40. package/dist/client/svelte/index.d.mts +5 -4
  41. package/dist/client/types.d.mts +2 -2
  42. package/dist/client/vanilla.d.mts +2 -1
  43. package/dist/client/vue/index.d.mts +5 -4
  44. package/dist/context/create-context.mjs +3 -3
  45. package/dist/context/helpers.mjs +2 -2
  46. package/dist/cookies/index.d.mts +7 -6
  47. package/dist/cookies/session-store.d.mts +0 -1
  48. package/dist/cookies/session-store.mjs +1 -2
  49. package/dist/crypto/index.d.mts +9 -2
  50. package/dist/crypto/jwt.d.mts +1 -0
  51. package/dist/crypto/password.d.mts +5 -1
  52. package/dist/db/adapter-base.d.mts +1 -0
  53. package/dist/db/adapter-kysely.d.mts +1 -0
  54. package/dist/db/field-converter.d.mts +1 -0
  55. package/dist/db/field.d.mts +10 -9
  56. package/dist/db/get-migration.d.mts +1 -0
  57. package/dist/db/get-schema.d.mts +1 -0
  58. package/dist/db/internal-adapter.d.mts +1 -0
  59. package/dist/db/internal-adapter.mjs +1 -2
  60. package/dist/db/revoke-unproven-account-access.d.mts +1 -0
  61. package/dist/db/schema.d.mts +2 -2
  62. package/dist/db/to-zod.d.mts +7 -3
  63. package/dist/db/with-hooks.d.mts +1 -0
  64. package/dist/index.d.mts +3 -4
  65. package/dist/integrations/next-js.d.mts +7 -4
  66. package/dist/integrations/node.d.mts +3 -2
  67. package/dist/integrations/svelte-kit.d.mts +9 -2
  68. package/dist/integrations/tanstack-start-solid.d.mts +5 -2
  69. package/dist/integrations/tanstack-start.d.mts +5 -2
  70. package/dist/oauth2/link-account.d.mts +1 -1
  71. package/dist/oauth2/state.d.mts +1 -0
  72. package/dist/oauth2/utils.d.mts +1 -0
  73. package/dist/package.mjs +1 -1
  74. package/dist/plugins/access/access.d.mts +1 -0
  75. package/dist/plugins/access/types.d.mts +5 -4
  76. package/dist/plugins/additional-fields/client.d.mts +1 -0
  77. package/dist/plugins/admin/access/statement.d.mts +0 -1
  78. package/dist/plugins/admin/admin.d.mts +137 -132
  79. package/dist/plugins/admin/client.d.mts +30 -30
  80. package/dist/plugins/admin/client.mjs +1 -1
  81. package/dist/plugins/admin/error-codes.d.mts +25 -23
  82. package/dist/plugins/admin/index.d.mts +1 -1
  83. package/dist/plugins/admin/schema.d.mts +1 -1
  84. package/dist/plugins/admin/types.d.mts +2 -3
  85. package/dist/plugins/anonymous/client.d.mts +11 -9
  86. package/dist/plugins/anonymous/client.mjs +1 -1
  87. package/dist/plugins/anonymous/error-codes.d.mts +10 -8
  88. package/dist/plugins/anonymous/index.d.mts +19 -15
  89. package/dist/plugins/anonymous/types.d.mts +1 -1
  90. package/dist/plugins/bearer/index.d.mts +8 -5
  91. package/dist/plugins/captcha/index.d.mts +8 -5
  92. package/dist/plugins/captcha/types.d.mts +1 -0
  93. package/dist/plugins/custom-session/client.d.mts +1 -0
  94. package/dist/plugins/custom-session/index.d.mts +12 -7
  95. package/dist/plugins/device-authorization/client.d.mts +1 -0
  96. package/dist/plugins/device-authorization/index.d.mts +22 -19
  97. package/dist/plugins/email-otp/client.d.mts +6 -4
  98. package/dist/plugins/email-otp/client.mjs +1 -1
  99. package/dist/plugins/email-otp/error-codes.d.mts +5 -3
  100. package/dist/plugins/email-otp/index.d.mts +76 -69
  101. package/dist/plugins/email-otp/types.d.mts +1 -0
  102. package/dist/plugins/generic-oauth/client.d.mts +11 -10
  103. package/dist/plugins/generic-oauth/client.mjs +1 -1
  104. package/dist/plugins/generic-oauth/error-codes.d.mts +10 -8
  105. package/dist/plugins/generic-oauth/index.d.mts +45 -41
  106. package/dist/plugins/generic-oauth/providers/auth0.d.mts +1 -0
  107. package/dist/plugins/generic-oauth/providers/gumroad.d.mts +1 -0
  108. package/dist/plugins/generic-oauth/providers/hubspot.d.mts +1 -0
  109. package/dist/plugins/generic-oauth/providers/index.d.mts +1 -2
  110. package/dist/plugins/generic-oauth/providers/keycloak.d.mts +1 -0
  111. package/dist/plugins/generic-oauth/providers/line.d.mts +1 -0
  112. package/dist/plugins/generic-oauth/providers/microsoft-entra-id.d.mts +1 -0
  113. package/dist/plugins/generic-oauth/providers/okta.d.mts +1 -0
  114. package/dist/plugins/generic-oauth/providers/patreon.d.mts +1 -0
  115. package/dist/plugins/generic-oauth/providers/slack.d.mts +1 -0
  116. package/dist/plugins/generic-oauth/providers/yandex.d.mts +1 -0
  117. package/dist/plugins/generic-oauth/types.d.mts +2 -1
  118. package/dist/plugins/haveibeenpwned/index.d.mts +6 -3
  119. package/dist/plugins/index.d.mts +1 -4
  120. package/dist/plugins/jwt/client.d.mts +2 -1
  121. package/dist/plugins/jwt/index.d.mts +12 -9
  122. package/dist/plugins/jwt/sign.d.mts +2 -2
  123. package/dist/plugins/jwt/types.d.mts +1 -1
  124. package/dist/plugins/jwt/utils.d.mts +4 -2
  125. package/dist/plugins/jwt/verify.d.mts +1 -0
  126. package/dist/plugins/last-login-method/index.d.mts +6 -3
  127. package/dist/plugins/magic-link/client.d.mts +1 -0
  128. package/dist/plugins/magic-link/index.d.mts +6 -4
  129. package/dist/plugins/mcp/client/adapters.d.mts +1 -0
  130. package/dist/plugins/mcp/client/index.mjs +2 -4
  131. package/dist/plugins/mcp/index.d.mts +12 -11
  132. package/dist/plugins/multi-session/client.d.mts +4 -2
  133. package/dist/plugins/multi-session/client.mjs +1 -1
  134. package/dist/plugins/multi-session/error-codes.d.mts +3 -1
  135. package/dist/plugins/multi-session/index.d.mts +12 -8
  136. package/dist/plugins/oauth-popup/client.d.mts +12 -6
  137. package/dist/plugins/oauth-popup/client.mjs +3 -5
  138. package/dist/plugins/oauth-popup/error-codes.d.mts +6 -4
  139. package/dist/plugins/oauth-popup/index.d.mts +12 -8
  140. package/dist/plugins/oauth-popup/index.mjs +1 -1
  141. package/dist/plugins/oauth-popup/types.d.mts +2 -1
  142. package/dist/plugins/oauth-proxy/index.d.mts +9 -6
  143. package/dist/plugins/oauth-proxy/index.mjs +2 -2
  144. package/dist/plugins/oidc-provider/client.d.mts +2 -1
  145. package/dist/plugins/oidc-provider/index.d.mts +20 -18
  146. package/dist/plugins/oidc-provider/schema.d.mts +1 -0
  147. package/dist/plugins/oidc-provider/types.d.mts +1 -1
  148. package/dist/plugins/one-tap/client.d.mts +3 -1
  149. package/dist/plugins/one-tap/index.d.mts +3 -1
  150. package/dist/plugins/one-time-token/client.d.mts +2 -1
  151. package/dist/plugins/one-time-token/index.d.mts +7 -6
  152. package/dist/plugins/open-api/generator.d.mts +1 -0
  153. package/dist/plugins/open-api/generator.mjs +5 -5
  154. package/dist/plugins/open-api/index.d.mts +5 -3
  155. package/dist/plugins/organization/access/statement.d.mts +0 -1
  156. package/dist/plugins/organization/adapter.d.mts +82 -56
  157. package/dist/plugins/organization/client.d.mts +103 -104
  158. package/dist/plugins/organization/client.mjs +4 -7
  159. package/dist/plugins/organization/error-codes.d.mts +61 -59
  160. package/dist/plugins/organization/has-permission.d.mts +1 -0
  161. package/dist/plugins/organization/has-permission.mjs +1 -1
  162. package/dist/plugins/organization/index.d.mts +1 -1
  163. package/dist/plugins/organization/organization.d.mts +33 -9
  164. package/dist/plugins/organization/organization.mjs +1 -1
  165. package/dist/plugins/organization/permission.d.mts +2 -2
  166. package/dist/plugins/organization/routes/crud-access-control.d.mts +147 -27
  167. package/dist/plugins/organization/routes/crud-invites.d.mts +186 -65
  168. package/dist/plugins/organization/routes/crud-invites.mjs +1 -1
  169. package/dist/plugins/organization/routes/crud-members.d.mts +178 -56
  170. package/dist/plugins/organization/routes/crud-members.mjs +1 -1
  171. package/dist/plugins/organization/routes/crud-org.d.mts +130 -57
  172. package/dist/plugins/organization/routes/crud-team.d.mts +235 -66
  173. package/dist/plugins/organization/schema.d.mts +4 -4
  174. package/dist/plugins/organization/schema.mjs +1 -1
  175. package/dist/plugins/organization/types.d.mts +14 -14
  176. package/dist/plugins/phone-number/client.d.mts +15 -13
  177. package/dist/plugins/phone-number/client.mjs +1 -1
  178. package/dist/plugins/phone-number/error-codes.d.mts +14 -12
  179. package/dist/plugins/phone-number/index.d.mts +47 -41
  180. package/dist/plugins/phone-number/types.d.mts +1 -1
  181. package/dist/plugins/siwe/client.d.mts +1 -0
  182. package/dist/plugins/siwe/index.d.mts +5 -4
  183. package/dist/plugins/test-utils/index.d.mts +4 -2
  184. package/dist/plugins/test-utils/types.d.mts +0 -1
  185. package/dist/plugins/two-factor/backup-codes/index.d.mts +7 -5
  186. package/dist/plugins/two-factor/backup-codes/index.mjs +1 -1
  187. package/dist/plugins/two-factor/client.d.mts +15 -12
  188. package/dist/plugins/two-factor/client.mjs +1 -1
  189. package/dist/plugins/two-factor/error-code.d.mts +12 -10
  190. package/dist/plugins/two-factor/index.d.mts +36 -32
  191. package/dist/plugins/two-factor/otp/index.d.mts +4 -2
  192. package/dist/plugins/two-factor/totp/index.d.mts +7 -5
  193. package/dist/plugins/two-factor/types.d.mts +1 -1
  194. package/dist/plugins/username/client.d.mts +11 -9
  195. package/dist/plugins/username/client.mjs +1 -1
  196. package/dist/plugins/username/error-codes.d.mts +10 -8
  197. package/dist/plugins/username/index.d.mts +22 -17
  198. package/dist/plugins/username/schema.d.mts +5 -3
  199. package/dist/state.d.mts +1 -0
  200. package/dist/test-utils/test-instance.d.mts +3 -5
  201. package/dist/types/adapter.d.mts +1 -1
  202. package/dist/types/api.d.mts +2 -1
  203. package/dist/types/auth.d.mts +1 -0
  204. package/dist/types/helper.d.mts +5 -5
  205. package/dist/types/index.d.mts +2 -2
  206. package/dist/types/models.d.mts +1 -0
  207. package/dist/types/plugins.d.mts +3 -2
  208. package/dist/utils/index.d.mts +1 -2
  209. package/dist/utils/url.d.mts +1 -0
  210. 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, import("@better-auth/core/db").DBFieldAttribute>;
47
+ additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
48
48
  } | undefined;
49
- } ? FieldAttributeToObject<Field> : {}) extends (infer T) ? { [K in keyof T]: T[K]; } : never) & {
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, import("@better-auth/core/db").DBFieldAttribute>;
98
+ additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
99
99
  } | undefined;
100
- } ? FieldAttributeToObject<Field> : {}) extends (infer T) ? { [K in keyof T]: T[K]; } : never) & {
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, import("@better-auth/core/db").DBFieldAttribute>;
142
+ additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
143
143
  } | undefined;
144
- } ? FieldAttributeToObject<Field> : {}) extends (infer T) ? { [K in keyof T]: T[K]; } : never) & {
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, import("@better-auth/core/db").DBFieldAttribute>;
183
+ additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
184
184
  } | undefined;
185
- } ? FieldAttributeToObject<Field> : {}) extends (infer T) ? { [K in keyof T]: T[K]; } : never) & {
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, import("@better-auth/core/db").DBFieldAttribute>;
229
+ additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
230
230
  } | undefined;
231
- } ? FieldAttributeToObject<Field> : {}) extends (infer T) ? { [K in keyof T]: T[K]; } : never) | null>;
232
- deleteMember: ({ memberId, organizationId, userId: _userId }: {
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: ({ userId, organizationId }: {
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, import("@better-auth/core/db").DBFieldAttribute>;
289
+ additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
283
290
  } | undefined;
284
- } ? FieldAttributeToObject<Field> : {}) extends (infer T) ? { [K in keyof T]: T[K]; } : never) | null>;
291
+ } ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never) | null>;
285
292
  /**
286
293
  * @requires db
287
294
  */
288
- findFullOrganization: ({ organizationId, isSlug, includeTeams, membersLimit }: {
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, import("@better-auth/core/db").DBFieldAttribute>;
314
+ additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
303
315
  } | undefined;
304
- } ? FieldAttributeToObject<Field> : {}) extends (infer T) ? { [K in keyof T]: T[K]; } : never) & {
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, import("@better-auth/core/db").DBFieldAttribute>;
344
+ additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
333
345
  } | undefined;
334
- } ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends (infer T_1) ? { [K_1 in keyof T_1]: T_1[K_1]; } : never)[];
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, import("@better-auth/core/db").DBFieldAttribute>;
376
+ additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
365
377
  } | undefined;
366
- } ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends (infer T_2) ? { [K_2 in keyof T_2]: T_2[K_2]; } : never) & {
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, import("@better-auth/core/db").DBFieldAttribute>;
394
+ additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
383
395
  } | undefined;
384
- } ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends (infer T_3) ? { [K_3 in keyof T_3]: T_3[K_3]; } : never)[] | undefined;
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, import("@better-auth/core/db").DBFieldAttribute>;
407
+ additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
396
408
  } | undefined;
397
- } ? FieldAttributeToObject<Field> : {}) extends (infer T) ? { [K in keyof T]: T[K]; } : never>;
398
- findTeamById: <IncludeMembers extends boolean>({ teamId, organizationId, includeTeamMembers }: {
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, import("@better-auth/core/db").DBFieldAttribute>;
433
+ additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
418
434
  } | undefined;
419
- } ? FieldAttributeToObject<Field> : {}) extends (infer T) ? { [K in keyof T]: T[K]; } : never) & InferAdditionalFieldsFromPluginOptions<"team", O>) | null>;
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, import("@better-auth/core/db").DBFieldAttribute>;
445
+ additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
430
446
  } | undefined;
431
- } ? FieldAttributeToObject<Field> : {}) extends (infer T) ? { [K in keyof T]: T[K]; } : never)[]>;
432
- createTeamInvitation: ({ email, role, teamId, organizationId, inviterId, expiresIn }: {
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, import("@better-auth/core/db").DBFieldAttribute>;
485
+ additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
463
486
  } | undefined;
464
- } ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends (infer T) ? { [K in keyof T]: T[K]; } : never>;
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, import("@better-auth/core/db").DBFieldAttribute>;
588
+ additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
566
589
  } | undefined;
567
- } ? FieldAttributeToObject<Field> : {}) extends (infer T) ? { [K in keyof T]: T[K]; } : never)[]>;
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, import("@better-auth/core/db").DBFieldAttribute>;
614
+ additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
592
615
  } | undefined;
593
- } ? FieldAttributeToObject<Field> : {}) extends (infer T) ? { [K in keyof T]: T[K]; } : never) & {
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, import("@better-auth/core/db").DBFieldAttribute>;
628
+ additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
606
629
  } | undefined;
607
630
  } ? FieldAttributeToObject<Field> : {}))["name"];
608
631
  })[]>;
609
- createInvitation: ({ invitation, user }: {
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, import("@better-auth/core/db").DBFieldAttribute>;
666
+ additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
641
667
  } | undefined;
642
- } ? FieldAttributeToObject<Field> : {}) extends (infer T) ? { [K in keyof T]: T[K]; } : never>;
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, import("@better-auth/core/db").DBFieldAttribute>;
692
+ additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
667
693
  } | undefined;
668
- } ? FieldAttributeToObject<Field> : {}) extends (infer T) ? { [K in keyof T]: T[K]; } : never) | null>;
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, import("@better-auth/core/db").DBFieldAttribute>;
721
+ additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
696
722
  } | undefined;
697
- } ? FieldAttributeToObject<Field> : {}) extends (infer T) ? { [K in keyof T]: T[K]; } : never)[]>;
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, import("@better-auth/core/db").DBFieldAttribute>;
749
+ additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
724
750
  } | undefined;
725
- } ? FieldAttributeToObject<Field> : {}) extends (infer T) ? { [K in keyof T]: T[K]; } : never)[]>;
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, import("@better-auth/core/db").DBFieldAttribute>;
777
+ additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
752
778
  } | undefined;
753
- } ? FieldAttributeToObject<Field> : {}) extends (infer T) ? { [K in keyof T]: T[K]; } : never)[]>;
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, import("@better-auth/core/db").DBFieldAttribute>;
812
+ additionalFields: infer Field extends Record<string, _$_better_auth_core_db0.DBFieldAttribute>;
787
813
  } | undefined;
788
- } ? FieldAttributeToObject<Field> : {}) extends (infer T) ? { [K in keyof T]: T[K]; } : never) | null>;
814
+ } ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never) | null>;
789
815
  };
790
816
  //#endregion
791
817
  export { getOrgAdapter };