Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cumulus/cmr-client

Package Overview
Dependencies
Maintainers
8
Versions
148
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cumulus/cmr-client - npm Package Compare versions

Comparing version 1.15.0 to 1.16.0

API.md

8

package.json
{
"name": "@cumulus/cmr-client",
"version": "1.15.0",
"version": "1.16.0",
"engines": {

@@ -8,3 +8,3 @@ "node": ">=8.10.0"

"scripts": {
"build-docs": "jsdoc2md --heading-depth 3 --template templates/README.hbs CMR.js CMRSearchConceptQueue.js > README.md",
"build-docs": "jsdoc2md --heading-depth 2 --template templates/API.hbs CMR.js CMRSearchConceptQueue.js > API.md",
"test": "ava",

@@ -35,3 +35,3 @@ "test-coverage": "nyc ava",

"dependencies": {
"@cumulus/logger": "1.15.0",
"@cumulus/logger": "1.16.0",
"got": "^9.6.0",

@@ -50,3 +50,3 @@ "lodash.get": "^4.4.2",

},
"gitHead": "49b3722e27bc5714f4220dedb87dc44b682886fd"
"gitHead": "00942fc9bfd7569506e0f8a2111297e1b3a85e43"
}

@@ -7,225 +7,4 @@ # @cumulus/cmr-client

### Classes
See [API.md](./API.md)
<dl>
<dt><a href="#CMR">CMR</a></dt>
<dd><p>A class to simplify requests to the CMR</p>
</dd>
<dt><a href="#CMRSearchConceptQueue">CMRSearchConceptQueue</a></dt>
<dd><p>A class to efficiently list all of the concepts (collections/granules) from
CMR search, without loading them all into memory at once. Handles paging.</p>
</dd>
</dl>
<a name="CMR"></a>
### CMR
A class to simplify requests to the CMR
**Kind**: global class
* [CMR](#CMR)
* [new CMR(params)](#new_CMR_new)
* [.getToken()](#CMR+getToken) ⇒ <code>Promise.&lt;string&gt;</code>
* [.getHeaders(params)](#CMR+getHeaders) ⇒ <code>Object</code>
* [.ingestCollection(xml)](#CMR+ingestCollection) ⇒ <code>Promise.&lt;Object&gt;</code>
* [.ingestGranule(xml)](#CMR+ingestGranule) ⇒ <code>Promise.&lt;Object&gt;</code>
* [.ingestUMMGranule(ummgMetadata)](#CMR+ingestUMMGranule) ⇒ <code>Promise.&lt;Object&gt;</code>
* [.deleteCollection(datasetID)](#CMR+deleteCollection) ⇒ <code>Promise.&lt;Object&gt;</code>
* [.deleteGranule(granuleUR)](#CMR+deleteGranule) ⇒ <code>Promise.&lt;Object&gt;</code>
* [.searchCollections(params, [format])](#CMR+searchCollections) ⇒ <code>Promise.&lt;Object&gt;</code>
* [.searchGranules(params, [format])](#CMR+searchGranules) ⇒ <code>Promise.&lt;Object&gt;</code>
<a name="new_CMR_new"></a>
#### new CMR(params)
The constructor for the CMR class
| Param | Type | Description |
| --- | --- | --- |
| params | <code>Object</code> | |
| params.provider | <code>string</code> | the CMR provider id |
| params.clientId | <code>string</code> | the CMR clientId |
| params.username | <code>string</code> | CMR username |
| params.password | <code>string</code> | CMR password |
**Example**
```js
const { CMR } = require('@cumulus/cmr-client');
const cmrClient = new CMR({
provider: 'my-provider',
clientId: 'my-clientId',
username: 'my-username',
password: 'my-password'
});
```
<a name="CMR+getToken"></a>
#### cmrClient.getToken() ⇒ <code>Promise.&lt;string&gt;</code>
The method for getting the token
**Kind**: instance method of [<code>CMR</code>](#CMR)
**Returns**: <code>Promise.&lt;string&gt;</code> - the token
<a name="CMR+getHeaders"></a>
#### cmrClient.getHeaders(params) ⇒ <code>Object</code>
Return object containing CMR request headers
**Kind**: instance method of [<code>CMR</code>](#CMR)
**Returns**: <code>Object</code> - CMR headers object
| Param | Type | Description |
| --- | --- | --- |
| params | <code>Object</code> | |
| [params.token] | <code>string</code> | CMR request token |
| [params.ummgVersion] | <code>string</code> | UMMG metadata version string or null if echo10 metadata |
<a name="CMR+ingestCollection"></a>
#### cmrClient.ingestCollection(xml) ⇒ <code>Promise.&lt;Object&gt;</code>
Adds a collection record to the CMR
**Kind**: instance method of [<code>CMR</code>](#CMR)
**Returns**: <code>Promise.&lt;Object&gt;</code> - the CMR response
| Param | Type | Description |
| --- | --- | --- |
| xml | <code>string</code> | the collection XML document |
<a name="CMR+ingestGranule"></a>
#### cmrClient.ingestGranule(xml) ⇒ <code>Promise.&lt;Object&gt;</code>
Adds a granule record to the CMR
**Kind**: instance method of [<code>CMR</code>](#CMR)
**Returns**: <code>Promise.&lt;Object&gt;</code> - the CMR response
| Param | Type | Description |
| --- | --- | --- |
| xml | <code>string</code> | the granule XML document |
<a name="CMR+ingestUMMGranule"></a>
#### cmrClient.ingestUMMGranule(ummgMetadata) ⇒ <code>Promise.&lt;Object&gt;</code>
Adds/Updates UMMG json metadata in the CMR
**Kind**: instance method of [<code>CMR</code>](#CMR)
**Returns**: <code>Promise.&lt;Object&gt;</code> - to the CMR response object.
| Param | Type | Description |
| --- | --- | --- |
| ummgMetadata | <code>Object</code> | UMMG metadata object |
<a name="CMR+deleteCollection"></a>
#### cmrClient.deleteCollection(datasetID) ⇒ <code>Promise.&lt;Object&gt;</code>
Deletes a collection record from the CMR
**Kind**: instance method of [<code>CMR</code>](#CMR)
**Returns**: <code>Promise.&lt;Object&gt;</code> - the CMR response
| Param | Type | Description |
| --- | --- | --- |
| datasetID | <code>string</code> | the collection unique id |
<a name="CMR+deleteGranule"></a>
#### cmrClient.deleteGranule(granuleUR) ⇒ <code>Promise.&lt;Object&gt;</code>
Deletes a granule record from the CMR
**Kind**: instance method of [<code>CMR</code>](#CMR)
**Returns**: <code>Promise.&lt;Object&gt;</code> - the CMR response
| Param | Type | Description |
| --- | --- | --- |
| granuleUR | <code>string</code> | the granule unique id |
<a name="CMR+searchCollections"></a>
#### cmrClient.searchCollections(params, [format]) ⇒ <code>Promise.&lt;Object&gt;</code>
Search in collections
**Kind**: instance method of [<code>CMR</code>](#CMR)
**Returns**: <code>Promise.&lt;Object&gt;</code> - the CMR response
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| params | <code>string</code> | | the search parameters |
| [format] | <code>string</code> | <code>&quot;json&quot;</code> | format of the response |
<a name="CMR+searchGranules"></a>
#### cmrClient.searchGranules(params, [format]) ⇒ <code>Promise.&lt;Object&gt;</code>
Search in granules
**Kind**: instance method of [<code>CMR</code>](#CMR)
**Returns**: <code>Promise.&lt;Object&gt;</code> - the CMR response
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| params | <code>string</code> | | the search parameters |
| [format] | <code>string</code> | <code>&quot;&#x27;json&#x27;&quot;</code> | format of the response |
<a name="CMRSearchConceptQueue"></a>
### CMRSearchConceptQueue
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
* [CMRSearchConceptQueue](#CMRSearchConceptQueue)
* [new CMRSearchConceptQueue(params)](#new_CMRSearchConceptQueue_new)
* [.peek()](#CMRSearchConceptQueue+peek) ⇒ <code>Promise.&lt;Object&gt;</code>
* [.shift()](#CMRSearchConceptQueue+shift) ⇒ <code>Promise.&lt;Object&gt;</code>
<a name="new_CMRSearchConceptQueue_new"></a>
#### new CMRSearchConceptQueue(params)
The constructor for the CMRSearchConceptQueue class
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| params | <code>Object</code> | | |
| params.provider | <code>string</code> | | the CMR provider id |
| params.clientId | <code>string</code> | | the CMR clientId |
| params.type | <code>string</code> | | the type of search 'granule' or 'collection' |
| [params.searchParams] | <code>string</code> | <code>&quot;{}&quot;</code> | the search parameters |
| params.format | <code>string</code> | | the result format |
**Example**
```js
const { CMRSearchConceptQueue } = require('@cumulus/cmr-client');
const cmrSearchConceptQueue = new CMRSearchConceptQueue({
provider: 'my-provider',
clientId: 'my-clientId',
type: 'granule',
searchParams: {},
format: 'json'
});
```
<a name="CMRSearchConceptQueue+peek"></a>
#### cmrSearchConceptQueue.peek() ⇒ <code>Promise.&lt;Object&gt;</code>
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 [<code>CMRSearchConceptQueue</code>](#CMRSearchConceptQueue)
**Returns**: <code>Promise.&lt;Object&gt;</code> - an item from the CMR search
<a name="CMRSearchConceptQueue+shift"></a>
#### cmrSearchConceptQueue.shift() ⇒ <code>Promise.&lt;Object&gt;</code>
Remove the next item from the queue
When there are no more items in the queue, returns `null`.
**Kind**: instance method of [<code>CMRSearchConceptQueue</code>](#CMRSearchConceptQueue)
**Returns**: <code>Promise.&lt;Object&gt;</code> - an item from the CMR search
## CMR Docs

@@ -235,6 +14,6 @@

- https://cmr.earthdata.nasa.gov/search/site/search_api_docs.html
- https://cmr.earthdata.nasa.gov/ingest/site/ingest_api_docs.html
- <https://cmr.earthdata.nasa.gov/search/site/search_api_docs.html>
- <https://cmr.earthdata.nasa.gov/ingest/site/ingest_api_docs.html>
## What is Cumulus?
## About Cumulus

@@ -249,9 +28,4 @@ Cumulus is a cloud-based data ingest, archive, distribution and management prototype for NASA's future Earth science data streams.

## Contributing
See [Cumulus README](https://github.com/nasa/cumulus/blob/master/README.md#installing-and-deploying)
---
Generated automatically using `npm run build-docs`
To make a contribution, please [see our contributing guidelines](https://github.com/nasa/cumulus/blob/master/CONTRIBUTING.md).
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc