import { getJson, getThalosAuthBaseUrl, postJson, postNoContent } from './client'; export type IdentityProvider = 0 | 1 | 2 | string | number; export type SessionProfile = { isAuthenticated: boolean; subjectId: string; tenantId: string; provider: IdentityProvider; }; export type SessionLoginRequest = { subjectId: string; tenantId: string; correlationId: string; provider: IdentityProvider; externalToken: string; }; export type SessionLoginResponse = { subjectId: string; tenantId: string; provider: IdentityProvider; expiresInSeconds: number; }; export async function loginSession(request: SessionLoginRequest): Promise { return postJson('/api/identity/session/login', request, getThalosAuthBaseUrl()); } export async function refreshSession(): Promise { return postJson('/api/identity/session/refresh', {}, getThalosAuthBaseUrl()); } export async function logoutSession(): Promise { return postNoContent('/api/identity/session/logout', {}, getThalosAuthBaseUrl()); } export async function getSessionMe(): Promise { return getJson('/api/identity/session/me', getThalosAuthBaseUrl()); }