@fishjam-cloud/js-server-sdk 0.28.0-rc.0 → 0.28.1
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-GERVP75S.mjs → chunk-GTNIELH6.mjs} +2 -3
- package/dist/index.d.mts +100 -55
- package/dist/index.d.ts +100 -55
- package/dist/index.js +70 -160
- package/dist/index.mjs +67 -157
- package/dist/integrations/gemini.js +2 -3
- package/dist/integrations/gemini.mjs +1 -1
- package/package.json +4 -5
package/dist/index.js
CHANGED
|
@@ -48,7 +48,8 @@ __export(index_exports, {
|
|
|
48
48
|
ServiceUnavailableException: () => ServiceUnavailableException,
|
|
49
49
|
UnauthorizedException: () => UnauthorizedException,
|
|
50
50
|
UnknownException: () => UnknownException,
|
|
51
|
-
VideoCodec: () => VideoCodec
|
|
51
|
+
VideoCodec: () => VideoCodec,
|
|
52
|
+
decodeServerNotifications: () => decodeServerNotifications
|
|
52
53
|
});
|
|
53
54
|
module.exports = __toCommonJS(index_exports);
|
|
54
55
|
|
|
@@ -182,12 +183,7 @@ var CredentialsApiFp = function(configuration) {
|
|
|
182
183
|
const localVarAxiosArgs = await localVarAxiosParamCreator.validateCredentials(options);
|
|
183
184
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
184
185
|
const localVarOperationServerBasePath = operationServerMap["CredentialsApi.validateCredentials"]?.[localVarOperationServerIndex]?.url;
|
|
185
|
-
return (axios2, basePath) => createRequestFunction(
|
|
186
|
-
localVarAxiosArgs,
|
|
187
|
-
import_axios.default,
|
|
188
|
-
BASE_PATH,
|
|
189
|
-
configuration
|
|
190
|
-
)(axios2, localVarOperationServerBasePath || basePath);
|
|
186
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
191
187
|
}
|
|
192
188
|
};
|
|
193
189
|
};
|
|
@@ -207,13 +203,13 @@ var MoQApiAxiosParamCreator = function(configuration) {
|
|
|
207
203
|
return {
|
|
208
204
|
/**
|
|
209
205
|
* Issue a short-lived JWT for a Media over QUIC client.
|
|
210
|
-
* @summary Create
|
|
211
|
-
* @param {
|
|
206
|
+
* @summary Create MoQ access
|
|
207
|
+
* @param {MoqAccessConfig} [moqAccessConfig]
|
|
212
208
|
* @param {*} [options] Override http request option.
|
|
213
209
|
* @throws {RequiredError}
|
|
214
210
|
*/
|
|
215
|
-
|
|
216
|
-
const localVarPath = `/moq/
|
|
211
|
+
createMoqAccess: async (moqAccessConfig, options = {}) => {
|
|
212
|
+
const localVarPath = `/moq/access`;
|
|
217
213
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
218
214
|
let baseOptions;
|
|
219
215
|
if (configuration) {
|
|
@@ -227,7 +223,7 @@ var MoQApiAxiosParamCreator = function(configuration) {
|
|
|
227
223
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
228
224
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
229
225
|
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
230
|
-
localVarRequestOptions.data = serializeDataIfNeeded(
|
|
226
|
+
localVarRequestOptions.data = serializeDataIfNeeded(moqAccessConfig, localVarRequestOptions, configuration);
|
|
231
227
|
return {
|
|
232
228
|
url: toPathString(localVarUrlObj),
|
|
233
229
|
options: localVarRequestOptions
|
|
@@ -240,35 +236,30 @@ var MoQApiFp = function(configuration) {
|
|
|
240
236
|
return {
|
|
241
237
|
/**
|
|
242
238
|
* Issue a short-lived JWT for a Media over QUIC client.
|
|
243
|
-
* @summary Create
|
|
244
|
-
* @param {
|
|
239
|
+
* @summary Create MoQ access
|
|
240
|
+
* @param {MoqAccessConfig} [moqAccessConfig]
|
|
245
241
|
* @param {*} [options] Override http request option.
|
|
246
242
|
* @throws {RequiredError}
|
|
247
243
|
*/
|
|
248
|
-
async
|
|
249
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.
|
|
244
|
+
async createMoqAccess(moqAccessConfig, options) {
|
|
245
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.createMoqAccess(moqAccessConfig, options);
|
|
250
246
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
251
|
-
const localVarOperationServerBasePath = operationServerMap["MoQApi.
|
|
252
|
-
return (axios2, basePath) => createRequestFunction(
|
|
253
|
-
localVarAxiosArgs,
|
|
254
|
-
import_axios.default,
|
|
255
|
-
BASE_PATH,
|
|
256
|
-
configuration
|
|
257
|
-
)(axios2, localVarOperationServerBasePath || basePath);
|
|
247
|
+
const localVarOperationServerBasePath = operationServerMap["MoQApi.createMoqAccess"]?.[localVarOperationServerIndex]?.url;
|
|
248
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
258
249
|
}
|
|
259
250
|
};
|
|
260
251
|
};
|
|
261
252
|
var MoQApi = class extends BaseAPI {
|
|
262
253
|
/**
|
|
263
254
|
* Issue a short-lived JWT for a Media over QUIC client.
|
|
264
|
-
* @summary Create
|
|
265
|
-
* @param {
|
|
255
|
+
* @summary Create MoQ access
|
|
256
|
+
* @param {MoqAccessConfig} [moqAccessConfig]
|
|
266
257
|
* @param {*} [options] Override http request option.
|
|
267
258
|
* @throws {RequiredError}
|
|
268
259
|
* @memberof MoQApi
|
|
269
260
|
*/
|
|
270
|
-
|
|
271
|
-
return MoQApiFp(this.configuration).
|
|
261
|
+
createMoqAccess(moqAccessConfig, options) {
|
|
262
|
+
return MoQApiFp(this.configuration).createMoqAccess(moqAccessConfig, options).then((request) => request(this.axios, this.basePath));
|
|
272
263
|
}
|
|
273
264
|
};
|
|
274
265
|
var RoomsApiAxiosParamCreator = function(configuration) {
|
|
@@ -277,7 +268,7 @@ var RoomsApiAxiosParamCreator = function(configuration) {
|
|
|
277
268
|
* Add a peer to a room and return its connection token.
|
|
278
269
|
* @summary Create a peer
|
|
279
270
|
* @param {string} roomId Room id
|
|
280
|
-
* @param {PeerConfig} [peerConfig]
|
|
271
|
+
* @param {PeerConfig} [peerConfig]
|
|
281
272
|
* @param {*} [options] Override http request option.
|
|
282
273
|
* @throws {RequiredError}
|
|
283
274
|
*/
|
|
@@ -306,7 +297,7 @@ var RoomsApiAxiosParamCreator = function(configuration) {
|
|
|
306
297
|
/**
|
|
307
298
|
* Create a new room with the given configuration.
|
|
308
299
|
* @summary Create a room
|
|
309
|
-
* @param {RoomConfig} [roomConfig]
|
|
300
|
+
* @param {RoomConfig} [roomConfig]
|
|
310
301
|
* @param {*} [options] Override http request option.
|
|
311
302
|
* @throws {RequiredError}
|
|
312
303
|
*/
|
|
@@ -527,11 +518,7 @@ var RoomsApiAxiosParamCreator = function(configuration) {
|
|
|
527
518
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
528
519
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
529
520
|
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
530
|
-
localVarRequestOptions.data = serializeDataIfNeeded(
|
|
531
|
-
subscribeTracksRequest,
|
|
532
|
-
localVarRequestOptions,
|
|
533
|
-
configuration
|
|
534
|
-
);
|
|
521
|
+
localVarRequestOptions.data = serializeDataIfNeeded(subscribeTracksRequest, localVarRequestOptions, configuration);
|
|
535
522
|
return {
|
|
536
523
|
url: toPathString(localVarUrlObj),
|
|
537
524
|
options: localVarRequestOptions
|
|
@@ -546,7 +533,7 @@ var RoomsApiFp = function(configuration) {
|
|
|
546
533
|
* Add a peer to a room and return its connection token.
|
|
547
534
|
* @summary Create a peer
|
|
548
535
|
* @param {string} roomId Room id
|
|
549
|
-
* @param {PeerConfig} [peerConfig]
|
|
536
|
+
* @param {PeerConfig} [peerConfig]
|
|
550
537
|
* @param {*} [options] Override http request option.
|
|
551
538
|
* @throws {RequiredError}
|
|
552
539
|
*/
|
|
@@ -554,17 +541,12 @@ var RoomsApiFp = function(configuration) {
|
|
|
554
541
|
const localVarAxiosArgs = await localVarAxiosParamCreator.addPeer(roomId, peerConfig, options);
|
|
555
542
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
556
543
|
const localVarOperationServerBasePath = operationServerMap["RoomsApi.addPeer"]?.[localVarOperationServerIndex]?.url;
|
|
557
|
-
return (axios2, basePath) => createRequestFunction(
|
|
558
|
-
localVarAxiosArgs,
|
|
559
|
-
import_axios.default,
|
|
560
|
-
BASE_PATH,
|
|
561
|
-
configuration
|
|
562
|
-
)(axios2, localVarOperationServerBasePath || basePath);
|
|
544
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
563
545
|
},
|
|
564
546
|
/**
|
|
565
547
|
* Create a new room with the given configuration.
|
|
566
548
|
* @summary Create a room
|
|
567
|
-
* @param {RoomConfig} [roomConfig]
|
|
549
|
+
* @param {RoomConfig} [roomConfig]
|
|
568
550
|
* @param {*} [options] Override http request option.
|
|
569
551
|
* @throws {RequiredError}
|
|
570
552
|
*/
|
|
@@ -572,12 +554,7 @@ var RoomsApiFp = function(configuration) {
|
|
|
572
554
|
const localVarAxiosArgs = await localVarAxiosParamCreator.createRoom(roomConfig, options);
|
|
573
555
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
574
556
|
const localVarOperationServerBasePath = operationServerMap["RoomsApi.createRoom"]?.[localVarOperationServerIndex]?.url;
|
|
575
|
-
return (axios2, basePath) => createRequestFunction(
|
|
576
|
-
localVarAxiosArgs,
|
|
577
|
-
import_axios.default,
|
|
578
|
-
BASE_PATH,
|
|
579
|
-
configuration
|
|
580
|
-
)(axios2, localVarOperationServerBasePath || basePath);
|
|
557
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
581
558
|
},
|
|
582
559
|
/**
|
|
583
560
|
* Remove a peer from a room and disconnect it.
|
|
@@ -591,12 +568,7 @@ var RoomsApiFp = function(configuration) {
|
|
|
591
568
|
const localVarAxiosArgs = await localVarAxiosParamCreator.deletePeer(roomId, id, options);
|
|
592
569
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
593
570
|
const localVarOperationServerBasePath = operationServerMap["RoomsApi.deletePeer"]?.[localVarOperationServerIndex]?.url;
|
|
594
|
-
return (axios2, basePath) => createRequestFunction(
|
|
595
|
-
localVarAxiosArgs,
|
|
596
|
-
import_axios.default,
|
|
597
|
-
BASE_PATH,
|
|
598
|
-
configuration
|
|
599
|
-
)(axios2, localVarOperationServerBasePath || basePath);
|
|
571
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
600
572
|
},
|
|
601
573
|
/**
|
|
602
574
|
* Delete a room by id and disconnect all of its peers.
|
|
@@ -609,12 +581,7 @@ var RoomsApiFp = function(configuration) {
|
|
|
609
581
|
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteRoom(roomId, options);
|
|
610
582
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
611
583
|
const localVarOperationServerBasePath = operationServerMap["RoomsApi.deleteRoom"]?.[localVarOperationServerIndex]?.url;
|
|
612
|
-
return (axios2, basePath) => createRequestFunction(
|
|
613
|
-
localVarAxiosArgs,
|
|
614
|
-
import_axios.default,
|
|
615
|
-
BASE_PATH,
|
|
616
|
-
configuration
|
|
617
|
-
)(axios2, localVarOperationServerBasePath || basePath);
|
|
584
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
618
585
|
},
|
|
619
586
|
/**
|
|
620
587
|
* List all rooms and livestreams.
|
|
@@ -626,12 +593,7 @@ var RoomsApiFp = function(configuration) {
|
|
|
626
593
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getAllRooms(options);
|
|
627
594
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
628
595
|
const localVarOperationServerBasePath = operationServerMap["RoomsApi.getAllRooms"]?.[localVarOperationServerIndex]?.url;
|
|
629
|
-
return (axios2, basePath) => createRequestFunction(
|
|
630
|
-
localVarAxiosArgs,
|
|
631
|
-
import_axios.default,
|
|
632
|
-
BASE_PATH,
|
|
633
|
-
configuration
|
|
634
|
-
)(axios2, localVarOperationServerBasePath || basePath);
|
|
596
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
635
597
|
},
|
|
636
598
|
/**
|
|
637
599
|
* Get a room by id.
|
|
@@ -644,12 +606,7 @@ var RoomsApiFp = function(configuration) {
|
|
|
644
606
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getRoom(roomId, options);
|
|
645
607
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
646
608
|
const localVarOperationServerBasePath = operationServerMap["RoomsApi.getRoom"]?.[localVarOperationServerIndex]?.url;
|
|
647
|
-
return (axios2, basePath) => createRequestFunction(
|
|
648
|
-
localVarAxiosArgs,
|
|
649
|
-
import_axios.default,
|
|
650
|
-
BASE_PATH,
|
|
651
|
-
configuration
|
|
652
|
-
)(axios2, localVarOperationServerBasePath || basePath);
|
|
609
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
653
610
|
},
|
|
654
611
|
/**
|
|
655
612
|
* Issue a fresh connection token for an existing peer.
|
|
@@ -663,12 +620,7 @@ var RoomsApiFp = function(configuration) {
|
|
|
663
620
|
const localVarAxiosArgs = await localVarAxiosParamCreator.refreshToken(roomId, id, options);
|
|
664
621
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
665
622
|
const localVarOperationServerBasePath = operationServerMap["RoomsApi.refreshToken"]?.[localVarOperationServerIndex]?.url;
|
|
666
|
-
return (axios2, basePath) => createRequestFunction(
|
|
667
|
-
localVarAxiosArgs,
|
|
668
|
-
import_axios.default,
|
|
669
|
-
BASE_PATH,
|
|
670
|
-
configuration
|
|
671
|
-
)(axios2, localVarOperationServerBasePath || basePath);
|
|
623
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
672
624
|
},
|
|
673
625
|
/**
|
|
674
626
|
* Subscribe a peer to all current and future tracks published by another peer in the same room.
|
|
@@ -683,12 +635,7 @@ var RoomsApiFp = function(configuration) {
|
|
|
683
635
|
const localVarAxiosArgs = await localVarAxiosParamCreator.subscribePeer(roomId, id, peerId, options);
|
|
684
636
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
685
637
|
const localVarOperationServerBasePath = operationServerMap["RoomsApi.subscribePeer"]?.[localVarOperationServerIndex]?.url;
|
|
686
|
-
return (axios2, basePath) => createRequestFunction(
|
|
687
|
-
localVarAxiosArgs,
|
|
688
|
-
import_axios.default,
|
|
689
|
-
BASE_PATH,
|
|
690
|
-
configuration
|
|
691
|
-
)(axios2, localVarOperationServerBasePath || basePath);
|
|
638
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
692
639
|
},
|
|
693
640
|
/**
|
|
694
641
|
* Subscribe a peer to a specific list of track IDs in the same room.
|
|
@@ -700,20 +647,10 @@ var RoomsApiFp = function(configuration) {
|
|
|
700
647
|
* @throws {RequiredError}
|
|
701
648
|
*/
|
|
702
649
|
async subscribeTracks(roomId, id, subscribeTracksRequest, options) {
|
|
703
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.subscribeTracks(
|
|
704
|
-
roomId,
|
|
705
|
-
id,
|
|
706
|
-
subscribeTracksRequest,
|
|
707
|
-
options
|
|
708
|
-
);
|
|
650
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.subscribeTracks(roomId, id, subscribeTracksRequest, options);
|
|
709
651
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
710
652
|
const localVarOperationServerBasePath = operationServerMap["RoomsApi.subscribeTracks"]?.[localVarOperationServerIndex]?.url;
|
|
711
|
-
return (axios2, basePath) => createRequestFunction(
|
|
712
|
-
localVarAxiosArgs,
|
|
713
|
-
import_axios.default,
|
|
714
|
-
BASE_PATH,
|
|
715
|
-
configuration
|
|
716
|
-
)(axios2, localVarOperationServerBasePath || basePath);
|
|
653
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
717
654
|
}
|
|
718
655
|
};
|
|
719
656
|
};
|
|
@@ -722,7 +659,7 @@ var RoomsApi = class extends BaseAPI {
|
|
|
722
659
|
* Add a peer to a room and return its connection token.
|
|
723
660
|
* @summary Create a peer
|
|
724
661
|
* @param {string} roomId Room id
|
|
725
|
-
* @param {PeerConfig} [peerConfig]
|
|
662
|
+
* @param {PeerConfig} [peerConfig]
|
|
726
663
|
* @param {*} [options] Override http request option.
|
|
727
664
|
* @throws {RequiredError}
|
|
728
665
|
* @memberof RoomsApi
|
|
@@ -733,7 +670,7 @@ var RoomsApi = class extends BaseAPI {
|
|
|
733
670
|
/**
|
|
734
671
|
* Create a new room with the given configuration.
|
|
735
672
|
* @summary Create a room
|
|
736
|
-
* @param {RoomConfig} [roomConfig]
|
|
673
|
+
* @param {RoomConfig} [roomConfig]
|
|
737
674
|
* @param {*} [options] Override http request option.
|
|
738
675
|
* @throws {RequiredError}
|
|
739
676
|
* @memberof RoomsApi
|
|
@@ -835,10 +772,7 @@ var StreamersApiAxiosParamCreator = function(configuration) {
|
|
|
835
772
|
*/
|
|
836
773
|
createStreamer: async (streamId, options = {}) => {
|
|
837
774
|
assertParamExists("createStreamer", "streamId", streamId);
|
|
838
|
-
const localVarPath = `/livestream/{stream_id}/streamer`.replace(
|
|
839
|
-
`{${"stream_id"}}`,
|
|
840
|
-
encodeURIComponent(String(streamId))
|
|
841
|
-
);
|
|
775
|
+
const localVarPath = `/livestream/{stream_id}/streamer`.replace(`{${"stream_id"}}`, encodeURIComponent(String(streamId)));
|
|
842
776
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
843
777
|
let baseOptions;
|
|
844
778
|
if (configuration) {
|
|
@@ -928,12 +862,7 @@ var StreamersApiFp = function(configuration) {
|
|
|
928
862
|
const localVarAxiosArgs = await localVarAxiosParamCreator.createStreamer(streamId, options);
|
|
929
863
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
930
864
|
const localVarOperationServerBasePath = operationServerMap["StreamersApi.createStreamer"]?.[localVarOperationServerIndex]?.url;
|
|
931
|
-
return (axios2, basePath) => createRequestFunction(
|
|
932
|
-
localVarAxiosArgs,
|
|
933
|
-
import_axios.default,
|
|
934
|
-
BASE_PATH,
|
|
935
|
-
configuration
|
|
936
|
-
)(axios2, localVarOperationServerBasePath || basePath);
|
|
865
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
937
866
|
},
|
|
938
867
|
/**
|
|
939
868
|
* Delete a streamer from a stream and revoke its token.
|
|
@@ -947,12 +876,7 @@ var StreamersApiFp = function(configuration) {
|
|
|
947
876
|
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteStreamer(streamId, streamerId, options);
|
|
948
877
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
949
878
|
const localVarOperationServerBasePath = operationServerMap["StreamersApi.deleteStreamer"]?.[localVarOperationServerIndex]?.url;
|
|
950
|
-
return (axios2, basePath) => createRequestFunction(
|
|
951
|
-
localVarAxiosArgs,
|
|
952
|
-
import_axios.default,
|
|
953
|
-
BASE_PATH,
|
|
954
|
-
configuration
|
|
955
|
-
)(axios2, localVarOperationServerBasePath || basePath);
|
|
879
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
956
880
|
},
|
|
957
881
|
/**
|
|
958
882
|
* Issue a fresh streamer token.
|
|
@@ -965,12 +889,7 @@ var StreamersApiFp = function(configuration) {
|
|
|
965
889
|
const localVarAxiosArgs = await localVarAxiosParamCreator.generateStreamerToken(roomId, options);
|
|
966
890
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
967
891
|
const localVarOperationServerBasePath = operationServerMap["StreamersApi.generateStreamerToken"]?.[localVarOperationServerIndex]?.url;
|
|
968
|
-
return (axios2, basePath) => createRequestFunction(
|
|
969
|
-
localVarAxiosArgs,
|
|
970
|
-
import_axios.default,
|
|
971
|
-
BASE_PATH,
|
|
972
|
-
configuration
|
|
973
|
-
)(axios2, localVarOperationServerBasePath || basePath);
|
|
892
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
974
893
|
}
|
|
975
894
|
};
|
|
976
895
|
};
|
|
@@ -1021,10 +940,7 @@ var ViewersApiAxiosParamCreator = function(configuration) {
|
|
|
1021
940
|
*/
|
|
1022
941
|
createViewer: async (streamId, options = {}) => {
|
|
1023
942
|
assertParamExists("createViewer", "streamId", streamId);
|
|
1024
|
-
const localVarPath = `/livestream/{stream_id}/viewer`.replace(
|
|
1025
|
-
`{${"stream_id"}}`,
|
|
1026
|
-
encodeURIComponent(String(streamId))
|
|
1027
|
-
);
|
|
943
|
+
const localVarPath = `/livestream/{stream_id}/viewer`.replace(`{${"stream_id"}}`, encodeURIComponent(String(streamId)));
|
|
1028
944
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
1029
945
|
let baseOptions;
|
|
1030
946
|
if (configuration) {
|
|
@@ -1114,12 +1030,7 @@ var ViewersApiFp = function(configuration) {
|
|
|
1114
1030
|
const localVarAxiosArgs = await localVarAxiosParamCreator.createViewer(streamId, options);
|
|
1115
1031
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
1116
1032
|
const localVarOperationServerBasePath = operationServerMap["ViewersApi.createViewer"]?.[localVarOperationServerIndex]?.url;
|
|
1117
|
-
return (axios2, basePath) => createRequestFunction(
|
|
1118
|
-
localVarAxiosArgs,
|
|
1119
|
-
import_axios.default,
|
|
1120
|
-
BASE_PATH,
|
|
1121
|
-
configuration
|
|
1122
|
-
)(axios2, localVarOperationServerBasePath || basePath);
|
|
1033
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
1123
1034
|
},
|
|
1124
1035
|
/**
|
|
1125
1036
|
* Delete a viewer from a stream and revoke its token.
|
|
@@ -1133,12 +1044,7 @@ var ViewersApiFp = function(configuration) {
|
|
|
1133
1044
|
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteViewer(streamId, viewerId, options);
|
|
1134
1045
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
1135
1046
|
const localVarOperationServerBasePath = operationServerMap["ViewersApi.deleteViewer"]?.[localVarOperationServerIndex]?.url;
|
|
1136
|
-
return (axios2, basePath) => createRequestFunction(
|
|
1137
|
-
localVarAxiosArgs,
|
|
1138
|
-
import_axios.default,
|
|
1139
|
-
BASE_PATH,
|
|
1140
|
-
configuration
|
|
1141
|
-
)(axios2, localVarOperationServerBasePath || basePath);
|
|
1047
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
1142
1048
|
},
|
|
1143
1049
|
/**
|
|
1144
1050
|
* Issue a fresh viewer token.
|
|
@@ -1151,12 +1057,7 @@ var ViewersApiFp = function(configuration) {
|
|
|
1151
1057
|
const localVarAxiosArgs = await localVarAxiosParamCreator.generateViewerToken(roomId, options);
|
|
1152
1058
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
1153
1059
|
const localVarOperationServerBasePath = operationServerMap["ViewersApi.generateViewerToken"]?.[localVarOperationServerIndex]?.url;
|
|
1154
|
-
return (axios2, basePath) => createRequestFunction(
|
|
1155
|
-
localVarAxiosArgs,
|
|
1156
|
-
import_axios.default,
|
|
1157
|
-
BASE_PATH,
|
|
1158
|
-
configuration
|
|
1159
|
-
)(axios2, localVarOperationServerBasePath || basePath);
|
|
1060
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
1160
1061
|
}
|
|
1161
1062
|
};
|
|
1162
1063
|
};
|
|
@@ -6056,6 +5957,16 @@ var mapNotification = (event, msg) => {
|
|
|
6056
5957
|
}
|
|
6057
5958
|
return msg;
|
|
6058
5959
|
};
|
|
5960
|
+
var isExpectedEvent = (event) => expectedEventsList.includes(event);
|
|
5961
|
+
var flattenServerMessage = (message) => message.notificationBatch?.notifications ?? [message];
|
|
5962
|
+
var toServerNotification = (message) => {
|
|
5963
|
+
const entry = Object.entries(message).find(([, value]) => value);
|
|
5964
|
+
if (!entry) return null;
|
|
5965
|
+
const [event, msg] = entry;
|
|
5966
|
+
if (!isExpectedEvent(event)) return null;
|
|
5967
|
+
return { type: event, notification: mapNotification(event, msg) };
|
|
5968
|
+
};
|
|
5969
|
+
var extractNotifications = (message) => flattenServerMessage(message).map(toServerNotification).filter((notification) => notification !== null);
|
|
6059
5970
|
|
|
6060
5971
|
// src/ws_notifier.ts
|
|
6061
5972
|
var FishjamWSNotifier = class extends import_events.EventEmitter {
|
|
@@ -6073,12 +5984,11 @@ var FishjamWSNotifier = class extends import_events.EventEmitter {
|
|
|
6073
5984
|
}
|
|
6074
5985
|
dispatchNotification(message) {
|
|
6075
5986
|
try {
|
|
6076
|
-
const
|
|
6077
|
-
const
|
|
6078
|
-
const
|
|
6079
|
-
|
|
6080
|
-
|
|
6081
|
-
emit(notification, mapNotification(notification, msg));
|
|
5987
|
+
const decodedMessage = ServerMessage.decode(new Uint8Array(message.data));
|
|
5988
|
+
const emit = this.emit.bind(this);
|
|
5989
|
+
for (const { type, notification } of extractNotifications(decodedMessage)) {
|
|
5990
|
+
emit(type, notification);
|
|
5991
|
+
}
|
|
6082
5992
|
} catch (e) {
|
|
6083
5993
|
console.error("Couldn't decode websocket server message", e, message);
|
|
6084
5994
|
}
|
|
@@ -6091,11 +6001,11 @@ var FishjamWSNotifier = class extends import_events.EventEmitter {
|
|
|
6091
6001
|
this.client.send(auth);
|
|
6092
6002
|
this.client.send(subscription);
|
|
6093
6003
|
}
|
|
6094
|
-
isExpectedEvent(notification) {
|
|
6095
|
-
return expectedEventsList.includes(notification);
|
|
6096
|
-
}
|
|
6097
6004
|
};
|
|
6098
6005
|
|
|
6006
|
+
// src/webhook.ts
|
|
6007
|
+
var decodeServerNotifications = (data) => extractNotifications(ServerMessage.decode(data instanceof Uint8Array ? data : new Uint8Array(data)));
|
|
6008
|
+
|
|
6099
6009
|
// src/agent.ts
|
|
6100
6010
|
var import_events2 = require("events");
|
|
6101
6011
|
var import_uuid = require("uuid");
|
|
@@ -6285,7 +6195,7 @@ var mapException = (error, entity) => {
|
|
|
6285
6195
|
// package.json
|
|
6286
6196
|
var package_default = {
|
|
6287
6197
|
name: "@fishjam-cloud/js-server-sdk",
|
|
6288
|
-
version: "0.28.
|
|
6198
|
+
version: "0.28.1",
|
|
6289
6199
|
description: "Fishjam server SDK for JavaScript",
|
|
6290
6200
|
homepage: "https://github.com/fishjam-cloud/js-server-sdk",
|
|
6291
6201
|
author: "Fishjam Team",
|
|
@@ -6374,8 +6284,7 @@ var package_default = {
|
|
|
6374
6284
|
"*.{js,ts,tsx,mjs,cjs}": [
|
|
6375
6285
|
"eslint --fix --config eslint.config.mjs"
|
|
6376
6286
|
]
|
|
6377
|
-
}
|
|
6378
|
-
stableVersion: "0.27.0"
|
|
6287
|
+
}
|
|
6379
6288
|
};
|
|
6380
6289
|
|
|
6381
6290
|
// src/client.ts
|
|
@@ -6639,13 +6548,13 @@ var FishjamClient = class _FishjamClient {
|
|
|
6639
6548
|
}
|
|
6640
6549
|
}
|
|
6641
6550
|
/**
|
|
6642
|
-
* Creates
|
|
6643
|
-
* @returns a
|
|
6551
|
+
* Creates MoQ access.
|
|
6552
|
+
* @returns connection details containing the relay URL with the JWT embedded as a `?jwt=` query parameter, and the token itself
|
|
6644
6553
|
*/
|
|
6645
|
-
async
|
|
6554
|
+
async createMoqAccess(config) {
|
|
6646
6555
|
try {
|
|
6647
|
-
const
|
|
6648
|
-
return
|
|
6556
|
+
const accessResponse = await this.moqApi.createMoqAccess(config);
|
|
6557
|
+
return accessResponse.data;
|
|
6649
6558
|
} catch (error) {
|
|
6650
6559
|
throw mapException(error);
|
|
6651
6560
|
}
|
|
@@ -6671,5 +6580,6 @@ var FishjamClient = class _FishjamClient {
|
|
|
6671
6580
|
ServiceUnavailableException,
|
|
6672
6581
|
UnauthorizedException,
|
|
6673
6582
|
UnknownException,
|
|
6674
|
-
VideoCodec
|
|
6583
|
+
VideoCodec,
|
|
6584
|
+
decodeServerNotifications
|
|
6675
6585
|
});
|