@fishjam-cloud/js-server-sdk 0.28.1 → 0.29.0-rc.1

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.
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var package_default = {
3
3
  name: "@fishjam-cloud/js-server-sdk",
4
- version: "0.28.1",
4
+ version: "0.29.0-rc.1",
5
5
  description: "Fishjam server SDK for JavaScript",
6
6
  homepage: "https://github.com/fishjam-cloud/js-server-sdk",
7
7
  author: "Fishjam Team",
@@ -90,7 +90,8 @@ var package_default = {
90
90
  "*.{js,ts,tsx,mjs,cjs}": [
91
91
  "eslint --fix --config eslint.config.mjs"
92
92
  ]
93
- }
93
+ },
94
+ stableVersion: "0.28.1"
94
95
  };
95
96
 
96
97
  export {
package/dist/index.d.mts CHANGED
@@ -840,6 +840,10 @@ type PeerType = PeerType$1 | 'unspecified';
840
840
  * with the addition of `'unspecified'` for messages whose track type is not set on the wire.
841
841
  */
842
842
  type TrackType = TrackType$2 | 'unspecified';
843
+ /**
844
+ * Voice activity status of a track.
845
+ */
846
+ type VadStatus = 'speech' | 'silence';
843
847
  type Room = {
844
848
  id: RoomId;
845
849
  peers: Peer[];
@@ -864,14 +868,14 @@ type Track = {
864
868
  type: TrackType;
865
869
  metadata: string;
866
870
  };
867
- declare const expectedEventsList$1: readonly ["roomCreated", "roomDeleted", "roomCrashed", "peerAdded", "peerDeleted", "peerConnected", "peerDisconnected", "peerMetadataUpdated", "peerCrashed", "streamerConnected", "streamerDisconnected", "viewerConnected", "viewerDisconnected", "trackAdded", "trackRemoved", "trackMetadataUpdated", "channelAdded", "channelRemoved"];
871
+ declare const expectedEventsList$1: readonly ["roomCreated", "roomDeleted", "roomCrashed", "peerAdded", "peerDeleted", "peerConnected", "peerDisconnected", "peerMetadataUpdated", "peerCrashed", "streamerConnected", "streamerDisconnected", "viewerConnected", "viewerDisconnected", "trackAdded", "trackRemoved", "trackMetadataUpdated", "trackForwarding", "trackForwardingRemoved", "vadNotification", "channelAdded", "channelRemoved"];
868
872
  type ExpectedEvents = (typeof expectedEventsList$1)[number];
869
873
  /**
870
874
  * `ServerMessage` oneof members that are intentionally NOT emitted to users.
871
875
  * Grouped with a brief rationale so the classification stays reviewable.
872
876
  * Mirrors the Python SDK's `IGNORED_NOTIFICATIONS` partition (FCE-3215).
873
877
  */
874
- declare const ignoredEventsList: readonly ["authenticated", "authRequest", "subscribeRequest", "subscribeResponse", "trackForwarding", "trackForwardingRemoved", "vadNotification", "notificationBatch", "streamConnected", "streamDisconnected", "hlsPlayable", "hlsUploaded", "hlsUploadCrashed", "componentCrashed"];
878
+ declare const ignoredEventsList: readonly ["authenticated", "authRequest", "subscribeRequest", "subscribeResponse", "notificationBatch", "streamConnected", "streamDisconnected", "hlsPlayable", "hlsUploaded", "hlsUploadCrashed", "componentCrashed"];
875
879
  type IgnoredEvents = (typeof ignoredEventsList)[number];
876
880
  /**
877
881
  * Field-level overrides applied to every notification payload: branded ID types
@@ -885,6 +889,9 @@ type NotificationOverrides = {
885
889
  peerId: PeerId;
886
890
  peerType: PeerType;
887
891
  track: Track | undefined;
892
+ audioTrack: Track | undefined;
893
+ videoTrack: Track | undefined;
894
+ status: VadStatus;
888
895
  };
889
896
  /** @inline */
890
897
  type Notification<K extends keyof ServerMessage> = Override<NonNullable<ServerMessage[K]>, NotificationOverrides>;
@@ -908,6 +915,9 @@ type Notifications = {
908
915
  trackAdded: Notification<'trackAdded'>;
909
916
  trackRemoved: Notification<'trackRemoved'>;
910
917
  trackMetadataUpdated: Notification<'trackMetadataUpdated'>;
918
+ trackForwarding: Notification<'trackForwarding'>;
919
+ trackForwardingRemoved: Notification<'trackForwardingRemoved'>;
920
+ vadNotification: Notification<'vadNotification'>;
911
921
  channelAdded: Notification<'channelAdded'>;
912
922
  channelRemoved: Notification<'channelRemoved'>;
913
923
  };
@@ -927,6 +937,9 @@ type ViewerDisconnected = Notifications['viewerDisconnected'];
927
937
  type TrackAdded = Notifications['trackAdded'];
928
938
  type TrackRemoved = Notifications['trackRemoved'];
929
939
  type TrackMetadataUpdated = Notifications['trackMetadataUpdated'];
940
+ type TrackForwarding = Notifications['trackForwarding'];
941
+ type TrackForwardingRemoved = Notifications['trackForwardingRemoved'];
942
+ type VadNotification = Notifications['vadNotification'];
930
943
  type ChannelAdded = Notifications['channelAdded'];
931
944
  type ChannelRemoved = Notifications['channelRemoved'];
932
945
  type NotificationEvents = {
@@ -952,6 +965,10 @@ declare const FishjamWSNotifier_base: new () => TypedEventEmitter<NotificationEv
952
965
  declare class FishjamWSNotifier extends FishjamWSNotifier_base {
953
966
  private readonly client;
954
967
  constructor(config: FishjamConfig, onError: ErrorEventHandler, onClose: CloseEventHandler);
968
+ /**
969
+ * Close the underlying WebSocket and stop emitting notifications.
970
+ */
971
+ disconnect(): void;
955
972
  private dispatchNotification;
956
973
  private setupConnection;
957
974
  }
@@ -1215,4 +1232,4 @@ declare class QuotaExceededException extends FishjamBaseException {
1215
1232
  declare class UnknownException extends FishjamBaseException {
1216
1233
  }
1217
1234
 
1218
- export { type AgentCallbacks, type AgentEvents, type AgentTrack, type AudioCodecParameters, BadRequestException, type Brand, type ChannelAdded, type ChannelRemoved, type CloseEventHandler, type ErrorEventHandler, type ExpectedAgentEvents, type ExpectedEvents, FishjamAgent, FishjamBaseException, FishjamClient, type FishjamConfig, FishjamNotFoundException, FishjamWSNotifier, ForbiddenException, type IgnoredEvents, type IncomingTrackData, type IncomingTrackImage, InvalidFishjamCredentialsException, MissingFishjamIdException, type MoqAccess, type MoqAccessConfig, type NotificationEvents, type OutgoingTrackData, type Override, type Peer, type PeerAdded, type PeerConnected, type PeerCrashed, type PeerDeleted, type PeerDisconnected, type PeerId, type PeerMetadataUpdated, PeerNotFoundException, type PeerOptions, type PeerOptionsAgent, type PeerOptionsVapi, type PeerOptionsWebRTC, PeerStatus, type PeerType, QuotaExceededException, type Room, type RoomConfig, type RoomCrashed, type RoomCreated, type RoomDeleted, type RoomId, RoomNotFoundException, RoomType, ServerMessage, type ServerNotification, ServiceUnavailableException, type StreamerConnected, type StreamerDisconnected, type StreamerToken, type Track, type TrackAdded, type TrackId, type TrackMetadataUpdated, type TrackRemoved, type TrackType, UnauthorizedException, UnknownException, VideoCodec, type ViewerConnected, type ViewerDisconnected, type ViewerToken, decodeServerNotifications };
1235
+ export { type AgentCallbacks, type AgentEvents, type AgentTrack, type AudioCodecParameters, BadRequestException, type Brand, type ChannelAdded, type ChannelRemoved, type CloseEventHandler, type ErrorEventHandler, type ExpectedAgentEvents, type ExpectedEvents, FishjamAgent, FishjamBaseException, FishjamClient, type FishjamConfig, FishjamNotFoundException, FishjamWSNotifier, ForbiddenException, type IgnoredEvents, type IncomingTrackData, type IncomingTrackImage, InvalidFishjamCredentialsException, MissingFishjamIdException, type MoqAccess, type MoqAccessConfig, type NotificationEvents, type OutgoingTrackData, type Override, type Peer, type PeerAdded, type PeerConnected, type PeerCrashed, type PeerDeleted, type PeerDisconnected, type PeerId, type PeerMetadataUpdated, PeerNotFoundException, type PeerOptions, type PeerOptionsAgent, type PeerOptionsVapi, type PeerOptionsWebRTC, PeerStatus, type PeerType, QuotaExceededException, type Room, type RoomConfig, type RoomCrashed, type RoomCreated, type RoomDeleted, type RoomId, RoomNotFoundException, RoomType, ServerMessage, type ServerNotification, ServiceUnavailableException, type StreamerConnected, type StreamerDisconnected, type StreamerToken, type Track, type TrackAdded, type TrackForwarding, type TrackForwardingRemoved, type TrackId, type TrackMetadataUpdated, type TrackRemoved, type TrackType, UnauthorizedException, UnknownException, type VadNotification, type VadStatus, VideoCodec, type ViewerConnected, type ViewerDisconnected, type ViewerToken, decodeServerNotifications };
package/dist/index.d.ts CHANGED
@@ -840,6 +840,10 @@ type PeerType = PeerType$1 | 'unspecified';
840
840
  * with the addition of `'unspecified'` for messages whose track type is not set on the wire.
841
841
  */
842
842
  type TrackType = TrackType$2 | 'unspecified';
843
+ /**
844
+ * Voice activity status of a track.
845
+ */
846
+ type VadStatus = 'speech' | 'silence';
843
847
  type Room = {
844
848
  id: RoomId;
845
849
  peers: Peer[];
@@ -864,14 +868,14 @@ type Track = {
864
868
  type: TrackType;
865
869
  metadata: string;
866
870
  };
867
- declare const expectedEventsList$1: readonly ["roomCreated", "roomDeleted", "roomCrashed", "peerAdded", "peerDeleted", "peerConnected", "peerDisconnected", "peerMetadataUpdated", "peerCrashed", "streamerConnected", "streamerDisconnected", "viewerConnected", "viewerDisconnected", "trackAdded", "trackRemoved", "trackMetadataUpdated", "channelAdded", "channelRemoved"];
871
+ declare const expectedEventsList$1: readonly ["roomCreated", "roomDeleted", "roomCrashed", "peerAdded", "peerDeleted", "peerConnected", "peerDisconnected", "peerMetadataUpdated", "peerCrashed", "streamerConnected", "streamerDisconnected", "viewerConnected", "viewerDisconnected", "trackAdded", "trackRemoved", "trackMetadataUpdated", "trackForwarding", "trackForwardingRemoved", "vadNotification", "channelAdded", "channelRemoved"];
868
872
  type ExpectedEvents = (typeof expectedEventsList$1)[number];
869
873
  /**
870
874
  * `ServerMessage` oneof members that are intentionally NOT emitted to users.
871
875
  * Grouped with a brief rationale so the classification stays reviewable.
872
876
  * Mirrors the Python SDK's `IGNORED_NOTIFICATIONS` partition (FCE-3215).
873
877
  */
874
- declare const ignoredEventsList: readonly ["authenticated", "authRequest", "subscribeRequest", "subscribeResponse", "trackForwarding", "trackForwardingRemoved", "vadNotification", "notificationBatch", "streamConnected", "streamDisconnected", "hlsPlayable", "hlsUploaded", "hlsUploadCrashed", "componentCrashed"];
878
+ declare const ignoredEventsList: readonly ["authenticated", "authRequest", "subscribeRequest", "subscribeResponse", "notificationBatch", "streamConnected", "streamDisconnected", "hlsPlayable", "hlsUploaded", "hlsUploadCrashed", "componentCrashed"];
875
879
  type IgnoredEvents = (typeof ignoredEventsList)[number];
876
880
  /**
877
881
  * Field-level overrides applied to every notification payload: branded ID types
@@ -885,6 +889,9 @@ type NotificationOverrides = {
885
889
  peerId: PeerId;
886
890
  peerType: PeerType;
887
891
  track: Track | undefined;
892
+ audioTrack: Track | undefined;
893
+ videoTrack: Track | undefined;
894
+ status: VadStatus;
888
895
  };
889
896
  /** @inline */
890
897
  type Notification<K extends keyof ServerMessage> = Override<NonNullable<ServerMessage[K]>, NotificationOverrides>;
@@ -908,6 +915,9 @@ type Notifications = {
908
915
  trackAdded: Notification<'trackAdded'>;
909
916
  trackRemoved: Notification<'trackRemoved'>;
910
917
  trackMetadataUpdated: Notification<'trackMetadataUpdated'>;
918
+ trackForwarding: Notification<'trackForwarding'>;
919
+ trackForwardingRemoved: Notification<'trackForwardingRemoved'>;
920
+ vadNotification: Notification<'vadNotification'>;
911
921
  channelAdded: Notification<'channelAdded'>;
912
922
  channelRemoved: Notification<'channelRemoved'>;
913
923
  };
@@ -927,6 +937,9 @@ type ViewerDisconnected = Notifications['viewerDisconnected'];
927
937
  type TrackAdded = Notifications['trackAdded'];
928
938
  type TrackRemoved = Notifications['trackRemoved'];
929
939
  type TrackMetadataUpdated = Notifications['trackMetadataUpdated'];
940
+ type TrackForwarding = Notifications['trackForwarding'];
941
+ type TrackForwardingRemoved = Notifications['trackForwardingRemoved'];
942
+ type VadNotification = Notifications['vadNotification'];
930
943
  type ChannelAdded = Notifications['channelAdded'];
931
944
  type ChannelRemoved = Notifications['channelRemoved'];
932
945
  type NotificationEvents = {
@@ -952,6 +965,10 @@ declare const FishjamWSNotifier_base: new () => TypedEventEmitter<NotificationEv
952
965
  declare class FishjamWSNotifier extends FishjamWSNotifier_base {
953
966
  private readonly client;
954
967
  constructor(config: FishjamConfig, onError: ErrorEventHandler, onClose: CloseEventHandler);
968
+ /**
969
+ * Close the underlying WebSocket and stop emitting notifications.
970
+ */
971
+ disconnect(): void;
955
972
  private dispatchNotification;
956
973
  private setupConnection;
957
974
  }
@@ -1215,4 +1232,4 @@ declare class QuotaExceededException extends FishjamBaseException {
1215
1232
  declare class UnknownException extends FishjamBaseException {
1216
1233
  }
1217
1234
 
1218
- export { type AgentCallbacks, type AgentEvents, type AgentTrack, type AudioCodecParameters, BadRequestException, type Brand, type ChannelAdded, type ChannelRemoved, type CloseEventHandler, type ErrorEventHandler, type ExpectedAgentEvents, type ExpectedEvents, FishjamAgent, FishjamBaseException, FishjamClient, type FishjamConfig, FishjamNotFoundException, FishjamWSNotifier, ForbiddenException, type IgnoredEvents, type IncomingTrackData, type IncomingTrackImage, InvalidFishjamCredentialsException, MissingFishjamIdException, type MoqAccess, type MoqAccessConfig, type NotificationEvents, type OutgoingTrackData, type Override, type Peer, type PeerAdded, type PeerConnected, type PeerCrashed, type PeerDeleted, type PeerDisconnected, type PeerId, type PeerMetadataUpdated, PeerNotFoundException, type PeerOptions, type PeerOptionsAgent, type PeerOptionsVapi, type PeerOptionsWebRTC, PeerStatus, type PeerType, QuotaExceededException, type Room, type RoomConfig, type RoomCrashed, type RoomCreated, type RoomDeleted, type RoomId, RoomNotFoundException, RoomType, ServerMessage, type ServerNotification, ServiceUnavailableException, type StreamerConnected, type StreamerDisconnected, type StreamerToken, type Track, type TrackAdded, type TrackId, type TrackMetadataUpdated, type TrackRemoved, type TrackType, UnauthorizedException, UnknownException, VideoCodec, type ViewerConnected, type ViewerDisconnected, type ViewerToken, decodeServerNotifications };
1235
+ export { type AgentCallbacks, type AgentEvents, type AgentTrack, type AudioCodecParameters, BadRequestException, type Brand, type ChannelAdded, type ChannelRemoved, type CloseEventHandler, type ErrorEventHandler, type ExpectedAgentEvents, type ExpectedEvents, FishjamAgent, FishjamBaseException, FishjamClient, type FishjamConfig, FishjamNotFoundException, FishjamWSNotifier, ForbiddenException, type IgnoredEvents, type IncomingTrackData, type IncomingTrackImage, InvalidFishjamCredentialsException, MissingFishjamIdException, type MoqAccess, type MoqAccessConfig, type NotificationEvents, type OutgoingTrackData, type Override, type Peer, type PeerAdded, type PeerConnected, type PeerCrashed, type PeerDeleted, type PeerDisconnected, type PeerId, type PeerMetadataUpdated, PeerNotFoundException, type PeerOptions, type PeerOptionsAgent, type PeerOptionsVapi, type PeerOptionsWebRTC, PeerStatus, type PeerType, QuotaExceededException, type Room, type RoomConfig, type RoomCrashed, type RoomCreated, type RoomDeleted, type RoomId, RoomNotFoundException, RoomType, ServerMessage, type ServerNotification, ServiceUnavailableException, type StreamerConnected, type StreamerDisconnected, type StreamerToken, type Track, type TrackAdded, type TrackForwarding, type TrackForwardingRemoved, type TrackId, type TrackMetadataUpdated, type TrackRemoved, type TrackType, UnauthorizedException, UnknownException, type VadNotification, type VadStatus, VideoCodec, type ViewerConnected, type ViewerDisconnected, type ViewerToken, decodeServerNotifications };
package/dist/index.js CHANGED
@@ -2041,6 +2041,13 @@ function serverMessage_EventTypeToJSON(object) {
2041
2041
  return "UNRECOGNIZED";
2042
2042
  }
2043
2043
  }
2044
+ var ServerMessage_VadNotification_Status = /* @__PURE__ */ ((ServerMessage_VadNotification_Status2) => {
2045
+ ServerMessage_VadNotification_Status2[ServerMessage_VadNotification_Status2["STATUS_UNSPECIFIED"] = 0] = "STATUS_UNSPECIFIED";
2046
+ ServerMessage_VadNotification_Status2[ServerMessage_VadNotification_Status2["STATUS_SILENCE"] = 1] = "STATUS_SILENCE";
2047
+ ServerMessage_VadNotification_Status2[ServerMessage_VadNotification_Status2["STATUS_SPEECH"] = 2] = "STATUS_SPEECH";
2048
+ ServerMessage_VadNotification_Status2[ServerMessage_VadNotification_Status2["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
2049
+ return ServerMessage_VadNotification_Status2;
2050
+ })(ServerMessage_VadNotification_Status || {});
2044
2051
  function serverMessage_VadNotification_StatusFromJSON(object) {
2045
2052
  switch (object) {
2046
2053
  case 0:
@@ -5916,6 +5923,12 @@ var trackTypeMap = {
5916
5923
  [TrackType.TRACK_TYPE_AUDIO]: "audio",
5917
5924
  [TrackType.UNRECOGNIZED]: "unspecified"
5918
5925
  };
5926
+ var vadStatusMap = {
5927
+ [ServerMessage_VadNotification_Status.STATUS_UNSPECIFIED]: "silence",
5928
+ [ServerMessage_VadNotification_Status.STATUS_SILENCE]: "silence",
5929
+ [ServerMessage_VadNotification_Status.STATUS_SPEECH]: "speech",
5930
+ [ServerMessage_VadNotification_Status.UNRECOGNIZED]: "silence"
5931
+ };
5919
5932
  var expectedEventsList = [
5920
5933
  "roomCreated",
5921
5934
  "roomDeleted",
@@ -5933,6 +5946,9 @@ var expectedEventsList = [
5933
5946
  "trackAdded",
5934
5947
  "trackRemoved",
5935
5948
  "trackMetadataUpdated",
5949
+ "trackForwarding",
5950
+ "trackForwardingRemoved",
5951
+ "vadNotification",
5936
5952
  "channelAdded",
5937
5953
  "channelRemoved"
5938
5954
  ];
@@ -5955,6 +5971,14 @@ var mapNotification = (event, msg) => {
5955
5971
  const trackMsg = msg;
5956
5972
  return { ...trackMsg, track: mapTrack(trackMsg.track) };
5957
5973
  }
5974
+ if (event === "trackForwarding") {
5975
+ const fwd = msg;
5976
+ return { ...fwd, audioTrack: mapTrack(fwd.audioTrack), videoTrack: mapTrack(fwd.videoTrack) };
5977
+ }
5978
+ if (event === "vadNotification") {
5979
+ const vad = msg;
5980
+ return { ...vad, status: vadStatusMap[vad.status] };
5981
+ }
5958
5982
  return msg;
5959
5983
  };
5960
5984
  var isExpectedEvent = (event) => expectedEventsList.includes(event);
@@ -5982,6 +6006,13 @@ var FishjamWSNotifier = class extends import_events.EventEmitter {
5982
6006
  this.client.onmessage = (message) => this.dispatchNotification(message);
5983
6007
  this.client.onopen = () => this.setupConnection(config.managementToken);
5984
6008
  }
6009
+ /**
6010
+ * Close the underlying WebSocket and stop emitting notifications.
6011
+ */
6012
+ disconnect() {
6013
+ this.removeAllListeners();
6014
+ this.client.close();
6015
+ }
5985
6016
  dispatchNotification(message) {
5986
6017
  try {
5987
6018
  const decodedMessage = ServerMessage.decode(new Uint8Array(message.data));
@@ -6195,7 +6226,7 @@ var mapException = (error, entity) => {
6195
6226
  // package.json
6196
6227
  var package_default = {
6197
6228
  name: "@fishjam-cloud/js-server-sdk",
6198
- version: "0.28.1",
6229
+ version: "0.29.0-rc.1",
6199
6230
  description: "Fishjam server SDK for JavaScript",
6200
6231
  homepage: "https://github.com/fishjam-cloud/js-server-sdk",
6201
6232
  author: "Fishjam Team",
@@ -6284,7 +6315,8 @@ var package_default = {
6284
6315
  "*.{js,ts,tsx,mjs,cjs}": [
6285
6316
  "eslint --fix --config eslint.config.mjs"
6286
6317
  ]
6287
- }
6318
+ },
6319
+ stableVersion: "0.28.1"
6288
6320
  };
6289
6321
 
6290
6322
  // src/client.ts
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  package_default
3
- } from "./chunk-GTNIELH6.mjs";
3
+ } from "./chunk-VLMRJKOY.mjs";
4
4
 
5
5
  // ../fishjam-openapi/dist/index.js
6
6
  import globalAxios2 from "axios";
@@ -1990,6 +1990,13 @@ function serverMessage_EventTypeToJSON(object) {
1990
1990
  return "UNRECOGNIZED";
1991
1991
  }
1992
1992
  }
1993
+ var ServerMessage_VadNotification_Status = /* @__PURE__ */ ((ServerMessage_VadNotification_Status2) => {
1994
+ ServerMessage_VadNotification_Status2[ServerMessage_VadNotification_Status2["STATUS_UNSPECIFIED"] = 0] = "STATUS_UNSPECIFIED";
1995
+ ServerMessage_VadNotification_Status2[ServerMessage_VadNotification_Status2["STATUS_SILENCE"] = 1] = "STATUS_SILENCE";
1996
+ ServerMessage_VadNotification_Status2[ServerMessage_VadNotification_Status2["STATUS_SPEECH"] = 2] = "STATUS_SPEECH";
1997
+ ServerMessage_VadNotification_Status2[ServerMessage_VadNotification_Status2["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
1998
+ return ServerMessage_VadNotification_Status2;
1999
+ })(ServerMessage_VadNotification_Status || {});
1993
2000
  function serverMessage_VadNotification_StatusFromJSON(object) {
1994
2001
  switch (object) {
1995
2002
  case 0:
@@ -5865,6 +5872,12 @@ var trackTypeMap = {
5865
5872
  [TrackType.TRACK_TYPE_AUDIO]: "audio",
5866
5873
  [TrackType.UNRECOGNIZED]: "unspecified"
5867
5874
  };
5875
+ var vadStatusMap = {
5876
+ [ServerMessage_VadNotification_Status.STATUS_UNSPECIFIED]: "silence",
5877
+ [ServerMessage_VadNotification_Status.STATUS_SILENCE]: "silence",
5878
+ [ServerMessage_VadNotification_Status.STATUS_SPEECH]: "speech",
5879
+ [ServerMessage_VadNotification_Status.UNRECOGNIZED]: "silence"
5880
+ };
5868
5881
  var expectedEventsList = [
5869
5882
  "roomCreated",
5870
5883
  "roomDeleted",
@@ -5882,6 +5895,9 @@ var expectedEventsList = [
5882
5895
  "trackAdded",
5883
5896
  "trackRemoved",
5884
5897
  "trackMetadataUpdated",
5898
+ "trackForwarding",
5899
+ "trackForwardingRemoved",
5900
+ "vadNotification",
5885
5901
  "channelAdded",
5886
5902
  "channelRemoved"
5887
5903
  ];
@@ -5904,6 +5920,14 @@ var mapNotification = (event, msg) => {
5904
5920
  const trackMsg = msg;
5905
5921
  return { ...trackMsg, track: mapTrack(trackMsg.track) };
5906
5922
  }
5923
+ if (event === "trackForwarding") {
5924
+ const fwd = msg;
5925
+ return { ...fwd, audioTrack: mapTrack(fwd.audioTrack), videoTrack: mapTrack(fwd.videoTrack) };
5926
+ }
5927
+ if (event === "vadNotification") {
5928
+ const vad = msg;
5929
+ return { ...vad, status: vadStatusMap[vad.status] };
5930
+ }
5907
5931
  return msg;
5908
5932
  };
5909
5933
  var isExpectedEvent = (event) => expectedEventsList.includes(event);
@@ -5931,6 +5955,13 @@ var FishjamWSNotifier = class extends EventEmitter {
5931
5955
  this.client.onmessage = (message) => this.dispatchNotification(message);
5932
5956
  this.client.onopen = () => this.setupConnection(config.managementToken);
5933
5957
  }
5958
+ /**
5959
+ * Close the underlying WebSocket and stop emitting notifications.
5960
+ */
5961
+ disconnect() {
5962
+ this.removeAllListeners();
5963
+ this.client.close();
5964
+ }
5934
5965
  dispatchNotification(message) {
5935
5966
  try {
5936
5967
  const decodedMessage = ServerMessage.decode(new Uint8Array(message.data));
@@ -31,7 +31,7 @@ var import_genai = require("@google/genai");
31
31
  // package.json
32
32
  var package_default = {
33
33
  name: "@fishjam-cloud/js-server-sdk",
34
- version: "0.28.1",
34
+ version: "0.29.0-rc.1",
35
35
  description: "Fishjam server SDK for JavaScript",
36
36
  homepage: "https://github.com/fishjam-cloud/js-server-sdk",
37
37
  author: "Fishjam Team",
@@ -120,7 +120,8 @@ var package_default = {
120
120
  "*.{js,ts,tsx,mjs,cjs}": [
121
121
  "eslint --fix --config eslint.config.mjs"
122
122
  ]
123
- }
123
+ },
124
+ stableVersion: "0.28.1"
124
125
  };
125
126
 
126
127
  // src/integrations/gemini.ts
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  package_default
3
- } from "../chunk-GTNIELH6.mjs";
3
+ } from "../chunk-VLMRJKOY.mjs";
4
4
 
5
5
  // src/integrations/gemini.ts
6
6
  import { GoogleGenAI } from "@google/genai";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fishjam-cloud/js-server-sdk",
3
- "version": "0.28.1",
3
+ "version": "0.29.0-rc.1",
4
4
  "description": "Fishjam server SDK for JavaScript",
5
5
  "homepage": "https://github.com/fishjam-cloud/js-server-sdk",
6
6
  "author": "Fishjam Team",
@@ -74,8 +74,8 @@
74
74
  }
75
75
  },
76
76
  "devDependencies": {
77
- "@fishjam-cloud/fishjam-openapi": "0.28.1",
78
- "@fishjam-cloud/fishjam-proto": "0.28.1",
77
+ "@fishjam-cloud/fishjam-openapi": "0.29.0-rc.1",
78
+ "@fishjam-cloud/fishjam-proto": "0.29.0-rc.1",
79
79
  "@openapitools/openapi-generator-cli": "^2.18.4",
80
80
  "@types/node": "^22.13.16",
81
81
  "@types/websocket": "^1.0.10",
@@ -89,5 +89,6 @@
89
89
  "*.{js,ts,tsx,mjs,cjs}": [
90
90
  "eslint --fix --config eslint.config.mjs"
91
91
  ]
92
- }
92
+ },
93
+ "stableVersion": "0.28.1"
93
94
  }