@hierotech/api-wrapper
Advanced tools
Comparing version 0.0.14 to 0.0.15
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@ololoepepe/api-wrapper"),require("@hierotech/common"),require("axios")):"function"==typeof define&&define.amd?define(["@ololoepepe/api-wrapper","@hierotech/common","axios"],e):"object"==typeof exports?exports.hierotechApiWrapper=e(require("@ololoepepe/api-wrapper"),require("@hierotech/common"),require("axios")):t.hierotechApiWrapper=e(t["@ololoepepe/api-wrapper"],t["@hierotech/common"],t.axios)}(self,(function(t,e,r){return(()=>{var n={757:(t,e,r)=>{t.exports=r(666)},666:t=>{var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(D){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,i=Object.create(o.prototype),a=new E(n||[]);return i._invoke=function(t,e,r){var n=f;return function(o,i){if(n===h)throw new Error("Generator is already running");if(n===d){if("throw"===o)throw i;return L()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=O(a,r);if(c){if(c===y)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var u=l(t,e,r);if("normal"===u.type){if(n=r.done?d:p,u.arg===y)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=d,r.method="throw",r.arg=u.arg)}}}(t,r,a),i}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(D){return{type:"throw",arg:D}}}t.wrap=s;var f="suspendedStart",p="suspendedYield",h="executing",d="completed",y={};function v(){}function m(){}function g(){}var b={};u(b,i,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(j([])));_&&_!==r&&n.call(_,i)&&(b=_);var k=g.prototype=v.prototype=Object.create(b);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(o,i,a,c){var u=l(t[o],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==typeof f&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function O(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator["return"]&&(r.method="return",r.arg=e,O(t,r),"throw"===r.method))return y;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var o=l(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,y;var i=o.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,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function A(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 R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function j(t){if(t){var r=t[i];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(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:L}}function L(){return{value:e,done:!0}}return m.prototype=g,u(k,"constructor",g),u(g,"constructor",m),m.displayName=u(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},t.awrap=function(t){return{__await:t}},x(S.prototype),u(S.prototype,a,(function(){return this})),t.AsyncIterator=S,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new S(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(k),u(k,c,"Generator"),u(k,i,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=j,E.prototype={constructor:E,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(R),!t)for(var r in this)"t"===r.charAt(0)&&n.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 o(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):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),y},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),R(r),y}},"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;R(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:j(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}(t.exports);try{regeneratorRuntime=e}catch(r){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},204:t=>{"use strict";t.exports=e},22:e=>{"use strict";e.exports=t},300:t=>{"use strict";t.exports=r}},o={};function i(t){var e=o[t];if(e!==undefined)return e.exports;var r=o[t]={exports:{}};return n[t](r,r.exports,i),r.exports}i.n=t=>{var e=t&&t.__esModule?()=>t["default"]:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.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){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function e(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){return n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(t,e)}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");Object.defineProperty(t,"prototype",{value:Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),writable:!1}),e&&n(t,e)}function c(t){return c="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},c(t)}function u(t,e){if(e&&("object"===c(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},s(t)}i.r(a),i.d(a,{"default":()=>D});var l=i(22);function f(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(s){return void r(s)}c.done?e(u):Promise.resolve(u).then(n,o)}function p(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){f(i,n,o,a,c,"next",t)}function c(t){f(i,n,o,a,c,"throw",t)}a(undefined)}))}}var h=i(757),d=i.n(h);function y(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=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u(this,r)}}var v=function(t){o(u,t);var n,i,a,c=y(u);function u(t){var e,n=t.dispatchSetTokenAccess,o=t.getStore,i=t.selectSessionData;return r(this,u),(e=c.call(this))._dispatchSetTokenAccess=n,e._selectSessionData=i,e._getStore=o,e}return e(u,[{key:"authenticate",value:(a=p(d().mark((function s(t,e){var r,n,o,i;return d().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(e){a.next=2;break}return a.abrupt("return",null);case 2:return r=e.sessionId,n=e.tokenRefresh,a.next=5,t.callMethod({method:"patch"},{payload:{data:{token_refresh:n},url:"/auth/sessions/".concat(r)}});case 5:return o=a.sent,i=o.data.token_access,a.abrupt("return",{sessionId:r,tokenAccess:i,tokenRefresh:n});case 8:case"end":return a.stop()}}),s)}))),function(t,e){return a.apply(this,arguments)})},{key:"loadAuthenticationData",value:(i=p(d().mark((function l(){var t,e,r,n,o;return d().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return t=this._selectSessionData(this._getStore().getState()),e=t.isLoggedIn,r=t.sessionId,n=t.tokenAccess,o=t.tokenRefresh,i.abrupt("return",e?{sessionId:r,tokenAccess:n,tokenRefresh:o}:null);case 2:case"end":return i.stop()}}),l,this)}))),function(){return i.apply(this,arguments)})},{key:"saveAuthenticationData",value:(n=p(d().mark((function f(t){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:this._dispatchSetTokenAccess(this._getStore().dispatch,t.tokenAccess);case 3:case"end":return e.stop()}}),f,this)}))),function(t){return n.apply(this,arguments)})}]),u}(l.ApiAuthenticator),m=i(204);function g(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return b(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return b(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r["return"]||r["return"]()}finally{if(c)throw i}}}}function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}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=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u(this,r)}}var _=m.Helper.exposeFields,k=m.Helper.stringifyQuery,x=new Map([["addSingle","onAddItem"],["addList","onAddItems"],["editSingle","onChangeItem"],["editList","onChangeItems"],["deleteSingle","onRemoveItem"]]),S=function(t){o(c,t);var n,i,a=w(c);function c(){var t;return r(this,c),(t=a.call(this))._error=null,t._isAuthRetry=!1,t._onConnect=null,t._subscriptions=new Map,t._wrapper=null,t._ws=null,t}return e(c,[{key:"connect",value:function(t){var e=this,r=t.onConnect,n=t.onDisconnect,o=t.wrapper;this._onConnect=r,this._wrapper=o;var i=new WebSocket("ws://".concat(window.location.host,"/api/realtime"));i.onclose=function(){n(e._error);var t,r=g(e._subscriptions);try{for(r.s();!(t=r.n()).done;){(0,t.value.onUnsubscribe)()}}catch(o){r.e(o)}finally{r.f()}e._error=null,e._isAuthRetry=!1,e._onConnect=null,e._subscriptions.clear(),e._wrapper=null,e._ws=null},i.onerror=function(t){console.warn("ws err:",t)},i.onmessage=function(t){return e._handleMessage(t)},i.onopen=function(){return e._handleConnect()},this._ws=i}},{key:"disconnect",value:function(){this._ws.close(1e3)}},{key:"subscribe",value:function(t){var e=t.callbacks,r=t.onSubscribe,n=t.onUnsubscribe,o=t.subscriptionData;this._subscriptions.set(this._createKey(o),{callbacks:e,onUnsubscribe:n,options:o.options}),"candlestick"===o.name&&this._ws.send(JSON.stringify({type:"subscribe",data:{data:o.options,type:"candlestick"}})),r()}},{key:"unsubscribe",value:function(t){var e=t.subscriptionData,r=this._createKey(e),n=this._subscriptions.get(r);this._subscriptions["delete"](r),"candlestick"===e.name&&this._ws.send(JSON.stringify({type:"unsubscribe",data:{data:e.options,type:"candlestick"}})),n.onUnsubscribe()}},{key:"_authenticate",value:(i=p(d().mark((function u(){var t;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,t=this._wrapper.authenticate()){e.next=4;break}throw new Error("No authenticationData provided");case 4:this._send({type:"auth",data:{token:t.tokenAccess}}),e.next=11;break;case 7:e.prev=7,e.t0=e["catch"](0),this._error=e.t0,this.disconnect();case 11:case"end":return e.stop()}}),u,this,[[0,7]])}))),function(){return i.apply(this,arguments)})},{key:"_createKey",value:function(t){var e=t.name,r=t.options;return"candlestick"===e?"".concat(e,"?").concat(k(_(r,"asset_ticker","interval","nominal"))):e}},{key:"_handleAuthMessage",value:function(t){var e=t.error;return t.success?(this._isAuthRetry=!1,void this._onConnect()):401!==(null==e?void 0:e.code)||this._isAuthRetry?(this._error=new Error("Authentication failed"),void this.disconnect()):(this._isAuthRetry=!0,void this._authenticate()["catch"]((function(t){return console.warn(t)})))}},{key:"_handleConnect",value:(n=p(d().mark((function s(){var t;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._wrapper.getAuthenticationData();case 3:if(t=e.sent){e.next=6;break}throw new Error("No authenticationData provided");case 6:this._send({type:"auth",data:{token:t.tokenAccess}}),e.next=13;break;case 9:e.prev=9,e.t0=e["catch"](0),this._error=e.t0,this.disconnect();case 13:case"end":return e.stop()}}),s,this,[[0,9]])}))),function(){return n.apply(this,arguments)})},{key:"_handleMessage",value:function(t){var e,r,n=JSON.parse(t.data),o=n.data,i=n.error,a=n.success,c=n.type;if("auth"!==c)if("notification"===c){var u=this._createKey({name:o.type,options:o.data.data}),s=null===(e=this._subscriptions.get(u))||void 0===e||null===(r=e.callbacks)||void 0===r?void 0:r[x.get(o.data.type)];s&&s(o.data.data)}else console.warn(c,o);else this._handleAuthMessage({error:i,success:a})}},{key:"_send",value:function(t){return this._ws.send(JSON.stringify(t))}}]),c}(l.ApiRealtimeTransport),O=i(300),A=i.n(O);function R(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=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u(this,r)}}function E(t,e,r){var n,o,i,a=t.apiWrapperOptions,c=t.methodData,u=t.payload,s=c.actionName,l=c.method;return(null==u?void 0:u[e])||(null==a||null===(n=a[s])||void 0===n?void 0:n[e])||(null==a||null===(o=a[l])||void 0===o?void 0:o[e])||(null==a||null===(i=a["default"])||void 0===i?void 0:i[e])||r}var j=function(t){o(a,t);var n,i=R(a);function a(t){var e,n=t.getStore;return r(this,a),(e=i.call(this))._axios=A().create({baseURL:"/api",timeout:1e4}),e._getStore=n,e}return e(a,[{key:"callMethod",value:(n=p(d().mark((function c(t){var e,r,n,o,i,a,u,s,l;return d().wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return e=t.authenticationData,r=t.methodData,n=t.requestData,o=n.apiWrapperOptions,i=n.payload,a=E({apiWrapperOptions:o,methodData:r,payload:i},"data"),u=E({apiWrapperOptions:o,methodData:r,payload:i},"timeout",1e4),s=E({apiWrapperOptions:o,methodData:r,payload:i},"url"),l=this._getStore().getState(),c.next=8,this._axios.request({timeout:u,data:"function"==typeof a?a(i,l):a,headers:e?{Authorization:"Bearer ".concat(e.tokenAccess)}:{},method:r.method,url:"function"==typeof s?s(i,l):s});case 8:return c.abrupt("return",c.sent);case 9:case"end":return c.stop()}}),c,this)}))),function(t){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(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)}}]),a}(l.ApiTransport);function L(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=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u(this,r)}}var D=function(t){o(i,t);var n=L(i);function i(t){var e=t.dispatchSetTokenAccess,o=t.getStore,a=t.selectSessionData;return r(this,i),n.call(this,{authenticator:new v({dispatchSetTokenAccess:e,getStore:o,selectSessionData:a}),realtimeTransport:new S,transport:new j({getStore:o})})}return e(i)}(l.ApiWrapper)})(),a})()})); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@ololoepepe/api-wrapper"),require("@hierotech/common"),require("axios")):"function"==typeof define&&define.amd?define(["@ololoepepe/api-wrapper","@hierotech/common","axios"],e):"object"==typeof exports?exports.hierotechApiWrapper=e(require("@ololoepepe/api-wrapper"),require("@hierotech/common"),require("axios")):t.hierotechApiWrapper=e(t["@ololoepepe/api-wrapper"],t["@hierotech/common"],t.axios)}(self,(function(t,e,r){return(()=>{var n={757:(t,e,r)=>{t.exports=r(666)},666:t=>{var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(D){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,i=Object.create(o.prototype),a=new E(n||[]);return i._invoke=function(t,e,r){var n=f;return function(o,i){if(n===h)throw new Error("Generator is already running");if(n===d){if("throw"===o)throw i;return L()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=O(a,r);if(c){if(c===y)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var u=l(t,e,r);if("normal"===u.type){if(n=r.done?d:p,u.arg===y)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=d,r.method="throw",r.arg=u.arg)}}}(t,r,a),i}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(D){return{type:"throw",arg:D}}}t.wrap=s;var f="suspendedStart",p="suspendedYield",h="executing",d="completed",y={};function v(){}function m(){}function g(){}var b={};u(b,i,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(j([])));_&&_!==r&&n.call(_,i)&&(b=_);var k=g.prototype=v.prototype=Object.create(b);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(o,i,a,c){var u=l(t[o],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==typeof f&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function O(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator["return"]&&(r.method="return",r.arg=e,O(t,r),"throw"===r.method))return y;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var o=l(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,y;var i=o.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,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function A(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 R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function j(t){if(t){var r=t[i];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(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:L}}function L(){return{value:e,done:!0}}return m.prototype=g,u(k,"constructor",g),u(g,"constructor",m),m.displayName=u(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},t.awrap=function(t){return{__await:t}},x(S.prototype),u(S.prototype,a,(function(){return this})),t.AsyncIterator=S,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new S(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(k),u(k,c,"Generator"),u(k,i,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=j,E.prototype={constructor:E,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(R),!t)for(var r in this)"t"===r.charAt(0)&&n.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 o(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):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),y},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),R(r),y}},"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;R(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:j(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}(t.exports);try{regeneratorRuntime=e}catch(r){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},204:t=>{"use strict";t.exports=e},22:e=>{"use strict";e.exports=t},300:t=>{"use strict";t.exports=r}},o={};function i(t){var e=o[t];if(e!==undefined)return e.exports;var r=o[t]={exports:{}};return n[t](r,r.exports,i),r.exports}i.n=t=>{var e=t&&t.__esModule?()=>t["default"]:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.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){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function e(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){return n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(t,e)}function o(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&&n(t,e)}function c(t){return c="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},c(t)}function u(t,e){if(e&&("object"===c(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},s(t)}i.r(a),i.d(a,{"default":()=>D});var l=i(22);function f(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(s){return void r(s)}c.done?e(u):Promise.resolve(u).then(n,o)}function p(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){f(i,n,o,a,c,"next",t)}function c(t){f(i,n,o,a,c,"throw",t)}a(undefined)}))}}var h=i(757),d=i.n(h);function y(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=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u(this,r)}}var v=function(t){o(u,t);var n,i,a,c=y(u);function u(t){var e,n=t.dispatchSetTokenAccess,o=t.getStore,i=t.selectSessionData;return r(this,u),(e=c.call(this))._dispatchSetTokenAccess=n,e._selectSessionData=i,e._getStore=o,e}return e(u,[{key:"authenticate",value:(a=p(d().mark((function s(t,e){var r,n,o,i;return d().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(e){a.next=2;break}return a.abrupt("return",null);case 2:return r=e.sessionId,n=e.tokenRefresh,a.next=5,t.callMethod({method:"patch"},{payload:{data:{token_refresh:n},url:"/auth/sessions/".concat(r)}});case 5:return o=a.sent,i=o.data.token_access,a.abrupt("return",{sessionId:r,tokenAccess:i,tokenRefresh:n});case 8:case"end":return a.stop()}}),s)}))),function(t,e){return a.apply(this,arguments)})},{key:"loadAuthenticationData",value:(i=p(d().mark((function l(){var t,e,r,n,o;return d().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return t=this._selectSessionData(this._getStore().getState()),e=t.isLoggedIn,r=t.sessionId,n=t.tokenAccess,o=t.tokenRefresh,i.abrupt("return",e?{sessionId:r,tokenAccess:n,tokenRefresh:o}:null);case 2:case"end":return i.stop()}}),l,this)}))),function(){return i.apply(this,arguments)})},{key:"saveAuthenticationData",value:(n=p(d().mark((function f(t){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:this._dispatchSetTokenAccess(this._getStore().dispatch,t.tokenAccess);case 3:case"end":return e.stop()}}),f,this)}))),function(t){return n.apply(this,arguments)})}]),u}(l.ApiAuthenticator),m=i(204);function g(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return b(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return b(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r["return"]||r["return"]()}finally{if(c)throw i}}}}function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}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=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u(this,r)}}var _=m.Helper.exposeFields,k=m.Helper.stringifyQuery,x=new Map([["addSingle","onAddItem"],["addList","onAddItems"],["editSingle","onChangeItem"],["editList","onChangeItems"],["deleteSingle","onRemoveItem"]]),S=function(t){o(c,t);var n,i,a=w(c);function c(){var t;return r(this,c),(t=a.call(this))._error=null,t._isAuthRetry=!1,t._onConnect=null,t._subscriptions=new Map,t._wrapper=null,t._ws=null,t}return e(c,[{key:"connect",value:function(t){var e=this,r=t.onConnect,n=t.onDisconnect,o=t.wrapper;this._onConnect=r,this._wrapper=o;var i=new WebSocket("ws://".concat(window.location.host,"/api/realtime"));i.onclose=function(){n(e._error);var t,r=g(e._subscriptions);try{for(r.s();!(t=r.n()).done;){(0,t.value.onUnsubscribe)()}}catch(o){r.e(o)}finally{r.f()}e._error=null,e._isAuthRetry=!1,e._onConnect=null,e._subscriptions.clear(),e._wrapper=null,e._ws=null},i.onerror=function(t){console.warn("ws err:",t)},i.onmessage=function(t){return e._handleMessage(t)},i.onopen=function(){return e._handleConnect()},this._ws=i}},{key:"disconnect",value:function(){this._ws.close(1e3)}},{key:"subscribe",value:function(t){var e=t.callbacks,r=t.onSubscribe,n=t.onUnsubscribe,o=t.subscriptionData;this._subscriptions.set(this._createKey(o),{callbacks:e,onUnsubscribe:n,options:o.options}),"candlestick"===o.name&&this._ws.send(JSON.stringify({type:"subscribe",data:{data:o.options,type:"candlestick"}})),r()}},{key:"unsubscribe",value:function(t){var e=t.subscriptionData,r=this._createKey(e),n=this._subscriptions.get(r);this._subscriptions["delete"](r),"candlestick"===e.name&&this._ws.send(JSON.stringify({type:"unsubscribe",data:{data:e.options,type:"candlestick"}})),n.onUnsubscribe()}},{key:"_authenticate",value:(i=p(d().mark((function u(){var t;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,t=this._wrapper.authenticate()){e.next=4;break}throw new Error("No authenticationData provided");case 4:this._send({type:"auth",data:{token:t.tokenAccess}}),e.next=11;break;case 7:e.prev=7,e.t0=e["catch"](0),this._error=e.t0,this.disconnect();case 11:case"end":return e.stop()}}),u,this,[[0,7]])}))),function(){return i.apply(this,arguments)})},{key:"_createKey",value:function(t){var e=t.name,r=t.options;return"candlestick"===e?"".concat(e,"?").concat(k(_(r,"asset_ticker","interval","nominal"))):e}},{key:"_handleAuthMessage",value:function(t){var e=t.error;return t.success?(this._isAuthRetry=!1,void this._onConnect()):401!==(null==e?void 0:e.code)||this._isAuthRetry?(this._error=new Error("Authentication failed"),void this.disconnect()):(this._isAuthRetry=!0,void this._authenticate()["catch"]((function(t){return console.warn(t)})))}},{key:"_handleConnect",value:(n=p(d().mark((function s(){var t;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._wrapper.getAuthenticationData();case 3:if(t=e.sent){e.next=6;break}throw new Error("No authenticationData provided");case 6:this._send({type:"auth",data:{token:t.tokenAccess}}),e.next=13;break;case 9:e.prev=9,e.t0=e["catch"](0),this._error=e.t0,this.disconnect();case 13:case"end":return e.stop()}}),s,this,[[0,9]])}))),function(){return n.apply(this,arguments)})},{key:"_handleMessage",value:function(t){var e,r,n=JSON.parse(t.data),o=n.data,i=n.error,a=n.success,c=n.type;if("auth"!==c)if("notification"===c){var u=this._createKey({name:o.type,options:o.data.data}),s=null===(e=this._subscriptions.get(u))||void 0===e||null===(r=e.callbacks)||void 0===r?void 0:r[x.get(o.data.type)];s&&s(o.data.data)}else console.warn(c,o);else this._handleAuthMessage({error:i,success:a})}},{key:"_send",value:function(t){return this._ws.send(JSON.stringify(t))}}]),c}(l.ApiRealtimeTransport),O=i(300),A=i.n(O);function R(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=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u(this,r)}}function E(t,e,r){var n,o,i,a=t.apiWrapperOptions,c=t.methodData,u=t.payload,s=c.actionName,l=c.method;return(null==u?void 0:u[e])||(null==a||null===(n=a[s])||void 0===n?void 0:n[e])||(null==a||null===(o=a[l])||void 0===o?void 0:o[e])||(null==a||null===(i=a["default"])||void 0===i?void 0:i[e])||r}var j=function(t){o(a,t);var n,i=R(a);function a(t){var e,n=t.getStore;return r(this,a),(e=i.call(this))._axios=A().create({baseURL:"/api",timeout:1e4}),e._getStore=n,e}return e(a,[{key:"callMethod",value:(n=p(d().mark((function c(t){var e,r,n,o,i,a,u,s,l;return d().wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return e=t.authenticationData,r=t.methodData,n=t.requestData,o=n.apiWrapperOptions,i=n.payload,a=E({apiWrapperOptions:o,methodData:r,payload:i},"data"),u=E({apiWrapperOptions:o,methodData:r,payload:i},"timeout",1e4),s=E({apiWrapperOptions:o,methodData:r,payload:i},"url"),l=this._getStore().getState(),c.next=8,this._axios.request({timeout:u,data:"function"==typeof a?a(i,l):a,headers:e?{Authorization:"Bearer ".concat(e.tokenAccess)}:{},method:r.method,url:"function"==typeof s?s(i,l):s});case 8:return c.abrupt("return",c.sent);case 9:case"end":return c.stop()}}),c,this)}))),function(t){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(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)}}]),a}(l.ApiTransport);function L(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=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u(this,r)}}var D=function(t){o(i,t);var n=L(i);function i(t){var e=t.dispatchSetTokenAccess,o=t.getStore,a=t.selectSessionData;return r(this,i),n.call(this,{authenticator:new v({dispatchSetTokenAccess:e,getStore:o,selectSessionData:a}),realtimeTransport:new S,transport:new j({getStore:o})})}return e(i)}(l.ApiWrapper)})(),a})()})); | ||
//# sourceMappingURL=index.browser.js.map |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@ololoepepe/api-wrapper"),require("@hierotech/common"),require("axios")):"function"==typeof define&&define.amd?define(["@ololoepepe/api-wrapper","@hierotech/common","axios"],e):"object"==typeof exports?exports.hierotechApiWrapper=e(require("@ololoepepe/api-wrapper"),require("@hierotech/common"),require("axios")):t.hierotechApiWrapper=e(t["@ololoepepe/api-wrapper"],t["@hierotech/common"],t.axios)}(global,(function(t,e,r){return(()=>{var n={506:t=>{t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.__esModule=!0,t.exports["default"]=t.exports},926:t=>{function e(t,e,r,n,o,a,i){try{var s=t[a](i),c=s.value}catch(u){return void r(u)}s.done?e(c):Promise.resolve(c).then(n,o)}t.exports=function(t){return function(){var r=this,n=arguments;return new Promise((function(o,a){var i=t.apply(r,n);function s(t){e(i,o,a,s,c,"next",t)}function c(t){e(i,o,a,s,c,"throw",t)}s(undefined)}))}},t.exports.__esModule=!0,t.exports["default"]=t.exports},575:t=>{t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports["default"]=t.exports},913:t=>{function e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports["default"]=t.exports},754:t=>{function e(r){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.__esModule=!0,t.exports["default"]=t.exports,e(r)}t.exports=e,t.exports.__esModule=!0,t.exports["default"]=t.exports},205:(t,e,r)=>{var n=r(489);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");Object.defineProperty(t,"prototype",{value:Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),writable:!1}),e&&n(t,e)},t.exports.__esModule=!0,t.exports["default"]=t.exports},585:(t,e,r)=>{var n=r(8)["default"],o=r(506);t.exports=function(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return o(t)},t.exports.__esModule=!0,t.exports["default"]=t.exports},489:t=>{function e(r,n){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},t.exports.__esModule=!0,t.exports["default"]=t.exports,e(r,n)}t.exports=e,t.exports.__esModule=!0,t.exports["default"]=t.exports},8: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},757:(t,e,r)=>{t.exports=r(666)},666:t=>{var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(M){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,a=Object.create(o.prototype),i=new E(n||[]);return a._invoke=function(t,e,r){var n=p;return function(o,a){if(n===h)throw new Error("Generator is already running");if(n===d){if("throw"===o)throw a;return L()}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var s=O(i,r);if(s){if(s===y)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===p)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var c=l(t,e,r);if("normal"===c.type){if(n=r.done?d:f,c.arg===y)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=d,r.method="throw",r.arg=c.arg)}}}(t,r,i),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(M){return{type:"throw",arg:M}}}t.wrap=u;var p="suspendedStart",f="suspendedYield",h="executing",d="completed",y={};function v(){}function m(){}function g(){}var b={};c(b,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(j([])));_&&_!==r&&n.call(_,a)&&(b=_);var w=g.prototype=v.prototype=Object.create(b);function k(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(o,a,i,s){var c=l(t[o],t,a);if("throw"!==c.type){var u=c.arg,p=u.value;return p&&"object"==typeof p&&n.call(p,"__await")?e.resolve(p.__await).then((function(t){r("next",t,i,s)}),(function(t){r("throw",t,i,s)})):e.resolve(p).then((function(t){u.value=t,i(u)}),(function(t){return r("throw",t,i,s)}))}s(c.arg)}var o;this._invoke=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 O(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator["return"]&&(r.method="return",r.arg=e,O(t,r),"throw"===r.method))return y;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var o=l(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,y;var a=o.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function A(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 R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function j(t){if(t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}return{next:L}}function L(){return{value:e,done:!0}}return m.prototype=g,c(w,"constructor",g),c(g,"constructor",m),m.displayName=c(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,c(t,s,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},k(S.prototype),c(S.prototype,i,(function(){return this})),t.AsyncIterator=S,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new S(u(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},k(w),c(w,s,"Generator"),c(w,a,(function(){return this})),c(w,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=j,E.prototype={constructor:E,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(R),!t)for(var r in this)"t"===r.charAt(0)&&n.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 o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],s=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(i)},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),y},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),R(r),y}},"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;R(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:j(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}(t.exports);try{regeneratorRuntime=e}catch(r){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},204:t=>{"use strict";t.exports=e},22:e=>{"use strict";e.exports=t},300:t=>{"use strict";t.exports=r}},o={};function a(t){var e=o[t];if(e!==undefined)return e.exports;var r=o[t]={exports:{}};return n[t](r,r.exports,a),r.exports}a.n=t=>{var e=t&&t.__esModule?()=>t["default"]:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var r in e)a.o(e,r)&&!a.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};return(()=>{"use strict";a.r(i),a.d(i,{"default":()=>P});var t=a(913),e=a.n(t),r=a(575),n=a.n(r),o=a(205),s=a.n(o),c=a(585),u=a.n(c),l=a(754),p=a.n(l),f=a(22),h=a(926),d=a.n(h),y=a(757),v=a.n(y);function m(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=p()(t);if(e){var o=p()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var g=function(t){s()(c,t);var r,o,a,i=m(c);function c(t){var e,r=t.dispatchSetTokenAccess,o=t.getStore,a=t.selectSessionData;return n()(this,c),(e=i.call(this))._dispatchSetTokenAccess=r,e._selectSessionData=a,e._getStore=o,e}return e()(c,[{key:"authenticate",value:(a=d()(v().mark((function u(t,e){var r,n,o,a;return v().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.sessionId,n=e.tokenRefresh,i.next=5,t.callMethod({method:"patch"},{payload:{data:{token_refresh:n},url:"/auth/sessions/".concat(r)}});case 5:return o=i.sent,a=o.data.token_access,i.abrupt("return",{sessionId:r,tokenAccess:a,tokenRefresh:n});case 8:case"end":return i.stop()}}),u)}))),function(t,e){return a.apply(this,arguments)})},{key:"loadAuthenticationData",value:(o=d()(v().mark((function l(){var t,e,r,n,o;return v().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return t=this._selectSessionData(this._getStore().getState()),e=t.isLoggedIn,r=t.sessionId,n=t.tokenAccess,o=t.tokenRefresh,a.abrupt("return",e?{sessionId:r,tokenAccess:n,tokenRefresh:o}:null);case 2:case"end":return a.stop()}}),l,this)}))),function(){return o.apply(this,arguments)})},{key:"saveAuthenticationData",value:(r=d()(v().mark((function p(t){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:this._dispatchSetTokenAccess(this._getStore().dispatch,t.tokenAccess);case 3:case"end":return e.stop()}}),p,this)}))),function(t){return r.apply(this,arguments)})}]),c}(f.ApiAuthenticator),b=a(204);function x(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return _(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){s=!0,a=t},f:function(){try{i||null==r["return"]||r["return"]()}finally{if(s)throw a}}}}function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}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=p()(t);if(e){var o=p()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var k=b.Helper.exposeFields,S=b.Helper.stringifyQuery,O=new Map([["addSingle","onAddItem"],["addList","onAddItems"],["editSingle","onChangeItem"],["editList","onChangeItems"],["deleteSingle","onRemoveItem"]]),A=function(t){s()(i,t);var r,o,a=w(i);function i(){var t;return n()(this,i),(t=a.call(this))._error=null,t._isAuthRetry=!1,t._onConnect=null,t._subscriptions=new Map,t._wrapper=null,t._ws=null,t}return e()(i,[{key:"connect",value:function(t){var e=this,r=t.onConnect,n=t.onDisconnect,o=t.wrapper;this._onConnect=r,this._wrapper=o;var a=new WebSocket("ws://".concat(window.location.host,"/api/realtime"));a.onclose=function(){n(e._error);var t,r=x(e._subscriptions);try{for(r.s();!(t=r.n()).done;){(0,t.value.onUnsubscribe)()}}catch(o){r.e(o)}finally{r.f()}e._error=null,e._isAuthRetry=!1,e._onConnect=null,e._subscriptions.clear(),e._wrapper=null,e._ws=null},a.onerror=function(t){console.warn("ws err:",t)},a.onmessage=function(t){return e._handleMessage(t)},a.onopen=function(){return e._handleConnect()},this._ws=a}},{key:"disconnect",value:function(){this._ws.close(1e3)}},{key:"subscribe",value:function(t){var e=t.callbacks,r=t.onSubscribe,n=t.onUnsubscribe,o=t.subscriptionData;this._subscriptions.set(this._createKey(o),{callbacks:e,onUnsubscribe:n,options:o.options}),"candlestick"===o.name&&this._ws.send(JSON.stringify({type:"subscribe",data:{data:o.options,type:"candlestick"}})),r()}},{key:"unsubscribe",value:function(t){var e=t.subscriptionData,r=this._createKey(e),n=this._subscriptions.get(r);this._subscriptions["delete"](r),"candlestick"===e.name&&this._ws.send(JSON.stringify({type:"unsubscribe",data:{data:e.options,type:"candlestick"}})),n.onUnsubscribe()}},{key:"_authenticate",value:(o=d()(v().mark((function c(){var t;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,t=this._wrapper.authenticate()){e.next=4;break}throw new Error("No authenticationData provided");case 4:this._send({type:"auth",data:{token:t.tokenAccess}}),e.next=11;break;case 7:e.prev=7,e.t0=e["catch"](0),this._error=e.t0,this.disconnect();case 11:case"end":return e.stop()}}),c,this,[[0,7]])}))),function(){return o.apply(this,arguments)})},{key:"_createKey",value:function(t){var e=t.name,r=t.options;return"candlestick"===e?"".concat(e,"?").concat(S(k(r,"asset_ticker","interval","nominal"))):e}},{key:"_handleAuthMessage",value:function(t){var e=t.error;return t.success?(this._isAuthRetry=!1,void this._onConnect()):401!==(null==e?void 0:e.code)||this._isAuthRetry?(this._error=new Error("Authentication failed"),void this.disconnect()):(this._isAuthRetry=!0,void this._authenticate()["catch"]((function(t){return console.warn(t)})))}},{key:"_handleConnect",value:(r=d()(v().mark((function u(){var t;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._wrapper.getAuthenticationData();case 3:if(t=e.sent){e.next=6;break}throw new Error("No authenticationData provided");case 6:this._send({type:"auth",data:{token:t.tokenAccess}}),e.next=13;break;case 9:e.prev=9,e.t0=e["catch"](0),this._error=e.t0,this.disconnect();case 13:case"end":return e.stop()}}),u,this,[[0,9]])}))),function(){return r.apply(this,arguments)})},{key:"_handleMessage",value:function(t){var e,r,n=JSON.parse(t.data),o=n.data,a=n.error,i=n.success,s=n.type;if("auth"!==s)if("notification"===s){var c=this._createKey({name:o.type,options:o.data.data}),u=null===(e=this._subscriptions.get(c))||void 0===e||null===(r=e.callbacks)||void 0===r?void 0:r[O.get(o.data.type)];u&&u(o.data.data)}else console.warn(s,o);else this._handleAuthMessage({error:a,success:i})}},{key:"_send",value:function(t){return this._ws.send(JSON.stringify(t))}}]),i}(f.ApiRealtimeTransport),R=a(300),E=a.n(R);function j(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=p()(t);if(e){var o=p()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}function L(t,e,r){var n,o,a,i=t.apiWrapperOptions,s=t.methodData,c=t.payload,u=s.actionName,l=s.method;return(null==c?void 0:c[e])||(null==i||null===(n=i[u])||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}var M=function(t){s()(a,t);var r,o=j(a);function a(t){var e,r=t.getStore;return n()(this,a),(e=o.call(this))._axios=E().create({baseURL:"/api",timeout:1e4}),e._getStore=r,e}return e()(a,[{key:"callMethod",value:(r=d()(v().mark((function i(t){var e,r,n,o,a,s,c,u,l;return v().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return e=t.authenticationData,r=t.methodData,n=t.requestData,o=n.apiWrapperOptions,a=n.payload,s=L({apiWrapperOptions:o,methodData:r,payload:a},"data"),c=L({apiWrapperOptions:o,methodData:r,payload:a},"timeout",1e4),u=L({apiWrapperOptions:o,methodData:r,payload:a},"url"),l=this._getStore().getState(),i.next=8,this._axios.request({timeout:c,data:"function"==typeof s?s(a,l):s,headers:e?{Authorization:"Bearer ".concat(e.tokenAccess)}:{},method:r.method,url:"function"==typeof u?u(a,l):u});case 8:return i.abrupt("return",i.sent);case 9:case"end":return i.stop()}}),i,this)}))),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)}}]),a}(f.ApiTransport);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=p()(t);if(e){var o=p()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var P=function(t){s()(o,t);var r=D(o);function o(t){var e=t.dispatchSetTokenAccess,a=t.getStore,i=t.selectSessionData;return n()(this,o),r.call(this,{authenticator:new g({dispatchSetTokenAccess:e,getStore:a,selectSessionData:i}),realtimeTransport:new A,transport:new M({getStore:a})})}return e()(o)}(f.ApiWrapper)})(),i})()})); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@ololoepepe/api-wrapper"),require("@hierotech/common"),require("axios")):"function"==typeof define&&define.amd?define(["@ololoepepe/api-wrapper","@hierotech/common","axios"],e):"object"==typeof exports?exports.hierotechApiWrapper=e(require("@ololoepepe/api-wrapper"),require("@hierotech/common"),require("axios")):t.hierotechApiWrapper=e(t["@ololoepepe/api-wrapper"],t["@hierotech/common"],t.axios)}(global,(function(t,e,r){return(()=>{var n={506:t=>{t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.__esModule=!0,t.exports["default"]=t.exports},926:t=>{function e(t,e,r,n,o,a,i){try{var s=t[a](i),c=s.value}catch(u){return void r(u)}s.done?e(c):Promise.resolve(c).then(n,o)}t.exports=function(t){return function(){var r=this,n=arguments;return new Promise((function(o,a){var i=t.apply(r,n);function s(t){e(i,o,a,s,c,"next",t)}function c(t){e(i,o,a,s,c,"throw",t)}s(undefined)}))}},t.exports.__esModule=!0,t.exports["default"]=t.exports},575:t=>{t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports["default"]=t.exports},913:t=>{function e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports["default"]=t.exports},754:t=>{function e(r){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.__esModule=!0,t.exports["default"]=t.exports,e(r)}t.exports=e,t.exports.__esModule=!0,t.exports["default"]=t.exports},205:(t,e,r)=>{var n=r(489);t.exports=function(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&&n(t,e)},t.exports.__esModule=!0,t.exports["default"]=t.exports},585:(t,e,r)=>{var n=r(8)["default"],o=r(506);t.exports=function(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return o(t)},t.exports.__esModule=!0,t.exports["default"]=t.exports},489:t=>{function e(r,n){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},t.exports.__esModule=!0,t.exports["default"]=t.exports,e(r,n)}t.exports=e,t.exports.__esModule=!0,t.exports["default"]=t.exports},8: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},757:(t,e,r)=>{t.exports=r(666)},666:t=>{var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(M){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,a=Object.create(o.prototype),i=new E(n||[]);return a._invoke=function(t,e,r){var n=p;return function(o,a){if(n===h)throw new Error("Generator is already running");if(n===d){if("throw"===o)throw a;return L()}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var s=O(i,r);if(s){if(s===y)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===p)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var c=l(t,e,r);if("normal"===c.type){if(n=r.done?d:f,c.arg===y)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=d,r.method="throw",r.arg=c.arg)}}}(t,r,i),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(M){return{type:"throw",arg:M}}}t.wrap=u;var p="suspendedStart",f="suspendedYield",h="executing",d="completed",y={};function v(){}function m(){}function g(){}var b={};c(b,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(j([])));_&&_!==r&&n.call(_,a)&&(b=_);var w=g.prototype=v.prototype=Object.create(b);function k(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(o,a,i,s){var c=l(t[o],t,a);if("throw"!==c.type){var u=c.arg,p=u.value;return p&&"object"==typeof p&&n.call(p,"__await")?e.resolve(p.__await).then((function(t){r("next",t,i,s)}),(function(t){r("throw",t,i,s)})):e.resolve(p).then((function(t){u.value=t,i(u)}),(function(t){return r("throw",t,i,s)}))}s(c.arg)}var o;this._invoke=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 O(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator["return"]&&(r.method="return",r.arg=e,O(t,r),"throw"===r.method))return y;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var o=l(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,y;var a=o.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function A(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 R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function j(t){if(t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}return{next:L}}function L(){return{value:e,done:!0}}return m.prototype=g,c(w,"constructor",g),c(g,"constructor",m),m.displayName=c(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,c(t,s,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},k(S.prototype),c(S.prototype,i,(function(){return this})),t.AsyncIterator=S,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new S(u(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},k(w),c(w,s,"Generator"),c(w,a,(function(){return this})),c(w,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=j,E.prototype={constructor:E,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(R),!t)for(var r in this)"t"===r.charAt(0)&&n.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 o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],s=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(i)},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),y},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),R(r),y}},"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;R(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:j(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}(t.exports);try{regeneratorRuntime=e}catch(r){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},204:t=>{"use strict";t.exports=e},22:e=>{"use strict";e.exports=t},300:t=>{"use strict";t.exports=r}},o={};function a(t){var e=o[t];if(e!==undefined)return e.exports;var r=o[t]={exports:{}};return n[t](r,r.exports,a),r.exports}a.n=t=>{var e=t&&t.__esModule?()=>t["default"]:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var r in e)a.o(e,r)&&!a.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};return(()=>{"use strict";a.r(i),a.d(i,{"default":()=>P});var t=a(913),e=a.n(t),r=a(575),n=a.n(r),o=a(205),s=a.n(o),c=a(585),u=a.n(c),l=a(754),p=a.n(l),f=a(22),h=a(926),d=a.n(h),y=a(757),v=a.n(y);function m(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=p()(t);if(e){var o=p()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var g=function(t){s()(c,t);var r,o,a,i=m(c);function c(t){var e,r=t.dispatchSetTokenAccess,o=t.getStore,a=t.selectSessionData;return n()(this,c),(e=i.call(this))._dispatchSetTokenAccess=r,e._selectSessionData=a,e._getStore=o,e}return e()(c,[{key:"authenticate",value:(a=d()(v().mark((function u(t,e){var r,n,o,a;return v().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.sessionId,n=e.tokenRefresh,i.next=5,t.callMethod({method:"patch"},{payload:{data:{token_refresh:n},url:"/auth/sessions/".concat(r)}});case 5:return o=i.sent,a=o.data.token_access,i.abrupt("return",{sessionId:r,tokenAccess:a,tokenRefresh:n});case 8:case"end":return i.stop()}}),u)}))),function(t,e){return a.apply(this,arguments)})},{key:"loadAuthenticationData",value:(o=d()(v().mark((function l(){var t,e,r,n,o;return v().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return t=this._selectSessionData(this._getStore().getState()),e=t.isLoggedIn,r=t.sessionId,n=t.tokenAccess,o=t.tokenRefresh,a.abrupt("return",e?{sessionId:r,tokenAccess:n,tokenRefresh:o}:null);case 2:case"end":return a.stop()}}),l,this)}))),function(){return o.apply(this,arguments)})},{key:"saveAuthenticationData",value:(r=d()(v().mark((function p(t){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:this._dispatchSetTokenAccess(this._getStore().dispatch,t.tokenAccess);case 3:case"end":return e.stop()}}),p,this)}))),function(t){return r.apply(this,arguments)})}]),c}(f.ApiAuthenticator),b=a(204);function x(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return _(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){s=!0,a=t},f:function(){try{i||null==r["return"]||r["return"]()}finally{if(s)throw a}}}}function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}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=p()(t);if(e){var o=p()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var k=b.Helper.exposeFields,S=b.Helper.stringifyQuery,O=new Map([["addSingle","onAddItem"],["addList","onAddItems"],["editSingle","onChangeItem"],["editList","onChangeItems"],["deleteSingle","onRemoveItem"]]),A=function(t){s()(i,t);var r,o,a=w(i);function i(){var t;return n()(this,i),(t=a.call(this))._error=null,t._isAuthRetry=!1,t._onConnect=null,t._subscriptions=new Map,t._wrapper=null,t._ws=null,t}return e()(i,[{key:"connect",value:function(t){var e=this,r=t.onConnect,n=t.onDisconnect,o=t.wrapper;this._onConnect=r,this._wrapper=o;var a=new WebSocket("ws://".concat(window.location.host,"/api/realtime"));a.onclose=function(){n(e._error);var t,r=x(e._subscriptions);try{for(r.s();!(t=r.n()).done;){(0,t.value.onUnsubscribe)()}}catch(o){r.e(o)}finally{r.f()}e._error=null,e._isAuthRetry=!1,e._onConnect=null,e._subscriptions.clear(),e._wrapper=null,e._ws=null},a.onerror=function(t){console.warn("ws err:",t)},a.onmessage=function(t){return e._handleMessage(t)},a.onopen=function(){return e._handleConnect()},this._ws=a}},{key:"disconnect",value:function(){this._ws.close(1e3)}},{key:"subscribe",value:function(t){var e=t.callbacks,r=t.onSubscribe,n=t.onUnsubscribe,o=t.subscriptionData;this._subscriptions.set(this._createKey(o),{callbacks:e,onUnsubscribe:n,options:o.options}),"candlestick"===o.name&&this._ws.send(JSON.stringify({type:"subscribe",data:{data:o.options,type:"candlestick"}})),r()}},{key:"unsubscribe",value:function(t){var e=t.subscriptionData,r=this._createKey(e),n=this._subscriptions.get(r);this._subscriptions["delete"](r),"candlestick"===e.name&&this._ws.send(JSON.stringify({type:"unsubscribe",data:{data:e.options,type:"candlestick"}})),n.onUnsubscribe()}},{key:"_authenticate",value:(o=d()(v().mark((function c(){var t;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,t=this._wrapper.authenticate()){e.next=4;break}throw new Error("No authenticationData provided");case 4:this._send({type:"auth",data:{token:t.tokenAccess}}),e.next=11;break;case 7:e.prev=7,e.t0=e["catch"](0),this._error=e.t0,this.disconnect();case 11:case"end":return e.stop()}}),c,this,[[0,7]])}))),function(){return o.apply(this,arguments)})},{key:"_createKey",value:function(t){var e=t.name,r=t.options;return"candlestick"===e?"".concat(e,"?").concat(S(k(r,"asset_ticker","interval","nominal"))):e}},{key:"_handleAuthMessage",value:function(t){var e=t.error;return t.success?(this._isAuthRetry=!1,void this._onConnect()):401!==(null==e?void 0:e.code)||this._isAuthRetry?(this._error=new Error("Authentication failed"),void this.disconnect()):(this._isAuthRetry=!0,void this._authenticate()["catch"]((function(t){return console.warn(t)})))}},{key:"_handleConnect",value:(r=d()(v().mark((function u(){var t;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._wrapper.getAuthenticationData();case 3:if(t=e.sent){e.next=6;break}throw new Error("No authenticationData provided");case 6:this._send({type:"auth",data:{token:t.tokenAccess}}),e.next=13;break;case 9:e.prev=9,e.t0=e["catch"](0),this._error=e.t0,this.disconnect();case 13:case"end":return e.stop()}}),u,this,[[0,9]])}))),function(){return r.apply(this,arguments)})},{key:"_handleMessage",value:function(t){var e,r,n=JSON.parse(t.data),o=n.data,a=n.error,i=n.success,s=n.type;if("auth"!==s)if("notification"===s){var c=this._createKey({name:o.type,options:o.data.data}),u=null===(e=this._subscriptions.get(c))||void 0===e||null===(r=e.callbacks)||void 0===r?void 0:r[O.get(o.data.type)];u&&u(o.data.data)}else console.warn(s,o);else this._handleAuthMessage({error:a,success:i})}},{key:"_send",value:function(t){return this._ws.send(JSON.stringify(t))}}]),i}(f.ApiRealtimeTransport),R=a(300),E=a.n(R);function j(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=p()(t);if(e){var o=p()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}function L(t,e,r){var n,o,a,i=t.apiWrapperOptions,s=t.methodData,c=t.payload,u=s.actionName,l=s.method;return(null==c?void 0:c[e])||(null==i||null===(n=i[u])||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}var M=function(t){s()(a,t);var r,o=j(a);function a(t){var e,r=t.getStore;return n()(this,a),(e=o.call(this))._axios=E().create({baseURL:"/api",timeout:1e4}),e._getStore=r,e}return e()(a,[{key:"callMethod",value:(r=d()(v().mark((function i(t){var e,r,n,o,a,s,c,u,l;return v().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return e=t.authenticationData,r=t.methodData,n=t.requestData,o=n.apiWrapperOptions,a=n.payload,s=L({apiWrapperOptions:o,methodData:r,payload:a},"data"),c=L({apiWrapperOptions:o,methodData:r,payload:a},"timeout",1e4),u=L({apiWrapperOptions:o,methodData:r,payload:a},"url"),l=this._getStore().getState(),i.next=8,this._axios.request({timeout:c,data:"function"==typeof s?s(a,l):s,headers:e?{Authorization:"Bearer ".concat(e.tokenAccess)}:{},method:r.method,url:"function"==typeof u?u(a,l):u});case 8:return i.abrupt("return",i.sent);case 9:case"end":return i.stop()}}),i,this)}))),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)}}]),a}(f.ApiTransport);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=p()(t);if(e){var o=p()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u()(this,r)}}var P=function(t){s()(o,t);var r=D(o);function o(t){var e=t.dispatchSetTokenAccess,a=t.getStore,i=t.selectSessionData;return n()(this,o),r.call(this,{authenticator:new g({dispatchSetTokenAccess:e,getStore:a,selectSessionData:i}),realtimeTransport:new A,transport:new M({getStore:a})})}return e()(o)}(f.ApiWrapper)})(),i})()})); | ||
//# sourceMappingURL=index.node.js.map |
{ | ||
"name": "@hierotech/api-wrapper", | ||
"version": "0.0.14", | ||
"version": "0.0.15", | ||
"description": "Implementation of @ololoepepe/api-wrapper for Hiero.tech", | ||
@@ -26,22 +26,22 @@ "main": "dist/index.node.js", | ||
"dependencies": { | ||
"@hierotech/common": "^0.1.19", | ||
"@ololoepepe/api-wrapper": "0.0.17", | ||
"axios": "^0.24.0" | ||
"@hierotech/common": "^0.1.20", | ||
"@ololoepepe/api-wrapper": "0.0.19", | ||
"axios": "^0.25.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.16.5", | ||
"@babel/core": "^7.16.12", | ||
"@babel/eslint-parser": "^7.16.5", | ||
"@babel/register": "^7.16.5", | ||
"@babel/runtime": "^7.16.5", | ||
"@ololoepepe/babel-preset-default": "^0.1.25", | ||
"@babel/register": "^7.16.9", | ||
"@babel/runtime": "^7.16.7", | ||
"@ololoepepe/babel-preset-default": "^0.1.26", | ||
"babel-loader": "^8.2.3", | ||
"core-js": "^3.20.1", | ||
"eslint": "^8.5.0", | ||
"core-js": "^3.20.3", | ||
"eslint": "^8.7.0", | ||
"eslint-config-xo": "^0.39.0", | ||
"mocha": "^9.1.3", | ||
"mocha": "^9.2.0", | ||
"regenerator-runtime": "^0.13.9", | ||
"terser-webpack-plugin": "^5.3.0", | ||
"webpack": "^5.65.0", | ||
"webpack-cli": "^4.9.1" | ||
"webpack": "^5.67.0", | ||
"webpack-cli": "^4.9.2" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
170790
+ Added@ololoepepe/api-wrapper@0.0.19(transitive)
+ Addedaxios@0.25.0(transitive)
- Removed@ololoepepe/api-wrapper@0.0.17(transitive)
- Removedaxios@0.24.0(transitive)
Updated@hierotech/common@^0.1.20
Updatedaxios@^0.25.0