@aws-sdk/lib-storage 3.1126.0 → 3.1128.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 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 { lstatSync, ReadStream } = require("node:fs");
6
+ const { statSync, ReadStream } = require("node:fs");
7
7
  const { Readable } = require("stream");
8
8
 
9
9
  const runtimeConfigShared = {
10
- lstatSync: () => { },
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
- lstatSync,
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.lstatSync(input.path).size;
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["LSTAT"] = "the size of the file given by Body.path on disk as reported by lstatSync";
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.lstatSync(input.path).size;
91
- return BYTE_LENGTH_SOURCE.LSTAT;
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}.
@@ -21,7 +21,7 @@ export const byteLength = (input) => {
21
21
  }
22
22
  else if (runtimeConfig.isFileReadStream(input)) {
23
23
  try {
24
- return runtimeConfig.lstatSync(input.path).size;
24
+ return runtimeConfig.statSync(input.path).size;
25
25
  }
26
26
  catch (error) {
27
27
  return undefined;
@@ -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["LSTAT"] = "the size of the file given by Body.path on disk as reported by lstatSync";
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.lstatSync(input.path).size;
38
- return BYTE_LENGTH_SOURCE.LSTAT;
37
+ runtimeConfig.statSync(input.path).size;
38
+ return BYTE_LENGTH_SOURCE.STAT;
39
39
  }
40
40
  catch (error) {
41
41
  return undefined;
@@ -1,9 +1,9 @@
1
- import { lstatSync, ReadStream } from "node:fs";
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
- lstatSync,
6
+ statSync,
7
7
  isFileReadStream(f) {
8
8
  return f instanceof ReadStream;
9
9
  },
@@ -1,5 +1,5 @@
1
1
  export const runtimeConfigShared = {
2
- lstatSync: () => { },
2
+ statSync: () => { },
3
3
  isFileReadStream(f) {
4
4
  return false;
5
5
  },
@@ -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
- LSTAT = "the size of the file given by Body.path on disk as reported by lstatSync"
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 ...".
@@ -2,7 +2,7 @@
2
2
  * @internal
3
3
  */
4
4
  export declare const runtimeConfig: {
5
- lstatSync: () => void;
5
+ statSync: () => void;
6
6
  isFileReadStream(f: unknown): boolean;
7
7
  runtime: string;
8
8
  };
@@ -4,6 +4,6 @@ import { ReadStream } from "node:fs";
4
4
  */
5
5
  export declare const runtimeConfig: {
6
6
  runtime: string;
7
- lstatSync: import("fs").StatSyncFn;
7
+ statSync: import("fs").StatSyncFn;
8
8
  isFileReadStream(f: unknown): f is ReadStream;
9
9
  };
@@ -2,7 +2,7 @@
2
2
  * @internal
3
3
  */
4
4
  export declare const runtimeConfig: {
5
- lstatSync: () => void;
5
+ statSync: () => void;
6
6
  isFileReadStream(f: unknown): boolean;
7
7
  runtime: string;
8
8
  };
@@ -2,6 +2,6 @@
2
2
  * @internal
3
3
  */
4
4
  export declare const runtimeConfigShared: {
5
- lstatSync: () => void;
5
+ statSync: () => void;
6
6
  isFileReadStream(f: unknown): boolean;
7
7
  };
@@ -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
- LSTAT = "the size of the file given by Body.path on disk as reported by lstatSync",
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,
@@ -1,5 +1,5 @@
1
1
  export declare const runtimeConfig: {
2
- lstatSync: () => void;
2
+ statSync: () => void;
3
3
  isFileReadStream(f: unknown): boolean;
4
4
  runtime: string;
5
5
  };
@@ -1,6 +1,6 @@
1
1
  import { ReadStream } from "node:fs";
2
2
  export declare const runtimeConfig: {
3
3
  runtime: string;
4
- lstatSync: import("fs").StatSyncFn;
4
+ statSync: import("fs").StatSyncFn;
5
5
  isFileReadStream(f: unknown): f is ReadStream;
6
6
  };
@@ -1,5 +1,5 @@
1
1
  export declare const runtimeConfig: {
2
- lstatSync: () => void;
2
+ statSync: () => void;
3
3
  isFileReadStream(f: unknown): boolean;
4
4
  runtime: string;
5
5
  };
@@ -1,4 +1,4 @@
1
1
  export declare const runtimeConfigShared: {
2
- lstatSync: () => void;
2
+ statSync: () => void;
3
3
  isFileReadStream(f: unknown): boolean;
4
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/lib-storage",
3
- "version": "3.1126.0",
3
+ "version": "3.1128.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.1126.0",
62
+ "@aws-sdk/client-s3": "3.1128.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.1126.0"
72
+ "@aws-sdk/client-s3": "^3.1128.0"
73
73
  },
74
74
  "engines": {
75
75
  "node": ">=20.0.0"