5 Commits
1.0.6 ... 1.0.9

Author SHA1 Message Date
96a5e5896b HotFix
All checks were successful
Setup testing environment and test the code / build (push) Successful in 1m13s
Publish to NPM / build-and-publish (release) Successful in 33s
2026-04-09 11:56:40 +02:00
14fe7ef41d HotFix 2026-04-09 11:56:29 +02:00
d04bd6a437 HotFix
All checks were successful
Setup testing environment and test the code / build (push) Successful in 57s
Publish to NPM / build-and-publish (release) Successful in 33s
2026-04-09 11:18:47 +02:00
0e553767b6 HotFix
Some checks failed
Publish to NPM / build-and-publish (release) Has been cancelled
Setup testing environment and test the code / build (push) Failing after 1m1s
2026-04-09 11:16:45 +02:00
b7af5497a4 Fix DM WebSocket
Some checks failed
Setup testing environment and test the code / build (push) Failing after 1m22s
Publish to NPM / build-and-publish (release) Successful in 30s
2026-04-09 11:12:41 +02:00
5 changed files with 14 additions and 7 deletions

8
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "chatenium-sdk",
"version": "1.0.0",
"name": "@chatenium/chatenium-sdk",
"version": "1.0.8",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "chatenium-sdk",
"version": "1.0.0",
"name": "@chatenium/chatenium-sdk",
"version": "1.0.8",
"dependencies": {
"@faker-js/faker": "^10.4.0",
"axios": "^1.14.0",

View File

@@ -1,6 +1,6 @@
{
"name": "@chatenium/chatenium-sdk",
"version": "1.0.6",
"version": "1.0.9",
"description": "A library for interacting with the Chatenium API",
"type": "module",
"main": "dist/index.js",

View File

@@ -65,6 +65,7 @@ export class WebSocketHandler {
console.log("ConnectionID received")
const data: WSConnIdPayload = JSON.parse(payl.data);
this.listeners.forEach(listener => {
console.log(data.connId, listener)
listener.onNewConnId(data.connId)
this.connectionId = data.connId;
})
@@ -78,6 +79,7 @@ export class WebSocketHandler {
}
public registerService(service: WSListenerPipe) {
console.log("Registering service", service)
this.listeners.add(service);
}

View File

@@ -28,4 +28,8 @@ export const dmHandlers = [
message: body.message,
})
}),
http.post('*/v2/chat/dm/joinWebSocketRoom', async () => {
return HttpResponse.json()
}),
]

View File

@@ -42,8 +42,9 @@ export class DMService {
}
private onNewConnId(newConnId: string) {
console.log("NetworkService: New connection id")
console.log("DmService: New connection id")
this.client.defaults.headers["X-WS-ID"] = newConnId;
this.joinWebSocketRoom().then()
}
/**
@@ -244,7 +245,7 @@ export class DMService {
*/
async joinWebSocketRoom(): Promise<void> {
try {
const resp = await this.client.patch("chat/dm/joinWebSocketRoom", <JoinWsRoomReq>{
await this.client.post("v2/chat/dm/joinWebSocketRoom", <JoinWsRoomReq>{
chatid: this.chatid,
userid: this.userid,
connId: WebSocketHandler.getInstance().connId,