@ermis-network/ermis-chat-sdk 1.0.7 → 1.0.8

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.
@@ -3259,6 +3259,20 @@ var ErmisChat = class _ErmisChat {
3259
3259
  }
3260
3260
  });
3261
3261
  }
3262
+ /**
3263
+ * Downloads a media file as a Blob via the SDK's configured axiosInstance.
3264
+ * This avoids CORS issues that arise when using `fetch()` directly from the browser,
3265
+ * because axios is routed through the SDK's authenticated transport layer.
3266
+ *
3267
+ * @param url - The full URL of the media file to download.
3268
+ * @returns A Blob of the file content.
3269
+ */
3270
+ async downloadMedia(url) {
3271
+ const response = await this.axiosInstance.get(url, {
3272
+ responseType: "blob"
3273
+ });
3274
+ return response.data;
3275
+ }
3262
3276
  errorFromResponse(response) {
3263
3277
  let err;
3264
3278
  err = new ErrorFromResponse(`ErmisChat error HTTP code: ${response.status}`);
@@ -3963,7 +3977,7 @@ var ErmisChat = class _ErmisChat {
3963
3977
  return pinExpires;
3964
3978
  }
3965
3979
  getUserAgent() {
3966
- return this.userAgent || `ermis-chat-sdk-javascript-client-${this.node ? "node" : "browser"}-${"1.0.7"}`;
3980
+ return this.userAgent || `ermis-chat-sdk-javascript-client-${this.node ? "node" : "browser"}-${"1.0.8"}`;
3967
3981
  }
3968
3982
  setUserAgent(userAgent) {
3969
3983
  this.userAgent = userAgent;
@@ -7321,7 +7335,7 @@ var ErmisAuthProvider = class {
7321
7335
  return data;
7322
7336
  }
7323
7337
  getUserAgent() {
7324
- return this.userAgent || `ermis-chat-sdk-javascript-client-${this.node ? "node" : "browser"}-${"1.0.7"}`;
7338
+ return this.userAgent || `ermis-chat-sdk-javascript-client-${this.node ? "node" : "browser"}-${"1.0.8"}`;
7325
7339
  }
7326
7340
  setUserAgent(userAgent) {
7327
7341
  this.userAgent = userAgent;