aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/object-storage/shared/object-storage-helpers.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/object-storage/shared/object-storage-helpers.ts')
-rw-r--r--server/lib/object-storage/shared/object-storage-helpers.ts17
1 files changed, 16 insertions, 1 deletions
diff --git a/server/lib/object-storage/shared/object-storage-helpers.ts b/server/lib/object-storage/shared/object-storage-helpers.ts
index be94b01a8..f517c5f69 100644
--- a/server/lib/object-storage/shared/object-storage-helpers.ts
+++ b/server/lib/object-storage/shared/object-storage-helpers.ts
@@ -59,6 +59,20 @@ async function storeObject (options: {
59 return uploadToStorage({ objectStorageKey, content: fileStream, bucketInfo, isPrivate }) 59 return uploadToStorage({ objectStorageKey, content: fileStream, bucketInfo, isPrivate })
60} 60}
61 61
62async function storeContent (options: {
63 content: string
64 inputPath: string
65 objectStorageKey: string
66 bucketInfo: BucketInfo
67 isPrivate: boolean
68}): Promise<string> {
69 const { content, objectStorageKey, bucketInfo, inputPath, isPrivate } = options
70
71 logger.debug('Uploading %s content to %s%s in bucket %s', inputPath, bucketInfo.PREFIX, objectStorageKey, bucketInfo.BUCKET_NAME, lTags())
72
73 return uploadToStorage({ objectStorageKey, content, bucketInfo, isPrivate })
74}
75
62// --------------------------------------------------------------------------- 76// ---------------------------------------------------------------------------
63 77
64async function updateObjectACL (options: { 78async function updateObjectACL (options: {
@@ -206,6 +220,7 @@ export {
206 buildKey, 220 buildKey,
207 221
208 storeObject, 222 storeObject,
223 storeContent,
209 224
210 removeObject, 225 removeObject,
211 removeObjectByFullKey, 226 removeObjectByFullKey,
@@ -223,7 +238,7 @@ export {
223// --------------------------------------------------------------------------- 238// ---------------------------------------------------------------------------
224 239
225async function uploadToStorage (options: { 240async function uploadToStorage (options: {
226 content: ReadStream 241 content: ReadStream | string
227 objectStorageKey: string 242 objectStorageKey: string
228 bucketInfo: BucketInfo 243 bucketInfo: BucketInfo
229 isPrivate: boolean 244 isPrivate: boolean