@aws-sdk/lib-storage 3.169.0 → 3.171.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/CHANGELOG.md +19 -0
- package/dist-cjs/Upload.js +5 -1
- package/dist-es/Upload.js +9 -5
- package/dist-types/ts3.4/Upload.d.ts +43 -40
- package/dist-types/ts3.4/bytelength.d.ts +1 -1
- package/dist-types/ts3.4/chunker.d.ts +5 -2
- package/dist-types/ts3.4/chunks/getChunkBuffer.d.ts +5 -3
- package/dist-types/ts3.4/chunks/getChunkStream.d.ts +6 -3
- package/dist-types/ts3.4/chunks/getDataReadable.d.ts +2 -3
- package/dist-types/ts3.4/chunks/getDataReadableStream.d.ts +3 -2
- package/dist-types/ts3.4/index.d.ts +2 -2
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +4 -5
- package/dist-types/ts3.4/runtimeConfig.d.ts +5 -7
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +4 -5
- package/dist-types/ts3.4/runtimeConfig.shared.d.ts +3 -4
- package/dist-types/ts3.4/types.d.ts +20 -27
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.171.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.170.0...v3.171.0) (2022-09-14)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **endpoint:** endpoints v2 codegen ([#3942](https://github.com/aws/aws-sdk-js-v3/issues/3942)) ([4b32da4](https://github.com/aws/aws-sdk-js-v3/commit/4b32da42011194d4eefe32eb6f7035872fb163c2))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [3.170.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.169.0...v3.170.0) (2022-09-13)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @aws-sdk/lib-storage
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
# [3.169.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.168.0...v3.169.0) (2022-09-12)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @aws-sdk/lib-storage
|
package/dist-cjs/Upload.js
CHANGED
|
@@ -41,6 +41,7 @@ class Upload extends events_1.EventEmitter {
|
|
|
41
41
|
return super.on(event, listener);
|
|
42
42
|
}
|
|
43
43
|
async __uploadUsingPut(dataPart) {
|
|
44
|
+
var _a, _b;
|
|
44
45
|
this.isMultiPart = false;
|
|
45
46
|
const params = { ...this.params, Body: dataPart.data };
|
|
46
47
|
const requestHandler = this.client.config.requestHandler;
|
|
@@ -61,8 +62,11 @@ class Upload extends events_1.EventEmitter {
|
|
|
61
62
|
}
|
|
62
63
|
const [putResult, endpoint] = await Promise.all([
|
|
63
64
|
this.client.send(new client_s3_1.PutObjectCommand(params)),
|
|
64
|
-
this.client.config.endpoint(),
|
|
65
|
+
(_b = (_a = this.client.config) === null || _a === void 0 ? void 0 : _a.endpoint) === null || _b === void 0 ? void 0 : _b.call(_a),
|
|
65
66
|
]);
|
|
67
|
+
if (!endpoint) {
|
|
68
|
+
throw new Error('Could not resolve endpoint from S3 "client.config.endpoint()".');
|
|
69
|
+
}
|
|
66
70
|
if (eventEmitter !== null) {
|
|
67
71
|
eventEmitter.off("xhr.upload.progress", uploadEventListener);
|
|
68
72
|
}
|
package/dist-es/Upload.js
CHANGED
|
@@ -53,11 +53,12 @@ var Upload = (function (_super) {
|
|
|
53
53
|
return _super.prototype.on.call(this, event, listener);
|
|
54
54
|
};
|
|
55
55
|
Upload.prototype.__uploadUsingPut = function (dataPart) {
|
|
56
|
+
var _a, _b;
|
|
56
57
|
return __awaiter(this, void 0, void 0, function () {
|
|
57
|
-
var params, requestHandler, eventEmitter, uploadEventListener,
|
|
58
|
+
var params, requestHandler, eventEmitter, uploadEventListener, _c, putResult, endpoint, locationKey, locationBucket, Location, totalSize;
|
|
58
59
|
var _this = this;
|
|
59
|
-
return __generator(this, function (
|
|
60
|
-
switch (
|
|
60
|
+
return __generator(this, function (_d) {
|
|
61
|
+
switch (_d.label) {
|
|
61
62
|
case 0:
|
|
62
63
|
this.isMultiPart = false;
|
|
63
64
|
params = __assign(__assign({}, this.params), { Body: dataPart.data });
|
|
@@ -79,10 +80,13 @@ var Upload = (function (_super) {
|
|
|
79
80
|
}
|
|
80
81
|
return [4, Promise.all([
|
|
81
82
|
this.client.send(new PutObjectCommand(params)),
|
|
82
|
-
this.client.config.endpoint(),
|
|
83
|
+
(_b = (_a = this.client.config) === null || _a === void 0 ? void 0 : _a.endpoint) === null || _b === void 0 ? void 0 : _b.call(_a),
|
|
83
84
|
])];
|
|
84
85
|
case 1:
|
|
85
|
-
|
|
86
|
+
_c = __read.apply(void 0, [_d.sent(), 2]), putResult = _c[0], endpoint = _c[1];
|
|
87
|
+
if (!endpoint) {
|
|
88
|
+
throw new Error('Could not resolve endpoint from S3 "client.config.endpoint()".');
|
|
89
|
+
}
|
|
86
90
|
if (eventEmitter !== null) {
|
|
87
91
|
eventEmitter.off("xhr.upload.progress", uploadEventListener);
|
|
88
92
|
}
|
|
@@ -1,40 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
1
|
+
import {
|
|
2
|
+
AbortMultipartUploadCommandOutput,
|
|
3
|
+
CompleteMultipartUploadCommandOutput,
|
|
4
|
+
} from "@aws-sdk/client-s3";
|
|
5
|
+
import { EventEmitter } from "events";
|
|
6
|
+
import { BodyDataTypes, Options, Progress } from "./types";
|
|
7
|
+
export interface RawDataPart {
|
|
8
|
+
partNumber: number;
|
|
9
|
+
data: BodyDataTypes;
|
|
10
|
+
lastPart?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare class Upload extends EventEmitter {
|
|
13
|
+
private MAX_PARTS;
|
|
14
|
+
private queueSize;
|
|
15
|
+
private partSize;
|
|
16
|
+
private leavePartsOnError;
|
|
17
|
+
private tags;
|
|
18
|
+
private client;
|
|
19
|
+
private params;
|
|
20
|
+
private totalBytes?;
|
|
21
|
+
private bytesUploadedSoFar;
|
|
22
|
+
private abortController;
|
|
23
|
+
private concurrentUploaders;
|
|
24
|
+
private createMultiPartPromise?;
|
|
25
|
+
private uploadedParts;
|
|
26
|
+
private uploadId?;
|
|
27
|
+
uploadEvent?: string;
|
|
28
|
+
private isMultiPart;
|
|
29
|
+
private singleUploadResult?;
|
|
30
|
+
constructor(options: Options);
|
|
31
|
+
abort(): Promise<void>;
|
|
32
|
+
done(): Promise<
|
|
33
|
+
CompleteMultipartUploadCommandOutput | AbortMultipartUploadCommandOutput
|
|
34
|
+
>;
|
|
35
|
+
on(event: "httpUploadProgress", listener: (progress: Progress) => void): this;
|
|
36
|
+
private __uploadUsingPut;
|
|
37
|
+
private __createMultipartUpload;
|
|
38
|
+
private __doConcurrentUpload;
|
|
39
|
+
private __doMultipartUpload;
|
|
40
|
+
private __notifyProgress;
|
|
41
|
+
private __abortTimeout;
|
|
42
|
+
private __validateInput;
|
|
43
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const byteLength: (input: any) => any;
|
|
1
|
+
export declare const byteLength: (input: any) => any;
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
import { BodyDataTypes } from "./types";
|
|
2
|
-
export declare const getChunk: (
|
|
1
|
+
import { BodyDataTypes } from "./types";
|
|
2
|
+
export declare const getChunk: (
|
|
3
|
+
data: BodyDataTypes,
|
|
4
|
+
partSize: number
|
|
5
|
+
) => AsyncGenerator<import("./Upload").RawDataPart, void, undefined>;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { RawDataPart } from "../Upload";
|
|
2
|
+
export declare function getChunkBuffer(
|
|
3
|
+
data: Buffer,
|
|
4
|
+
partSize: number
|
|
5
|
+
): AsyncGenerator<RawDataPart, void, undefined>;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { RawDataPart } from "../Upload";
|
|
2
|
+
export declare function getChunkStream<T>(
|
|
3
|
+
data: T,
|
|
4
|
+
partSize: number,
|
|
5
|
+
getNextData: (data: T) => AsyncGenerator<Buffer>
|
|
6
|
+
): AsyncGenerator<RawDataPart, void, undefined>;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare function getDataReadable(data: Readable): AsyncGenerator<Buffer>;
|
|
1
|
+
import { Readable } from "stream";
|
|
2
|
+
export declare function getDataReadable(data: Readable): AsyncGenerator<Buffer>;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export declare function getDataReadableStream(
|
|
2
|
+
data: ReadableStream
|
|
3
|
+
): AsyncGenerator<Buffer>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./Upload";
|
|
2
|
-
export * from "./types";
|
|
1
|
+
export * from "./Upload";
|
|
2
|
+
export * from "./types";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
1
|
+
export declare const ClientDefaultValues: {
|
|
2
|
+
runtime: string;
|
|
3
|
+
lstatSync: () => void;
|
|
4
|
+
};
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
lstatSync: typeof lstatSync;
|
|
7
|
-
};
|
|
1
|
+
import { lstatSync } from "fs";
|
|
2
|
+
export declare const ClientDefaultValues: {
|
|
3
|
+
runtime: string;
|
|
4
|
+
lstatSync: typeof lstatSync;
|
|
5
|
+
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
1
|
+
export declare const ClientDefaultValues: {
|
|
2
|
+
runtime: string;
|
|
3
|
+
lstatSync: () => void;
|
|
4
|
+
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
1
|
+
export declare const ClientSharedValues: {
|
|
2
|
+
lstatSync: () => void;
|
|
3
|
+
};
|
|
@@ -1,27 +1,20 @@
|
|
|
1
|
-
import { PutObjectCommandInput, S3Client, Tag } from "@aws-sdk/client-s3";
|
|
2
|
-
export interface Progress {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
export declare type BodyDataTypes = PutObjectCommandInput["Body"];
|
|
10
|
-
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
export interface Options extends Partial<Configuration> {
|
|
23
|
-
|
|
24
|
-
params: PutObjectCommandInput;
|
|
25
|
-
|
|
26
|
-
client: S3Client;
|
|
27
|
-
}
|
|
1
|
+
import { PutObjectCommandInput, S3Client, Tag } from "@aws-sdk/client-s3";
|
|
2
|
+
export interface Progress {
|
|
3
|
+
loaded?: number;
|
|
4
|
+
total?: number;
|
|
5
|
+
part?: number;
|
|
6
|
+
Key?: string;
|
|
7
|
+
Bucket?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare type BodyDataTypes = PutObjectCommandInput["Body"];
|
|
10
|
+
export declare type ServiceClients = S3Client;
|
|
11
|
+
export interface Configuration {
|
|
12
|
+
queueSize: number;
|
|
13
|
+
partSize: number;
|
|
14
|
+
leavePartsOnError: boolean;
|
|
15
|
+
tags: Tag[];
|
|
16
|
+
}
|
|
17
|
+
export interface Options extends Partial<Configuration> {
|
|
18
|
+
params: PutObjectCommandInput;
|
|
19
|
+
client: S3Client;
|
|
20
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/lib-storage",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.171.0",
|
|
4
4
|
"description": "Storage higher order operation",
|
|
5
5
|
"main": "./dist-cjs/index.js",
|
|
6
6
|
"module": "./dist-es/index.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"license": "Apache-2.0",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@aws-sdk/smithy-client": "3.
|
|
27
|
+
"@aws-sdk/smithy-client": "3.171.0",
|
|
28
28
|
"buffer": "5.6.0",
|
|
29
29
|
"events": "3.3.0",
|
|
30
30
|
"stream-browserify": "3.0.0",
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
"@aws-sdk/client-s3": "^3.0.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@aws-sdk/abort-controller": "3.
|
|
39
|
-
"@aws-sdk/client-s3": "3.
|
|
38
|
+
"@aws-sdk/abort-controller": "3.171.0",
|
|
39
|
+
"@aws-sdk/client-s3": "3.171.0",
|
|
40
40
|
"@tsconfig/recommended": "1.0.1",
|
|
41
41
|
"@types/node": "^14.11.2",
|
|
42
42
|
"concurrently": "7.0.0",
|
|
43
|
-
"downlevel-dts": "0.
|
|
43
|
+
"downlevel-dts": "0.10.1",
|
|
44
44
|
"rimraf": "3.0.2",
|
|
45
45
|
"typedoc": "0.19.2",
|
|
46
46
|
"typescript": "~4.6.2",
|