import { Auth, Credential, CreateCredentialOptions, UpdateCredentialOptions } from '../sdk/auth.js'; import { S as Selector, a as Storage, D as Database } from '../shared/hive.DlaRxYsk.js'; import { Logger } from '../sdk/logger.js'; import '../sdk/transaction.js'; import 'zod'; import '../streams/index.js'; //#region src/index.d.ts interface ApiKeyAuthConfig { /** * Logger instance to use for logging. */ logger?: Logger | null | undefined; /** * Storage instance to use for storing and retrieving the Database containing * the API keys. */ storage: Storage; /** * Array of static API keys that work without access to the `.auth` Database. */ staticKeys?: Array | null | undefined; } declare class ApiKeyAuth extends Auth { static selector: Selector<"database">; /** * Storage instance to use for storing and retrieving the Database containing * the API keys. */ readonly storage: Storage; /** * Logger instance to use for logging. */ readonly logger: Logger | null; /** * Array of static API keys that work without access to the `.auth` Database. */ readonly staticKeys: Array; /** * Reference to the Promise returned when invoking `start`. * Used primarily to deduplicate Database initialization. */ private starting; constructor(config: ApiKeyAuthConfig); /** * Start the API Key Authentication instance. * * @returns Promise resolving the Database containing the API keys. */ readonly start: () => Promise; /** * Stop the API Key Authentication instance. * * @returns Promise resolving once the API Key Authentication instance has * been stopped. */ readonly stop: () => Promise; readonly list: () => Promise>; readonly create: (opts: CreateCredentialOptions) => Promise; readonly update: (id: string, opts: UpdateCredentialOptions) => Promise; readonly delete: (id: string) => Promise; readonly isValid: (token: string | null | undefined) => Promise; readonly hasAccess: (token: string | null | undefined, resource: Selector | null | undefined) => Promise; } export { ApiKeyAuth }; export type { ApiKeyAuthConfig };