@cumulus/aws-client 18.2.2 → 18.3.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.
@@ -1,13 +1,14 @@
1
+ import { CloudFormation } from '@aws-sdk/client-cloudformation';
1
2
  declare class CloudFormationGateway {
2
3
  private cloudFormationService;
3
- constructor(cloudFormationService: AWS.CloudFormation);
4
+ constructor(cloudFormationService: CloudFormation);
4
5
  /**
5
6
  * Get the status of a CloudFormation stack
6
7
  *
7
8
  * @param {string} StackName
8
9
  * @returns {string} the stack status
9
10
  */
10
- getStackStatus(StackName: string): Promise<string>;
11
+ getStackStatus(StackName: string): Promise<import("@aws-sdk/client-cloudformation").StackStatus | undefined>;
11
12
  }
12
13
  export = CloudFormationGateway;
13
14
  //# sourceMappingURL=CloudFormationGateway.d.ts.map
@@ -21,7 +21,7 @@ class CloudFormationGateway {
21
21
  try {
22
22
  const stackDetails = await this.cloudFormationService.describeStacks({
23
23
  StackName,
24
- }).promise();
24
+ });
25
25
  if (!stackDetails.Stacks) {
26
26
  throw new Error(`Could not fetch stack details of ${StackName}`);
27
27
  }
package/Lambda.d.ts CHANGED
@@ -1,15 +1,17 @@
1
1
  /**
2
2
  * @module Lambda
3
3
  */
4
- import { InvocationType } from '@aws-sdk/client-lambda';
4
+ import { InvocationType, InvokeCommandOutput } from '@aws-sdk/client-lambda';
5
+ import { EventBridgeEvent } from 'aws-lambda';
6
+ export declare type StepFunctionEventBridgeEvent = EventBridgeEvent<'Step Functions Execution Status Change', {
7
+ [key: string]: string;
8
+ }>;
9
+ /**
10
+ * Bare check for EventBridge shape
11
+ */
12
+ export declare const isEventBridgeEvent: (event: Object) => event is StepFunctionEventBridgeEvent;
5
13
  /**
6
14
  * Invoke a Lambda function
7
- *
8
- * @param {string} name - Lambda function name
9
- * @param {any} payload - the payload to the Lambda function
10
- * @param {string} type - the invocation type
11
- * @returns {Promise<InvokeCommandOutput>}
12
- * @alias module:Lambda.invoke
13
15
  */
14
- export declare const invoke: (name: string, payload: unknown, type?: InvocationType) => Promise<false | import("@aws-sdk/client-lambda").InvokeCommandOutput>;
16
+ export declare const invoke: (name: string, payload: unknown, type?: InvocationType) => Promise<InvokeCommandOutput | undefined>;
15
17
  //# sourceMappingURL=Lambda.d.ts.map
package/Lambda.js CHANGED
@@ -3,33 +3,37 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.invoke = void 0;
6
+ exports.invoke = exports.isEventBridgeEvent = void 0;
7
+ /**
8
+ * @module Lambda
9
+ */
10
+ const client_lambda_1 = require("@aws-sdk/client-lambda");
7
11
  const logger_1 = __importDefault(require("@cumulus/logger"));
8
12
  const services_1 = require("./services");
9
13
  const test_utils_1 = require("./test-utils");
10
14
  const log = new logger_1.default({ sender: 'aws-client/Lambda' });
15
+ /**
16
+ * Bare check for EventBridge shape
17
+ */
18
+ const isEventBridgeEvent = (event) => (event instanceof Object
19
+ && 'detail' in event);
20
+ exports.isEventBridgeEvent = isEventBridgeEvent;
11
21
  /**
12
22
  * Invoke a Lambda function
13
- *
14
- * @param {string} name - Lambda function name
15
- * @param {any} payload - the payload to the Lambda function
16
- * @param {string} type - the invocation type
17
- * @returns {Promise<InvokeCommandOutput>}
18
- * @alias module:Lambda.invoke
19
23
  */
