pipelinedeals
Advanced tools
Comparing version 1.3.0 to 1.4.0
@@ -17,3 +17,3 @@ var request = require('request'); | ||
var url = BASE_URL + options.endpoint + '?api_key=' + options.apiKey + '&page=' + page + '&per_page=200'; | ||
if(options.debug) { | ||
if (options.debug) { | ||
console.log('pipelinedeals url: ', url); | ||
@@ -29,3 +29,3 @@ } | ||
} catch (e) { | ||
if(options.debug) { | ||
if (options.debug) { | ||
console.log('pipelinedeals response: ', body); | ||
@@ -47,3 +47,5 @@ } | ||
if (body.pagination.page < body.pagination.pages) { | ||
makeCall(++page); | ||
setTimeout(function () { | ||
makeCall(++page); | ||
}, options.paginationDelay || 0); | ||
} else { | ||
@@ -50,0 +52,0 @@ callback(null, allEntries); |
{ | ||
"name": "pipelinedeals", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "Easier access to the PipelineDeals API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -23,7 +23,12 @@ # pipelinedeals | ||
endpoint: STRING, //REQUIRED | ||
apiKey: STRING //REQUIRED | ||
apiKey: STRING, //REQUIRED | ||
paginationDelay: NUMBER, //OPTIONAL Defaults to 0 | ||
debug: BOOLEAN //OPTIONAL Defaults to false | ||
} | ||
``` | ||
There is a strict 5 calls per second that pipelinedeals enforces. While the calls are already made sequentially | ||
and timeout problems are low, you have the option to add an extra wait time before making the next paged call. | ||
Pass in the number of milliseconds you want to wait. | ||
The endpoint for this url `https://api.pipelinedeals.com/api/v3/deals.json` is `deals.json` | ||
The endpoint for this url `https://api.pipelinedeals.com/api/v3/account_notifications.json` is `account_notifications.json` |
var pld = require('./index'); | ||
var options = { | ||
endpoint: 'company_custom_field_labels.json', | ||
apiKey: 'lUVTLOpqMwOhFzsQ7rWD' | ||
endpoint: 'companies.json', | ||
apiKey: 'lUVTLOpqMwOhFzsQ7rWD', | ||
debug: true, | ||
paginationDelay: 10 | ||
}; | ||
@@ -7,0 +9,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
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
4547
6
57
34