cloudflare
Version:
The official TypeScript library for the Cloudflare API
243 lines • 9.46 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Meetings = exports.BaseMeetings = void 0;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
const resource_1 = require("../../core/resource.js");
const path_1 = require("../../internal/utils/path.js");
var BaseMeetings = /* @__PURE__ */ (() => {
class BaseMeetings extends resource_1.APIResource {
/**
* Create a meeting for the given App ID.
*
* @example
* ```ts
* const meeting = await client.realtimeKit.meetings.create(
* '14a396e7-ca44-4937-bf1f-050a69118543',
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
create(appID, params, options) {
const { account_id, ...body } = params;
return this._client.post((0, path_1.path) `/accounts/${account_id}/realtime/kit/${appID}/meetings`, {
body,
...options,
});
}
/**
* Adds a participant to the given meeting ID.
*
* @example
* ```ts
* const response =
* await client.realtimeKit.meetings.addParticipant(
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* app_id: '14a396e7-ca44-4937-bf1f-050a69118543',
* custom_participant_id: 'custom_participant_id',
* preset_name: 'preset_name',
* },
* );
* ```
*/
addParticipant(meetingID, params, options) {
const { account_id, app_id, ...body } = params;
return this._client.post((0, path_1.path) `/accounts/${account_id}/realtime/kit/${app_id}/meetings/${meetingID}/participants`, { body, ...options });
}
/**
* Deletes a participant for the given meeting and participant ID.
*
* @example
* ```ts
* const response =
* await client.realtimeKit.meetings.deleteMeetingParticipant(
* 'participant_id',
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* app_id: '14a396e7-ca44-4937-bf1f-050a69118543',
* meeting_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
* },
* );
* ```
*/
deleteMeetingParticipant(participantID, params, options) {
const { account_id, app_id, meeting_id } = params;
return this._client.delete((0, path_1.path) `/accounts/${account_id}/realtime/kit/${app_id}/meetings/${meeting_id}/participants/${participantID}`, options);
}
/**
* Updates a participant's details for the given meeting and participant ID.
*
* @example
* ```ts
* const response =
* await client.realtimeKit.meetings.editParticipant(
* 'participant_id',
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* app_id: '14a396e7-ca44-4937-bf1f-050a69118543',
* meeting_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
* },
* );
* ```
*/
editParticipant(participantID, params, options) {
const { account_id, app_id, meeting_id, ...body } = params;
return this._client.patch((0, path_1.path) `/accounts/${account_id}/realtime/kit/${app_id}/meetings/${meeting_id}/participants/${participantID}`, { body, ...options });
}
/**
* Returns all meetings for the given App ID.
*
* @example
* ```ts
* const meeting = await client.realtimeKit.meetings.get(
* '14a396e7-ca44-4937-bf1f-050a69118543',
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
get(appID, params, options) {
const { account_id, ...query } = params;
return this._client.get((0, path_1.path) `/accounts/${account_id}/realtime/kit/${appID}/meetings`, {
query,
...options,
});
}
/**
* Returns a meeting details in an App for the given meeting ID.
*
* @example
* ```ts
* const response =
* await client.realtimeKit.meetings.getMeetingByID(
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* app_id: '14a396e7-ca44-4937-bf1f-050a69118543',
* },
* );
* ```
*/
getMeetingByID(meetingID, params, options) {
const { account_id, app_id, ...query } = params;
return this._client.get((0, path_1.path) `/accounts/${account_id}/realtime/kit/${app_id}/meetings/${meetingID}`, {
query,
...options,
});
}
/**
* Returns a participant details for the given meeting and participant ID.
*
* @example
* ```ts
* const response =
* await client.realtimeKit.meetings.getMeetingParticipant(
* 'participant_id',
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* app_id: '14a396e7-ca44-4937-bf1f-050a69118543',
* meeting_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
* },
* );
* ```
*/
getMeetingParticipant(participantID, params, options) {
const { account_id, app_id, meeting_id } = params;
return this._client.get((0, path_1.path) `/accounts/${account_id}/realtime/kit/${app_id}/meetings/${meeting_id}/participants/${participantID}`, options);
}
/**
* Returns all participants detail for the given meeting ID.
*
* @example
* ```ts
* const response =
* await client.realtimeKit.meetings.getMeetingParticipants(
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* app_id: '14a396e7-ca44-4937-bf1f-050a69118543',
* },
* );
* ```
*/
getMeetingParticipants(meetingID, params, options) {
const { account_id, app_id, ...query } = params;
return this._client.get((0, path_1.path) `/accounts/${account_id}/realtime/kit/${app_id}/meetings/${meetingID}/participants`, { query, ...options });
}
/**
* Regenerates participant's authentication token for the given meeting and
* participant ID.
*
* @example
* ```ts
* const response =
* await client.realtimeKit.meetings.refreshParticipantToken(
* 'participant_id',
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* app_id: '14a396e7-ca44-4937-bf1f-050a69118543',
* meeting_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
* },
* );
* ```
*/
refreshParticipantToken(participantID, params, options) {
const { account_id, app_id, meeting_id } = params;
return this._client.post((0, path_1.path) `/accounts/${account_id}/realtime/kit/${app_id}/meetings/${meeting_id}/participants/${participantID}/token`, options);
}
/**
* Replaces all the details for the given meeting ID.
*
* @example
* ```ts
* const response =
* await client.realtimeKit.meetings.replaceMeetingByID(
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* app_id: '14a396e7-ca44-4937-bf1f-050a69118543',
* },
* );
* ```
*/
replaceMeetingByID(meetingID, params, options) {
const { account_id, app_id, ...body } = params;
return this._client.put((0, path_1.path) `/accounts/${account_id}/realtime/kit/${app_id}/meetings/${meetingID}`, {
body,
...options,
});
}
/**
* Updates a meeting in an App for the given meeting ID.
*
* @example
* ```ts
* const response =
* await client.realtimeKit.meetings.updateMeetingByID(
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* app_id: '14a396e7-ca44-4937-bf1f-050a69118543',
* },
* );
* ```
*/
updateMeetingByID(meetingID, params, options) {
const { account_id, app_id, ...body } = params;
return this._client.patch((0, path_1.path) `/accounts/${account_id}/realtime/kit/${app_id}/meetings/${meetingID}`, {
body,
...options,
});
}
}
BaseMeetings._key = Object.freeze([
'realtimeKit',
'meetings',
]);
return BaseMeetings;
})();
exports.BaseMeetings = BaseMeetings;
class Meetings extends BaseMeetings {
}
exports.Meetings = Meetings;
//# sourceMappingURL=meetings.js.map