@fishjam-cloud/js-server-sdk 0.27.0-rc.1 → 0.27.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-B3H63SYI.mjs → chunk-GFB6IWU4.mjs} +1 -1
- package/dist/index.d.mts +107 -29
- package/dist/index.d.ts +107 -29
- package/dist/index.js +295 -179
- package/dist/index.mjs +295 -179
- package/dist/integrations/gemini.js +1 -1
- package/dist/integrations/gemini.mjs +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -138,12 +138,12 @@ var VideoCodec = {
|
|
|
138
138
|
H264: "h264",
|
|
139
139
|
Vp8: "vp8"
|
|
140
140
|
};
|
|
141
|
-
var
|
|
141
|
+
var MoQApiAxiosParamCreator = function(configuration) {
|
|
142
142
|
return {
|
|
143
143
|
/**
|
|
144
|
-
*
|
|
145
|
-
* @summary
|
|
146
|
-
* @param {MoqTokenConfig} [moqTokenConfig]
|
|
144
|
+
* Issue a short-lived JWT for a Media over QUIC client.
|
|
145
|
+
* @summary Create a MoQ token
|
|
146
|
+
* @param {MoqTokenConfig} [moqTokenConfig]
|
|
147
147
|
* @param {*} [options] Override http request option.
|
|
148
148
|
* @throws {RequiredError}
|
|
149
149
|
*/
|
|
@@ -170,44 +170,44 @@ var MoqApiAxiosParamCreator = function(configuration) {
|
|
|
170
170
|
}
|
|
171
171
|
};
|
|
172
172
|
};
|
|
173
|
-
var
|
|
174
|
-
const localVarAxiosParamCreator =
|
|
173
|
+
var MoQApiFp = function(configuration) {
|
|
174
|
+
const localVarAxiosParamCreator = MoQApiAxiosParamCreator(configuration);
|
|
175
175
|
return {
|
|
176
176
|
/**
|
|
177
|
-
*
|
|
178
|
-
* @summary
|
|
179
|
-
* @param {MoqTokenConfig} [moqTokenConfig]
|
|
177
|
+
* Issue a short-lived JWT for a Media over QUIC client.
|
|
178
|
+
* @summary Create a MoQ token
|
|
179
|
+
* @param {MoqTokenConfig} [moqTokenConfig]
|
|
180
180
|
* @param {*} [options] Override http request option.
|
|
181
181
|
* @throws {RequiredError}
|
|
182
182
|
*/
|
|
183
183
|
async createMoqToken(moqTokenConfig, options) {
|
|
184
184
|
const localVarAxiosArgs = await localVarAxiosParamCreator.createMoqToken(moqTokenConfig, options);
|
|
185
185
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
186
|
-
const localVarOperationServerBasePath = operationServerMap["
|
|
186
|
+
const localVarOperationServerBasePath = operationServerMap["MoQApi.createMoqToken"]?.[localVarOperationServerIndex]?.url;
|
|
187
187
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
188
188
|
}
|
|
189
189
|
};
|
|
190
190
|
};
|
|
191
|
-
var
|
|
191
|
+
var MoQApi = class extends BaseAPI {
|
|
192
192
|
/**
|
|
193
|
-
*
|
|
194
|
-
* @summary
|
|
195
|
-
* @param {MoqTokenConfig} [moqTokenConfig]
|
|
193
|
+
* Issue a short-lived JWT for a Media over QUIC client.
|
|
194
|
+
* @summary Create a MoQ token
|
|
195
|
+
* @param {MoqTokenConfig} [moqTokenConfig]
|
|
196
196
|
* @param {*} [options] Override http request option.
|
|
197
197
|
* @throws {RequiredError}
|
|
198
|
-
* @memberof
|
|
198
|
+
* @memberof MoQApi
|
|
199
199
|
*/
|
|
200
200
|
createMoqToken(moqTokenConfig, options) {
|
|
201
|
-
return
|
|
201
|
+
return MoQApiFp(this.configuration).createMoqToken(moqTokenConfig, options).then((request) => request(this.axios, this.basePath));
|
|
202
202
|
}
|
|
203
203
|
};
|
|
204
|
-
var
|
|
204
|
+
var RoomsApiAxiosParamCreator = function(configuration) {
|
|
205
205
|
return {
|
|
206
206
|
/**
|
|
207
|
-
*
|
|
208
|
-
* @summary Create peer
|
|
207
|
+
* Add a peer to a room and return its connection token.
|
|
208
|
+
* @summary Create a peer
|
|
209
209
|
* @param {string} roomId Room id
|
|
210
|
-
* @param {PeerConfig} [peerConfig]
|
|
210
|
+
* @param {PeerConfig} [peerConfig]
|
|
211
211
|
* @param {*} [options] Override http request option.
|
|
212
212
|
* @throws {RequiredError}
|
|
213
213
|
*/
|
|
@@ -234,9 +234,9 @@ var RoomApiAxiosParamCreator = function(configuration) {
|
|
|
234
234
|
};
|
|
235
235
|
},
|
|
236
236
|
/**
|
|
237
|
-
*
|
|
238
|
-
* @summary
|
|
239
|
-
* @param {RoomConfig} [roomConfig]
|
|
237
|
+
* Create a new room with the given configuration.
|
|
238
|
+
* @summary Create a room
|
|
239
|
+
* @param {RoomConfig} [roomConfig]
|
|
240
240
|
* @param {*} [options] Override http request option.
|
|
241
241
|
* @throws {RequiredError}
|
|
242
242
|
*/
|
|
@@ -262,8 +262,8 @@ var RoomApiAxiosParamCreator = function(configuration) {
|
|
|
262
262
|
};
|
|
263
263
|
},
|
|
264
264
|
/**
|
|
265
|
-
*
|
|
266
|
-
* @summary Delete peer
|
|
265
|
+
* Remove a peer from a room and disconnect it.
|
|
266
|
+
* @summary Delete a peer
|
|
267
267
|
* @param {string} roomId Room id
|
|
268
268
|
* @param {string} id Peer id
|
|
269
269
|
* @param {*} [options] Override http request option.
|
|
@@ -291,8 +291,8 @@ var RoomApiAxiosParamCreator = function(configuration) {
|
|
|
291
291
|
};
|
|
292
292
|
},
|
|
293
293
|
/**
|
|
294
|
-
*
|
|
295
|
-
* @summary Delete
|
|
294
|
+
* Delete a room by id and disconnect all of its peers.
|
|
295
|
+
* @summary Delete a room
|
|
296
296
|
* @param {string} roomId Room id
|
|
297
297
|
* @param {*} [options] Override http request option.
|
|
298
298
|
* @throws {RequiredError}
|
|
@@ -318,8 +318,8 @@ var RoomApiAxiosParamCreator = function(configuration) {
|
|
|
318
318
|
};
|
|
319
319
|
},
|
|
320
320
|
/**
|
|
321
|
-
*
|
|
322
|
-
* @summary
|
|
321
|
+
* List all rooms and livestreams.
|
|
322
|
+
* @summary List all rooms
|
|
323
323
|
* @param {*} [options] Override http request option.
|
|
324
324
|
* @throws {RequiredError}
|
|
325
325
|
*/
|
|
@@ -343,8 +343,8 @@ var RoomApiAxiosParamCreator = function(configuration) {
|
|
|
343
343
|
};
|
|
344
344
|
},
|
|
345
345
|
/**
|
|
346
|
-
*
|
|
347
|
-
* @summary
|
|
346
|
+
* Get a room by id.
|
|
347
|
+
* @summary Get a room
|
|
348
348
|
* @param {string} roomId Room ID
|
|
349
349
|
* @param {*} [options] Override http request option.
|
|
350
350
|
* @throws {RequiredError}
|
|
@@ -370,8 +370,8 @@ var RoomApiAxiosParamCreator = function(configuration) {
|
|
|
370
370
|
};
|
|
371
371
|
},
|
|
372
372
|
/**
|
|
373
|
-
*
|
|
374
|
-
* @summary Refresh peer token
|
|
373
|
+
* Issue a fresh connection token for an existing peer.
|
|
374
|
+
* @summary Refresh a peer token
|
|
375
375
|
* @param {string} roomId Room id
|
|
376
376
|
* @param {string} id Peer id
|
|
377
377
|
* @param {*} [options] Override http request option.
|
|
@@ -399,8 +399,8 @@ var RoomApiAxiosParamCreator = function(configuration) {
|
|
|
399
399
|
};
|
|
400
400
|
},
|
|
401
401
|
/**
|
|
402
|
-
*
|
|
403
|
-
* @summary Subscribe peer to another peer\'s tracks
|
|
402
|
+
* Subscribe a peer to all current and future tracks published by another peer in the same room.
|
|
403
|
+
* @summary Subscribe a peer to another peer\'s tracks
|
|
404
404
|
* @param {string} roomId Room id
|
|
405
405
|
* @param {string} id Peer id
|
|
406
406
|
* @param {string} [peerId] ID of the peer that produces the track
|
|
@@ -432,8 +432,8 @@ var RoomApiAxiosParamCreator = function(configuration) {
|
|
|
432
432
|
};
|
|
433
433
|
},
|
|
434
434
|
/**
|
|
435
|
-
*
|
|
436
|
-
* @summary Subscribe peer to specific tracks
|
|
435
|
+
* Subscribe a peer to a specific list of track IDs in the same room.
|
|
436
|
+
* @summary Subscribe a peer to specific tracks
|
|
437
437
|
* @param {string} roomId Room id
|
|
438
438
|
* @param {string} id Peer id
|
|
439
439
|
* @param {SubscribeTracksRequest} [subscribeTracksRequest] Track IDs
|
|
@@ -465,39 +465,39 @@ var RoomApiAxiosParamCreator = function(configuration) {
|
|
|
465
465
|
}
|
|
466
466
|
};
|
|
467
467
|
};
|
|
468
|
-
var
|
|
469
|
-
const localVarAxiosParamCreator =
|
|
468
|
+
var RoomsApiFp = function(configuration) {
|
|
469
|
+
const localVarAxiosParamCreator = RoomsApiAxiosParamCreator(configuration);
|
|
470
470
|
return {
|
|
471
471
|
/**
|
|
472
|
-
*
|
|
473
|
-
* @summary Create peer
|
|
472
|
+
* Add a peer to a room and return its connection token.
|
|
473
|
+
* @summary Create a peer
|
|
474
474
|
* @param {string} roomId Room id
|
|
475
|
-
* @param {PeerConfig} [peerConfig]
|
|
475
|
+
* @param {PeerConfig} [peerConfig]
|
|
476
476
|
* @param {*} [options] Override http request option.
|
|
477
477
|
* @throws {RequiredError}
|
|
478
478
|
*/
|
|
479
479
|
async addPeer(roomId, peerConfig, options) {
|
|
480
480
|
const localVarAxiosArgs = await localVarAxiosParamCreator.addPeer(roomId, peerConfig, options);
|
|
481
481
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
482
|
-
const localVarOperationServerBasePath = operationServerMap["
|
|
482
|
+
const localVarOperationServerBasePath = operationServerMap["RoomsApi.addPeer"]?.[localVarOperationServerIndex]?.url;
|
|
483
483
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
484
484
|
},
|
|
485
485
|
/**
|
|
486
|
-
*
|
|
487
|
-
* @summary
|
|
488
|
-
* @param {RoomConfig} [roomConfig]
|
|
486
|
+
* Create a new room with the given configuration.
|
|
487
|
+
* @summary Create a room
|
|
488
|
+
* @param {RoomConfig} [roomConfig]
|
|
489
489
|
* @param {*} [options] Override http request option.
|
|
490
490
|
* @throws {RequiredError}
|
|
491
491
|
*/
|
|
492
492
|
async createRoom(roomConfig, options) {
|
|
493
493
|
const localVarAxiosArgs = await localVarAxiosParamCreator.createRoom(roomConfig, options);
|
|
494
494
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
495
|
-
const localVarOperationServerBasePath = operationServerMap["
|
|
495
|
+
const localVarOperationServerBasePath = operationServerMap["RoomsApi.createRoom"]?.[localVarOperationServerIndex]?.url;
|
|
496
496
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
497
497
|
},
|
|
498
498
|
/**
|
|
499
|
-
*
|
|
500
|
-
* @summary Delete peer
|
|
499
|
+
* Remove a peer from a room and disconnect it.
|
|
500
|
+
* @summary Delete a peer
|
|
501
501
|
* @param {string} roomId Room id
|
|
502
502
|
* @param {string} id Peer id
|
|
503
503
|
* @param {*} [options] Override http request option.
|
|
@@ -506,12 +506,12 @@ var RoomApiFp = function(configuration) {
|
|
|
506
506
|
async deletePeer(roomId, id, options) {
|
|
507
507
|
const localVarAxiosArgs = await localVarAxiosParamCreator.deletePeer(roomId, id, options);
|
|
508
508
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
509
|
-
const localVarOperationServerBasePath = operationServerMap["
|
|
509
|
+
const localVarOperationServerBasePath = operationServerMap["RoomsApi.deletePeer"]?.[localVarOperationServerIndex]?.url;
|
|
510
510
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
511
511
|
},
|
|
512
512
|
/**
|
|
513
|
-
*
|
|
514
|
-
* @summary Delete
|
|
513
|
+
* Delete a room by id and disconnect all of its peers.
|
|
514
|
+
* @summary Delete a room
|
|
515
515
|
* @param {string} roomId Room id
|
|
516
516
|
* @param {*} [options] Override http request option.
|
|
517
517
|
* @throws {RequiredError}
|
|
@@ -519,24 +519,24 @@ var RoomApiFp = function(configuration) {
|
|
|
519
519
|
async deleteRoom(roomId, options) {
|
|
520
520
|
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteRoom(roomId, options);
|
|
521
521
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
522
|
-
const localVarOperationServerBasePath = operationServerMap["
|
|
522
|
+
const localVarOperationServerBasePath = operationServerMap["RoomsApi.deleteRoom"]?.[localVarOperationServerIndex]?.url;
|
|
523
523
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
524
524
|
},
|
|
525
525
|
/**
|
|
526
|
-
*
|
|
527
|
-
* @summary
|
|
526
|
+
* List all rooms and livestreams.
|
|
527
|
+
* @summary List all rooms
|
|
528
528
|
* @param {*} [options] Override http request option.
|
|
529
529
|
* @throws {RequiredError}
|
|
530
530
|
*/
|
|
531
531
|
async getAllRooms(options) {
|
|
532
532
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getAllRooms(options);
|
|
533
533
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
534
|
-
const localVarOperationServerBasePath = operationServerMap["
|
|
534
|
+
const localVarOperationServerBasePath = operationServerMap["RoomsApi.getAllRooms"]?.[localVarOperationServerIndex]?.url;
|
|
535
535
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
536
536
|
},
|
|
537
537
|
/**
|
|
538
|
-
*
|
|
539
|
-
* @summary
|
|
538
|
+
* Get a room by id.
|
|
539
|
+
* @summary Get a room
|
|
540
540
|
* @param {string} roomId Room ID
|
|
541
541
|
* @param {*} [options] Override http request option.
|
|
542
542
|
* @throws {RequiredError}
|
|
@@ -544,12 +544,12 @@ var RoomApiFp = function(configuration) {
|
|
|
544
544
|
async getRoom(roomId, options) {
|
|
545
545
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getRoom(roomId, options);
|
|
546
546
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
547
|
-
const localVarOperationServerBasePath = operationServerMap["
|
|
547
|
+
const localVarOperationServerBasePath = operationServerMap["RoomsApi.getRoom"]?.[localVarOperationServerIndex]?.url;
|
|
548
548
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
549
549
|
},
|
|
550
550
|
/**
|
|
551
|
-
*
|
|
552
|
-
* @summary Refresh peer token
|
|
551
|
+
* Issue a fresh connection token for an existing peer.
|
|
552
|
+
* @summary Refresh a peer token
|
|
553
553
|
* @param {string} roomId Room id
|
|
554
554
|
* @param {string} id Peer id
|
|
555
555
|
* @param {*} [options] Override http request option.
|
|
@@ -558,12 +558,12 @@ var RoomApiFp = function(configuration) {
|
|
|
558
558
|
async refreshToken(roomId, id, options) {
|
|
559
559
|
const localVarAxiosArgs = await localVarAxiosParamCreator.refreshToken(roomId, id, options);
|
|
560
560
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
561
|
-
const localVarOperationServerBasePath = operationServerMap["
|
|
561
|
+
const localVarOperationServerBasePath = operationServerMap["RoomsApi.refreshToken"]?.[localVarOperationServerIndex]?.url;
|
|
562
562
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
563
563
|
},
|
|
564
564
|
/**
|
|
565
|
-
*
|
|
566
|
-
* @summary Subscribe peer to another peer\'s tracks
|
|
565
|
+
* Subscribe a peer to all current and future tracks published by another peer in the same room.
|
|
566
|
+
* @summary Subscribe a peer to another peer\'s tracks
|
|
567
567
|
* @param {string} roomId Room id
|
|
568
568
|
* @param {string} id Peer id
|
|
569
569
|
* @param {string} [peerId] ID of the peer that produces the track
|
|
@@ -573,12 +573,12 @@ var RoomApiFp = function(configuration) {
|
|
|
573
573
|
async subscribePeer(roomId, id, peerId, options) {
|
|
574
574
|
const localVarAxiosArgs = await localVarAxiosParamCreator.subscribePeer(roomId, id, peerId, options);
|
|
575
575
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
576
|
-
const localVarOperationServerBasePath = operationServerMap["
|
|
576
|
+
const localVarOperationServerBasePath = operationServerMap["RoomsApi.subscribePeer"]?.[localVarOperationServerIndex]?.url;
|
|
577
577
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
578
578
|
},
|
|
579
579
|
/**
|
|
580
|
-
*
|
|
581
|
-
* @summary Subscribe peer to specific tracks
|
|
580
|
+
* Subscribe a peer to a specific list of track IDs in the same room.
|
|
581
|
+
* @summary Subscribe a peer to specific tracks
|
|
582
582
|
* @param {string} roomId Room id
|
|
583
583
|
* @param {string} id Peer id
|
|
584
584
|
* @param {SubscribeTracksRequest} [subscribeTracksRequest] Track IDs
|
|
@@ -588,123 +588,123 @@ var RoomApiFp = function(configuration) {
|
|
|
588
588
|
async subscribeTracks(roomId, id, subscribeTracksRequest, options) {
|
|
589
589
|
const localVarAxiosArgs = await localVarAxiosParamCreator.subscribeTracks(roomId, id, subscribeTracksRequest, options);
|
|
590
590
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
591
|
-
const localVarOperationServerBasePath = operationServerMap["
|
|
591
|
+
const localVarOperationServerBasePath = operationServerMap["RoomsApi.subscribeTracks"]?.[localVarOperationServerIndex]?.url;
|
|
592
592
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
593
593
|
}
|
|
594
594
|
};
|
|
595
595
|
};
|
|
596
|
-
var
|
|
596
|
+
var RoomsApi = class extends BaseAPI {
|
|
597
597
|
/**
|
|
598
|
-
*
|
|
599
|
-
* @summary Create peer
|
|
598
|
+
* Add a peer to a room and return its connection token.
|
|
599
|
+
* @summary Create a peer
|
|
600
600
|
* @param {string} roomId Room id
|
|
601
|
-
* @param {PeerConfig} [peerConfig]
|
|
601
|
+
* @param {PeerConfig} [peerConfig]
|
|
602
602
|
* @param {*} [options] Override http request option.
|
|
603
603
|
* @throws {RequiredError}
|
|
604
|
-
* @memberof
|
|
604
|
+
* @memberof RoomsApi
|
|
605
605
|
*/
|
|
606
606
|
addPeer(roomId, peerConfig, options) {
|
|
607
|
-
return
|
|
607
|
+
return RoomsApiFp(this.configuration).addPeer(roomId, peerConfig, options).then((request) => request(this.axios, this.basePath));
|
|
608
608
|
}
|
|
609
609
|
/**
|
|
610
|
-
*
|
|
611
|
-
* @summary
|
|
612
|
-
* @param {RoomConfig} [roomConfig]
|
|
610
|
+
* Create a new room with the given configuration.
|
|
611
|
+
* @summary Create a room
|
|
612
|
+
* @param {RoomConfig} [roomConfig]
|
|
613
613
|
* @param {*} [options] Override http request option.
|
|
614
614
|
* @throws {RequiredError}
|
|
615
|
-
* @memberof
|
|
615
|
+
* @memberof RoomsApi
|
|
616
616
|
*/
|
|
617
617
|
createRoom(roomConfig, options) {
|
|
618
|
-
return
|
|
618
|
+
return RoomsApiFp(this.configuration).createRoom(roomConfig, options).then((request) => request(this.axios, this.basePath));
|
|
619
619
|
}
|
|
620
620
|
/**
|
|
621
|
-
*
|
|
622
|
-
* @summary Delete peer
|
|
621
|
+
* Remove a peer from a room and disconnect it.
|
|
622
|
+
* @summary Delete a peer
|
|
623
623
|
* @param {string} roomId Room id
|
|
624
624
|
* @param {string} id Peer id
|
|
625
625
|
* @param {*} [options] Override http request option.
|
|
626
626
|
* @throws {RequiredError}
|
|
627
|
-
* @memberof
|
|
627
|
+
* @memberof RoomsApi
|
|
628
628
|
*/
|
|
629
629
|
deletePeer(roomId, id, options) {
|
|
630
|
-
return
|
|
630
|
+
return RoomsApiFp(this.configuration).deletePeer(roomId, id, options).then((request) => request(this.axios, this.basePath));
|
|
631
631
|
}
|
|
632
632
|
/**
|
|
633
|
-
*
|
|
634
|
-
* @summary Delete
|
|
633
|
+
* Delete a room by id and disconnect all of its peers.
|
|
634
|
+
* @summary Delete a room
|
|
635
635
|
* @param {string} roomId Room id
|
|
636
636
|
* @param {*} [options] Override http request option.
|
|
637
637
|
* @throws {RequiredError}
|
|
638
|
-
* @memberof
|
|
638
|
+
* @memberof RoomsApi
|
|
639
639
|
*/
|
|
640
640
|
deleteRoom(roomId, options) {
|
|
641
|
-
return
|
|
641
|
+
return RoomsApiFp(this.configuration).deleteRoom(roomId, options).then((request) => request(this.axios, this.basePath));
|
|
642
642
|
}
|
|
643
643
|
/**
|
|
644
|
-
*
|
|
645
|
-
* @summary
|
|
644
|
+
* List all rooms and livestreams.
|
|
645
|
+
* @summary List all rooms
|
|
646
646
|
* @param {*} [options] Override http request option.
|
|
647
647
|
* @throws {RequiredError}
|
|
648
|
-
* @memberof
|
|
648
|
+
* @memberof RoomsApi
|
|
649
649
|
*/
|
|
650
650
|
getAllRooms(options) {
|
|
651
|
-
return
|
|
651
|
+
return RoomsApiFp(this.configuration).getAllRooms(options).then((request) => request(this.axios, this.basePath));
|
|
652
652
|
}
|
|
653
653
|
/**
|
|
654
|
-
*
|
|
655
|
-
* @summary
|
|
654
|
+
* Get a room by id.
|
|
655
|
+
* @summary Get a room
|
|
656
656
|
* @param {string} roomId Room ID
|
|
657
657
|
* @param {*} [options] Override http request option.
|
|
658
658
|
* @throws {RequiredError}
|
|
659
|
-
* @memberof
|
|
659
|
+
* @memberof RoomsApi
|
|
660
660
|
*/
|
|
661
661
|
getRoom(roomId, options) {
|
|
662
|
-
return
|
|
662
|
+
return RoomsApiFp(this.configuration).getRoom(roomId, options).then((request) => request(this.axios, this.basePath));
|
|
663
663
|
}
|
|
664
664
|
/**
|
|
665
|
-
*
|
|
666
|
-
* @summary Refresh peer token
|
|
665
|
+
* Issue a fresh connection token for an existing peer.
|
|
666
|
+
* @summary Refresh a peer token
|
|
667
667
|
* @param {string} roomId Room id
|
|
668
668
|
* @param {string} id Peer id
|
|
669
669
|
* @param {*} [options] Override http request option.
|
|
670
670
|
* @throws {RequiredError}
|
|
671
|
-
* @memberof
|
|
671
|
+
* @memberof RoomsApi
|
|
672
672
|
*/
|
|
673
673
|
refreshToken(roomId, id, options) {
|
|
674
|
-
return
|
|
674
|
+
return RoomsApiFp(this.configuration).refreshToken(roomId, id, options).then((request) => request(this.axios, this.basePath));
|
|
675
675
|
}
|
|
676
676
|
/**
|
|
677
|
-
*
|
|
678
|
-
* @summary Subscribe peer to another peer\'s tracks
|
|
677
|
+
* Subscribe a peer to all current and future tracks published by another peer in the same room.
|
|
678
|
+
* @summary Subscribe a peer to another peer\'s tracks
|
|
679
679
|
* @param {string} roomId Room id
|
|
680
680
|
* @param {string} id Peer id
|
|
681
681
|
* @param {string} [peerId] ID of the peer that produces the track
|
|
682
682
|
* @param {*} [options] Override http request option.
|
|
683
683
|
* @throws {RequiredError}
|
|
684
|
-
* @memberof
|
|
684
|
+
* @memberof RoomsApi
|
|
685
685
|
*/
|
|
686
686
|
subscribePeer(roomId, id, peerId, options) {
|
|
687
|
-
return
|
|
687
|
+
return RoomsApiFp(this.configuration).subscribePeer(roomId, id, peerId, options).then((request) => request(this.axios, this.basePath));
|
|
688
688
|
}
|
|
689
689
|
/**
|
|
690
|
-
*
|
|
691
|
-
* @summary Subscribe peer to specific tracks
|
|
690
|
+
* Subscribe a peer to a specific list of track IDs in the same room.
|
|
691
|
+
* @summary Subscribe a peer to specific tracks
|
|
692
692
|
* @param {string} roomId Room id
|
|
693
693
|
* @param {string} id Peer id
|
|
694
694
|
* @param {SubscribeTracksRequest} [subscribeTracksRequest] Track IDs
|
|
695
695
|
* @param {*} [options] Override http request option.
|
|
696
696
|
* @throws {RequiredError}
|
|
697
|
-
* @memberof
|
|
697
|
+
* @memberof RoomsApi
|
|
698
698
|
*/
|
|
699
699
|
subscribeTracks(roomId, id, subscribeTracksRequest, options) {
|
|
700
|
-
return
|
|
700
|
+
return RoomsApiFp(this.configuration).subscribeTracks(roomId, id, subscribeTracksRequest, options).then((request) => request(this.axios, this.basePath));
|
|
701
701
|
}
|
|
702
702
|
};
|
|
703
|
-
var
|
|
703
|
+
var StreamersApiAxiosParamCreator = function(configuration) {
|
|
704
704
|
return {
|
|
705
705
|
/**
|
|
706
|
-
*
|
|
707
|
-
* @summary
|
|
706
|
+
* Create a streamer for a stream and return its credentials.
|
|
707
|
+
* @summary Create a streamer
|
|
708
708
|
* @param {string} streamId Stream id
|
|
709
709
|
* @param {*} [options] Override http request option.
|
|
710
710
|
* @throws {RequiredError}
|
|
@@ -730,8 +730,8 @@ var StreamerApiAxiosParamCreator = function(configuration) {
|
|
|
730
730
|
};
|
|
731
731
|
},
|
|
732
732
|
/**
|
|
733
|
-
*
|
|
734
|
-
* @summary
|
|
733
|
+
* Delete a streamer from a stream and revoke its token.
|
|
734
|
+
* @summary Delete a streamer
|
|
735
735
|
* @param {string} streamId Stream id
|
|
736
736
|
* @param {string} streamerId Streamer id
|
|
737
737
|
* @param {*} [options] Override http request option.
|
|
@@ -759,8 +759,8 @@ var StreamerApiAxiosParamCreator = function(configuration) {
|
|
|
759
759
|
};
|
|
760
760
|
},
|
|
761
761
|
/**
|
|
762
|
-
*
|
|
763
|
-
* @summary
|
|
762
|
+
* Issue a fresh streamer token.
|
|
763
|
+
* @summary Create a streamer token
|
|
764
764
|
* @param {string} roomId ID of the stream.
|
|
765
765
|
* @param {*} [options] Override http request option.
|
|
766
766
|
* @throws {RequiredError}
|
|
@@ -787,12 +787,12 @@ var StreamerApiAxiosParamCreator = function(configuration) {
|
|
|
787
787
|
}
|
|
788
788
|
};
|
|
789
789
|
};
|
|
790
|
-
var
|
|
791
|
-
const localVarAxiosParamCreator =
|
|
790
|
+
var StreamersApiFp = function(configuration) {
|
|
791
|
+
const localVarAxiosParamCreator = StreamersApiAxiosParamCreator(configuration);
|
|
792
792
|
return {
|
|
793
793
|
/**
|
|
794
|
-
*
|
|
795
|
-
* @summary
|
|
794
|
+
* Create a streamer for a stream and return its credentials.
|
|
795
|
+
* @summary Create a streamer
|
|
796
796
|
* @param {string} streamId Stream id
|
|
797
797
|
* @param {*} [options] Override http request option.
|
|
798
798
|
* @throws {RequiredError}
|
|
@@ -800,12 +800,12 @@ var StreamerApiFp = function(configuration) {
|
|
|
800
800
|
async createStreamer(streamId, options) {
|
|
801
801
|
const localVarAxiosArgs = await localVarAxiosParamCreator.createStreamer(streamId, options);
|
|
802
802
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
803
|
-
const localVarOperationServerBasePath = operationServerMap["
|
|
803
|
+
const localVarOperationServerBasePath = operationServerMap["StreamersApi.createStreamer"]?.[localVarOperationServerIndex]?.url;
|
|
804
804
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
805
805
|
},
|
|
806
806
|
/**
|
|
807
|
-
*
|
|
808
|
-
* @summary
|
|
807
|
+
* Delete a streamer from a stream and revoke its token.
|
|
808
|
+
* @summary Delete a streamer
|
|
809
809
|
* @param {string} streamId Stream id
|
|
810
810
|
* @param {string} streamerId Streamer id
|
|
811
811
|
* @param {*} [options] Override http request option.
|
|
@@ -814,12 +814,12 @@ var StreamerApiFp = function(configuration) {
|
|
|
814
814
|
async deleteStreamer(streamId, streamerId, options) {
|
|
815
815
|
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteStreamer(streamId, streamerId, options);
|
|
816
816
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
817
|
-
const localVarOperationServerBasePath = operationServerMap["
|
|
817
|
+
const localVarOperationServerBasePath = operationServerMap["StreamersApi.deleteStreamer"]?.[localVarOperationServerIndex]?.url;
|
|
818
818
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
819
819
|
},
|
|
820
820
|
/**
|
|
821
|
-
*
|
|
822
|
-
* @summary
|
|
821
|
+
* Issue a fresh streamer token.
|
|
822
|
+
* @summary Create a streamer token
|
|
823
823
|
* @param {string} roomId ID of the stream.
|
|
824
824
|
* @param {*} [options] Override http request option.
|
|
825
825
|
* @throws {RequiredError}
|
|
@@ -827,52 +827,52 @@ var StreamerApiFp = function(configuration) {
|
|
|
827
827
|
async generateStreamerToken(roomId, options) {
|
|
828
828
|
const localVarAxiosArgs = await localVarAxiosParamCreator.generateStreamerToken(roomId, options);
|
|
829
829
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
830
|
-
const localVarOperationServerBasePath = operationServerMap["
|
|
830
|
+
const localVarOperationServerBasePath = operationServerMap["StreamersApi.generateStreamerToken"]?.[localVarOperationServerIndex]?.url;
|
|
831
831
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
832
832
|
}
|
|
833
833
|
};
|
|
834
834
|
};
|
|
835
|
-
var
|
|
835
|
+
var StreamersApi = class extends BaseAPI {
|
|
836
836
|
/**
|
|
837
|
-
*
|
|
838
|
-
* @summary
|
|
837
|
+
* Create a streamer for a stream and return its credentials.
|
|
838
|
+
* @summary Create a streamer
|
|
839
839
|
* @param {string} streamId Stream id
|
|
840
840
|
* @param {*} [options] Override http request option.
|
|
841
841
|
* @throws {RequiredError}
|
|
842
|
-
* @memberof
|
|
842
|
+
* @memberof StreamersApi
|
|
843
843
|
*/
|
|
844
844
|
createStreamer(streamId, options) {
|
|
845
|
-
return
|
|
845
|
+
return StreamersApiFp(this.configuration).createStreamer(streamId, options).then((request) => request(this.axios, this.basePath));
|
|
846
846
|
}
|
|
847
847
|
/**
|
|
848
|
-
*
|
|
849
|
-
* @summary
|
|
848
|
+
* Delete a streamer from a stream and revoke its token.
|
|
849
|
+
* @summary Delete a streamer
|
|
850
850
|
* @param {string} streamId Stream id
|
|
851
851
|
* @param {string} streamerId Streamer id
|
|
852
852
|
* @param {*} [options] Override http request option.
|
|
853
853
|
* @throws {RequiredError}
|
|
854
|
-
* @memberof
|
|
854
|
+
* @memberof StreamersApi
|
|
855
855
|
*/
|
|
856
856
|
deleteStreamer(streamId, streamerId, options) {
|
|
857
|
-
return
|
|
857
|
+
return StreamersApiFp(this.configuration).deleteStreamer(streamId, streamerId, options).then((request) => request(this.axios, this.basePath));
|
|
858
858
|
}
|
|
859
859
|
/**
|
|
860
|
-
*
|
|
861
|
-
* @summary
|
|
860
|
+
* Issue a fresh streamer token.
|
|
861
|
+
* @summary Create a streamer token
|
|
862
862
|
* @param {string} roomId ID of the stream.
|
|
863
863
|
* @param {*} [options] Override http request option.
|
|
864
864
|
* @throws {RequiredError}
|
|
865
|
-
* @memberof
|
|
865
|
+
* @memberof StreamersApi
|
|
866
866
|
*/
|
|
867
867
|
generateStreamerToken(roomId, options) {
|
|
868
|
-
return
|
|
868
|
+
return StreamersApiFp(this.configuration).generateStreamerToken(roomId, options).then((request) => request(this.axios, this.basePath));
|
|
869
869
|
}
|
|
870
870
|
};
|
|
871
|
-
var
|
|
871
|
+
var ViewersApiAxiosParamCreator = function(configuration) {
|
|
872
872
|
return {
|
|
873
873
|
/**
|
|
874
|
-
*
|
|
875
|
-
* @summary
|
|
874
|
+
* Create a viewer for a stream and return its credentials.
|
|
875
|
+
* @summary Create a viewer
|
|
876
876
|
* @param {string} streamId Stream id
|
|
877
877
|
* @param {*} [options] Override http request option.
|
|
878
878
|
* @throws {RequiredError}
|
|
@@ -898,8 +898,8 @@ var ViewerApiAxiosParamCreator = function(configuration) {
|
|
|
898
898
|
};
|
|
899
899
|
},
|
|
900
900
|
/**
|
|
901
|
-
*
|
|
902
|
-
* @summary
|
|
901
|
+
* Delete a viewer from a stream and revoke its token.
|
|
902
|
+
* @summary Delete a viewer
|
|
903
903
|
* @param {string} streamId Stream id
|
|
904
904
|
* @param {string} viewerId Viewer id
|
|
905
905
|
* @param {*} [options] Override http request option.
|
|
@@ -927,8 +927,8 @@ var ViewerApiAxiosParamCreator = function(configuration) {
|
|
|
927
927
|
};
|
|
928
928
|
},
|
|
929
929
|
/**
|
|
930
|
-
*
|
|
931
|
-
* @summary
|
|
930
|
+
* Issue a fresh viewer token.
|
|
931
|
+
* @summary Create a viewer token
|
|
932
932
|
* @param {string} roomId ID of the stream.
|
|
933
933
|
* @param {*} [options] Override http request option.
|
|
934
934
|
* @throws {RequiredError}
|
|
@@ -955,12 +955,12 @@ var ViewerApiAxiosParamCreator = function(configuration) {
|
|
|
955
955
|
}
|
|
956
956
|
};
|
|
957
957
|
};
|
|
958
|
-
var
|
|
959
|
-
const localVarAxiosParamCreator =
|
|
958
|
+
var ViewersApiFp = function(configuration) {
|
|
959
|
+
const localVarAxiosParamCreator = ViewersApiAxiosParamCreator(configuration);
|
|
960
960
|
return {
|
|
961
961
|
/**
|
|
962
|
-
*
|
|
963
|
-
* @summary
|
|
962
|
+
* Create a viewer for a stream and return its credentials.
|
|
963
|
+
* @summary Create a viewer
|
|
964
964
|
* @param {string} streamId Stream id
|
|
965
965
|
* @param {*} [options] Override http request option.
|
|
966
966
|
* @throws {RequiredError}
|
|
@@ -968,12 +968,12 @@ var ViewerApiFp = function(configuration) {
|
|
|
968
968
|
async createViewer(streamId, options) {
|
|
969
969
|
const localVarAxiosArgs = await localVarAxiosParamCreator.createViewer(streamId, options);
|
|
970
970
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
971
|
-
const localVarOperationServerBasePath = operationServerMap["
|
|
971
|
+
const localVarOperationServerBasePath = operationServerMap["ViewersApi.createViewer"]?.[localVarOperationServerIndex]?.url;
|
|
972
972
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
973
973
|
},
|
|
974
974
|
/**
|
|
975
|
-
*
|
|
976
|
-
* @summary
|
|
975
|
+
* Delete a viewer from a stream and revoke its token.
|
|
976
|
+
* @summary Delete a viewer
|
|
977
977
|
* @param {string} streamId Stream id
|
|
978
978
|
* @param {string} viewerId Viewer id
|
|
979
979
|
* @param {*} [options] Override http request option.
|
|
@@ -982,12 +982,12 @@ var ViewerApiFp = function(configuration) {
|
|
|
982
982
|
async deleteViewer(streamId, viewerId, options) {
|
|
983
983
|
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteViewer(streamId, viewerId, options);
|
|
984
984
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
985
|
-
const localVarOperationServerBasePath = operationServerMap["
|
|
985
|
+
const localVarOperationServerBasePath = operationServerMap["ViewersApi.deleteViewer"]?.[localVarOperationServerIndex]?.url;
|
|
986
986
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
987
987
|
},
|
|
988
988
|
/**
|
|
989
|
-
*
|
|
990
|
-
* @summary
|
|
989
|
+
* Issue a fresh viewer token.
|
|
990
|
+
* @summary Create a viewer token
|
|
991
991
|
* @param {string} roomId ID of the stream.
|
|
992
992
|
* @param {*} [options] Override http request option.
|
|
993
993
|
* @throws {RequiredError}
|
|
@@ -995,45 +995,45 @@ var ViewerApiFp = function(configuration) {
|
|
|
995
995
|
async generateViewerToken(roomId, options) {
|
|
996
996
|
const localVarAxiosArgs = await localVarAxiosParamCreator.generateViewerToken(roomId, options);
|
|
997
997
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
998
|
-
const localVarOperationServerBasePath = operationServerMap["
|
|
998
|
+
const localVarOperationServerBasePath = operationServerMap["ViewersApi.generateViewerToken"]?.[localVarOperationServerIndex]?.url;
|
|
999
999
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
1000
1000
|
}
|
|
1001
1001
|
};
|
|
1002
1002
|
};
|
|
1003
|
-
var
|
|
1003
|
+
var ViewersApi = class extends BaseAPI {
|
|
1004
1004
|
/**
|
|
1005
|
-
*
|
|
1006
|
-
* @summary
|
|
1005
|
+
* Create a viewer for a stream and return its credentials.
|
|
1006
|
+
* @summary Create a viewer
|
|
1007
1007
|
* @param {string} streamId Stream id
|
|
1008
1008
|
* @param {*} [options] Override http request option.
|
|
1009
1009
|
* @throws {RequiredError}
|
|
1010
|
-
* @memberof
|
|
1010
|
+
* @memberof ViewersApi
|
|
1011
1011
|
*/
|
|
1012
1012
|
createViewer(streamId, options) {
|
|
1013
|
-
return
|
|
1013
|
+
return ViewersApiFp(this.configuration).createViewer(streamId, options).then((request) => request(this.axios, this.basePath));
|
|
1014
1014
|
}
|
|
1015
1015
|
/**
|
|
1016
|
-
*
|
|
1017
|
-
* @summary
|
|
1016
|
+
* Delete a viewer from a stream and revoke its token.
|
|
1017
|
+
* @summary Delete a viewer
|
|
1018
1018
|
* @param {string} streamId Stream id
|
|
1019
1019
|
* @param {string} viewerId Viewer id
|
|
1020
1020
|
* @param {*} [options] Override http request option.
|
|
1021
1021
|
* @throws {RequiredError}
|
|
1022
|
-
* @memberof
|
|
1022
|
+
* @memberof ViewersApi
|
|
1023
1023
|
*/
|
|
1024
1024
|
deleteViewer(streamId, viewerId, options) {
|
|
1025
|
-
return
|
|
1025
|
+
return ViewersApiFp(this.configuration).deleteViewer(streamId, viewerId, options).then((request) => request(this.axios, this.basePath));
|
|
1026
1026
|
}
|
|
1027
1027
|
/**
|
|
1028
|
-
*
|
|
1029
|
-
* @summary
|
|
1028
|
+
* Issue a fresh viewer token.
|
|
1029
|
+
* @summary Create a viewer token
|
|
1030
1030
|
* @param {string} roomId ID of the stream.
|
|
1031
1031
|
* @param {*} [options] Override http request option.
|
|
1032
1032
|
* @throws {RequiredError}
|
|
1033
|
-
* @memberof
|
|
1033
|
+
* @memberof ViewersApi
|
|
1034
1034
|
*/
|
|
1035
1035
|
generateViewerToken(roomId, options) {
|
|
1036
|
-
return
|
|
1036
|
+
return ViewersApiFp(this.configuration).generateViewerToken(roomId, options).then((request) => request(this.axios, this.basePath));
|
|
1037
1037
|
}
|
|
1038
1038
|
};
|
|
1039
1039
|
|
|
@@ -1906,6 +1906,14 @@ var Track = {
|
|
|
1906
1906
|
function isSet(value) {
|
|
1907
1907
|
return value !== null && value !== void 0;
|
|
1908
1908
|
}
|
|
1909
|
+
var ServerMessage_PeerType = /* @__PURE__ */ ((ServerMessage_PeerType2) => {
|
|
1910
|
+
ServerMessage_PeerType2[ServerMessage_PeerType2["PEER_TYPE_UNSPECIFIED"] = 0] = "PEER_TYPE_UNSPECIFIED";
|
|
1911
|
+
ServerMessage_PeerType2[ServerMessage_PeerType2["PEER_TYPE_WEBRTC"] = 1] = "PEER_TYPE_WEBRTC";
|
|
1912
|
+
ServerMessage_PeerType2[ServerMessage_PeerType2["PEER_TYPE_AGENT"] = 2] = "PEER_TYPE_AGENT";
|
|
1913
|
+
ServerMessage_PeerType2[ServerMessage_PeerType2["PEER_TYPE_VAPI"] = 3] = "PEER_TYPE_VAPI";
|
|
1914
|
+
ServerMessage_PeerType2[ServerMessage_PeerType2["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
1915
|
+
return ServerMessage_PeerType2;
|
|
1916
|
+
})(ServerMessage_PeerType || {});
|
|
1909
1917
|
function serverMessage_PeerTypeFromJSON(object) {
|
|
1910
1918
|
switch (object) {
|
|
1911
1919
|
case 0:
|
|
@@ -2029,6 +2037,7 @@ function createBaseServerMessage() {
|
|
|
2029
2037
|
viewerDisconnected: void 0,
|
|
2030
2038
|
streamerConnected: void 0,
|
|
2031
2039
|
streamerDisconnected: void 0,
|
|
2040
|
+
notificationBatch: void 0,
|
|
2032
2041
|
streamConnected: void 0,
|
|
2033
2042
|
streamDisconnected: void 0,
|
|
2034
2043
|
hlsPlayable: void 0,
|
|
@@ -2114,6 +2123,9 @@ var ServerMessage = {
|
|
|
2114
2123
|
if (message.streamerDisconnected !== void 0) {
|
|
2115
2124
|
ServerMessage_StreamerDisconnected.encode(message.streamerDisconnected, writer.uint32(218).fork()).join();
|
|
2116
2125
|
}
|
|
2126
|
+
if (message.notificationBatch !== void 0) {
|
|
2127
|
+
ServerMessage_NotificationBatch.encode(message.notificationBatch, writer.uint32(266).fork()).join();
|
|
2128
|
+
}
|
|
2117
2129
|
if (message.streamConnected !== void 0) {
|
|
2118
2130
|
ServerMessage_StreamConnected.encode(message.streamConnected, writer.uint32(178).fork()).join();
|
|
2119
2131
|
}
|
|
@@ -2316,6 +2328,13 @@ var ServerMessage = {
|
|
|
2316
2328
|
message.streamerDisconnected = ServerMessage_StreamerDisconnected.decode(reader, reader.uint32());
|
|
2317
2329
|
continue;
|
|
2318
2330
|
}
|
|
2331
|
+
case 33: {
|
|
2332
|
+
if (tag !== 266) {
|
|
2333
|
+
break;
|
|
2334
|
+
}
|
|
2335
|
+
message.notificationBatch = ServerMessage_NotificationBatch.decode(reader, reader.uint32());
|
|
2336
|
+
continue;
|
|
2337
|
+
}
|
|
2319
2338
|
case 22: {
|
|
2320
2339
|
if (tag !== 178) {
|
|
2321
2340
|
break;
|
|
@@ -2393,6 +2412,7 @@ var ServerMessage = {
|
|
|
2393
2412
|
viewerDisconnected: isSet2(object.viewerDisconnected) ? ServerMessage_ViewerDisconnected.fromJSON(object.viewerDisconnected) : void 0,
|
|
2394
2413
|
streamerConnected: isSet2(object.streamerConnected) ? ServerMessage_StreamerConnected.fromJSON(object.streamerConnected) : void 0,
|
|
2395
2414
|
streamerDisconnected: isSet2(object.streamerDisconnected) ? ServerMessage_StreamerDisconnected.fromJSON(object.streamerDisconnected) : void 0,
|
|
2415
|
+
notificationBatch: isSet2(object.notificationBatch) ? ServerMessage_NotificationBatch.fromJSON(object.notificationBatch) : void 0,
|
|
2396
2416
|
streamConnected: isSet2(object.streamConnected) ? ServerMessage_StreamConnected.fromJSON(object.streamConnected) : void 0,
|
|
2397
2417
|
streamDisconnected: isSet2(object.streamDisconnected) ? ServerMessage_StreamDisconnected.fromJSON(object.streamDisconnected) : void 0,
|
|
2398
2418
|
hlsPlayable: isSet2(object.hlsPlayable) ? ServerMessage_HlsPlayable.fromJSON(object.hlsPlayable) : void 0,
|
|
@@ -2478,6 +2498,9 @@ var ServerMessage = {
|
|
|
2478
2498
|
if (message.streamerDisconnected !== void 0) {
|
|
2479
2499
|
obj.streamerDisconnected = ServerMessage_StreamerDisconnected.toJSON(message.streamerDisconnected);
|
|
2480
2500
|
}
|
|
2501
|
+
if (message.notificationBatch !== void 0) {
|
|
2502
|
+
obj.notificationBatch = ServerMessage_NotificationBatch.toJSON(message.notificationBatch);
|
|
2503
|
+
}
|
|
2481
2504
|
if (message.streamConnected !== void 0) {
|
|
2482
2505
|
obj.streamConnected = ServerMessage_StreamConnected.toJSON(message.streamConnected);
|
|
2483
2506
|
}
|
|
@@ -2528,6 +2551,7 @@ var ServerMessage = {
|
|
|
2528
2551
|
message.viewerDisconnected = object.viewerDisconnected !== void 0 && object.viewerDisconnected !== null ? ServerMessage_ViewerDisconnected.fromPartial(object.viewerDisconnected) : void 0;
|
|
2529
2552
|
message.streamerConnected = object.streamerConnected !== void 0 && object.streamerConnected !== null ? ServerMessage_StreamerConnected.fromPartial(object.streamerConnected) : void 0;
|
|
2530
2553
|
message.streamerDisconnected = object.streamerDisconnected !== void 0 && object.streamerDisconnected !== null ? ServerMessage_StreamerDisconnected.fromPartial(object.streamerDisconnected) : void 0;
|
|
2554
|
+
message.notificationBatch = object.notificationBatch !== void 0 && object.notificationBatch !== null ? ServerMessage_NotificationBatch.fromPartial(object.notificationBatch) : void 0;
|
|
2531
2555
|
message.streamConnected = object.streamConnected !== void 0 && object.streamConnected !== null ? ServerMessage_StreamConnected.fromPartial(object.streamConnected) : void 0;
|
|
2532
2556
|
message.streamDisconnected = object.streamDisconnected !== void 0 && object.streamDisconnected !== null ? ServerMessage_StreamDisconnected.fromPartial(object.streamDisconnected) : void 0;
|
|
2533
2557
|
message.hlsPlayable = object.hlsPlayable !== void 0 && object.hlsPlayable !== null ? ServerMessage_HlsPlayable.fromPartial(object.hlsPlayable) : void 0;
|
|
@@ -4834,6 +4858,59 @@ var ServerMessage_StreamerDisconnected = {
|
|
|
4834
4858
|
return message;
|
|
4835
4859
|
}
|
|
4836
4860
|
};
|
|
4861
|
+
function createBaseServerMessage_NotificationBatch() {
|
|
4862
|
+
return { notifications: [] };
|
|
4863
|
+
}
|
|
4864
|
+
var ServerMessage_NotificationBatch = {
|
|
4865
|
+
encode(message, writer = new BinaryWriter()) {
|
|
4866
|
+
for (const v of message.notifications) {
|
|
4867
|
+
ServerMessage.encode(v, writer.uint32(10).fork()).join();
|
|
4868
|
+
}
|
|
4869
|
+
return writer;
|
|
4870
|
+
},
|
|
4871
|
+
decode(input, length) {
|
|
4872
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
4873
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
4874
|
+
const message = createBaseServerMessage_NotificationBatch();
|
|
4875
|
+
while (reader.pos < end) {
|
|
4876
|
+
const tag = reader.uint32();
|
|
4877
|
+
switch (tag >>> 3) {
|
|
4878
|
+
case 1: {
|
|
4879
|
+
if (tag !== 10) {
|
|
4880
|
+
break;
|
|
4881
|
+
}
|
|
4882
|
+
message.notifications.push(ServerMessage.decode(reader, reader.uint32()));
|
|
4883
|
+
continue;
|
|
4884
|
+
}
|
|
4885
|
+
}
|
|
4886
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
4887
|
+
break;
|
|
4888
|
+
}
|
|
4889
|
+
reader.skip(tag & 7);
|
|
4890
|
+
}
|
|
4891
|
+
return message;
|
|
4892
|
+
},
|
|
4893
|
+
fromJSON(object) {
|
|
4894
|
+
return {
|
|
4895
|
+
notifications: globalThis.Array.isArray(object?.notifications) ? object.notifications.map((e) => ServerMessage.fromJSON(e)) : []
|
|
4896
|
+
};
|
|
4897
|
+
},
|
|
4898
|
+
toJSON(message) {
|
|
4899
|
+
const obj = {};
|
|
4900
|
+
if (message.notifications?.length) {
|
|
4901
|
+
obj.notifications = message.notifications.map((e) => ServerMessage.toJSON(e));
|
|
4902
|
+
}
|
|
4903
|
+
return obj;
|
|
4904
|
+
},
|
|
4905
|
+
create(base) {
|
|
4906
|
+
return ServerMessage_NotificationBatch.fromPartial(base ?? {});
|
|
4907
|
+
},
|
|
4908
|
+
fromPartial(object) {
|
|
4909
|
+
const message = createBaseServerMessage_NotificationBatch();
|
|
4910
|
+
message.notifications = object.notifications?.map((e) => ServerMessage.fromPartial(e)) || [];
|
|
4911
|
+
return message;
|
|
4912
|
+
}
|
|
4913
|
+
};
|
|
4837
4914
|
function isSet2(value) {
|
|
4838
4915
|
return value !== null && value !== void 0;
|
|
4839
4916
|
}
|
|
@@ -5760,7 +5837,20 @@ var getFishjamUrl = (config) => {
|
|
|
5760
5837
|
}
|
|
5761
5838
|
};
|
|
5762
5839
|
|
|
5763
|
-
// src/
|
|
5840
|
+
// src/notifications.ts
|
|
5841
|
+
var peerTypeMap = {
|
|
5842
|
+
[ServerMessage_PeerType.PEER_TYPE_UNSPECIFIED]: "unspecified",
|
|
5843
|
+
[ServerMessage_PeerType.PEER_TYPE_WEBRTC]: "webrtc",
|
|
5844
|
+
[ServerMessage_PeerType.PEER_TYPE_AGENT]: "agent",
|
|
5845
|
+
[ServerMessage_PeerType.PEER_TYPE_VAPI]: "vapi",
|
|
5846
|
+
[ServerMessage_PeerType.UNRECOGNIZED]: "unspecified"
|
|
5847
|
+
};
|
|
5848
|
+
var trackTypeMap = {
|
|
5849
|
+
[TrackType.TRACK_TYPE_UNSPECIFIED]: "unspecified",
|
|
5850
|
+
[TrackType.TRACK_TYPE_VIDEO]: "video",
|
|
5851
|
+
[TrackType.TRACK_TYPE_AUDIO]: "audio",
|
|
5852
|
+
[TrackType.UNRECOGNIZED]: "unspecified"
|
|
5853
|
+
};
|
|
5764
5854
|
var expectedEventsList = [
|
|
5765
5855
|
"roomCreated",
|
|
5766
5856
|
"roomDeleted",
|
|
@@ -5771,14 +5861,39 @@ var expectedEventsList = [
|
|
|
5771
5861
|
"peerDisconnected",
|
|
5772
5862
|
"peerMetadataUpdated",
|
|
5773
5863
|
"peerCrashed",
|
|
5774
|
-
"
|
|
5775
|
-
"
|
|
5864
|
+
"streamerConnected",
|
|
5865
|
+
"streamerDisconnected",
|
|
5776
5866
|
"viewerConnected",
|
|
5777
5867
|
"viewerDisconnected",
|
|
5778
5868
|
"trackAdded",
|
|
5779
5869
|
"trackRemoved",
|
|
5780
|
-
"trackMetadataUpdated"
|
|
5870
|
+
"trackMetadataUpdated",
|
|
5871
|
+
"channelAdded",
|
|
5872
|
+
"channelRemoved"
|
|
5781
5873
|
];
|
|
5874
|
+
var peerEventsWithPeerType = /* @__PURE__ */ new Set([
|
|
5875
|
+
"peerAdded",
|
|
5876
|
+
"peerDeleted",
|
|
5877
|
+
"peerConnected",
|
|
5878
|
+
"peerDisconnected",
|
|
5879
|
+
"peerMetadataUpdated",
|
|
5880
|
+
"peerCrashed"
|
|
5881
|
+
]);
|
|
5882
|
+
var trackEvents = /* @__PURE__ */ new Set(["trackAdded", "trackRemoved", "trackMetadataUpdated"]);
|
|
5883
|
+
var mapTrack = (track) => track && { id: track.id, type: trackTypeMap[track.type], metadata: track.metadata };
|
|
5884
|
+
var mapNotification = (event, msg) => {
|
|
5885
|
+
if (peerEventsWithPeerType.has(event)) {
|
|
5886
|
+
const peerMsg = msg;
|
|
5887
|
+
return { ...peerMsg, peerType: peerTypeMap[peerMsg.peerType] };
|
|
5888
|
+
}
|
|
5889
|
+
if (trackEvents.has(event)) {
|
|
5890
|
+
const trackMsg = msg;
|
|
5891
|
+
return { ...trackMsg, track: mapTrack(trackMsg.track) };
|
|
5892
|
+
}
|
|
5893
|
+
return msg;
|
|
5894
|
+
};
|
|
5895
|
+
|
|
5896
|
+
// src/ws_notifier.ts
|
|
5782
5897
|
var FishjamWSNotifier = class extends import_events.EventEmitter {
|
|
5783
5898
|
client;
|
|
5784
5899
|
constructor(config, onError, onClose) {
|
|
@@ -5798,7 +5913,8 @@ var FishjamWSNotifier = class extends import_events.EventEmitter {
|
|
|
5798
5913
|
const decodedMessage = ServerMessage.decode(data);
|
|
5799
5914
|
const [notification, msg] = Object.entries(decodedMessage).find(([_k, v]) => v);
|
|
5800
5915
|
if (!this.isExpectedEvent(notification)) return;
|
|
5801
|
-
this.emit
|
|
5916
|
+
const emit = this.emit;
|
|
5917
|
+
emit(notification, mapNotification(notification, msg));
|
|
5802
5918
|
} catch (e) {
|
|
5803
5919
|
console.error("Couldn't decode websocket server message", e, message);
|
|
5804
5920
|
}
|
|
@@ -6000,7 +6116,7 @@ var mapException = (error, entity) => {
|
|
|
6000
6116
|
// package.json
|
|
6001
6117
|
var package_default = {
|
|
6002
6118
|
name: "@fishjam-cloud/js-server-sdk",
|
|
6003
|
-
version: "0.27.0
|
|
6119
|
+
version: "0.27.0",
|
|
6004
6120
|
description: "Fishjam server SDK for JavaScript",
|
|
6005
6121
|
homepage: "https://github.com/fishjam-cloud/js-server-sdk",
|
|
6006
6122
|
author: "Fishjam Team",
|
|
@@ -6123,10 +6239,10 @@ var FishjamClient = class {
|
|
|
6123
6239
|
return response;
|
|
6124
6240
|
});
|
|
6125
6241
|
const fishjamUrl = getFishjamUrl(config);
|
|
6126
|
-
this.moqApi = new
|
|
6127
|
-
this.roomApi = new
|
|
6128
|
-
this.viewerApi = new
|
|
6129
|
-
this.streamerApi = new
|
|
6242
|
+
this.moqApi = new MoQApi(void 0, fishjamUrl, client);
|
|
6243
|
+
this.roomApi = new RoomsApi(void 0, fishjamUrl, client);
|
|
6244
|
+
this.viewerApi = new ViewersApi(void 0, fishjamUrl, client);
|
|
6245
|
+
this.streamerApi = new StreamersApi(void 0, fishjamUrl, client);
|
|
6130
6246
|
this.fishjamConfig = config;
|
|
6131
6247
|
}
|
|
6132
6248
|
handleDeprecationHeader(headers) {
|