@aws-sdk/lib-storage 3.677.0 → 3.678.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 +8 -4
- package/dist-es/Upload.js +4 -4
- package/dist-types/Upload.d.ts +5 -0
- package/dist-types/ts3.4/Upload.d.ts +1 -0
- package/package.json +7 -5
package/dist-cjs/index.js
CHANGED
|
@@ -170,7 +170,6 @@ var getChunk = /* @__PURE__ */ __name((data, partSize) => {
|
|
|
170
170
|
}, "getChunk");
|
|
171
171
|
|
|
172
172
|
// src/Upload.ts
|
|
173
|
-
var MIN_PART_SIZE = 1024 * 1024 * 5;
|
|
174
173
|
var _Upload = class _Upload extends import_events.EventEmitter {
|
|
175
174
|
constructor(options) {
|
|
176
175
|
super();
|
|
@@ -180,7 +179,7 @@ var _Upload = class _Upload extends import_events.EventEmitter {
|
|
|
180
179
|
this.MAX_PARTS = 1e4;
|
|
181
180
|
// Defaults.
|
|
182
181
|
this.queueSize = 4;
|
|
183
|
-
this.partSize = MIN_PART_SIZE;
|
|
182
|
+
this.partSize = _Upload.MIN_PART_SIZE;
|
|
184
183
|
this.leavePartsOnError = false;
|
|
185
184
|
this.tags = [];
|
|
186
185
|
this.concurrentUploaders = [];
|
|
@@ -464,9 +463,9 @@ var _Upload = class _Upload extends import_events.EventEmitter {
|
|
|
464
463
|
if (!this.client) {
|
|
465
464
|
throw new Error(`InputError: Upload requires a AWS client to do uploads with.`);
|
|
466
465
|
}
|
|
467
|
-
if (this.partSize < MIN_PART_SIZE) {
|
|
466
|
+
if (this.partSize < _Upload.MIN_PART_SIZE) {
|
|
468
467
|
throw new Error(
|
|
469
|
-
`EntityTooSmall: Your proposed upload partsize [${this.partSize}] is smaller than the minimum allowed size [${MIN_PART_SIZE}] (5MB)`
|
|
468
|
+
`EntityTooSmall: Your proposed upload partsize [${this.partSize}] is smaller than the minimum allowed size [${_Upload.MIN_PART_SIZE}] (5MB)`
|
|
470
469
|
);
|
|
471
470
|
}
|
|
472
471
|
if (this.queueSize < 1) {
|
|
@@ -475,6 +474,11 @@ var _Upload = class _Upload extends import_events.EventEmitter {
|
|
|
475
474
|
}
|
|
476
475
|
};
|
|
477
476
|
__name(_Upload, "Upload");
|
|
477
|
+
/**
|
|
478
|
+
* @internal
|
|
479
|
+
* modified in testing only.
|
|
480
|
+
*/
|
|
481
|
+
_Upload.MIN_PART_SIZE = 1024 * 1024 * 5;
|
|
478
482
|
var Upload = _Upload;
|
|
479
483
|
// Annotate the CommonJS export names for ESM import in node:
|
|
480
484
|
|
package/dist-es/Upload.js
CHANGED
|
@@ -5,13 +5,12 @@ import { extendedEncodeURIComponent } from "@smithy/smithy-client";
|
|
|
5
5
|
import { EventEmitter } from "events";
|
|
6
6
|
import { byteLength } from "./bytelength";
|
|
7
7
|
import { getChunk } from "./chunker";
|
|
8
|
-
const MIN_PART_SIZE = 1024 * 1024 * 5;
|
|
9
8
|
export class Upload extends EventEmitter {
|
|
10
9
|
constructor(options) {
|
|
11
10
|
super();
|
|
12
11
|
this.MAX_PARTS = 10000;
|
|
13
12
|
this.queueSize = 4;
|
|
14
|
-
this.partSize = MIN_PART_SIZE;
|
|
13
|
+
this.partSize = Upload.MIN_PART_SIZE;
|
|
15
14
|
this.leavePartsOnError = false;
|
|
16
15
|
this.tags = [];
|
|
17
16
|
this.concurrentUploaders = [];
|
|
@@ -281,11 +280,12 @@ export class Upload extends EventEmitter {
|
|
|
281
280
|
if (!this.client) {
|
|
282
281
|
throw new Error(`InputError: Upload requires a AWS client to do uploads with.`);
|
|
283
282
|
}
|
|
284
|
-
if (this.partSize < MIN_PART_SIZE) {
|
|
285
|
-
throw new Error(`EntityTooSmall: Your proposed upload partsize [${this.partSize}] is smaller than the minimum allowed size [${MIN_PART_SIZE}] (5MB)`);
|
|
283
|
+
if (this.partSize < Upload.MIN_PART_SIZE) {
|
|
284
|
+
throw new Error(`EntityTooSmall: Your proposed upload partsize [${this.partSize}] is smaller than the minimum allowed size [${Upload.MIN_PART_SIZE}] (5MB)`);
|
|
286
285
|
}
|
|
287
286
|
if (this.queueSize < 1) {
|
|
288
287
|
throw new Error(`Queue size: Must have at least one uploading queue.`);
|
|
289
288
|
}
|
|
290
289
|
}
|
|
291
290
|
}
|
|
291
|
+
Upload.MIN_PART_SIZE = 1024 * 1024 * 5;
|
package/dist-types/Upload.d.ts
CHANGED
|
@@ -8,6 +8,11 @@ export interface RawDataPart {
|
|
|
8
8
|
lastPart?: boolean;
|
|
9
9
|
}
|
|
10
10
|
export declare class Upload extends EventEmitter {
|
|
11
|
+
/**
|
|
12
|
+
* @internal
|
|
13
|
+
* modified in testing only.
|
|
14
|
+
*/
|
|
15
|
+
private static MIN_PART_SIZE;
|
|
11
16
|
/**
|
|
12
17
|
* S3 multipart upload does not allow more than 10,000 parts.
|
|
13
18
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/lib-storage",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.678.0",
|
|
4
4
|
"description": "Storage higher order operation",
|
|
5
5
|
"main": "./dist-cjs/index.js",
|
|
6
6
|
"module": "./dist-es/index.js",
|
|
@@ -14,8 +14,10 @@
|
|
|
14
14
|
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
|
|
15
15
|
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
|
|
16
16
|
"extract:docs": "api-extractor run --local",
|
|
17
|
-
"test": "
|
|
18
|
-
"test:e2e": "
|
|
17
|
+
"test": "vitest run",
|
|
18
|
+
"test:e2e": "vitest run -c vitest.config.e2e.ts",
|
|
19
|
+
"test:watch": "vitest watch",
|
|
20
|
+
"test:e2e:watch": "vitest watch -c vitest.config.e2e.ts"
|
|
19
21
|
},
|
|
20
22
|
"engines": {
|
|
21
23
|
"node": ">=16.0.0"
|
|
@@ -35,10 +37,10 @@
|
|
|
35
37
|
"tslib": "^2.6.2"
|
|
36
38
|
},
|
|
37
39
|
"peerDependencies": {
|
|
38
|
-
"@aws-sdk/client-s3": "^3.
|
|
40
|
+
"@aws-sdk/client-s3": "^3.678.0"
|
|
39
41
|
},
|
|
40
42
|
"devDependencies": {
|
|
41
|
-
"@aws-sdk/client-s3": "3.
|
|
43
|
+
"@aws-sdk/client-s3": "3.678.0",
|
|
42
44
|
"@smithy/types": "^3.5.0",
|
|
43
45
|
"@tsconfig/recommended": "1.0.1",
|
|
44
46
|
"@types/node": "^16.18.96",
|