@fishjam-cloud/js-server-sdk 0.29.0-rc.2 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,44 +1,16 @@
1
1
  import { BinaryWriter, BinaryReader } from '@bufbuild/protobuf/wire';
2
- import { AxiosError } from 'axios';
3
2
 
4
3
  /**
5
- * Output audio options
6
- * @export
7
- * @interface AgentOutput
8
- */
9
- interface AgentOutput {
10
- /**
11
- *
12
- * @type {AudioFormat}
13
- * @memberof AgentOutput
14
- */
15
- 'audioFormat'?: AudioFormat;
16
- /**
17
- *
18
- * @type {AudioSampleRate}
19
- * @memberof AgentOutput
20
- */
21
- 'audioSampleRate'?: AudioSampleRate;
22
- }
23
- /**
24
- * The format of the output audio
25
- * @export
26
- * @enum {string}
27
- */
28
- declare const AudioFormat: {
29
- readonly Pcm16: "pcm16";
30
- };
31
- type AudioFormat = typeof AudioFormat[keyof typeof AudioFormat];
32
- /**
33
- * The sample rate of the output audio
34
- * @export
35
- * @enum {string}
4
+ * Fishjam API
5
+ * API for managing Fishjam real-time media resources. ## Authentication ## Credentials (Fishjam ID, Fishjam Management Token) can be obtained at https://fishjam.io/app. All requests require HTTP Bearer authorization using the Fishjam Management Token. ## Fishjam SDKs ## For TypeScript and Python users, we provide SDKs that simplify using this API. We recommend using them instead of manually consuming the API in these languages. You can learn more about our SDKs in our [SDK Docs](http://fishjam.swmansion.com/docs/how-to/backend/server-setup)
6
+ *
7
+ * The version of the OpenAPI document: 0.28.1
8
+ * Contact: contact@fishjam.io
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
36
13
  */
37
- declare const AudioSampleRate: {
38
- readonly NUMBER_16000: 16000;
39
- readonly NUMBER_24000: 24000;
40
- };
41
- type AudioSampleRate = typeof AudioSampleRate[keyof typeof AudioSampleRate];
42
14
  /**
43
15
  * Connection details for a MoQ relay client
44
16
  * @export
@@ -50,14 +22,26 @@ interface MoqAccess {
50
22
  * @type {string}
51
23
  * @memberof MoqAccess
52
24
  */
53
- 'connection_url': string;
25
+ connection_url: string;
54
26
  /**
55
27
  * JWT authorizing the MoQ relay connection, also embedded in `connection_url`
56
28
  * @type {string}
57
29
  * @memberof MoqAccess
58
30
  */
59
- 'token': string;
31
+ token: string;
60
32
  }
33
+
34
+ /**
35
+ * Fishjam API
36
+ * API for managing Fishjam real-time media resources. ## Authentication ## Credentials (Fishjam ID, Fishjam Management Token) can be obtained at https://fishjam.io/app. All requests require HTTP Bearer authorization using the Fishjam Management Token. ## Fishjam SDKs ## For TypeScript and Python users, we provide SDKs that simplify using this API. We recommend using them instead of manually consuming the API in these languages. You can learn more about our SDKs in our [SDK Docs](http://fishjam.swmansion.com/docs/how-to/backend/server-setup)
37
+ *
38
+ * The version of the OpenAPI document: 0.28.1
39
+ * Contact: contact@fishjam.io
40
+ *
41
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
42
+ * https://openapi-generator.tech
43
+ * Do not edit the class manually.
44
+ */
61
45
  /**
62
46
  * MoQ access configuration
63
47
  * @export
@@ -69,69 +53,121 @@ interface MoqAccessConfig {
69
53
  * @type {string}
70
54
  * @memberof MoqAccessConfig
71
55
  */
72
- 'publishPath'?: string | null;
56
+ publishPath?: string | null;
73
57
  /**
74
58
  * Path under the root the token grants subscribe access to
75
59
  * @type {string}
76
60
  * @memberof MoqAccessConfig
77
61
  */
78
- 'subscribePath'?: string | null;
62
+ subscribePath?: string | null;
79
63
  }
64
+
80
65
  /**
81
- * Describes peer status
66
+ * Fishjam API
67
+ * API for managing Fishjam real-time media resources. ## Authentication ## Credentials (Fishjam ID, Fishjam Management Token) can be obtained at https://fishjam.io/app. All requests require HTTP Bearer authorization using the Fishjam Management Token. ## Fishjam SDKs ## For TypeScript and Python users, we provide SDKs that simplify using this API. We recommend using them instead of manually consuming the API in these languages. You can learn more about our SDKs in our [SDK Docs](http://fishjam.swmansion.com/docs/how-to/backend/server-setup)
68
+ *
69
+ * The version of the OpenAPI document: 0.28.1
70
+ * Contact: contact@fishjam.io
71
+ *
72
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
73
+ * https://openapi-generator.tech
74
+ * Do not edit the class manually.
75
+ */
76
+ /**
77
+ * The sample rate of the output audio
82
78
  * @export
83
- * @interface Peer
84
79
  */
