@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.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
package_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GFB6IWU4.mjs";
|
|
4
4
|
|
|
5
5
|
// ../fishjam-openapi/dist/index.js
|
|
6
6
|
import globalAxios2 from "axios";
|
|
@@ -90,12 +90,12 @@ var VideoCodec = {
|
|
|
90
90
|
H264: "h264",
|
|
91
91
|
Vp8: "vp8"
|
|
92
92
|
};
|
|
93
|
-
var
|
|
93
|
+
var MoQApiAxiosParamCreator = function(configuration) {
|
|
94
94
|
return {
|
|
95
95
|
/**
|
|
96
|
-
*
|
|
97
|
-
* @summary
|
|
98
|
-
* @param {MoqTokenConfig} [moqTokenConfig]
|
|
96
|
+
* Issue a short-lived JWT for a Media over QUIC client.
|
|
97
|
+
* @summary Create a MoQ token
|
|
98
|
+
* @param {MoqTokenConfig} [moqTokenConfig]
|
|
99
99
|
* @param {*} [options] Override http request option.
|
|
100
100
|
* @throws {RequiredError}
|
|
101
101
|
*/
|
|
@@ -122,44 +122,44 @@ var MoqApiAxiosParamCreator = function(configuration) {
|
|
|
122
122
|
}
|
|
123
123
|
};
|
|
124
124
|
};
|
|
125
|
-
var
|
|
126
|
-
const localVarAxiosParamCreator =
|
|
125
|
+
var MoQApiFp = function(configuration) {
|
|
126
|
+
const localVarAxiosParamCreator = MoQApiAxiosParamCreator(configuration);
|
|
127
127
|
return {
|
|
128
128
|
/**
|
|
129
|
-
*
|
|
130
|
-
* @summary
|
|
131
|
-
* @param {MoqTokenConfig} [moqTokenConfig]
|
|
129
|
+
* Issue a short-lived JWT for a Media over QUIC client.
|
|
130
|
+
* @summary Create a MoQ token
|
|
131
|
+
* @param {MoqTokenConfig} [moqTokenConfig]
|
|
132
132
|
* @param {*} [options] Override http request option.
|
|
133
133
|
* @throws {RequiredError}
|
|
134
134
|
*/
|
|
135
135
|
async createMoqToken(moqTokenConfig, options) {
|
|
136
136
|
const localVarAxiosArgs = await localVarAxiosParamCreator.createMoqToken(moqTokenConfig, options);
|
|
137
137
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
138
|
-
const localVarOperationServerBasePath = operationServerMap["
|
|
138
|
+
const localVarOperationServerBasePath = operationServerMap["MoQApi.createMoqToken"]?.[localVarOperationServerIndex]?.url;
|
|
139
139
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
140
140
|
}
|
|
141
141
|
};
|
|
142
142
|
};
|
|
143
|
-
var
|
|
143
|
+
var MoQApi = class extends BaseAPI {
|
|
144
144
|
/**
|
|
145
|
-
*
|
|
146
|
-
* @summary
|
|
147
|
-
* @param {MoqTokenConfig} [moqTokenConfig]
|
|
145
|
+
* Issue a short-lived JWT for a Media over QUIC client.
|
|
146
|
+
* @summary Create a MoQ token
|
|
147
|
+
* @param {MoqTokenConfig} [moqTokenConfig]
|
|
148
148
|
* @param {*} [options] Override http request option.
|
|
149
149
|
* @throws {RequiredError}
|
|
150
|
-
* @memberof
|
|
150
|
+
* @memberof MoQApi
|
|
151
151
|
*/
|
|
152
152
|
createMoqToken(moqTokenConfig, options) {
|
|
153
|
-
return
|
|
153
|
+
return MoQApiFp(this.configuration).createMoqToken(moqTokenConfig, options).then((request) => request(this.axios, this.basePath));
|
|
154
154
|
}
|
|
155
155
|
};
|
|
156
|
-
var
|
|
156
|
+
var RoomsApiAxiosParamCreator = function(configuration) {
|
|
157
157
|
return {
|
|
158
158
|
/**
|
|
159
|
-
*
|
|
160
|
-
* @summary Create peer
|
|
159
|
+
* Add a peer to a room and return its connection token.
|
|
160
|
+
* @summary Create a peer
|
|
161
161
|
* @param {string} roomId Room id
|
|
162
|
-
* @param {PeerConfig} [peerConfig]
|
|
162
|
+
* @param {PeerConfig} [peerConfig]
|
|
163
163
|
* @param {*} [options] Override http request option.
|
|
164
164
|
* @throws {RequiredError}
|
|
165
165
|
*/
|
|
@@ -186,9 +186,9 @@ var RoomApiAxiosParamCreator = function(configuration) {
|
|
|
186
186
|
};
|
|
187
187
|
},
|
|
188
188
|
/**
|
|
189
|
-
*
|
|
190
|
-
* @summary
|
|
191
|
-
* @param {RoomConfig} [roomConfig]
|
|
189
|
+
* Create a new room with the given configuration.
|
|
190
|
+
* @summary Create a room
|
|
191
|
+
* @param {RoomConfig} [roomConfig]
|
|
192
192
|
* @param {*} [options] Override http request option.
|
|
193
193
|
* @throws {RequiredError}
|
|
194
194
|
*/
|
|
@@ -214,8 +214,8 @@ var RoomApiAxiosParamCreator = function(configuration) {
|
|
|
214
214
|
};
|
|
215
215
|
},
|
|
216
216
|
/**
|
|
217
|
-
*
|
|
218
|
-
* @summary Delete peer
|
|
217
|
+
* Remove a peer from a room and disconnect it.
|
|
218
|
+
* @summary Delete a peer
|
|
219
219
|
* @param {string} roomId Room id
|
|
220
220
|
* @param {string} id Peer id
|
|
221
221
|
* @param {*} [options] Override http request option.
|
|
@@ -243,8 +243,8 @@ var RoomApiAxiosParamCreator = function(configuration) {
|
|
|
243
243
|
};
|
|
244
244
|
},
|
|
245
245
|
/**
|
|
246
|
-
*
|
|
247
|
-
* @summary Delete
|
|
246
|
+
* Delete a room by id and disconnect all of its peers.
|
|
247
|
+
* @summary Delete a room
|
|
248
248
|
* @param {string} roomId Room id
|
|
249
249
|
* @param {*} [options] Override http request option.
|
|
250
250
|
* @throws {RequiredError}
|
|
@@ -270,8 +270,8 @@ var RoomApiAxiosParamCreator = function(configuration) {
|
|
|
270
270
|
};
|
|
271
271
|
},
|
|
272
272
|
/**
|
|
273
|
-
*
|
|
274
|
-
* @summary
|
|
273
|
+
* List all rooms and livestreams.
|
|
274
|
+
* @summary List all rooms
|
|
275
275
|
* @param {*} [options] Override http request option.
|
|
276
276
|
* @throws {RequiredError}
|
|
277
277
|
*/
|
|
@@ -295,8 +295,8 @@ var RoomApiAxiosParamCreator = function(configuration) {
|
|
|
295
295
|
};
|
|
296
296
|
},
|
|
297
297
|
/**
|
|
298
|
-
*
|
|
299
|
-
* @summary
|
|
298
|
+
* Get a room by id.
|
|
299
|
+
* @summary Get a room
|
|
300
300
|
* @param {string} roomId Room ID
|
|
301
301
|
* @param {*} [options] Override http request option.
|
|
302
302
|
* @throws {RequiredError}
|
|
@@ -322,8 +322,8 @@ var RoomApiAxiosParamCreator = function(configuration) {
|
|
|
322
322
|
};
|
|
323
323
|
},
|
|
324
324
|
/**
|
|
325
|
-
*
|
|
326
|
-
* @summary Refresh peer token
|
|
325
|
+
* Issue a fresh connection token for an existing peer.
|
|
326
|
+
* @summary Refresh a peer token
|
|
327
327
|
* @param {string} roomId Room id
|
|
328
328
|
* @param {string} id Peer id
|
|
329
329
|
* @param {*} [options] Override http request option.
|
|
@@ -351,8 +351,8 @@ var RoomApiAxiosParamCreator = function(configuration) {
|
|
|
351
351
|
};
|
|
352
352
|
},
|
|
353
353
|
/**
|
|
354
|
-
*
|
|
355
|
-
* @summary Subscribe peer to another peer\'s tracks
|
|
354
|
+
* Subscribe a peer to all current and future tracks published by another peer in the same room.
|
|
355
|
+
* @summary Subscribe a peer to another peer\'s tracks
|
|
356
356
|
* @param {string} roomId Room id
|
|
357
357
|
* @param {string} id Peer id
|
|
358
358
|
* @param {string} [peerId] ID of the peer that produces the track
|
|
@@ -384,8 +384,8 @@ var RoomApiAxiosParamCreator = function(configuration) {
|
|
|
384
384
|
};
|
|
385
385
|
},
|
|
386
386
|
/**
|
|
387
|
-
*
|
|
388
|
-
* @summary Subscribe peer to specific tracks
|
|
387
|
+
* Subscribe a peer to a specific list of track IDs in the same room.
|
|
388
|
+
* @summary Subscribe a peer to specific tracks
|
|
389
389
|
* @param {string} roomId Room id
|
|
390
390
|
* @param {string} id Peer id
|
|
391
391
|
* @param {SubscribeTracksRequest} [subscribeTracksRequest] Track IDs
|
|
@@ -417,39 +417,39 @@ var RoomApiAxiosParamCreator = function(configuration) {
|
|
|
417
417
|
}
|
|
418
418
|
};
|
|
419
419
|
};
|
|
420
|
-
var
|
|
421
|
-
const localVarAxiosParamCreator =
|
|
420
|
+
var RoomsApiFp = function(configuration) {
|
|
421
|
+
const localVarAxiosParamCreator = RoomsApiAxiosParamCreator(configuration);
|
|
422
422
|
return {
|
|
423
423
|
/**
|
|
424
|
-
*
|
|
425
|
-
* @summary Create peer
|
|
424
|
+
* Add a peer to a room and return its connection token.
|
|
425
|
+
* @summary Create a peer
|
|
426
426
|
* @param {string} roomId Room id
|
|
427
|
-
* @param {PeerConfig} [peerConfig]
|
|
427
|
+
* @param {PeerConfig} [peerConfig]
|
|
428
428
|
* @param {*} [options] Override http request option.
|
|
429
429
|
* @throws {RequiredError}
|
|
430
430
|
*/
|
|
431
431
|
async addPeer(roomId, peerConfig, options) {
|
|
432
432
|
const localVarAxiosArgs = await localVarAxiosParamCreator.addPeer(roomId, peerConfig, options);
|
|
433
433
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
434
|
-
const localVarOperationServerBasePath = operationServerMap["
|
|
434
|
+
const localVarOperationServerBasePath = operationServerMap["RoomsApi.addPeer"]?.[localVarOperationServerIndex]?.url;
|
|
435
435
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
436
436
|
},
|
|
437
437
|
/**
|
|
438
|
-
*
|
|
439
|
-
* @summary
|
|
440
|
-
* @param {RoomConfig} [roomConfig]
|
|
438
|
+
* Create a new room with the given configuration.
|
|
439
|
+
* @summary Create a room
|
|
440
|
+
* @param {RoomConfig} [roomConfig]
|
|
441
441
|
* @param {*} [options] Override http request option.
|
|
442
442
|
* @throws {RequiredError}
|
|
443
443
|
*/
|
|
444
444
|
async createRoom(roomConfig, options) {
|
|
445
445
|
const localVarAxiosArgs = await localVarAxiosParamCreator.createRoom(roomConfig, options);
|
|
446
446
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
447
|
-
const localVarOperationServerBasePath = operationServerMap["
|
|
447
|
+
const localVarOperationServerBasePath = operationServerMap["RoomsApi.createRoom"]?.[localVarOperationServerIndex]?.url;
|
|
448
448
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
449
449
|
},
|
|
450
450
|
/**
|
|
451
|
-
*
|
|
452
|
-
* @summary Delete peer
|
|
451
|
+
* Remove a peer from a room and disconnect it.
|
|
452
|
+
* @summary Delete a peer
|
|
453
453
|
* @param {string} roomId Room id
|
|
454
454
|
* @param {string} id Peer id
|
|
455
455
|
* @param {*} [options] Override http request option.
|
|
@@ -458,12 +458,12 @@ var RoomApiFp = function(configuration) {
|
|
|
458
458
|
async deletePeer(roomId, id, options) {
|
|
459
459
|
const localVarAxiosArgs = await localVarAxiosParamCreator.deletePeer(roomId, id, options);
|
|
460
460
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
461
|
-
const localVarOperationServerBasePath = operationServerMap["
|
|
461
|
+
const localVarOperationServerBasePath = operationServerMap["RoomsApi.deletePeer"]?.[localVarOperationServerIndex]?.url;
|
|
462
462
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
463
463
|
},
|
|
464
464
|
/**
|
|
465
|
-
*
|
|
466
|
-
* @summary Delete
|
|
465
|
+
* Delete a room by id and disconnect all of its peers.
|
|
466
|
+
* @summary Delete a room
|
|
467
467
|
* @param {string} roomId Room id
|
|
468
468
|
* @param {*} [options] Override http request option.
|
|
469
469
|
* @throws {RequiredError}
|
|
@@ -471,24 +471,24 @@ var RoomApiFp = function(configuration) {
|
|
|
471
471
|
async deleteRoom(roomId, options) {
|
|
472
472
|
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteRoom(roomId, options);
|
|
473
473
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
474
|
-
const localVarOperationServerBasePath = operationServerMap["
|
|
474
|
+
const localVarOperationServerBasePath = operationServerMap["RoomsApi.deleteRoom"]?.[localVarOperationServerIndex]?.url;
|
|
475
475
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
476
476
|
},
|
|
477
477
|
/**
|
|
478
|
-
*
|
|
479
|
-
* @summary
|
|
478
|
+
* List all rooms and livestreams.
|
|
479
|
+
* @summary List all rooms
|
|
480
480
|
* @param {*} [options] Override http request option.
|
|
481
481
|
* @throws {RequiredError}
|
|
482
482
|
*/
|
|
483
483
|
async getAllRooms(options) {
|
|
484
484
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getAllRooms(options);
|
|
485
485
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
486
|
-
const localVarOperationServerBasePath = operationServerMap["
|
|
486
|
+
const localVarOperationServerBasePath = operationServerMap["RoomsApi.getAllRooms"]?.[localVarOperationServerIndex]?.url;
|
|
487
487
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
488
488
|
},
|
|
489
489
|
/**
|
|
490
|
-
*
|
|
491
|
-
* @summary
|
|
490
|
+
* Get a room by id.
|
|
491
|
+
* @summary Get a room
|
|
492
492
|
* @param {string} roomId Room ID
|
|
493
493
|
* @param {*} [options] Override http request option.
|
|
494
494
|
* @throws {RequiredError}
|
|
@@ -496,12 +496,12 @@ var RoomApiFp = function(configuration) {
|
|
|
496
496
|
async getRoom(roomId, options) {
|
|
497
497
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getRoom(roomId, options);
|
|
498
498
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
499
|
-
const localVarOperationServerBasePath = operationServerMap["
|
|
499
|
+
const localVarOperationServerBasePath = operationServerMap["RoomsApi.getRoom"]?.[localVarOperationServerIndex]?.url;
|
|
500
500
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
501
501
|
},
|
|
502
502
|
/**
|
|
503
|
-
*
|
|
504
|
-
* @summary Refresh peer token
|
|
503
|
+
* Issue a fresh connection token for an existing peer.
|
|
504
|
+
* @summary Refresh a peer token
|
|
505
505
|
* @param {string} roomId Room id
|
|
506
506
|
* @param {string} id Peer id
|
|
507
507
|
* @param {*} [options] Override http request option.
|
|
@@ -510,12 +510,12 @@ var RoomApiFp = function(configuration) {
|
|
|
510
510
|
async refreshToken(roomId, id, options) {
|
|
511
511
|
const localVarAxiosArgs = await localVarAxiosParamCreator.refreshToken(roomId, id, options);
|
|
512
512
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
513
|
-
const localVarOperationServerBasePath = operationServerMap["
|
|
513
|
+
const localVarOperationServerBasePath = operationServerMap["RoomsApi.refreshToken"]?.[localVarOperationServerIndex]?.url;
|
|
514
514
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
515
515
|
},
|
|
516
516
|
/**
|
|
517
|
-
*
|
|
518
|
-
* @summary Subscribe peer to another peer\'s tracks
|
|
517
|
+
* Subscribe a peer to all current and future tracks published by another peer in the same room.
|
|
518
|
+
* @summary Subscribe a peer to another peer\'s tracks
|
|
519
519
|
* @param {string} roomId Room id
|
|
520
520
|
* @param {string} id Peer id
|
|
521
521
|
* @param {string} [peerId] ID of the peer that produces the track
|
|
@@ -525,12 +525,12 @@ var RoomApiFp = function(configuration) {
|
|
|
525
525
|
async subscribePeer(roomId, id, peerId, options) {
|
|
526
526
|
const localVarAxiosArgs = await localVarAxiosParamCreator.subscribePeer(roomId, id, peerId, options);
|
|
527
527
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
528
|
-
const localVarOperationServerBasePath = operationServerMap["
|
|
528
|
+
const localVarOperationServerBasePath = operationServerMap["RoomsApi.subscribePeer"]?.[localVarOperationServerIndex]?.url;
|
|
529
529
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
530
530
|
},
|
|
531
531
|
/**
|
|
532
|
-
*
|
|
533
|
-
* @summary Subscribe peer to specific tracks
|
|
532
|
+
* Subscribe a peer to a specific list of track IDs in the same room.
|
|
533
|
+
* @summary Subscribe a peer to specific tracks
|
|
534
534
|
* @param {string} roomId Room id
|
|
535
535
|
* @param {string} id Peer id
|
|
536
536
|
* @param {SubscribeTracksRequest} [subscribeTracksRequest] Track IDs
|
|
@@ -540,123 +540,123 @@ var RoomApiFp = function(configuration) {
|
|
|
540
540
|
async subscribeTracks(roomId, id, subscribeTracksRequest, options) {
|
|
541
541
|
const localVarAxiosArgs = await localVarAxiosParamCreator.subscribeTracks(roomId, id, subscribeTracksRequest, options);
|
|
542
542
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
543
|
-
const localVarOperationServerBasePath = operationServerMap["
|
|
543
|
+
const localVarOperationServerBasePath = operationServerMap["RoomsApi.subscribeTracks"]?.[localVarOperationServerIndex]?.url;
|
|
544
544
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
545
545
|
}
|
|
546
546
|
};
|
|
547
547
|
};
|
|
548
|
-
var
|
|
548
|
+
var RoomsApi = class extends BaseAPI {
|
|
549
549
|
/**
|
|
550
|
-
*
|
|
551
|
-
* @summary Create peer
|
|
550
|
+
* Add a peer to a room and return its connection token.
|
|
551
|
+
* @summary Create a peer
|
|
552
552
|
* @param {string} roomId Room id
|
|
553
|
-
* @param {PeerConfig} [peerConfig]
|
|
553
|
+
* @param {PeerConfig} [peerConfig]
|
|
554
554
|
* @param {*} [options] Override http request option.
|
|
555
555
|
* @throws {RequiredError}
|
|
556
|
-
* @memberof
|
|
556
|
+
* @memberof RoomsApi
|
|
557
557
|
*/
|
|
558
558
|
addPeer(roomId, peerConfig, options) {
|
|
559
|
-
return
|
|
559
|
+
return RoomsApiFp(this.configuration).addPeer(roomId, peerConfig, options).then((request) => request(this.axios, this.basePath));
|
|
560
560
|
}
|
|
561
561
|
/**
|
|
562
|
-
*
|
|
563
|
-
* @summary
|
|
564
|
-
* @param {RoomConfig} [roomConfig]
|
|
562
|
+
* Create a new room with the given configuration.
|
|
563
|
+
* @summary Create a room
|
|
564
|
+
* @param {RoomConfig} [roomConfig]
|
|
565
565
|
* @param {*} [options] Override http request option.
|
|
566
566
|
* @throws {RequiredError}
|
|
567
|
-
* @memberof
|
|
567
|
+
* @memberof RoomsApi
|
|
568
568
|
*/
|
|
569
569
|
createRoom(roomConfig, options) {
|
|
570
|
-
return
|
|
570
|
+
return RoomsApiFp(this.configuration).createRoom(roomConfig, options).then((request) => request(this.axios, this.basePath));
|
|
571
571
|
}
|
|
572
572
|
/**
|
|
573
|
-
*
|
|
574
|
-
* @summary Delete peer
|
|
573
|
+
* Remove a peer from a room and disconnect it.
|
|
574
|
+
* @summary Delete a peer
|
|
575
575
|
* @param {string} roomId Room id
|
|
576
576
|
* @param {string} id Peer id
|
|
577
577
|
* @param {*} [options] Override http request option.
|
|
578
578
|
* @throws {RequiredError}
|
|
579
|
-
* @memberof
|
|
579
|
+
* @memberof RoomsApi
|
|
580
580
|
*/
|
|
581
581
|
deletePeer(roomId, id, options) {
|
|
582
|
-
return
|
|
582
|
+
return RoomsApiFp(this.configuration).deletePeer(roomId, id, options).then((request) => request(this.axios, this.basePath));
|
|
583
583
|
}
|
|
584
584
|
/**
|
|
585
|
-
*
|
|
586
|
-
* @summary Delete
|
|
585
|
+
* Delete a room by id and disconnect all of its peers.
|
|
586
|
+
* @summary Delete a room
|
|
587
587
|
* @param {string} roomId Room id
|
|
588
588
|
* @param {*} [options] Override http request option.
|
|
589
589
|
* @throws {RequiredError}
|
|
590
|
-
* @memberof
|
|
590
|
+
* @memberof RoomsApi
|
|
591
591
|
*/
|
|
592
592
|
deleteRoom(roomId, options) {
|
|
593
|
-
return
|
|
593
|
+
return RoomsApiFp(this.configuration).deleteRoom(roomId, options).then((request) => request(this.axios, this.basePath));
|
|
594
594
|
}
|
|
595
595
|
/**
|
|
596
|
-
*
|
|
597
|
-
* @summary
|
|
596
|
+
* List all rooms and livestreams.
|
|
597
|
+
* @summary List all rooms
|
|
598
598
|
* @param {*} [options] Override http request option.
|
|
599
599
|
* @throws {RequiredError}
|
|
600
|
-
* @memberof
|
|
600
|
+
* @memberof RoomsApi
|
|
601
601
|
*/
|
|
602
602
|
getAllRooms(options) {
|
|
603
|
-
return
|
|
603
|
+
return RoomsApiFp(this.configuration).getAllRooms(options).then((request) => request(this.axios, this.basePath));
|
|
604
604
|
}
|
|
605
605
|
/**
|
|
606
|
-
*
|
|
607
|
-
* @summary
|
|
606
|
+
* Get a room by id.
|
|
607
|
+
* @summary Get a room
|
|
608
608
|
* @param {string} roomId Room ID
|
|
609
609
|
* @param {*} [options] Override http request option.
|
|
610
610
|
* @throws {RequiredError}
|
|
611
|
-
* @memberof
|
|
611
|
+
* @memberof RoomsApi
|
|
612
612
|
*/
|
|
613
613
|
getRoom(roomId, options) {
|
|
614
|
-
return
|
|
614
|
+
return RoomsApiFp(this.configuration).getRoom(roomId, options).then((request) => request(this.axios, this.basePath));
|
|
615
615
|
}
|
|
616
616
|
/**
|
|
617
|
-
*
|
|
618
|
-
* @summary Refresh peer token
|
|
617
|
+
* Issue a fresh connection token for an existing peer.
|
|
618
|
+
* @summary Refresh a peer token
|
|
619
619
|
* @param {string} roomId Room id
|
|
620
620
|
* @param {string} id Peer id
|
|
621
621
|
* @param {*} [options] Override http request option.
|
|
622
622
|
* @throws {RequiredError}
|
|
623
|
-
* @memberof
|
|
623
|
+
* @memberof RoomsApi
|
|
624
624
|
*/
|
|
625
625
|
refreshToken(roomId, id, options) {
|
|
626
|
-
return
|
|
626
|
+
return RoomsApiFp(this.configuration).refreshToken(roomId, id, options).then((request) => request(this.axios, this.basePath));
|
|
627
627
|
}
|
|
628
628
|
/**
|
|
629
|
-
*
|
|
630
|
-
* @summary Subscribe peer to another peer\'s tracks
|
|
629
|
+
* Subscribe a peer to all current and future tracks published by another peer in the same room.
|
|
630
|
+
* @summary Subscribe a peer to another peer\'s tracks
|
|
631
631
|
* @param {string} roomId Room id
|
|
632
632
|
* @param {string} id Peer id
|
|
633
633
|
* @param {string} [peerId] ID of the peer that produces the track
|
|
634
634
|
* @param {*} [options] Override http request option.
|
|
635
635
|
* @throws {RequiredError}
|
|
636
|
-
* @memberof
|
|
636
|
+
* @memberof RoomsApi
|
|
637
637
|
*/
|
|
638
638
|
subscribePeer(roomId, id, peerId, options) {
|
|
639
|
-
return
|
|
639
|
+
return RoomsApiFp(this.configuration).subscribePeer(roomId, id, peerId, options).then((request) => request(this.axios, this.basePath));
|
|
640
640
|
}
|
|
641
641
|
/**
|
|
642
|
-
*
|
|
643
|
-
* @summary Subscribe peer to specific tracks
|
|
642
|
+
* Subscribe a peer to a specific list of track IDs in the same room.
|
|
643
|
+
* @summary Subscribe a peer to specific tracks
|
|
644
644
|
* @param {string} roomId Room id
|
|
645
645
|
* @param {string} id Peer id
|
|
646
646
|
* @param {SubscribeTracksRequest} [subscribeTracksRequest] Track IDs
|
|
647
647
|
* @param {*} [options] Override http request option.
|
|
648
648
|
* @throws {RequiredError}
|
|
649
|
-
* @memberof
|
|
649
|
+
* @memberof RoomsApi
|
|
650
650
|
*/
|
|
651
651
|
subscribeTracks(roomId, id, subscribeTracksRequest, options) {
|
|
652
|
-
return
|
|
652
|
+
return RoomsApiFp(this.configuration).subscribeTracks(roomId, id, subscribeTracksRequest, options).then((request) => request(this.axios, this.basePath));
|
|
653
653
|
}
|
|
654
654
|
};
|
|
655
|
-
var
|
|
655
|
+
var StreamersApiAxiosParamCreator = function(configuration) {
|
|
656
656
|
return {
|
|
657
657
|
/**
|
|
658
|
-
*
|
|
659
|
-
* @summary
|
|
658
|
+
* Create a streamer for a stream and return its credentials.
|
|
659
|
+
* @summary Create a streamer
|
|
660
660
|
* @param {string} streamId Stream id
|
|
661
661
|
* @param {*} [options] Override http request option.
|
|
662
662
|
* @throws {RequiredError}
|
|
@@ -682,8 +682,8 @@ var StreamerApiAxiosParamCreator = function(configuration) {
|
|
|
682
682
|
};
|
|
683
683
|
},
|
|
684
684
|
/**
|
|
685
|
-
*
|
|
686
|
-
* @summary
|
|
685
|
+
* Delete a streamer from a stream and revoke its token.
|
|
686
|
+
* @summary Delete a streamer
|
|
687
687
|
* @param {string} streamId Stream id
|
|
688
688
|
* @param {string} streamerId Streamer id
|
|
689
689
|
* @param {*} [options] Override http request option.
|
|
@@ -711,8 +711,8 @@ var StreamerApiAxiosParamCreator = function(configuration) {
|
|
|
711
711
|
};
|
|
712
712
|
},
|
|
713
713
|
/**
|
|
714
|
-
*
|
|
715
|
-
* @summary
|
|
714
|
+
* Issue a fresh streamer token.
|
|
715
|
+
* @summary Create a streamer token
|
|
716
716
|
* @param {string} roomId ID of the stream.
|
|
717
717
|
* @param {*} [options] Override http request option.
|
|
718
718
|
* @throws {RequiredError}
|
|
@@ -739,12 +739,12 @@ var StreamerApiAxiosParamCreator = function(configuration) {
|
|
|
739
739
|
}
|
|
740
740
|
};
|
|
741
741
|
};
|
|
742
|
-
var
|
|
743
|
-
const localVarAxiosParamCreator =
|
|
742
|
+
var StreamersApiFp = function(configuration) {
|
|
743
|
+
const localVarAxiosParamCreator = StreamersApiAxiosParamCreator(configuration);
|
|
744
744
|
return {
|
|
745
745
|
/**
|
|
746
|
-
*
|
|
747
|
-
* @summary
|
|
746
|
+
* Create a streamer for a stream and return its credentials.
|
|
747
|
+
* @summary Create a streamer
|
|
748
748
|
* @param {string} streamId Stream id
|
|
749
749
|
* @param {*} [options] Override http request option.
|
|
750
750
|
* @throws {RequiredError}
|
|
@@ -752,12 +752,12 @@ var StreamerApiFp = function(configuration) {
|
|
|
752
752
|
async createStreamer(streamId, options) {
|
|
753
753
|
const localVarAxiosArgs = await localVarAxiosParamCreator.createStreamer(streamId, options);
|
|
754
754
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
755
|
-
const localVarOperationServerBasePath = operationServerMap["
|
|
755
|
+
const localVarOperationServerBasePath = operationServerMap["StreamersApi.createStreamer"]?.[localVarOperationServerIndex]?.url;
|
|
756
756
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
757
757
|
},
|
|
758
758
|
/**
|
|
759
|
-
*
|
|
760
|
-
* @summary
|
|
759
|
+
* Delete a streamer from a stream and revoke its token.
|
|
760
|
+
* @summary Delete a streamer
|
|
761
761
|
* @param {string} streamId Stream id
|
|
762
762
|
* @param {string} streamerId Streamer id
|
|
763
763
|
* @param {*} [options] Override http request option.
|
|
@@ -766,12 +766,12 @@ var StreamerApiFp = function(configuration) {
|
|
|
766
766
|
async deleteStreamer(streamId, streamerId, options) {
|
|
767
767
|
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteStreamer(streamId, streamerId, options);
|
|
768
768
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
769
|
-
const localVarOperationServerBasePath = operationServerMap["
|
|
769
|
+
const localVarOperationServerBasePath = operationServerMap["StreamersApi.deleteStreamer"]?.[localVarOperationServerIndex]?.url;
|
|
770
770
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
771
771
|
},
|
|
772
772
|
/**
|
|
773
|
-
*
|
|
774
|
-
* @summary
|
|
773
|
+
* Issue a fresh streamer token.
|
|
774
|
+
* @summary Create a streamer token
|
|
775
775
|
* @param {string} roomId ID of the stream.
|
|
776
776
|
* @param {*} [options] Override http request option.
|
|
777
777
|
* @throws {RequiredError}
|
|
@@ -779,52 +779,52 @@ var StreamerApiFp = function(configuration) {
|
|
|
779
779
|
async generateStreamerToken(roomId, options) {
|
|
780
780
|
const localVarAxiosArgs = await localVarAxiosParamCreator.generateStreamerToken(roomId, options);
|
|
781
781
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
782
|
-
const localVarOperationServerBasePath = operationServerMap["
|
|
782
|
+
const localVarOperationServerBasePath = operationServerMap["StreamersApi.generateStreamerToken"]?.[localVarOperationServerIndex]?.url;
|
|
783
783
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
784
784
|
}
|
|
785
785
|
};
|
|
786
786
|
};
|
|
787
|
-
var
|
|
787
|
+
var StreamersApi = class extends BaseAPI {
|
|
788
788
|
/**
|
|
789
|
-
*
|
|
790
|
-
* @summary
|
|
789
|
+
* Create a streamer for a stream and return its credentials.
|
|
790
|
+
* @summary Create a streamer
|
|
791
791
|
* @param {string} streamId Stream id
|
|
792
792
|
* @param {*} [options] Override http request option.
|
|
793
793
|
* @throws {RequiredError}
|
|
794
|
-
* @memberof
|
|
794
|
+
* @memberof StreamersApi
|
|
795
795
|
*/
|
|
796
796
|
createStreamer(streamId, options) {
|
|
797
|
-
return
|
|
797
|
+
return StreamersApiFp(this.configuration).createStreamer(streamId, options).then((request) => request(this.axios, this.basePath));
|
|
798
798
|
}
|
|
799
799
|
/**
|
|
800
|
-
*
|
|
801
|
-
* @summary
|
|
800
|
+
* Delete a streamer from a stream and revoke its token.
|
|
801
|
+
* @summary Delete a streamer
|
|
802
802
|
* @param {string} streamId Stream id
|
|
803
803
|
* @param {string} streamerId Streamer id
|
|
804
804
|
* @param {*} [options] Override http request option.
|
|
805
805
|
* @throws {RequiredError}
|
|
806
|
-
* @memberof
|
|
806
|
+
* @memberof StreamersApi
|
|
807
807
|
*/
|
|
808
808
|
deleteStreamer(streamId, streamerId, options) {
|
|
809
|
-
return
|
|
809
|
+
return StreamersApiFp(this.configuration).deleteStreamer(streamId, streamerId, options).then((request) => request(this.axios, this.basePath));
|
|
810
810
|
}
|
|
811
811
|
/**
|
|
812
|
-
*
|
|
813
|
-
* @summary
|
|
812
|
+
* Issue a fresh streamer token.
|
|
813
|
+
* @summary Create a streamer token
|
|
814
814
|
* @param {string} roomId ID of the stream.
|
|
815
815
|
* @param {*} [options] Override http request option.
|
|
816
816
|
* @throws {RequiredError}
|
|
817
|
-
* @memberof
|
|
817
|
+
* @memberof StreamersApi
|
|
818
818
|
*/
|
|
819
819
|
generateStreamerToken(roomId, options) {
|
|
820
|
-
return
|
|
820
|
+
return StreamersApiFp(this.configuration).generateStreamerToken(roomId, options).then((request) => request(this.axios, this.basePath));
|
|
821
821
|
}
|
|
822
822
|
};
|
|
823
|
-
var
|
|
823
|
+
var ViewersApiAxiosParamCreator = function(configuration) {
|
|
824
824
|
return {
|
|
825
825
|
/**
|
|
826
|
-
*
|
|
827
|
-
* @summary
|
|
826
|
+
* Create a viewer for a stream and return its credentials.
|
|
827
|
+
* @summary Create a viewer
|
|
828
828
|
* @param {string} streamId Stream id
|
|
829
829
|
* @param {*} [options] Override http request option.
|
|
830
830
|
* @throws {RequiredError}
|
|
@@ -850,8 +850,8 @@ var ViewerApiAxiosParamCreator = function(configuration) {
|
|
|
850
850
|
};
|
|
851
851
|
},
|
|
852
852
|
/**
|
|
853
|
-
*
|
|
854
|
-
* @summary
|
|
853
|
+
* Delete a viewer from a stream and revoke its token.
|
|
854
|
+
* @summary Delete a viewer
|
|
855
855
|
* @param {string} streamId Stream id
|
|
856
856
|
* @param {string} viewerId Viewer id
|
|
857
857
|
* @param {*} [options] Override http request option.
|
|
@@ -879,8 +879,8 @@ var ViewerApiAxiosParamCreator = function(configuration) {
|
|
|
879
879
|
};
|
|
880
880
|
},
|
|
881
881
|
/**
|
|
882
|
-
*
|
|
883
|
-
* @summary
|
|
882
|
+
* Issue a fresh viewer token.
|
|
883
|
+
* @summary Create a viewer token
|
|
884
884
|
* @param {string} roomId ID of the stream.
|
|
885
885
|
* @param {*} [options] Override http request option.
|
|
886
886
|
* @throws {RequiredError}
|
|
@@ -907,12 +907,12 @@ var ViewerApiAxiosParamCreator = function(configuration) {
|
|
|
907
907
|
}
|
|
908
908
|
};
|
|
909
909
|
};
|
|
910
|
-
var
|
|
911
|
-
const localVarAxiosParamCreator =
|
|
910
|
+
var ViewersApiFp = function(configuration) {
|
|
911
|
+
const localVarAxiosParamCreator = ViewersApiAxiosParamCreator(configuration);
|
|
912
912
|
return {
|
|
913
913
|
/**
|
|
914
|
-
*
|
|
915
|
-
* @summary
|
|
914
|
+
* Create a viewer for a stream and return its credentials.
|
|
915
|
+
* @summary Create a viewer
|
|
916
916
|
* @param {string} streamId Stream id
|
|
917
917
|
* @param {*} [options] Override http request option.
|
|
918
918
|
* @throws {RequiredError}
|
|
@@ -920,12 +920,12 @@ var ViewerApiFp = function(configuration) {
|
|
|
920
920
|
async createViewer(streamId, options) {
|
|
921
921
|
const localVarAxiosArgs = await localVarAxiosParamCreator.createViewer(streamId, options);
|
|
922
922
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
923
|
-
const localVarOperationServerBasePath = operationServerMap["
|
|
923
|
+
const localVarOperationServerBasePath = operationServerMap["ViewersApi.createViewer"]?.[localVarOperationServerIndex]?.url;
|
|
924
924
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
925
925
|
},
|
|
926
926
|
/**
|
|
927
|
-
*
|
|
928
|
-
* @summary
|
|
927
|
+
* Delete a viewer from a stream and revoke its token.
|
|
928
|
+
* @summary Delete a viewer
|
|
929
929
|
* @param {string} streamId Stream id
|
|
930
930
|
* @param {string} viewerId Viewer id
|
|
931
931
|
* @param {*} [options] Override http request option.
|
|
@@ -934,12 +934,12 @@ var ViewerApiFp = function(configuration) {
|
|
|
934
934
|
async deleteViewer(streamId, viewerId, options) {
|
|
935
935
|
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteViewer(streamId, viewerId, options);
|
|
936
936
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
937
|
-
const localVarOperationServerBasePath = operationServerMap["
|
|
937
|
+
const localVarOperationServerBasePath = operationServerMap["ViewersApi.deleteViewer"]?.[localVarOperationServerIndex]?.url;
|
|
938
938
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
939
939
|
},
|
|
940
940
|
/**
|
|
941
|
-
*
|
|
942
|
-
* @summary
|
|
941
|
+
* Issue a fresh viewer token.
|
|
942
|
+
* @summary Create a viewer token
|
|
943
943
|
* @param {string} roomId ID of the stream.
|
|
944
944
|
* @param {*} [options] Override http request option.
|
|
945
945
|
* @throws {RequiredError}
|
|
@@ -947,45 +947,45 @@ var ViewerApiFp = function(configuration) {
|
|
|
947
947
|
async generateViewerToken(roomId, options) {
|
|
948
948
|
const localVarAxiosArgs = await localVarAxiosParamCreator.generateViewerToken(roomId, options);
|
|
949
949
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
950
|
-
const localVarOperationServerBasePath = operationServerMap["
|
|
950
|
+
const localVarOperationServerBasePath = operationServerMap["ViewersApi.generateViewerToken"]?.[localVarOperationServerIndex]?.url;
|
|
951
951
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
952
952
|
}
|
|
953
953
|
};
|
|
954
954
|
};
|
|
955
|
-
var
|
|
955
|
+
var ViewersApi = class extends BaseAPI {
|
|
956
956
|
/**
|
|
957
|
-
*
|
|
958
|
-
* @summary
|
|
957
|
+
* Create a viewer for a stream and return its credentials.
|
|
958
|
+
* @summary Create a viewer
|
|
959
959
|
* @param {string} streamId Stream id
|
|
960
960
|
* @param {*} [options] Override http request option.
|
|
961
961
|
* @throws {RequiredError}
|
|
962
|
-
* @memberof
|
|
962
|
+
* @memberof ViewersApi
|
|
963
963
|
*/
|
|
964
964
|
createViewer(streamId, options) {
|
|
965
|
-
return
|
|
965
|
+
return ViewersApiFp(this.configuration).createViewer(streamId, options).then((request) => request(this.axios, this.basePath));
|
|
966
966
|
}
|
|
967
967
|
/**
|
|
968
|
-
*
|
|
969
|
-
* @summary
|
|
968
|
+
* Delete a viewer from a stream and revoke its token.
|
|
969
|
+
* @summary Delete a viewer
|
|
970
970
|
* @param {string} streamId Stream id
|
|
971
971
|
* @param {string} viewerId Viewer id
|
|
972
972
|
* @param {*} [options] Override http request option.
|
|
973
973
|
* @throws {RequiredError}
|
|
974
|
-
* @memberof
|
|
974
|
+
* @memberof ViewersApi
|
|
975
975
|
*/
|
|
976
976
|
deleteViewer(streamId, viewerId, options) {
|
|
977
|
-
return
|
|
977
|
+
return ViewersApiFp(this.configuration).deleteViewer(streamId, viewerId, options).then((request) => request(this.axios, this.basePath));
|
|
978
978
|
}
|
|
979
979
|
/**
|
|
980
|
-
*
|
|
981
|
-
* @summary
|
|
980
|
+
* Issue a fresh viewer token.
|
|
981
|
+
* @summary Create a viewer token
|
|
982
982
|
* @param {string} roomId ID of the stream.
|
|
983
983
|
* @param {*} [options] Override http request option.
|
|
984
984
|
* @throws {RequiredError}
|
|
985
|
-
* @memberof
|
|
985
|
+
* @memberof ViewersApi
|
|
986
986
|
*/
|
|
987
987
|
generateViewerToken(roomId, options) {
|
|
988
|
-
return
|
|
988
|
+
return ViewersApiFp(this.configuration).generateViewerToken(roomId, options).then((request) => request(this.axios, this.basePath));
|
|
989
989
|
}
|
|
990
990
|
};
|
|
991
991
|
|
|
@@ -1858,6 +1858,14 @@ var Track = {
|
|
|
1858
1858
|
function isSet(value) {
|
|
1859
1859
|
return value !== null && value !== void 0;
|
|
1860
1860
|
}
|
|
1861
|
+
var ServerMessage_PeerType = /* @__PURE__ */ ((ServerMessage_PeerType2) => {
|
|
1862
|
+
ServerMessage_PeerType2[ServerMessage_PeerType2["PEER_TYPE_UNSPECIFIED"] = 0] = "PEER_TYPE_UNSPECIFIED";
|
|
1863
|
+
ServerMessage_PeerType2[ServerMessage_PeerType2["PEER_TYPE_WEBRTC"] = 1] = "PEER_TYPE_WEBRTC";
|
|
1864
|
+
ServerMessage_PeerType2[ServerMessage_PeerType2["PEER_TYPE_AGENT"] = 2] = "PEER_TYPE_AGENT";
|
|
1865
|
+
ServerMessage_PeerType2[ServerMessage_PeerType2["PEER_TYPE_VAPI"] = 3] = "PEER_TYPE_VAPI";
|
|
1866
|
+
ServerMessage_PeerType2[ServerMessage_PeerType2["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
1867
|
+
return ServerMessage_PeerType2;
|
|
1868
|
+
})(ServerMessage_PeerType || {});
|
|
1861
1869
|
function serverMessage_PeerTypeFromJSON(object) {
|
|
1862
1870
|
switch (object) {
|
|
1863
1871
|
case 0:
|
|
@@ -1981,6 +1989,7 @@ function createBaseServerMessage() {
|
|
|
1981
1989
|
viewerDisconnected: void 0,
|
|
1982
1990
|
streamerConnected: void 0,
|
|
1983
1991
|
streamerDisconnected: void 0,
|
|
1992
|
+
notificationBatch: void 0,
|
|
1984
1993
|
streamConnected: void 0,
|
|
1985
1994
|
streamDisconnected: void 0,
|
|
1986
1995
|
hlsPlayable: void 0,
|
|
@@ -2066,6 +2075,9 @@ var ServerMessage = {
|
|
|
2066
2075
|
if (message.streamerDisconnected !== void 0) {
|
|
2067
2076
|
ServerMessage_StreamerDisconnected.encode(message.streamerDisconnected, writer.uint32(218).fork()).join();
|
|
2068
2077
|
}
|
|
2078
|
+
if (message.notificationBatch !== void 0) {
|
|
2079
|
+
ServerMessage_NotificationBatch.encode(message.notificationBatch, writer.uint32(266).fork()).join();
|
|
2080
|
+
}
|
|
2069
2081
|
if (message.streamConnected !== void 0) {
|
|
2070
2082
|
ServerMessage_StreamConnected.encode(message.streamConnected, writer.uint32(178).fork()).join();
|
|
2071
2083
|
}
|
|
@@ -2268,6 +2280,13 @@ var ServerMessage = {
|
|
|
2268
2280
|
message.streamerDisconnected = ServerMessage_StreamerDisconnected.decode(reader, reader.uint32());
|
|
2269
2281
|
continue;
|
|
2270
2282
|
}
|
|
2283
|
+
case 33: {
|
|
2284
|
+
if (tag !== 266) {
|
|
2285
|
+
break;
|
|
2286
|
+
}
|
|
2287
|
+
message.notificationBatch = ServerMessage_NotificationBatch.decode(reader, reader.uint32());
|
|
2288
|
+
continue;
|
|
2289
|
+
}
|
|
2271
2290
|
case 22: {
|
|
2272
2291
|
if (tag !== 178) {
|
|
2273
2292
|
break;
|
|
@@ -2345,6 +2364,7 @@ var ServerMessage = {
|
|
|
2345
2364
|
viewerDisconnected: isSet2(object.viewerDisconnected) ? ServerMessage_ViewerDisconnected.fromJSON(object.viewerDisconnected) : void 0,
|
|
2346
2365
|
streamerConnected: isSet2(object.streamerConnected) ? ServerMessage_StreamerConnected.fromJSON(object.streamerConnected) : void 0,
|
|
2347
2366
|
streamerDisconnected: isSet2(object.streamerDisconnected) ? ServerMessage_StreamerDisconnected.fromJSON(object.streamerDisconnected) : void 0,
|
|
2367
|
+
notificationBatch: isSet2(object.notificationBatch) ? ServerMessage_NotificationBatch.fromJSON(object.notificationBatch) : void 0,
|
|
2348
2368
|
streamConnected: isSet2(object.streamConnected) ? ServerMessage_StreamConnected.fromJSON(object.streamConnected) : void 0,
|
|
2349
2369
|
streamDisconnected: isSet2(object.streamDisconnected) ? ServerMessage_StreamDisconnected.fromJSON(object.streamDisconnected) : void 0,
|
|
2350
2370
|
hlsPlayable: isSet2(object.hlsPlayable) ? ServerMessage_HlsPlayable.fromJSON(object.hlsPlayable) : void 0,
|
|
@@ -2430,6 +2450,9 @@ var ServerMessage = {
|
|
|
2430
2450
|
if (message.streamerDisconnected !== void 0) {
|
|
2431
2451
|
obj.streamerDisconnected = ServerMessage_StreamerDisconnected.toJSON(message.streamerDisconnected);
|
|
2432
2452
|
}
|
|
2453
|
+
if (message.notificationBatch !== void 0) {
|
|
2454
|
+
obj.notificationBatch = ServerMessage_NotificationBatch.toJSON(message.notificationBatch);
|
|
2455
|
+
}
|
|
2433
2456
|
if (message.streamConnected !== void 0) {
|
|
2434
2457
|
obj.streamConnected = ServerMessage_StreamConnected.toJSON(message.streamConnected);
|
|
2435
2458
|
}
|
|
@@ -2480,6 +2503,7 @@ var ServerMessage = {
|
|
|
2480
2503
|
message.viewerDisconnected = object.viewerDisconnected !== void 0 && object.viewerDisconnected !== null ? ServerMessage_ViewerDisconnected.fromPartial(object.viewerDisconnected) : void 0;
|
|
2481
2504
|
message.streamerConnected = object.streamerConnected !== void 0 && object.streamerConnected !== null ? ServerMessage_StreamerConnected.fromPartial(object.streamerConnected) : void 0;
|
|
2482
2505
|
message.streamerDisconnected = object.streamerDisconnected !== void 0 && object.streamerDisconnected !== null ? ServerMessage_StreamerDisconnected.fromPartial(object.streamerDisconnected) : void 0;
|
|
2506
|
+
message.notificationBatch = object.notificationBatch !== void 0 && object.notificationBatch !== null ? ServerMessage_NotificationBatch.fromPartial(object.notificationBatch) : void 0;
|
|
2483
2507
|
message.streamConnected = object.streamConnected !== void 0 && object.streamConnected !== null ? ServerMessage_StreamConnected.fromPartial(object.streamConnected) : void 0;
|
|
2484
2508
|
message.streamDisconnected = object.streamDisconnected !== void 0 && object.streamDisconnected !== null ? ServerMessage_StreamDisconnected.fromPartial(object.streamDisconnected) : void 0;
|
|
2485
2509
|
message.hlsPlayable = object.hlsPlayable !== void 0 && object.hlsPlayable !== null ? ServerMessage_HlsPlayable.fromPartial(object.hlsPlayable) : void 0;
|
|
@@ -4786,6 +4810,59 @@ var ServerMessage_StreamerDisconnected = {
|
|
|
4786
4810
|
return message;
|
|
4787
4811
|
}
|
|
4788
4812
|
};
|
|
4813
|
+
function createBaseServerMessage_NotificationBatch() {
|
|
4814
|
+
return { notifications: [] };
|
|
4815
|
+
}
|
|
4816
|
+
var ServerMessage_NotificationBatch = {
|
|
4817
|
+
encode(message, writer = new BinaryWriter()) {
|
|
4818
|
+
for (const v of message.notifications) {
|
|
4819
|
+
ServerMessage.encode(v, writer.uint32(10).fork()).join();
|
|
4820
|
+
}
|
|
4821
|
+
return writer;
|
|
4822
|
+
},
|
|
4823
|
+
decode(input, length) {
|
|
4824
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
4825
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
4826
|
+
const message = createBaseServerMessage_NotificationBatch();
|
|
4827
|
+
while (reader.pos < end) {
|
|
4828
|
+
const tag = reader.uint32();
|
|
4829
|
+
switch (tag >>> 3) {
|
|
4830
|
+
case 1: {
|
|
4831
|
+
if (tag !== 10) {
|
|
4832
|
+
break;
|
|
4833
|
+
}
|
|
4834
|
+
message.notifications.push(ServerMessage.decode(reader, reader.uint32()));
|
|
4835
|
+
continue;
|
|
4836
|
+
}
|
|
4837
|
+
}
|
|
4838
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
4839
|
+
break;
|
|
4840
|
+
}
|
|
4841
|
+
reader.skip(tag & 7);
|
|
4842
|
+
}
|
|
4843
|
+
return message;
|
|
4844
|
+
},
|
|
4845
|
+
fromJSON(object) {
|
|
4846
|
+
return {
|
|
4847
|
+
notifications: globalThis.Array.isArray(object?.notifications) ? object.notifications.map((e) => ServerMessage.fromJSON(e)) : []
|
|
4848
|
+
};
|
|
4849
|
+
},
|
|
4850
|
+
toJSON(message) {
|
|
4851
|
+
const obj = {};
|
|
4852
|
+
if (message.notifications?.length) {
|
|
4853
|
+
obj.notifications = message.notifications.map((e) => ServerMessage.toJSON(e));
|
|
4854
|
+
}
|
|
4855
|
+
return obj;
|
|
4856
|
+
},
|
|
4857
|
+
create(base) {
|
|
4858
|
+
return ServerMessage_NotificationBatch.fromPartial(base ?? {});
|
|
4859
|
+
},
|
|
4860
|
+
fromPartial(object) {
|
|
4861
|
+
const message = createBaseServerMessage_NotificationBatch();
|
|
4862
|
+
message.notifications = object.notifications?.map((e) => ServerMessage.fromPartial(e)) || [];
|
|
4863
|
+
return message;
|
|
4864
|
+
}
|
|
4865
|
+
};
|
|
4789
4866
|
function isSet2(value) {
|
|
4790
4867
|
return value !== null && value !== void 0;
|
|
4791
4868
|
}
|
|
@@ -5712,7 +5789,20 @@ var getFishjamUrl = (config) => {
|
|
|
5712
5789
|
}
|
|
5713
5790
|
};
|
|
5714
5791
|
|
|
5715
|
-
// src/
|
|
5792
|
+
// src/notifications.ts
|
|
5793
|
+
var peerTypeMap = {
|
|
5794
|
+
[ServerMessage_PeerType.PEER_TYPE_UNSPECIFIED]: "unspecified",
|
|
5795
|
+
[ServerMessage_PeerType.PEER_TYPE_WEBRTC]: "webrtc",
|
|
5796
|
+
[ServerMessage_PeerType.PEER_TYPE_AGENT]: "agent",
|
|
5797
|
+
[ServerMessage_PeerType.PEER_TYPE_VAPI]: "vapi",
|
|
5798
|
+
[ServerMessage_PeerType.UNRECOGNIZED]: "unspecified"
|
|
5799
|
+
};
|
|
5800
|
+
var trackTypeMap = {
|
|
5801
|
+
[TrackType.TRACK_TYPE_UNSPECIFIED]: "unspecified",
|
|
5802
|
+
[TrackType.TRACK_TYPE_VIDEO]: "video",
|
|
5803
|
+
[TrackType.TRACK_TYPE_AUDIO]: "audio",
|
|
5804
|
+
[TrackType.UNRECOGNIZED]: "unspecified"
|
|
5805
|
+
};
|
|
5716
5806
|
var expectedEventsList = [
|
|
5717
5807
|
"roomCreated",
|
|
5718
5808
|
"roomDeleted",
|
|
@@ -5723,14 +5813,39 @@ var expectedEventsList = [
|
|
|
5723
5813
|
"peerDisconnected",
|
|
5724
5814
|
"peerMetadataUpdated",
|
|
5725
5815
|
"peerCrashed",
|
|
5726
|
-
"
|
|
5727
|
-
"
|
|
5816
|
+
"streamerConnected",
|
|
5817
|
+
"streamerDisconnected",
|
|
5728
5818
|
"viewerConnected",
|
|
5729
5819
|
"viewerDisconnected",
|
|
5730
5820
|
"trackAdded",
|
|
5731
5821
|
"trackRemoved",
|
|
5732
|
-
"trackMetadataUpdated"
|
|
5822
|
+
"trackMetadataUpdated",
|
|
5823
|
+
"channelAdded",
|
|
5824
|
+
"channelRemoved"
|
|
5733
5825
|
];
|
|
5826
|
+
var peerEventsWithPeerType = /* @__PURE__ */ new Set([
|
|
5827
|
+
"peerAdded",
|
|
5828
|
+
"peerDeleted",
|
|
5829
|
+
"peerConnected",
|
|
5830
|
+
"peerDisconnected",
|
|
5831
|
+
"peerMetadataUpdated",
|
|
5832
|
+
"peerCrashed"
|
|
5833
|
+
]);
|
|
5834
|
+
var trackEvents = /* @__PURE__ */ new Set(["trackAdded", "trackRemoved", "trackMetadataUpdated"]);
|
|
5835
|
+
var mapTrack = (track) => track && { id: track.id, type: trackTypeMap[track.type], metadata: track.metadata };
|
|
5836
|
+
var mapNotification = (event, msg) => {
|
|
5837
|
+
if (peerEventsWithPeerType.has(event)) {
|
|
5838
|
+
const peerMsg = msg;
|
|
5839
|
+
return { ...peerMsg, peerType: peerTypeMap[peerMsg.peerType] };
|
|
5840
|
+
}
|
|
5841
|
+
if (trackEvents.has(event)) {
|
|
5842
|
+
const trackMsg = msg;
|
|
5843
|
+
return { ...trackMsg, track: mapTrack(trackMsg.track) };
|
|
5844
|
+
}
|
|
5845
|
+
return msg;
|
|
5846
|
+
};
|
|
5847
|
+
|
|
5848
|
+
// src/ws_notifier.ts
|
|
5734
5849
|
var FishjamWSNotifier = class extends EventEmitter {
|
|
5735
5850
|
client;
|
|
5736
5851
|
constructor(config, onError, onClose) {
|
|
@@ -5750,7 +5865,8 @@ var FishjamWSNotifier = class extends EventEmitter {
|
|
|
5750
5865
|
const decodedMessage = ServerMessage.decode(data);
|
|
5751
5866
|
const [notification, msg] = Object.entries(decodedMessage).find(([_k, v]) => v);
|
|
5752
5867
|
if (!this.isExpectedEvent(notification)) return;
|
|
5753
|
-
this.emit
|
|
5868
|
+
const emit = this.emit;
|
|
5869
|
+
emit(notification, mapNotification(notification, msg));
|
|
5754
5870
|
} catch (e) {
|
|
5755
5871
|
console.error("Couldn't decode websocket server message", e, message);
|
|
5756
5872
|
}
|
|
@@ -5980,10 +6096,10 @@ var FishjamClient = class {
|
|
|
5980
6096
|
return response;
|
|
5981
6097
|
});
|
|
5982
6098
|
const fishjamUrl = getFishjamUrl(config);
|
|
5983
|
-
this.moqApi = new
|
|
5984
|
-
this.roomApi = new
|
|
5985
|
-
this.viewerApi = new
|
|
5986
|
-
this.streamerApi = new
|
|
6099
|
+
this.moqApi = new MoQApi(void 0, fishjamUrl, client);
|
|
6100
|
+
this.roomApi = new RoomsApi(void 0, fishjamUrl, client);
|
|
6101
|
+
this.viewerApi = new ViewersApi(void 0, fishjamUrl, client);
|
|
6102
|
+
this.streamerApi = new StreamersApi(void 0, fishjamUrl, client);
|
|
5987
6103
|
this.fishjamConfig = config;
|
|
5988
6104
|
}
|
|
5989
6105
|
handleDeprecationHeader(headers) {
|