UNPKG

signicat-client-ts

Version:

Community TypeScript client for Signicat Authentication REST API with automatic token management

45 lines (44 loc) 1.83 kB
import type { SessionDataDto } from "../models/SessionDataDto"; import type { SessionRequestDto } from "../models/SessionRequestDto"; import type { CancelablePromise } from "../core/CancelablePromise"; import type { BaseHttpRequest } from "../core/BaseHttpRequest"; export declare class AuthenticationSessionService { readonly httpRequest: BaseHttpRequest; private encryptionPrivateKey?; constructor(httpRequest: BaseHttpRequest); /** * Set encryption private key for decrypting JWE responses * @param privateKey The private key in JWK format */ setEncryptionPrivateKey(privateKey: any): void; /** * Create a new session * Use this endpoint to create a session. This must contain a JSON object (as described) with all the info needed. * @param requestBody JSON object with data used necessary for creating the session. * @returns SessionDataDto OK * @throws ApiError */ createSession(requestBody: SessionRequestDto): CancelablePromise<SessionDataDto>; /** * Get session status * Use this endpoint to get information regarding a previously created session. * @param id The session identifier. * @param sessionNonce The sessionNonce used for the embedded flow * @returns SessionDataDto OK * @throws ApiError */ getSession(id: string, sessionNonce?: string): CancelablePromise<SessionDataDto>; /** * Cancel Authentication Session * @param id The session identifier. * @returns SessionDataDto OK * @throws ApiError */ cancelSession(id: string): CancelablePromise<SessionDataDto>; /** * Handle potentially encrypted responses * @param promise The original request promise * @returns Promise with decrypted data if necessary */ private handleEncryptedResponse; }