@voidwalkers/void-client
Advanced tools
Comparing version 0.1.10 to 0.1.11
/*! For license information please see index.browser.js.LICENSE.txt */ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@ololoepepe/api-wrapper"),require("axios")):"function"==typeof define&&define.amd?define(["@ololoepepe/api-wrapper","axios"],e):"object"==typeof exports?exports.voidClient=e(require("@ololoepepe/api-wrapper"),require("axios")):t.voidClient=e(t["@ololoepepe/api-wrapper"],t.axios)}(self,((t,e)=>(()=>{var r={22:e=>{"use strict";e.exports=t},300:t=>{"use strict";t.exports=e},61:(t,e,r)=>{var n=r(698)["default"];function o(){"use strict";t.exports=o=function(){return r},t.exports.__esModule=!0,t.exports["default"]=t.exports;var e,r={},a=Object.prototype,i=a.hasOwnProperty,u=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",l=c.asyncIterator||"@@asyncIterator",p=c.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(e){f=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var o=e&&e.prototype instanceof g?e:g,a=Object.create(o.prototype),i=new R(n||[]);return u(a,"_invoke",{value:W(t,r,i)}),a}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=h;var y="suspendedStart",v="suspendedYield",w="executing",m="completed",b={};function g(){}function x(){}function k(){}var O={};f(O,s,(function(){return this}));var j=Object.getPrototypeOf,S=j&&j(j(L([])));S&&S!==a&&i.call(S,s)&&(O=S);var E=k.prototype=g.prototype=Object.create(O);function M(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function P(t,e){function r(o,a,u,c){var s=d(t[o],t,a);if("throw"!==s.type){var l=s.arg,p=l.value;return p&&"object"==n(p)&&i.call(p,"__await")?e.resolve(p.__await).then((function(t){r("next",t,u,c)}),(function(t){r("throw",t,u,c)})):e.resolve(p).then((function(t){l.value=t,u(l)}),(function(t){return r("throw",t,u,c)}))}c(s.arg)}var o;u(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(a,a):a()}})}function W(t,r,n){var o=y;return function(a,i){if(o===w)throw new Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var u=n.delegate;if(u){var c=_(u,n);if(c){if(c===b)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=w;var s=d(t,r,n);if("normal"===s.type){if(o=n.done?m:v,s.arg===b)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=m,n.method="throw",n.arg=s.arg)}}}function _(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator["return"]&&(r.method="return",r.arg=e,_(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=d(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function D(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function R(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(D,this),this.reset(!0)}function L(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(i.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(n(t)+" is not iterable")}return x.prototype=k,u(E,"constructor",{value:k,configurable:!0}),u(k,"constructor",{value:x,configurable:!0}),x.displayName=f(k,p,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===x||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,k):(t.__proto__=k,f(t,p,"GeneratorFunction")),t.prototype=Object.create(E),t},r.awrap=function(t){return{__await:t}},M(P.prototype),f(P.prototype,l,(function(){return this})),r.AsyncIterator=P,r.async=function(t,e,n,o,a){void 0===a&&(a=Promise);var i=new P(h(t,e,n,o),a);return r.isGeneratorFunction(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},M(E),f(E,p,"Generator"),f(E,s,(function(){return this})),f(E,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function o(){for(;r.length;){var t=r.pop();if(t in e)return o.value=t,o.done=!1,o}return o.done=!0,o}},r.values=L,R.prototype={constructor:R,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return u.type="throw",u.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=i.call(a,"catchLoc"),s=i.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),b},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),b}},"catch":function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:L(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},r}t.exports=o,t.exports.__esModule=!0,t.exports["default"]=t.exports},698:t=>{function e(r){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports["default"]=t.exports,e(r)}t.exports=e,t.exports.__esModule=!0,t.exports["default"]=t.exports},687:(t,e,r)=>{var n=r(61)();t.exports=n;try{regeneratorRuntime=n}catch(o){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},n={};function o(t){var e=n[t];if(e!==undefined)return e.exports;var a=n[t]={exports:{}};return r[t](a,a.exports,o),a.exports}o.d=(t,e)=>{for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var a={};return(()=>{"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function r(t){var r=function(t,r){if("object"!==e(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(n!==undefined){var o=n.call(t,r||"default");if("object"!==e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"===e(r)?r:String(r)}function n(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,r(o.key),o)}}function i(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}o.r(a),o.d(a,{StorageDriver:()=>c,StorageDriverLocalStorage:()=>k,VoidClient:()=>Kt});var u,c=function(){function e(){t(this,e)}return i(e,[{key:"load",value:function(){throw new Error("[StorageDriver.load] Method not implemented")}},{key:"save",value:function(){throw new Error("[StorageDriver.save] Method not implemented")}}],[{key:"StorageKey",get:function(){return{CurrentUser:"current_user",Session:"session"}}}]),e}();function s(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function l(t,e){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},l(t,e)}function p(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&l(t,e)}function f(t,r){if(r&&("object"===e(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return s(t)}function h(t){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},h(t)}function d(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function y(t,e){return function(t,e){return e.get?e.get.call(t):e.value}(t,d(t,e,"get"))}function v(t,e,r){return function(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}(t,d(t,e,"set"),r),r}function w(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=h(t);if(e){var o=h(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}function m(t,e,r){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,r)}function b(t,e,r){return function(t,e){if(t!==e)throw new TypeError("Private static access of wrong provenance")}(t,e),r}var g=new WeakMap,x=new WeakMap,k=function(e){p(n,e);var r=w(n);function n(){var e,o=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},a=o.prefix,i=void 0===a?"void":a,u=o.storageType,c=void 0===u?n.StorageType.LocalStorage:u;return t(this,n),m(s(e=r.call(this)),g,{writable:!0,value:null}),m(s(e),x,{writable:!0,value:null}),v(s(e),g,i),v(s(e),x,b(n,n,O).call(n,c)),e}return i(n,[{key:"load",value:function(t){var e=y(this,x).getItem("".concat(y(this,g),"/").concat(t));return null===e?null:JSON.parse(e)}},{key:"save",value:function(t,e){y(this,x).setItem("".concat(y(this,g),"/").concat(t),JSON.stringify(e))}}],[{key:"StorageType",get:function(){return{LocalStorage:"localStorage",SessionStorage:"sessionStorage"}}}]),n}(c);function O(t){switch(t){case u.StorageType.LocalStorage:return window.localStorage;case u.StorageType.SessionStorage:return window.sessionStorage;default:return null}}u=k;var j=o(22);function S(t,e,n){return(e=r(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function E(t,e,r,n,o,a,i){try{var u=t[a](i),c=u.value}catch(s){return void r(s)}u.done?e(c):Promise.resolve(c).then(n,o)}function M(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){E(a,n,o,i,u,"next",t)}function u(t){E(a,n,o,i,u,"throw",t)}i(undefined)}))}}var P=o(687);function W(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function _(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?W(Object(r),!0).forEach((function(e){S(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):W(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function D(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=h(t);if(e){var o=h(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}function T(t,e,r){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,r)}var R=new WeakMap,L=function(e){p(u,e);var r,n,o,a=D(u);function u(e){var r,n=e.storageDriver;return t(this,u),T(s(r=a.call(this)),R,{writable:!0,value:null}),v(s(r),R,n),r}return i(u,[{key:"authenticate",value:(o=M(P.mark((function l(t,e){var r,n,o,a;return P.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(e){i.next=2;break}return i.abrupt("return",null);case 2:return r=e.id,n=e.token_refresh,i.next=5,t.callMethod({method:"post"},{payload:{data:{session_id:r,token_refresh:n},url:"/auth/users/refresh"}});case 5:return o=i.sent,a=o.data,i.abrupt("return",_(_({},e),{},{id:r,token_access:a.token_access}));case 8:case"end":return i.stop()}}),l)}))),function(t,e){return o.apply(this,arguments)})},{key:"loadAuthenticationData",value:(n=M(P.mark((function f(){return P.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,y(this,R).load(c.StorageKey.Session);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),f,this)}))),function(){return n.apply(this,arguments)})},{key:"saveAuthenticationData",value:(r=M(P.mark((function h(t){return P.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==undefined){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,y(this,R).save(c.StorageKey.Session,t);case 4:case"end":return e.stop()}}),h,this)}))),function(t){return r.apply(this,arguments)})}]),u}(j.ApiAuthenticator);function C(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=h(t);if(e){var o=h(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}var A=function(e){p(n,e);var r=C(n);function n(){return t(this,n),r.apply(this,arguments)}return i(n,[{key:"connect",value:function(){}},{key:"disconnect",value:function(){}},{key:"subscribe",value:function(){}},{key:"unsubscribe",value:function(){}}]),n}(j.ApiRealtimeTransport),N=o(300);function B(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function q(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?B(Object(r),!0).forEach((function(e){S(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):B(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function z(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=h(t);if(e){var o=h(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}function F(t,e,r){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,r)}function U(t,e,r){var n,o,a,i=t.apiWrapperOptions,u=t.methodData,c=t.payload,s=u.actionName,l=u.method;return[null==c?void 0:c[e],null==i||null===(n=i[s])||void 0===n?void 0:n[e],null==i||null===(o=i[l])||void 0===o?void 0:o[e],null==i||null===(a=i["default"])||void 0===a?void 0:a[e],r].find((function(t){return t!==undefined}))}var G=new WeakMap,I=new WeakMap,K=new WeakMap,J=function(e){p(o,e);var r,n=z(o);function o(e){var r,a=e.getExtraRequestData,i=e.project;t(this,o),F(s(r=n.call(this)),G,{writable:!0,value:null}),F(s(r),I,{writable:!0,value:null}),F(s(r),K,{writable:!0,value:null});var u=i.slug,c=i.tokenPublic;return v(s(r),G,N.create({baseURL:"https://void.void-walkers.com",headers:{Authorization:"Bearer ".concat(c)},timeout:3e4})),v(s(r),I,a),v(s(r),K,u),r}return i(o,[{key:"callMethod",value:(r=M(P.mark((function a(t){var e,r,n,o,i,u,c,s,l,p,f,h,d,v;return P.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return e=t.authenticationData,r=t.methodData,n=t.requestData,o=n.apiWrapperOptions,i=n.payload,u=U({apiWrapperOptions:o,methodData:r,payload:i},"data"),c=U({apiWrapperOptions:o,methodData:r,payload:i},"headers",{}),s=U({apiWrapperOptions:o,methodData:r,payload:i},"method",r.method),l=U({apiWrapperOptions:o,methodData:r,payload:i},"prefix","/projects/".concat(y(this,K))),p=U({apiWrapperOptions:o,methodData:r,payload:i},"timeout",3e4),f=U({apiWrapperOptions:o,methodData:r,payload:i},"url"),h=y(this,I).call(this),d="function"==typeof c?c(i,h):c,v=null!=e&&e.token_access?q({"X-Void-Auth":e.token_access},d):d,a.prev=11,a.next=14,y(this,G).request({timeout:p,data:"function"==typeof u?u(i,h):u,headers:v,method:"function"==typeof s?s(i,h):s,url:l+("function"==typeof f?f(i,h):f)});case 14:return a.abrupt("return",a.sent);case 17:throw a.prev=17,a.t0=a["catch"](11),console.warn(a.t0,a.t0.response),a.t0;case 21:case"end":return a.stop()}}),a,this,[[11,17]])}))),function(t){return r.apply(this,arguments)})},{key:"getCreateMethodData",value:function(){return{actionName:"create",method:"post"}}},{key:"getDeleteMethodData",value:function(){return{actionName:"delete",method:"delete"}}},{key:"getReadMethodData",value:function(){return{actionName:"read",method:"get"}}},{key:"getUpdateMethodData",value:function(){return{actionName:"update",method:"patch"}}},{key:"isAuthenticationFailedError",value:function(t){var e;return 403===(null==t||null===(e=t.response)||void 0===e?void 0:e.status)}},{key:"isSessionExpiredError",value:function(t){var e;return 401===(null==t||null===(e=t.response)||void 0===e?void 0:e.status)}}]),o}(j.ApiTransport);function V(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=h(t);if(e){var o=h(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}var Y={delay:1e3,delayFactor:2,maxDelay:4e3},X=function(e){p(n,e);var r=V(n);function n(e){var o=e.config,a=void 0===o?{}:o,i=e.project,u=e.storageDriver;return t(this,n),r.call(this,{authenticator:new L({storageDriver:u}),realtimeTransport:new A,reconnectConfig:(null==a?void 0:a.reconnectConfig)||Y,transport:new J({project:i,getExtraRequestData:(null==a?void 0:a.getExtraRequestData)||function(){return{}}})})}return i(n)}(j.ApiWrapper),H="authenticate",Q="register";function Z(t,e){tt(t,e),e.add(t)}function $(t,e,r){tt(t,e),e.set(t,r)}function tt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function et(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}var rt=new WeakMap,nt=new WeakMap,ot=new WeakSet,at=new WeakSet,it=new WeakSet,ut=function(){function e(r){var n=r.apiWrapper,o=r.storageDriver;t(this,e),Z(this,it),Z(this,at),Z(this,ot),$(this,rt,{writable:!0,value:null}),$(this,nt,{writable:!0,value:null}),v(this,rt,n),v(this,nt,o)}var r,n,o,a;return i(e,[{key:"getCurrentUser",value:(a=M(P.mark((function u(){return P.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,y(this,nt).load(c.StorageKey.CurrentUser);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),u,this)}))),function(){return a.apply(this,arguments)})},{key:"signInCustom",value:(o=M(P.mark((function s(t){return P.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,et(this,ot,ct).call(this,H,t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),s,this)}))),function(t){return o.apply(this,arguments)})},{key:"signOut",value:(n=M(P.mark((function l(){var t,e,r,n,o=arguments;return P.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return t=o.length>0&&o[0]!==undefined&&o[0],a.next=3,y(this,rt).getAuthenticator().loadAuthenticationData();case 3:return e=a.sent,r=e.id,n=e.token_refresh,a.prev=6,a.next=9,y(this,rt).callMethod({method:"post"},{payload:{data:{session_id:r,token_refresh:n},url:"/auth/users/deauthenticate"}});case 9:a.next=17;break;case 11:if(a.prev=11,a.t0=a["catch"](6),!t){a.next=16;break}return console.warn(a.t0),a.abrupt("return");case 16:throw a.t0;case 17:return a.next=19,et(this,at,lt).call(this,null);case 19:return a.next=21,et(this,it,ft).call(this,null);case 21:case"end":return a.stop()}}),l,this,[[6,11]])}))),function(){return n.apply(this,arguments)})},{key:"signUpCustom",value:(r=M(P.mark((function p(t){return P.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,et(this,ot,ct).call(this,Q,t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),p,this)}))),function(t){return r.apply(this,arguments)})}]),e}();function ct(t,e){return st.apply(this,arguments)}function st(){return(st=M(P.mark((function t(e,r){var n,o,a,i;return P.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,y(this,rt).callMethod({method:"post"},{payload:{data:{payload:r},url:"/auth/users/".concat(e)}});case 2:return n=t.sent,o=n.data,a=o.session,i=o.user,t.next=7,et(this,it,ft).call(this,a);case 7:return t.next=9,et(this,at,lt).call(this,i);case 9:return t.abrupt("return",{session:a,user:i});case 10:case"end":return t.stop()}}),t,this)})))).apply(this,arguments)}function lt(t){return pt.apply(this,arguments)}function pt(){return(pt=M(P.mark((function t(e){return P.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,y(this,nt).save(c.StorageKey.CurrentUser,e);case 2:case"end":return t.stop()}}),t,this)})))).apply(this,arguments)}function ft(t){return ht.apply(this,arguments)}function ht(){return(ht=M(P.mark((function t(e){return P.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,y(this,nt).save(c.StorageKey.Session,e);case 2:case"end":return t.stop()}}),t,this)})))).apply(this,arguments)}function dt(t,e,r){yt(t,e),e.set(t,r)}function yt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}var vt=new WeakMap,wt=new WeakMap,mt=new WeakSet,bt=function(){function e(r){var n,o,a=r.apiWrapper;t(this,e),yt(n=this,o=mt),o.add(n),dt(this,vt,{writable:!0,value:null}),dt(this,wt,{writable:!0,value:new Map}),v(this,vt,a)}return i(e,[{key:"getFunction",value:function(t){var e=this,r=y(this,wt).get(t);return r||(r=function(){for(var r,n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return(r=function(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}(e,mt,gt)).call.apply(r,[e,t].concat(o))},y(this,wt).set(t,r)),r}}]),e}();function gt(t,e){return xt.apply(this,arguments)}function xt(){return(xt=M(P.mark((function t(e,r){var n;return P.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,y(this,vt).callMethod({method:"post"},{payload:{data:r,url:"/functions/".concat(e)}},!0);case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t,this)})))).apply(this,arguments)}function kt(t,e,r){Ot(t,e),e.set(t,r)}function Ot(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function jt(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}var St=new WeakMap,Et=new WeakMap,Mt=new WeakMap,Pt=new WeakSet,Wt=function(){function e(r){var n,o,a=r.apiWrapper,i=r.database,u=r.name;t(this,e),Ot(n=this,o=Pt),o.add(n),kt(this,St,{writable:!0,value:null}),kt(this,Et,{writable:!0,value:null}),kt(this,Mt,{writable:!0,value:null}),v(this,St,a),v(this,Et,i),v(this,Mt,u)}var r,n,o,a,u,c,s,l,p,f;return i(e,[{key:"deleteMany",value:(f=M(P.mark((function h(){var t,e=arguments;return P.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return t=e.length>0&&e[0]!==undefined?e[0]:{},r.next=3,jt(this,Pt,_t).call(this,"deleteMany",{filter:t});case 3:return r.abrupt("return",r.sent);case 4:case"end":return r.stop()}}),h,this)}))),function(){return f.apply(this,arguments)})},{key:"deleteOne",value:(p=M(P.mark((function d(){var t,e=arguments;return P.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return t=e.length>0&&e[0]!==undefined?e[0]:{},r.next=3,jt(this,Pt,_t).call(this,"deleteOne",{filter:t});case 3:return r.abrupt("return",r.sent);case 4:case"end":return r.stop()}}),d,this)}))),function(){return p.apply(this,arguments)})},{key:"find",value:(l=M(P.mark((function y(){var t,e,r=arguments;return P.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t=r.length>0&&r[0]!==undefined?r[0]:{},e=r.length>1&&r[1]!==undefined?r[1]:{},n.next=4,jt(this,Pt,_t).call(this,"find",{filter:t,options:e});case 4:return n.abrupt("return",n.sent);case 5:case"end":return n.stop()}}),y,this)}))),function(){return l.apply(this,arguments)})},{key:"findOne",value:(s=M(P.mark((function w(t){return P.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,jt(this,Pt,_t).call(this,"findOne",{filter:t});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),w,this)}))),function(t){return s.apply(this,arguments)})},{key:"findOneAndUpdate",value:(c=M(P.mark((function m(t,e){var r,n=arguments;return P.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return r=n.length>2&&n[2]!==undefined?n[2]:{},o.next=3,jt(this,Pt,_t).call(this,"findOneAndUpdate",{filter:t,options:r,update:e});case 3:return o.abrupt("return",o.sent);case 4:case"end":return o.stop()}}),m,this)}))),function(t,e){return c.apply(this,arguments)})},{key:"insertMany",value:(u=M(P.mark((function b(t){return P.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,jt(this,Pt,_t).call(this,"insertMany",{docs:t});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),b,this)}))),function(t){return u.apply(this,arguments)})},{key:"insertOne",value:(a=M(P.mark((function g(t){return P.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,jt(this,Pt,_t).call(this,"insertOne",{doc:t});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),g,this)}))),function(t){return a.apply(this,arguments)})},{key:"replaceOne",value:(o=M(P.mark((function x(t,e){var r,n=arguments;return P.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return r=n.length>2&&n[2]!==undefined?n[2]:{},o.next=3,jt(this,Pt,_t).call(this,"replaceOne",{filter:t,options:r,replacement:e});case 3:return o.abrupt("return",o.sent);case 4:case"end":return o.stop()}}),x,this)}))),function(t,e){return o.apply(this,arguments)})},{key:"updateMany",value:(n=M(P.mark((function k(t,e){var r,n=arguments;return P.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return r=n.length>2&&n[2]!==undefined?n[2]:{},o.next=3,jt(this,Pt,_t).call(this,"updateMany",{filter:t,options:r,update:e});case 3:return o.abrupt("return",o.sent);case 4:case"end":return o.stop()}}),k,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"updateOne",value:(r=M(P.mark((function O(t,e){var r,n=arguments;return P.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return r=n.length>2&&n[2]!==undefined?n[2]:{},o.next=3,jt(this,Pt,_t).call(this,"updateOne",{filter:t,options:r,update:e});case 3:return o.abrupt("return",o.sent);case 4:case"end":return o.stop()}}),O,this)}))),function(t,e){return r.apply(this,arguments)})}]),e}();function _t(t){return Dt.apply(this,arguments)}function Dt(){return Dt=M(P.mark((function t(e){var r,n,o=arguments;return P.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=o.length>1&&o[1]!==undefined?o[1]:{},t.next=3,y(this,St).callMethod({method:"post"},{payload:{data:{method:e,params:r,collection:y(this,Mt)},url:"/mongo/".concat(y(this,Et).name,"/query")}},!0);case 3:return n=t.sent,t.abrupt("return",n.data);case 5:case"end":return t.stop()}}),t,this)}))),Dt.apply(this,arguments)}function Tt(t,e,r){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,r)}var Rt=new WeakMap,Lt=new WeakMap,Ct=new WeakMap,At=function(){function e(r){var n=r.apiWrapper,o=r.name;t(this,e),Tt(this,Rt,{writable:!0,value:null}),Tt(this,Lt,{writable:!0,value:new Map}),Tt(this,Ct,{writable:!0,value:null}),v(this,Rt,n),v(this,Ct,o)}return i(e,[{key:"collection",value:function(t){var e=y(this,Lt).get(t);return e||(e=new Wt({name:t,apiWrapper:y(this,Rt),database:this}),y(this,Lt).set(t,e)),e}},{key:"name",get:function(){return y(this,Ct)}}]),e}();function Nt(t,e,r){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,r)}var Bt=new WeakMap,qt=new WeakMap,zt=function(){function e(r){var n=r.apiWrapper;t(this,e),Nt(this,Bt,{writable:!0,value:null}),Nt(this,qt,{writable:!0,value:new Map}),v(this,Bt,n)}return i(e,[{key:"collection",value:function(t){return this.db().collection(t)}},{key:"db",value:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"default",e=y(this,qt).get(t);return e||(e=new At({name:t,apiWrapper:y(this,Bt)}),y(this,qt).set(t,e)),e}}]),e}();function Ft(t,e,r){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,r)}var Ut=new WeakMap,Gt=new WeakMap,It=new WeakMap,Kt=function(){function e(r){var n=r.apiWrapperConfig,o=void 0===n?{}:n,a=r.project,i=r.storageDriver;t(this,e),Ft(this,Ut,{writable:!0,value:null}),Ft(this,Gt,{writable:!0,value:null}),Ft(this,It,{writable:!0,value:null}),i||(i="undefined"!=typeof window&&"undefined"!=typeof window.document?new k:null);var u=new X({project:a,storageDriver:i,config:o});v(this,Ut,new ut({apiWrapper:u,storageDriver:i})),v(this,Gt,new bt({apiWrapper:u})),v(this,It,new zt({apiWrapper:u}))}return i(e,[{key:"auth",get:function(){return y(this,Ut)}},{key:"function",value:function(t){return y(this,Gt).getFunction(t)}},{key:"mongo",get:function(){return y(this,It)}}]),e}()})(),a})())); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@ololoepepe/api-wrapper"),require("axios")):"function"==typeof define&&define.amd?define(["@ololoepepe/api-wrapper","axios"],t):"object"==typeof exports?exports.voidClient=t(require("@ololoepepe/api-wrapper"),require("axios")):e.voidClient=t(e["@ololoepepe/api-wrapper"],e.axios)}(self,((e,t)=>(()=>{var n={187:e=>{"use strict";var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(n,r){function o(n){e.removeListener(t,i),r(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}v(e,t,i,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&v(e,"error",t,n)}(e,o,{once:!0})}))},i.EventEmitter=i,i.prototype._events=undefined,i.prototype._eventsCount=0,i.prototype._maxListeners=undefined;var a=10;function u(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function s(e){return e._maxListeners===undefined?i.defaultMaxListeners:e._maxListeners}function c(e,t,n,r){var o,i,a,c;if(u(n),(i=e._events)===undefined?(i=e._events=Object.create(null),e._eventsCount=0):(i.newListener!==undefined&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),a=i[t]),a===undefined)a=i[t]=n,++e._eventsCount;else if("function"==typeof a?a=i[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(o=s(e))>0&&a.length>o&&!a.warned){a.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=e,f.type=t,f.count=a.length,c=f,console&&console.warn&&console.warn(c)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,n){var r={fired:!1,wrapFn:undefined,target:e,type:t,listener:n},o=f.bind(r);return o.listener=n,r.wrapFn=o,o}function p(e,t,n){var r=e._events;if(r===undefined)return[];var o=r[t];return o===undefined?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):d(o,o.length)}function h(e){var t=this._events;if(t!==undefined){var n=t[e];if("function"==typeof n)return 1;if(n!==undefined)return n.length}return 0}function d(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function v(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){r.once&&e.removeEventListener(t,o),n(i)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),i.init=function(){this._events!==undefined&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||undefined},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return s(this)},i.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var o="error"===e,i=this._events;if(i!==undefined)o=o&&i.error===undefined;else if(!o)return!1;if(o){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var u=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw u.context=a,u}var s=i[e];if(s===undefined)return!1;if("function"==typeof s)r(s,this,t);else{var c=s.length,f=d(s,c);for(n=0;n<c;++n)r(f[n],this,t)}return!0},i.prototype.addListener=function(e,t){return c(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return c(this,e,t,!0)},i.prototype.once=function(e,t){return u(t),this.on(e,l(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return u(t),this.prependListener(e,l(this,e,t)),this},i.prototype.removeListener=function(e,t){var n,r,o,i,a;if(u(t),(r=this._events)===undefined)return this;if((n=r[e])===undefined)return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){a=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),r.removeListener!==undefined&&this.emit("removeListener",e,a||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,n,r;if((n=this._events)===undefined)return this;if(n.removeListener===undefined)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):n[e]!==undefined&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(t!==undefined)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},i.prototype.listeners=function(e){return p(this,e,!0)},i.prototype.rawListeners=function(e){return p(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},i.prototype.listenerCount=h,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},22:t=>{"use strict";t.exports=e},300:e=>{"use strict";e.exports=t},61:(e,t,n)=>{var r=n(698)["default"];function o(){"use strict";e.exports=o=function(){return n},e.exports.__esModule=!0,e.exports["default"]=e.exports;var t,n={},i=Object.prototype,a=i.hasOwnProperty,u=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},c=s.iterator||"@@iterator",f=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function p(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(t){p=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),a=new T(r||[]);return u(i,"_invoke",{value:P(e,n,a)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=h;var v="suspendedStart",y="suspendedYield",w="executing",m="completed",g={};function b(){}function x(){}function k(){}var O={};p(O,c,(function(){return this}));var j=Object.getPrototypeOf,_=j&&j(j(D([])));_&&_!==i&&a.call(_,c)&&(O=_);var L=k.prototype=b.prototype=Object.create(O);function E(e){["next","throw","return"].forEach((function(t){p(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function n(o,i,u,s){var c=d(e[o],e,i);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==r(l)&&a.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,u,s)}),(function(e){n("throw",e,u,s)})):t.resolve(l).then((function(e){f.value=e,u(f)}),(function(e){return n("throw",e,u,s)}))}s(c.arg)}var o;u(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function P(e,n,r){var o=v;return function(i,a){if(o===w)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var s=M(u,r);if(s){if(s===g)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===v)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=w;var c=d(e,n,r);if("normal"===c.type){if(o=r.done?m:y,c.arg===g)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=m,r.method="throw",r.arg=c.arg)}}}function M(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator["return"]&&(n.method="return",n.arg=t,M(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function W(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function D(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(a.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(r(e)+" is not iterable")}return x.prototype=k,u(L,"constructor",{value:k,configurable:!0}),u(k,"constructor",{value:x,configurable:!0}),x.displayName=p(k,l,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===x||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,k):(e.__proto__=k,p(e,l,"GeneratorFunction")),e.prototype=Object.create(L),e},n.awrap=function(e){return{__await:e}},E(S.prototype),p(S.prototype,f,(function(){return this})),n.AsyncIterator=S,n.async=function(e,t,r,o,i){void 0===i&&(i=Promise);var a=new S(h(e,t,r,o),i);return n.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(L),p(L,l,"Generator"),p(L,c,(function(){return this})),p(L,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function o(){for(;n.length;){var e=n.pop();if(e in t)return o.value=e,o.done=!1,o}return o.done=!0,o}},n.values=D,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(W),!e)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),c=a.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),W(n),g}},"catch":function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;W(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:D(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},n}e.exports=o,e.exports.__esModule=!0,e.exports["default"]=e.exports},698:e=>{function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports["default"]=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports["default"]=e.exports},687:(e,t,n)=>{var r=n(61)();e.exports=r;try{regeneratorRuntime=r}catch(o){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},r={};function o(e){var t=r[e];if(t!==undefined)return t.exports;var i=r[e]={exports:{}};return n[e](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function n(e){var n=function(e,n){if("object"!==t(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(r!==undefined){var o=r.call(e,n||"default");if("object"!==t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"===t(n)?n:String(n)}function r(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,n(o.key),o)}}function a(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}o.r(i),o.d(i,{StorageDriver:()=>s,StorageDriverLocalStorage:()=>k,VoidClient:()=>Ve});var u,s=function(){function t(){e(this,t)}return a(t,[{key:"load",value:function(){throw new Error("[StorageDriver.load] Method not implemented")}},{key:"save",value:function(){throw new Error("[StorageDriver.save] Method not implemented")}}],[{key:"StorageKey",get:function(){return{CurrentUser:"current_user",Session:"session"}}}]),t}();function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}function p(e,n){if(n&&("object"===t(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return c(e)}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function d(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function v(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,d(e,t,"get"))}function y(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,d(e,t,"set"),n),n}function w(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}function m(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}function g(e,t,n){return function(e,t){if(e!==t)throw new TypeError("Private static access of wrong provenance")}(e,t),n}var b=new WeakMap,x=new WeakMap,k=function(t){l(r,t);var n=w(r);function r(){var t,o=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},i=o.prefix,a=void 0===i?"void":i,u=o.storageType,s=void 0===u?r.StorageType.LocalStorage:u;return e(this,r),m(c(t=n.call(this)),b,{writable:!0,value:null}),m(c(t),x,{writable:!0,value:null}),y(c(t),b,a),y(c(t),x,g(r,r,O).call(r,s)),t}return a(r,[{key:"load",value:function(e){var t=v(this,x).getItem("".concat(v(this,b),"/").concat(e));return null===t?null:JSON.parse(t)}},{key:"save",value:function(e,t){v(this,x).setItem("".concat(v(this,b),"/").concat(e),JSON.stringify(t))}}],[{key:"StorageType",get:function(){return{LocalStorage:"localStorage",SessionStorage:"sessionStorage"}}}]),r}(s);function O(e){switch(e){case u.StorageType.LocalStorage:return window.localStorage;case u.StorageType.SessionStorage:return window.sessionStorage;default:return null}}u=k;var j=o(22);function _(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function L(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(c){return void n(c)}u.done?t(s):Promise.resolve(s).then(r,o)}function E(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){L(i,r,o,a,u,"next",e)}function u(e){L(i,r,o,a,u,"throw",e)}a(undefined)}))}}var S=o(687);function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function M(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(Object(n),!0).forEach((function(t){_(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function R(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}function W(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}var T=new WeakMap,D=function(t){l(u,t);var n,r,o,i=R(u);function u(t){var n,r=t.storageDriver;return e(this,u),W(c(n=i.call(this)),T,{writable:!0,value:null}),y(c(n),T,r),n}return a(u,[{key:"authenticate",value:(o=E(S.mark((function f(e,t){var n,r,o,i;return S.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(t){a.next=2;break}return a.abrupt("return",null);case 2:return n=t.id,r=t.token_refresh,a.next=5,e.callMethod({method:"post"},{payload:{data:{session_id:n,token_refresh:r},url:"/auth/users/refresh"}});case 5:return o=a.sent,i=o.data,a.abrupt("return",M(M({},t),{},{id:n,token_access:i.token_access}));case 8:case"end":return a.stop()}}),f)}))),function(e,t){return o.apply(this,arguments)})},{key:"loadAuthenticationData",value:(r=E(S.mark((function p(){return S.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v(this,T).load(s.StorageKey.Session);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),p,this)}))),function(){return r.apply(this,arguments)})},{key:"saveAuthenticationData",value:(n=E(S.mark((function h(e){return S.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e!==undefined){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,v(this,T).save(s.StorageKey.Session,e);case 4:case"end":return t.stop()}}),h,this)}))),function(e){return n.apply(this,arguments)})}]),u}(j.ApiAuthenticator);function C(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}var A=function(t){l(r,t);var n=C(r);function r(){return e(this,r),n.apply(this,arguments)}return a(r,[{key:"connect",value:function(){}},{key:"disconnect",value:function(){}},{key:"subscribe",value:function(){}},{key:"unsubscribe",value:function(){}}]),r}(j.ApiRealtimeTransport),N=o(300);function F(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function B(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?F(Object(n),!0).forEach((function(t){_(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function U(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}function q(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}function z(e,t,n){var r,o,i,a=e.apiWrapperOptions,u=e.methodData,s=e.payload,c=u.actionName,f=u.method;return[null==s?void 0:s[t],null==a||null===(r=a[c])||void 0===r?void 0:r[t],null==a||null===(o=a[f])||void 0===o?void 0:o[t],null==a||null===(i=a["default"])||void 0===i?void 0:i[t],n].find((function(e){return e!==undefined}))}var G=new WeakMap,I=new WeakMap,K=new WeakMap,J=function(t){l(o,t);var n,r=U(o);function o(t){var n,i=t.getExtraRequestData,a=t.project;e(this,o),q(c(n=r.call(this)),G,{writable:!0,value:null}),q(c(n),I,{writable:!0,value:null}),q(c(n),K,{writable:!0,value:null});var u=a.slug,s=a.tokenPublic;return y(c(n),G,N.create({baseURL:"https://void.void-walkers.com",headers:{Authorization:"Bearer ".concat(s)},timeout:3e4})),y(c(n),I,i),y(c(n),K,u),n}return a(o,[{key:"callMethod",value:(n=E(S.mark((function i(e){var t,n,r,o,a,u,s,c,f,l,p,h,d,y;return S.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return t=e.authenticationData,n=e.methodData,r=e.requestData,o=r.apiWrapperOptions,a=r.payload,u=z({apiWrapperOptions:o,methodData:n,payload:a},"data"),s=z({apiWrapperOptions:o,methodData:n,payload:a},"headers",{}),c=z({apiWrapperOptions:o,methodData:n,payload:a},"method",n.method),f=z({apiWrapperOptions:o,methodData:n,payload:a},"prefix","/projects/".concat(v(this,K))),l=z({apiWrapperOptions:o,methodData:n,payload:a},"timeout",3e4),p=z({apiWrapperOptions:o,methodData:n,payload:a},"url"),h=v(this,I).call(this),d="function"==typeof s?s(a,h):s,y=null!=t&&t.token_access?B({"X-Void-Auth":t.token_access},d):d,i.prev=11,i.next=14,v(this,G).request({timeout:l,data:"function"==typeof u?u(a,h):u,headers:y,method:"function"==typeof c?c(a,h):c,url:f+("function"==typeof p?p(a,h):p)});case 14:return i.abrupt("return",i.sent);case 17:throw i.prev=17,i.t0=i["catch"](11),console.warn(i.t0,i.t0.response),i.t0;case 21:case"end":return i.stop()}}),i,this,[[11,17]])}))),function(e){return n.apply(this,arguments)})},{key:"getCreateMethodData",value:function(){return{actionName:"create",method:"post"}}},{key:"getDeleteMethodData",value:function(){return{actionName:"delete",method:"delete"}}},{key:"getReadMethodData",value:function(){return{actionName:"read",method:"get"}}},{key:"getUpdateMethodData",value:function(){return{actionName:"update",method:"patch"}}},{key:"isAuthenticationFailedError",value:function(e){var t;return 403===(null==e||null===(t=e.response)||void 0===t?void 0:t.status)}},{key:"isSessionExpiredError",value:function(e){var t;return 401===(null==e||null===(t=e.response)||void 0===t?void 0:t.status)}}]),o}(j.ApiTransport);function V(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}var Y={delay:1e3,delayFactor:2,maxDelay:4e3},X=function(t){l(r,t);var n=V(r);function r(t){var o=t.config,i=void 0===o?{}:o,a=t.project,u=t.storageDriver;return e(this,r),n.call(this,{authenticator:new D({storageDriver:u}),realtimeTransport:new A,reconnectConfig:(null==i?void 0:i.reconnectConfig)||Y,transport:new J({project:a,getExtraRequestData:(null==i?void 0:i.getExtraRequestData)||function(){return{}}})})}return a(r)}(j.ApiWrapper),H=o(187),Q="authenticate",Z="register";function $(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}function ee(e,t){ne(e,t),t.add(e)}function te(e,t,n){ne(e,t),t.set(e,n)}function ne(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function re(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}var oe=new WeakMap,ie=new WeakMap,ae=new WeakSet,ue=new WeakSet,se=new WeakSet,ce=function(t){l(f,t);var n,r,o,i,u=$(f);function f(t){var n,r=t.apiWrapper,o=t.storageDriver;return e(this,f),ee(c(n=u.call(this)),se),ee(c(n),ue),ee(c(n),ae),te(c(n),oe,{writable:!0,value:null}),te(c(n),ie,{writable:!0,value:null}),y(c(n),oe,r),y(c(n),ie,o),n}return a(f,[{key:"getCurrentUser",value:(i=E(S.mark((function p(){return S.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v(this,ie).load(s.StorageKey.CurrentUser);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),p,this)}))),function(){return i.apply(this,arguments)})},{key:"signInCustom",value:(o=E(S.mark((function h(e){return S.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,re(this,ae,fe).call(this,Q,e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),h,this)}))),function(e){return o.apply(this,arguments)})},{key:"signOut",value:(r=E(S.mark((function d(){var e,t,n,r,o=arguments;return S.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return e=o.length>0&&o[0]!==undefined&&o[0],i.next=3,v(this,oe).getAuthenticator().loadAuthenticationData();case 3:return t=i.sent,n=t.id,r=t.token_refresh,i.prev=6,i.next=9,v(this,oe).callMethod({method:"post"},{payload:{data:{session_id:n,token_refresh:r},url:"/auth/users/deauthenticate"}});case 9:i.next=16;break;case 11:if(i.prev=11,i.t0=i["catch"](6),e){i.next=15;break}throw i.t0;case 15:console.warn(i.t0);case 16:return i.next=18,re(this,ue,pe).call(this,null);case 18:return i.next=20,re(this,se,de).call(this,null);case 20:case"end":return i.stop()}}),d,this,[[6,11]])}))),function(){return r.apply(this,arguments)})},{key:"signUpCustom",value:(n=E(S.mark((function w(e){return S.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,re(this,ae,fe).call(this,Z,e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),w,this)}))),function(e){return n.apply(this,arguments)})}]),f}(H);function fe(e,t){return le.apply(this,arguments)}function le(){return(le=E(S.mark((function e(t,n){var r,o,i,a;return S.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v(this,oe).callMethod({method:"post"},{payload:{data:{payload:n},url:"/auth/users/".concat(t)}});case 2:return r=e.sent,o=r.data,i=o.session,a=o.user,e.next=7,re(this,se,de).call(this,i);case 7:return e.next=9,re(this,ue,pe).call(this,a);case 9:return e.abrupt("return",{session:i,user:a});case 10:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function pe(e){return he.apply(this,arguments)}function he(){return(he=E(S.mark((function e(t){return S.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v(this,ie).save(s.StorageKey.CurrentUser,t);case 2:this.emit("currentUserChange");case 3:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function de(e){return ve.apply(this,arguments)}function ve(){return(ve=E(S.mark((function e(t){return S.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v(this,ie).save(s.StorageKey.Session,t);case 2:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function ye(e,t,n){we(e,t),t.set(e,n)}function we(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}var me=new WeakMap,ge=new WeakMap,be=new WeakSet,xe=function(){function t(n){var r,o,i=n.apiWrapper;e(this,t),we(r=this,o=be),o.add(r),ye(this,me,{writable:!0,value:null}),ye(this,ge,{writable:!0,value:new Map}),y(this,me,i)}return a(t,[{key:"getFunction",value:function(e){var t=this,n=v(this,ge).get(e);return n||(n=function(){for(var n,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return(n=function(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}(t,be,ke)).call.apply(n,[t,e].concat(o))},v(this,ge).set(e,n)),n}}]),t}();function ke(e,t){return Oe.apply(this,arguments)}function Oe(){return(Oe=E(S.mark((function e(t,n){var r;return S.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v(this,me).callMethod({method:"post"},{payload:{data:n,url:"/functions/".concat(t)}},!0);case 2:return r=e.sent,e.abrupt("return",r.data);case 4:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function je(e,t,n){_e(e,t),t.set(e,n)}function _e(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Le(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}var Ee=new WeakMap,Se=new WeakMap,Pe=new WeakMap,Me=new WeakSet,Re=function(){function t(n){var r,o,i=n.apiWrapper,a=n.database,u=n.name;e(this,t),_e(r=this,o=Me),o.add(r),je(this,Ee,{writable:!0,value:null}),je(this,Se,{writable:!0,value:null}),je(this,Pe,{writable:!0,value:null}),y(this,Ee,i),y(this,Se,a),y(this,Pe,u)}var n,r,o,i,u,s,c,f,l,p;return a(t,[{key:"deleteMany",value:(p=E(S.mark((function h(){var e,t=arguments;return S.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e=t.length>0&&t[0]!==undefined?t[0]:{},n.next=3,Le(this,Me,We).call(this,"deleteMany",{filter:e});case 3:return n.abrupt("return",n.sent);case 4:case"end":return n.stop()}}),h,this)}))),function(){return p.apply(this,arguments)})},{key:"deleteOne",value:(l=E(S.mark((function d(){var e,t=arguments;return S.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e=t.length>0&&t[0]!==undefined?t[0]:{},n.next=3,Le(this,Me,We).call(this,"deleteOne",{filter:e});case 3:return n.abrupt("return",n.sent);case 4:case"end":return n.stop()}}),d,this)}))),function(){return l.apply(this,arguments)})},{key:"find",value:(f=E(S.mark((function v(){var e,t,n=arguments;return S.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return e=n.length>0&&n[0]!==undefined?n[0]:{},t=n.length>1&&n[1]!==undefined?n[1]:{},r.next=4,Le(this,Me,We).call(this,"find",{filter:e,options:t});case 4:return r.abrupt("return",r.sent);case 5:case"end":return r.stop()}}),v,this)}))),function(){return f.apply(this,arguments)})},{key:"findOne",value:(c=E(S.mark((function w(e){return S.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Le(this,Me,We).call(this,"findOne",{filter:e});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),w,this)}))),function(e){return c.apply(this,arguments)})},{key:"findOneAndUpdate",value:(s=E(S.mark((function m(e,t){var n,r=arguments;return S.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return n=r.length>2&&r[2]!==undefined?r[2]:{},o.next=3,Le(this,Me,We).call(this,"findOneAndUpdate",{filter:e,options:n,update:t});case 3:return o.abrupt("return",o.sent);case 4:case"end":return o.stop()}}),m,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"insertMany",value:(u=E(S.mark((function g(e){return S.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Le(this,Me,We).call(this,"insertMany",{docs:e});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),g,this)}))),function(e){return u.apply(this,arguments)})},{key:"insertOne",value:(i=E(S.mark((function b(e){return S.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Le(this,Me,We).call(this,"insertOne",{doc:e});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),b,this)}))),function(e){return i.apply(this,arguments)})},{key:"replaceOne",value:(o=E(S.mark((function x(e,t){var n,r=arguments;return S.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return n=r.length>2&&r[2]!==undefined?r[2]:{},o.next=3,Le(this,Me,We).call(this,"replaceOne",{filter:e,options:n,replacement:t});case 3:return o.abrupt("return",o.sent);case 4:case"end":return o.stop()}}),x,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"updateMany",value:(r=E(S.mark((function k(e,t){var n,r=arguments;return S.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return n=r.length>2&&r[2]!==undefined?r[2]:{},o.next=3,Le(this,Me,We).call(this,"updateMany",{filter:e,options:n,update:t});case 3:return o.abrupt("return",o.sent);case 4:case"end":return o.stop()}}),k,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"updateOne",value:(n=E(S.mark((function O(e,t){var n,r=arguments;return S.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return n=r.length>2&&r[2]!==undefined?r[2]:{},o.next=3,Le(this,Me,We).call(this,"updateOne",{filter:e,options:n,update:t});case 3:return o.abrupt("return",o.sent);case 4:case"end":return o.stop()}}),O,this)}))),function(e,t){return n.apply(this,arguments)})}]),t}();function We(e){return Te.apply(this,arguments)}function Te(){return Te=E(S.mark((function e(t){var n,r,o=arguments;return S.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>1&&o[1]!==undefined?o[1]:{},e.next=3,v(this,Ee).callMethod({method:"post"},{payload:{data:{method:t,params:n,collection:v(this,Pe)},url:"/mongo/".concat(v(this,Se).name,"/query")}},!0);case 3:return r=e.sent,e.abrupt("return",r.data);case 5:case"end":return e.stop()}}),e,this)}))),Te.apply(this,arguments)}function De(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}var Ce=new WeakMap,Ae=new WeakMap,Ne=new WeakMap,Fe=function(){function t(n){var r=n.apiWrapper,o=n.name;e(this,t),De(this,Ce,{writable:!0,value:null}),De(this,Ae,{writable:!0,value:new Map}),De(this,Ne,{writable:!0,value:null}),y(this,Ce,r),y(this,Ne,o)}return a(t,[{key:"collection",value:function(e){var t=v(this,Ae).get(e);return t||(t=new Re({name:e,apiWrapper:v(this,Ce),database:this}),v(this,Ae).set(e,t)),t}},{key:"name",get:function(){return v(this,Ne)}}]),t}();function Be(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}var Ue=new WeakMap,qe=new WeakMap,ze=function(){function t(n){var r=n.apiWrapper;e(this,t),Be(this,Ue,{writable:!0,value:null}),Be(this,qe,{writable:!0,value:new Map}),y(this,Ue,r)}return a(t,[{key:"collection",value:function(e){return this.db().collection(e)}},{key:"db",value:function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"default",t=v(this,qe).get(e);return t||(t=new Fe({name:e,apiWrapper:v(this,Ue)}),v(this,qe).set(e,t)),t}}]),t}();function Ge(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}var Ie=new WeakMap,Ke=new WeakMap,Je=new WeakMap,Ve=function(){function t(n){var r=n.apiWrapperConfig,o=void 0===r?{}:r,i=n.project,a=n.storageDriver;e(this,t),Ge(this,Ie,{writable:!0,value:null}),Ge(this,Ke,{writable:!0,value:null}),Ge(this,Je,{writable:!0,value:null}),a||(a="undefined"!=typeof window&&"undefined"!=typeof window.document?new k:null);var u=new X({project:i,storageDriver:a,config:o});y(this,Ie,new ce({apiWrapper:u,storageDriver:a})),y(this,Ke,new xe({apiWrapper:u})),y(this,Je,new ze({apiWrapper:u}))}return a(t,[{key:"auth",get:function(){return v(this,Ie)}},{key:"function",value:function(e){return v(this,Ke).getFunction(e)}},{key:"mongo",get:function(){return v(this,Je)}}]),t}()})(),i})())); | ||
//# sourceMappingURL=index.browser.js.map |
{ | ||
"name": "@voidwalkers/void-client", | ||
"version": "0.1.10", | ||
"version": "0.1.11", | ||
"description": "Client lib for Void Walkers Void", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -0,5 +1,7 @@ | ||
import EventEmitter from 'events'; | ||
import {AuthIntent} from '#src/lib/constants.js'; | ||
import {StorageDriver} from '#src/lib/storage-drivers/index.js'; | ||
export default class Auth { | ||
export default class Auth extends EventEmitter { | ||
#apiWrapper = null; | ||
@@ -9,2 +11,4 @@ #storageDriver = null; | ||
constructor({apiWrapper, storageDriver}) { | ||
super(); | ||
this.#apiWrapper = apiWrapper; | ||
@@ -39,9 +43,7 @@ this.#storageDriver = storageDriver; | ||
} catch (err) { | ||
if (ignoreError) { | ||
console.warn(err); | ||
return; | ||
if (!ignoreError) { | ||
throw err; | ||
} | ||
throw err; | ||
console.warn(err); | ||
} | ||
@@ -75,2 +77,4 @@ | ||
await this.#storageDriver.save(StorageDriver.StorageKey.CurrentUser, user); | ||
this.emit('currentUserChange'); | ||
} | ||
@@ -77,0 +81,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
154125
598