import { n as ApiKeyConfigurationOptions, r as ApiKeyOptions, t as ApiKey } from "./types-CCe5L05Y.mjs"; import * as better_auth0 from "better-auth"; import * as zod from "zod"; import * as better_call0 from "better-call"; import { HookEndpointContext } from "@better-auth/core"; //#region src/error-codes.d.ts declare const API_KEY_ERROR_CODES: { INVALID_METADATA_TYPE: better_auth0.RawError<"INVALID_METADATA_TYPE">; REFILL_AMOUNT_AND_INTERVAL_REQUIRED: better_auth0.RawError<"REFILL_AMOUNT_AND_INTERVAL_REQUIRED">; REFILL_INTERVAL_AND_AMOUNT_REQUIRED: better_auth0.RawError<"REFILL_INTERVAL_AND_AMOUNT_REQUIRED">; USER_BANNED: better_auth0.RawError<"USER_BANNED">; UNAUTHORIZED_SESSION: better_auth0.RawError<"UNAUTHORIZED_SESSION">; KEY_NOT_FOUND: better_auth0.RawError<"KEY_NOT_FOUND">; KEY_DISABLED: better_auth0.RawError<"KEY_DISABLED">; KEY_EXPIRED: better_auth0.RawError<"KEY_EXPIRED">; USAGE_EXCEEDED: better_auth0.RawError<"USAGE_EXCEEDED">; KEY_NOT_RECOVERABLE: better_auth0.RawError<"KEY_NOT_RECOVERABLE">; EXPIRES_IN_IS_TOO_SMALL: better_auth0.RawError<"EXPIRES_IN_IS_TOO_SMALL">; EXPIRES_IN_IS_TOO_LARGE: better_auth0.RawError<"EXPIRES_IN_IS_TOO_LARGE">; INVALID_REMAINING: better_auth0.RawError<"INVALID_REMAINING">; INVALID_PREFIX_LENGTH: better_auth0.RawError<"INVALID_PREFIX_LENGTH">; INVALID_NAME_LENGTH: better_auth0.RawError<"INVALID_NAME_LENGTH">; METADATA_DISABLED: better_auth0.RawError<"METADATA_DISABLED">; RATE_LIMIT_EXCEEDED: better_auth0.RawError<"RATE_LIMIT_EXCEEDED">; NO_VALUES_TO_UPDATE: better_auth0.RawError<"NO_VALUES_TO_UPDATE">; KEY_DISABLED_EXPIRATION: better_auth0.RawError<"KEY_DISABLED_EXPIRATION">; INVALID_API_KEY: better_auth0.RawError<"INVALID_API_KEY">; INVALID_USER_ID_FROM_API_KEY: better_auth0.RawError<"INVALID_USER_ID_FROM_API_KEY">; INVALID_REFERENCE_ID_FROM_API_KEY: better_auth0.RawError<"INVALID_REFERENCE_ID_FROM_API_KEY">; INVALID_API_KEY_GETTER_RETURN_TYPE: better_auth0.RawError<"INVALID_API_KEY_GETTER_RETURN_TYPE">; SERVER_ONLY_PROPERTY: better_auth0.RawError<"SERVER_ONLY_PROPERTY">; FAILED_TO_UPDATE_API_KEY: better_auth0.RawError<"FAILED_TO_UPDATE_API_KEY">; NAME_REQUIRED: better_auth0.RawError<"NAME_REQUIRED">; ORGANIZATION_ID_REQUIRED: better_auth0.RawError<"ORGANIZATION_ID_REQUIRED">; USER_NOT_MEMBER_OF_ORGANIZATION: better_auth0.RawError<"USER_NOT_MEMBER_OF_ORGANIZATION">; INSUFFICIENT_API_KEY_PERMISSIONS: better_auth0.RawError<"INSUFFICIENT_API_KEY_PERMISSIONS">; NO_DEFAULT_API_KEY_CONFIGURATION_FOUND: better_auth0.RawError<"NO_DEFAULT_API_KEY_CONFIGURATION_FOUND">; ORGANIZATION_PLUGIN_REQUIRED: better_auth0.RawError<"ORGANIZATION_PLUGIN_REQUIRED">; }; //#endregion //#region src/index.d.ts declare module "@better-auth/core" { interface BetterAuthPluginRegistry { "api-key": { creator: typeof apiKey; }; } } declare const defaultKeyHasher: (key: string) => Promise; declare const API_KEY_TABLE_NAME = "apikey"; declare function apiKey(_configurations?: (ApiKeyConfigurationOptions & ApiKeyOptions) | ApiKeyConfigurationOptions[] | undefined, _options?: ApiKeyOptions | undefined): { id: "api-key"; $ERROR_CODES: { INVALID_METADATA_TYPE: better_auth0.RawError<"INVALID_METADATA_TYPE">; REFILL_AMOUNT_AND_INTERVAL_REQUIRED: better_auth0.RawError<"REFILL_AMOUNT_AND_INTERVAL_REQUIRED">; REFILL_INTERVAL_AND_AMOUNT_REQUIRED: better_auth0.RawError<"REFILL_INTERVAL_AND_AMOUNT_REQUIRED">; USER_BANNED: better_auth0.RawError<"USER_BANNED">; UNAUTHORIZED_SESSION: better_auth0.RawError<"UNAUTHORIZED_SESSION">; KEY_NOT_FOUND: better_auth0.RawError<"KEY_NOT_FOUND">; KEY_DISABLED: better_auth0.RawError<"KEY_DISABLED">; KEY_EXPIRED: better_auth0.RawError<"KEY_EXPIRED">; USAGE_EXCEEDED: better_auth0.RawError<"USAGE_EXCEEDED">; KEY_NOT_RECOVERABLE: better_auth0.RawError<"KEY_NOT_RECOVERABLE">; EXPIRES_IN_IS_TOO_SMALL: better_auth0.RawError<"EXPIRES_IN_IS_TOO_SMALL">; EXPIRES_IN_IS_TOO_LARGE: better_auth0.RawError<"EXPIRES_IN_IS_TOO_LARGE">; INVALID_REMAINING: better_auth0.RawError<"INVALID_REMAINING">; INVALID_PREFIX_LENGTH: better_auth0.RawError<"INVALID_PREFIX_LENGTH">; INVALID_NAME_LENGTH: better_auth0.RawError<"INVALID_NAME_LENGTH">; METADATA_DISABLED: better_auth0.RawError<"METADATA_DISABLED">; RATE_LIMIT_EXCEEDED: better_auth0.RawError<"RATE_LIMIT_EXCEEDED">; NO_VALUES_TO_UPDATE: better_auth0.RawError<"NO_VALUES_TO_UPDATE">; KEY_DISABLED_EXPIRATION: better_auth0.RawError<"KEY_DISABLED_EXPIRATION">; INVALID_API_KEY: better_auth0.RawError<"INVALID_API_KEY">; INVALID_USER_ID_FROM_API_KEY: better_auth0.RawError<"INVALID_USER_ID_FROM_API_KEY">; INVALID_REFERENCE_ID_FROM_API_KEY: better_auth0.RawError<"INVALID_REFERENCE_ID_FROM_API_KEY">; INVALID_API_KEY_GETTER_RETURN_TYPE: better_auth0.RawError<"INVALID_API_KEY_GETTER_RETURN_TYPE">; SERVER_ONLY_PROPERTY: better_auth0.RawError<"SERVER_ONLY_PROPERTY">; FAILED_TO_UPDATE_API_KEY: better_auth0.RawError<"FAILED_TO_UPDATE_API_KEY">; NAME_REQUIRED: better_auth0.RawError<"NAME_REQUIRED">; ORGANIZATION_ID_REQUIRED: better_auth0.RawError<"ORGANIZATION_ID_REQUIRED">; USER_NOT_MEMBER_OF_ORGANIZATION: better_auth0.RawError<"USER_NOT_MEMBER_OF_ORGANIZATION">; INSUFFICIENT_API_KEY_PERMISSIONS: better_auth0.RawError<"INSUFFICIENT_API_KEY_PERMISSIONS">; NO_DEFAULT_API_KEY_CONFIGURATION_FOUND: better_auth0.RawError<"NO_DEFAULT_API_KEY_CONFIGURATION_FOUND">; ORGANIZATION_PLUGIN_REQUIRED: better_auth0.RawError<"ORGANIZATION_PLUGIN_REQUIRED">; }; hooks: { before: { matcher: (ctx: HookEndpointContext) => boolean; handler: (inputContext: better_call0.MiddlewareInputContext) => Promise<{ user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; session: { id: string; token: string; userId: string; userAgent: string | null; ipAddress: string | null; createdAt: Date; updatedAt: Date; expiresAt: Date; }; } | { context: better_call0.MiddlewareContext & better_auth0.InfoContext & { options: better_auth0.BetterAuthOptions; trustedOrigins: string[]; trustedProviders: string[]; isTrustedOrigin: (url: string, settings?: { allowRelativePaths: boolean; }) => boolean; oauthConfig: { skipStateCookieCheck?: boolean | undefined; storeStateStrategy: "database" | "cookie"; }; newSession: { 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; } | null; session: { 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; } | null; setNewSession: (session: { 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; } | null) => void; socialProviders: better_auth0.OAuthProvider[]; authCookies: better_auth0.BetterAuthCookies; logger: ReturnType; rateLimit: { enabled: boolean; window: number; max: number; storage: "memory" | "database" | "secondary-storage"; } & Omit; adapter: better_auth0.DBAdapter; internalAdapter: better_auth0.InternalAdapter; createAuthCookie: (cookieName: string, overrideAttributes?: Partial | undefined) => better_auth0.BetterAuthCookie; secret: string; secretConfig: string | better_auth0.SecretConfig; sessionConfig: { updateAge: number; expiresIn: number; freshAge: number; cookieRefreshCache: false | { enabled: true; updateAge: number; }; }; generateId: (options: { model: better_auth0.ModelNames; size?: number | undefined; }) => string | false; secondaryStorage: better_auth0.SecondaryStorage | undefined; password: { hash: (password: string) => Promise; verify: (data: { password: string; hash: string; }) => Promise; config: { minPasswordLength: number; maxPasswordLength: number; }; checkPassword: (userId: string, ctx: better_auth0.GenericEndpointContext) => Promise; }; tables: better_auth0.BetterAuthDBSchema; runMigrations: () => Promise; publishTelemetry: (event: { type: string; anonymousId?: string | undefined; payload: Record; }) => Promise; skipOriginCheck: boolean | string[]; skipCSRFCheck: boolean; runInBackground: (promise: Promise) => void; runInBackgroundOrAwait: (promise: Promise | void) => better_auth0.Awaitable; }>; }>; }[]; }; endpoints: { /** * ### Endpoint * * POST `/api-key/create` * * ### API Methods * * **server:** * `auth.api.createApiKey` * * **client:** * `authClient.apiKey.create` * * @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/api-key#api-method-api-key-create) */ createApiKey: better_call0.StrictEndpoint<"/api-key/create", { method: "POST"; body: zod.ZodObject<{ configId: zod.ZodOptional; name: zod.ZodOptional; expiresIn: zod.ZodDefault>>; prefix: zod.ZodOptional; remaining: zod.ZodDefault>>; metadata: zod.ZodOptional; refillAmount: zod.ZodOptional; refillInterval: zod.ZodOptional; rateLimitTimeWindow: zod.ZodOptional; rateLimitMax: zod.ZodOptional; rateLimitEnabled: zod.ZodOptional; permissions: zod.ZodOptional>>; userId: zod.ZodOptional>; organizationId: zod.ZodOptional>; }, better_auth0.$strip>; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { id: { type: string; description: string; }; createdAt: { type: string; format: string; description: string; }; updatedAt: { type: string; format: string; description: string; }; name: { type: string; nullable: boolean; description: string; }; prefix: { type: string; nullable: boolean; description: string; }; start: { type: string; nullable: boolean; description: string; }; key: { type: string; description: string; }; enabled: { type: string; description: string; }; expiresAt: { type: string; format: string; nullable: boolean; description: string; }; referenceId: { type: string; description: string; }; lastRefillAt: { type: string; format: string; nullable: boolean; description: string; }; lastRequest: { type: string; format: string; nullable: boolean; description: string; }; metadata: { type: string; nullable: boolean; additionalProperties: boolean; description: string; }; rateLimitMax: { type: string; nullable: boolean; description: string; }; rateLimitTimeWindow: { type: string; nullable: boolean; description: string; }; remaining: { type: string; nullable: boolean; description: string; }; refillAmount: { type: string; nullable: boolean; description: string; }; refillInterval: { type: string; nullable: boolean; description: string; }; rateLimitEnabled: { type: string; description: string; }; requestCount: { type: string; description: string; }; permissions: { type: string; nullable: boolean; additionalProperties: { type: string; items: { type: string; }; }; description: string; }; }; required: string[]; }; }; }; }; }; }; }; }, { key: string; metadata: any; permissions: any; id: string; configId: string; name: string | null; start: string | null; prefix: string | null; referenceId: string; refillInterval: number | null; refillAmount: number | null; lastRefillAt: Date | null; enabled: boolean; rateLimitEnabled: boolean; rateLimitTimeWindow: number | null; rateLimitMax: number | null; requestCount: number; remaining: number | null; lastRequest: Date | null; expiresAt: Date | null; createdAt: Date; updatedAt: Date; }>; /** * ### Endpoint * * POST `/api-key/verify` * * ### API Methods * * **server:** * `auth.api.verifyApiKey` * * @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/api-key#api-method-api-key-verify) */ verifyApiKey: better_call0.StrictEndpoint; key: zod.ZodString; permissions: zod.ZodOptional>>; }, better_auth0.$strip>; }, { valid: boolean; error: { message: better_auth0.RawError<"INVALID_API_KEY">; code: "KEY_NOT_FOUND"; }; key: null; } | { valid: boolean; error: { message: string | undefined; code: string; cause?: unknown; }; key: null; } | { valid: boolean; error: { message: better_auth0.RawError<"INVALID_API_KEY">; code: "INVALID_API_KEY"; }; key: null; } | { valid: boolean; error: null; key: Omit | null; }>; /** * ### Endpoint * * GET `/api-key/get` * * ### API Methods * * **server:** * `auth.api.getApiKey` * * **client:** * `authClient.apiKey.get` * * @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/api-key#api-method-api-key-get) */ getApiKey: better_call0.StrictEndpoint<"/api-key/get", { method: "GET"; query: zod.ZodObject<{ configId: zod.ZodOptional; id: zod.ZodString; }, better_auth0.$strip>; 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; }; }; }>)[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { id: { type: string; description: string; }; name: { type: string; nullable: boolean; description: string; }; start: { type: string; nullable: boolean; description: string; }; prefix: { type: string; nullable: boolean; description: string; }; userId: { type: string; description: string; }; refillInterval: { type: string; nullable: boolean; description: string; }; refillAmount: { type: string; nullable: boolean; description: string; }; lastRefillAt: { type: string; format: string; nullable: boolean; description: string; }; enabled: { type: string; description: string; default: boolean; }; rateLimitEnabled: { type: string; description: string; }; rateLimitTimeWindow: { type: string; nullable: boolean; description: string; }; rateLimitMax: { type: string; nullable: boolean; description: string; }; requestCount: { type: string; description: string; }; remaining: { type: string; nullable: boolean; description: string; }; lastRequest: { type: string; format: string; nullable: boolean; description: string; }; expiresAt: { type: string; format: string; nullable: boolean; description: string; }; createdAt: { type: string; format: string; description: string; }; updatedAt: { type: string; format: string; description: string; }; metadata: { type: string; nullable: boolean; additionalProperties: boolean; description: string; }; permissions: { type: string; nullable: boolean; description: string; }; }; required: string[]; }; }; }; }; }; }; }; }, { metadata: Record | null; permissions: { [key: string]: string[]; } | null; id: string; configId: string; name: string | null; start: string | null; prefix: string | null; referenceId: string; refillInterval: number | null; refillAmount: number | null; lastRefillAt: Date | null; enabled: boolean; rateLimitEnabled: boolean; rateLimitTimeWindow: number | null; rateLimitMax: number | null; requestCount: number; remaining: number | null; lastRequest: Date | null; expiresAt: Date | null; createdAt: Date; updatedAt: Date; }>; /** * ### Endpoint * * POST `/api-key/update` * * ### API Methods * * **server:** * `auth.api.updateApiKey` * * **client:** * `authClient.apiKey.update` * * @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/api-key#api-method-api-key-update) */ updateApiKey: better_call0.StrictEndpoint<"/api-key/update", { method: "POST"; body: zod.ZodObject<{ configId: zod.ZodOptional; keyId: zod.ZodString; userId: zod.ZodOptional>; name: zod.ZodOptional; enabled: zod.ZodOptional; remaining: zod.ZodOptional; refillAmount: zod.ZodOptional; refillInterval: zod.ZodOptional; metadata: zod.ZodOptional; expiresIn: zod.ZodNullable>; rateLimitEnabled: zod.ZodOptional; rateLimitTimeWindow: zod.ZodOptional; rateLimitMax: zod.ZodOptional; permissions: zod.ZodNullable>>>; }, better_auth0.$strip>; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { id: { type: string; description: string; }; name: { type: string; nullable: boolean; description: string; }; start: { type: string; nullable: boolean; description: string; }; prefix: { type: string; nullable: boolean; description: string; }; userId: { type: string; description: string; }; refillInterval: { type: string; nullable: boolean; description: string; }; refillAmount: { type: string; nullable: boolean; description: string; }; lastRefillAt: { type: string; format: string; nullable: boolean; description: string; }; enabled: { type: string; description: string; default: boolean; }; rateLimitEnabled: { type: string; description: string; }; rateLimitTimeWindow: { type: string; nullable: boolean; description: string; }; rateLimitMax: { type: string; nullable: boolean; description: string; }; requestCount: { type: string; description: string; }; remaining: { type: string; nullable: boolean; description: string; }; lastRequest: { type: string; format: string; nullable: boolean; description: string; }; expiresAt: { type: string; format: string; nullable: boolean; description: string; }; createdAt: { type: string; format: string; description: string; }; updatedAt: { type: string; format: string; description: string; }; metadata: { type: string; nullable: boolean; additionalProperties: boolean; description: string; }; permissions: { type: string; nullable: boolean; description: string; }; }; required: string[]; }; }; }; }; }; }; }; }, { metadata: Record | null; permissions: { [key: string]: string[]; } | null; id: string; configId: string; name: string | null; start: string | null; prefix: string | null; referenceId: string; refillInterval: number | null; refillAmount: number | null; lastRefillAt: Date | null; enabled: boolean; rateLimitEnabled: boolean; rateLimitTimeWindow: number | null; rateLimitMax: number | null; requestCount: number; remaining: number | null; lastRequest: Date | null; expiresAt: Date | null; createdAt: Date; updatedAt: Date; }>; /** * ### Endpoint * * POST `/api-key/delete` * * ### API Methods * * **server:** * `auth.api.deleteApiKey` * * **client:** * `authClient.apiKey.delete` * * @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/api-key#api-method-api-key-delete) */ deleteApiKey: better_call0.StrictEndpoint<"/api-key/delete", { method: "POST"; body: zod.ZodObject<{ configId: zod.ZodOptional; keyId: zod.ZodString; }, better_auth0.$strip>; 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; }; }; }>)[]; metadata: { openapi: { description: string; requestBody: { content: { "application/json": { schema: { type: "object"; properties: { keyId: { type: string; description: string; }; }; required: string[]; }; }; }; }; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { success: { type: string; description: string; }; }; required: string[]; }; }; }; }; }; }; }; }, { success: boolean; }>; /** * ### Endpoint * * GET `/api-key/list` * * ### API Methods * * **server:** * `auth.api.listApiKeys` * * **client:** * `authClient.apiKey.list` * * @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/api-key#api-method-api-key-list) */ listApiKeys: better_call0.StrictEndpoint<"/api-key/list", { method: "GET"; 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; }; }; }>)[]; query: zod.ZodOptional; organizationId: zod.ZodOptional; limit: zod.ZodOptional>; offset: zod.ZodOptional>; sortBy: zod.ZodOptional; sortDirection: zod.ZodOptional>; }, better_auth0.$strip>>; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { apiKeys: { type: string; items: { type: string; properties: { id: { type: string; description: string; }; name: { type: string; nullable: boolean; description: string; }; start: { type: string; nullable: boolean; description: string; }; prefix: { type: string; nullable: boolean; description: string; }; userId: { type: string; description: string; }; refillInterval: { type: string; nullable: boolean; description: string; }; refillAmount: { type: string; nullable: boolean; description: string; }; lastRefillAt: { type: string; format: string; nullable: boolean; description: string; }; enabled: { type: string; description: string; default: boolean; }; rateLimitEnabled: { type: string; description: string; }; rateLimitTimeWindow: { type: string; nullable: boolean; description: string; }; rateLimitMax: { type: string; nullable: boolean; description: string; }; requestCount: { type: string; description: string; }; remaining: { type: string; nullable: boolean; description: string; }; lastRequest: { type: string; format: string; nullable: boolean; description: string; }; expiresAt: { type: string; format: string; nullable: boolean; description: string; }; createdAt: { type: string; format: string; description: string; }; updatedAt: { type: string; format: string; description: string; }; metadata: { type: string; nullable: boolean; additionalProperties: boolean; description: string; }; permissions: { type: string; nullable: boolean; description: string; }; }; required: string[]; }; }; total: { type: string; description: string; }; limit: { type: string; nullable: boolean; description: string; }; offset: { type: string; nullable: boolean; description: string; }; }; required: string[]; }; }; }; }; }; }; }; }, { apiKeys: { metadata: Record | null; permissions: { [key: string]: string[]; } | null; id: string; configId: string; name: string | null; start: string | null; prefix: string | null; referenceId: string; refillInterval: number | null; refillAmount: number | null; lastRefillAt: Date | null; enabled: boolean; rateLimitEnabled: boolean; rateLimitTimeWindow: number | null; rateLimitMax: number | null; requestCount: number; remaining: number | null; lastRequest: Date | null; expiresAt: Date | null; createdAt: Date; updatedAt: Date; }[]; total: number; limit: number | undefined; offset: number | undefined; }>; /** * ### Endpoint * * POST `/api-key/delete-all-expired-api-keys` * * ### API Methods * * **server:** * `auth.api.deleteAllExpiredApiKeys` * * @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/api-key#api-method-api-key-delete-all-expired-api-keys) */ deleteAllExpiredApiKeys: better_call0.StrictEndpoint; }; schema: { apikey: { fields: { configId: { type: "string"; required: true; defaultValue: string; input: false; index: true; }; name: { type: "string"; required: false; input: false; }; start: { type: "string"; required: false; input: false; }; referenceId: { type: "string"; required: true; input: false; index: true; }; prefix: { type: "string"; required: false; input: false; }; key: { type: "string"; required: true; input: false; index: true; }; refillInterval: { type: "number"; required: false; input: false; }; refillAmount: { type: "number"; required: false; input: false; }; lastRefillAt: { type: "date"; required: false; input: false; }; enabled: { type: "boolean"; required: false; input: false; defaultValue: true; }; rateLimitEnabled: { type: "boolean"; required: false; input: false; defaultValue: true; }; rateLimitTimeWindow: { type: "number"; required: false; input: false; defaultValue: number; }; rateLimitMax: { type: "number"; required: false; input: false; defaultValue: number; }; requestCount: { type: "number"; required: false; input: false; defaultValue: number; }; remaining: { type: "number"; required: false; input: false; }; lastRequest: { type: "date"; required: false; input: false; }; expiresAt: { type: "date"; required: false; input: false; }; createdAt: { type: "date"; required: true; input: false; }; updatedAt: { type: "date"; required: true; input: false; }; permissions: { type: "string"; required: false; input: false; }; metadata: { type: "string"; required: false; input: true; transform: { input(value: better_auth0.DBPrimitive): string; output(value: better_auth0.DBPrimitive): any; }; }; }; }; }; }; //#endregion export { API_KEY_ERROR_CODES as i, apiKey as n, defaultKeyHasher as r, API_KEY_TABLE_NAME as t }; //# sourceMappingURL=index-CLXIQyX5.d.mts.map