@reactoo/watchtogether-sdk-js 2.8.7 → 2.8.9

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.7",
3
+ "version": "2.8.9",
4
4
  "description": "Javascript SDK for Reactoo",
5
5
  "main": "dist/watchtogether-sdk.min.js",
6
6
  "module": "dist/watchtogether-sdk.min.js",
@@ -115,7 +115,15 @@ let asset = function() {
115
115
  createHighlightAsset: (id, title, roomIds, highlight = {}) => {
116
116
  return this.__privates.auth.__client
117
117
  .then(client => client.apis.asset.publishAsset({id}, {requestBody: {assetType: 'highlight',...(roomIds ? {roomIds} : {}), title, highlight}}));
118
- }
118
+ },
119
+
120
+ createHighlightAssetWithThumbnail: (file, id, title, roomIds, highlight = {}, initiationData = null) => {
121
+ return this.__privates.auth.__client
122
+ .then(client => Promise.all([client, initiationData ? Promise.resolve(initiationData) : client.apis.asset.initiateAssetUpload({id: id || generateUUID()})]))
123
+ .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]))
124
+ .then(([client, response, idn]) => Promise.all([client.apis.asset.publishAsset({id:idn}, {requestBody: {assetType: 'highlight', title: title, ...(roomIds ? {roomIds} : {}), highlight}}), idn]))
125
+ ;
126
+ },
119
127
  }
120
128
  };
121
129
 
@@ -12,13 +12,13 @@ let liveBarn = function() {
12
12
  ...(fulltextPhrase && {fulltextPhrase}),
13
13
  ...(comingSoon && {comingSoon}),
14
14
  ...(online && {online}),
15
- ...(countries && {countries}),
16
- ...(sports && {sports}),
17
- ...(surfaceStatus && {surfaceStatus}),
18
- ...(feedModes && {feedModes}),
19
- ...(cities && {cities}),
20
- ...(provinces && {provinces}),
21
- ...(venues && {venues}),
15
+ ...(countries?.length && {countries: countries.join(',')}),
16
+ ...(sports?.length && {sports: sports.join(',')}),
17
+ ...(surfaceStatus?.length && {surfaceStatus: surfaceStatus.join(',')}),
18
+ ...(feedModes?.length && {feedModes: feedModes.join(',')}),
19
+ ...(cities?.length && {cities: cities.join(',')}),
20
+ ...(provinces?.length && {provinces: provinces.join(',')}),
21
+ ...(venues?.length && {venues: venues.join(',')}),
22
22
  ...(idsChunk?.length && {ids: idsChunk.join(',')}),
23
23
  ...(size && !ids?.length && {size}),
24
24
  ...(startKey && {startKey}),
@@ -48,16 +48,16 @@ let liveBarn = function() {
48
48
  ...(fulltextPhrase && {fulltextPhrase}),
49
49
  ...(comingSoon && {comingSoon}),
50
50
  ...(online && {online}),
51
- ...(countries && {countries}),
52
- ...(sports && {sports}),
53
- ...(surfaceStatus && {surfaceStatus}),
54
- ...(feedModes && {feedModes}),
55
- ...(cities && {cities}),
56
- ...(provinces && {provinces}),
57
- ...(venueStatus && {venueStatus}),
58
- ...(postalCode && {postalCode}),
59
- ...(uuid && {uuid}),
60
- ...(surfaces && {surfaces}),
51
+ ...(countries?.length && {countries: countries.join(',')}),
52
+ ...(sports?.length && {sports: sports.join(',')}),
53
+ ...(surfaceStatus?.length && {surfaceStatus: surfaceStatus.join(',')}),
54
+ ...(feedModes?.length && {feedModes: feedModes.join(',')}),
55
+ ...(cities?.length && {cities: cities.join(',')}),
56
+ ...(provinces?.length && {provinces: provinces.join(',')}),
57
+ ...(venueStatus?.length && {venueStatus: venueStatus.join(',')}),
58
+ ...(postalCode?.length && {postalCode: postalCode.join(',')}),
59
+ ...(uuid?.length && {uuid: uuid.join(',')}),
60
+ ...(surfaces?.length && {surfaces: surfaces.join(',')}),
61
61
  ...(idsChunk?.length && {ids: idsChunk.join(',')}),
62
62
  ...(size && !ids?.length && {size}),
63
63
  ...(startKey && {startKey}),