85
- interface Peer$1 {
86
- /**
87
- * Assigned peer id
88
- * @type {string}
89
- * @memberof Peer
90
- */
91
- 'id': string;
92
- /**
93
- * Custom metadata set by the peer
94
- * @type {object}
95
- * @memberof Peer
96
- */
97
- 'metadata': object | null;
98
- /**
99
- *
100
- * @type {PeerStatus}
101
- * @memberof Peer
102
- */
103
- 'status': PeerStatus;
104
- /**
105
- *
106
- * @type {SubscribeMode}
107
- * @memberof Peer
108
- */
109
- 'subscribeMode': SubscribeMode;
80
+ declare const AudioSampleRate: {
81
+ readonly NUMBER_16000: 16000;
82
+ readonly NUMBER_24000: 24000;
83
+ };
84
+ type AudioSampleRate = typeof AudioSampleRate[keyof typeof AudioSampleRate];
85
+
86
+ /**
87
+ * Fishjam API
88
+ * API for managing Fishjam real-time media resources. ## Authentication ## Credentials (Fishjam ID, Fishjam Management Token) can be obtained at https://fishjam.io/app. All requests require HTTP Bearer authorization using the Fishjam Management Token. ## Fishjam SDKs ## For TypeScript and Python users, we provide SDKs that simplify using this API. We recommend using them instead of manually consuming the API in these languages. You can learn more about our SDKs in our [SDK Docs](http://fishjam.swmansion.com/docs/how-to/backend/server-setup)
89
+ *
90
+ * The version of the OpenAPI document: 0.28.1
91
+ * Contact: contact@fishjam.io
92
+ *
93
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
94
+ * https://openapi-generator.tech
95
+ * Do not edit the class manually.
96
+ */
97
+ /**
98
+ * The format of the output audio
99
+ * @export
100
+ */
101
+ declare const AudioFormat: {
102
+ readonly Pcm16: "pcm16";
103
+ };
104
+ type AudioFormat = typeof AudioFormat[keyof typeof AudioFormat];
105
+
106
+ /**
107
+ * Fishjam API
108
+ * API for managing Fishjam real-time media resources. ## Authentication ## Credentials (Fishjam ID, Fishjam Management Token) can be obtained at https://fishjam.io/app. All requests require HTTP Bearer authorization using the Fishjam Management Token. ## Fishjam SDKs ## For TypeScript and Python users, we provide SDKs that simplify using this API. We recommend using them instead of manually consuming the API in these languages. You can learn more about our SDKs in our [SDK Docs](http://fishjam.swmansion.com/docs/how-to/backend/server-setup)
109
+ *
110
+ * The version of the OpenAPI document: 0.28.1
111
+ * Contact: contact@fishjam.io
112
+ *
113
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
114
+ * https://openapi-generator.tech
115
+ * Do not edit the class manually.
116
+ */
117
+
118
+ /**
119
+ * Output audio options
120
+ * @export
121
+ * @interface AgentOutput
122
+ */
123
+ interface AgentOutput {
110
124
  /**
111
125
  *
112
- * @type {Subscriptions}
113
- * @memberof Peer
114
- */
115
- 'subscriptions': Subscriptions;
116
- /**
117
- * List of all peer\'s tracks
118
- * @type {Array<Track>}
119
- * @memberof Peer
126
+ * @type {AudioFormat}
127
+ * @memberof AgentOutput
120
128
  */
121
- 'tracks': Array<Track$2>;
129
+ audioFormat?: AudioFormat;
122
130
  /**
123
131
  *
124
- * @type {PeerType}
125
- * @memberof Peer
132
+ * @type {AudioSampleRate}
133
+ * @memberof AgentOutput
126
134
  */
127
- 'type': PeerType$1;
135
+ audioSampleRate?: AudioSampleRate;
128
136
  }
137
+
138
+ /**
139
+ * Fishjam API
140
+ * API for managing Fishjam real-time media resources. ## Authentication ## Credentials (Fishjam ID, Fishjam Management Token) can be obtained at https://fishjam.io/app. All requests require HTTP Bearer authorization using the Fishjam Management Token. ## Fishjam SDKs ## For TypeScript and Python users, we provide SDKs that simplify using this API. We recommend using them instead of manually consuming the API in these languages. You can learn more about our SDKs in our [SDK Docs](http://fishjam.swmansion.com/docs/how-to/backend/server-setup)
141
+ *
142
+ * The version of the OpenAPI document: 0.28.1
143
+ * Contact: contact@fishjam.io
144
+ *
145
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
146
+ * https://openapi-generator.tech
147
+ * Do not edit the class manually.
148
+ */
129
149
  /**
130
- * @type PeerOptions
131
- * Peer-specific options
150
+ * Configuration of peer's subscribing policy
132
151
  * @export
133
152
  */
134
- type PeerOptions = PeerOptionsAgent | PeerOptionsVapi | PeerOptionsWebRTC;
153
+ declare const SubscribeMode: {
154
+ readonly Auto: "auto";
155
+ readonly Manual: "manual";
156
+ };
157
+ type SubscribeMode = typeof SubscribeMode[keyof typeof SubscribeMode];
158
+
159
+ /**
160
+ * Fishjam API
161
+ * API for managing Fishjam real-time media resources. ## Authentication ## Credentials (Fishjam ID, Fishjam Management Token) can be obtained at https://fishjam.io/app. All requests require HTTP Bearer authorization using the Fishjam Management Token. ## Fishjam SDKs ## For TypeScript and Python users, we provide SDKs that simplify using this API. We recommend using them instead of manually consuming the API in these languages. You can learn more about our SDKs in our [SDK Docs](http://fishjam.swmansion.com/docs/how-to/backend/server-setup)
162
+ *
163
+ * The version of the OpenAPI document: 0.28.1
164
+ * Contact: contact@fishjam.io
165
+ *
166
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
167
+ * https://openapi-generator.tech
168
+ * Do not edit the class manually.
169
+ */
170
+
135
171
  /**
136
172
  * Options specific to the Agent peer
137
173
  * @export
@@ -143,14 +179,27 @@ interface PeerOptionsAgent {
143
179
  * @type {AgentOutput}
144
180
  * @memberof PeerOptionsAgent
145
181
  */
146
- 'output'?: AgentOutput;
182
+ output?: AgentOutput;
147
183
  /**
148
184
  *
149
185
  * @type {SubscribeMode}
150
186
  * @memberof PeerOptionsAgent
151
187
  */
152
- 'subscribeMode'?: SubscribeMode;
188
+ subscribeMode?: SubscribeMode;
153
189
  }
