@stream-io/video-client 1.22.1 → 1.22.2
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/CHANGELOG.md +8 -0
- package/dist/index.browser.es.js +37 -9
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +37 -9
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +37 -9
- package/dist/index.es.js.map +1 -1
- package/dist/src/coordinator/connection/types.d.ts +11 -4
- package/package.json +2 -2
- package/src/coordinator/connection/client.ts +7 -7
- package/src/coordinator/connection/types.ts +46 -4
package/dist/index.es.js
CHANGED
|
@@ -299,6 +299,34 @@ const VideoSettingsResponseCameraFacingEnum = {
|
|
|
299
299
|
};
|
|
300
300
|
|
|
301
301
|
class ErrorFromResponse extends Error {
|
|
302
|
+
constructor({ message, code, status, response, unrecoverable, }) {
|
|
303
|
+
super(message);
|
|
304
|
+
this.name = 'ErrorFromResponse';
|
|
305
|
+
this.code = code;
|
|
306
|
+
this.response = response;
|
|
307
|
+
this.status = status;
|
|
308
|
+
this.unrecoverable = unrecoverable;
|
|
309
|
+
}
|
|
310
|
+
// Vitest helper (serialized errors are too large to read)
|
|
311
|
+
// https://github.com/vitest-dev/vitest/blob/v3.1.3/packages/utils/src/error.ts#L60-L62
|
|
312
|
+
toJSON() {
|
|
313
|
+
const extra = [
|
|
314
|
+
['status', this.status],
|
|
315
|
+
['code', this.code],
|
|
316
|
+
['unrecoverable', this.unrecoverable],
|
|
317
|
+
];
|
|
318
|
+
const joinable = [];
|
|
319
|
+
for (const [key, value] of extra) {
|
|
320
|
+
if (typeof value !== 'undefined' && value !== null) {
|
|
321
|
+
joinable.push(`${key}: ${value}`);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
return {
|
|
325
|
+
message: `(${joinable.join(', ')}) - ${this.message}`,
|
|
326
|
+
stack: this.stack,
|
|
327
|
+
name: this.name,
|
|
328
|
+
};
|
|
329
|
+
}
|
|
302
330
|
}
|
|
303
331
|
|
|
304
332
|
// @generated by protobuf-ts 2.9.6 with parameter long_type_string,client_generic,server_none,eslint_disable,optimize_code_size
|
|
@@ -5653,7 +5681,7 @@ const aggregate = (stats) => {
|
|
|
5653
5681
|
return report;
|
|
5654
5682
|
};
|
|
5655
5683
|
|
|
5656
|
-
const version = "1.22.
|
|
5684
|
+
const version = "1.22.2";
|
|
5657
5685
|
const [major, minor, patch] = version.split('.');
|
|
5658
5686
|
let sdkInfo = {
|
|
5659
5687
|
type: SdkType.PLAIN_JAVASCRIPT,
|
|
@@ -13694,13 +13722,13 @@ class StreamClient {
|
|
|
13694
13722
|
};
|
|
13695
13723
|
this.errorFromResponse = (response) => {
|
|
13696
13724
|
const { data, status } = response;
|
|
13697
|
-
|
|
13698
|
-
|
|
13699
|
-
|
|
13700
|
-
|
|
13701
|
-
|
|
13702
|
-
|
|
13703
|
-
|
|
13725
|
+
return new ErrorFromResponse({
|
|
13726
|
+
message: `Stream error code ${data.code}: ${data.message}`,
|
|
13727
|
+
code: data.code ?? null,
|
|
13728
|
+
unrecoverable: data.unrecoverable ?? null,
|
|
13729
|
+
response: response,
|
|
13730
|
+
status: status,
|
|
13731
|
+
});
|
|
13704
13732
|
};
|
|
13705
13733
|
this.handleResponse = (response) => {
|
|
13706
13734
|
const data = response.data;
|
|
@@ -13741,7 +13769,7 @@ class StreamClient {
|
|
|
13741
13769
|
this.getUserAgent = () => {
|
|
13742
13770
|
if (!this.cachedUserAgent) {
|
|
13743
13771
|
const { clientAppIdentifier = {} } = this.options;
|
|
13744
|
-
const { sdkName = 'js', sdkVersion = "1.22.
|
|
13772
|
+
const { sdkName = 'js', sdkVersion = "1.22.2", ...extras } = clientAppIdentifier;
|
|
13745
13773
|
this.cachedUserAgent = [
|
|
13746
13774
|
`stream-video-${sdkName}-v${sdkVersion}`,
|
|
13747
13775
|
...Object.entries(extras).map(([key, value]) => `${key}=${value}`),
|