import type { BentoClient } from '../client'; import type { SiteStats, SegmentStats, ReportStats } from './types'; export class BentoStats { private readonly _url = '/stats'; constructor(private readonly _client: BentoClient) {} /** * Retrieves overall statistics for the site * @returns Promise */ public async getSiteStats(): Promise { const result = await this._client.get(`${this._url}/site`); return result; } /** * Retrieves statistics for a specific segment * @param segmentId ID of the segment to get stats for * @returns Promise */ public async getSegmentStats(segmentId: string): Promise { const result = await this._client.get(`${this._url}/segments/${segmentId}`); return result; } /** * Retrieves statistics for a specific report * @param reportId ID of the report to get stats for * @returns Promise */ public async getReportStats(reportId: string): Promise { const result = await this._client.get(`${this._url}/reports/${reportId}`); return result; } }