@fishjam-cloud/js-server-sdk 0.25.5 → 0.26.0

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.25.5",
4
+ version: "0.26.0",
5
5
  description: "Fishjam server SDK for JavaScript",
6
6
  homepage: "https://github.com/fishjam-cloud/js-server-sdk",
7
7
  author: "Fishjam Team",
package/dist/index.d.mts CHANGED
@@ -93,7 +93,7 @@ interface Peer$1 {
93
93
  * Peer-specific options
94
94
  * @export
95
95
  */
96
- type PeerOptions = PeerOptionsAgent | PeerOptionsWebRTC;
96
+ type PeerOptions = PeerOptionsAgent | PeerOptionsVapi | PeerOptionsWebRTC;
97
97
  /**
98
98
  * Options specific to the Agent peer
99
99
  * @export
@@ -113,6 +113,31 @@ interface PeerOptionsAgent {
113
113
  */
114
114
  'subscribeMode'?: SubscribeMode;
115
115
  }
116
+ /**
117
+ * Options specific to the VAPI peer
118
+ * @export
119
+ * @interface PeerOptionsVapi
120
+ */
121
+ interface PeerOptionsVapi {
122
+ /**
123
+ * VAPI API key
124
+ * @type {string}
125
+ * @memberof PeerOptionsVapi
126
+ */
127
+ 'apiKey': string;
128
+ /**
129
+ * VAPI call ID
130
+ * @type {string}
131
+ * @memberof PeerOptionsVapi
132
+ */
133
+ 'callId': string;
134
+ /**
135
+ *
136
+ * @type {SubscribeMode}
137
+ * @memberof PeerOptionsVapi
138
+ */
139
+ 'subscribeMode'?: SubscribeMode;
140
+ }
116
141
  /**
117
142
  * Options specific to the WebRTC peer
118
143
  * @export
@@ -152,6 +177,7 @@ type PeerStatus = typeof PeerStatus[keyof typeof PeerStatus];
152
177
  declare const PeerType: {
153
178
  readonly Webrtc: "webrtc";
154
179
  readonly Agent: "agent";
180
+ readonly Vapi: "vapi";
155
181
  };
156
182
  type PeerType = typeof PeerType[keyof typeof PeerType];
157
183
  /**
@@ -343,6 +369,7 @@ declare enum ServerMessage_PeerType {
343
369
  PEER_TYPE_UNSPECIFIED = 0,
344
370
  PEER_TYPE_WEBRTC = 1,
345
371
  PEER_TYPE_AGENT = 2,
372
+ PEER_TYPE_VAPI = 3,
346
373
  UNRECOGNIZED = -1
347
374
  }
348
375
  /** Defines message groups for which peer can subscribe */
@@ -351,38 +378,51 @@ declare enum ServerMessage_EventType {
351
378
  EVENT_TYPE_SERVER_NOTIFICATION = 1,
352
379
  UNRECOGNIZED = -1
353
380
  }
381
+ declare enum ServerMessage_VadNotification_Status {
382
+ STATUS_UNSPECIFIED = 0,
383
+ STATUS_SILENCE = 1,
384
+ STATUS_SPEECH = 2,
385
+ UNRECOGNIZED = -1
386
+ }
354
387
  /** Defines any type of message passed between FJ and server peer */
