@reactoo/watchtogether-sdk-js 2.4.34 → 2.4.35
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/example/index.html
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
<script>
|
|
27
27
|
|
|
28
|
-
let roomId = '
|
|
28
|
+
let roomId = 'fc2d34f2-de58-42a0-9312-5cd40f2d754e'; //It will create room automatically if not set
|
|
29
29
|
let pinHash = undefined;//'967ca05f-7fab-a205-5913-39393bbbe923';
|
|
30
30
|
|
|
31
31
|
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
console.log('Iot message:', r);
|
|
124
124
|
});
|
|
125
125
|
|
|
126
|
-
Instance.auth.
|
|
126
|
+
Instance.auth.deviceLogin() // login as browser
|
|
127
127
|
.then(r => Instance.iot.iotLogin()) // login to mqtt
|
|
128
128
|
.then(r => {
|
|
129
129
|
|
|
@@ -154,11 +154,7 @@
|
|
|
154
154
|
.then(r => Instance.room.createSession({roomId:r.roomId, pinHash: r.pinHash})) // pin hash is not needed if you're owner of the room
|
|
155
155
|
.then(session => {
|
|
156
156
|
Instance.user.getUserSelf().then(r => {
|
|
157
|
-
Instance.
|
|
158
|
-
"operation": "auth",
|
|
159
|
-
uuid: r.data._id,
|
|
160
|
-
username: r.data.displayname
|
|
161
|
-
})
|
|
157
|
+
Instance.room.getRoomChatList()
|
|
162
158
|
.then(r => console.log('wooo',r))
|
|
163
159
|
|
|
164
160
|
})
|
package/package.json
CHANGED
package/src/models/room.js
CHANGED
|
@@ -159,6 +159,16 @@ let room = function () {
|
|
|
159
159
|
}))
|
|
160
160
|
},
|
|
161
161
|
|
|
162
|
+
getRoomChatList: ({roomId, type = "normal", size = 50, startKey = null} = {}) => {
|
|
163
|
+
let apiParams = {
|
|
164
|
+
roomId, type,
|
|
165
|
+
size,
|
|
166
|
+
...(startKey && {startKey})
|
|
167
|
+
};
|
|
168
|
+
return this.__privates.auth.__client
|
|
169
|
+
.then(client => client.apis.wt.getRoomChatList(apiParams))
|
|
170
|
+
},
|
|
171
|
+
|
|
162
172
|
getRoomsList: ({
|
|
163
173
|
type = 'participant',
|
|
164
174
|
activeOnly = null,
|