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

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.
@@ -3199,6 +3199,20 @@ var ErmisChat = class _ErmisChat {
3199
3199
  }
3200
3200
  });
3201
3201
  }
3202
+ /**
3203
+ * Downloads a media file as a Blob via the SDK's configured axiosInstance.
3204
+ * This avoids CORS issues that arise when using `fetch()` directly from the browser,
3205
+ * because axios is routed through the SDK's authenticated transport layer.
3206
+ *
3207
+ * @param url - The full URL of the media file to download.
3208
+ * @returns A Blob of the file content.
3209
+ */
3210
+ async downloadMedia(url) {
3211
+ const response = await this.axiosInstance.get(url, {
3212
+ responseType: "blob"
3213
+ });
3214
+ return response.data;
3215
+ }
3202
3216
  errorFromResponse(response) {
3203
3217
  let err;
3204
3218
  err = new ErrorFromResponse(`ErmisChat error HTTP code: ${response.status}`);
@@ -3903,7 +3917,7 @@ var ErmisChat = class _ErmisChat {
3903
3917
  return pinExpires;
3904
3918
  }
3905
3919
  getUserAgent() {
3906
- return this.userAgent || `ermis-chat-sdk-javascript-client-${this.node ? "node" : "browser"}-${"1.0.7"}`;
3920
+ return this.userAgent || `ermis-chat-sdk-javascript-client-${this.node ? "node" : "browser"}-${"1.0.9"}`;
3907
3921
  }
3908
3922
  setUserAgent(userAgent) {
3909
3923
  this.userAgent = userAgent;
@@ -7261,7 +7275,7 @@ var ErmisAuthProvider = class {
7261
7275
  return data;
7262
7276
  }
7263
7277
  getUserAgent() {
7264
- return this.userAgent || `ermis-chat-sdk-javascript-client-${this.node ? "node" : "browser"}-${"1.0.7"}`;
7278
+ return this.userAgent || `ermis-chat-sdk-javascript-client-${this.node ? "node" : "browser"}-${"1.0.9"}`;
7265
7279
  }
7266
7280
  setUserAgent(userAgent) {
7267
7281
  this.userAgent = userAgent;