better-auth 1.6.23 → 1.6.24

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 (244) hide show
  1. package/dist/adapters/index.d.mts +1 -6
  2. package/dist/api/dispatch.d.mts +0 -1
  3. package/dist/api/index.d.mts +476 -478
  4. package/dist/api/middlewares/authorization.d.mts +12 -8
  5. package/dist/api/middlewares/authorization.mjs +2 -1
  6. package/dist/api/middlewares/index.d.mts +2 -1
  7. package/dist/api/middlewares/origin-check.d.mts +3 -5
  8. package/dist/api/routes/account.d.mts +10 -13
  9. package/dist/api/routes/account.mjs +35 -7
  10. package/dist/api/routes/callback.d.mts +1 -3
  11. package/dist/api/routes/callback.mjs +4 -0
  12. package/dist/api/routes/email-verification.d.mts +4 -8
  13. package/dist/api/routes/email-verification.mjs +15 -2
  14. package/dist/api/routes/error.d.mts +1 -3
  15. package/dist/api/routes/index.d.mts +2 -1
  16. package/dist/api/routes/ok.d.mts +1 -3
  17. package/dist/api/routes/password.d.mts +7 -9
  18. package/dist/api/routes/password.mjs +14 -1
  19. package/dist/api/routes/session.d.mts +22 -24
  20. package/dist/api/routes/session.mjs +5 -1
  21. package/dist/api/routes/sign-in.d.mts +3 -5
  22. package/dist/api/routes/sign-in.mjs +84 -2
  23. package/dist/api/routes/sign-out.d.mts +1 -3
  24. package/dist/api/routes/sign-up.d.mts +3 -4
  25. package/dist/api/routes/sign-up.mjs +3 -2
  26. package/dist/api/routes/update-session.d.mts +3 -4
  27. package/dist/api/routes/update-user.d.mts +13 -14
  28. package/dist/api/routes/update-user.mjs +26 -1
  29. package/dist/auth/full.d.mts +1 -1
  30. package/dist/auth/minimal.d.mts +1 -1
  31. package/dist/client/config.d.mts +12 -14
  32. package/dist/client/config.mjs +2 -2
  33. package/dist/client/equality.d.mts +0 -1
  34. package/dist/client/index.d.mts +6 -5
  35. package/dist/client/lynx/index.d.mts +4 -5
  36. package/dist/client/lynx/lynx-store.d.mts +1 -2
  37. package/dist/client/parser.d.mts +7 -3
  38. package/dist/client/path-to-object.d.mts +3 -4
  39. package/dist/client/plugins/index.d.mts +1 -1
  40. package/dist/client/plugins/infer-plugin.d.mts +0 -1
  41. package/dist/client/query.d.mts +0 -1
  42. package/dist/client/query.mjs +38 -20
  43. package/dist/client/react/index.d.mts +4 -5
  44. package/dist/client/react/react-store.d.mts +1 -2
  45. package/dist/client/session-refresh.d.mts +0 -1
  46. package/dist/client/solid/index.d.mts +5 -6
  47. package/dist/client/svelte/index.d.mts +5 -6
  48. package/dist/client/types.d.mts +2 -2
  49. package/dist/client/vanilla.d.mts +2 -3
  50. package/dist/client/vue/index.d.mts +5 -6
  51. package/dist/context/create-context.mjs +3 -3
  52. package/dist/context/helpers.mjs +2 -2
  53. package/dist/cookies/cookie-utils.d.mts +1 -1
  54. package/dist/cookies/index.d.mts +6 -7
  55. package/dist/cookies/index.mjs +4 -0
  56. package/dist/cookies/session-store.d.mts +1 -0
  57. package/dist/cookies/session-store.mjs +6 -1
  58. package/dist/crypto/index.d.mts +2 -9
  59. package/dist/crypto/jwt.d.mts +0 -1
  60. package/dist/crypto/password.d.mts +1 -5
  61. package/dist/db/adapter-base.d.mts +0 -1
  62. package/dist/db/adapter-kysely.d.mts +0 -1
  63. package/dist/db/field-converter.d.mts +0 -1
  64. package/dist/db/field.d.mts +9 -10
  65. package/dist/db/get-migration.d.mts +0 -1
  66. package/dist/db/get-migration.mjs +8 -4
  67. package/dist/db/get-schema.d.mts +0 -1
  68. package/dist/db/internal-adapter.d.mts +0 -1
  69. package/dist/db/internal-adapter.mjs +61 -1
  70. package/dist/db/revoke-unproven-account-access.d.mts +0 -1
  71. package/dist/db/schema.d.mts +2 -2
  72. package/dist/db/to-zod.d.mts +3 -7
  73. package/dist/db/with-hooks.d.mts +0 -1
  74. package/dist/index.d.mts +4 -3
  75. package/dist/integrations/next-js.d.mts +4 -7
  76. package/dist/integrations/node.d.mts +2 -3
  77. package/dist/integrations/svelte-kit.d.mts +2 -9
  78. package/dist/integrations/tanstack-start-solid.d.mts +2 -5
  79. package/dist/integrations/tanstack-start.d.mts +2 -5
  80. package/dist/oauth2/link-account.d.mts +1 -1
  81. package/dist/oauth2/state.d.mts +0 -1
  82. package/dist/oauth2/utils.d.mts +0 -1
  83. package/dist/package.mjs +1 -1
  84. package/dist/plugins/access/access.d.mts +0 -1
  85. package/dist/plugins/access/types.d.mts +4 -5
  86. package/dist/plugins/additional-fields/client.d.mts +0 -1
  87. package/dist/plugins/admin/access/statement.d.mts +1 -0
  88. package/dist/plugins/admin/admin.d.mts +120 -125
  89. package/dist/plugins/admin/client.d.mts +30 -30
  90. package/dist/plugins/admin/client.mjs +1 -1
  91. package/dist/plugins/admin/error-codes.d.mts +23 -25
  92. package/dist/plugins/admin/index.d.mts +1 -1
  93. package/dist/plugins/admin/routes.mjs +9 -0
  94. package/dist/plugins/admin/schema.d.mts +1 -1
  95. package/dist/plugins/admin/types.d.mts +3 -2
  96. package/dist/plugins/anonymous/client.d.mts +9 -11
  97. package/dist/plugins/anonymous/client.mjs +1 -1
  98. package/dist/plugins/anonymous/error-codes.d.mts +8 -10
  99. package/dist/plugins/anonymous/index.d.mts +14 -18
  100. package/dist/plugins/anonymous/types.d.mts +1 -1
  101. package/dist/plugins/bearer/index.d.mts +4 -7
  102. package/dist/plugins/captcha/index.d.mts +5 -8
  103. package/dist/plugins/captcha/types.d.mts +0 -1
  104. package/dist/plugins/custom-session/client.d.mts +0 -1
  105. package/dist/plugins/custom-session/index.d.mts +7 -12
  106. package/dist/plugins/device-authorization/client.d.mts +0 -1
  107. package/dist/plugins/device-authorization/index.d.mts +19 -22
  108. package/dist/plugins/email-otp/client.d.mts +4 -6
  109. package/dist/plugins/email-otp/client.mjs +1 -1
  110. package/dist/plugins/email-otp/error-codes.d.mts +3 -5
  111. package/dist/plugins/email-otp/index.d.mts +67 -73
  112. package/dist/plugins/email-otp/routes.mjs +2 -0
  113. package/dist/plugins/email-otp/types.d.mts +0 -1
  114. package/dist/plugins/generic-oauth/client.d.mts +10 -11
  115. package/dist/plugins/generic-oauth/client.mjs +1 -1
  116. package/dist/plugins/generic-oauth/error-codes.d.mts +8 -10
  117. package/dist/plugins/generic-oauth/index.d.mts +40 -44
  118. package/dist/plugins/generic-oauth/providers/auth0.d.mts +0 -1
  119. package/dist/plugins/generic-oauth/providers/gumroad.d.mts +0 -1
  120. package/dist/plugins/generic-oauth/providers/hubspot.d.mts +0 -1
  121. package/dist/plugins/generic-oauth/providers/index.d.mts +2 -1
  122. package/dist/plugins/generic-oauth/providers/keycloak.d.mts +0 -1
  123. package/dist/plugins/generic-oauth/providers/line.d.mts +0 -1
  124. package/dist/plugins/generic-oauth/providers/microsoft-entra-id.d.mts +0 -1
  125. package/dist/plugins/generic-oauth/providers/okta.d.mts +0 -1
  126. package/dist/plugins/generic-oauth/providers/patreon.d.mts +0 -1
  127. package/dist/plugins/generic-oauth/providers/slack.d.mts +0 -1
  128. package/dist/plugins/generic-oauth/providers/yandex.d.mts +0 -1
  129. package/dist/plugins/generic-oauth/routes.mjs +14 -0
  130. package/dist/plugins/generic-oauth/types.d.mts +1 -2
  131. package/dist/plugins/haveibeenpwned/index.d.mts +3 -6
  132. package/dist/plugins/index.d.mts +4 -1
  133. package/dist/plugins/jwt/client.d.mts +2 -4
  134. package/dist/plugins/jwt/index.d.mts +8 -11
  135. package/dist/plugins/jwt/sign.d.mts +2 -2
  136. package/dist/plugins/jwt/types.d.mts +1 -1
  137. package/dist/plugins/jwt/utils.d.mts +2 -4
  138. package/dist/plugins/jwt/verify.d.mts +0 -1
  139. package/dist/plugins/last-login-method/client.mjs +13 -0
  140. package/dist/plugins/last-login-method/index.d.mts +11 -5
  141. package/dist/plugins/last-login-method/index.mjs +8 -0
  142. package/dist/plugins/magic-link/client.d.mts +0 -1
  143. package/dist/plugins/magic-link/index.d.mts +4 -5
  144. package/dist/plugins/magic-link/index.mjs +32 -1
  145. package/dist/plugins/mcp/authorize.mjs +12 -0
  146. package/dist/plugins/mcp/client/adapters.d.mts +0 -1
  147. package/dist/plugins/mcp/client/index.d.mts +2 -0
  148. package/dist/plugins/mcp/client/index.mjs +36 -11
  149. package/dist/plugins/mcp/index.d.mts +10 -11
  150. package/dist/plugins/multi-session/client.d.mts +2 -4
  151. package/dist/plugins/multi-session/client.mjs +1 -1
  152. package/dist/plugins/multi-session/error-codes.d.mts +1 -3
  153. package/dist/plugins/multi-session/index.d.mts +7 -11
  154. package/dist/plugins/multi-session/index.mjs +45 -0
  155. package/dist/plugins/oauth-popup/client.d.mts +6 -12
  156. package/dist/plugins/oauth-popup/client.mjs +5 -3
  157. package/dist/plugins/oauth-popup/error-codes.d.mts +4 -6
  158. package/dist/plugins/oauth-popup/index.d.mts +8 -12
  159. package/dist/plugins/oauth-popup/index.mjs +1 -1
  160. package/dist/plugins/oauth-popup/types.d.mts +1 -2
  161. package/dist/plugins/oauth-proxy/index.d.mts +6 -9
  162. package/dist/plugins/oauth-proxy/index.mjs +2 -2
  163. package/dist/plugins/oidc-provider/authorize.mjs +9 -0
  164. package/dist/plugins/oidc-provider/client.d.mts +1 -2
  165. package/dist/plugins/oidc-provider/index.d.mts +15 -17
  166. package/dist/plugins/oidc-provider/index.mjs +26 -2
  167. package/dist/plugins/oidc-provider/schema.d.mts +0 -1
  168. package/dist/plugins/oidc-provider/schema.mjs +37 -0
  169. package/dist/plugins/oidc-provider/types.d.mts +1 -1
  170. package/dist/plugins/one-tap/client.d.mts +3 -6
  171. package/dist/plugins/one-tap/client.mjs +3 -0
  172. package/dist/plugins/one-tap/index.d.mts +1 -3
  173. package/dist/plugins/one-tap/index.mjs +5 -0
  174. package/dist/plugins/one-time-token/client.d.mts +1 -2
  175. package/dist/plugins/one-time-token/index.d.mts +5 -6
  176. package/dist/plugins/one-time-token/index.mjs +30 -0
  177. package/dist/plugins/open-api/generator.d.mts +0 -1
  178. package/dist/plugins/open-api/generator.mjs +81 -5
  179. package/dist/plugins/open-api/index.d.mts +3 -5
  180. package/dist/plugins/organization/access/statement.d.mts +1 -0
  181. package/dist/plugins/organization/adapter.d.mts +56 -82
  182. package/dist/plugins/organization/adapter.mjs +17 -3
  183. package/dist/plugins/organization/client.d.mts +106 -105
  184. package/dist/plugins/organization/client.mjs +7 -4
  185. package/dist/plugins/organization/error-codes.d.mts +59 -61
  186. package/dist/plugins/organization/has-permission.d.mts +0 -1
  187. package/dist/plugins/organization/has-permission.mjs +1 -1
  188. package/dist/plugins/organization/index.d.mts +1 -1
  189. package/dist/plugins/organization/organization.d.mts +7 -7
  190. package/dist/plugins/organization/organization.mjs +434 -1
  191. package/dist/plugins/organization/permission.d.mts +2 -2
  192. package/dist/plugins/organization/routes/crud-access-control.d.mts +17 -17
  193. package/dist/plugins/organization/routes/crud-invites.d.mts +53 -54
  194. package/dist/plugins/organization/routes/crud-invites.mjs +1 -1
  195. package/dist/plugins/organization/routes/crud-members.d.mts +44 -46
  196. package/dist/plugins/organization/routes/crud-members.mjs +4 -1
  197. package/dist/plugins/organization/routes/crud-org.d.mts +47 -48
  198. package/dist/plugins/organization/routes/crud-org.mjs +2 -2
  199. package/dist/plugins/organization/routes/crud-team.d.mts +50 -51
  200. package/dist/plugins/organization/schema.d.mts +4 -4
  201. package/dist/plugins/organization/schema.mjs +1 -1
  202. package/dist/plugins/organization/types.d.mts +16 -16
  203. package/dist/plugins/phone-number/client.d.mts +13 -15
  204. package/dist/plugins/phone-number/client.mjs +1 -1
  205. package/dist/plugins/phone-number/error-codes.d.mts +12 -14
  206. package/dist/plugins/phone-number/index.d.mts +41 -47
  207. package/dist/plugins/phone-number/routes.mjs +15 -0
  208. package/dist/plugins/phone-number/types.d.mts +1 -1
  209. package/dist/plugins/siwe/client.d.mts +0 -1
  210. package/dist/plugins/siwe/index.d.mts +4 -5
  211. package/dist/plugins/test-utils/index.d.mts +2 -4
  212. package/dist/plugins/test-utils/types.d.mts +1 -0
  213. package/dist/plugins/two-factor/backup-codes/index.d.mts +4 -6
  214. package/dist/plugins/two-factor/backup-codes/index.mjs +52 -1
  215. package/dist/plugins/two-factor/client.d.mts +12 -15
  216. package/dist/plugins/two-factor/client.mjs +1 -1
  217. package/dist/plugins/two-factor/error-code.d.mts +10 -12
  218. package/dist/plugins/two-factor/index.d.mts +27 -31
  219. package/dist/plugins/two-factor/index.mjs +30 -0
  220. package/dist/plugins/two-factor/otp/index.d.mts +2 -4
  221. package/dist/plugins/two-factor/otp/index.mjs +42 -1
  222. package/dist/plugins/two-factor/totp/index.d.mts +4 -6
  223. package/dist/plugins/two-factor/totp/index.mjs +47 -0
  224. package/dist/plugins/two-factor/types.d.mts +1 -1
  225. package/dist/plugins/username/client.d.mts +9 -11
  226. package/dist/plugins/username/client.mjs +1 -1
  227. package/dist/plugins/username/error-codes.d.mts +8 -10
  228. package/dist/plugins/username/index.d.mts +17 -22
  229. package/dist/plugins/username/schema.d.mts +3 -5
  230. package/dist/state.d.mts +0 -1
  231. package/dist/state.mjs +4 -0
  232. package/dist/test-utils/test-instance.d.mts +5 -3
  233. package/dist/test-utils/test-instance.mjs +4 -1
  234. package/dist/types/adapter.d.mts +1 -1
  235. package/dist/types/api.d.mts +1 -2
  236. package/dist/types/auth.d.mts +0 -1
  237. package/dist/types/helper.d.mts +5 -5
  238. package/dist/types/index.d.mts +2 -2
  239. package/dist/types/models.d.mts +0 -1
  240. package/dist/types/plugins.d.mts +2 -3
  241. package/dist/utils/index.d.mts +2 -1
  242. package/dist/utils/request.mjs +23 -0
  243. package/dist/utils/url.d.mts +0 -1
  244. package/package.json +10 -10