190
+
191
+ /**
192
+ * Fishjam API
193
+ * API for managing Fishjam real-time media resources. ## Authentication ## Credentials (Fishjam ID, Fishjam Management Token) can be obtained at https://fishjam.io/app. All requests require HTTP Bearer authorization using the Fishjam Management Token. ## Fishjam SDKs ## For TypeScript and Python users, we provide SDKs that simplify using this API. We recommend using them instead of manually consuming the API in these languages. You can learn more about our SDKs in our [SDK Docs](http://fishjam.swmansion.com/docs/how-to/backend/server-setup)
194
+ *
195
+ * The version of the OpenAPI document: 0.28.1
196
+ * Contact: contact@fishjam.io
197
+ *
198
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
199
+ * https://openapi-generator.tech
200
+ * Do not edit the class manually.
201
+ */
202
+
154
203
  /**
155
204
  * Options specific to the VAPI peer
156
205
  * @export
@@ -162,20 +211,33 @@ interface PeerOptionsVapi {
162
211
  * @type {string}
163
212
  * @memberof PeerOptionsVapi
164
213
  */
165
- 'apiKey': string;
214
+ apiKey: string;
166
215
  /**
167
216
  * VAPI call ID
168
217
  * @type {string}
169
218
  * @memberof PeerOptionsVapi
170
219
  */
171
- 'callId': string;
220
+ callId: string;
172
221
  /**
173
222
  *
174
223
  * @type {SubscribeMode}
175
224
  * @memberof PeerOptionsVapi
176
225
  */
177
- 'subscribeMode'?: SubscribeMode;
226
+ subscribeMode?: SubscribeMode;
178
227
  }
228
+
229
+ /**
230
+ * Fishjam API
231
+ * API for managing Fishjam real-time media resources. ## Authentication ## Credentials (Fishjam ID, Fishjam Management Token) can be obtained at https://fishjam.io/app. All requests require HTTP Bearer authorization using the Fishjam Management Token. ## Fishjam SDKs ## For TypeScript and Python users, we provide SDKs that simplify using this API. We recommend using them instead of manually consuming the API in these languages. You can learn more about our SDKs in our [SDK Docs](http://fishjam.swmansion.com/docs/how-to/backend/server-setup)
232
+ *
233
+ * The version of the OpenAPI document: 0.28.1
234
+ * Contact: contact@fishjam.io
235
+ *
236
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
237
+ * https://openapi-generator.tech
238
+ * Do not edit the class manually.
239
+ */
240
+
179
241
  /**
180
242
  * Options specific to the WebRTC peer
181
243
  * @export
@@ -187,7 +249,7 @@ interface PeerOptionsWebRTC {
187
249
  * @type {{ [key: string]: any; }}
188
250
  * @memberof PeerOptionsWebRTC
189
251
  */
190
- 'metadata'?: {
252
+ metadata?: {
191
253
  [key: string]: any;
192
254
  };
193
255
  /**
@@ -195,22 +257,75 @@ interface PeerOptionsWebRTC {
195
257
  * @type {SubscribeMode}
196
258
  * @memberof PeerOptionsWebRTC
197
259
  */
198
- 'subscribeMode'?: SubscribeMode;
260
+ subscribeMode?: SubscribeMode;
199
261
  }
