dnsimple
Advanced tools
Comparing version 7.1.0 to 7.1.1
@@ -7,2 +7,28 @@ import type { DNSimple, QueryParams } from "./main"; | ||
/** | ||
* Activate DNS resolution for the zone in the account. | ||
* | ||
* PUT /{account}/zones/{zone}/activation | ||
* | ||
* @see https://developer.dnsimple.com/v2/zones/#activateZoneService | ||
* | ||
* @param account The account id | ||
* @param zone The zone name | ||
*/ | ||
activateDns: (account: number, zone: string, params?: QueryParams & {}) => Promise<{ | ||
data: types.Zone; | ||
}>; | ||
/** | ||
* Deativate DNS resolution for the zone in the account. | ||
* | ||
* DELETE /{account}/zones/{zone}/activation | ||
* | ||
* @see https://developer.dnsimple.com/v2/zones/#deactivateZoneService | ||
* | ||
* @param account The account id | ||
* @param zone The zone name | ||
*/ | ||
deactivateDns: (account: number, zone: string, params?: QueryParams & {}) => Promise<{ | ||
data: types.Zone; | ||
}>; | ||
/** | ||
* Lists the zones in the account. | ||
@@ -9,0 +35,0 @@ * |
@@ -25,2 +25,30 @@ "use strict"; | ||
/** | ||
* Activate DNS resolution for the zone in the account. | ||
* | ||
* PUT /{account}/zones/{zone}/activation | ||
* | ||
* @see https://developer.dnsimple.com/v2/zones/#activateZoneService | ||
* | ||
* @param account The account id | ||
* @param zone The zone name | ||
*/ | ||
this.activateDns = (() => { | ||
const method = (account, zone, params = {}) => this._client.request("PUT", `/${account}/zones/${zone}/activation`, null, params); | ||
return method; | ||
})(); | ||
/** | ||
* Deativate DNS resolution for the zone in the account. | ||
* | ||
* DELETE /{account}/zones/{zone}/activation | ||
* | ||
* @see https://developer.dnsimple.com/v2/zones/#deactivateZoneService | ||
* | ||
* @param account The account id | ||
* @param zone The zone name | ||
*/ | ||
this.deactivateDns = (() => { | ||
const method = (account, zone, params = {}) => this._client.request("DELETE", `/${account}/zones/${zone}/activation`, null, params); | ||
return method; | ||
})(); | ||
/** | ||
* Lists the zones in the account. | ||
@@ -27,0 +55,0 @@ * |
{ | ||
"name": "dnsimple", | ||
"version": "7.1.0", | ||
"version": "7.1.1", | ||
"description": "A Node.JS client for the DNSimple API.", | ||
@@ -42,4 +42,4 @@ "keywords": [ | ||
"nock": "^13.0.0", | ||
"prettier": "^2.8.4", | ||
"prettier-plugin-organize-imports": "^3.2.2", | ||
"prettier": "2.8.4", | ||
"prettier-plugin-organize-imports": "3.2.2", | ||
"sinon": "^15.0.2", | ||
@@ -46,0 +46,0 @@ "ts-node": "^10.9.1", |
@@ -9,2 +9,44 @@ "use strict"; | ||
describe("zones", () => { | ||
describe("#activateDns", () => { | ||
const accountId = 1010; | ||
const fixture = (0, util_1.loadFixture)("activateZoneService/success.http"); | ||
it("produces a zone", (done) => { | ||
nock("https://api.dnsimple.com") | ||
.put("/v2/1010/zones/example.com/activation") | ||
.reply(fixture.statusCode, fixture.body); | ||
dnsimple.zones.activateDns(accountId, "example.com").then((response) => { | ||
const zone = response.data; | ||
(0, chai_1.expect)(zone.id).to.eq(1); | ||
(0, chai_1.expect)(zone.account_id).to.eq(1010); | ||
(0, chai_1.expect)(zone.name).to.eq("example.com"); | ||
(0, chai_1.expect)(zone.reverse).to.eq(false); | ||
(0, chai_1.expect)(zone.created_at).to.eq("2015-04-23T07:40:03Z"); | ||
(0, chai_1.expect)(zone.updated_at).to.eq("2015-04-23T07:40:03Z"); | ||
done(); | ||
}, (error) => { | ||
done(error); | ||
}); | ||
}); | ||
}); | ||
describe("#deactivateDns", () => { | ||
const accountId = 1010; | ||
const fixture = (0, util_1.loadFixture)("deactivateZoneService/success.http"); | ||
it("produces a zone", (done) => { | ||
nock("https://api.dnsimple.com") | ||
.delete("/v2/1010/zones/example.com/activation") | ||
.reply(fixture.statusCode, fixture.body); | ||
dnsimple.zones.deactivateDns(accountId, "example.com").then((response) => { | ||
const zone = response.data; | ||
(0, chai_1.expect)(zone.id).to.eq(1); | ||
(0, chai_1.expect)(zone.account_id).to.eq(1010); | ||
(0, chai_1.expect)(zone.name).to.eq("example.com"); | ||
(0, chai_1.expect)(zone.reverse).to.eq(false); | ||
(0, chai_1.expect)(zone.created_at).to.eq("2015-04-23T07:40:03Z"); | ||
(0, chai_1.expect)(zone.updated_at).to.eq("2015-04-23T07:40:03Z"); | ||
done(); | ||
}, (error) => { | ||
done(error); | ||
}); | ||
}); | ||
}); | ||
describe("#listZones", () => { | ||
@@ -11,0 +53,0 @@ const accountId = 1010; |
{ | ||
"name": "dnsimple", | ||
"version": "7.1.0", | ||
"version": "7.1.1", | ||
"description": "A Node.JS client for the DNSimple API.", | ||
@@ -42,4 +42,4 @@ "keywords": [ | ||
"nock": "^13.0.0", | ||
"prettier": "^2.8.4", | ||
"prettier-plugin-organize-imports": "^3.2.2", | ||
"prettier": "2.8.4", | ||
"prettier-plugin-organize-imports": "3.2.2", | ||
"sinon": "^15.0.2", | ||
@@ -46,0 +46,0 @@ "ts-node": "^10.9.1", |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
395790
8882
3