import { AccessControl, Role, Statements } from '../access/index.js'; import { z, ZodLiteral } from 'zod'; import * as better_call from 'better-call'; import { b as Prettify } from '../../shared/better-auth.Bi8FQwDD.js'; import { U as User, S as Session, G as GenericEndpointContext } from '../../shared/better-auth.6fr3ElRe.js'; import { defaultRoles } from './access/index.js'; export { adminAc, defaultAc, defaultStatements, memberAc, ownerAc } from './access/index.js'; import '../../shared/better-auth.BLX8BItA.js'; import 'jose'; import 'kysely'; import 'better-sqlite3'; declare const role: z.ZodString; declare const invitationStatus: z.ZodDefault>; declare const organizationSchema: z.ZodObject<{ id: z.ZodDefault; name: z.ZodString; slug: z.ZodString; logo: z.ZodOptional>; metadata: z.ZodOptional, z.ZodEffects]>>>; createdAt: z.ZodDate; }, "strip", z.ZodTypeAny, { id: string; name: string; createdAt: Date; slug: string; metadata?: any; logo?: string | null | undefined; }, { name: string; createdAt: Date; slug: string; metadata?: string | Record | null | undefined; id?: string | undefined; logo?: string | null | undefined; }>; declare const memberSchema: z.ZodObject<{ id: z.ZodDefault; organizationId: z.ZodString; userId: z.ZodString; role: z.ZodString; createdAt: z.ZodDefault; teamId: z.ZodOptional; }, "strip", z.ZodTypeAny, { id: string; createdAt: Date; userId: string; organizationId: string; role: string; teamId?: string | undefined; }, { userId: string; organizationId: string; role: string; id?: string | undefined; createdAt?: Date | undefined; teamId?: string | undefined; }>; declare const invitationSchema: z.ZodObject<{ id: z.ZodDefault; organizationId: z.ZodString; email: z.ZodString; role: z.ZodString; status: z.ZodDefault>; teamId: z.ZodOptional; inviterId: z.ZodString; expiresAt: z.ZodDate; }, "strip", z.ZodTypeAny, { id: string; email: string; status: "pending" | "accepted" | "rejected" | "canceled"; expiresAt: Date; organizationId: string; role: string; inviterId: string; teamId?: string | undefined; }, { email: string; expiresAt: Date; organizationId: string; role: string; inviterId: string; id?: string | undefined; status?: "pending" | "accepted" | "rejected" | "canceled" | undefined; teamId?: string | undefined; }>; declare const teamSchema: z.ZodObject<{ id: z.ZodDefault; name: z.ZodString; organizationId: z.ZodString; createdAt: z.ZodDate; updatedAt: z.ZodOptional; }, "strip", z.ZodTypeAny, { id: string; name: string; createdAt: Date; organizationId: string; updatedAt?: Date | undefined; }, { name: string; createdAt: Date; organizationId: string; id?: string | undefined; updatedAt?: Date | undefined; }>; type Organization = z.infer & Record; type Member = z.infer; type Team = z.infer; type Invitation = z.infer; type InvitationInput = z.input; type MemberInput = z.input; type OrganizationInput = z.input; type TeamInput = z.infer; type InferZodRolesFromOption = ZodLiteral; type InferRolesFromOption = O extends { roles: any; } ? keyof O["roles"] : "admin" | "member" | "owner"; type InvitationStatus = "pending" | "accepted" | "rejected" | "canceled"; type InferMember = O["teams"] extends { enabled: true; } ? { id: string; organizationId: string; role: InferRolesFromOption; createdAt: Date; userId: string; user: { email: string; name: string; image?: string; }; } : { id: string; organizationId: string; createdAt: Date; role: InferRolesFromOption; teamId?: string; userId: string; user: { email: string; name: string; image?: string; }; }; type InferInvitation = O["teams"] extends { enabled: true; } ? { id: string; organizationId: string; email: string; role: InferRolesFromOption; status: InvitationStatus; inviterId: string; expiresAt: Date; } : { id: string; organizationId: string; email: string; role: InferRolesFromOption; status: InvitationStatus; inviterId: string; expiresAt: Date; teamId?: string; }; declare function parseRoles(roles: string | string[]): string; interface OrganizationOptions { /** * Configure whether new users are able to create new organizations. * You can also pass a function that returns a boolean. * * @example * ```ts * allowUserToCreateOrganization: async (user) => { * const plan = await getUserPlan(user); * return plan.name === "pro"; * } * ``` * @default true */ allowUserToCreateOrganization?: boolean | ((user: User) => Promise | boolean); /** * The maximum number of organizations a user can create. * * You can also pass a function that returns a boolean */ organizationLimit?: number | ((user: User) => Promise | boolean); /** * The role that is assigned to the creator of the * organization. * * @default "owner" */ creatorRole?: string; /** * The number of memberships a user can have in an organization. * * @default 100 */ membershipLimit?: number; /** * Configure the roles and permissions for the * organization plugin. */ ac?: AccessControl; /** * Custom permissions for roles. */ roles?: { [key in string]?: Role; }; /** * Support for team. */ teams?: { /** * Enable team features. */ enabled: boolean; /** * Default team configuration */ defaultTeam?: { /** * Enable creating a default team when an organization is created * * @default true */ enabled: boolean; /** * Pass a custom default team creator function */ customCreateDefaultTeam?: (organization: Organization & Record, request?: Request) => Promise>; }; /** * Maximum number of teams an organization can have. * * You can pass a number or a function that returns a number * * @default "unlimited" * * @param organization * @param request * @returns */ maximumTeams?: ((data: { organizationId: string; session: { user: User; session: Session; } | null; }, request?: Request) => number | Promise) | number; /** * By default, if an organization does only have one team, they'll not be able to remove it. * * You can disable this behavior by setting this to `false. * * @default false */ allowRemovingAllTeams?: boolean; }; /** * The expiration time for the invitation link. * * @default 48 hours */ invitationExpiresIn?: number; /** * Send an email with the * invitation link to the user. * * Note: Better Auth doesn't * generate invitation URLs. * You'll need to construct the * URL using the invitation ID * and pass it to the * acceptInvitation endpoint for * the user to accept the * invitation. * * @example * ```ts * sendInvitationEmail: async (data) => { * const url = `https://yourapp.com/organization/ * accept-invitation?id=${data.id}`; * await sendEmail(data.email, "Invitation to join * organization", `Click the link to join the * organization: ${url}`); * } * ``` */ sendInvitationEmail?: (data: { /** * the invitation id */ id: string; /** * the role of the user */ role: string; /** * the email of the user */ email: string; /** * the organization the user is invited to join */ organization: Organization; /** * the invitation object */ invitation: Invitation; /** * the member who is inviting the user */ inviter: Member & { user: User; }; }, /** * The request object */ request?: Request) => Promise; /** * The schema for the organization plugin. */ schema?: { session?: { fields?: { activeOrganizationId?: string; }; }; organization?: { modelName?: string; fields?: { [key in keyof Omit]?: string; }; }; member?: { modelName?: string; fields?: { [key in keyof Omit]?: string; }; }; invitation?: { modelName?: string; fields?: { [key in keyof Omit]?: string; }; }; team?: { modelName?: string; fields?: { [key in keyof Omit]?: string; }; }; }; /** * Configure how organization deletion is handled */ organizationDeletion?: { /** * disable deleting organization */ disabled?: boolean; /** * A callback that runs before the organization is * deleted * * @param data - organization and user object * @param request - the request object * @returns */ beforeDelete?: (data: { organization: Organization; user: User; }, request?: Request) => Promise; /** * A callback that runs after the organization is * deleted * * @param data - organization and user object * @param request - the request object * @returns */ afterDelete?: (data: { organization: Organization; user: User; }, request?: Request) => Promise; }; organizationCreation?: { disabled?: boolean; beforeCreate?: (data: { organization: Omit; user: User; }, request?: Request) => Promise; }>; afterCreate?: (data: { organization: Organization; member: Member; user: User; }, request?: Request) => Promise; }; } /** * Organization plugin for Better Auth. Organization allows you to create teams, members, * and manage access control for your users. * * @example * ```ts * const auth = createAuth({ * plugins: [ * organization({ * allowUserToCreateOrganization: true, * }), * ], * }); * ``` */ declare const organization: (options?: O) => { id: "organization"; endpoints: (O["teams"] extends { enabled: true; } ? { createTeam: { ; name: z.ZodString; }, "strip", z.ZodTypeAny, { name: string; organizationId?: string | undefined; }, { name: string; organizationId?: string | undefined; }>; use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>)[]; } & { use: any[]; }>]>(...inputCtx: C): Promise; options: { method: "POST"; body: z.ZodObject<{ organizationId: z.ZodOptional; name: z.ZodString; }, "strip", z.ZodTypeAny, { name: string; organizationId?: string | undefined; }, { name: string; organizationId?: string | undefined; }>; use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>)[]; } & { use: any[]; }; path: "/organization/create-team"; }; listOrganizationTeams: { ; }, "strip", z.ZodTypeAny, { organizationId?: string | undefined; }, { organizationId?: string | undefined; }>>; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; } & { use: any[]; }> | undefined)?]>(...inputCtx: C): Promise; options: { method: "GET"; query: z.ZodOptional; }, "strip", z.ZodTypeAny, { organizationId?: string | undefined; }, { organizationId?: string | undefined; }>>; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; } & { use: any[]; }; path: "/organization/list-teams"; }; removeTeam: { ; }, "strip", z.ZodTypeAny, { teamId: string; organizationId?: string | undefined; }, { teamId: string; organizationId?: string | undefined; }>; use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>)[]; } & { use: any[]; }>]>(...inputCtx: C): Promise; options: { method: "POST"; body: z.ZodObject<{ teamId: z.ZodString; organizationId: z.ZodOptional; }, "strip", z.ZodTypeAny, { teamId: string; organizationId?: string | undefined; }, { teamId: string; organizationId?: string | undefined; }>; use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>)[]; } & { use: any[]; }; path: "/organization/remove-team"; }; updateTeam: { >; name: z.ZodOptional; organizationId: z.ZodOptional; createdAt: z.ZodOptional; updatedAt: z.ZodOptional>; }, "strip", z.ZodTypeAny, { id?: string | undefined; name?: string | undefined; createdAt?: Date | undefined; updatedAt?: Date | undefined; organizationId?: string | undefined; }, { id?: string | undefined; name?: string | undefined; createdAt?: Date | undefined; updatedAt?: Date | undefined; organizationId?: string | undefined; }>; }, "strip", z.ZodTypeAny, { data: { id?: string | undefined; name?: string | undefined; createdAt?: Date | undefined; updatedAt?: Date | undefined; organizationId?: string | undefined; }; teamId: string; }, { data: { id?: string | undefined; name?: string | undefined; createdAt?: Date | undefined; updatedAt?: Date | undefined; organizationId?: string | undefined; }; teamId: string; }>; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; } & { use: any[]; }>]>(...inputCtx: C): Promise; options: { method: "POST"; body: z.ZodObject<{ teamId: z.ZodString; data: z.ZodObject<{ id: z.ZodOptional>; name: z.ZodOptional; organizationId: z.ZodOptional; createdAt: z.ZodOptional; updatedAt: z.ZodOptional>; }, "strip", z.ZodTypeAny, { id?: string | undefined; name?: string | undefined; createdAt?: Date | undefined; updatedAt?: Date | undefined; organizationId?: string | undefined; }, { id?: string | undefined; name?: string | undefined; createdAt?: Date | undefined; updatedAt?: Date | undefined; organizationId?: string | undefined; }>; }, "strip", z.ZodTypeAny, { data: { id?: string | undefined; name?: string | undefined; createdAt?: Date | undefined; updatedAt?: Date | undefined; organizationId?: string | undefined; }; teamId: string; }, { data: { id?: string | undefined; name?: string | undefined; createdAt?: Date | undefined; updatedAt?: Date | undefined; organizationId?: string | undefined; }; teamId: string; }>; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; } & { use: any[]; }; path: "/organization/update-team"; }; } & { createOrganization: { ; logo: z.ZodOptional; metadata: z.ZodOptional>; keepCurrentActiveOrganization: z.ZodOptional; }, "strip", z.ZodTypeAny, { name: string; slug: string; metadata?: Record | undefined; userId?: string | undefined; logo?: string | undefined; keepCurrentActiveOrganization?: boolean | undefined; }, { name: string; slug: string; metadata?: Record | undefined; userId?: string | undefined; logo?: string | undefined; keepCurrentActiveOrganization?: boolean | undefined; }>; use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>)[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; description: string; $ref: string; }; }; }; }; }; }; }; } & { use: any[]; }>]>(...inputCtx: C): Promise | undefined; members: { id: string; createdAt: Date; userId: string; organizationId: string; role: string; teamId?: string | undefined; }[]; id: string; name: string; createdAt: Date; slug: string; logo?: string | null | undefined; } | null; } : { metadata: Record | undefined; members: { id: string; createdAt: Date; userId: string; organizationId: string; role: string; teamId?: string | undefined; }[]; id: string; name: string; createdAt: Date; slug: string; logo?: string | null | undefined; } | null>; options: { method: "POST"; body: z.ZodObject<{ name: z.ZodString; slug: z.ZodString; userId: z.ZodOptional; logo: z.ZodOptional; metadata: z.ZodOptional>; keepCurrentActiveOrganization: z.ZodOptional; }, "strip", z.ZodTypeAny, { name: string; slug: string; metadata?: Record | undefined; userId?: string | undefined; logo?: string | undefined; keepCurrentActiveOrganization?: boolean | undefined; }, { name: string; slug: string; metadata?: Record | undefined; userId?: string | undefined; logo?: string | undefined; keepCurrentActiveOrganization?: boolean | undefined; }>; use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>)[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; description: string; $ref: string; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/organization/create"; }; updateOrganization: { >; slug: z.ZodOptional>; logo: z.ZodOptional>; metadata: z.ZodOptional>>; }, "strip", z.ZodTypeAny, { metadata?: Record | undefined; name?: string | undefined; slug?: string | undefined; logo?: string | undefined; }, { metadata?: Record | undefined; name?: string | undefined; slug?: string | undefined; logo?: string | undefined; }>; organizationId: z.ZodOptional; }, "strip", z.ZodTypeAny, { data: { metadata?: Record | undefined; name?: string | undefined; slug?: string | undefined; logo?: string | undefined; }; organizationId?: string | undefined; }, { data: { metadata?: Record | undefined; name?: string | undefined; slug?: string | undefined; logo?: string | undefined; }; organizationId?: string | undefined; }>; requireHeaders: true; use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>)[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; description: string; $ref: string; }; }; }; }; }; }; }; } & { use: any[]; }>]>(...inputCtx: C): Promise | undefined; id: string; name: string; createdAt: Date; slug: string; logo?: string | null | undefined; } | null; } : { metadata: Record | undefined; id: string; name: string; createdAt: Date; slug: string; logo?: string | null | undefined; } | null>; options: { method: "POST"; body: z.ZodObject<{ data: z.ZodObject<{ name: z.ZodOptional>; slug: z.ZodOptional>; logo: z.ZodOptional>; metadata: z.ZodOptional>>; }, "strip", z.ZodTypeAny, { metadata?: Record | undefined; name?: string | undefined; slug?: string | undefined; logo?: string | undefined; }, { metadata?: Record | undefined; name?: string | undefined; slug?: string | undefined; logo?: string | undefined; }>; organizationId: z.ZodOptional; }, "strip", z.ZodTypeAny, { data: { metadata?: Record | undefined; name?: string | undefined; slug?: string | undefined; logo?: string | undefined; }; organizationId?: string | undefined; }, { data: { metadata?: Record | undefined; name?: string | undefined; slug?: string | undefined; logo?: string | undefined; }; organizationId?: string | undefined; }>; requireHeaders: true; use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>)[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; description: string; $ref: string; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/organization/update"; }; deleteOrganization: { ; requireHeaders: true; use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>)[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "string"; description: string; }; }; }; }; }; }; }; } & { use: any[]; }>]>(...inputCtx: C): Promise; options: { method: "POST"; body: z.ZodObject<{ organizationId: z.ZodString; }, "strip", z.ZodTypeAny, { organizationId: string; }, { organizationId: string; }>; requireHeaders: true; use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>)[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "string"; description: string; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/organization/delete"; }; setActiveOrganization: { >; organizationSlug: z.ZodOptional; }, "strip", z.ZodTypeAny, { organizationId?: string | null | undefined; organizationSlug?: string | undefined; }, { organizationId?: string | null | undefined; organizationSlug?: string | undefined; }>; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; description: string; $ref: string; }; }; }; }; }; }; }; } & { use: any[]; }>]>(...inputCtx: C): Promise[]; invitations: InferInvitation[]; teams: Team[]; } & { id: string; name: string; createdAt: Date; slug: string; metadata?: any; logo?: string | null | undefined; } & Record : { members: InferMember[]; invitations: InferInvitation[]; } & { id: string; name: string; createdAt: Date; slug: string; metadata?: any; logo?: string | null | undefined; } & Record) | null; } : (O["teams"] extends { enabled: true; } ? { members: InferMember[]; invitations: InferInvitation[]; teams: Team[]; } & { id: string; name: string; createdAt: Date; slug: string; metadata?: any; logo?: string | null | undefined; } & Record : { members: InferMember[]; invitations: InferInvitation[]; } & { id: string; name: string; createdAt: Date; slug: string; metadata?: any; logo?: string | null | undefined; } & Record) | null>; options: { method: "POST"; body: z.ZodObject<{ organizationId: z.ZodOptional>; organizationSlug: z.ZodOptional; }, "strip", z.ZodTypeAny, { organizationId?: string | null | undefined; organizationSlug?: string | undefined; }, { organizationId?: string | null | undefined; organizationSlug?: string | undefined; }>; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; description: string; $ref: string; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/organization/set-active"; }; getFullOrganization: { ; organizationSlug: z.ZodOptional; }, "strip", z.ZodTypeAny, { organizationId?: string | undefined; organizationSlug?: string | undefined; }, { organizationId?: string | undefined; organizationSlug?: string | undefined; }>>; requireHeaders: true; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; description: string; $ref: string; }; }; }; }; }; }; }; } & { use: any[]; }>]>(...inputCtx: C): Promise[]; invitations: InferInvitation[]; teams: Team[]; } & { id: string; name: string; createdAt: Date; slug: string; metadata?: any; logo?: string | null | undefined; } & Record : { members: InferMember[]; invitations: InferInvitation[]; } & { id: string; name: string; createdAt: Date; slug: string; metadata?: any; logo?: string | null | undefined; } & Record) | null; } : (O["teams"] extends { enabled: true; } ? { members: InferMember[]; invitations: InferInvitation[]; teams: Team[]; } & { id: string; name: string; createdAt: Date; slug: string; metadata?: any; logo?: string | null | undefined; } & Record : { members: InferMember[]; invitations: InferInvitation[]; } & { id: string; name: string; createdAt: Date; slug: string; metadata?: any; logo?: string | null | undefined; } & Record) | null>; options: { method: "GET"; query: z.ZodOptional; organizationSlug: z.ZodOptional; }, "strip", z.ZodTypeAny, { organizationId?: string | undefined; organizationSlug?: string | undefined; }, { organizationId?: string | undefined; organizationSlug?: string | undefined; }>>; requireHeaders: true; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; description: string; $ref: string; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/organization/get-full-organization"; }; listOrganizations: { ) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "array"; items: { $ref: string; }; }; }; }; }; }; }; }; } & { use: any[]; }> | undefined)?]>(...inputCtx: C): Promise; options: { method: "GET"; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "array"; items: { $ref: string; }; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/organization/list"; }; createInvitation: { ) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; body: z.ZodObject<{ email: z.ZodString; role: z.ZodUnion<[z.ZodString, z.ZodArray]>; organizationId: z.ZodOptional; resend: z.ZodOptional; teamId: z.ZodOptional; }, "strip", z.ZodTypeAny, { email: string; role: string | string[]; organizationId?: string | undefined; teamId?: string | undefined; resend?: boolean | undefined; }, { email: string; role: string | string[]; organizationId?: string | undefined; teamId?: string | undefined; resend?: boolean | undefined; }>; metadata: { $Infer: { body: { email: string; role: InferRolesFromOption | InferRolesFromOption[]; organizationId?: string; resend?: boolean; } & (O extends { teams: { enabled: true; }; } ? { teamId?: string; } : {}); }; openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { id: { type: string; }; email: { type: string; }; role: { type: string; }; organizationId: { type: string; }; inviterId: { type: string; }; status: { type: string; }; expiresAt: { type: string; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }>> extends true ? [better_call.InputContext<"/organization/invite-member", { method: "POST"; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; body: z.ZodObject<{ email: z.ZodString; role: z.ZodUnion<[z.ZodString, z.ZodArray]>; organizationId: z.ZodOptional; resend: z.ZodOptional; teamId: z.ZodOptional; }, "strip", z.ZodTypeAny, { email: string; role: string | string[]; organizationId?: string | undefined; teamId?: string | undefined; resend?: boolean | undefined; }, { email: string; role: string | string[]; organizationId?: string | undefined; teamId?: string | undefined; resend?: boolean | undefined; }>; metadata: { $Infer: { body: { email: string; role: InferRolesFromOption | InferRolesFromOption[]; organizationId?: string; resend?: boolean; } & (O extends { teams: { enabled: true; }; } ? { teamId?: string; } : {}); }; openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { id: { type: string; }; email: { type: string; }; role: { type: string; }; organizationId: { type: string; }; inviterId: { type: string; }; status: { type: string; }; expiresAt: { type: string; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }>] : [(better_call.InputContext<"/organization/invite-member", { method: "POST"; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; body: z.ZodObject<{ email: z.ZodString; role: z.ZodUnion<[z.ZodString, z.ZodArray]>; organizationId: z.ZodOptional; resend: z.ZodOptional; teamId: z.ZodOptional; }, "strip", z.ZodTypeAny, { email: string; role: string | string[]; organizationId?: string | undefined; teamId?: string | undefined; resend?: boolean | undefined; }, { email: string; role: string | string[]; organizationId?: string | undefined; teamId?: string | undefined; resend?: boolean | undefined; }>; metadata: { $Infer: { body: { email: string; role: InferRolesFromOption | InferRolesFromOption[]; organizationId?: string; resend?: boolean; } & (O extends { teams: { enabled: true; }; } ? { teamId?: string; } : {}); }; openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { id: { type: string; }; email: { type: string; }; role: { type: string; }; organizationId: { type: string; }; inviterId: { type: string; }; status: { type: string; }; expiresAt: { type: string; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }> | undefined)?]>(...inputCtx: C): Promise; options: { method: "POST"; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; body: z.ZodObject<{ email: z.ZodString; role: z.ZodUnion<[z.ZodString, z.ZodArray]>; organizationId: z.ZodOptional; resend: z.ZodOptional; teamId: z.ZodOptional; }, "strip", z.ZodTypeAny, { email: string; role: string | string[]; organizationId?: string | undefined; teamId?: string | undefined; resend?: boolean | undefined; }, { email: string; role: string | string[]; organizationId?: string | undefined; teamId?: string | undefined; resend?: boolean | undefined; }>; metadata: { $Infer: { body: { email: string; role: InferRolesFromOption | InferRolesFromOption[]; organizationId?: string; resend?: boolean; } & (O extends { teams: { enabled: true; }; } ? { teamId?: string; } : {}); }; openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { id: { type: string; }; email: { type: string; }; role: { type: string; }; organizationId: { type: string; }; inviterId: { type: string; }; status: { type: string; }; expiresAt: { type: string; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/organization/invite-member"; }; cancelInvitation: { ; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: string; properties: { invitation: { type: string; }; }; }; }; }; }; }; }; } & { use: any[]; }>]>(...inputCtx: C): Promise; options: { method: "POST"; body: z.ZodObject<{ invitationId: z.ZodString; }, "strip", z.ZodTypeAny, { invitationId: string; }, { invitationId: string; }>; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: string; properties: { invitation: { type: string; }; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/organization/cancel-invitation"; }; acceptInvitation: { ; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { invitation: { type: string; }; member: { type: string; }; }; }; }; }; }; }; }; }; } & { use: any[]; }>]>(...inputCtx: C): Promise; options: { method: "POST"; body: z.ZodObject<{ invitationId: z.ZodString; }, "strip", z.ZodTypeAny, { invitationId: string; }, { invitationId: string; }>; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { invitation: { type: string; }; member: { type: string; }; }; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/organization/accept-invitation"; }; getInvitation: { ) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>)[]; requireHeaders: true; query: z.ZodObject<{ id: z.ZodString; }, "strip", z.ZodTypeAny, { id: string; }, { id: string; }>; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { id: { type: string; }; email: { type: string; }; role: { type: string; }; organizationId: { type: string; }; inviterId: { type: string; }; status: { type: string; }; expiresAt: { type: string; }; organizationName: { type: string; }; organizationSlug: { type: string; }; inviterEmail: { type: string; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }>]>(...inputCtx: C): Promise; options: { method: "GET"; use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>)[]; requireHeaders: true; query: z.ZodObject<{ id: z.ZodString; }, "strip", z.ZodTypeAny, { id: string; }, { id: string; }>; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { id: { type: string; }; email: { type: string; }; role: { type: string; }; organizationId: { type: string; }; inviterId: { type: string; }; status: { type: string; }; expiresAt: { type: string; }; organizationName: { type: string; }; organizationSlug: { type: string; }; inviterEmail: { type: string; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/organization/get-invitation"; }; rejectInvitation: { ; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { invitation: { type: string; }; member: { type: string; }; }; }; }; }; }; }; }; }; } & { use: any[]; }>]>(...inputCtx: C): Promise; options: { method: "POST"; body: z.ZodObject<{ invitationId: z.ZodString; }, "strip", z.ZodTypeAny, { invitationId: string; }, { invitationId: string; }>; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { invitation: { type: string; }; member: { type: string; }; }; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/organization/reject-invitation"; }; checkOrganizationSlug: { ; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; } | null; }>) | ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>))[]; } & { use: any[]; }>]>(...inputCtx: C): Promise; options: { method: "POST"; body: z.ZodObject<{ slug: z.ZodString; }, "strip", z.ZodTypeAny, { slug: string; }, { slug: string; }>; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; } | null; }>) | ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>))[]; } & { use: any[]; }; path: "/organization/check-slug"; }; addMember: { ]>; organizationId: z.ZodOptional; }, "strip", z.ZodTypeAny, { userId: string; role: string | string[]; organizationId?: string | undefined; }, { userId: string; role: string | string[]; organizationId?: string | undefined; }>; use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>)[]; metadata: { SERVER_ONLY: true; $Infer: { body: { userId: string; role: InferRolesFromOption | InferRolesFromOption[]; organizationId?: string; } & (O extends { teams: { enabled: true; }; } ? { teamId?: string; } : {}); }; }; } & { use: any[]; }>> extends true ? [better_call.InputContext<"/organization/add-member", { method: "POST"; body: z.ZodObject<{ userId: z.ZodString; role: z.ZodUnion<[z.ZodString, z.ZodArray]>; organizationId: z.ZodOptional; }, "strip", z.ZodTypeAny, { userId: string; role: string | string[]; organizationId?: string | undefined; }, { userId: string; role: string | string[]; organizationId?: string | undefined; }>; use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>)[]; metadata: { SERVER_ONLY: true; $Infer: { body: { userId: string; role: InferRolesFromOption | InferRolesFromOption[]; organizationId?: string; } & (O extends { teams: { enabled: true; }; } ? { teamId?: string; } : {}); }; }; } & { use: any[]; }>] : [(better_call.InputContext<"/organization/add-member", { method: "POST"; body: z.ZodObject<{ userId: z.ZodString; role: z.ZodUnion<[z.ZodString, z.ZodArray]>; organizationId: z.ZodOptional; }, "strip", z.ZodTypeAny, { userId: string; role: string | string[]; organizationId?: string | undefined; }, { userId: string; role: string | string[]; organizationId?: string | undefined; }>; use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>)[]; metadata: { SERVER_ONLY: true; $Infer: { body: { userId: string; role: InferRolesFromOption | InferRolesFromOption[]; organizationId?: string; } & (O extends { teams: { enabled: true; }; } ? { teamId?: string; } : {}); }; }; } & { use: any[]; }> | undefined)?]>(...inputCtx: C): Promise; options: { method: "POST"; body: z.ZodObject<{ userId: z.ZodString; role: z.ZodUnion<[z.ZodString, z.ZodArray]>; organizationId: z.ZodOptional; }, "strip", z.ZodTypeAny, { userId: string; role: string | string[]; organizationId?: string | undefined; }, { userId: string; role: string | string[]; organizationId?: string | undefined; }>; use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>)[]; metadata: { SERVER_ONLY: true; $Infer: { body: { userId: string; role: InferRolesFromOption | InferRolesFromOption[]; organizationId?: string; } & (O extends { teams: { enabled: true; }; } ? { teamId?: string; } : {}); }; }; } & { use: any[]; }; path: "/organization/add-member"; }; removeMember: { ; }, "strip", z.ZodTypeAny, { memberIdOrEmail: string; organizationId?: string | undefined; }, { memberIdOrEmail: string; organizationId?: string | undefined; }>; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { member: { type: string; properties: { id: { type: string; }; userId: { type: string; }; organizationId: { type: string; }; role: { type: string; }; }; required: string[]; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }>]>(...inputCtx: C): Promise; options: { method: "POST"; body: z.ZodObject<{ memberIdOrEmail: z.ZodString; organizationId: z.ZodOptional; }, "strip", z.ZodTypeAny, { memberIdOrEmail: string; organizationId?: string | undefined; }, { memberIdOrEmail: string; organizationId?: string | undefined; }>; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { member: { type: string; properties: { id: { type: string; }; userId: { type: string; }; organizationId: { type: string; }; role: { type: string; }; }; required: string[]; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/organization/remove-member"; }; updateMemberRole: { ]>; memberId: z.ZodString; organizationId: z.ZodOptional; }, "strip", z.ZodTypeAny, { role: string | string[]; memberId: string; organizationId?: string | undefined; }, { role: string | string[]; memberId: string; organizationId?: string | undefined; }>; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; metadata: { $Infer: { body: { role: InferRolesFromOption | InferRolesFromOption[]; memberId: string; organizationId?: string; }; }; openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { member: { type: string; properties: { id: { type: string; }; userId: { type: string; }; organizationId: { type: string; }; role: { type: string; }; }; required: string[]; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }>]>(...inputCtx: C): Promise; options: { method: "POST"; body: z.ZodObject<{ role: z.ZodUnion<[z.ZodString, z.ZodArray]>; memberId: z.ZodString; organizationId: z.ZodOptional; }, "strip", z.ZodTypeAny, { role: string | string[]; memberId: string; organizationId?: string | undefined; }, { role: string | string[]; memberId: string; organizationId?: string | undefined; }>; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; metadata: { $Infer: { body: { role: InferRolesFromOption | InferRolesFromOption[]; memberId: string; organizationId?: string; }; }; openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { member: { type: string; properties: { id: { type: string; }; userId: { type: string; }; organizationId: { type: string; }; role: { type: string; }; }; required: string[]; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/organization/update-member-role"; }; getActiveMember: { ) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { id: { type: string; }; userId: { type: string; }; organizationId: { type: string; }; role: { type: string; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }> | undefined)?]>(...inputCtx: C): Promise; options: { method: "GET"; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { id: { type: string; }; userId: { type: string; }; organizationId: { type: string; }; role: { type: string; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/organization/get-active-member"; }; leaveOrganization: { ; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>) | ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>))[]; } & { use: any[]; }>]>(...inputCtx: C): Promise; options: { method: "POST"; body: z.ZodObject<{ organizationId: z.ZodString; }, "strip", z.ZodTypeAny, { organizationId: string; }, { organizationId: string; }>; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>) | ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>))[]; } & { use: any[]; }; path: "/organization/leave"; }; } : { createOrganization: { ; logo: z.ZodOptional; metadata: z.ZodOptional>; keepCurrentActiveOrganization: z.ZodOptional; }, "strip", z.ZodTypeAny, { name: string; slug: string; metadata?: Record | undefined; userId?: string | undefined; logo?: string | undefined; keepCurrentActiveOrganization?: boolean | undefined; }, { name: string; slug: string; metadata?: Record | undefined; userId?: string | undefined; logo?: string | undefined; keepCurrentActiveOrganization?: boolean | undefined; }>; use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>)[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; description: string; $ref: string; }; }; }; }; }; }; }; } & { use: any[]; }>]>(...inputCtx: C): Promise | undefined; members: { id: string; createdAt: Date; userId: string; organizationId: string; role: string; teamId?: string | undefined; }[]; id: string; name: string; createdAt: Date; slug: string; logo?: string | null | undefined; } | null; } : { metadata: Record | undefined; members: { id: string; createdAt: Date; userId: string; organizationId: string; role: string; teamId?: string | undefined; }[]; id: string; name: string; createdAt: Date; slug: string; logo?: string | null | undefined; } | null>; options: { method: "POST"; body: z.ZodObject<{ name: z.ZodString; slug: z.ZodString; userId: z.ZodOptional; logo: z.ZodOptional; metadata: z.ZodOptional>; keepCurrentActiveOrganization: z.ZodOptional; }, "strip", z.ZodTypeAny, { name: string; slug: string; metadata?: Record | undefined; userId?: string | undefined; logo?: string | undefined; keepCurrentActiveOrganization?: boolean | undefined; }, { name: string; slug: string; metadata?: Record | undefined; userId?: string | undefined; logo?: string | undefined; keepCurrentActiveOrganization?: boolean | undefined; }>; use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>)[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; description: string; $ref: string; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/organization/create"; }; updateOrganization: { >; slug: z.ZodOptional>; logo: z.ZodOptional>; metadata: z.ZodOptional>>; }, "strip", z.ZodTypeAny, { metadata?: Record | undefined; name?: string | undefined; slug?: string | undefined; logo?: string | undefined; }, { metadata?: Record | undefined; name?: string | undefined; slug?: string | undefined; logo?: string | undefined; }>; organizationId: z.ZodOptional; }, "strip", z.ZodTypeAny, { data: { metadata?: Record | undefined; name?: string | undefined; slug?: string | undefined; logo?: string | undefined; }; organizationId?: string | undefined; }, { data: { metadata?: Record | undefined; name?: string | undefined; slug?: string | undefined; logo?: string | undefined; }; organizationId?: string | undefined; }>; requireHeaders: true; use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>)[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; description: string; $ref: string; }; }; }; }; }; }; }; } & { use: any[]; }>]>(...inputCtx: C): Promise | undefined; id: string; name: string; createdAt: Date; slug: string; logo?: string | null | undefined; } | null; } : { metadata: Record | undefined; id: string; name: string; createdAt: Date; slug: string; logo?: string | null | undefined; } | null>; options: { method: "POST"; body: z.ZodObject<{ data: z.ZodObject<{ name: z.ZodOptional>; slug: z.ZodOptional>; logo: z.ZodOptional>; metadata: z.ZodOptional>>; }, "strip", z.ZodTypeAny, { metadata?: Record | undefined; name?: string | undefined; slug?: string | undefined; logo?: string | undefined; }, { metadata?: Record | undefined; name?: string | undefined; slug?: string | undefined; logo?: string | undefined; }>; organizationId: z.ZodOptional; }, "strip", z.ZodTypeAny, { data: { metadata?: Record | undefined; name?: string | undefined; slug?: string | undefined; logo?: string | undefined; }; organizationId?: string | undefined; }, { data: { metadata?: Record | undefined; name?: string | undefined; slug?: string | undefined; logo?: string | undefined; }; organizationId?: string | undefined; }>; requireHeaders: true; use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>)[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; description: string; $ref: string; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/organization/update"; }; deleteOrganization: { ; requireHeaders: true; use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>)[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "string"; description: string; }; }; }; }; }; }; }; } & { use: any[]; }>]>(...inputCtx: C): Promise; options: { method: "POST"; body: z.ZodObject<{ organizationId: z.ZodString; }, "strip", z.ZodTypeAny, { organizationId: string; }, { organizationId: string; }>; requireHeaders: true; use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>)[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "string"; description: string; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/organization/delete"; }; setActiveOrganization: { >; organizationSlug: z.ZodOptional; }, "strip", z.ZodTypeAny, { organizationId?: string | null | undefined; organizationSlug?: string | undefined; }, { organizationId?: string | null | undefined; organizationSlug?: string | undefined; }>; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; description: string; $ref: string; }; }; }; }; }; }; }; } & { use: any[]; }>]>(...inputCtx: C): Promise[]; invitations: InferInvitation[]; teams: Team[]; } & { id: string; name: string; createdAt: Date; slug: string; metadata?: any; logo?: string | null | undefined; } & Record : { members: InferMember[]; invitations: InferInvitation[]; } & { id: string; name: string; createdAt: Date; slug: string; metadata?: any; logo?: string | null | undefined; } & Record) | null; } : (O["teams"] extends { enabled: true; } ? { members: InferMember[]; invitations: InferInvitation[]; teams: Team[]; } & { id: string; name: string; createdAt: Date; slug: string; metadata?: any; logo?: string | null | undefined; } & Record : { members: InferMember[]; invitations: InferInvitation[]; } & { id: string; name: string; createdAt: Date; slug: string; metadata?: any; logo?: string | null | undefined; } & Record) | null>; options: { method: "POST"; body: z.ZodObject<{ organizationId: z.ZodOptional>; organizationSlug: z.ZodOptional; }, "strip", z.ZodTypeAny, { organizationId?: string | null | undefined; organizationSlug?: string | undefined; }, { organizationId?: string | null | undefined; organizationSlug?: string | undefined; }>; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; description: string; $ref: string; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/organization/set-active"; }; getFullOrganization: { ; organizationSlug: z.ZodOptional; }, "strip", z.ZodTypeAny, { organizationId?: string | undefined; organizationSlug?: string | undefined; }, { organizationId?: string | undefined; organizationSlug?: string | undefined; }>>; requireHeaders: true; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; description: string; $ref: string; }; }; }; }; }; }; }; } & { use: any[]; }>]>(...inputCtx: C): Promise[]; invitations: InferInvitation[]; teams: Team[]; } & { id: string; name: string; createdAt: Date; slug: string; metadata?: any; logo?: string | null | undefined; } & Record : { members: InferMember[]; invitations: InferInvitation[]; } & { id: string; name: string; createdAt: Date; slug: string; metadata?: any; logo?: string | null | undefined; } & Record) | null; } : (O["teams"] extends { enabled: true; } ? { members: InferMember[]; invitations: InferInvitation[]; teams: Team[]; } & { id: string; name: string; createdAt: Date; slug: string; metadata?: any; logo?: string | null | undefined; } & Record : { members: InferMember[]; invitations: InferInvitation[]; } & { id: string; name: string; createdAt: Date; slug: string; metadata?: any; logo?: string | null | undefined; } & Record) | null>; options: { method: "GET"; query: z.ZodOptional; organizationSlug: z.ZodOptional; }, "strip", z.ZodTypeAny, { organizationId?: string | undefined; organizationSlug?: string | undefined; }, { organizationId?: string | undefined; organizationSlug?: string | undefined; }>>; requireHeaders: true; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; description: string; $ref: string; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/organization/get-full-organization"; }; listOrganizations: { ) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "array"; items: { $ref: string; }; }; }; }; }; }; }; }; } & { use: any[]; }> | undefined)?]>(...inputCtx: C): Promise; options: { method: "GET"; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "array"; items: { $ref: string; }; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/organization/list"; }; createInvitation: { ) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; body: z.ZodObject<{ email: z.ZodString; role: z.ZodUnion<[z.ZodString, z.ZodArray]>; organizationId: z.ZodOptional; resend: z.ZodOptional; teamId: z.ZodOptional; }, "strip", z.ZodTypeAny, { email: string; role: string | string[]; organizationId?: string | undefined; teamId?: string | undefined; resend?: boolean | undefined; }, { email: string; role: string | string[]; organizationId?: string | undefined; teamId?: string | undefined; resend?: boolean | undefined; }>; metadata: { $Infer: { body: { email: string; role: InferRolesFromOption | InferRolesFromOption[]; organizationId?: string; resend?: boolean; } & (O extends { teams: { enabled: true; }; } ? { teamId?: string; } : {}); }; openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { id: { type: string; }; email: { type: string; }; role: { type: string; }; organizationId: { type: string; }; inviterId: { type: string; }; status: { type: string; }; expiresAt: { type: string; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }>> extends true ? [better_call.InputContext<"/organization/invite-member", { method: "POST"; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; body: z.ZodObject<{ email: z.ZodString; role: z.ZodUnion<[z.ZodString, z.ZodArray]>; organizationId: z.ZodOptional; resend: z.ZodOptional; teamId: z.ZodOptional; }, "strip", z.ZodTypeAny, { email: string; role: string | string[]; organizationId?: string | undefined; teamId?: string | undefined; resend?: boolean | undefined; }, { email: string; role: string | string[]; organizationId?: string | undefined; teamId?: string | undefined; resend?: boolean | undefined; }>; metadata: { $Infer: { body: { email: string; role: InferRolesFromOption | InferRolesFromOption[]; organizationId?: string; resend?: boolean; } & (O extends { teams: { enabled: true; }; } ? { teamId?: string; } : {}); }; openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { id: { type: string; }; email: { type: string; }; role: { type: string; }; organizationId: { type: string; }; inviterId: { type: string; }; status: { type: string; }; expiresAt: { type: string; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }>] : [(better_call.InputContext<"/organization/invite-member", { method: "POST"; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; body: z.ZodObject<{ email: z.ZodString; role: z.ZodUnion<[z.ZodString, z.ZodArray]>; organizationId: z.ZodOptional; resend: z.ZodOptional; teamId: z.ZodOptional; }, "strip", z.ZodTypeAny, { email: string; role: string | string[]; organizationId?: string | undefined; teamId?: string | undefined; resend?: boolean | undefined; }, { email: string; role: string | string[]; organizationId?: string | undefined; teamId?: string | undefined; resend?: boolean | undefined; }>; metadata: { $Infer: { body: { email: string; role: InferRolesFromOption | InferRolesFromOption[]; organizationId?: string; resend?: boolean; } & (O extends { teams: { enabled: true; }; } ? { teamId?: string; } : {}); }; openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { id: { type: string; }; email: { type: string; }; role: { type: string; }; organizationId: { type: string; }; inviterId: { type: string; }; status: { type: string; }; expiresAt: { type: string; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }> | undefined)?]>(...inputCtx: C): Promise; options: { method: "POST"; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; body: z.ZodObject<{ email: z.ZodString; role: z.ZodUnion<[z.ZodString, z.ZodArray]>; organizationId: z.ZodOptional; resend: z.ZodOptional; teamId: z.ZodOptional; }, "strip", z.ZodTypeAny, { email: string; role: string | string[]; organizationId?: string | undefined; teamId?: string | undefined; resend?: boolean | undefined; }, { email: string; role: string | string[]; organizationId?: string | undefined; teamId?: string | undefined; resend?: boolean | undefined; }>; metadata: { $Infer: { body: { email: string; role: InferRolesFromOption | InferRolesFromOption[]; organizationId?: string; resend?: boolean; } & (O extends { teams: { enabled: true; }; } ? { teamId?: string; } : {}); }; openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { id: { type: string; }; email: { type: string; }; role: { type: string; }; organizationId: { type: string; }; inviterId: { type: string; }; status: { type: string; }; expiresAt: { type: string; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/organization/invite-member"; }; cancelInvitation: { ; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: string; properties: { invitation: { type: string; }; }; }; }; }; }; }; }; } & { use: any[]; }>]>(...inputCtx: C): Promise; options: { method: "POST"; body: z.ZodObject<{ invitationId: z.ZodString; }, "strip", z.ZodTypeAny, { invitationId: string; }, { invitationId: string; }>; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: string; properties: { invitation: { type: string; }; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/organization/cancel-invitation"; }; acceptInvitation: { ; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { invitation: { type: string; }; member: { type: string; }; }; }; }; }; }; }; }; }; } & { use: any[]; }>]>(...inputCtx: C): Promise; options: { method: "POST"; body: z.ZodObject<{ invitationId: z.ZodString; }, "strip", z.ZodTypeAny, { invitationId: string; }, { invitationId: string; }>; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { invitation: { type: string; }; member: { type: string; }; }; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/organization/accept-invitation"; }; getInvitation: { ) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>)[]; requireHeaders: true; query: z.ZodObject<{ id: z.ZodString; }, "strip", z.ZodTypeAny, { id: string; }, { id: string; }>; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { id: { type: string; }; email: { type: string; }; role: { type: string; }; organizationId: { type: string; }; inviterId: { type: string; }; status: { type: string; }; expiresAt: { type: string; }; organizationName: { type: string; }; organizationSlug: { type: string; }; inviterEmail: { type: string; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }>]>(...inputCtx: C): Promise; options: { method: "GET"; use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>)[]; requireHeaders: true; query: z.ZodObject<{ id: z.ZodString; }, "strip", z.ZodTypeAny, { id: string; }, { id: string; }>; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { id: { type: string; }; email: { type: string; }; role: { type: string; }; organizationId: { type: string; }; inviterId: { type: string; }; status: { type: string; }; expiresAt: { type: string; }; organizationName: { type: string; }; organizationSlug: { type: string; }; inviterEmail: { type: string; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/organization/get-invitation"; }; rejectInvitation: { ; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { invitation: { type: string; }; member: { type: string; }; }; }; }; }; }; }; }; }; } & { use: any[]; }>]>(...inputCtx: C): Promise; options: { method: "POST"; body: z.ZodObject<{ invitationId: z.ZodString; }, "strip", z.ZodTypeAny, { invitationId: string; }, { invitationId: string; }>; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { invitation: { type: string; }; member: { type: string; }; }; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/organization/reject-invitation"; }; checkOrganizationSlug: { ; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; } | null; }>) | ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>))[]; } & { use: any[]; }>]>(...inputCtx: C): Promise; options: { method: "POST"; body: z.ZodObject<{ slug: z.ZodString; }, "strip", z.ZodTypeAny, { slug: string; }, { slug: string; }>; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; } | null; }>) | ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>))[]; } & { use: any[]; }; path: "/organization/check-slug"; }; addMember: { ]>; organizationId: z.ZodOptional; }, "strip", z.ZodTypeAny, { userId: string; role: string | string[]; organizationId?: string | undefined; }, { userId: string; role: string | string[]; organizationId?: string | undefined; }>; use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>)[]; metadata: { SERVER_ONLY: true; $Infer: { body: { userId: string; role: InferRolesFromOption | InferRolesFromOption[]; organizationId?: string; } & (O extends { teams: { enabled: true; }; } ? { teamId?: string; } : {}); }; }; } & { use: any[]; }>> extends true ? [better_call.InputContext<"/organization/add-member", { method: "POST"; body: z.ZodObject<{ userId: z.ZodString; role: z.ZodUnion<[z.ZodString, z.ZodArray]>; organizationId: z.ZodOptional; }, "strip", z.ZodTypeAny, { userId: string; role: string | string[]; organizationId?: string | undefined; }, { userId: string; role: string | string[]; organizationId?: string | undefined; }>; use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>)[]; metadata: { SERVER_ONLY: true; $Infer: { body: { userId: string; role: InferRolesFromOption | InferRolesFromOption[]; organizationId?: string; } & (O extends { teams: { enabled: true; }; } ? { teamId?: string; } : {}); }; }; } & { use: any[]; }>] : [(better_call.InputContext<"/organization/add-member", { method: "POST"; body: z.ZodObject<{ userId: z.ZodString; role: z.ZodUnion<[z.ZodString, z.ZodArray]>; organizationId: z.ZodOptional; }, "strip", z.ZodTypeAny, { userId: string; role: string | string[]; organizationId?: string | undefined; }, { userId: string; role: string | string[]; organizationId?: string | undefined; }>; use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>)[]; metadata: { SERVER_ONLY: true; $Infer: { body: { userId: string; role: InferRolesFromOption | InferRolesFromOption[]; organizationId?: string; } & (O extends { teams: { enabled: true; }; } ? { teamId?: string; } : {}); }; }; } & { use: any[]; }> | undefined)?]>(...inputCtx: C): Promise; options: { method: "POST"; body: z.ZodObject<{ userId: z.ZodString; role: z.ZodUnion<[z.ZodString, z.ZodArray]>; organizationId: z.ZodOptional; }, "strip", z.ZodTypeAny, { userId: string; role: string | string[]; organizationId?: string | undefined; }, { userId: string; role: string | string[]; organizationId?: string | undefined; }>; use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>)[]; metadata: { SERVER_ONLY: true; $Infer: { body: { userId: string; role: InferRolesFromOption | InferRolesFromOption[]; organizationId?: string; } & (O extends { teams: { enabled: true; }; } ? { teamId?: string; } : {}); }; }; } & { use: any[]; }; path: "/organization/add-member"; }; removeMember: { ; }, "strip", z.ZodTypeAny, { memberIdOrEmail: string; organizationId?: string | undefined; }, { memberIdOrEmail: string; organizationId?: string | undefined; }>; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { member: { type: string; properties: { id: { type: string; }; userId: { type: string; }; organizationId: { type: string; }; role: { type: string; }; }; required: string[]; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }>]>(...inputCtx: C): Promise; options: { method: "POST"; body: z.ZodObject<{ memberIdOrEmail: z.ZodString; organizationId: z.ZodOptional; }, "strip", z.ZodTypeAny, { memberIdOrEmail: string; organizationId?: string | undefined; }, { memberIdOrEmail: string; organizationId?: string | undefined; }>; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { member: { type: string; properties: { id: { type: string; }; userId: { type: string; }; organizationId: { type: string; }; role: { type: string; }; }; required: string[]; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/organization/remove-member"; }; updateMemberRole: { ]>; memberId: z.ZodString; organizationId: z.ZodOptional; }, "strip", z.ZodTypeAny, { role: string | string[]; memberId: string; organizationId?: string | undefined; }, { role: string | string[]; memberId: string; organizationId?: string | undefined; }>; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; metadata: { $Infer: { body: { role: InferRolesFromOption | InferRolesFromOption[]; memberId: string; organizationId?: string; }; }; openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { member: { type: string; properties: { id: { type: string; }; userId: { type: string; }; organizationId: { type: string; }; role: { type: string; }; }; required: string[]; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }>]>(...inputCtx: C): Promise; options: { method: "POST"; body: z.ZodObject<{ role: z.ZodUnion<[z.ZodString, z.ZodArray]>; memberId: z.ZodString; organizationId: z.ZodOptional; }, "strip", z.ZodTypeAny, { role: string | string[]; memberId: string; organizationId?: string | undefined; }, { role: string | string[]; memberId: string; organizationId?: string | undefined; }>; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; metadata: { $Infer: { body: { role: InferRolesFromOption | InferRolesFromOption[]; memberId: string; organizationId?: string; }; }; openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { member: { type: string; properties: { id: { type: string; }; userId: { type: string; }; organizationId: { type: string; }; role: { type: string; }; }; required: string[]; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/organization/update-member-role"; }; getActiveMember: { ) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { id: { type: string; }; userId: { type: string; }; organizationId: { type: string; }; role: { type: string; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }> | undefined)?]>(...inputCtx: C): Promise; options: { method: "GET"; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>) | ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>))[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { id: { type: string; }; userId: { type: string; }; organizationId: { type: string; }; role: { type: string; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/organization/get-active-member"; }; leaveOrganization: { ; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>) | ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>))[]; } & { use: any[]; }>]>(...inputCtx: C): Promise; options: { method: "POST"; body: z.ZodObject<{ organizationId: z.ZodString; }, "strip", z.ZodTypeAny, { organizationId: string; }, { organizationId: string; }>; use: (((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>) | ((inputContext: better_call.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: GenericEndpointContext) => Promise<{ session: Session & { activeOrganizationId?: string; }; user: User; }>; }>))[]; } & { use: any[]; }; path: "/organization/leave"; }; }) & { hasPermission: { ; permission: z.ZodRecord>; }, "strip", z.ZodTypeAny, { permission: Record; organizationId?: string | undefined; }, { permission: Record; organizationId?: string | undefined; }>; use: ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>)[]; metadata: { $Infer: { body: { permission: { [key in keyof (O["ac"] extends AccessControl ? S : { readonly organization: readonly ["update", "delete"]; readonly member: readonly ["create", "update", "delete"]; readonly invitation: readonly ["create", "cancel"]; readonly team: readonly ["create", "update", "delete"]; })]?: Array<(O["ac"] extends AccessControl ? S : { readonly organization: readonly ["update", "delete"]; readonly member: readonly ["create", "update", "delete"]; readonly invitation: readonly ["create", "cancel"]; readonly team: readonly ["create", "update", "delete"]; })[key][number]>; }; organizationId?: string; }; }; openapi: { description: string; requestBody: { content: { "application/json": { schema: { type: "object"; properties: { permission: { type: string; description: string; }; }; required: string[]; }; }; }; }; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { error: { type: string; }; success: { type: string; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }>]>(...inputCtx: C): Promise; options: { method: "POST"; requireHeaders: true; body: z.ZodObject<{ organizationId: z.ZodOptional; permission: z.ZodRecord>; }, "strip", z.ZodTypeAny, { permission: Record; organizationId?: string | undefined; }, { permission: Record; organizationId?: string | undefined; }>; use: ((inputContext: better_call.MiddlewareInputContext<{ use: ((inputContext: better_call.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; }>) => Promise<{ session: { session: Session & { activeOrganizationId?: string; }; user: User; }; }>)[]; metadata: { $Infer: { body: { permission: { [key in keyof (O["ac"] extends AccessControl ? S : { readonly organization: readonly ["update", "delete"]; readonly member: readonly ["create", "update", "delete"]; readonly invitation: readonly ["create", "cancel"]; readonly team: readonly ["create", "update", "delete"]; })]?: Array<(O["ac"] extends AccessControl ? S : { readonly organization: readonly ["update", "delete"]; readonly member: readonly ["create", "update", "delete"]; readonly invitation: readonly ["create", "cancel"]; readonly team: readonly ["create", "update", "delete"]; })[key][number]>; }; organizationId?: string; }; }; openapi: { description: string; requestBody: { content: { "application/json": { schema: { type: "object"; properties: { permission: { type: string; description: string; }; }; required: string[]; }; }; }; }; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { error: { type: string; }; success: { type: string; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/organization/has-permission"; }; }; schema: { team?: { modelName: string | undefined; fields: { name: { type: "string"; required: true; fieldName: string | undefined; }; organizationId: { type: "string"; required: true; references: { model: string; field: string; }; fieldName: string | undefined; }; createdAt: { type: "date"; required: true; fieldName: string | undefined; }; updatedAt: { type: "date"; required: false; fieldName: string | undefined; }; }; } | undefined; session: { fields: { activeOrganizationId: { type: "string"; required: false; fieldName: string | undefined; }; }; }; organization: { modelName: string | undefined; fields: { name: { type: "string"; required: true; sortable: true; fieldName: string | undefined; }; slug: { type: "string"; unique: true; sortable: true; fieldName: string | undefined; }; logo: { type: "string"; required: false; fieldName: string | undefined; }; createdAt: { type: "date"; required: true; fieldName: string | undefined; }; metadata: { type: "string"; required: false; fieldName: string | undefined; }; }; }; member: { modelName: string | undefined; fields: { createdAt: { type: "date"; required: true; fieldName: string | undefined; }; teamId?: { type: "string"; required: false; sortable: true; fieldName: string | undefined; } | undefined; organizationId: { type: "string"; required: true; references: { model: string; field: string; }; fieldName: string | undefined; }; userId: { type: "string"; required: true; fieldName: string | undefined; references: { model: string; field: string; }; }; role: { type: "string"; required: true; sortable: true; defaultValue: string; fieldName: string | undefined; }; }; }; invitation: { modelName: string | undefined; fields: { status: { type: "string"; required: true; sortable: true; defaultValue: string; fieldName: string | undefined; }; expiresAt: { type: "date"; required: true; fieldName: string | undefined; }; inviterId: { type: "string"; references: { model: string; field: string; }; fieldName: string | undefined; required: true; }; teamId?: { type: "string"; required: false; sortable: true; fieldName: string | undefined; } | undefined; organizationId: { type: "string"; required: true; references: { model: string; field: string; }; fieldName: string | undefined; }; email: { type: "string"; required: true; sortable: true; fieldName: string | undefined; }; role: { type: "string"; required: false; sortable: true; fieldName: string | undefined; }; }; }; }; $Infer: { Organization: Organization; Invitation: Invitation; Member: Member; Team: any; ActiveOrganization: Prettify[]; invitations: Invitation[]; }>; }; $ERROR_CODES: { readonly YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION: "You are not allowed to create a new organization"; readonly YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS: "You have reached the maximum number of organizations"; readonly ORGANIZATION_ALREADY_EXISTS: "Organization already exists"; readonly ORGANIZATION_NOT_FOUND: "Organization not found"; readonly USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION: "User is not a member of the organization"; readonly YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION: "You are not allowed to update this organization"; readonly YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION: "You are not allowed to delete this organization"; readonly NO_ACTIVE_ORGANIZATION: "No active organization"; readonly USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION: "User is already a member of this organization"; readonly MEMBER_NOT_FOUND: "Member not found"; readonly ROLE_NOT_FOUND: "Role not found"; readonly YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM: "You are not allowed to create a new team"; readonly TEAM_ALREADY_EXISTS: "Team already exists"; readonly TEAM_NOT_FOUND: "Team not found"; readonly YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER: "You cannot leave the organization as the only owner"; readonly YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER: "You are not allowed to delete this member"; readonly YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION: "You are not allowed to invite users to this organization"; readonly USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION: "User is already invited to this organization"; readonly INVITATION_NOT_FOUND: "Invitation not found"; readonly YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION: "You are not the recipient of the invitation"; readonly YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION: "You are not allowed to cancel this invitation"; readonly INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION: "Inviter is no longer a member of the organization"; readonly YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE: "you are not allowed to invite user with this role"; readonly FAILED_TO_RETRIEVE_INVITATION: "Failed to retrieve invitation"; readonly YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS: "You have reached the maximum number of teams"; readonly UNABLE_TO_REMOVE_LAST_TEAM: "Unable to remove last team"; readonly YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER: "You are not allowed to update this member"; readonly ORGANIZATION_MEMBERSHIP_LIMIT_REACHED: "Organization membership limit reached"; readonly YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION: "You are not allowed to create teams in this organization"; readonly YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION: "You are not allowed to delete teams in this organization"; readonly YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM: "You are not allowed to update this team"; }; }; export { type InferInvitation, type InferMember, type InferRolesFromOption, type InferZodRolesFromOption, type Invitation, type InvitationInput, type InvitationStatus, type Member, type MemberInput, type Organization, type OrganizationInput, type OrganizationOptions, type Team, type TeamInput, defaultRoles, invitationSchema, invitationStatus, memberSchema, organization, organizationSchema, parseRoles, role, teamSchema };