@fishjam-cloud/js-server-sdk 0.26.0 → 0.27.0-rc.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-ASJFPK3O.mjs → chunk-B3H63SYI.mjs} +5 -3
- package/dist/index.d.mts +39 -1
- package/dist/index.d.ts +39 -1
- package/dist/index.js +82 -3
- package/dist/index.mjs +78 -1
- package/dist/integrations/gemini.js +5 -3
- package/dist/integrations/gemini.mjs +1 -1
- package/package.json +8 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// package.json
|
|
2
2
|
var package_default = {
|
|
3
3
|
name: "@fishjam-cloud/js-server-sdk",
|
|
4
|
-
version: "0.
|
|
4
|
+
version: "0.27.0-rc.1",
|
|
5
5
|
description: "Fishjam server SDK for JavaScript",
|
|
6
6
|
homepage: "https://github.com/fishjam-cloud/js-server-sdk",
|
|
7
7
|
author: "Fishjam Team",
|
|
@@ -42,7 +42,8 @@ var package_default = {
|
|
|
42
42
|
"format:check": "prettier --check .",
|
|
43
43
|
typecheck: "tsc --noEmit",
|
|
44
44
|
lint: "eslint . --fix",
|
|
45
|
-
"lint:check": "eslint .
|
|
45
|
+
"lint:check": "eslint .",
|
|
46
|
+
test: "vitest run"
|
|
46
47
|
},
|
|
47
48
|
tsup: {
|
|
48
49
|
entry: [
|
|
@@ -82,7 +83,8 @@ var package_default = {
|
|
|
82
83
|
eslint: "^9.33.0",
|
|
83
84
|
prettier: "^3.6.2",
|
|
84
85
|
tsup: "^8.4.0",
|
|
85
|
-
"typed-emitter": "^2.1.0"
|
|
86
|
+
"typed-emitter": "^2.1.0",
|
|
87
|
+
vitest: "^3.0.0"
|
|
86
88
|
},
|
|
87
89
|
"lint-staged": {
|
|
88
90
|
"*.{js,ts,tsx,mjs,cjs}": [
|
package/dist/index.d.mts
CHANGED
|
@@ -39,6 +39,38 @@ declare const AudioSampleRate: {
|
|
|
39
39
|
readonly NUMBER_24000: 24000;
|
|
40
40
|
};
|
|
41
41
|
type AudioSampleRate = typeof AudioSampleRate[keyof typeof AudioSampleRate];
|
|
42
|
+
/**
|
|
43
|
+
* Token for authorizing a MoQ relay connection
|
|
44
|
+
* @export
|
|
45
|
+
* @interface MoqToken
|
|
46
|
+
*/
|
|
47
|
+
interface MoqToken {
|
|
48
|
+
/**
|
|
49
|
+
* JWT token for MoQ relay
|
|
50
|
+
* @type {string}
|
|
51
|
+
* @memberof MoqToken
|
|
52
|
+
*/
|
|
53
|
+
'token': string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* MoQ token configuration
|
|
57
|
+
* @export
|
|
58
|
+
* @interface MoqTokenConfig
|
|
59
|
+
*/
|
|
60
|
+
interface MoqTokenConfig {
|
|
61
|
+
/**
|
|
62
|
+
* Path under the root the token grants publish access to
|
|
63
|
+
* @type {string}
|
|
64
|
+
* @memberof MoqTokenConfig
|
|
65
|
+
*/
|
|
66
|
+
'publishPath'?: string | null;
|
|
67
|
+
/**
|
|
68
|
+
* Path under the root the token grants subscribe access to
|
|
69
|
+
* @type {string}
|
|
70
|
+
* @memberof MoqTokenConfig
|
|
71
|
+
*/
|
|
72
|
+
'subscribePath'?: string | null;
|
|
73
|
+
}
|
|
42
74
|
/**
|
|
43
75
|
* Describes peer status
|
|
44
76
|
* @export
|
|
@@ -909,6 +941,7 @@ declare class FishjamAgent extends FishjamAgent_base {
|
|
|
909
941
|
* @category Client
|
|
910
942
|
*/
|
|
911
943
|
declare class FishjamClient {
|
|
944
|
+
private readonly moqApi;
|
|
912
945
|
private readonly roomApi;
|
|
913
946
|
private readonly viewerApi;
|
|
914
947
|
private readonly streamerApi;
|
|
@@ -993,6 +1026,11 @@ declare class FishjamClient {
|
|
|
993
1026
|
* @returns a livestream streamer token
|
|
994
1027
|
*/
|
|
995
1028
|
createLivestreamStreamerToken(roomId: RoomId): Promise<StreamerToken>;
|
|
1029
|
+
/**
|
|
1030
|
+
* Creates a MoQ token.
|
|
1031
|
+
* @returns a MoQ token
|
|
1032
|
+
*/
|
|
1033
|
+
createMoqToken(config?: MoqTokenConfig): Promise<MoqToken>;
|
|
996
1034
|
}
|
|
997
1035
|
|
|
998
1036
|
declare class MissingFishjamIdException extends Error {
|
|
@@ -1021,4 +1059,4 @@ declare class ServiceUnavailableException extends FishjamBaseException {
|
|
|
1021
1059
|
declare class UnknownException extends FishjamBaseException {
|
|
1022
1060
|
}
|
|
1023
1061
|
|
|
1024
|
-
export { type AgentCallbacks, type AgentEvents, type AgentTrack, type AudioCodecParameters, BadRequestException, type Brand, type CloseEventHandler, type ErrorEventHandler, type ExpectedAgentEvents, type ExpectedEvents, FishjamAgent, FishjamBaseException, FishjamClient, type FishjamConfig, FishjamNotFoundException, FishjamWSNotifier, ForbiddenException, type IncomingTrackData, type IncomingTrackImage, MissingFishjamIdException, type NotificationEvents, type OutgoingTrackData, type Peer, type PeerAdded, type PeerConnected, type PeerCrashed, type PeerDeleted, type PeerDisconnected, type PeerId, type PeerMetadataUpdated, PeerNotFoundException, type PeerOptions, type PeerOptionsAgent, type PeerOptionsVapi, type PeerOptionsWebRTC, PeerStatus, type Room, type RoomConfig, type RoomCrashed, type RoomCreated, type RoomDeleted, type RoomId, RoomNotFoundException, RoomType, ServerMessage, ServiceUnavailableException, type StreamConnected, type StreamDisconnected, type StreamerToken, type TrackAdded, type TrackId, type TrackMetadataUpdated, type TrackRemoved, type TrackType, UnauthorizedException, UnknownException, VideoCodec, type ViewerConnected, type ViewerDisconnected, type ViewerToken };
|
|
1062
|
+
export { type AgentCallbacks, type AgentEvents, type AgentTrack, type AudioCodecParameters, BadRequestException, type Brand, type CloseEventHandler, type ErrorEventHandler, type ExpectedAgentEvents, type ExpectedEvents, FishjamAgent, FishjamBaseException, FishjamClient, type FishjamConfig, FishjamNotFoundException, FishjamWSNotifier, ForbiddenException, type IncomingTrackData, type IncomingTrackImage, MissingFishjamIdException, type MoqToken, type MoqTokenConfig, type NotificationEvents, type OutgoingTrackData, type Peer, type PeerAdded, type PeerConnected, type PeerCrashed, type PeerDeleted, type PeerDisconnected, type PeerId, type PeerMetadataUpdated, PeerNotFoundException, type PeerOptions, type PeerOptionsAgent, type PeerOptionsVapi, type PeerOptionsWebRTC, PeerStatus, type Room, type RoomConfig, type RoomCrashed, type RoomCreated, type RoomDeleted, type RoomId, RoomNotFoundException, RoomType, ServerMessage, ServiceUnavailableException, type StreamConnected, type StreamDisconnected, type StreamerToken, type TrackAdded, type TrackId, type TrackMetadataUpdated, type TrackRemoved, type TrackType, UnauthorizedException, UnknownException, VideoCodec, type ViewerConnected, type ViewerDisconnected, type ViewerToken };
|
package/dist/index.d.ts
CHANGED
|
@@ -39,6 +39,38 @@ declare const AudioSampleRate: {
|
|
|
39
39
|
readonly NUMBER_24000: 24000;
|
|
40
40
|
};
|
|
41
41
|
type AudioSampleRate = typeof AudioSampleRate[keyof typeof AudioSampleRate];
|
|
42
|
+
/**
|
|
43
|
+
* Token for authorizing a MoQ relay connection
|
|
44
|
+
* @export
|
|
45
|
+
* @interface MoqToken
|
|
46
|
+
*/
|
|
47
|
+
interface MoqToken {
|
|
48
|
+
/**
|
|
49
|
+
* JWT token for MoQ relay
|
|
50
|
+
* @type {string}
|
|
51
|
+
* @memberof MoqToken
|
|
52
|
+
*/
|
|
53
|
+
'token': string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* MoQ token configuration
|
|
57
|
+
* @export
|
|
58
|
+
* @interface MoqTokenConfig
|
|
59
|
+
*/
|
|
60
|
+
interface MoqTokenConfig {
|
|
61
|
+
/**
|
|
62
|
+
* Path under the root the token grants publish access to
|
|
63
|
+
* @type {string}
|
|
64
|
+
* @memberof MoqTokenConfig
|
|
65
|
+
*/
|
|
66
|
+
'publishPath'?: string | null;
|
|
67
|
+
/**
|
|
68
|
+
* Path under the root the token grants subscribe access to
|
|
69
|
+
* @type {string}
|
|
70
|
+
* @memberof MoqTokenConfig
|
|
71
|
+
*/
|
|
72
|
+
'subscribePath'?: string | null;
|
|
73
|
+
}
|
|
42
74
|
/**
|
|
43
75
|
* Describes peer status
|
|
44
76
|
* @export
|
|
@@ -909,6 +941,7 @@ declare class FishjamAgent extends FishjamAgent_base {
|
|
|
909
941
|
* @category Client
|
|
910
942
|
*/
|
|
911
943
|
declare class FishjamClient {
|
|
944
|
+
private readonly moqApi;
|
|
912
945
|
private readonly roomApi;
|
|
913
946
|
private readonly viewerApi;
|
|
914
947
|
private readonly streamerApi;
|
|
@@ -993,6 +1026,11 @@ declare class FishjamClient {
|
|
|
993
1026
|
* @returns a livestream streamer token
|
|
994
1027
|
*/
|
|
995
1028
|
createLivestreamStreamerToken(roomId: RoomId): Promise<StreamerToken>;
|
|
1029
|
+
/**
|
|
1030
|
+
* Creates a MoQ token.
|
|
1031
|
+
* @returns a MoQ token
|
|
1032
|
+
*/
|
|
1033
|
+
createMoqToken(config?: MoqTokenConfig): Promise<MoqToken>;
|
|
996
1034
|
}
|
|
997
1035
|
|
|
998
1036
|
declare class MissingFishjamIdException extends Error {
|
|
@@ -1021,4 +1059,4 @@ declare class ServiceUnavailableException extends FishjamBaseException {
|
|
|
1021
1059
|
declare class UnknownException extends FishjamBaseException {
|
|
1022
1060
|
}
|
|
1023
1061
|
|
|
1024
|
-
export { type AgentCallbacks, type AgentEvents, type AgentTrack, type AudioCodecParameters, BadRequestException, type Brand, type CloseEventHandler, type ErrorEventHandler, type ExpectedAgentEvents, type ExpectedEvents, FishjamAgent, FishjamBaseException, FishjamClient, type FishjamConfig, FishjamNotFoundException, FishjamWSNotifier, ForbiddenException, type IncomingTrackData, type IncomingTrackImage, MissingFishjamIdException, type NotificationEvents, type OutgoingTrackData, type Peer, type PeerAdded, type PeerConnected, type PeerCrashed, type PeerDeleted, type PeerDisconnected, type PeerId, type PeerMetadataUpdated, PeerNotFoundException, type PeerOptions, type PeerOptionsAgent, type PeerOptionsVapi, type PeerOptionsWebRTC, PeerStatus, type Room, type RoomConfig, type RoomCrashed, type RoomCreated, type RoomDeleted, type RoomId, RoomNotFoundException, RoomType, ServerMessage, ServiceUnavailableException, type StreamConnected, type StreamDisconnected, type StreamerToken, type TrackAdded, type TrackId, type TrackMetadataUpdated, type TrackRemoved, type TrackType, UnauthorizedException, UnknownException, VideoCodec, type ViewerConnected, type ViewerDisconnected, type ViewerToken };
|
|
1062
|
+
export { type AgentCallbacks, type AgentEvents, type AgentTrack, type AudioCodecParameters, BadRequestException, type Brand, type CloseEventHandler, type ErrorEventHandler, type ExpectedAgentEvents, type ExpectedEvents, FishjamAgent, FishjamBaseException, FishjamClient, type FishjamConfig, FishjamNotFoundException, FishjamWSNotifier, ForbiddenException, type IncomingTrackData, type IncomingTrackImage, MissingFishjamIdException, type MoqToken, type MoqTokenConfig, type NotificationEvents, type OutgoingTrackData, type Peer, type PeerAdded, type PeerConnected, type PeerCrashed, type PeerDeleted, type PeerDisconnected, type PeerId, type PeerMetadataUpdated, PeerNotFoundException, type PeerOptions, type PeerOptionsAgent, type PeerOptionsVapi, type PeerOptionsWebRTC, PeerStatus, type Room, type RoomConfig, type RoomCrashed, type RoomCreated, type RoomDeleted, type RoomId, RoomNotFoundException, RoomType, ServerMessage, ServiceUnavailableException, type StreamConnected, type StreamDisconnected, type StreamerToken, type TrackAdded, type TrackId, type TrackMetadataUpdated, type TrackRemoved, type TrackType, UnauthorizedException, UnknownException, VideoCodec, type ViewerConnected, type ViewerDisconnected, type ViewerToken };
|
package/dist/index.js
CHANGED
|
@@ -138,6 +138,69 @@ var VideoCodec = {
|
|
|
138
138
|
H264: "h264",
|
|
139
139
|
Vp8: "vp8"
|
|
140
140
|
};
|
|
141
|
+
var MoqApiAxiosParamCreator = function(configuration) {
|
|
142
|
+
return {
|
|
143
|
+
/**
|
|
144
|
+
*
|
|
145
|
+
* @summary Creates a MoQ token for the given stream
|
|
146
|
+
* @param {MoqTokenConfig} [moqTokenConfig] Token configuration
|
|
147
|
+
* @param {*} [options] Override http request option.
|
|
148
|
+
* @throws {RequiredError}
|
|
149
|
+
*/
|
|
150
|
+
createMoqToken: async (moqTokenConfig, options = {}) => {
|
|
151
|
+
const localVarPath = `/moq/token`;
|
|
152
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
153
|
+
let baseOptions;
|
|
154
|
+
if (configuration) {
|
|
155
|
+
baseOptions = configuration.baseOptions;
|
|
156
|
+
}
|
|
157
|
+
const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
|
|
158
|
+
const localVarHeaderParameter = {};
|
|
159
|
+
const localVarQueryParameter = {};
|
|
160
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
161
|
+
localVarHeaderParameter["Content-Type"] = "application/json";
|
|
162
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
163
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
164
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
165
|
+
localVarRequestOptions.data = serializeDataIfNeeded(moqTokenConfig, localVarRequestOptions, configuration);
|
|
166
|
+
return {
|
|
167
|
+
url: toPathString(localVarUrlObj),
|
|
168
|
+
options: localVarRequestOptions
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
var MoqApiFp = function(configuration) {
|
|
174
|
+
const localVarAxiosParamCreator = MoqApiAxiosParamCreator(configuration);
|
|
175
|
+
return {
|
|
176
|
+
/**
|
|
177
|
+
*
|
|
178
|
+
* @summary Creates a MoQ token for the given stream
|
|
179
|
+
* @param {MoqTokenConfig} [moqTokenConfig] Token configuration
|
|
180
|
+
* @param {*} [options] Override http request option.
|
|
181
|
+
* @throws {RequiredError}
|
|
182
|
+
*/
|
|
183
|
+
async createMoqToken(moqTokenConfig, options) {
|
|
184
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.createMoqToken(moqTokenConfig, options);
|
|
185
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
186
|
+
const localVarOperationServerBasePath = operationServerMap["MoqApi.createMoqToken"]?.[localVarOperationServerIndex]?.url;
|
|
187
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
var MoqApi = class extends BaseAPI {
|
|
192
|
+
/**
|
|
193
|
+
*
|
|
194
|
+
* @summary Creates a MoQ token for the given stream
|
|
195
|
+
* @param {MoqTokenConfig} [moqTokenConfig] Token configuration
|
|
196
|
+
* @param {*} [options] Override http request option.
|
|
197
|
+
* @throws {RequiredError}
|
|
198
|
+
* @memberof MoqApi
|
|
199
|
+
*/
|
|
200
|
+
createMoqToken(moqTokenConfig, options) {
|
|
201
|
+
return MoqApiFp(this.configuration).createMoqToken(moqTokenConfig, options).then((request) => request(this.axios, this.basePath));
|
|
202
|
+
}
|
|
203
|
+
};
|
|
141
204
|
var RoomApiAxiosParamCreator = function(configuration) {
|
|
142
205
|
return {
|
|
143
206
|
/**
|
|
@@ -5937,7 +6000,7 @@ var mapException = (error, entity) => {
|
|
|
5937
6000
|
// package.json
|
|
5938
6001
|
var package_default = {
|
|
5939
6002
|
name: "@fishjam-cloud/js-server-sdk",
|
|
5940
|
-
version: "0.
|
|
6003
|
+
version: "0.27.0-rc.1",
|
|
5941
6004
|
description: "Fishjam server SDK for JavaScript",
|
|
5942
6005
|
homepage: "https://github.com/fishjam-cloud/js-server-sdk",
|
|
5943
6006
|
author: "Fishjam Team",
|
|
@@ -5978,7 +6041,8 @@ var package_default = {
|
|
|
5978
6041
|
"format:check": "prettier --check .",
|
|
5979
6042
|
typecheck: "tsc --noEmit",
|
|
5980
6043
|
lint: "eslint . --fix",
|
|
5981
|
-
"lint:check": "eslint .
|
|
6044
|
+
"lint:check": "eslint .",
|
|
6045
|
+
test: "vitest run"
|
|
5982
6046
|
},
|
|
5983
6047
|
tsup: {
|
|
5984
6048
|
entry: [
|
|
@@ -6018,7 +6082,8 @@ var package_default = {
|
|
|
6018
6082
|
eslint: "^9.33.0",
|
|
6019
6083
|
prettier: "^3.6.2",
|
|
6020
6084
|
tsup: "^8.4.0",
|
|
6021
|
-
"typed-emitter": "^2.1.0"
|
|
6085
|
+
"typed-emitter": "^2.1.0",
|
|
6086
|
+
vitest: "^3.0.0"
|
|
6022
6087
|
},
|
|
6023
6088
|
"lint-staged": {
|
|
6024
6089
|
"*.{js,ts,tsx,mjs,cjs}": [
|
|
@@ -6029,6 +6094,7 @@ var package_default = {
|
|
|
6029
6094
|
|
|
6030
6095
|
// src/client.ts
|
|
6031
6096
|
var FishjamClient = class {
|
|
6097
|
+
moqApi;
|
|
6032
6098
|
roomApi;
|
|
6033
6099
|
viewerApi;
|
|
6034
6100
|
streamerApi;
|
|
@@ -6057,6 +6123,7 @@ var FishjamClient = class {
|
|
|
6057
6123
|
return response;
|
|
6058
6124
|
});
|
|
6059
6125
|
const fishjamUrl = getFishjamUrl(config);
|
|
6126
|
+
this.moqApi = new MoqApi(void 0, fishjamUrl, client);
|
|
6060
6127
|
this.roomApi = new RoomApi(void 0, fishjamUrl, client);
|
|
6061
6128
|
this.viewerApi = new ViewerApi(void 0, fishjamUrl, client);
|
|
6062
6129
|
this.streamerApi = new StreamerApi(void 0, fishjamUrl, client);
|
|
@@ -6246,6 +6313,18 @@ var FishjamClient = class {
|
|
|
6246
6313
|
throw mapException(error);
|
|
6247
6314
|
}
|
|
6248
6315
|
}
|
|
6316
|
+
/**
|
|
6317
|
+
* Creates a MoQ token.
|
|
6318
|
+
* @returns a MoQ token
|
|
6319
|
+
*/
|
|
6320
|
+
async createMoqToken(config) {
|
|
6321
|
+
try {
|
|
6322
|
+
const tokenResponse = await this.moqApi.createMoqToken(config);
|
|
6323
|
+
return tokenResponse.data;
|
|
6324
|
+
} catch (error) {
|
|
6325
|
+
throw mapException(error);
|
|
6326
|
+
}
|
|
6327
|
+
}
|
|
6249
6328
|
};
|
|
6250
6329
|
// Annotate the CommonJS export names for ESM import in node:
|
|
6251
6330
|
0 && (module.exports = {
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
package_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-B3H63SYI.mjs";
|
|
4
4
|
|
|
5
5
|
// ../fishjam-openapi/dist/index.js
|
|
6
6
|
import globalAxios2 from "axios";
|
|
@@ -90,6 +90,69 @@ var VideoCodec = {
|
|
|
90
90
|
H264: "h264",
|
|
91
91
|
Vp8: "vp8"
|
|
92
92
|
};
|
|
93
|
+
var MoqApiAxiosParamCreator = function(configuration) {
|
|
94
|
+
return {
|
|
95
|
+
/**
|
|
96
|
+
*
|
|
97
|
+
* @summary Creates a MoQ token for the given stream
|
|
98
|
+
* @param {MoqTokenConfig} [moqTokenConfig] Token configuration
|
|
99
|
+
* @param {*} [options] Override http request option.
|
|
100
|
+
* @throws {RequiredError}
|
|
101
|
+
*/
|
|
102
|
+
createMoqToken: async (moqTokenConfig, options = {}) => {
|
|
103
|
+
const localVarPath = `/moq/token`;
|
|
104
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
105
|
+
let baseOptions;
|
|
106
|
+
if (configuration) {
|
|
107
|
+
baseOptions = configuration.baseOptions;
|
|
108
|
+
}
|
|
109
|
+
const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
|
|
110
|
+
const localVarHeaderParameter = {};
|
|
111
|
+
const localVarQueryParameter = {};
|
|
112
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
113
|
+
localVarHeaderParameter["Content-Type"] = "application/json";
|
|
114
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
115
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
116
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
117
|
+
localVarRequestOptions.data = serializeDataIfNeeded(moqTokenConfig, localVarRequestOptions, configuration);
|
|
118
|
+
return {
|
|
119
|
+
url: toPathString(localVarUrlObj),
|
|
120
|
+
options: localVarRequestOptions
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
var MoqApiFp = function(configuration) {
|
|
126
|
+
const localVarAxiosParamCreator = MoqApiAxiosParamCreator(configuration);
|
|
127
|
+
return {
|
|
128
|
+
/**
|
|
129
|
+
*
|
|
130
|
+
* @summary Creates a MoQ token for the given stream
|
|
131
|
+
* @param {MoqTokenConfig} [moqTokenConfig] Token configuration
|
|
132
|
+
* @param {*} [options] Override http request option.
|
|
133
|
+
* @throws {RequiredError}
|
|
134
|
+
*/
|
|
135
|
+
async createMoqToken(moqTokenConfig, options) {
|
|
136
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.createMoqToken(moqTokenConfig, options);
|
|
137
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
138
|
+
const localVarOperationServerBasePath = operationServerMap["MoqApi.createMoqToken"]?.[localVarOperationServerIndex]?.url;
|
|
139
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
var MoqApi = class extends BaseAPI {
|
|
144
|
+
/**
|
|
145
|
+
*
|
|
146
|
+
* @summary Creates a MoQ token for the given stream
|
|
147
|
+
* @param {MoqTokenConfig} [moqTokenConfig] Token configuration
|
|
148
|
+
* @param {*} [options] Override http request option.
|
|
149
|
+
* @throws {RequiredError}
|
|
150
|
+
* @memberof MoqApi
|
|
151
|
+
*/
|
|
152
|
+
createMoqToken(moqTokenConfig, options) {
|
|
153
|
+
return MoqApiFp(this.configuration).createMoqToken(moqTokenConfig, options).then((request) => request(this.axios, this.basePath));
|
|
154
|
+
}
|
|
155
|
+
};
|
|
93
156
|
var RoomApiAxiosParamCreator = function(configuration) {
|
|
94
157
|
return {
|
|
95
158
|
/**
|
|
@@ -5888,6 +5951,7 @@ var mapException = (error, entity) => {
|
|
|
5888
5951
|
|
|
5889
5952
|
// src/client.ts
|
|
5890
5953
|
var FishjamClient = class {
|
|
5954
|
+
moqApi;
|
|
5891
5955
|
roomApi;
|
|
5892
5956
|
viewerApi;
|
|
5893
5957
|
streamerApi;
|
|
@@ -5916,6 +5980,7 @@ var FishjamClient = class {
|
|
|
5916
5980
|
return response;
|
|
5917
5981
|
});
|
|
5918
5982
|
const fishjamUrl = getFishjamUrl(config);
|
|
5983
|
+
this.moqApi = new MoqApi(void 0, fishjamUrl, client);
|
|
5919
5984
|
this.roomApi = new RoomApi(void 0, fishjamUrl, client);
|
|
5920
5985
|
this.viewerApi = new ViewerApi(void 0, fishjamUrl, client);
|
|
5921
5986
|
this.streamerApi = new StreamerApi(void 0, fishjamUrl, client);
|
|
@@ -6105,6 +6170,18 @@ var FishjamClient = class {
|
|
|
6105
6170
|
throw mapException(error);
|
|
6106
6171
|
}
|
|
6107
6172
|
}
|
|
6173
|
+
/**
|
|
6174
|
+
* Creates a MoQ token.
|
|
6175
|
+
* @returns a MoQ token
|
|
6176
|
+
*/
|
|
6177
|
+
async createMoqToken(config) {
|
|
6178
|
+
try {
|
|
6179
|
+
const tokenResponse = await this.moqApi.createMoqToken(config);
|
|
6180
|
+
return tokenResponse.data;
|
|
6181
|
+
} catch (error) {
|
|
6182
|
+
throw mapException(error);
|
|
6183
|
+
}
|
|
6184
|
+
}
|
|
6108
6185
|
};
|
|
6109
6186
|
export {
|
|
6110
6187
|
BadRequestException,
|
|
@@ -31,7 +31,7 @@ var import_genai = require("@google/genai");
|
|
|
31
31
|
// package.json
|
|
32
32
|
var package_default = {
|
|
33
33
|
name: "@fishjam-cloud/js-server-sdk",
|
|
34
|
-
version: "0.
|
|
34
|
+
version: "0.27.0-rc.1",
|
|
35
35
|
description: "Fishjam server SDK for JavaScript",
|
|
36
36
|
homepage: "https://github.com/fishjam-cloud/js-server-sdk",
|
|
37
37
|
author: "Fishjam Team",
|
|
@@ -72,7 +72,8 @@ var package_default = {
|
|
|
72
72
|
"format:check": "prettier --check .",
|
|
73
73
|
typecheck: "tsc --noEmit",
|
|
74
74
|
lint: "eslint . --fix",
|
|
75
|
-
"lint:check": "eslint .
|
|
75
|
+
"lint:check": "eslint .",
|
|
76
|
+
test: "vitest run"
|
|
76
77
|
},
|
|
77
78
|
tsup: {
|
|
78
79
|
entry: [
|
|
@@ -112,7 +113,8 @@ var package_default = {
|
|
|
112
113
|
eslint: "^9.33.0",
|
|
113
114
|
prettier: "^3.6.2",
|
|
114
115
|
tsup: "^8.4.0",
|
|
115
|
-
"typed-emitter": "^2.1.0"
|
|
116
|
+
"typed-emitter": "^2.1.0",
|
|
117
|
+
vitest: "^3.0.0"
|
|
116
118
|
},
|
|
117
119
|
"lint-staged": {
|
|
118
120
|
"*.{js,ts,tsx,mjs,cjs}": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fishjam-cloud/js-server-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0-rc.1",
|
|
4
4
|
"description": "Fishjam server SDK for JavaScript",
|
|
5
5
|
"homepage": "https://github.com/fishjam-cloud/js-server-sdk",
|
|
6
6
|
"author": "Fishjam Team",
|
|
@@ -41,7 +41,8 @@
|
|
|
41
41
|
"format:check": "prettier --check .",
|
|
42
42
|
"typecheck": "tsc --noEmit",
|
|
43
43
|
"lint": "eslint . --fix",
|
|
44
|
-
"lint:check": "eslint .
|
|
44
|
+
"lint:check": "eslint .",
|
|
45
|
+
"test": "vitest run"
|
|
45
46
|
},
|
|
46
47
|
"tsup": {
|
|
47
48
|
"entry": [
|
|
@@ -73,19 +74,20 @@
|
|
|
73
74
|
}
|
|
74
75
|
},
|
|
75
76
|
"devDependencies": {
|
|
76
|
-
"@fishjam-cloud/fishjam-openapi": "
|
|
77
|
-
"@fishjam-cloud/fishjam-proto": "
|
|
77
|
+
"@fishjam-cloud/fishjam-openapi": "0.27.0-rc.1",
|
|
78
|
+
"@fishjam-cloud/fishjam-proto": "0.27.0-rc.1",
|
|
78
79
|
"@openapitools/openapi-generator-cli": "^2.18.4",
|
|
79
80
|
"@types/node": "^22.13.16",
|
|
80
81
|
"@types/websocket": "^1.0.10",
|
|
81
82
|
"eslint": "^9.33.0",
|
|
82
83
|
"prettier": "^3.6.2",
|
|
83
84
|
"tsup": "^8.4.0",
|
|
84
|
-
"typed-emitter": "^2.1.0"
|
|
85
|
+
"typed-emitter": "^2.1.0",
|
|
86
|
+
"vitest": "^3.0.0"
|
|
85
87
|
},
|
|
86
88
|
"lint-staged": {
|
|
87
89
|
"*.{js,ts,tsx,mjs,cjs}": [
|
|
88
90
|
"eslint --fix --config eslint.config.mjs"
|
|
89
91
|
]
|
|
90
92
|
}
|
|
91
|
-
}
|
|
93
|
+
}
|