@aws-sdk/client-s3 3.181.0 → 3.183.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 +8 -0
- package/dist-es/S3.js +374 -381
- package/dist-es/S3Client.js +26 -32
- package/dist-es/commands/AbortMultipartUploadCommand.js +21 -28
- package/dist-es/commands/CompleteMultipartUploadCommand.js +21 -28
- package/dist-es/commands/CopyObjectCommand.js +21 -28
- package/dist-es/commands/CreateBucketCommand.js +21 -28
- package/dist-es/commands/CreateMultipartUploadCommand.js +21 -28
- package/dist-es/commands/DeleteBucketAnalyticsConfigurationCommand.js +22 -29
- package/dist-es/commands/DeleteBucketCommand.js +22 -29
- package/dist-es/commands/DeleteBucketCorsCommand.js +22 -29
- package/dist-es/commands/DeleteBucketEncryptionCommand.js +22 -29
- package/dist-es/commands/DeleteBucketIntelligentTieringConfigurationCommand.js +22 -29
- package/dist-es/commands/DeleteBucketInventoryConfigurationCommand.js +22 -29
- package/dist-es/commands/DeleteBucketLifecycleCommand.js +22 -29
- package/dist-es/commands/DeleteBucketMetricsConfigurationCommand.js +22 -29
- package/dist-es/commands/DeleteBucketOwnershipControlsCommand.js +22 -29
- package/dist-es/commands/DeleteBucketPolicyCommand.js +22 -29
- package/dist-es/commands/DeleteBucketReplicationCommand.js +22 -29
- package/dist-es/commands/DeleteBucketTaggingCommand.js +22 -29
- package/dist-es/commands/DeleteBucketWebsiteCommand.js +22 -29
- package/dist-es/commands/DeleteObjectCommand.js +21 -28
- package/dist-es/commands/DeleteObjectTaggingCommand.js +21 -28
- package/dist-es/commands/DeleteObjectsCommand.js +21 -28
- package/dist-es/commands/DeletePublicAccessBlockCommand.js +22 -29
- package/dist-es/commands/GetBucketAccelerateConfigurationCommand.js +21 -28
- package/dist-es/commands/GetBucketAclCommand.js +21 -28
- package/dist-es/commands/GetBucketAnalyticsConfigurationCommand.js +21 -28
- package/dist-es/commands/GetBucketCorsCommand.js +21 -28
- package/dist-es/commands/GetBucketEncryptionCommand.js +21 -28
- package/dist-es/commands/GetBucketIntelligentTieringConfigurationCommand.js +21 -28
- package/dist-es/commands/GetBucketInventoryConfigurationCommand.js +21 -28
- package/dist-es/commands/GetBucketLifecycleConfigurationCommand.js +21 -28
- package/dist-es/commands/GetBucketLocationCommand.js +21 -28
- package/dist-es/commands/GetBucketLoggingCommand.js +21 -28
- package/dist-es/commands/GetBucketMetricsConfigurationCommand.js +21 -28
- package/dist-es/commands/GetBucketNotificationConfigurationCommand.js +21 -28
- package/dist-es/commands/GetBucketOwnershipControlsCommand.js +21 -28
- package/dist-es/commands/GetBucketPolicyCommand.js +21 -28
- package/dist-es/commands/GetBucketPolicyStatusCommand.js +21 -28
- package/dist-es/commands/GetBucketReplicationCommand.js +21 -28
- package/dist-es/commands/GetBucketRequestPaymentCommand.js +21 -28
- package/dist-es/commands/GetBucketTaggingCommand.js +21 -28
- package/dist-es/commands/GetBucketVersioningCommand.js +21 -28
- package/dist-es/commands/GetBucketWebsiteCommand.js +21 -28
- package/dist-es/commands/GetObjectAclCommand.js +21 -28
- package/dist-es/commands/GetObjectAttributesCommand.js +21 -28
- package/dist-es/commands/GetObjectCommand.js +21 -28
- package/dist-es/commands/GetObjectLegalHoldCommand.js +21 -28
- package/dist-es/commands/GetObjectLockConfigurationCommand.js +21 -28
- package/dist-es/commands/GetObjectRetentionCommand.js +21 -28
- package/dist-es/commands/GetObjectTaggingCommand.js +21 -28
- package/dist-es/commands/GetObjectTorrentCommand.js +21 -28
- package/dist-es/commands/GetPublicAccessBlockCommand.js +21 -28
- package/dist-es/commands/HeadBucketCommand.js +22 -29
- package/dist-es/commands/HeadObjectCommand.js +21 -28
- package/dist-es/commands/ListBucketAnalyticsConfigurationsCommand.js +21 -28
- package/dist-es/commands/ListBucketIntelligentTieringConfigurationsCommand.js +21 -28
- package/dist-es/commands/ListBucketInventoryConfigurationsCommand.js +21 -28
- package/dist-es/commands/ListBucketMetricsConfigurationsCommand.js +21 -28
- package/dist-es/commands/ListBucketsCommand.js +22 -29
- package/dist-es/commands/ListMultipartUploadsCommand.js +21 -28
- package/dist-es/commands/ListObjectVersionsCommand.js +21 -28
- package/dist-es/commands/ListObjectsCommand.js +21 -28
- package/dist-es/commands/ListObjectsV2Command.js +21 -28
- package/dist-es/commands/ListPartsCommand.js +21 -28
- package/dist-es/commands/PutBucketAccelerateConfigurationCommand.js +22 -29
- package/dist-es/commands/PutBucketAclCommand.js +22 -29
- package/dist-es/commands/PutBucketAnalyticsConfigurationCommand.js +22 -29
- package/dist-es/commands/PutBucketCorsCommand.js +22 -29
- package/dist-es/commands/PutBucketEncryptionCommand.js +22 -29
- package/dist-es/commands/PutBucketIntelligentTieringConfigurationCommand.js +22 -29
- package/dist-es/commands/PutBucketInventoryConfigurationCommand.js +22 -29
- package/dist-es/commands/PutBucketLifecycleConfigurationCommand.js +22 -29
- package/dist-es/commands/PutBucketLoggingCommand.js +22 -29
- package/dist-es/commands/PutBucketMetricsConfigurationCommand.js +22 -29
- package/dist-es/commands/PutBucketNotificationConfigurationCommand.js +22 -29
- package/dist-es/commands/PutBucketOwnershipControlsCommand.js +22 -29
- package/dist-es/commands/PutBucketPolicyCommand.js +22 -29
- package/dist-es/commands/PutBucketReplicationCommand.js +22 -29
- package/dist-es/commands/PutBucketRequestPaymentCommand.js +22 -29
- package/dist-es/commands/PutBucketTaggingCommand.js +22 -29
- package/dist-es/commands/PutBucketVersioningCommand.js +22 -29
- package/dist-es/commands/PutBucketWebsiteCommand.js +22 -29
- package/dist-es/commands/PutObjectAclCommand.js +21 -28
- package/dist-es/commands/PutObjectCommand.js +21 -28
- package/dist-es/commands/PutObjectLegalHoldCommand.js +21 -28
- package/dist-es/commands/PutObjectLockConfigurationCommand.js +21 -28
- package/dist-es/commands/PutObjectRetentionCommand.js +21 -28
- package/dist-es/commands/PutObjectTaggingCommand.js +21 -28
- package/dist-es/commands/PutPublicAccessBlockCommand.js +22 -29
- package/dist-es/commands/RestoreObjectCommand.js +21 -28
- package/dist-es/commands/SelectObjectContentCommand.js +21 -28
- package/dist-es/commands/UploadPartCommand.js +21 -28
- package/dist-es/commands/UploadPartCopyCommand.js +21 -28
- package/dist-es/commands/WriteGetObjectResponseCommand.js +22 -29
- package/dist-es/endpoints.js +8 -8
- package/dist-es/models/S3ServiceException.js +5 -10
- package/dist-es/models/models_0.js +896 -378
- package/dist-es/models/models_1.js +141 -54
- package/dist-es/pagination/ListObjectsV2Paginator.js +25 -68
- package/dist-es/pagination/ListPartsPaginator.js +25 -68
- package/dist-es/protocols/Aws_restXml.js +6891 -9022
- package/dist-es/runtimeConfig.browser.js +31 -12
- package/dist-es/runtimeConfig.js +36 -12
- package/dist-es/runtimeConfig.native.js +8 -5
- package/dist-es/runtimeConfig.shared.js +11 -14
- package/dist-es/waiters/waitForBucketExists.js +23 -42
- package/dist-es/waiters/waitForBucketNotExists.js +22 -42
- package/dist-es/waiters/waitForObjectExists.js +23 -42
- package/dist-es/waiters/waitForObjectNotExists.js +22 -42
- package/package.json +50 -50
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { __assign, __extends } from "tslib";
|
|
2
1
|
import { SENSITIVE_STRING } from "@aws-sdk/smithy-client";
|
|
3
2
|
import { S3ServiceException as __BaseException } from "./S3ServiceException";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
export class ObjectAlreadyInActiveTierError extends __BaseException {
|
|
4
|
+
constructor(opts) {
|
|
5
|
+
super({
|
|
6
|
+
name: "ObjectAlreadyInActiveTierError",
|
|
7
|
+
$fault: "client",
|
|
8
|
+
...opts,
|
|
9
|
+
});
|
|
10
|
+
this.name = "ObjectAlreadyInActiveTierError";
|
|
11
|
+
this.$fault = "client";
|
|
12
|
+
Object.setPrototypeOf(this, ObjectAlreadyInActiveTierError.prototype);
|
|
12
13
|
}
|
|
13
|
-
|
|
14
|
-
}(__BaseException));
|
|
15
|
-
export { ObjectAlreadyInActiveTierError };
|
|
14
|
+
}
|
|
16
15
|
export var FileHeaderInfo;
|
|
17
16
|
(function (FileHeaderInfo) {
|
|
18
17
|
FileHeaderInfo["IGNORE"] = "IGNORE";
|
|
@@ -35,7 +34,7 @@ export var RestoreRequestType;
|
|
|
35
34
|
})(RestoreRequestType || (RestoreRequestType = {}));
|
|
36
35
|
export var SelectObjectContentEventStream;
|
|
37
36
|
(function (SelectObjectContentEventStream) {
|
|
38
|
-
SelectObjectContentEventStream.visit =
|
|
37
|
+
SelectObjectContentEventStream.visit = (value, visitor) => {
|
|
39
38
|
if (value.Records !== undefined)
|
|
40
39
|
return visitor.Records(value.Records);
|
|
41
40
|
if (value.Stats !== undefined)
|
|
@@ -49,36 +48,96 @@ export var SelectObjectContentEventStream;
|
|
|
49
48
|
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
50
49
|
};
|
|
51
50
|
})(SelectObjectContentEventStream || (SelectObjectContentEventStream = {}));
|
|
52
|
-
export
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
export
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
export
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
export
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
export
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
export
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
export
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
export
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
export
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
export
|
|
81
|
-
|
|
51
|
+
export const PutObjectRetentionOutputFilterSensitiveLog = (obj) => ({
|
|
52
|
+
...obj,
|
|
53
|
+
});
|
|
54
|
+
export const PutObjectRetentionRequestFilterSensitiveLog = (obj) => ({
|
|
55
|
+
...obj,
|
|
56
|
+
});
|
|
57
|
+
export const PutObjectTaggingOutputFilterSensitiveLog = (obj) => ({
|
|
58
|
+
...obj,
|
|
59
|
+
});
|
|
60
|
+
export const PutObjectTaggingRequestFilterSensitiveLog = (obj) => ({
|
|
61
|
+
...obj,
|
|
62
|
+
});
|
|
63
|
+
export const PutPublicAccessBlockRequestFilterSensitiveLog = (obj) => ({
|
|
64
|
+
...obj,
|
|
65
|
+
});
|
|
66
|
+
export const RestoreObjectOutputFilterSensitiveLog = (obj) => ({
|
|
67
|
+
...obj,
|
|
68
|
+
});
|
|
69
|
+
export const GlacierJobParametersFilterSensitiveLog = (obj) => ({
|
|
70
|
+
...obj,
|
|
71
|
+
});
|
|
72
|
+
export const EncryptionFilterSensitiveLog = (obj) => ({
|
|
73
|
+
...obj,
|
|
74
|
+
...(obj.KMSKeyId && { KMSKeyId: SENSITIVE_STRING }),
|
|
75
|
+
});
|
|
76
|
+
export const MetadataEntryFilterSensitiveLog = (obj) => ({
|
|
77
|
+
...obj,
|
|
78
|
+
});
|
|
79
|
+
export const S3LocationFilterSensitiveLog = (obj) => ({
|
|
80
|
+
...obj,
|
|
81
|
+
...(obj.Encryption && { Encryption: EncryptionFilterSensitiveLog(obj.Encryption) }),
|
|
82
|
+
});
|
|
83
|
+
export const OutputLocationFilterSensitiveLog = (obj) => ({
|
|
84
|
+
...obj,
|
|
85
|
+
...(obj.S3 && { S3: S3LocationFilterSensitiveLog(obj.S3) }),
|
|
86
|
+
});
|
|
87
|
+
export const CSVInputFilterSensitiveLog = (obj) => ({
|
|
88
|
+
...obj,
|
|
89
|
+
});
|
|
90
|
+
export const JSONInputFilterSensitiveLog = (obj) => ({
|
|
91
|
+
...obj,
|
|
92
|
+
});
|
|
93
|
+
export const ParquetInputFilterSensitiveLog = (obj) => ({
|
|
94
|
+
...obj,
|
|
95
|
+
});
|
|
96
|
+
export const InputSerializationFilterSensitiveLog = (obj) => ({
|
|
97
|
+
...obj,
|
|
98
|
+
});
|
|
99
|
+
export const CSVOutputFilterSensitiveLog = (obj) => ({
|
|
100
|
+
...obj,
|
|
101
|
+
});
|
|
102
|
+
export const JSONOutputFilterSensitiveLog = (obj) => ({
|
|
103
|
+
...obj,
|
|
104
|
+
});
|
|
105
|
+
export const OutputSerializationFilterSensitiveLog = (obj) => ({
|
|
106
|
+
...obj,
|
|
107
|
+
});
|
|
108
|
+
export const SelectParametersFilterSensitiveLog = (obj) => ({
|
|
109
|
+
...obj,
|
|
110
|
+
});
|
|
111
|
+
export const RestoreRequestFilterSensitiveLog = (obj) => ({
|
|
112
|
+
...obj,
|
|
113
|
+
...(obj.OutputLocation && { OutputLocation: OutputLocationFilterSensitiveLog(obj.OutputLocation) }),
|
|
114
|
+
});
|
|
115
|
+
export const RestoreObjectRequestFilterSensitiveLog = (obj) => ({
|
|
116
|
+
...obj,
|
|
117
|
+
...(obj.RestoreRequest && { RestoreRequest: RestoreRequestFilterSensitiveLog(obj.RestoreRequest) }),
|
|
118
|
+
});
|
|
119
|
+
export const ContinuationEventFilterSensitiveLog = (obj) => ({
|
|
120
|
+
...obj,
|
|
121
|
+
});
|
|
122
|
+
export const EndEventFilterSensitiveLog = (obj) => ({
|
|
123
|
+
...obj,
|
|
124
|
+
});
|
|
125
|
+
export const ProgressFilterSensitiveLog = (obj) => ({
|
|
126
|
+
...obj,
|
|
127
|
+
});
|
|
128
|
+
export const ProgressEventFilterSensitiveLog = (obj) => ({
|
|
129
|
+
...obj,
|
|
130
|
+
});
|
|
131
|
+
export const RecordsEventFilterSensitiveLog = (obj) => ({
|
|
132
|
+
...obj,
|
|
133
|
+
});
|
|
134
|
+
export const StatsFilterSensitiveLog = (obj) => ({
|
|
135
|
+
...obj,
|
|
136
|
+
});
|
|
137
|
+
export const StatsEventFilterSensitiveLog = (obj) => ({
|
|
138
|
+
...obj,
|
|
139
|
+
});
|
|
140
|
+
export const SelectObjectContentEventStreamFilterSensitiveLog = (obj) => {
|
|
82
141
|
if (obj.Records !== undefined)
|
|
83
142
|
return { Records: RecordsEventFilterSensitiveLog(obj.Records) };
|
|
84
143
|
if (obj.Stats !== undefined)
|
|
@@ -90,15 +149,43 @@ export var SelectObjectContentEventStreamFilterSensitiveLog = function (obj) {
|
|
|
90
149
|
if (obj.End !== undefined)
|
|
91
150
|
return { End: EndEventFilterSensitiveLog(obj.End) };
|
|
92
151
|
if (obj.$unknown !== undefined)
|
|
93
|
-
return
|
|
152
|
+
return { [obj.$unknown[0]]: "UNKNOWN" };
|
|
94
153
|
};
|
|
95
|
-
export
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
export
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
export
|
|
103
|
-
|
|
104
|
-
|
|
154
|
+
export const SelectObjectContentOutputFilterSensitiveLog = (obj) => ({
|
|
155
|
+
...obj,
|
|
156
|
+
...(obj.Payload && { Payload: "STREAMING_CONTENT" }),
|
|
157
|
+
});
|
|
158
|
+
export const RequestProgressFilterSensitiveLog = (obj) => ({
|
|
159
|
+
...obj,
|
|
160
|
+
});
|
|
161
|
+
export const ScanRangeFilterSensitiveLog = (obj) => ({
|
|
162
|
+
...obj,
|
|
163
|
+
});
|
|
164
|
+
export const SelectObjectContentRequestFilterSensitiveLog = (obj) => ({
|
|
165
|
+
...obj,
|
|
166
|
+
...(obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING }),
|
|
167
|
+
});
|
|
168
|
+
export const UploadPartOutputFilterSensitiveLog = (obj) => ({
|
|
169
|
+
...obj,
|
|
170
|
+
...(obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING }),
|
|
171
|
+
});
|
|
172
|
+
export const UploadPartRequestFilterSensitiveLog = (obj) => ({
|
|
173
|
+
...obj,
|
|
174
|
+
...(obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING }),
|
|
175
|
+
});
|
|
176
|
+
export const CopyPartResultFilterSensitiveLog = (obj) => ({
|
|
177
|
+
...obj,
|
|
178
|
+
});
|
|
179
|
+
export const UploadPartCopyOutputFilterSensitiveLog = (obj) => ({
|
|
180
|
+
...obj,
|
|
181
|
+
...(obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING }),
|
|
182
|
+
});
|
|
183
|
+
export const UploadPartCopyRequestFilterSensitiveLog = (obj) => ({
|
|
184
|
+
...obj,
|
|
185
|
+
...(obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING }),
|
|
186
|
+
...(obj.CopySourceSSECustomerKey && { CopySourceSSECustomerKey: SENSITIVE_STRING }),
|
|
187
|
+
});
|
|
188
|
+
export const WriteGetObjectResponseRequestFilterSensitiveLog = (obj) => ({
|
|
189
|
+
...obj,
|
|
190
|
+
...(obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING }),
|
|
191
|
+
});
|
|
@@ -1,75 +1,32 @@
|
|
|
1
|
-
import { __asyncGenerator, __await, __awaiter, __generator, __read, __spreadArray } from "tslib";
|
|
2
1
|
import { ListObjectsV2Command, } from "../commands/ListObjectsV2Command";
|
|
3
2
|
import { S3 } from "../S3";
|
|
4
3
|
import { S3Client } from "../S3Client";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
8
|
-
args[_i - 2] = arguments[_i];
|
|
9
|
-
}
|
|
10
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
11
|
-
return __generator(this, function (_a) {
|
|
12
|
-
switch (_a.label) {
|
|
13
|
-
case 0: return [4, client.send.apply(client, __spreadArray([new ListObjectsV2Command(input)], __read(args), false))];
|
|
14
|
-
case 1: return [2, _a.sent()];
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
});
|
|
4
|
+
const makePagedClientRequest = async (client, input, ...args) => {
|
|
5
|
+
return await client.send(new ListObjectsV2Command(input), ...args);
|
|
18
6
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
22
|
-
args[_i - 2] = arguments[_i];
|
|
23
|
-
}
|
|
24
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
25
|
-
return __generator(this, function (_a) {
|
|
26
|
-
switch (_a.label) {
|
|
27
|
-
case 0: return [4, client.listObjectsV2.apply(client, __spreadArray([input], __read(args), false))];
|
|
28
|
-
case 1: return [2, _a.sent()];
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
});
|
|
7
|
+
const makePagedRequest = async (client, input, ...args) => {
|
|
8
|
+
return await client.listObjectsV2(input, ...args);
|
|
32
9
|
};
|
|
33
|
-
export function paginateListObjectsV2(config, input) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
10
|
+
export async function* paginateListObjectsV2(config, input, ...additionalArguments) {
|
|
11
|
+
let token = config.startingToken || undefined;
|
|
12
|
+
let hasNext = true;
|
|
13
|
+
let page;
|
|
14
|
+
while (hasNext) {
|
|
15
|
+
input.ContinuationToken = token;
|
|
16
|
+
input["MaxKeys"] = config.pageSize;
|
|
17
|
+
if (config.client instanceof S3) {
|
|
18
|
+
page = await makePagedRequest(config.client, input, ...additionalArguments);
|
|
19
|
+
}
|
|
20
|
+
else if (config.client instanceof S3Client) {
|
|
21
|
+
page = await makePagedClientRequest(config.client, input, ...additionalArguments);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
throw new Error("Invalid client, expected S3 | S3Client");
|
|
25
|
+
}
|
|
26
|
+
yield page;
|
|
27
|
+
const prevToken = token;
|
|
28
|
+
token = page.NextContinuationToken;
|
|
29
|
+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
|
|
37
30
|
}
|
|
38
|
-
return
|
|
39
|
-
var token, hasNext, page, prevToken;
|
|
40
|
-
return __generator(this, function (_a) {
|
|
41
|
-
switch (_a.label) {
|
|
42
|
-
case 0:
|
|
43
|
-
token = config.startingToken || undefined;
|
|
44
|
-
hasNext = true;
|
|
45
|
-
_a.label = 1;
|
|
46
|
-
case 1:
|
|
47
|
-
if (!hasNext) return [3, 9];
|
|
48
|
-
input.ContinuationToken = token;
|
|
49
|
-
input["MaxKeys"] = config.pageSize;
|
|
50
|
-
if (!(config.client instanceof S3)) return [3, 3];
|
|
51
|
-
return [4, __await(makePagedRequest.apply(void 0, __spreadArray([config.client, input], __read(additionalArguments), false)))];
|
|
52
|
-
case 2:
|
|
53
|
-
page = _a.sent();
|
|
54
|
-
return [3, 6];
|
|
55
|
-
case 3:
|
|
56
|
-
if (!(config.client instanceof S3Client)) return [3, 5];
|
|
57
|
-
return [4, __await(makePagedClientRequest.apply(void 0, __spreadArray([config.client, input], __read(additionalArguments), false)))];
|
|
58
|
-
case 4:
|
|
59
|
-
page = _a.sent();
|
|
60
|
-
return [3, 6];
|
|
61
|
-
case 5: throw new Error("Invalid client, expected S3 | S3Client");
|
|
62
|
-
case 6: return [4, __await(page)];
|
|
63
|
-
case 7: return [4, _a.sent()];
|
|
64
|
-
case 8:
|
|
65
|
-
_a.sent();
|
|
66
|
-
prevToken = token;
|
|
67
|
-
token = page.NextContinuationToken;
|
|
68
|
-
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
|
|
69
|
-
return [3, 1];
|
|
70
|
-
case 9: return [4, __await(undefined)];
|
|
71
|
-
case 10: return [2, _a.sent()];
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
});
|
|
31
|
+
return undefined;
|
|
75
32
|
}
|
|
@@ -1,75 +1,32 @@
|
|
|
1
|
-
import { __asyncGenerator, __await, __awaiter, __generator, __read, __spreadArray } from "tslib";
|
|
2
1
|
import { ListPartsCommand } from "../commands/ListPartsCommand";
|
|
3
2
|
import { S3 } from "../S3";
|
|
4
3
|
import { S3Client } from "../S3Client";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
8
|
-
args[_i - 2] = arguments[_i];
|
|
9
|
-
}
|
|
10
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
11
|
-
return __generator(this, function (_a) {
|
|
12
|
-
switch (_a.label) {
|
|
13
|
-
case 0: return [4, client.send.apply(client, __spreadArray([new ListPartsCommand(input)], __read(args), false))];
|
|
14
|
-
case 1: return [2, _a.sent()];
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
});
|
|
4
|
+
const makePagedClientRequest = async (client, input, ...args) => {
|
|
5
|
+
return await client.send(new ListPartsCommand(input), ...args);
|
|
18
6
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
22
|
-
args[_i - 2] = arguments[_i];
|
|
23
|
-
}
|
|
24
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
25
|
-
return __generator(this, function (_a) {
|
|
26
|
-
switch (_a.label) {
|
|
27
|
-
case 0: return [4, client.listParts.apply(client, __spreadArray([input], __read(args), false))];
|
|
28
|
-
case 1: return [2, _a.sent()];
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
});
|
|
7
|
+
const makePagedRequest = async (client, input, ...args) => {
|
|
8
|
+
return await client.listParts(input, ...args);
|
|
32
9
|
};
|
|
33
|
-
export function paginateListParts(config, input) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
10
|
+
export async function* paginateListParts(config, input, ...additionalArguments) {
|
|
11
|
+
let token = config.startingToken || undefined;
|
|
12
|
+
let hasNext = true;
|
|
13
|
+
let page;
|
|
14
|
+
while (hasNext) {
|
|
15
|
+
input.PartNumberMarker = token;
|
|
16
|
+
input["MaxParts"] = config.pageSize;
|
|
17
|
+
if (config.client instanceof S3) {
|
|
18
|
+
page = await makePagedRequest(config.client, input, ...additionalArguments);
|
|
19
|
+
}
|
|
20
|
+
else if (config.client instanceof S3Client) {
|
|
21
|
+
page = await makePagedClientRequest(config.client, input, ...additionalArguments);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
throw new Error("Invalid client, expected S3 | S3Client");
|
|
25
|
+
}
|
|
26
|
+
yield page;
|
|
27
|
+
const prevToken = token;
|
|
28
|
+
token = page.NextPartNumberMarker;
|
|
29
|
+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
|
|
37
30
|
}
|
|
38
|
-
return
|
|
39
|
-
var token, hasNext, page, prevToken;
|
|
40
|
-
return __generator(this, function (_a) {
|
|
41
|
-
switch (_a.label) {
|
|
42
|
-
case 0:
|
|
43
|
-
token = config.startingToken || undefined;
|
|
44
|
-
hasNext = true;
|
|
45
|
-
_a.label = 1;
|
|
46
|
-
case 1:
|
|
47
|
-
if (!hasNext) return [3, 9];
|
|
48
|
-
input.PartNumberMarker = token;
|
|
49
|
-
input["MaxParts"] = config.pageSize;
|
|
50
|
-
if (!(config.client instanceof S3)) return [3, 3];
|
|
51
|
-
return [4, __await(makePagedRequest.apply(void 0, __spreadArray([config.client, input], __read(additionalArguments), false)))];
|
|
52
|
-
case 2:
|
|
53
|
-
page = _a.sent();
|
|
54
|
-
return [3, 6];
|
|
55
|
-
case 3:
|
|
56
|
-
if (!(config.client instanceof S3Client)) return [3, 5];
|
|
57
|
-
return [4, __await(makePagedClientRequest.apply(void 0, __spreadArray([config.client, input], __read(additionalArguments), false)))];
|
|
58
|
-
case 4:
|
|
59
|
-
page = _a.sent();
|
|
60
|
-
return [3, 6];
|
|
61
|
-
case 5: throw new Error("Invalid client, expected S3 | S3Client");
|
|
62
|
-
case 6: return [4, __await(page)];
|
|
63
|
-
case 7: return [4, _a.sent()];
|
|
64
|
-
case 8:
|
|
65
|
-
_a.sent();
|
|
66
|
-
prevToken = token;
|
|
67
|
-
token = page.NextPartNumberMarker;
|
|
68
|
-
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
|
|
69
|
-
return [3, 1];
|
|
70
|
-
case 9: return [4, __await(undefined)];
|
|
71
|
-
case 10: return [2, _a.sent()];
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
});
|
|
31
|
+
return undefined;
|
|
75
32
|
}
|