cloudflare
Version:
The official TypeScript library for the Cloudflare API
165 lines • 6.27 kB
JavaScript
// 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 BaseRecordings = /* @__PURE__ */ (() => {
class BaseRecordings extends APIResource {
/**
* Returns the active recording details for the given meeting ID.
*
* @example
* ```ts
* const response =
* await client.realtimeKit.recordings.getActiveRecordings(
* 'meeting_id',
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* app_id: '14a396e7-ca44-4937-bf1f-050a69118543',
* },
* );
* ```
*/
getActiveRecordings(meetingID, params, options) {
const { account_id, app_id } = params;
return this._client.get(path `/accounts/${account_id}/realtime/kit/${app_id}/recordings/active-recording/${meetingID}`, options);
}
/**
* Returns details of a recording for the given recording ID.
*
* @example
* ```ts
* const response =
* await client.realtimeKit.recordings.getOneRecording(
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* app_id: '14a396e7-ca44-4937-bf1f-050a69118543',
* },
* );
* ```
*/
getOneRecording(recordingID, params, options) {
const { account_id, app_id } = params;
return this._client.get(path `/accounts/${account_id}/realtime/kit/${app_id}/recordings/${recordingID}`, options);
}
/**
* Returns all recordings for an App. If the `meeting_id` parameter is passed,
* returns all recordings for the given meeting ID.
*
* @example
* ```ts
* const response =
* await client.realtimeKit.recordings.getRecordings(
* '14a396e7-ca44-4937-bf1f-050a69118543',
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
getRecordings(appID, params, options) {
const { account_id, ...query } = params;
return this._client.get(path `/accounts/${account_id}/realtime/kit/${appID}/recordings`, {
query,
...options,
});
}
/**
* Pause/Resume/Stop a given recording ID.
*
* @example
* ```ts
* const response =
* await client.realtimeKit.recordings.pauseResumeStopRecording(
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* app_id: '14a396e7-ca44-4937-bf1f-050a69118543',
* action: 'stop',
* },
* );
* ```
*/
pauseResumeStopRecording(recordingID, params, options) {
const { account_id, app_id, ...body } = params;
return this._client.put(path `/accounts/${account_id}/realtime/kit/${app_id}/recordings/${recordingID}`, {
body,
...options,
});
}
/**
* Starts recording a meeting. The meeting can be started by an App admin directly,
* or a participant with permissions to start a recording, based on the type of
* authorization used.
*
* @example
* ```ts
* const response =
* await client.realtimeKit.recordings.startRecordings(
* '14a396e7-ca44-4937-bf1f-050a69118543',
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* meeting_id: '97440c6a-140b-40a9-9499-b23fd7a3868a',
* audio_config: {
* channel: 'stereo',
* codec: 'AAC',
* export_file: true,
* },
* file_name_prefix: 'string',
* interactive_config: { type: 'ID3' },
* max_seconds: 60,
* realtimekit_bucket_config: { enabled: true },
* video_config: {
* codec: 'H264',
* export_file: true,
* height: 720,
* watermark: {
* position: 'left top',
* size: { height: 1, width: 1 },
* url: 'http://example.com',
* },
* width: 1280,
* },
* },
* );
* ```
*/
startRecordings(appID, params, options) {
const { account_id, ...body } = params;
return this._client.post(path `/accounts/${account_id}/realtime/kit/${appID}/recordings`, {
body,
...options,
});
}
/**
* Starts track recording for a meeting. Track recording currently records separate
* participant audio tracks as WebM files in the RealtimeKit bucket. Video track
* recording is in development. For more information, refer to
* [Track recording](/realtime/realtimekit/recording-guide/track-recording/).
*
* @example
* ```ts
* const response =
* await client.realtimeKit.recordings.startTrackRecording(
* '14a396e7-ca44-4937-bf1f-050a69118543',
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* meeting_id: '97440c6a-140b-40a9-9499-b23fd7a3868a',
* },
* );
* ```
*/
startTrackRecording(appID, params, options) {
const { account_id, ...body } = params;
return this._client.post(path `/accounts/${account_id}/realtime/kit/${appID}/recordings/track`, {
body,
...options,
});
}
}
BaseRecordings._key = Object.freeze([
'realtimeKit',
'recordings',
]);
return BaseRecordings;
})();
export class Recordings extends BaseRecordings {
}
//# sourceMappingURL=recordings.mjs.map