UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

99 lines • 3.9 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ActiveSession = exports.BaseActiveSession = 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 BaseActiveSession = /* @__PURE__ */ (() => { class BaseActiveSession extends resource_1.APIResource { /** * Creates a new poll in an active session for the given meeting ID. * * @example * ```ts * const response = * await client.realtimeKit.activeSession.createPoll( * 'meeting_id', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * app_id: '14a396e7-ca44-4937-bf1f-050a69118543', * options: ['string'], * question: 'question', * }, * ); * ``` */ createPoll(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}/active-session/poll`, { body, ...options }); } /** * Returns details of an ongoing active session for the given meeting ID. * * @example * ```ts * const response = * await client.realtimeKit.activeSession.getActiveSession( * 'meeting_id', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * app_id: '14a396e7-ca44-4937-bf1f-050a69118543', * }, * ); * ``` */ getActiveSession(meetingID, params, options) { const { account_id, app_id } = params; return this._client.get((0, path_1.path) `/accounts/${account_id}/realtime/kit/${app_id}/meetings/${meetingID}/active-session`, options); } /** * Kicks all participants from an active session for the given meeting ID. * * @example * ```ts * const response = * await client.realtimeKit.activeSession.kickAllParticipants( * 'meeting_id', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * app_id: '14a396e7-ca44-4937-bf1f-050a69118543', * }, * ); * ``` */ kickAllParticipants(meetingID, params, options) { const { account_id, app_id } = params; return this._client.post((0, path_1.path) `/accounts/${account_id}/realtime/kit/${app_id}/meetings/${meetingID}/active-session/kick-all`, options); } /** * Kicks one or more participants from an active session using user ID or custom * participant ID. * * @example * ```ts * const response = * await client.realtimeKit.activeSession.kickParticipants( * 'meeting_id', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * app_id: '14a396e7-ca44-4937-bf1f-050a69118543', * }, * ); * ``` */ kickParticipants(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}/active-session/kick`, { body, ...options }); } } BaseActiveSession._key = Object.freeze([ 'realtimeKit', 'activeSession', ]); return BaseActiveSession; })(); exports.BaseActiveSession = BaseActiveSession; class ActiveSession extends BaseActiveSession { } exports.ActiveSession = ActiveSession; //# sourceMappingURL=active-session.js.map