@webex/plugin-meetings 3.7.0-next.8 → 3.7.0-web-workers-keepalive.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.
Files changed (107) hide show
  1. package/dist/annotation/index.js +17 -0
  2. package/dist/annotation/index.js.map +1 -1
  3. package/dist/breakouts/breakout.js +1 -1
  4. package/dist/breakouts/index.js +1 -1
  5. package/dist/common/errors/{webinar-registration-error.js → join-webinar-error.js} +12 -12
  6. package/dist/common/errors/join-webinar-error.js.map +1 -0
  7. package/dist/common/errors/multistream-not-supported-error.js +53 -0
  8. package/dist/common/errors/multistream-not-supported-error.js.map +1 -0
  9. package/dist/config.js +1 -1
  10. package/dist/config.js.map +1 -1
  11. package/dist/constants.js +26 -5
  12. package/dist/constants.js.map +1 -1
  13. package/dist/index.js +16 -11
  14. package/dist/index.js.map +1 -1
  15. package/dist/interpretation/index.js +1 -1
  16. package/dist/interpretation/siLanguage.js +1 -1
  17. package/dist/locus-info/index.js +13 -2
  18. package/dist/locus-info/index.js.map +1 -1
  19. package/dist/locus-info/selfUtils.js +30 -17
  20. package/dist/locus-info/selfUtils.js.map +1 -1
  21. package/dist/meeting/index.js +903 -800
  22. package/dist/meeting/index.js.map +1 -1
  23. package/dist/meeting/locusMediaRequest.js +9 -0
  24. package/dist/meeting/locusMediaRequest.js.map +1 -1
  25. package/dist/meeting/request.js +30 -0
  26. package/dist/meeting/request.js.map +1 -1
  27. package/dist/meeting/request.type.js.map +1 -1
  28. package/dist/meeting/util.js +16 -16
  29. package/dist/meeting/util.js.map +1 -1
  30. package/dist/meeting-info/meeting-info-v2.js +29 -17
  31. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  32. package/dist/meetings/index.js +6 -3
  33. package/dist/meetings/index.js.map +1 -1
  34. package/dist/meetings/util.js +1 -1
  35. package/dist/meetings/util.js.map +1 -1
  36. package/dist/member/index.js +9 -0
  37. package/dist/member/index.js.map +1 -1
  38. package/dist/member/types.js.map +1 -1
  39. package/dist/member/util.js +39 -28
  40. package/dist/member/util.js.map +1 -1
  41. package/dist/metrics/constants.js +1 -1
  42. package/dist/metrics/constants.js.map +1 -1
  43. package/dist/multistream/remoteMedia.js +30 -15
  44. package/dist/multistream/remoteMedia.js.map +1 -1
  45. package/dist/multistream/sendSlotManager.js +24 -0
  46. package/dist/multistream/sendSlotManager.js.map +1 -1
  47. package/dist/roap/index.js +10 -8
  48. package/dist/roap/index.js.map +1 -1
  49. package/dist/types/annotation/index.d.ts +5 -0
  50. package/dist/types/common/errors/{webinar-registration-error.d.ts → join-webinar-error.d.ts} +2 -2
  51. package/dist/types/common/errors/multistream-not-supported-error.d.ts +17 -0
  52. package/dist/types/constants.d.ts +20 -1
  53. package/dist/types/index.d.ts +3 -3
  54. package/dist/types/locus-info/index.d.ts +2 -1
  55. package/dist/types/meeting/index.d.ts +19 -12
  56. package/dist/types/meeting/locusMediaRequest.d.ts +4 -0
  57. package/dist/types/meeting/request.d.ts +12 -1
  58. package/dist/types/meeting/request.type.d.ts +6 -0
  59. package/dist/types/meeting/util.d.ts +1 -1
  60. package/dist/types/meeting-info/meeting-info-v2.d.ts +4 -4
  61. package/dist/types/meetings/index.d.ts +3 -0
  62. package/dist/types/member/index.d.ts +1 -0
  63. package/dist/types/member/types.d.ts +7 -0
  64. package/dist/types/metrics/constants.d.ts +1 -1
  65. package/dist/types/multistream/sendSlotManager.d.ts +8 -1
  66. package/dist/webinar/index.js +354 -3
  67. package/dist/webinar/index.js.map +1 -1
  68. package/package.json +23 -22
  69. package/src/annotation/index.ts +16 -0
  70. package/src/common/errors/join-webinar-error.ts +24 -0
  71. package/src/common/errors/multistream-not-supported-error.ts +30 -0
  72. package/src/config.ts +1 -1
  73. package/src/constants.ts +23 -3
  74. package/src/index.ts +5 -3
  75. package/src/locus-info/index.ts +17 -2
  76. package/src/locus-info/selfUtils.ts +19 -6
  77. package/src/meeting/index.ts +234 -80
  78. package/src/meeting/locusMediaRequest.ts +7 -0
  79. package/src/meeting/request.ts +26 -1
  80. package/src/meeting/request.type.ts +7 -0
  81. package/src/meeting/util.ts +8 -10
  82. package/src/meeting-info/meeting-info-v2.ts +23 -11
  83. package/src/meetings/index.ts +8 -2
  84. package/src/meetings/util.ts +2 -1
  85. package/src/member/index.ts +9 -0
  86. package/src/member/types.ts +8 -0
  87. package/src/member/util.ts +34 -24
  88. package/src/metrics/constants.ts +1 -1
  89. package/src/multistream/remoteMedia.ts +28 -15
  90. package/src/multistream/sendSlotManager.ts +31 -0
  91. package/src/roap/index.ts +10 -8
  92. package/src/webinar/index.ts +197 -3
  93. package/test/unit/spec/annotation/index.ts +46 -1
  94. package/test/unit/spec/locus-info/index.js +222 -0
  95. package/test/unit/spec/locus-info/selfConstant.js +7 -0
  96. package/test/unit/spec/locus-info/selfUtils.js +91 -1
  97. package/test/unit/spec/meeting/index.js +683 -103
  98. package/test/unit/spec/meeting/utils.js +22 -19
  99. package/test/unit/spec/meeting-info/meetinginfov2.js +9 -4
  100. package/test/unit/spec/meetings/index.js +9 -5
  101. package/test/unit/spec/meetings/utils.js +10 -0
  102. package/test/unit/spec/member/util.js +52 -11
  103. package/test/unit/spec/multistream/remoteMedia.ts +11 -7
  104. package/test/unit/spec/roap/index.ts +47 -0
  105. package/test/unit/spec/webinar/index.ts +457 -0
  106. package/dist/common/errors/webinar-registration-error.js.map +0 -1
  107. package/src/common/errors/webinar-registration-error.ts +0 -27
