@cumulus/aws-client 11.1.0-alpha1 → 12.0.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/LICENSE +60 -0
- package/README.md +168 -159
- package/S3.d.ts +86 -94
- package/S3.js +181 -136
- package/S3ListObjectsV2Queue.d.ts +4 -3
- package/S3ListObjectsV2Queue.js +1 -1
- package/S3ObjectStore.d.ts +12 -9
- package/S3ObjectStore.js +43 -40
- package/SQS.js +5 -1
- package/client.js +0 -4
- package/index.js +5 -1
- package/lib/S3MultipartUploads.d.ts +5 -4
- package/lib/S3MultipartUploads.js +4 -4
- package/package.json +16 -7
- package/services.d.ts +2 -1
- package/services.js +7 -2
- package/test-utils.d.ts +7 -3
- package/test-utils.js +6 -5
- package/types.d.ts +2 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
Copyright © 2020 United States Government as represented by the Administrator of the National Aeronautics and Space Administration. All Rights Reserved.
|
|
2
|
+
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
|
|
4
|
+
You may obtain a copy of the License at
|
|
5
|
+
|
|
6
|
+
http://www.apache.org/licenses/LICE NSE-2.0
|
|
7
|
+
|
|
8
|
+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
14
|
+
|
|
15
|
+
1. Definitions.
|
|
16
|
+
|
|
17
|
+
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
|
18
|
+
|
|
19
|
+
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
|
20
|
+
|
|
21
|
+
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
|
24
|
+
|
|
25
|
+
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
|
26
|
+
|
|
27
|
+
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
|
28
|
+
|
|
29
|
+
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
|
30
|
+
|
|
31
|
+
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
|
32
|
+
|
|
33
|
+
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
|
34
|
+
|
|
35
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
|
36
|
+
|
|
37
|
+
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
|
38
|
+
|
|
39
|
+
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
|
40
|
+
|
|
41
|
+
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
|
42
|
+
|
|
43
|
+
You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
|
44
|
+
You must cause any modified files to carry prominent notices stating that You changed the files; and
|
|
45
|
+
You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
|
46
|
+
If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
|
|
47
|
+
|
|
48
|
+
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
|
49
|
+
|
|
50
|
+
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
|
51
|
+
|
|
52
|
+
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
|
53
|
+
|
|
54
|
+
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
|
55
|
+
|
|
56
|
+
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
|
57
|
+
|
|
58
|
+
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
|
59
|
+
|
|
60
|
+
END OF TERMS AND CONDITIONS
|
package/README.md
CHANGED
|
@@ -143,41 +143,19 @@ Create a CloudWatch Events rule
|
|
|
143
143
|
|
|
144
144
|
* [DynamoDb](#module_DynamoDb)
|
|
145
145
|
* _static_
|
|
146
|
-
* [.get](#module_DynamoDb.get) ⇒ <code>Promise.<Object></code>
|
|
147
146
|
* [.scan](#module_DynamoDb.scan) ⇒ <code>Promise.<Object></code>
|
|
148
147
|
* [.createAndWaitForDynamoDbTable(params)](#module_DynamoDb.createAndWaitForDynamoDbTable) ⇒ <code>Promise.<Object></code>
|
|
149
148
|
* [.deleteAndWaitForDynamoDbTableNotExists(params)](#module_DynamoDb.deleteAndWaitForDynamoDbTableNotExists) ⇒ <code>Promise</code>
|
|
150
149
|
* _inner_
|
|
150
|
+
* [~get(params)](#module_DynamoDb..get) ⇒ <code>Promise.<Object></code>
|
|
151
151
|
* [~parallelScan(params)](#module_DynamoDb..parallelScan) ⇒ <code>Promise</code>
|
|
152
152
|
|
|
153
|
-
<a name="module_DynamoDb.get"></a>
|
|
154
|
-
|
|
155
|
-
### DynamoDb.get ⇒ <code>Promise.<Object></code>
|
|
156
|
-
Call DynamoDb client get
|
|
157
|
-
|
|
158
|
-
See [DocumentClient.get()](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#get-property)
|
|
159
|
-
for descriptions of `params` and the return data.
|
|
160
|
-
|
|
161
|
-
**Kind**: static property of [<code>DynamoDb</code>](#module_DynamoDb)
|
|
162
|
-
**Throws**:
|
|
163
|
-
|
|
164
|
-
- <code>RecordDoesNotExist</code> if a record cannot be found
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
| Param | Type | Description |
|
|
168
|
-
| --- | --- | --- |
|
|
169
|
-
| params | <code>Object</code> | |
|
|
170
|
-
| params.tableName | <code>string</code> | Table name to read |
|
|
171
|
-
| params.item | <code>AWS.DynamoDB.DocumentClient.Key</code> | Key identifying object to get |
|
|
172
|
-
| params.client | <code>AWS.DynamoDB.DocumentClient</code> | Instance of a DynamoDb DocumentClient |
|
|
173
|
-
| params.getParams | <code>Object</code> | Additional parameters for DocumentClient.get() |
|
|
174
|
-
|
|
175
153
|
<a name="module_DynamoDb.scan"></a>
|
|
176
154
|
|
|
177
155
|
### DynamoDb.scan ⇒ <code>Promise.<Object></code>
|
|
178
156
|
Call DynamoDb client scan
|
|
179
157
|
|
|
180
|
-
See [DocumentClient.scan()](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/
|
|
158
|
+
See [DocumentClient.scan()](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/modules/_aws_sdk_lib_dynamodb.html)
|
|
181
159
|
for descriptions of `params` and the return data.
|
|
182
160
|
|
|
183
161
|
**Kind**: static property of [<code>DynamoDb</code>](#module_DynamoDb)
|
|
@@ -196,7 +174,7 @@ Create a DynamoDB table and then wait for the table to exist
|
|
|
196
174
|
|
|
197
175
|
| Param | Type | Description |
|
|
198
176
|
| --- | --- | --- |
|
|
199
|
-
| params | <code>Object</code> | the same params that you would pass to AWS.createTable See https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/
|
|
177
|
+
| params | <code>Object</code> | the same params that you would pass to AWS.createTable See https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-dynamodb/classes/dynamodb.html#createtable |
|
|
200
178
|
|
|
201
179
|
<a name="module_DynamoDb.deleteAndWaitForDynamoDbTableNotExists"></a>
|
|
202
180
|
|
|
@@ -207,7 +185,29 @@ Delete a DynamoDB table and then wait for the table to not exist
|
|
|
207
185
|
|
|
208
186
|
| Param | Type | Description |
|
|
209
187
|
| --- | --- | --- |
|
|
210
|
-
| params | <code>Object</code> | the same params that you would pass to AWS.deleteTable See https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/
|
|
188
|
+
| params | <code>Object</code> | the same params that you would pass to AWS.deleteTable See https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-dynamodb/classes/dynamodb.html#deletetable |
|
|
189
|
+
|
|
190
|
+
<a name="module_DynamoDb..get"></a>
|
|
191
|
+
|
|
192
|
+
### DynamoDb~get(params) ⇒ <code>Promise.<Object></code>
|
|
193
|
+
Call DynamoDb client get
|
|
194
|
+
|
|
195
|
+
See [DocumentClient.get()](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/modules/_aws_sdk_lib_dynamodb.html)
|
|
196
|
+
for descriptions of `params` and the return data.
|
|
197
|
+
|
|
198
|
+
**Kind**: inner method of [<code>DynamoDb</code>](#module_DynamoDb)
|
|
199
|
+
**Throws**:
|
|
200
|
+
|
|
201
|
+
- <code>RecordDoesNotExist</code> if a record cannot be found
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
| Param | Type | Description |
|
|
205
|
+
| --- | --- | --- |
|
|
206
|
+
| params | <code>Object</code> | |
|
|
207
|
+
| params.tableName | <code>string</code> | Table name to read |
|
|
208
|
+
| params.item | <code>GetCommandInput.Key</code> | Key identifying object to get |
|
|
209
|
+
| params.client | <code>DynamoDBDocument</code> | Instance of a DynamoDb DocumentClient |
|
|
210
|
+
| params.getParams | <code>Object</code> | Additional parameters for DocumentClient.get() |
|
|
211
211
|
|
|
212
212
|
<a name="module_DynamoDb..parallelScan"></a>
|
|
213
213
|
|
|
@@ -215,7 +215,7 @@ Delete a DynamoDB table and then wait for the table to not exist
|
|
|
215
215
|
Do a parallel scan of DynamoDB table using a document client.
|
|
216
216
|
|
|
217
217
|
See https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Scan.html#Scan.ParallelScan.
|
|
218
|
-
See [DocumentClient.scan()](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/
|
|
218
|
+
See [DocumentClient.scan()](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/modules/_aws_sdk_lib_dynamodb.html).
|
|
219
219
|
|
|
220
220
|
**Kind**: inner method of [<code>DynamoDb</code>](#module_DynamoDb)
|
|
221
221
|
|
|
@@ -223,9 +223,9 @@ See [DocumentClient.scan()](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/
|
|
|
223
223
|
| --- | --- | --- |
|
|
224
224
|
| params | <code>Object</code> | |
|
|
225
225
|
| params.totalSegments | <code>number</code> | Total number of segments to divide table into for parallel scanning |
|
|
226
|
-
| params.scanParams | <code>
|
|
226
|
+
| params.scanParams | <code>ScanInput</code> | Params for the DynamoDB client scan operation See https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Scan.html |
|
|
227
227
|
| params.processItemsFunc | <code>function</code> | Function used to process returned items by scan |
|
|
228
|
-
| [params.dynamoDbClient] | <code>
|
|
228
|
+
| [params.dynamoDbClient] | <code>DynamoDBDocument</code> | Instance of Dynamo DB document client |
|
|
229
229
|
| [params.retryOptions] | <code>pRetry.Options</code> | Retry options for scan operations |
|
|
230
230
|
|
|
231
231
|
<a name="module_KMS"></a>
|
|
@@ -315,13 +315,6 @@ Invoke a Lambda function
|
|
|
315
315
|
|
|
316
316
|
* [S3](#module_S3)
|
|
317
317
|
* _static_
|
|
318
|
-
* [.deleteS3Object](#module_S3.deleteS3Object)
|
|
319
|
-
* [.headObject](#module_S3.headObject) ⇒ <code>Promise</code>
|
|
320
|
-
* [.s3PutObject](#module_S3.s3PutObject)
|
|
321
|
-
* [.s3CopyObject](#module_S3.s3CopyObject) ⇒ <code>Promise</code>
|
|
322
|
-
* [.promiseS3Upload](#module_S3.promiseS3Upload) ⇒ <code>Promise</code>
|
|
323
|
-
* [.s3GetObjectTagging](#module_S3.s3GetObjectTagging) ⇒ <code>Promise.<AWS.S3.GetObjectTaggingOutput></code>
|
|
324
|
-
* [.s3PutObjectTagging](#module_S3.s3PutObjectTagging) ⇒ <code>Promise</code>
|
|
325
318
|
* ~~[.getS3Object](#module_S3.getS3Object) ⇒ <code>Promise</code>~~
|
|
326
319
|
* [.recursivelyDeleteS3Bucket](#module_S3.recursivelyDeleteS3Bucket) ⇒ <code>Promise</code>
|
|
327
320
|
* [.listS3ObjectsV2(params)](#module_S3.listS3ObjectsV2) ⇒ <code>Promise.<Array></code>
|
|
@@ -330,17 +323,25 @@ Invoke a Lambda function
|
|
|
330
323
|
* [~parseS3Uri(uri)](#module_S3..parseS3Uri) ⇒ <code>Object</code>
|
|
331
324
|
* [~buildS3Uri(bucket, key)](#module_S3..buildS3Uri) ⇒ <code>string</code>
|
|
332
325
|
* [~s3TagSetToQueryString(tagset)](#module_S3..s3TagSetToQueryString) ⇒ <code>string</code>
|
|
326
|
+
* [~deleteS3Object(bucket, key)](#module_S3..deleteS3Object) ⇒ <code>Promise</code>
|
|
327
|
+
* [~headObject(Bucket, Key, retryOptions)](#module_S3..headObject) ⇒ <code>Promise</code>
|
|
333
328
|
* [~s3ObjectExists(params)](#module_S3..s3ObjectExists) ⇒ <code>Promise.<boolean></code>
|
|
334
329
|
* [~waitForObjectToExist(params)](#module_S3..waitForObjectToExist) ⇒ <code>Promise.<undefined></code>
|
|
330
|
+
* [~s3PutObject(params)](#module_S3..s3PutObject) ⇒ <code>Promise</code>
|
|
335
331
|
* [~putFile(bucket, key, filename)](#module_S3..putFile) ⇒ <code>Promise</code>
|
|
332
|
+
* [~s3CopyObject(params)](#module_S3..s3CopyObject) ⇒ <code>Promise</code>
|
|
333
|
+
* [~promiseS3Upload(params)](#module_S3..promiseS3Upload) ⇒ <code>Promise</code>
|
|
336
334
|
* [~streamS3Upload(uploadStream, uploadParams)](#module_S3..streamS3Upload) ⇒ <code>Promise</code>
|
|
335
|
+
* [~getObjectReadStream(params)](#module_S3..getObjectReadStream) ⇒ <code>Promise.<Readable></code>
|
|
337
336
|
* [~downloadS3File(s3Obj, filepath)](#module_S3..downloadS3File) ⇒ <code>Promise.<string></code>
|
|
338
337
|
* [~getObjectSize(params)](#module_S3..getObjectSize) ⇒ <code>Promise.<(number\|undefined)></code>
|
|
339
|
-
* [~
|
|
340
|
-
* [~
|
|
338
|
+
* [~s3GetObjectTagging(bucket, key)](#module_S3..s3GetObjectTagging) ⇒ <code>Promise.<GetObjectTaggingOutput></code>
|
|
339
|
+
* [~s3PutObjectTagging(Bucket, Key, ObjectTagging)](#module_S3..s3PutObjectTagging) ⇒ <code>Promise</code>
|
|
340
|
+
* [~getObject(s3Client, params)](#module_S3..getObject) ⇒ <code>Promise.<GetObjectOutput></code>
|
|
341
|
+
* [~waitForObject(s3Client, params, [retryOptions])](#module_S3..waitForObject) ⇒ <code>Promise.<GetObjectOutput></code>
|
|
342
|
+
* [~getObjectStreamContents(objectReadStream)](#module_S3..getObjectStreamContents) ⇒ <code>Promise.<string></code>
|
|
341
343
|
* [~getTextObject(bucket, key)](#module_S3..getTextObject) ⇒ <code>Promise.<string></code>
|
|
342
344
|
* [~getJsonS3Object(bucket, key)](#module_S3..getJsonS3Object) ⇒ <code>Promise.<\*></code>
|
|
343
|
-
* [~getObjectReadStream(params)](#module_S3..getObjectReadStream) ⇒ <code>Readable</code>
|
|
344
345
|
* [~fileExists(bucket, key)](#module_S3..fileExists) ⇒ <code>Promise</code>
|
|
345
346
|
* [~deleteS3Files(s3Objs)](#module_S3..deleteS3Files) ⇒ <code>Promise</code>
|
|
346
347
|
* [~deleteS3Buckets(buckets)](#module_S3..deleteS3Buckets) ⇒ <code>Promise</code>
|
|
@@ -354,97 +355,6 @@ Invoke a Lambda function
|
|
|
354
355
|
* [~multipartCopyObject(params)](#module_S3..multipartCopyObject) ⇒ <code>Promise.<{etag: string}></code>
|
|
355
356
|
* [~moveObject(params)](#module_S3..moveObject) ⇒ <code>Promise.<undefined></code>
|
|
356
357
|
|
|
357
|
-
<a name="module_S3.deleteS3Object"></a>
|
|
358
|
-
|
|
359
|
-
### S3.deleteS3Object
|
|
360
|
-
Delete an object from S3
|
|
361
|
-
|
|
362
|
-
**Kind**: static property of [<code>S3</code>](#module_S3)
|
|
363
|
-
|
|
364
|
-
| Param | Type | Description |
|
|
365
|
-
| --- | --- | --- |
|
|
366
|
-
| bucket | <code>string</code> | bucket where the object exists |
|
|
367
|
-
| key | <code>string</code> | key of the object to be deleted promise of the object being deleted |
|
|
368
|
-
|
|
369
|
-
<a name="module_S3.headObject"></a>
|
|
370
|
-
|
|
371
|
-
### S3.headObject ⇒ <code>Promise</code>
|
|
372
|
-
Get an object header from S3
|
|
373
|
-
|
|
374
|
-
**Kind**: static property of [<code>S3</code>](#module_S3)
|
|
375
|
-
**Returns**: <code>Promise</code> - returns response from `S3.headObject` as a promise
|
|
376
|
-
|
|
377
|
-
| Param | Type | Description |
|
|
378
|
-
| --- | --- | --- |
|
|
379
|
-
| Bucket | <code>string</code> | name of bucket |
|
|
380
|
-
| Key | <code>string</code> | key for object (filepath + filename) |
|
|
381
|
-
| retryOptions | <code>Object</code> | options to control retry behavior when an object does not exist. See https://github.com/tim-kos/node-retry#retryoperationoptions By default, retries will not be performed |
|
|
382
|
-
|
|
383
|
-
<a name="module_S3.s3PutObject"></a>
|
|
384
|
-
|
|
385
|
-
### S3.s3PutObject
|
|
386
|
-
Put an object on S3
|
|
387
|
-
|
|
388
|
-
**Kind**: static property of [<code>S3</code>](#module_S3)
|
|
389
|
-
|
|
390
|
-
| Param | Type | Description |
|
|
391
|
-
| --- | --- | --- |
|
|
392
|
-
| params | <code>Object</code> | same params as https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#putObject-property promise of the object being put |
|
|
393
|
-
|
|
394
|
-
<a name="module_S3.s3CopyObject"></a>
|
|
395
|
-
|
|
396
|
-
### S3.s3CopyObject ⇒ <code>Promise</code>
|
|
397
|
-
Copy an object from one location on S3 to another
|
|
398
|
-
|
|
399
|
-
**Kind**: static property of [<code>S3</code>](#module_S3)
|
|
400
|
-
**Returns**: <code>Promise</code> - promise of the object being copied
|
|
401
|
-
|
|
402
|
-
| Param | Type | Description |
|
|
403
|
-
| --- | --- | --- |
|
|
404
|
-
| params | <code>Object</code> | same params as https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#putObject-property |
|
|
405
|
-
|
|
406
|
-
<a name="module_S3.promiseS3Upload"></a>
|
|
407
|
-
|
|
408
|
-
### S3.promiseS3Upload ⇒ <code>Promise</code>
|
|
409
|
-
Upload data to S3
|
|
410
|
-
|
|
411
|
-
Note: This is equivalent to calling `aws.s3().upload(params).promise()`
|
|
412
|
-
|
|
413
|
-
**Kind**: static property of [<code>S3</code>](#module_S3)
|
|
414
|
-
**Returns**: <code>Promise</code> - see [S3.upload()](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property)
|
|
415
|
-
|
|
416
|
-
| Param | Type | Description |
|
|
417
|
-
| --- | --- | --- |
|
|
418
|
-
| params | <code>Object</code> | see [S3.upload()](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property) |
|
|
419
|
-
|
|
420
|
-
<a name="module_S3.s3GetObjectTagging"></a>
|
|
421
|
-
|
|
422
|
-
### S3.s3GetObjectTagging ⇒ <code>Promise.<AWS.S3.GetObjectTaggingOutput></code>
|
|
423
|
-
Get object Tagging from S3
|
|
424
|
-
|
|
425
|
-
**Kind**: static property of [<code>S3</code>](#module_S3)
|
|
426
|
-
**Returns**: <code>Promise.<AWS.S3.GetObjectTaggingOutput></code> - the promised response from `S3.getObjectTagging`
|
|
427
|
-
|
|
428
|
-
| Param | Type | Description |
|
|
429
|
-
| --- | --- | --- |
|
|
430
|
-
| bucket | <code>string</code> | name of bucket |
|
|
431
|
-
| key | <code>string</code> | key for object (filepath + filename) |
|
|
432
|
-
|
|
433
|
-
<a name="module_S3.s3PutObjectTagging"></a>
|
|
434
|
-
|
|
435
|
-
### S3.s3PutObjectTagging ⇒ <code>Promise</code>
|
|
436
|
-
Puts object Tagging in S3
|
|
437
|
-
https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#putObjectTagging-property
|
|
438
|
-
|
|
439
|
-
**Kind**: static property of [<code>S3</code>](#module_S3)
|
|
440
|
-
**Returns**: <code>Promise</code> - returns response from `S3.getObjectTagging` as a promise
|
|
441
|
-
|
|
442
|
-
| Param | Type | Description |
|
|
443
|
-
| --- | --- | --- |
|
|
444
|
-
| Bucket | <code>string</code> | name of bucket |
|
|
445
|
-
| Key | <code>string</code> | key for object (filepath + filename) |
|
|
446
|
-
| Tagging | <code>Object</code> | tagging object |
|
|
447
|
-
|
|
448
358
|
<a name="module_S3.getS3Object"></a>
|
|
449
359
|
|
|
450
360
|
### ~~S3.getS3Object ⇒ <code>Promise</code>~~
|
|
@@ -543,6 +453,33 @@ e.g. [{ Key: 'tag', Value: 'value }] to 'tag=value'
|
|
|
543
453
|
| --- | --- | --- |
|
|
544
454
|
| tagset | <code>Array.<Object></code> | S3 TagSet array |
|
|
545
455
|
|
|
456
|
+
<a name="module_S3..deleteS3Object"></a>
|
|
457
|
+
|
|
458
|
+
### S3~deleteS3Object(bucket, key) ⇒ <code>Promise</code>
|
|
459
|
+
Delete an object from S3
|
|
460
|
+
|
|
461
|
+
**Kind**: inner method of [<code>S3</code>](#module_S3)
|
|
462
|
+
**Returns**: <code>Promise</code> - promise of the object being deleted
|
|
463
|
+
|
|
464
|
+
| Param | Type | Description |
|
|
465
|
+
| --- | --- | --- |
|
|
466
|
+
| bucket | <code>string</code> | bucket where the object exists |
|
|
467
|
+
| key | <code>string</code> | key of the object to be deleted |
|
|
468
|
+
|
|
469
|
+
<a name="module_S3..headObject"></a>
|
|
470
|
+
|
|
471
|
+
### S3~headObject(Bucket, Key, retryOptions) ⇒ <code>Promise</code>
|
|
472
|
+
Get an object header from S3
|
|
473
|
+
|
|
474
|
+
**Kind**: inner method of [<code>S3</code>](#module_S3)
|
|
475
|
+
**Returns**: <code>Promise</code> - returns response from `S3.headObject` as a promise
|
|
476
|
+
|
|
477
|
+
| Param | Type | Description |
|
|
478
|
+
| --- | --- | --- |
|
|
479
|
+
| Bucket | <code>string</code> | name of bucket |
|
|
480
|
+
| Key | <code>string</code> | key for object (filepath + filename) |
|
|
481
|
+
| retryOptions | <code>Object</code> | options to control retry behavior when an object does not exist. See https://github.com/tim-kos/node-retry#retryoperationoptions By default, retries will not be performed |
|
|
482
|
+
|
|
546
483
|
<a name="module_S3..s3ObjectExists"></a>
|
|
547
484
|
|
|
548
485
|
### S3~s3ObjectExists(params) ⇒ <code>Promise.<boolean></code>
|
|
@@ -571,6 +508,17 @@ Wait for an object to exist in S3
|
|
|
571
508
|
| [params.interval] | <code>number</code> | <code>1000</code> | interval before retries, in ms |
|
|
572
509
|
| [params.timeout] | <code>number</code> | <code>30000</code> | timeout, in ms |
|
|
573
510
|
|
|
511
|
+
<a name="module_S3..s3PutObject"></a>
|
|
512
|
+
|
|
513
|
+
### S3~s3PutObject(params) ⇒ <code>Promise</code>
|
|
514
|
+
Put an object on S3
|
|
515
|
+
|
|
516
|
+
**Kind**: inner method of [<code>S3</code>](#module_S3)
|
|
517
|
+
|
|
518
|
+
| Param | Type | Description |
|
|
519
|
+
| --- | --- | --- |
|
|
520
|
+
| params | <code>Object</code> | same params as https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#putObject-property promise of the object being put |
|
|
521
|
+
|
|
574
522
|
<a name="module_S3..putFile"></a>
|
|
575
523
|
|
|
576
524
|
### S3~putFile(bucket, key, filename) ⇒ <code>Promise</code>
|
|
@@ -584,21 +532,56 @@ Upload a file to S3
|
|
|
584
532
|
| key | <code>string</code> | the destination S3 key |
|
|
585
533
|
| filename | <code>filename</code> | the local file to be uploaded |
|
|
586
534
|
|
|
535
|
+
<a name="module_S3..s3CopyObject"></a>
|
|
536
|
+
|
|
537
|
+
### S3~s3CopyObject(params) ⇒ <code>Promise</code>
|
|
538
|
+
Copy an object from one location on S3 to another
|
|
539
|
+
|
|
540
|
+
**Kind**: inner method of [<code>S3</code>](#module_S3)
|
|
541
|
+
**Returns**: <code>Promise</code> - promise of the object being copied
|
|
542
|
+
|
|
543
|
+
| Param | Type | Description |
|
|
544
|
+
| --- | --- | --- |
|
|
545
|
+
| params | <code>Object</code> | same params as https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#putObject-property |
|
|
546
|
+
|
|
547
|
+
<a name="module_S3..promiseS3Upload"></a>
|
|
548
|
+
|
|
549
|
+
### S3~promiseS3Upload(params) ⇒ <code>Promise</code>
|
|
550
|
+
Upload data to S3
|
|
551
|
+
|
|
552
|
+
see https://github.com/aws/aws-sdk-js-v3/tree/main/lib/lib-storage
|
|
553
|
+
|
|
554
|
+
**Kind**: inner method of [<code>S3</code>](#module_S3)
|
|
555
|
+
|
|
556
|
+
| Param | Type |
|
|
557
|
+
| --- | --- |
|
|
558
|
+
| params | <code>UploadOptions</code> |
|
|
559
|
+
|
|
587
560
|
<a name="module_S3..streamS3Upload"></a>
|
|
588
561
|
|
|
589
562
|
### S3~streamS3Upload(uploadStream, uploadParams) ⇒ <code>Promise</code>
|
|
590
563
|
Upload data to S3 using a stream
|
|
591
564
|
|
|
592
|
-
We are not using `s3.upload().promise()` due to errors observed in testing
|
|
593
|
-
with uncaught exceptions. By creating our own promise, we can ensure any
|
|
594
|
-
errors from the streams or upload cause this promise to reject.
|
|
595
|
-
|
|
596
565
|
**Kind**: inner method of [<code>S3</code>](#module_S3)
|
|
597
566
|
|
|
598
567
|
| Param | Type | Description |
|
|
599
568
|
| --- | --- | --- |
|
|
600
569
|
| uploadStream | <code>Readable</code> | Stream of data to upload |
|
|
601
|
-
| uploadParams | <code>Object</code> |
|
|
570
|
+
| uploadParams | <code>Object</code> | |
|
|
571
|
+
|
|
572
|
+
<a name="module_S3..getObjectReadStream"></a>
|
|
573
|
+
|
|
574
|
+
### S3~getObjectReadStream(params) ⇒ <code>Promise.<Readable></code>
|
|
575
|
+
Get a readable stream for an S3 object
|
|
576
|
+
|
|
577
|
+
**Kind**: inner method of [<code>S3</code>](#module_S3)
|
|
578
|
+
|
|
579
|
+
| Param | Type | Description |
|
|
580
|
+
| --- | --- | --- |
|
|
581
|
+
| params | <code>Object</code> | |
|
|
582
|
+
| params.s3 | <code>S3</code> | an S3 instance |
|
|
583
|
+
| params.bucket | <code>string</code> | the bucket of the requested object |
|
|
584
|
+
| params.key | <code>string</code> | the key of the requested object |
|
|
602
585
|
|
|
603
586
|
<a name="module_S3..downloadS3File"></a>
|
|
604
587
|
|
|
@@ -626,21 +609,49 @@ Get the size of an S3 object
|
|
|
626
609
|
| params | <code>Object</code> | |
|
|
627
610
|
| params.bucket | <code>string</code> | |
|
|
628
611
|
| params.key | <code>string</code> | |
|
|
629
|
-
| params.s3 | <code>
|
|
612
|
+
| params.s3 | <code>S3</code> | an S3 client instance |
|
|
613
|
+
|
|
614
|
+
<a name="module_S3..s3GetObjectTagging"></a>
|
|
615
|
+
|
|
616
|
+
### S3~s3GetObjectTagging(bucket, key) ⇒ <code>Promise.<GetObjectTaggingOutput></code>
|
|
617
|
+
Get object Tagging from S3
|
|
618
|
+
|
|
619
|
+
**Kind**: inner method of [<code>S3</code>](#module_S3)
|
|
620
|
+
**Returns**: <code>Promise.<GetObjectTaggingOutput></code> - the promised response from `S3.getObjectTagging`
|
|
621
|
+
|
|
622
|
+
| Param | Type | Description |
|
|
623
|
+
| --- | --- | --- |
|
|
624
|
+
| bucket | <code>string</code> | name of bucket |
|
|
625
|
+
| key | <code>string</code> | key for object (filepath + filename) |
|
|
626
|
+
|
|
627
|
+
<a name="module_S3..s3PutObjectTagging"></a>
|
|
628
|
+
|
|
629
|
+
### S3~s3PutObjectTagging(Bucket, Key, ObjectTagging) ⇒ <code>Promise</code>
|
|
630
|
+
Puts object Tagging in S3
|
|
631
|
+
https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#putObjectTagging-property
|
|
632
|
+
|
|
633
|
+
**Kind**: inner method of [<code>S3</code>](#module_S3)
|
|
634
|
+
**Returns**: <code>Promise</code> - returns response from `S3.getObjectTagging` as a promise
|
|
635
|
+
|
|
636
|
+
| Param | Type | Description |
|
|
637
|
+
| --- | --- | --- |
|
|
638
|
+
| Bucket | <code>string</code> | name of bucket |
|
|
639
|
+
| Key | <code>string</code> | key for object (filepath + filename) |
|
|
640
|
+
| ObjectTagging | <code>Object</code> | tagging object |
|
|
630
641
|
|
|
631
642
|
<a name="module_S3..getObject"></a>
|
|
632
643
|
|
|
633
|
-
### S3~getObject(s3Client, params) ⇒ <code>Promise.<
|
|
644
|
+
### S3~getObject(s3Client, params) ⇒ <code>Promise.<GetObjectOutput></code>
|
|
634
645
|
Gets an object from S3.
|
|
635
646
|
|
|
636
647
|
**Kind**: inner method of [<code>S3</code>](#module_S3)
|
|
637
|
-
**Returns**: <code>Promise.<
|
|
648
|
+
**Returns**: <code>Promise.<GetObjectOutput></code> - response from `S3.getObject()`
|
|
638
649
|
as a Promise
|
|
639
650
|
|
|
640
651
|
| Param | Type | Description |
|
|
641
652
|
| --- | --- | --- |
|
|
642
|
-
| s3Client | <code>
|
|
643
|
-
| params | <code>
|
|
653
|
+
| s3Client | <code>S3</code> | an `S3` instance |
|
|
654
|
+
| params | <code>GetObjectCommandInput</code> | parameters object to pass through to `S3.getObject()` |
|
|
644
655
|
|
|
645
656
|
**Example**
|
|
646
657
|
```js
|
|
@@ -648,7 +659,7 @@ const obj = await getObject(s3(), { Bucket: 'b', Key: 'k' })
|
|
|
648
659
|
```
|
|
649
660
|
<a name="module_S3..waitForObject"></a>
|
|
650
661
|
|
|
651
|
-
### S3~waitForObject(s3Client, params, [retryOptions]) ⇒ <code>Promise.<
|
|
662
|
+
### S3~waitForObject(s3Client, params, [retryOptions]) ⇒ <code>Promise.<GetObjectOutput></code>
|
|
652
663
|
Get an object from S3, waiting for it to exist and, if specified, have the
|
|
653
664
|
correct ETag.
|
|
654
665
|
|
|
@@ -656,10 +667,22 @@ correct ETag.
|
|
|
656
667
|
|
|
657
668
|
| Param | Type | Default |
|
|
658
669
|
| --- | --- | --- |
|
|
659
|
-
| s3Client | <code>
|
|
660
|
-
| params | <code>
|
|
670
|
+
| s3Client | <code>S3</code> | |
|
|
671
|
+
| params | <code>GetObjectCommandInput</code> | |
|
|
661
672
|
| [retryOptions] | <code>pRetry.Options</code> | <code>{}</code> |
|
|
662
673
|
|
|
674
|
+
<a name="module_S3..getObjectStreamContents"></a>
|
|
675
|
+
|
|
676
|
+
### S3~getObjectStreamContents(objectReadStream) ⇒ <code>Promise.<string></code>
|
|
677
|
+
Transform streaming response from S3 object to text content
|
|
678
|
+
|
|
679
|
+
**Kind**: inner method of [<code>S3</code>](#module_S3)
|
|
680
|
+
**Returns**: <code>Promise.<string></code> - the contents of the S3 object
|
|
681
|
+
|
|
682
|
+
| Param | Type | Description |
|
|
683
|
+
| --- | --- | --- |
|
|
684
|
+
| objectReadStream | <code>Readable</code> | Readable stream of S3 object |
|
|
685
|
+
|
|
663
686
|
<a name="module_S3..getTextObject"></a>
|
|
664
687
|
|
|
665
688
|
### S3~getTextObject(bucket, key) ⇒ <code>Promise.<string></code>
|
|
@@ -686,20 +709,6 @@ Fetch JSON stored in an S3 object
|
|
|
686
709
|
| bucket | <code>string</code> | the S3 object's bucket |
|
|
687
710
|
| key | <code>string</code> | the S3 object's key |
|
|
688
711
|
|
|
689
|
-
<a name="module_S3..getObjectReadStream"></a>
|
|
690
|
-
|
|
691
|
-
### S3~getObjectReadStream(params) ⇒ <code>Readable</code>
|
|
692
|
-
Get a readable stream for an S3 object
|
|
693
|
-
|
|
694
|
-
**Kind**: inner method of [<code>S3</code>](#module_S3)
|
|
695
|
-
|
|
696
|
-
| Param | Type | Description |
|
|
697
|
-
| --- | --- | --- |
|
|
698
|
-
| params | <code>Object</code> | |
|
|
699
|
-
| params.s3 | <code>AWS.S3</code> | an AWS.S3 instance |
|
|
700
|
-
| params.bucket | <code>string</code> | the bucket of the requested object |
|
|
701
|
-
| params.key | <code>string</code> | the key of the requested object |
|
|
702
|
-
|
|
703
712
|
<a name="module_S3..fileExists"></a>
|
|
704
713
|
|
|
705
714
|
### S3~fileExists(bucket, key) ⇒ <code>Promise</code>
|
|
@@ -779,7 +788,7 @@ Calculate the cryptographic hash of an S3 object
|
|
|
779
788
|
| Param | Type | Description |
|
|
780
789
|
| --- | --- | --- |
|
|
781
790
|
| params | <code>Object</code> | |
|
|
782
|
-
| params.s3 | <code>
|
|
791
|
+
| params.s3 | <code>S3</code> | an S3 instance |
|
|
783
792
|
| params.algorithm | <code>string</code> | `cksum`, or an algorithm listed in `openssl list -digest-algorithms` |
|
|
784
793
|
| params.bucket | <code>string</code> | |
|
|
785
794
|
| params.key | <code>string</code> | |
|
|
@@ -855,7 +864,7 @@ Copy an S3 object to another location in S3 using a multipart copy
|
|
|
855
864
|
| params.sourceKey | <code>string</code> | | |
|
|
856
865
|
| params.destinationBucket | <code>string</code> | | |
|
|
857
866
|
| params.destinationKey | <code>string</code> | | |
|
|
858
|
-
| [params.sourceObject] | <code>
|
|
867
|
+
| [params.sourceObject] | <code>S3.HeadObjectOutput</code> | | Output from https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#headObject-property |
|
|
859
868
|
| [params.ACL] | <code>string</code> | | an [S3 Canned ACL](https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl) |
|
|
860
869
|
| [params.copyTags] | <code>boolean</code> | <code>false</code> | |
|
|
861
870
|
| [params.chunkSize] | <code>number</code> | | chunk size of the S3 multipart uploads |
|