UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

211 lines • 8.95 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from "../../core/resource.mjs"; import { path } from "../../internal/utils/path.mjs"; export var BaseLivestreams = /* @__PURE__ */ (() => { class BaseLivestreams extends APIResource { /** * 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, params, options) { const { account_id, app_id } = params; return this._client.get(path `/accounts/${account_id}/realtime/kit/${app_id}/livestreams/${livestreamID}/active-livestream-session`, options); } /** * 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, params, options) { const { account_id, ...query } = params; return this._client.get(path `/accounts/${account_id}/realtime/kit/${appID}/livestreams`, { query, ...options, }); } /** * 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, params, options) { const { account_id, ...query } = params; return this._client.get(path `/accounts/${account_id}/realtime/kit/${appID}/analytics/livestreams/overall`, { query, ...options }); } /** * 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, params, options) { const { account_id, ...query } = params; return this._client.get(path `/accounts/${account_id}/realtime/kit/${appID}/analytics/livestreams/daywise`, { query, ...options }); } /** * 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, params, options) { const { account_id, app_id } = params; return this._client.get(path `/accounts/${account_id}/realtime/kit/${app_id}/livestreams/sessions/${livestreamSessionID}`, options); } /** * 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, params, options) { const { account_id, app_id, ...query } = params; return this._client.get(path `/accounts/${account_id}/realtime/kit/${app_id}/livestreams/${livestreamID}`, { query, ...options }); } /** * 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, params, options) { const { account_id, app_id } = params; return this._client.get(path `/accounts/${account_id}/realtime/kit/${app_id}/meetings/${meetingID}/active-livestream`, options); } /** * 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, params, options) { const { account_id, ...query } = params; return this._client.get(path `/accounts/${account_id}/realtime/kit/${appID}/analytics/daywise`, { query, ...options, }); } /** * 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, params, options) { const { account_id, app_id, ...body } = params; return this._client.post(path `/accounts/${account_id}/realtime/kit/${app_id}/meetings/${meetingID}/livestreams`, { body, ...options }); } /** * 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, params, options) { const { account_id, app_id } = params; return this._client.post(path `/accounts/${account_id}/realtime/kit/${app_id}/meetings/${meetingID}/active-livestream/stop`, options); } } BaseLivestreams._key = Object.freeze([ 'realtimeKit', 'livestreams', ]); return BaseLivestreams; })(); export class Livestreams extends BaseLivestreams { } //# sourceMappingURL=livestreams.mjs.map