@@ -1,19 +1,20 @@
1
1
  import { FieldAttributeToObject, RemoveFieldsWithReturnedFalse } from "../../db/field.mjs";
2
2
  import { Prettify } from "../../types/helper.mjs";
3
- import { BetterAuthOptions as BetterAuthOptions$1 } from "../../types/index.mjs";
3
+ import { BetterAuthOptions } from "../../types/index.mjs";
4
4
  import { AuthQueryAtom } from "../../client/query.mjs";
5
5
  import { AccessControl, ArrayElement, Role, Statements } from "../access/types.mjs";
6
+ import "../access/index.mjs";
7
+ import "../../db/index.mjs";
6
8
  import { OrganizationOptions } from "./types.mjs";
7
9
  import { InferInvitation, InferMember, InferOrganization, InferOrganizationRolesFromOption, InferOrganizationZodRolesFromOption, InferTeam, Invitation, InvitationInput, InvitationStatus, Member, MemberInput, Organization, OrganizationInput, OrganizationRole, OrganizationSchema, Team, TeamInput, TeamMember, TeamMemberInput, defaultRolesSchema, invitationSchema, invitationStatus, memberSchema, organizationRoleSchema, organizationSchema, roleSchema, teamMemberSchema, teamSchema } from "./schema.mjs";
