@supabase/storage-js 2.95.2 → 2.95.3

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
@@ -957,6 +957,7 @@ var StorageFileApi = class extends BaseApiClient {
957
957
  * @category File Buckets
958
958
  * @param path The full path and file name of the file to be downloaded. For example `folder/image.png`.
959
959
  * @param options.transform Transform the asset before serving it to the client.
960
+ * @param parameters Additional fetch parameters like signal for cancellation. Supports standard fetch options including cache control.
960
961
  * @returns BlobDownloadBuilder instance for downloading the file
961
962
  *
962
963
  * @example Download file
@@ -988,8 +989,27 @@ var StorageFileApi = class extends BaseApiClient {
988
989
  * }
989
990
  * })
990
991
  * ```
992
+ *
993
+ * @example Download with cache control (useful in Edge Functions)
994
+ * ```js
995
+ * const { data, error } = await supabase
996
+ * .storage
997
+ * .from('avatars')
998
+ * .download('folder/avatar1.png', {}, { cache: 'no-store' })
999
+ * ```
1000
+ *
1001
+ * @example Download with abort signal
1002
+ * ```js
1003
+ * const controller = new AbortController()
1004
+ * setTimeout(() => controller.abort(), 5000)
1005
+ *
1006
+ * const { data, error } = await supabase
1007
+ * .storage
1008
+ * .from('avatars')
1009
+ * .download('folder/avatar1.png', {}, { signal: controller.signal })
1010
+ * ```
991
1011
  */
992
- download(path, options) {
1012
+ download(path, options, parameters) {
993
1013
  const renderPath = typeof (options === null || options === void 0 ? void 0 : options.transform) !== "undefined" ? "render/image/authenticated" : "object";
994
1014
  const transformationQuery = this.transformOptsToQueryString((options === null || options === void 0 ? void 0 : options.transform) || {});
995
1015
  const queryString = transformationQuery ? `?${transformationQuery}` : "";
@@ -997,7 +1017,7 @@ var StorageFileApi = class extends BaseApiClient {
997
1017
  const downloadFn = () => get(this.fetch, `${this.url}/${renderPath}/${_path}${queryString}`, {
998
1018
  headers: this.headers,
999
1019
  noResolveJson: true
1000
- });
1020
+ }, parameters);
1001
1021
  return new BlobDownloadBuilder(downloadFn, this.shouldThrowOnError);
1002
1022
  }
1003
1023
  /**
@@ -1264,7 +1284,7 @@ var StorageFileApi = class extends BaseApiClient {
1264
1284
 
1265
1285
  //#endregion
1266
1286
  //#region src/lib/version.ts
1267
- const version = "2.95.2";
1287
+ const version = "2.95.3";
1268
1288
 
1269
1289
  //#endregion
1270
1290
  //#region src/lib/constants.ts