@reactoo/watchtogether-sdk-js 2.6.4 → 2.6.6
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.6.
|
|
3
|
+
* @version 2.6.6
|
|
4
4
|
*/
|
|
5
5
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
6
6
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
@@ -10018,7 +10018,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _mod
|
|
|
10018
10018
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
10019
10019
|
|
|
10020
10020
|
"use strict";
|
|
10021
|
-
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\n\nlet asset = function () {\n var _this = this;\n return {\n getAssetList: _ref => {\n let {\n type = 'instanceType',\n instanceType,\n assetType,\n size = 20,\n startKey = null,\n roomId,\n ids\n } = _ref;\n let apiParams = {\n type,\n ...(instanceType && {\n instanceType: instanceType === true ? this.__instanceType : instanceType\n }),\n ...(assetType && {\n assetType\n }),\n ...(size && !ids && {\n size\n }),\n ...(ids && {\n ids: ids.join(',')\n }),\n ...(roomId && {\n roomId\n }),\n ...(startKey && {\n startKey\n })\n };\n return this.__privates.auth.__client.then(client => client.apis.asset.getAssetList(apiParams));\n },\n getAssetById: id => {\n return this.__privates.auth.__client.then(client => client.apis.
|
|
10021
|
+
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\n\nlet asset = function () {\n var _this = this;\n return {\n getAssetList: _ref => {\n let {\n type = 'instanceType',\n instanceType,\n assetType,\n size = 20,\n startKey = null,\n roomId,\n ids\n } = _ref;\n let apiParams = {\n type,\n ...(instanceType && {\n instanceType: instanceType === true ? this.__instanceType : instanceType\n }),\n ...(assetType && {\n assetType\n }),\n ...(size && !ids && {\n size\n }),\n ...(ids && {\n ids: ids.join(',')\n }),\n ...(roomId && {\n roomId\n }),\n ...(startKey && {\n startKey\n })\n };\n return this.__privates.auth.__client.then(client => client.apis.asset.getAssetList(apiParams));\n },\n getAssetById: id => {\n return this.__privates.auth.__client.then(client => client.apis.asset.getAssetById({\n id\n }));\n },\n updateAsset: function () {\n let {\n id,\n assetType,\n title,\n roomIds\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.auth.__client.then(client => client.apis.asset.updateAsset({\n id\n }, {\n requestBody: {\n assetType,\n title,\n roomIds\n }\n }));\n },\n deleteAsset: id => {\n return this.__privates.auth.__client.then(client => client.apis.asset.deleteAsset({\n id\n }));\n },\n initiateAssetUpload: function () {\n let id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n return _this.__privates.auth.__client.then(client => client.apis.asset.initiateAssetUpload());\n },\n uploadAsset: function (file, roomIds) {\n let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n let initiationData = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n return _this.__privates.auth.__client.then(client => Promise.all([client, initiationData ? Promise.resolve(initiationData) : client.apis.asset.initiateAssetUpload({\n id: id || Object(_modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__[\"generateUUID\"])()\n })])).then(_ref2 => {\n let [client, response] = _ref2;\n return Promise.all([client, client.http({\n url: response.data.signedUrl,\n method: response.data.httpMethod,\n headers: {\n \"Content-Type\": file.type\n },\n body: file\n }), response.data.id]);\n }).then(_ref3 => {\n let [client, response, idn] = _ref3;\n return Promise.all([client.apis.asset.publishAsset({\n id: idn\n }, {\n requestBody: {\n title: file.name,\n ...(roomIds ? {\n roomIds\n } : {})\n }\n }), idn]);\n });\n },\n downloadAsset: function (url) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return _this.__privates.auth.__client.then(client => client.http({\n url,\n method: 'GET',\n ...options\n }));\n }\n };\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (asset);\n\n//# sourceURL=webpack://WatchTogetherSDK/./src/models/asset.js?");
|
|
10022
10022
|
|
|
10023
10023
|
/***/ }),
|
|
10024
10024
|
|