@supabase/storage-js 2.103.0 → 2.103.1-canary.0
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 +78 -75
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +8 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +78 -75
- package/dist/index.mjs.map +1 -1
- package/dist/umd/supabase.js +1 -1
- package/package.json +1 -1
- package/src/lib/common/errors.ts +10 -4
- package/src/lib/version.ts +1 -1
- package/src/packages/StorageFileApi.ts +8 -2
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,71 @@
|
|
|
1
1
|
let iceberg_js = require("iceberg-js");
|
|
2
2
|
|
|
3
|
+
//#region \0@oxc-project+runtime@0.101.0/helpers/typeof.js
|
|
4
|
+
function _typeof(o) {
|
|
5
|
+
"@babel/helpers - typeof";
|
|
6
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
|
|
7
|
+
return typeof o$1;
|
|
8
|
+
} : function(o$1) {
|
|
9
|
+
return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
|
|
10
|
+
}, _typeof(o);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region \0@oxc-project+runtime@0.101.0/helpers/toPrimitive.js
|
|
15
|
+
function toPrimitive(t, r) {
|
|
16
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
17
|
+
var e = t[Symbol.toPrimitive];
|
|
18
|
+
if (void 0 !== e) {
|
|
19
|
+
var i = e.call(t, r || "default");
|
|
20
|
+
if ("object" != _typeof(i)) return i;
|
|
21
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
22
|
+
}
|
|
23
|
+
return ("string" === r ? String : Number)(t);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region \0@oxc-project+runtime@0.101.0/helpers/toPropertyKey.js
|
|
28
|
+
function toPropertyKey(t) {
|
|
29
|
+
var i = toPrimitive(t, "string");
|
|
30
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region \0@oxc-project+runtime@0.101.0/helpers/defineProperty.js
|
|
35
|
+
function _defineProperty(e, r, t) {
|
|
36
|
+
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
37
|
+
value: t,
|
|
38
|
+
enumerable: !0,
|
|
39
|
+
configurable: !0,
|
|
40
|
+
writable: !0
|
|
41
|
+
}) : e[r] = t, e;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region \0@oxc-project+runtime@0.101.0/helpers/objectSpread2.js
|
|
46
|
+
function ownKeys(e, r) {
|
|
47
|
+
var t = Object.keys(e);
|
|
48
|
+
if (Object.getOwnPropertySymbols) {
|
|
49
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
50
|
+
r && (o = o.filter(function(r$1) {
|
|
51
|
+
return Object.getOwnPropertyDescriptor(e, r$1).enumerable;
|
|
52
|
+
})), t.push.apply(t, o);
|
|
53
|
+
}
|
|
54
|
+
return t;
|
|
55
|
+
}
|
|
56
|
+
function _objectSpread2(e) {
|
|
57
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
58
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
59
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function(r$1) {
|
|
60
|
+
_defineProperty(e, r$1, t[r$1]);
|
|
61
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {
|
|
62
|
+
Object.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return e;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
//#endregion
|
|
3
69
|
//#region src/lib/common/errors.ts
|
|
4
70
|
/**
|
|
5
71
|
* Base error class for all Storage errors
|
|
@@ -14,6 +80,14 @@ var StorageError = class extends Error {
|
|
|
14
80
|
this.status = status;
|
|
15
81
|
this.statusCode = statusCode;
|
|
16
82
|
}
|
|
83
|
+
toJSON() {
|
|
84
|
+
return {
|
|
85
|
+
name: this.name,
|
|
86
|
+
message: this.message,
|
|
87
|
+
status: this.status,
|
|
88
|
+
statusCode: this.statusCode
|
|
89
|
+
};
|
|
90
|
+
}
|
|
17
91
|
};
|
|
18
92
|
/**
|
|
19
93
|
* Type guard to check if an error is a StorageError
|
|
@@ -35,12 +109,7 @@ var StorageApiError = class extends StorageError {
|
|
|
35
109
|
this.statusCode = statusCode;
|
|
36
110
|
}
|
|
37
111
|
toJSON() {
|
|
38
|
-
return {
|
|
39
|
-
name: this.name,
|
|
40
|
-
message: this.message,
|
|
41
|
-
status: this.status,
|
|
42
|
-
statusCode: this.statusCode
|
|
43
|
-
};
|
|
112
|
+
return _objectSpread2({}, super.toJSON());
|
|
44
113
|
}
|
|
45
114
|
};
|
|
46
115
|
/**
|
|
@@ -175,72 +244,6 @@ const isValidBucketName = (bucketName) => {
|
|
|
175
244
|
return /^[\w!.\*'() &$@=;:+,?-]+$/.test(bucketName);
|
|
176
245
|
};
|
|
177
246
|
|
|
178
|
-
//#endregion
|
|
179
|
-
//#region \0@oxc-project+runtime@0.101.0/helpers/typeof.js
|
|
180
|
-
function _typeof(o) {
|
|
181
|
-
"@babel/helpers - typeof";
|
|
182
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
|
|
183
|
-
return typeof o$1;
|
|
184
|
-
} : function(o$1) {
|
|
185
|
-
return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
|
|
186
|
-
}, _typeof(o);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
//#endregion
|
|
190
|
-
//#region \0@oxc-project+runtime@0.101.0/helpers/toPrimitive.js
|
|
191
|
-
function toPrimitive(t, r) {
|
|
192
|
-
if ("object" != _typeof(t) || !t) return t;
|
|
193
|
-
var e = t[Symbol.toPrimitive];
|
|
194
|
-
if (void 0 !== e) {
|
|
195
|
-
var i = e.call(t, r || "default");
|
|
196
|
-
if ("object" != _typeof(i)) return i;
|
|
197
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
198
|
-
}
|
|
199
|
-
return ("string" === r ? String : Number)(t);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
//#endregion
|
|
203
|
-
//#region \0@oxc-project+runtime@0.101.0/helpers/toPropertyKey.js
|
|
204
|
-
function toPropertyKey(t) {
|
|
205
|
-
var i = toPrimitive(t, "string");
|
|
206
|
-
return "symbol" == _typeof(i) ? i : i + "";
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
//#endregion
|
|
210
|
-
//#region \0@oxc-project+runtime@0.101.0/helpers/defineProperty.js
|
|
211
|
-
function _defineProperty(e, r, t) {
|
|
212
|
-
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
213
|
-
value: t,
|
|
214
|
-
enumerable: !0,
|
|
215
|
-
configurable: !0,
|
|
216
|
-
writable: !0
|
|
217
|
-
}) : e[r] = t, e;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
//#endregion
|
|
221
|
-
//#region \0@oxc-project+runtime@0.101.0/helpers/objectSpread2.js
|
|
222
|
-
function ownKeys(e, r) {
|
|
223
|
-
var t = Object.keys(e);
|
|
224
|
-
if (Object.getOwnPropertySymbols) {
|
|
225
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
226
|
-
r && (o = o.filter(function(r$1) {
|
|
227
|
-
return Object.getOwnPropertyDescriptor(e, r$1).enumerable;
|
|
228
|
-
})), t.push.apply(t, o);
|
|
229
|
-
}
|
|
230
|
-
return t;
|
|
231
|
-
}
|
|
232
|
-
function _objectSpread2(e) {
|
|
233
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
234
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
235
|
-
r % 2 ? ownKeys(Object(t), !0).forEach(function(r$1) {
|
|
236
|
-
_defineProperty(e, r$1, t[r$1]);
|
|
237
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {
|
|
238
|
-
Object.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
return e;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
247
|
//#endregion
|
|
245
248
|
//#region src/lib/common/fetch.ts
|
|
246
249
|
/**
|
|
@@ -1091,7 +1094,7 @@ var StorageFileApi = class extends BaseApiClient {
|
|
|
1091
1094
|
* - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
|
|
1092
1095
|
*/
|
|
1093
1096
|
download(path, options, parameters) {
|
|
1094
|
-
const renderPath = typeof (options === null || options === void 0 ? void 0 : options.transform)
|
|
1097
|
+
const renderPath = typeof (options === null || options === void 0 ? void 0 : options.transform) === "object" && options.transform !== null && Object.keys(options.transform).length > 0 ? "render/image/authenticated" : "object";
|
|
1095
1098
|
const query = new URLSearchParams();
|
|
1096
1099
|
if (options === null || options === void 0 ? void 0 : options.transform) this.applyTransformOptsToQuery(query, options.transform);
|
|
1097
1100
|
if ((options === null || options === void 0 ? void 0 : options.cacheNonce) != null) query.set("cacheNonce", String(options.cacheNonce));
|
|
@@ -1235,7 +1238,7 @@ var StorageFileApi = class extends BaseApiClient {
|
|
|
1235
1238
|
if (options === null || options === void 0 ? void 0 : options.transform) this.applyTransformOptsToQuery(query, options.transform);
|
|
1236
1239
|
if ((options === null || options === void 0 ? void 0 : options.cacheNonce) != null) query.set("cacheNonce", String(options.cacheNonce));
|
|
1237
1240
|
const queryString = query.toString();
|
|
1238
|
-
const renderPath = typeof (options === null || options === void 0 ? void 0 : options.transform)
|
|
1241
|
+
const renderPath = typeof (options === null || options === void 0 ? void 0 : options.transform) === "object" && options.transform !== null && Object.keys(options.transform).length > 0 ? "render/image" : "object";
|
|
1239
1242
|
return { data: { publicUrl: encodeURI(`${this.url}/${renderPath}/public/${_path}`) + (queryString ? `?${queryString}` : "") } };
|
|
1240
1243
|
}
|
|
1241
1244
|
/**
|
|
@@ -1452,7 +1455,7 @@ var StorageFileApi = class extends BaseApiClient {
|
|
|
1452
1455
|
|
|
1453
1456
|
//#endregion
|
|
1454
1457
|
//#region src/lib/version.ts
|
|
1455
|
-
const version = "2.103.0";
|
|
1458
|
+
const version = "2.103.1-canary.0";
|
|
1456
1459
|
|
|
1457
1460
|
//#endregion
|
|
1458
1461
|
//#region src/lib/constants.ts
|