@supabase/storage-js 2.119.0-canary.2 → 2.119.0-canary.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 +7 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +7 -3
- package/dist/index.mjs.map +1 -1
- package/dist/umd/supabase.js +1 -1
- package/package.json +1 -1
- package/src/lib/types.ts +3 -3
- package/src/lib/version.ts +1 -1
- package/src/packages/StorageFileApi.ts +9 -2
package/dist/index.cjs
CHANGED
|
@@ -600,6 +600,10 @@ const DEFAULT_FILE_OPTIONS = {
|
|
|
600
600
|
contentType: "text/plain;charset=UTF-8",
|
|
601
601
|
upsert: false
|
|
602
602
|
};
|
|
603
|
+
function mergeFileOptions(fileOptions) {
|
|
604
|
+
const definedOptions = Object.fromEntries(Object.entries(fileOptions !== null && fileOptions !== void 0 ? fileOptions : {}).filter(([, value]) => value !== void 0));
|
|
605
|
+
return _objectSpread2(_objectSpread2({}, DEFAULT_FILE_OPTIONS), definedOptions);
|
|
606
|
+
}
|
|
603
607
|
var StorageFileApi = class extends BaseApiClient {
|
|
604
608
|
constructor(url, headers = {}, bucketId, fetch$1) {
|
|
605
609
|
super(url, headers, fetch$1, "storage");
|
|
@@ -616,7 +620,7 @@ var StorageFileApi = class extends BaseApiClient {
|
|
|
616
620
|
var _this = this;
|
|
617
621
|
return _this.handleOperation(async () => {
|
|
618
622
|
let body;
|
|
619
|
-
const options =
|
|
623
|
+
const options = mergeFileOptions(fileOptions);
|
|
620
624
|
let headers = _objectSpread2(_objectSpread2({}, _this.headers), method === "POST" && { "x-upsert": String(options.upsert) });
|
|
621
625
|
const metadata = options.metadata;
|
|
622
626
|
if (typeof Blob !== "undefined" && fileBody instanceof Blob || typeof FormData !== "undefined" && fileBody instanceof FormData) body = _this.prepareUploadFormData(fileBody, options);
|
|
@@ -755,7 +759,7 @@ var StorageFileApi = class extends BaseApiClient {
|
|
|
755
759
|
url.searchParams.set("token", token);
|
|
756
760
|
return _this3.handleOperation(async () => {
|
|
757
761
|
let body;
|
|
758
|
-
const options =
|
|
762
|
+
const options = mergeFileOptions(fileOptions);
|
|
759
763
|
let headers = _objectSpread2(_objectSpread2({}, _this3.headers), { "x-upsert": String(options.upsert) });
|
|
760
764
|
const metadata = options.metadata;
|
|
761
765
|
if (typeof Blob !== "undefined" && fileBody instanceof Blob || typeof FormData !== "undefined" && fileBody instanceof FormData) body = _this3.prepareUploadFormData(fileBody, options);
|
|
@@ -1647,7 +1651,7 @@ var StorageFileApi = class extends BaseApiClient {
|
|
|
1647
1651
|
|
|
1648
1652
|
//#endregion
|
|
1649
1653
|
//#region src/lib/version.ts
|
|
1650
|
-
const version = "2.119.0-canary.
|
|
1654
|
+
const version = "2.119.0-canary.3";
|
|
1651
1655
|
|
|
1652
1656
|
//#endregion
|
|
1653
1657
|
//#region src/lib/constants.ts
|