@reactoo/watchtogether-sdk-js 2.8.30 → 2.8.32

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reactoo/watchtogether-sdk-js",
3
- "version": "2.8.30",
3
+ "version": "2.8.32",
4
4
  "description": "Javascript SDK for Reactoo",
5
5
  "main": "dist/watchtogether-sdk.min.js",
6
6
  "module": "dist/watchtogether-sdk.min.js",
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- import {chunkArray} from "./utils";
3
+ import {chunkArray, generateUUID} from "./utils";
4
4
 
5
5
  let liveBarn = function() {
6
6
  return {
@@ -89,7 +89,7 @@ let liveBarn = function() {
89
89
  .reduce((promiseChain, idsChunk) => {
90
90
  return promiseChain.then(chainResponse => {
91
91
  const apiParams = {
92
- operation: 'teamList',
92
+ operation: 'listTeams',
93
93
  ...(fulltextPhrase && {fulltextPhrase}),
94
94
  ...(sports?.length && {sports}),
95
95
  ...(idsChunk?.length && {ids: idsChunk.join(',')}),
@@ -115,6 +115,13 @@ let liveBarn = function() {
115
115
  };
116
116
  return this.system.getIntegrationPublic(type, apiParams);
117
117
  },
118
+ uploadTeamLogo: (file, teamId) => {
119
+ return this.__privates.auth.__client
120
+ .then(client => Promise.all([client, client.apis.livebarn.initiateTeamLogoUpload({id: generateUUID(), teamId})]))
121
+ .then(([client, response]) => Promise.all([client, client.http({url: response.data.signedUrl, method: response.data.httpMethod, headers: {"Content-Type": file.type}, body: file}), response.data.id]))
122
+ .then(([client, response, idn]) => Promise.all([client.apis.livebarn.publishTeamLogo({id: idn, teamId}), idn]))
123
+ ;
124
+ },
118
125
  };
119
126
  };
120
127