Files
vitanovaPackages/dist/telegram/telegram-session-api.service.d.ts

29 lines
1.2 KiB
TypeScript
Raw Normal View History

import { Observable } from 'rxjs';
import { AuthSession, WebSessionStart } from './models/session.model';
/**
* The one Telegram QR/session API (`{authApiUrl}/users/sessions`). Customer
* login (AuthService) and admin login (AdminAuthService) both call this same
* service against this same endpoint - there is no separate admin backend.
* This class only does the HTTP call + response normalization; it holds no
* session state and writes no cookies, so each caller manages its own
* storage/signals independently on top of it.
*/
export declare class TelegramSessionApiService {
private readonly http;
private readonly authApiUrl;
private readonly telegramBotUsername;
createSession(): Observable<WebSessionStart>;
checkSessionOnce(webSessionID: string | null): Observable<AuthSession | null>;
logout(webSessionID: string): Observable<unknown>;
getBotLoginUrl(webSessionID: string): string;
getBotAppLoginUrl(webSessionID: string): string;
private getBotUsername;
private normalizeWebSession;
private extractSessionId;
private readFirst;
private readString;
private readNumber;
private asRecord;
private isActiveStatus;
}