triangle-utils 1.4.117 → 1.4.119

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.
@@ -7,7 +7,7 @@ interface S3Input {
7
7
  export declare class UtilsS3 {
8
8
  private readonly s3;
9
9
  constructor(region: string);
10
- get_client(): Promise<S3>;
10
+ get_client(): S3;
11
11
  get_s3_input(s3_id: string): S3Input | undefined;
12
12
  get_headers(s3_id: string): Promise<{
13
13
  DeleteMarker?: boolean | undefined;
@@ -68,6 +68,7 @@ export declare class UtilsS3 {
68
68
  }): Promise<import("@aws-sdk/client-s3").PutObjectCommandOutput | undefined>;
69
69
  upload(s3_id: string, content: string | Buffer | Readable, options?: {
70
70
  content_type_id?: string;
71
+ part_size?: number;
71
72
  }): Promise<void>;
72
73
  delete(s3_id: string): Promise<void>;
73
74
  get_download_url(s3_id: string): Promise<string | undefined>;
@@ -7,7 +7,7 @@ export class UtilsS3 {
7
7
  constructor(region) {
8
8
  this.s3 = new S3({ region: region });
9
9
  }
10
- async get_client() {
10
+ get_client() {
11
11
  return this.s3;
12
12
  }
13
13
  get_s3_input(s3_id) {
@@ -152,6 +152,7 @@ export class UtilsS3 {
152
152
  }
153
153
  async upload(s3_id, content, options = {}) {
154
154
  const content_type_id = options.content_type_id !== undefined ? options.content_type_id : undefined;
155
+ const part_size = options.part_size !== undefined ? options.part_size : undefined;
155
156
  const s3_input = this.get_s3_input(s3_id);
156
157
  if (s3_input === undefined) {
157
158
  return undefined;
@@ -162,7 +163,8 @@ export class UtilsS3 {
162
163
  ...s3_input,
163
164
  Body: content,
164
165
  ContentType: content_type_id
165
- }
166
+ },
167
+ partSize: part_size
166
168
  });
167
169
  await upload.done();
168
170
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-utils",
3
- "version": "1.4.117",
3
+ "version": "1.4.119",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "directories": {
package/src/UtilsS3.ts CHANGED
@@ -16,7 +16,7 @@ export class UtilsS3 {
16
16
  this.s3 = new S3({ region : region })
17
17
  }
18
18
 
19
- async get_client() {
19
+ get_client() {
20
20
  return this.s3
21
21
  }
22
22
 
@@ -167,9 +167,11 @@ export class UtilsS3 {
167
167
  }
168
168
 
169
169
  async upload(s3_id : string, content : string | Buffer | Readable, options : {
170
- content_type_id? : string
170
+ content_type_id? : string,
171
+ part_size? : number
171
172
  } = {}) : Promise<void> {
172
173
  const content_type_id = options.content_type_id !== undefined ? options.content_type_id : undefined
174
+ const part_size = options.part_size !== undefined ? options.part_size : undefined
173
175
  const s3_input = this.get_s3_input(s3_id)
174
176
  if (s3_input === undefined) {
175
177
  return undefined
@@ -180,7 +182,8 @@ export class UtilsS3 {
180
182
  ...s3_input,
181
183
  Body : content,
182
184
  ContentType : content_type_id
183
- }
185
+ },
186
+ partSize : part_size
184
187
  })
185
188
  await upload.done()
186
189
  }