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