@cumulus/aws-client 11.1.0 → 11.1.1
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/README.md +139 -130
- package/S3.d.ts +86 -94
- package/S3.js +176 -135
- package/S3ListObjectsV2Queue.d.ts +4 -3
- package/S3ListObjectsV2Queue.js +1 -1
- package/S3ObjectStore.d.ts +12 -9
- package/S3ObjectStore.js +43 -44
- package/client.js +0 -4
- package/lib/S3MultipartUploads.d.ts +5 -4
- package/lib/S3MultipartUploads.js +4 -4
- package/package.json +14 -6
- package/services.d.ts +2 -1
- package/services.js +2 -1
- package/test-utils.d.ts +7 -3
- package/test-utils.js +6 -5
- package/types.d.ts +2 -1
package/README.md
CHANGED
|
@@ -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 |
|