// Copyright © 2022-2026 Partium, Inc. DBA Partium import { Observable } from 'rxjs'; import { OauthSessionService, OauthStatus, OauthLoginConfig } from '../../services/session/oauth-session.service'; import { LogoutConfig } from '../../services/session/session.service.interface'; import { ServiceProvider } from '../../services/service-provider'; export interface JsOauthPublicApiResponse { token: string; expires_in_secs: number; expires: boolean; refreshable: boolean; refresh_token: string; } /** * Public-Api-specific implementation of the OauthSessionService for * web-based Applications. */ export declare class JSOauthPublicApiSessionService extends OauthSessionService { private _status; private status$; private httpsClientService; constructor(serviceProvider: ServiceProvider); /** * Called when the service is initialized */ onCreate(): void; /** * Get an observable that always sends the OauthStatus every time * it changes. * * @returns Observable observable that resolves with the OauthStatus, every time it changes */ getStatus(): Observable; /** * Login user and resolves on success * * @param config the oauthLoginConfiguration */ login(config: OauthLoginConfig): Observable; /** * Refresh session and Access token with the refresh token */ refresh(): Observable; /** * Logout the current user-session */ logout(_config?: LogoutConfig): Observable; /** * Instead of logging in with an api-key, the user already logged in to keycloak via another channel (eg direct) * -> reuse this existing session instead of creating a new one. * (Used to prevent that the API-key needs to be exposed in the app and sent to the SDK without encryption) * * @param activeSession data about the active session (session-token, ...) */ private reuseActiveSession; /** * Update the current access token from a keycloak response. * Should be called after successful login or refresh */ private updateTokenFromResponse; /** * Update the current access token * Should be called after successful login, refresh or session reuse */ private updateToken; /** * Reset the current access token * Called on logout or failing login/refresh */ private resetToken; private handleError; /** * Creates an appropiate SdkError from the input error * @param error * @returns SdkError */ private createSdkError; }