@@ -837,6 +837,14 @@ export default class Meeting extends StatelessWebexPlugin {
837
837
  authorizingLocusUrl: string;
838
838
  mainLocusUrl: string;
839
839
  }): any;
840
+ /**
841
+ * Manages be right back status updates for the current participant.
842
+ *
843
+ * @param {boolean} enabled - Indicates whether the user enabled brb or not.
844
+ * @returns {Promise<void>} resolves when the brb status is updated or does nothing if not in a multistream meeting.
845
+ * @throws {Error} - Throws an error if the request fails.
846
+ */
847
+ beRightBack(enabled: boolean): Promise<void>;
840
848
  /**
841
849
  * Remove the member from the meeting, boot them
842
850
  * @param {String} memberId
@@ -1046,11 +1054,12 @@ export default class Meeting extends StatelessWebexPlugin {
1046
1054
  * Close the peer connections and remove them from the class.
1047
1055
  * Cleanup any media connection related things.
1048
1056
  *
1057
+ * @param {boolean} resetMuteStates whether to also reset the audio/video mute state information
1049
1058
  * @returns {Promise}
1050
1059
  * @public
1051
1060
  * @memberof Meeting
1052
1061
  */
1053
- closePeerConnections(): Promise<void>;
1062
+ closePeerConnections(resetMuteStates?: boolean): Promise<void>;
1054
1063
  /**
1055
1064
  * Unsets the peer connections on the class
1056
1065
  * warning DO NOT CALL WITHOUT CLOSING PEER CONNECTIONS FIRST
@@ -1115,7 +1124,7 @@ export default class Meeting extends StatelessWebexPlugin {
1115
1124
  * @param {Object} options - options to join with media
1116
1125
  * @param {JoinOptions} [options.joinOptions] - see #join()
1117
1126
  * @param {AddMediaOptions} [options.mediaOptions] - see #addMedia()
1118
- * @returns {Promise} -- {join: see join(), media: see addMedia()}
1127
+ * @returns {Promise} -- {join: see join(), media: see addMedia(), multistreamEnabled: flag to indicate if we managed to join in multistream mode}
1119
1128
  * @public
1120
1129
  * @memberof Meeting
1121
1130
  * @example
@@ -1337,16 +1346,6 @@ export default class Meeting extends StatelessWebexPlugin {
1337
1346
  * @returns {void}
1338
1347
  */
