import { DocumentScope, ServerScope } from 'nano'; import { Config } from '../types/config'; import { CouchDbAuthDoc } from '../types/typings'; import { DBAdapter } from '../types/adapters'; import { SessionHashing } from '../session-hashing'; export declare class CouchAdapter implements DBAdapter { private couchAuthDB; private couch; private config; private session; couchAuthOnCloudant: boolean; constructor(couchAuthDB: DocumentScope, couch: ServerScope, config: Partial, session?: SessionHashing); /** * stores a CouchDbAuthDoc with the passed information. Expects the `username` * (i.e. `key`) and the UUID. */ storeKey(username: string, user_uid: string, key: string, password: string, expires: number, roles: string[], provider: string): Promise; extendKey(key: string, newExpiration: number): Promise; /** * fetches the document from the couchAuthDB, if it's present. Throws an error otherwise. */ retrieveKey(key: string): Promise; /** * Removes the keys of format `org.couchdb.user:TOKEN` from the `_users` - database, if they are present. */ removeKeys(keys: string[]): Promise; /** * initializes the `_security` doc with the passed roles * @param {import('nano').DocumentScope} db * @param {string[]} adminRoles * @param {string[]} memberRoles */ initSecurity(db: DocumentScope, adminRoles: string[], memberRoles: string[]): Promise; /** * authorises the passed keys to access the db */ authorizeKeys(db: DocumentScope, keys: Record | Array | string): Promise; /** * removes the keys from the security doc of the db */ deauthorizeKeys(db: DocumentScope, keys: string[] | string): Promise; }