import { DocumentScope } from 'nano'; import { Config } from '../types/config'; import { SlUserDoc, UserAction } from '../types/typings'; export declare class DbManager { private userDB; private config; constructor(userDB: DocumentScope, config: Partial); /** returns the `SlUserDoc` if found, else null. Rejects on other error */ getUserByUUID(uuid: string): Promise; /** * returns the `SlUserDoc`, if found, else `null`. * Todo: rejecting with 404 might be better! */ getUserBy(identifier: '_id' | 'email' | 'key', login: string): Promise; findUserDocBySession(key: string): Promise; /** * generates a unique user_id used as `key` for backwards compatibility with * old `user_id`s. Returns a URL-Safe UUID, shortened to length 8. */ generateUsername(): Promise; verifyNewDBKey(newKey: string): Promise; /** adds a log entry for the `action` and returns the modified `userDoc` */ logActivity(action: UserAction, provider: string, userDoc: SlUserDoc): SlUserDoc; getMatchingIdentifier(login: string, allowUUID?: boolean): '_id' | 'email' | 'key'; getUser(login: string, allowUUId?: boolean): Promise; initLinkSocial(login: string, provider: string, auth: any, profile: any): Promise; unlink(user_id: any, provider: any): Promise; }