355
388
  interface ServerMessage {
356
- roomCrashed?: ServerMessage_RoomCrashed | undefined;
357
- peerConnected?: ServerMessage_PeerConnected | undefined;
358
- peerDisconnected?: ServerMessage_PeerDisconnected | undefined;
359
- peerCrashed?: ServerMessage_PeerCrashed | undefined;
360
- componentCrashed?: ServerMessage_ComponentCrashed | undefined;
361
389
  authenticated?: ServerMessage_Authenticated | undefined;
362
390
  authRequest?: ServerMessage_AuthRequest | undefined;
363
391
  subscribeRequest?: ServerMessage_SubscribeRequest | undefined;
364
392
  subscribeResponse?: ServerMessage_SubscribeResponse | undefined;
365
393
  roomCreated?: ServerMessage_RoomCreated | undefined;
366
394
  roomDeleted?: ServerMessage_RoomDeleted | undefined;
367
- hlsPlayable?: ServerMessage_HlsPlayable | undefined;
368
- hlsUploaded?: ServerMessage_HlsUploaded | undefined;
369
- hlsUploadCrashed?: ServerMessage_HlsUploadCrashed | undefined;
395
+ roomCrashed?: ServerMessage_RoomCrashed | undefined;
396
+ peerConnected?: ServerMessage_PeerConnected | undefined;
397
+ peerDisconnected?: ServerMessage_PeerDisconnected | undefined;
398
+ peerCrashed?: ServerMessage_PeerCrashed | undefined;
370
399
  peerMetadataUpdated?: ServerMessage_PeerMetadataUpdated | undefined;
371
400
  trackAdded?: ServerMessage_TrackAdded | undefined;
372
401
  trackRemoved?: ServerMessage_TrackRemoved | undefined;
373
402
  trackMetadataUpdated?: ServerMessage_TrackMetadataUpdated | undefined;
374
403
  peerAdded?: ServerMessage_PeerAdded | undefined;
375
404
  peerDeleted?: ServerMessage_PeerDeleted | undefined;
376
- /** @deprecated */
377
- streamConnected?: ServerMessage_StreamConnected | undefined;
378
- /** @deprecated */
379
- streamDisconnected?: ServerMessage_StreamDisconnected | undefined;
405
+ channelAdded?: ServerMessage_ChannelAdded | undefined;
406
+ channelRemoved?: ServerMessage_ChannelRemoved | undefined;
407
+ trackForwarding?: ServerMessage_TrackForwarding | undefined;
408
+ trackForwardingRemoved?: ServerMessage_TrackForwardingRemoved | undefined;
409
+ vadNotification?: ServerMessage_VadNotification | undefined;
380
410
  viewerConnected?: ServerMessage_ViewerConnected | undefined;
381
411
  viewerDisconnected?: ServerMessage_ViewerDisconnected | undefined;
382
412
  streamerConnected?: ServerMessage_StreamerConnected | undefined;
383
413
  streamerDisconnected?: ServerMessage_StreamerDisconnected | undefined;
384
- channelAdded?: ServerMessage_ChannelAdded | undefined;
385
- channelRemoved?: ServerMessage_ChannelRemoved | undefined;
414
+ /** @deprecated */
415
+ streamConnected?: ServerMessage_StreamConnected | undefined;
416
+ /** @deprecated */
417
+ streamDisconnected?: ServerMessage_StreamDisconnected | undefined;
418
+ /** @deprecated */
419
+ hlsPlayable?: ServerMessage_HlsPlayable | undefined;
420
+ /** @deprecated */
421
+ hlsUploaded?: ServerMessage_HlsUploaded | undefined;
422
+ /** @deprecated */
423
+ hlsUploadCrashed?: ServerMessage_HlsUploadCrashed | undefined;
424
+ /** @deprecated */
425
+ componentCrashed?: ServerMessage_ComponentCrashed | undefined;
386
426
  }
387
427
  declare const ServerMessage: MessageFns$1<ServerMessage>;
388
428
  /** Notification sent when a room crashes */
@@ -525,6 +565,33 @@ interface ServerMessage_ChannelRemoved {
525
565
  channelId: string;
526
566
  }
527
567
  declare const ServerMessage_ChannelRemoved: MessageFns$1<ServerMessage_ChannelRemoved>;
