@budibase/backend-core 2.27.5 → 2.27.6
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.js +15 -3
- package/dist/index.js.map +2 -2
- package/dist/index.js.meta.json +1 -1
- package/dist/package.json +4 -4
- package/dist/plugins.js.map +1 -1
- package/dist/plugins.js.meta.json +1 -1
- package/dist/src/objectStore/objectStore.d.ts +10 -2
- package/dist/src/objectStore/objectStore.js +13 -2
- package/dist/src/objectStore/objectStore.js.map +1 -1
- package/package.json +4 -4
- package/src/objectStore/objectStore.ts +21 -7
package/dist/index.js
CHANGED
|
@@ -58686,6 +58686,9 @@ async function streamUpload({
|
|
|
58686
58686
|
extra,
|
|
58687
58687
|
ttl
|
|
58688
58688
|
}) {
|
|
58689
|
+
if (!stream3) {
|
|
58690
|
+
throw new Error("Stream to upload is invalid/undefined");
|
|
58691
|
+
}
|
|
58689
58692
|
const extension = filename.split(".").pop();
|
|
58690
58693
|
const objectStore = ObjectStore(bucketName);
|
|
58691
58694
|
const bucketCreated = await createBucketIfNotExists(objectStore, bucketName);
|
|
@@ -58708,14 +58711,23 @@ async function streamUpload({
|
|
|
58708
58711
|
if (!contentType) {
|
|
58709
58712
|
contentType = extension ? CONTENT_TYPE_MAP[extension.toLowerCase()] : CONTENT_TYPE_MAP.txt;
|
|
58710
58713
|
}
|
|
58714
|
+
const bucket = sanitizeBucket(bucketName), objKey = sanitizeKey(filename);
|
|
58711
58715
|
const params2 = {
|
|
58712
|
-
Bucket:
|
|
58713
|
-
Key:
|
|
58716
|
+
Bucket: bucket,
|
|
58717
|
+
Key: objKey,
|
|
58714
58718
|
Body: stream3,
|
|
58715
58719
|
ContentType: contentType,
|
|
58716
58720
|
...extra
|
|
58717
58721
|
};
|
|
58718
|
-
|
|
58722
|
+
const details = await objectStore.upload(params2).promise();
|
|
58723
|
+
const headDetails = await objectStore.headObject({
|
|
58724
|
+
Bucket: bucket,
|
|
58725
|
+
Key: objKey
|
|
58726
|
+
}).promise();
|
|
58727
|
+
return {
|
|
58728
|
+
...details,
|
|
58729
|
+
ContentLength: headDetails.ContentLength
|
|
58730
|
+
};
|
|
58719
58731
|
}
|
|
58720
58732
|
async function retrieve(bucketName, filepath) {
|
|
58721
58733
|
const objectStore = ObjectStore(bucketName);
|