262
+
263
+ /**
264
+ * Fishjam API
265
+ * API for managing Fishjam real-time media resources. ## Authentication ## Credentials (Fishjam ID, Fishjam Management Token) can be obtained at https://fishjam.io/app. All requests require HTTP Bearer authorization using the Fishjam Management Token. ## Fishjam SDKs ## For TypeScript and Python users, we provide SDKs that simplify using this API. We recommend using them instead of manually consuming the API in these languages. You can learn more about our SDKs in our [SDK Docs](http://fishjam.swmansion.com/docs/how-to/backend/server-setup)
266
+ *
267
+ * The version of the OpenAPI document: 0.28.1
268
+ * Contact: contact@fishjam.io
269
+ *
270
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
271
+ * https://openapi-generator.tech
272
+ * Do not edit the class manually.
273
+ */
274
+ /**
275
+ * Describes peer's subscriptions in manual mode
276
+ * @export
277
+ * @interface Subscriptions
278
+ */
279
+ interface Subscriptions {
280
+ /**
281
+ * List of peer IDs this peer subscribes to
282
+ * @type {Array<string>}
283
+ * @memberof Subscriptions
284
+ */
285
+ peers: Array<string>;
286
+ /**
287
+ * List of track IDs this peer subscribes to
288
+ * @type {Array<string>}
289
+ * @memberof Subscriptions
290
+ */
291
+ tracks: Array<string>;
292
+ }
293
+
294
+ /**
295
+ * Fishjam API
296
+ * API for managing Fishjam real-time media resources. ## Authentication ## Credentials (Fishjam ID, Fishjam Management Token) can be obtained at https://fishjam.io/app. All requests require HTTP Bearer authorization using the Fishjam Management Token. ## Fishjam SDKs ## For TypeScript and Python users, we provide SDKs that simplify using this API. We recommend using them instead of manually consuming the API in these languages. You can learn more about our SDKs in our [SDK Docs](http://fishjam.swmansion.com/docs/how-to/backend/server-setup)
297
+ *
298
+ * The version of the OpenAPI document: 0.28.1
299
+ * Contact: contact@fishjam.io
300
+ *
301
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
302
+ * https://openapi-generator.tech
303
+ * Do not edit the class manually.
304
+ */
200
305
  /**
201
306
  * Informs about the peer status
202
307
  * @export
203
- * @enum {string}
204
308
  */
205
309
  declare const PeerStatus: {
206
310
  readonly Connected: "connected";
207
311
  readonly Disconnected: "disconnected";
208
312
  };
209
313
  type PeerStatus = typeof PeerStatus[keyof typeof PeerStatus];
314
+
315
+ /**
316
+ * Fishjam API
317
+ * API for managing Fishjam real-time media resources. ## Authentication ## Credentials (Fishjam ID, Fishjam Management Token) can be obtained at https://fishjam.io/app. All requests require HTTP Bearer authorization using the Fishjam Management Token. ## Fishjam SDKs ## For TypeScript and Python users, we provide SDKs that simplify using this API. We recommend using them instead of manually consuming the API in these languages. You can learn more about our SDKs in our [SDK Docs](http://fishjam.swmansion.com/docs/how-to/backend/server-setup)
318
+ *
319
+ * The version of the OpenAPI document: 0.28.1
320
+ * Contact: contact@fishjam.io
321
+ *
322
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
323
+ * https://openapi-generator.tech
324
+ * Do not edit the class manually.
325
+ */
210
326
  /**
211
327
  * Peer type
212
328
  * @export
213
- * @enum {string}
214
329
  */