20
24
  const invoke = async (name, payload, type = 'Event') => {
21
25
  if (process.env.IS_LOCAL || (0, test_utils_1.inTestMode)()) {
22
26
  log.info(`Faking Lambda invocation for ${name}`);
23
- return false;
27
+ return undefined;
24
28
  }
25
29
  log.info(`Invoking ${name}`);
26
30
  let response;
27
31
  try {
28
- response = await (0, services_1.lambda)().invoke({
32
+ response = await (0, services_1.lambda)().send(new client_lambda_1.InvokeCommand({
29
33
  FunctionName: name,
30
34
  Payload: new TextEncoder().encode(JSON.stringify(payload)),
31
35
  InvocationType: type,
32
- });
36
+ }));
33
37
  }
34
38
  catch (error) {
35
39
  log.error(`Error invoking ${name}`, error);
package/README.md CHANGED
@@ -37,12 +37,16 @@ NODE_ENV=test
37
37
  <dd></dd>
38
38
  <dt><a href="#module_Kinesis">Kinesis</a></dt>
39
39
  <dd></dd>
40
+ <dt><a href="#module_Lambda">Lambda</a></dt>
41
+ <dd></dd>
40
42
  <dt><a href="#module_S3">S3</a></dt>
41
43
  <dd></dd>
42
44
  <dt><a href="#module_SNS">SNS</a></dt>
43
45
  <dd></dd>
44
46
  <dt><a href="#module_SQS">SQS</a></dt>
45
47
  <dd></dd>
48
+ <dt><a href="#module_STS">STS</a></dt>
49
+ <dd></dd>
46
50
  <dt><a href="#module_SecretsManager">SecretsManager</a></dt>
47
51
  <dd></dd>
48
52
  <dt><a href="#module_StepFunctions">StepFunctions</a></dt>
@@ -257,6 +261,26 @@ Describe a Kinesis stream.
257
261
  | params.StreamName | <code>string</code> | A Kinesis stream name |
258
262
  | retryOptions | <code>Object</code> | Options passed to p-retry module |
259
263
 
264
+ <a name="module_Lambda"></a>
265
+
266
+ ## Lambda
267
+
268
+ * [Lambda](#module_Lambda)
269
+ * [~isEventBridgeEvent()](#module_Lambda..isEventBridgeEvent)
270
+ * [~invoke()](#module_Lambda..invoke)
271
+
272
+ <a name="module_Lambda..isEventBridgeEvent"></a>
273
+
274
+ ### Lambda~isEventBridgeEvent()
275
+ Bare check for EventBridge shape
276
+
277
+ **Kind**: inner method of [<code>Lambda</code>](#module_Lambda)
278
+ <a name="module_Lambda..invoke"></a>
279
+
280
+ ### Lambda~invoke()
281
+ Invoke a Lambda function
282
+
283
+ **Kind**: inner method of [<code>Lambda</code>](#module_Lambda)
260
284
  <a name="module_S3"></a>
261
285
 
262
286
  ## S3
@@ -264,15 +288,16 @@ Describe a Kinesis stream.
264
288
  * [S3](#module_S3)
265
289
  * _static_
266
290
  * ~~[.getS3Object](#module_S3.getS3Object) ⇒ <code>Promise</code>~~
267
- * [.recursivelyDeleteS3Bucket](#module_S3.recursivelyDeleteS3Bucket) ⇒ <code>Promise</code>
291
+ * [.recursivelyDeleteS3Bucket](#module_S3.recursivelyDeleteS3Bucket) ⇒
268
292
  * [.listS3ObjectsV2(params)](#module_S3.listS3ObjectsV2) ⇒ <code>Promise.&lt;Array&gt;</code>
293
+ * [.listS3ObjectsV2Batch(params)](#module_S3.listS3ObjectsV2Batch)
269
294
  * _inner_
270
295
  * [~s3Join(...args)](#module_S3..s3Join) ⇒ <code>string</code>
271
296
  * [~parseS3Uri(uri)](#module_S3..parseS3Uri) ⇒ <code>Object</code>
272
297
  * [~buildS3Uri(bucket, key)](#module_S3..buildS3Uri) ⇒ <code>string</code>
273
298
  * [~s3TagSetToQueryString(tagset)](#module_S3..s3TagSetToQueryString) ⇒ <code>string</code>
274
299
  * [~deleteS3Object(bucket, key)](#module_S3..deleteS3Object) ⇒ <code>Promise</code>
275
- * [~headObject(Bucket, Key, retryOptions)](#module_S3..headObject) ⇒ <code>Promise</code>
300
+ * [~headObject(Bucket, Key, retryOptions)](#module_S3..headObject) ⇒
276
301
  * [~s3ObjectExists(params)](#module_S3..s3ObjectExists) ⇒ <code>Promise.&lt;boolean&gt;</code>
277
302
  * [~waitForObjectToExist(params)](#module_S3..waitForObjectToExist) ⇒ <code>Promise.&lt;undefined&gt;</code>
278
303
  * [~s3PutObject(params)](#module_S3..s3PutObject) ⇒ <code>Promise</code>
@@ -292,9 +317,9 @@ Describe a Kinesis stream.
292
317
  * [~getJsonS3Object(bucket, key)](#module_S3..getJsonS3Object) ⇒ <code>Promise.&lt;\*&gt;</code>
293
318
  * [~fileExists(bucket, key)](#module_S3..fileExists) ⇒ <code>Promise</code>
294
319
  * [~deleteS3Files(s3Objs)](#module_S3..deleteS3Files) ⇒ <code>Promise</code>
295
- * [~deleteS3Buckets(buckets)](#module_S3..deleteS3Buckets) ⇒ <code>Promise</code>
296
320
  * [~uploadS3FileStream(fileStream, bucket, key, s3opts)](#module_S3..uploadS3FileStream) ⇒ <code>Promise</code>
297
- * [~listS3Objects(bucket, prefix, skipFolders)](#module_S3..listS3Objects) ⇒ <code>Promise</code>
321
+ * [~listS3Objects()](#module_S3..listS3Objects)
322
+ * [~deleteS3Buckets(buckets)](#module_S3..deleteS3Buckets) ⇒ <code>Promise</code>
298
323
  * [~calculateObjectHash(params)](#module_S3..calculateObjectHash)
299
324
  * [~validateS3ObjectChecksum(params)](#module_S3..validateS3ObjectChecksum) ⇒ <code>Promise.&lt;boolean&gt;</code>
300
325
  * [~getFileBucketAndKey(pathParams)](#module_S3..getFileBucketAndKey) ⇒ <code>Array.&lt;string&gt;</code>
@@ -321,15 +346,15 @@ Gets an object from S3.
321
346
 
322
347
  <a name="module_S3.recursivelyDeleteS3Bucket"></a>
323
348
 
324
- ### S3.recursivelyDeleteS3Bucket ⇒ <code>Promise</code>
349
+ ### S3.recursivelyDeleteS3Bucket ⇒
325
350
  Delete a bucket and all of its objects from S3
326
351
 
327
352
  **Kind**: static property of [<code>S3</code>](#module_S3)
328
- **Returns**: <code>Promise</code> - the promised result of `S3.deleteBucket`
353
+ **Returns**: the promised result of `S3.deleteBucket`
329
354
 
330
- | Param | Type | Description |
331
- | --- | --- | --- |
332
- | bucket | <code>string</code> | name of the bucket |
355
+ | Param | Description |
356
+ | --- | --- |
357
+ | bucket | name of the bucket |
333
358
 
334
359
  <a name="module_S3.listS3ObjectsV2"></a>
335
360
 
@@ -351,6 +376,24 @@ https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#listObjectsV2-pr
351
376
  | --- | --- | --- |
352
377
  | params | <code>Object</code> | params for the s3.listObjectsV2 call |
353
378
 
379
+ <a name="module_S3.listS3ObjectsV2Batch"></a>
380
+
381
+ ### S3.listS3ObjectsV2Batch(params)
382
+ Fetch lazy list of S3 objects
383
+
384
+ listObjectsV2 is limited to 1,000 results per call. This function continues
385
+ listing objects until there are no more to be fetched.
386
+
387
+ The passed params must be compatible with the listObjectsV2 call.
388
+
389
+ https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#listObjectsV2-property
390
+
391
+ **Kind**: static method of [<code>S3</code>](#module_S3)
392
+
393
+ | Param | Description |
394
+ | --- | --- |
395
+ | params | params for the s3.listObjectsV2 call |
396
+
354
397
  <a name="module_S3..s3Join"></a>
355
398
 
356
399
  ### S3~s3Join(...args) ⇒ <code>string</code>
@@ -416,17 +459,17 @@ Delete an object from S3
416
459
 
417
460
  <a name="module_S3..headObject"></a>
418
461
 
419
- ### S3~headObject(Bucket, Key, retryOptions) ⇒ <code>Promise</code>
462
+ ### S3~headObject(Bucket, Key, retryOptions) ⇒
420
463
  Get an object header from S3
421
464
 
422
465
  **Kind**: inner method of [<code>S3</code>](#module_S3)
423
- **Returns**: <code>Promise</code> - returns response from `S3.headObject` as a promise
466
+ **Returns**: returns response from `S3.headObject` as a promise
424
467
 
425
- | Param | Type | Description |
426
- | --- | --- | --- |
427
- | Bucket | <code>string</code> | name of bucket |
428
- | Key | <code>string</code> | key for object (filepath + filename) |
429
- | 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 |
468
+ | Param | Description |
469
+ | --- | --- |
470
+ | Bucket | name of bucket |
471
+ | Key | key for object (filepath + filename) |
472
+ | retryOptions | 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 |
430
473
 
431
474
  <a name="module_S3..s3ObjectExists"></a>
432
475
 
@@ -683,18 +726,6 @@ Delete files from S3
683
726
  | --- | --- | --- |
684
727
  | s3Objs | <code>Array</code> | An array of objects containing keys 'Bucket' and 'Key' |
685
728
 
686
- <a name="module_S3..deleteS3Buckets"></a>
687
-
688
- ### S3~deleteS3Buckets(buckets) ⇒ <code>Promise</code>
689
- Delete a list of buckets and all of their objects from S3
690
-
691
- **Kind**: inner method of [<code>S3</code>](#module_S3)
692
- **Returns**: <code>Promise</code> - the promised result of `S3.deleteBucket`
693
-
694
- | Param | Type | Description |
695
- | --- | --- | --- |
696
- | buckets | <code>Array</code> | list of bucket names |
697
-
698
729
  <a name="module_S3..uploadS3FileStream"></a>
699
730
 
700
731
  ### S3~uploadS3FileStream(fileStream, bucket, key, s3opts) ⇒ <code>Promise</code>
@@ -712,19 +743,21 @@ Upload the file associated with the given stream to an S3 bucket
712
743
 
713
744
  <a name="module_S3..listS3Objects"></a>
714
745
 
715
- ### S3~listS3Objects(bucket, prefix, skipFolders) ⇒ <code>Promise</code>
746
+ ### S3~listS3Objects()
716
747
  List the objects in an S3 bucket
717
748
 
718
749
  **Kind**: inner method of [<code>S3</code>](#module_S3)
719
- **Returns**: <code>Promise</code> - A promise that resolves to the list of objects. Each S3
720
- object is represented as a JS object with the following attributes: `Key`,
721
- `ETag`, `LastModified`, `Owner`, `Size`, `StorageClass`.
750
+ <a name="module_S3..deleteS3Buckets"></a>
722
751
 
723
- | Param | Type | Default | Description |
724
- | --- | --- | --- | --- |
725
- | bucket | <code>string</code> | | The name of the bucket |
726
- | prefix | <code>string</code> | | Only objects with keys starting with this prefix will be included (useful for searching folders in buckets, e.g., '/PDR') |
727
- | skipFolders | <code>boolean</code> | <code>true</code> | If true don't return objects that are folders (defaults to true) |
752
+ ### S3~deleteS3Buckets(buckets) <code>Promise</code>
753
+ Delete a list of buckets and all of their objects from S3
754
+
755
+ **Kind**: inner method of [<code>S3</code>](#module_S3)
756
+ **Returns**: <code>Promise</code> - the promised result of `S3.deleteBucket`
757
+
758
+ | Param | Type | Description |
759
+ | --- | --- | --- |
760
+ | buckets | <code>Array</code> | list of bucket names |
728
761
 
729
762
  <a name="module_S3..calculateObjectHash"></a>
730
763
 
@@ -842,22 +875,22 @@ Move an S3 object to another location in S3
842
875
  ## SNS
843
876
 
844
877
  * [SNS](#module_SNS)
845
- * [~publishSnsMessage(snsTopicArn, message, retryOptions)](#module_SNS..publishSnsMessage) ⇒ <code>Promise.&lt;undefined&gt;</code>
878
+ * [~publishSnsMessageWithRetry(snsTopicArn, message, retryOptions)](#module_SNS..publishSnsMessageWithRetry) ⇒ <code>Promise.&lt;undefined&gt;</code>
846
879
  * [~createSnsTopic(snsTopicName)](#module_SNS..createSnsTopic) ⇒
847
880
 
848
- <a name="module_SNS..publishSnsMessage"></a>
881
+ <a name="module_SNS..publishSnsMessageWithRetry"></a>
849
882
 
850
- ### SNS~publishSnsMessage(snsTopicArn, message, retryOptions) ⇒ <code>Promise.&lt;undefined&gt;</code>
883
+ ### SNS~publishSnsMessageWithRetry(snsTopicArn, message, retryOptions) ⇒ <code>Promise.&lt;undefined&gt;</code>
851
884
  Publish a message to an SNS topic. Does not catch
852
885
  errors, to allow more specific handling by the caller.
853
886
 
854
887
  **Kind**: inner method of [<code>SNS</code>](#module_SNS)
855
888
 
856
- | Param | Type | Description |
857
- | --- | --- | --- |
858
- | snsTopicArn | <code>string</code> | SNS topic ARN |
859
- | message | <code>Object</code> | Message object |
860
- | retryOptions | <code>Object</code> | options to control retry behavior when publishing a message fails. See https://github.com/tim-kos/node-retry#retryoperationoptions |
889
+ | Param | Description |
890
+ | --- | --- |
891
+ | snsTopicArn | SNS topic ARN |
892
+ | message | Message object |
893
+ | retryOptions | options to control retry behavior when publishing a message fails. See https://github.com/tim-kos/node-retry#retryoperationoptions |
861
894
 
862
895
  <a name="module_SNS..createSnsTopic"></a>
863
896
 
@@ -876,83 +909,60 @@ Create an SNS topic with a given name.
876
909
  ## SQS
877
910
 
878
911
  * [SQS](#module_SQS)
879
- * _static_
880
- * [.createQueue(QueueName)](#module_SQS.createQueue) ⇒ <code>Promise.&lt;string&gt;</code>
881
- * _inner_
882
- * [~sendSQSMessage(queueUrl, message, [logOverride])](#module_SQS..sendSQSMessage) ⇒ <code>Promise</code>
883
- * [~receiveSQSMessages(queueUrl, options)](#module_SQS..receiveSQSMessages) ⇒ <code>Promise.&lt;Array&gt;</code>
884
- * [~deleteSQSMessage(queueUrl, receiptHandle)](#module_SQS..deleteSQSMessage) ⇒ <code>Promise</code>
885
- * [~sqsQueueExists(queueUrl)](#module_SQS..sqsQueueExists) ⇒ <code>Promise.&lt;boolean&gt;</code>
912
+ * [~createQueue()](#module_SQS..createQueue)
913
+ * [~sendSQSMessage()](#module_SQS..sendSQSMessage)
914
+ * [~receiveSQSMessages()](#module_SQS..receiveSQSMessages)
915
+ * [~isSQSRecordLike()](#module_SQS..isSQSRecordLike)
916
+ * [~parseSQSMessageBody()](#module_SQS..parseSQSMessageBody)
917
+ * [~deleteSQSMessage()](#module_SQS..deleteSQSMessage)
918
+ * [~sqsQueueExists()](#module_SQS..sqsQueueExists)
886
919
 
887
- <a name="module_SQS.createQueue"></a>
920
+ <a name="module_SQS..createQueue"></a>
888
921
 
889
- ### SQS.createQueue(QueueName) ⇒ <code>Promise.&lt;string&gt;</code>
922
+ ### SQS~createQueue()
890
923
  Create an SQS Queue. Properly handles localstack queue URLs
891
924
 
892
- **Kind**: static method of [<code>SQS</code>](#module_SQS)
893
- **Returns**: <code>Promise.&lt;string&gt;</code> - the Queue URL
894
-
895
- | Param | Type | Description |
896
- | --- | --- | --- |
897
- | QueueName | <code>string</code> | queue name |
898
-
925
+ **Kind**: inner method of [<code>SQS</code>](#module_SQS)
899
926
  <a name="module_SQS..sendSQSMessage"></a>
900
927
 
901
- ### SQS~sendSQSMessage(queueUrl, message, [logOverride]) ⇒ <code>Promise</code>
928
+ ### SQS~sendSQSMessage()
902
929
  Send a message to AWS SQS
903
930
 
904
931
  **Kind**: inner method of [<code>SQS</code>](#module_SQS)
905
- **Returns**: <code>Promise</code> - resolves when the messsage has been sent
906
-
907
- | Param | Type | Description |
908
- | --- | --- | --- |
909
- | queueUrl | <code>string</code> | url of the SQS queue |
910
- | message | <code>string</code> \| <code>Object</code> | either string or object message. If an object it will be serialized into a JSON string. |
911
- | [logOverride] | <code>Logger</code> | optional Logger passed in for testing |
912
-
913
932
  <a name="module_SQS..receiveSQSMessages"></a>
914
933
 
915
- ### SQS~receiveSQSMessages(queueUrl, options) ⇒ <code>Promise.&lt;Array&gt;</code>
934
+ ### SQS~receiveSQSMessages()
916
935
  Receives SQS messages from a given queue. The number of messages received
917
936
  can be set and the timeout is also adjustable.
918
937
 
919
938
  **Kind**: inner method of [<code>SQS</code>](#module_SQS)
920
- **Returns**: <code>Promise.&lt;Array&gt;</code> - an array of messages
939
+ <a name="module_SQS..isSQSRecordLike"></a>
921
940
 
922
- | Param | Type | Default | Description |
923
- | --- | --- | --- | --- |
924
- | queueUrl | <code>string</code> | | url of the SQS queue |
925
- | options | <code>Object</code> | | options object |
926
- | [options.numOfMessages] | <code>integer</code> | <code>1</code> | number of messages to read from the queue |
927
- | [options.visibilityTimeout] | <code>integer</code> | <code>30</code> | number of seconds a message is invisible after read |
928
- | [options.waitTimeSeconds] | <code>integer</code> | <code>0</code> | number of seconds to poll SQS queue (long polling) |
941
+ ### SQS~isSQSRecordLike()
942
+ Bare check for SQS message Shape
929
943
 
930
- <a name="module_SQS..deleteSQSMessage"></a>
944
+ **Kind**: inner method of [<code>SQS</code>](#module_SQS)
945
+ <a name="module_SQS..parseSQSMessageBody"></a>
931
946
 
932
- ### SQS~deleteSQSMessage(queueUrl, receiptHandle) ⇒ <code>Promise</code>
933
- Delete a given SQS message from a given queue.
947
+ ### SQS~parseSQSMessageBody()
948
+ Extract SQS message body
934
949
 
935
950
  **Kind**: inner method of [<code>SQS</code>](#module_SQS)
936
- **Returns**: <code>Promise</code> - an AWS SQS response
951
+ <a name="module_SQS..deleteSQSMessage"></a>
937
952
 
938
- | Param | Type | Description |
939
- | --- | --- | --- |
940
- | queueUrl | <code>string</code> | url of the SQS queue |
941
- | receiptHandle | <code>integer</code> | the unique identifier of the sQS message |
953
+ ### SQS~deleteSQSMessage()
954
+ Delete a given SQS message from a given queue.
942
955
 
956
+ **Kind**: inner method of [<code>SQS</code>](#module_SQS)
943
957
  <a name="module_SQS..sqsQueueExists"></a>
944
958
 
945
- ### SQS~sqsQueueExists(queueUrl) ⇒ <code>Promise.&lt;boolean&gt;</code>
959
+ ### SQS~sqsQueueExists()
946
960
  Test if an SQS queue exists
947
961
 
948
962
  **Kind**: inner method of [<code>SQS</code>](#module_SQS)
949
- **Returns**: <code>Promise.&lt;boolean&gt;</code> - - a Promise that will resolve to a boolean indicating
950
- if the queue exists
951
-
952
- | Param | Type | Description |
953
- | --- | --- | --- |
954
- | queueUrl | <code>Object</code> | queue url |
963
+ <a name="module_STS"></a>
955
964
 
965
+ ## STS
956
966
  <a name="module_SecretsManager"></a>
957
967
 
958
968
  ## SecretsManager
@@ -962,16 +972,16 @@ Test if an SQS queue exists
962
972
 
963
973
  * [StepFunctions](#module_StepFunctions)
964
974
  * _static_
965
- * [.describeExecution(params)](#module_StepFunctions.describeExecution) ⇒ <code>Promise.&lt;Object&gt;</code>
966
- * [.describeStateMachine(params)](#module_StepFunctions.describeStateMachine) ⇒ <code>Promise.&lt;Object&gt;</code>
967
- * [.getExecutionHistory(params)](#module_StepFunctions.getExecutionHistory) ⇒ <code>Promise.&lt;Object&gt;</code>
975
+ * [.describeExecution(params)](#module_StepFunctions.describeExecution) ⇒ <code>Promise.&lt;DescribeExecutionOutput&gt;</code>
976
+ * [.describeStateMachine(params)](#module_StepFunctions.describeStateMachine) ⇒ <code>Promise.&lt;DescribeStateMachineOutput&gt;</code>
977
+ * [.getExecutionHistory(params)](#module_StepFunctions.getExecutionHistory) ⇒ <code>Promise.&lt;GetExecutionHistoryOutput&gt;</code>
968
978
  * [.listExecutions(params)](#module_StepFunctions.listExecutions) ⇒ <code>Promise.&lt;Object&gt;</code>
969
979
  * _inner_
970
980
  * [~executionExists(executionArn)](#module_StepFunctions..executionExists) ⇒ <code>Promise.&lt;boolean&gt;</code>
971
981
 
972
982
  <a name="module_StepFunctions.describeExecution"></a>
973
983
 
974
- ### StepFunctions.describeExecution(params) ⇒ <code>Promise.&lt;Object&gt;</code>
984
+ ### StepFunctions.describeExecution(params) ⇒ <code>Promise.&lt;DescribeExecutionOutput&gt;</code>
975
985
  Call StepFunctions DescribeExecution
976
986
 
977
987
  See [StepFunctions.describeExecution()](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/StepFunctions.html#describeExecution-property)
@@ -984,11 +994,11 @@ exponential backoff.
984
994
 
985
995
  | Param | Type |
986
996
  | --- | --- |
987
- | params | <code>Object</code> |
997
+ | params | <code>DescribeExecutionInput</code> |
988
998
 
989
999
  <a name="module_StepFunctions.describeStateMachine"></a>
990
1000
 
991
- ### StepFunctions.describeStateMachine(params) ⇒ <code>Promise.&lt;Object&gt;</code>
1001
+ ### StepFunctions.describeStateMachine(params) ⇒ <code>Promise.&lt;DescribeStateMachineOutput&gt;</code>
992
1002
  Call StepFunctions DescribeStateMachine
993
1003
 
994
1004
  See [StepFunctions.describeStateMachine()](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/StepFunctions.html#describeStateMachine-property)
@@ -1001,11 +1011,11 @@ exponential backoff.
1001
1011
 
1002
1012
  | Param | Type |
1003
1013
  | --- | --- |
1004
- | params | <code>Object</code> |
1014
+ | params | <code>DescribeStateMachineInput</code> |
1005
1015
 
1006
1016
  <a name="module_StepFunctions.getExecutionHistory"></a>
1007
1017
 
1008
- ### StepFunctions.getExecutionHistory(params) ⇒ <code>Promise.&lt;Object&gt;</code>
1018
+ ### StepFunctions.getExecutionHistory(params) ⇒ <code>Promise.&lt;GetExecutionHistoryOutput&gt;</code>
1009
1019
  Call StepFunctions GetExecutionHistory
1010
1020
 
1011
1021
  See [StepFunctions.getExecutionHistory()](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/StepFunctions.html#getExecutionHistory-property)
@@ -1018,7 +1028,7 @@ exponential backoff.
1018
1028
 
1019
1029
  | Param | Type |
1020
1030
  | --- | --- |
1021
- | params | <code>Object</code> |
1031
+ | params | <code>GetExecutionHistoryInput</code> |
1022
1032
 
1023
1033
  <a name="module_StepFunctions.listExecutions"></a>
1024
1034
 
package/S3.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  /// <reference types="node" />
5
5
  import pRetry from 'p-retry';
6
6
  import { Readable, TransformOptions } from 'stream';
7
- import { CopyObjectCommandInput, DeleteObjectRequest, GetObjectCommandInput, GetObjectOutput, HeadObjectOutput, ListObjectsV2Output, ListObjectsV2Request, ObjectCannedACL, PutObjectCommandInput, PutObjectRequest, S3, Tagging } from '@aws-sdk/client-s3';
7
+ import { CopyObjectCommandInput, DeleteObjectRequest, DeleteBucketCommandOutput, GetObjectCommandInput, GetObjectOutput, HeadObjectOutput, ListObjectsV2Request, ObjectCannedACL, PutObjectCommandInput, PutObjectRequest, S3, Tagging, ListObjectsCommandOutput } from '@aws-sdk/client-s3';
8
8
  import { Options as UploadOptions } from '@aws-sdk/lib-storage';
9
9
  import { s3 } from './services';
10
10
  export declare type GetObjectMethod = (params: GetObjectCommandInput) => Promise<GetObjectOutput>;
@@ -57,14 +57,14 @@ export declare const deleteS3Objects: (params: {
57
57
  /**
58
58
  * Get an object header from S3
59
59
  *
60
- * @param {string} Bucket - name of bucket
61
- * @param {string} Key - key for object (filepath + filename)
62
- * @param {Object} retryOptions - options to control retry behavior when an
60
+ * @param Bucket - name of bucket
61
+ * @param Key - key for object (filepath + filename)
62
+ * @param retryOptions - options to control retry behavior when an
63
63
  * object does not exist. See https://github.com/tim-kos/node-retry#retryoperationoptions
64
64
  * By default, retries will not be performed
65
- * @returns {Promise} returns response from `S3.headObject` as a promise
65
+ * @returns returns response from `S3.headObject` as a promise
66
66
  **/
67
- export declare const headObject: (Bucket: string, Key: string, retryOptions?: pRetry.Options) => Promise<import("@aws-sdk/client-s3").HeadObjectCommandOutput>;
67
+ export declare const headObject: (Bucket: string, Key: string, retryOptions?: pRetry.Options) => Promise<HeadObjectOutput>;
68
68
  /**
69
69
  * Test if an object exists in S3
70
70
  *
@@ -268,20 +268,6 @@ export declare const fileExists: (bucket: string, key: string) => Promise<false
268
268
  * from the deletion operations
269
269
  */
270
270
  export declare const deleteS3Files: (s3Objs: DeleteObjectRequest[]) => Promise<import("@aws-sdk/client-s3").DeleteObjectCommandOutput[]>;
271
- /**
272
- * Delete a bucket and all of its objects from S3
273
- *
274
- * @param {string} bucket - name of the bucket
275
- * @returns {Promise} the promised result of `S3.deleteBucket`
276
- **/
277
- export declare const recursivelyDeleteS3Bucket: (bucket: string) => Promise<import("@aws-sdk/client-s3").DeleteBucketCommandOutput>;
278
- /**
279
- * Delete a list of buckets and all of their objects from S3
280
- *
281
- * @param {Array} buckets - list of bucket names
282
- * @returns {Promise} the promised result of `S3.deleteBucket`
283
- **/
284
- export declare const deleteS3Buckets: (buckets: Array<string>) => Promise<any>;
285
271
  declare type FileInfo = {
286
272
  filename: string;
287
273
  key: string;
@@ -306,17 +292,8 @@ export declare const uploadS3FileStream: (fileStream: Readable, bucket: string,
306
292
  }>;
307
293
  /**
308
294
  * List the objects in an S3 bucket
309
- *
310
- * @param {string} bucket - The name of the bucket
311
- * @param {string} prefix - Only objects with keys starting with this prefix
312
- * will be included (useful for searching folders in buckets, e.g., '/PDR')
313
- * @param {boolean} skipFolders - If true don't return objects that are folders
314
- * (defaults to true)
315
- * @returns {Promise} A promise that resolves to the list of objects. Each S3
316
- * object is represented as a JS object with the following attributes: `Key`,
317
- * `ETag`, `LastModified`, `Owner`, `Size`, `StorageClass`.
318
295
  */
319
- export declare const listS3Objects: (bucket: string, prefix?: string, skipFolders?: boolean) => Promise<import("@aws-sdk/client-s3")._Object[]>;
296
+ export declare const listS3Objects: (bucket: string, prefix?: string, skipFolders?: boolean) => Promise<ListObjectsCommandOutput['Contents']>;
320
297
  /**
321
298
  * Fetch complete list of S3 objects
322
299
  *
@@ -333,7 +310,39 @@ export declare const listS3Objects: (bucket: string, prefix?: string, skipFolder
333
310
  *
334
311
  * @static
335
312
  */
336
- export declare const listS3ObjectsV2: (params: ListObjectsV2Request) => Promise<ListObjectsV2Output['Contents']>;
313
+ export declare const listS3ObjectsV2: (params: ListObjectsV2Request) => Promise<ListObjectsCommandOutput['Contents']>;
314
+ /**
315
+ * Fetch lazy list of S3 objects
316
+ *
317
+ * listObjectsV2 is limited to 1,000 results per call. This function continues
318
+ * listing objects until there are no more to be fetched.
319
+ *
320
+ * The passed params must be compatible with the listObjectsV2 call.
321
+ *
322
+ * https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#listObjectsV2-property
323
+ *
324
+ * @param params - params for the s3.listObjectsV2 call
325
+ * @yields a series of objects corresponding to
326
+ * the Contents property of the listObjectsV2 response
327
+ * batched to allow processing of one chunk at a time
328
+ *
329
+ * @static
330
+ */
331
+ export declare function listS3ObjectsV2Batch(params: ListObjectsV2Request): AsyncIterable<ListObjectsCommandOutput['Contents']>;
332
+ /**
333
+ * Delete a bucket and all of its objects from S3
334
+ *
335
+ * @param bucket - name of the bucket
336
+ * @returns the promised result of `S3.deleteBucket`
337
+ **/
338
+ export declare const recursivelyDeleteS3Bucket: (bucket: string) => Promise<DeleteBucketCommandOutput>;
339
+ /**
340
+ * Delete a list of buckets and all of their objects from S3
341
+ *
342
+ * @param {Array} buckets - list of bucket names
343
+ * @returns {Promise} the promised result of `S3.deleteBucket`
344
+ **/
345
+ export declare const deleteS3Buckets: (buckets: Array<string>) => Promise<any>;
337
346
  /**
338
347
  * Calculate the cryptographic hash of an S3 object
339
348
  *