UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

35 lines (34 loc) 2.06 kB
import { AbstractSession } from "../AbstractSession"; import { RestSession } from "./RestSession"; import { RestWebService, WebServiceType } from "../../webservice"; import { KeyStorePassword, UserCertificates, UserCredentials } from "../../generated-sources"; import { AxiosInstance } from "axios"; import { SessionContext } from "../connection"; import { AuthenticationProvider } from "../auth"; import { DocumentManager, RestDocument } from "./documents"; import { AdministrationManager } from "./administration"; export declare abstract class AbstractRestSession<T_REST_DOCUMENT extends RestDocument> extends AbstractSession implements RestSession<T_REST_DOCUMENT> { private static readonly INFO_PATH; private static readonly LOGOUT_PATH; private static readonly CERTIFICATES_PATH; private readonly _httpClient; protected user?: UserCredentials; protected certificates?: UserCertificates; protected readonly documentManager: DocumentManager<T_REST_DOCUMENT>; protected administrationManager: AdministrationManager<T_REST_DOCUMENT>; constructor(serverContext: SessionContext, authProvider: AuthenticationProvider); getHttpClient(): AxiosInstance; getDocumentManager(): DocumentManager<T_REST_DOCUMENT>; getAdministrationManager(): AdministrationManager<T_REST_DOCUMENT>; getUser(): Promise<UserCredentials>; getCertificates(): Promise<UserCertificates>; updateCertificates(keystoreName: string, keyStorePassword: KeyStorePassword): Promise<UserCertificates | undefined>; close(): Promise<void>; protected abstract createDocumentManager(): DocumentManager<T_REST_DOCUMENT>; protected abstract createAdministrationManager(): AdministrationManager<T_REST_DOCUMENT>; abstract createWebServiceInstance<T_WEBSERVICE extends RestWebService<any, any, any>>(webServiceType: WebServiceType): T_WEBSERVICE; abstract uploadDocument(data: Blob, fileName: string, options?: { onProgress?: (event: any) => void; abortSignal?: AbortSignal; }): Promise<T_REST_DOCUMENT>; }