@fishjam-cloud/js-server-sdk 0.25.5 → 0.27.0-rc.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.
- package/dist/{chunk-NUDP3SRJ.mjs → chunk-Q5OZUPAC.mjs} +5 -3
- package/dist/index.d.mts +118 -16
- package/dist/index.d.ts +118 -16
- package/dist/index.js +844 -279
- package/dist/index.mjs +840 -277
- package/dist/integrations/gemini.js +5 -3
- package/dist/integrations/gemini.mjs +1 -1
- package/package.json +8 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// package.json
|
|
2
2
|
var package_default = {
|
|
3
3
|
name: "@fishjam-cloud/js-server-sdk",
|
|
4
|
-
version: "0.
|
|
4
|
+
version: "0.27.0-rc.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",
|
|
@@ -42,7 +42,8 @@ var package_default = {
|
|
|
42
42
|
"format:check": "prettier --check .",
|
|
43
43
|
typecheck: "tsc --noEmit",
|
|
44
44
|
lint: "eslint . --fix",
|
|
45
|
-
"lint:check": "eslint .
|
|
45
|
+
"lint:check": "eslint .",
|
|
46
|
+
test: "vitest run"
|
|
46
47
|
},
|
|
47
48
|
tsup: {
|
|
48
49
|
entry: [
|
|
@@ -82,7 +83,8 @@ var package_default = {
|
|
|
82
83
|
eslint: "^9.33.0",
|
|
83
84
|
prettier: "^3.6.2",
|
|
84
85
|
tsup: "^8.4.0",
|
|
85
|
-
"typed-emitter": "^2.1.0"
|
|
86
|
+
"typed-emitter": "^2.1.0",
|
|
87
|
+
vitest: "^3.0.0"
|
|
86
88
|
},
|
|
87
89
|
"lint-staged": {
|
|
88
90
|
"*.{js,ts,tsx,mjs,cjs}": [
|
package/dist/index.d.mts
CHANGED
|
@@ -39,6 +39,19 @@ declare const AudioSampleRate: {
|
|
|
39
39
|
readonly NUMBER_24000: 24000;
|
|
40
40
|
};
|
|
41
41
|
type AudioSampleRate = typeof AudioSampleRate[keyof typeof AudioSampleRate];
|
|
42
|
+
/**
|
|
43
|
+
* Token for authorizing a MoQ relay connection
|
|
44
|
+
* @export
|
|
45
|
+
* @interface MoqToken
|
|
46
|
+
*/
|
|
47
|
+
interface MoqToken {
|
|
48
|
+
/**
|
|
49
|
+
* JWT token for MoQ relay
|
|
50
|
+
* @type {string}
|
|
51
|
+
* @memberof MoqToken
|
|
52
|
+
*/
|
|
53
|
+
'token': string;
|
|
54
|
+
}
|
|
42
55
|
/**
|
|
43
56
|
* Describes peer status
|
|
44
57
|
* @export
|
|
@@ -93,7 +106,7 @@ interface Peer$1 {
|
|
|
93
106
|
* Peer-specific options
|
|
94
107
|
* @export
|
|
95
108
|
*/
|
|
96
|
-
type PeerOptions = PeerOptionsAgent | PeerOptionsWebRTC;
|
|
109
|
+
type PeerOptions = PeerOptionsAgent | PeerOptionsVapi | PeerOptionsWebRTC;
|
|
97
110
|
/**
|
|
98
111
|
* Options specific to the Agent peer
|
|
99
112
|
* @export
|
|
@@ -113,6 +126,31 @@ interface PeerOptionsAgent {
|
|
|
113
126
|
*/
|
|
114
127
|
'subscribeMode'?: SubscribeMode;
|
|
115
128
|
}
|
|
129
|
+
/**
|
|
130
|
+
* Options specific to the VAPI peer
|
|
131
|
+
* @export
|
|
132
|
+
* @interface PeerOptionsVapi
|
|
133
|
+
*/
|
|
134
|
+
interface PeerOptionsVapi {
|
|
135
|
+
/**
|
|
136
|
+
* VAPI API key
|
|
137
|
+
* @type {string}
|
|
138
|
+
* @memberof PeerOptionsVapi
|
|
139
|
+
*/
|
|
140
|
+
'apiKey': string;
|
|
141
|
+
/**
|
|
142
|
+
* VAPI call ID
|
|
143
|
+
* @type {string}
|
|
144
|
+
* @memberof PeerOptionsVapi
|
|
145
|
+
*/
|
|
146
|
+
'callId': string;
|
|
147
|
+
/**
|
|
148
|
+
*
|
|
149
|
+
* @type {SubscribeMode}
|
|
150
|
+
* @memberof PeerOptionsVapi
|
|
151
|
+
*/
|
|
152
|
+
'subscribeMode'?: SubscribeMode;
|
|
153
|
+
}
|
|
116
154
|
/**
|
|
117
155
|
* Options specific to the WebRTC peer
|
|
118
156
|
* @export
|
|
@@ -152,6 +190,7 @@ type PeerStatus = typeof PeerStatus[keyof typeof PeerStatus];
|
|
|
152
190
|
declare const PeerType: {
|
|
153
191
|
readonly Webrtc: "webrtc";
|
|
154
192
|
readonly Agent: "agent";
|
|
193
|
+
readonly Vapi: "vapi";
|
|
155
194
|
};
|
|
156
195
|
type PeerType = typeof PeerType[keyof typeof PeerType];
|
|
157
196
|
/**
|
|
@@ -343,6 +382,7 @@ declare enum ServerMessage_PeerType {
|
|
|
343
382
|
PEER_TYPE_UNSPECIFIED = 0,
|
|
344
383
|
PEER_TYPE_WEBRTC = 1,
|
|
345
384
|
PEER_TYPE_AGENT = 2,
|
|
385
|
+
PEER_TYPE_VAPI = 3,
|
|
346
386
|
UNRECOGNIZED = -1
|
|
347
387
|
}
|
|
348
388
|
/** Defines message groups for which peer can subscribe */
|
|
@@ -351,38 +391,51 @@ declare enum ServerMessage_EventType {
|
|
|
351
391
|
EVENT_TYPE_SERVER_NOTIFICATION = 1,
|
|
352
392
|
UNRECOGNIZED = -1
|
|
353
393
|
}
|
|
394
|
+
declare enum ServerMessage_VadNotification_Status {
|
|
395
|
+
STATUS_UNSPECIFIED = 0,
|
|
396
|
+
STATUS_SILENCE = 1,
|
|
397
|
+
STATUS_SPEECH = 2,
|
|
398
|
+
UNRECOGNIZED = -1
|
|
399
|
+
}
|
|
354
400
|
/** Defines any type of message passed between FJ and server peer */
|
|
355
401
|
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
402
|
authenticated?: ServerMessage_Authenticated | undefined;
|
|
362
403
|
authRequest?: ServerMessage_AuthRequest | undefined;
|
|
363
404
|
subscribeRequest?: ServerMessage_SubscribeRequest | undefined;
|
|
364
405
|
subscribeResponse?: ServerMessage_SubscribeResponse | undefined;
|
|
365
406
|
roomCreated?: ServerMessage_RoomCreated | undefined;
|
|
366
407
|
roomDeleted?: ServerMessage_RoomDeleted | undefined;
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
408
|
+
roomCrashed?: ServerMessage_RoomCrashed | undefined;
|
|
409
|
+
peerConnected?: ServerMessage_PeerConnected | undefined;
|
|
410
|
+
peerDisconnected?: ServerMessage_PeerDisconnected | undefined;
|
|
411
|
+
peerCrashed?: ServerMessage_PeerCrashed | undefined;
|
|
370
412
|
peerMetadataUpdated?: ServerMessage_PeerMetadataUpdated | undefined;
|
|
371
413
|
trackAdded?: ServerMessage_TrackAdded | undefined;
|
|
372
414
|
trackRemoved?: ServerMessage_TrackRemoved | undefined;
|
|
373
415
|
trackMetadataUpdated?: ServerMessage_TrackMetadataUpdated | undefined;
|
|
374
416
|
peerAdded?: ServerMessage_PeerAdded | undefined;
|
|
375
417
|
peerDeleted?: ServerMessage_PeerDeleted | undefined;
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
418
|
+
channelAdded?: ServerMessage_ChannelAdded | undefined;
|
|
419
|
+
channelRemoved?: ServerMessage_ChannelRemoved | undefined;
|
|
420
|
+
trackForwarding?: ServerMessage_TrackForwarding | undefined;
|
|
421
|
+
trackForwardingRemoved?: ServerMessage_TrackForwardingRemoved | undefined;
|
|
422
|
+
vadNotification?: ServerMessage_VadNotification | undefined;
|
|
380
423
|
viewerConnected?: ServerMessage_ViewerConnected | undefined;
|
|
381
424
|
viewerDisconnected?: ServerMessage_ViewerDisconnected | undefined;
|
|
382
425
|
streamerConnected?: ServerMessage_StreamerConnected | undefined;
|
|
383
426
|
streamerDisconnected?: ServerMessage_StreamerDisconnected | undefined;
|
|
384
|
-
|
|
385
|
-
|
|
427
|
+
/** @deprecated */
|
|
428
|
+
streamConnected?: ServerMessage_StreamConnected | undefined;
|
|
429
|
+
/** @deprecated */
|
|
430
|
+
streamDisconnected?: ServerMessage_StreamDisconnected | undefined;
|
|
431
|
+
/** @deprecated */
|
|
432
|
+
hlsPlayable?: ServerMessage_HlsPlayable | undefined;
|
|
433
|
+
/** @deprecated */
|
|
434
|
+
hlsUploaded?: ServerMessage_HlsUploaded | undefined;
|
|
435
|
+
/** @deprecated */
|
|
436
|
+
hlsUploadCrashed?: ServerMessage_HlsUploadCrashed | undefined;
|
|
437
|
+
/** @deprecated */
|
|
438
|
+
componentCrashed?: ServerMessage_ComponentCrashed | undefined;
|
|
386
439
|
}
|
|
387
440
|
declare const ServerMessage: MessageFns$1<ServerMessage>;
|
|
388
441
|
/** Notification sent when a room crashes */
|
|
@@ -525,6 +578,33 @@ interface ServerMessage_ChannelRemoved {
|
|
|
525
578
|
channelId: string;
|
|
526
579
|
}
|
|
527
580
|
declare const ServerMessage_ChannelRemoved: MessageFns$1<ServerMessage_ChannelRemoved>;
|
|
581
|
+
/** Sent when there is an upsert to track forwardings from Fishjam to Composition */
|
|
582
|
+
interface ServerMessage_TrackForwarding {
|
|
583
|
+
roomId: string;
|
|
584
|
+
peerId: string;
|
|
585
|
+
compositionUrl: string;
|
|
586
|
+
inputId: string;
|
|
587
|
+
/** Track has id, type, and metadata */
|
|
588
|
+
audioTrack?: Track | undefined;
|
|
589
|
+
videoTrack?: Track | undefined;
|
|
590
|
+
}
|
|
591
|
+
declare const ServerMessage_TrackForwarding: MessageFns$1<ServerMessage_TrackForwarding>;
|
|
592
|
+
/** Sent when track forwarding is removed */
|
|
593
|
+
interface ServerMessage_TrackForwardingRemoved {
|
|
594
|
+
roomId: string;
|
|
595
|
+
peerId: string;
|
|
596
|
+
compositionUrl: string;
|
|
597
|
+
inputId: string;
|
|
598
|
+
}
|
|
599
|
+
declare const ServerMessage_TrackForwardingRemoved: MessageFns$1<ServerMessage_TrackForwardingRemoved>;
|
|
600
|
+
/** Notification sent when voice activity changes on a track */
|
|
601
|
+
interface ServerMessage_VadNotification {
|
|
602
|
+
roomId: string;
|
|
603
|
+
peerId: string;
|
|
604
|
+
trackId: string;
|
|
605
|
+
status: ServerMessage_VadNotification_Status;
|
|
606
|
+
}
|
|
607
|
+
declare const ServerMessage_VadNotification: MessageFns$1<ServerMessage_VadNotification>;
|
|
528
608
|
/** Notification sent when streamer successfully connects */
|
|
529
609
|
interface ServerMessage_StreamConnected {
|
|
530
610
|
streamId: string;
|
|
@@ -682,6 +762,11 @@ type RoomId = Brand<string, 'RoomId'>;
|
|
|
682
762
|
* ID of Peer. Peer is associated with Room and can be created with {@link FishjamClient.createPeer}.
|
|
683
763
|
*/
|
|
684
764
|
type PeerId = Brand<string, 'PeerId'>;
|
|
765
|
+
/**
|
|
766
|
+
* ID of a MoQ stream. Tokens for a stream can be created with
|
|
767
|
+
* {@link FishjamClient.createMoqPublisherToken} and {@link FishjamClient.createMoqSubscriberToken}.
|
|
768
|
+
*/
|
|
769
|
+
type StreamId = Brand<string, 'StreamId'>;
|
|
685
770
|
type Peer = Omit<Peer$1, 'id'> & {
|
|
686
771
|
id: PeerId;
|
|
687
772
|
};
|
|
@@ -842,6 +927,7 @@ declare class FishjamAgent extends FishjamAgent_base {
|
|
|
842
927
|
* @category Client
|
|
843
928
|
*/
|
|
844
929
|
declare class FishjamClient {
|
|
930
|
+
private readonly moqApi;
|
|
845
931
|
private readonly roomApi;
|
|
846
932
|
private readonly viewerApi;
|
|
847
933
|
private readonly streamerApi;
|
|
@@ -886,6 +972,12 @@ declare class FishjamClient {
|
|
|
886
972
|
agent: FishjamAgent;
|
|
887
973
|
peer: Peer;
|
|
888
974
|
}>;
|
|
975
|
+
/**
|
|
976
|
+
* Create a new VAPI agent assigned to a room.
|
|
977
|
+
*/
|
|
978
|
+
createVapiAgent(roomId: RoomId, options: PeerOptionsVapi): Promise<{
|
|
979
|
+
peer: Peer;
|
|
980
|
+
}>;
|
|
889
981
|
/**
|
|
890
982
|
* Get details about a given room.
|
|
891
983
|
*/
|
|
@@ -920,6 +1012,16 @@ declare class FishjamClient {
|
|
|
920
1012
|
* @returns a livestream streamer token
|
|
921
1013
|
*/
|
|
922
1014
|
createLivestreamStreamerToken(roomId: RoomId): Promise<StreamerToken>;
|
|
1015
|
+
/**
|
|
1016
|
+
* Creates a MoQ publisher token for the given stream.
|
|
1017
|
+
* @returns a MoQ publisher token
|
|
1018
|
+
*/
|
|
1019
|
+
createMoqPublisherToken(streamId: StreamId): Promise<MoqToken>;
|
|
1020
|
+
/**
|
|
1021
|
+
* Creates a MoQ subscriber token for the given stream.
|
|
1022
|
+
* @returns a MoQ subscriber token
|
|
1023
|
+
*/
|
|
1024
|
+
createMoqSubscriberToken(streamId: StreamId): Promise<MoqToken>;
|
|
923
1025
|
}
|
|
924
1026
|
|
|
925
1027
|
declare class MissingFishjamIdException extends Error {
|
|
@@ -948,4 +1050,4 @@ declare class ServiceUnavailableException extends FishjamBaseException {
|
|
|
948
1050
|
declare class UnknownException extends FishjamBaseException {
|
|
949
1051
|
}
|
|
950
1052
|
|
|
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 };
|
|
1053
|
+
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 MoqToken, 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 StreamId, 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
|
@@ -39,6 +39,19 @@ declare const AudioSampleRate: {
|
|
|
39
39
|
readonly NUMBER_24000: 24000;
|
|
40
40
|
};
|
|
41
41
|
type AudioSampleRate = typeof AudioSampleRate[keyof typeof AudioSampleRate];
|
|
42
|
+
/**
|
|
43
|
+
* Token for authorizing a MoQ relay connection
|
|
44
|
+
* @export
|
|
45
|
+
* @interface MoqToken
|
|
46
|
+
*/
|
|
47
|
+
interface MoqToken {
|
|
48
|
+
/**
|
|
49
|
+
* JWT token for MoQ relay
|
|
50
|
+
* @type {string}
|
|
51
|
+
* @memberof MoqToken
|
|
52
|
+
*/
|
|
53
|
+
'token': string;
|
|
54
|
+
}
|
|
42
55
|
/**
|
|
43
56
|
* Describes peer status
|
|
44
57
|
* @export
|
|
@@ -93,7 +106,7 @@ interface Peer$1 {
|
|
|
93
106
|
* Peer-specific options
|
|
94
107
|
* @export
|
|
95
108
|
*/
|
|
96
|
-
type PeerOptions = PeerOptionsAgent | PeerOptionsWebRTC;
|
|
109
|
+
type PeerOptions = PeerOptionsAgent | PeerOptionsVapi | PeerOptionsWebRTC;
|
|
97
110
|
/**
|
|
98
111
|
* Options specific to the Agent peer
|
|
99
112
|
* @export
|
|
@@ -113,6 +126,31 @@ interface PeerOptionsAgent {
|
|
|
113
126
|
*/
|
|
114
127
|
'subscribeMode'?: SubscribeMode;
|
|
115
128
|
}
|
|
129
|
+
/**
|
|
130
|
+
* Options specific to the VAPI peer
|
|
131
|
+
* @export
|
|
132
|
+
* @interface PeerOptionsVapi
|
|
133
|
+
*/
|
|
134
|
+
interface PeerOptionsVapi {
|
|
135
|
+
/**
|
|
136
|
+
* VAPI API key
|
|
137
|
+
* @type {string}
|
|
138
|
+
* @memberof PeerOptionsVapi
|
|
139
|
+
*/
|
|
140
|
+
'apiKey': string;
|
|
141
|
+
/**
|
|
142
|
+
* VAPI call ID
|
|
143
|
+
* @type {string}
|
|
144
|
+
* @memberof PeerOptionsVapi
|
|
145
|
+
*/
|
|
146
|
+
'callId': string;
|
|
147
|
+
/**
|
|
148
|
+
*
|
|
149
|
+
* @type {SubscribeMode}
|
|
150
|
+
* @memberof PeerOptionsVapi
|
|
151
|
+
*/
|
|
152
|
+
'subscribeMode'?: SubscribeMode;
|
|
153
|
+
}
|
|
116
154
|
/**
|
|
117
155
|
* Options specific to the WebRTC peer
|
|
118
156
|
* @export
|
|
@@ -152,6 +190,7 @@ type PeerStatus = typeof PeerStatus[keyof typeof PeerStatus];
|
|
|
152
190
|
declare const PeerType: {
|
|
153
191
|
readonly Webrtc: "webrtc";
|
|
154
192
|
readonly Agent: "agent";
|
|
193
|
+
readonly Vapi: "vapi";
|
|
155
194
|
};
|
|
156
195
|
type PeerType = typeof PeerType[keyof typeof PeerType];
|
|
157
196
|
/**
|
|
@@ -343,6 +382,7 @@ declare enum ServerMessage_PeerType {
|
|
|
343
382
|
PEER_TYPE_UNSPECIFIED = 0,
|
|
344
383
|
PEER_TYPE_WEBRTC = 1,
|
|
345
384
|
PEER_TYPE_AGENT = 2,
|
|
385
|
+
PEER_TYPE_VAPI = 3,
|
|
346
386
|
UNRECOGNIZED = -1
|
|
347
387
|
}
|
|
348
388
|
/** Defines message groups for which peer can subscribe */
|
|
@@ -351,38 +391,51 @@ declare enum ServerMessage_EventType {
|
|
|
351
391
|
EVENT_TYPE_SERVER_NOTIFICATION = 1,
|
|
352
392
|
UNRECOGNIZED = -1
|
|
353
393
|
}
|
|
394
|
+
declare enum ServerMessage_VadNotification_Status {
|
|
395
|
+
STATUS_UNSPECIFIED = 0,
|
|
396
|
+
STATUS_SILENCE = 1,
|
|
397
|
+
STATUS_SPEECH = 2,
|
|
398
|
+
UNRECOGNIZED = -1
|
|
399
|
+
}
|
|
354
400
|
/** Defines any type of message passed between FJ and server peer */
|
|
355
401
|
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
402
|
authenticated?: ServerMessage_Authenticated | undefined;
|
|
362
403
|
authRequest?: ServerMessage_AuthRequest | undefined;
|
|
363
404
|
subscribeRequest?: ServerMessage_SubscribeRequest | undefined;
|
|
364
405
|
subscribeResponse?: ServerMessage_SubscribeResponse | undefined;
|
|
365
406
|
roomCreated?: ServerMessage_RoomCreated | undefined;
|
|
366
407
|
roomDeleted?: ServerMessage_RoomDeleted | undefined;
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
408
|
+
roomCrashed?: ServerMessage_RoomCrashed | undefined;
|
|
409
|
+
peerConnected?: ServerMessage_PeerConnected | undefined;
|
|
410
|
+
peerDisconnected?: ServerMessage_PeerDisconnected | undefined;
|
|
411
|
+
peerCrashed?: ServerMessage_PeerCrashed | undefined;
|
|
370
412
|
peerMetadataUpdated?: ServerMessage_PeerMetadataUpdated | undefined;
|
|
371
413
|
trackAdded?: ServerMessage_TrackAdded | undefined;
|
|
372
414
|
trackRemoved?: ServerMessage_TrackRemoved | undefined;
|
|
373
415
|
trackMetadataUpdated?: ServerMessage_TrackMetadataUpdated | undefined;
|
|
374
416
|
peerAdded?: ServerMessage_PeerAdded | undefined;
|
|
375
417
|
peerDeleted?: ServerMessage_PeerDeleted | undefined;
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
418
|
+
channelAdded?: ServerMessage_ChannelAdded | undefined;
|
|
419
|
+
channelRemoved?: ServerMessage_ChannelRemoved | undefined;
|
|
420
|
+
trackForwarding?: ServerMessage_TrackForwarding | undefined;
|
|
421
|
+
trackForwardingRemoved?: ServerMessage_TrackForwardingRemoved | undefined;
|
|
422
|
+
vadNotification?: ServerMessage_VadNotification | undefined;
|
|
380
423
|
viewerConnected?: ServerMessage_ViewerConnected | undefined;
|
|
381
424
|
viewerDisconnected?: ServerMessage_ViewerDisconnected | undefined;
|
|
382
425
|
streamerConnected?: ServerMessage_StreamerConnected | undefined;
|
|
383
426
|
streamerDisconnected?: ServerMessage_StreamerDisconnected | undefined;
|
|
384
|
-
|
|
385
|
-
|
|
427
|
+
/** @deprecated */
|
|
428
|
+
streamConnected?: ServerMessage_StreamConnected | undefined;
|
|
429
|
+
/** @deprecated */
|
|
430
|
+
streamDisconnected?: ServerMessage_StreamDisconnected | undefined;
|
|
431
|
+
/** @deprecated */
|
|
432
|
+
hlsPlayable?: ServerMessage_HlsPlayable | undefined;
|
|
433
|
+
/** @deprecated */
|
|
434
|
+
hlsUploaded?: ServerMessage_HlsUploaded | undefined;
|
|
435
|
+
/** @deprecated */
|
|
436
|
+
hlsUploadCrashed?: ServerMessage_HlsUploadCrashed | undefined;
|
|
437
|
+
/** @deprecated */
|
|
438
|
+
componentCrashed?: ServerMessage_ComponentCrashed | undefined;
|
|
386
439
|
}
|
|
387
440
|
declare const ServerMessage: MessageFns$1<ServerMessage>;
|
|
388
441
|
/** Notification sent when a room crashes */
|
|
@@ -525,6 +578,33 @@ interface ServerMessage_ChannelRemoved {
|
|
|
525
578
|
channelId: string;
|
|
526
579
|
}
|
|
527
580
|
declare const ServerMessage_ChannelRemoved: MessageFns$1<ServerMessage_ChannelRemoved>;
|
|
581
|
+
/** Sent when there is an upsert to track forwardings from Fishjam to Composition */
|
|
582
|
+
interface ServerMessage_TrackForwarding {
|
|
583
|
+
roomId: string;
|
|
584
|
+
peerId: string;
|
|
585
|
+
compositionUrl: string;
|
|
586
|
+
inputId: string;
|
|
587
|
+
/** Track has id, type, and metadata */
|
|
588
|
+
audioTrack?: Track | undefined;
|
|
589
|
+
videoTrack?: Track | undefined;
|
|
590
|
+
}
|
|
591
|
+
declare const ServerMessage_TrackForwarding: MessageFns$1<ServerMessage_TrackForwarding>;
|
|
592
|
+
/** Sent when track forwarding is removed */
|
|
593
|
+
interface ServerMessage_TrackForwardingRemoved {
|
|
594
|
+
roomId: string;
|
|
595
|
+
peerId: string;
|
|
596
|
+
compositionUrl: string;
|
|
597
|
+
inputId: string;
|
|
598
|
+
}
|
|
599
|
+
declare const ServerMessage_TrackForwardingRemoved: MessageFns$1<ServerMessage_TrackForwardingRemoved>;
|
|
600
|
+
/** Notification sent when voice activity changes on a track */
|
|
601
|
+
interface ServerMessage_VadNotification {
|
|
602
|
+
roomId: string;
|
|
603
|
+
peerId: string;
|
|
604
|
+
trackId: string;
|
|
605
|
+
status: ServerMessage_VadNotification_Status;
|
|
606
|
+
}
|
|
607
|
+
declare const ServerMessage_VadNotification: MessageFns$1<ServerMessage_VadNotification>;
|
|
528
608
|
/** Notification sent when streamer successfully connects */
|
|
529
609
|
interface ServerMessage_StreamConnected {
|
|
530
610
|
streamId: string;
|
|
@@ -682,6 +762,11 @@ type RoomId = Brand<string, 'RoomId'>;
|
|
|
682
762
|
* ID of Peer. Peer is associated with Room and can be created with {@link FishjamClient.createPeer}.
|
|
683
763
|
*/
|
|
684
764
|
type PeerId = Brand<string, 'PeerId'>;
|
|
765
|
+
/**
|
|
766
|
+
* ID of a MoQ stream. Tokens for a stream can be created with
|
|
767
|
+
* {@link FishjamClient.createMoqPublisherToken} and {@link FishjamClient.createMoqSubscriberToken}.
|
|
768
|
+
*/
|
|
769
|
+
type StreamId = Brand<string, 'StreamId'>;
|
|
685
770
|
type Peer = Omit<Peer$1, 'id'> & {
|
|
686
771
|
id: PeerId;
|
|
687
772
|
};
|
|
@@ -842,6 +927,7 @@ declare class FishjamAgent extends FishjamAgent_base {
|
|
|
842
927
|
* @category Client
|
|
843
928
|
*/
|
|
844
929
|
declare class FishjamClient {
|
|
930
|
+
private readonly moqApi;
|
|
845
931
|
private readonly roomApi;
|
|
846
932
|
private readonly viewerApi;
|
|
847
933
|
private readonly streamerApi;
|
|
@@ -886,6 +972,12 @@ declare class FishjamClient {
|
|
|
886
972
|
agent: FishjamAgent;
|
|
887
973
|
peer: Peer;
|
|
888
974
|
}>;
|
|
975
|
+
/**
|
|
976
|
+
* Create a new VAPI agent assigned to a room.
|
|
977
|
+
*/
|
|
978
|
+
createVapiAgent(roomId: RoomId, options: PeerOptionsVapi): Promise<{
|
|
979
|
+
peer: Peer;
|
|
980
|
+
}>;
|
|
889
981
|
/**
|
|
890
982
|
* Get details about a given room.
|
|
891
983
|
*/
|
|
@@ -920,6 +1012,16 @@ declare class FishjamClient {
|
|
|
920
1012
|
* @returns a livestream streamer token
|
|
921
1013
|
*/
|
|
922
1014
|
createLivestreamStreamerToken(roomId: RoomId): Promise<StreamerToken>;
|
|
1015
|
+
/**
|
|
1016
|
+
* Creates a MoQ publisher token for the given stream.
|
|
1017
|
+
* @returns a MoQ publisher token
|
|
1018
|
+
*/
|
|
1019
|
+
createMoqPublisherToken(streamId: StreamId): Promise<MoqToken>;
|
|
1020
|
+
/**
|
|
1021
|
+
* Creates a MoQ subscriber token for the given stream.
|
|
1022
|
+
* @returns a MoQ subscriber token
|
|
1023
|
+
*/
|
|
1024
|
+
createMoqSubscriberToken(streamId: StreamId): Promise<MoqToken>;
|
|
923
1025
|
}
|
|
924
1026
|
|
|
925
1027
|
declare class MissingFishjamIdException extends Error {
|
|
@@ -948,4 +1050,4 @@ declare class ServiceUnavailableException extends FishjamBaseException {
|
|
|
948
1050
|
declare class UnknownException extends FishjamBaseException {
|
|
949
1051
|
}
|
|
950
1052
|
|
|
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 };
|
|
1053
|
+
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 MoqToken, 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 StreamId, type StreamerToken, type TrackAdded, type TrackId, type TrackMetadataUpdated, type TrackRemoved, type TrackType, UnauthorizedException, UnknownException, VideoCodec, type ViewerConnected, type ViewerDisconnected, type ViewerToken };
|