@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 CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [1.22.2](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.22.1...@stream-io/video-client-1.22.2) (2025-05-15)
6
+
7
+ - adjust ErrorFromResponse class ([#1791](https://github.com/GetStream/stream-video-js/issues/1791)) ([c0abcba](https://github.com/GetStream/stream-video-js/commit/c0abcbacfddeb87d8378c4418f80e6770981cdc8)), closes [GetStream/chat#1540](https://github.com/GetStream/chat/issues/1540)
8
+
9
+ ### Bug Fixes
10
+
11
+ - enable chore releases ([#1792](https://github.com/GetStream/stream-video-js/issues/1792)) ([6046654](https://github.com/GetStream/stream-video-js/commit/6046654fe19505a1c115a4fb838759d010540614))
12
+
5
13
  ## [1.22.1](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.22.0...@stream-io/video-client-1.22.1) (2025-05-14)
6
14
 
7
15
  ### Bug Fixes
@@ -298,6 +298,34 @@ const VideoSettingsResponseCameraFacingEnum = {
298
298
  };
299
299
 
300
300
  class ErrorFromResponse extends Error {
301
+ constructor({ message, code, status, response, unrecoverable, }) {
302
+ super(message);
303
+ this.name = 'ErrorFromResponse';
304
+ this.code = code;
305
+ this.response = response;
306
+ this.status = status;
307
+ this.unrecoverable = unrecoverable;
308
+ }
309
+ // Vitest helper (serialized errors are too large to read)
310
+ // https://github.com/vitest-dev/vitest/blob/v3.1.3/packages/utils/src/error.ts#L60-L62
311
+ toJSON() {
312
+ const extra = [
313
+ ['status', this.status],
314
+ ['code', this.code],
315
+ ['unrecoverable', this.unrecoverable],
316
+ ];
317
+ const joinable = [];
318
+ for (const [key, value] of extra) {
319
+ if (typeof value !== 'undefined' && value !== null) {
320
+ joinable.push(`${key}: ${value}`);
321
+ }
322
+ }
323
+ return {
324
+ message: `(${joinable.join(', ')}) - ${this.message}`,
325
+ stack: this.stack,
326
+ name: this.name,
327
+ };
328
+ }
301
329
  }
302
330
 
303
331
  // @generated by protobuf-ts 2.9.6 with parameter long_type_string,client_generic,server_none,eslint_disable,optimize_code_size
@@ -5652,7 +5680,7 @@ const aggregate = (stats) => {
5652
5680
  return report;
5653
5681
  };
5654
5682
 
5655
- const version = "1.22.1";
5683
+ const version = "1.22.2";
5656
5684
  const [major, minor, patch] = version.split('.');
5657
5685
  let sdkInfo = {
5658
5686
  type: SdkType.PLAIN_JAVASCRIPT,
@@ -13695,13 +13723,13 @@ class StreamClient {
13695
13723
  };
13696
13724
  this.errorFromResponse = (response) => {
13697
13725
  const { data, status } = response;
13698
- const err = new ErrorFromResponse();
13699
- err.message = `Stream error code ${data.code}: ${data.message}`;
13700
- err.code = data.code;
13701
- err.unrecoverable = data.unrecoverable;
13702
- err.response = response;
13703
- err.status = status;
13704
- return err;
13726
+ return new ErrorFromResponse({
13727
+ message: `Stream error code ${data.code}: ${data.message}`,
13728
+ code: data.code ?? null,
13729
+ unrecoverable: data.unrecoverable ?? null,
13730
+ response: response,
13731
+ status: status,
13732
+ });
13705
13733
  };
13706
13734
  this.handleResponse = (response) => {
13707
13735
  const data = response.data;
@@ -13742,7 +13770,7 @@ class StreamClient {
13742
13770
  this.getUserAgent = () => {
13743
13771
  if (!this.cachedUserAgent) {
13744
13772
  const { clientAppIdentifier = {} } = this.options;
13745
- const { sdkName = 'js', sdkVersion = "1.22.1", ...extras } = clientAppIdentifier;
13773
+ const { sdkName = 'js', sdkVersion = "1.22.2", ...extras } = clientAppIdentifier;
13746
13774
  this.cachedUserAgent = [
13747
13775
  `stream-video-${sdkName}-v${sdkVersion}`,
13748
13776
  ...Object.entries(extras).map(([key, value]) => `${key}=${value}`),