import * as soap from 'soap'; import * as DODP from './DODPTypes'; import { EventEmitter } from 'events'; export interface DODPSecurity extends soap.WSSecurity { defaults?: any; addHeaders?(headers: any): void; addOptions?(options: any): void; toXML?(): string; } /** * This is only meant as a simple wrapper around the DODP SOAP-service. * More complex logic belongs in the DODPService-class */ export declare class DODPClient implements DODP.DODPClientAPI { /** * SOAP Client initialized from a WSDL */ protected soapClient: Promise; /** * Name of the session cookie used by the service */ private sessionCookieName; /** * Currect session id */ private _sessionId; sessionId: string; private _clientIp; /** * Set the client ip, added as X-Forwarded-For header */ clientIp: string; /** * DODPSecurity object used to add the session cookie to request headers */ private securityHandler; private events; /** * @param sessionCookieName * @param wsdl URL or local filepath to WSDL-file * @optional endpointUrl Override default endpointURL from the WSDL-file * @optional securityHandler Override default security handler, if you need to do more than just adding a cookie * @optional mockClient Mock DODP.Client, only use this for testing */ constructor(sessionCookieName: string, wsdl: string, endpointUrl?: string, securityHandler?: soap.WSSecurity | DODPSecurity, mockClient?: DODP.Client); private defaultSecurityHandler(); private setupCallEvent(callName, promise); logOn(username: string, password: string): Promise; logOff(): Promise; getServiceAttributes(): Promise; setReadingSystemAttributes(readingSystemAttributes: DODP.ReadingSystemAttributes): Promise; getServiceAnnouncements(): Promise; markAnnouncementsAsRead(item: string[]): Promise; getContentList(listId: string, firstItem?: number, lastItem?: number): Promise; getContentMetadata(contentID: string): Promise; issueContent(contentID: string): Promise; returnContent(contentID: string): Promise; getContentResources(contentID: string): Promise; getBookmarks(contentID: string): Promise; setBookmarks(contentID: string, title: string, audio: string, uid: string, bookmarks: DODP.Bookmark[], lastmark: DODP.Lastmark): Promise; getQuestions(data?: string): Promise; getKeyExchangeObject(requestedKeyName: string): Promise; on(eventName: string, cb: Function): EventEmitter; private emit(eventName, ...args); }