cloudflare
Version:
The official TypeScript library for the Cloudflare API
119 lines • 4.03 kB
text/typescript
import { APIResource } from "../../core/resource.mjs";
import { APIPromise } from "../../core/api-promise.mjs";
import { RequestOptions } from "../../internal/request-options.mjs";
export declare class BaseAnalytics extends APIResource {
static readonly _key: readonly ['realtimeKit', 'analytics'];
/**
* Returns day-wise session and recording analytics data of an App for the
* specified time range start_date to end_date. If start_date and end_date are not
* provided, the default time range is set from 30 days ago to the current date.
*
* @example
* ```ts
* const response =
* await client.realtimeKit.analytics.getOrgAnalytics(
* '14a396e7-ca44-4937-bf1f-050a69118543',
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
getOrgAnalytics(appID: string, params: AnalyticsGetOrgAnalyticsParams, options?: RequestOptions): APIPromise<AnalyticsGetOrgAnalyticsResponse>;
}
export declare class Analytics extends BaseAnalytics {
}
export interface AnalyticsGetOrgAnalyticsResponse {
data?: AnalyticsGetOrgAnalyticsResponse.Data;
success?: boolean;
}
export declare namespace AnalyticsGetOrgAnalyticsResponse {
interface Data {
/**
* Recording statistics of an App during the range specified
*/
recording_stats?: Data.RecordingStats;
/**
* Session statistics of an App during the range specified
*/
session_stats?: Data.SessionStats;
}
namespace Data {
/**
* Recording statistics of an App during the range specified
*/
interface RecordingStats {
/**
* Day wise recording stats
*/
day_stats?: Array<RecordingStats.DayStat>;
/**
* Total number of recordings during the range specified
*/
recording_count?: number;
/**
* Total recording minutes during the range specified
*/
recording_minutes_consumed?: number;
}
namespace RecordingStats {
interface DayStat {
day?: string;
/**
* Total recording minutes for a specific day
*/
total_recording_minutes?: number;
/**
* Total number of recordings for a specific day
*/
total_recordings?: number;
}
}
/**
* Session statistics of an App during the range specified
*/
interface SessionStats {
/**
* Day wise session stats
*/
day_stats?: Array<SessionStats.DayStat>;
/**
* Total number of sessions during the range specified
*/
sessions_count?: number;
/**
* Total session minutes during the range specified
*/
sessions_minutes_consumed?: number;
}
namespace SessionStats {
interface DayStat {
day?: string;
/**
* Total session minutes for a specific day
*/
total_session_minutes?: number;
/**
* Total number of sessions for a specific day
*/
total_sessions?: number;
}
}
}
}
export interface AnalyticsGetOrgAnalyticsParams {
/**
* Path param: The account identifier tag.
*/
account_id: string;
/**
* Query param: end date in YYYY-MM-DD format
*/
end_date?: string;
/**
* Query param: start date in YYYY-MM-DD format
*/
start_date?: string;
}
export declare namespace Analytics {
export { type AnalyticsGetOrgAnalyticsResponse as AnalyticsGetOrgAnalyticsResponse, type AnalyticsGetOrgAnalyticsParams as AnalyticsGetOrgAnalyticsParams, };
}
//# sourceMappingURL=analytics.d.mts.map