@cumulus/aws-client 18.2.0-alpha.0 → 18.2.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/CloudFormation.d.ts +2 -2
- package/CloudFormation.js +2 -2
- package/CloudwatchEvents.d.ts +5 -6
- package/CloudwatchEvents.js +4 -4
- package/KMS.d.ts +2 -1
- package/KMS.js +6 -8
- package/Kinesis.d.ts +2 -1
- package/Kinesis.js +3 -2
- package/README.md +83 -96
- package/package.json +11 -7
- package/services.d.ts +8 -4
- package/services.js +9 -5
- package/test-utils.d.ts +4 -4
- package/test-utils.js +4 -4
- package/types.d.ts +5 -1
package/CloudFormation.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @param {string} StackName - The name of the CloudFormation stack to query
|
|
10
10
|
* @returns {Promise<CloudFormation.Stack>} The resources belonging to the stack
|
|
11
11
|
*/
|
|
12
|
-
export declare const describeCfStack: (StackName: string) => Promise<import("aws-sdk/
|
|
12
|
+
export declare const describeCfStack: (StackName: string) => Promise<import("@aws-sdk/client-cloudformation").Stack>;
|
|
13
13
|
/**
|
|
14
14
|
* Describes the resources belonging to a given CloudFormation stack
|
|
15
15
|
*
|
|
@@ -18,7 +18,7 @@ export declare const describeCfStack: (StackName: string) => Promise<import("aws
|
|
|
18
18
|
* @param {string} StackName - The name of the CloudFormation stack to query
|
|
19
19
|
* @returns {Promise<CloudFormation.StackResources>} The resources belonging to the stack
|
|
20
20
|
*/
|
|
21
|
-
export declare const describeCfStackResources: (StackName: string) => Promise<import("aws-sdk/
|
|
21
|
+
export declare const describeCfStackResources: (StackName: string) => Promise<import("@aws-sdk/client-cloudformation").StackResource[] | undefined>;
|
|
22
22
|
/**
|
|
23
23
|
* Get parameter values for the given CloudFormation stack
|
|
24
24
|
*
|
package/CloudFormation.js
CHANGED
|
@@ -18,7 +18,7 @@ const services_1 = require("./services");
|
|
|
18
18
|
* @returns {Promise<CloudFormation.Stack>} The resources belonging to the stack
|
|
19
19
|
*/
|
|
20
20
|
const describeCfStack = async (StackName) => {
|
|
21
|
-
const response = await (0, services_1.cf)().describeStacks({ StackName })
|
|
21
|
+
const response = await (0, services_1.cf)().describeStacks({ StackName });
|
|
22
22
|
if (response.Stacks)
|
|
23
23
|
return response.Stacks[0];
|
|
24
24
|
throw new Error(`Stack not found: ${StackName}`);
|
|
@@ -33,7 +33,7 @@ exports.describeCfStack = describeCfStack;
|
|
|
33
33
|
* @returns {Promise<CloudFormation.StackResources>} The resources belonging to the stack
|
|
34
34
|
*/
|
|
35
35
|
const describeCfStackResources = async (StackName) => {
|
|
36
|
-
const response = await (0, services_1.cf)().describeStackResources({ StackName })
|
|
36
|
+
const response = await (0, services_1.cf)().describeStackResources({ StackName });
|
|
37
37
|
return response.StackResources;
|
|
38
38
|
};
|
|
39
39
|
exports.describeCfStackResources = describeCfStackResources;
|
package/CloudwatchEvents.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module CloudwatchEvents
|
|
3
3
|
*/
|
|
4
|
+
import { RuleState } from '@aws-sdk/client-cloudwatch-events';
|
|
4
5
|
/**
|
|
5
6
|
* Create a CloudWatch Events rule
|
|
6
7
|
*
|
|
@@ -11,10 +12,8 @@
|
|
|
11
12
|
* @param {string} [role] - a Role ARN
|
|
12
13
|
* @returns {Promise<CloudWatchEvents.PutRuleResponse>}
|
|
13
14
|
*/
|
|
14
|
-
export declare const putEvent: (name: string, schedule: string, state:
|
|
15
|
-
export declare const deleteEvent: (name: string) => Promise<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export declare const deleteTarget: (id: string, rule: string) => Promise<import("aws-sdk/lib/request").PromiseResult<import("aws-sdk/clients/cloudwatchevents").RemoveTargetsResponse, import("aws-sdk").AWSError>>;
|
|
19
|
-
export declare const putTarget: (rule: string, id: string, arn: string, input: string) => Promise<import("aws-sdk/lib/request").PromiseResult<import("aws-sdk/clients/cloudwatchevents").PutTargetsResponse, import("aws-sdk").AWSError>>;
|
|
15
|
+
export declare const putEvent: (name: string, schedule: string, state: RuleState, description?: string, role?: string) => Promise<import("@aws-sdk/client-cloudwatch-events").PutRuleCommandOutput>;
|
|
16
|
+
export declare const deleteEvent: (name: string) => Promise<import("@aws-sdk/client-cloudwatch-events").DeleteRuleCommandOutput>;
|
|
17
|
+
export declare const deleteTarget: (id: string, rule: string) => Promise<import("@aws-sdk/client-cloudwatch-events").RemoveTargetsCommandOutput>;
|
|
18
|
+
export declare const putTarget: (rule: string, id: string, arn: string, input: string) => Promise<import("@aws-sdk/client-cloudwatch-events").PutTargetsCommandOutput>;
|
|
20
19
|
//# sourceMappingURL=CloudwatchEvents.d.ts.map
|
package/CloudwatchEvents.js
CHANGED
|
@@ -21,14 +21,14 @@ const putEvent = (name, schedule, state, description, role) => (0, services_1.cl
|
|
|
21
21
|
RoleArn: role,
|
|
22
22
|
ScheduleExpression: schedule,
|
|
23
23
|
State: state,
|
|
24
|
-
})
|
|
24
|
+
});
|
|
25
25
|
exports.putEvent = putEvent;
|
|
26
|
-
const deleteEvent = (name) => (0, services_1.cloudwatchevents)().deleteRule({ Name: name })
|
|
26
|
+
const deleteEvent = (name) => (0, services_1.cloudwatchevents)().deleteRule({ Name: name });
|
|
27
27
|
exports.deleteEvent = deleteEvent;
|
|
28
28
|
const deleteTarget = (id, rule) => (0, services_1.cloudwatchevents)().removeTargets({
|
|
29
29
|
Ids: [id],
|
|
30
30
|
Rule: rule,
|
|
31
|
-
})
|
|
31
|
+
});
|
|
32
32
|
exports.deleteTarget = deleteTarget;
|
|
33
33
|
const putTarget = (rule, id, arn, input) => (0, services_1.cloudwatchevents)().putTargets({
|
|
34
34
|
Rule: rule,
|
|
@@ -39,6 +39,6 @@ const putTarget = (rule, id, arn, input) => (0, services_1.cloudwatchevents)().p
|
|
|
39
39
|
Input: input,
|
|
40
40
|
},
|
|
41
41
|
],
|
|
42
|
-
})
|
|
42
|
+
});
|
|
43
43
|
exports.putTarget = putTarget;
|
|
44
44
|
//# sourceMappingURL=CloudwatchEvents.js.map
|
package/KMS.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module KMS
|
|
3
3
|
*/
|
|
4
|
+
import { CreateKeyCommandInput } from '@aws-sdk/client-kms';
|
|
4
5
|
/**
|
|
5
6
|
* Create a KMS key
|
|
6
7
|
*
|
|
@@ -10,7 +11,7 @@
|
|
|
10
11
|
* @param {Object} params
|
|
11
12
|
* @returns {Promise<Object>}
|
|
12
13
|
*/
|
|
13
|
-
export declare const createKey: (params?:
|
|
14
|
+
export declare const createKey: (params?: CreateKeyCommandInput) => Promise<import("@aws-sdk/client-kms").CreateKeyCommandOutput>;
|
|
14
15
|
/**
|
|
15
16
|
* Encrypt a string using KMS
|
|
16
17
|
*
|
package/KMS.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @module KMS
|
|
4
|
-
*/
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.decryptBase64String = exports.encrypt = exports.createKey = void 0;
|
|
7
4
|
const services_1 = require("./services");
|
|
@@ -14,7 +11,7 @@ const services_1 = require("./services");
|
|
|
14
11
|
* @param {Object} params
|
|
15
12
|
* @returns {Promise<Object>}
|
|
16
13
|
*/
|
|
17
|
-
const createKey = (params = {}) => (0, services_1.kms)().createKey(params)
|
|
14
|
+
const createKey = (params = {}) => (0, services_1.kms)().createKey(params);
|
|
18
15
|
exports.createKey = createKey;
|
|
19
16
|
/**
|
|
20
17
|
* Encrypt a string using KMS
|
|
@@ -24,10 +21,11 @@ exports.createKey = createKey;
|
|
|
24
21
|
* @returns {Promise<string>} the Base 64 encoding of the encrypted value
|
|
25
22
|
*/
|
|
26
23
|
const encrypt = async (KeyId, Plaintext) => {
|
|
27
|
-
const { CiphertextBlob } = await (0, services_1.kms)().encrypt({ KeyId,
|
|
24
|
+
const { CiphertextBlob } = await (0, services_1.kms)().encrypt({ KeyId,
|
|
25
|
+
Plaintext: new TextEncoder().encode(Plaintext) });
|
|
28
26
|
if (CiphertextBlob === undefined)
|
|
29
27
|
throw new Error('Returned CiphertextBlob is undefined');
|
|
30
|
-
return CiphertextBlob.toString('base64');
|
|
28
|
+
return Buffer.from(CiphertextBlob).toString('base64');
|
|
31
29
|
};
|
|
32
30
|
exports.encrypt = encrypt;
|
|
33
31
|
/**
|
|
@@ -39,10 +37,10 @@ exports.encrypt = encrypt;
|
|
|
39
37
|
const decryptBase64String = async (ciphertext) => {
|
|
40
38
|
const { Plaintext } = await (0, services_1.kms)().decrypt({
|
|
41
39
|
CiphertextBlob: Buffer.from(ciphertext, 'base64'),
|
|
42
|
-
})
|
|
40
|
+
});
|
|
43
41
|
if (Plaintext === undefined)
|
|
44
42
|
return undefined;
|
|
45
|
-
return Plaintext.toString();
|
|
43
|
+
return Buffer.from(Plaintext).toString();
|
|
46
44
|
};
|
|
47
45
|
exports.decryptBase64String = decryptBase64String;
|
|
48
46
|
//# sourceMappingURL=KMS.js.map
|
package/Kinesis.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* @module Kinesis
|
|
3
3
|
*/
|
|
4
4
|
import pRetry from 'p-retry';
|
|
5
|
+
import { DescribeStreamInput } from '@aws-sdk/client-kinesis';
|
|
5
6
|
/**
|
|
6
7
|
* Describe a Kinesis stream.
|
|
7
8
|
*
|
|
@@ -10,5 +11,5 @@ import pRetry from 'p-retry';
|
|
|
10
11
|
* @param {Object} retryOptions - Options passed to p-retry module
|
|
11
12
|
* @returns {Promise<Object>} The stream description response
|
|
12
13
|
*/
|
|
13
|
-
export declare const describeStream: (params:
|
|
14
|
+
export declare const describeStream: (params: DescribeStreamInput, retryOptions?: pRetry.Options) => Promise<import("@aws-sdk/client-kinesis").DescribeStreamCommandOutput>;
|
|
14
15
|
//# sourceMappingURL=Kinesis.d.ts.map
|
package/Kinesis.js
CHANGED
|
@@ -8,6 +8,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.describeStream = void 0;
|
|
10
10
|
const p_retry_1 = __importDefault(require("p-retry"));
|
|
11
|
+
const client_kinesis_1 = require("@aws-sdk/client-kinesis");
|
|
11
12
|
const services_1 = require("./services");
|
|
12
13
|
/**
|
|
13
14
|
* Describe a Kinesis stream.
|
|
@@ -19,10 +20,10 @@ const services_1 = require("./services");
|
|
|
19
20
|
*/
|
|
20
21
|
const describeStream = (params, retryOptions = { retries: 0 }) => (0, p_retry_1.default)(async () => {
|
|
21
22
|
try {
|
|
22
|
-
return await (0, services_1.kinesis)().describeStream(params)
|
|
23
|
+
return await (0, services_1.kinesis)().describeStream(params);
|
|
23
24
|
}
|
|
24
25
|
catch (error) {
|
|
25
|
-
if (error
|
|
26
|
+
if (error instanceof client_kinesis_1.ResourceNotFoundException)
|
|
26
27
|
throw error;
|
|
27
28
|
throw new p_retry_1.default.AbortError(error);
|
|
28
29
|
}
|
package/README.md
CHANGED
|
@@ -35,12 +35,8 @@ NODE_ENV=test
|
|
|
35
35
|
<dd></dd>
|
|
36
36
|
<dt><a href="#module_DynamoDb">DynamoDb</a></dt>
|
|
37
37
|
<dd></dd>
|
|
38
|
-
<dt><a href="#module_KMS">KMS</a></dt>
|
|
39
|
-
<dd></dd>
|
|
40
38
|
<dt><a href="#module_Kinesis">Kinesis</a></dt>
|
|
41
39
|
<dd></dd>
|
|
42
|
-
<dt><a href="#module_Lambda">Lambda</a></dt>
|
|
43
|
-
<dd></dd>
|
|
44
40
|
<dt><a href="#module_S3">S3</a></dt>
|
|
45
41
|
<dd></dd>
|
|
46
42
|
<dt><a href="#module_SNS">SNS</a></dt>
|
|
@@ -69,6 +65,22 @@ them all into memory at once. Handles paging of listS3ObjectsV2 requests.</p>
|
|
|
69
65
|
</dd>
|
|
70
66
|
</dl>
|
|
71
67
|
|
|
68
|
+
## Functions
|
|
69
|
+
|
|
70
|
+
<dl>
|
|
71
|
+
<dt><a href="#createKey">createKey(params)</a> ⇒ <code>Promise.<Object></code></dt>
|
|
72
|
+
<dd><p>Create a KMS key</p>
|
|
73
|
+
<p>See <a href="https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/KMS.html#createKey-property">https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/KMS.html#createKey-property</a>
|
|
74
|
+
for allowed params and return value.</p>
|
|
75
|
+
</dd>
|
|
76
|
+
<dt><a href="#encrypt">encrypt(KeyId, Plaintext)</a> ⇒ <code>Promise.<string></code></dt>
|
|
77
|
+
<dd><p>Encrypt a string using KMS</p>
|
|
78
|
+
</dd>
|
|
79
|
+
<dt><a href="#decryptBase64String">decryptBase64String(ciphertext)</a> ⇒ <code>string</code></dt>
|
|
80
|
+
<dd><p>Decrypt a KMS-encrypted string, Base 64 encoded</p>
|
|
81
|
+
</dd>
|
|
82
|
+
</dl>
|
|
83
|
+
|
|
72
84
|
<a name="module_CloudFormation"></a>
|
|
73
85
|
|
|
74
86
|
## CloudFormation
|
|
@@ -228,54 +240,6 @@ See [DocumentClient.scan()](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/late
|
|
|
228
240
|
| [params.dynamoDbClient] | <code>DynamoDBDocument</code> | Instance of Dynamo DB document client |
|
|
229
241
|
| [params.retryOptions] | <code>pRetry.Options</code> | Retry options for scan operations |
|
|
230
242
|
|
|
231
|
-
<a name="module_KMS"></a>
|
|
232
|
-
|
|
233
|
-
## KMS
|
|
234
|
-
|
|
235
|
-
* [KMS](#module_KMS)
|
|
236
|
-
* [~createKey(params)](#module_KMS..createKey) ⇒ <code>Promise.<Object></code>
|
|
237
|
-
* [~encrypt(KeyId, Plaintext)](#module_KMS..encrypt) ⇒ <code>Promise.<string></code>
|
|
238
|
-
* [~decryptBase64String(ciphertext)](#module_KMS..decryptBase64String) ⇒ <code>string</code>
|
|
239
|
-
|
|
240
|
-
<a name="module_KMS..createKey"></a>
|
|
241
|
-
|
|
242
|
-
### KMS~createKey(params) ⇒ <code>Promise.<Object></code>
|
|
243
|
-
Create a KMS key
|
|
244
|
-
|
|
245
|
-
See https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/KMS.html#createKey-property
|
|
246
|
-
for allowed params and return value.
|
|
247
|
-
|
|
248
|
-
**Kind**: inner method of [<code>KMS</code>](#module_KMS)
|
|
249
|
-
|
|
250
|
-
| Param | Type |
|
|
251
|
-
| --- | --- |
|
|
252
|
-
| params | <code>Object</code> |
|
|
253
|
-
|
|
254
|
-
<a name="module_KMS..encrypt"></a>
|
|
255
|
-
|
|
256
|
-
### KMS~encrypt(KeyId, Plaintext) ⇒ <code>Promise.<string></code>
|
|
257
|
-
Encrypt a string using KMS
|
|
258
|
-
|
|
259
|
-
**Kind**: inner method of [<code>KMS</code>](#module_KMS)
|
|
260
|
-
**Returns**: <code>Promise.<string></code> - the Base 64 encoding of the encrypted value
|
|
261
|
-
|
|
262
|
-
| Param | Type | Description |
|
|
263
|
-
| --- | --- | --- |
|
|
264
|
-
| KeyId | <code>string</code> | the KMS key to use for encryption |
|
|
265
|
-
| Plaintext | <code>string</code> | the string to be encrypted |
|
|
266
|
-
|
|
267
|
-
<a name="module_KMS..decryptBase64String"></a>
|
|
268
|
-
|
|
269
|
-
### KMS~decryptBase64String(ciphertext) ⇒ <code>string</code>
|
|
270
|
-
Decrypt a KMS-encrypted string, Base 64 encoded
|
|
271
|
-
|
|
272
|
-
**Kind**: inner method of [<code>KMS</code>](#module_KMS)
|
|
273
|
-
**Returns**: <code>string</code> - the plaintext
|
|
274
|
-
|
|
275
|
-
| Param | Type | Description |
|
|
276
|
-
| --- | --- | --- |
|
|
277
|
-
| ciphertext | <code>string</code> | a KMS-encrypted value, Base 64 encoded |
|
|
278
|
-
|
|
279
243
|
<a name="module_Kinesis"></a>
|
|
280
244
|
|
|
281
245
|
## Kinesis
|
|
@@ -293,22 +257,6 @@ Describe a Kinesis stream.
|
|
|
293
257
|
| params.StreamName | <code>string</code> | A Kinesis stream name |
|
|
294
258
|
| retryOptions | <code>Object</code> | Options passed to p-retry module |
|
|
295
259
|
|
|
296
|
-
<a name="module_Lambda"></a>
|
|
297
|
-
|
|
298
|
-
## Lambda
|
|
299
|
-
<a name="module_Lambda.invoke"></a>
|
|
300
|
-
|
|
301
|
-
### Lambda.invoke(name, payload, type) ⇒ <code>Promise.<InvokeCommandOutput></code>
|
|
302
|
-
Invoke a Lambda function
|
|
303
|
-
|
|
304
|
-
**Kind**: static method of [<code>Lambda</code>](#module_Lambda)
|
|
305
|
-
|
|
306
|
-
| Param | Type | Default | Description |
|
|
307
|
-
| --- | --- | --- | --- |
|
|
308
|
-
| name | <code>string</code> | | Lambda function name |
|
|
309
|
-
| payload | <code>any</code> | | the payload to the Lambda function |
|
|
310
|
-
| type | <code>string</code> | <code>"Event"</code> | the invocation type |
|
|
311
|
-
|
|
312
260
|
<a name="module_S3"></a>
|
|
313
261
|
|
|
314
262
|
## S3
|
|
@@ -912,51 +860,38 @@ errors, to allow more specific handling by the caller.
|
|
|
912
860
|
|
|
913
861
|
* [SQS](#module_SQS)
|
|
914
862
|
* _static_
|
|
915
|
-
* [.sendSQSMessage](#module_SQS.sendSQSMessage) ⇒ <code>Promise</code>
|
|
916
|
-
* [.deleteSQSMessage](#module_SQS.deleteSQSMessage) ⇒ <code>Promise</code>
|
|
917
863
|
* [.createQueue(QueueName)](#module_SQS.createQueue) ⇒ <code>Promise.<string></code>
|
|
918
864
|
* _inner_
|
|
865
|
+
* [~sendSQSMessage(queueUrl, message, [logOverride])](#module_SQS..sendSQSMessage) ⇒ <code>Promise</code>
|
|
919
866
|
* [~receiveSQSMessages(queueUrl, options)](#module_SQS..receiveSQSMessages) ⇒ <code>Promise.<Array></code>
|
|
867
|
+
* [~deleteSQSMessage(queueUrl, receiptHandle)](#module_SQS..deleteSQSMessage) ⇒ <code>Promise</code>
|
|
920
868
|
* [~sqsQueueExists(queueUrl)](#module_SQS..sqsQueueExists) ⇒ <code>Promise.<boolean></code>
|
|
921
869
|
|
|
922
|
-
<a name="module_SQS.
|
|
870
|
+
<a name="module_SQS.createQueue"></a>
|
|
923
871
|
|
|
924
|
-
### SQS.
|
|
925
|
-
|
|
872
|
+
### SQS.createQueue(QueueName) ⇒ <code>Promise.<string></code>
|
|
873
|
+
Create an SQS Queue. Properly handles localstack queue URLs
|
|
926
874
|
|
|
927
|
-
**Kind**: static
|
|
928
|
-
**Returns**: <code>Promise
|
|
875
|
+
**Kind**: static method of [<code>SQS</code>](#module_SQS)
|
|
876
|
+
**Returns**: <code>Promise.<string></code> - the Queue URL
|
|
929
877
|
|
|
930
878
|
| Param | Type | Description |
|
|
931
879
|
| --- | --- | --- |
|
|
932
|
-
|
|
|
933
|
-
| message | <code>string</code> \| <code>Object</code> | either string or object message. If an object it will be serialized into a JSON string. |
|
|
934
|
-
| [logOverride] | <code>Logger</code> | optional Logger passed in for testing |
|
|
880
|
+
| QueueName | <code>string</code> | queue name |
|
|
935
881
|
|
|
936
|
-
<a name="module_SQS
|
|
882
|
+
<a name="module_SQS..sendSQSMessage"></a>
|
|
937
883
|
|
|
938
|
-
### SQS
|
|
939
|
-
|
|
884
|
+
### SQS~sendSQSMessage(queueUrl, message, [logOverride]) ⇒ <code>Promise</code>
|
|
885
|
+
Send a message to AWS SQS
|
|
940
886
|
|
|
941
|
-
**Kind**:
|
|
942
|
-
**Returns**: <code>Promise</code> -
|
|
887
|
+
**Kind**: inner method of [<code>SQS</code>](#module_SQS)
|
|
888
|
+
**Returns**: <code>Promise</code> - resolves when the messsage has been sent
|
|
943
889
|
|
|
944
890
|
| Param | Type | Description |
|
|
945
891
|
| --- | --- | --- |
|
|
946
892
|
| queueUrl | <code>string</code> | url of the SQS queue |
|
|
947
|
-
|
|
|
948
|
-
|
|
949
|
-
<a name="module_SQS.createQueue"></a>
|
|
950
|
-
|
|
951
|
-
### SQS.createQueue(QueueName) ⇒ <code>Promise.<string></code>
|
|
952
|
-
Create an SQS Queue. Properly handles localstack queue URLs
|
|
953
|
-
|
|
954
|
-
**Kind**: static method of [<code>SQS</code>](#module_SQS)
|
|
955
|
-
**Returns**: <code>Promise.<string></code> - the Queue URL
|
|
956
|
-
|
|
957
|
-
| Param | Type | Description |
|
|
958
|
-
| --- | --- | --- |
|
|
959
|
-
| QueueName | <code>string</code> | queue name |
|
|
893
|
+
| message | <code>string</code> \| <code>Object</code> | either string or object message. If an object it will be serialized into a JSON string. |
|
|
894
|
+
| [logOverride] | <code>Logger</code> | optional Logger passed in for testing |
|
|
960
895
|
|
|
961
896
|
<a name="module_SQS..receiveSQSMessages"></a>
|
|
962
897
|
|
|
@@ -975,6 +910,19 @@ can be set and the timeout is also adjustable.
|
|
|
975
910
|
| [options.visibilityTimeout] | <code>integer</code> | <code>30</code> | number of seconds a message is invisible after read |
|
|
976
911
|
| [options.waitTimeSeconds] | <code>integer</code> | <code>0</code> | number of seconds to poll SQS queue (long polling) |
|
|
977
912
|
|
|
913
|
+
<a name="module_SQS..deleteSQSMessage"></a>
|
|
914
|
+
|
|
915
|
+
### SQS~deleteSQSMessage(queueUrl, receiptHandle) ⇒ <code>Promise</code>
|
|
916
|
+
Delete a given SQS message from a given queue.
|
|
917
|
+
|
|
918
|
+
**Kind**: inner method of [<code>SQS</code>](#module_SQS)
|
|
919
|
+
**Returns**: <code>Promise</code> - an AWS SQS response
|
|
920
|
+
|
|
921
|
+
| Param | Type | Description |
|
|
922
|
+
| --- | --- | --- |
|
|
923
|
+
| queueUrl | <code>string</code> | url of the SQS queue |
|
|
924
|
+
| receiptHandle | <code>integer</code> | the unique identifier of the sQS message |
|
|
925
|
+
|
|
978
926
|
<a name="module_SQS..sqsQueueExists"></a>
|
|
979
927
|
|
|
980
928
|
### SQS~sqsQueueExists(queueUrl) ⇒ <code>Promise.<boolean></code>
|
|
@@ -1208,6 +1156,45 @@ store URL
|
|
|
1208
1156
|
| [queryParams] | <code>string</code> | a mapping of parameter key/values to put in the URL |
|
|
1209
1157
|
| presignOptions | <code>RequestPresigningArguments</code> | presignOptions |
|
|
1210
1158
|
|
|
1159
|
+
<a name="createKey"></a>
|
|
1160
|
+
|
|
1161
|
+
## createKey(params) ⇒ <code>Promise.<Object></code>
|
|
1162
|
+
Create a KMS key
|
|
1163
|
+
|
|
1164
|
+
See https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/KMS.html#createKey-property
|
|
1165
|
+
for allowed params and return value.
|
|
1166
|
+
|
|
1167
|
+
**Kind**: global function
|
|
1168
|
+
|
|
1169
|
+
| Param | Type |
|
|
1170
|
+
| --- | --- |
|
|
1171
|
+
| params | <code>Object</code> |
|
|
1172
|
+
|
|
1173
|
+
<a name="encrypt"></a>
|
|
1174
|
+
|
|
1175
|
+
## encrypt(KeyId, Plaintext) ⇒ <code>Promise.<string></code>
|
|
1176
|
+
Encrypt a string using KMS
|
|
1177
|
+
|
|
1178
|
+
**Kind**: global function
|
|
1179
|
+
**Returns**: <code>Promise.<string></code> - the Base 64 encoding of the encrypted value
|
|
1180
|
+
|
|
1181
|
+
| Param | Type | Description |
|
|
1182
|
+
| --- | --- | --- |
|
|
1183
|
+
| KeyId | <code>string</code> | the KMS key to use for encryption |
|
|
1184
|
+
| Plaintext | <code>string</code> | the string to be encrypted |
|
|
1185
|
+
|
|
1186
|
+
<a name="decryptBase64String"></a>
|
|
1187
|
+
|
|
1188
|
+
## decryptBase64String(ciphertext) ⇒ <code>string</code>
|
|
1189
|
+
Decrypt a KMS-encrypted string, Base 64 encoded
|
|
1190
|
+
|
|
1191
|
+
**Kind**: global function
|
|
1192
|
+
**Returns**: <code>string</code> - the plaintext
|
|
1193
|
+
|
|
1194
|
+
| Param | Type | Description |
|
|
1195
|
+
| --- | --- | --- |
|
|
1196
|
+
| ciphertext | <code>string</code> | a KMS-encrypted value, Base 64 encoded |
|
|
1197
|
+
|
|
1211
1198
|
|
|
1212
1199
|
## About Cumulus
|
|
1213
1200
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cumulus/aws-client",
|
|
3
|
-
"version": "18.2.0
|
|
3
|
+
"version": "18.2.0",
|
|
4
4
|
"description": "Utilities for working with AWS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"GIBS",
|
|
@@ -44,9 +44,13 @@
|
|
|
44
44
|
"author": "Cumulus Authors",
|
|
45
45
|
"license": "Apache-2.0",
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@aws-sdk/client-api-gateway": "^3.
|
|
47
|
+
"@aws-sdk/client-api-gateway": "^3.499.0",
|
|
48
|
+
"@aws-sdk/client-cloudformation": "^3.447.0",
|
|
49
|
+
"@aws-sdk/client-cloudwatch-events": "^3.447.0",
|
|
48
50
|
"@aws-sdk/client-dynamodb": "^3.447.0",
|
|
49
51
|
"@aws-sdk/client-dynamodb-streams": "^3.447.0",
|
|
52
|
+
"@aws-sdk/client-kinesis": "^3.447.0",
|
|
53
|
+
"@aws-sdk/client-kms": "^3.447.0",
|
|
50
54
|
"@aws-sdk/client-lambda": "^3.447.0",
|
|
51
55
|
"@aws-sdk/client-s3": "^3.447.0",
|
|
52
56
|
"@aws-sdk/client-sns": "^3.447.0",
|
|
@@ -56,9 +60,9 @@
|
|
|
56
60
|
"@aws-sdk/s3-request-presigner": "^3.447.0",
|
|
57
61
|
"@aws-sdk/signature-v4-crt": "^3.447.0",
|
|
58
62
|
"@aws-sdk/types": "^3.447.0",
|
|
59
|
-
"@cumulus/checksum": "18.2.0
|
|
60
|
-
"@cumulus/errors": "18.2.0
|
|
61
|
-
"@cumulus/logger": "18.2.0
|
|
63
|
+
"@cumulus/checksum": "18.2.0",
|
|
64
|
+
"@cumulus/errors": "18.2.0",
|
|
65
|
+
"@cumulus/logger": "18.2.0",
|
|
62
66
|
"aws-sdk": "^2.1492.0",
|
|
63
67
|
"jsonpath-plus": "^1.1.0",
|
|
64
68
|
"lodash": "~4.17.21",
|
|
@@ -71,8 +75,8 @@
|
|
|
71
75
|
"uuid": "^8.2.0"
|
|
72
76
|
},
|
|
73
77
|
"devDependencies": {
|
|
74
|
-
"@cumulus/test-data": "18.
|
|
78
|
+
"@cumulus/test-data": "18.0.0",
|
|
75
79
|
"@types/uuid": "^8.0.0"
|
|
76
80
|
},
|
|
77
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "c3b3d1a8accfbd53df89382ba2e9fa7dcbf46b6e"
|
|
78
82
|
}
|
package/services.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { APIGatewayClient } from '@aws-sdk/client-api-gateway';
|
|
2
|
+
import { CloudFormation } from '@aws-sdk/client-cloudformation';
|
|
2
3
|
import { DynamoDB } from '@aws-sdk/client-dynamodb';
|
|
3
4
|
import { DynamoDBStreamsClient } from '@aws-sdk/client-dynamodb-streams';
|
|
5
|
+
import { Kinesis } from '@aws-sdk/client-kinesis';
|
|
6
|
+
import { KMS } from '@aws-sdk/client-kms';
|
|
4
7
|
import { Lambda } from '@aws-sdk/client-lambda';
|
|
8
|
+
import { CloudWatchEvents } from '@aws-sdk/client-cloudwatch-events';
|
|
5
9
|
import { S3 } from '@aws-sdk/client-s3';
|
|
6
10
|
import { SQS } from '@aws-sdk/client-sqs';
|
|
7
11
|
import { DynamoDBDocument, TranslateConfig } from '@aws-sdk/lib-dynamodb';
|
|
@@ -11,21 +15,21 @@ export declare const apigateway: (params?: object | undefined) => APIGatewayClie
|
|
|
11
15
|
export declare const ecs: (params?: object | undefined) => AWS.ECS;
|
|
12
16
|
export declare const ec2: (params?: object | undefined) => AWS.EC2;
|
|
13
17
|
export declare const s3: (params?: object | undefined) => S3;
|
|
14
|
-
export declare const kinesis: (params?: object | undefined) =>
|
|
18
|
+
export declare const kinesis: (params?: object | undefined) => Kinesis;
|
|
15
19
|
export declare const lambda: (params?: object | undefined) => Lambda;
|
|
20
|
+
export declare const cloudwatchevents: (params?: object | undefined) => CloudWatchEvents;
|
|
16
21
|
export declare const sqs: (params?: object | undefined) => SQS;
|
|
17
|
-
export declare const cloudwatchevents: (params?: object | undefined) => AWS.CloudWatchEvents;
|
|
18
22
|
export declare const cloudwatchlogs: (params?: object | undefined) => AWS.CloudWatchLogs;
|
|
19
23
|
export declare const cloudwatch: (params?: object | undefined) => AWS.CloudWatch;
|
|
20
24
|
export declare const dynamodb: (params?: object | undefined) => DynamoDB;
|
|
21
25
|
export declare const dynamodbstreams: (params?: object | undefined) => DynamoDBStreamsClient;
|
|
22
26
|
export declare const dynamodbDocClient: (docClientOptions?: TranslateConfig, dynamoOptions?: object) => DynamoDBDocument;
|
|
23
27
|
export declare const sfn: (params?: object | undefined) => AWS.StepFunctions;
|
|
24
|
-
export declare const cf: (params?: object | undefined) =>
|
|
28
|
+
export declare const cf: (params?: object | undefined) => CloudFormation;
|
|
25
29
|
export declare const sns: (params?: object | undefined) => SNS;
|
|
26
30
|
export declare const secretsManager: (params?: object | undefined) => AWS.SecretsManager;
|
|
27
31
|
export declare const systemsManager: (params?: object | undefined) => AWS.SSM;
|
|
28
|
-
export declare const kms: (params?: object | undefined) =>
|
|
32
|
+
export declare const kms: (params?: object | undefined) => KMS;
|
|
29
33
|
export declare const es: (params?: object | undefined) => AWS.ES;
|
|
30
34
|
export declare const sts: (params?: object | undefined) => AWS.STS;
|
|
31
35
|
//# sourceMappingURL=services.d.ts.map
|
package/services.js
CHANGED
|
@@ -26,11 +26,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.sts = exports.es = exports.kms = exports.systemsManager = exports.secretsManager = exports.sns = exports.cf = exports.sfn = exports.dynamodbDocClient = exports.dynamodbstreams = exports.dynamodb = exports.cloudwatch = exports.cloudwatchlogs = exports.
|
|
29
|
+
exports.sts = exports.es = exports.kms = exports.systemsManager = exports.secretsManager = exports.sns = exports.cf = exports.sfn = exports.dynamodbDocClient = exports.dynamodbstreams = exports.dynamodb = exports.cloudwatch = exports.cloudwatchlogs = exports.sqs = exports.cloudwatchevents = exports.lambda = exports.kinesis = exports.s3 = exports.ec2 = exports.ecs = exports.apigateway = void 0;
|
|
30
30
|
const client_api_gateway_1 = require("@aws-sdk/client-api-gateway");
|
|
31
|
+
const client_cloudformation_1 = require("@aws-sdk/client-cloudformation");
|
|
31
32
|
const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
|
|
32
33
|
const client_dynamodb_streams_1 = require("@aws-sdk/client-dynamodb-streams");
|
|
34
|
+
const client_kinesis_1 = require("@aws-sdk/client-kinesis");
|
|
35
|
+
const client_kms_1 = require("@aws-sdk/client-kms");
|
|
33
36
|
const client_lambda_1 = require("@aws-sdk/client-lambda");
|
|
37
|
+
const client_cloudwatch_events_1 = require("@aws-sdk/client-cloudwatch-events");
|
|
34
38
|
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
35
39
|
const client_sqs_1 = require("@aws-sdk/client-sqs");
|
|
36
40
|
const lib_dynamodb_1 = require("@aws-sdk/lib-dynamodb");
|
|
@@ -41,10 +45,10 @@ exports.apigateway = (0, client_1.default)(client_api_gateway_1.APIGatewayClient
|
|
|
41
45
|
exports.ecs = (0, client_1.default)(AWS.ECS, '2014-11-13');
|
|
42
46
|
exports.ec2 = (0, client_1.default)(AWS.EC2, '2016-11-15');
|
|
43
47
|
exports.s3 = (0, client_1.default)(client_s3_1.S3, '2006-03-01');
|
|
44
|
-
exports.kinesis = (0, client_1.default)(
|
|
48
|
+
exports.kinesis = (0, client_1.default)(client_kinesis_1.Kinesis, '2013-12-02');
|
|
45
49
|
exports.lambda = (0, client_1.default)(client_lambda_1.Lambda, '2015-03-31');
|
|
50
|
+
exports.cloudwatchevents = (0, client_1.default)(client_cloudwatch_events_1.CloudWatchEvents, '2015-10-07');
|
|
46
51
|
exports.sqs = (0, client_1.default)(client_sqs_1.SQS, '2012-11-05');
|
|
47
|
-
exports.cloudwatchevents = (0, client_1.default)(AWS.CloudWatchEvents, '2014-02-03');
|
|
48
52
|
exports.cloudwatchlogs = (0, client_1.default)(AWS.CloudWatchLogs, '2014-03-28');
|
|
49
53
|
exports.cloudwatch = (0, client_1.default)(AWS.CloudWatch, '2010-08-01');
|
|
50
54
|
exports.dynamodb = (0, client_1.default)(client_dynamodb_1.DynamoDB, '2012-08-10');
|
|
@@ -52,11 +56,11 @@ exports.dynamodbstreams = (0, client_1.default)(client_dynamodb_streams_1.Dynamo
|
|
|
52
56
|
const dynamodbDocClient = (docClientOptions, dynamoOptions) => lib_dynamodb_1.DynamoDBDocument.from((0, client_1.default)(client_dynamodb_1.DynamoDB, '2012-08-10')(dynamoOptions), docClientOptions);
|
|
53
57
|
exports.dynamodbDocClient = dynamodbDocClient;
|
|
54
58
|
exports.sfn = (0, client_1.default)(AWS.StepFunctions, '2016-11-23');
|
|
55
|
-
exports.cf = (0, client_1.default)(
|
|
59
|
+
exports.cf = (0, client_1.default)(client_cloudformation_1.CloudFormation, '2010-05-15');
|
|
56
60
|
exports.sns = (0, client_1.default)(client_sns_1.SNS, '2010-03-31');
|
|
57
61
|
exports.secretsManager = (0, client_1.default)(AWS.SecretsManager, '2017-10-17');
|
|
58
62
|
exports.systemsManager = (0, client_1.default)(AWS.SSM, '2017-10-17');
|
|
59
|
-
exports.kms = (0, client_1.default)(
|
|
63
|
+
exports.kms = (0, client_1.default)(client_kms_1.KMS, '2014-11-01');
|
|
60
64
|
exports.es = (0, client_1.default)(AWS.ES, '2015-01-01');
|
|
61
65
|
exports.sts = (0, client_1.default)(AWS.STS, '2011-06-15');
|
|
62
66
|
//# sourceMappingURL=services.js.map
|
package/test-utils.d.ts
CHANGED
|
@@ -4,9 +4,9 @@ export declare const inTestMode: () => boolean;
|
|
|
4
4
|
declare const localStackPorts: {
|
|
5
5
|
stepfunctions: number;
|
|
6
6
|
APIGatewayClient: number;
|
|
7
|
-
|
|
7
|
+
CloudFormation: number;
|
|
8
8
|
cloudwatch: number;
|
|
9
|
-
|
|
9
|
+
CloudWatchEvents: number;
|
|
10
10
|
cloudwatchlogs: number;
|
|
11
11
|
DynamoDB: number;
|
|
12
12
|
DynamoDBClient: number;
|
|
@@ -16,8 +16,8 @@ declare const localStackPorts: {
|
|
|
16
16
|
es: number;
|
|
17
17
|
firehose: number;
|
|
18
18
|
iam: number;
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
Kinesis: number;
|
|
20
|
+
KMS: number;
|
|
21
21
|
Lambda: number;
|
|
22
22
|
redshift: number;
|
|
23
23
|
route53: number;
|
package/test-utils.js
CHANGED
|
@@ -9,9 +9,9 @@ exports.inTestMode = inTestMode;
|
|
|
9
9
|
const localStackPorts = {
|
|
10
10
|
stepfunctions: 4566,
|
|
11
11
|
APIGatewayClient: 4566,
|
|
12
|
-
|
|
12
|
+
CloudFormation: 4566,
|
|
13
13
|
cloudwatch: 4566,
|
|
14
|
-
|
|
14
|
+
CloudWatchEvents: 4566,
|
|
15
15
|
cloudwatchlogs: 4566,
|
|
16
16
|
DynamoDB: 4566,
|
|
17
17
|
DynamoDBClient: 4566,
|
|
@@ -21,8 +21,8 @@ const localStackPorts = {
|
|
|
21
21
|
es: 4566,
|
|
22
22
|
firehose: 4566,
|
|
23
23
|
iam: 4566,
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
Kinesis: 4566,
|
|
25
|
+
KMS: 4566,
|
|
26
26
|
Lambda: 4566,
|
|
27
27
|
redshift: 4566,
|
|
28
28
|
route53: 4566,
|
package/types.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import * as AWS from 'aws-sdk';
|
|
2
2
|
import { APIGatewayClient } from '@aws-sdk/client-api-gateway';
|
|
3
|
+
import { CloudWatchEvents } from '@aws-sdk/client-cloudwatch-events';
|
|
4
|
+
import { CloudFormation } from '@aws-sdk/client-cloudformation';
|
|
3
5
|
import { DynamoDBStreamsClient } from '@aws-sdk/client-dynamodb-streams';
|
|
4
6
|
import { DynamoDB, DynamoDBClient } from '@aws-sdk/client-dynamodb';
|
|
7
|
+
import { Kinesis } from '@aws-sdk/client-kinesis';
|
|
8
|
+
import { KMS } from '@aws-sdk/client-kms';
|
|
5
9
|
import { Lambda } from '@aws-sdk/client-lambda';
|
|
6
10
|
import { S3 } from '@aws-sdk/client-s3';
|
|
7
11
|
import { SNS } from '@aws-sdk/client-sns';
|
|
8
12
|
import { SQS } from '@aws-sdk/client-sqs';
|
|
9
|
-
export declare type AWSClientTypes = APIGatewayClient | DynamoDB | DynamoDBClient | DynamoDBStreamsClient | Lambda | S3 | SNS | SQS | AWS.Service | AWS.DynamoDB.DocumentClient;
|
|
13
|
+
export declare type AWSClientTypes = APIGatewayClient | CloudFormation | CloudWatchEvents | DynamoDB | DynamoDBClient | DynamoDBStreamsClient | KMS | Kinesis | Lambda | S3 | SNS | SQS | AWS.Service | AWS.DynamoDB.DocumentClient;
|
|
10
14
|
//# sourceMappingURL=types.d.ts.map
|