568
+ /** Sent when there is an upsert to track forwardings from Fishjam to Composition */
569
+ interface ServerMessage_TrackForwarding {
570
+ roomId: string;
571
+ peerId: string;
572
+ compositionUrl: string;
573
+ inputId: string;
574
+ /** Track has id, type, and metadata */
575
+ audioTrack?: Track | undefined;
576
+ videoTrack?: Track | undefined;
577
+ }
578
+ declare const ServerMessage_TrackForwarding: MessageFns$1<ServerMessage_TrackForwarding>;
579
+ /** Sent when track forwarding is removed */
580
+ interface ServerMessage_TrackForwardingRemoved {
581
+ roomId: string;
582
+ peerId: string;
583
+ compositionUrl: string;
584
+ inputId: string;
585
+ }
586
+ declare const ServerMessage_TrackForwardingRemoved: MessageFns$1<ServerMessage_TrackForwardingRemoved>;
587
+ /** Notification sent when voice activity changes on a track */
588
+ interface ServerMessage_VadNotification {
589
+ roomId: string;
590
+ peerId: string;
591
+ trackId: string;
592
+ status: ServerMessage_VadNotification_Status;
593
+ }
594
+ declare const ServerMessage_VadNotification: MessageFns$1<ServerMessage_VadNotification>;
528
595
  /** Notification sent when streamer successfully connects */
