@reactoo/watchtogether-sdk-js 2.8.28 → 2.8.30

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.28",
3
+ "version": "2.8.30",
4
4
  "description": "Javascript SDK for Reactoo",
5
5
  "main": "dist/watchtogether-sdk.min.js",
6
6
  "module": "dist/watchtogether-sdk.min.js",
@@ -41,6 +41,7 @@ let liveBarn = function() {
41
41
  return this.__privates.auth.__client
42
42
  .then(client => client.apis.livebarn.getLiveBarnSurfaceById({id}));
43
43
  },
44
+
44
45
  getLiveBarnVenueList: ({fulltextPhrase, comingSoon, online, hasActive, hasStream, countries, sports, surfaceStatus, feedModes, cities, provinces, venueStatus, postalCode, uuid, surfaces, ids, size, startKey, sort} = {}) => {
45
46
  return chunkArray(ids, 30)
46
47
  .reduce((promiseChain, idsChunk) => {
@@ -82,6 +83,38 @@ let liveBarn = function() {
82
83
  return this.__privates.auth.__client
83
84
  .then(client => client.apis.livebarn.getLiveBarnVenueById({id}));
84
85
  },
86
+
87
+ getLiveBarnTeamList: ({type, fulltextPhrase, sports, ids, size, startKey, sort} = {}) => {
88
+ return chunkArray(ids, 30)
89
+ .reduce((promiseChain, idsChunk) => {
90
+ return promiseChain.then(chainResponse => {
91
+ const apiParams = {
92
+ operation: 'teamList',
93
+ ...(fulltextPhrase && {fulltextPhrase}),
94
+ ...(sports?.length && {sports}),
95
+ ...(idsChunk?.length && {ids: idsChunk.join(',')}),
96
+ ...(size && !ids?.length && {size}),
97
+ ...(startKey && {startKey}),
98
+ ...(sort && {sort}),
99
+ };
100
+ return this.system.getIntegrationPublic(type, apiParams)
101
+ .then(response => ids?.length ? ({
102
+ data: {
103
+ items: [...chainResponse.data.items, ...response.data.items],
104
+ size: chainResponse.data.size + response.data.size,
105
+ startKey: null,
106
+ },
107
+ }) : response);
108
+ });
109
+ }, Promise.resolve({data: {items: [], size: 0, startKey: null}}));
110
+ },
111
+ getLiveBarnTeamById: ({type, id} = {}) => {
112
+ const apiParams = {
113
+ operation: 'getTeam',
114
+ id,
115
+ };
116
+ return this.system.getIntegrationPublic(type, apiParams);
117
+ },
85
118
  };
86
119
  };
87
120
 
@@ -914,7 +914,7 @@ class RoomSession {
914
914
  }
915
915
  }
916
916
 
917
- async sendMessage(handleId, message = {body: 'Example Body'}, dontWait = false, dontResolveOnAck = false, retry = 2) {
917
+ async sendMessage(handleId, message = {body: 'Example Body'}, dontWait = false, dontResolveOnAck = false, retry = 1) {
918
918
  return this.#send({
919
919
  "janus": "message",
920
920
  "handle_id": handleId,
@@ -937,7 +937,7 @@ class RoomSession {
937
937
  })
938
938
  }
939
939
 
940
- async #sendHTTP(request = {}, ignoreResponse = false, dontResolveOnAck = false, retry = 2) {
940
+ async #sendHTTP(request = {}, ignoreResponse = false, dontResolveOnAck = false, retry = 1) {
941
941
  let transaction = RoomSession.randomString(12);
942
942
  let requestData = {
943
943
  ...request,
@@ -965,7 +965,7 @@ class RoomSession {
965
965
  })
966
966
  }
967
967
 
968
- async #sendWebsockets(request = {}, ignoreResponse = false, dontResolveOnAck = false, retry = 2) {
968
+ async #sendWebsockets(request = {}, ignoreResponse = false, dontResolveOnAck = false, retry = 1) {
969
969
  let transaction = RoomSession.randomString(12);
970
970
  let requestData = {
971
971
  ...request,