rehive 1.29.1 → 1.31.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- !function(n){var t=setTimeout;function i(){}function o(n){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof n)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(n,this)}function s(e,i){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,o._immediateFn(function(){var n=1===e._state?i.onFulfilled:i.onRejected;if(null!==n){var t;try{t=n(e._value)}catch(n){return void r(i.promise,n)}u(i.promise,t)}else(1===e._state?u:r)(i.promise,e._value)})):e._deferreds.push(i)}function u(t,n){try{if(n===t)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var e=n.then;if(n instanceof o)return t._state=3,t._value=n,void c(t);if("function"==typeof e)return void f((i=e,s=n,function(){i.apply(s,arguments)}),t)}t._state=1,t._value=n,c(t)}catch(n){r(t,n)}var i,s}function r(n,t){n._state=2,n._value=t,c(n)}function c(n){2===n._state&&0===n._deferreds.length&&o._immediateFn(function(){n._handled||o._unhandledRejectionFn(n._value)});for(var t=0,e=n._deferreds.length;t<e;t++)s(n,n._deferreds[t]);n._deferreds=null}function a(n,t,e){this.onFulfilled="function"==typeof n?n:null,this.onRejected="function"==typeof t?t:null,this.promise=e}function f(n,t){var e=!1;try{n(function(n){e||(e=!0,u(t,n))},function(n){e||(e=!0,r(t,n))})}catch(n){if(e)return;e=!0,r(t,n)}}o.prototype.catch=function(n){return this.then(null,n)},o.prototype.then=function(n,t){var e=new this.constructor(i);return s(this,new a(n,t,e)),e},o.all=function(n){var r=Array.prototype.slice.call(n);return new o(function(i,s){if(0===r.length)return i([]);var o=r.length;function u(t,n){try{if(n&&("object"==typeof n||"function"==typeof n)){var e=n.then;if("function"==typeof e)return void e.call(n,function(n){u(t,n)},s)}r[t]=n,0==--o&&i(r)}catch(n){s(n)}}for(var n=0;n<r.length;n++)u(n,r[n])})},o.resolve=function(t){return t&&"object"==typeof t&&t.constructor===o?t:new o(function(n){n(t)})},o.reject=function(e){return new o(function(n,t){t(e)})},o.race=function(s){return new o(function(n,t){for(var e=0,i=s.length;e<i;e++)s[e].then(n,t)})},o._immediateFn="function"==typeof setImmediate&&function(n){setImmediate(n)}||function(n){t(n,0)},o._unhandledRejectionFn=function(n){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",n)},o._setImmediateFn=function(n){o._immediateFn=n},o._setUnhandledRejectionFn=function(n){o._unhandledRejectionFn=n},"undefined"!=typeof module&&module.exports?module.exports=o:n.Promise||(n.Promise=o)}(this),function(n){"use strict";if(!n.fetch){var t="URLSearchParams"in n,e="Symbol"in n&&"iterator"in Symbol,u="FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(n){return!1}}(),i="FormData"in n,s="ArrayBuffer"in n;if(s)var o=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],r=function(n){return n&&DataView.prototype.isPrototypeOf(n)},c=ArrayBuffer.isView||function(n){return n&&-1<o.indexOf(Object.prototype.toString.call(n))};l.prototype.append=function(n,t){n=m(n),t=d(t);var e=this.map[n];this.map[n]=e?e+","+t:t},l.prototype.delete=function(n){delete this.map[m(n)]},l.prototype.get=function(n){return n=m(n),this.has(n)?this.map[n]:null},l.prototype.has=function(n){return this.map.hasOwnProperty(m(n))},l.prototype.set=function(n,t){this.map[m(n)]=d(t)},l.prototype.forEach=function(n,t){for(var e in this.map)this.map.hasOwnProperty(e)&&n.call(t,this.map[e],e,this)},l.prototype.keys=function(){var e=[];return this.forEach(function(n,t){e.push(t)}),h(e)},l.prototype.values=function(){var t=[];return this.forEach(function(n){t.push(n)}),h(t)},l.prototype.entries=function(){var e=[];return this.forEach(function(n,t){e.push([t,n])}),h(e)},e&&(l.prototype[Symbol.iterator]=l.prototype.entries);var a=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},P.call(b.prototype),P.call(N.prototype),N.prototype.clone=function(){return new N(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},N.error=function(){var n=new N(null,{status:0,statusText:""});return n.type="error",n};var f=[301,302,303,307,308];N.redirect=function(n,t){if(-1===f.indexOf(t))throw new RangeError("Invalid status code");return new N(null,{status:t,headers:{location:n}})},n.Headers=l,n.Request=b,n.Response=N,n.fetch=function(e,s){return new Promise(function(i,n){var t=new b(e,s),o=new XMLHttpRequest;o.onload=function(){var n,s,t={status:o.status,statusText:o.statusText,headers:(n=o.getAllResponseHeaders()||"",s=new l,n.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(n){var t=n.split(":"),e=t.shift().trim();if(e){var i=t.join(":").trim();s.append(e,i)}}),s)};t.url="responseURL"in o?o.responseURL:t.headers.get("X-Request-URL");var e="response"in o?o.response:o.responseText;i(new N(e,t))},o.onerror=function(){n(new TypeError("Network request failed"))},o.ontimeout=function(){n(new TypeError("Network request failed"))},o.open(t.method,t.url,!0),"include"===t.credentials?o.withCredentials=!0:"omit"===t.credentials&&(o.withCredentials=!1),"responseType"in o&&u&&(o.responseType="blob"),t.headers.forEach(function(n,t){o.setRequestHeader(t,n)}),o.send(void 0===t._bodyInit?null:t._bodyInit)})},n.fetch.polyfill=!0}function m(n){if("string"!=typeof n&&(n=String(n)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(n))throw new TypeError("Invalid character in header field name");return n.toLowerCase()}function d(n){return"string"!=typeof n&&(n=String(n)),n}function h(t){var n={next:function(){var n=t.shift();return{done:void 0===n,value:n}}};return e&&(n[Symbol.iterator]=function(){return n}),n}function l(t){this.map={},t instanceof l?t.forEach(function(n,t){this.append(t,n)},this):Array.isArray(t)?t.forEach(function(n){this.append(n[0],n[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(n){this.append(n,t[n])},this)}function g(n){if(n.bodyUsed)return Promise.reject(new TypeError("Already read"));n.bodyUsed=!0}function p(e){return new Promise(function(n,t){e.onload=function(){n(e.result)},e.onerror=function(){t(e.error)}})}function w(n){var t=new FileReader,e=p(t);return t.readAsArrayBuffer(n),e}function v(n){if(n.slice)return n.slice(0);var t=new Uint8Array(n.byteLength);return t.set(new Uint8Array(n)),t.buffer}function P(){return this.bodyUsed=!1,this._initBody=function(n){if(this._bodyInit=n)if("string"==typeof n)this._bodyText=n;else if(u&&Blob.prototype.isPrototypeOf(n))this._bodyBlob=n;else if(i&&FormData.prototype.isPrototypeOf(n))this._bodyFormData=n;else if(t&&URLSearchParams.prototype.isPrototypeOf(n))this._bodyText=n.toString();else if(s&&u&&r(n))this._bodyArrayBuffer=v(n.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!s||!ArrayBuffer.prototype.isPrototypeOf(n)&&!c(n))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=v(n)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof n?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t&&URLSearchParams.prototype.isPrototypeOf(n)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},u&&(this.blob=function(){var n=g(this);if(n)return n;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?g(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(w)}),this.text=function(){var n,t,e,i=g(this);if(i)return i;if(this._bodyBlob)return n=this._bodyBlob,t=new FileReader,e=p(t),t.readAsText(n),e;if(this._bodyArrayBuffer)return Promise.resolve(function(n){for(var t=new Uint8Array(n),e=new Array(t.length),i=0;i<t.length;i++)e[i]=String.fromCharCode(t[i]);return e.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i&&(this.formData=function(){return this.text().then(y)}),this.json=function(){return this.text().then(JSON.parse)},this}function b(n,t){var e,i,s=(t=t||{}).body;if(n instanceof b){if(n.bodyUsed)throw new TypeError("Already read");this.url=n.url,this.credentials=n.credentials,t.headers||(this.headers=new l(n.headers)),this.method=n.method,this.mode=n.mode,s||null==n._bodyInit||(s=n._bodyInit,n.bodyUsed=!0)}else this.url=String(n);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new l(t.headers)),this.method=(e=t.method||this.method||"GET",i=e.toUpperCase(),-1<a.indexOf(i)?i:e),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&s)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(s)}function y(n){var s=new FormData;return n.trim().split("&").forEach(function(n){if(n){var t=n.split("="),e=t.shift().replace(/\+/g," "),i=t.join("=").replace(/\+/g," ");s.append(decodeURIComponent(e),decodeURIComponent(i))}}),s}function N(n,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=200<=this.status&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new l(t.headers),this.url=t.url||"",this._initBody(n)}}("undefined"!=typeof self?self:this);var fetch,isNode=!1;function Rehive(t){this.public={companies:[]},this.auth={password:{},email:{},mobile:{},tokens:{},mfa:{sms:{},token:{},status:{}}},this.user={addresses:[],bankAccounts:{},cryptoAccounts:{},documents:{},emails:{},mobiles:{}},this.transactions={totals:{}},this.transaction_collections={},this.accounts={currencies:{}},this.company={currencies:{},bankAccounts:{}},this.groups={},this.permissions={},this.admin={auth:{login:{},register:{}},accessControlRules:{},users:{overview:{},tiers:{},addresses:{},bankAccounts:{currencies:{}},settings:{},cryptoAccounts:{},documents:{},emails:{},mobiles:{},permissions:{},groups:{},kyc:{},mfa:{token:{},sms:{}}},requests:{},transactions:{totals:{}},transaction_collections:{},accounts:{currencies:{limits:{},fees:{},settings:{}}},account:{currencies:{},definitions:{groups:{currencies:{}}}},currencies:{overview:{},bankAccounts:{}},company:{settings:{},address:{}},bankAccounts:{currencies:{}},webhooks:{},subtypes:{},notifications:{},services:{},groups:{tiers:{requirements:{},limits:{},fees:{},settings:{}},permissions:{},accountConfigurations:{currencies:{}},settings:{}},webhookTasks:{requests:{}},exports:{sets:{}},metrics:{points:{}}};var u,n="3",i="public/companies/",s="auth/mfa/sms/",o="auth/mfa/token/",r="auth/tokens/",c="user/addresses/",a="user/bank-accounts/",f="user/crypto-accounts/",m="user/documents/",d="user/emails/",h="user/mobiles/",l="transactions/",g="transaction-collections/",p="accounts/",w="/currencies/",v="company/currencies/",P="permissions/",b="groups/",y={"Content-Type":"application/json",Accept:"application/json"},N="admin/users/",k="admin/access-control-rules/",A="/settings/",_="admin/users/overview/",T="/permissions/",x="/groups/",C="admin/users/addresses/",S="admin/users/bank-accounts/",E="admin/users/crypto-accounts/",R="admin/users/documents/",j="admin/users/emails/",q="admin/users/mobiles/",O="admin/transactions/",B="admin/exports/",I="admin/transaction-collections/",U="admin/accounts/",F="/currencies/",z="/limits/",D="/fees/",L="/settings/",M="admin/account-currencies/",G="admin/account-definitions/",H="admin/currencies/",J="/bank-accounts/",V="admin/company/",X="settings/",K="address/",W="admin/webhooks/",$="admin/webhook-tasks/",Q="/requests/",Y="admin/subtypes/",Z="admin/notifications/",nn="/requirements/",tn="/limits/",en="/fees/",sn="admin/bank-accounts/",on="admin/services/",un="admin/groups/",rn="admin/requests/",cn="/permissions/",an="/settings/",fn="/tiers/",mn="/account-configurations/",dn="/currencies/",hn="/settings/",ln="admin/metrics/";t||(t={}),u=0<Object.keys(t).length?t.customAPIURL?t.customAPIURL:(n=t.apiVersion?t.apiVersion:"3",t.apiToken&&bn(t.apiToken),t.network&&"staging"==t.network?t.network="api.staging.rehive.com":t.network="api.rehive.com","https://"+t.network+"/"+n+"/"):(n="3",t.network="api.rehive.com","https://"+t.network+"/"+n+"/");var e,gn,pn,wn={},vn={};function Pn(n){var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push(encodeURIComponent(e)+"="+encodeURIComponent(n[e]));return t.join("&")}function bn(n){if(t&&t.storageMethod){if(void 0===sessionStorage||void 0===localStorage)return void console.log("sessionStorage and localStorage not supported.");"local"===t.storageMethod?localStorage.setItem("token",n):"session"===t.storageMethod&&sessionStorage.setItem("token",n)}e=n}function yn(){return t&&"local"===t.storageMethod?e=localStorage.getItem("token"):t&&"session"===t.storageMethod&&(e=sessionStorage.getItem("token")),e||""}function Nn(){t&&"local"===t.storageMethod?e=localStorage.removeItem("token"):t&&"session"===t.storageMethod&&(e=sessionStorage.removeItem("token")),delete y.Authorization,e=""}function kn(e){return e.json().then(function(t){return new Promise(function(n){e.ok||(t.status_code=e.status,t.ok=e.ok),n(t)})})}function An(n){gn=n.next?n.next:null,pn=n.previous?n.previous:null}function _n(n,t){n.next?wn[t]=n.next:delete wn[t],n.previous?vn[t]=n.previous:delete vn[t]}var Tn=function(i,s,o){return new Promise(function(t,e){var n=yn();n&&!o?y.Authorization="Token "+n:delete y.Authorization,fetch(u+i,{method:"POST",headers:y,body:JSON.stringify(s)}).then(kn).then(function(n){"success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):n.message?t({message:n.message}):t({}):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},xn=function(i,s){return new Promise(function(t,e){var n=s||yn();n?y.Authorization="Token "+n:delete y.Authorization,fetch(u+i,{method:"GET",headers:y}).then(kn).then(function(n){"success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):n.message?t({message:n.message}):t({}):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},Cn=function(i,s){return new Promise(function(t,e){var n=yn();n?y.Authorization="Token "+n:delete y.Authorization,!isNode&&s instanceof FormData?delete y["Content-Type"]:(y["Content-Type"]="application/json",s=JSON.stringify(s)),fetch(u+i,{method:"PATCH",headers:y,body:s}).then(kn).then(function(n){y["Content-Type"]="application/json","success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):n.message?t({message:n.message}):t({}):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},Sn=function(i,s){return new Promise(function(t,e){var n=yn();n?y.Authorization="Token "+n:delete y.Authorization,fetch(u+i,{method:"DELETE",headers:y,body:JSON.stringify(s)}).then(kn).then(function(n){"success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):n.message?t({message:n.message}):t({}):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})};this.removeToken=function(){return t&&"local"===t.storageMethod?e=localStorage.removeItem("token"):t&&"session"===t.storageMethod&&(e=sessionStorage.removeItem("token")),delete y.Authorization,e="","Token removed"},this.public.companies.get=function(n){return new Promise(function(t,e){xn(n?i+n+"/":i).then(function(n){t(n)},function(n){e(n)})})},this.auth.register=function(n){return new Promise(function(t,e){fetch(u+"auth/register/",{method:"POST",headers:y,body:JSON.stringify(n)}).then(kn).then(function(n){"success"==n.status?(bn(n.data.token),t({user:n.data.user,token:n.data.token})):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},this.auth.registerCompany=function(n){return new Promise(function(t,e){fetch(u+"auth/company/register/",{method:"POST",headers:y,body:JSON.stringify(n)}).then(kn).then(function(n){"success"==n.status?(bn(n.data.token),t(n.data.user)):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},this.auth.login=function(n){return new Promise(function(t,e){fetch(u+"auth/login/",{method:"POST",headers:y,body:JSON.stringify(n)}).then(kn).then(function(n){"success"==n.status?(bn(n.data.token),t({user:n.data.user,token:n.data.token,mfa:void 0!==n.data.mfa?n.data.mfa:null})):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},this.auth.logout=function(){return new Promise(function(t,e){var n=yn();n?y.Authorization="Token "+n:delete y.Authorization,fetch(u+"auth/logout/",{method:"POST",headers:y}).then(kn).then(function(n){"success"==n.status?(Nn(),t({})):"error"==n.status&&(n.data?e(n.data):e({status:n.status_code,message:n.message}))})})},this.auth.logoutAll=function(){return new Promise(function(t,e){var n=yn();n?y.Authorization="Token "+n:delete y.Authorization,fetch(u+"auth/logout/all/",{method:"POST",headers:y}).then(kn).then(function(n){"success"==n.status?(Nn(),t({})):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},this.auth.password.change=function(n){return new Promise(function(t,e){Tn("auth/password/change/",n).then(function(n){t(n)},function(n){e(n)})})},this.auth.password.reset=function(n){return new Promise(function(t,e){Tn("auth/password/reset/",n,!0).then(function(n){t(n)},function(n){e(n)})})},this.auth.password.resetConfirm=function(n){return new Promise(function(t,e){Tn("auth/password/reset/confirm/",n,!0).then(function(n){t(n)},function(n){e(n)})})},this.auth.email.resendEmailVerification=function(n){return new Promise(function(t,e){Tn("auth/email/verify/resend/",n,!0).then(function(n){t(n)},function(n){e(n)})})},this.auth.mobile.resendMobileVerification=function(n){return new Promise(function(t,e){Tn("auth/mobile/verify/resend/",n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mobile.verify=function(n){return new Promise(function(t,e){Tn("auth/mobile/verify/",n).then(function(n){t(n)},function(n){e(n)})})},this.auth.email.verify=function(n){return new Promise(function(t,e){Tn("auth/email/verify/",n).then(function(n){t(n)},function(n){e(n)})})},this.auth.tokens.get=function(n){var i;return i=n?r+n:r,new Promise(function(t,e){xn(i).then(function(n){t(n)},function(n){e(n)})})},this.auth.tokens.create=function(n){return new Promise(function(t,e){Tn(r,n).then(function(n){t(n)},function(n){e(n)})})},this.auth.tokens.delete=function(i){return new Promise(function(t,e){var n;i?n=r+i:e({status:"error",message:"A token is required"}),Sn(n,{}).then(function(n){t(n)},function(n){e(n)})})},this.auth.tokens.verify=function(n){return new Promise(function(t,e){xn("auth/",n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.status.get=function(){return new Promise(function(t,e){xn("auth/mfa/").then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.sms.get=function(){return new Promise(function(t,e){xn(s).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.sms.enable=function(n){return new Promise(function(t,e){Tn(s,n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.sms.send=function(n){return new Promise(function(t,e){Tn("auth/mfa/sms/send/",n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.sms.disable=function(n){return new Promise(function(t,e){Sn(s,n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.token.get=function(){return new Promise(function(t,e){xn(o).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.token.enable=function(n){return new Promise(function(t,e){Tn(o,n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.token.disable=function(){return new Promise(function(t,e){Sn(o).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.verify=function(n){return new Promise(function(t,e){Tn("auth/mfa/verify/",n).then(function(n){t(n)},function(n){e(n)})})},this.transactions.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?l+s.id+"/":s&&s.filters?(i="?"+Pn(s.filters),l+i):l,xn(n).then(function(n){_n(n,"Transaction"),t(n)},function(n){e(n)})})},this.transactions.getNext=function(){return new Promise(function(t,e){var n,i=wn.Transaction;i?(n=i.split(u)[1],xn(n).then(function(n){_n(n,"Transaction"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.transactions.getPrevious=function(){return new Promise(function(t,e){var n,i=vn.Transaction;i?(n=i.split(u)[1],xn(n).then(function(n){_n(n,"Transaction"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.transactions.totals.get=function(n){return new Promise(function(t,e){n=n?"?"+Pn(n):"",xn(l+"totals/"+n).then(function(n){t(n)},function(n){e(n)})})},this.transactions.createDebit=function(n){return new Promise(function(t,e){Tn("transactions/debit/",n).then(function(n){t(n)},function(n){e(n)})})},this.transactions.createCredit=function(n){return new Promise(function(t,e){Tn("transactions/credit/",n).then(function(n){t(n)},function(n){e(n)})})},this.transactions.createTransfer=function(n){return new Promise(function(t,e){Tn("transactions/transfer/",n).then(function(n){t(n)},function(n){e(n)})})},this.transaction_collections.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?g+s.id+"/":s&&s.filters?(i="?"+Pn(s.filters),g+i):g,xn(n).then(function(n){_n(n,"Transaction Collection"),t(n)},function(n){e(n)})})},this.transaction_collections.getNext=function(){return new Promise(function(t,e){var n,i=wn["Transaction Collection"];i?(n=i.split(u)[1],xn(n).then(function(n){_n(n,"Transaction Collection"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.transaction_collections.getPrevious=function(){return new Promise(function(t,e){var n,i=vn["Transaction Collection"];i?(n=i.split(u)[1],xn(n).then(function(n){_n(n,"Transaction Collection"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.transaction_collections.create=function(n){return new Promise(function(t,e){Tn(g,n).then(function(n){t(n)},function(n){e(n)})})},this.accounts.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.reference?p+s.reference+"/":s&&s.filters?(i="?"+Pn(s.filters),p+i):p,xn(n).then(function(n){_n(n,"Account"),t(n)},function(n){e(n)})})},this.accounts.getNext=function(){return new Promise(function(t,e){var n,i=wn.Account;i?(n=i.split(u)[1],xn(n).then(function(n){_n(n,"Account"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.accounts.getPrevious=function(){return new Promise(function(t,e){var n,i=vn.Account;i?(n=i.split(u)[1],xn(n).then(function(n){_n(n,"Account"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.accounts.create=function(n){return new Promise(function(t,e){Tn(p,n).then(function(n){t(n)},function(n){e(n)})})},this.accounts.currencies.get=function(s,o){return new Promise(function(t,e){var n,i;s&&"string"==typeof s?(n=o&&o.code?p+s+w+o.code+"/":o&&o.filters?(i="?"+Pn(o.filters),p+s+w+i):p+s+w,xn(n).then(function(n){_n(n,"AccountCurrencies"),t(n)},function(n){e(n)})):e({status:"error",message:"Reference is required"})})},this.accounts.currencies.getNext=function(){return new Promise(function(t,e){var n,i=wn.AccountCurrencies;i?(n=i.split(u)[1],xn(n).then(function(n){_n(n,"AccountCurrencies"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.accounts.currencies.getPrevious=function(){return new Promise(function(t,e){var n,i=vn.AccountCurrencies;i?(n=i.split(u)[1],xn(n).then(function(n){_n(n,"AccountCurrencies"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.accounts.currencies.update=function(n,i,s){return new Promise(function(t,e){n&&"string"==typeof n?i&&"string"==typeof i?Cn(p+n+w+i+"/",s).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Currency Code is required"}):e({status:"error",message:"Reference is required"})})},this.company.get=function(){return new Promise(function(t,e){xn("company/").then(function(n){t(n)},function(n){e(n)})})},this.company.currencies.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.code?v+s.code+"/":s&&s.filters?(i="?"+Pn(s.filters),v+i):v,xn(n).then(function(n){_n(n,"CompanyCurrencies"),t(n)},function(n){e(n)})})},this.company.currencies.getNext=function(){return new Promise(function(t,e){var n,i=wn.CompanyCurrencies;i?(n=i.split(u)[1],xn(n).then(function(n){_n(n,"CompanyCurrencies"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.company.currencies.getPrevious=function(){return new Promise(function(t,e){var n,i=vn.CompanyCurrencies;i?(n=i.split(u)[1],xn(n).then(function(n){_n(n,"CompanyCurrencies"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.company.bankAccounts.get=function(){return new Promise(function(t,e){xn("company/bank-accounts/").then(function(n){t(n)},function(n){e(n)})})},this.permissions.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?P+s.id+"/":s&&s.filters?(i="?"+Pn(s.filters),P+i):P,xn(n).then(function(n){_n(n,"Permissions"),t(n)},function(n){e(n)})})},this.permissions.getNext=function(){return new Promise(function(t,e){var n,i=wn.Permissions;i?(n=i.split(u)[1],xn(n).then(function(n){_n(n,"Permissions"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.permissions.getPrevious=function(){return new Promise(function(t,e){var n,i=vn.Permissions;i?(n=i.split(u)[1],xn(n).then(function(n){_n(n,"Permissions"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.groups.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.name?b+s.name+"/":s&&s.filters?(i="?"+Pn(s.filters),b+i):b,xn(n).then(function(n){_n(n,"Groups"),t(n)},function(n){e(n)})})},this.groups.getNext=function(){return new Promise(function(t,e){var n,i=wn.Groups;i?(n=i.split(u)[1],xn(n).then(function(n){_n(n,"Groups"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.groups.getPrevious=function(){return new Promise(function(t,e){var n,i=vn.Groups;i?(n=i.split(u)[1],xn(n).then(function(n){_n(n,"CompanyCurrencies"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.user.get=function(){return new Promise(function(t,e){xn("user/").then(function(n){t(n)},function(n){e(n)})})},this.user.update=function(n){return new Promise(function(t,e){Cn("user/",n).then(function(n){t(n)},function(n){e(n)})})},this.user.addresses.get=function(n){return new Promise(function(t,e){xn(n?c+n:c).then(function(n){t(n)},function(n){e(n)})})},this.user.addresses.update=function(i){return new Promise(function(t,e){var n;i.id?n=c+i.id+"/":e({status:400,message:"No id has been given"}),Cn(n,i).then(function(n){t(n)},function(n){e(n)})})},this.user.addresses.create=function(n){return new Promise(function(t,e){Tn(c,n).then(function(n){t(n)},function(n){e(n)})})},this.user.addresses.delete=function(n){return new Promise(function(t,e){n?Sn(c+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.user.bankAccounts.get=function(n){return new Promise(function(t,e){xn(n?a+n+"/":a).then(function(n){t(n)},function(n){e(n)})})},this.user.bankAccounts.create=function(n){return new Promise(function(t,e){Tn(a,n).then(function(n){t(n)},function(n){e(n)})})},this.user.bankAccounts.update=function(n,i){return new Promise(function(t,e){n?Cn(a+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Account id is required"})})},this.user.bankAccounts.delete=function(n){return new Promise(function(t,e){n?Sn(a+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Bank id is required"})})},this.user.cryptoAccounts.get=function(n){return new Promise(function(t,e){xn(n?f+n+"/":f).then(function(n){t(n)},function(n){e(n)})})},this.user.cryptoAccounts.create=function(n){return new Promise(function(t,e){Tn(f,n).then(function(n){t(n)},function(n){e(n)})})},this.user.cryptoAccounts.update=function(n,i){return new Promise(function(t,e){n?Cn(f+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Crypto account id is required"})})},this.user.cryptoAccounts.delete=function(n){return new Promise(function(t,e){n?Sn(f+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Crypto account id is required"})})},this.user.documents.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?m+s.id+"/":s&&s.filters?(i="?"+Pn(s.filters),m+i):m,xn(n).then(function(n){_n(n,"Documents"),t(n)},function(n){e(n)})})},this.user.documents.getNext=function(){return new Promise(function(t,e){var n,i=wn.Documents;i?(n=i.split(u)[1],xn(n).then(function(n){_n(n,"Documents"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.user.documents.getPrevious=function(){return new Promise(function(t,e){var n,i=vn.Documents;i?(n=i.split(u)[1],xn(n).then(function(n){_n(n,"Documents"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.user.documents.create=function(s){return new Promise(function(t,e){var n=yn(),i={};n?i.Authorization="Token "+n:delete i.Authorization,fetch(u+m,{method:"POST",headers:i,body:s}).then(kn).then(function(n){"success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):t(n):"error"==n.status&&(n.data?e(n.data):e({status:n.status_code,message:n.message}))})})},this.user.emails.get=function(n){return new Promise(function(t,e){xn(n?d+n+"/":d).then(function(n){t(n)},function(n){e(n)})})},this.user.emails.create=function(n){return new Promise(function(t,e){Tn(d,n).then(function(n){t(n)},function(n){e(n)})})},this.user.emails.update=function(n,i){return new Promise(function(t,e){n&&i?Cn(d+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Email address id is required"},null)})},this.user.emails.delete=function(n){return new Promise(function(t,e){n?Sn(d+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Email address id is required"})})},this.user.mobiles.get=function(n){return new Promise(function(t,e){xn(n?h+n+"/":h).then(function(n){t(n)},function(n){e(n)})})},this.user.mobiles.create=function(n){return new Promise(function(t,e){Tn(h,n).then(function(n){t(n)},function(n){e(n)})})},this.user.mobiles.update=function(n,i){return new Promise(function(t,e){n&&i?Cn(h+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Mobile number id is required"})})},this.user.mobiles.delete=function(n){return new Promise(function(t,e){n?Sn(h+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Mobile number id is required"})})},this.admin.auth.login=function(n){return new Promise(function(t,e){Tn("admin/auth/login/",n).then(function(n){t(n)},function(n){e(n)})})},this.admin.auth.register=function(n){return new Promise(function(t,e){Tn("admin/auth/register/",n).then(function(n){t(n)},function(n){e(n)})})},this.admin.metrics.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?ln+s.id+"/":s&&s.filters?(i="?"+Pn(s.filters),ln+i):ln,xn(n).then(function(n){An(n),t(n)},function(n){e(n)})})},this.admin.metrics.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.metrics.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.metrics.create=function(n){return new Promise(function(t,e){Tn(ln,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.metrics.delete=function(n){return new Promise(function(t,e){n?Sn(ln+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.metrics.points.get=function(i,s){return new Promise(function(t,e){var n;i?(n=ln+i+"/points/",s.filters&&(n+="?"+Pn(s.filters)),xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"No id has been given"})})},this.admin.metrics.points.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.metrics.points.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.exports.sets.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?B+s.id+"/":s&&s.filters?(i="?"+Pn(s.filters),B+i):B,xn(n).then(function(n){An(n),t(n)},function(n){e(n)})})},this.admin.exports.sets.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.exports.sets.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.exports.sets.create=function(n){return new Promise(function(t,e){Tn(B,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.exports.sets.delete=function(n){return new Promise(function(t,e){n?Sn(B+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.accessControlRules.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?k+s.id+"/":s&&s.filters?(i="?"+Pn(s.filters),k+i):k,xn(n).then(function(n){An(n),t(n)},function(n){e(n)})})},this.admin.accessControlRules.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.accessControlRules.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.accessControlRules.create=function(n){return new Promise(function(t,e){n?Tn(k,n).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No data has been given"})})},this.admin.accessControlRules.update=function(n,i){return new Promise(function(t,e){n?Cn(k+n,i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.accessControlRules.delete=function(n){return new Promise(function(t,e){n?Sn(k+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.overview.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.filters?(i="?"+Pn(s.filters),_+i):_,xn(n).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.settings.get=function(n){return new Promise(function(t,e){n?xn(N+n+A).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.settings.update=function(n,i){return new Promise(function(t,e){n?Cn(N+n+A,i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.kyc.get=function(n){return new Promise(function(t,e){n?xn(N+n+"/kyc/").then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.kyc.update=function(n,i){return new Promise(function(t,e){n?Cn(N+n+"/kyc/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?N+s.id+"/":s&&s.filters?(i="?"+Pn(s.filters),N+i):N,xn(n).then(function(n){An(n),t(n)},function(n){e(n)})})},this.admin.users.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.create=function(i){return new Promise(function(t,e){var n=yn();n?y.Authorization="Token "+n:delete y.Authorization,!isNode&&i instanceof FormData?delete y["Content-Type"]:i=JSON.stringify(i),fetch(u+N,{method:"POST",headers:y,body:i}).then(kn).then(function(n){y["Content-Type"]="application/json","success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):t(n):"error"==n.status&&(n.data?e(n.data):e({status:n.status_code,message:n.message}))})})},this.admin.users.update=function(s,o){return new Promise(function(t,e){if(s){var n=yn(),i={};n?i.Authorization="Token "+n:delete i.Authorization,fetch(u+N+s+"/",{method:"PATCH",headers:i,body:o}).then(kn).then(function(n){"success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):t(n):"error"==n.status&&(n.data?e(n.data):e({status:n.status_code,message:n.message}))})}else e({status:400,message:"No id has been given"})})},this.admin.users.delete=function(n){return new Promise(function(t,e){n?Sn(N+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.permissions.get=function(s,o){return new Promise(function(t,e){var n,i;s?(n=o&&o.id?N+s+T+o.id+"/":o&&o.filters?(i="?"+Pn(o.filters),N+s+T+i):N+s+T,xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"No id has been given"})})},this.admin.users.permissions.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.permissions.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.permissions.create=function(n,i){return new Promise(function(t,e){Tn(N+n+T,i).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.permissions.delete=function(n,i){return new Promise(function(t,e){Sn(N+n+T+i+"/",{}).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.groups.get=function(s,o){return new Promise(function(t,e){var n,i;s?(n=o&&o.name?N+s+x+o.name+"/":o&&o.filters?(i="?"+Pn(o.filters),N+s+x+i):N+s+x,xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"No id has been given"})})},this.admin.users.groups.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.groups.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.groups.create=function(n,i){return new Promise(function(t,e){Tn(N+n+x,i).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.groups.delete=function(n,i){return new Promise(function(t,e){Sn(N+n+x+i+"/",{}).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.addresses.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?C+s.id+"/":s&&s.filters?(i="?"+Pn(s.filters),C+i):C,xn(n).then(function(n){An(n),t(n)},function(n){e(n)})})},this.admin.users.addresses.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.addresses.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.addresses.create=function(n){return new Promise(function(t,e){Tn(C,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.addresses.update=function(n,i){return new Promise(function(t,e){n?Cn(C+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.addresses.delete=function(n){return new Promise(function(t,e){n?Sn(C+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.bankAccounts.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?S+s.id+"/":s&&s.filters?(i="?"+Pn(s.filters),S+i):S,xn(n).then(function(n){An(n),t(n)},function(n){e(n)})})},this.admin.users.bankAccounts.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.bankAccounts.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.bankAccounts.create=function(n){return new Promise(function(t,e){Tn(S,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.bankAccounts.update=function(n,i){return new Promise(function(t,e){n?Cn(S+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.bankAccounts.delete=function(n){return new Promise(function(t,e){n?Sn(S+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.bankAccounts.currencies.get=function(s,o){return new Promise(function(t,e){var n,i;n=o&&o.code?S+s+"/currencies/"+o.code+"/":o&&o.filters?(i="?"+Pn(o.filters),S+s+"/currencies/"+i):S+s+"/currencies/",xn(n).then(function(n){An(n),t(n)},function(n){e(n)})})},this.admin.users.bankAccounts.currencies.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.bankAccounts.currencies.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.bankAccounts.currencies.create=function(n,i){return new Promise(function(t,e){n?Tn(S+n+"/currencies/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.bankAccounts.currencies.update=function(n,i,s){return new Promise(function(t,e){n?i?Cn(S+n+"/currencies/"+i+"/",s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No currency code has been given"}):e({status:400,message:"No id has been given"})})},this.admin.users.bankAccounts.currencies.delete=function(n,i){return new Promise(function(t,e){n?i?Sn(S+n+"/currencies/"+i+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No currency code has been given"}):e({status:400,message:"No id has been given"})})},this.admin.users.cryptoAccounts.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?E+s.id+"/":s&&s.filters?(i="?"+Pn(s.filters),E+i):E,xn(n).then(function(n){An(n),t(n)},function(n){e(n)})})},this.admin.users.cryptoAccounts.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.cryptoAccounts.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.cryptoAccounts.create=function(n){return new Promise(function(t,e){Tn(E,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.cryptoAccounts.update=function(n,i){return new Promise(function(t,e){n?Cn(E+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.cryptoAccounts.delete=function(n){return new Promise(function(t,e){n?Sn(E+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.documents.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?R+s.id+"/":s&&s.filters?(i="?"+Pn(s.filters),R+i):R,xn(n).then(function(n){An(n),t(n)},function(n){e(n)})})},this.admin.users.documents.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.documents.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.documents.create=function(s){return new Promise(function(t,e){var n=yn(),i={};n?i.Authorization="Token "+n:delete i.Authorization,fetch(u+R,{method:"POST",headers:i,body:s}).then(kn).then(function(n){"success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):t(n):"error"==n.status&&(n.data?e(n.data):e({status:n.status_code,message:n.message}))})})},this.admin.users.documents.update=function(s,o){return new Promise(function(t,e){if(s){var n=yn(),i={};n?i.Authorization="Token "+n:delete i.Authorization,fetch(u+R+s+"/",{method:"PATCH",headers:i,body:o}).then(kn).then(function(n){"success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):t(n):"error"==n.status&&(n.data?e(n.data):e({status:n.status_code,message:n.message}))})}else e({status:400,message:"No id has been given"})})},this.admin.users.documents.delete=function(n){return new Promise(function(t,e){n?Sn(R+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.emails.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?j+s.id+"/":s&&s.filters?(i="?"+Pn(s.filters),j+i):j,xn(n).then(function(n){An(n),t(n)},function(n){e(n)})})},this.admin.users.emails.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.emails.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.emails.create=function(n){return new Promise(function(t,e){Tn(j,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.emails.update=function(n,i){return new Promise(function(t,e){n?Cn(j+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.emails.delete=function(n){return new Promise(function(t,e){n?Sn(j+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.mobiles.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?q+s.id+"/":s&&s.filters?(i="?"+Pn(s.filters),q+i):q,xn(n).then(function(n){An(n),t(n)},function(n){e(n)})})},this.admin.users.mobiles.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.mobiles.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.mobiles.create=function(n){return new Promise(function(t,e){Tn(q,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.mobiles.update=function(n,i){return new Promise(function(t,e){n?Cn(q+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.mobiles.delete=function(n){return new Promise(function(t,e){n?Sn(q+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.mfa.get=function(n){return new Promise(function(t,e){n?xn(N+n+"/mfa/").then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.mfa.sms.delete=function(n){return new Promise(function(t,e){n?Sn(N+n+"/mfa/sms/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.mfa.token.delete=function(n){return new Promise(function(t,e){n?Sn(N+n+"/mfa/token/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.transactions.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?O+s.id+"/":s&&s.filters?(i="?"+Pn(s.filters),O+i):O,xn(n).then(function(n){An(n),t(n)},function(n){e(n)})})},this.admin.transactions.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.transactions.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.transactions.totals.get=function(i){return new Promise(function(t,e){var n;n=i?"?"+Pn(i.filters):"",xn("admin/transactions/totals/"+n).then(function(n){An(n),t(n)},function(n){e(n)})})},this.admin.transactions.update=function(n,i){return new Promise(function(t,e){n?Cn(O+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.transactions.createCredit=function(n){return new Promise(function(t,e){Tn("admin/transactions/credit/",n).then(function(n){t(n)},function(n){e(n)})})},this.admin.transactions.createDebit=function(n){return new Promise(function(t,e){Tn("admin/transactions/debit/",n).then(function(n){t(n)},function(n){e(n)})})},this.admin.transactions.createTransfer=function(n){return new Promise(function(t,e){Tn("admin/transactions/transfer/",n).then(function(n){t(n)},function(n){e(n)})})},this.admin.transaction_collections.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?I+s.id+"/":s&&s.filters?(i="?"+Pn(s.filters),I+i):I,xn(n).then(function(n){An(n),t(n)},function(n){e(n)})})},this.admin.transaction_collections.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.transaction_collections.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.transaction_collections.create=function(n){return new Promise(function(t,e){Tn(I,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.transaction_collections.update=function(n,i){return new Promise(function(t,e){n?Cn(I+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference has been given"})})},this.admin.transaction_collections.delete=function(n){return new Promise(function(t,e){n?Sn(I+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.accounts.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.reference?U+s.reference+"/":s&&s.filters?(i="?"+Pn(s.filters),U+i):U,xn(n).then(function(n){An(n),t(n)},function(n){e(n)})})},this.admin.accounts.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.accounts.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.account.definitions.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.name?G+s.name+"/":s&&s.filters?(i="?"+Pn(s.filters),G+i):G,xn(n).then(function(n){An(n),t(n)},function(n){e(n)})})},this.admin.account.definitions.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.account.definitions.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.account.definitions.create=function(n){return new Promise(function(t,e){Tn(G,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.account.definitions.update=function(n,i){return new Promise(function(t,e){n?Cn(G+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.delete=function(n){return new Promise(function(t,e){n?Sn(G+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.groups.get=function(s,o){return new Promise(function(t,e){var n,i;s?(n=o&&o.name?G+s+"/groups/"+o.name+"/":o&&o.filters?(i="?"+Pn(o.filters),G+s+"/groups/"+i):G+s+"/groups/",xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.groups.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.account.definitions.groups.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.account.definitions.groups.create=function(n,i){return new Promise(function(t,e){n?Tn(G+n+"/groups/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.groups.update=function(n,i,s){return new Promise(function(t,e){n?i?Cn(G+n+"/groups/"+i+"/",s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"}):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.groups.delete=function(n,i){return new Promise(function(t,e){n?i?Sn(G+n+"/groups/"+i+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"}):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.groups.currencies.get=function(s,o,u){return new Promise(function(t,e){var n,i;s?o?(n=u&&u.code?G+s+"/groups/"+o+"/currencies/"+u.code+"/":u&&u.filters?(i="?"+Pn(u.filters),G+s+"/groups/"+o+"/currencies/"+i):G+s+"/groups/"+o+"/currencies/",xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"No group name has been given"}):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.groups.currencies.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.account.definitions.groups.currencies.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.account.definitions.groups.currencies.create=function(n,i,s){return new Promise(function(t,e){n?i?Tn(G+n+"/groups/"+i+"/currencies/",s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"}):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.groups.currencies.update=function(n,i,s,o){return new Promise(function(t,e){n?i?s?Cn(G+n+"/groups/"+i+"/currencies/"+s+"/",o).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No currency code has been given"}):e({status:400,message:"No group name has been given"}):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.groups.currencies.delete=function(n,i,s){return new Promise(function(t,e){n?i?s?Sn(G+n+"/groups/"+i+"/currencies/"+s+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No currency code has been given"}):e({status:400,message:"No group name has been given"}):e({status:400,message:"No account name has been given"})})},this.admin.account.currencies.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.reference?M+s.reference+"/":s&&s.filters?(i="?"+Pn(s.filters),M+i):M,xn(n).then(function(n){An(n),t(n)},function(n){e(n)})})},this.admin.account.currencies.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.account.currencies.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.accounts.create=function(n){return new Promise(function(t,e){Tn(U,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.accounts.update=function(n,i){return new Promise(function(t,e){n?Cn(U+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference has been given"})})},this.admin.accounts.currencies.get=function(s,o){return new Promise(function(t,e){var n,i;s?(n=o&&o.code?U+s+F+o.code+"/":o&&o.filters?(i="?"+Pn(o.filters),U+s+F+i):U+s+F,xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"No reference has been given"})})},this.admin.accounts.currencies.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.accounts.currencies.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.accounts.currencies.create=function(n,i){return new Promise(function(t,e){Tn(U+n+F,i).then(function(n){t(n)},function(n){e(n)})})},this.admin.accounts.currencies.update=function(n,i,s){return new Promise(function(t,e){n&&i?Cn(U+n+F+i+"/",s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference or code has been given"})})},this.admin.accounts.currencies.limits.get=function(i,s,o){return new Promise(function(t,e){var n;i&&s?(n=o&&o.id?U+i+F+s+z+o.id+"/":U+i+F+s+z,xn(n).then(function(n){t(n)},function(n){e(n)})):e({status:400,message:"No reference or code has been given"})})},this.admin.accounts.currencies.limits.create=function(n,i,s){return new Promise(function(t,e){Tn(U+n+F+i+z,s).then(function(n){t(n)},function(n){e(n)})})},this.admin.accounts.currencies.limits.update=function(n,i,s,o){return new Promise(function(t,e){n&&i&&s?Cn(U+n+F+i+z+s+"/",o).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference or code or id has been given"})})},this.admin.accounts.currencies.limits.delete=function(n,i,s){return new Promise(function(t,e){n&&i&&s?Sn(U+n+F+i+z+s+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference or code or id has been given"})})},this.admin.accounts.currencies.fees.get=function(i,s,o){return new Promise(function(t,e){var n;i&&s?(n=o&&o.id?U+i+F+s+D+o.id+"/":U+i+F+s+D,xn(n).then(function(n){t(n)},function(n){e(n)})):e({status:400,message:"No reference or code has been given"})})},this.admin.accounts.currencies.fees.create=function(n,i,s){return new Promise(function(t,e){Tn(U+n+F+i+D,s).then(function(n){t(n)},function(n){e(n)})})},this.admin.accounts.currencies.fees.update=function(n,i,s,o){return new Promise(function(t,e){n&&i&&s?Cn(U+n+F+i+D+s+"/",o).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference or code or id has been given"})})},this.admin.accounts.currencies.fees.delete=function(n,i,s){return new Promise(function(t,e){n&&i&&s?Sn(U+n+F+i+D+s+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference or code or id has been given"})})},this.admin.accounts.currencies.settings.get=function(n,i){return new Promise(function(t,e){n&&i?xn(U+n+F+i+L).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference or code has been given"})})},this.admin.accounts.currencies.settings.update=function(n,i,s){return new Promise(function(t,e){n&&i?Cn(U+n+F+i+L,s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference or code has been given"})})},this.admin.currencies.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.code?H+s.code+"/":s&&s.filters?(i="?"+Pn(s.filters),H+i):H,xn(n).then(function(n){An(n),t(n)},function(n){e(n)})})},this.admin.currencies.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.currencies.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.currencies.create=function(n){return new Promise(function(t,e){Tn(H,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.currencies.update=function(n,i){return new Promise(function(t,e){if(!n)return currencies.update,void e({status:400,message:"No code has been given"});Cn(H+n+"/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.currencies.delete=function(n){return new Promise(function(t,e){n?Sn(H+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No code has been given"})})},this.admin.currencies.overview.get=function(n){return new Promise(function(t,e){n||e({status:400,message:"No code provided"}),xn(H+n+"/overview/").then(function(n){t(n)},function(n){e(n)})})},this.admin.currencies.bankAccounts.get=function(s,o){return new Promise(function(t,e){var n,i;n=o&&o.id?H+s+J+o.id+"/":o&&o.filters?(i="?"+Pn(o.filters),H+s+J+i):H+s+J,xn(n).then(function(n){An(n),t(n)},function(n){e(n)})})},this.admin.currencies.bankAccounts.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.currencies.bankAccounts.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.currencies.bankAccounts.create=function(n,i){return new Promise(function(t,e){Tn(H+n+J,i).then(function(n){t(n)},function(n){e(n)})})},this.admin.currencies.bankAccounts.delete=function(n,i){return new Promise(function(t,e){Sn(H+n+J+i+"/").then(function(n){t(n)},function(n){e(n)})})},this.admin.company.get=function(){return new Promise(function(t,e){xn(V).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.update=function(n){return new Promise(function(t,e){Cn(V,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.settings.get=function(){return new Promise(function(t,e){xn(V+X).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.settings.update=function(n){return new Promise(function(t,e){Cn(V+X,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.address.get=function(){return new Promise(function(t,e){xn(V+K).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.address.update=function(n){return new Promise(function(t,e){Cn(V+K,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.bankAccounts.get=function(n){var i;return i=n&&n.id?sn+n.id+"/":sn,new Promise(function(t,e){xn(i).then(function(n){t(n)},function(n){e(n)})})},this.admin.bankAccounts.create=function(n){return new Promise(function(t,e){Tn(sn,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.bankAccounts.update=function(n,i){return new Promise(function(t,e){Cn(sn+n+"/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.bankAccounts.delete=function(n){return new Promise(function(t,e){Sn(sn+n+"/",{}).then(function(n){t(n)},function(n){e(n)})})},this.admin.bankAccounts.currencies.get=function(i,s){return new Promise(function(t,e){if(i){var n=sn+i+"/currencies/";s&&(n+=s),xn(n).then(function(n){An(n),t(n)},function(n){e(n)})}else e({status:400,message:"No bank ID has been given"})})},this.admin.bankAccounts.currencies.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){n.next&&An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.bankAccounts.currencies.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.bankAccounts.currencies.create=function(n,i){if(i.currency)return new Promise(function(t,e){Tn(sn+n+"/currencies/",i).then(function(n){t(n)},function(n){e(n)})});reject({status:400,message:"No currency has been given"})},this.admin.bankAccounts.currencies.delete=function(n,i){if(n){if(i)return new Promise(function(t,e){Sn(sn+n+"/currencies/"+i,{}).then(function(n){t(n)},function(n){e(n)})});reject({status:400,message:"No currency has been given"})}else reject({status:400,message:"No bank ID has been given"})},this.admin.webhooks.get=function(n){var i,t;return i=n&&n.id?W+n.id+"/":n&&n.filters?(t="?"+Pn(n.filters),W+t):W,new Promise(function(t,e){xn(i).then(function(n){An(n),t(n)},function(n){e(n)})})},this.admin.webhooks.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.webhooks.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.webhooks.create=function(n){return new Promise(function(t,e){Tn(W,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.webhooks.update=function(n,i){return new Promise(function(t,e){Cn(W+n+"/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.webhooks.delete=function(n){return new Promise(function(t,e){Sn(W+n+"/",{}).then(function(n){t(n)},function(n){e(n)})})},this.admin.webhookTasks.get=function(n){var i,t;return i=n&&n.id?$+n.id+"/":n&&n.filters?(t="?"+Pn(n.filters),$+t):$,n&&n.id?new Promise(function(t,e){var n=yn();n?y.Authorization="Token "+n:delete y.Authorization,fetch(u+i,{method:"GET",headers:y}).then(kn).then(function(n){"success"==n.status?n.data&&t(n.data):"error"==n.status&&(n.data?e(n.data):e({status:n.status_code,message:n.message}))})}):new Promise(function(t,e){xn(i).then(function(n){An(n),t(n)},function(n){e(n)})})},this.admin.webhookTasks.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.webhookTasks.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.webhookTasks.requests.get=function(n,t){var i,e;return i=t&&t.id?$+n+Q+t.id+"/":t&&t.filters?(e="?"+Pn(t.filters),$+n+Q+e):$,new Promise(function(t,e){xn(i).then(function(n){An(n),t(n)},function(n){e(n)})})},this.admin.webhookTasks.requests.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.webhookTasks.requests.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.subtypes.get=function(n){var i;return i=n&&n.id?Y+n.id+"/":Y,new Promise(function(t,e){xn(i).then(function(n){t(n)},function(n){e(n)})})},this.admin.subtypes.create=function(n){return new Promise(function(t,e){Tn(Y,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.subtypes.update=function(n,i){return new Promise(function(t,e){Cn(Y+n+"/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.subtypes.delete=function(n){return new Promise(function(t,e){Sn(Y+n+"/",{}).then(function(n){t(n)},function(n){e(n)})})},this.admin.notifications.get=function(n){var i;return i=n&&n.id?Z+n.id+"/":Z,new Promise(function(t,e){xn(i).then(function(n){t(n)},function(n){e(n)})})},this.admin.notifications.update=function(n,i){return new Promise(function(t,e){Cn(Z+n+"/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.services.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?on+s.id+"/":s&&s.filters?(i="?"+Pn(s.filters),on+i):on,xn(n).then(function(n){An(n),t(n)},function(n){e(n)})})},this.admin.services.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.services.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.services.update=function(n,i){return new Promise(function(t,e){Cn(on+n+"/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.services.create=function(n){return new Promise(function(t,e){Tn(on,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.services.delete=function(n){return new Promise(function(t,e){n?Sn(on+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.requests.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?rn+s.id+"/":s&&s.filters?(i="?"+Pn(s.filters),rn+i):rn,xn(n).then(function(n){An(n),t(n)},function(n){e(n)})})},this.admin.requests.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){n.next&&An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.requests.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.name?un+s.name+"/":s&&s.filters?(i="?"+Pn(s.filters),un+i):un,xn(n).then(function(n){An(n),t(n)},function(n){e(n)})})},this.admin.groups.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.create=function(n){return new Promise(function(t,e){Tn(un,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.groups.update=function(n,i){return new Promise(function(t,e){n?Cn(un+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})},this.admin.groups.delete=function(n){return new Promise(function(t,e){n?Sn(un+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})},this.admin.groups.permissions.get=function(s,o){return new Promise(function(t,e){var n,i;n=o&&o.id?un+s+cn+o.id+"/":o&&o.filters?(i="?"+Pn(o.filters),un+s+cn+i):un+s+cn,xn(n).then(function(n){An(n),t(n)},function(n){e(n)})})},this.admin.groups.permissions.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.permissions.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.permissions.create=function(n,i){return new Promise(function(t,e){n?Tn(un+n+cn,i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})},this.admin.groups.permissions.delete=function(n,i){return new Promise(function(t,e){n&&i?Sn(un+n+cn+i+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name or permission id has been given"})})},this.admin.groups.settings.get=function(n){return new Promise(function(t,e){n?xn(un+n+an).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})},this.admin.groups.settings.update=function(n,i){if(n)return new Promise(function(t,e){Cn(un+n+an,i).then(function(n){t(n)},function(n){e(n)})});reject({status:400,message:"No group name has been given"})},this.admin.groups.tiers.get=function(n,t){var i;return i=t&&t.id?un+n+fn+t.id+"/":un+n+fn,new Promise(function(t,e){xn(i).then(function(n){t(n)},function(n){e(n)})})},this.admin.groups.tiers.create=function(n,i){return new Promise(function(t,e){Tn(un+n+fn,i).then(function(n){t(n)},function(n){e(n)})})},this.admin.groups.tiers.update=function(n,i,s){return new Promise(function(t,e){Cn(un+n+fn+i+"/",s).then(function(n){t(n)},function(n){e(n)})})},this.admin.groups.tiers.delete=function(n,i){return new Promise(function(t,e){Sn(un+n+fn+i+"/",{}).then(function(n){t(n)},function(n){e(n)})})},this.admin.groups.tiers.requirements.get=function(i,s,o){return new Promise(function(t,e){var n;s?(n=o&&o.id?un+i+fn+s+nn+o.id+"/":un+i+fn+s+nn,xn(n).then(function(n){t(n)},function(n){e(n)})):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.requirements.create=function(n,i,s){return new Promise(function(t,e){i?Tn(un+n+fn+i+nn,s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.requirements.update=function(n,i,s,o){return new Promise(function(t,e){i?s?Cn(un+n+fn+i+nn+s+"/",o).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No requirement id is provided"}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.requirements.delete=function(n,i,s){return new Promise(function(t,e){i?s?Sn(un+n+fn+i+nn+s+"/").then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No requirement id is provided"}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.fees.get=function(i,s,o){return new Promise(function(t,e){var n;s?(n=o&&o.id?un+i+fn+s+en+o.id+"/":un+i+fn+s+en,xn(n).then(function(n){t(n)},function(n){e(n)})):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.fees.create=function(n,i,s){return new Promise(function(t,e){i?Tn(un+n+fn+i+en,s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.fees.update=function(n,i,s,o){return new Promise(function(t,e){i?s?Cn(un+n+fn+i+en+s+"/",o).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No fee id is provided"}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.fees.delete=function(n,i,s){return new Promise(function(t,e){i?s?Sn(un+n+fn+i+en+s+"/").then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No fee id is provided"}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.limits.get=function(i,s,o){return new Promise(function(t,e){var n;s?(n=o&&o.id?un+i+fn+s+tn+o.id+"/":un+i+fn+s+tn,xn(n).then(function(n){t(n)},function(n){e(n)})):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.limits.create=function(n,i,s){return new Promise(function(t,e){i?Tn(un+n+fn+i+tn,s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.limits.update=function(n,i,s,o){return new Promise(function(t,e){i?s?Cn(un+n+fn+i+tn+s+"/",o).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No limit id is provided"}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.limits.delete=function(n,i,s){return new Promise(function(t,e){i?s?Sn(un+n+fn+i+tn+s+"/").then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No limit id is provided"}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.settings.get=function(n,i){return new Promise(function(t,e){n?xn(un+n+fn+i+hn).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})},this.admin.groups.tiers.settings.update=function(n,i,s){if(n)return new Promise(function(t,e){Cn(un+n+fn+i+hn,s).then(function(n){t(n)},function(n){e(n)})});reject({status:400,message:"No group name has been given"})},this.admin.groups.accountConfigurations.get=function(s,o){return new Promise(function(t,e){var n,i;n=o&&o.name?un+s+mn+o.name+"/":o&&o.filters?(i="?"+Pn(o.filters),un+s+mn+i):un+s+mn,xn(n).then(function(n){An(n),t(n)},function(n){e(n)})})},this.admin.groups.accountConfigurations.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.accountConfigurations.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.accountConfigurations.create=function(n,i){return new Promise(function(t,e){Tn(un+n+mn,i).then(function(n){t(n)},function(n){e(n)})})},this.admin.groups.accountConfigurations.update=function(n,i,s){return new Promise(function(t,e){n?Cn(un+n+mn+i+"/",s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})},this.admin.groups.accountConfigurations.delete=function(n,i){return new Promise(function(t,e){n?Sn(un+n+mn+i+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})},this.admin.groups.accountConfigurations.currencies.get=function(s,o,u){return new Promise(function(t,e){var n,i;n=u&&u.code?un+s+mn+o+dn+u.code+"/":u&&u.filters?(i="?"+Pn(u.filters),un+s+mn+o+dn+i):un+s+mn+o+dn,xn(n).then(function(n){An(n),t(n)},function(n){e(n)})})},this.admin.groups.accountConfigurations.currencies.getNext=function(){return new Promise(function(t,e){var n;gn?(n=gn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.accountConfigurations.currencies.getPrevious=function(){return new Promise(function(t,e){var n;pn?(n=pn.split(u)[1],xn(n).then(function(n){An(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.accountConfigurations.currencies.create=function(n,i,s){return new Promise(function(t,e){Tn(un+n+mn+i+dn,s).then(function(n){t(n)},function(n){e(n)})})},this.admin.groups.accountConfigurations.currencies.delete=function(n,i,s){return new Promise(function(t,e){n?Sn(un+n+mn+i+dn+s+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})}}"undefined"!=typeof module&&module.exports?(module.exports=Rehive,global.fetch&&!process.env.IS_BROWSER?fetch=global.fetch:(fetch=require("node-fetch"),isNode=!0)):(window.this,isNode=!1,fetch=window.fetch);
1
+ !function(n){var t=setTimeout;function i(){}function o(n){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof n)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(n,this)}function s(e,i){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,o._immediateFn(function(){var n=1===e._state?i.onFulfilled:i.onRejected;if(null!==n){var t;try{t=n(e._value)}catch(n){return void r(i.promise,n)}u(i.promise,t)}else(1===e._state?u:r)(i.promise,e._value)})):e._deferreds.push(i)}function u(t,n){try{if(n===t)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var e=n.then;if(n instanceof o)return t._state=3,t._value=n,void c(t);if("function"==typeof e)return void f((i=e,s=n,function(){i.apply(s,arguments)}),t)}t._state=1,t._value=n,c(t)}catch(n){r(t,n)}var i,s}function r(n,t){n._state=2,n._value=t,c(n)}function c(n){2===n._state&&0===n._deferreds.length&&o._immediateFn(function(){n._handled||o._unhandledRejectionFn(n._value)});for(var t=0,e=n._deferreds.length;t<e;t++)s(n,n._deferreds[t]);n._deferreds=null}function a(n,t,e){this.onFulfilled="function"==typeof n?n:null,this.onRejected="function"==typeof t?t:null,this.promise=e}function f(n,t){var e=!1;try{n(function(n){e||(e=!0,u(t,n))},function(n){e||(e=!0,r(t,n))})}catch(n){if(e)return;e=!0,r(t,n)}}o.prototype.catch=function(n){return this.then(null,n)},o.prototype.then=function(n,t){var e=new this.constructor(i);return s(this,new a(n,t,e)),e},o.all=function(n){var r=Array.prototype.slice.call(n);return new o(function(i,s){if(0===r.length)return i([]);var o=r.length;function u(t,n){try{if(n&&("object"==typeof n||"function"==typeof n)){var e=n.then;if("function"==typeof e)return void e.call(n,function(n){u(t,n)},s)}r[t]=n,0==--o&&i(r)}catch(n){s(n)}}for(var n=0;n<r.length;n++)u(n,r[n])})},o.resolve=function(t){return t&&"object"==typeof t&&t.constructor===o?t:new o(function(n){n(t)})},o.reject=function(e){return new o(function(n,t){t(e)})},o.race=function(s){return new o(function(n,t){for(var e=0,i=s.length;e<i;e++)s[e].then(n,t)})},o._immediateFn="function"==typeof setImmediate&&function(n){setImmediate(n)}||function(n){t(n,0)},o._unhandledRejectionFn=function(n){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",n)},o._setImmediateFn=function(n){o._immediateFn=n},o._setUnhandledRejectionFn=function(n){o._unhandledRejectionFn=n},"undefined"!=typeof module&&module.exports?module.exports=o:n.Promise||(n.Promise=o)}(this),function(n){"use strict";if(!n.fetch){var t="URLSearchParams"in n,e="Symbol"in n&&"iterator"in Symbol,u="FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(n){return!1}}(),i="FormData"in n,s="ArrayBuffer"in n;if(s)var o=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],r=function(n){return n&&DataView.prototype.isPrototypeOf(n)},c=ArrayBuffer.isView||function(n){return n&&-1<o.indexOf(Object.prototype.toString.call(n))};l.prototype.append=function(n,t){n=m(n),t=d(t);var e=this.map[n];this.map[n]=e?e+","+t:t},l.prototype.delete=function(n){delete this.map[m(n)]},l.prototype.get=function(n){return n=m(n),this.has(n)?this.map[n]:null},l.prototype.has=function(n){return this.map.hasOwnProperty(m(n))},l.prototype.set=function(n,t){this.map[m(n)]=d(t)},l.prototype.forEach=function(n,t){for(var e in this.map)this.map.hasOwnProperty(e)&&n.call(t,this.map[e],e,this)},l.prototype.keys=function(){var e=[];return this.forEach(function(n,t){e.push(t)}),h(e)},l.prototype.values=function(){var t=[];return this.forEach(function(n){t.push(n)}),h(t)},l.prototype.entries=function(){var e=[];return this.forEach(function(n,t){e.push([t,n])}),h(e)},e&&(l.prototype[Symbol.iterator]=l.prototype.entries);var a=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},P.call(b.prototype),P.call(N.prototype),N.prototype.clone=function(){return new N(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},N.error=function(){var n=new N(null,{status:0,statusText:""});return n.type="error",n};var f=[301,302,303,307,308];N.redirect=function(n,t){if(-1===f.indexOf(t))throw new RangeError("Invalid status code");return new N(null,{status:t,headers:{location:n}})},n.Headers=l,n.Request=b,n.Response=N,n.fetch=function(e,s){return new Promise(function(i,n){var t=new b(e,s),o=new XMLHttpRequest;o.onload=function(){var n,s,t={status:o.status,statusText:o.statusText,headers:(n=o.getAllResponseHeaders()||"",s=new l,n.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(n){var t=n.split(":"),e=t.shift().trim();if(e){var i=t.join(":").trim();s.append(e,i)}}),s)};t.url="responseURL"in o?o.responseURL:t.headers.get("X-Request-URL");var e="response"in o?o.response:o.responseText;i(new N(e,t))},o.onerror=function(){n(new TypeError("Network request failed"))},o.ontimeout=function(){n(new TypeError("Network request failed"))},o.open(t.method,t.url,!0),"include"===t.credentials?o.withCredentials=!0:"omit"===t.credentials&&(o.withCredentials=!1),"responseType"in o&&u&&(o.responseType="blob"),t.headers.forEach(function(n,t){o.setRequestHeader(t,n)}),o.send(void 0===t._bodyInit?null:t._bodyInit)})},n.fetch.polyfill=!0}function m(n){if("string"!=typeof n&&(n=String(n)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(n))throw new TypeError("Invalid character in header field name");return n.toLowerCase()}function d(n){return"string"!=typeof n&&(n=String(n)),n}function h(t){var n={next:function(){var n=t.shift();return{done:void 0===n,value:n}}};return e&&(n[Symbol.iterator]=function(){return n}),n}function l(t){this.map={},t instanceof l?t.forEach(function(n,t){this.append(t,n)},this):Array.isArray(t)?t.forEach(function(n){this.append(n[0],n[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(n){this.append(n,t[n])},this)}function g(n){if(n.bodyUsed)return Promise.reject(new TypeError("Already read"));n.bodyUsed=!0}function p(e){return new Promise(function(n,t){e.onload=function(){n(e.result)},e.onerror=function(){t(e.error)}})}function w(n){var t=new FileReader,e=p(t);return t.readAsArrayBuffer(n),e}function v(n){if(n.slice)return n.slice(0);var t=new Uint8Array(n.byteLength);return t.set(new Uint8Array(n)),t.buffer}function P(){return this.bodyUsed=!1,this._initBody=function(n){if(this._bodyInit=n)if("string"==typeof n)this._bodyText=n;else if(u&&Blob.prototype.isPrototypeOf(n))this._bodyBlob=n;else if(i&&FormData.prototype.isPrototypeOf(n))this._bodyFormData=n;else if(t&&URLSearchParams.prototype.isPrototypeOf(n))this._bodyText=n.toString();else if(s&&u&&r(n))this._bodyArrayBuffer=v(n.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!s||!ArrayBuffer.prototype.isPrototypeOf(n)&&!c(n))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=v(n)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof n?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t&&URLSearchParams.prototype.isPrototypeOf(n)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},u&&(this.blob=function(){var n=g(this);if(n)return n;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?g(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(w)}),this.text=function(){var n,t,e,i=g(this);if(i)return i;if(this._bodyBlob)return n=this._bodyBlob,t=new FileReader,e=p(t),t.readAsText(n),e;if(this._bodyArrayBuffer)return Promise.resolve(function(n){for(var t=new Uint8Array(n),e=new Array(t.length),i=0;i<t.length;i++)e[i]=String.fromCharCode(t[i]);return e.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i&&(this.formData=function(){return this.text().then(y)}),this.json=function(){return this.text().then(JSON.parse)},this}function b(n,t){var e,i,s=(t=t||{}).body;if(n instanceof b){if(n.bodyUsed)throw new TypeError("Already read");this.url=n.url,this.credentials=n.credentials,t.headers||(this.headers=new l(n.headers)),this.method=n.method,this.mode=n.mode,s||null==n._bodyInit||(s=n._bodyInit,n.bodyUsed=!0)}else this.url=String(n);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new l(t.headers)),this.method=(e=t.method||this.method||"GET",i=e.toUpperCase(),-1<a.indexOf(i)?i:e),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&s)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(s)}function y(n){var s=new FormData;return n.trim().split("&").forEach(function(n){if(n){var t=n.split("="),e=t.shift().replace(/\+/g," "),i=t.join("=").replace(/\+/g," ");s.append(decodeURIComponent(e),decodeURIComponent(i))}}),s}function N(n,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=200<=this.status&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new l(t.headers),this.url=t.url||"",this._initBody(n)}}("undefined"!=typeof self?self:this);var fetch,isNode=!1;function Rehive(t){this.public={companies:[]},this.auth={password:{},email:{},mobile:{},tokens:{},mfa:{sms:{},token:{},status:{}}},this.user={addresses:[],bankAccounts:{},cryptoAccounts:{},documents:{},emails:{},mobiles:{},legalTerms:{versions:{}}},this.transactions={totals:{}},this.transaction_collections={},this.accounts={currencies:{}},this.company={currencies:{},bankAccounts:{}},this.groups={},this.permissions={},this.admin={auth:{login:{},register:{}},accessControlRules:{},users:{overview:{},tiers:{},addresses:{},bankAccounts:{currencies:{}},settings:{},cryptoAccounts:{},documents:{},emails:{},mobiles:{},permissions:{},groups:{},kyc:{},mfa:{token:{},sms:{}}},requests:{},transactions:{totals:{}},transaction_collections:{},accounts:{currencies:{limits:{},fees:{},settings:{}}},account:{currencies:{},definitions:{groups:{currencies:{}}}},currencies:{overview:{},bankAccounts:{}},company:{settings:{},address:{},links:{}},bankAccounts:{currencies:{}},webhooks:{},subtypes:{},notifications:{},services:{},groups:{tiers:{requirements:{},limits:{},fees:{},settings:{}},permissions:{},accountConfigurations:{currencies:{}},settings:{}},webhookTasks:{requests:{}},exports:{sets:{}},metrics:{points:{}}};var u,n="3",i="public/companies/",s="auth/mfa/sms/",o="auth/mfa/token/",r="auth/tokens/",c="user/addresses/",a="user/bank-accounts/",f="user/crypto-accounts/",m="user/documents/",d="user/emails/",h="user/mobiles/",l="user/legal-terms/",g="transactions/",p="transaction-collections/",w="accounts/",v="/currencies/",P="company/currencies/",b="permissions/",y="groups/",N={"Content-Type":"application/json",Accept:"application/json"},k="admin/users/",A="admin/access-control-rules/",_="/settings/",T="admin/users/overview/",x="/permissions/",C="/groups/",S="admin/users/addresses/",E="admin/users/bank-accounts/",R="admin/users/crypto-accounts/",j="admin/users/documents/",q="admin/users/emails/",I="admin/users/mobiles/",O="admin/transactions/",B="admin/exports/",U="admin/transaction-collections/",D="admin/accounts/",F="/currencies/",z="/limits/",L="/fees/",M="/settings/",G="admin/account-currencies/",H="admin/account-definitions/",J="admin/currencies/",V="/bank-accounts/",X="admin/company/",K="admin/company/links/",W="settings/",$="address/",Q="admin/webhooks/",Y="admin/webhook-tasks/",Z="/requests/",nn="admin/subtypes/",tn="admin/notifications/",en="/requirements/",sn="/limits/",on="/fees/",un="admin/bank-accounts/",rn="admin/services/",cn="admin/groups/",an="admin/requests/",fn="/permissions/",mn="/settings/",dn="/tiers/",hn="/account-configurations/",ln="/currencies/",gn="/settings/",pn="admin/metrics/";t||(t={}),u=0<Object.keys(t).length?t.customAPIURL?t.customAPIURL:(n=t.apiVersion?t.apiVersion:"3",t.apiToken&&Nn(t.apiToken),t.network&&"staging"==t.network?t.network="api.staging.rehive.com":t.network="api.rehive.com","https://"+t.network+"/"+n+"/"):(n="3",t.network="api.rehive.com","https://"+t.network+"/"+n+"/");var e,wn,vn,Pn={},bn={};function yn(n){var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push(encodeURIComponent(e)+"="+encodeURIComponent(n[e]));return t.join("&")}function Nn(n){if(t&&t.storageMethod){if(void 0===sessionStorage||void 0===localStorage)return void console.log("sessionStorage and localStorage not supported.");"local"===t.storageMethod?localStorage.setItem("token",n):"session"===t.storageMethod&&sessionStorage.setItem("token",n)}e=n}function kn(){return t&&"local"===t.storageMethod?e=localStorage.getItem("token"):t&&"session"===t.storageMethod&&(e=sessionStorage.getItem("token")),e||""}function An(){t&&"local"===t.storageMethod?e=localStorage.removeItem("token"):t&&"session"===t.storageMethod&&(e=sessionStorage.removeItem("token")),delete N.Authorization,e=""}function _n(e){return e.json().then(function(t){return new Promise(function(n){e.ok||(t.status_code=e.status,t.ok=e.ok),n(t)})})}function Tn(n){wn=n.next?n.next:null,vn=n.previous?n.previous:null}function xn(n,t){n.next?Pn[t]=n.next:delete Pn[t],n.previous?bn[t]=n.previous:delete bn[t]}var Cn=function(i,s,o){return new Promise(function(t,e){var n=kn();n&&!o?N.Authorization="Token "+n:delete N.Authorization,fetch(u+i,{method:"POST",headers:N,body:JSON.stringify(s)}).then(_n).then(function(n){"success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):n.message?t({message:n.message}):t({}):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},Sn=function(i,s){return new Promise(function(t,e){var n=s||kn();n?N.Authorization="Token "+n:delete N.Authorization,fetch(u+i,{method:"GET",headers:N}).then(_n).then(function(n){"success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):n.message?t({message:n.message}):t({}):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},En=function(i,s){return new Promise(function(t,e){var n=kn();n?N.Authorization="Token "+n:delete N.Authorization,!isNode&&s instanceof FormData?delete N["Content-Type"]:(N["Content-Type"]="application/json",s=JSON.stringify(s)),fetch(u+i,{method:"PATCH",headers:N,body:s}).then(_n).then(function(n){N["Content-Type"]="application/json","success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):n.message?t({message:n.message}):t({}):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},Rn=function(i,s){return new Promise(function(t,e){var n=kn();n?N.Authorization="Token "+n:delete N.Authorization,fetch(u+i,{method:"DELETE",headers:N,body:JSON.stringify(s)}).then(_n).then(function(n){"success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):n.message?t({message:n.message}):t({}):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})};this.removeToken=function(){return t&&"local"===t.storageMethod?e=localStorage.removeItem("token"):t&&"session"===t.storageMethod&&(e=sessionStorage.removeItem("token")),delete N.Authorization,e="","Token removed"},this.public.companies.get=function(n){return new Promise(function(t,e){Sn(n?i+n+"/":i).then(function(n){t(n)},function(n){e(n)})})},this.auth.register=function(n){return new Promise(function(t,e){fetch(u+"auth/register/",{method:"POST",headers:N,body:JSON.stringify(n)}).then(_n).then(function(n){"success"==n.status?(Nn(n.data.token),t({user:n.data.user,token:n.data.token})):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},this.auth.registerCompany=function(n){return new Promise(function(t,e){fetch(u+"auth/company/register/",{method:"POST",headers:N,body:JSON.stringify(n)}).then(_n).then(function(n){"success"==n.status?(Nn(n.data.token),t(n.data.user)):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},this.auth.login=function(n){return new Promise(function(t,e){fetch(u+"auth/login/",{method:"POST",headers:N,body:JSON.stringify(n)}).then(_n).then(function(n){"success"==n.status?(Nn(n.data.token),t({user:n.data.user,token:n.data.token,mfa:void 0!==n.data.mfa?n.data.mfa:null})):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},this.auth.logout=function(){return new Promise(function(t,e){var n=kn();n?N.Authorization="Token "+n:delete N.Authorization,fetch(u+"auth/logout/",{method:"POST",headers:N}).then(_n).then(function(n){"success"==n.status?(An(),t({})):"error"==n.status&&(n.data?e(n.data):e({status:n.status_code,message:n.message}))})})},this.auth.logoutAll=function(){return new Promise(function(t,e){var n=kn();n?N.Authorization="Token "+n:delete N.Authorization,fetch(u+"auth/logout/all/",{method:"POST",headers:N}).then(_n).then(function(n){"success"==n.status?(An(),t({})):"error"==n.status&&(n.data?e({status:n.status_code,message:n.message,data:n.data}):e({status:n.status_code,message:n.message}))})})},this.auth.password.change=function(n){return new Promise(function(t,e){Cn("auth/password/change/",n).then(function(n){t(n)},function(n){e(n)})})},this.auth.password.reset=function(n){return new Promise(function(t,e){Cn("auth/password/reset/",n,!0).then(function(n){t(n)},function(n){e(n)})})},this.auth.password.resetConfirm=function(n){return new Promise(function(t,e){Cn("auth/password/reset/confirm/",n,!0).then(function(n){t(n)},function(n){e(n)})})},this.auth.email.resendEmailVerification=function(n){return new Promise(function(t,e){Cn("auth/email/verify/resend/",n,!0).then(function(n){t(n)},function(n){e(n)})})},this.auth.mobile.resendMobileVerification=function(n){return new Promise(function(t,e){Cn("auth/mobile/verify/resend/",n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mobile.verify=function(n){return new Promise(function(t,e){Cn("auth/mobile/verify/",n).then(function(n){t(n)},function(n){e(n)})})},this.auth.email.verify=function(n){return new Promise(function(t,e){Cn("auth/email/verify/",n).then(function(n){t(n)},function(n){e(n)})})},this.auth.tokens.get=function(n){var i;return i=n?r+n:r,new Promise(function(t,e){Sn(i).then(function(n){t(n)},function(n){e(n)})})},this.auth.tokens.create=function(n){return new Promise(function(t,e){Cn(r,n).then(function(n){t(n)},function(n){e(n)})})},this.auth.tokens.delete=function(i){return new Promise(function(t,e){var n;i?n=r+i:e({status:"error",message:"A token is required"}),Rn(n,{}).then(function(n){t(n)},function(n){e(n)})})},this.auth.tokens.verify=function(n){return new Promise(function(t,e){Sn("auth/",n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.status.get=function(){return new Promise(function(t,e){Sn("auth/mfa/").then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.sms.get=function(){return new Promise(function(t,e){Sn(s).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.sms.enable=function(n){return new Promise(function(t,e){Cn(s,n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.sms.send=function(n){return new Promise(function(t,e){Cn("auth/mfa/sms/send/",n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.sms.disable=function(n){return new Promise(function(t,e){Rn(s,n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.token.get=function(){return new Promise(function(t,e){Sn(o).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.token.enable=function(n){return new Promise(function(t,e){Cn(o,n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.token.disable=function(){return new Promise(function(t,e){Rn(o).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.verify=function(n){return new Promise(function(t,e){Cn("auth/mfa/verify/",n).then(function(n){t(n)},function(n){e(n)})})},this.transactions.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?g+s.id+"/":s&&s.filters?(i="?"+yn(s.filters),g+i):g,Sn(n).then(function(n){xn(n,"Transaction"),t(n)},function(n){e(n)})})},this.transactions.getNext=function(){return new Promise(function(t,e){var n,i=Pn.Transaction;i?(n=i.split(u)[1],Sn(n).then(function(n){xn(n,"Transaction"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.transactions.getPrevious=function(){return new Promise(function(t,e){var n,i=bn.Transaction;i?(n=i.split(u)[1],Sn(n).then(function(n){xn(n,"Transaction"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.transactions.totals.get=function(n){return new Promise(function(t,e){n=n?"?"+yn(n):"",Sn(g+"totals/"+n).then(function(n){t(n)},function(n){e(n)})})},this.transactions.createDebit=function(n){return new Promise(function(t,e){Cn("transactions/debit/",n).then(function(n){t(n)},function(n){e(n)})})},this.transactions.createCredit=function(n){return new Promise(function(t,e){Cn("transactions/credit/",n).then(function(n){t(n)},function(n){e(n)})})},this.transactions.createTransfer=function(n){return new Promise(function(t,e){Cn("transactions/transfer/",n).then(function(n){t(n)},function(n){e(n)})})},this.transaction_collections.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?p+s.id+"/":s&&s.filters?(i="?"+yn(s.filters),p+i):p,Sn(n).then(function(n){xn(n,"Transaction Collection"),t(n)},function(n){e(n)})})},this.transaction_collections.getNext=function(){return new Promise(function(t,e){var n,i=Pn["Transaction Collection"];i?(n=i.split(u)[1],Sn(n).then(function(n){xn(n,"Transaction Collection"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.transaction_collections.getPrevious=function(){return new Promise(function(t,e){var n,i=bn["Transaction Collection"];i?(n=i.split(u)[1],Sn(n).then(function(n){xn(n,"Transaction Collection"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.transaction_collections.create=function(n){return new Promise(function(t,e){Cn(p,n).then(function(n){t(n)},function(n){e(n)})})},this.accounts.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.reference?w+s.reference+"/":s&&s.filters?(i="?"+yn(s.filters),w+i):w,Sn(n).then(function(n){xn(n,"Account"),t(n)},function(n){e(n)})})},this.accounts.getNext=function(){return new Promise(function(t,e){var n,i=Pn.Account;i?(n=i.split(u)[1],Sn(n).then(function(n){xn(n,"Account"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.accounts.getPrevious=function(){return new Promise(function(t,e){var n,i=bn.Account;i?(n=i.split(u)[1],Sn(n).then(function(n){xn(n,"Account"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.accounts.create=function(n){return new Promise(function(t,e){Cn(w,n).then(function(n){t(n)},function(n){e(n)})})},this.accounts.currencies.get=function(s,o){return new Promise(function(t,e){var n,i;s&&"string"==typeof s?(n=o&&o.code?w+s+v+o.code+"/":o&&o.filters?(i="?"+yn(o.filters),w+s+v+i):w+s+v,Sn(n).then(function(n){xn(n,"AccountCurrencies"),t(n)},function(n){e(n)})):e({status:"error",message:"Reference is required"})})},this.accounts.currencies.getNext=function(){return new Promise(function(t,e){var n,i=Pn.AccountCurrencies;i?(n=i.split(u)[1],Sn(n).then(function(n){xn(n,"AccountCurrencies"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.accounts.currencies.getPrevious=function(){return new Promise(function(t,e){var n,i=bn.AccountCurrencies;i?(n=i.split(u)[1],Sn(n).then(function(n){xn(n,"AccountCurrencies"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.accounts.currencies.update=function(n,i,s){return new Promise(function(t,e){n&&"string"==typeof n?i&&"string"==typeof i?En(w+n+v+i+"/",s).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Currency Code is required"}):e({status:"error",message:"Reference is required"})})},this.company.get=function(){return new Promise(function(t,e){Sn("company/").then(function(n){t(n)},function(n){e(n)})})},this.company.currencies.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.code?P+s.code+"/":s&&s.filters?(i="?"+yn(s.filters),P+i):P,Sn(n).then(function(n){xn(n,"CompanyCurrencies"),t(n)},function(n){e(n)})})},this.company.currencies.getNext=function(){return new Promise(function(t,e){var n,i=Pn.CompanyCurrencies;i?(n=i.split(u)[1],Sn(n).then(function(n){xn(n,"CompanyCurrencies"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.company.currencies.getPrevious=function(){return new Promise(function(t,e){var n,i=bn.CompanyCurrencies;i?(n=i.split(u)[1],Sn(n).then(function(n){xn(n,"CompanyCurrencies"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.company.bankAccounts.get=function(){return new Promise(function(t,e){Sn("company/bank-accounts/").then(function(n){t(n)},function(n){e(n)})})},this.permissions.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?b+s.id+"/":s&&s.filters?(i="?"+yn(s.filters),b+i):b,Sn(n).then(function(n){xn(n,"Permissions"),t(n)},function(n){e(n)})})},this.permissions.getNext=function(){return new Promise(function(t,e){var n,i=Pn.Permissions;i?(n=i.split(u)[1],Sn(n).then(function(n){xn(n,"Permissions"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.permissions.getPrevious=function(){return new Promise(function(t,e){var n,i=bn.Permissions;i?(n=i.split(u)[1],Sn(n).then(function(n){xn(n,"Permissions"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.groups.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.name?y+s.name+"/":s&&s.filters?(i="?"+yn(s.filters),y+i):y,Sn(n).then(function(n){xn(n,"Groups"),t(n)},function(n){e(n)})})},this.groups.getNext=function(){return new Promise(function(t,e){var n,i=Pn.Groups;i?(n=i.split(u)[1],Sn(n).then(function(n){xn(n,"Groups"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.groups.getPrevious=function(){return new Promise(function(t,e){var n,i=bn.Groups;i?(n=i.split(u)[1],Sn(n).then(function(n){xn(n,"CompanyCurrencies"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.user.get=function(){return new Promise(function(t,e){Sn("user/").then(function(n){t(n)},function(n){e(n)})})},this.user.update=function(n){return new Promise(function(t,e){En("user/",n).then(function(n){t(n)},function(n){e(n)})})},this.user.addresses.get=function(n){return new Promise(function(t,e){Sn(n?c+n:c).then(function(n){t(n)},function(n){e(n)})})},this.user.addresses.update=function(i){return new Promise(function(t,e){var n;i.id?n=c+i.id+"/":e({status:400,message:"No id has been given"}),En(n,i).then(function(n){t(n)},function(n){e(n)})})},this.user.addresses.create=function(n){return new Promise(function(t,e){Cn(c,n).then(function(n){t(n)},function(n){e(n)})})},this.user.addresses.delete=function(n){return new Promise(function(t,e){n?Rn(c+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.user.bankAccounts.get=function(n){return new Promise(function(t,e){Sn(n?a+n+"/":a).then(function(n){t(n)},function(n){e(n)})})},this.user.bankAccounts.create=function(n){return new Promise(function(t,e){Cn(a,n).then(function(n){t(n)},function(n){e(n)})})},this.user.bankAccounts.update=function(n,i){return new Promise(function(t,e){n?En(a+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Account id is required"})})},this.user.bankAccounts.delete=function(n){return new Promise(function(t,e){n?Rn(a+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Bank id is required"})})},this.user.cryptoAccounts.get=function(n){return new Promise(function(t,e){Sn(n?f+n+"/":f).then(function(n){t(n)},function(n){e(n)})})},this.user.cryptoAccounts.create=function(n){return new Promise(function(t,e){Cn(f,n).then(function(n){t(n)},function(n){e(n)})})},this.user.cryptoAccounts.update=function(n,i){return new Promise(function(t,e){n?En(f+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Crypto account id is required"})})},this.user.cryptoAccounts.delete=function(n){return new Promise(function(t,e){n?Rn(f+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Crypto account id is required"})})},this.user.documents.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?m+s.id+"/":s&&s.filters?(i="?"+yn(s.filters),m+i):m,Sn(n).then(function(n){xn(n,"Documents"),t(n)},function(n){e(n)})})},this.user.documents.getNext=function(){return new Promise(function(t,e){var n,i=Pn.Documents;i?(n=i.split(u)[1],Sn(n).then(function(n){xn(n,"Documents"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.user.documents.getPrevious=function(){return new Promise(function(t,e){var n,i=bn.Documents;i?(n=i.split(u)[1],Sn(n).then(function(n){xn(n,"Documents"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.user.documents.create=function(s){return new Promise(function(t,e){var n=kn(),i={};n?i.Authorization="Token "+n:delete i.Authorization,fetch(u+m,{method:"POST",headers:i,body:s}).then(_n).then(function(n){"success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):t(n):"error"==n.status&&(n.data?e(n.data):e({status:n.status_code,message:n.message}))})})},this.user.emails.get=function(n){return new Promise(function(t,e){Sn(n?d+n+"/":d).then(function(n){t(n)},function(n){e(n)})})},this.user.emails.create=function(n){return new Promise(function(t,e){Cn(d,n).then(function(n){t(n)},function(n){e(n)})})},this.user.emails.update=function(n,i){return new Promise(function(t,e){n&&i?En(d+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Email address id is required"},null)})},this.user.emails.delete=function(n){return new Promise(function(t,e){n?Rn(d+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Email address id is required"})})},this.user.mobiles.get=function(n){return new Promise(function(t,e){Sn(n?h+n+"/":h).then(function(n){t(n)},function(n){e(n)})})},this.user.mobiles.create=function(n){return new Promise(function(t,e){Cn(h,n).then(function(n){t(n)},function(n){e(n)})})},this.user.mobiles.update=function(n,i){return new Promise(function(t,e){n&&i?En(h+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Mobile number id is required"})})},this.user.mobiles.delete=function(n){return new Promise(function(t,e){n?Rn(h+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Mobile number id is required"})})},this.user.legalTerms.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?l+s.id+"/":s&&s.filters?(i="?"+yn(s.filters),l+i):l,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.user.legalTerms.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.user.legalTerms.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.user.legalTerms.versions.get=function(i,s){return new Promise(function(t,e){if(i){var n=l+i+"/versions/";s&&s.id?n+=s.id+"/":s&&s.filters&&(filters="?"+yn(s.filters),n+=filters),Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})}else e({status:400,message:"No term ID has been given"})})},this.user.legalTerms.versions.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){n.next&&Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.user.legalTerms.versions.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.user.legalTerms.versions.update=function(n,i,s){return new Promise(function(t,e){n?i?En(l+n+"/versions/"+i+"/",s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No version ID has been given"}):e({status:400,message:"No term ID has been given"})})},this.admin.auth.login=function(n){return new Promise(function(t,e){Cn("admin/auth/login/",n).then(function(n){t(n)},function(n){e(n)})})},this.admin.auth.register=function(n){return new Promise(function(t,e){Cn("admin/auth/register/",n).then(function(n){t(n)},function(n){e(n)})})},this.admin.metrics.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?pn+s.id+"/":s&&s.filters?(i="?"+yn(s.filters),pn+i):pn,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.metrics.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.metrics.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.metrics.create=function(n){return new Promise(function(t,e){Cn(pn,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.metrics.delete=function(n){return new Promise(function(t,e){n?Rn(pn+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.metrics.points.get=function(i,s){return new Promise(function(t,e){var n;i?(n=pn+i+"/points/",s.filters&&(n+="?"+yn(s.filters)),Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"No id has been given"})})},this.admin.metrics.points.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.metrics.points.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.exports.sets.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?B+s.id+"/":s&&s.filters?(i="?"+yn(s.filters),B+i):B,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.exports.sets.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.exports.sets.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.exports.sets.create=function(n){return new Promise(function(t,e){Cn(B,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.exports.sets.delete=function(n){return new Promise(function(t,e){n?Rn(B+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.accessControlRules.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?A+s.id+"/":s&&s.filters?(i="?"+yn(s.filters),A+i):A,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.accessControlRules.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.accessControlRules.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.accessControlRules.create=function(n){return new Promise(function(t,e){n?Cn(A,n).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No data has been given"})})},this.admin.accessControlRules.update=function(n,i){return new Promise(function(t,e){n?En(A+n,i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.accessControlRules.delete=function(n){return new Promise(function(t,e){n?Rn(A+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.overview.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.filters?(i="?"+yn(s.filters),T+i):T,Sn(n).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.settings.get=function(n){return new Promise(function(t,e){n?Sn(k+n+_).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.settings.update=function(n,i){return new Promise(function(t,e){n?En(k+n+_,i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.kyc.get=function(n){return new Promise(function(t,e){n?Sn(k+n+"/kyc/").then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.kyc.update=function(n,i){return new Promise(function(t,e){n?En(k+n+"/kyc/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?k+s.id+"/":s&&s.filters?(i="?"+yn(s.filters),k+i):k,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.users.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.create=function(i){return new Promise(function(t,e){var n=kn();n?N.Authorization="Token "+n:delete N.Authorization,!isNode&&i instanceof FormData?delete N["Content-Type"]:i=JSON.stringify(i),fetch(u+k,{method:"POST",headers:N,body:i}).then(_n).then(function(n){N["Content-Type"]="application/json","success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):t(n):"error"==n.status&&(n.data?e(n.data):e({status:n.status_code,message:n.message}))})})},this.admin.users.update=function(s,o){return new Promise(function(t,e){if(s){var n=kn(),i={};n?i.Authorization="Token "+n:delete i.Authorization,fetch(u+k+s+"/",{method:"PATCH",headers:i,body:o}).then(_n).then(function(n){"success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):t(n):"error"==n.status&&(n.data?e(n.data):e({status:n.status_code,message:n.message}))})}else e({status:400,message:"No id has been given"})})},this.admin.users.delete=function(n){return new Promise(function(t,e){n?Rn(k+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.permissions.get=function(s,o){return new Promise(function(t,e){var n,i;s?(n=o&&o.id?k+s+x+o.id+"/":o&&o.filters?(i="?"+yn(o.filters),k+s+x+i):k+s+x,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"No id has been given"})})},this.admin.users.permissions.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.permissions.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.permissions.create=function(n,i){return new Promise(function(t,e){Cn(k+n+x,i).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.permissions.delete=function(n,i){return new Promise(function(t,e){Rn(k+n+x+i+"/",{}).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.groups.get=function(s,o){return new Promise(function(t,e){var n,i;s?(n=o&&o.name?k+s+C+o.name+"/":o&&o.filters?(i="?"+yn(o.filters),k+s+C+i):k+s+C,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"No id has been given"})})},this.admin.users.groups.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.groups.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.groups.create=function(n,i){return new Promise(function(t,e){Cn(k+n+C,i).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.groups.delete=function(n,i){return new Promise(function(t,e){Rn(k+n+C+i+"/",{}).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.addresses.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?S+s.id+"/":s&&s.filters?(i="?"+yn(s.filters),S+i):S,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.users.addresses.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.addresses.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.addresses.create=function(n){return new Promise(function(t,e){Cn(S,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.addresses.update=function(n,i){return new Promise(function(t,e){n?En(S+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.addresses.delete=function(n){return new Promise(function(t,e){n?Rn(S+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.bankAccounts.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?E+s.id+"/":s&&s.filters?(i="?"+yn(s.filters),E+i):E,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.users.bankAccounts.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.bankAccounts.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.bankAccounts.create=function(n){return new Promise(function(t,e){Cn(E,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.bankAccounts.update=function(n,i){return new Promise(function(t,e){n?En(E+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.bankAccounts.delete=function(n){return new Promise(function(t,e){n?Rn(E+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.bankAccounts.currencies.get=function(s,o){return new Promise(function(t,e){var n,i;n=o&&o.code?E+s+"/currencies/"+o.code+"/":o&&o.filters?(i="?"+yn(o.filters),E+s+"/currencies/"+i):E+s+"/currencies/",Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.users.bankAccounts.currencies.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.bankAccounts.currencies.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.bankAccounts.currencies.create=function(n,i){return new Promise(function(t,e){n?Cn(E+n+"/currencies/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.bankAccounts.currencies.update=function(n,i,s){return new Promise(function(t,e){n?i?En(E+n+"/currencies/"+i+"/",s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No currency code has been given"}):e({status:400,message:"No id has been given"})})},this.admin.users.bankAccounts.currencies.delete=function(n,i){return new Promise(function(t,e){n?i?Rn(E+n+"/currencies/"+i+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No currency code has been given"}):e({status:400,message:"No id has been given"})})},this.admin.users.cryptoAccounts.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?R+s.id+"/":s&&s.filters?(i="?"+yn(s.filters),R+i):R,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.users.cryptoAccounts.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.cryptoAccounts.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.cryptoAccounts.create=function(n){return new Promise(function(t,e){Cn(R,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.cryptoAccounts.update=function(n,i){return new Promise(function(t,e){n?En(R+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.cryptoAccounts.delete=function(n){return new Promise(function(t,e){n?Rn(R+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.documents.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?j+s.id+"/":s&&s.filters?(i="?"+yn(s.filters),j+i):j,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.users.documents.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.documents.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.documents.create=function(s){return new Promise(function(t,e){var n=kn(),i={};n?i.Authorization="Token "+n:delete i.Authorization,fetch(u+j,{method:"POST",headers:i,body:s}).then(_n).then(function(n){"success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):t(n):"error"==n.status&&(n.data?e(n.data):e({status:n.status_code,message:n.message}))})})},this.admin.users.documents.update=function(s,o){return new Promise(function(t,e){if(s){var n=kn(),i={};n?i.Authorization="Token "+n:delete i.Authorization,fetch(u+j+s+"/",{method:"PATCH",headers:i,body:o}).then(_n).then(function(n){"success"==n.status?n.data&&n.data.data?t(n.data.data):n.data?t(n.data):t(n):"error"==n.status&&(n.data?e(n.data):e({status:n.status_code,message:n.message}))})}else e({status:400,message:"No id has been given"})})},this.admin.users.documents.delete=function(n){return new Promise(function(t,e){n?Rn(j+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.emails.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?q+s.id+"/":s&&s.filters?(i="?"+yn(s.filters),q+i):q,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.users.emails.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.emails.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.emails.create=function(n){return new Promise(function(t,e){Cn(q,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.emails.update=function(n,i){return new Promise(function(t,e){n?En(q+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.emails.delete=function(n){return new Promise(function(t,e){n?Rn(q+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.mobiles.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?I+s.id+"/":s&&s.filters?(i="?"+yn(s.filters),I+i):I,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.users.mobiles.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.mobiles.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.users.mobiles.create=function(n){return new Promise(function(t,e){Cn(I,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.mobiles.update=function(n,i){return new Promise(function(t,e){n?En(I+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.mobiles.delete=function(n){return new Promise(function(t,e){n?Rn(I+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.mfa.get=function(n){return new Promise(function(t,e){n?Sn(k+n+"/mfa/").then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.mfa.sms.delete=function(n){return new Promise(function(t,e){n?Rn(k+n+"/mfa/sms/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.users.mfa.token.delete=function(n){return new Promise(function(t,e){n?Rn(k+n+"/mfa/token/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.transactions.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?O+s.id+"/":s&&s.filters?(i="?"+yn(s.filters),O+i):O,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.transactions.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.transactions.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.transactions.totals.get=function(i){return new Promise(function(t,e){var n;n=i?"?"+yn(i.filters):"",Sn("admin/transactions/totals/"+n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.transactions.update=function(n,i){return new Promise(function(t,e){n?En(O+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.transactions.createCredit=function(n){return new Promise(function(t,e){Cn("admin/transactions/credit/",n).then(function(n){t(n)},function(n){e(n)})})},this.admin.transactions.createDebit=function(n){return new Promise(function(t,e){Cn("admin/transactions/debit/",n).then(function(n){t(n)},function(n){e(n)})})},this.admin.transactions.createTransfer=function(n){return new Promise(function(t,e){Cn("admin/transactions/transfer/",n).then(function(n){t(n)},function(n){e(n)})})},this.admin.transaction_collections.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?U+s.id+"/":s&&s.filters?(i="?"+yn(s.filters),U+i):U,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.transaction_collections.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.transaction_collections.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.transaction_collections.create=function(n){return new Promise(function(t,e){Cn(U,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.transaction_collections.update=function(n,i){return new Promise(function(t,e){n?En(U+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference has been given"})})},this.admin.transaction_collections.delete=function(n){return new Promise(function(t,e){n?Rn(U+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.accounts.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.reference?D+s.reference+"/":s&&s.filters?(i="?"+yn(s.filters),D+i):D,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.accounts.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.accounts.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.account.definitions.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.name?H+s.name+"/":s&&s.filters?(i="?"+yn(s.filters),H+i):H,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.account.definitions.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.account.definitions.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.account.definitions.create=function(n){return new Promise(function(t,e){Cn(H,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.account.definitions.update=function(n,i){return new Promise(function(t,e){n?En(H+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.delete=function(n){return new Promise(function(t,e){n?Rn(H+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.groups.get=function(s,o){return new Promise(function(t,e){var n,i;s?(n=o&&o.name?H+s+"/groups/"+o.name+"/":o&&o.filters?(i="?"+yn(o.filters),H+s+"/groups/"+i):H+s+"/groups/",Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.groups.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.account.definitions.groups.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.account.definitions.groups.create=function(n,i){return new Promise(function(t,e){n?Cn(H+n+"/groups/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.groups.update=function(n,i,s){return new Promise(function(t,e){n?i?En(H+n+"/groups/"+i+"/",s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"}):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.groups.delete=function(n,i){return new Promise(function(t,e){n?i?Rn(H+n+"/groups/"+i+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"}):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.groups.currencies.get=function(s,o,u){return new Promise(function(t,e){var n,i;s?o?(n=u&&u.code?H+s+"/groups/"+o+"/currencies/"+u.code+"/":u&&u.filters?(i="?"+yn(u.filters),H+s+"/groups/"+o+"/currencies/"+i):H+s+"/groups/"+o+"/currencies/",Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"No group name has been given"}):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.groups.currencies.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.account.definitions.groups.currencies.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.account.definitions.groups.currencies.create=function(n,i,s){return new Promise(function(t,e){n?i?Cn(H+n+"/groups/"+i+"/currencies/",s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"}):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.groups.currencies.update=function(n,i,s,o){return new Promise(function(t,e){n?i?s?En(H+n+"/groups/"+i+"/currencies/"+s+"/",o).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No currency code has been given"}):e({status:400,message:"No group name has been given"}):e({status:400,message:"No account name has been given"})})},this.admin.account.definitions.groups.currencies.delete=function(n,i,s){return new Promise(function(t,e){n?i?s?Rn(H+n+"/groups/"+i+"/currencies/"+s+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No currency code has been given"}):e({status:400,message:"No group name has been given"}):e({status:400,message:"No account name has been given"})})},this.admin.account.currencies.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.reference?G+s.reference+"/":s&&s.filters?(i="?"+yn(s.filters),G+i):G,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.account.currencies.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.account.currencies.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.accounts.create=function(n){return new Promise(function(t,e){Cn(D,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.accounts.update=function(n,i){return new Promise(function(t,e){n?En(D+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference has been given"})})},this.admin.accounts.currencies.get=function(s,o){return new Promise(function(t,e){var n,i;s?(n=o&&o.code?D+s+F+o.code+"/":o&&o.filters?(i="?"+yn(o.filters),D+s+F+i):D+s+F,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"No reference has been given"})})},this.admin.accounts.currencies.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.accounts.currencies.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.accounts.currencies.create=function(n,i){return new Promise(function(t,e){Cn(D+n+F,i).then(function(n){t(n)},function(n){e(n)})})},this.admin.accounts.currencies.update=function(n,i,s){return new Promise(function(t,e){n&&i?En(D+n+F+i+"/",s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference or code has been given"})})},this.admin.accounts.currencies.limits.get=function(i,s,o){return new Promise(function(t,e){var n;i&&s?(n=o&&o.id?D+i+F+s+z+o.id+"/":D+i+F+s+z,Sn(n).then(function(n){t(n)},function(n){e(n)})):e({status:400,message:"No reference or code has been given"})})},this.admin.accounts.currencies.limits.create=function(n,i,s){return new Promise(function(t,e){Cn(D+n+F+i+z,s).then(function(n){t(n)},function(n){e(n)})})},this.admin.accounts.currencies.limits.update=function(n,i,s,o){return new Promise(function(t,e){n&&i&&s?En(D+n+F+i+z+s+"/",o).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference or code or id has been given"})})},this.admin.accounts.currencies.limits.delete=function(n,i,s){return new Promise(function(t,e){n&&i&&s?Rn(D+n+F+i+z+s+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference or code or id has been given"})})},this.admin.accounts.currencies.fees.get=function(i,s,o){return new Promise(function(t,e){var n;i&&s?(n=o&&o.id?D+i+F+s+L+o.id+"/":D+i+F+s+L,Sn(n).then(function(n){t(n)},function(n){e(n)})):e({status:400,message:"No reference or code has been given"})})},this.admin.accounts.currencies.fees.create=function(n,i,s){return new Promise(function(t,e){Cn(D+n+F+i+L,s).then(function(n){t(n)},function(n){e(n)})})},this.admin.accounts.currencies.fees.update=function(n,i,s,o){return new Promise(function(t,e){n&&i&&s?En(D+n+F+i+L+s+"/",o).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference or code or id has been given"})})},this.admin.accounts.currencies.fees.delete=function(n,i,s){return new Promise(function(t,e){n&&i&&s?Rn(D+n+F+i+L+s+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference or code or id has been given"})})},this.admin.accounts.currencies.settings.get=function(n,i){return new Promise(function(t,e){n&&i?Sn(D+n+F+i+M).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference or code has been given"})})},this.admin.accounts.currencies.settings.update=function(n,i,s){return new Promise(function(t,e){n&&i?En(D+n+F+i+M,s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No reference or code has been given"})})},this.admin.currencies.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.code?J+s.code+"/":s&&s.filters?(i="?"+yn(s.filters),J+i):J,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.currencies.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.currencies.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.currencies.create=function(n){return new Promise(function(t,e){Cn(J,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.currencies.update=function(n,i){return new Promise(function(t,e){if(!n)return currencies.update,void e({status:400,message:"No code has been given"});En(J+n+"/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.currencies.delete=function(n){return new Promise(function(t,e){n?Rn(J+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No code has been given"})})},this.admin.currencies.overview.get=function(n){return new Promise(function(t,e){n||e({status:400,message:"No code provided"}),Sn(J+n+"/overview/").then(function(n){t(n)},function(n){e(n)})})},this.admin.currencies.bankAccounts.get=function(s,o){return new Promise(function(t,e){var n,i;n=o&&o.id?J+s+V+o.id+"/":o&&o.filters?(i="?"+yn(o.filters),J+s+V+i):J+s+V,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.currencies.bankAccounts.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.currencies.bankAccounts.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.currencies.bankAccounts.create=function(n,i){return new Promise(function(t,e){Cn(J+n+V,i).then(function(n){t(n)},function(n){e(n)})})},this.admin.currencies.bankAccounts.delete=function(n,i){return new Promise(function(t,e){Rn(J+n+V+i+"/").then(function(n){t(n)},function(n){e(n)})})},this.admin.company.get=function(){return new Promise(function(t,e){Sn(X).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.update=function(n){return new Promise(function(t,e){En(X,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.settings.get=function(){return new Promise(function(t,e){Sn(X+W).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.settings.update=function(n){return new Promise(function(t,e){En(X+W,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.address.get=function(){return new Promise(function(t,e){Sn(X+$).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.address.update=function(n){return new Promise(function(t,e){En(X+$,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.links.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?K+s.id+"/":s&&s.filters?(i="?"+yn(s.filters),K+i):K,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.company.links.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.company.links.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.company.links.create=function(n){return new Promise(function(t,e){Cn(K,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.links.update=function(n,i){return new Promise(function(t,e){n?En(K+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.company.links.delete=function(n){return new Promise(function(t,e){n?Rn(K+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.bankAccounts.get=function(n){var i;return i=n&&n.id?un+n.id+"/":un,new Promise(function(t,e){Sn(i).then(function(n){t(n)},function(n){e(n)})})},this.admin.bankAccounts.create=function(n){return new Promise(function(t,e){Cn(un,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.bankAccounts.update=function(n,i){return new Promise(function(t,e){En(un+n+"/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.bankAccounts.delete=function(n){return new Promise(function(t,e){Rn(un+n+"/",{}).then(function(n){t(n)},function(n){e(n)})})},this.admin.bankAccounts.currencies.get=function(i,s){return new Promise(function(t,e){if(i){var n=un+i+"/currencies/";s&&(n+=s),Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})}else e({status:400,message:"No bank ID has been given"})})},this.admin.bankAccounts.currencies.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){n.next&&Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.bankAccounts.currencies.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.bankAccounts.currencies.create=function(n,i){if(i.currency)return new Promise(function(t,e){Cn(un+n+"/currencies/",i).then(function(n){t(n)},function(n){e(n)})});reject({status:400,message:"No currency has been given"})},this.admin.bankAccounts.currencies.delete=function(n,i){if(n){if(i)return new Promise(function(t,e){Rn(un+n+"/currencies/"+i,{}).then(function(n){t(n)},function(n){e(n)})});reject({status:400,message:"No currency has been given"})}else reject({status:400,message:"No bank ID has been given"})},this.admin.webhooks.get=function(n){var i,t;return i=n&&n.id?Q+n.id+"/":n&&n.filters?(t="?"+yn(n.filters),Q+t):Q,new Promise(function(t,e){Sn(i).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.webhooks.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.webhooks.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.webhooks.create=function(n){return new Promise(function(t,e){Cn(Q,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.webhooks.update=function(n,i){return new Promise(function(t,e){En(Q+n+"/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.webhooks.delete=function(n){return new Promise(function(t,e){Rn(Q+n+"/",{}).then(function(n){t(n)},function(n){e(n)})})},this.admin.webhookTasks.get=function(n){var i,t;return i=n&&n.id?Y+n.id+"/":n&&n.filters?(t="?"+yn(n.filters),Y+t):Y,n&&n.id?new Promise(function(t,e){var n=kn();n?N.Authorization="Token "+n:delete N.Authorization,fetch(u+i,{method:"GET",headers:N}).then(_n).then(function(n){"success"==n.status?n.data&&t(n.data):"error"==n.status&&(n.data?e(n.data):e({status:n.status_code,message:n.message}))})}):new Promise(function(t,e){Sn(i).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.webhookTasks.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.webhookTasks.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.webhookTasks.requests.get=function(n,t){var i,e;return i=t&&t.id?Y+n+Z+t.id+"/":t&&t.filters?(e="?"+yn(t.filters),Y+n+Z+e):Y,new Promise(function(t,e){Sn(i).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.webhookTasks.requests.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.webhookTasks.requests.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.subtypes.get=function(n){var i;return i=n&&n.id?nn+n.id+"/":n&&n.filters?(filters="?"+yn(n.filters),nn+filters):nn,new Promise(function(t,e){Sn(i).then(function(n){t(n)},function(n){e(n)})})},this.admin.subtypes.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.subtypes.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.subtypes.create=function(n){return new Promise(function(t,e){Cn(nn,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.subtypes.update=function(n,i){return new Promise(function(t,e){En(nn+n+"/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.subtypes.delete=function(n){return new Promise(function(t,e){Rn(nn+n+"/",{}).then(function(n){t(n)},function(n){e(n)})})},this.admin.notifications.get=function(n){var i;return i=n&&n.id?tn+n.id+"/":tn,new Promise(function(t,e){Sn(i).then(function(n){t(n)},function(n){e(n)})})},this.admin.notifications.update=function(n,i){return new Promise(function(t,e){En(tn+n+"/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.services.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?rn+s.id+"/":s&&s.filters?(i="?"+yn(s.filters),rn+i):rn,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.services.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.services.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.services.update=function(n,i){return new Promise(function(t,e){En(rn+n+"/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.services.create=function(n){return new Promise(function(t,e){Cn(rn,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.services.delete=function(n){return new Promise(function(t,e){n?Rn(rn+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No id has been given"})})},this.admin.requests.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?an+s.id+"/":s&&s.filters?(i="?"+yn(s.filters),an+i):an,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.requests.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){n.next&&Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.requests.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.name?cn+s.name+"/":s&&s.filters?(i="?"+yn(s.filters),cn+i):cn,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.groups.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.create=function(n){return new Promise(function(t,e){Cn(cn,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.groups.update=function(n,i){return new Promise(function(t,e){n?En(cn+n+"/",i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})},this.admin.groups.delete=function(n){return new Promise(function(t,e){n?Rn(cn+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})},this.admin.groups.permissions.get=function(s,o){return new Promise(function(t,e){var n,i;n=o&&o.id?cn+s+fn+o.id+"/":o&&o.filters?(i="?"+yn(o.filters),cn+s+fn+i):cn+s+fn,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.groups.permissions.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.permissions.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.permissions.create=function(n,i){return new Promise(function(t,e){n?Cn(cn+n+fn,i).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})},this.admin.groups.permissions.delete=function(n,i){return new Promise(function(t,e){n&&i?Rn(cn+n+fn+i+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name or permission id has been given"})})},this.admin.groups.settings.get=function(n){return new Promise(function(t,e){n?Sn(cn+n+mn).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})},this.admin.groups.settings.update=function(n,i){if(n)return new Promise(function(t,e){En(cn+n+mn,i).then(function(n){t(n)},function(n){e(n)})});reject({status:400,message:"No group name has been given"})},this.admin.groups.tiers.get=function(n,t){var i;return i=t&&t.id?cn+n+dn+t.id+"/":cn+n+dn,new Promise(function(t,e){Sn(i).then(function(n){t(n)},function(n){e(n)})})},this.admin.groups.tiers.create=function(n,i){return new Promise(function(t,e){Cn(cn+n+dn,i).then(function(n){t(n)},function(n){e(n)})})},this.admin.groups.tiers.update=function(n,i,s){return new Promise(function(t,e){En(cn+n+dn+i+"/",s).then(function(n){t(n)},function(n){e(n)})})},this.admin.groups.tiers.delete=function(n,i){return new Promise(function(t,e){Rn(cn+n+dn+i+"/",{}).then(function(n){t(n)},function(n){e(n)})})},this.admin.groups.tiers.requirements.get=function(i,s,o){return new Promise(function(t,e){var n;s?(n=o&&o.id?cn+i+dn+s+en+o.id+"/":cn+i+dn+s+en,Sn(n).then(function(n){t(n)},function(n){e(n)})):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.requirements.create=function(n,i,s){return new Promise(function(t,e){i?Cn(cn+n+dn+i+en,s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.requirements.update=function(n,i,s,o){return new Promise(function(t,e){i?s?En(cn+n+dn+i+en+s+"/",o).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No requirement id is provided"}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.requirements.delete=function(n,i,s){return new Promise(function(t,e){i?s?Rn(cn+n+dn+i+en+s+"/").then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No requirement id is provided"}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.fees.get=function(i,s,o){return new Promise(function(t,e){var n;s?(n=o&&o.id?cn+i+dn+s+on+o.id+"/":cn+i+dn+s+on,Sn(n).then(function(n){t(n)},function(n){e(n)})):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.fees.create=function(n,i,s){return new Promise(function(t,e){i?Cn(cn+n+dn+i+on,s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.fees.update=function(n,i,s,o){return new Promise(function(t,e){i?s?En(cn+n+dn+i+on+s+"/",o).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No fee id is provided"}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.fees.delete=function(n,i,s){return new Promise(function(t,e){i?s?Rn(cn+n+dn+i+on+s+"/").then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No fee id is provided"}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.limits.get=function(i,s,o){return new Promise(function(t,e){var n;s?(n=o&&o.id?cn+i+dn+s+sn+o.id+"/":cn+i+dn+s+sn,Sn(n).then(function(n){t(n)},function(n){e(n)})):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.limits.create=function(n,i,s){return new Promise(function(t,e){i?Cn(cn+n+dn+i+sn,s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.limits.update=function(n,i,s,o){return new Promise(function(t,e){i?s?En(cn+n+dn+i+sn+s+"/",o).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No limit id is provided"}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.limits.delete=function(n,i,s){return new Promise(function(t,e){i?s?Rn(cn+n+dn+i+sn+s+"/").then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No limit id is provided"}):e({status:400,message:"No tier id is provided"})})},this.admin.groups.tiers.settings.get=function(n,i){return new Promise(function(t,e){n?Sn(cn+n+dn+i+gn).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})},this.admin.groups.tiers.settings.update=function(n,i,s){if(n)return new Promise(function(t,e){En(cn+n+dn+i+gn,s).then(function(n){t(n)},function(n){e(n)})});reject({status:400,message:"No group name has been given"})},this.admin.groups.accountConfigurations.get=function(s,o){return new Promise(function(t,e){var n,i;n=o&&o.name?cn+s+hn+o.name+"/":o&&o.filters?(i="?"+yn(o.filters),cn+s+hn+i):cn+s+hn,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.groups.accountConfigurations.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.accountConfigurations.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.accountConfigurations.create=function(n,i){return new Promise(function(t,e){Cn(cn+n+hn,i).then(function(n){t(n)},function(n){e(n)})})},this.admin.groups.accountConfigurations.update=function(n,i,s){return new Promise(function(t,e){n?En(cn+n+hn+i+"/",s).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})},this.admin.groups.accountConfigurations.delete=function(n,i){return new Promise(function(t,e){n?Rn(cn+n+hn+i+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})},this.admin.groups.accountConfigurations.currencies.get=function(s,o,u){return new Promise(function(t,e){var n,i;n=u&&u.code?cn+s+hn+o+ln+u.code+"/":u&&u.filters?(i="?"+yn(u.filters),cn+s+hn+o+ln+i):cn+s+hn+o+ln,Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})})},this.admin.groups.accountConfigurations.currencies.getNext=function(){return new Promise(function(t,e){var n;wn?(n=wn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.accountConfigurations.currencies.getPrevious=function(){return new Promise(function(t,e){var n;vn?(n=vn.split(u)[1],Sn(n).then(function(n){Tn(n),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.admin.groups.accountConfigurations.currencies.create=function(n,i,s){return new Promise(function(t,e){Cn(cn+n+hn+i+ln,s).then(function(n){t(n)},function(n){e(n)})})},this.admin.groups.accountConfigurations.currencies.delete=function(n,i,s){return new Promise(function(t,e){n?Rn(cn+n+hn+i+ln+s+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:400,message:"No group name has been given"})})}}"undefined"!=typeof module&&module.exports?(module.exports=Rehive,global.fetch&&!process.env.IS_BROWSER?fetch=global.fetch:(fetch=require("node-fetch"),isNode=!0)):(window.this,isNode=!1,fetch=window.fetch);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rehive",
3
- "version": "1.29.1",
3
+ "version": "1.31.1",
4
4
  "description": "Javascript sdk for rehive APIs",
5
5
  "main": "rehive.js",
6
6
  "dependencies": {
package/rehive.js CHANGED
@@ -38,7 +38,10 @@ function Rehive(config) {
38
38
  cryptoAccounts: {},
39
39
  documents: {},
40
40
  emails: {},
41
- mobiles: {}
41
+ mobiles: {},
42
+ legalTerms: {
43
+ versions: {}
44
+ }
42
45
  };
43
46
 
44
47
  this.transactions = {
@@ -112,7 +115,8 @@ function Rehive(config) {
112
115
  },
113
116
  company: {
114
117
  settings: {},
115
- address: {}
118
+ address: {},
119
+ links: {}
116
120
  },
117
121
  bankAccounts: {
118
122
  currencies: {}
@@ -173,6 +177,7 @@ function Rehive(config) {
173
177
  userCreateDocumentAPI = 'user/documents/',
174
178
  userEmailAddressesAPI = 'user/emails/',
175
179
  userMobileNumbersAPI = 'user/mobiles/',
180
+ userLegalTermsAPI = 'user/legal-terms/',
176
181
  transactionsAPI = 'transactions/',
177
182
  totalTransactionsListAPI = 'totals/',
178
183
  transactionCollectionsAPI = 'transaction-collections/',
@@ -225,6 +230,7 @@ function Rehive(config) {
225
230
  adminCurrenciesBankAccountsAPI = '/bank-accounts/',
226
231
  adminCurrenciesOverviewAPI = '/overview/',
227
232
  adminCompanyAPI = 'admin/company/',
233
+ adminCompanyLinksAPI = 'admin/company/links/',
228
234
  adminCompanySettingsAPI = 'settings/',
229
235
  adminCompanyAddressAPI = 'address/',
230
236
  adminWebhooksAPI = 'admin/webhooks/',
@@ -1883,6 +1889,149 @@ function Rehive(config) {
1883
1889
  });
1884
1890
  });
1885
1891
  };
1892
+
1893
+ this.user.legalTerms.get = function (obj) {
1894
+ return new Promise(function (resolve, reject) {
1895
+ var url,filters;
1896
+
1897
+ if(obj && obj.id) {
1898
+ url = userLegalTermsAPI + obj.id + '/';
1899
+ } else if(obj && obj.filters){
1900
+ filters = '?' + serialize(obj.filters);
1901
+ url = userLegalTermsAPI + filters;
1902
+ } else {
1903
+ url = userLegalTermsAPI;
1904
+ }
1905
+
1906
+ httpGetRehive(url).then(function (response) {
1907
+ saveFilter(response);
1908
+ resolve(response);
1909
+ }, function (error) {
1910
+ reject(error);
1911
+ });
1912
+ });
1913
+ };
1914
+
1915
+ this.user.legalTerms.getNext = function () {
1916
+ return new Promise(function (resolve, reject) {
1917
+ var url = nextFilterForLists, mainUrl;
1918
+ if (url) {
1919
+ var urlArray = url.split(baseAPI);
1920
+ mainUrl = urlArray[1];
1921
+
1922
+ httpGetRehive(mainUrl).then(function (response) {
1923
+ saveFilter(response);
1924
+ resolve(response);
1925
+ }, function (error) {
1926
+ reject(error);
1927
+ });
1928
+ } else {
1929
+ reject({ status: 400, message: 'Not allowed' });
1930
+ }
1931
+ });
1932
+ };
1933
+
1934
+ this.user.legalTerms.getPrevious = function () {
1935
+ return new Promise(function (resolve, reject) {
1936
+ var url = previousFilterForLists, mainUrl;
1937
+ if (url) {
1938
+ var urlArray = url.split(baseAPI);
1939
+ mainUrl = urlArray[1];
1940
+
1941
+ httpGetRehive(mainUrl).then(function (response) {
1942
+ saveFilter(response)
1943
+ resolve(response);
1944
+ }, function (error) {
1945
+ reject(error);
1946
+ });
1947
+ } else {
1948
+ reject({ status: 400, message: 'Not allowed' });
1949
+ }
1950
+ });
1951
+ };
1952
+
1953
+ this.user.legalTerms.versions.get = function (termId, obj) {
1954
+ return new Promise(function (resolve, reject) {
1955
+ if (!termId) {
1956
+ reject({ status: 400, message: 'No term ID has been given' });
1957
+ return;
1958
+ }
1959
+
1960
+ var url = userLegalTermsAPI + termId + '/versions/';
1961
+
1962
+ if(obj && obj.id) {
1963
+ url += obj.id + '/';
1964
+ } else if(obj && obj.filters){
1965
+ filters = '?' + serialize(obj.filters);
1966
+ url += filters;
1967
+ }
1968
+
1969
+ httpGetRehive(url).then(function (response) {
1970
+ saveFilter(response);
1971
+ resolve(response);
1972
+ }, function (error) {
1973
+ reject(error);
1974
+ });
1975
+ });
1976
+ };
1977
+
1978
+ this.user.legalTerms.versions.getNext = function () {
1979
+ return new Promise(function (resolve, reject) {
1980
+ var url = nextFilterForLists, mainUrl;
1981
+ if (url) {
1982
+ var urlArray = url.split(baseAPI);
1983
+ mainUrl = urlArray[1];
1984
+
1985
+ httpGetRehive(mainUrl).then(function (response) {
1986
+ if (response.next) {
1987
+ saveFilter(response);
1988
+ }
1989
+ resolve(response);
1990
+ }, function (error) {
1991
+ reject(error);
1992
+ });
1993
+ } else {
1994
+ reject({ status: 400, message: 'Not allowed' });
1995
+ }
1996
+ });
1997
+ };
1998
+
1999
+ this.user.legalTerms.versions.getPrevious = function () {
2000
+ return new Promise(function (resolve, reject) {
2001
+ var url = previousFilterForLists, mainUrl;
2002
+ if (url) {
2003
+ var urlArray = url.split(baseAPI);
2004
+ mainUrl = urlArray[1];
2005
+
2006
+ httpGetRehive(mainUrl).then(function (response) {
2007
+ saveFilter(response);
2008
+ resolve(response);
2009
+ }, function (error) {
2010
+ reject(error);
2011
+ });
2012
+ } else {
2013
+ reject({ status: 400, message: 'Not allowed' });
2014
+ }
2015
+ });
2016
+ };
2017
+
2018
+ this.user.legalTerms.versions.update = function (termId, versionId, data) {
2019
+ return new Promise(function (resolve, reject) {
2020
+ if (!termId) {
2021
+ reject({ status: 400, message: 'No term ID has been given' });
2022
+ return;
2023
+ } else if (!versionId) {
2024
+ reject({ status: 400, message: 'No version ID has been given' });
2025
+ return;
2026
+ }
2027
+ var url = userLegalTermsAPI + termId + '/versions/' + versionId + '/';
2028
+ httpPatchRehive(url, data).then(function (response) {
2029
+ resolve(response);
2030
+ }, function (error) {
2031
+ reject(error);
2032
+ });
2033
+ });
2034
+ };
1886
2035
  //#endregion
1887
2036
 
1888
2037
  //#region Admin methods
@@ -4692,6 +4841,106 @@ function Rehive(config) {
4692
4841
  });
4693
4842
  });
4694
4843
  };
4844
+
4845
+ this.admin.company.links.get = function (obj) {
4846
+ return new Promise(function (resolve, reject) {
4847
+ var url,filters;
4848
+
4849
+ if(obj && obj.id) {
4850
+ url = adminCompanyLinksAPI + obj.id + '/';
4851
+ } else if(obj && obj.filters){
4852
+ filters = '?' + serialize(obj.filters);
4853
+ url = adminCompanyLinksAPI + filters;
4854
+ } else {
4855
+ url = adminCompanyLinksAPI;
4856
+ }
4857
+
4858
+ httpGetRehive(url).then(function (response) {
4859
+ saveFilter(response);
4860
+ resolve(response);
4861
+ }, function (error) {
4862
+ reject(error);
4863
+ });
4864
+ });
4865
+ };
4866
+
4867
+ this.admin.company.links.getNext = function () {
4868
+ return new Promise(function (resolve, reject) {
4869
+ var url = nextFilterForLists, mainUrl;
4870
+ if (url) {
4871
+ var urlArray = url.split(baseAPI);
4872
+ mainUrl = urlArray[1];
4873
+
4874
+ httpGetRehive(mainUrl).then(function (response) {
4875
+ saveFilter(response);
4876
+ resolve(response);
4877
+ }, function (error) {
4878
+ reject(error);
4879
+ });
4880
+ } else {
4881
+ reject({ status: 400, message: 'Not allowed' });
4882
+ }
4883
+ });
4884
+ };
4885
+
4886
+ this.admin.company.links.getPrevious = function () {
4887
+ return new Promise(function (resolve, reject) {
4888
+ var url = previousFilterForLists, mainUrl;
4889
+ if (url) {
4890
+ var urlArray = url.split(baseAPI);
4891
+ mainUrl = urlArray[1];
4892
+
4893
+ httpGetRehive(mainUrl).then(function (response) {
4894
+ saveFilter(response)
4895
+ resolve(response);
4896
+ }, function (error) {
4897
+ reject(error);
4898
+ });
4899
+ } else {
4900
+ reject({ status: 400, message: 'Not allowed' });
4901
+ }
4902
+ });
4903
+ };
4904
+
4905
+ this.admin.company.links.create = function (data) {
4906
+ return new Promise(function (resolve, reject) {
4907
+ httpPostRehive(adminCompanyLinksAPI, data).then(function (response) {
4908
+ resolve(response);
4909
+ }, function (error) {
4910
+ reject(error);
4911
+ });
4912
+ });
4913
+ };
4914
+
4915
+ this.admin.company.links.update = function (id, data) {
4916
+ return new Promise(function (resolve, reject) {
4917
+ if (!id) {
4918
+ reject({ status: 400, message: 'No id has been given' });
4919
+ return;
4920
+ }
4921
+
4922
+ httpPatchRehive(adminCompanyLinksAPI + id + '/', data).then(function (response) {
4923
+ resolve(response);
4924
+ }, function (error) {
4925
+ reject(error);
4926
+ });
4927
+ });
4928
+ };
4929
+
4930
+ this.admin.company.links.delete = function (id) {
4931
+ return new Promise(function (resolve, reject) {
4932
+ if (!id) {
4933
+ reject({ status: 400, message: 'No id has been given' });
4934
+ return;
4935
+ }
4936
+
4937
+ httpDeleteRehive(adminCompanyLinksAPI + id + '/', {}).then(function (response) {
4938
+ resolve(response);
4939
+ }, function (error) {
4940
+ reject(error);
4941
+ });
4942
+ });
4943
+ };
4695
4944
  //#endregion
4696
4945
 
4697
4946
  //#region Admin Bankaccount methods
@@ -5089,6 +5338,9 @@ function Rehive(config) {
5089
5338
 
5090
5339
  if(obj && obj.id) {
5091
5340
  url = adminSubtypesAPI + obj.id + '/';
5341
+ } else if(obj && obj.filters){
5342
+ filters = '?' + serialize(obj.filters);
5343
+ url = adminSubtypesAPI + filters;
5092
5344
  } else {
5093
5345
  url = adminSubtypesAPI;
5094
5346
  }
@@ -5102,6 +5354,44 @@ function Rehive(config) {
5102
5354
  });
5103
5355
  };
5104
5356
 
5357
+ this.admin.subtypes.getNext = function () {
5358
+ return new Promise(function (resolve, reject) {
5359
+ var url = nextFilterForLists, mainUrl;
5360
+ if (url) {
5361
+ var urlArray = url.split(baseAPI);
5362
+ mainUrl = urlArray[1];
5363
+
5364
+ httpGetRehive(mainUrl).then(function (response) {
5365
+ saveFilter(response);
5366
+ resolve(response);
5367
+ }, function (error) {
5368
+ reject(error);
5369
+ });
5370
+ } else {
5371
+ reject({ status: 400, message: 'Not allowed' });
5372
+ }
5373
+ });
5374
+ };
5375
+
5376
+ this.admin.subtypes.getPrevious = function () {
5377
+ return new Promise(function (resolve, reject) {
5378
+ var url = previousFilterForLists, mainUrl;
5379
+ if (url) {
5380
+ var urlArray = url.split(baseAPI);
5381
+ mainUrl = urlArray[1];
5382
+
5383
+ httpGetRehive(mainUrl).then(function (response) {
5384
+ saveFilter(response);
5385
+ resolve(response);
5386
+ }, function (error) {
5387
+ reject(error);
5388
+ });
5389
+ } else {
5390
+ reject({ status: 400, message: 'Not allowed' });
5391
+ }
5392
+ });
5393
+ };
5394
+
5105
5395
  this.admin.subtypes.create = function (data) {
5106
5396
  return new Promise(function (resolve, reject) {
5107
5397
  httpPostRehive(adminSubtypesAPI, data).then(function (response) {