Security News
npm Updates Search Experience with New Objective Sorting Options
npm has a revamped search experience with new, more transparent sorting options—Relevance, Downloads, Dependents, and Publish Date.
@cumulus/cmr-client
Advanced tools
[![Build Status](https://travis-ci.org/nasa/cumulus.svg?branch=master)](https://travis-ci.org/nasa/cumulus)
A Node.js client to read from, write to, and delete from NASA's Common Metadata Repository (CMR) API.
A class to simplify requests to the CMR
A class to efficiently list all of the concepts (collections/granules) from CMR search, without loading them all into memory at once. Handles paging.
A class to simplify requests to the CMR
Kind: global class
Promise.<string>
Object
Promise.<Object>
Promise.<Object>
Promise.<Object>
Promise.<Object>
Promise.<Object>
Promise.<Object>
Promise.<Object>
The constructor for the CMR class
Param | Type | Description |
---|---|---|
params | Object | |
params.provider | string | the CMR provider id |
params.clientId | string | the CMR clientId |
params.username | string | CMR username |
params.password | string | CMR password |
Example
const { CMR } = require('@cumulus/cmr-client');
const cmrClient = new CMR({
provider: 'my-provider',
clientId: 'my-clientId',
username: 'my-username',
password: 'my-password'
});
Promise.<string>
The method for getting the token
Kind: instance method of CMR
Returns: Promise.<string>
- the token
Object
Return object containing CMR request headers
Kind: instance method of CMR
Returns: Object
- CMR headers object
Param | Type | Description |
---|---|---|
params | Object | |
[params.token] | string | CMR request token |
[params.ummgVersion] | string | UMMG metadata version string or null if echo10 metadata |
Promise.<Object>
Adds a collection record to the CMR
Kind: instance method of CMR
Returns: Promise.<Object>
- the CMR response
Param | Type | Description |
---|---|---|
xml | string | the collection XML document |
Promise.<Object>
Adds a granule record to the CMR
Kind: instance method of CMR
Returns: Promise.<Object>
- the CMR response
Param | Type | Description |
---|---|---|
xml | string | the granule XML document |
Promise.<Object>
Adds/Updates UMMG json metadata in the CMR
Kind: instance method of CMR
Returns: Promise.<Object>
- to the CMR response object.
Param | Type | Description |
---|---|---|
ummgMetadata | Object | UMMG metadata object |
Promise.<Object>
Deletes a collection record from the CMR
Kind: instance method of CMR
Returns: Promise.<Object>
- the CMR response
Param | Type | Description |
---|---|---|
datasetID | string | the collection unique id |
Promise.<Object>
Deletes a granule record from the CMR
Kind: instance method of CMR
Returns: Promise.<Object>
- the CMR response
Param | Type | Description |
---|---|---|
granuleUR | string | the granule unique id |
Promise.<Object>
Search in collections
Kind: instance method of CMR
Returns: Promise.<Object>
- the CMR response
Param | Type | Default | Description |
---|---|---|---|
params | string | the search parameters | |
[format] | string | "json" | format of the response |
Promise.<Object>
Search in granules
Kind: instance method of CMR
Returns: Promise.<Object>
- the CMR response
Param | Type | Default | Description |
---|---|---|---|
params | string | the search parameters | |
[format] | string | "'json'" | format of the response |
A class to efficiently list all of the concepts (collections/granules) from CMR search, without loading them all into memory at once. Handles paging.
Kind: global class
Promise.<Object>
Promise.<Object>
The constructor for the CMRSearchConceptQueue class
Param | Type | Default | Description |
---|---|---|---|
params | Object | ||
params.provider | string | the CMR provider id | |
params.clientId | string | the CMR clientId | |
params.type | string | the type of search 'granule' or 'collection' | |
[params.searchParams] | string | "{}" | the search parameters |
params.format | string | the result format |
Example
const { CMRSearchConceptQueue } = require('@cumulus/cmr-client');
const cmrSearchConceptQueue = new CMRSearchConceptQueue({
provider: 'my-provider',
clientId: 'my-clientId',
type: 'granule',
searchParams: {},
format: 'json'
});
Promise.<Object>
View the next item in the queue
This does not remove the object from the queue. When there are no more items in the queue, returns 'null'.
Kind: instance method of CMRSearchConceptQueue
Returns: Promise.<Object>
- an item from the CMR search
Promise.<Object>
Remove the next item from the queue
When there are no more items in the queue, returns null
.
Kind: instance method of CMRSearchConceptQueue
Returns: Promise.<Object>
- an item from the CMR search
CMR REST API endpoint documentation is here:
Cumulus is a cloud-based data ingest, archive, distribution and management prototype for NASA's future Earth science data streams.
Test with npm run test
.
See Cumulus README
Generated automatically using npm run build-docs
[v1.12.0] - 2019-4-4
Note: There was an issue publishing 1.12.0. Upgrade to 1.12.1.
CUMULUS-1139
granule.applyWorkflow
uses the new-style granule record as input to workflows.CUMULUS-1171
http
or https
providers so that the host field only
contains a valid hostname or IP address, and the port field contains the
provider port.CUMULUS-1176:
@cumulus/move-granules
input expectations have changed. @cumulus/files-to-granules
is a new intermediate task to perform input translation in the old style.
See the Added and Changed sections of this release changelog for more information.CUMULUS-670
CUMULUS-1208
@cumulus/queue-granules
will now be added to ingest workflow messages as is. In practice, this means that if you are using @cumulus/queue-granules
to trigger ingest workflows and your granule objects input have invalid properties, then your ingest workflows will fail due to schema validation errors.CUMULUS-777
CUMULUS-1183
CUMULUS-1223
@cumulus/common/bucketsConfigJsonObject
for fetching stack's bucket configuration as an object.CUMULUS-853
CUMULUS-805
AWS_REGION
in .env
to be used by deployment scriptCUMULUS-803
CUMULUS-670
CUMULUS-1184 - Added kes logging output to ensure we always see the state machine reference before failures due to configuration
CUMULUS-1105 - Added a dashboard endpoint to serve the dashboard from an S3 bucket
CUMULUS-1199 - Moves s3credentials
endpoint from the backend to the distribution API.
CUMULUS-666
@api/endpoints/s3credentials
to allow EarthData Login authorized users to retrieve temporary security credentials for same-region direct S3 access.CUMULUS-671
@packages/integration-tests/api/distribution/getDistributionApiS3SignedUrl()
to return the S3 signed URL for a file protected by the distribution APICUMULUS-672
cmrMetadataFormat
and cmrConceptId
to output for individual granules from @cumulus/post-to-cmr
. cmrMetadataFormat
will be read from the cmrMetadataFormat
generated for each granule in @cumulus/cmrjs/publish2CMR()
@packages/integration-tests/api/distribution
:
getDistributionApiFileStream()
returns a stream to download files protected by the distribution APIgetDistributionFileUrl()
constructs URLs for requesting files from the distribution APICUMULUS-1185 @cumulus/api/models/Granule.removeGranuleFromCmrByGranule
to replace @cumulus/api/models/Granule.removeGranuleFromCmr
and use the Granule UR from the CMR metadata to remove the granule from CMR
CUMULUS-1101
@cumulus/checksum
package. This package provides functions to calculate and validate checksums.@cumulus/common/aws
: calculateS3ObjectChecksum
and validateS3ObjectChecksum
, which depend on the checksum
package.CUMULUS-1171
@cumulus/common
API documentation to packages/common/docs/API.md
npm run build-docs
task to @cumulus/common
@cumulus/common/string#isValidHostname()
@cumulus/common/string#match()
@cumulus/common/string#matches()
@cumulus/common/string#toLower()
@cumulus/common/string#toUpper()
@cumulus/common/URLUtils#buildURL()
@cumulus/common/util#isNil()
@cumulus/common/util#isNull()
@cumulus/common/util#isUndefined()
@cumulus/common/util#negate()
CUMULUS-1176
@cumulus/files-to-granules
task to handle converting file array output from cumulus-process
tasks into granule objects.
Allows simplification of @cumulus/move-granules
and @cumulus/post-to-cmr
, see Changed section for more details.CUMULUS-1151 Compare the granule holdings in CMR with Cumulus' internal data store
CUMULUS-1152 Compare the granule file holdings in CMR with Cumulus' internal data store
CUMULUS-1216 - Updated @cumulus/ingest/granule/ingestFile
to download files to expected staging location.
CUMULUS-1208 - Updated @cumulus/ingest/queue/enqueueGranuleIngestMessage()
to not transform granule object passed to it when building an ingest message
CUMULUS-1198 - @cumulus/ingest
no longer enforces any expectations about whether provider_path
contains a leading slash or not.
CUMULUS-1170
npm
instead of yarn
package-lock.json
files to ensure matching versions of npm packagesnpm ci
instead of npm install
CUMULUS-670
CUMULUS-1139 - Granules stored in the API contain a files
property. That schema has been greatly
simplified and now better matches the CNM format.
name
property has been renamed to fileName
.filepath
property has been renamed to key
.checksumValue
property has been renamed to checksum
.path
property has been removed.url_path
property has been removed.filename
property (which contained an s3://
URL) has been removed, and the bucket
and key
properties should be used instead. Any requests sent to the API containing a granule.files[].filename
property will be rejected, and any responses coming back from the API will not contain that
filename
property.source
property has been added, which is a URL indicating the original source of the file.@cumulus/ingest/granule.moveGranuleFiles()
no longer includes a filename
field in its
output. The bucket
and key
fields should be used instead.CUMULUS-672
@cumulus/integration-tests/api/EarthdataLogin.getEarthdataLoginRedirectResponse
to @cumulus/integration-tests/api/EarthdataLogin.getEarthdataAccessToken
. The new function returns an access response from Earthdata login, if successful.@cumulus/integration-tests/cmr/getOnlineResources
now accepts an object of options, including cmrMetadataFormat
. Based on the cmrMetadataFormat
, the function will correctly retrieve the online resources for each metadata format (ECHO10, UMM-G)CUMULUS-1101
@cumulus/common/file/getFileChecksumFromStream
into @cumulus/checksum
, and renamed it to generateChecksumFromStream
.
This is a breaking change for users relying on @cumulus/common/file/getFileChecksumFromStream
.@cumulus/ingest/Granule
to depend on new common/aws
checksum functions and remove significantly present checksumming code.
@cumulus/ingest/granule.validateChecksum
. Replaced with @cumulus/ingest/granule.verifyFile
.granule.getChecksumFromFile
to granule.retrieveSuppliedFileChecksumInformation
to be more accurate.@cumulus/common/aws.checksumS3Objects
. Use @cumulus/common/aws.calculateS3ObjectChecksum
instead.CUMULUS-1171
host
and
port
properties. HTTP providers ignored port
and protocol
, and stored
an entire URL in the host
property. Updated the API to only accept valid
hostnames or IP addresses in the provider.host
field. Updated ingest code
to properly build HTTP and HTTPS URLs from provider.protocol
,
provider.host
, and provider.port
.CUMULUS-1176
@cumulus/move-granules
breaking change:
Input to move-granules
is now expected to be in the form of a granules object (i.e. { granules: [ { ... }, { ... } ] }
);
For backwards compatibility with array-of-files outputs from processing steps, use the new @cumulus/files-to-granules
task as an intermediate step.
This task will perform the input translation. This change allows move-granules
to be simpler and behave more predictably.
config.granuleIdExtraction
and config.input_granules
are no longer needed/used by move-granules
.@cumulus/post-to-cmr
: config.granuleIdExtraction
is no longer needed/used by post-to-cmr
.CUMULUS-1174
@cumulus/api
files and granules were not getting indexed correctly because files indexing was failing in db-indexer
@cumulus/deployment
A bug in the Cloudformation template was preventing the API from being able to be launched in a VPC, updated the IAM template to give the permissions to be able to run the API in a VPC@cumulus/api/models/Granule.removeGranuleFromCmr
, instead use @cumulus/api/models/Granule.removeGranuleFromCmrByGranule
@cumulus/ingest/granule.validateChecksum
, instead use @cumulus/ingest/granule.verifyFile
@cumulus/common/aws.checksumS3Objects
, instead use @cumulus/common/aws.calculateS3ObjectChecksum
@cumulus/cmrjs
: getGranuleId
and getCmrFiles
are deprecated due to changes in input handling.FAQs
A Node.js client to NASA's Common Metadata Repository (CMR) API.
The npm package @cumulus/cmr-client receives a total of 60 weekly downloads. As such, @cumulus/cmr-client popularity was classified as not popular.
We found that @cumulus/cmr-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm has a revamped search experience with new, more transparent sorting options—Relevance, Downloads, Dependents, and Publish Date.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.