cloudflare
Advanced tools
Comparing version 2.4.1 to 2.5.0
@@ -19,2 +19,4 @@ /* | ||
dnsRecords: require('./lib/resources/DNSRecords'), | ||
enterpriseZoneWorkersScripts: require('./lib/resources/EnterpriseZoneWorkersScripts'), | ||
enterpriseZoneWorkersRoutes: require('./lib/resources/EnterpriseZoneWorkersRoutes'), | ||
ips: require('./lib/resources/IPs'), | ||
@@ -24,2 +26,5 @@ zones: require('./lib/resources/Zones'), | ||
zoneCustomHostNames: require('./lib/resources/ZoneCustomHostNames'), | ||
zoneWorkers: require('./lib/resources/ZoneWorkers'), | ||
zoneWorkersScript: require('./lib/resources/ZoneWorkersScript'), | ||
zoneWorkersRoutes: require('./lib/resources/ZoneWorkersRoutes'), | ||
user: require('./lib/resources/User'), | ||
@@ -26,0 +31,0 @@ }; |
@@ -47,3 +47,3 @@ /* | ||
const options = { | ||
json: true, | ||
json: opts.json !== false, | ||
timeout: opts.timeout || 1e4, | ||
@@ -54,3 +54,3 @@ retries: opts.retries, | ||
'user-agent': `cloudflare/${pkg.version} node/${process.versions.node}`, | ||
'Content-Type': 'application/json', | ||
'Content-Type': opts.contentType || 'application/json', | ||
Accept: 'application/json', | ||
@@ -57,0 +57,0 @@ 'X-Cloudflare-Client-User-Agent': USER_AGENT, |
@@ -38,3 +38,3 @@ /* | ||
if (args.length > 0) { | ||
if (isPlainObject(args[0]) && !isOptionsHash(args[0])) { | ||
if (!isOptionsHash(args[0])) { | ||
return args.shift(); | ||
@@ -79,2 +79,4 @@ } | ||
const encode = spec.encode || identity; | ||
const json = spec.json !== false; | ||
const contentType = spec.contentType || 'application/json'; | ||
@@ -112,2 +114,5 @@ return function() { | ||
opts.json = json; | ||
opts.contentType = contentType; | ||
if (args.length !== 0) { | ||
@@ -114,0 +119,0 @@ err = new Error( |
{ | ||
"name": "cloudflare", | ||
"version": "2.4.1", | ||
"version": "2.5.0", | ||
"description": "CloudFlare API client", | ||
@@ -5,0 +5,0 @@ "author": "Terin Stock <terinjokes@gmail.com>", |
39499
20
1150