UNPKG

@mkeen/rxcouch

Version:

Real Time RxJs Based CouchDB Client

26 lines (25 loc) 1.26 kB
import { Observable, BehaviorSubject } from 'rxjs'; import { HttpResponseWithHeaders } from '@mkeen/rxhttp'; import { AuthorizationBehavior, CouchDBCredentials, CouchDBSessionInfo, CouchDBUserContext } from './types'; export declare class CouchDBSession { authorizationBehavior: AuthorizationBehavior; sessionUrl: string; private credentials?; authenticated: BehaviorSubject<boolean>; loginAttemptMade: BehaviorSubject<boolean>; userSession: BehaviorSubject<CouchDBSessionInfo | null>; cookie: BehaviorSubject<string>; context: BehaviorSubject<CouchDBUserContext | null>; private lastCredentials; constructor(authorizationBehavior: AuthorizationBehavior, sessionUrl?: string, credentials?: Observable<CouchDBCredentials> | undefined); authenticate(providedCredentials?: CouchDBCredentials): Observable<boolean>; reauthenticate(): Observable<boolean>; get(): Observable<CouchDBSessionInfo>; saveCookie: (access_token?: any) => (httpResponse: HttpResponseWithHeaders<any>) => void; extractResponse: (httpResponse: HttpResponseWithHeaders<any>) => any; private attemptNewAuthentication; private httpRequest; private httpRequestOptions; private cookieForRequestHeader; destroy(): any; }