refactor: use strict typing

This commit is contained in:
Carlos Valente
2025-03-21 19:44:16 +01:00
committed by Carlos Valente
parent 4ed38340e0
commit 178640bfc4
39 changed files with 339 additions and 246 deletions
@@ -4,7 +4,7 @@ import { getDataProvider } from '../../classes/data-provider/DataProvider.js';
import { publicDir } from '../../setup/index.js';
import { socket } from '../../adapters/WebsocketAdapter.js';
import { getLastRequest } from '../../api-integration/integration.controller.js';
import { getLastLoadedProject } from '../../services/app-state-service/AppStateService.js';
import { getCurrentProject } from '../../services/project-service/ProjectService.js';
import { runtimeService } from '../../services/runtime-service/RuntimeService.js';
import { getNetworkInterfaces } from '../../utils/network.js';
import { getTimezoneLabel } from '../../utils/time.js';
@@ -17,7 +17,7 @@ const startedAt = new Date();
export async function getSessionStats(): Promise<SessionStats> {
const { connectedClients, lastConnection } = socket.getStats();
const lastRequest = getLastRequest();
const projectName = await getLastLoadedProject();
const { filename } = await getCurrentProject();
const { playback } = runtimeService.getRuntimeState();
return {
@@ -25,7 +25,7 @@ export async function getSessionStats(): Promise<SessionStats> {
connectedClients,
lastConnection: lastConnection !== null ? lastConnection.toISOString() : null,
lastRequest: lastRequest !== null ? lastRequest.toISOString() : null,
projectName,
projectName: filename,
playback,
timezone: getTimezoneLabel(startedAt),
};