@cumulus/cmr-client
Advanced tools
Comparing version 1.15.0 to 1.16.0
{ | ||
"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" | ||
} |
236
README.md
@@ -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.<string></code> | ||
* [.getHeaders(params)](#CMR+getHeaders) ⇒ <code>Object</code> | ||
* [.ingestCollection(xml)](#CMR+ingestCollection) ⇒ <code>Promise.<Object></code> | ||
* [.ingestGranule(xml)](#CMR+ingestGranule) ⇒ <code>Promise.<Object></code> | ||
* [.ingestUMMGranule(ummgMetadata)](#CMR+ingestUMMGranule) ⇒ <code>Promise.<Object></code> | ||
* [.deleteCollection(datasetID)](#CMR+deleteCollection) ⇒ <code>Promise.<Object></code> | ||
* [.deleteGranule(granuleUR)](#CMR+deleteGranule) ⇒ <code>Promise.<Object></code> | ||
* [.searchCollections(params, [format])](#CMR+searchCollections) ⇒ <code>Promise.<Object></code> | ||
* [.searchGranules(params, [format])](#CMR+searchGranules) ⇒ <code>Promise.<Object></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.<string></code> | ||
The method for getting the token | ||
**Kind**: instance method of [<code>CMR</code>](#CMR) | ||
**Returns**: <code>Promise.<string></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.<Object></code> | ||
Adds a collection record to the CMR | ||
**Kind**: instance method of [<code>CMR</code>](#CMR) | ||
**Returns**: <code>Promise.<Object></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.<Object></code> | ||
Adds a granule record to the CMR | ||
**Kind**: instance method of [<code>CMR</code>](#CMR) | ||
**Returns**: <code>Promise.<Object></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.<Object></code> | ||
Adds/Updates UMMG json metadata in the CMR | ||
**Kind**: instance method of [<code>CMR</code>](#CMR) | ||
**Returns**: <code>Promise.<Object></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.<Object></code> | ||
Deletes a collection record from the CMR | ||
**Kind**: instance method of [<code>CMR</code>](#CMR) | ||
**Returns**: <code>Promise.<Object></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.<Object></code> | ||
Deletes a granule record from the CMR | ||
**Kind**: instance method of [<code>CMR</code>](#CMR) | ||
**Returns**: <code>Promise.<Object></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.<Object></code> | ||
Search in collections | ||
**Kind**: instance method of [<code>CMR</code>](#CMR) | ||
**Returns**: <code>Promise.<Object></code> - the CMR response | ||
| Param | Type | Default | Description | | ||
| --- | --- | --- | --- | | ||
| params | <code>string</code> | | the search parameters | | ||
| [format] | <code>string</code> | <code>"json"</code> | format of the response | | ||
<a name="CMR+searchGranules"></a> | ||
#### cmrClient.searchGranules(params, [format]) ⇒ <code>Promise.<Object></code> | ||
Search in granules | ||
**Kind**: instance method of [<code>CMR</code>](#CMR) | ||
**Returns**: <code>Promise.<Object></code> - the CMR response | ||
| Param | Type | Default | Description | | ||
| --- | --- | --- | --- | | ||
| params | <code>string</code> | | the search parameters | | ||
| [format] | <code>string</code> | <code>"'json'"</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.<Object></code> | ||
* [.shift()](#CMRSearchConceptQueue+shift) ⇒ <code>Promise.<Object></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>"{}"</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.<Object></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.<Object></code> - an item from the CMR search | ||
<a name="CMRSearchConceptQueue+shift"></a> | ||
#### cmrSearchConceptQueue.shift() ⇒ <code>Promise.<Object></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.<Object></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). |
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
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
255
16
148
2
5
1
20
41477
29
+ Added@cumulus/logger@1.16.0(transitive)
- Removed@cumulus/logger@1.15.0(transitive)
Updated@cumulus/logger@1.16.0