@cumulus/aws-client
Advanced tools
Comparing version 1.18.0 to 1.18.1-alpha.0
@@ -146,6 +146,19 @@ 'use strict'; | ||
/** | ||
* Delete a DynamoDB table and then wait for the table to not exist | ||
* | ||
* @param {Object} params - the same params that you would pass to AWS.deleteTable | ||
* See https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB.html#deleteTable-property | ||
* @returns {Promise} | ||
*/ | ||
async function deleteAndWaitForDynamoDbTableNotExists(params) { | ||
await awsServices.dynamodb().deleteTable(params).promise(); | ||
return awsServices.dynamodb().waitFor('tableNotExists', { TableName: params.TableName }).promise(); | ||
} | ||
module.exports = { | ||
createAndWaitForDynamoDbTable, | ||
deleteAndWaitForDynamoDbTableNotExists, | ||
get, | ||
scan | ||
}; |
{ | ||
"name": "@cumulus/aws-client", | ||
"version": "1.18.0", | ||
"version": "1.18.1-alpha.0", | ||
"description": "Utilities for working with AWS", | ||
@@ -63,4 +63,3 @@ "keywords": [ | ||
"sinon": "^8.0.4" | ||
}, | ||
"gitHead": "f55107a043f48e9d54cfc7050f0dd4cc8c65f649" | ||
} | ||
} |
21
S3.js
@@ -274,6 +274,23 @@ const fs = require('fs'); | ||
exports.getJsonS3Object = (bucket, key) => | ||
/** | ||
* Fetch the contents of an S3 object | ||
* | ||
* @param {string} bucket - the S3 object's bucket | ||
* @param {string} key - the S3 object's key | ||
* @returns {Promise<string>} the contents of the S3 object | ||
*/ | ||
exports.getTextObject = (bucket, key) => | ||
exports.getS3Object(bucket, key) | ||
.then(({ Body }) => JSON.parse(Body.toString())); | ||
.then(({ Body }) => Body.toString()); | ||
/** | ||
* Fetch JSON stored in an S3 object | ||
* @param {string} bucket - the S3 object's bucket | ||
* @param {string} key - the S3 object's key | ||
* @returns {Promise<*>} the contents of the S3 object, parsed as JSON | ||
*/ | ||
exports.getJsonS3Object = (bucket, key) => | ||
exports.getTextObject(bucket, key) | ||
.then(JSON.parse); | ||
exports.putJsonS3Object = (bucket, key, data) => | ||
@@ -280,0 +297,0 @@ exports.s3PutObject({ |
@@ -21,2 +21,3 @@ const AWS = require('aws-sdk'); | ||
exports.secretsManager = awsClient(AWS.SecretsManager, '2017-10-17'); | ||
exports.kms = awsClient(AWS.KMS, '2014-11-01'); | ||
exports.es = awsClient(AWS.ES, '2015-01-01'); |
@@ -82,2 +82,3 @@ /* eslint no-console: "off" */ | ||
kinesis: 4568, | ||
kms: 4599, | ||
lambda: 4574, | ||
@@ -84,0 +85,0 @@ redshift: 4577, |
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
77352
22
1734
1
1