10
+ import "../index.mjs";
8
11
  import { ORGANIZATION_ERROR_CODES } from "./error-codes.mjs";
9
12
  import { HasPermissionBaseInput } from "./permission.mjs";
10
13
  import { OrganizationPlugin } from "./organization.mjs";
11
- import * as _better_auth_core0 from "@better-auth/core";
14
+ import "./index.mjs";
15
+ import "../../client/index.mjs";
12
16
  import { DBFieldAttribute } from "@better-auth/core/db";
13
- import * as _better_auth_core_utils_error_codes0 from "@better-auth/core/utils/error-codes";
14
- import * as nanostores from "nanostores";
15
- import * as _better_fetch_fetch0 from "@better-fetch/fetch";
16
-
17
+ import { BetterFetch } from "@better-fetch/fetch";
17
18
  //#region src/plugins/organization/client.d.ts
18
19
  /**
19
20
  * Using the same `hasPermissionFn` function, but without the need for a `ctx` parameter or the `organizationId` parameter.
@@ -21,7 +22,7 @@ import * as _better_fetch_fetch0 from "@better-fetch/fetch";
21
22
  declare const clientSideHasPermission: (input: HasPermissionBaseInput) => boolean;
22
23
  interface OrganizationClientOptions {
23
24
  ac?: AccessControl | undefined;
24
- roles?: { [key in string]: Role } | undefined;
25
+ roles?: { [key in string]: Role; } | undefined;
25
26
  teams?: {
26
27
  enabled: boolean;
27
28
  } | undefined;
@@ -84,7 +85,7 @@ declare const organizationClient: <CO extends OrganizationClientOptions>(options
84
85
  } ? true : false;
85
86
  };
86
87
  }>;
87
- getActions: ($fetch: _better_fetch_fetch0.BetterFetch, _$store: _better_auth_core0.ClientStore, co: _better_auth_core0.BetterAuthClientOptions | undefined) => {
88
+ getActions: ($fetch: BetterFetch, _$store: import("@better-auth/core").ClientStore, co: import("@better-auth/core").BetterAuthClientOptions | undefined) => {
88
89
  $Infer: {
89
90
  ActiveOrganization: CO["teams"] extends {
90
91
  enabled: true;
@@ -103,7 +104,7 @@ declare const organizationClient: <CO extends OrganizationClientOptions>(options
103
104
  organization?: {
104
105
  additionalFields: infer Field extends Record<string, DBFieldAttribute>;
105
106
  } | undefined;
106
- } ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends infer T ? { [K in keyof T]: T[K] } : never) : {
107
+ } ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends (infer T) ? { [K in keyof T]: T[K]; } : never) : {
107
108
  members: InferMember<CO>[];
108
109
  invitations: InferInvitation<CO>[];
109
110
  } & ({
@@ -117,16 +118,16 @@ declare const organizationClient: <CO extends OrganizationClientOptions>(options
117
118
  organization?: {
118
119
  additionalFields: infer Field extends Record<string, DBFieldAttribute>;
119
120
  } | undefined;
120
- } ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends infer T_1 ? { [K in keyof T_1]: T_1[K] } : never);
121
+ } ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends (infer T_1) ? { [K in keyof T_1]: T_1[K]; } : never);
121
122
  Organization: InferOrganization<CO>;
122
123
  Invitation: InferInvitation<CO>;
123
124
  Member: InferMember<CO>;
124
125
  Team: InferTeam<CO>;
125
126
  };
126
127
  organization: {
127
- checkRolePermission: <R extends (CO extends {
128
+ checkRolePermission: <R extends CO extends {
128
129
  roles: any;
129
- } ? keyof CO["roles"] : "admin" | "member" | "owner")>(data: {
130
+ } ? keyof CO["roles"] : "admin" | "member" | "owner">(data: {
130
131
  permissions: { [key in keyof (CO["ac"] extends AccessControl<infer S extends Statements> ? S : {
131
132
  readonly organization: readonly ["update", "delete"];
132
133
  readonly member: readonly ["create", "update", "delete"];
@@ -145,17 +146,17 @@ declare const organizationClient: <CO extends OrganizationClientOptions>(options
145
146
  readonly invitation: readonly ["create", "cancel"];
146
147
  readonly team: readonly ["create", "update", "delete"];
147
148
  readonly ac: readonly ["create", "read", "update", "delete"];
148
- })[key]> : never)[] | undefined };
149
+ })[key]> : never)[] | undefined; };
149
150
  } & {
150
151
  role: R;
151
152
  }) => boolean;
152
153
  };
153
154
  };
154
- getAtoms: ($fetch: _better_fetch_fetch0.BetterFetch) => {
155
- $listOrg: nanostores.PreinitializedWritableAtom<boolean> & object;
156
- $activeOrgSignal: nanostores.PreinitializedWritableAtom<boolean> & object;
157
- $activeMemberSignal: nanostores.PreinitializedWritableAtom<boolean> & object;
158
- $activeMemberRoleSignal: nanostores.PreinitializedWritableAtom<boolean> & object;
155
+ getAtoms: ($fetch: BetterFetch) => {
156
+ $listOrg: import("nanostores").PreinitializedWritableAtom<boolean> & object;
157
+ $activeOrgSignal: import("nanostores").PreinitializedWritableAtom<boolean> & object;
158
+ $activeMemberSignal: import("nanostores").PreinitializedWritableAtom<boolean> & object;
159
+ $activeMemberRoleSignal: import("nanostores").PreinitializedWritableAtom<boolean> & object;
159
160
  activeOrganization: AuthQueryAtom<Prettify<({
160
161
  id: string;
161
162
  name: string;
@@ -167,7 +168,7 @@ declare const organizationClient: <CO extends OrganizationClientOptions>(options
167
168
  organization?: {
168
169
  additionalFields: infer Field extends Record<string, DBFieldAttribute>;
169
170
  } | undefined;
170
- } ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends infer T ? { [K in keyof T]: T[K] } : never) & {
171
+ } ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends (infer T) ? { [K in keyof T]: T[K]; } : never) & {
171
172
  members: InferMember<CO>[];
172
173
  invitations: InferInvitation<CO>[];
173
174
  }>>;
@@ -182,7 +183,7 @@ declare const organizationClient: <CO extends OrganizationClientOptions>(options
182
183
  organization?: {
183
184
  additionalFields: infer Field extends Record<string, DBFieldAttribute>;
184
185
  } | undefined;
185
- } ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends infer T_1 ? { [K in keyof T_1]: T_1[K] } : never)[]>;
186
+ } ? FieldAttributeToObject<RemoveFieldsWithReturnedFalse<Field>> : {}) extends (infer T_1) ? { [K in keyof T_1]: T_1[K]; } : never)[]>;
186
187
  activeMember: AuthQueryAtom<{
187
188
  id: string;
188
189
  organizationId: string;
@@ -215,69 +216,69 @@ declare const organizationClient: <CO extends OrganizationClientOptions>(options
215
216
  signal: "$activeMemberRoleSignal";
216
217
  })[];
217
218
  $ERROR_CODES: {
218
- YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION">;
219
- YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS: _better_auth_core_utils_error_codes0.RawError<"YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS">;
220
- ORGANIZATION_ALREADY_EXISTS: _better_auth_core_utils_error_codes0.RawError<"ORGANIZATION_ALREADY_EXISTS">;
221
- ORGANIZATION_SLUG_ALREADY_TAKEN: _better_auth_core_utils_error_codes0.RawError<"ORGANIZATION_SLUG_ALREADY_TAKEN">;
222
- ORGANIZATION_NOT_FOUND: _better_auth_core_utils_error_codes0.RawError<"ORGANIZATION_NOT_FOUND">;
223
- USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION: _better_auth_core_utils_error_codes0.RawError<"USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION">;
224
- YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION">;
225
- YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION">;
226
- NO_ACTIVE_ORGANIZATION: _better_auth_core_utils_error_codes0.RawError<"NO_ACTIVE_ORGANIZATION">;
227
- USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION: _better_auth_core_utils_error_codes0.RawError<"USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION">;
228
- MEMBER_NOT_FOUND: _better_auth_core_utils_error_codes0.RawError<"MEMBER_NOT_FOUND">;
229
- ROLE_NOT_FOUND: _better_auth_core_utils_error_codes0.RawError<"ROLE_NOT_FOUND">;
230
- YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM">;
231
- TEAM_ALREADY_EXISTS: _better_auth_core_utils_error_codes0.RawError<"TEAM_ALREADY_EXISTS">;
232
- TEAM_NOT_FOUND: _better_auth_core_utils_error_codes0.RawError<"TEAM_NOT_FOUND">;
233
- YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER: _better_auth_core_utils_error_codes0.RawError<"YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER">;
234
- YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER: _better_auth_core_utils_error_codes0.RawError<"YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER">;
235
- YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER">;
236
- YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION">;
237
- USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION: _better_auth_core_utils_error_codes0.RawError<"USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION">;
238
- INVITATION_NOT_FOUND: _better_auth_core_utils_error_codes0.RawError<"INVITATION_NOT_FOUND">;
239
- YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION">;
240
- EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION: _better_auth_core_utils_error_codes0.RawError<"EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION">;
241
- EMAIL_VERIFICATION_REQUIRED_FOR_INVITATION: _better_auth_core_utils_error_codes0.RawError<"EMAIL_VERIFICATION_REQUIRED_FOR_INVITATION">;
242
- YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION">;
243
- INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION: _better_auth_core_utils_error_codes0.RawError<"INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION">;
244
- YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE">;
245
- FAILED_TO_RETRIEVE_INVITATION: _better_auth_core_utils_error_codes0.RawError<"FAILED_TO_RETRIEVE_INVITATION">;
246
- YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS: _better_auth_core_utils_error_codes0.RawError<"YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS">;
247
- UNABLE_TO_REMOVE_LAST_TEAM: _better_auth_core_utils_error_codes0.RawError<"UNABLE_TO_REMOVE_LAST_TEAM">;
248
- YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER">;
249
- ORGANIZATION_MEMBERSHIP_LIMIT_REACHED: _better_auth_core_utils_error_codes0.RawError<"ORGANIZATION_MEMBERSHIP_LIMIT_REACHED">;
250
- YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION">;
251
- YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION">;
252
- YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM">;
253
- YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM">;
254
- INVITATION_LIMIT_REACHED: _better_auth_core_utils_error_codes0.RawError<"INVITATION_LIMIT_REACHED">;
255
- TEAM_MEMBER_LIMIT_REACHED: _better_auth_core_utils_error_codes0.RawError<"TEAM_MEMBER_LIMIT_REACHED">;
256
- USER_IS_NOT_A_MEMBER_OF_THE_TEAM: _better_auth_core_utils_error_codes0.RawError<"USER_IS_NOT_A_MEMBER_OF_THE_TEAM">;
257
- YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM: _better_auth_core_utils_error_codes0.RawError<"YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM">;
258
- YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM: _better_auth_core_utils_error_codes0.RawError<"YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM">;
259
- YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER">;
260
- YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER">;
261
- YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION">;
262
- YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION">;
263
- MISSING_AC_INSTANCE: _better_auth_core_utils_error_codes0.RawError<"MISSING_AC_INSTANCE">;
264
- YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE: _better_auth_core_utils_error_codes0.RawError<"YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE">;
265
- YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE">;
266
- YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE">;
267
- YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE">;
268
- YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE">;
269
- YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE">;
270
- YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE">;
271
- TOO_MANY_ROLES: _better_auth_core_utils_error_codes0.RawError<"TOO_MANY_ROLES">;
272
- INVALID_RESOURCE: _better_auth_core_utils_error_codes0.RawError<"INVALID_RESOURCE">;
273
- ROLE_NAME_IS_ALREADY_TAKEN: _better_auth_core_utils_error_codes0.RawError<"ROLE_NAME_IS_ALREADY_TAKEN">;
274
- CANNOT_DELETE_A_PRE_DEFINED_ROLE: _better_auth_core_utils_error_codes0.RawError<"CANNOT_DELETE_A_PRE_DEFINED_ROLE">;
275
- ROLE_IS_ASSIGNED_TO_MEMBERS: _better_auth_core_utils_error_codes0.RawError<"ROLE_IS_ASSIGNED_TO_MEMBERS">;
276
- INVALID_TEAM_ID: _better_auth_core_utils_error_codes0.RawError<"INVALID_TEAM_ID">;
219
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION">;
220
+ YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS: import("@better-auth/core/utils/error-codes").RawError<"YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS">;
221
+ ORGANIZATION_ALREADY_EXISTS: import("@better-auth/core/utils/error-codes").RawError<"ORGANIZATION_ALREADY_EXISTS">;
222
+ ORGANIZATION_SLUG_ALREADY_TAKEN: import("@better-auth/core/utils/error-codes").RawError<"ORGANIZATION_SLUG_ALREADY_TAKEN">;
223
+ ORGANIZATION_NOT_FOUND: import("@better-auth/core/utils/error-codes").RawError<"ORGANIZATION_NOT_FOUND">;
224
+ USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION: import("@better-auth/core/utils/error-codes").RawError<"USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION">;
225
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION">;
226
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION">;
227
+ NO_ACTIVE_ORGANIZATION: import("@better-auth/core/utils/error-codes").RawError<"NO_ACTIVE_ORGANIZATION">;
228
+ USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION: import("@better-auth/core/utils/error-codes").RawError<"USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION">;
229
+ MEMBER_NOT_FOUND: import("@better-auth/core/utils/error-codes").RawError<"MEMBER_NOT_FOUND">;
230
+ ROLE_NOT_FOUND: import("@better-auth/core/utils/error-codes").RawError<"ROLE_NOT_FOUND">;
231
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM">;
232
+ TEAM_ALREADY_EXISTS: import("@better-auth/core/utils/error-codes").RawError<"TEAM_ALREADY_EXISTS">;
233
+ TEAM_NOT_FOUND: import("@better-auth/core/utils/error-codes").RawError<"TEAM_NOT_FOUND">;
234
+ YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER: import("@better-auth/core/utils/error-codes").RawError<"YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER">;
235
+ YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER: import("@better-auth/core/utils/error-codes").RawError<"YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER">;
236
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER">;
237
+ YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION">;
238
+ USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION: import("@better-auth/core/utils/error-codes").RawError<"USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION">;
239
+ INVITATION_NOT_FOUND: import("@better-auth/core/utils/error-codes").RawError<"INVITATION_NOT_FOUND">;
240
+ YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION">;
241
+ EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION: import("@better-auth/core/utils/error-codes").RawError<"EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION">;
242
+ EMAIL_VERIFICATION_REQUIRED_FOR_INVITATION: import("@better-auth/core/utils/error-codes").RawError<"EMAIL_VERIFICATION_REQUIRED_FOR_INVITATION">;
243
+ YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION">;
244
+ INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION: import("@better-auth/core/utils/error-codes").RawError<"INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION">;
245
+ YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE">;
246
+ FAILED_TO_RETRIEVE_INVITATION: import("@better-auth/core/utils/error-codes").RawError<"FAILED_TO_RETRIEVE_INVITATION">;
247
+ YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS: import("@better-auth/core/utils/error-codes").RawError<"YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS">;
248
+ UNABLE_TO_REMOVE_LAST_TEAM: import("@better-auth/core/utils/error-codes").RawError<"UNABLE_TO_REMOVE_LAST_TEAM">;
249
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER">;
250
+ ORGANIZATION_MEMBERSHIP_LIMIT_REACHED: import("@better-auth/core/utils/error-codes").RawError<"ORGANIZATION_MEMBERSHIP_LIMIT_REACHED">;
251
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION">;
252
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION">;
253
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM">;
254
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM">;
255
+ INVITATION_LIMIT_REACHED: import("@better-auth/core/utils/error-codes").RawError<"INVITATION_LIMIT_REACHED">;
256
+ TEAM_MEMBER_LIMIT_REACHED: import("@better-auth/core/utils/error-codes").RawError<"TEAM_MEMBER_LIMIT_REACHED">;
257
+ USER_IS_NOT_A_MEMBER_OF_THE_TEAM: import("@better-auth/core/utils/error-codes").RawError<"USER_IS_NOT_A_MEMBER_OF_THE_TEAM">;
258
+ YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM: import("@better-auth/core/utils/error-codes").RawError<"YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM">;
259
+ YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM: import("@better-auth/core/utils/error-codes").RawError<"YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM">;
260
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER">;
261
+ YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER">;
262
+ YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION">;
263
+ YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION">;
264
+ MISSING_AC_INSTANCE: import("@better-auth/core/utils/error-codes").RawError<"MISSING_AC_INSTANCE">;
265
+ YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE: import("@better-auth/core/utils/error-codes").RawError<"YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE">;
266
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE">;
267
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE">;
268
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE">;
269
+ YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE">;
270
+ YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE">;
271
+ YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE">;
272
+ TOO_MANY_ROLES: import("@better-auth/core/utils/error-codes").RawError<"TOO_MANY_ROLES">;
273
+ INVALID_RESOURCE: import("@better-auth/core/utils/error-codes").RawError<"INVALID_RESOURCE">;
274
+ ROLE_NAME_IS_ALREADY_TAKEN: import("@better-auth/core/utils/error-codes").RawError<"ROLE_NAME_IS_ALREADY_TAKEN">;
275
+ CANNOT_DELETE_A_PRE_DEFINED_ROLE: import("@better-auth/core/utils/error-codes").RawError<"CANNOT_DELETE_A_PRE_DEFINED_ROLE">;
276
+ ROLE_IS_ASSIGNED_TO_MEMBERS: import("@better-auth/core/utils/error-codes").RawError<"ROLE_IS_ASSIGNED_TO_MEMBERS">;
277
+ INVALID_TEAM_ID: import("@better-auth/core/utils/error-codes").RawError<"INVALID_TEAM_ID">;
277
278
  };
278
279
  };
279
280
  declare const inferOrgAdditionalFields: <O extends {
280
- options: BetterAuthOptions$1;
281
+ options: BetterAuthOptions;
281
282
  }, S extends OrganizationOptions["schema"] = undefined>(schema?: S | undefined) => undefined extends S ? O extends Object ? O extends {
282
283
  session?: {
283
284
  fields?: {
@@ -287,32 +288,32 @@ declare const inferOrgAdditionalFields: <O extends {
287
288
  };
288
289
  organization?: {
289
290
  modelName?: string;
290
- fields?: { [key in keyof Omit<Organization, "id">]?: string };
291
- additionalFields?: { [key in string]: DBFieldAttribute };
291
+ fields?: { [key in keyof Omit<Organization, "id">]?: string; };
292
+ additionalFields?: { [key in string]: DBFieldAttribute; };
292
293
  };
293
294
  member?: {
294
295
  modelName?: string;
295
- fields?: { [key in keyof Omit<Member, "id">]?: string };
296
- additionalFields?: { [key in string]: DBFieldAttribute };
296
+ fields?: { [key in keyof Omit<Member, "id">]?: string; };
297
+ additionalFields?: { [key in string]: DBFieldAttribute; };
297
298
  };
298
299
  invitation?: {
299
300
  modelName?: string;
300
- fields?: { [key in keyof Omit<Invitation, "id">]?: string };
301
- additionalFields?: { [key in string]: DBFieldAttribute };
301
+ fields?: { [key in keyof Omit<Invitation, "id">]?: string; };
302
+ additionalFields?: { [key in string]: DBFieldAttribute; };
302
303
  };
303
304
  team?: {
304
305
  modelName?: string;
305
- fields?: { [key in keyof Omit<Team, "id">]?: string };
306
- additionalFields?: { [key in string]: DBFieldAttribute };
306
+ fields?: { [key in keyof Omit<Team, "id">]?: string; };
307
+ additionalFields?: { [key in string]: DBFieldAttribute; };
307
308
  };
308
309
  teamMember?: {
309
310
  modelName?: string;
310
- fields?: { [key in keyof Omit<TeamMember, "id">]?: string };
311
+ fields?: { [key in keyof Omit<TeamMember, "id">]?: string; };
311
312
  };
312
313
  organizationRole?: {
313
314
  modelName?: string;
314
- fields?: { [key in keyof Omit<OrganizationRole, "id">]?: string };
315
- additionalFields?: { [key in string]: DBFieldAttribute };
315
+ fields?: { [key in keyof Omit<OrganizationRole, "id">]?: string; };
316
+ additionalFields?: { [key in string]: DBFieldAttribute; };
316
317
  };
317
318
  } ? O : ((O extends {
318
319
  options: any;
@@ -320,7 +321,7 @@ declare const inferOrgAdditionalFields: <O extends {
320
321
  options: {
321
322
  plugins: [];
322
323
  };
323
- })["options"]["plugins"][number] extends infer T ? T extends (O extends {
324
+ })["options"]["plugins"][number] extends (infer T) ? T extends (O extends {
324
325
  options: any;
325
326
  } ? O : {
326
327
  options: {
@@ -341,35 +342,35 @@ declare const inferOrgAdditionalFields: <O extends {
341
342
  };
342
343
  organization?: {
343
344
  modelName?: string;
344
- fields?: { [key in keyof Omit<Organization, "id">]?: string };
345
- additionalFields?: { [key in string]: DBFieldAttribute };
345
+ fields?: { [key in keyof Omit<Organization, "id">]?: string; };
346
+ additionalFields?: { [key in string]: DBFieldAttribute; };
346
347
  };
347
348
  member?: {
348
349
  modelName?: string;
349
- fields?: { [key in keyof Omit<Member, "id">]?: string };
350
- additionalFields?: { [key in string]: DBFieldAttribute };
350
+ fields?: { [key in keyof Omit<Member, "id">]?: string; };
351
+ additionalFields?: { [key in string]: DBFieldAttribute; };
351
352
  };
352
353
  invitation?: {
353
354
  modelName?: string;
354
- fields?: { [key in keyof Omit<Invitation, "id">]?: string };
355
- additionalFields?: { [key in string]: DBFieldAttribute };
355
+ fields?: { [key in keyof Omit<Invitation, "id">]?: string; };
356
+ additionalFields?: { [key in string]: DBFieldAttribute; };
356
357
  };
357
358
  team?: {
358
359
  modelName?: string;
359
- fields?: { [key in keyof Omit<Team, "id">]?: string };
360
- additionalFields?: { [key in string]: DBFieldAttribute };
360
+ fields?: { [key in keyof Omit<Team, "id">]?: string; };
361
+ additionalFields?: { [key in string]: DBFieldAttribute; };
361
362
  };
362
363
  teamMember?: {
363
364
  modelName?: string;
364
- fields?: { [key in keyof Omit<TeamMember, "id">]?: string };
365
+ fields?: { [key in keyof Omit<TeamMember, "id">]?: string; };
365
366
  };
366
367
  organizationRole?: {
367
368
  modelName?: string;
368
- fields?: { [key in keyof Omit<OrganizationRole, "id">]?: string };
369
- additionalFields?: { [key in string]: DBFieldAttribute };
369
+ fields?: { [key in keyof Omit<OrganizationRole, "id">]?: string; };
370
+ additionalFields?: { [key in string]: DBFieldAttribute; };
370
371
  };
371
372
  } | undefined ? { [K in keyof S_1 as S_1[K] extends {
372
373
  additionalFields: unknown;
373
- } ? K : never]: S_1[K] } : undefined : undefined : undefined : S;
374
+ } ? K : never]: S_1[K]; } : undefined : undefined : undefined : S;
374
375
  //#endregion
375
- export { OrganizationClientOptions, clientSideHasPermission, inferOrgAdditionalFields, organizationClient };
376
+ export { type InferInvitation, type InferMember, type InferOrganization, type InferOrganizationRolesFromOption, type InferOrganizationZodRolesFromOption, type InferTeam, type Invitation, type InvitationInput, type InvitationStatus, type Member, type MemberInput, ORGANIZATION_ERROR_CODES, type Organization, OrganizationClientOptions, type OrganizationInput, type OrganizationRole, type OrganizationSchema, type Team, type TeamInput, type TeamMember, type TeamMemberInput, clientSideHasPermission, type defaultRolesSchema, inferOrgAdditionalFields, type invitationSchema, type invitationStatus, type memberSchema, organizationClient, type organizationRoleSchema, type organizationSchema, type roleSchema, type teamMemberSchema, type teamSchema };
@@ -47,15 +47,18 @@ const organizationClient = (options) => {
47
47
  }),
48
48
  getAtoms: ($fetch) => {
49
49
  const listOrganizations = useAuthQuery($listOrg, "/organization/list", $fetch, { method: "GET" });
50
+ const activeOrganization = useAuthQuery([$activeOrgSignal], "/organization/get-full-organization", $fetch, () => ({ method: "GET" }));
51
+ const activeMember = useAuthQuery([$activeOrgSignal, $activeMemberSignal], "/organization/get-active-member", $fetch, { method: "GET" });
52
+ const activeMemberRole = useAuthQuery([$activeOrgSignal, $activeMemberRoleSignal], "/organization/get-active-member-role", $fetch, { method: "GET" });
50
53
  return {
51
54
  $listOrg,
52
55
  $activeOrgSignal,
53
56
  $activeMemberSignal,
54
57
  $activeMemberRoleSignal,
55
- activeOrganization: useAuthQuery([$activeOrgSignal], "/organization/get-full-organization", $fetch, () => ({ method: "GET" })),
58
+ activeOrganization,
56
59
  listOrganizations,
57
- activeMember: useAuthQuery([$activeOrgSignal, $activeMemberSignal], "/organization/get-active-member", $fetch, { method: "GET" }),
58
- activeMemberRole: useAuthQuery([$activeOrgSignal, $activeMemberRoleSignal], "/organization/get-active-member-role", $fetch, { method: "GET" })
60
+ activeMember,
61
+ activeMemberRole
59
62
  };
60
63
  },
61
64
  pathMethods: {
@@ -101,4 +104,4 @@ const inferOrgAdditionalFields = (schema) => {
101
104
  return {};
102
105
  };
103
106
  //#endregion
104
- export { clientSideHasPermission, inferOrgAdditionalFields, organizationClient };
107
+ export { ORGANIZATION_ERROR_CODES, clientSideHasPermission, inferOrgAdditionalFields, organizationClient };
@@ -1,66 +1,64 @@
1
- import * as _better_auth_core_utils_error_codes0 from "@better-auth/core/utils/error-codes";
2
-
3
1
  //#region src/plugins/organization/error-codes.d.ts
4
2
  declare const ORGANIZATION_ERROR_CODES: {
5
- YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION">;
6
- YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS: _better_auth_core_utils_error_codes0.RawError<"YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS">;
7
- ORGANIZATION_ALREADY_EXISTS: _better_auth_core_utils_error_codes0.RawError<"ORGANIZATION_ALREADY_EXISTS">;
8
- ORGANIZATION_SLUG_ALREADY_TAKEN: _better_auth_core_utils_error_codes0.RawError<"ORGANIZATION_SLUG_ALREADY_TAKEN">;
9
- ORGANIZATION_NOT_FOUND: _better_auth_core_utils_error_codes0.RawError<"ORGANIZATION_NOT_FOUND">;
10
- USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION: _better_auth_core_utils_error_codes0.RawError<"USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION">;
11
- YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION">;
12
- YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION">;
13
- NO_ACTIVE_ORGANIZATION: _better_auth_core_utils_error_codes0.RawError<"NO_ACTIVE_ORGANIZATION">;
14
- USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION: _better_auth_core_utils_error_codes0.RawError<"USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION">;
15
- MEMBER_NOT_FOUND: _better_auth_core_utils_error_codes0.RawError<"MEMBER_NOT_FOUND">;
16
- ROLE_NOT_FOUND: _better_auth_core_utils_error_codes0.RawError<"ROLE_NOT_FOUND">;
17
- YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM">;
18
- TEAM_ALREADY_EXISTS: _better_auth_core_utils_error_codes0.RawError<"TEAM_ALREADY_EXISTS">;
19
- TEAM_NOT_FOUND: _better_auth_core_utils_error_codes0.RawError<"TEAM_NOT_FOUND">;
20
- YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER: _better_auth_core_utils_error_codes0.RawError<"YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER">;
21
- YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER: _better_auth_core_utils_error_codes0.RawError<"YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER">;
22
- YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER">;
23
- YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION">;
24
- USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION: _better_auth_core_utils_error_codes0.RawError<"USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION">;
25
- INVITATION_NOT_FOUND: _better_auth_core_utils_error_codes0.RawError<"INVITATION_NOT_FOUND">;
26
- YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION">;
27
- EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION: _better_auth_core_utils_error_codes0.RawError<"EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION">;
28
- EMAIL_VERIFICATION_REQUIRED_FOR_INVITATION: _better_auth_core_utils_error_codes0.RawError<"EMAIL_VERIFICATION_REQUIRED_FOR_INVITATION">;
29
- YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION">;
30
- INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION: _better_auth_core_utils_error_codes0.RawError<"INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION">;
31
- YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE">;
32
- FAILED_TO_RETRIEVE_INVITATION: _better_auth_core_utils_error_codes0.RawError<"FAILED_TO_RETRIEVE_INVITATION">;
33
- YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS: _better_auth_core_utils_error_codes0.RawError<"YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS">;
34
- UNABLE_TO_REMOVE_LAST_TEAM: _better_auth_core_utils_error_codes0.RawError<"UNABLE_TO_REMOVE_LAST_TEAM">;
35
- YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER">;
36
- ORGANIZATION_MEMBERSHIP_LIMIT_REACHED: _better_auth_core_utils_error_codes0.RawError<"ORGANIZATION_MEMBERSHIP_LIMIT_REACHED">;
37
- YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION">;
38
- YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION">;
39
- YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM">;
40
- YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM">;
41
- INVITATION_LIMIT_REACHED: _better_auth_core_utils_error_codes0.RawError<"INVITATION_LIMIT_REACHED">;
42
- TEAM_MEMBER_LIMIT_REACHED: _better_auth_core_utils_error_codes0.RawError<"TEAM_MEMBER_LIMIT_REACHED">;
43
- USER_IS_NOT_A_MEMBER_OF_THE_TEAM: _better_auth_core_utils_error_codes0.RawError<"USER_IS_NOT_A_MEMBER_OF_THE_TEAM">;
44
- YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM: _better_auth_core_utils_error_codes0.RawError<"YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM">;
45
- YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM: _better_auth_core_utils_error_codes0.RawError<"YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM">;
46
- YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER">;
47
- YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER">;
48
- YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION">;
49
- YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION">;
50
- MISSING_AC_INSTANCE: _better_auth_core_utils_error_codes0.RawError<"MISSING_AC_INSTANCE">;
51
- YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE: _better_auth_core_utils_error_codes0.RawError<"YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE">;
52
- YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE">;
53
- YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE">;
54
- YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE">;
55
- YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE">;
56
- YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE">;
57
- YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE: _better_auth_core_utils_error_codes0.RawError<"YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE">;
58
- TOO_MANY_ROLES: _better_auth_core_utils_error_codes0.RawError<"TOO_MANY_ROLES">;
59
- INVALID_RESOURCE: _better_auth_core_utils_error_codes0.RawError<"INVALID_RESOURCE">;
60
- ROLE_NAME_IS_ALREADY_TAKEN: _better_auth_core_utils_error_codes0.RawError<"ROLE_NAME_IS_ALREADY_TAKEN">;
61
- CANNOT_DELETE_A_PRE_DEFINED_ROLE: _better_auth_core_utils_error_codes0.RawError<"CANNOT_DELETE_A_PRE_DEFINED_ROLE">;
62
- ROLE_IS_ASSIGNED_TO_MEMBERS: _better_auth_core_utils_error_codes0.RawError<"ROLE_IS_ASSIGNED_TO_MEMBERS">;
63
- INVALID_TEAM_ID: _better_auth_core_utils_error_codes0.RawError<"INVALID_TEAM_ID">;
3
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION">;
4
+ YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS: import("@better-auth/core/utils/error-codes").RawError<"YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS">;
5
+ ORGANIZATION_ALREADY_EXISTS: import("@better-auth/core/utils/error-codes").RawError<"ORGANIZATION_ALREADY_EXISTS">;
6
+ ORGANIZATION_SLUG_ALREADY_TAKEN: import("@better-auth/core/utils/error-codes").RawError<"ORGANIZATION_SLUG_ALREADY_TAKEN">;
7
+ ORGANIZATION_NOT_FOUND: import("@better-auth/core/utils/error-codes").RawError<"ORGANIZATION_NOT_FOUND">;
8
+ USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION: import("@better-auth/core/utils/error-codes").RawError<"USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION">;
9
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION">;
10
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION">;
11
+ NO_ACTIVE_ORGANIZATION: import("@better-auth/core/utils/error-codes").RawError<"NO_ACTIVE_ORGANIZATION">;
12
+ USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION: import("@better-auth/core/utils/error-codes").RawError<"USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION">;
13
+ MEMBER_NOT_FOUND: import("@better-auth/core/utils/error-codes").RawError<"MEMBER_NOT_FOUND">;
14
+ ROLE_NOT_FOUND: import("@better-auth/core/utils/error-codes").RawError<"ROLE_NOT_FOUND">;
15
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM">;
16
+ TEAM_ALREADY_EXISTS: import("@better-auth/core/utils/error-codes").RawError<"TEAM_ALREADY_EXISTS">;
17
+ TEAM_NOT_FOUND: import("@better-auth/core/utils/error-codes").RawError<"TEAM_NOT_FOUND">;
18
+ YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER: import("@better-auth/core/utils/error-codes").RawError<"YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER">;
19
+ YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER: import("@better-auth/core/utils/error-codes").RawError<"YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER">;
20
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER">;
21
+ YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION">;
22
+ USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION: import("@better-auth/core/utils/error-codes").RawError<"USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION">;
23
+ INVITATION_NOT_FOUND: import("@better-auth/core/utils/error-codes").RawError<"INVITATION_NOT_FOUND">;
24
+ YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION">;
25
+ EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION: import("@better-auth/core/utils/error-codes").RawError<"EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION">;
26
+ EMAIL_VERIFICATION_REQUIRED_FOR_INVITATION: import("@better-auth/core/utils/error-codes").RawError<"EMAIL_VERIFICATION_REQUIRED_FOR_INVITATION">;
27
+ YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION">;
28
+ INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION: import("@better-auth/core/utils/error-codes").RawError<"INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION">;
29
+ YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE">;
30
+ FAILED_TO_RETRIEVE_INVITATION: import("@better-auth/core/utils/error-codes").RawError<"FAILED_TO_RETRIEVE_INVITATION">;
31
+ YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS: import("@better-auth/core/utils/error-codes").RawError<"YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS">;
32
+ UNABLE_TO_REMOVE_LAST_TEAM: import("@better-auth/core/utils/error-codes").RawError<"UNABLE_TO_REMOVE_LAST_TEAM">;
33
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER">;
34
+ ORGANIZATION_MEMBERSHIP_LIMIT_REACHED: import("@better-auth/core/utils/error-codes").RawError<"ORGANIZATION_MEMBERSHIP_LIMIT_REACHED">;
35
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION">;
36
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION">;
37
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM">;
38
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM">;
39
+ INVITATION_LIMIT_REACHED: import("@better-auth/core/utils/error-codes").RawError<"INVITATION_LIMIT_REACHED">;
40
+ TEAM_MEMBER_LIMIT_REACHED: import("@better-auth/core/utils/error-codes").RawError<"TEAM_MEMBER_LIMIT_REACHED">;
41
+ USER_IS_NOT_A_MEMBER_OF_THE_TEAM: import("@better-auth/core/utils/error-codes").RawError<"USER_IS_NOT_A_MEMBER_OF_THE_TEAM">;
42
+ YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM: import("@better-auth/core/utils/error-codes").RawError<"YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM">;
43
+ YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM: import("@better-auth/core/utils/error-codes").RawError<"YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM">;
44
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER">;
45
+ YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER">;
46
+ YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION">;
47
+ YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION">;
48
+ MISSING_AC_INSTANCE: import("@better-auth/core/utils/error-codes").RawError<"MISSING_AC_INSTANCE">;
49
+ YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE: import("@better-auth/core/utils/error-codes").RawError<"YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE">;
50
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE">;
51
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE">;
52
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE">;
53
+ YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE">;
54
+ YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE">;
55
+ YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE: import("@better-auth/core/utils/error-codes").RawError<"YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE">;
56
+ TOO_MANY_ROLES: import("@better-auth/core/utils/error-codes").RawError<"TOO_MANY_ROLES">;
57
+ INVALID_RESOURCE: import("@better-auth/core/utils/error-codes").RawError<"INVALID_RESOURCE">;
58
+ ROLE_NAME_IS_ALREADY_TAKEN: import("@better-auth/core/utils/error-codes").RawError<"ROLE_NAME_IS_ALREADY_TAKEN">;
59
+ CANNOT_DELETE_A_PRE_DEFINED_ROLE: import("@better-auth/core/utils/error-codes").RawError<"CANNOT_DELETE_A_PRE_DEFINED_ROLE">;
60
+ ROLE_IS_ASSIGNED_TO_MEMBERS: import("@better-auth/core/utils/error-codes").RawError<"ROLE_IS_ASSIGNED_TO_MEMBERS">;
61
+ INVALID_TEAM_ID: import("@better-auth/core/utils/error-codes").RawError<"INVALID_TEAM_ID">;
64
62
  };
65
63
  //#endregion
66
64
  export { ORGANIZATION_ERROR_CODES };
@@ -1,6 +1,5 @@
1
1
  import { HasPermissionBaseInput } from "./permission.mjs";
2
2
  import { GenericEndpointContext } from "@better-auth/core";
3
-
4
3
  //#region src/plugins/organization/has-permission.d.ts
5
4
  declare const hasPermission: (input: {
6
5
  organizationId: string;
@@ -20,7 +20,7 @@ const hasPermission = async (input, ctx) => {
20
20
  throw new APIError("INTERNAL_SERVER_ERROR", { message: "Invalid permissions for role " + role });
21
21
  }
22
22
  const merged = { ...acRoles[role]?.statements };
23
- for (const [key, actions] of Object.entries(result.data)) merged[key] = [...new Set([...merged[key] ?? [], ...actions])];
23
+ for (const [key, actions] of Object.entries(result.data)) merged[key] = [.../* @__PURE__ */ new Set([...merged[key] ?? [], ...actions])];
24
24
  acRoles[role] = input.options.ac.newRole(merged);
