add dns listing

This commit is contained in:
AJ ONeal 2017-03-15 03:38:18 -06:00
parent 356a2d3131
commit d64699977e
1 changed files with 19 additions and 0 deletions

19
oauth3.dns.js Normal file
View File

@ -0,0 +1,19 @@
;(function (exports) {
'use strict';
var OAUTH3 = exports.OAUTH3 = exports.OAUTH3 || require('./oauth3.core.js').OAUTH3;
OAUTH3.api['dns.list'] = function (providerUri, opts) {
var session = opts.session;
return OAUTH3.request({
method: 'GET'
, url: OAUTH3.url.normalize(providerUri)
+ '/api/com.daplie.domains/accounts/' + session.token.sub + '/dns'
, session: session
}).then(function (res) {
return res.data.records || res.data;
});
};
}('undefined' !== typeof exports ? exports : window));