@reactoo/watchtogether-sdk-js 2.4.18 → 2.4.19
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.
|
|
3
|
+
* @version 2.4.19
|
|
4
4
|
*/
|
|
5
5
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
6
6
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
@@ -9643,7 +9643,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _mod
|
|
|
9643
9643
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
9644
9644
|
|
|
9645
9645
|
"use strict";
|
|
9646
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modules/wt-utils */ \"./src/modules/wt-utils.js\");\n\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure 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 _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 _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\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\nvar auth = function auth() {\n var _this = this;\n\n return {\n login: function login(username, password) {\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.auth.signIn({}, {\n requestBody: {\n username: username,\n password: password\n }\n });\n }).then(function (response) {\n _this.userId = response.data.userId;\n _this.username = response.data.username;\n return _this.__privates.auth.login(response.data.idToken, response.data.accessToken, response.data.refreshToken);\n });\n },\n providerLogin: function providerLogin(domain, token, displayname) {\n if (!token && typeof _this.__privates.providerAuth === 'function') {\n var _this$__privates$prov = _this.__privates.providerAuth();\n\n token = _this$__privates$prov.token;\n displayname = _this$__privates$prov.displayname;\n }\n\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.auth.providerSignIn({}, {\n requestBody: _objectSpread({\n domain: domain,\n token: token\n }, displayname !== null && {\n
|
|
9646
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modules/wt-utils */ \"./src/modules/wt-utils.js\");\n\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure 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 _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 _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\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\nvar auth = function auth() {\n var _this = this;\n\n return {\n login: function login(username, password) {\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.auth.signIn({}, {\n requestBody: {\n username: username,\n password: password\n }\n });\n }).then(function (response) {\n _this.userId = response.data.userId;\n _this.username = response.data.username;\n return _this.__privates.auth.login(response.data.idToken, response.data.accessToken, response.data.refreshToken);\n });\n },\n providerLogin: function providerLogin(domain, token, displayname, deviceId) {\n if (!token && typeof _this.__privates.providerAuth === 'function') {\n var _this$__privates$prov = _this.__privates.providerAuth();\n\n token = _this$__privates$prov.token;\n displayname = _this$__privates$prov.displayname;\n }\n\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.auth.providerSignIn({}, {\n requestBody: _objectSpread(_objectSpread({\n domain: domain,\n token: token\n }, displayname && {\n displayname: displayname\n }), deviceId !== null && {\n deviceId: deviceId\n })\n });\n }).then(function (response) {\n _this.userId = response.data.userId;\n _this.username = response.data.username;\n return _this.__privates.auth.login(response.data.idToken, response.data.accessToken, response.data.refreshToken);\n });\n },\n getProviderAuth: function getProviderAuth() {\n return _this.__privates.providerAuth;\n },\n deviceLogin: function deviceLogin() {\n return Object(_modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__[\"wait\"])(300).then(function () {\n return Object(_modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__[\"getBrowserFingerprint\"])(_this.__instanceType);\n }).then(function (deviceId) {\n return Promise.all([deviceId, _this.__privates.auth.__client]);\n }).then(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n deviceId = _ref2[0],\n client = _ref2[1];\n\n return client.apis.auth.deviceSignIn({}, {\n requestBody: {\n deviceId: deviceId,\n domain: location.hostname\n }\n });\n }).then(function (response) {\n _this.userId = response.data.userId;\n _this.username = response.data.username;\n return _this.__privates.auth.login(response.data.idToken, response.data.accessToken, response.data.refreshToken);\n });\n },\n logout: function logout() {\n return _this.__privates.auth.logout();\n },\n isLoggedIn: function isLoggedIn() {\n return _this.__privates.auth.isLoggedIn();\n },\n setLanguage: function setLanguage(language) {\n return _this.__privates.auth.setLanguage(language);\n },\n getLanguage: function getLanguage() {\n return _this.__privates.auth.__language;\n },\n signUp: function signUp(username, password, email, phone) {\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.auth.signUp({}, {\n requestBody: {\n username: username,\n password: password,\n email: email,\n phone: phone\n }\n });\n });\n },\n confirmSignUp: function confirmSignUp(confirmationCode, username, displayname) {\n var isPublic = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.auth.confirmSignUp({}, {\n requestBody: {\n confirmationCode: confirmationCode,\n username: username,\n displayname: displayname,\n isPublic: isPublic\n }\n });\n }).then(function (response) {\n _this.userId = response.data.userId;\n _this.username = response.data.username;\n return _this.__privates.auth.login(response.data.idToken, response.data.accessToken, response.data.refreshToken);\n });\n },\n resendConfirmationCode: function resendConfirmationCode(username) {\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.auth.resendConfirmationCode({}, {\n requestBody: {\n username: username\n }\n });\n });\n },\n forgotPassword: function forgotPassword(username) {\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.auth.forgotPassword({}, {\n requestBody: {\n username: username\n }\n });\n });\n },\n confirmForgotPassword: function confirmForgotPassword(username, confirmationCode, password) {\n return _this.__privates.auth.__client.then(function (client) {\n return client.apis.auth.confirmForgotPassword({}, {\n requestBody: {\n password: password,\n confirmationCode: confirmationCode,\n username: username\n }\n });\n });\n },\n $on: function $on(key, callback, that) {\n return _this.__privates.auth.on(key, callback, that || _this);\n },\n $off: function $off(key, callback, that) {\n return _this.__privates.auth.off(key, callback, that || _this);\n },\n $clear: function $clear() {\n return _this.__privates.auth.clear();\n }\n };\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (auth);\n\n//# sourceURL=webpack://WatchTogetherSDK/./src/models/auth.js?");
|
|
9647
9647
|
|
|
9648
9648
|
/***/ }),
|
|
9649
9649
|
|