API Pullout-glueAdd,dnsUnset,deviceDetach
This commit is contained in:
parent
ebb44c3dcb
commit
faf6814a53
|
@ -55,28 +55,15 @@ OAUTH3.api['devices.attach'] = function (providerUri, opts) {
|
||||||
|
|
||||||
OAUTH3.api['devices.detach'] = function (providerUri, opts) {
|
OAUTH3.api['devices.detach'] = function (providerUri, opts) {
|
||||||
var session = opts.session;
|
var session = opts.session;
|
||||||
|
var device = opts.device;
|
||||||
|
var tld = opts.tld;
|
||||||
|
var sld = opts.sld;
|
||||||
|
var sub = opts.sub;
|
||||||
|
|
||||||
return OAUTH3.request({
|
return OAUTH3.request({
|
||||||
url: OAUTH3.url.normalize(providerUri)
|
url: OAUTH3.url.normalize(providerUri)
|
||||||
+ '/api/com.daplie.domains/accounts/' + session.token.sub
|
+ '/api/com.daplie.domains/accounts/' + session.token.sub
|
||||||
//+ '/devices/' + device + '/'
|
+ '/devices/' + device + '/' + tld + '/' + sld + '/' + (sub || '')
|
||||||
+ '/devices/' + (opts.data.uid || '_') + '/' + opts.data.device
|
|
||||||
+ '/' + opts.data.tld + '/' + opts.data.sld + '/' + (opts.data.sub || '')
|
|
||||||
, method: 'DELETE'
|
|
||||||
, session: session
|
|
||||||
}, {}).then(function (res) {
|
|
||||||
return res.data.devices || res.data;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
OAUTH3.api['devices.detach'] = function (providerUri, opts) {
|
|
||||||
var session = opts.session;
|
|
||||||
|
|
||||||
return OAUTH3.request({
|
|
||||||
url: OAUTH3.url.normalize(providerUri)
|
|
||||||
+ '/api/com.daplie.domains/accounts/' + session.token.sub
|
|
||||||
+ '/devices/' + opts.data.device
|
|
||||||
+ '/' + opts.data.tld + '/' + opts.data.sld + '/' + (opts.data.sub || '')
|
|
||||||
, method: 'DELETE'
|
, method: 'DELETE'
|
||||||
, session: session
|
, session: session
|
||||||
}, {}).then(function (res) {
|
}, {}).then(function (res) {
|
||||||
|
@ -115,4 +102,23 @@ OAUTH3.api['dns.set'] = function (providerUri, opts) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
OAUTH3.api['dns.unset'] = function (providerUri, opts) {
|
||||||
|
var session = opts.session;
|
||||||
|
var tld = opts.tld;
|
||||||
|
var sld = opts.sld;
|
||||||
|
var sub = (opts.sub || '@');
|
||||||
|
var type = opts.type;
|
||||||
|
var value = opts.value;
|
||||||
|
|
||||||
|
return OAUTH3.request({
|
||||||
|
url: OAUTH3.url.normalize(providerUri)
|
||||||
|
+ '/api/com.daplie.domains/accounts/' + session.token.sub
|
||||||
|
+ '/dns/' + tld + '/' + sld + '/' + sub + '/' + type + '/' + value
|
||||||
|
, method: 'DELETE'
|
||||||
|
, session: session
|
||||||
|
}, {}).then(function (res) {
|
||||||
|
return res.data || res;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
}('undefined' !== typeof exports ? exports : window));
|
}('undefined' !== typeof exports ? exports : window));
|
||||||
|
|
|
@ -84,7 +84,7 @@ OAUTH3.api['glue.add'] = function (providerUri, opts) {
|
||||||
var ip = opts.ip;
|
var ip = opts.ip;
|
||||||
var tld = opts.tld;
|
var tld = opts.tld;
|
||||||
var sld = opts.sld;
|
var sld = opts.sld;
|
||||||
var sub = opts.sub;
|
var sub = (opts.sub || '@');
|
||||||
|
|
||||||
return OAUTH3.request({
|
return OAUTH3.request({
|
||||||
method: 'POST'
|
method: 'POST'
|
||||||
|
|
Loading…
Reference in New Issue