Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 76f573023f | |||
| b217123b99 | |||
| 59f7e10dd7 | |||
| 56a0167120 |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@chatenium/chatenium-sdk",
|
||||
"version": "1.0.11",
|
||||
"version": "1.1.2",
|
||||
"description": "A library for interacting with the Chatenium API",
|
||||
"type": "module",
|
||||
"main": "dist/index.js",
|
||||
|
||||
@@ -80,6 +80,9 @@ export class WebSocketHandler {
|
||||
|
||||
public registerService(service: WSListenerPipe) {
|
||||
console.log("Registering service", service)
|
||||
if (this.connId) {
|
||||
service.onNewConnId(this.connId)
|
||||
}
|
||||
this.listeners.add(service);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ export interface JoinWebsocketRoomReq {
|
||||
channelId: string
|
||||
networkId: string
|
||||
categoryId: string
|
||||
disableAutoRemove: boolean
|
||||
}
|
||||
|
||||
export interface StreamRegistry {
|
||||
|
||||
@@ -58,6 +58,7 @@ export interface JoinWsRoomReq {
|
||||
connId: string
|
||||
chatid: string
|
||||
userid: string
|
||||
disableAutoRemove: boolean
|
||||
}
|
||||
|
||||
// Response schemas
|
||||
|
||||
@@ -255,6 +255,7 @@ export interface JoinWebSocketRoomReq {
|
||||
userid: string
|
||||
connId: string
|
||||
networkId: string
|
||||
disableAutoRemove: boolean
|
||||
}
|
||||
|
||||
export interface GetFromInviteReq {
|
||||
|
||||
@@ -78,6 +78,7 @@ export interface JoinWsRoomReq {
|
||||
networkId: string
|
||||
categoryId: string
|
||||
userid: string
|
||||
disableAutoRemove: boolean
|
||||
}
|
||||
|
||||
// Response schemas
|
||||
|
||||
@@ -31,7 +31,7 @@ export class BroadcastChannelService {
|
||||
})
|
||||
WebSocketHandler.getInstance().registerService({
|
||||
identifier: channelId,
|
||||
onNewConnId: this.onNewConnId,
|
||||
onNewConnId: newConnId => this.onNewConnId(newConnId),
|
||||
onNewMessage: wsMessageListener,
|
||||
})
|
||||
}
|
||||
@@ -81,6 +81,7 @@ export class BroadcastChannelService {
|
||||
networkId: this.networkId,
|
||||
connId: WebSocketHandler.getInstance().connId,
|
||||
categoryId: this.categoryId,
|
||||
disableAutoRemove: true
|
||||
});
|
||||
return
|
||||
} catch (e) {
|
||||
|
||||
@@ -32,7 +32,7 @@ export class ChatService {
|
||||
})
|
||||
WebSocketHandler.getInstance().registerService({
|
||||
identifier: userid,
|
||||
onNewConnId: this.onNewConnId,
|
||||
onNewConnId: newConnId => this.onNewConnId(newConnId),
|
||||
onNewMessage: wsMessageListener,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ export class DMService {
|
||||
})
|
||||
WebSocketHandler.getInstance().registerService({
|
||||
identifier: chatid,
|
||||
onNewConnId: this.onNewConnId,
|
||||
onNewConnId: newConnId => this.onNewConnId(newConnId),
|
||||
onNewMessage: wsMessageListener,
|
||||
})
|
||||
}
|
||||
@@ -246,10 +246,11 @@ export class DMService {
|
||||
*/
|
||||
async joinWebSocketRoom(): Promise<void> {
|
||||
try {
|
||||
await this.client.post("v2/chat/dm/joinWebSocketRoom", <JoinWsRoomReq>{
|
||||
await this.client.post("v2/chat/dm/joinWebSocketRoom", <JoinWsRoomReq>{
|
||||
chatid: this.chatid,
|
||||
userid: this.userid,
|
||||
connId: WebSocketHandler.getInstance().connId,
|
||||
disableAutoRemove: true
|
||||
});
|
||||
return
|
||||
} catch (e) {
|
||||
|
||||
@@ -39,7 +39,7 @@ export class NetworkService {
|
||||
})
|
||||
WebSocketHandler.getInstance().registerService({
|
||||
identifier: networkId,
|
||||
onNewConnId: this.onNewConnId,
|
||||
onNewConnId: newConnId => this.onNewConnId(newConnId),
|
||||
onNewMessage: wsMessageListener,
|
||||
})
|
||||
}
|
||||
@@ -863,6 +863,7 @@ export class NetworkService {
|
||||
userid: this.userid,
|
||||
networkId: this.networkId,
|
||||
connId: connId,
|
||||
disableAutoRemove: true
|
||||
});
|
||||
return
|
||||
} catch (e) {
|
||||
|
||||
@@ -40,7 +40,7 @@ export class TextChannelServiceService {
|
||||
})
|
||||
WebSocketHandler.getInstance().registerService({
|
||||
identifier: channelId,
|
||||
onNewConnId: this.onNewConnId,
|
||||
onNewConnId: newConnId => this.onNewConnId(newConnId),
|
||||
onNewMessage: wsMessageListener,
|
||||
})
|
||||
}
|
||||
@@ -269,6 +269,7 @@ export class TextChannelServiceService {
|
||||
categoryId: this.categoryId,
|
||||
userid: this.userid,
|
||||
connId: WebSocketHandler.getInstance().connId,
|
||||
disableAutoRemove: true
|
||||
});
|
||||
return
|
||||
} catch (e) {
|
||||
|
||||
@@ -18,6 +18,7 @@ describe("FileUploadService Integration Testing", () => {
|
||||
|
||||
const service = new FileUploadService(FILE_UPL_SERVICE_TESTING_TOKEN);
|
||||
await service.uploadFiles(
|
||||
"",
|
||||
FILE_UPL_SERVICE_TESTING_CHAT_ID,
|
||||
FILE_UPL_SERVICE_TESTING_USER_ID,
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user