import { FieldAttributeToObject, InferAdditionalFieldsFromPluginOptions, RemoveFieldsWithReturnedFalse } from "../../../db/field.mjs"; import { Role } from "../../access/types.mjs"; import { OrganizationOptions } from "../types.mjs"; import { InferOrganizationRolesFromOption } from "../schema.mjs"; import { defaultRoles } from "../access/statement.mjs"; import * as _better_auth_core0 from "@better-auth/core"; import { LiteralString } from "@better-auth/core"; import * as _better_auth_core_db0 from "@better-auth/core/db"; import * as better_call0 from "better-call"; import * as z from "zod"; //#region src/plugins/organization/routes/crud-members.d.ts declare const addMember: (option: O) => better_call0.StrictEndpoint; role: z.ZodUnion]>; organizationId: z.ZodOptional; teamId: z.ZodOptional; }, z.core.$strip>; use: ((inputContext: better_call0.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: _better_auth_core0.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>>; declare const removeMember: (options: O) => better_call0.StrictEndpoint<"/organization/remove-member", { method: "POST"; body: z.ZodObject<{ memberIdOrEmail: z.ZodString; organizationId: z.ZodOptional; }, z.core.$strip>; requireHeaders: true; use: (((inputContext: better_call0.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: _better_auth_core0.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; }; }>; }>) | ((inputContext: better_call0.MiddlewareInputContext<{ use: ((inputContext: better_call0.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; 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; }>; declare const updateMemberRole: (option: O) => better_call0.StrictEndpoint<"/organization/update-member-role", { method: "POST"; body: z.ZodObject<{ role: z.ZodUnion]>; memberId: z.ZodString; organizationId: z.ZodOptional; }, z.core.$strip>; use: (((inputContext: better_call0.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: _better_auth_core0.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; }; }>; }>) | ((inputContext: better_call0.MiddlewareInputContext<{ use: ((inputContext: better_call0.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; 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; }; }>; declare const getActiveMember: (options: O) => better_call0.StrictEndpoint<"/organization/get-active-member", { method: "GET"; use: (((inputContext: better_call0.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: _better_auth_core0.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; }; }>; }>) | ((inputContext: better_call0.MiddlewareInputContext<{ use: ((inputContext: better_call0.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; 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; }; }>; declare const leaveOrganization: (options: O) => better_call0.StrictEndpoint<"/organization/leave", { method: "POST"; body: z.ZodObject<{ organizationId: z.ZodString; }, z.core.$strip>; requireHeaders: true; use: (((inputContext: better_call0.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; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>) | ((inputContext: better_call0.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: _better_auth_core0.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; }; }>; declare const listMembers: (options: O) => better_call0.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: (((inputContext: better_call0.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: _better_auth_core0.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; }; }>; }>) | ((inputContext: better_call0.MiddlewareInputContext<{ use: ((inputContext: better_call0.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; 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; }>; declare const getActiveMemberRole: (options: O) => better_call0.StrictEndpoint<"/organization/get-active-member-role", { method: "GET"; query: z.ZodOptional; organizationId: z.ZodOptional; organizationSlug: z.ZodOptional; }, z.core.$strip>>; requireHeaders: true; use: (((inputContext: better_call0.MiddlewareInputContext) => Promise<{ orgOptions: OrganizationOptions; roles: typeof defaultRoles & { [key: string]: Role<{}>; }; getSession: (context: _better_auth_core0.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; }; }>; }>) | ((inputContext: better_call0.MiddlewareInputContext<{ use: ((inputContext: better_call0.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; 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: (((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; }; })["role"]; }>; //#endregion export { addMember, getActiveMember, getActiveMemberRole, leaveOrganization, listMembers, removeMember, updateMemberRole }; //# sourceMappingURL=crud-members.d.mts.map