@cumulus/cmr-client
Advanced tools
Comparing version 1.17.0 to 1.18.0-alpha.1
@@ -239,3 +239,3 @@ 'use strict'; | ||
async searchCollections(params, format = 'json') { | ||
const searchParams = Object.assign({}, { provider_short_name: this.provider }, params); | ||
const searchParams = { provider_short_name: this.provider, ...params }; | ||
return searchConcept({ | ||
@@ -258,3 +258,3 @@ type: 'collections', | ||
async searchGranules(params, format = 'json') { | ||
const searchParams = Object.assign({}, { provider_short_name: this.provider }, params); | ||
const searchParams = { provider_short_name: this.provider, ...params }; | ||
return searchConcept({ | ||
@@ -261,0 +261,0 @@ type: 'granules', |
@@ -30,2 +30,4 @@ 'use strict'; | ||
* @param {string} params.type - the type of search 'granule' or 'collection' | ||
* @param {string} params.cmrEnvironment - optional, CMR environment to | ||
* use valid arguments are ['OPS', 'SIT', 'UAT'] | ||
* @param {string} [params.searchParams={}] - the search parameters | ||
@@ -38,2 +40,3 @@ * @param {string} params.format - the result format | ||
this.type = params.type; | ||
this.cmrEnvironment = params.cmrEnvironment; | ||
this.params = { provider_short_name: this.provider, ...params.searchParams }; | ||
@@ -78,2 +81,3 @@ this.format = params.format; | ||
type: this.type, | ||
cmrEnvironment: this.cmrEnvironment, | ||
searchParams: this.params, | ||
@@ -80,0 +84,0 @@ previousResults: [], |
{ | ||
"name": "@cumulus/cmr-client", | ||
"version": "1.17.0", | ||
"version": "1.18.0-alpha.1", | ||
"engines": { | ||
@@ -34,3 +34,3 @@ "node": ">=10.16.3" | ||
"dependencies": { | ||
"@cumulus/logger": "1.17.0", | ||
"@cumulus/logger": "1.18.0", | ||
"got": "^9.6.0", | ||
@@ -48,4 +48,3 @@ "lodash.get": "^4.4.2", | ||
"sinon": "^7.1.1" | ||
}, | ||
"gitHead": "e0ce84197da9657ed3f9d8a0d38abe8b3138ea9f" | ||
} | ||
} |
@@ -11,2 +11,4 @@ 'use strict'; | ||
* @param {string} params.type - Concept type to search, choices: ['collections', 'granules'] | ||
* @param {string} params.cmrEnvironment - optional, CMR environment to | ||
* use valid arguments are ['OPS', 'SIT', 'UAT'] | ||
* @param {Object} params.searchParams - CMR search parameters | ||
@@ -25,2 +27,3 @@ * Note initial searchParams.page_num should only be set if recursive is false | ||
type, | ||
cmrEnvironment, | ||
searchParams, | ||
@@ -39,3 +42,3 @@ previousResults = [], | ||
const url = `${getUrl('search')}${type}.${format.toLowerCase()}`; | ||
const url = `${getUrl('search', null, cmrEnvironment)}${type}.${format.toLowerCase()}`; | ||
@@ -45,3 +48,3 @@ const pageNum = (searchParams.page_num) ? searchParams.page_num + 1 : 1; | ||
// if requested, recursively retrieve all the search results for collections or granules | ||
const query = Object.assign({}, defaultParams, searchParams, { page_num: pageNum }); | ||
const query = { ...defaultParams, ...searchParams, page_num: pageNum }; | ||
const response = await got.get(url, { json: format.endsWith('json'), query, headers }); | ||
@@ -48,0 +51,0 @@ |
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
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
653
31935
15
2
1
+ Added@cumulus/logger@1.18.0(transitive)
- Removed@cumulus/logger@1.17.0(transitive)
Updated@cumulus/logger@1.18.0