215
330
  declare const PeerType$1: {
216
331
  readonly Webrtc: "webrtc";
@@ -218,53 +333,142 @@ declare const PeerType$1: {
218
333
  readonly Vapi: "vapi";
219
334
  };
220
335
  type PeerType$1 = typeof PeerType$1[keyof typeof PeerType$1];
336
+
221
337
  /**
222
- * Room configuration
338
+ * Fishjam API
339
+ * API for managing Fishjam real-time media resources. ## Authentication ## Credentials (Fishjam ID, Fishjam Management Token) can be obtained at https://fishjam.io/app. All requests require HTTP Bearer authorization using the Fishjam Management Token. ## Fishjam SDKs ## For TypeScript and Python users, we provide SDKs that simplify using this API. We recommend using them instead of manually consuming the API in these languages. You can learn more about our SDKs in our [SDK Docs](http://fishjam.swmansion.com/docs/how-to/backend/server-setup)
340
+ *
341
+ * The version of the OpenAPI document: 0.28.1
342
+ * Contact: contact@fishjam.io
343
+ *
344
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
345
+ * https://openapi-generator.tech
346
+ * Do not edit the class manually.
347
+ */
348
+ /**
349
+ * Media type carried by the track
223
350
  * @export
224
- * @interface RoomConfig
225
351
  */
226
- interface RoomConfig {
352
+ declare const TrackType$2: {
353
+ readonly Audio: "audio";
354
+ readonly Video: "video";
355
+ };
356
+ type TrackType$2 = typeof TrackType$2[keyof typeof TrackType$2];
357
+
358
+ /**
359
+ * Fishjam API
360
+ * API for managing Fishjam real-time media resources. ## Authentication ## Credentials (Fishjam ID, Fishjam Management Token) can be obtained at https://fishjam.io/app. All requests require HTTP Bearer authorization using the Fishjam Management Token. ## Fishjam SDKs ## For TypeScript and Python users, we provide SDKs that simplify using this API. We recommend using them instead of manually consuming the API in these languages. You can learn more about our SDKs in our [SDK Docs](http://fishjam.swmansion.com/docs/how-to/backend/server-setup)
361
+ *
362
+ * The version of the OpenAPI document: 0.28.1
363
+ * Contact: contact@fishjam.io
364
+ *
365
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
366
+ * https://openapi-generator.tech
367
+ * Do not edit the class manually.
368
+ */
369
+
370
+ /**
371
+ * Media track of a Peer
372
+ * @export
373
+ * @interface Track
374
+ */
375
+ interface Track$2 {
227
376
  /**
228
- * If true, webhook notifications for this room are coalesced into a single NotificationBatch per HTTP send instead of one request per notification. VAD notifications are unaffected.
229
- * @type {boolean}
230
- * @memberof RoomConfig
377
+ * Assigned track id
378
+ * @type {string}
379
+ * @memberof Track
231
380
  */
232
- 'batchWebhookNotifications'?: boolean;
381
+ id?: string;
233
382
  /**
234
- * Maximum amount of peers allowed into the room
235
- * @type {number}
236
- * @memberof RoomConfig
383
+ * Metadata attached to the track by the peer
384
+ * @type {object}
385
+ * @memberof Track
237
386
  */
238
- 'maxPeers'?: number | null;
387
+ metadata?: object | null;
239
388
  /**
240
- * True if livestream viewers can omit specifying a token.
241
- * @type {boolean}
242
- * @memberof RoomConfig
389
+ *
390
+ * @type {TrackType}
391
+ * @memberof Track
243
392
  */
244
- 'public'?: boolean;
393
+ type?: TrackType$2;
394
+ }
395
+
396
+ /**
397
+ * Fishjam API
398
+ * API for managing Fishjam real-time media resources. ## Authentication ## Credentials (Fishjam ID, Fishjam Management Token) can be obtained at https://fishjam.io/app. All requests require HTTP Bearer authorization using the Fishjam Management Token. ## Fishjam SDKs ## For TypeScript and Python users, we provide SDKs that simplify using this API. We recommend using them instead of manually consuming the API in these languages. You can learn more about our SDKs in our [SDK Docs](http://fishjam.swmansion.com/docs/how-to/backend/server-setup)
399
+ *
400
+ * The version of the OpenAPI document: 0.28.1
401
+ * Contact: contact@fishjam.io
402
+ *
403
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
404
+ * https://openapi-generator.tech
405
+ * Do not edit the class manually.
406
+ */
407
+
408
+ /**
409
+ * Describes peer status
410
+ * @export
411
+ * @interface Peer
412
+ */
413
+ interface Peer$1 {
414
+ /**
415
+ * Assigned peer id
416
+ * @type {string}
417
+ * @memberof Peer
418
+ */
419
+ id: string;
420
+ /**
421
+ * Custom metadata set by the peer
422
+ * @type {object}
423
+ * @memberof Peer
424
+ */
425
+ metadata: object | null;
245
426
  /**
246
427
  *
247
- * @type {RoomType}
248
- * @memberof RoomConfig
428
+ * @type {PeerStatus}
429
+ * @memberof Peer
249
430
  */
250
- 'roomType'?: RoomType;
431
+ status: PeerStatus;
251
432
  /**
252
433
  *
253
- * @type {VideoCodec}
254
- * @memberof RoomConfig
434
+ * @type {SubscribeMode}
435
+ * @memberof Peer
255
436
  */
256
- 'videoCodec'?: VideoCodec;
437
+ subscribeMode: SubscribeMode;
257
438
  /**
258
- * URL where Fishjam notifications will be sent
259
- * @type {string}
260
- * @memberof RoomConfig
439
+ *
440
+ * @type {Subscriptions}
441
+ * @memberof Peer
442
+ */
443
+ subscriptions: Subscriptions;
444
+ /**
445
+ * List of all peer's tracks
446
+ * @type {Array<Track>}
447
+ * @memberof Peer
261
448
  */
262
- 'webhookUrl'?: string | null;
449
+ tracks: Array<Track$2>;
450
+ /**
451
+ *
452
+ * @type {PeerType}
453
+ * @memberof Peer
454
+ */
455
+ type: PeerType$1;
263
456
  }
457
+
458
+ /**
459
+ * Fishjam API
460
+ * API for managing Fishjam real-time media resources. ## Authentication ## Credentials (Fishjam ID, Fishjam Management Token) can be obtained at https://fishjam.io/app. All requests require HTTP Bearer authorization using the Fishjam Management Token. ## Fishjam SDKs ## For TypeScript and Python users, we provide SDKs that simplify using this API. We recommend using them instead of manually consuming the API in these languages. You can learn more about our SDKs in our [SDK Docs](http://fishjam.swmansion.com/docs/how-to/backend/server-setup)
461
+ *
462
+ * The version of the OpenAPI document: 0.28.1
463
+ * Contact: contact@fishjam.io
464
+ *
465
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
466
+ * https://openapi-generator.tech
467
+ * Do not edit the class manually.
468
+ */
264
469
  /**
265
470
  * The use-case of the room. If not provided, this defaults to conference.
266
471
  * @export
267
- * @enum {string}
268
472
  */
269
473
  declare const RoomType: {
270
474
  readonly FullFeature: "full_feature";
@@ -275,93 +479,121 @@ declare const RoomType: {
275
479
  readonly AudioOnlyLivestream: "audio_only_livestream";
276
480
  };
277
481
  type RoomType = typeof RoomType[keyof typeof RoomType];
482
+
278
483
  /**
279
- * Streamer authorization token
280
- * @export
281
- * @interface StreamerToken
484
+ * Fishjam API
485
+ * API for managing Fishjam real-time media resources. ## Authentication ## Credentials (Fishjam ID, Fishjam Management Token) can be obtained at https://fishjam.io/app. All requests require HTTP Bearer authorization using the Fishjam Management Token. ## Fishjam SDKs ## For TypeScript and Python users, we provide SDKs that simplify using this API. We recommend using them instead of manually consuming the API in these languages. You can learn more about our SDKs in our [SDK Docs](http://fishjam.swmansion.com/docs/how-to/backend/server-setup)
486
+ *
487
+ * The version of the OpenAPI document: 0.28.1
488
+ * Contact: contact@fishjam.io
489
+ *
490
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
491
+ * https://openapi-generator.tech
492
+ * Do not edit the class manually.
282
493
  */
283
- interface StreamerToken {
284
- /**
285
- * Token streamer should authorize with
286
- * @type {string}
287
- * @memberof StreamerToken
288
- */
289
- 'token': string;
290
- }
291
494
  /**
292
- * Configuration of peer\'s subscribing policy
495
+ * Enforces video codec for each peer in the room
293
496
  * @export
294
- * @enum {string}
295
497
  */
296
- declare const SubscribeMode: {
297
- readonly Auto: "auto";
298
- readonly Manual: "manual";
498
+ declare const VideoCodec: {
499
+ readonly H264: "h264";
500
+ readonly Vp8: "vp8";
299
501
  };
300
- type SubscribeMode = typeof SubscribeMode[keyof typeof SubscribeMode];
502
+ type VideoCodec = typeof VideoCodec[keyof typeof VideoCodec];
503
+
504
+ /**
505
+ * Fishjam API
506
+ * API for managing Fishjam real-time media resources. ## Authentication ## Credentials (Fishjam ID, Fishjam Management Token) can be obtained at https://fishjam.io/app. All requests require HTTP Bearer authorization using the Fishjam Management Token. ## Fishjam SDKs ## For TypeScript and Python users, we provide SDKs that simplify using this API. We recommend using them instead of manually consuming the API in these languages. You can learn more about our SDKs in our [SDK Docs](http://fishjam.swmansion.com/docs/how-to/backend/server-setup)
507
+ *
508
+ * The version of the OpenAPI document: 0.28.1
509
+ * Contact: contact@fishjam.io
510
+ *
511
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
512
+ * https://openapi-generator.tech
513
+ * Do not edit the class manually.
514
+ */
515
+
301
516
  /**
302
- * Describes peer\'s subscriptions in manual mode
517
+ * Room configuration
303
518
  * @export
304
- * @interface Subscriptions
519
+ * @interface RoomConfig
305
520
  */
306
- interface Subscriptions {
521
+ interface RoomConfig {
307
522
  /**
308
- * List of peer IDs this peer subscribes to
309
- * @type {Array<string>}
310
- * @memberof Subscriptions
523
+ * If true, webhook notifications for this room are coalesced into a single NotificationBatch per HTTP send instead of one request per notification. VAD notifications are unaffected.
524
+ * @type {boolean}
525
+ * @memberof RoomConfig
311
526
  */
312
- 'peers': Array<string>;
527
+ batchWebhookNotifications?: boolean;
313
528
  /**
314
- * List of track IDs this peer subscribes to
315
- * @type {Array<string>}
316
- * @memberof Subscriptions
529
+ * Maximum amount of peers allowed into the room
530
+ * @type {number}
531
+ * @memberof RoomConfig
317
532
  */
318
- 'tracks': Array<string>;
319
- }
320
- /**
321
- * Media track of a Peer
322
- * @export
323
- * @interface Track
324
- */
325
- interface Track$2 {
533
+ maxPeers?: number | null;
326
534
  /**
327
- * Assigned track id
328
- * @type {string}
329
- * @memberof Track
535
+ * True if livestream viewers can omit specifying a token.
536
+ * @type {boolean}
537
+ * @memberof RoomConfig
330
538
  */
331
- 'id'?: string;
539
+ public?: boolean;
332
540
  /**
333
- * Metadata attached to the track by the peer
334
- * @type {object}
335
- * @memberof Track
541
+ *
542
+ * @type {RoomType}
543
+ * @memberof RoomConfig
336
544
  */
337
- 'metadata'?: object | null;
545
+ roomType?: RoomType;
338
546
  /**
339
547
  *
340
- * @type {TrackType}
341
- * @memberof Track
548
+ * @type {VideoCodec}
549
+ * @memberof RoomConfig
550
+ */
551
+ videoCodec?: VideoCodec;
552
+ /**
553
+ * Deprecated: configure the webhook in the Dashboard instead. URL where Fishjam notifications will be sent; overrides the Dashboard-configured webhook URL
554
+ * @type {string}
555
+ * @memberof RoomConfig
556
+ * @deprecated
342
557
  */
343
- 'type'?: TrackType$2;
558
+ webhookUrl?: string | null;
344
559
  }
560
+
345
561
  /**
346
- * Media type carried by the track
347
- * @export
348
- * @enum {string}
562
+ * Fishjam API
563
+ * API for managing Fishjam real-time media resources. ## Authentication ## Credentials (Fishjam ID, Fishjam Management Token) can be obtained at https://fishjam.io/app. All requests require HTTP Bearer authorization using the Fishjam Management Token. ## Fishjam SDKs ## For TypeScript and Python users, we provide SDKs that simplify using this API. We recommend using them instead of manually consuming the API in these languages. You can learn more about our SDKs in our [SDK Docs](http://fishjam.swmansion.com/docs/how-to/backend/server-setup)
564
+ *
565
+ * The version of the OpenAPI document: 0.28.1
566
+ * Contact: contact@fishjam.io
567
+ *
568
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
569
+ * https://openapi-generator.tech
570
+ * Do not edit the class manually.
349
571
  */
350
- declare const TrackType$2: {
351
- readonly Audio: "audio";
352
- readonly Video: "video";
353
- };
354
- type TrackType$2 = typeof TrackType$2[keyof typeof TrackType$2];
355
572
  /**
356
- * Enforces video codec for each peer in the room
573
+ * Streamer authorization token
357
574
  * @export
358
- * @enum {string}
575
+ * @interface StreamerToken
576
+ */
577
+ interface StreamerToken {
578
+ /**
579
+ * Token streamer should authorize with
580
+ * @type {string}
581
+ * @memberof StreamerToken
582
+ */
583
+ token: string;
584
+ }
585
+
586
+ /**
587
+ * Fishjam API
588
+ * API for managing Fishjam real-time media resources. ## Authentication ## Credentials (Fishjam ID, Fishjam Management Token) can be obtained at https://fishjam.io/app. All requests require HTTP Bearer authorization using the Fishjam Management Token. ## Fishjam SDKs ## For TypeScript and Python users, we provide SDKs that simplify using this API. We recommend using them instead of manually consuming the API in these languages. You can learn more about our SDKs in our [SDK Docs](http://fishjam.swmansion.com/docs/how-to/backend/server-setup)
589
+ *
590
+ * The version of the OpenAPI document: 0.28.1
591
+ * Contact: contact@fishjam.io
592
+ *
593
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
594
+ * https://openapi-generator.tech
595
+ * Do not edit the class manually.
359
596
  */
360
- declare const VideoCodec: {
361
- readonly H264: "h264";
362
- readonly Vp8: "vp8";
363
- };
364
- type VideoCodec = typeof VideoCodec[keyof typeof VideoCodec];
365
597
  /**
366
598
  * Viewer authorization token
367
599
  * @export
@@ -373,7 +605,7 @@ interface ViewerToken {
373
605
  * @type {string}
374
606
  * @memberof ViewerToken
375
607
  */
376
- 'token': string;
608
+ token: string;
377
609
  }
378
610
 
379
611
  /** Defines types of tracks being published by peers and component */
@@ -1001,6 +1233,32 @@ declare class FishjamWSNotifier extends FishjamWSNotifier_base {
1001
1233
  * @category Notifications
1002
1234
  */
1003
1235
  declare const decodeServerNotifications: (data: Uint8Array | ArrayBuffer) => ServerNotification[];
1236
+ /**
1237
+ * Verify the signature of a raw Fishjam webhook request.
1238
+ *
1239
+ * Fishjam signs each webhook delivery with the room's signing secret and sends
1240
+ * the result in the `x-fishjam-signature-256` header as
1241
+ * `sha256=<lowercase hex HMAC-SHA256 of the raw body>`. Pass the raw,
1242
+ * not-yet-decoded request body, the header value, and your secret; the comparison
1243
+ * is constant-time (signatures of the wrong length are rejected early, which
1244
+ * leaks only the expected signature length — public knowledge for SHA-256).
1245
+ * Verify before calling {@link decodeServerNotifications}.
1246
+ *
1247
+ * @example
1248
+ * ```ts
1249
+ * import { verifyWebhookSignature, decodeServerNotifications } from '@fishjam-cloud/js-server-sdk';
1250
+ *
1251
+ * declare const body: Uint8Array;
1252
+ * declare const signatureHeader: string;
1253
+ * // ---cut---
1254
+ * if (!verifyWebhookSignature(body, signatureHeader, process.env.WEBHOOK_SECRET!)) {
1255
+ * throw new Error('Invalid webhook signature');
1256
+ * }
1257
+ * const notifications = decodeServerNotifications(body);
1258
+ * ```
1259
+ * @category Notifications
1260
+ */
1261
+ declare const verifyWebhookSignature: (body: Uint8Array | ArrayBuffer, signature: string, secret: string) => boolean;
1004
1262
 
1005
1263
  declare const expectedEventsList: readonly ["trackData"];
1006
1264
  /**
@@ -1032,9 +1290,10 @@ declare const FishjamAgent_base: new () => TypedEventEmitter<AgentEvents>;
1032
1290
  declare class FishjamAgent extends FishjamAgent_base {
1033
1291
  private readonly client;
1034
1292
  private resolveConnectionPromise;
1293
+ private rejectConnectionPromise;
1035
1294
  private readonly connectionPromise;
1036
1295
  private readonly pendingImageCaptures;
1037
- constructor(config: FishjamConfig, agentToken: string, callbacks?: AgentCallbacks);
1296
+ constructor(config: FishjamConfig, agentToken: string, callbacks?: AgentCallbacks, peerWebsocketUrl?: string);
1038
1297
  /**
1039
1298
  * Await Agent connection to Fishjam.
1040
1299
  */
@@ -1073,6 +1332,7 @@ declare class FishjamAgent extends FishjamAgent_base {
1073
1332
  private rejectPendingCaptures;
1074
1333
  private dispatchNotification;
1075
1334
  private setupConnection;
1335
+ private settleConnection;
1076
1336
  private isExpectedEvent;
1077
1337
  }
1078
1338
 
@@ -1205,11 +1465,15 @@ declare class FishjamClient {
1205
1465
  declare class MissingFishjamIdException extends Error {
1206
1466
  constructor();
1207
1467
  }
1468
+ interface FishjamExceptionInfo {
1469
+ message: string;
1470
+ statusCode?: number;
1471
+ details?: string;
1472
+ }
1208
1473
  declare class FishjamBaseException extends Error {
1209
1474
  statusCode: number;
1210
- axiosCode?: string;
1211
1475
  details?: string;
1212
- constructor(error: AxiosError<Record<string, string>>);
1476
+ constructor(info: FishjamExceptionInfo);
1213
1477
  }
1214
1478
  declare class BadRequestException extends FishjamBaseException {
1215
1479
  }
@@ -1232,4 +1496,12 @@ declare class QuotaExceededException extends FishjamBaseException {
1232
1496
  declare class UnknownException extends FishjamBaseException {
1233
1497
  }
1234
1498
 
1235
- export { type AgentCallbacks, type AgentEvents, type AgentTrack, type AudioCodecParameters, BadRequestException, type Brand, type ChannelAdded, type ChannelRemoved, type CloseEventHandler, type ErrorEventHandler, type ExpectedAgentEvents, type ExpectedEvents, FishjamAgent, FishjamBaseException, FishjamClient, type FishjamConfig, FishjamNotFoundException, FishjamWSNotifier, ForbiddenException, type IgnoredEvents, type IncomingTrackData, type IncomingTrackImage, InvalidFishjamCredentialsException, MissingFishjamIdException, type MoqAccess, type MoqAccessConfig, type NotificationEvents, type OutgoingTrackData, type Override, 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 PeerType, QuotaExceededException, type Room, type RoomConfig, type RoomCrashed, type RoomCreated, type RoomDeleted, type RoomId, RoomNotFoundException, RoomType, ServerMessage, type ServerNotification, ServiceUnavailableException, type StreamerConnected, type StreamerDisconnected, type StreamerToken, type Track, type TrackAdded, type TrackForwarding, type TrackForwardingRemoved, type TrackId, type TrackMetadataUpdated, type TrackRemoved, type TrackType, UnauthorizedException, UnknownException, type VadNotification, type VadStatus, VideoCodec, type ViewerConnected, type ViewerDisconnected, type ViewerToken, decodeServerNotifications };
1499
+ /**
1500
+ * Server-side Node.js SDK for creating and managing Fishjam rooms, peers, agents, and receiving real-time server notifications.
1501
+ *
1502
+ * @packageDocumentation
1503
+ */
1504
+
1505
+ type PeerOptions = PeerOptionsWebRTC | PeerOptionsAgent | PeerOptionsVapi;
1506
+
1507
+ export { type AgentCallbacks, type AgentEvents, type AgentTrack, type AudioCodecParameters, BadRequestException, type Brand, type ChannelAdded, type ChannelRemoved, type CloseEventHandler, type ErrorEventHandler, type ExpectedAgentEvents, type ExpectedEvents, FishjamAgent, FishjamBaseException, FishjamClient, type FishjamConfig, type FishjamExceptionInfo, FishjamNotFoundException, FishjamWSNotifier, ForbiddenException, type IgnoredEvents, type IncomingTrackData, type IncomingTrackImage, InvalidFishjamCredentialsException, MissingFishjamIdException, type MoqAccess, type MoqAccessConfig, type NotificationEvents, type OutgoingTrackData, type Override, 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 PeerType, QuotaExceededException, type Room, type RoomConfig, type RoomCrashed, type RoomCreated, type RoomDeleted, type RoomId, RoomNotFoundException, RoomType, ServerMessage, type ServerNotification, ServiceUnavailableException, type StreamerConnected, type StreamerDisconnected, type StreamerToken, type Track, type TrackAdded, type TrackForwarding, type TrackForwardingRemoved, type TrackId, type TrackMetadataUpdated, type TrackRemoved, type TrackType, UnauthorizedException, UnknownException, type VadNotification, type VadStatus, VideoCodec, type ViewerConnected, type ViewerDisconnected, type ViewerToken, decodeServerNotifications, verifyWebhookSignature };