@dolbyio/dolbyio-rest-apis-client 3.6.0 → 3.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { CreateConferenceOptions, Conference, UserTokens } from './types/conference';
1
+ import { CreateConferenceOptions, Conference, UserTokens, ListParticipantsResponse } from './types/conference';
2
2
  import { SpatialEnvironment, SpatialListener, SpatialUsers } from './types/spatialAudio';
3
3
  import JwtToken from '../types/jwtToken';
4
4
  import Participant from './types/participant';
@@ -73,6 +73,17 @@ export declare const setSpatialListenersAudio: (accessToken: JwtToken, conferenc
73
73
  * @returns The list of user tokens for each participants.
74
74
  */
75
75
  export declare const updatePermissions: (accessToken: JwtToken, conferenceId: string, participants: Array<Participant>) => Promise<UserTokens>;
76
+ /**
77
+ * Returns the current participant list.
78
+ *
79
+ * @link https://docs.dolby.io/communications-apis/reference/return-participant-list
80
+ *
81
+ * @param accessToken Access token to use for authentication.
82
+ * @param conferenceId Identifier of the conference.
83
+ *
84
+ * @returns The list of participants in the conference.
85
+ */
86
+ export declare const participants: (accessToken: JwtToken, conferenceId: string) => Promise<ListParticipantsResponse>;
76
87
  /**
77
88
  * Terminates an ongoing conference and removes all remaining participants from the conference.
78
89
  *
@@ -4,7 +4,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.updatePermissions = exports.terminate = exports.setSpatialListenersAudio = exports.sendMessage = exports.kick = exports.invite = exports.createConference = void 0;
7
+ exports.updatePermissions = exports.terminate = exports.setSpatialListenersAudio = exports.sendMessage = exports.participants = exports.kick = exports.invite = exports.createConference = void 0;
8
8
  var _httpHelpers = require("../internal/httpHelpers");
9
9
  var _urls = require("./internal/urls");
10
10
  var _rtcpMode = require("./types/rtcpMode");
@@ -333,23 +333,25 @@ var updatePermissions = /*#__PURE__*/function () {
333
333
  }();
334
334
 
335
335
  /**
336
- * Terminates an ongoing conference and removes all remaining participants from the conference.
336
+ * Returns the current participant list.
337
337
  *
338
- * @link https://docs.dolby.io/communications-apis/reference/terminate-conference
338
+ * @link https://docs.dolby.io/communications-apis/reference/return-participant-list
339
339
  *
340
340
  * @param accessToken Access token to use for authentication.
341
341
  * @param conferenceId Identifier of the conference.
342
+ *
343
+ * @returns The list of participants in the conference.
342
344
  */
343
345
  exports.updatePermissions = updatePermissions;
344
- var terminate = /*#__PURE__*/function () {
346
+ var participants = /*#__PURE__*/function () {
345
347
  var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(accessToken, conferenceId) {
346
- var options;
348
+ var requestOptions, response;
347
349
  return _regeneratorRuntime().wrap(function _callee7$(_context7) {
348
350
  while (1) switch (_context7.prev = _context7.next) {
349
351
  case 0:
350
- options = {
352
+ requestOptions = {
351
353
  hostname: _urls.COMMS_HOSTNAME,
352
- path: "/v2/conferences/".concat(conferenceId),
354
+ path: "/v2/conferences/".concat(conferenceId, "/participants"),
353
355
  headers: {
354
356
  Accept: 'application/json',
355
357
  'Content-Type': 'application/json',
@@ -357,15 +359,55 @@ var terminate = /*#__PURE__*/function () {
357
359
  }
358
360
  };
359
361
  _context7.next = 3;
360
- return (0, _httpHelpers.sendDelete)(options);
362
+ return (0, _httpHelpers.sendGet)(requestOptions);
361
363
  case 3:
364
+ response = _context7.sent;
365
+ return _context7.abrupt("return", response);
366
+ case 5:
362
367
  case "end":
363
368
  return _context7.stop();
364
369
  }
365
370
  }, _callee7);
366
371
  }));
367
- return function terminate(_x22, _x23) {
372
+ return function participants(_x22, _x23) {
368
373
  return _ref7.apply(this, arguments);
369
374
  };
370
375
  }();
376
+
377
+ /**
378
+ * Terminates an ongoing conference and removes all remaining participants from the conference.
379
+ *
380
+ * @link https://docs.dolby.io/communications-apis/reference/terminate-conference
381
+ *
382
+ * @param accessToken Access token to use for authentication.
383
+ * @param conferenceId Identifier of the conference.
384
+ */
385
+ exports.participants = participants;
386
+ var terminate = /*#__PURE__*/function () {
387
+ var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(accessToken, conferenceId) {
388
+ var options;
389
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
390
+ while (1) switch (_context8.prev = _context8.next) {
391
+ case 0:
392
+ options = {
393
+ hostname: _urls.COMMS_HOSTNAME,
394
+ path: "/v2/conferences/".concat(conferenceId),
395
+ headers: {
396
+ Accept: 'application/json',
397
+ 'Content-Type': 'application/json',
398
+ Authorization: "".concat(accessToken.token_type, " ").concat(accessToken.access_token)
399
+ }
400
+ };
401
+ _context8.next = 3;
402
+ return (0, _httpHelpers.sendDelete)(options);
403
+ case 3:
404
+ case "end":
405
+ return _context8.stop();
406
+ }
407
+ }, _callee8);
408
+ }));
409
+ return function terminate(_x24, _x25) {
410
+ return _ref8.apply(this, arguments);
411
+ };
412
+ }();
371
413
  exports.terminate = terminate;
@@ -52,3 +52,25 @@ export interface Conference {
52
52
  /** The conference access token of the conference participants. */
53
53
  usersTokens: UserTokens;
54
54
  }
55
+ export interface Participants {
56
+ /** The participant ID, in UUID (Universally Unique Identifier) format. The Dolby.io Communications APIs platform automatically generates an ID for each participant connected to the conference. */
57
+ userId: string;
58
+ /** The external ID of the participant. */
59
+ externalId: string;
60
+ /** The name of the participant. */
61
+ name: string;
62
+ /** The URL of the participant's avatar. */
63
+ avatarUrl: string;
64
+ /** The last external IP used by the participant in the conference. */
65
+ ipAddress: string;
66
+ /** The participant's user agent. */
67
+ userAgent: string;
68
+ /** The timestamp of the last time when the participant joined the conference. */
69
+ lastJoinTimestamp: number;
70
+ /** The number of times the participant joined the conference. */
71
+ nbSession: number;
72
+ }
73
+ export interface ListParticipantsResponse {
74
+ /** The ID of the created conference. */
75
+ participants: Participants[];
76
+ }
package/dist/index.js CHANGED
@@ -15,5 +15,5 @@ var streaming = _interopRequireWildcard(require("./streaming"));
15
15
  exports.streaming = streaming;
16
16
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
17
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
18
- var version = "3.6.0";
18
+ var version = "3.6.1";
19
19
  exports.version = version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dolbyio/dolbyio-rest-apis-client",
3
- "version": "3.6.0",
3
+ "version": "3.6.1",
4
4
  "description": "Node.JS wrapper for the dolby.io REST APIs",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {