import { type AdminOptions } from "better-auth/plugins"; export type { AdminOptions } from "better-auth/plugins"; /** * Admin 플러그인 스키마 * * better-auth admin 플러그인 호출 시 전달합니다: * ```typescript * admin({ schema: ADMIN_SCHEMA }) * ``` */ export declare const ADMIN_SCHEMA: AdminOptions["schema"]; /** * admin 플러그인 래퍼 * * Sonamu의 스키마 매핑을 자동으로 병합합니다. */ export declare const admin: (options?: AdminOptions) => { id: "admin"; version: string; init(): { options: { databaseHooks: { user: { create: { before(user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; } & Record): Promise<{ data: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; role: string; }; }>; }; }; session: { create: { before(session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & Record, ctx: import("better-auth").GenericEndpointContext | null): Promise; }; }; }; }; }; hooks: { after: { matcher(context: import("better-auth").HookEndpointContext): boolean; handler: (inputContext: import("better-auth").MiddlewareInputContext) => Promise; }[]; }; endpoints: { setRole: import("better-auth").StrictEndpoint<"/admin/set-role", { method: "POST"; body: import("zod").ZodObject<{ userId: import("zod").ZodCoercedString; role: import("zod").ZodUnion]>; }, import("zod/v4/core").$strip>; requireHeaders: true; use: ((inputContext: import("better-auth").MiddlewareInputContext) => Promise<{ session: { user: import("better-auth/plugins").UserWithRole; session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; }; }>)[]; metadata: { openapi: { operationId: string; summary: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { user: { $ref: string; }; }; }; }; }; }; }; }; $Infer: { body: { userId: string; role: "user" | "admin" | ("user" | "admin")[]; }; }; }; }, { user: import("better-auth/plugins").UserWithRole; }>; getUser: import("better-auth").StrictEndpoint<"/admin/get-user", { method: "GET"; query: import("zod").ZodObject<{ id: import("zod").ZodString; }, import("zod/v4/core").$strip>; use: ((inputContext: import("better-auth").MiddlewareInputContext) => Promise<{ session: { user: import("better-auth/plugins").UserWithRole; session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; }; }>)[]; metadata: { openapi: { operationId: string; summary: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { user: { $ref: string; }; }; }; }; }; }; }; }; }; }, import("better-auth/plugins").UserWithRole>; createUser: import("better-auth").StrictEndpoint<"/admin/create-user", { method: "POST"; body: import("zod").ZodObject<{ email: import("zod").ZodString; password: import("zod").ZodOptional; name: import("zod").ZodString; role: import("zod").ZodOptional]>>; data: import("zod").ZodOptional>; }, import("zod/v4/core").$strip>; metadata: { openapi: { operationId: string; summary: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { user: { $ref: string; }; }; }; }; }; }; }; }; $Infer: { body: { email: string; password?: string | undefined; name: string; role?: "user" | "admin" | ("user" | "admin")[] | undefined; data?: Record | undefined; }; }; }; }, { user: import("better-auth/plugins").UserWithRole; }>; adminUpdateUser: import("better-auth").StrictEndpoint<"/admin/update-user", { method: "POST"; body: import("zod").ZodObject<{ userId: import("zod").ZodCoercedString; data: import("zod").ZodRecord; }, import("zod/v4/core").$strip>; use: ((inputContext: import("better-auth").MiddlewareInputContext) => Promise<{ session: { user: import("better-auth/plugins").UserWithRole; session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; }; }>)[]; metadata: { openapi: { operationId: string; summary: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { user: { $ref: string; }; }; }; }; }; }; }; }; }; }, import("better-auth/plugins").UserWithRole>; listUsers: import("better-auth").StrictEndpoint<"/admin/list-users", { method: "GET"; use: ((inputContext: import("better-auth").MiddlewareInputContext) => Promise<{ session: { user: import("better-auth/plugins").UserWithRole; session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; }; }>)[]; query: import("zod").ZodObject<{ searchValue: import("zod").ZodOptional; searchField: import("zod").ZodOptional>; searchOperator: import("zod").ZodOptional>; limit: import("zod").ZodOptional>; offset: import("zod").ZodOptional>; sortBy: import("zod").ZodOptional; sortDirection: import("zod").ZodOptional>; filterField: import("zod").ZodOptional; filterValue: import("zod").ZodOptional, import("zod").ZodBoolean]>, import("zod").ZodArray]>, import("zod").ZodArray]>>; filterOperator: import("zod").ZodOptional>; }, import("zod/v4/core").$strip>; metadata: { openapi: { operationId: string; summary: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { users: { type: string; items: { $ref: string; }; }; total: { type: string; }; limit: { type: string; }; offset: { type: string; }; }; required: string[]; }; }; }; }; }; }; }; }, { users: import("better-auth/plugins").UserWithRole[]; total: number; }>; listUserSessions: import("better-auth").StrictEndpoint<"/admin/list-user-sessions", { method: "POST"; use: ((inputContext: import("better-auth").MiddlewareInputContext) => Promise<{ session: { user: import("better-auth/plugins").UserWithRole; session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; }; }>)[]; body: import("zod").ZodObject<{ userId: import("zod").ZodCoercedString; }, import("zod/v4/core").$strip>; metadata: { openapi: { operationId: string; summary: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { sessions: { type: string; items: { $ref: string; }; }; }; }; }; }; }; }; }; }; }, { sessions: import("better-auth/plugins").SessionWithImpersonatedBy[]; }>; unbanUser: import("better-auth").StrictEndpoint<"/admin/unban-user", { method: "POST"; body: import("zod").ZodObject<{ userId: import("zod").ZodCoercedString; }, import("zod/v4/core").$strip>; use: ((inputContext: import("better-auth").MiddlewareInputContext) => Promise<{ session: { user: import("better-auth/plugins").UserWithRole; session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; }; }>)[]; metadata: { openapi: { operationId: string; summary: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { user: { $ref: string; }; }; }; }; }; }; }; }; }; }, { user: import("better-auth/plugins").UserWithRole; }>; banUser: import("better-auth").StrictEndpoint<"/admin/ban-user", { method: "POST"; body: import("zod").ZodObject<{ userId: import("zod").ZodCoercedString; banReason: import("zod").ZodOptional; banExpiresIn: import("zod").ZodOptional; }, import("zod/v4/core").$strip>; use: ((inputContext: import("better-auth").MiddlewareInputContext) => Promise<{ session: { user: import("better-auth/plugins").UserWithRole; session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; }; }>)[]; metadata: { openapi: { operationId: string; summary: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { user: { $ref: string; }; }; }; }; }; }; }; }; }; }, { user: import("better-auth/plugins").UserWithRole; }>; impersonateUser: import("better-auth").StrictEndpoint<"/admin/impersonate-user", { method: "POST"; body: import("zod").ZodObject<{ userId: import("zod").ZodCoercedString; }, import("zod/v4/core").$strip>; use: ((inputContext: import("better-auth").MiddlewareInputContext) => Promise<{ session: { user: import("better-auth/plugins").UserWithRole; session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; }; }>)[]; metadata: { openapi: { operationId: string; summary: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { session: { $ref: string; }; user: { $ref: string; }; }; }; }; }; }; }; }; }; }, { session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: import("better-auth/plugins").UserWithRole; }>; stopImpersonating: import("better-auth").StrictEndpoint<"/admin/stop-impersonating", { method: "POST"; requireHeaders: true; }, { session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & Record; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; } & Record; }>; revokeUserSession: import("better-auth").StrictEndpoint<"/admin/revoke-user-session", { method: "POST"; body: import("zod").ZodObject<{ sessionToken: import("zod").ZodString; }, import("zod/v4/core").$strip>; use: ((inputContext: import("better-auth").MiddlewareInputContext) => Promise<{ session: { user: import("better-auth/plugins").UserWithRole; session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; }; }>)[]; metadata: { openapi: { operationId: string; summary: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { success: { type: string; }; }; }; }; }; }; }; }; }; }, { success: boolean; }>; revokeUserSessions: import("better-auth").StrictEndpoint<"/admin/revoke-user-sessions", { method: "POST"; body: import("zod").ZodObject<{ userId: import("zod").ZodCoercedString; }, import("zod/v4/core").$strip>; use: ((inputContext: import("better-auth").MiddlewareInputContext) => Promise<{ session: { user: import("better-auth/plugins").UserWithRole; session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; }; }>)[]; metadata: { openapi: { operationId: string; summary: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { success: { type: string; }; }; }; }; }; }; }; }; }; }, { success: boolean; }>; removeUser: import("better-auth").StrictEndpoint<"/admin/remove-user", { method: "POST"; body: import("zod").ZodObject<{ userId: import("zod").ZodCoercedString; }, import("zod/v4/core").$strip>; use: ((inputContext: import("better-auth").MiddlewareInputContext) => Promise<{ session: { user: import("better-auth/plugins").UserWithRole; session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; }; }>)[]; metadata: { openapi: { operationId: string; summary: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { success: { type: string; }; }; }; }; }; }; }; }; }; }, { success: boolean; }>; setUserPassword: import("better-auth").StrictEndpoint<"/admin/set-user-password", { method: "POST"; body: import("zod").ZodObject<{ newPassword: import("zod").ZodString; userId: import("zod").ZodCoercedString; }, import("zod/v4/core").$strip>; use: ((inputContext: import("better-auth").MiddlewareInputContext) => Promise<{ session: { user: import("better-auth/plugins").UserWithRole; session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; }; }>)[]; metadata: { openapi: { operationId: string; summary: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { status: { type: string; }; }; }; }; }; }; }; }; }; }, { status: boolean; }>; userHasPermission: import("better-auth").StrictEndpoint<"/admin/has-permission", { method: "POST"; body: import("zod").ZodIntersection>; role: import("zod").ZodOptional; }, import("zod/v4/core").$strip>, import("zod").ZodUnion>; permissions: import("zod").ZodUndefined; }, import("zod/v4/core").$strip>, import("zod").ZodObject<{ permission: import("zod").ZodUndefined; permissions: import("zod").ZodRecord>; }, import("zod/v4/core").$strip>]>>; metadata: { openapi: { description: string; requestBody: { content: { "application/json": { schema: { type: "object"; properties: { permissions: { 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[]; }; }; }; }; }; }; $Infer: { body: { permissions: { readonly user?: ("update" | "delete" | "create" | "get" | "list" | "set-role" | "ban" | "impersonate" | "impersonate-admins" | "set-password")[] | undefined; readonly session?: ("delete" | "list" | "revoke")[] | undefined; }; } & { userId?: string | undefined; role?: "user" | "admin" | undefined; }; }; }; }, { error: null; success: boolean; }>; }; $ERROR_CODES: { USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: import("better-auth").RawError<"USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL">; FAILED_TO_CREATE_USER: import("better-auth").RawError<"FAILED_TO_CREATE_USER">; USER_ALREADY_EXISTS: import("better-auth").RawError<"USER_ALREADY_EXISTS">; YOU_CANNOT_BAN_YOURSELF: import("better-auth").RawError<"YOU_CANNOT_BAN_YOURSELF">; YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE">; YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS">; YOU_ARE_NOT_ALLOWED_TO_LIST_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS">; YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS">; YOU_ARE_NOT_ALLOWED_TO_BAN_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_BAN_USERS">; YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS">; YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS">; YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS">; YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD">; BANNED_USER: import("better-auth").RawError<"BANNED_USER">; YOU_ARE_NOT_ALLOWED_TO_GET_USER: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_GET_USER">; NO_DATA_TO_UPDATE: import("better-auth").RawError<"NO_DATA_TO_UPDATE">; YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS">; YOU_CANNOT_REMOVE_YOURSELF: import("better-auth").RawError<"YOU_CANNOT_REMOVE_YOURSELF">; YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE">; YOU_CANNOT_IMPERSONATE_ADMINS: import("better-auth").RawError<"YOU_CANNOT_IMPERSONATE_ADMINS">; INVALID_ROLE_TYPE: import("better-auth").RawError<"INVALID_ROLE_TYPE">; }; schema: { user: { fields: { role: { type: "string"; required: false; input: false; }; banned: { type: "boolean"; defaultValue: false; required: false; input: false; }; banReason: { type: "string"; required: false; input: false; }; banExpires: { type: "date"; required: false; input: false; }; }; }; session: { fields: { impersonatedBy: { type: "string"; required: false; }; }; }; }; options: NoInfer; }; //# sourceMappingURL=admin.d.ts.map