529
596
  interface ServerMessage_StreamConnected {
530
597
  streamId: string;
@@ -886,6 +953,12 @@ declare class FishjamClient {
886
953
  agent: FishjamAgent;
887
954
  peer: Peer;
888
955
  }>;
956
+ /**
957
+ * Create a new VAPI agent assigned to a room.
958
+ */
959
+ createVapiAgent(roomId: RoomId, options: PeerOptionsVapi): Promise<{
960
+ peer: Peer;
961
+ }>;
889
962
  /**
890
963
  * Get details about a given room.
891
964
  */
@@ -948,4 +1021,4 @@ declare class ServiceUnavailableException extends FishjamBaseException {
948
1021
  declare class UnknownException extends FishjamBaseException {
949
1022
  }
950
1023
 
951
- export { type AgentCallbacks, type AgentEvents, type AgentTrack, type AudioCodecParameters, BadRequestException, type Brand, type CloseEventHandler, type ErrorEventHandler, type ExpectedAgentEvents, type ExpectedEvents, FishjamAgent, FishjamBaseException, FishjamClient, type FishjamConfig, FishjamNotFoundException, FishjamWSNotifier, ForbiddenException, type IncomingTrackData, type IncomingTrackImage, MissingFishjamIdException, type NotificationEvents, type OutgoingTrackData, type Peer, type PeerAdded, type PeerConnected, type PeerCrashed, type PeerDeleted, type PeerDisconnected, type PeerId, type PeerMetadataUpdated, PeerNotFoundException, type PeerOptions, type PeerOptionsAgent, type PeerOptionsWebRTC, PeerStatus, type Room, type RoomConfig, type RoomCrashed, type RoomCreated, type RoomDeleted, type RoomId, RoomNotFoundException, RoomType, ServerMessage, ServiceUnavailableException, type StreamConnected, type StreamDisconnected, type StreamerToken, type TrackAdded, type TrackId, type TrackMetadataUpdated, type TrackRemoved, type TrackType, UnauthorizedException, UnknownException, VideoCodec, type ViewerConnected, type ViewerDisconnected, type ViewerToken };
1024
+ export { type AgentCallbacks, type AgentEvents, type AgentTrack, type AudioCodecParameters, BadRequestException, type Brand, type CloseEventHandler, type ErrorEventHandler, type ExpectedAgentEvents, type ExpectedEvents, FishjamAgent, FishjamBaseException, FishjamClient, type FishjamConfig, FishjamNotFoundException, FishjamWSNotifier, ForbiddenException, type IncomingTrackData, type IncomingTrackImage, MissingFishjamIdException, type NotificationEvents, type OutgoingTrackData, 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 Room, type RoomConfig, type RoomCrashed, type RoomCreated, type RoomDeleted, type RoomId, RoomNotFoundException, RoomType, ServerMessage, ServiceUnavailableException, type StreamConnected, type StreamDisconnected, type StreamerToken, type TrackAdded, type TrackId, type TrackMetadataUpdated, type TrackRemoved, type TrackType, UnauthorizedException, UnknownException, VideoCodec, type ViewerConnected, type ViewerDisconnected, type ViewerToken };
package/dist/index.d.ts CHANGED
@@ -93,7 +93,7 @@ interface Peer$1 {
93
93
  * Peer-specific options
94
94
  * @export
95
95
  */
96
- type PeerOptions = PeerOptionsAgent | PeerOptionsWebRTC;
96
+ type PeerOptions = PeerOptionsAgent | PeerOptionsVapi | PeerOptionsWebRTC;
97
97
  /**
98
98
  * Options specific to the Agent peer
99
99
  * @export
@@ -113,6 +113,31 @@ interface PeerOptionsAgent {
113
113
  */
114
114
  'subscribeMode'?: SubscribeMode;
115
115
  }
116
+ /**
117
+ * Options specific to the VAPI peer
118
+ * @export
119
+ * @interface PeerOptionsVapi
120
+ */
121
+ interface PeerOptionsVapi {
122
+ /**
123
+ * VAPI API key
124
+ * @type {string}
125
+ * @memberof PeerOptionsVapi
126
+ */
127
+ 'apiKey': string;
128
+ /**
129
+ * VAPI call ID
130
+ * @type {string}
131
+ * @memberof PeerOptionsVapi
132
+ */
133
+ 'callId': string;
134
+ /**
135
+ *
136
+ * @type {SubscribeMode}
137
+ * @memberof PeerOptionsVapi
138
+ */
139
+ 'subscribeMode'?: SubscribeMode;
140
+ }
116
141
  /**
117
142
  * Options specific to the WebRTC peer
118
143
  * @export
@@ -152,6 +177,7 @@ type PeerStatus = typeof PeerStatus[keyof typeof PeerStatus];
152
177
  declare const PeerType: {
153
178
  readonly Webrtc: "webrtc";
154
179
  readonly Agent: "agent";
180
+ readonly Vapi: "vapi";
155
181
  };
156
182
  type PeerType = typeof PeerType[keyof typeof PeerType];
157
183
  /**
@@ -343,6 +369,7 @@ declare enum ServerMessage_PeerType {
343
369
  PEER_TYPE_UNSPECIFIED = 0,
344
370
  PEER_TYPE_WEBRTC = 1,
345
371
  PEER_TYPE_AGENT = 2,
372
+ PEER_TYPE_VAPI = 3,
346
373
  UNRECOGNIZED = -1
347
374
  }
348
375
  /** Defines message groups for which peer can subscribe */
@@ -351,38 +378,51 @@ declare enum ServerMessage_EventType {
351
378
  EVENT_TYPE_SERVER_NOTIFICATION = 1,
352
379
  UNRECOGNIZED = -1
353
380
  }
381
+ declare enum ServerMessage_VadNotification_Status {
382
+ STATUS_UNSPECIFIED = 0,
383
+ STATUS_SILENCE = 1,
384
+ STATUS_SPEECH = 2,
385
+ UNRECOGNIZED = -1
386
+ }
354
387
  /** Defines any type of message passed between FJ and server peer */
355
388
  interface ServerMessage {
356
- roomCrashed?: ServerMessage_RoomCrashed | undefined;
357
- peerConnected?: ServerMessage_PeerConnected | undefined;
358
- peerDisconnected?: ServerMessage_PeerDisconnected | undefined;
359
- peerCrashed?: ServerMessage_PeerCrashed | undefined;
360
- componentCrashed?: ServerMessage_ComponentCrashed | undefined;
361
389
  authenticated?: ServerMessage_Authenticated | undefined;
362
390
  authRequest?: ServerMessage_AuthRequest | undefined;
363
391
  subscribeRequest?: ServerMessage_SubscribeRequest | undefined;
364
392
  subscribeResponse?: ServerMessage_SubscribeResponse | undefined;
365
393
  roomCreated?: ServerMessage_RoomCreated | undefined;
366
394
  roomDeleted?: ServerMessage_RoomDeleted | undefined;
367
- hlsPlayable?: ServerMessage_HlsPlayable | undefined;
368
- hlsUploaded?: ServerMessage_HlsUploaded | undefined;
369
- hlsUploadCrashed?: ServerMessage_HlsUploadCrashed | undefined;
395
+ roomCrashed?: ServerMessage_RoomCrashed | undefined;
396
+ peerConnected?: ServerMessage_PeerConnected | undefined;
397
+ peerDisconnected?: ServerMessage_PeerDisconnected | undefined;
398
+ peerCrashed?: ServerMessage_PeerCrashed | undefined;
370
399
  peerMetadataUpdated?: ServerMessage_PeerMetadataUpdated | undefined;
371
400
  trackAdded?: ServerMessage_TrackAdded | undefined;
372
401
  trackRemoved?: ServerMessage_TrackRemoved | undefined;
373
402
  trackMetadataUpdated?: ServerMessage_TrackMetadataUpdated | undefined;
374
403
  peerAdded?: ServerMessage_PeerAdded | undefined;
375
404
  peerDeleted?: ServerMessage_PeerDeleted | undefined;
376
- /** @deprecated */
377
- streamConnected?: ServerMessage_StreamConnected | undefined;
378
- /** @deprecated */
379
- streamDisconnected?: ServerMessage_StreamDisconnected | undefined;
405
+ channelAdded?: ServerMessage_ChannelAdded | undefined;
406
+ channelRemoved?: ServerMessage_ChannelRemoved | undefined;
407
+ trackForwarding?: ServerMessage_TrackForwarding | undefined;
408
+ trackForwardingRemoved?: ServerMessage_TrackForwardingRemoved | undefined;
409
+ vadNotification?: ServerMessage_VadNotification | undefined;
380
410
  viewerConnected?: ServerMessage_ViewerConnected | undefined;
381
411
  viewerDisconnected?: ServerMessage_ViewerDisconnected | undefined;
382
412
  streamerConnected?: ServerMessage_StreamerConnected | undefined;
383
413
  streamerDisconnected?: ServerMessage_StreamerDisconnected | undefined;
384
- channelAdded?: ServerMessage_ChannelAdded | undefined;
385
- channelRemoved?: ServerMessage_ChannelRemoved | undefined;
414
+ /** @deprecated */
415
+ streamConnected?: ServerMessage_StreamConnected | undefined;
416
+ /** @deprecated */
417
+ streamDisconnected?: ServerMessage_StreamDisconnected | undefined;
418
+ /** @deprecated */
419
+ hlsPlayable?: ServerMessage_HlsPlayable | undefined;
420
+ /** @deprecated */
421
+ hlsUploaded?: ServerMessage_HlsUploaded | undefined;
422
+ /** @deprecated */
423
+ hlsUploadCrashed?: ServerMessage_HlsUploadCrashed | undefined;
424
+ /** @deprecated */
425
+ componentCrashed?: ServerMessage_ComponentCrashed | undefined;
386
426
  }
387
427
  declare const ServerMessage: MessageFns$1<ServerMessage>;
388
428
  /** Notification sent when a room crashes */
@@ -525,6 +565,33 @@ interface ServerMessage_ChannelRemoved {
525
565
  channelId: string;
526
566
  }
527
567
  declare const ServerMessage_ChannelRemoved: MessageFns$1<ServerMessage_ChannelRemoved>;
568
+ /** Sent when there is an upsert to track forwardings from Fishjam to Composition */
569
+ interface ServerMessage_TrackForwarding {
570
+ roomId: string;
571
+ peerId: string;
572
+ compositionUrl: string;
573
+ inputId: string;
574
+ /** Track has id, type, and metadata */
575
+ audioTrack?: Track | undefined;
576
+ videoTrack?: Track | undefined;
577
+ }
578
+ declare const ServerMessage_TrackForwarding: MessageFns$1<ServerMessage_TrackForwarding>;
579
+ /** Sent when track forwarding is removed */
580
+ interface ServerMessage_TrackForwardingRemoved {
581
+ roomId: string;
582
+ peerId: string;
583
+ compositionUrl: string;
584
+ inputId: string;
585
+ }
586
+ declare const ServerMessage_TrackForwardingRemoved: MessageFns$1<ServerMessage_TrackForwardingRemoved>;
587
+ /** Notification sent when voice activity changes on a track */
588
+ interface ServerMessage_VadNotification {
589
+ roomId: string;
590
+ peerId: string;
591
+ trackId: string;
592
+ status: ServerMessage_VadNotification_Status;
593
+ }
594
+ declare const ServerMessage_VadNotification: MessageFns$1<ServerMessage_VadNotification>;
528
595
  /** Notification sent when streamer successfully connects */
529
596
  interface ServerMessage_StreamConnected {
530
597
  streamId: string;
@@ -886,6 +953,12 @@ declare class FishjamClient {
886
953
  agent: FishjamAgent;
887
954
  peer: Peer;
888
955
  }>;
956
+ /**
957
+ * Create a new VAPI agent assigned to a room.
958
+ */
959
+ createVapiAgent(roomId: RoomId, options: PeerOptionsVapi): Promise<{
960
+ peer: Peer;
961
+ }>;
889
962
  /**
890
963
  * Get details about a given room.
891
964
  */
@@ -948,4 +1021,4 @@ declare class ServiceUnavailableException extends FishjamBaseException {
948
1021
  declare class UnknownException extends FishjamBaseException {
949
1022
  }
950
1023
 
951
- export { type AgentCallbacks, type AgentEvents, type AgentTrack, type AudioCodecParameters, BadRequestException, type Brand, type CloseEventHandler, type ErrorEventHandler, type ExpectedAgentEvents, type ExpectedEvents, FishjamAgent, FishjamBaseException, FishjamClient, type FishjamConfig, FishjamNotFoundException, FishjamWSNotifier, ForbiddenException, type IncomingTrackData, type IncomingTrackImage, MissingFishjamIdException, type NotificationEvents, type OutgoingTrackData, type Peer, type PeerAdded, type PeerConnected, type PeerCrashed, type PeerDeleted, type PeerDisconnected, type PeerId, type PeerMetadataUpdated, PeerNotFoundException, type PeerOptions, type PeerOptionsAgent, type PeerOptionsWebRTC, PeerStatus, type Room, type RoomConfig, type RoomCrashed, type RoomCreated, type RoomDeleted, type RoomId, RoomNotFoundException, RoomType, ServerMessage, ServiceUnavailableException, type StreamConnected, type StreamDisconnected, type StreamerToken, type TrackAdded, type TrackId, type TrackMetadataUpdated, type TrackRemoved, type TrackType, UnauthorizedException, UnknownException, VideoCodec, type ViewerConnected, type ViewerDisconnected, type ViewerToken };
1024
+ export { type AgentCallbacks, type AgentEvents, type AgentTrack, type AudioCodecParameters, BadRequestException, type Brand, type CloseEventHandler, type ErrorEventHandler, type ExpectedAgentEvents, type ExpectedEvents, FishjamAgent, FishjamBaseException, FishjamClient, type FishjamConfig, FishjamNotFoundException, FishjamWSNotifier, ForbiddenException, type IncomingTrackData, type IncomingTrackImage, MissingFishjamIdException, type NotificationEvents, type OutgoingTrackData, 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 Room, type RoomConfig, type RoomCrashed, type RoomCreated, type RoomDeleted, type RoomId, RoomNotFoundException, RoomType, ServerMessage, ServiceUnavailableException, type StreamConnected, type StreamDisconnected, type StreamerToken, type TrackAdded, type TrackId, type TrackMetadataUpdated, type TrackRemoved, type TrackType, UnauthorizedException, UnknownException, VideoCodec, type ViewerConnected, type ViewerDisconnected, type ViewerToken };