cloudflare
Version:
The official TypeScript library for the Cloudflare API
817 lines • 28.5 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 BaseLivestreams extends APIResource {
static readonly _key: readonly ['realtimeKit', 'livestreams'];
/**
* Returns details of all active livestreams for the given livestream ID. Retreive
* the livestream ID using the `Start livestreaming a meeting` API.
*
* @example
* ```ts
* const response =
* await client.realtimeKit.livestreams.getActiveLivestreamsForLivestreamID(
* 'livestream_id',
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* app_id: '14a396e7-ca44-4937-bf1f-050a69118543',
* },
* );
* ```
*/
getActiveLivestreamsForLivestreamID(livestreamID: string, params: LivestreamGetActiveLivestreamsForLivestreamIDParams, options?: RequestOptions): APIPromise<LivestreamGetActiveLivestreamsForLivestreamIDResponse>;
/**
* Returns details of livestreams associated with the given App ID. It includes
* livestreams created by your App and RealtimeKit meetings that are livestreamed
* by your App. If you only want details of livestreams created by your App and not
* RealtimeKit meetings, you can use the `exclude_meetings` query parameter.
*
* @example
* ```ts
* const response =
* await client.realtimeKit.livestreams.getAllLivestreams(
* '14a396e7-ca44-4937-bf1f-050a69118543',
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
getAllLivestreams(appID: string, params: LivestreamGetAllLivestreamsParams, options?: RequestOptions): APIPromise<LivestreamGetAllLivestreamsResponse>;
/**
* Returns livestream analytics for the specified time range.
*
* @example
* ```ts
* const response =
* await client.realtimeKit.livestreams.getLivestreamAnalyticsComplete(
* '14a396e7-ca44-4937-bf1f-050a69118543',
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
getLivestreamAnalyticsComplete(appID: string, params: LivestreamGetLivestreamAnalyticsCompleteParams, options?: RequestOptions): APIPromise<LivestreamGetLivestreamAnalyticsCompleteResponse>;
/**
* Returns day-wise livestream analytics for the specified time range.
*
* @example
* ```ts
* const response =
* await client.realtimeKit.livestreams.getLivestreamAnalyticsDaywise(
* '14a396e7-ca44-4937-bf1f-050a69118543',
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
getLivestreamAnalyticsDaywise(appID: string, params: LivestreamGetLivestreamAnalyticsDaywiseParams, options?: RequestOptions): APIPromise<LivestreamGetLivestreamAnalyticsDaywiseResponse>;
/**
* Returns livestream session details for the given livestream session ID. Retrieve
* the `livestream_session_id`using the
* `Fetch livestream session details using a session ID` API.
*
* @example
* ```ts
* const response =
* await client.realtimeKit.livestreams.getLivestreamSessionDetailsForSessionID(
* 'livestream-session-id',
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* app_id: '14a396e7-ca44-4937-bf1f-050a69118543',
* },
* );
* ```
*/
getLivestreamSessionDetailsForSessionID(livestreamSessionID: string, params: LivestreamGetLivestreamSessionDetailsForSessionIDParams, options?: RequestOptions): APIPromise<LivestreamGetLivestreamSessionDetailsForSessionIDResponse>;
/**
* Returns details of a livestream with sessions for the given livestream ID.
* Retreive the livestream ID using the `Start livestreaming a meeting` API.
*
* @example
* ```ts
* const response =
* await client.realtimeKit.livestreams.getLivestreamSessionForLivestreamID(
* 'livestream_id',
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* app_id: '14a396e7-ca44-4937-bf1f-050a69118543',
* },
* );
* ```
*/
getLivestreamSessionForLivestreamID(livestreamID: string, params: LivestreamGetLivestreamSessionForLivestreamIDParams, options?: RequestOptions): APIPromise<LivestreamGetLivestreamSessionForLivestreamIDResponse>;
/**
* Returns details of all active livestreams for the given meeting ID.
*
* @example
* ```ts
* const response =
* await client.realtimeKit.livestreams.getMeetingActiveLivestreams(
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* app_id: '14a396e7-ca44-4937-bf1f-050a69118543',
* },
* );
* ```
*/
getMeetingActiveLivestreams(meetingID: string, params: LivestreamGetMeetingActiveLivestreamsParams, options?: RequestOptions): APIPromise<LivestreamGetMeetingActiveLivestreamsResponse>;
/**
* 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.livestreams.getOrgAnalytics(
* '14a396e7-ca44-4937-bf1f-050a69118543',
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
getOrgAnalytics(appID: string, params: LivestreamGetOrgAnalyticsParams, options?: RequestOptions): APIPromise<LivestreamGetOrgAnalyticsResponse>;
/**
* Starts livestream of a meeting associated with the given meeting ID. Retreive
* the meeting ID using the `Create a meeting` API.
*
* @example
* ```ts
* const response =
* await client.realtimeKit.livestreams.startLivestreamingAMeeting(
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* app_id: '14a396e7-ca44-4937-bf1f-050a69118543',
* name: 'prdmmp-xhycsl',
* },
* );
* ```
*/
startLivestreamingAMeeting(meetingID: string, params: LivestreamStartLivestreamingAMeetingParams, options?: RequestOptions): APIPromise<LivestreamStartLivestreamingAMeetingResponse>;
/**
* Stops the active livestream of a meeting associated with the given meeting ID.
* Retreive the meeting ID using the `Create a meeting` API.
*
* @example
* ```ts
* const response =
* await client.realtimeKit.livestreams.stopLivestreamingAMeeting(
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* app_id: '14a396e7-ca44-4937-bf1f-050a69118543',
* },
* );
* ```
*/
stopLivestreamingAMeeting(meetingID: string, params: LivestreamStopLivestreamingAMeetingParams, options?: RequestOptions): APIPromise<LivestreamStopLivestreamingAMeetingResponse>;
}
export declare class Livestreams extends BaseLivestreams {
}
export interface LivestreamGetActiveLivestreamsForLivestreamIDResponse {
data?: LivestreamGetActiveLivestreamsForLivestreamIDResponse.Data;
success?: boolean;
}
export declare namespace LivestreamGetActiveLivestreamsForLivestreamIDResponse {
interface Data {
livestream?: Data.Livestream;
session?: Data.Session;
}
namespace Data {
interface Livestream {
id?: string;
/**
* Timestamp the object was created at. The time is returned in ISO format.
*/
created_at?: string;
/**
* Specifies if the livestream was disabled.
*/
disabled?: string;
/**
* The server URL to which the RTMP encoder sends the video and audio data.
*/
ingest_server?: string;
/**
* ID of the meeting.
*/
meeting_id?: string;
/**
* Name of the livestream.
*/
name?: string;
/**
* The web address that viewers can use to watch the livestream.
*/
playback_url?: string;
status?: 'LIVE' | 'IDLE' | 'ERRORED' | 'INVOKED';
/**
* Unique key for accessing each livestream.
*/
stream_key?: string;
/**
* Timestamp the object was updated at. The time is returned in ISO format.
*/
updated_at?: string;
}
interface Session {
id?: string;
/**
* Timestamp the object was created at. The time is returned in ISO format.
*/
created_at?: string;
err_message?: string;
/**
* The time duration for which the input was given or the meeting was streamed.
*/
ingest_seconds?: string;
/**
* Timestamp the object was invoked. The time is returned in ISO format.
*/
invoked_time?: string;
livestream_id?: string;
/**
* Timestamp the object was started. The time is returned in ISO format.
*/
started_time?: string;
/**
* Timestamp the object was stopped. The time is returned in ISO format.
*/
stopped_time?: string;
/**
* Timestamp the object was updated at. The time is returned in ISO format.
*/
updated_at?: string;
/**
* The total view time for which the viewers watched the stream.
*/
viewer_seconds?: string;
}
}
}
export interface LivestreamGetAllLivestreamsResponse {
data?: LivestreamGetAllLivestreamsResponse.Data;
success?: boolean;
}
export declare namespace LivestreamGetAllLivestreamsResponse {
interface Data {
/**
* The ID of the livestream.
*/
id?: string;
/**
* Timestamp the object was created at. The time is returned in ISO format.
*/
created_at?: string;
/**
* Specifies if the livestream was disabled.
*/
disabled?: string;
/**
* The server URL to which the RTMP encoder sends the video and audio data.
*/
ingest_server?: string;
/**
* ID of the meeting.
*/
meeting_id?: string;
/**
* Name of the livestream.
*/
name?: string;
paging?: Data.Paging;
/**
* The web address that viewers can use to watch the livestream.
*/
playback_url?: string;
status?: 'LIVE' | 'IDLE' | 'ERRORED' | 'INVOKED';
/**
* Unique key for accessing each livestream.
*/
stream_key?: string;
/**
* Timestamp the object was updated at. The time is returned in ISO format.
*/
updated_at?: string;
}
namespace Data {
interface Paging {
end_offset?: number;
start_offset?: number;
total_count?: number;
}
}
}
export interface LivestreamGetLivestreamAnalyticsCompleteResponse {
data?: LivestreamGetLivestreamAnalyticsCompleteResponse.Data;
success?: boolean;
}
export declare namespace LivestreamGetLivestreamAnalyticsCompleteResponse {
interface Data {
/**
* Count of total livestreams.
*/
count?: number;
/**
* Total time duration for which the input was given or the meeting was streamed.
*/
total_ingest_seconds?: number;
/**
* Total view time for which the viewers watched the stream.
*/
total_viewer_seconds?: number;
}
}
export interface LivestreamGetLivestreamAnalyticsDaywiseResponse {
data?: Array<LivestreamGetLivestreamAnalyticsDaywiseResponse.Data>;
success?: boolean;
}
export declare namespace LivestreamGetLivestreamAnalyticsDaywiseResponse {
interface Data {
/**
* Count of total livestream sessions.
*/
count?: number;
/**
* Analytics date.
*/
date?: string | null;
/**
* Total time duration for which the input was given or the meeting was streamed.
*/
total_ingest_seconds?: number;
/**
* Total view time for which the viewers watched the stream.
*/
total_viewer_seconds?: number;
}
}
export interface LivestreamGetLivestreamSessionDetailsForSessionIDResponse {
data?: LivestreamGetLivestreamSessionDetailsForSessionIDResponse.Data;
success?: boolean;
}
export declare namespace LivestreamGetLivestreamSessionDetailsForSessionIDResponse {
interface Data {
/**
* The livestream ID.
*/
id?: string;
/**
* Timestamp the object was created at. The time is returned in ISO format.
*/
created_at?: string;
/**
* The server URL to which the RTMP encoder sends the video and audio data.
*/
err_message?: string;
/**
* Name of the livestream.
*/
ingest_seconds?: number;
livestream_id?: string;
/**
* Unique key for accessing each livestream.
*/
started_time?: string;
/**
* The web address that viewers can use to watch the livestream.
*/
stopped_time?: string;
/**
* Timestamp the object was updated at. The time is returned in ISO format.
*/
updated_at?: string;
/**
* Specifies if the livestream was disabled.
*/
viewer_seconds?: number;
}
}
export interface LivestreamGetLivestreamSessionForLivestreamIDResponse {
data?: LivestreamGetLivestreamSessionForLivestreamIDResponse.Data;
success?: boolean;
}
export declare namespace LivestreamGetLivestreamSessionForLivestreamIDResponse {
interface Data {
livestream?: Data.Livestream;
paging?: Data.Paging;
session?: Data.Session;
}
namespace Data {
interface Livestream {
/**
* ID of the livestream.
*/
id?: string;
/**
* Timestamp the object was created at. The time is returned in ISO format.
*/
created_at?: string;
/**
* Specifies if the livestream was disabled.
*/
disabled?: string;
/**
* The server URL to which the RTMP encoder sends the video and audio data.
*/
ingest_server?: string;
/**
* The ID of the meeting.
*/
meeting_id?: string;
/**
* Name of the livestream.
*/
name?: string;
/**
* The web address that viewers can use to watch the livestream.
*/
playback_url?: string;
status?: 'LIVE' | 'IDLE' | 'ERRORED' | 'INVOKED';
/**
* Unique key for accessing each livestream.
*/
stream_key?: string;
/**
* Timestamp the object was updated at. The time is returned in ISO format.
*/
updated_at?: string;
}
interface Paging {
end_offset?: number;
start_offset?: number;
total_count?: number;
}
interface Session {
/**
* ID of the session.
*/
id?: string;
/**
* Timestamp the object was created at. The time is returned in ISO format.
*/
created_at?: string;
err_message?: string;
/**
* The time duration for which the input was given or the meeting was streamed.
*/
ingest_seconds?: number;
/**
* Timestamp the object was invoked. The time is returned in ISO format.
*/
invoked_time?: string;
livestream_id?: string;
/**
* Timestamp the object was started. The time is returned in ISO format.
*/
started_time?: string;
/**
* Timestamp the object was stopped. The time is returned in ISO format.
*/
stopped_time?: string;
/**
* Timestamp the object was updated at. The time is returned in ISO format.
*/
updated_at?: string;
/**
* The total view time for which the viewers watched the stream.
*/
viewer_seconds?: number;
}
}
}
export interface LivestreamGetMeetingActiveLivestreamsResponse {
data?: LivestreamGetMeetingActiveLivestreamsResponse.Data;
success?: boolean;
}
export declare namespace LivestreamGetMeetingActiveLivestreamsResponse {
interface Data {
/**
* The livestream ID.
*/
id?: string;
/**
* Timestamp the object was created at. The time is returned in ISO format.
*/
created_at?: string;
/**
* Specifies if the livestream was disabled.
*/
disabled?: string;
/**
* The server URL to which the RTMP encoder sends the video and audio data.
*/
ingest_server?: string;
meeting_id?: string;
/**
* Name of the livestream.
*/
name?: string | null;
/**
* The web address that viewers can use to watch the livestream.
*/
playback_url?: string;
status?: 'LIVE' | 'IDLE' | 'ERRORED' | 'INVOKED';
/**
* Unique key for accessing each livestream.
*/
stream_key?: string;
/**
* Timestamp the object was updated at. The time is returned in ISO format.
*/
updated_at?: string;
}
}
export interface LivestreamGetOrgAnalyticsResponse {
data?: LivestreamGetOrgAnalyticsResponse.Data;
success?: boolean;
}
export declare namespace LivestreamGetOrgAnalyticsResponse {
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 LivestreamStartLivestreamingAMeetingResponse {
data?: LivestreamStartLivestreamingAMeetingResponse.Data;
success?: boolean;
}
export declare namespace LivestreamStartLivestreamingAMeetingResponse {
interface Data {
/**
* The livestream ID.
*/
id?: string;
/**
* The server URL to which the RTMP encoder sends the video and audio data.
*/
ingest_server?: string;
/**
* The web address that viewers can use to watch the livestream.
*/
playback_url?: string;
status?: 'LIVE' | 'IDLE' | 'ERRORED' | 'INVOKED';
/**
* Unique key for accessing each livestream.
*/
stream_key?: string;
}
}
export interface LivestreamStopLivestreamingAMeetingResponse {
data?: LivestreamStopLivestreamingAMeetingResponse.Data;
success?: boolean;
}
export declare namespace LivestreamStopLivestreamingAMeetingResponse {
interface Data {
message?: string;
}
}
export interface LivestreamGetActiveLivestreamsForLivestreamIDParams {
/**
* The account identifier tag.
*/
account_id: string;
/**
* The app identifier tag.
*/
app_id: string;
}
export interface LivestreamGetAllLivestreamsParams {
/**
* Path param: The account identifier tag.
*/
account_id: string;
/**
* Query param: Specify the end time range in ISO format to access the live stream.
*/
end_time?: string;
/**
* Query param: Exclude the RealtimeKit meetings that are livestreamed.
*/
exclude_meetings?: boolean;
/**
* Query param: The page number from which you want your page search results to be
* displayed.
*/
page_no?: number;
/**
* Query param: Number of results per page.
*/
per_page?: number;
/**
* Query param: Specifies the sorting order for the results.
*/
sort_order?: 'ASC' | 'DSC';
/**
* Query param: Specify the start time range in ISO format to access the live
* stream.
*/
start_time?: string;
/**
* Query param: Specifies the status of the operation.
*/
status?: 'LIVE' | 'IDLE' | 'ERRORED' | 'INVOKED';
}
export interface LivestreamGetLivestreamAnalyticsCompleteParams {
/**
* Path param: The account identifier tag.
*/
account_id: string;
/**
* Query param: Specify the end time as a Unix timestamp in seconds to access the
* livestream analytics.
*/
end_time?: number;
/**
* Query param: Optional filters for livestream analytics.
*/
filters?: string;
/**
* Query param: Specify the start time as a Unix timestamp in seconds to access the
* livestream analytics.
*/
start_time?: number;
}
export interface LivestreamGetLivestreamAnalyticsDaywiseParams {
/**
* Path param: The account identifier tag.
*/
account_id: string;
/**
* Query param: Specify the end time as a Unix timestamp in seconds to access the
* livestream analytics.
*/
end_time?: number;
/**
* Query param: Optional filters for livestream analytics.
*/
filters?: string;
/**
* Query param: Specify the start time as a Unix timestamp in seconds to access the
* livestream analytics.
*/
start_time?: number;
}
export interface LivestreamGetLivestreamSessionDetailsForSessionIDParams {
/**
* The account identifier tag.
*/
account_id: string;
/**
* The app identifier tag.
*/
app_id: string;
}
export interface LivestreamGetLivestreamSessionForLivestreamIDParams {
/**
* Path param: The account identifier tag.
*/
account_id: string;
/**
* Path param: The app identifier tag.
*/
app_id: string;
/**
* Query param: The page number from which you want your page search results to be
* displayed.
*/
page_no?: number;
/**
* Query param: Number of results per page.
*/
per_page?: number;
}
export interface LivestreamGetMeetingActiveLivestreamsParams {
/**
* The account identifier tag.
*/
account_id: string;
/**
* The app identifier tag.
*/
app_id: string;
}
export interface LivestreamGetOrgAnalyticsParams {
/**
* 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 interface LivestreamStartLivestreamingAMeetingParams {
/**
* Path param: The account identifier tag.
*/
account_id: string;
/**
* Path param: The app identifier tag.
*/
app_id: string;
/**
* Body param
*/
name?: string | null;
/**
* Body param
*/
video_config?: LivestreamStartLivestreamingAMeetingParams.VideoConfig;
}
export declare namespace LivestreamStartLivestreamingAMeetingParams {
interface VideoConfig {
/**
* Height of the livestreaming video in pixels
*/
height?: number;
/**
* Width of the livestreaming video in pixels
*/
width?: number;
}
}
export interface LivestreamStopLivestreamingAMeetingParams {
/**
* The account identifier tag.
*/
account_id: string;
/**
* The app identifier tag.
*/
app_id: string;
}
export declare namespace Livestreams {
export { type LivestreamGetActiveLivestreamsForLivestreamIDResponse as LivestreamGetActiveLivestreamsForLivestreamIDResponse, type LivestreamGetAllLivestreamsResponse as LivestreamGetAllLivestreamsResponse, type LivestreamGetLivestreamAnalyticsCompleteResponse as LivestreamGetLivestreamAnalyticsCompleteResponse, type LivestreamGetLivestreamAnalyticsDaywiseResponse as LivestreamGetLivestreamAnalyticsDaywiseResponse, type LivestreamGetLivestreamSessionDetailsForSessionIDResponse as LivestreamGetLivestreamSessionDetailsForSessionIDResponse, type LivestreamGetLivestreamSessionForLivestreamIDResponse as LivestreamGetLivestreamSessionForLivestreamIDResponse, type LivestreamGetMeetingActiveLivestreamsResponse as LivestreamGetMeetingActiveLivestreamsResponse, type LivestreamGetOrgAnalyticsResponse as LivestreamGetOrgAnalyticsResponse, type LivestreamStartLivestreamingAMeetingResponse as LivestreamStartLivestreamingAMeetingResponse, type LivestreamStopLivestreamingAMeetingResponse as LivestreamStopLivestreamingAMeetingResponse, type LivestreamGetActiveLivestreamsForLivestreamIDParams as LivestreamGetActiveLivestreamsForLivestreamIDParams, type LivestreamGetAllLivestreamsParams as LivestreamGetAllLivestreamsParams, type LivestreamGetLivestreamAnalyticsCompleteParams as LivestreamGetLivestreamAnalyticsCompleteParams, type LivestreamGetLivestreamAnalyticsDaywiseParams as LivestreamGetLivestreamAnalyticsDaywiseParams, type LivestreamGetLivestreamSessionDetailsForSessionIDParams as LivestreamGetLivestreamSessionDetailsForSessionIDParams, type LivestreamGetLivestreamSessionForLivestreamIDParams as LivestreamGetLivestreamSessionForLivestreamIDParams, type LivestreamGetMeetingActiveLivestreamsParams as LivestreamGetMeetingActiveLivestreamsParams, type LivestreamGetOrgAnalyticsParams as LivestreamGetOrgAnalyticsParams, type LivestreamStartLivestreamingAMeetingParams as LivestreamStartLivestreamingAMeetingParams, type LivestreamStopLivestreamingAMeetingParams as LivestreamStopLivestreamingAMeetingParams, };
}
//# sourceMappingURL=livestreams.d.mts.map