@aws-sdk/lib-storage 3.1127.0 → 3.1129.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 -7
- package/dist-es/Upload.js +1 -0
- package/dist-es/byteLength.js +1 -1
- package/dist-es/byteLengthSource.js +3 -3
- package/dist-es/runtimeConfig.js +2 -2
- package/dist-es/runtimeConfig.shared.js +1 -1
- package/dist-types/byteLengthSource.d.ts +1 -1
- package/dist-types/runtimeConfig.browser.d.ts +1 -1
- package/dist-types/runtimeConfig.d.ts +1 -1
- package/dist-types/runtimeConfig.native.d.ts +1 -1
- package/dist-types/runtimeConfig.shared.d.ts +1 -1
- package/dist-types/ts3.4/byteLengthSource.d.ts +1 -1
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +1 -1
- package/dist-types/ts3.4/runtimeConfig.d.ts +1 -1
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +1 -1
- package/dist-types/ts3.4/runtimeConfig.shared.d.ts +1 -1
- package/package.json +3 -3
package/dist-cjs/index.js
CHANGED
|
@@ -3,11 +3,11 @@ const { toEndpointV1, getEndpointFromInstructions } = require("@smithy/core/endp
|
|
|
3
3
|
const { extendedEncodeURIComponent } = require("@smithy/core/protocols");
|
|
4
4
|
const { EventEmitter } = require("events");
|
|
5
5
|
const { Buffer } = require("buffer");
|
|
6
|
-
const {
|
|
6
|
+
const { statSync, ReadStream } = require("node:fs");
|
|
7
7
|
const { Readable } = require("stream");
|
|
8
8
|
|
|
9
9
|
const runtimeConfigShared = {
|
|
10
|
-
|
|
10
|
+
statSync: () => { },
|
|
11
11
|
isFileReadStream(f) {
|
|
12
12
|
return false;
|
|
13
13
|
},
|
|
@@ -16,7 +16,7 @@ const runtimeConfigShared = {
|
|
|
16
16
|
const runtimeConfig = {
|
|
17
17
|
...runtimeConfigShared,
|
|
18
18
|
runtime: "node",
|
|
19
|
-
|
|
19
|
+
statSync,
|
|
20
20
|
isFileReadStream(f) {
|
|
21
21
|
return f instanceof ReadStream;
|
|
22
22
|
},
|
|
@@ -43,7 +43,7 @@ const byteLength = (input) => {
|
|
|
43
43
|
}
|
|
44
44
|
else if (runtimeConfig.isFileReadStream(input)) {
|
|
45
45
|
try {
|
|
46
|
-
return runtimeConfig.
|
|
46
|
+
return runtimeConfig.statSync(input.path).size;
|
|
47
47
|
}
|
|
48
48
|
catch (error) {
|
|
49
49
|
return undefined;
|
|
@@ -61,7 +61,7 @@ var BYTE_LENGTH_SOURCE;
|
|
|
61
61
|
BYTE_LENGTH_SOURCE["LENGTH"] = "the value of Body.length";
|
|
62
62
|
BYTE_LENGTH_SOURCE["SIZE"] = "the value of Body.size";
|
|
63
63
|
BYTE_LENGTH_SOURCE["START_END_DIFF"] = "the numeric difference between Body.start and Body.end";
|
|
64
|
-
BYTE_LENGTH_SOURCE["
|
|
64
|
+
BYTE_LENGTH_SOURCE["STAT"] = "the size of the file given by Body.path on disk as reported by statSync";
|
|
65
65
|
})(BYTE_LENGTH_SOURCE || (BYTE_LENGTH_SOURCE = {}));
|
|
66
66
|
const byteLengthSource = (input, override) => {
|
|
67
67
|
if (override != null) {
|
|
@@ -87,8 +87,8 @@ const byteLengthSource = (input, override) => {
|
|
|
87
87
|
}
|
|
88
88
|
else if (runtimeConfig.isFileReadStream(input)) {
|
|
89
89
|
try {
|
|
90
|
-
runtimeConfig.
|
|
91
|
-
return BYTE_LENGTH_SOURCE.
|
|
90
|
+
runtimeConfig.statSync(input.path).size;
|
|
91
|
+
return BYTE_LENGTH_SOURCE.STAT;
|
|
92
92
|
}
|
|
93
93
|
catch (error) {
|
|
94
94
|
return undefined;
|
|
@@ -442,6 +442,7 @@ class Upload extends EventEmitter {
|
|
|
442
442
|
if (this.isMultiPart) {
|
|
443
443
|
const { expectedPartsCount, uploadedParts, totalBytes, totalBytesSource } = this;
|
|
444
444
|
if (totalBytes !== undefined && expectedPartsCount !== undefined && uploadedParts.length !== expectedPartsCount) {
|
|
445
|
+
await this.markUploadAsAborted();
|
|
445
446
|
throw new Error(`Expected ${expectedPartsCount} part(s) but uploaded ${uploadedParts.length} part(s).
|
|
446
447
|
The expected part count is based on the byte-count of the input.params.Body,
|
|
447
448
|
which was read from ${totalBytesSource} and is ${totalBytes}.
|
package/dist-es/Upload.js
CHANGED
|
@@ -252,6 +252,7 @@ export class Upload extends EventEmitter {
|
|
|
252
252
|
if (this.isMultiPart) {
|
|
253
253
|
const { expectedPartsCount, uploadedParts, totalBytes, totalBytesSource } = this;
|
|
254
254
|
if (totalBytes !== undefined && expectedPartsCount !== undefined && uploadedParts.length !== expectedPartsCount) {
|
|
255
|
+
await this.markUploadAsAborted();
|
|
255
256
|
throw new Error(`Expected ${expectedPartsCount} part(s) but uploaded ${uploadedParts.length} part(s).
|
|
256
257
|
The expected part count is based on the byte-count of the input.params.Body,
|
|
257
258
|
which was read from ${totalBytesSource} and is ${totalBytes}.
|
package/dist-es/byteLength.js
CHANGED
|
@@ -8,7 +8,7 @@ export var BYTE_LENGTH_SOURCE;
|
|
|
8
8
|
BYTE_LENGTH_SOURCE["LENGTH"] = "the value of Body.length";
|
|
9
9
|
BYTE_LENGTH_SOURCE["SIZE"] = "the value of Body.size";
|
|
10
10
|
BYTE_LENGTH_SOURCE["START_END_DIFF"] = "the numeric difference between Body.start and Body.end";
|
|
11
|
-
BYTE_LENGTH_SOURCE["
|
|
11
|
+
BYTE_LENGTH_SOURCE["STAT"] = "the size of the file given by Body.path on disk as reported by statSync";
|
|
12
12
|
})(BYTE_LENGTH_SOURCE || (BYTE_LENGTH_SOURCE = {}));
|
|
13
13
|
export const byteLengthSource = (input, override) => {
|
|
14
14
|
if (override != null) {
|
|
@@ -34,8 +34,8 @@ export const byteLengthSource = (input, override) => {
|
|
|
34
34
|
}
|
|
35
35
|
else if (runtimeConfig.isFileReadStream(input)) {
|
|
36
36
|
try {
|
|
37
|
-
runtimeConfig.
|
|
38
|
-
return BYTE_LENGTH_SOURCE.
|
|
37
|
+
runtimeConfig.statSync(input.path).size;
|
|
38
|
+
return BYTE_LENGTH_SOURCE.STAT;
|
|
39
39
|
}
|
|
40
40
|
catch (error) {
|
|
41
41
|
return undefined;
|
package/dist-es/runtimeConfig.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReadStream, statSync } from "node:fs";
|
|
2
2
|
import { runtimeConfigShared as shared } from "./runtimeConfig.shared";
|
|
3
3
|
export const runtimeConfig = {
|
|
4
4
|
...shared,
|
|
5
5
|
runtime: "node",
|
|
6
|
-
|
|
6
|
+
statSync,
|
|
7
7
|
isFileReadStream(f) {
|
|
8
8
|
return f instanceof ReadStream;
|
|
9
9
|
},
|
|
@@ -9,7 +9,7 @@ export declare enum BYTE_LENGTH_SOURCE {
|
|
|
9
9
|
LENGTH = "the value of Body.length",
|
|
10
10
|
SIZE = "the value of Body.size",
|
|
11
11
|
START_END_DIFF = "the numeric difference between Body.start and Body.end",
|
|
12
|
-
|
|
12
|
+
STAT = "the size of the file given by Body.path on disk as reported by statSync"
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* The returned value should complete the sentence, "The byte count of the data was determined by ...".
|
|
@@ -6,7 +6,7 @@ export declare enum BYTE_LENGTH_SOURCE {
|
|
|
6
6
|
LENGTH = "the value of Body.length",
|
|
7
7
|
SIZE = "the value of Body.size",
|
|
8
8
|
START_END_DIFF = "the numeric difference between Body.start and Body.end",
|
|
9
|
-
|
|
9
|
+
STAT = "the size of the file given by Body.path on disk as reported by statSync",
|
|
10
10
|
}
|
|
11
11
|
export declare const byteLengthSource: (
|
|
12
12
|
input: any,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/lib-storage",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1129.0",
|
|
4
4
|
"description": "Storage higher order operation",
|
|
5
5
|
"homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/lib/lib-storage",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"tslib": "^2.6.2"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@aws-sdk/client-s3": "3.
|
|
62
|
+
"@aws-sdk/client-s3": "3.1129.0",
|
|
63
63
|
"@tsconfig/recommended": "1.0.1",
|
|
64
64
|
"@types/node": "^20.14.8",
|
|
65
65
|
"concurrently": "7.0.0",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"web-streams-polyfill": "3.2.1"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
|
-
"@aws-sdk/client-s3": "^3.
|
|
72
|
+
"@aws-sdk/client-s3": "^3.1129.0"
|
|
73
73
|
},
|
|
74
74
|
"engines": {
|
|
75
75
|
"node": ">=20.0.0"
|