1339
1348
  private createStatsAnalyzer;
1340
- /**
1341
- * Handles device logging
1342
- *
1343
- * @private
1344
- * @static
1345
- * @param {boolean} isAudioEnabled
1346
- * @param {boolean} isVideoEnabled
1347
- * @returns {Promise<void>}
1348
- */
1349
- private static handleDeviceLogging;
1350
1349
  /**
1351
1350
  * Returns a promise. This promise is created once the local sdp offer has been successfully created and is resolved
1352
1351
  * once the remote sdp answer has been received.
@@ -1412,6 +1411,14 @@ export default class Meeting extends StatelessWebexPlugin {
1412
1411
  * @returns {Promise<void>}
1413
1412
  */
1414
1413
  private cleanUpOnAddMediaFailure;
1414
+ /**
1415
+ * Cleans up stats analyzer, peer connection and other things before
1416
+ * we can create a new transcoded media connection
1417
+ *
1418
+ * @private
1419
+ * @returns {Promise<void>}
1420
+ */
1421
+ private downgradeFromMultistreamToTranscoded;
1415
1422
  /**
1416
1423
  * Sends stats report, closes peer connection and cleans up any media connection
1417
1424
  * related things before trying to establish media connection again with turn server
@@ -73,4 +73,8 @@ export declare class LocusMediaRequest extends WebexPlugin {
73
73
  send(request: Request): Promise<RequestResult>;
74
74
  /** Returns true if a confluence on the server is already created */
75
75
  isConfluenceCreated(): boolean;
76
+ /**
77
+ * This method needs to be called when we downgrade from multistream to transcoded connection.
78
+ */
79
+ downgradeFromMultistreamToTranscoded(): void;
76
80
  }
@@ -1,5 +1,5 @@
1
1
  import { StatelessWebexPlugin } from '@webex/webex-core';
2
- import { SendReactionOptions, ToggleReactionsOptions } from './request.type';
2
+ import { SendReactionOptions, BrbOptions, ToggleReactionsOptions } from './request.type';
3
3
  import { AnnotationInfo } from '../annotation/annotation.types';
4
4
  import { ClientMediaPreferences } from '../reachability/reachability.types';
5
5
  /**
@@ -292,4 +292,15 @@ export default class MeetingRequest extends StatelessWebexPlugin {
292
292
  */
293
293
  toggleReactions({ enable, locusUrl, requestingParticipantId }: ToggleReactionsOptions): Promise<any>;
294
294
  getLocusStatusByUrl(locusUrl: string): any;
295
+ /**
296
+ * Sends a request to set be right back status.
297
+ *
298
+ * @param {Object} options - The options for brb request.
299
+ * @param {boolean} options.enabled - Whether brb status is enabled.
300
+ * @param {string} options.locusUrl - The URL of the locus.
301
+ * @param {string} options.deviceUrl - The URL of the device.
302
+ * @param {string} options.selfId - The ID of the participant.
303
+ * @returns {Promise}
304
+ */
305
+ setBrb({ enabled, locusUrl, deviceUrl, selfId }: BrbOptions): Promise<any>;
295
306
  }
@@ -9,3 +9,9 @@ export type ToggleReactionsOptions = {
9
9
  locusUrl: string;
10
10
  requestingParticipantId: string;
11
11
  };
