plenna_utilities 1.1.0 → 1.1.2

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.
@@ -1,9 +1,9 @@
1
- import { type ObjectCannedACL, type PutObjectCommandInput } from '@aws-sdk/client-s3';
1
+ import { type ObjectCannedACL, type PutObjectCommandInput, type S3ClientConfig } from '@aws-sdk/client-s3';
2
2
  export declare class PlennaS3Service {
3
3
  private readonly bucket;
4
4
  private readonly acl;
5
5
  private readonly options;
6
6
  constructor(bucket: string, acl: ObjectCannedACL, options?: Partial<PutObjectCommandInput>);
7
- getPresignedUrl(keyName: string): Promise<string>;
7
+ getPresignedUrl(keyName: string, clientConfig?: S3ClientConfig): Promise<string>;
8
8
  upload(fileName: string, file: PutObjectCommandInput['Body'], options?: Partial<PutObjectCommandInput>): Promise<string>;
9
9
  }
@@ -13,8 +13,8 @@ class PlennaS3Service {
13
13
  this.acl = acl;
14
14
  this.options = options;
15
15
  }
16
- async getPresignedUrl(keyName) {
17
- const s3Client = new client_s3_1.S3Client({ region: REGION });
16
+ async getPresignedUrl(keyName, clientConfig = {}) {
17
+ const s3Client = new client_s3_1.S3Client({ region: REGION, ...clientConfig });
18
18
  const command = new client_s3_1.PutObjectCommand({
19
19
  ...this.options,
20
20
  Bucket: this.bucket,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plenna_utilities",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "plenna's utils for backend projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",