Comparing version 2.4.0 to 2.5.0
@@ -25,3 +25,3 @@ 'use strict'; | ||
Dnsimple.DEFAULT_BASE_URL = 'https://api.dnsimple.com'; | ||
Dnsimple.DEFAULT_USER_AGENT = 'dnsimple-node/v2'; | ||
Dnsimple.DEFAULT_USER_AGENT = 'dnsimple-node/2.4.0'; | ||
@@ -73,3 +73,7 @@ function Dnsimple(attrs) { | ||
setUserAgent: function(userAgent) { | ||
this._api.userAgent = userAgent || Dnsimple.DEFAULT_USER_AGENT; | ||
if (!userAgent) { | ||
this._api.userAgent = Dnsimple.DEFAULT_USER_AGENT; | ||
} else { | ||
this._api.userAgent = Dnsimple.DEFAULT_USER_AGENT + ' ' + userAgent; | ||
} | ||
}, | ||
@@ -76,0 +80,0 @@ |
@@ -162,2 +162,163 @@ 'use strict'; | ||
/** | ||
* Enable DNSSEC for the domain. | ||
* | ||
* @see https://developer.dnsimple.com/v2/domains/dnssec/#enable | ||
* | ||
* @param {number} accountId The account ID | ||
* @param {string|number} domainId The domain name or numeric ID | ||
* @param {Object} [options] | ||
* @return {Promise} | ||
*/ | ||
enableDnssec(accountId, domainId, options = {}) { | ||
return this._client.post(`/${accountId}/domains/${domainId}/dnssec`, null, options); | ||
} | ||
/** | ||
* Disable DNSSEC for the domain. | ||
* | ||
* @see https://developer.dnsimple.com/v2/domains/dnssec/#disable | ||
* | ||
* @param {number} accountId The account ID | ||
* @param {string|number} domainId The domain name or numeric ID | ||
* @param {Object} [options] | ||
* @return {Promise} | ||
*/ | ||
disableDnssec(accountId, domainId, options = {}) { | ||
return this._client.delete(`/${accountId}/domains/${domainId}/dnssec`, options); | ||
} | ||
/** | ||
* Get the DNSSEC status for the domain. | ||
* | ||
* @see https://developer.dnsimple.com/v2/domains/dnssec/#get | ||
* | ||
* @param {number} accountId The account ID | ||
* @param {string|number} domainId The domain name or numeric ID | ||
* @param {Object} [options] | ||
* @return {Promise} | ||
*/ | ||
getDnssec(accountId, domainId, options = {}) { | ||
return this._client.get(`/${accountId}/domains/${domainId}/dnssec`, options); | ||
} | ||
/** | ||
* List delegation signer records under a given domain. | ||
* | ||
* @see https://developer.dnsimple.com/v2/domains/dnssec/#ds-record-list | ||
* | ||
* @example List delegation signer records under a domain in the first page | ||
* client.domains.listDelegationSignerRecords(1010, 'example.com').then(function(response) { | ||
* # handle response | ||
* }, function(error) { | ||
* # handle error | ||
* }); | ||
* | ||
* @example List delegation signer records under a domain, provide a specific page | ||
* client.domains.listDelegationSignerRecords(1010, 'example.com', {page: 2}).then(function(response) { | ||
* # handle response | ||
* }, function(error) { | ||
* # handle error | ||
* }); | ||
* | ||
* @example List delegation signer records under a domain, provide a sorting policy | ||
* client.domains.listDelegationSignerRecords(1010, 'example.com', {sort: 'from:asc'}).then(function(response) { | ||
* # handle response | ||
* }, function(error) { | ||
* # handle error | ||
* }); | ||
* | ||
* @param {number} accountId The account ID | ||
* @param {string|number} domainId The domain name or numeric ID | ||
* @param {Object} [options] | ||
* @param {number} [options.page] The current page number | ||
* @param {number} [options.per_page] The number of items per page | ||
* @param {string} [options.sort] The sort definition in the form `key:direction` | ||
* @return {Promise} | ||
*/ | ||
listDelegationSignerRecords(accountId, domainId, options = {}) { | ||
return this._client.get(`/${accountId}/domains/${domainId}/ds_records`, options); | ||
} | ||
/** | ||
* List ALL the delegation signer records in the account. | ||
* | ||
* This method is similar to {#listDelegationSignerRecords}, but instead of returning the results of a | ||
* specific page it iterates all the pages and returns the entire collection. | ||
* | ||
* Please use this method carefully, as fetching the entire collection will increase the | ||
* number of requests you send to the API server and you may eventually risk to hit the | ||
* throttle limit. | ||
* | ||
* @example List all delegation signer records | ||
* client.domains.allDelegationSignerRecords(1010, 'example.com').then(function(ds_records) { | ||
* // use delegation signer record list | ||
* }, function(error) { | ||
* // handle error | ||
* }); | ||
* | ||
* @example List delegation signer records, provide a sorting policy | ||
* client.domains.allDelegationSignerRecords(1010, 'example.com', {sort: 'from:asc'}).then(function(ds_records) { | ||
* // use delegation signer record list | ||
* }, function(error) { | ||
* // handle error | ||
* }); | ||
* | ||
* @param {number} accountId The account ID | ||
* @param {string|number} domainId The domain name or numeric ID | ||
* @param {Object} [options] The filtering and sorting options | ||
* @param {string} [options.sort] The sort definition in the form `key:direction` | ||
* @return {Promise} | ||
*/ | ||
allDelegationSignerRecords(accountId, domainId, options = {}) { | ||
return new Paginate(this).paginate(this.listDelegationSignerRecords, [accountId, domainId, options]); | ||
} | ||
/** | ||
* Get a specific delegation signer record associated to a domain and account using the delegation | ||
* signer record ID. | ||
* | ||
* @see https://developer.dnsimple.com/v2/domains/dnssec/#ds-record-get | ||
* | ||
* @param {number} accountId The account ID | ||
* @param {string|number} domainId The domain name or numeric ID | ||
* @param {number} delegationSignerRecordId The delegation signer record ID | ||
* @param {Object} [options] | ||
* @return {Promise} | ||
*/ | ||
getDelegationSignerRecord(accountId, domainId, delegationSignerRecordId, options = {}) { | ||
return this._client.get(`/${accountId}/domains/${domainId}/ds_records/${delegationSignerRecordId}`, options); | ||
} | ||
/** | ||
* Create a delegation signer record associated to a domain and account. | ||
* | ||
* @see https://developer.dnsimple.com/v2/domains/dnssec/#ds-record-create | ||
* | ||
* @param {number} accountId The account ID | ||
* @param {string|number} domainId The domain name or numeric ID | ||
* @param {Object} attributes The delegation signer record attributes | ||
* @param {Object} [options] | ||
* @return {Promise} | ||
*/ | ||
createDelegationSignerRecord(accountId, domainId, attributes, options = {}) { | ||
return this._client.post(`/${accountId}/domains/${domainId}/ds_records`, attributes, options); | ||
} | ||
/** | ||
* Delete a specific delegation signer record associated from a domain and account using the | ||
* delegation signer record ID. | ||
* | ||
* @see https://developer.dnsimple.com/v2/domains/dnssec/#ds-record-delete | ||
* | ||
* @param {number} accountId The account ID | ||
* @param {string|number} domainId The domain name or numeric ID | ||
* @param {number} delegationSignerRecordId The delegation signer record ID | ||
* @param {Object} [options] | ||
* @return {Promise} | ||
*/ | ||
deleteDelegationSignerRecord(accountId, domainId, delegationSignerRecordId, options = {}) { | ||
return this._client.delete(`/${accountId}/domains/${domainId}/ds_records/${delegationSignerRecordId}`, options); | ||
} | ||
/** | ||
* List email forwards under a given domain. | ||
@@ -241,3 +402,3 @@ * | ||
* @param {string|number} domainId The domain name or numeric ID | ||
* @param {number} emailForwardID The email forward ID | ||
* @param {number} emailForwardId The email forward ID | ||
* @param {Object} [options] | ||
@@ -272,3 +433,3 @@ * @return {Promise} | ||
* @param {string|number} domainId The domain name or numeric ID | ||
* @param {number} emailForwardID The email forward ID | ||
* @param {number} emailForwardId The email forward ID | ||
* @param {Object} [options] | ||
@@ -275,0 +436,0 @@ * @return {Promise} |
The MIT License (MIT) | ||
Copyright (c) 2016 Aetrion LLC | ||
Copyright (c) 2016-2017 Aetrion LLC | ||
@@ -5,0 +5,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
{ | ||
"name": "dnsimple", | ||
"version": "2.4.0", | ||
"version": "2.5.0", | ||
"description": "DNSimple v2 API wrapper", | ||
@@ -26,2 +26,5 @@ "keywords": [ | ||
"main": "lib/dnsimple.js", | ||
"files": [ | ||
"lib" | ||
], | ||
"devDependencies": { | ||
@@ -28,0 +31,0 @@ "chai": "~1.10.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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
97
0
2
91828
20
2461