triangle-utils 1.4.118 → 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.
- package/dist/src/UtilsS3.d.ts +1 -0
- package/dist/src/UtilsS3.js +3 -1
- package/package.json +1 -1
- package/src/UtilsS3.ts +5 -2
package/dist/src/UtilsS3.d.ts
CHANGED
|
@@ -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>;
|
package/dist/src/UtilsS3.js
CHANGED
|
@@ -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
package/src/UtilsS3.ts
CHANGED
|
@@ -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
|
}
|