import { Knex } from 'knex'; import { AdminApiKey, AdminApiKeyCreateOptions } from '../types/admin.js'; /** * Service for managing admin API keys */ export declare class AdminApiKeyService { private knex; constructor(knex: Knex); /** * Generate a new API key * @returns Object containing the full API key and its prefix */ private generateApiKey; /** * Hash an API key for storage * @param key The API key to hash * @returns The hashed key */ private hashApiKey; /** * Create a new API key for an admin * @param options API key creation options * @returns The created API key and the full key (only returned once) */ createApiKey(options: AdminApiKeyCreateOptions): Promise<{ apiKey: AdminApiKey; fullKey: string; }>; /** * Validate an API key * @param apiKey The API key to validate * @returns The admin API key if valid, null otherwise */ validateApiKey(apiKey: string): Promise; /** * List all API keys for an admin * @param adminId The admin ID * @returns Array of API keys */ listApiKeys(adminId: string): Promise; /** * Get an API key by ID * @param id The API key ID * @returns The API key if found, null otherwise */ getApiKeyById(id: string): Promise; /** * Update an API key * @param id The API key ID * @param updates The updates to apply * @returns The updated API key */ updateApiKey(id: string, updates: { name?: string; scopes?: string[]; expires_at?: Date | null; }): Promise; /** * Delete an API key * @param id The API key ID * @returns True if the key was deleted, false otherwise */ deleteApiKey(id: string): Promise; /** * Delete all API keys for an admin * @param adminId The admin ID * @returns The number of keys deleted */ deleteAllApiKeys(adminId: string): Promise; /** * Check if an API key has a specific scope * @param apiKey The API key * @param scope The scope to check * @returns True if the API key has the scope, false otherwise */ hasScope(apiKey: AdminApiKey, scope: string): boolean; } //# sourceMappingURL=admin-api-key.service.d.ts.map