|
@@ -29,16 +29,16 @@ function loadSettings(name) {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
-function addRecord(name, record) {
|
|
|
- return cloudflare.record_add(name, record).then(function(data) {
|
|
|
+function recordAdd(name, record) {
|
|
|
+ return cloudflare.recordAdd(name, record).then(function(data) {
|
|
|
if(data.result === 'success') {
|
|
|
findDomain(name).records.push(data.response.rec.obj);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
-function editRecord(name, record) {
|
|
|
- return cloudflare.record_edit(name, record).then(function(data) {
|
|
|
+function recordEdit(name, record) {
|
|
|
+ return cloudflare.recordEdit(name, record).then(function(data) {
|
|
|
if(data.result === 'success') {
|
|
|
var domain = findDomain(name);
|
|
|
var oldRecord = domain.records.find(function(r) {
|
|
@@ -49,8 +49,8 @@ function editRecord(name, record) {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
-function deleteRecord(name, id) {
|
|
|
- return cloudflare.record_delete(name, id).then(function(data) {
|
|
|
+function recordDelete(name, id) {
|
|
|
+ return cloudflare.recordDelete(name, id).then(function(data) {
|
|
|
if(data.result === 'success') {
|
|
|
var domain = findDomain(name);
|
|
|
var oldRecord = domain.records.find(function(r) {
|
|
@@ -62,7 +62,7 @@ function deleteRecord(name, id) {
|
|
|
}
|
|
|
|
|
|
function setDevelopmentMode(name, value) {
|
|
|
- return cloudflare.set_devmode(name, value).then(function(data) {
|
|
|
+ return cloudflare.setDevelopmentMode(name, value).then(function(data) {
|
|
|
if(data.result === 'success') {
|
|
|
findDomain(name).settings.dev_mode.set(data.response.expires_on || 0);
|
|
|
}
|
|
@@ -70,7 +70,7 @@ function setDevelopmentMode(name, value) {
|
|
|
}
|
|
|
|
|
|
function purgeCache(name) {
|
|
|
- return cloudflare.purge_cache(name);
|
|
|
+ return cloudflare.purgeCache(name);
|
|
|
}
|
|
|
|
|
|
cloudflare.domains().then(function(data) {
|
|
@@ -84,9 +84,9 @@ cloudflare.domains().then(function(data) {
|
|
|
module.exports = {
|
|
|
Domains: {
|
|
|
find: findDomain,
|
|
|
- add: addRecord,
|
|
|
- edit: editRecord,
|
|
|
- remove: deleteRecord,
|
|
|
+ recordAdd: recordAdd,
|
|
|
+ recordEdit: recordEdit,
|
|
|
+ recordDelete: recordDelete,
|
|
|
setDevelopmentMode: setDevelopmentMode,
|
|
|
purgeCache: purgeCache,
|
|
|
loadRecords: loadRecords,
|