12
+ export type BrbOptions = {
13
+ enabled: boolean;
14
+ locusUrl: string;
15
+ deviceUrl: string;
16
+ selfId: string;
17
+ };
@@ -54,6 +54,7 @@ declare const MeetingUtil: {
54
54
  canUserLowerSomeoneElsesHand: (displayHints: any) => any;
55
55
  bothLeaveAndEndMeetingAvailable: (displayHints: any) => any;
56
56
  canManageBreakout: (displayHints: any) => any;
57
+ canStartBreakout: (displayHints: any) => boolean;
57
58
  canBroadcastMessageToBreakout: (displayHints: any, policies?: {}) => boolean;
58
59
  isSuppressBreakoutSupport: (displayHints: any) => any;
59
60
  canAdmitLobbyToBreakout: (displayHints: any) => boolean;
@@ -63,7 +64,6 @@ declare const MeetingUtil: {
63
64
  unlockMeeting: (actions: any, request: any, locusUrl: any) => any;
64
65
  handleAudioLogging: (audioStream?: LocalMicrophoneStream) => void;
65
66
  handleVideoLogging: (videoStream?: LocalCameraStream) => void;
66
- handleDeviceLogging: (devices?: any[]) => void;
67
67
  endMeetingForAll: (meeting: any) => any;
68
68
  canEnableClosedCaption: (displayHints: any) => any;
69
69
  isSaveTranscriptsEnabled: (displayHints: any) => any;
@@ -65,9 +65,9 @@ export declare class MeetingInfoV2CaptchaError extends Error {
65
65
  constructor(wbxAppApiErrorCode?: number, captchaInfo?: object, message?: string);
66
66
  }
67
67
  /**
68
- * Error preventing join because of a webinar registration error
68
+ * Error preventing join because of a webinar have some error
69
69
  */
70
- export declare class MeetingInfoV2WebinarRegistrationError extends Error {
70
+ export declare class MeetingInfoV2JoinWebinarError extends Error {
71
71
  meetingInfo: any;
72
72
  sdkMessage: any;
73
73
  wbxAppApiCode: any;
@@ -107,11 +107,11 @@ export default class MeetingInfoV2 {
107
107
  */
108
108
  handlePolicyError: (err: any) => void;
109
109
  /**
110
- * Raises a handleWebinarRegistrationError for webinar registration error codes
110
+ * Raises a handleJoinWebinarError for join webinar error codes
111
111
  * @param {any} err the error from the request
112
112
  * @returns {void}
113
113
  */
114
- handleWebinarRegistrationError: (err: any) => void;
114
+ handleJoinWebinarError: (err: any) => void;
115
115
  /**
116
116
  * Creates adhoc space meetings for a space by fetching the conversation infomation
117
117
  * @param {String} conversationUrl conversationUrl to start adhoc meeting on
@@ -71,6 +71,9 @@ export type BasicMeetingInformation = {
71
71
  };
72
72
  meetingInfo: any;
73
73
  sessionCorrelationId: string;
74
+ roles: string[];
75
+ getCurUserType: () => string | null;
76
+ callStateForMetrics: CallStateForMetrics;
74
77
  };
75
78
  /**
76
79
  * Maintain a cache of meetings and sync with services.
@@ -21,6 +21,7 @@ export default class Member {
21
21
  isRecording: any;
22
22
  isRemovable: any;
23
23
  isSelf: any;
24
+ isBrb: boolean;
24
25
  isUser: any;
25
26
  isVideoMuted: any;
26
27
  roles: IExternalRoles;
@@ -19,6 +19,13 @@ export type ParticipantWithRoles = {
19
19
  };
20
20
  };
21
21
  };
22
+ export type ParticipantWithBrb = {
23
+ controls: {
24
+ brb?: {
25
+ enabled: boolean;
26
+ };
27
+ };
28
+ };
22
29
  export declare enum MediaStatus {
23
30
  RECVONLY = "RECVONLY",
24
31
  SENDONLY = "SENDONLY",
@@ -67,7 +67,7 @@ declare const BEHAVIORAL_METRICS: {
67
67
  ROAP_HTTP_RESPONSE_MISSING: string;
68
68
  TURN_DISCOVERY_REQUIRES_OK: string;
69
69
  REACHABILITY_COMPLETED: string;
70
- WEBINAR_REGISTRATION_ERROR: string;
70
+ JOIN_WEBINAR_ERROR: string;
71
71
  GUEST_ENTERED_LOBBY: string;
72
72
  GUEST_EXITED_LOBBY: string;
73
73
  };
@@ -1,4 +1,4 @@
1
- import { SendSlot, MediaType, LocalStream, MultistreamRoapMediaConnection, NamedMediaGroup } from '@webex/internal-media-core';
1
+ import { SendSlot, MediaType, LocalStream, MultistreamRoapMediaConnection, NamedMediaGroup, StreamState } from '@webex/internal-media-core';
2
2
  export default class SendSlotManager {
3
3
  private readonly slots;
4
4
  private readonly LoggerProxy;
@@ -25,6 +25,13 @@ export default class SendSlotManager {
25
25
  * @returns {void}
26
26
  */
27
27
  setNamedMediaGroups(mediaType: MediaType, namedMediaGroups: NamedMediaGroup[]): void;
28
+ /**
29
+ * Sets the source state override for the given media type.
30
+ * @param {MediaType} mediaType - The type of media (must be MediaType.VideoMain to apply source state changes).
31
+ * @param {StreamState | null} state - The state to set or null to clear the override value.
32
+ * @returns {void}
33
+ */
34
+ setSourceStateOverride(mediaType: MediaType, state: StreamState | null): void;
28
35
  /**
29
36
  * This method publishes the given stream to the sendSlot for the given mediaType
30
37
  * @param {MediaType} mediaType MediaType of the sendSlot to which a stream needs to be published (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)
@@ -6,7 +6,11 @@ _Object$defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.default = void 0;
9
+ var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
10
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
11
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
9
12
  var _webexCore = require("@webex/webex-core");
13
+ var _uuid = _interopRequireDefault(require("uuid"));
10
14
  var _lodash = require("lodash");
11
15
  var _constants = require("../constants");
12
16
  var _collection = _interopRequireDefault(require("./collection"));
@@ -34,7 +38,9 @@ var Webinar = _webexCore.WebexPlugin.extend({
34
38
  // self is panelist
35
39
  selfIsAttendee: 'boolean',
36
40
  // self is attendee
37
- practiceSessionEnabled: 'boolean' // practice session enabled
41
+ practiceSessionEnabled: 'boolean',
42
+ // practice session enabled
43
+ meetingId: 'string'
38
44
  },
39
45
  /**
40
46
  * Update the current locus url of the webinar
@@ -71,15 +77,46 @@ var Webinar = _webexCore.WebexPlugin.extend({
71
77
  var oldRoles = (0, _lodash.get)(payload, 'oldRoles', []);
72
78
  var newRoles = (0, _lodash.get)(payload, 'newRoles', []);
73
79
  var isPromoted = oldRoles.includes(_constants.SELF_ROLES.ATTENDEE) && newRoles.includes(_constants.SELF_ROLES.PANELIST);
74
- var isDemoted = oldRoles.includes(_constants.SELF_ROLES.PANELIST) && newRoles.includes(_constants.SELF_ROLES.ATTENDEE);
80
+ var isDemoted = oldRoles.includes(_constants.SELF_ROLES.PANELIST) && newRoles.includes(_constants.SELF_ROLES.ATTENDEE) || !oldRoles.includes(_constants.SELF_ROLES.ATTENDEE) && newRoles.includes(_constants.SELF_ROLES.ATTENDEE); // for attendee just join meeting case
75
81
  this.set('selfIsPanelist', newRoles.includes(_constants.SELF_ROLES.PANELIST));
76
82
  this.set('selfIsAttendee', newRoles.includes(_constants.SELF_ROLES.ATTENDEE));
77
83
  this.updateCanManageWebcast(newRoles.includes(_constants.SELF_ROLES.MODERATOR));
84
+ this.updateStatusByRole({
85
+ isPromoted: isPromoted,
86
+ isDemoted: isDemoted
87
+ });
78
88
  return {
79
89
  isPromoted: isPromoted,
80
90
  isDemoted: isDemoted
81
91
  };
82
92
  },
93
+ /**
94
+ * should join practice session data channel or not
95
+ * @param {Object} {isPromoted: boolean, isDemoted: boolean}} Role transition states
96
+ * @returns {void}
97
+ */
98
+ updateStatusByRole: function updateStatusByRole(_ref) {
99
+ var isPromoted = _ref.isPromoted,
100
+ isDemoted = _ref.isDemoted;
101
+ var meeting = this.webex.meetings.getMeetingByType(_constants._ID_, this.meetingId);
102
+ if (isDemoted && (meeting === null || meeting === void 0 ? void 0 : meeting.shareStatus) === _constants.SHARE_STATUS.WHITEBOARD_SHARE_ACTIVE || isPromoted) {
103
+ var _meeting$locusInfo, _meeting$locusInfo2;
104
+ // attendees in webinar should subscribe streaming for whiteboard sharing
105
+ // while panelist still need subscribe native mode so trigger force update here
106
+ meeting === null || meeting === void 0 ? void 0 : (_meeting$locusInfo = meeting.locusInfo) === null || _meeting$locusInfo === void 0 ? void 0 : _meeting$locusInfo.updateMediaShares(meeting === null || meeting === void 0 ? void 0 : (_meeting$locusInfo2 = meeting.locusInfo) === null || _meeting$locusInfo2 === void 0 ? void 0 : _meeting$locusInfo2.mediaShares, true);
107
+ }
108
+ if (this.practiceSessionEnabled) {
109
+ // may need change data channel in practice session
110
+ meeting === null || meeting === void 0 ? void 0 : meeting.updateLLMConnection();
111
+ }
112
+ },
113
+ /**
114
+ * should join practice session data channel or not
115
+ * @returns {boolean}
116
+ */
117
+ isJoinPracticeSessionDataChannel: function isJoinPracticeSessionDataChannel() {
118
+ return this.selfIsPanelist && this.practiceSessionEnabled;
119
+ },
83
120
  /**
84
121
  * start or stop practice session for webinar
85
122
  * @param {boolean} enabled
@@ -107,7 +144,321 @@ var Webinar = _webexCore.WebexPlugin.extend({
107
144
  updatePracticeSessionStatus: function updatePracticeSessionStatus(payload) {
108
145
  this.set('practiceSessionEnabled', payload.enabled);
109
146
  },
110
- version: "3.7.0-next.8"
147
+ /**
148
+ * start webcast mode for webinar
149
+ * @param {object} meeting
150
+ * @param {object} layout
151
+ * @returns {Promise}
152
+ */
153
+ startWebcast: function startWebcast(meeting, layout) {
154
+ var _this = this;
155
+ return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
156
+ return _regenerator.default.wrap(function _callee$(_context) {
157
+ while (1) switch (_context.prev = _context.next) {
158
+ case 0:
159
+ if (meeting) {
160
+ _context.next = 3;
161
+ break;
162
+ }
163
+ _loggerProxy.default.logger.error("Meeting:webinar#startWebcast failed --> meeting parameter : ".concat(meeting));
164
+ throw new Error('Meeting parameter does not meet expectations');
165
+ case 3:
166
+ _context.t0 = _this;
167
+ _context.t1 = _constants.HTTP_VERBS.PUT;
168
+ _context.t2 = "".concat(_this.webcastInstanceUrl, "/streaming");
169
+ _context.t3 = _defineProperty2.default;
170
+ _context.next = 9;
171
+ return _this.webex.credentials.getUserToken();
172
+ case 9:
173
+ _context.t4 = _context.sent;
174
+ _context.t5 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
175
+ _context.t6 = {
176
+ authorization: _context.t4,
177
+ trackingId: _context.t5
178
+ };
179
+ _context.t7 = _constants.HEADERS.CONTENT_TYPE;
180
+ _context.t8 = _constants.HEADERS.CONTENT_TYPE_VALUE.APPLICATION_JSON;
181
+ _context.t9 = (0, _context.t3)(_context.t6, _context.t7, _context.t8);
182
+ _context.t10 = {
183
+ action: 'start',
184
+ meetingInfo: {
185
+ locusId: meeting.locusId,
186
+ correlationId: meeting.correlationId
187
+ },
188
+ layout: layout
189
+ };
190
+ _context.t11 = {
191
+ method: _context.t1,
192
+ uri: _context.t2,
193
+ headers: _context.t9,
194
+ body: _context.t10
195
+ };
196
+ return _context.abrupt("return", _context.t0.request.call(_context.t0, _context.t11).catch(function (error) {
197
+ _loggerProxy.default.logger.error('Meeting:webinar#startWebcast failed', error);
198
+ throw error;
199
+ }));
200
+ case 18:
201
+ case "end":
202
+ return _context.stop();
203
+ }
204
+ }, _callee);
205
+ }))();
206
+ },
207
+ /**
208
+ * stop webcast mode for webinar
209
+ * @returns {Promise}
210
+ */
211
+ stopWebcast: function stopWebcast() {
212
+ var _this2 = this;
213
+ return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
214
+ return _regenerator.default.wrap(function _callee2$(_context2) {
215
+ while (1) switch (_context2.prev = _context2.next) {
216
+ case 0:
217
+ _context2.t0 = _this2;
218
+ _context2.t1 = _constants.HTTP_VERBS.PUT;
219
+ _context2.t2 = "".concat(_this2.webcastInstanceUrl, "/streaming");
220
+ _context2.t3 = _defineProperty2.default;
221
+ _context2.next = 6;
222
+ return _this2.webex.credentials.getUserToken();
223
+ case 6:
224
+ _context2.t4 = _context2.sent;
225
+ _context2.t5 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
226
+ _context2.t6 = {
227
+ authorization: _context2.t4,
228
+ trackingId: _context2.t5
229
+ };
230
+ _context2.t7 = _constants.HEADERS.CONTENT_TYPE;
231
+ _context2.t8 = _constants.HEADERS.CONTENT_TYPE_VALUE.APPLICATION_JSON;
232
+ _context2.t9 = (0, _context2.t3)(_context2.t6, _context2.t7, _context2.t8);
233
+ _context2.t10 = {
234
+ action: 'stop'
235
+ };
236
+ _context2.t11 = {
237
+ method: _context2.t1,
238
+ uri: _context2.t2,
239
+ headers: _context2.t9,
240
+ body: _context2.t10
241
+ };
242
+ return _context2.abrupt("return", _context2.t0.request.call(_context2.t0, _context2.t11).catch(function (error) {
243
+ _loggerProxy.default.logger.error('Meeting:webinar#stopWebcast failed', error);
244
+ throw error;
245
+ }));
246
+ case 15:
247
+ case "end":
248
+ return _context2.stop();
249
+ }
250
+ }, _callee2);
251
+ }))();
252
+ },
253
+ /**
254
+ * query webcast layout for webinar
255
+ * @returns {Promise}
256
+ */
257
+ queryWebcastLayout: function queryWebcastLayout() {
258
+ var _this3 = this;
259
+ return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
260
+ return _regenerator.default.wrap(function _callee3$(_context3) {
261
+ while (1) switch (_context3.prev = _context3.next) {
262
+ case 0:
263
+ _context3.t0 = _this3;
264
+ _context3.t1 = _constants.HTTP_VERBS.GET;
265
+ _context3.t2 = "".concat(_this3.webcastInstanceUrl, "/layout");
266
+ _context3.next = 5;
267
+ return _this3.webex.credentials.getUserToken();
268
+ case 5:
269
+ _context3.t3 = _context3.sent;
270
+ _context3.t4 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
271
+ _context3.t5 = {
272
+ authorization: _context3.t3,
273
+ trackingId: _context3.t4
274
+ };
275
+ _context3.t6 = {
276
+ method: _context3.t1,
277
+ uri: _context3.t2,
278
+ headers: _context3.t5
279
+ };
280
+ return _context3.abrupt("return", _context3.t0.request.call(_context3.t0, _context3.t6).catch(function (error) {
281
+ _loggerProxy.default.logger.error('Meeting:webinar#queryWebcastLayout failed', error);
282
+ throw error;
283
+ }));
284
+ case 10:
285
+ case "end":
286
+ return _context3.stop();
287
+ }
288
+ }, _callee3);
289
+ }))();
290
+ },
291
+ /**
292
+ * update webcast layout for webinar
293
+ * @param {object} layout
294
+ * @returns {Promise}
295
+ */
296
+ updateWebcastLayout: function updateWebcastLayout(layout) {
297
+ var _this4 = this;
298
+ return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
299
+ return _regenerator.default.wrap(function _callee4$(_context4) {
300
+ while (1) switch (_context4.prev = _context4.next) {
301
+ case 0:
302
+ _context4.t0 = _this4;
303
+ _context4.t1 = _constants.HTTP_VERBS.PUT;
304
+ _context4.t2 = "".concat(_this4.webcastInstanceUrl, "/layout");
305
+ _context4.t3 = _defineProperty2.default;
306
+ _context4.next = 6;
307
+ return _this4.webex.credentials.getUserToken();
308
+ case 6:
309
+ _context4.t4 = _context4.sent;
310
+ _context4.t5 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
311
+ _context4.t6 = {
312
+ authorization: _context4.t4,
313
+ trackingId: _context4.t5
314
+ };
315
+ _context4.t7 = _constants.HEADERS.CONTENT_TYPE;
316
+ _context4.t8 = _constants.HEADERS.CONTENT_TYPE_VALUE.APPLICATION_JSON;
317
+ _context4.t9 = (0, _context4.t3)(_context4.t6, _context4.t7, _context4.t8);
318
+ _context4.t10 = {
319
+ videoLayout: layout.videoLayout,
320
+ contentLayout: layout.contentLayout,
321
+ syncStageLayout: layout.syncStageLayout,
322
+ syncStageInMeeting: layout.syncStageInMeeting
323
+ };
324
+ _context4.t11 = {
325
+ method: _context4.t1,
326
+ uri: _context4.t2,
327
+ headers: _context4.t9,
328
+ body: _context4.t10
329
+ };
330
+ return _context4.abrupt("return", _context4.t0.request.call(_context4.t0, _context4.t11).catch(function (error) {
331
+ _loggerProxy.default.logger.error('Meeting:webinar#updateWebcastLayout failed', error);
332
+ throw error;
333
+ }));
334
+ case 15:
335
+ case "end":
336
+ return _context4.stop();
337
+ }
338
+ }, _callee4);
339
+ }))();
340
+ },
341
+ /**
342
+ * view all webcast attendees
343
+ * @param {string} queryString
344
+ * @returns {Promise}
345
+ */
346
+ viewAllWebcastAttendees: function viewAllWebcastAttendees() {
347
+ var _this5 = this;
348
+ return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
349
+ return _regenerator.default.wrap(function _callee5$(_context5) {
350
+ while (1) switch (_context5.prev = _context5.next) {
351
+ case 0:
352
+ _context5.t0 = _this5;
353
+ _context5.t1 = _constants.HTTP_VERBS.GET;
354
+ _context5.t2 = "".concat(_this5.webcastInstanceUrl, "/attendees");
355
+ _context5.next = 5;
356
+ return _this5.webex.credentials.getUserToken();
357
+ case 5:
358
+ _context5.t3 = _context5.sent;
359
+ _context5.t4 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
360
+ _context5.t5 = {
361
+ authorization: _context5.t3,
362
+ trackingId: _context5.t4
363
+ };
364
+ _context5.t6 = {
365
+ method: _context5.t1,
366
+ uri: _context5.t2,
367
+ headers: _context5.t5
368
+ };
369
+ return _context5.abrupt("return", _context5.t0.request.call(_context5.t0, _context5.t6).catch(function (error) {
370
+ _loggerProxy.default.logger.error('Meeting:webinar#viewAllWebcastAttendees failed', error);
371
+ throw error;
372
+ }));
373
+ case 10:
374
+ case "end":
375
+ return _context5.stop();
376
+ }
377
+ }, _callee5);
378
+ }))();
379
+ },
380
+ /**
381
+ * search webcast attendees by query string
382
+ * @param {string} queryString
383
+ * @returns {Promise}
384
+ */
385
+ searchWebcastAttendees: function searchWebcastAttendees() {
386
+ var _arguments = arguments,
387
+ _this6 = this;
388
+ return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
389
+ var queryString;
390
+ return _regenerator.default.wrap(function _callee6$(_context6) {
391
+ while (1) switch (_context6.prev = _context6.next) {
392
+ case 0:
393
+ queryString = _arguments.length > 0 && _arguments[0] !== undefined ? _arguments[0] : '';
394
+ _context6.t0 = _this6;
395
+ _context6.t1 = _constants.HTTP_VERBS.GET;
396
+ _context6.t2 = "".concat(_this6.webcastInstanceUrl, "/attendees?keyword=").concat(encodeURIComponent(queryString));
397
+ _context6.next = 6;
398
+ return _this6.webex.credentials.getUserToken();
399
+ case 6:
400
+ _context6.t3 = _context6.sent;
401
+ _context6.t4 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
402
+ _context6.t5 = {
403
+ authorization: _context6.t3,
404
+ trackingId: _context6.t4
405
+ };
406
+ _context6.t6 = {
407
+ method: _context6.t1,
408
+ uri: _context6.t2,
409
+ headers: _context6.t5
410
+ };
411
+ return _context6.abrupt("return", _context6.t0.request.call(_context6.t0, _context6.t6).catch(function (error) {
412
+ _loggerProxy.default.logger.error('Meeting:webinar#searchWebcastAttendees failed', error);
413
+ throw error;
414
+ }));
415
+ case 11:
416
+ case "end":
417
+ return _context6.stop();
418
+ }
419
+ }, _callee6);
420
+ }))();
421
+ },
422
+ /**
423
+ * expel webcast attendee by participantId
424
+ * @param {string} participantId
425
+ * @returns {Promise}
426
+ */
427
+ expelWebcastAttendee: function expelWebcastAttendee(participantId) {
428
+ var _this7 = this;
429
+ return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
430
+ return _regenerator.default.wrap(function _callee7$(_context7) {
431
+ while (1) switch (_context7.prev = _context7.next) {
432
+ case 0:
433
+ _context7.t0 = _this7;
434
+ _context7.t1 = _constants.HTTP_VERBS.DELETE;
435
+ _context7.t2 = "".concat(_this7.webcastInstanceUrl, "/attendees/").concat(participantId);
436
+ _context7.next = 5;
437
+ return _this7.webex.credentials.getUserToken();
438
+ case 5:
439
+ _context7.t3 = _context7.sent;
440
+ _context7.t4 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
441
+ _context7.t5 = {
442
+ authorization: _context7.t3,
443
+ trackingId: _context7.t4
444
+ };
445
+ _context7.t6 = {
446
+ method: _context7.t1,
447
+ uri: _context7.t2,
448
+ headers: _context7.t5
449
+ };
450
+ return _context7.abrupt("return", _context7.t0.request.call(_context7.t0, _context7.t6).catch(function (error) {
451
+ _loggerProxy.default.logger.error('Meeting:webinar#expelWebcastAttendee failed', error);
452
+ throw error;
453
+ }));
454
+ case 10:
455
+ case "end":
456
+ return _context7.stop();
457
+ }
458
+ }, _callee7);
459
+ }))();
460
+ },
461
+ version: "3.7.0-web-workers-keepalive.1"
111
462
  });
112
463
  var _default = exports.default = Webinar;
113
464
  //# sourceMappingURL=index.js.map