@whereby.com/assistant-sdk 0.0.0-canary-20250923130059 → 0.0.0-canary-20250923134558
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/index.cjs +7 -5
- package/dist/index.d.cts +1 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +7 -5
- package/dist/legacy-esm.js +7 -5
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -586,11 +586,13 @@ class Assistant extends EventEmitter {
|
|
|
586
586
|
this.combinedStream = null;
|
|
587
587
|
this.remoteMediaTracks = {};
|
|
588
588
|
this.roomUrl = null;
|
|
589
|
+
this.stateSubscriptions = [];
|
|
589
590
|
this.handleConnectionStatusChange = (status) => {
|
|
590
591
|
if (status === "connected") {
|
|
591
592
|
this.emit(ASSISTANT_JOINED_ROOM, { roomUrl: this.roomUrl || "" });
|
|
592
593
|
}
|
|
593
594
|
if (["left", "kicked"].includes(status)) {
|
|
595
|
+
this.stateSubscriptions.forEach((unsubscribe) => unsubscribe());
|
|
594
596
|
this.emit(ASSISTANT_LEFT_ROOM, { roomUrl: this.roomUrl || "" });
|
|
595
597
|
}
|
|
596
598
|
};
|
|
@@ -652,10 +654,10 @@ class Assistant extends EventEmitter {
|
|
|
652
654
|
};
|
|
653
655
|
const audioMixer = new AudioMixer(handleStreamReady);
|
|
654
656
|
this.combinedStream = audioMixer.getCombinedAudioStream();
|
|
655
|
-
this.roomConnection.subscribeToRemoteParticipants(audioMixer.handleRemoteParticipants.bind(audioMixer));
|
|
657
|
+
this.stateSubscriptions.push(this.roomConnection.subscribeToRemoteParticipants(audioMixer.handleRemoteParticipants.bind(audioMixer)));
|
|
656
658
|
}
|
|
657
|
-
this.roomConnection.subscribeToConnectionStatus(this.handleConnectionStatusChange);
|
|
658
|
-
this.roomConnection.subscribeToRemoteParticipants(this.handleRemoteParticipantsTracksChange);
|
|
659
|
+
this.stateSubscriptions.push(this.roomConnection.subscribeToConnectionStatus(this.handleConnectionStatusChange));
|
|
660
|
+
this.stateSubscriptions.push(this.roomConnection.subscribeToRemoteParticipants(this.handleRemoteParticipantsTracksChange));
|
|
659
661
|
}
|
|
660
662
|
joinRoom(roomUrl) {
|
|
661
663
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -814,8 +816,8 @@ class Trigger extends EventEmitter.EventEmitter {
|
|
|
814
816
|
const app = express();
|
|
815
817
|
const router = webhookRouter(this.webhookTriggers, this);
|
|
816
818
|
app.use(router);
|
|
817
|
-
app.listen(this.port, () => {
|
|
818
|
-
|
|
819
|
+
app.listen(this.port).on("error", (error) => {
|
|
820
|
+
console.error("Could not start Trigger web server", error);
|
|
819
821
|
});
|
|
820
822
|
}
|
|
821
823
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -146,6 +146,7 @@ declare class Assistant extends EventEmitter<AssistantEvents> {
|
|
|
146
146
|
private combinedStream;
|
|
147
147
|
private remoteMediaTracks;
|
|
148
148
|
private roomUrl;
|
|
149
|
+
private stateSubscriptions;
|
|
149
150
|
constructor({ assistantKey, startCombinedAudioStream, startLocalMedia }: AssistantOptions);
|
|
150
151
|
private handleConnectionStatusChange;
|
|
151
152
|
private handleRemoteParticipantsTracksChange;
|
package/dist/index.d.mts
CHANGED
|
@@ -146,6 +146,7 @@ declare class Assistant extends EventEmitter<AssistantEvents> {
|
|
|
146
146
|
private combinedStream;
|
|
147
147
|
private remoteMediaTracks;
|
|
148
148
|
private roomUrl;
|
|
149
|
+
private stateSubscriptions;
|
|
149
150
|
constructor({ assistantKey, startCombinedAudioStream, startLocalMedia }: AssistantOptions);
|
|
150
151
|
private handleConnectionStatusChange;
|
|
151
152
|
private handleRemoteParticipantsTracksChange;
|
package/dist/index.d.ts
CHANGED
|
@@ -146,6 +146,7 @@ declare class Assistant extends EventEmitter<AssistantEvents> {
|
|
|
146
146
|
private combinedStream;
|
|
147
147
|
private remoteMediaTracks;
|
|
148
148
|
private roomUrl;
|
|
149
|
+
private stateSubscriptions;
|
|
149
150
|
constructor({ assistantKey, startCombinedAudioStream, startLocalMedia }: AssistantOptions);
|
|
150
151
|
private handleConnectionStatusChange;
|
|
151
152
|
private handleRemoteParticipantsTracksChange;
|
package/dist/index.mjs
CHANGED
|
@@ -565,11 +565,13 @@ class Assistant extends EventEmitter$1 {
|
|
|
565
565
|
this.combinedStream = null;
|
|
566
566
|
this.remoteMediaTracks = {};
|
|
567
567
|
this.roomUrl = null;
|
|
568
|
+
this.stateSubscriptions = [];
|
|
568
569
|
this.handleConnectionStatusChange = (status) => {
|
|
569
570
|
if (status === "connected") {
|
|
570
571
|
this.emit(ASSISTANT_JOINED_ROOM, { roomUrl: this.roomUrl || "" });
|
|
571
572
|
}
|
|
572
573
|
if (["left", "kicked"].includes(status)) {
|
|
574
|
+
this.stateSubscriptions.forEach((unsubscribe) => unsubscribe());
|
|
573
575
|
this.emit(ASSISTANT_LEFT_ROOM, { roomUrl: this.roomUrl || "" });
|
|
574
576
|
}
|
|
575
577
|
};
|
|
@@ -631,10 +633,10 @@ class Assistant extends EventEmitter$1 {
|
|
|
631
633
|
};
|
|
632
634
|
const audioMixer = new AudioMixer(handleStreamReady);
|
|
633
635
|
this.combinedStream = audioMixer.getCombinedAudioStream();
|
|
634
|
-
this.roomConnection.subscribeToRemoteParticipants(audioMixer.handleRemoteParticipants.bind(audioMixer));
|
|
636
|
+
this.stateSubscriptions.push(this.roomConnection.subscribeToRemoteParticipants(audioMixer.handleRemoteParticipants.bind(audioMixer)));
|
|
635
637
|
}
|
|
636
|
-
this.roomConnection.subscribeToConnectionStatus(this.handleConnectionStatusChange);
|
|
637
|
-
this.roomConnection.subscribeToRemoteParticipants(this.handleRemoteParticipantsTracksChange);
|
|
638
|
+
this.stateSubscriptions.push(this.roomConnection.subscribeToConnectionStatus(this.handleConnectionStatusChange));
|
|
639
|
+
this.stateSubscriptions.push(this.roomConnection.subscribeToRemoteParticipants(this.handleRemoteParticipantsTracksChange));
|
|
638
640
|
}
|
|
639
641
|
joinRoom(roomUrl) {
|
|
640
642
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -793,8 +795,8 @@ class Trigger extends EventEmitter {
|
|
|
793
795
|
const app = express();
|
|
794
796
|
const router = webhookRouter(this.webhookTriggers, this);
|
|
795
797
|
app.use(router);
|
|
796
|
-
app.listen(this.port, () => {
|
|
797
|
-
|
|
798
|
+
app.listen(this.port).on("error", (error) => {
|
|
799
|
+
console.error("Could not start Trigger web server", error);
|
|
798
800
|
});
|
|
799
801
|
}
|
|
800
802
|
}
|
package/dist/legacy-esm.js
CHANGED
|
@@ -565,11 +565,13 @@ class Assistant extends EventEmitter$1 {
|
|
|
565
565
|
this.combinedStream = null;
|
|
566
566
|
this.remoteMediaTracks = {};
|
|
567
567
|
this.roomUrl = null;
|
|
568
|
+
this.stateSubscriptions = [];
|
|
568
569
|
this.handleConnectionStatusChange = (status) => {
|
|
569
570
|
if (status === "connected") {
|
|
570
571
|
this.emit(ASSISTANT_JOINED_ROOM, { roomUrl: this.roomUrl || "" });
|
|
571
572
|
}
|
|
572
573
|
if (["left", "kicked"].includes(status)) {
|
|
574
|
+
this.stateSubscriptions.forEach((unsubscribe) => unsubscribe());
|
|
573
575
|
this.emit(ASSISTANT_LEFT_ROOM, { roomUrl: this.roomUrl || "" });
|
|
574
576
|
}
|
|
575
577
|
};
|
|
@@ -631,10 +633,10 @@ class Assistant extends EventEmitter$1 {
|
|
|
631
633
|
};
|
|
632
634
|
const audioMixer = new AudioMixer(handleStreamReady);
|
|
633
635
|
this.combinedStream = audioMixer.getCombinedAudioStream();
|
|
634
|
-
this.roomConnection.subscribeToRemoteParticipants(audioMixer.handleRemoteParticipants.bind(audioMixer));
|
|
636
|
+
this.stateSubscriptions.push(this.roomConnection.subscribeToRemoteParticipants(audioMixer.handleRemoteParticipants.bind(audioMixer)));
|
|
635
637
|
}
|
|
636
|
-
this.roomConnection.subscribeToConnectionStatus(this.handleConnectionStatusChange);
|
|
637
|
-
this.roomConnection.subscribeToRemoteParticipants(this.handleRemoteParticipantsTracksChange);
|
|
638
|
+
this.stateSubscriptions.push(this.roomConnection.subscribeToConnectionStatus(this.handleConnectionStatusChange));
|
|
639
|
+
this.stateSubscriptions.push(this.roomConnection.subscribeToRemoteParticipants(this.handleRemoteParticipantsTracksChange));
|
|
638
640
|
}
|
|
639
641
|
joinRoom(roomUrl) {
|
|
640
642
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -793,8 +795,8 @@ class Trigger extends EventEmitter {
|
|
|
793
795
|
const app = express();
|
|
794
796
|
const router = webhookRouter(this.webhookTriggers, this);
|
|
795
797
|
app.use(router);
|
|
796
|
-
app.listen(this.port, () => {
|
|
797
|
-
|
|
798
|
+
app.listen(this.port).on("error", (error) => {
|
|
799
|
+
console.error("Could not start Trigger web server", error);
|
|
798
800
|
});
|
|
799
801
|
}
|
|
800
802
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@whereby.com/assistant-sdk",
|
|
3
3
|
"description": "Assistant SDK for whereby.com",
|
|
4
4
|
"author": "Whereby AS",
|
|
5
|
-
"version": "0.0.0-canary-
|
|
5
|
+
"version": "0.0.0-canary-20250923134558",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"express": "5.1.0",
|
|
65
65
|
"uuid": "^11.0.3",
|
|
66
66
|
"ws": "^8.18.0",
|
|
67
|
-
"@whereby.com/core": "0.0.0-canary-
|
|
67
|
+
"@whereby.com/core": "0.0.0-canary-20250923134558"
|
|
68
68
|
},
|
|
69
69
|
"prettier": "@whereby.com/prettier-config",
|
|
70
70
|
"scripts": {
|