@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.
- package/CloudFormationGateway.d.ts +3 -2
- package/CloudFormationGateway.js +1 -1
- package/Lambda.d.ts +10 -8
- package/Lambda.js +14 -10
- package/README.md +113 -103
- package/S3.d.ts +40 -31
- package/S3.js +69 -44
- package/SNS.d.ts +4 -4
- package/SNS.js +13 -10
- package/SQS.d.ts +13 -33
- package/SQS.js +43 -50
- package/STS.d.ts +5 -0
- package/STS.js +6 -0
- package/SecretsManager.js +1 -1
- package/StepFunctions.d.ts +17 -17
- package/StepFunctions.js +15 -14
- package/client.d.ts +1 -3
- package/client.js +1 -12
- package/lib/S3MultipartUploads.d.ts +3 -3
- package/package.json +17 -9
- package/services.d.ts +18 -16
- package/services.js +19 -40
- package/test-utils.d.ts +6 -8
- package/test-utils.js +6 -8
- package/types.d.ts +7 -2
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import { CloudFormation } from '@aws-sdk/client-cloudformation';
|
|
1
2
|
declare class CloudFormationGateway {
|
|
2
3
|
private cloudFormationService;
|
|
3
|
-
constructor(cloudFormationService:
|
|
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<
|
|
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
|
package/CloudFormationGateway.js
CHANGED
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<
|
|
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
|
|
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)().
|
|
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) ⇒
|
|
291
|
+
* [.recursivelyDeleteS3Bucket](#module_S3.recursivelyDeleteS3Bucket) ⇒
|
|
268
292
|
* [.listS3ObjectsV2(params)](#module_S3.listS3ObjectsV2) ⇒ <code>Promise.<Array></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) ⇒
|
|
300
|
+
* [~headObject(Bucket, Key, retryOptions)](#module_S3..headObject) ⇒
|
|
276
301
|
* [~s3ObjectExists(params)](#module_S3..s3ObjectExists) ⇒ <code>Promise.<boolean></code>
|
|
277
302
|
* [~waitForObjectToExist(params)](#module_S3..waitForObjectToExist) ⇒ <code>Promise.<undefined></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.<\*></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(
|
|
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.<boolean></code>
|
|
300
325
|
* [~getFileBucketAndKey(pathParams)](#module_S3..getFileBucketAndKey) ⇒ <code>Array.<string></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 ⇒
|
|
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**:
|
|
353
|
+
**Returns**: the promised result of `S3.deleteBucket`
|
|
329
354
|
|
|
330
|
-
| Param |
|
|
331
|
-
| --- | --- |
|
|
332
|
-
| 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) ⇒
|
|
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**:
|
|
466
|
+
**Returns**: returns response from `S3.headObject` as a promise
|
|
424
467
|
|
|
425
|
-
| Param |
|
|
426
|
-
| --- | --- |
|
|
427
|
-
| Bucket |
|
|
428
|
-
| Key |
|
|
429
|
-
| retryOptions |
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
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
|
-
* [~
|
|
878
|
+
* [~publishSnsMessageWithRetry(snsTopicArn, message, retryOptions)](#module_SNS..publishSnsMessageWithRetry) ⇒ <code>Promise.<undefined></code>
|
|
846
879
|
* [~createSnsTopic(snsTopicName)](#module_SNS..createSnsTopic) ⇒
|
|
847
880
|
|
|
848
|
-
<a name="module_SNS..
|
|
881
|
+
<a name="module_SNS..publishSnsMessageWithRetry"></a>
|
|
849
882
|
|
|
850
|
-
### SNS~
|
|
883
|
+
### SNS~publishSnsMessageWithRetry(snsTopicArn, message, retryOptions) ⇒ <code>Promise.<undefined></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 |
|
|
857
|
-
| --- | --- |
|
|
858
|
-
| snsTopicArn |
|
|
859
|
-
| message |
|
|
860
|
-
| retryOptions |
|
|
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
|
-
*
|
|
880
|
-
|
|
881
|
-
*
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
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
|
|
920
|
+
<a name="module_SQS..createQueue"></a>
|
|
888
921
|
|
|
889
|
-
### SQS
|
|
922
|
+
### SQS~createQueue()
|
|
890
923
|
Create an SQS Queue. Properly handles localstack queue URLs
|
|
891
924
|
|
|
892
|
-
**Kind**:
|
|
893
|
-
**Returns**: <code>Promise.<string></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(
|
|
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(
|
|
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
|
-
|
|
939
|
+
<a name="module_SQS..isSQSRecordLike"></a>
|
|
921
940
|
|
|
922
|
-
|
|
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
|
-
<
|
|
944
|
+
**Kind**: inner method of [<code>SQS</code>](#module_SQS)
|
|
945
|
+
<a name="module_SQS..parseSQSMessageBody"></a>
|
|
931
946
|
|
|
932
|
-
### SQS~
|
|
933
|
-
|
|
947
|
+
### SQS~parseSQSMessageBody()
|
|
948
|
+
Extract SQS message body
|
|
934
949
|
|
|
935
950
|
**Kind**: inner method of [<code>SQS</code>](#module_SQS)
|
|
936
|
-
|
|
951
|
+
<a name="module_SQS..deleteSQSMessage"></a>
|
|
937
952
|
|
|
938
|
-
|
|
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(
|
|
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
|
-
|
|
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.<
|
|
966
|
-
* [.describeStateMachine(params)](#module_StepFunctions.describeStateMachine) ⇒ <code>Promise.<
|
|
967
|
-
* [.getExecutionHistory(params)](#module_StepFunctions.getExecutionHistory) ⇒ <code>Promise.<
|
|
975
|
+
* [.describeExecution(params)](#module_StepFunctions.describeExecution) ⇒ <code>Promise.<DescribeExecutionOutput></code>
|
|
976
|
+
* [.describeStateMachine(params)](#module_StepFunctions.describeStateMachine) ⇒ <code>Promise.<DescribeStateMachineOutput></code>
|
|
977
|
+
* [.getExecutionHistory(params)](#module_StepFunctions.getExecutionHistory) ⇒ <code>Promise.<GetExecutionHistoryOutput></code>
|
|
968
978
|
* [.listExecutions(params)](#module_StepFunctions.listExecutions) ⇒ <code>Promise.<Object></code>
|
|
969
979
|
* _inner_
|
|
970
980
|
* [~executionExists(executionArn)](#module_StepFunctions..executionExists) ⇒ <code>Promise.<boolean></code>
|
|
971
981
|
|
|
972
982
|
<a name="module_StepFunctions.describeExecution"></a>
|
|
973
983
|
|
|
974
|
-
### StepFunctions.describeExecution(params) ⇒ <code>Promise.<
|
|
984
|
+
### StepFunctions.describeExecution(params) ⇒ <code>Promise.<DescribeExecutionOutput></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>
|
|
997
|
+
| params | <code>DescribeExecutionInput</code> |
|
|
988
998
|
|
|
989
999
|
<a name="module_StepFunctions.describeStateMachine"></a>
|
|
990
1000
|
|
|
991
|
-
### StepFunctions.describeStateMachine(params) ⇒ <code>Promise.<
|
|
1001
|
+
### StepFunctions.describeStateMachine(params) ⇒ <code>Promise.<DescribeStateMachineOutput></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>
|
|
1014
|
+
| params | <code>DescribeStateMachineInput</code> |
|
|
1005
1015
|
|
|
1006
1016
|
<a name="module_StepFunctions.getExecutionHistory"></a>
|
|
1007
1017
|
|
|
1008
|
-
### StepFunctions.getExecutionHistory(params) ⇒ <code>Promise.<
|
|
1018
|
+
### StepFunctions.getExecutionHistory(params) ⇒ <code>Promise.<GetExecutionHistoryOutput></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>
|
|
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,
|
|
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
|
|
61
|
-
* @param
|
|
62
|
-
* @param
|
|
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
|
|
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<
|
|
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<
|
|
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<
|
|
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
|
*
|