import { FieldAttributeToObject, InferAdditionalFieldsFromPluginOptions, RemoveFieldsWithReturnedFalse } from "../../../db/field.mjs"; import { Role } from "../../access/types.mjs"; import "../../index.mjs"; import "../../../db/index.mjs"; import { defaultRoles } from "../access/statement.mjs"; import { InferOrganizationRolesFromOption } from "../schema.mjs"; import { OrganizationOptions } from "../types.mjs"; import { LiteralString } from "@better-auth/core"; import * as z from "zod"; export declare const addMember: (option: O) => import("better-call").StrictEndpoint; role: z.ZodUnion]>; organizationId: z.ZodOptional; teamId: z.ZodOptional; }, z.core.$strip>; use: import("better-call").Middleware) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: import("@better-auth/core").GenericEndpointContext) => Promise<{ session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & { activeTeamId?: string | undefined; activeOrganizationId?: string | undefined; }; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }>; }>>[]; metadata: { $Infer: { body: { userId: string; role: InferOrganizationRolesFromOption | InferOrganizationRolesFromOption[]; organizationId?: string | undefined; } & (O extends { teams: { enabled: true; }; } ? { teamId?: string | undefined; } : {}) & InferAdditionalFieldsFromPluginOptions<"member", O>; }; openapi: { operationId: string; description: string; }; }; }, { id: string; organizationId: string; userId: string; role: string; createdAt: Date; } & InferAdditionalFieldsFromPluginOptions<"member", O, false>>; export declare const removeMember: (options: O) => import("better-call").StrictEndpoint<"/organization/remove-member", { method: "POST"; body: z.ZodObject<{ memberIdOrEmail: z.ZodString; organizationId: z.ZodOptional; }, z.core.$strip>; requireHeaders: true; use: (import("better-call").Middleware) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: import("@better-auth/core").GenericEndpointContext) => Promise<{ session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & { activeTeamId?: string | undefined; activeOrganizationId?: string | undefined; }; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }>; }>> | import("better-call").Middleware<{ use: import("better-call").Middleware) => 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; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>>[]; }, (inputContext: import("better-call").MiddlewareInputContext<{ use: import("better-call").Middleware) => 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; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>>[]; }>) => Promise<{ session: { session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & { activeTeamId?: string | undefined; activeOrganizationId?: string | undefined; }; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>>)[]; 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[]; }; }; }; }; }; }; }; }, { member: (O["teams"] extends { enabled: true; } ? { id: string; organizationId: string; role: InferOrganizationRolesFromOption; createdAt: Date; userId: string; teamId?: string | undefined; user: { id: string; email: string; name: string; image?: string | undefined; }; } : { id: string; organizationId: string; role: InferOrganizationRolesFromOption; createdAt: Date; userId: string; user: { id: string; email: string; name: string; image?: string | undefined; }; }) & (O["schema"] extends { member?: { additionalFields: infer Field extends Record; } | undefined; } ? FieldAttributeToObject> : {}) extends (infer T) ? { [K in keyof T]: T[K]; } : never; }>; export declare const updateMemberRole: (option: O) => import("better-call").StrictEndpoint<"/organization/update-member-role", { method: "POST"; body: z.ZodObject<{ role: z.ZodUnion]>; memberId: z.ZodString; organizationId: z.ZodOptional; }, z.core.$strip>; use: (import("better-call").Middleware) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: import("@better-auth/core").GenericEndpointContext) => Promise<{ session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & { activeTeamId?: string | undefined; activeOrganizationId?: string | undefined; }; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }>; }>> | import("better-call").Middleware<{ use: import("better-call").Middleware) => 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; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>>[]; }, (inputContext: import("better-call").MiddlewareInputContext<{ use: import("better-call").Middleware) => 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; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>>[]; }>) => Promise<{ session: { session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & { activeTeamId?: string | undefined; activeOrganizationId?: string | undefined; }; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>>)[]; requireHeaders: true; metadata: { $Infer: { body: { role: InferOrganizationRolesFromOption | InferOrganizationRolesFromOption[] | LiteralString | LiteralString[]; memberId: string; /** * If not provided, the active organization will be used */ organizationId?: string | undefined; }; }; openapi: { operationId: string; 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[]; }; }; }; }; }; }; }; }, { id: string; organizationId: string; role: "admin" | "member" | "owner"; createdAt: Date; userId: string; user: { id: string; email: string; name: string; image?: string | undefined; }; }>; export declare const getActiveMember: (options: O) => import("better-call").StrictEndpoint<"/organization/get-active-member", { method: "GET"; use: (import("better-call").Middleware) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: import("@better-auth/core").GenericEndpointContext) => Promise<{ session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & { activeTeamId?: string | undefined; activeOrganizationId?: string | undefined; }; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }>; }>> | import("better-call").Middleware<{ use: import("better-call").Middleware) => 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; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>>[]; }, (inputContext: import("better-call").MiddlewareInputContext<{ use: import("better-call").Middleware) => 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; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>>[]; }>) => Promise<{ session: { session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & { activeTeamId?: string | undefined; activeOrganizationId?: string | undefined; }; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>>)[]; requireHeaders: true; 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[]; }; }; }; }; }; }; }; }, Omit<((O["teams"] extends { enabled: true; } ? { id: string; organizationId: string; role: InferOrganizationRolesFromOption; createdAt: Date; userId: string; teamId?: string | undefined; user: { id: string; email: string; name: string; image?: string | undefined; }; } : { id: string; organizationId: string; role: InferOrganizationRolesFromOption; createdAt: Date; userId: string; user: { id: string; email: string; name: string; image?: string | undefined; }; }) & (O["schema"] extends { member?: { additionalFields: infer Field extends Record; } | undefined; } ? FieldAttributeToObject : {}) extends (infer T) ? { [K in keyof T]: T[K]; } : never) & { user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }, "user"> & { user: { id: string; name: string; email: string; image: string | undefined; }; }>; export declare const leaveOrganization: (options: O) => import("better-call").StrictEndpoint<"/organization/leave", { method: "POST"; body: z.ZodObject<{ organizationId: z.ZodString; }, z.core.$strip>; requireHeaders: true; use: (import("better-call").Middleware) => 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; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>> | import("better-call").Middleware) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: import("@better-auth/core").GenericEndpointContext) => Promise<{ session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & { activeTeamId?: string | undefined; activeOrganizationId?: string | undefined; }; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }>; }>>)[]; }, Omit<((O["teams"] extends { enabled: true; } ? { id: string; organizationId: string; role: InferOrganizationRolesFromOption; createdAt: Date; userId: string; teamId?: string | undefined; user: { id: string; email: string; name: string; image?: string | undefined; }; } : { id: string; organizationId: string; role: InferOrganizationRolesFromOption; createdAt: Date; userId: string; user: { id: string; email: string; name: string; image?: string | undefined; }; }) & (O["schema"] extends { member?: { additionalFields: infer Field extends Record; } | undefined; } ? FieldAttributeToObject : {}) extends (infer T) ? { [K in keyof T]: T[K]; } : never) & { user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }, "user"> & { user: { id: string; name: string; email: string; image: string | undefined; }; }>; export declare const listMembers: (options: O) => import("better-call").StrictEndpoint<"/organization/list-members", { method: "GET"; query: z.ZodOptional>; offset: z.ZodOptional>; sortBy: z.ZodOptional; sortDirection: z.ZodOptional>; filterField: z.ZodOptional; filterValue: z.ZodOptional, z.ZodBoolean]>, z.ZodArray]>, z.ZodArray]>>; filterOperator: z.ZodOptional>; organizationId: z.ZodOptional; organizationSlug: z.ZodOptional; }, z.core.$strip>>; requireHeaders: true; use: (import("better-call").Middleware) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: import("@better-auth/core").GenericEndpointContext) => Promise<{ session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & { activeTeamId?: string | undefined; activeOrganizationId?: string | undefined; }; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }>; }>> | import("better-call").Middleware<{ use: import("better-call").Middleware) => 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; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>>[]; }, (inputContext: import("better-call").MiddlewareInputContext<{ use: import("better-call").Middleware) => 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; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>>[]; }>) => Promise<{ session: { session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & { activeTeamId?: string | undefined; activeOrganizationId?: string | undefined; }; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>>)[]; }, { members: (((O["teams"] extends { enabled: true; } ? { id: string; organizationId: string; role: InferOrganizationRolesFromOption; createdAt: Date; userId: string; teamId?: string | undefined; user: { id: string; email: string; name: string; image?: string | undefined; }; } : { id: string; organizationId: string; role: InferOrganizationRolesFromOption; createdAt: Date; userId: string; user: { id: string; email: string; name: string; image?: string | undefined; }; }) & (O["schema"] extends { member?: { additionalFields: infer Field extends Record; } | undefined; } ? FieldAttributeToObject : {}) extends (infer T) ? { [K in keyof T]: T[K]; } : never) & { user: { id: string; name: string; email: string; image: string | null | undefined; }; })[]; total: number; }>; export declare const getActiveMemberRole: (options: O) => import("better-call").StrictEndpoint<"/organization/get-active-member-role", { method: "GET"; query: z.ZodOptional; organizationId: z.ZodOptional; organizationSlug: z.ZodOptional; }, z.core.$strip>>; requireHeaders: true; use: (import("better-call").Middleware) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: import("@better-auth/core").GenericEndpointContext) => Promise<{ session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & { activeTeamId?: string | undefined; activeOrganizationId?: string | undefined; }; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }>; }>> | import("better-call").Middleware<{ use: import("better-call").Middleware) => 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; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>>[]; }, (inputContext: import("better-call").MiddlewareInputContext<{ use: import("better-call").Middleware) => 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; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>>[]; }>) => Promise<{ session: { session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & { activeTeamId?: string | undefined; activeOrganizationId?: string | undefined; }; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>>)[]; }, { role: InferOrganizationRolesFromOption; }>;