cloudflare
Advanced tools
Comparing version 1.0.5 to 1.1.0
@@ -22,2 +22,3 @@ 'use strict'; | ||
this.perPage = info.per_page; | ||
this.totalPages = info.total_pages; | ||
this.count = info.count; | ||
@@ -78,2 +79,3 @@ this.total = info.total_count; | ||
addZone: zones.add, | ||
checkZoneActivation: zones.activationCheck, | ||
deleteZone: zones.delete, | ||
@@ -80,0 +82,0 @@ deleteCache: purge.delete, |
@@ -98,3 +98,3 @@ 'use strict'; | ||
var uri = join('zones', zid, 'dns_records'); | ||
var body = pick(rr.toJSON({useAliases: true}), ['type', 'name', 'content', 'ttl', 'proxied']); | ||
var body = pick(rr.toJSON({useAliases: true}), ['type', 'name', 'content', 'ttl', 'proxied', 'data']); | ||
options.method = 'POST'; | ||
@@ -101,0 +101,0 @@ options.body = JSON.stringify(body); |
@@ -148,2 +148,14 @@ 'use strict'; | ||
function activationCheck(z) { | ||
var zid = Zone.is(z) ? z.id : z; | ||
var uri = join('zones', zid, 'activation_check'); | ||
var options = { | ||
method: 'PUT' | ||
}; | ||
return this._got(uri, options).then(function (response) { | ||
return response.body.result; | ||
}); | ||
} | ||
module.exports.browse = browse; | ||
@@ -154,2 +166,3 @@ module.exports.read = read; | ||
module.exports.delete = remove; | ||
module.exports.activationCheck = activationCheck; | ||
module.exports.Zone = Zone; |
@@ -5,3 +5,3 @@ { | ||
"author": "Terin Stock <terinjokes@gmail.com>", | ||
"version": "1.0.5", | ||
"version": "1.1.0", | ||
"bugs": { | ||
@@ -16,3 +16,3 @@ "url": "https://github.com/cloudflare/node-cloudflare/issues" | ||
"url-join": "^1.1.0", | ||
"verymodel": "git+https://github.com/terinjokes/VeryModel.git#old_data" | ||
"verymodel": "^3.6.0" | ||
}, | ||
@@ -19,0 +19,0 @@ "devDependencies": { |
@@ -94,2 +94,9 @@ # CloudFlare API Client for Node.js | ||
#### `checkZoneActivation(z): Promise<{id: string}>` | ||
* z: `Zone` object | ||
* *API Reference*: [Initiate another zone activation check](https://api.cloudflare.com/#zone-initiate-another-zone-activation-check) | ||
Initiate another zone activation check. | ||
#### `deleteZone(z, [options]): Promise<{id: string}>` | ||
@@ -165,3 +172,3 @@ | ||
Retrive the `DNSRecord` for a identifier `did` from `Zone` (or zone id). | ||
Retrive the `DNSRecord` for an identifier `did` from `Zone` (or zone id). | ||
@@ -168,0 +175,0 @@ #### `editDNS(d, [options]): Promise<DNSRecord>` |
@@ -298,1 +298,35 @@ /* eslint-disable camelcase */ | ||
}); | ||
test('Initiate zone activation check by id', async t => { | ||
nock('https://api.cloudflare.com') | ||
.put('/client/v4/zones/1/activation_check') | ||
.reply(200, { | ||
result: { | ||
id: '1' | ||
} | ||
}); | ||
let zone = await t.context.cf.checkZoneActivation('1'); | ||
t.false(Zone.is(zone)); | ||
t.true(zone.id === '1'); | ||
}); | ||
test('Initiate zone activation check by Zone', async t => { | ||
let z = Zone.create({ | ||
id: '1', | ||
name: 'example.com' | ||
}); | ||
nock('https://api.cloudflare.com') | ||
.put('/client/v4/zones/1/activation_check') | ||
.reply(200, { | ||
result: { | ||
id: '1' | ||
} | ||
}); | ||
let zone = await t.context.cf.checkZoneActivation(z); | ||
t.false(Zone.is(zone)); | ||
t.true(zone.id === '1'); | ||
}); |
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
Git dependency
Supply chain riskContains a dependency which resolves to a remote git URL. Dependencies fetched from git URLs are not immutable and can be used to inject untrusted code or reduce the likelihood of a reproducible install.
Found 1 instance in 1 package
37206
990
232
0
+ Addedhoek@3.0.44.3.1(transitive)
+ Addedisemail@2.2.1(transitive)
+ Addedjoi@7.3.0(transitive)
+ Addedmoment@2.30.1(transitive)
+ Addedtopo@2.1.1(transitive)
+ Addedverymodel@3.6.0(transitive)
Updatedverymodel@^3.6.0