@fishjam-cloud/js-server-sdk 0.17.1 → 0.19.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/index.d.mts +10 -46
- package/dist/index.d.ts +10 -46
- package/dist/index.js +10 -9
- package/dist/index.mjs +10 -9
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -89,19 +89,13 @@ interface RoomConfig {
|
|
|
89
89
|
*/
|
|
90
90
|
'maxPeers'?: number | null;
|
|
91
91
|
/**
|
|
92
|
-
*
|
|
93
|
-
* @type {
|
|
94
|
-
* @memberof RoomConfig
|
|
95
|
-
*/
|
|
96
|
-
'peerDisconnectedTimeout'?: number | null;
|
|
97
|
-
/**
|
|
98
|
-
* Duration (in seconds) after which the room will be removed if no peers are connected. If not provided, this feature is disabled.
|
|
99
|
-
* @type {number}
|
|
92
|
+
* True if livestream viewers can omit specifying a token.
|
|
93
|
+
* @type {boolean}
|
|
100
94
|
* @memberof RoomConfig
|
|
101
95
|
*/
|
|
102
|
-
'
|
|
96
|
+
'public'?: boolean;
|
|
103
97
|
/**
|
|
104
|
-
* The use-case of the room. If not provided, this defaults to
|
|
98
|
+
* The use-case of the room. If not provided, this defaults to conference.
|
|
105
99
|
* @type {string}
|
|
106
100
|
* @memberof RoomConfig
|
|
107
101
|
*/
|
|
@@ -123,6 +117,8 @@ declare const RoomConfigRoomTypeEnum: {
|
|
|
123
117
|
readonly FullFeature: "full_feature";
|
|
124
118
|
readonly AudioOnly: "audio_only";
|
|
125
119
|
readonly Broadcaster: "broadcaster";
|
|
120
|
+
readonly Livestream: "livestream";
|
|
121
|
+
readonly Conference: "conference";
|
|
126
122
|
};
|
|
127
123
|
type RoomConfigRoomTypeEnum = typeof RoomConfigRoomTypeEnum[keyof typeof RoomConfigRoomTypeEnum];
|
|
128
124
|
declare const RoomConfigVideoCodecEnum: {
|
|
@@ -171,7 +167,7 @@ interface ViewerToken {
|
|
|
171
167
|
* @type {string}
|
|
172
168
|
* @memberof ViewerToken
|
|
173
169
|
*/
|
|
174
|
-
'token'
|
|
170
|
+
'token': string;
|
|
175
171
|
}
|
|
176
172
|
|
|
177
173
|
type EventMap = {
|
|
@@ -238,44 +234,12 @@ type Peer = Omit<Peer$1, 'id'> & {
|
|
|
238
234
|
type Room = {
|
|
239
235
|
id: RoomId;
|
|
240
236
|
peers: Peer[];
|
|
241
|
-
config:
|
|
237
|
+
config: RoomConfig;
|
|
242
238
|
};
|
|
243
239
|
type FishjamConfig = {
|
|
244
240
|
fishjamUrl: string;
|
|
245
241
|
managementToken: string;
|
|
246
242
|
};
|
|
247
|
-
type RoomOptions = {
|
|
248
|
-
/**
|
|
249
|
-
* Maximum amount of peers allowed into the room
|
|
250
|
-
* @type {number}
|
|
251
|
-
*/
|
|
252
|
-
maxPeers?: number | null;
|
|
253
|
-
/**
|
|
254
|
-
* Duration (in seconds) after which the peer will be removed if it is disconnected. If not provided, this feature is disabled.
|
|
255
|
-
* @type {number}
|
|
256
|
-
*/
|
|
257
|
-
peerDisconnectedTimeout?: number | null;
|
|
258
|
-
/**
|
|
259
|
-
* Duration (in seconds) after which the room will be removed if no peers are connected. If not provided, this feature is disabled.
|
|
260
|
-
* @type {number}
|
|
261
|
-
*/
|
|
262
|
-
peerlessPurgeTimeout?: number | null;
|
|
263
|
-
/**
|
|
264
|
-
* The use-case of the room. If not provided, this defaults to full_feature.
|
|
265
|
-
* @type {string}
|
|
266
|
-
*/
|
|
267
|
-
roomType?: RoomConfigRoomTypeEnum | 'livestream';
|
|
268
|
-
/**
|
|
269
|
-
* Enforces video codec for each peer in the room
|
|
270
|
-
* @type {string}
|
|
271
|
-
*/
|
|
272
|
-
videoCodec?: RoomConfigVideoCodecEnum | null;
|
|
273
|
-
/**
|
|
274
|
-
* URL where Fishjam notifications will be sent
|
|
275
|
-
* @type {string}
|
|
276
|
-
*/
|
|
277
|
-
webhookUrl?: string | null;
|
|
278
|
-
};
|
|
279
243
|
|
|
280
244
|
type ExpectedEvents = 'roomCreated' | 'roomDeleted' | 'roomCrashed' | 'peerAdded' | 'peerDeleted' | 'peerConnected' | 'peerDisconnected' | 'peerMetadataUpdated' | 'peerCrashed' | 'trackAdded' | 'trackRemoved' | 'trackMetadataUpdated';
|
|
281
245
|
type ErrorEventHandler = (msg: Error) => void;
|
|
@@ -317,7 +281,7 @@ declare class FishjamClient {
|
|
|
317
281
|
/**
|
|
318
282
|
* Create a new room. All peers connected to the same room will be able to send/receive streams to each other.
|
|
319
283
|
*/
|
|
320
|
-
createRoom(config?:
|
|
284
|
+
createRoom(config?: RoomConfig): Promise<Room>;
|
|
321
285
|
/**
|
|
322
286
|
* Delete an existing room. All peers connected to this room will be disconnected and removed.
|
|
323
287
|
*/
|
|
@@ -377,4 +341,4 @@ declare class ServiceUnavailableException extends FishjamBaseException {
|
|
|
377
341
|
declare class UnknownException extends FishjamBaseException {
|
|
378
342
|
}
|
|
379
343
|
|
|
380
|
-
export { BadRequestException, type Brand, type CloseEventHandler, type ErrorEventHandler, type ExpectedEvents, FishjamBaseException, FishjamClient, type FishjamConfig, FishjamNotFoundException, FishjamWSNotifier, ForbiddenException, type NotificationEvents, type Peer, type PeerId, PeerNotFoundException, type PeerOptions, PeerStatus, type Room, type RoomConfig, RoomConfigRoomTypeEnum, RoomConfigVideoCodecEnum, type RoomId, RoomNotFoundException,
|
|
344
|
+
export { BadRequestException, type Brand, type CloseEventHandler, type ErrorEventHandler, type ExpectedEvents, FishjamBaseException, FishjamClient, type FishjamConfig, FishjamNotFoundException, FishjamWSNotifier, ForbiddenException, type NotificationEvents, type Peer, type PeerId, PeerNotFoundException, type PeerOptions, PeerStatus, type Room, type RoomConfig, RoomConfigRoomTypeEnum, RoomConfigVideoCodecEnum, type RoomId, RoomNotFoundException, ServiceUnavailableException, UnauthorizedException, UnknownException, type ViewerToken };
|
package/dist/index.d.ts
CHANGED
|
@@ -89,19 +89,13 @@ interface RoomConfig {
|
|
|
89
89
|
*/
|
|
90
90
|
'maxPeers'?: number | null;
|
|
91
91
|
/**
|
|
92
|
-
*
|
|
93
|
-
* @type {
|
|
94
|
-
* @memberof RoomConfig
|
|
95
|
-
*/
|
|
96
|
-
'peerDisconnectedTimeout'?: number | null;
|
|
97
|
-
/**
|
|
98
|
-
* Duration (in seconds) after which the room will be removed if no peers are connected. If not provided, this feature is disabled.
|
|
99
|
-
* @type {number}
|
|
92
|
+
* True if livestream viewers can omit specifying a token.
|
|
93
|
+
* @type {boolean}
|
|
100
94
|
* @memberof RoomConfig
|
|
101
95
|
*/
|
|
102
|
-
'
|
|
96
|
+
'public'?: boolean;
|
|
103
97
|
/**
|
|
104
|
-
* The use-case of the room. If not provided, this defaults to
|
|
98
|
+
* The use-case of the room. If not provided, this defaults to conference.
|
|
105
99
|
* @type {string}
|
|
106
100
|
* @memberof RoomConfig
|
|
107
101
|
*/
|
|
@@ -123,6 +117,8 @@ declare const RoomConfigRoomTypeEnum: {
|
|
|
123
117
|
readonly FullFeature: "full_feature";
|
|
124
118
|
readonly AudioOnly: "audio_only";
|
|
125
119
|
readonly Broadcaster: "broadcaster";
|
|
120
|
+
readonly Livestream: "livestream";
|
|
121
|
+
readonly Conference: "conference";
|
|
126
122
|
};
|
|
127
123
|
type RoomConfigRoomTypeEnum = typeof RoomConfigRoomTypeEnum[keyof typeof RoomConfigRoomTypeEnum];
|
|
128
124
|
declare const RoomConfigVideoCodecEnum: {
|
|
@@ -171,7 +167,7 @@ interface ViewerToken {
|
|
|
171
167
|
* @type {string}
|
|
172
168
|
* @memberof ViewerToken
|
|
173
169
|
*/
|
|
174
|
-
'token'
|
|
170
|
+
'token': string;
|
|
175
171
|
}
|
|
176
172
|
|
|
177
173
|
type EventMap = {
|
|
@@ -238,44 +234,12 @@ type Peer = Omit<Peer$1, 'id'> & {
|
|
|
238
234
|
type Room = {
|
|
239
235
|
id: RoomId;
|
|
240
236
|
peers: Peer[];
|
|
241
|
-
config:
|
|
237
|
+
config: RoomConfig;
|
|
242
238
|
};
|
|
243
239
|
type FishjamConfig = {
|
|
244
240
|
fishjamUrl: string;
|
|
245
241
|
managementToken: string;
|
|
246
242
|
};
|
|
247
|
-
type RoomOptions = {
|
|
248
|
-
/**
|
|
249
|
-
* Maximum amount of peers allowed into the room
|
|
250
|
-
* @type {number}
|
|
251
|
-
*/
|
|
252
|
-
maxPeers?: number | null;
|
|
253
|
-
/**
|
|
254
|
-
* Duration (in seconds) after which the peer will be removed if it is disconnected. If not provided, this feature is disabled.
|
|
255
|
-
* @type {number}
|
|
256
|
-
*/
|
|
257
|
-
peerDisconnectedTimeout?: number | null;
|
|
258
|
-
/**
|
|
259
|
-
* Duration (in seconds) after which the room will be removed if no peers are connected. If not provided, this feature is disabled.
|
|
260
|
-
* @type {number}
|
|
261
|
-
*/
|
|
262
|
-
peerlessPurgeTimeout?: number | null;
|
|
263
|
-
/**
|
|
264
|
-
* The use-case of the room. If not provided, this defaults to full_feature.
|
|
265
|
-
* @type {string}
|
|
266
|
-
*/
|
|
267
|
-
roomType?: RoomConfigRoomTypeEnum | 'livestream';
|
|
268
|
-
/**
|
|
269
|
-
* Enforces video codec for each peer in the room
|
|
270
|
-
* @type {string}
|
|
271
|
-
*/
|
|
272
|
-
videoCodec?: RoomConfigVideoCodecEnum | null;
|
|
273
|
-
/**
|
|
274
|
-
* URL where Fishjam notifications will be sent
|
|
275
|
-
* @type {string}
|
|
276
|
-
*/
|
|
277
|
-
webhookUrl?: string | null;
|
|
278
|
-
};
|
|
279
243
|
|
|
280
244
|
type ExpectedEvents = 'roomCreated' | 'roomDeleted' | 'roomCrashed' | 'peerAdded' | 'peerDeleted' | 'peerConnected' | 'peerDisconnected' | 'peerMetadataUpdated' | 'peerCrashed' | 'trackAdded' | 'trackRemoved' | 'trackMetadataUpdated';
|
|
281
245
|
type ErrorEventHandler = (msg: Error) => void;
|
|
@@ -317,7 +281,7 @@ declare class FishjamClient {
|
|
|
317
281
|
/**
|
|
318
282
|
* Create a new room. All peers connected to the same room will be able to send/receive streams to each other.
|
|
319
283
|
*/
|
|
320
|
-
createRoom(config?:
|
|
284
|
+
createRoom(config?: RoomConfig): Promise<Room>;
|
|
321
285
|
/**
|
|
322
286
|
* Delete an existing room. All peers connected to this room will be disconnected and removed.
|
|
323
287
|
*/
|
|
@@ -377,4 +341,4 @@ declare class ServiceUnavailableException extends FishjamBaseException {
|
|
|
377
341
|
declare class UnknownException extends FishjamBaseException {
|
|
378
342
|
}
|
|
379
343
|
|
|
380
|
-
export { BadRequestException, type Brand, type CloseEventHandler, type ErrorEventHandler, type ExpectedEvents, FishjamBaseException, FishjamClient, type FishjamConfig, FishjamNotFoundException, FishjamWSNotifier, ForbiddenException, type NotificationEvents, type Peer, type PeerId, PeerNotFoundException, type PeerOptions, PeerStatus, type Room, type RoomConfig, RoomConfigRoomTypeEnum, RoomConfigVideoCodecEnum, type RoomId, RoomNotFoundException,
|
|
344
|
+
export { BadRequestException, type Brand, type CloseEventHandler, type ErrorEventHandler, type ExpectedEvents, FishjamBaseException, FishjamClient, type FishjamConfig, FishjamNotFoundException, FishjamWSNotifier, ForbiddenException, type NotificationEvents, type Peer, type PeerId, PeerNotFoundException, type PeerOptions, PeerStatus, type Room, type RoomConfig, RoomConfigRoomTypeEnum, RoomConfigVideoCodecEnum, type RoomId, RoomNotFoundException, ServiceUnavailableException, UnauthorizedException, UnknownException, type ViewerToken };
|
package/dist/index.js
CHANGED
|
@@ -10806,7 +10806,7 @@ var require_dist = __commonJS({
|
|
|
10806
10806
|
RoomApiAxiosParamCreator: () => RoomApiAxiosParamCreator,
|
|
10807
10807
|
RoomApiFactory: () => RoomApiFactory,
|
|
10808
10808
|
RoomApiFp: () => RoomApiFp,
|
|
10809
|
-
RoomConfigRoomTypeEnum: () =>
|
|
10809
|
+
RoomConfigRoomTypeEnum: () => RoomConfigRoomTypeEnum2,
|
|
10810
10810
|
RoomConfigVideoCodecEnum: () => RoomConfigVideoCodecEnum2,
|
|
10811
10811
|
SipApi: () => SipApi,
|
|
10812
10812
|
SipApiAxiosParamCreator: () => SipApiAxiosParamCreator,
|
|
@@ -14084,10 +14084,12 @@ var require_dist = __commonJS({
|
|
|
14084
14084
|
Connected: "connected",
|
|
14085
14085
|
Disconnected: "disconnected"
|
|
14086
14086
|
};
|
|
14087
|
-
var
|
|
14087
|
+
var RoomConfigRoomTypeEnum2 = {
|
|
14088
14088
|
FullFeature: "full_feature",
|
|
14089
14089
|
AudioOnly: "audio_only",
|
|
14090
|
-
Broadcaster: "broadcaster"
|
|
14090
|
+
Broadcaster: "broadcaster",
|
|
14091
|
+
Livestream: "livestream",
|
|
14092
|
+
Conference: "conference"
|
|
14091
14093
|
};
|
|
14092
14094
|
var RoomConfigVideoCodecEnum2 = {
|
|
14093
14095
|
H264: "h264",
|
|
@@ -15697,7 +15699,7 @@ var require_dist = __commonJS({
|
|
|
15697
15699
|
return {
|
|
15698
15700
|
/**
|
|
15699
15701
|
*
|
|
15700
|
-
* @summary Generate single
|
|
15702
|
+
* @summary Generate single livestream access token
|
|
15701
15703
|
* @param {string} roomId A room id.
|
|
15702
15704
|
* @param {*} [options] Override http request option.
|
|
15703
15705
|
* @throws {RequiredError}
|
|
@@ -15728,7 +15730,7 @@ var require_dist = __commonJS({
|
|
|
15728
15730
|
return {
|
|
15729
15731
|
/**
|
|
15730
15732
|
*
|
|
15731
|
-
* @summary Generate single
|
|
15733
|
+
* @summary Generate single livestream access token
|
|
15732
15734
|
* @param {string} roomId A room id.
|
|
15733
15735
|
* @param {*} [options] Override http request option.
|
|
15734
15736
|
* @throws {RequiredError}
|
|
@@ -15746,7 +15748,7 @@ var require_dist = __commonJS({
|
|
|
15746
15748
|
return {
|
|
15747
15749
|
/**
|
|
15748
15750
|
*
|
|
15749
|
-
* @summary Generate single
|
|
15751
|
+
* @summary Generate single livestream access token
|
|
15750
15752
|
* @param {string} roomId A room id.
|
|
15751
15753
|
* @param {*} [options] Override http request option.
|
|
15752
15754
|
* @throws {RequiredError}
|
|
@@ -15759,7 +15761,7 @@ var require_dist = __commonJS({
|
|
|
15759
15761
|
var ViewerApi2 = class extends BaseAPI {
|
|
15760
15762
|
/**
|
|
15761
15763
|
*
|
|
15762
|
-
* @summary Generate single
|
|
15764
|
+
* @summary Generate single livestream access token
|
|
15763
15765
|
* @param {string} roomId A room id.
|
|
15764
15766
|
* @param {*} [options] Override http request option.
|
|
15765
15767
|
* @throws {RequiredError}
|
|
@@ -18710,8 +18712,7 @@ var FishjamClient = class {
|
|
|
18710
18712
|
*/
|
|
18711
18713
|
async createRoom(config = {}) {
|
|
18712
18714
|
try {
|
|
18713
|
-
const
|
|
18714
|
-
const response = await this.roomApi.createRoom({ ...config, roomType: parsedRoomType });
|
|
18715
|
+
const response = await this.roomApi.createRoom(config);
|
|
18715
18716
|
const {
|
|
18716
18717
|
data: {
|
|
18717
18718
|
data: {
|
package/dist/index.mjs
CHANGED
|
@@ -10781,7 +10781,7 @@ var require_dist = __commonJS({
|
|
|
10781
10781
|
RoomApiAxiosParamCreator: () => RoomApiAxiosParamCreator,
|
|
10782
10782
|
RoomApiFactory: () => RoomApiFactory,
|
|
10783
10783
|
RoomApiFp: () => RoomApiFp,
|
|
10784
|
-
RoomConfigRoomTypeEnum: () =>
|
|
10784
|
+
RoomConfigRoomTypeEnum: () => RoomConfigRoomTypeEnum2,
|
|
10785
10785
|
RoomConfigVideoCodecEnum: () => RoomConfigVideoCodecEnum2,
|
|
10786
10786
|
SipApi: () => SipApi,
|
|
10787
10787
|
SipApiAxiosParamCreator: () => SipApiAxiosParamCreator,
|
|
@@ -14059,10 +14059,12 @@ var require_dist = __commonJS({
|
|
|
14059
14059
|
Connected: "connected",
|
|
14060
14060
|
Disconnected: "disconnected"
|
|
14061
14061
|
};
|
|
14062
|
-
var
|
|
14062
|
+
var RoomConfigRoomTypeEnum2 = {
|
|
14063
14063
|
FullFeature: "full_feature",
|
|
14064
14064
|
AudioOnly: "audio_only",
|
|
14065
|
-
Broadcaster: "broadcaster"
|
|
14065
|
+
Broadcaster: "broadcaster",
|
|
14066
|
+
Livestream: "livestream",
|
|
14067
|
+
Conference: "conference"
|
|
14066
14068
|
};
|
|
14067
14069
|
var RoomConfigVideoCodecEnum2 = {
|
|
14068
14070
|
H264: "h264",
|
|
@@ -15672,7 +15674,7 @@ var require_dist = __commonJS({
|
|
|
15672
15674
|
return {
|
|
15673
15675
|
/**
|
|
15674
15676
|
*
|
|
15675
|
-
* @summary Generate single
|
|
15677
|
+
* @summary Generate single livestream access token
|
|
15676
15678
|
* @param {string} roomId A room id.
|
|
15677
15679
|
* @param {*} [options] Override http request option.
|
|
15678
15680
|
* @throws {RequiredError}
|
|
@@ -15703,7 +15705,7 @@ var require_dist = __commonJS({
|
|
|
15703
15705
|
return {
|
|
15704
15706
|
/**
|
|
15705
15707
|
*
|
|
15706
|
-
* @summary Generate single
|
|
15708
|
+
* @summary Generate single livestream access token
|
|
15707
15709
|
* @param {string} roomId A room id.
|
|
15708
15710
|
* @param {*} [options] Override http request option.
|
|
15709
15711
|
* @throws {RequiredError}
|
|
@@ -15721,7 +15723,7 @@ var require_dist = __commonJS({
|
|
|
15721
15723
|
return {
|
|
15722
15724
|
/**
|
|
15723
15725
|
*
|
|
15724
|
-
* @summary Generate single
|
|
15726
|
+
* @summary Generate single livestream access token
|
|
15725
15727
|
* @param {string} roomId A room id.
|
|
15726
15728
|
* @param {*} [options] Override http request option.
|
|
15727
15729
|
* @throws {RequiredError}
|
|
@@ -15734,7 +15736,7 @@ var require_dist = __commonJS({
|
|
|
15734
15736
|
var ViewerApi2 = class extends BaseAPI {
|
|
15735
15737
|
/**
|
|
15736
15738
|
*
|
|
15737
|
-
* @summary Generate single
|
|
15739
|
+
* @summary Generate single livestream access token
|
|
15738
15740
|
* @param {string} roomId A room id.
|
|
15739
15741
|
* @param {*} [options] Override http request option.
|
|
15740
15742
|
* @throws {RequiredError}
|
|
@@ -15995,8 +15997,7 @@ var FishjamClient = class {
|
|
|
15995
15997
|
*/
|
|
15996
15998
|
async createRoom(config = {}) {
|
|
15997
15999
|
try {
|
|
15998
|
-
const
|
|
15999
|
-
const response = await this.roomApi.createRoom({ ...config, roomType: parsedRoomType });
|
|
16000
|
+
const response = await this.roomApi.createRoom(config);
|
|
16000
16001
|
const {
|
|
16001
16002
|
data: {
|
|
16002
16003
|
data: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fishjam-cloud/js-server-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"description": "Fishjam server SDK for JavaScript",
|
|
5
5
|
"homepage": "https://github.com/fishjam-cloud/js-server-sdk",
|
|
6
6
|
"author": "Fishjam Team",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"websocket": "^1.0.35"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@fishjam-cloud/fishjam-openapi": "0.
|
|
60
|
-
"@fishjam-cloud/fishjam-proto": "0.
|
|
59
|
+
"@fishjam-cloud/fishjam-openapi": "0.19.0",
|
|
60
|
+
"@fishjam-cloud/fishjam-proto": "0.19.0",
|
|
61
61
|
"@openapitools/openapi-generator-cli": "^2.18.4",
|
|
62
62
|
"@types/node": "^22.13.16",
|
|
63
63
|
"@types/websocket": "^1.0.10",
|