planet-client
Advanced tools
Comparing version 0.4.0 to 0.5.0
@@ -23,7 +23,8 @@ /** | ||
* `null`. | ||
* @param {Object} options Any request options. | ||
* @return {Promise.<Page>} The previous page. | ||
* @method | ||
*/ | ||
this.prev = !links.prev ? null : function() { | ||
return factory(url.parse(links.prev, true).query); | ||
this.prev = !links.prev ? null : function(options) { | ||
return factory(url.parse(links.prev, true).query, options); | ||
}; | ||
@@ -33,2 +34,3 @@ | ||
* Get the next page. | ||
* @param {Object} options Any request options. | ||
* @return {Promise.<Page>} The next page. If there is no next page, | ||
@@ -38,4 +40,4 @@ * `next` will be `null`. | ||
*/ | ||
this.next = !links.next ? null : function() { | ||
return factory(url.parse(links.next, true).query); | ||
this.next = !links.next ? null : function(options) { | ||
return factory(url.parse(links.next, true).query, options); | ||
}; | ||
@@ -42,0 +44,0 @@ |
@@ -14,8 +14,15 @@ /** | ||
* @param {string} quadId A quad identifier. | ||
* @param {Object} options Options. | ||
* @param {function(function())} options.terminator A function that is called | ||
* with a function that can be called back to terminate the request. | ||
* @return {Promise.<Object>} A promise that resolves to quad metadata or is | ||
* rejected with any error. | ||
*/ | ||
function get(mosaicId, quadId) { | ||
var url = urls.join(urls.MOSAICS, mosaicId, 'quads', quadId); | ||
return request.get(url).then(function(res) { | ||
function get(mosaicId, quadId, options) { | ||
options = options || {}; | ||
var config = { | ||
url: urls.join(urls.MOSAICS, mosaicId, 'quads', quadId), | ||
terminator: options.terminator | ||
}; | ||
return request.get(config).then(function(res) { | ||
return res.body; | ||
@@ -29,9 +36,14 @@ }); | ||
* @param {Object} query A query object. | ||
* @param {Object} options Options. | ||
* @param {function(function())} options.terminator A function that is called | ||
* with a function that can be called back to terminate the request. | ||
* @return {Promise.<Page>} A promise that resolves to a page of quad | ||
* metadata or is rejected with any error. | ||
*/ | ||
function search(mosaicId, query) { | ||
function search(mosaicId, query, options) { | ||
options = options || {}; | ||
var config = { | ||
url: urls.join(urls.MOSAICS, mosaicId, 'quads', ''), | ||
query: query | ||
query: query, | ||
terminator: options.terminator | ||
}; | ||
@@ -38,0 +50,0 @@ return request.get(config).then(function(res) { |
@@ -19,2 +19,4 @@ /** | ||
* resources in the response. False by default. | ||
* @param {function(function())} options.terminator A function that is called | ||
* with a function that can be called back to terminate the request. | ||
* @return {Promise.<Object>} A promise that resolves to scene metadata or is | ||
@@ -31,4 +33,7 @@ * rejected with any error. | ||
} | ||
var url = urls.join(urls.SCENES, scene.type, scene.id); | ||
return request.get(url).then(function(res) { | ||
var config = { | ||
url: urls.join(urls.SCENES, scene.type, scene.id), | ||
terminator: options.terminator | ||
}; | ||
return request.get(config).then(function(res) { | ||
if (options.augmentLinks !== false) { | ||
@@ -47,2 +52,4 @@ util.augmentSceneLinks(res.body); | ||
* resources in the response. False by default. | ||
* @param {function(function())} options.terminator A function that is called | ||
* with a function that can be called back to terminate the request. | ||
* @return {Promise.<Page>} A promise that resolves to a page of scene | ||
@@ -63,3 +70,4 @@ * metadata or is rejected with any error. | ||
url: urls.join(urls.SCENES, type, ''), | ||
query: query | ||
query: query, | ||
terminator: options.terminator | ||
}; | ||
@@ -66,0 +74,0 @@ return request.get(config).then(function(res) { |
{ | ||
"name": "planet-client", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"description": "A client for Planet's imagery API", | ||
@@ -5,0 +5,0 @@ "repository": { |
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
80950
2434