type ApiKeyRecord = { /** * Plaintext lookup key (128-bit b64u). */ id: string; /** * Storage hash of the secret (43-char b64u). */ hash: string; /** * The prefix the key was minted with. */ prefix: string; userId: string; scopes: string[]; /** * Human label ("Production Backend"). */ name?: string | undefined; /** * `'live'` / `'test'` / caller-defined. */ environment?: string | undefined; metadata?: Record | undefined; /** * ms epoch. */ createdAt: number; /** * ms epoch; absent = no expiry. */ expiresAt?: number | undefined; /** * ms epoch when the record was revoked. */ revokedAt?: number | undefined; revokedReason?: string | undefined; /** * ms epoch of the last successful verify. */ lastUsedAt?: number | undefined; /** * Index into the peppers array that was used at mint. 0 = newest. */ pepperVersion?: number | undefined; }; type ApiKeyStore = { put: (record: ApiKeyRecord) => Promise; getById: (id: string) => Promise; update: (id: string, patch: Partial) => Promise; revoke: (id: string, reason?: string) => Promise; revokeAllForUser: (userId: string, reason?: string) => Promise; listByUser: (userId: string) => Promise; }; /** * @returns {import('../index.js').ApiKeyStore & { _size: () => number }} */ declare function memoryStore(): ApiKeyStore & { _size: () => number; }; /** * @typedef {object} RedisStoreOptions * @property {string} [keyPrefix='apikey:'] */ /** * @param {any} client * @param {RedisStoreOptions} [options] * @returns {import('../index.js').ApiKeyStore} */ declare function redisStore(client: any, options?: RedisStoreOptions): ApiKeyStore; type RedisStoreOptions = { keyPrefix?: string | undefined; }; declare const customStore: (impl: object) => Record Promise>; export { customStore, memoryStore, redisStore };