@reactoo/watchtogether-sdk-js 2.7.75 → 2.7.77
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/dist/watchtogether-sdk.min.js +2 -2
- package/package.json +1 -1
- package/src/models/user.js +11 -4
package/package.json
CHANGED
package/src/models/user.js
CHANGED
|
@@ -36,12 +36,12 @@ let user = function () {
|
|
|
36
36
|
.then(response => response.data.key)
|
|
37
37
|
;
|
|
38
38
|
},
|
|
39
|
-
uploadVideo: (roomId, files, privateAttributes = {}, customPrice) => {
|
|
39
|
+
uploadVideo: (roomId, files, privateAttributes = {}, customAttributes = {}, customPrice) => {
|
|
40
40
|
let id = generateUUID();
|
|
41
41
|
return this.__privates.auth.__client
|
|
42
42
|
.then(client => Promise.all([client, client.apis.video.initiateVideoUpload({id, segmentCount: files.length || 0})]))
|
|
43
43
|
.then(([client, response]) => Promise.all([client, response.data.signedUrlSegments.reduce((acc, url, index) => acc.then(() => client.http({url, method: response.data.httpMethod, headers: {"Content-Type":files[index].type}, body:files[index]})), Promise.resolve())]))
|
|
44
|
-
.then(([client]) => client.apis.video.publishVideo({_id:id, roomId, customPrice}, {requestBody:{_id:id, roomId, privateAttributes, customPrice}}))
|
|
44
|
+
.then(([client]) => client.apis.video.publishVideo({_id:id, roomId, customPrice}, {requestBody:{_id:id, roomId, privateAttributes, customAttributes, customPrice}}))
|
|
45
45
|
},
|
|
46
46
|
|
|
47
47
|
publishVideo: (roomId, id, privateAttributes = {}, customPrice) => {
|
|
@@ -72,7 +72,7 @@ let user = function () {
|
|
|
72
72
|
.then(client => client.apis.video.getVideoById({id}))
|
|
73
73
|
},
|
|
74
74
|
|
|
75
|
-
getVideos: ({roomId, userId, type, size, startKey, ids, includeUserModels = false, includeRoomQueueStatus} = {}) => {
|
|
75
|
+
getVideos: ({roomId, userId, type, size, startKey, ids, includeUserModels = false, includeRoomQueueStatus, filter} = {}) => {
|
|
76
76
|
return chunkArray(ids, 50)
|
|
77
77
|
.reduce((promiseChain, idsChunk) => {
|
|
78
78
|
return promiseChain.then(chainResponse => {
|
|
@@ -83,6 +83,7 @@ let user = function () {
|
|
|
83
83
|
...(idsChunk?.length && {ids: idsChunk.join(',')}),
|
|
84
84
|
...(startKey && {startKey}),
|
|
85
85
|
...(includeRoomQueueStatus && {includeRoomQueueStatus}),
|
|
86
|
+
...(filter && Object.keys(filter).length && {filter: JSON.stringify(filter)}),
|
|
86
87
|
includeUserModels,
|
|
87
88
|
type
|
|
88
89
|
};
|
|
@@ -93,10 +94,16 @@ let user = function () {
|
|
|
93
94
|
items: [...chainResponse.data.items, ...response.data.items],
|
|
94
95
|
size: chainResponse.data.size + response.data.size,
|
|
95
96
|
startKey: null,
|
|
97
|
+
users: [...chainResponse.data.users, ...(response.data.users ?? [])],
|
|
96
98
|
},
|
|
97
99
|
} : response);
|
|
98
100
|
});
|
|
99
|
-
}, Promise.resolve({data: {items: [], size: 0, startKey: null}}));
|
|
101
|
+
}, Promise.resolve({data: {items: [], size: 0, startKey: null, users: []}}));
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
getVideoListFilters: (roomId) => {
|
|
105
|
+
return this.__privates.auth.__client
|
|
106
|
+
.then(client => client.apis.video.getVideoListFilters({roomId}));
|
|
100
107
|
},
|
|
101
108
|
|
|
102
109
|
deleteVideo: (id) => {
|