Add removeAddress and extend functionality

This commit is contained in:
Drew Warren 2017-07-04 13:22:30 -06:00
parent 1a43a58af1
commit 9cb2ad036b
2 changed files with 16 additions and 3 deletions

View File

@ -70,4 +70,17 @@ OAUTH3.api['account.addAddress'] = function (providerUri, opts) {
}); });
}; };
OAUTH3.api['account.removeAddress'] = function (providerUri, opts) {
var session = opts.session;
return OAUTH3.request({
method: 'DELETE'
, url: OAUTH3.url.normalize(providerUri)
+ '/api/com.daplie.me/accounts/' + session.token.sub + '/addresses/' + opts.addressId
, session: session
}).then(function (res) {
return res;
});
};
}('undefined' !== typeof exports ? exports : window)); }('undefined' !== typeof exports ? exports : window));

View File

@ -45,21 +45,21 @@ OAUTH3.api['domains.list'] = function (providerUri, opts) {
}); });
}; };
/* TODO: Manual Renew Function // TODO: Manual Renew Function
OAUTH3.api['domains.extend'] = function (providerUri, opts) { OAUTH3.api['domains.extend'] = function (providerUri, opts) {
var session = opts.session; var session = opts.session;
return OAUTH3.request({ return OAUTH3.request({
method: 'POST' method: 'POST'
, url: OAUTH3.url.normalize(providerUri) , url: OAUTH3.url.normalize(providerUri)
+ '/api/com.daplie.domains/accounts/' + session.token.sub + '/registrations/' + opts.tld + '/' + opts.sld + '/extend' + '/api/com.daplie.domains/accounts/' + session.token.sub + '/registrations/' + opts.data.tld + '/' + opts.data.sld + '/extend'
, session: session , session: session
, data: opts.data , data: opts.data
}).then(function (res) { }).then(function (res) {
return res; return res;
}); });
}; };
*/
OAUTH3.api['ns.list'] = function (providerUri, opts) { OAUTH3.api['ns.list'] = function (providerUri, opts) {
var session = opts.session; var session = opts.session;