import { Feed , Observable } from '../feed/feed' ; import { LoginResponse } from '../http/messages' ; import { Keystore , UserIdentity } from '../keystore' ; import { Query } from '../query/query' ; import { FactEnvelope , FactRecord , FactReference } from '../storage' ; import { Authentication } from './authentication' ; export class AuthenticationDevice implements Authentication { constructor ( private inner , private keystore , private localDeviceIdentity ) { } async login ( ) { throw new Error ( 'No logged in user.' ) ; } async local ( ) { return await this . keystore . getDeviceFact ( this . localDeviceIdentity ) ; } from ( fact , query ) { return this . inner . from ( fact , query ) ; } save ( envelopes ) { return this . inner . save ( envelopes ) ; } query ( start , query ) { return this . inner . query ( start , query ) ; } exists ( fact ) { throw new Error ( "Exists method not implemented on AuthenticationDevice." ) ; } load ( references ) { return this . inner . load ( references ) ; } }