@reactoo/watchtogether-sdk-js 2.4.34 → 2.4.35

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,6 +1,6 @@
1
1
  /*!
2
2
  * @reactoo/watchtogether-sdk-js
3
- * @version 2.4.34
3
+ * @version 2.4.35
4
4
  */
5
5
  (function webpackUniversalModuleDefinition(root, factory) {
6
6
  if(typeof exports === 'object' && typeof module === 'object')
@@ -9241,7 +9241,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _mod
9241
9241
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
9242
9242
 
9243
9243
  "use strict";
9244
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _room_session__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./room-session */ \"./src/models/room-session.js\");\n/* harmony import */ var _streaming_session__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./streaming-session */ \"./src/models/streaming-session.js\");\n\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\nvar room = function room() {\n var _this = this;\n\n return {\n //TODO: should have own model\n integration: function integration() {\n var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.system.integration({\n type: _this.__instanceType\n }, {\n requestBody: _objectSpread({}, data),\n requestInterceptor: function requestInterceptor(req) {\n if (!req.headers) {\n req.headers = {};\n }\n\n req.headers['Authorization'] = 'Bearer ' + localStorage.getItem('rwt_idToken');\n return req;\n }\n });\n });\n },\n getAnalytics: function getAnalytics() {\n var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.system.getAnalytics(_objectSpread({\n instanceType: _this.__instanceType\n }, data));\n });\n },\n sendChatMessage: function sendChatMessage(_ref) {\n var roomId = _ref.roomId,\n message = _ref.message,\n options = _ref.options,\n senderUserId = _ref.senderUserId;\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.wt.sendRoomMessage({}, {\n requestBody: {\n roomId: roomId,\n message: message,\n options: options,\n senderUserId: senderUserId\n }\n });\n });\n },\n createRoom: function createRoom() {\n var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n title = _ref2.title,\n description = _ref2.description,\n isPublic = _ref2.isPublic,\n isListed = _ref2.isListed,\n isStudioLayout = _ref2.isStudioLayout,\n allowedParticipants = _ref2.allowedParticipants,\n wtChannelId = _ref2.wtChannelId,\n isHd = _ref2.isHd,\n disableSync = _ref2.disableSync,\n reduceRoomControls = _ref2.reduceRoomControls,\n muteParticipantOnJoin = _ref2.muteParticipantOnJoin,\n hasStudioChat = _ref2.hasStudioChat,\n maxParticipants = _ref2.maxParticipants,\n customAttributes = _ref2.customAttributes;\n\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.wt.createRoom({}, {\n requestBody: {\n title: title,\n description: description,\n isPublic: isPublic,\n isListed: isListed,\n isStudioLayout: isStudioLayout,\n instanceType: _this.__instanceType,\n allowedParticipants: allowedParticipants,\n wtChannelId: wtChannelId,\n isHd: isHd,\n disableSync: disableSync,\n reduceRoomControls: reduceRoomControls,\n muteParticipantOnJoin: muteParticipantOnJoin,\n hasStudioChat: hasStudioChat,\n maxParticipants: maxParticipants,\n customAttributes: customAttributes\n }\n });\n });\n },\n updateRoom: function updateRoom() {\n var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n roomId = _ref3.roomId,\n title = _ref3.title,\n description = _ref3.description,\n isPublic = _ref3.isPublic,\n isListed = _ref3.isListed,\n allowedParticipants = _ref3.allowedParticipants,\n recordings = _ref3.recordings,\n slug = _ref3.slug,\n password = _ref3.password,\n maxParticipants = _ref3.maxParticipants,\n _ref3$setInstanceType = _ref3.setInstanceType,\n setInstanceType = _ref3$setInstanceType === void 0 ? false : _ref3$setInstanceType,\n wtChannelId = _ref3.wtChannelId,\n isHd = _ref3.isHd,\n isStudioLayout = _ref3.isStudioLayout,\n hasStudioChat = _ref3.hasStudioChat,\n reduceRoomControls = _ref3.reduceRoomControls,\n muteParticipantOnJoin = _ref3.muteParticipantOnJoin,\n disableSync = _ref3.disableSync,\n defaultRegion = _ref3.defaultRegion,\n customAttributes = _ref3.customAttributes,\n dotAttribute = _ref3.dotAttribute;\n\n var _da = dotAttribute ? Array.isArray(dotAttribute) ? dotAttribute.reduce(function (p, cv) {\n return (p[cv.name] = cv.value) && p || p;\n }, {}) : _defineProperty({}, dotAttribute.name, dotAttribute.value) : {};\n\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.wt.updateRoom({\n id: roomId\n }, {\n requestBody: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, _da), {}, {\n title: title,\n description: description,\n slug: slug,\n password: password,\n isPublic: isPublic,\n isListed: isListed,\n isHd: isHd,\n isStudioLayout: isStudioLayout,\n hasStudioChat: hasStudioChat,\n maxParticipants: maxParticipants,\n reduceRoomControls: reduceRoomControls,\n muteParticipantOnJoin: muteParticipantOnJoin,\n disableSync: disableSync,\n defaultRegion: defaultRegion,\n customAttributes: customAttributes,\n wtChannelId: wtChannelId\n }, setInstanceType && {\n instanceType: setInstanceType === true ? _this.__instanceType : setInstanceType\n }), allowedParticipants && {\n allowedParticipants: allowedParticipants\n }), recordings && {\n recordings: recordings\n })\n });\n });\n },\n deleteRoom: function deleteRoom(roomId) {\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.wt.deleteRoom({\n id: roomId\n });\n });\n },\n leaveRoom: function leaveRoom(roomId) {\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.wt.leave({\n roomId: roomId\n });\n });\n },\n updateLayout: function updateLayout(_ref5) {\n var roomId = _ref5.roomId,\n operation = _ref5.operation,\n name = _ref5.name,\n attributeName = _ref5.attributeName,\n value = _ref5.value,\n target = _ref5.target;\n //operation : clearLayouts, setLayout, setLayouts, unsetLayout, setName, setTarget, setStyle, setAttribute, unsetAttribute,'sendMessage'\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.wt.updateLayout({}, {\n requestBody: {\n roomId: roomId,\n operation: operation,\n name: name,\n attributeName: attributeName,\n value: value,\n target: target\n }\n });\n });\n },\n getInviteUrl: function getInviteUrl(roomId, domain, url) {\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.wt.invite({}, {\n requestBody: {\n roomId: roomId,\n domain: domain || location.host,\n url: url || location.href\n }\n });\n });\n },\n getRoomsList: function getRoomsList() {\n var _ref6 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref6$type = _ref6.type,\n type = _ref6$type === void 0 ? 'participant' : _ref6$type,\n _ref6$activeOnly = _ref6.activeOnly,\n activeOnly = _ref6$activeOnly === void 0 ? null : _ref6$activeOnly,\n _ref6$instanceType = _ref6.instanceType,\n instanceType = _ref6$instanceType === void 0 ? _this.__instanceType : _ref6$instanceType,\n _ref6$size = _ref6.size,\n size = _ref6$size === void 0 ? 20 : _ref6$size,\n _ref6$startKey = _ref6.startKey,\n startKey = _ref6$startKey === void 0 ? null : _ref6$startKey,\n _ref6$includeWtEventM = _ref6.includeWtEventModels,\n includeWtEventModels = _ref6$includeWtEventM === void 0 ? false : _ref6$includeWtEventM,\n _ref6$demo = _ref6.demo,\n demo = _ref6$demo === void 0 ? false : _ref6$demo,\n _ref6$viewType = _ref6.viewType,\n viewType = _ref6$viewType === void 0 ? 'list' : _ref6$viewType,\n _ref6$wtChannelId = _ref6.wtChannelId,\n wtChannelId = _ref6$wtChannelId === void 0 ? undefined : _ref6$wtChannelId;\n\n var apiParams = _objectSpread(_objectSpread(_objectSpread({\n type: type,\n instanceType: instanceType,\n size: size,\n includeWtEventModels: includeWtEventModels,\n demo: demo,\n viewType: viewType\n }, wtChannelId && {\n wtChannelId: wtChannelId\n }), activeOnly && {\n activeOnly: activeOnly\n }), startKey && {\n startKey: startKey\n });\n\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.wt.getRoomList(apiParams);\n });\n },\n setUser: function setUser(_ref7) {\n var userId = _ref7.userId,\n roomId = _ref7.roomId,\n flag = _ref7.flag,\n timestamp = _ref7.timestamp,\n option = _ref7.option;\n //leave, kick, ban, unban, approve, report\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.wt.setUser({\n userId: userId,\n roomId: roomId,\n flag: flag,\n timestamp: timestamp,\n option: option\n });\n });\n },\n getRoomById: function getRoomById(id) {\n var pinHash = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n var showPublic = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;\n var demo = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.wt.getRoom({\n id: id,\n pinHash: pinHash,\n \"public\": showPublic,\n demo: demo\n });\n });\n },\n getRoomBySlug: function getRoomBySlug(slug) {\n var password = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n var showPublic = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;\n var demo = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.wt.getRoom({\n slug: slug,\n password: password,\n \"public\": showPublic,\n demo: demo\n });\n });\n },\n roomRecorder: function roomRecorder() {\n var _ref8 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n roomId = _ref8.roomId,\n _ref8$operation = _ref8.operation,\n operation = _ref8$operation === void 0 ? 'get' : _ref8$operation,\n config = _ref8.config;\n\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.wt.recordRoom({}, {\n requestBody: {\n roomId: roomId,\n operation: operation,\n config: config\n }\n });\n });\n },\n __joinRoom: function __joinRoom() {\n var _ref9 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n roomId = _ref9.roomId,\n pinHash = _ref9.pinHash,\n _ref9$instanceType = _ref9.instanceType,\n instanceType = _ref9$instanceType === void 0 ? _this.__instanceType : _ref9$instanceType,\n _ref9$isTalkback = _ref9.isTalkback,\n isTalkback = _ref9$isTalkback === void 0 ? undefined : _ref9$isTalkback,\n _ref9$isMonitor = _ref9.isMonitor,\n isMonitor = _ref9$isMonitor === void 0 ? undefined : _ref9$isMonitor,\n _ref9$isInstructor = _ref9.isInstructor,\n isInstructor = _ref9$isInstructor === void 0 ? undefined : _ref9$isInstructor,\n _ref9$customBearer = _ref9.customBearer,\n customBearer = _ref9$customBearer === void 0 ? undefined : _ref9$customBearer;\n\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.wt.join({\n roomId: roomId,\n pinHash: pinHash,\n instanceType: instanceType,\n isTalkback: isTalkback,\n isMonitor: isMonitor,\n isInstructor: isInstructor,\n platform: _this.browser === 'firefox' ? 'web-firefox' : 'web'\n }, _objectSpread({}, customBearer ? {\n requestInterceptor: function requestInterceptor(req) {\n if (!req.headers) {\n req.headers = {};\n }\n\n req.headers['Authorization'] = customBearer;\n return req;\n }\n } : {}));\n });\n },\n __isThisSafariSupported: function __isThisSafariSupported() {\n return _this.__privates.room.safariVp8;\n },\n createStreamingSession: function createStreamingSession() {\n var _ref10 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n roomId = _ref10.roomId,\n pinHash = _ref10.pinHash,\n streamId = _ref10.streamId,\n href = _ref10.href,\n iceServers = _ref10.iceServers,\n accessToken = _ref10.accessToken;\n\n return _this.__privates.room.isReady.then(function (lib) {\n return _streaming_session__WEBPACK_IMPORTED_MODULE_1__[\"default\"].call(_this, {\n roomId: roomId,\n pinHash: pinHash,\n streamId: streamId,\n href: href,\n iceServers: iceServers,\n accessToken: accessToken\n }, lib.createSession('streaming'), _this);\n });\n },\n createSession: function createSession(_ref11) {\n var roomId = _ref11.roomId,\n pinHash = _ref11.pinHash,\n isTalkback = _ref11.isTalkback,\n isMonitor = _ref11.isMonitor,\n isInstructor = _ref11.isInstructor,\n options = _ref11.options;\n return _this.__privates.room.isReady.then(function (lib) {\n return _room_session__WEBPACK_IMPORTED_MODULE_0__[\"default\"].call(_this, {\n roomId: roomId,\n pinHash: pinHash,\n isTalkback: isTalkback,\n isMonitor: isMonitor,\n isInstructor: isInstructor\n }, lib.createSession('reactooroom', options), _this);\n });\n },\n destroySession: function destroySession(constructId) {\n return _this.__privates.room.closeSessionByConstructId(constructId);\n },\n queue: function queue() {\n var _ref12 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n roomId = _ref12.roomId,\n operation = _ref12.operation,\n userId = _ref12.userId;\n\n //Enum: \"status\" \"join\" \"approve\" \"reject\" \"block\" \"unblock\"\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.wt.queue({}, {\n requestBody: {\n roomId: roomId,\n operation: operation,\n userId: userId\n }\n });\n });\n },\n getDefaultRegions: function getDefaultRegions() {\n return _this.__privates.auth.__client.then(function (client) {\n var _client$spec, _client$spec$componen, _client$spec$componen2, _client$spec$componen3, _client$spec$componen4, _client$spec$componen5;\n\n return _toConsumableArray(((_client$spec = client.spec) === null || _client$spec === void 0 ? void 0 : (_client$spec$componen = _client$spec.components) === null || _client$spec$componen === void 0 ? void 0 : (_client$spec$componen2 = _client$spec$componen.schemas) === null || _client$spec$componen2 === void 0 ? void 0 : (_client$spec$componen3 = _client$spec$componen2.WtRoom) === null || _client$spec$componen3 === void 0 ? void 0 : (_client$spec$componen4 = _client$spec$componen3.properties) === null || _client$spec$componen4 === void 0 ? void 0 : (_client$spec$componen5 = _client$spec$componen4.defaultRegion) === null || _client$spec$componen5 === void 0 ? void 0 : _client$spec$componen5.enum) || ['']);\n });\n }\n };\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (room);\n\n//# sourceURL=webpack://WatchTogetherSDK/./src/models/room.js?");
9244
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _room_session__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./room-session */ \"./src/models/room-session.js\");\n/* harmony import */ var _streaming_session__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./streaming-session */ \"./src/models/streaming-session.js\");\n\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n\nvar room = function room() {\n var _this = this;\n\n return {\n //TODO: should have own model\n integration: function integration() {\n var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.system.integration({\n type: _this.__instanceType\n }, {\n requestBody: _objectSpread({}, data),\n requestInterceptor: function requestInterceptor(req) {\n if (!req.headers) {\n req.headers = {};\n }\n\n req.headers['Authorization'] = 'Bearer ' + localStorage.getItem('rwt_idToken');\n return req;\n }\n });\n });\n },\n getAnalytics: function getAnalytics() {\n var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.system.getAnalytics(_objectSpread({\n instanceType: _this.__instanceType\n }, data));\n });\n },\n sendChatMessage: function sendChatMessage(_ref) {\n var roomId = _ref.roomId,\n message = _ref.message,\n options = _ref.options,\n senderUserId = _ref.senderUserId;\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.wt.sendRoomMessage({}, {\n requestBody: {\n roomId: roomId,\n message: message,\n options: options,\n senderUserId: senderUserId\n }\n });\n });\n },\n createRoom: function createRoom() {\n var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n title = _ref2.title,\n description = _ref2.description,\n isPublic = _ref2.isPublic,\n isListed = _ref2.isListed,\n isStudioLayout = _ref2.isStudioLayout,\n allowedParticipants = _ref2.allowedParticipants,\n wtChannelId = _ref2.wtChannelId,\n isHd = _ref2.isHd,\n disableSync = _ref2.disableSync,\n reduceRoomControls = _ref2.reduceRoomControls,\n muteParticipantOnJoin = _ref2.muteParticipantOnJoin,\n hasStudioChat = _ref2.hasStudioChat,\n maxParticipants = _ref2.maxParticipants,\n customAttributes = _ref2.customAttributes;\n\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.wt.createRoom({}, {\n requestBody: {\n title: title,\n description: description,\n isPublic: isPublic,\n isListed: isListed,\n isStudioLayout: isStudioLayout,\n instanceType: _this.__instanceType,\n allowedParticipants: allowedParticipants,\n wtChannelId: wtChannelId,\n isHd: isHd,\n disableSync: disableSync,\n reduceRoomControls: reduceRoomControls,\n muteParticipantOnJoin: muteParticipantOnJoin,\n hasStudioChat: hasStudioChat,\n maxParticipants: maxParticipants,\n customAttributes: customAttributes\n }\n });\n });\n },\n updateRoom: function updateRoom() {\n var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n roomId = _ref3.roomId,\n title = _ref3.title,\n description = _ref3.description,\n isPublic = _ref3.isPublic,\n isListed = _ref3.isListed,\n allowedParticipants = _ref3.allowedParticipants,\n recordings = _ref3.recordings,\n slug = _ref3.slug,\n password = _ref3.password,\n maxParticipants = _ref3.maxParticipants,\n _ref3$setInstanceType = _ref3.setInstanceType,\n setInstanceType = _ref3$setInstanceType === void 0 ? false : _ref3$setInstanceType,\n wtChannelId = _ref3.wtChannelId,\n isHd = _ref3.isHd,\n isStudioLayout = _ref3.isStudioLayout,\n hasStudioChat = _ref3.hasStudioChat,\n reduceRoomControls = _ref3.reduceRoomControls,\n muteParticipantOnJoin = _ref3.muteParticipantOnJoin,\n disableSync = _ref3.disableSync,\n defaultRegion = _ref3.defaultRegion,\n customAttributes = _ref3.customAttributes,\n dotAttribute = _ref3.dotAttribute;\n\n var _da = dotAttribute ? Array.isArray(dotAttribute) ? dotAttribute.reduce(function (p, cv) {\n return (p[cv.name] = cv.value) && p || p;\n }, {}) : _defineProperty({}, dotAttribute.name, dotAttribute.value) : {};\n\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.wt.updateRoom({\n id: roomId\n }, {\n requestBody: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, _da), {}, {\n title: title,\n description: description,\n slug: slug,\n password: password,\n isPublic: isPublic,\n isListed: isListed,\n isHd: isHd,\n isStudioLayout: isStudioLayout,\n hasStudioChat: hasStudioChat,\n maxParticipants: maxParticipants,\n reduceRoomControls: reduceRoomControls,\n muteParticipantOnJoin: muteParticipantOnJoin,\n disableSync: disableSync,\n defaultRegion: defaultRegion,\n customAttributes: customAttributes,\n wtChannelId: wtChannelId\n }, setInstanceType && {\n instanceType: setInstanceType === true ? _this.__instanceType : setInstanceType\n }), allowedParticipants && {\n allowedParticipants: allowedParticipants\n }), recordings && {\n recordings: recordings\n })\n });\n });\n },\n deleteRoom: function deleteRoom(roomId) {\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.wt.deleteRoom({\n id: roomId\n });\n });\n },\n leaveRoom: function leaveRoom(roomId) {\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.wt.leave({\n roomId: roomId\n });\n });\n },\n updateLayout: function updateLayout(_ref5) {\n var roomId = _ref5.roomId,\n operation = _ref5.operation,\n name = _ref5.name,\n attributeName = _ref5.attributeName,\n value = _ref5.value,\n target = _ref5.target;\n //operation : clearLayouts, setLayout, setLayouts, unsetLayout, setName, setTarget, setStyle, setAttribute, unsetAttribute,'sendMessage'\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.wt.updateLayout({}, {\n requestBody: {\n roomId: roomId,\n operation: operation,\n name: name,\n attributeName: attributeName,\n value: value,\n target: target\n }\n });\n });\n },\n getInviteUrl: function getInviteUrl(roomId, domain, url) {\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.wt.invite({}, {\n requestBody: {\n roomId: roomId,\n domain: domain || location.host,\n url: url || location.href\n }\n });\n });\n },\n getRoomChatList: function getRoomChatList() {\n var _ref6 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n roomId = _ref6.roomId,\n _ref6$type = _ref6.type,\n type = _ref6$type === void 0 ? \"normal\" : _ref6$type,\n _ref6$size = _ref6.size,\n size = _ref6$size === void 0 ? 50 : _ref6$size,\n _ref6$startKey = _ref6.startKey,\n startKey = _ref6$startKey === void 0 ? null : _ref6$startKey;\n\n var apiParams = _objectSpread({\n roomId: roomId,\n type: type,\n size: size\n }, startKey && {\n startKey: startKey\n });\n\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.wt.getRoomChatList(apiParams);\n });\n },\n getRoomsList: function getRoomsList() {\n var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref7$type = _ref7.type,\n type = _ref7$type === void 0 ? 'participant' : _ref7$type,\n _ref7$activeOnly = _ref7.activeOnly,\n activeOnly = _ref7$activeOnly === void 0 ? null : _ref7$activeOnly,\n _ref7$instanceType = _ref7.instanceType,\n instanceType = _ref7$instanceType === void 0 ? _this.__instanceType : _ref7$instanceType,\n _ref7$size = _ref7.size,\n size = _ref7$size === void 0 ? 20 : _ref7$size,\n _ref7$startKey = _ref7.startKey,\n startKey = _ref7$startKey === void 0 ? null : _ref7$startKey,\n _ref7$includeWtEventM = _ref7.includeWtEventModels,\n includeWtEventModels = _ref7$includeWtEventM === void 0 ? false : _ref7$includeWtEventM,\n _ref7$demo = _ref7.demo,\n demo = _ref7$demo === void 0 ? false : _ref7$demo,\n _ref7$viewType = _ref7.viewType,\n viewType = _ref7$viewType === void 0 ? 'list' : _ref7$viewType,\n _ref7$wtChannelId = _ref7.wtChannelId,\n wtChannelId = _ref7$wtChannelId === void 0 ? undefined : _ref7$wtChannelId;\n\n var apiParams = _objectSpread(_objectSpread(_objectSpread({\n type: type,\n instanceType: instanceType,\n size: size,\n includeWtEventModels: includeWtEventModels,\n demo: demo,\n viewType: viewType\n }, wtChannelId && {\n wtChannelId: wtChannelId\n }), activeOnly && {\n activeOnly: activeOnly\n }), startKey && {\n startKey: startKey\n });\n\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.wt.getRoomList(apiParams);\n });\n },\n setUser: function setUser(_ref8) {\n var userId = _ref8.userId,\n roomId = _ref8.roomId,\n flag = _ref8.flag,\n timestamp = _ref8.timestamp,\n option = _ref8.option;\n //leave, kick, ban, unban, approve, report\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.wt.setUser({\n userId: userId,\n roomId: roomId,\n flag: flag,\n timestamp: timestamp,\n option: option\n });\n });\n },\n getRoomById: function getRoomById(id) {\n var pinHash = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n var showPublic = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;\n var demo = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.wt.getRoom({\n id: id,\n pinHash: pinHash,\n \"public\": showPublic,\n demo: demo\n });\n });\n },\n getRoomBySlug: function getRoomBySlug(slug) {\n var password = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n var showPublic = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;\n var demo = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.wt.getRoom({\n slug: slug,\n password: password,\n \"public\": showPublic,\n demo: demo\n });\n });\n },\n roomRecorder: function roomRecorder() {\n var _ref9 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n roomId = _ref9.roomId,\n _ref9$operation = _ref9.operation,\n operation = _ref9$operation === void 0 ? 'get' : _ref9$operation,\n config = _ref9.config;\n\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.wt.recordRoom({}, {\n requestBody: {\n roomId: roomId,\n operation: operation,\n config: config\n }\n });\n });\n },\n __joinRoom: function __joinRoom() {\n var _ref10 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n roomId = _ref10.roomId,\n pinHash = _ref10.pinHash,\n _ref10$instanceType = _ref10.instanceType,\n instanceType = _ref10$instanceType === void 0 ? _this.__instanceType : _ref10$instanceType,\n _ref10$isTalkback = _ref10.isTalkback,\n isTalkback = _ref10$isTalkback === void 0 ? undefined : _ref10$isTalkback,\n _ref10$isMonitor = _ref10.isMonitor,\n isMonitor = _ref10$isMonitor === void 0 ? undefined : _ref10$isMonitor,\n _ref10$isInstructor = _ref10.isInstructor,\n isInstructor = _ref10$isInstructor === void 0 ? undefined : _ref10$isInstructor,\n _ref10$customBearer = _ref10.customBearer,\n customBearer = _ref10$customBearer === void 0 ? undefined : _ref10$customBearer;\n\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.wt.join({\n roomId: roomId,\n pinHash: pinHash,\n instanceType: instanceType,\n isTalkback: isTalkback,\n isMonitor: isMonitor,\n isInstructor: isInstructor,\n platform: _this.browser === 'firefox' ? 'web-firefox' : 'web'\n }, _objectSpread({}, customBearer ? {\n requestInterceptor: function requestInterceptor(req) {\n if (!req.headers) {\n req.headers = {};\n }\n\n req.headers['Authorization'] = customBearer;\n return req;\n }\n } : {}));\n });\n },\n __isThisSafariSupported: function __isThisSafariSupported() {\n return _this.__privates.room.safariVp8;\n },\n createStreamingSession: function createStreamingSession() {\n var _ref11 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n roomId = _ref11.roomId,\n pinHash = _ref11.pinHash,\n streamId = _ref11.streamId,\n href = _ref11.href,\n iceServers = _ref11.iceServers,\n accessToken = _ref11.accessToken;\n\n return _this.__privates.room.isReady.then(function (lib) {\n return _streaming_session__WEBPACK_IMPORTED_MODULE_1__[\"default\"].call(_this, {\n roomId: roomId,\n pinHash: pinHash,\n streamId: streamId,\n href: href,\n iceServers: iceServers,\n accessToken: accessToken\n }, lib.createSession('streaming'), _this);\n });\n },\n createSession: function createSession(_ref12) {\n var roomId = _ref12.roomId,\n pinHash = _ref12.pinHash,\n isTalkback = _ref12.isTalkback,\n isMonitor = _ref12.isMonitor,\n isInstructor = _ref12.isInstructor,\n options = _ref12.options;\n return _this.__privates.room.isReady.then(function (lib) {\n return _room_session__WEBPACK_IMPORTED_MODULE_0__[\"default\"].call(_this, {\n roomId: roomId,\n pinHash: pinHash,\n isTalkback: isTalkback,\n isMonitor: isMonitor,\n isInstructor: isInstructor\n }, lib.createSession('reactooroom', options), _this);\n });\n },\n destroySession: function destroySession(constructId) {\n return _this.__privates.room.closeSessionByConstructId(constructId);\n },\n queue: function queue() {\n var _ref13 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n roomId = _ref13.roomId,\n operation = _ref13.operation,\n userId = _ref13.userId;\n\n //Enum: \"status\" \"join\" \"approve\" \"reject\" \"block\" \"unblock\"\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.wt.queue({}, {\n requestBody: {\n roomId: roomId,\n operation: operation,\n userId: userId\n }\n });\n });\n },\n getDefaultRegions: function getDefaultRegions() {\n return _this.__privates.auth.__client.then(function (client) {\n var _client$spec, _client$spec$componen, _client$spec$componen2, _client$spec$componen3, _client$spec$componen4, _client$spec$componen5;\n\n return _toConsumableArray(((_client$spec = client.spec) === null || _client$spec === void 0 ? void 0 : (_client$spec$componen = _client$spec.components) === null || _client$spec$componen === void 0 ? void 0 : (_client$spec$componen2 = _client$spec$componen.schemas) === null || _client$spec$componen2 === void 0 ? void 0 : (_client$spec$componen3 = _client$spec$componen2.WtRoom) === null || _client$spec$componen3 === void 0 ? void 0 : (_client$spec$componen4 = _client$spec$componen3.properties) === null || _client$spec$componen4 === void 0 ? void 0 : (_client$spec$componen5 = _client$spec$componen4.defaultRegion) === null || _client$spec$componen5 === void 0 ? void 0 : _client$spec$componen5.enum) || ['']);\n });\n }\n };\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (room);\n\n//# sourceURL=webpack://WatchTogetherSDK/./src/models/room.js?");
9245
9245
 
9246
9246
  /***/ }),
9247
9247