better-auth 1.6.22 → 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.
- package/dist/adapters/index.d.mts +1 -6
- package/dist/api/dispatch.d.mts +0 -1
- package/dist/api/index.d.mts +476 -478
- package/dist/api/middlewares/authorization.d.mts +12 -8
- package/dist/api/middlewares/authorization.mjs +2 -1
- package/dist/api/middlewares/index.d.mts +2 -1
- package/dist/api/middlewares/origin-check.d.mts +3 -5
- package/dist/api/routes/account.d.mts +10 -13
- package/dist/api/routes/account.mjs +35 -7
- package/dist/api/routes/callback.d.mts +1 -3
- package/dist/api/routes/callback.mjs +4 -0
- package/dist/api/routes/email-verification.d.mts +4 -8
- package/dist/api/routes/email-verification.mjs +15 -2
- package/dist/api/routes/error.d.mts +1 -3
- package/dist/api/routes/index.d.mts +2 -1
- package/dist/api/routes/ok.d.mts +1 -3
- package/dist/api/routes/password.d.mts +7 -9
- package/dist/api/routes/password.mjs +14 -1
- package/dist/api/routes/session.d.mts +22 -24
- package/dist/api/routes/session.mjs +5 -1
- package/dist/api/routes/sign-in.d.mts +3 -5
- package/dist/api/routes/sign-in.mjs +84 -2
- package/dist/api/routes/sign-out.d.mts +1 -3
- package/dist/api/routes/sign-up.d.mts +3 -4
- package/dist/api/routes/sign-up.mjs +3 -2
- package/dist/api/routes/update-session.d.mts +3 -4
- package/dist/api/routes/update-user.d.mts +13 -14
- package/dist/api/routes/update-user.mjs +26 -1
- package/dist/auth/full.d.mts +1 -1
- package/dist/auth/minimal.d.mts +1 -1
- package/dist/client/config.d.mts +12 -14
- package/dist/client/config.mjs +2 -2
- package/dist/client/equality.d.mts +0 -1
- package/dist/client/index.d.mts +6 -5
- package/dist/client/lynx/index.d.mts +4 -5
- package/dist/client/lynx/lynx-store.d.mts +1 -2
- package/dist/client/parser.d.mts +7 -3
- package/dist/client/path-to-object.d.mts +3 -4
- package/dist/client/plugins/index.d.mts +2 -1
- package/dist/client/plugins/infer-plugin.d.mts +0 -1
- package/dist/client/query.d.mts +0 -1
- package/dist/client/query.mjs +38 -20
- package/dist/client/react/index.d.mts +4 -5
- package/dist/client/react/react-store.d.mts +1 -2
- package/dist/client/session-refresh.d.mts +0 -1
- package/dist/client/solid/index.d.mts +5 -6
- package/dist/client/svelte/index.d.mts +5 -6
- package/dist/client/types.d.mts +2 -2
- package/dist/client/vanilla.d.mts +2 -3
- package/dist/client/vue/index.d.mts +5 -6
- package/dist/context/create-context.mjs +3 -3
- package/dist/context/helpers.mjs +2 -2
- package/dist/cookies/cookie-utils.d.mts +1 -1
- package/dist/cookies/index.d.mts +6 -7
- package/dist/cookies/index.mjs +4 -0
- package/dist/cookies/session-store.d.mts +1 -0
- package/dist/cookies/session-store.mjs +6 -1
- package/dist/crypto/index.d.mts +2 -9
- package/dist/crypto/jwt.d.mts +0 -1
- package/dist/crypto/password.d.mts +1 -5
- package/dist/db/adapter-base.d.mts +0 -1
- package/dist/db/adapter-kysely.d.mts +0 -1
- package/dist/db/field-converter.d.mts +0 -1
- package/dist/db/field.d.mts +9 -10
- package/dist/db/get-migration.d.mts +0 -1
- package/dist/db/get-migration.mjs +8 -4
- package/dist/db/get-schema.d.mts +0 -1
- package/dist/db/internal-adapter.d.mts +0 -1
- package/dist/db/internal-adapter.mjs +61 -1
- package/dist/db/revoke-unproven-account-access.d.mts +0 -1
- package/dist/db/schema.d.mts +2 -2
- package/dist/db/to-zod.d.mts +3 -7
- package/dist/db/with-hooks.d.mts +0 -1
- package/dist/index.d.mts +4 -3
- package/dist/integrations/next-js.d.mts +4 -7
- package/dist/integrations/node.d.mts +2 -3
- package/dist/integrations/svelte-kit.d.mts +2 -9
- package/dist/integrations/tanstack-start-solid.d.mts +2 -5
- package/dist/integrations/tanstack-start.d.mts +2 -5
- package/dist/oauth2/link-account.d.mts +1 -1
- package/dist/oauth2/state.d.mts +0 -1
- package/dist/oauth2/utils.d.mts +0 -1
- package/dist/package.mjs +1 -1
- package/dist/plugins/access/access.d.mts +0 -1
- package/dist/plugins/access/types.d.mts +4 -5
- package/dist/plugins/additional-fields/client.d.mts +0 -1
- package/dist/plugins/admin/access/statement.d.mts +1 -0
- package/dist/plugins/admin/admin.d.mts +120 -125
- package/dist/plugins/admin/client.d.mts +30 -30
- package/dist/plugins/admin/client.mjs +1 -1
- package/dist/plugins/admin/error-codes.d.mts +23 -25
- package/dist/plugins/admin/index.d.mts +1 -1
- package/dist/plugins/admin/routes.mjs +9 -0
- package/dist/plugins/admin/schema.d.mts +1 -1
- package/dist/plugins/admin/types.d.mts +3 -2
- package/dist/plugins/anonymous/client.d.mts +9 -11
- package/dist/plugins/anonymous/client.mjs +1 -1
- package/dist/plugins/anonymous/error-codes.d.mts +8 -10
- package/dist/plugins/anonymous/index.d.mts +14 -18
- package/dist/plugins/anonymous/types.d.mts +1 -1
- package/dist/plugins/bearer/index.d.mts +4 -7
- package/dist/plugins/captcha/index.d.mts +5 -8
- package/dist/plugins/captcha/types.d.mts +0 -1
- package/dist/plugins/custom-session/client.d.mts +0 -1
- package/dist/plugins/custom-session/index.d.mts +7 -12
- package/dist/plugins/device-authorization/client.d.mts +0 -1
- package/dist/plugins/device-authorization/index.d.mts +19 -22
- package/dist/plugins/email-otp/client.d.mts +4 -6
- package/dist/plugins/email-otp/client.mjs +1 -1
- package/dist/plugins/email-otp/error-codes.d.mts +3 -5
- package/dist/plugins/email-otp/index.d.mts +67 -73
- package/dist/plugins/email-otp/routes.mjs +2 -0
- package/dist/plugins/email-otp/types.d.mts +0 -1
- package/dist/plugins/generic-oauth/client.d.mts +11 -11
- package/dist/plugins/generic-oauth/client.mjs +1 -1
- package/dist/plugins/generic-oauth/error-codes.d.mts +8 -10
- package/dist/plugins/generic-oauth/index.d.mts +41 -44
- package/dist/plugins/generic-oauth/index.mjs +2 -1
- package/dist/plugins/generic-oauth/providers/auth0.d.mts +0 -1
- package/dist/plugins/generic-oauth/providers/gumroad.d.mts +0 -1
- package/dist/plugins/generic-oauth/providers/hubspot.d.mts +0 -1
- package/dist/plugins/generic-oauth/providers/index.d.mts +3 -1
- package/dist/plugins/generic-oauth/providers/keycloak.d.mts +0 -1
- package/dist/plugins/generic-oauth/providers/line.d.mts +0 -1
- package/dist/plugins/generic-oauth/providers/microsoft-entra-id.d.mts +0 -1
- package/dist/plugins/generic-oauth/providers/okta.d.mts +0 -1
- package/dist/plugins/generic-oauth/providers/patreon.d.mts +0 -1
- package/dist/plugins/generic-oauth/providers/slack.d.mts +0 -1
- package/dist/plugins/generic-oauth/providers/yandex.d.mts +28 -0
- package/dist/plugins/generic-oauth/providers/yandex.mjs +60 -0
- package/dist/plugins/generic-oauth/routes.mjs +14 -0
- package/dist/plugins/generic-oauth/types.d.mts +1 -2
- package/dist/plugins/haveibeenpwned/index.d.mts +3 -6
- package/dist/plugins/index.d.mts +5 -1
- package/dist/plugins/index.mjs +2 -1
- package/dist/plugins/jwt/client.d.mts +2 -4
- package/dist/plugins/jwt/index.d.mts +8 -11
- package/dist/plugins/jwt/sign.d.mts +2 -2
- package/dist/plugins/jwt/types.d.mts +1 -1
- package/dist/plugins/jwt/utils.d.mts +2 -4
- package/dist/plugins/jwt/verify.d.mts +0 -1
- package/dist/plugins/last-login-method/client.mjs +13 -0
- package/dist/plugins/last-login-method/index.d.mts +11 -5
- package/dist/plugins/last-login-method/index.mjs +8 -0
- package/dist/plugins/magic-link/client.d.mts +0 -1
- package/dist/plugins/magic-link/index.d.mts +4 -5
- package/dist/plugins/magic-link/index.mjs +32 -1
- package/dist/plugins/mcp/authorize.mjs +12 -0
- package/dist/plugins/mcp/client/adapters.d.mts +0 -1
- package/dist/plugins/mcp/client/index.d.mts +2 -0
- package/dist/plugins/mcp/client/index.mjs +36 -11
- package/dist/plugins/mcp/index.d.mts +10 -11
- package/dist/plugins/multi-session/client.d.mts +2 -4
- package/dist/plugins/multi-session/client.mjs +1 -1
- package/dist/plugins/multi-session/error-codes.d.mts +1 -3
- package/dist/plugins/multi-session/index.d.mts +7 -11
- package/dist/plugins/multi-session/index.mjs +45 -0
- package/dist/plugins/oauth-popup/client.d.mts +6 -12
- package/dist/plugins/oauth-popup/client.mjs +5 -3
- package/dist/plugins/oauth-popup/error-codes.d.mts +4 -6
- package/dist/plugins/oauth-popup/index.d.mts +8 -12
- package/dist/plugins/oauth-popup/index.mjs +1 -1
- package/dist/plugins/oauth-popup/types.d.mts +1 -2
- package/dist/plugins/oauth-proxy/index.d.mts +6 -9
- package/dist/plugins/oauth-proxy/index.mjs +2 -2
- package/dist/plugins/oidc-provider/authorize.mjs +9 -0
- package/dist/plugins/oidc-provider/client.d.mts +1 -2
- package/dist/plugins/oidc-provider/index.d.mts +15 -17
- package/dist/plugins/oidc-provider/index.mjs +26 -2
- package/dist/plugins/oidc-provider/schema.d.mts +0 -1
- package/dist/plugins/oidc-provider/schema.mjs +37 -0
- package/dist/plugins/oidc-provider/types.d.mts +1 -1
- package/dist/plugins/one-tap/client.d.mts +3 -6
- package/dist/plugins/one-tap/client.mjs +3 -0
- package/dist/plugins/one-tap/index.d.mts +1 -3
- package/dist/plugins/one-tap/index.mjs +5 -0
- package/dist/plugins/one-time-token/client.d.mts +1 -2
- package/dist/plugins/one-time-token/index.d.mts +5 -6
- package/dist/plugins/one-time-token/index.mjs +30 -0
- package/dist/plugins/open-api/generator.d.mts +0 -1
- package/dist/plugins/open-api/generator.mjs +81 -5
- package/dist/plugins/open-api/index.d.mts +3 -5
- package/dist/plugins/organization/access/statement.d.mts +1 -0
- package/dist/plugins/organization/adapter.d.mts +56 -82
- package/dist/plugins/organization/adapter.mjs +17 -3
- package/dist/plugins/organization/client.d.mts +106 -105
- package/dist/plugins/organization/client.mjs +7 -4
- package/dist/plugins/organization/error-codes.d.mts +59 -61
- package/dist/plugins/organization/has-permission.d.mts +0 -1
- package/dist/plugins/organization/has-permission.mjs +1 -1
- package/dist/plugins/organization/index.d.mts +1 -1
- package/dist/plugins/organization/organization.d.mts +7 -7
- package/dist/plugins/organization/organization.mjs +434 -1
- package/dist/plugins/organization/permission.d.mts +2 -2
- package/dist/plugins/organization/routes/crud-access-control.d.mts +17 -17
- package/dist/plugins/organization/routes/crud-invites.d.mts +53 -54
- package/dist/plugins/organization/routes/crud-invites.mjs +1 -1
- package/dist/plugins/organization/routes/crud-members.d.mts +44 -46
- package/dist/plugins/organization/routes/crud-members.mjs +4 -1
- package/dist/plugins/organization/routes/crud-org.d.mts +47 -48
- package/dist/plugins/organization/routes/crud-org.mjs +2 -2
- package/dist/plugins/organization/routes/crud-team.d.mts +50 -51
- package/dist/plugins/organization/schema.d.mts +4 -4
- package/dist/plugins/organization/schema.mjs +1 -1
- package/dist/plugins/organization/types.d.mts +16 -16
- package/dist/plugins/phone-number/client.d.mts +13 -15
- package/dist/plugins/phone-number/client.mjs +1 -1
- package/dist/plugins/phone-number/error-codes.d.mts +12 -14
- package/dist/plugins/phone-number/index.d.mts +41 -47
- package/dist/plugins/phone-number/routes.mjs +15 -0
- package/dist/plugins/phone-number/types.d.mts +1 -1
- package/dist/plugins/siwe/client.d.mts +0 -1
- package/dist/plugins/siwe/index.d.mts +4 -5
- package/dist/plugins/test-utils/index.d.mts +2 -4
- package/dist/plugins/test-utils/types.d.mts +1 -0
- package/dist/plugins/two-factor/backup-codes/index.d.mts +4 -6
- package/dist/plugins/two-factor/backup-codes/index.mjs +52 -1
- package/dist/plugins/two-factor/client.d.mts +12 -15
- package/dist/plugins/two-factor/client.mjs +1 -1
- package/dist/plugins/two-factor/error-code.d.mts +10 -12
- package/dist/plugins/two-factor/index.d.mts +27 -31
- package/dist/plugins/two-factor/index.mjs +30 -0
- package/dist/plugins/two-factor/otp/index.d.mts +2 -4
- package/dist/plugins/two-factor/otp/index.mjs +42 -1
- package/dist/plugins/two-factor/totp/index.d.mts +4 -6
- package/dist/plugins/two-factor/totp/index.mjs +47 -0
- package/dist/plugins/two-factor/types.d.mts +1 -1
- package/dist/plugins/username/client.d.mts +9 -11
- package/dist/plugins/username/client.mjs +1 -1
- package/dist/plugins/username/error-codes.d.mts +8 -10
- package/dist/plugins/username/index.d.mts +17 -22
- package/dist/plugins/username/schema.d.mts +3 -5
- package/dist/state.d.mts +0 -1
- package/dist/state.mjs +4 -0
- package/dist/test-utils/test-instance.d.mts +5 -3
- package/dist/test-utils/test-instance.mjs +4 -1
- package/dist/types/adapter.d.mts +1 -1
- package/dist/types/api.d.mts +1 -2
- package/dist/types/auth.d.mts +0 -1
- package/dist/types/helper.d.mts +5 -5
- package/dist/types/index.d.mts +2 -2
- package/dist/types/models.d.mts +0 -1
- package/dist/types/plugins.d.mts +2 -3
- package/dist/utils/index.d.mts +2 -1
- package/dist/utils/request.mjs +23 -0
- package/dist/utils/url.d.mts +0 -1
- package/package.json +10 -10
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { AccessControl, ArrayElement, Statements } from "../access/types.mjs";
|
|
2
|
+
import "../access/index.mjs";
|
|
2
3
|
import { OrganizationOptions } from "./types.mjs";
|
|
3
4
|
import { InferInvitation, InferMember, InferOrganization, InferTeam, OrganizationSchema, TeamMember } from "./schema.mjs";
|
|
5
|
+
import "../index.mjs";
|
|
4
6
|
import { ORGANIZATION_ERROR_CODES } from "./error-codes.mjs";
|
|
5
7
|
import { createOrgRole, deleteOrgRole, getOrgRole, listOrgRoles, updateOrgRole } from "./routes/crud-access-control.mjs";
|
|
6
8
|
import { acceptInvitation, cancelInvitation, createInvitation, getInvitation, listInvitations, listUserInvitations, rejectInvitation } from "./routes/crud-invites.mjs";
|
|
@@ -8,9 +10,7 @@ import { addMember, getActiveMember, getActiveMemberRole, leaveOrganization, lis
|
|
|
8
10
|
import { checkOrganizationSlug, createOrganization, deleteOrganization, getFullOrganization, listOrganizations, setActiveOrganization, updateOrganization } from "./routes/crud-org.mjs";
|
|
9
11
|
import { addTeamMember, createTeam, listOrganizationTeams, listTeamMembers, listUserTeams, removeTeam, removeTeamMember, setActiveTeam, updateTeam } from "./routes/crud-team.mjs";
|
|
10
12
|
import { hasPermission } from "./has-permission.mjs";
|
|
11
|
-
import * as better_call0 from "better-call";
|
|
12
13
|
import * as z from "zod";
|
|
13
|
-
|
|
14
14
|
//#region src/plugins/organization/organization.d.ts
|
|
15
15
|
declare module "@better-auth/core" {
|
|
16
16
|
interface BetterAuthPluginRegistry<AuthOptions, Options> {
|
|
@@ -94,7 +94,7 @@ type OrganizationEndpoints<O extends OrganizationOptions> = {
|
|
|
94
94
|
getActiveMemberRole: ReturnType<typeof getActiveMemberRole<O>>;
|
|
95
95
|
hasPermission: ReturnType<typeof createHasPermission<O>>;
|
|
96
96
|
};
|
|
97
|
-
declare const createHasPermission: <O extends OrganizationOptions>(options: O) =>
|
|
97
|
+
declare const createHasPermission: <O extends OrganizationOptions>(options: O) => import("better-call").StrictEndpoint<"/organization/has-permission", {
|
|
98
98
|
method: "POST";
|
|
99
99
|
requireHeaders: true;
|
|
100
100
|
body: z.ZodIntersection<z.ZodObject<{
|
|
@@ -104,8 +104,8 @@ declare const createHasPermission: <O extends OrganizationOptions>(options: O) =
|
|
|
104
104
|
}, z.core.$strip>, z.ZodObject<{
|
|
105
105
|
permissions: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
|
|
106
106
|
}, z.core.$strip>]>>;
|
|
107
|
-
use: ((inputContext:
|
|
108
|
-
use: ((inputContext:
|
|
107
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<{
|
|
108
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
109
109
|
session: {
|
|
110
110
|
session: Record<string, any> & {
|
|
111
111
|
id: string;
|
|
@@ -175,7 +175,7 @@ declare const createHasPermission: <O extends OrganizationOptions>(options: O) =
|
|
|
175
175
|
readonly invitation: readonly ["create", "cancel"];
|
|
176
176
|
readonly team: readonly ["create", "update", "delete"];
|
|
177
177
|
readonly ac: readonly ["create", "read", "update", "delete"];
|
|
178
|
-
})[key]> : never)[] | undefined };
|
|
178
|
+
})[key]> : never)[] | undefined; };
|
|
179
179
|
} & {
|
|
180
180
|
organizationId?: string | undefined;
|
|
181
181
|
};
|
|
@@ -392,4 +392,4 @@ declare function organization<O extends OrganizationOptions & {
|
|
|
392
392
|
};
|
|
393
393
|
declare function organization<O extends OrganizationOptions>(options?: O | undefined): DefaultOrganizationPlugin<O>;
|
|
394
394
|
//#endregion
|
|
395
|
-
export { DefaultOrganizationPlugin, DynamicAccessControlEndpoints, OrganizationCreator, OrganizationEndpoints, OrganizationPlugin, TeamEndpoints, organization, parseRoles };
|
|
395
|
+
export { DefaultOrganizationPlugin, DynamicAccessControlEndpoints, OrganizationCreator, OrganizationEndpoints, type OrganizationOptions, OrganizationPlugin, TeamEndpoints, hasPermission, organization, parseRoles };
|
|
@@ -80,38 +80,471 @@ const createHasPermission = (options) => {
|
|
|
80
80
|
function organization(options) {
|
|
81
81
|
const opts = options || {};
|
|
82
82
|
let endpoints = {
|
|
83
|
+
/**
|
|
84
|
+
* ### Endpoint
|
|
85
|
+
*
|
|
86
|
+
* POST `/organization/create`
|
|
87
|
+
*
|
|
88
|
+
* ### API Methods
|
|
89
|
+
*
|
|
90
|
+
* **server:**
|
|
91
|
+
* `auth.api.createOrganization`
|
|
92
|
+
*
|
|
93
|
+
* **client:**
|
|
94
|
+
* `authClient.organization.create`
|
|
95
|
+
*
|
|
96
|
+
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/organization#api-method-organization-create)
|
|
97
|
+
*/
|
|
83
98
|
createOrganization: createOrganization(opts),
|
|
99
|
+
/**
|
|
100
|
+
* ### Endpoint
|
|
101
|
+
*
|
|
102
|
+
* POST `/organization/update`
|
|
103
|
+
*
|
|
104
|
+
* ### API Methods
|
|
105
|
+
*
|
|
106
|
+
* **server:**
|
|
107
|
+
* `auth.api.updateOrganization`
|
|
108
|
+
*
|
|
109
|
+
* **client:**
|
|
110
|
+
* `authClient.organization.update`
|
|
111
|
+
*
|
|
112
|
+
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/organization#api-method-organization-update)
|
|
113
|
+
*/
|
|
84
114
|
updateOrganization: updateOrganization(opts),
|
|
115
|
+
/**
|
|
116
|
+
* ### Endpoint
|
|
117
|
+
*
|
|
118
|
+
* POST `/organization/delete`
|
|
119
|
+
*
|
|
120
|
+
* ### API Methods
|
|
121
|
+
*
|
|
122
|
+
* **server:**
|
|
123
|
+
* `auth.api.deleteOrganization`
|
|
124
|
+
*
|
|
125
|
+
* **client:**
|
|
126
|
+
* `authClient.organization.delete`
|
|
127
|
+
*
|
|
128
|
+
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/organization#api-method-organization-delete)
|
|
129
|
+
*/
|
|
85
130
|
deleteOrganization: deleteOrganization(opts),
|
|
131
|
+
/**
|
|
132
|
+
* ### Endpoint
|
|
133
|
+
*
|
|
134
|
+
* POST `/organization/set-active`
|
|
135
|
+
*
|
|
136
|
+
* ### API Methods
|
|
137
|
+
*
|
|
138
|
+
* **server:**
|
|
139
|
+
* `auth.api.setActiveOrganization`
|
|
140
|
+
*
|
|
141
|
+
* **client:**
|
|
142
|
+
* `authClient.organization.setActive`
|
|
143
|
+
*
|
|
144
|
+
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/organization#api-method-organization-set-active)
|
|
145
|
+
*/
|
|
86
146
|
setActiveOrganization: setActiveOrganization(opts),
|
|
147
|
+
/**
|
|
148
|
+
* ### Endpoint
|
|
149
|
+
*
|
|
150
|
+
* GET `/organization/get-full-organization`
|
|
151
|
+
*
|
|
152
|
+
* ### API Methods
|
|
153
|
+
*
|
|
154
|
+
* **server:**
|
|
155
|
+
* `auth.api.getFullOrganization`
|
|
156
|
+
*
|
|
157
|
+
* **client:**
|
|
158
|
+
* `authClient.organization.getFullOrganization`
|
|
159
|
+
*
|
|
160
|
+
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/organization#api-method-organization-get-full-organization)
|
|
161
|
+
*/
|
|
87
162
|
getFullOrganization: getFullOrganization(opts),
|
|
163
|
+
/**
|
|
164
|
+
* ### Endpoint
|
|
165
|
+
*
|
|
166
|
+
* GET `/organization/list`
|
|
167
|
+
*
|
|
168
|
+
* ### API Methods
|
|
169
|
+
*
|
|
170
|
+
* **server:**
|
|
171
|
+
* `auth.api.listOrganizations`
|
|
172
|
+
*
|
|
173
|
+
* **client:**
|
|
174
|
+
* `authClient.organization.list`
|
|
175
|
+
*
|
|
176
|
+
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/organization#api-method-organization-list)
|
|
177
|
+
*/
|
|
88
178
|
listOrganizations: listOrganizations(opts),
|
|
179
|
+
/**
|
|
180
|
+
* ### Endpoint
|
|
181
|
+
*
|
|
182
|
+
* POST `/organization/invite-member`
|
|
183
|
+
*
|
|
184
|
+
* ### API Methods
|
|
185
|
+
*
|
|
186
|
+
* **server:**
|
|
187
|
+
* `auth.api.createInvitation`
|
|
188
|
+
*
|
|
189
|
+
* **client:**
|
|
190
|
+
* `authClient.organization.inviteMember`
|
|
191
|
+
*
|
|
192
|
+
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/organization#api-method-organization-invite-member)
|
|
193
|
+
*/
|
|
89
194
|
createInvitation: createInvitation(opts),
|
|
195
|
+
/**
|
|
196
|
+
* ### Endpoint
|
|
197
|
+
*
|
|
198
|
+
* POST `/organization/cancel-invitation`
|
|
199
|
+
*
|
|
200
|
+
* ### API Methods
|
|
201
|
+
*
|
|
202
|
+
* **server:**
|
|
203
|
+
* `auth.api.cancelInvitation`
|
|
204
|
+
*
|
|
205
|
+
* **client:**
|
|
206
|
+
* `authClient.organization.cancelInvitation`
|
|
207
|
+
*
|
|
208
|
+
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/organization#api-method-organization-cancel-invitation)
|
|
209
|
+
*/
|
|
90
210
|
cancelInvitation: cancelInvitation(opts),
|
|
211
|
+
/**
|
|
212
|
+
* ### Endpoint
|
|
213
|
+
*
|
|
214
|
+
* POST `/organization/accept-invitation`
|
|
215
|
+
*
|
|
216
|
+
* ### API Methods
|
|
217
|
+
*
|
|
218
|
+
* **server:**
|
|
219
|
+
* `auth.api.acceptInvitation`
|
|
220
|
+
*
|
|
221
|
+
* **client:**
|
|
222
|
+
* `authClient.organization.acceptInvitation`
|
|
223
|
+
*
|
|
224
|
+
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/organization#api-method-organization-accept-invitation)
|
|
225
|
+
*/
|
|
91
226
|
acceptInvitation: acceptInvitation(opts),
|
|
227
|
+
/**
|
|
228
|
+
* ### Endpoint
|
|
229
|
+
*
|
|
230
|
+
* GET `/organization/get-invitation`
|
|
231
|
+
*
|
|
232
|
+
* ### API Methods
|
|
233
|
+
*
|
|
234
|
+
* **server:**
|
|
235
|
+
* `auth.api.getInvitation`
|
|
236
|
+
*
|
|
237
|
+
* **client:**
|
|
238
|
+
* `authClient.organization.getInvitation`
|
|
239
|
+
*
|
|
240
|
+
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/organization#api-method-organization-get-invitation)
|
|
241
|
+
*/
|
|
92
242
|
getInvitation: getInvitation(opts),
|
|
243
|
+
/**
|
|
244
|
+
* ### Endpoint
|
|
245
|
+
*
|
|
246
|
+
* POST `/organization/reject-invitation`
|
|
247
|
+
*
|
|
248
|
+
* ### API Methods
|
|
249
|
+
*
|
|
250
|
+
* **server:**
|
|
251
|
+
* `auth.api.rejectInvitation`
|
|
252
|
+
*
|
|
253
|
+
* **client:**
|
|
254
|
+
* `authClient.organization.rejectInvitation`
|
|
255
|
+
*
|
|
256
|
+
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/organization#api-method-organization-reject-invitation)
|
|
257
|
+
*/
|
|
93
258
|
rejectInvitation: rejectInvitation(opts),
|
|
259
|
+
/**
|
|
260
|
+
* ### Endpoint
|
|
261
|
+
*
|
|
262
|
+
* GET `/organization/list-invitations`
|
|
263
|
+
*
|
|
264
|
+
* ### API Methods
|
|
265
|
+
*
|
|
266
|
+
* **server:**
|
|
267
|
+
* `auth.api.listInvitations`
|
|
268
|
+
*
|
|
269
|
+
* **client:**
|
|
270
|
+
* `authClient.organization.listInvitations`
|
|
271
|
+
*
|
|
272
|
+
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/organization#api-method-organization-list-invitations)
|
|
273
|
+
*/
|
|
94
274
|
listInvitations: listInvitations(opts),
|
|
275
|
+
/**
|
|
276
|
+
* ### Endpoint
|
|
277
|
+
*
|
|
278
|
+
* GET `/organization/get-active-member`
|
|
279
|
+
*
|
|
280
|
+
* ### API Methods
|
|
281
|
+
*
|
|
282
|
+
* **server:**
|
|
283
|
+
* `auth.api.getActiveMember`
|
|
284
|
+
*
|
|
285
|
+
* **client:**
|
|
286
|
+
* `authClient.organization.getActiveMember`
|
|
287
|
+
*
|
|
288
|
+
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/organization#api-method-organization-get-active-member)
|
|
289
|
+
*/
|
|
95
290
|
getActiveMember: getActiveMember(opts),
|
|
291
|
+
/**
|
|
292
|
+
* ### Endpoint
|
|
293
|
+
*
|
|
294
|
+
* POST `/organization/check-slug`
|
|
295
|
+
*
|
|
296
|
+
* ### API Methods
|
|
297
|
+
*
|
|
298
|
+
* **server:**
|
|
299
|
+
* `auth.api.checkOrganizationSlug`
|
|
300
|
+
*
|
|
301
|
+
* **client:**
|
|
302
|
+
* `authClient.organization.checkSlug`
|
|
303
|
+
*
|
|
304
|
+
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/organization#api-method-organization-check-slug)
|
|
305
|
+
*/
|
|
96
306
|
checkOrganizationSlug: checkOrganizationSlug(opts),
|
|
307
|
+
/**
|
|
308
|
+
* Add a member to an organization directly, bypassing the invitation flow.
|
|
309
|
+
*
|
|
310
|
+
* **Server-only:** callable as `auth.api.addMember` from trusted server
|
|
311
|
+
* code. It is not registered as an HTTP route and has no client method, so
|
|
312
|
+
* it runs no session or permission check of its own; the caller is
|
|
313
|
+
* responsible for authorizing the request.
|
|
314
|
+
*
|
|
315
|
+
* ### API Methods
|
|
316
|
+
*
|
|
317
|
+
* **server:**
|
|
318
|
+
* `auth.api.addMember`
|
|
319
|
+
*
|
|
320
|
+
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/organization#api-method-organization-add-member)
|
|
321
|
+
*/
|
|
97
322
|
addMember: addMember(opts),
|
|
323
|
+
/**
|
|
324
|
+
* ### Endpoint
|
|
325
|
+
*
|
|
326
|
+
* POST `/organization/remove-member`
|
|
327
|
+
*
|
|
328
|
+
* ### API Methods
|
|
329
|
+
*
|
|
330
|
+
* **server:**
|
|
331
|
+
* `auth.api.removeMember`
|
|
332
|
+
*
|
|
333
|
+
* **client:**
|
|
334
|
+
* `authClient.organization.removeMember`
|
|
335
|
+
*
|
|
336
|
+
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/organization#api-method-organization-remove-member)
|
|
337
|
+
*/
|
|
98
338
|
removeMember: removeMember(opts),
|
|
339
|
+
/**
|
|
340
|
+
* ### Endpoint
|
|
341
|
+
*
|
|
342
|
+
* POST `/organization/update-member-role`
|
|
343
|
+
*
|
|
344
|
+
* ### API Methods
|
|
345
|
+
*
|
|
346
|
+
* **server:**
|
|
347
|
+
* `auth.api.updateMemberRole`
|
|
348
|
+
*
|
|
349
|
+
* **client:**
|
|
350
|
+
* `authClient.organization.updateMemberRole`
|
|
351
|
+
*
|
|
352
|
+
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/organization#api-method-organization-update-member-role)
|
|
353
|
+
*/
|
|
99
354
|
updateMemberRole: updateMemberRole(opts),
|
|
355
|
+
/**
|
|
356
|
+
* ### Endpoint
|
|
357
|
+
*
|
|
358
|
+
* POST `/organization/leave`
|
|
359
|
+
*
|
|
360
|
+
* ### API Methods
|
|
361
|
+
*
|
|
362
|
+
* **server:**
|
|
363
|
+
* `auth.api.leaveOrganization`
|
|
364
|
+
*
|
|
365
|
+
* **client:**
|
|
366
|
+
* `authClient.organization.leave`
|
|
367
|
+
*
|
|
368
|
+
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/organization#api-method-organization-leave)
|
|
369
|
+
*/
|
|
100
370
|
leaveOrganization: leaveOrganization(opts),
|
|
101
371
|
listUserInvitations: listUserInvitations(opts),
|
|
372
|
+
/**
|
|
373
|
+
* ### Endpoint
|
|
374
|
+
*
|
|
375
|
+
* GET `/organization/list-members`
|
|
376
|
+
*
|
|
377
|
+
* ### API Methods
|
|
378
|
+
*
|
|
379
|
+
* **server:**
|
|
380
|
+
* `auth.api.listMembers`
|
|
381
|
+
*
|
|
382
|
+
* **client:**
|
|
383
|
+
* `authClient.organization.listMembers`
|
|
384
|
+
*/
|
|
102
385
|
listMembers: listMembers(opts),
|
|
386
|
+
/**
|
|
387
|
+
* ### Endpoint
|
|
388
|
+
*
|
|
389
|
+
* GET `/organization/get-active-member-role`
|
|
390
|
+
*
|
|
391
|
+
* ### API Methods
|
|
392
|
+
*
|
|
393
|
+
* **server:**
|
|
394
|
+
* `auth.api.getActiveMemberRole`
|
|
395
|
+
*
|
|
396
|
+
* **client:**
|
|
397
|
+
* `authClient.organization.getActiveMemberRole`
|
|
398
|
+
*
|
|
399
|
+
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/organization#api-method-organization-get-active-member-role)
|
|
400
|
+
*/
|
|
103
401
|
getActiveMemberRole: getActiveMemberRole(opts)
|
|
104
402
|
};
|
|
105
403
|
const teamSupport = opts.teams?.enabled;
|
|
106
404
|
const teamEndpoints = {
|
|
405
|
+
/**
|
|
406
|
+
* ### Endpoint
|
|
407
|
+
*
|
|
408
|
+
* POST `/organization/create-team`
|
|
409
|
+
*
|
|
410
|
+
* ### API Methods
|
|
411
|
+
*
|
|
412
|
+
* **server:**
|
|
413
|
+
* `auth.api.createTeam`
|
|
414
|
+
*
|
|
415
|
+
* **client:**
|
|
416
|
+
* `authClient.organization.createTeam`
|
|
417
|
+
*
|
|
418
|
+
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/organization#api-method-organization-create-team)
|
|
419
|
+
*/
|
|
107
420
|
createTeam: createTeam(opts),
|
|
421
|
+
/**
|
|
422
|
+
* ### Endpoint
|
|
423
|
+
*
|
|
424
|
+
* GET `/organization/list-teams`
|
|
425
|
+
*
|
|
426
|
+
* ### API Methods
|
|
427
|
+
*
|
|
428
|
+
* **server:**
|
|
429
|
+
* `auth.api.listOrganizationTeams`
|
|
430
|
+
*
|
|
431
|
+
* **client:**
|
|
432
|
+
* `authClient.organization.listTeams`
|
|
433
|
+
*
|
|
434
|
+
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/organization#api-method-organization-list-teams)
|
|
435
|
+
*/
|
|
108
436
|
listOrganizationTeams: listOrganizationTeams(opts),
|
|
437
|
+
/**
|
|
438
|
+
* ### Endpoint
|
|
439
|
+
*
|
|
440
|
+
* POST `/organization/remove-team`
|
|
441
|
+
*
|
|
442
|
+
* ### API Methods
|
|
443
|
+
*
|
|
444
|
+
* **server:**
|
|
445
|
+
* `auth.api.removeTeam`
|
|
446
|
+
*
|
|
447
|
+
* **client:**
|
|
448
|
+
* `authClient.organization.removeTeam`
|
|
449
|
+
*
|
|
450
|
+
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/organization#api-method-organization-remove-team)
|
|
451
|
+
*/
|
|
109
452
|
removeTeam: removeTeam(opts),
|
|
453
|
+
/**
|
|
454
|
+
* ### Endpoint
|
|
455
|
+
*
|
|
456
|
+
* POST `/organization/update-team`
|
|
457
|
+
*
|
|
458
|
+
* ### API Methods
|
|
459
|
+
*
|
|
460
|
+
* **server:**
|
|
461
|
+
* `auth.api.updateTeam`
|
|
462
|
+
*
|
|
463
|
+
* **client:**
|
|
464
|
+
* `authClient.organization.updateTeam`
|
|
465
|
+
*
|
|
466
|
+
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/organization#api-method-organization-update-team)
|
|
467
|
+
*/
|
|
110
468
|
updateTeam: updateTeam(opts),
|
|
469
|
+
/**
|
|
470
|
+
* ### Endpoint
|
|
471
|
+
*
|
|
472
|
+
* POST `/organization/set-active-team`
|
|
473
|
+
*
|
|
474
|
+
* ### API Methods
|
|
475
|
+
*
|
|
476
|
+
* **server:**
|
|
477
|
+
* `auth.api.setActiveTeam`
|
|
478
|
+
*
|
|
479
|
+
* **client:**
|
|
480
|
+
* `authClient.organization.setActiveTeam`
|
|
481
|
+
*
|
|
482
|
+
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/organization#api-set-active-team)
|
|
483
|
+
*/
|
|
111
484
|
setActiveTeam: setActiveTeam(opts),
|
|
485
|
+
/**
|
|
486
|
+
* ### Endpoint
|
|
487
|
+
*
|
|
488
|
+
* GET `/organization/list-user-teams`
|
|
489
|
+
*
|
|
490
|
+
* ### API Methods
|
|
491
|
+
*
|
|
492
|
+
* **server:**
|
|
493
|
+
* `auth.api.listUserTeams`
|
|
494
|
+
*
|
|
495
|
+
* **client:**
|
|
496
|
+
* `authClient.organization.listUserTeams`
|
|
497
|
+
*
|
|
498
|
+
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/organization#api-set-active-team)
|
|
499
|
+
*/
|
|
112
500
|
listUserTeams: listUserTeams(opts),
|
|
501
|
+
/**
|
|
502
|
+
* ### Endpoint
|
|
503
|
+
*
|
|
504
|
+
* POST `/organization/list-team-members`
|
|
505
|
+
*
|
|
506
|
+
* ### API Methods
|
|
507
|
+
*
|
|
508
|
+
* **server:**
|
|
509
|
+
* `auth.api.listTeamMembers`
|
|
510
|
+
*
|
|
511
|
+
* **client:**
|
|
512
|
+
* `authClient.organization.listTeamMembers`
|
|
513
|
+
*
|
|
514
|
+
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/organization#api-set-active-team)
|
|
515
|
+
*/
|
|
113
516
|
listTeamMembers: listTeamMembers(opts),
|
|
517
|
+
/**
|
|
518
|
+
* ### Endpoint
|
|
519
|
+
*
|
|
520
|
+
* POST `/organization/add-team-member`
|
|
521
|
+
*
|
|
522
|
+
* ### API Methods
|
|
523
|
+
*
|
|
524
|
+
* **server:**
|
|
525
|
+
* `auth.api.addTeamMember`
|
|
526
|
+
*
|
|
527
|
+
* **client:**
|
|
528
|
+
* `authClient.organization.addTeamMember`
|
|
529
|
+
*
|
|
530
|
+
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/organization#api-add-team-member)
|
|
531
|
+
*/
|
|
114
532
|
addTeamMember: addTeamMember(opts),
|
|
533
|
+
/**
|
|
534
|
+
* ### Endpoint
|
|
535
|
+
*
|
|
536
|
+
* POST `/organization/remove-team-member`
|
|
537
|
+
*
|
|
538
|
+
* ### API Methods
|
|
539
|
+
*
|
|
540
|
+
* **server:**
|
|
541
|
+
* `auth.api.removeTeamMember`
|
|
542
|
+
*
|
|
543
|
+
* **client:**
|
|
544
|
+
* `authClient.organization.removeTeamMember`
|
|
545
|
+
*
|
|
546
|
+
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/organization#api-remove-team-member)
|
|
547
|
+
*/
|
|
115
548
|
removeTeamMember: removeTeamMember(opts)
|
|
116
549
|
};
|
|
117
550
|
if (teamSupport) endpoints = {
|
|
@@ -418,4 +851,4 @@ function organization(options) {
|
|
|
418
851
|
};
|
|
419
852
|
}
|
|
420
853
|
//#endregion
|
|
421
|
-
export { organization, parseRoles };
|
|
854
|
+
export { hasPermission, organization, parseRoles };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import "../access/index.mjs";
|
|
1
2
|
import { OrganizationOptions } from "./types.mjs";
|
|
2
|
-
|
|
3
3
|
//#region src/plugins/organization/permission.d.ts
|
|
4
4
|
type PermissionExclusive = {
|
|
5
5
|
permissions: {
|
|
@@ -12,4 +12,4 @@ type HasPermissionBaseInput = {
|
|
|
12
12
|
allowCreatorAllPermissions?: boolean | undefined;
|
|
13
13
|
} & PermissionExclusive;
|
|
14
14
|
//#endregion
|
|
15
|
-
export { HasPermissionBaseInput };
|
|
15
|
+
export { HasPermissionBaseInput, PermissionExclusive };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { InferAdditionalFieldsFromPluginOptions } from "../../../db/field.mjs";
|
|
2
2
|
import { ExactRoleStatements } from "../../access/types.mjs";
|
|
3
|
+
import "../../../db/index.mjs";
|
|
3
4
|
import { OrganizationOptions } from "../types.mjs";
|
|
4
5
|
import { OrganizationRole } from "../schema.mjs";
|
|
5
|
-
import
|
|
6
|
+
import "../../index.mjs";
|
|
6
7
|
import * as z from "zod";
|
|
7
|
-
|
|
8
8
|
//#region src/plugins/organization/routes/crud-access-control.d.ts
|
|
9
9
|
type IsExactlyEmptyObject<T> = keyof T extends never ? T extends {} ? {} extends T ? true : false : false : false;
|
|
10
|
-
declare const createOrgRole: <O extends OrganizationOptions>(options: O) =>
|
|
10
|
+
declare const createOrgRole: <O extends OrganizationOptions>(options: O) => import("better-call").StrictEndpoint<"/organization/create-role", {
|
|
11
11
|
method: "POST";
|
|
12
12
|
body: z.ZodObject<{
|
|
13
13
|
organizationId: z.ZodOptional<z.ZodString>;
|
|
@@ -31,8 +31,8 @@ declare const createOrgRole: <O extends OrganizationOptions>(options: O) => bett
|
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
33
|
requireHeaders: true;
|
|
34
|
-
use: ((inputContext:
|
|
35
|
-
use: ((inputContext:
|
|
34
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<{
|
|
35
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
36
36
|
session: {
|
|
37
37
|
session: Record<string, any> & {
|
|
38
38
|
id: string;
|
|
@@ -93,7 +93,7 @@ declare const createOrgRole: <O extends OrganizationOptions>(options: O) => bett
|
|
|
93
93
|
} & InferAdditionalFieldsFromPluginOptions<"organizationRole", O, false>;
|
|
94
94
|
statements: ExactRoleStatements<Record<string, string[]>>;
|
|
95
95
|
}>;
|
|
96
|
-
declare const deleteOrgRole: <O extends OrganizationOptions>(options: O) =>
|
|
96
|
+
declare const deleteOrgRole: <O extends OrganizationOptions>(options: O) => import("better-call").StrictEndpoint<"/organization/delete-role", {
|
|
97
97
|
method: "POST";
|
|
98
98
|
body: z.ZodIntersection<z.ZodObject<{
|
|
99
99
|
organizationId: z.ZodOptional<z.ZodString>;
|
|
@@ -103,8 +103,8 @@ declare const deleteOrgRole: <O extends OrganizationOptions>(options: O) => bett
|
|
|
103
103
|
roleId: z.ZodString;
|
|
104
104
|
}, z.core.$strip>]>>;
|
|
105
105
|
requireHeaders: true;
|
|
106
|
-
use: ((inputContext:
|
|
107
|
-
use: ((inputContext:
|
|
106
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<{
|
|
107
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
108
108
|
session: {
|
|
109
109
|
session: Record<string, any> & {
|
|
110
110
|
id: string;
|
|
@@ -165,11 +165,11 @@ declare const deleteOrgRole: <O extends OrganizationOptions>(options: O) => bett
|
|
|
165
165
|
}, {
|
|
166
166
|
success: boolean;
|
|
167
167
|
}>;
|
|
168
|
-
declare const listOrgRoles: <O extends OrganizationOptions>(options: O) =>
|
|
168
|
+
declare const listOrgRoles: <O extends OrganizationOptions>(options: O) => import("better-call").StrictEndpoint<"/organization/list-roles", {
|
|
169
169
|
method: "GET";
|
|
170
170
|
requireHeaders: true;
|
|
171
|
-
use: ((inputContext:
|
|
172
|
-
use: ((inputContext:
|
|
171
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<{
|
|
172
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
173
173
|
session: {
|
|
174
174
|
session: Record<string, any> & {
|
|
175
175
|
id: string;
|
|
@@ -229,11 +229,11 @@ declare const listOrgRoles: <O extends OrganizationOptions>(options: O) => bette
|
|
|
229
229
|
createdAt: Date;
|
|
230
230
|
updatedAt?: Date | undefined;
|
|
231
231
|
} & InferAdditionalFieldsFromPluginOptions<"organizationRole", O, false>)[]>;
|
|
232
|
-
declare const getOrgRole: <O extends OrganizationOptions>(options: O) =>
|
|
232
|
+
declare const getOrgRole: <O extends OrganizationOptions>(options: O) => import("better-call").StrictEndpoint<"/organization/get-role", {
|
|
233
233
|
method: "GET";
|
|
234
234
|
requireHeaders: true;
|
|
235
|
-
use: ((inputContext:
|
|
236
|
-
use: ((inputContext:
|
|
235
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<{
|
|
236
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
237
237
|
session: {
|
|
238
238
|
session: Record<string, any> & {
|
|
239
239
|
id: string;
|
|
@@ -306,7 +306,7 @@ declare const getOrgRole: <O extends OrganizationOptions>(options: O) => better_
|
|
|
306
306
|
createdAt: Date;
|
|
307
307
|
updatedAt?: Date | undefined;
|
|
308
308
|
} & InferAdditionalFieldsFromPluginOptions<"organizationRole", O, false>>;
|
|
309
|
-
declare const updateOrgRole: <O extends OrganizationOptions>(options: O) =>
|
|
309
|
+
declare const updateOrgRole: <O extends OrganizationOptions>(options: O) => import("better-call").StrictEndpoint<"/organization/update-role", {
|
|
310
310
|
method: "POST";
|
|
311
311
|
body: z.ZodIntersection<z.ZodObject<{
|
|
312
312
|
organizationId: z.ZodOptional<z.ZodString>;
|
|
@@ -333,8 +333,8 @@ declare const updateOrgRole: <O extends OrganizationOptions>(options: O) => bett
|
|
|
333
333
|
};
|
|
334
334
|
};
|
|
335
335
|
requireHeaders: true;
|
|
336
|
-
use: ((inputContext:
|
|
337
|
-
use: ((inputContext:
|
|
336
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<{
|
|
337
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
338
338
|
session: {
|
|
339
339
|
session: Record<string, any> & {
|
|
340
340
|
id: string;
|