@ducktors/storagebus-s3
Advanced tools
Comparing version
@@ -6,3 +6,9 @@ /// <reference types="node" /> | ||
import { AbstractStorageOptions, Storage as AbstractStorage } from '@ducktors/storagebus-abstract'; | ||
export type EntryptionOptions = { | ||
export type StorageOptions = { | ||
bucket: string; | ||
region?: string; | ||
accessKeyId?: string; | ||
secretAccessKey?: string; | ||
} & AbstractStorageOptions; | ||
type EntryptionOptions = { | ||
entryption?: { | ||
@@ -19,8 +25,3 @@ ServerSideEncryption: `${ServerSideEncryption}`; | ||
protected bucket: string; | ||
constructor(opts?: { | ||
region?: string; | ||
bucket?: string; | ||
accessKeyId?: string; | ||
secretAccessKey?: string; | ||
} & AbstractStorageOptions); | ||
constructor(opts: StorageOptions); | ||
write(key: string, fileReadable: Readable, opts?: WriteOpts): Promise<string>; | ||
@@ -33,1 +34,2 @@ exists(key: string): Promise<boolean>; | ||
} | ||
export {}; |
@@ -23,3 +23,3 @@ "use strict"; | ||
}); | ||
const { region, bucket, accessKeyId, secretAccessKey } = opts ?? {}; | ||
const { bucket, region, accessKeyId, secretAccessKey } = opts; | ||
this.client = new client_s3_1.S3Client({ | ||
@@ -29,3 +29,3 @@ ...(region ? { region } : {}), | ||
}); | ||
this.bucket = bucket ?? ''; | ||
this.bucket = bucket; | ||
} | ||
@@ -32,0 +32,0 @@ async write(key, fileReadable, opts) { |
{ | ||
"name": "@ducktors/storagebus-s3", | ||
"version": "0.10.1", | ||
"version": "0.11.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
140
1.45%14167
-0.06%