@cumulus/common
Advanced tools
Comparing version 1.13.4 to 1.14.0
@@ -7,6 +7,6 @@ 'use strict'; | ||
const isString = require('lodash.isstring'); | ||
const path = require('path'); | ||
const pMap = require('p-map'); | ||
const pRetry = require('p-retry'); | ||
const pump = require('pump'); | ||
const path = require('path'); | ||
const url = require('url'); | ||
@@ -121,2 +121,3 @@ const { generateChecksumFromStream, validateChecksumFromStream } = require('@cumulus/checksum'); | ||
exports.apigateway = awsClient(AWS.APIGateway, '2015-07-09'); | ||
exports.ecs = awsClient(AWS.ECS, '2014-11-13'); | ||
@@ -128,2 +129,3 @@ exports.s3 = awsClient(AWS.S3, '2006-03-01'); | ||
exports.cloudwatchlogs = awsClient(AWS.CloudWatchLogs, '2014-03-28'); | ||
exports.cloudwatch = awsClient(AWS.CloudWatch, '2010-08-01'); | ||
exports.dynamodb = awsClient(AWS.DynamoDB, '2012-08-10'); | ||
@@ -130,0 +132,0 @@ exports.dynamodbstreams = awsClient(AWS.DynamoDBStreams, '2012-08-10'); |
@@ -38,3 +38,3 @@ 'use strict'; | ||
* @param {string} dataType - the name of the collection config to fetch | ||
* @param {number} dataVersion - the version of the collection config to fetch | ||
* @param {string} dataVersion - the version of the collection config to fetch | ||
* @returns {Object} the fetched collection config | ||
@@ -56,3 +56,3 @@ */ | ||
if (err.code === 'NoSuchKey') { | ||
throw new Error(`A collection config for data type "${dataType}__${dataVersion}" was not found.`); | ||
throw new Error(`A collection config for data type "${collectionId}" was not found.`); | ||
} | ||
@@ -59,0 +59,0 @@ |
@@ -11,4 +11,7 @@ 'use strict'; | ||
exports.http = require('./http'); | ||
exports.launchpad = require('./launchpad'); | ||
exports.LaunchpadToken = require('./LaunchpadToken'); | ||
exports.log = require('./log'); | ||
exports.stepFunctions = require('./step-functions'); | ||
exports.sftp = require('./sftp'); | ||
exports.stepFunctions = require('./StepFunctions'); | ||
exports.stringUtils = require('./string'); | ||
@@ -15,0 +18,0 @@ exports.testUtils = require('./test-utils'); |
{ | ||
"name": "@cumulus/common", | ||
"version": "1.13.4", | ||
"version": "1.14.0", | ||
"description": "Common utilities used across tasks", | ||
@@ -33,3 +33,5 @@ "keywords": [ | ||
"ava": { | ||
"files": "tests" | ||
"files": [ | ||
"tests/**" | ||
] | ||
}, | ||
@@ -45,4 +47,4 @@ "nyc": { | ||
"dependencies": { | ||
"@cumulus/checksum": "1.13.4", | ||
"@cumulus/logger": "1.13.4", | ||
"@cumulus/checksum": "1.14.0", | ||
"@cumulus/logger": "1.14.0", | ||
"ajv": "^5.2.2", | ||
@@ -61,3 +63,5 @@ "async": "^2.0.0", | ||
"lodash.curry": "^4.1.1", | ||
"lodash.findkey": "^4.6.0", | ||
"lodash.flowright": "^3.5.0", | ||
"lodash.get": "^4.4.2", | ||
"lodash.isfunction": "^3.0.9", | ||
@@ -70,4 +74,7 @@ "lodash.isnil": "^4.0.0", | ||
"lodash.kebabcase": "^4.1.1", | ||
"lodash.merge": "^4.6.2", | ||
"lodash.omitby": "^4.6.0", | ||
"lodash.pick": "^4.4.0", | ||
"lodash.range": "^3.2.0", | ||
"mime-types": "^2.1.22", | ||
"mocha": "^5.0.4", | ||
@@ -81,2 +88,3 @@ "mocha-junit-reporter": "^1.11.1", | ||
"randexp": "^0.4.9", | ||
"ssh2": "^0.5.5", | ||
"url-join": "^4.0.0", | ||
@@ -86,10 +94,11 @@ "uuid": "^3.2.1" | ||
"devDependencies": { | ||
"@cumulus/test-data": "1.13.4", | ||
"ava": "^0.25.0", | ||
"@cumulus/test-data": "1.14.0", | ||
"ava": "^2.1.0", | ||
"jsdoc-to-markdown": "^4.0.1", | ||
"nock": "^10.0.0", | ||
"nyc": "^14.0.0", | ||
"rewire": "^4.0.1", | ||
"sinon": "^7.1.1" | ||
}, | ||
"gitHead": "20aca4ba31c61151e3ec8ce703daa130dabada86" | ||
"gitHead": "545de822b548ebaec705b273cc090e5b8879ea3d" | ||
} |
# @cumulus/common | ||
[![Build Status](https://travis-ci.org/nasa/cumulus.svg?branch=master)](https://travis-ci.org/nasa/cumulus) | ||
Common libraries used in Cumulus. | ||
@@ -6,0 +4,0 @@ |
@@ -104,2 +104,12 @@ /* eslint no-console: "off" */ | ||
/** | ||
* Generate a random for the given scale. | ||
* | ||
* Defaults to a number between 1 and 10. | ||
* | ||
* @param {number} scale - scale for the random number. Defaults to 10. | ||
* @returns {number} - a random number | ||
*/ | ||
exports.randomNumber = (scale = 10) => Math.ceil(Math.random() * scale); | ||
/** | ||
* Create a random granule id from the regular expression | ||
@@ -119,2 +129,3 @@ * | ||
cloudwatchevents: 4582, | ||
cloudwatchlogs: 4586, | ||
dynamodb: 4569, | ||
@@ -124,2 +135,3 @@ dynamodbstreams: 4570, | ||
firehose: 4573, | ||
iam: 4593, | ||
kinesis: 4568, | ||
@@ -133,3 +145,4 @@ lambda: 4574, | ||
sqs: 4576, | ||
ssm: 4583 | ||
ssm: 4583, | ||
sts: 4592 | ||
}; | ||
@@ -136,0 +149,0 @@ |
24
util.js
@@ -13,2 +13,3 @@ 'use strict'; | ||
const curry = require('lodash.curry'); | ||
const fs = require('fs'); | ||
@@ -19,2 +20,3 @@ const isNil = require('lodash.isnil'); | ||
const path = require('path'); | ||
const mime = require('mime-types'); | ||
const log = require('./log'); | ||
@@ -173,1 +175,23 @@ | ||
exports.removeNilProperties = (obj) => omitBy(obj, isNil); | ||
/** | ||
* Return mime-type based on input url or filename | ||
* | ||
* @param {string} key | ||
* @returns {string} mimeType or null | ||
*/ | ||
exports.lookupMimeType = (key) => mime.lookup(key) || null; | ||
/** | ||
* Test if a value is included in a list of items | ||
* | ||
* This is a curried function - https://lodash.com/docs/4.17.11#curry | ||
* | ||
* @param {Array} collection - the list of items to check against | ||
* @param {Object} val - the item to check for in the collection | ||
* @returns {boolean} | ||
* | ||
* @static | ||
* @kind function | ||
*/ | ||
exports.isOneOf = curry((collection, val) => collection.includes(val)); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
184965
40
4282
41
7
39
29
1
+ Addedlodash.findkey@^4.6.0
+ Addedlodash.get@^4.4.2
+ Addedlodash.merge@^4.6.2
+ Addedlodash.pick@^4.4.0
+ Addedmime-types@^2.1.22
+ Addedssh2@^0.5.5
+ Added@cumulus/checksum@1.14.0(transitive)
+ Added@cumulus/logger@1.14.0(transitive)
+ Addedasn1@0.2.6(transitive)
+ Addedlodash.findkey@4.6.0(transitive)
+ Addedlodash.get@4.4.2(transitive)
+ Addedlodash.merge@4.6.2(transitive)
+ Addedlodash.pick@4.4.0(transitive)
+ Addedmath-intrinsics@1.1.0(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsemver@5.7.2(transitive)
+ Addedssh2@0.5.5(transitive)
+ Addedssh2-streams@0.1.20(transitive)
+ Addedstreamsearch@0.1.2(transitive)
- Removed@cumulus/checksum@1.13.4(transitive)
- Removed@cumulus/logger@1.13.4(transitive)
- Removedmath-intrinsics@1.0.0(transitive)
Updated@cumulus/checksum@1.14.0
Updated@cumulus/logger@1.14.0