@aws-sdk/lib-storage 3.896.0 → 3.899.0
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-cjs/index.js +4 -4
- package/dist-es/Upload.js +5 -4
- package/package.json +5 -5
package/dist-cjs/index.js
CHANGED
|
@@ -215,10 +215,13 @@ var Upload = class _Upload extends import_events.EventEmitter {
|
|
|
215
215
|
this.tags = options.tags || this.tags;
|
|
216
216
|
this.client = options.client;
|
|
217
217
|
this.params = options.params;
|
|
218
|
+
if (!this.params) {
|
|
219
|
+
throw new Error(`InputError: Upload requires params to be passed to upload.`);
|
|
220
|
+
}
|
|
218
221
|
this.totalBytes = byteLength(this.params.Body);
|
|
219
222
|
this.bytesUploadedSoFar = 0;
|
|
220
223
|
this.abortController = options.abortController ?? new import_abort_controller.AbortController();
|
|
221
|
-
this.partSize = Math.max(_Upload.MIN_PART_SIZE, Math.floor((this.totalBytes || 0) / this.MAX_PARTS));
|
|
224
|
+
this.partSize = options.partSize || Math.max(_Upload.MIN_PART_SIZE, Math.floor((this.totalBytes || 0) / this.MAX_PARTS));
|
|
222
225
|
this.expectedPartsCount = this.totalBytes !== void 0 ? Math.ceil(this.totalBytes / this.partSize) : void 0;
|
|
223
226
|
this.__validateInput();
|
|
224
227
|
}
|
|
@@ -504,9 +507,6 @@ var Upload = class _Upload extends import_events.EventEmitter {
|
|
|
504
507
|
}
|
|
505
508
|
}
|
|
506
509
|
__validateInput() {
|
|
507
|
-
if (!this.params) {
|
|
508
|
-
throw new Error(`InputError: Upload requires params to be passed to upload.`);
|
|
509
|
-
}
|
|
510
510
|
if (!this.client) {
|
|
511
511
|
throw new Error(`InputError: Upload requires a AWS client to do uploads with.`);
|
|
512
512
|
}
|
package/dist-es/Upload.js
CHANGED
|
@@ -35,10 +35,14 @@ export class Upload extends EventEmitter {
|
|
|
35
35
|
this.tags = options.tags || this.tags;
|
|
36
36
|
this.client = options.client;
|
|
37
37
|
this.params = options.params;
|
|
38
|
+
if (!this.params) {
|
|
39
|
+
throw new Error(`InputError: Upload requires params to be passed to upload.`);
|
|
40
|
+
}
|
|
38
41
|
this.totalBytes = byteLength(this.params.Body);
|
|
39
42
|
this.bytesUploadedSoFar = 0;
|
|
40
43
|
this.abortController = options.abortController ?? new AbortController();
|
|
41
|
-
this.partSize =
|
|
44
|
+
this.partSize =
|
|
45
|
+
options.partSize || Math.max(Upload.MIN_PART_SIZE, Math.floor((this.totalBytes || 0) / this.MAX_PARTS));
|
|
42
46
|
this.expectedPartsCount = this.totalBytes !== undefined ? Math.ceil(this.totalBytes / this.partSize) : undefined;
|
|
43
47
|
this.__validateInput();
|
|
44
48
|
}
|
|
@@ -307,9 +311,6 @@ export class Upload extends EventEmitter {
|
|
|
307
311
|
}
|
|
308
312
|
}
|
|
309
313
|
__validateInput() {
|
|
310
|
-
if (!this.params) {
|
|
311
|
-
throw new Error(`InputError: Upload requires params to be passed to upload.`);
|
|
312
|
-
}
|
|
313
314
|
if (!this.client) {
|
|
314
315
|
throw new Error(`InputError: Upload requires a AWS client to do uploads with.`);
|
|
315
316
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/lib-storage",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.899.0",
|
|
4
4
|
"description": "Storage higher order operation",
|
|
5
5
|
"main": "./dist-cjs/index.js",
|
|
6
6
|
"module": "./dist-es/index.js",
|
|
@@ -29,18 +29,18 @@
|
|
|
29
29
|
"license": "Apache-2.0",
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@smithy/abort-controller": "^4.1.1",
|
|
32
|
-
"@smithy/middleware-endpoint": "^4.2.
|
|
33
|
-
"@smithy/smithy-client": "^4.6.
|
|
32
|
+
"@smithy/middleware-endpoint": "^4.2.5",
|
|
33
|
+
"@smithy/smithy-client": "^4.6.5",
|
|
34
34
|
"buffer": "5.6.0",
|
|
35
35
|
"events": "3.3.0",
|
|
36
36
|
"stream-browserify": "3.0.0",
|
|
37
37
|
"tslib": "^2.6.2"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@aws-sdk/client-s3": "^3.
|
|
40
|
+
"@aws-sdk/client-s3": "^3.899.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@aws-sdk/client-s3": "3.
|
|
43
|
+
"@aws-sdk/client-s3": "3.899.0",
|
|
44
44
|
"@smithy/types": "^4.5.0",
|
|
45
45
|
"@tsconfig/recommended": "1.0.1",
|
|
46
46
|
"@types/node": "^18.19.69",
|