25
25
  }
26
26
  }
@@ -3,4 +3,4 @@ import { InferInvitation, InferMember, InferOrganization, InferOrganizationRoles
3
3
  import { getOrgAdapter } from "./adapter.mjs";
4
4
  import { hasPermission } from "./has-permission.mjs";
5
5
  import { DefaultOrganizationPlugin, DynamicAccessControlEndpoints, OrganizationCreator, OrganizationEndpoints, OrganizationPlugin, TeamEndpoints, organization, parseRoles } from "./organization.mjs";
6
- export { DefaultOrganizationPlugin, DynamicAccessControlEndpoints, InferInvitation, InferMember, InferOrganization, InferOrganizationRolesFromOption, InferOrganizationZodRolesFromOption, InferTeam, Invitation, InvitationInput, InvitationStatus, Member, MemberInput, Organization, OrganizationCreator, OrganizationEndpoints, OrganizationInput, OrganizationOptions, OrganizationPlugin, OrganizationRole, OrganizationSchema, Team, TeamEndpoints, TeamInput, TeamMember, TeamMemberInput, defaultRolesSchema, getOrgAdapter, hasPermission, invitationSchema, invitationStatus, memberSchema, organization, organizationRoleSchema, organizationSchema, parseRoles, roleSchema, teamMemberSchema, teamSchema };
6
+ export { DefaultOrganizationPlugin, DynamicAccessControlEndpoints, type InferInvitation, type InferMember, type InferOrganization, type InferOrganizationRolesFromOption, type InferOrganizationZodRolesFromOption, type InferTeam, type Invitation, type InvitationInput, type InvitationStatus, type Member, type MemberInput, type Organization, OrganizationCreator, OrganizationEndpoints, type OrganizationInput, type OrganizationOptions, OrganizationPlugin, type OrganizationRole, type OrganizationSchema, type Team, TeamEndpoints, type TeamInput, type TeamMember, type TeamMemberInput, type defaultRolesSchema, getOrgAdapter, hasPermission, type invitationSchema, type invitationStatus, type memberSchema, organization, type organizationRoleSchema, type organizationSchema, parseRoles, type roleSchema, type teamMemberSchema, type teamSchema };