rehive 1.26.2 → 1.27.0
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.
- package/build/rehive.min.js +1 -1
- package/package.json +1 -1
- package/rehive.js +29 -0
package/build/rehive.min.js
CHANGED
|
@@ -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={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:{}}};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/";t||(t={}),u=0<Object.keys(t).length?t.customAPIURL?t.customAPIURL:(n=t.apiVersion?t.apiVersion:"3",t.apiToken&&Pn(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,ln,gn,pn={},wn={};function vn(n){var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push(encodeURIComponent(e)+"="+encodeURIComponent(n[e]));return t.join("&")}function Pn(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 bn(){return t&&"local"===t.storageMethod?e=localStorage.getItem("token"):t&&"session"===t.storageMethod&&(e=sessionStorage.getItem("token")),e||""}function yn(){t&&"local"===t.storageMethod?e=localStorage.removeItem("token"):t&&"session"===t.storageMethod&&(e=sessionStorage.removeItem("token")),delete y.Authorization,e=""}function Nn(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 kn(n){ln=n.next?n.next:null,gn=n.previous?n.previous:null}function An(n,t){n.next?pn[t]=n.next:delete pn[t],n.previous?wn[t]=n.previous:delete wn[t]}var _n=function(i,s,o){return new Promise(function(t,e){var n=bn();n&&!o?y.Authorization="Token "+n:delete y.Authorization,fetch(u+i,{method:"POST",headers:y,body:JSON.stringify(s)}).then(Nn).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}))})})},Tn=function(i,s){return new Promise(function(t,e){var n=s||bn();n?y.Authorization="Token "+n:delete y.Authorization,fetch(u+i,{method:"GET",headers:y}).then(Nn).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=bn();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(Nn).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}))})})},Cn=function(i,s){return new Promise(function(t,e){var n=bn();n?y.Authorization="Token "+n:delete y.Authorization,fetch(u+i,{method:"DELETE",headers:y,body:JSON.stringify(s)}).then(Nn).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){Tn(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(Nn).then(function(n){"success"==n.status?(Pn(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(Nn).then(function(n){"success"==n.status?(Pn(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(Nn).then(function(n){"success"==n.status?(Pn(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=bn();n?y.Authorization="Token "+n:delete y.Authorization,fetch(u+"auth/logout/",{method:"POST",headers:y}).then(Nn).then(function(n){"success"==n.status?(yn(),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=bn();n?y.Authorization="Token "+n:delete y.Authorization,fetch(u+"auth/logout/all/",{method:"POST",headers:y}).then(Nn).then(function(n){"success"==n.status?(yn(),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){_n("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){_n("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){_n("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){_n("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){_n("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){_n("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){_n("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){Tn(i).then(function(n){t(n)},function(n){e(n)})})},this.auth.tokens.create=function(n){return new Promise(function(t,e){_n(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"}),Cn(n,{}).then(function(n){t(n)},function(n){e(n)})})},this.auth.tokens.verify=function(n){return new Promise(function(t,e){Tn("auth/",n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.status.get=function(){return new Promise(function(t,e){Tn("auth/mfa/").then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.sms.get=function(){return new Promise(function(t,e){Tn(s).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.sms.enable=function(n){return new Promise(function(t,e){_n(s,n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.sms.send=function(n){return new Promise(function(t,e){_n("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){Cn(s,n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.token.get=function(){return new Promise(function(t,e){Tn(o).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.token.enable=function(n){return new Promise(function(t,e){_n(o,n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.token.disable=function(){return new Promise(function(t,e){Cn(o).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.verify=function(n){return new Promise(function(t,e){_n("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="?"+vn(s.filters),l+i):l,Tn(n).then(function(n){An(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],Tn(n).then(function(n){An(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=wn.Transaction;i?(n=i.split(u)[1],Tn(n).then(function(n){An(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?"?"+vn(n):"",Tn(l+"totals/"+n).then(function(n){t(n)},function(n){e(n)})})},this.transactions.createDebit=function(n){return new Promise(function(t,e){_n("transactions/debit/",n).then(function(n){t(n)},function(n){e(n)})})},this.transactions.createCredit=function(n){return new Promise(function(t,e){_n("transactions/credit/",n).then(function(n){t(n)},function(n){e(n)})})},this.transactions.createTransfer=function(n){return new Promise(function(t,e){_n("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="?"+vn(s.filters),g+i):g,Tn(n).then(function(n){An(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],Tn(n).then(function(n){An(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=wn["Transaction Collection"];i?(n=i.split(u)[1],Tn(n).then(function(n){An(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){_n(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="?"+vn(s.filters),p+i):p,Tn(n).then(function(n){An(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],Tn(n).then(function(n){An(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=wn.Account;i?(n=i.split(u)[1],Tn(n).then(function(n){An(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){_n(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="?"+vn(o.filters),p+s+w+i):p+s+w,Tn(n).then(function(n){An(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],Tn(n).then(function(n){An(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=wn.AccountCurrencies;i?(n=i.split(u)[1],Tn(n).then(function(n){An(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?xn(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){Tn("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="?"+vn(s.filters),v+i):v,Tn(n).then(function(n){An(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],Tn(n).then(function(n){An(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=wn.CompanyCurrencies;i?(n=i.split(u)[1],Tn(n).then(function(n){An(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){Tn("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="?"+vn(s.filters),P+i):P,Tn(n).then(function(n){An(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],Tn(n).then(function(n){An(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=wn.Permissions;i?(n=i.split(u)[1],Tn(n).then(function(n){An(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="?"+vn(s.filters),b+i):b,Tn(n).then(function(n){An(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],Tn(n).then(function(n){An(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=wn.Groups;i?(n=i.split(u)[1],Tn(n).then(function(n){An(n,"CompanyCurrencies"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.user.get=function(){return new Promise(function(t,e){Tn("user/").then(function(n){t(n)},function(n){e(n)})})},this.user.update=function(n){return new Promise(function(t,e){xn("user/",n).then(function(n){t(n)},function(n){e(n)})})},this.user.addresses.get=function(n){return new Promise(function(t,e){Tn(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"}),xn(n,i).then(function(n){t(n)},function(n){e(n)})})},this.user.addresses.create=function(n){return new Promise(function(t,e){_n(c,n).then(function(n){t(n)},function(n){e(n)})})},this.user.addresses.delete=function(n){return new Promise(function(t,e){n?Cn(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){Tn(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){_n(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?xn(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?Cn(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){Tn(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){_n(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?xn(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?Cn(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="?"+vn(s.filters),m+i):m,Tn(n).then(function(n){An(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],Tn(n).then(function(n){An(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=wn.Documents;i?(n=i.split(u)[1],Tn(n).then(function(n){An(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=bn(),i={};n?i.Authorization="Token "+n:delete i.Authorization,fetch(u+m,{method:"POST",headers:i,body:s}).then(Nn).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){Tn(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){_n(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?xn(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?Cn(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){Tn(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){_n(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?xn(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?Cn(h+n+"/",{}).then(function(n){t(n)},function(n){e(n)}):e({status:"error",message:"Mobile number id is required"})})},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="?"+vn(s.filters),B+i):B,Tn(n).then(function(n){kn(n),t(n)},function(n){e(n)})})},this.admin.exports.sets.getNext=function(){return new Promise(function(t,e){var n;ln?(n=ln.split(u)[1],Tn(n).then(function(n){kn(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;gn?(n=gn.split(u)[1],Tn(n).then(function(n){kn(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){_n(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?Cn(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="?"+vn(s.filters),k+i):k,Tn(n).then(function(n){kn(n),t(n)},function(n){e(n)})})},this.admin.accessControlRules.getNext=function(){return new Promise(function(t,e){var n;ln?(n=ln.split(u)[1],Tn(n).then(function(n){kn(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;gn?(n=gn.split(u)[1],Tn(n).then(function(n){kn(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?_n(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?xn(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?Cn(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="?"+vn(s.filters),_+i):_,Tn(n).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.settings.get=function(n){return new Promise(function(t,e){n?Tn(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?xn(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?Tn(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?xn(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="?"+vn(s.filters),N+i):N,Tn(n).then(function(n){kn(n),t(n)},function(n){e(n)})})},this.admin.users.getNext=function(){return new Promise(function(t,e){var n;ln?(n=ln.split(u)[1],Tn(n).then(function(n){kn(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;gn?(n=gn.split(u)[1],Tn(n).then(function(n){kn(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=bn();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(Nn).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=bn(),i={};n?i.Authorization="Token "+n:delete i.Authorization,fetch(u+N+s+"/",{method:"PATCH",headers:i,body:o}).then(Nn).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?Cn(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="?"+vn(o.filters),N+s+T+i):N+s+T,Tn(n).then(function(n){kn(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;ln?(n=ln.split(u)[1],Tn(n).then(function(n){kn(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;gn?(n=gn.split(u)[1],Tn(n).then(function(n){kn(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){_n(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){Cn(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="?"+vn(o.filters),N+s+x+i):N+s+x,Tn(n).then(function(n){kn(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;ln?(n=ln.split(u)[1],Tn(n).then(function(n){kn(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;gn?(n=gn.split(u)[1],Tn(n).then(function(n){kn(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){_n(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){Cn(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="?"+vn(s.filters),C+i):C,Tn(n).then(function(n){kn(n),t(n)},function(n){e(n)})})},this.admin.users.addresses.getNext=function(){return new Promise(function(t,e){var n;ln?(n=ln.split(u)[1],Tn(n).then(function(n){kn(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;gn?(n=gn.split(u)[1],Tn(n).then(function(n){kn(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){_n(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?xn(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?Cn(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="?"+vn(s.filters),S+i):S,Tn(n).then(function(n){kn(n),t(n)},function(n){e(n)})})},this.admin.users.bankAccounts.getNext=function(){return new Promise(function(t,e){var n;ln?(n=ln.split(u)[1],Tn(n).then(function(n){kn(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;gn?(n=gn.split(u)[1],Tn(n).then(function(n){kn(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){_n(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?xn(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?Cn(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="?"+vn(o.filters),S+s+"/currencies/"+i):S+s+"/currencies/",Tn(n).then(function(n){kn(n),t(n)},function(n){e(n)})})},this.admin.users.bankAccounts.currencies.getNext=function(){return new Promise(function(t,e){var n;ln?(n=ln.split(u)[1],Tn(n).then(function(n){kn(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;gn?(n=gn.split(u)[1],Tn(n).then(function(n){kn(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?_n(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?xn(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?Cn(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="?"+vn(s.filters),E+i):E,Tn(n).then(function(n){kn(n),t(n)},function(n){e(n)})})},this.admin.users.cryptoAccounts.getNext=function(){return new Promise(function(t,e){var n;ln?(n=ln.split(u)[1],Tn(n).then(function(n){kn(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;gn?(n=gn.split(u)[1],Tn(n).then(function(n){kn(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){_n(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?xn(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?Cn(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="?"+vn(s.filters),R+i):R,Tn(n).then(function(n){kn(n),t(n)},function(n){e(n)})})},this.admin.users.documents.getNext=function(){return new Promise(function(t,e){var n;ln?(n=ln.split(u)[1],Tn(n).then(function(n){kn(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;gn?(n=gn.split(u)[1],Tn(n).then(function(n){kn(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=bn(),i={};n?i.Authorization="Token "+n:delete i.Authorization,fetch(u+R,{method:"POST",headers:i,body:s}).then(Nn).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=bn(),i={};n?i.Authorization="Token "+n:delete i.Authorization,fetch(u+R+s+"/",{method:"PATCH",headers:i,body:o}).then(Nn).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?Cn(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="?"+vn(s.filters),j+i):j,Tn(n).then(function(n){kn(n),t(n)},function(n){e(n)})})},this.admin.users.emails.getNext=function(){return new Promise(function(t,e){var n;ln?(n=ln.split(u)[1],Tn(n).then(function(n){kn(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;gn?(n=gn.split(u)[1],Tn(n).then(function(n){kn(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){_n(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?xn(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?Cn(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="?"+vn(s.filters),q+i):q,Tn(n).then(function(n){kn(n),t(n)},function(n){e(n)})})},this.admin.users.mobiles.getNext=function(){return new Promise(function(t,e){var n;ln?(n=ln.split(u)[1],Tn(n).then(function(n){kn(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;gn?(n=gn.split(u)[1],Tn(n).then(function(n){kn(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){_n(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?xn(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?Cn(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?Tn(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?Cn(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?Cn(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="?"+vn(s.filters),O+i):O,Tn(n).then(function(n){kn(n),t(n)},function(n){e(n)})})},this.admin.transactions.getNext=function(){return new Promise(function(t,e){var n;ln?(n=ln.split(u)[1],Tn(n).then(function(n){kn(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;gn?(n=gn.split(u)[1],Tn(n).then(function(n){kn(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?"?"+vn(i.filters):"",Tn("admin/transactions/totals/"+n).then(function(n){kn(n),t(n)},function(n){e(n)})})},this.admin.transactions.update=function(n,i){return new Promise(function(t,e){n?xn(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){_n("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){_n("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){_n("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="?"+vn(s.filters),I+i):I,Tn(n).then(function(n){kn(n),t(n)},function(n){e(n)})})},this.admin.transaction_collections.getNext=function(){return new Promise(function(t,e){var n;ln?(n=ln.split(u)[1],Tn(n).then(function(n){kn(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;gn?(n=gn.split(u)[1],Tn(n).then(function(n){kn(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){_n(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?xn(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?Cn(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="?"+vn(s.filters),U+i):U,Tn(n).then(function(n){kn(n),t(n)},function(n){e(n)})})},this.admin.accounts.getNext=function(){return new Promise(function(t,e){var n;ln?(n=ln.split(u)[1],Tn(n).then(function(n){kn(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;gn?(n=gn.split(u)[1],Tn(n).then(function(n){kn(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="?"+vn(s.filters),G+i):G,Tn(n).then(function(n){kn(n),t(n)},function(n){e(n)})})},this.admin.account.definitions.getNext=function(){return new Promise(function(t,e){var n;ln?(n=ln.split(u)[1],Tn(n).then(function(n){kn(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;gn?(n=gn.split(u)[1],Tn(n).then(function(n){kn(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){_n(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?xn(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?Cn(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="?"+vn(o.filters),G+s+"/groups/"+i):G+s+"/groups/",Tn(n).then(function(n){kn(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;ln?(n=ln.split(u)[1],Tn(n).then(function(n){kn(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;gn?(n=gn.split(u)[1],Tn(n).then(function(n){kn(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?_n(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?xn(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?Cn(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="?"+vn(u.filters),G+s+"/groups/"+o+"/currencies/"+i):G+s+"/groups/"+o+"/currencies/",Tn(n).then(function(n){kn(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;ln?(n=ln.split(u)[1],Tn(n).then(function(n){kn(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;gn?(n=gn.split(u)[1],Tn(n).then(function(n){kn(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?_n(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?xn(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?Cn(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="?"+vn(s.filters),M+i):M,Tn(n).then(function(n){kn(n),t(n)},function(n){e(n)})})},this.admin.account.currencies.getNext=function(){return new Promise(function(t,e){var n;ln?(n=ln.split(u)[1],Tn(n).then(function(n){kn(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;gn?(n=gn.split(u)[1],Tn(n).then(function(n){kn(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){_n(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?xn(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="?"+vn(o.filters),U+s+F+i):U+s+F,Tn(n).then(function(n){kn(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;ln?(n=ln.split(u)[1],Tn(n).then(function(n){kn(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;gn?(n=gn.split(u)[1],Tn(n).then(function(n){kn(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){_n(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?xn(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,Tn(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){_n(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?xn(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?Cn(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,Tn(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){_n(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?xn(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?Cn(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?Tn(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?xn(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="?"+vn(s.filters),H+i):H,Tn(n).then(function(n){kn(n),t(n)},function(n){e(n)})})},this.admin.currencies.getNext=function(){return new Promise(function(t,e){var n;ln?(n=ln.split(u)[1],Tn(n).then(function(n){kn(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;gn?(n=gn.split(u)[1],Tn(n).then(function(n){kn(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){_n(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"});xn(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?Cn(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"}),Tn(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="?"+vn(o.filters),H+s+J+i):H+s+J,Tn(n).then(function(n){kn(n),t(n)},function(n){e(n)})})},this.admin.currencies.bankAccounts.getNext=function(){return new Promise(function(t,e){var n;ln?(n=ln.split(u)[1],Tn(n).then(function(n){kn(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;gn?(n=gn.split(u)[1],Tn(n).then(function(n){kn(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){_n(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){Cn(H+n+J+i+"/").then(function(n){t(n)},function(n){e(n)})})},this.admin.company.get=function(){return new Promise(function(t,e){Tn(V).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.update=function(n){return new Promise(function(t,e){xn(V,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.settings.get=function(){return new Promise(function(t,e){Tn(V+X).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.settings.update=function(n){return new Promise(function(t,e){xn(V+X,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.address.get=function(){return new Promise(function(t,e){Tn(V+K).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.address.update=function(n){return new Promise(function(t,e){xn(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){Tn(i).then(function(n){t(n)},function(n){e(n)})})},this.admin.bankAccounts.create=function(n){return new Promise(function(t,e){_n(sn,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.bankAccounts.update=function(n,i){return new Promise(function(t,e){xn(sn+n+"/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.bankAccounts.delete=function(n){return new Promise(function(t,e){Cn(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),Tn(n).then(function(n){kn(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;ln?(n=ln.split(u)[1],Tn(n).then(function(n){n.next&&kn(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;gn?(n=gn.split(u)[1],Tn(n).then(function(n){kn(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){_n(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){Cn(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="?"+vn(n.filters),W+t):W,new Promise(function(t,e){Tn(i).then(function(n){kn(n),t(n)},function(n){e(n)})})},this.admin.webhooks.getNext=function(){return new Promise(function(t,e){var n;ln?(n=ln.split(u)[1],Tn(n).then(function(n){kn(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;gn?(n=gn.split(u)[1],Tn(n).then(function(n){kn(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){_n(W,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.webhooks.update=function(n,i){return new Promise(function(t,e){xn(W+n+"/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.webhooks.delete=function(n){return new Promise(function(t,e){Cn(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="?"+vn(n.filters),$+t):$,n&&n.id?new Promise(function(t,e){var n=bn();n?y.Authorization="Token "+n:delete y.Authorization,fetch(u+i,{method:"GET",headers:y}).then(Nn).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){Tn(i).then(function(n){kn(n),t(n)},function(n){e(n)})})},this.admin.webhookTasks.getNext=function(){return new Promise(function(t,e){var n;ln?(n=ln.split(u)[1],Tn(n).then(function(n){kn(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;gn?(n=gn.split(u)[1],Tn(n).then(function(n){kn(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="?"+vn(t.filters),$+n+Q+e):$,new Promise(function(t,e){Tn(i).then(function(n){kn(n),t(n)},function(n){e(n)})})},this.admin.webhookTasks.requests.getNext=function(){return new Promise(function(t,e){var n;ln?(n=ln.split(u)[1],Tn(n).then(function(n){kn(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;gn?(n=gn.split(u)[1],Tn(n).then(function(n){kn(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){Tn(i).then(function(n){t(n)},function(n){e(n)})})},this.admin.subtypes.create=function(n){return new Promise(function(t,e){_n(Y,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.subtypes.update=function(n,i){return new Promise(function(t,e){xn(Y+n+"/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.subtypes.delete=function(n){return new Promise(function(t,e){Cn(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){Tn(i).then(function(n){t(n)},function(n){e(n)})})},this.admin.notifications.update=function(n,i){return new Promise(function(t,e){xn(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="?"+vn(s.filters),on+i):on,Tn(n).then(function(n){kn(n),t(n)},function(n){e(n)})})},this.admin.services.getNext=function(){return new Promise(function(t,e){var n;ln?(n=ln.split(u)[1],Tn(n).then(function(n){kn(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;gn?(n=gn.split(u)[1],Tn(n).then(function(n){kn(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){xn(on+n+"/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.services.create=function(n){return new Promise(function(t,e){_n(on,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.services.delete=function(n){return new Promise(function(t,e){n?Cn(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="?"+vn(s.filters),rn+i):rn,Tn(n).then(function(n){kn(n),t(n)},function(n){e(n)})})},this.admin.requests.getNext=function(){return new Promise(function(t,e){var n;ln?(n=ln.split(u)[1],Tn(n).then(function(n){n.next&&kn(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;gn?(n=gn.split(u)[1],Tn(n).then(function(n){kn(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="?"+vn(s.filters),un+i):un,Tn(n).then(function(n){kn(n),t(n)},function(n){e(n)})})},this.admin.groups.getNext=function(){return new Promise(function(t,e){var n;ln?(n=ln.split(u)[1],Tn(n).then(function(n){kn(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;gn?(n=gn.split(u)[1],Tn(n).then(function(n){kn(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){_n(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?xn(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?Cn(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="?"+vn(o.filters),un+s+cn+i):un+s+cn,Tn(n).then(function(n){kn(n),t(n)},function(n){e(n)})})},this.admin.groups.permissions.getNext=function(){return new Promise(function(t,e){var n;ln?(n=ln.split(u)[1],Tn(n).then(function(n){kn(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;gn?(n=gn.split(u)[1],Tn(n).then(function(n){kn(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?_n(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?Cn(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?Tn(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){xn(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){Tn(i).then(function(n){t(n)},function(n){e(n)})})},this.admin.groups.tiers.create=function(n,i){return new Promise(function(t,e){_n(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){xn(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){Cn(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,Tn(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?_n(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?xn(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?Cn(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,Tn(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?_n(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?xn(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?Cn(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,Tn(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?_n(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?xn(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?Cn(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?Tn(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){xn(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="?"+vn(o.filters),un+s+mn+i):un+s+mn,Tn(n).then(function(n){kn(n),t(n)},function(n){e(n)})})},this.admin.groups.accountConfigurations.getNext=function(){return new Promise(function(t,e){var n;ln?(n=ln.split(u)[1],Tn(n).then(function(n){kn(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;gn?(n=gn.split(u)[1],Tn(n).then(function(n){kn(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){_n(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?xn(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?Cn(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="?"+vn(u.filters),un+s+mn+o+dn+i):un+s+mn+o+dn,Tn(n).then(function(n){kn(n),t(n)},function(n){e(n)})})},this.admin.groups.accountConfigurations.currencies.getNext=function(){return new Promise(function(t,e){var n;ln?(n=ln.split(u)[1],Tn(n).then(function(n){kn(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;gn?(n=gn.split(u)[1],Tn(n).then(function(n){kn(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){_n(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?Cn(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:{}},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:{}}};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/",A="admin/access-control-rules/",k="/settings/",_="admin/users/overview/",T="/permissions/",x="/groups/",C="admin/users/addresses/",S="admin/users/bank-accounts/",R="admin/users/crypto-accounts/",E="admin/users/documents/",j="admin/users/emails/",I="admin/users/mobiles/",q="admin/transactions/",O="admin/exports/",B="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/";adminAuthLoginAPI="admin/auth/login/",adminAuthRegisterAPI="admin/auth/register/",t||(t={}),u=0<Object.keys(t).length?t.customAPIURL?t.customAPIURL:(n=t.apiVersion?t.apiVersion:"3",t.apiToken&&Pn(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,ln,gn,pn={},wn={};function vn(n){var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push(encodeURIComponent(e)+"="+encodeURIComponent(n[e]));return t.join("&")}function Pn(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 bn(){return t&&"local"===t.storageMethod?e=localStorage.getItem("token"):t&&"session"===t.storageMethod&&(e=sessionStorage.getItem("token")),e||""}function yn(){t&&"local"===t.storageMethod?e=localStorage.removeItem("token"):t&&"session"===t.storageMethod&&(e=sessionStorage.removeItem("token")),delete y.Authorization,e=""}function Nn(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){ln=n.next?n.next:null,gn=n.previous?n.previous:null}function kn(n,t){n.next?pn[t]=n.next:delete pn[t],n.previous?wn[t]=n.previous:delete wn[t]}var _n=function(i,s,o){return new Promise(function(t,e){var n=bn();n&&!o?y.Authorization="Token "+n:delete y.Authorization,fetch(u+i,{method:"POST",headers:y,body:JSON.stringify(s)}).then(Nn).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}))})})},Tn=function(i,s){return new Promise(function(t,e){var n=s||bn();n?y.Authorization="Token "+n:delete y.Authorization,fetch(u+i,{method:"GET",headers:y}).then(Nn).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=bn();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(Nn).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}))})})},Cn=function(i,s){return new Promise(function(t,e){var n=bn();n?y.Authorization="Token "+n:delete y.Authorization,fetch(u+i,{method:"DELETE",headers:y,body:JSON.stringify(s)}).then(Nn).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){Tn(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(Nn).then(function(n){"success"==n.status?(Pn(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(Nn).then(function(n){"success"==n.status?(Pn(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(Nn).then(function(n){"success"==n.status?(Pn(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=bn();n?y.Authorization="Token "+n:delete y.Authorization,fetch(u+"auth/logout/",{method:"POST",headers:y}).then(Nn).then(function(n){"success"==n.status?(yn(),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=bn();n?y.Authorization="Token "+n:delete y.Authorization,fetch(u+"auth/logout/all/",{method:"POST",headers:y}).then(Nn).then(function(n){"success"==n.status?(yn(),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){_n("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){_n("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){_n("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){_n("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){_n("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){_n("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){_n("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){Tn(i).then(function(n){t(n)},function(n){e(n)})})},this.auth.tokens.create=function(n){return new Promise(function(t,e){_n(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"}),Cn(n,{}).then(function(n){t(n)},function(n){e(n)})})},this.auth.tokens.verify=function(n){return new Promise(function(t,e){Tn("auth/",n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.status.get=function(){return new Promise(function(t,e){Tn("auth/mfa/").then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.sms.get=function(){return new Promise(function(t,e){Tn(s).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.sms.enable=function(n){return new Promise(function(t,e){_n(s,n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.sms.send=function(n){return new Promise(function(t,e){_n("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){Cn(s,n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.token.get=function(){return new Promise(function(t,e){Tn(o).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.token.enable=function(n){return new Promise(function(t,e){_n(o,n).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.token.disable=function(){return new Promise(function(t,e){Cn(o).then(function(n){t(n)},function(n){e(n)})})},this.auth.mfa.verify=function(n){return new Promise(function(t,e){_n("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="?"+vn(s.filters),l+i):l,Tn(n).then(function(n){kn(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],Tn(n).then(function(n){kn(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=wn.Transaction;i?(n=i.split(u)[1],Tn(n).then(function(n){kn(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?"?"+vn(n):"",Tn(l+"totals/"+n).then(function(n){t(n)},function(n){e(n)})})},this.transactions.createDebit=function(n){return new Promise(function(t,e){_n("transactions/debit/",n).then(function(n){t(n)},function(n){e(n)})})},this.transactions.createCredit=function(n){return new Promise(function(t,e){_n("transactions/credit/",n).then(function(n){t(n)},function(n){e(n)})})},this.transactions.createTransfer=function(n){return new Promise(function(t,e){_n("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="?"+vn(s.filters),g+i):g,Tn(n).then(function(n){kn(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],Tn(n).then(function(n){kn(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=wn["Transaction Collection"];i?(n=i.split(u)[1],Tn(n).then(function(n){kn(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){_n(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="?"+vn(s.filters),p+i):p,Tn(n).then(function(n){kn(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],Tn(n).then(function(n){kn(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=wn.Account;i?(n=i.split(u)[1],Tn(n).then(function(n){kn(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){_n(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="?"+vn(o.filters),p+s+w+i):p+s+w,Tn(n).then(function(n){kn(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],Tn(n).then(function(n){kn(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=wn.AccountCurrencies;i?(n=i.split(u)[1],Tn(n).then(function(n){kn(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?xn(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){Tn("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="?"+vn(s.filters),v+i):v,Tn(n).then(function(n){kn(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],Tn(n).then(function(n){kn(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=wn.CompanyCurrencies;i?(n=i.split(u)[1],Tn(n).then(function(n){kn(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){Tn("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="?"+vn(s.filters),P+i):P,Tn(n).then(function(n){kn(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],Tn(n).then(function(n){kn(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=wn.Permissions;i?(n=i.split(u)[1],Tn(n).then(function(n){kn(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="?"+vn(s.filters),b+i):b,Tn(n).then(function(n){kn(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],Tn(n).then(function(n){kn(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=wn.Groups;i?(n=i.split(u)[1],Tn(n).then(function(n){kn(n,"CompanyCurrencies"),t(n)},function(n){e(n)})):e({status:400,message:"Not allowed"})})},this.user.get=function(){return new Promise(function(t,e){Tn("user/").then(function(n){t(n)},function(n){e(n)})})},this.user.update=function(n){return new Promise(function(t,e){xn("user/",n).then(function(n){t(n)},function(n){e(n)})})},this.user.addresses.get=function(n){return new Promise(function(t,e){Tn(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"}),xn(n,i).then(function(n){t(n)},function(n){e(n)})})},this.user.addresses.create=function(n){return new Promise(function(t,e){_n(c,n).then(function(n){t(n)},function(n){e(n)})})},this.user.addresses.delete=function(n){return new Promise(function(t,e){n?Cn(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){Tn(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){_n(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?xn(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?Cn(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){Tn(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){_n(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?xn(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?Cn(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="?"+vn(s.filters),m+i):m,Tn(n).then(function(n){kn(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],Tn(n).then(function(n){kn(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=wn.Documents;i?(n=i.split(u)[1],Tn(n).then(function(n){kn(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=bn(),i={};n?i.Authorization="Token "+n:delete i.Authorization,fetch(u+m,{method:"POST",headers:i,body:s}).then(Nn).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){Tn(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){_n(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?xn(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?Cn(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){Tn(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){_n(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?xn(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?Cn(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){_n(adminAuthLoginAPI,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.auth.register=function(n){return new Promise(function(t,e){_n(adminAuthRegisterAPI,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.exports.sets.get=function(s){return new Promise(function(t,e){var n,i;n=s&&s.id?O+s.id+"/":s&&s.filters?(i="?"+vn(s.filters),O+i):O,Tn(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;ln?(n=ln.split(u)[1],Tn(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;gn?(n=gn.split(u)[1],Tn(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){_n(O,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.exports.sets.delete=function(n){return new Promise(function(t,e){n?Cn(O+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="?"+vn(s.filters),A+i):A,Tn(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;ln?(n=ln.split(u)[1],Tn(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;gn?(n=gn.split(u)[1],Tn(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?_n(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?xn(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?Cn(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="?"+vn(s.filters),_+i):_,Tn(n).then(function(n){t(n)},function(n){e(n)})})},this.admin.users.settings.get=function(n){return new Promise(function(t,e){n?Tn(N+n+k).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?xn(N+n+k,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?Tn(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?xn(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="?"+vn(s.filters),N+i):N,Tn(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;ln?(n=ln.split(u)[1],Tn(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;gn?(n=gn.split(u)[1],Tn(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=bn();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(Nn).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=bn(),i={};n?i.Authorization="Token "+n:delete i.Authorization,fetch(u+N+s+"/",{method:"PATCH",headers:i,body:o}).then(Nn).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?Cn(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="?"+vn(o.filters),N+s+T+i):N+s+T,Tn(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;ln?(n=ln.split(u)[1],Tn(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;gn?(n=gn.split(u)[1],Tn(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){_n(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){Cn(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="?"+vn(o.filters),N+s+x+i):N+s+x,Tn(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;ln?(n=ln.split(u)[1],Tn(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;gn?(n=gn.split(u)[1],Tn(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){_n(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){Cn(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="?"+vn(s.filters),C+i):C,Tn(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;ln?(n=ln.split(u)[1],Tn(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;gn?(n=gn.split(u)[1],Tn(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){_n(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?xn(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?Cn(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="?"+vn(s.filters),S+i):S,Tn(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;ln?(n=ln.split(u)[1],Tn(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;gn?(n=gn.split(u)[1],Tn(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){_n(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?xn(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?Cn(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="?"+vn(o.filters),S+s+"/currencies/"+i):S+s+"/currencies/",Tn(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;ln?(n=ln.split(u)[1],Tn(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;gn?(n=gn.split(u)[1],Tn(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?_n(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?xn(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?Cn(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?R+s.id+"/":s&&s.filters?(i="?"+vn(s.filters),R+i):R,Tn(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;ln?(n=ln.split(u)[1],Tn(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;gn?(n=gn.split(u)[1],Tn(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){_n(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?xn(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?Cn(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?E+s.id+"/":s&&s.filters?(i="?"+vn(s.filters),E+i):E,Tn(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;ln?(n=ln.split(u)[1],Tn(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;gn?(n=gn.split(u)[1],Tn(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=bn(),i={};n?i.Authorization="Token "+n:delete i.Authorization,fetch(u+E,{method:"POST",headers:i,body:s}).then(Nn).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=bn(),i={};n?i.Authorization="Token "+n:delete i.Authorization,fetch(u+E+s+"/",{method:"PATCH",headers:i,body:o}).then(Nn).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?Cn(E+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="?"+vn(s.filters),j+i):j,Tn(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;ln?(n=ln.split(u)[1],Tn(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;gn?(n=gn.split(u)[1],Tn(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){_n(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?xn(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?Cn(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?I+s.id+"/":s&&s.filters?(i="?"+vn(s.filters),I+i):I,Tn(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;ln?(n=ln.split(u)[1],Tn(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;gn?(n=gn.split(u)[1],Tn(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){_n(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?xn(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?Cn(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?Tn(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?Cn(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?Cn(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?q+s.id+"/":s&&s.filters?(i="?"+vn(s.filters),q+i):q,Tn(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;ln?(n=ln.split(u)[1],Tn(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;gn?(n=gn.split(u)[1],Tn(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?"?"+vn(i.filters):"",Tn("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?xn(q+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){_n("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){_n("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){_n("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?B+s.id+"/":s&&s.filters?(i="?"+vn(s.filters),B+i):B,Tn(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;ln?(n=ln.split(u)[1],Tn(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;gn?(n=gn.split(u)[1],Tn(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){_n(B,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?xn(B+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?Cn(B+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="?"+vn(s.filters),U+i):U,Tn(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;ln?(n=ln.split(u)[1],Tn(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;gn?(n=gn.split(u)[1],Tn(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="?"+vn(s.filters),G+i):G,Tn(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;ln?(n=ln.split(u)[1],Tn(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;gn?(n=gn.split(u)[1],Tn(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){_n(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?xn(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?Cn(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="?"+vn(o.filters),G+s+"/groups/"+i):G+s+"/groups/",Tn(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;ln?(n=ln.split(u)[1],Tn(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;gn?(n=gn.split(u)[1],Tn(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?_n(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?xn(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?Cn(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="?"+vn(u.filters),G+s+"/groups/"+o+"/currencies/"+i):G+s+"/groups/"+o+"/currencies/",Tn(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;ln?(n=ln.split(u)[1],Tn(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;gn?(n=gn.split(u)[1],Tn(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?_n(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?xn(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?Cn(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="?"+vn(s.filters),M+i):M,Tn(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;ln?(n=ln.split(u)[1],Tn(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;gn?(n=gn.split(u)[1],Tn(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){_n(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?xn(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="?"+vn(o.filters),U+s+F+i):U+s+F,Tn(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;ln?(n=ln.split(u)[1],Tn(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;gn?(n=gn.split(u)[1],Tn(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){_n(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?xn(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,Tn(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){_n(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?xn(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?Cn(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,Tn(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){_n(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?xn(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?Cn(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?Tn(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?xn(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="?"+vn(s.filters),H+i):H,Tn(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;ln?(n=ln.split(u)[1],Tn(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;gn?(n=gn.split(u)[1],Tn(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){_n(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"});xn(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?Cn(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"}),Tn(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="?"+vn(o.filters),H+s+J+i):H+s+J,Tn(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;ln?(n=ln.split(u)[1],Tn(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;gn?(n=gn.split(u)[1],Tn(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){_n(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){Cn(H+n+J+i+"/").then(function(n){t(n)},function(n){e(n)})})},this.admin.company.get=function(){return new Promise(function(t,e){Tn(V).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.update=function(n){return new Promise(function(t,e){xn(V,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.settings.get=function(){return new Promise(function(t,e){Tn(V+X).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.settings.update=function(n){return new Promise(function(t,e){xn(V+X,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.address.get=function(){return new Promise(function(t,e){Tn(V+K).then(function(n){t(n)},function(n){e(n)})})},this.admin.company.address.update=function(n){return new Promise(function(t,e){xn(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){Tn(i).then(function(n){t(n)},function(n){e(n)})})},this.admin.bankAccounts.create=function(n){return new Promise(function(t,e){_n(sn,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.bankAccounts.update=function(n,i){return new Promise(function(t,e){xn(sn+n+"/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.bankAccounts.delete=function(n){return new Promise(function(t,e){Cn(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),Tn(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;ln?(n=ln.split(u)[1],Tn(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;gn?(n=gn.split(u)[1],Tn(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){_n(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){Cn(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="?"+vn(n.filters),W+t):W,new Promise(function(t,e){Tn(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;ln?(n=ln.split(u)[1],Tn(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;gn?(n=gn.split(u)[1],Tn(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){_n(W,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.webhooks.update=function(n,i){return new Promise(function(t,e){xn(W+n+"/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.webhooks.delete=function(n){return new Promise(function(t,e){Cn(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="?"+vn(n.filters),$+t):$,n&&n.id?new Promise(function(t,e){var n=bn();n?y.Authorization="Token "+n:delete y.Authorization,fetch(u+i,{method:"GET",headers:y}).then(Nn).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){Tn(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;ln?(n=ln.split(u)[1],Tn(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;gn?(n=gn.split(u)[1],Tn(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="?"+vn(t.filters),$+n+Q+e):$,new Promise(function(t,e){Tn(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;ln?(n=ln.split(u)[1],Tn(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;gn?(n=gn.split(u)[1],Tn(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){Tn(i).then(function(n){t(n)},function(n){e(n)})})},this.admin.subtypes.create=function(n){return new Promise(function(t,e){_n(Y,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.subtypes.update=function(n,i){return new Promise(function(t,e){xn(Y+n+"/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.subtypes.delete=function(n){return new Promise(function(t,e){Cn(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){Tn(i).then(function(n){t(n)},function(n){e(n)})})},this.admin.notifications.update=function(n,i){return new Promise(function(t,e){xn(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="?"+vn(s.filters),on+i):on,Tn(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;ln?(n=ln.split(u)[1],Tn(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;gn?(n=gn.split(u)[1],Tn(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){xn(on+n+"/",i).then(function(n){t(n)},function(n){e(n)})})},this.admin.services.create=function(n){return new Promise(function(t,e){_n(on,n).then(function(n){t(n)},function(n){e(n)})})},this.admin.services.delete=function(n){return new Promise(function(t,e){n?Cn(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="?"+vn(s.filters),rn+i):rn,Tn(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;ln?(n=ln.split(u)[1],Tn(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;gn?(n=gn.split(u)[1],Tn(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="?"+vn(s.filters),un+i):un,Tn(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;ln?(n=ln.split(u)[1],Tn(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;gn?(n=gn.split(u)[1],Tn(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){_n(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?xn(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?Cn(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="?"+vn(o.filters),un+s+cn+i):un+s+cn,Tn(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;ln?(n=ln.split(u)[1],Tn(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;gn?(n=gn.split(u)[1],Tn(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?_n(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?Cn(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?Tn(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){xn(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){Tn(i).then(function(n){t(n)},function(n){e(n)})})},this.admin.groups.tiers.create=function(n,i){return new Promise(function(t,e){_n(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){xn(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){Cn(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,Tn(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?_n(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?xn(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?Cn(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,Tn(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?_n(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?xn(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?Cn(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,Tn(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?_n(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?xn(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?Cn(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?Tn(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){xn(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="?"+vn(o.filters),un+s+mn+i):un+s+mn,Tn(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;ln?(n=ln.split(u)[1],Tn(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;gn?(n=gn.split(u)[1],Tn(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){_n(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?xn(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?Cn(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="?"+vn(u.filters),un+s+mn+o+dn+i):un+s+mn+o+dn,Tn(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;ln?(n=ln.split(u)[1],Tn(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;gn?(n=gn.split(u)[1],Tn(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){_n(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?Cn(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);
|
package/package.json
CHANGED
package/rehive.js
CHANGED
|
@@ -61,6 +61,10 @@ function Rehive(config) {
|
|
|
61
61
|
this.permissions = {};
|
|
62
62
|
|
|
63
63
|
this.admin = {
|
|
64
|
+
auth: {
|
|
65
|
+
login: {},
|
|
66
|
+
register: {}
|
|
67
|
+
},
|
|
64
68
|
accessControlRules: {},
|
|
65
69
|
users: {
|
|
66
70
|
overview: {},
|
|
@@ -238,6 +242,8 @@ function Rehive(config) {
|
|
|
238
242
|
adminGroupsAccountConfigurationsAPI = '/account-configurations/',
|
|
239
243
|
adminGroupsAccountConfigurationsCurrenciesAPI = '/currencies/',
|
|
240
244
|
adminGroupsTiersSettingsAPI = '/settings/';
|
|
245
|
+
adminAuthLoginAPI = 'admin/auth/login/';
|
|
246
|
+
adminAuthRegisterAPI = 'admin/auth/register/';
|
|
241
247
|
|
|
242
248
|
var baseAPI;
|
|
243
249
|
|
|
@@ -1876,6 +1882,29 @@ function Rehive(config) {
|
|
|
1876
1882
|
//#endregion
|
|
1877
1883
|
|
|
1878
1884
|
//#region Admin methods
|
|
1885
|
+
//#region Admin Auth methods
|
|
1886
|
+
this.admin.auth.login = function (data) {
|
|
1887
|
+
return new Promise(function (resolve, reject) {
|
|
1888
|
+
httpPostRehive(adminAuthLoginAPI, data).then(function (response) {
|
|
1889
|
+
resolve(response);
|
|
1890
|
+
}, function (error) {
|
|
1891
|
+
reject(error);
|
|
1892
|
+
});
|
|
1893
|
+
});
|
|
1894
|
+
};
|
|
1895
|
+
|
|
1896
|
+
this.admin.auth.register = function (data) {
|
|
1897
|
+
return new Promise(function (resolve, reject) {
|
|
1898
|
+
httpPostRehive(adminAuthRegisterAPI, data).then(function (response) {
|
|
1899
|
+
resolve(response);
|
|
1900
|
+
}, function (error) {
|
|
1901
|
+
reject(error);
|
|
1902
|
+
});
|
|
1903
|
+
});
|
|
1904
|
+
};
|
|
1905
|
+
|
|
1906
|
+
//#endregion
|
|
1907
|
+
|
|
1879
1908
|
//#region Admin Export methods
|
|
1880
1909
|
this.admin.exports.sets.get = function (obj) {
|
|
1881
1910
|
return new Promise(function (resolve, reject) {
|