@ololoepepe/api-wrapper
Advanced tools
Comparing version 0.0.13 to 0.0.14
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.apiWrapper=e():t.apiWrapper=e()}(self,(function(){return(()=>{var t={757:(t,e,r)=>{t.exports=r(666)},187:t=>{"use strict";var e,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function i(){i.init.call(this)}t.exports=i,t.exports.once=function(t,e){return new Promise((function(r,n){function o(r){t.removeListener(e,i),n(r)}function i(){"function"==typeof t.removeListener&&t.removeListener("error",o),r([].slice.call(arguments))}v(t,e,i,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&v(t,"error",e,r)}(t,o,{once:!0})}))},i.EventEmitter=i,i.prototype._events=undefined,i.prototype._eventsCount=0,i.prototype._maxListeners=undefined;var a=10;function c(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function s(t){return t._maxListeners===undefined?i.defaultMaxListeners:t._maxListeners}function u(t,e,r,n){var o,i,a,u;if(c(r),(i=t._events)===undefined?(i=t._events=Object.create(null),t._eventsCount=0):(i.newListener!==undefined&&(t.emit("newListener",e,r.listener?r.listener:r),i=t._events),a=i[e]),a===undefined)a=i[e]=r,++t._eventsCount;else if("function"==typeof a?a=i[e]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(o=s(t))>0&&a.length>o&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=a.length,u=l,console&&console.warn&&console.warn(u)}return t}function l(){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 p(t,e,r){var n={fired:!1,wrapFn:undefined,target:t,type:e,listener:r},o=l.bind(n);return o.listener=r,n.wrapFn=o,o}function f(t,e,r){var n=t._events;if(n===undefined)return[];var o=n[e];return o===undefined?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(o):d(o,o.length)}function h(t){var e=this._events;if(e!==undefined){var r=e[t];if("function"==typeof r)return 1;if(r!==undefined)return r.length}return 0}function d(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function v(t,e,r,n){if("function"==typeof t.on)n.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function o(i){n.once&&t.removeEventListener(e,o),r(i)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");a=t}}),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(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},i.prototype.getMaxListeners=function(){return s(this)},i.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var o="error"===t,i=this._events;if(i!==undefined)o=o&&i.error===undefined;else if(!o)return!1;if(o){var a;if(e.length>0&&(a=e[0]),a instanceof Error)throw a;var c=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw c.context=a,c}var s=i[t];if(s===undefined)return!1;if("function"==typeof s)n(s,this,e);else{var u=s.length,l=d(s,u);for(r=0;r<u;++r)n(l[r],this,e)}return!0},i.prototype.addListener=function(t,e){return u(this,t,e,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(t,e){return u(this,t,e,!0)},i.prototype.once=function(t,e){return c(e),this.on(t,p(this,t,e)),this},i.prototype.prependOnceListener=function(t,e){return c(e),this.prependListener(t,p(this,t,e)),this},i.prototype.removeListener=function(t,e){var r,n,o,i,a;if(c(e),(n=this._events)===undefined)return this;if((r=n[t])===undefined)return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===e||r[i].listener===e){a=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,o),1===r.length&&(n[t]=r[0]),n.removeListener!==undefined&&this.emit("removeListener",t,a||e)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(t){var e,r,n;if((r=this._events)===undefined)return this;if(r.removeListener===undefined)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):r[t]!==undefined&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var o,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(o=i[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(e!==undefined)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},i.prototype.listeners=function(t){return f(this,t,!0)},i.prototype.rawListeners=function(t){return f(this,t,!1)},i.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):h.call(t,e)},i.prototype.listenerCount=h,i.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},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 s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(O){s=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),a=new L(n||[]);return i._invoke=function(t,e,r){var n=p;return function(o,i){if(n===h)throw new Error("Generator is already running");if(n===d){if("throw"===o)throw i;return M()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=k(a,r);if(c){if(c===v)continue;return c}}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 s=l(t,e,r);if("normal"===s.type){if(n=r.done?d:f,s.arg===v)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n=d,r.method="throw",r.arg=s.arg)}}}(t,r,a),i}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(O){return{type:"throw",arg:O}}}t.wrap=u;var p="suspendedStart",f="suspendedYield",h="executing",d="completed",v={};function y(){}function m(){}function g(){}var b={};s(b,i,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(R([])));_&&_!==r&&n.call(_,i)&&(b=_);var A=g.prototype=y.prototype=Object.create(b);function x(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function r(o,i,a,c){var s=l(t[o],t,i);if("throw"!==s.type){var u=s.arg,p=u.value;return p&&"object"==typeof p&&n.call(p,"__await")?e.resolve(p.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(p).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,c)}))}c(s.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 k(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,k(t,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=l(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;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,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}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 L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(D,this),this.reset(!0)}function R(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:M}}function M(){return{value:e,done:!0}}return m.prototype=g,s(A,"constructor",g),s(g,"constructor",m),m.displayName=s(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,s(t,c,"GeneratorFunction")),t.prototype=Object.create(A),t},t.awrap=function(t){return{__await:t}},x(E.prototype),s(E.prototype,a,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(A),s(A,c,"Generator"),s(A,i,(function(){return this})),s(A,"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=R,L.prototype={constructor:L,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)&&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 s=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)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,v):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),v},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),v}},"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:R(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=e}catch(r){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}}},e={};function r(n){var o=e[n];if(o!==undefined)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t["default"]:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";function t(e,r){return(t=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(e,r)}function e(){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}}function o(r,n,i){return(o=e()?Reflect.construct:function(e,r,n){var o=[null];o.push.apply(o,r);var i=new(Function.bind.apply(e,o));return n&&t(i,n.prototype),i}).apply(null,arguments)}function i(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 a(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(u){return void r(u)}c.done?e(s):Promise.resolve(s).then(n,o)}function s(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){c(i,n,o,a,s,"next",t)}function s(t){c(i,n,o,a,s,"throw",t)}a(undefined)}))}}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(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 p(t,e,r){return e&&l(t.prototype,e),r&&l(t,r),t}r.r(n),r.d(n,{ApiAuthenticator:()=>T,ApiError:()=>D,ApiRealtimeTransport:()=>L,ApiTransport:()=>R,ApiWrapper:()=>F});var f=r(757),h=r.n(f);function d(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&t(e,r)}function v(t){return(v="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)}function y(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function m(t,e){if(e&&("object"===v(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return y(t)}function g(t){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function b(e){var r="function"==typeof Map?new Map:undefined;return(b=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,i)}function i(){return o(e,arguments,g(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t(i,e)})(e)}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=g(t);if(e){var o=g(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return m(this,r)}}var _="api_wrapper/authentication_failed",A="api_wrapper/method_not_implemented",x="api_wrapper/parameter_not_provided",E="api_wrapper/realtime_transport",k="api_wrapper/unexpected",D=function(t){d(r,t);var e=w(r);function r(){var t,n=arguments.length>0&&arguments[0]!==undefined?arguments[0]:k,o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:n,i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;return u(this,r),(t=e.call(this,o)).code=n,t.data=i,t}return p(r,null,[{key:"createAuthenticationFailedErrorArgs",value:function(t,e,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;return[_,"[".concat(e,".").concat(r).concat(n?"::".concat(n):"","] Authentication failed"),{className:e,methodName:r,originalError:t,place:n}]}},{key:"createMethodNotImplementedErrorArgs",value:function(t,e){return[A,"[".concat(t,".").concat(e,"] Method not implemented: ").concat(e),{className:t,methodName:e}]}},{key:"createParameterNotProvidedErrorArgs",value:function(t,e,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;return[x,"[".concat(e,".").concat(r).concat(n?"::".concat(n):"","] Parameter not provided: ").concat(t),{className:e,methodName:r,parameterName:t,place:n}]}},{key:"createRealtimeTransportErrorArgs",value:function(t,e,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;return[E,"[".concat(e,".").concat(r).concat(n?"::".concat(n):"","] Realtime transport error: ").concat(t.message),{className:e,methodName:r,originalError:t,place:n}]}}]),r}(b(Error)),T=function(){function t(){u(this,t)}var e,r,n;return p(t,[{key:"authenticate",value:(n=s(h().mark((function i(t,e){return h().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:throw console.log("[ApiAuthenticator.authenticate]","wrapper:",t),console.log("[ApiAuthenticator.authenticate]","previousAuthenticationData:",e),o(D,a(D.createMethodNotImplementedErrorArgs("ApiAuthenticator","authenticate")));case 3:case"end":return r.stop()}}),i)}))),function(t,e){return n.apply(this,arguments)})},{key:"loadAuthenticationData",value:(r=s(h().mark((function c(){return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw o(D,a(D.createMethodNotImplementedErrorArgs("ApiAuthenticator","loadAuthenticationData")));case 1:case"end":return t.stop()}}),c)}))),function(){return r.apply(this,arguments)})},{key:"saveAuthenticationData",value:(e=s(h().mark((function l(t){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw console.log("[ApiAuthenticator.saveAuthenticationData]","authenticationData:",t),o(D,a(D.createMethodNotImplementedErrorArgs("ApiAuthenticator","saveAuthenticationData")));case 2:case"end":return e.stop()}}),l)}))),function(t){return e.apply(this,arguments)})}]),t}(),L=function(){function t(){u(this,t)}return p(t,[{key:"connect",value:function(t){var e=t.onConnect,r=t.onDisconnect,n=t.wrapper;throw console.log("[ApiRealtimeTransport.connect]","onConnect:",e),console.log("[ApiRealtimeTransport.connect]","onDisconnect:",r),console.log("[ApiRealtimeTransport.connect]","wrapper:",n),o(D,a(D.createMethodNotImplementedErrorArgs("ApiRealtimeTransport","connect")))}},{key:"disconnect",value:function(){throw o(D,a(D.createMethodNotImplementedErrorArgs("ApiRealtimeTransport","disconnect")))}},{key:"subscribe",value:function(t){var e=t.callbacks,r=t.isPrivate,n=t.onSubscribe,i=t.onUnsubscribe,c=t.subscriptionData;throw console.log("[ApiRealtimeTransport.subscribe]","callbacks:",e),console.log("[ApiRealtimeTransport.subscribe]","isPrivate:",r),console.log("[ApiRealtimeTransport.subscribe]","onSubscribe:",n),console.log("[ApiRealtimeTransport.subscribe]","onUnsubscribe:",i),console.log("[ApiRealtimeTransport.subscribe]","subscriptionData:",c),o(D,a(D.createMethodNotImplementedErrorArgs("ApiRealtimeTransport","subscribe")))}},{key:"unsubscribe",value:function(t){var e=t.subscriptionData;throw console.log("[ApiRealtimeTransport.unsubscribe]","subscriptionData:",e),o(D,a(D.createMethodNotImplementedErrorArgs("ApiRealtimeTransport","unsubscribe")))}}]),t}(),R=function(){function t(){u(this,t)}var e;return p(t,[{key:"callMethod",value:(e=s(h().mark((function r(t){var e,n,i,c;return h().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:throw e=t.authenticationData,n=t.methodData,i=t.requestData,c=t.wrapper,console.log("[ApiTransport.callMethod]","authenticationData:",e),console.log("[ApiTransport.callMethod]","methodData:",n),console.log("[ApiTransport.callMethod]","requestData:",i),console.log("[ApiTransport.callMethod]","wrapper:",c),o(D,a(D.createMethodNotImplementedErrorArgs("ApiTransport","callMethod")));case 6:case"end":return r.stop()}}),r)}))),function(t){return e.apply(this,arguments)})},{key:"getCreateMethodData",value:function(){throw o(D,a(D.createMethodNotImplementedErrorArgs("ApiTransport","getCreateMethodData")))}},{key:"getDeleteMethodData",value:function(){throw o(D,a(D.createMethodNotImplementedErrorArgs("ApiTransport","getDeleteMethodData")))}},{key:"getReadMethodData",value:function(){throw o(D,a(D.createMethodNotImplementedErrorArgs("ApiTransport","getReadMethodData")))}},{key:"getUpdateMethodData",value:function(){throw o(D,a(D.createMethodNotImplementedErrorArgs("ApiTransport","getUpdateMethodData")))}},{key:"isAuthenticationFailedError",value:function(t){throw console.log("[ApiTransport.isAuthenticationFailedError]","error:",t),o(D,a(D.createMethodNotImplementedErrorArgs("ApiTransport","isAuthenticationFailedError")))}},{key:"isSessionExpiredError",value:function(t){throw console.log("[ApiTransport.isSessionExpiredError]","error:",t),o(D,a(D.createMethodNotImplementedErrorArgs("ApiTransport","isSessionExpiredError")))}}]),t}(),M=r(187),O=r.n(M);function P(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 S(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 S(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 S(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}var j={Connected:"connected",Connecting:"connecting",Disconnected:"disconnected",Disconnecting:"disconnecting"},N=function(){function t(e){var r=e.onError,n=e.realtimeTransport,o=e.wrapper;u(this,t),this._connectionState=j.Disconnected,this._onError=r,this._realtimeTransport=n,this._reconnectDelay=1e3,this._subscriptions=new Set,this._wrapper=o}return p(t,[{key:"getRealtimeTransport",value:function(){return this._realtimeTransport}},{key:"getWrapper",value:function(){return this._wrapper}},{key:"subscribe",value:function(t){var e=this,r=t.callbacks,n=t.isPrivate,o=void 0!==n&&n,i=t.subscriptionData,a=this.getRealtimeTransport(),c={callbacks:r,isPrivate:o,subscriptionData:i,isSubscribed:!1};switch(this._subscriptions.add(c),this._connectionState){case j.Disconnected:this._connect();break;case j.Connected:this._subscribe(c)}return function(){if(c.isSubscribed&&a.unsubscribe({subscriptionData:i}),e._subscriptions["delete"](c),e._subscriptions.size<1){if([j.Disconnected,j.Disconnecting].includes(e._connectionState))return;e._disconnect()}}}},{key:"_connect",value:function(){var t=this;this._connectionState=j.Connecting,this.getRealtimeTransport().connect({onConnect:function(){return t._handleConnect()},onDisconnect:function(e){return t._handleDisconnect(e)},wrapper:this.getWrapper()})}},{key:"_disconnect",value:function(){this._connectionState=j.Disconnecting,this.getRealtimeTransport().disconnect()}},{key:"_handleConnect",value:function(){this._reconnectDelay=1e3,this._connectionState=j.Connected;var t,e=P(this._subscriptions);try{for(e.s();!(t=e.n()).done;){var r=t.value;r.isSubscribed||this._subscribe(r)}}catch(n){e.e(n)}finally{e.f()}}},{key:"_handleDisconnect",value:function(t){var e=this,r=this._connectionState===j.Disconnecting;this._connectionState=j.Disconnected,t?this._onError(t):this._subscriptions.size<1||(r?this._connect():(this._reconnectDelay<32e3&&(this._reconnectDelay*=2),setTimeout((function(){return e._connect()}),this._reconnectDelay)))}},{key:"_subscribe",value:function(t){var e=t.callbacks,r=t.isPrivate,n=t.subscriptionData;this.getRealtimeTransport().subscribe({callbacks:e,isPrivate:r,subscriptionData:n,onSubscribe:function(){t.isSubscribed=!0},onUnsubscribe:function(){t.isSubscribed=!1}})}}]),t}();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=g(t);if(e){var o=g(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return m(this,r)}}var I=new Map,F=function(t){d(g,t);var e,r,n,i,c,l,f,v,m=C(g);function g(t){var e,r=t.authenticator,n=t.realtimeTransport,i=t.transport;if(u(this,g),!r)throw o(D,a(D.createParameterNotProvidedErrorArgs("authenticator","ApiWrapper","constructor")));if(!n)throw o(D,a(D.createParameterNotProvidedErrorArgs("realtimeTransport","ApiWrapper","constructor")));if(!i)throw o(D,a(D.createParameterNotProvidedErrorArgs("transport","ApiWrapper","constructor")));return(e=m.call(this))._authenticator=r,e._realtimeTransportWrapper=new N({realtimeTransport:n,onError:e._handleRealtimeTransportWrapperError,wrapper:y(e)}),e._transport=i,e}return p(g,[{key:"authenticate",value:(v=s(h().mark((function b(){var t,e,r;return h().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t=this.getAuthenticator(),n.prev=1,n.next=4,this._getAuthenticationPromise();case 4:return e=n.sent,n.next=7,t.saveAuthenticationData(e);case 7:return n.abrupt("return",e);case 10:if(n.prev=10,n.t0=n["catch"](1),!this.getTransport().isAuthenticationFailedError(n.t0)){n.next=16;break}throw r=o(D,a(D.createAuthenticationFailedErrorArgs(n.t0,"ApiWrapper","authenticate"))),this.emit("error",r),r;case 16:throw this.emit("error",n.t0),n.t0;case 18:case"end":return n.stop()}}),b,this,[[1,10]])}))),function(){return v.apply(this,arguments)})},{key:"callMethod",value:(f=s(h().mark((function w(t){var e,r,n=arguments;return h().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return e=n.length>1&&n[1]!==undefined?n[1]:null,r=n.length>2&&n[2]!==undefined&&n[2],o.next=4,this._callMethod({isPrivate:r,methodData:t,requestData:e});case 4:return o.abrupt("return",o.sent);case 5:case"end":return o.stop()}}),w,this)}))),function(t){return f.apply(this,arguments)})},{key:"create",value:(l=s(h().mark((function _(){var t,e,r=arguments;return h().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t=r.length>0&&r[0]!==undefined?r[0]:null,e=r.length>1&&r[1]!==undefined&&r[1],n.next=4,this._callMethod({isPrivate:e,requestData:t,methodData:this.getTransport().getCreateMethodData()});case 4:return n.abrupt("return",n.sent);case 5:case"end":return n.stop()}}),_,this)}))),function(){return l.apply(this,arguments)})},{key:"delete",value:(c=s(h().mark((function A(){var t,e,r=arguments;return h().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t=r.length>0&&r[0]!==undefined?r[0]:null,e=r.length>1&&r[1]!==undefined&&r[1],n.next=4,this._callMethod({isPrivate:e,requestData:t,methodData:this.getTransport().getDeleteMethodData()});case 4:return n.abrupt("return",n.sent);case 5:case"end":return n.stop()}}),A,this)}))),function(){return c.apply(this,arguments)})},{key:"getAuthenticationData",value:(i=s(h().mark((function x(){var t,e;return h().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return t=this.getAuthenticator(),r.next=3,t.loadAuthenticationData();case 3:if(e=r.sent){r.next=8;break}return r.next=7,this.authenticate();case 7:e=r.sent;case 8:return r.abrupt("return",e);case 9:case"end":return r.stop()}}),x,this)}))),function(){return i.apply(this,arguments)})},{key:"getAuthenticator",value:function(){return this._authenticator}},{key:"getRealtimeTransportWrapper",value:function(){return this._realtimeTransportWrapper}},{key:"getTransport",value:function(){return this._transport}},{key:"read",value:(n=s(h().mark((function E(){var t,e,r=arguments;return h().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t=r.length>0&&r[0]!==undefined?r[0]:null,e=r.length>1&&r[1]!==undefined&&r[1],n.next=4,this._callMethod({isPrivate:e,requestData:t,methodData:this.getTransport().getReadMethodData()});case 4:return n.abrupt("return",n.sent);case 5:case"end":return n.stop()}}),E,this)}))),function(){return n.apply(this,arguments)})},{key:"subscribe",value:function(t,e){var r=arguments.length>2&&arguments[2]!==undefined&&arguments[2];return this.getRealtimeTransportWrapper().subscribe({callbacks:e,isPrivate:r,subscriptionData:t})}},{key:"update",value:(r=s(h().mark((function k(){var t,e,r=arguments;return h().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t=r.length>0&&r[0]!==undefined?r[0]:null,e=r.length>1&&r[1]!==undefined&&r[1],n.next=4,this._callMethod({isPrivate:e,requestData:t,methodData:this.getTransport().getUpdateMethodData()});case 4:return n.abrupt("return",n.sent);case 5:case"end":return n.stop()}}),k,this)}))),function(){return r.apply(this,arguments)})},{key:"_callMethod",value:(e=s(h().mark((function T(){var t,e,r,n,o,i,a,c,s,u,l=arguments;return h().wrap((function(p){for(;;)switch(p.prev=p.next){case 0:if(t=l.length>0&&l[0]!==undefined?l[0]:{},e=t.isPrivate,r=void 0!==e&&e,n=t.isRetry,o=void 0!==n&&n,i=t.methodData,a=t.requestData,c=void 0===a?null:a,s=this.getTransport(),!r){p.next=8;break}return p.next=5,this.getAuthenticationData();case 5:p.t0=p.sent,p.next=9;break;case 8:p.t0=null;case 9:return u=p.t0,p.prev=10,p.next=13,s.callMethod({authenticationData:u,methodData:i,requestData:c,wrapper:this});case 13:return p.abrupt("return",p.sent);case 16:if(p.prev=16,p.t1=p["catch"](10),o||!s.isSessionExpiredError(p.t1)){p.next=24;break}return p.next=21,this.authenticate();case 21:return p.next=23,this._callMethod({isPrivate:r,methodData:i,requestData:c,isRetry:!0});case 23:return p.abrupt("return",p.sent);case 24:throw this.emit("error",p.t1),p.t1;case 26:case"end":return p.stop()}}),T,this,[[10,16]])}))),function(){return e.apply(this,arguments)})},{key:"_getAuthenticationPromise",value:function(){var t=this,e=this.getAuthenticator(),r=I.get(e);return r||(r=s(h().mark((function n(){var r;return h().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,e.loadAuthenticationData();case 2:return r=n.sent,n.next=5,e.authenticate(t,r);case 5:return n.abrupt("return",n.sent);case 6:case"end":return n.stop()}}),n)})))(),I.set(e,r),s(h().mark((function o(){return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,r;case 3:t.next=7;break;case 5:t.prev=5,t.t0=t["catch"](0);case 7:return t.prev=7,I["delete"](e),t.finish(7);case 10:case"end":return t.stop()}}),o,null,[[0,5,7,10]])})))(),r)}},{key:"_handleRealtimeTransportWrapperError",value:function(t){this.emit("error",o(D,a(D.createRealtimeTransportErrorArgs(t,"ApiWrapper","_handleRealtimeTransportWrapperEvent"))))}}]),g}(O())})(),n})()})); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.apiWrapper=e():t.apiWrapper=e()}(self,(function(){return(()=>{var t={757:(t,e,r)=>{t.exports=r(666)},187:t=>{"use strict";var e,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function i(){i.init.call(this)}t.exports=i,t.exports.once=function(t,e){return new Promise((function(r,n){function o(r){t.removeListener(e,i),n(r)}function i(){"function"==typeof t.removeListener&&t.removeListener("error",o),r([].slice.call(arguments))}v(t,e,i,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&v(t,"error",e,r)}(t,o,{once:!0})}))},i.EventEmitter=i,i.prototype._events=undefined,i.prototype._eventsCount=0,i.prototype._maxListeners=undefined;var a=10;function c(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function s(t){return t._maxListeners===undefined?i.defaultMaxListeners:t._maxListeners}function u(t,e,r,n){var o,i,a,u;if(c(r),(i=t._events)===undefined?(i=t._events=Object.create(null),t._eventsCount=0):(i.newListener!==undefined&&(t.emit("newListener",e,r.listener?r.listener:r),i=t._events),a=i[e]),a===undefined)a=i[e]=r,++t._eventsCount;else if("function"==typeof a?a=i[e]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(o=s(t))>0&&a.length>o&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=a.length,u=l,console&&console.warn&&console.warn(u)}return t}function l(){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 p(t,e,r){var n={fired:!1,wrapFn:undefined,target:t,type:e,listener:r},o=l.bind(n);return o.listener=r,n.wrapFn=o,o}function f(t,e,r){var n=t._events;if(n===undefined)return[];var o=n[e];return o===undefined?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(o):d(o,o.length)}function h(t){var e=this._events;if(e!==undefined){var r=e[t];if("function"==typeof r)return 1;if(r!==undefined)return r.length}return 0}function d(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function v(t,e,r,n){if("function"==typeof t.on)n.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function o(i){n.once&&t.removeEventListener(e,o),r(i)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");a=t}}),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(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},i.prototype.getMaxListeners=function(){return s(this)},i.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var o="error"===t,i=this._events;if(i!==undefined)o=o&&i.error===undefined;else if(!o)return!1;if(o){var a;if(e.length>0&&(a=e[0]),a instanceof Error)throw a;var c=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw c.context=a,c}var s=i[t];if(s===undefined)return!1;if("function"==typeof s)n(s,this,e);else{var u=s.length,l=d(s,u);for(r=0;r<u;++r)n(l[r],this,e)}return!0},i.prototype.addListener=function(t,e){return u(this,t,e,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(t,e){return u(this,t,e,!0)},i.prototype.once=function(t,e){return c(e),this.on(t,p(this,t,e)),this},i.prototype.prependOnceListener=function(t,e){return c(e),this.prependListener(t,p(this,t,e)),this},i.prototype.removeListener=function(t,e){var r,n,o,i,a;if(c(e),(n=this._events)===undefined)return this;if((r=n[t])===undefined)return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===e||r[i].listener===e){a=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,o),1===r.length&&(n[t]=r[0]),n.removeListener!==undefined&&this.emit("removeListener",t,a||e)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(t){var e,r,n;if((r=this._events)===undefined)return this;if(r.removeListener===undefined)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):r[t]!==undefined&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var o,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(o=i[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(e!==undefined)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},i.prototype.listeners=function(t){return f(this,t,!0)},i.prototype.rawListeners=function(t){return f(this,t,!1)},i.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):h.call(t,e)},i.prototype.listenerCount=h,i.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},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 s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(O){s=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),a=new L(n||[]);return i._invoke=function(t,e,r){var n=p;return function(o,i){if(n===h)throw new Error("Generator is already running");if(n===d){if("throw"===o)throw i;return M()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=k(a,r);if(c){if(c===v)continue;return c}}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 s=l(t,e,r);if("normal"===s.type){if(n=r.done?d:f,s.arg===v)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n=d,r.method="throw",r.arg=s.arg)}}}(t,r,a),i}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(O){return{type:"throw",arg:O}}}t.wrap=u;var p="suspendedStart",f="suspendedYield",h="executing",d="completed",v={};function y(){}function m(){}function g(){}var b={};s(b,i,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(R([])));_&&_!==r&&n.call(_,i)&&(b=_);var A=g.prototype=y.prototype=Object.create(b);function x(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function r(o,i,a,c){var s=l(t[o],t,i);if("throw"!==s.type){var u=s.arg,p=u.value;return p&&"object"==typeof p&&n.call(p,"__await")?e.resolve(p.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(p).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,c)}))}c(s.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 k(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,k(t,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=l(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;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,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}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 L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(D,this),this.reset(!0)}function R(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:M}}function M(){return{value:e,done:!0}}return m.prototype=g,s(A,"constructor",g),s(g,"constructor",m),m.displayName=s(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,s(t,c,"GeneratorFunction")),t.prototype=Object.create(A),t},t.awrap=function(t){return{__await:t}},x(E.prototype),s(E.prototype,a,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(A),s(A,c,"Generator"),s(A,i,(function(){return this})),s(A,"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=R,L.prototype={constructor:L,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)&&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 s=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)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,v):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),v},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),v}},"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:R(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=e}catch(r){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}}},e={};function r(n){var o=e[n];if(o!==undefined)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t["default"]:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";function t(e,r){return t=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},t(e,r)}function e(){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}}function o(r,n,i){return o=e()?Reflect.construct:function(e,r,n){var o=[null];o.push.apply(o,r);var i=new(Function.bind.apply(e,o));return n&&t(i,n.prototype),i},o.apply(null,arguments)}function i(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 a(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(u){return void r(u)}c.done?e(s):Promise.resolve(s).then(n,o)}function s(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){c(i,n,o,a,s,"next",t)}function s(t){c(i,n,o,a,s,"throw",t)}a(undefined)}))}}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(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 p(t,e,r){return e&&l(t.prototype,e),r&&l(t,r),t}r.r(n),r.d(n,{ApiAuthenticator:()=>T,ApiError:()=>D,ApiRealtimeTransport:()=>L,ApiTransport:()=>R,ApiWrapper:()=>F});var f=r(757),h=r.n(f);function d(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&t(e,r)}function v(t){return v="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},v(t)}function y(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function m(t,e){if(e&&("object"===v(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return y(t)}function g(t){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},g(t)}function b(e){var r="function"==typeof Map?new Map:undefined;return b=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,i)}function i(){return o(e,arguments,g(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t(i,e)},b(e)}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=g(t);if(e){var o=g(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return m(this,r)}}var _="api_wrapper/authentication_failed",A="api_wrapper/method_not_implemented",x="api_wrapper/parameter_not_provided",E="api_wrapper/realtime_transport",k="api_wrapper/unexpected",D=function(t){d(r,t);var e=w(r);function r(){var t,n=arguments.length>0&&arguments[0]!==undefined?arguments[0]:k,o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:n,i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;return u(this,r),(t=e.call(this,o)).code=n,t.data=i,t}return p(r,null,[{key:"createAuthenticationFailedErrorArgs",value:function(t,e,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;return[_,"[".concat(e,".").concat(r).concat(n?"::".concat(n):"","] Authentication failed"),{className:e,methodName:r,originalError:t,place:n}]}},{key:"createMethodNotImplementedErrorArgs",value:function(t,e){return[A,"[".concat(t,".").concat(e,"] Method not implemented: ").concat(e),{className:t,methodName:e}]}},{key:"createParameterNotProvidedErrorArgs",value:function(t,e,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;return[x,"[".concat(e,".").concat(r).concat(n?"::".concat(n):"","] Parameter not provided: ").concat(t),{className:e,methodName:r,parameterName:t,place:n}]}},{key:"createRealtimeTransportErrorArgs",value:function(t,e,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;return[E,"[".concat(e,".").concat(r).concat(n?"::".concat(n):"","] Realtime transport error: ").concat(t.message),{className:e,methodName:r,originalError:t,place:n}]}}]),r}(b(Error)),T=function(){function t(){u(this,t)}var e,r,n;return p(t,[{key:"authenticate",value:(n=s(h().mark((function i(t,e){return h().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:throw console.log("[ApiAuthenticator.authenticate]","wrapper:",t),console.log("[ApiAuthenticator.authenticate]","previousAuthenticationData:",e),o(D,a(D.createMethodNotImplementedErrorArgs("ApiAuthenticator","authenticate")));case 3:case"end":return r.stop()}}),i)}))),function(t,e){return n.apply(this,arguments)})},{key:"loadAuthenticationData",value:(r=s(h().mark((function c(){return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw o(D,a(D.createMethodNotImplementedErrorArgs("ApiAuthenticator","loadAuthenticationData")));case 1:case"end":return t.stop()}}),c)}))),function(){return r.apply(this,arguments)})},{key:"saveAuthenticationData",value:(e=s(h().mark((function l(t){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw console.log("[ApiAuthenticator.saveAuthenticationData]","authenticationData:",t),o(D,a(D.createMethodNotImplementedErrorArgs("ApiAuthenticator","saveAuthenticationData")));case 2:case"end":return e.stop()}}),l)}))),function(t){return e.apply(this,arguments)})}]),t}(),L=function(){function t(){u(this,t)}return p(t,[{key:"connect",value:function(t){var e=t.onConnect,r=t.onDisconnect,n=t.wrapper;throw console.log("[ApiRealtimeTransport.connect]","onConnect:",e),console.log("[ApiRealtimeTransport.connect]","onDisconnect:",r),console.log("[ApiRealtimeTransport.connect]","wrapper:",n),o(D,a(D.createMethodNotImplementedErrorArgs("ApiRealtimeTransport","connect")))}},{key:"disconnect",value:function(){throw o(D,a(D.createMethodNotImplementedErrorArgs("ApiRealtimeTransport","disconnect")))}},{key:"subscribe",value:function(t){var e=t.callbacks,r=t.isPrivate,n=t.onSubscribe,i=t.onUnsubscribe,c=t.subscriptionData;throw console.log("[ApiRealtimeTransport.subscribe]","callbacks:",e),console.log("[ApiRealtimeTransport.subscribe]","isPrivate:",r),console.log("[ApiRealtimeTransport.subscribe]","onSubscribe:",n),console.log("[ApiRealtimeTransport.subscribe]","onUnsubscribe:",i),console.log("[ApiRealtimeTransport.subscribe]","subscriptionData:",c),o(D,a(D.createMethodNotImplementedErrorArgs("ApiRealtimeTransport","subscribe")))}},{key:"unsubscribe",value:function(t){var e=t.subscriptionData;throw console.log("[ApiRealtimeTransport.unsubscribe]","subscriptionData:",e),o(D,a(D.createMethodNotImplementedErrorArgs("ApiRealtimeTransport","unsubscribe")))}}]),t}(),R=function(){function t(){u(this,t)}var e;return p(t,[{key:"callMethod",value:(e=s(h().mark((function r(t){var e,n,i,c;return h().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:throw e=t.authenticationData,n=t.methodData,i=t.requestData,c=t.wrapper,console.log("[ApiTransport.callMethod]","authenticationData:",e),console.log("[ApiTransport.callMethod]","methodData:",n),console.log("[ApiTransport.callMethod]","requestData:",i),console.log("[ApiTransport.callMethod]","wrapper:",c),o(D,a(D.createMethodNotImplementedErrorArgs("ApiTransport","callMethod")));case 6:case"end":return r.stop()}}),r)}))),function(t){return e.apply(this,arguments)})},{key:"getCreateMethodData",value:function(){throw o(D,a(D.createMethodNotImplementedErrorArgs("ApiTransport","getCreateMethodData")))}},{key:"getDeleteMethodData",value:function(){throw o(D,a(D.createMethodNotImplementedErrorArgs("ApiTransport","getDeleteMethodData")))}},{key:"getReadMethodData",value:function(){throw o(D,a(D.createMethodNotImplementedErrorArgs("ApiTransport","getReadMethodData")))}},{key:"getUpdateMethodData",value:function(){throw o(D,a(D.createMethodNotImplementedErrorArgs("ApiTransport","getUpdateMethodData")))}},{key:"isAuthenticationFailedError",value:function(t){throw console.log("[ApiTransport.isAuthenticationFailedError]","error:",t),o(D,a(D.createMethodNotImplementedErrorArgs("ApiTransport","isAuthenticationFailedError")))}},{key:"isSessionExpiredError",value:function(t){throw console.log("[ApiTransport.isSessionExpiredError]","error:",t),o(D,a(D.createMethodNotImplementedErrorArgs("ApiTransport","isSessionExpiredError")))}}]),t}(),M=r(187),O=r.n(M);function P(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 S(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 S(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 S(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}var j={Connected:"connected",Connecting:"connecting",Disconnected:"disconnected",Disconnecting:"disconnecting"},N=function(){function t(e){var r=e.onError,n=e.realtimeTransport,o=e.wrapper;u(this,t),this._connectionState=j.Disconnected,this._onError=r,this._realtimeTransport=n,this._reconnectDelay=1e3,this._subscriptions=new Set,this._wrapper=o}return p(t,[{key:"getRealtimeTransport",value:function(){return this._realtimeTransport}},{key:"getWrapper",value:function(){return this._wrapper}},{key:"subscribe",value:function(t){var e=this,r=t.callbacks,n=t.isPrivate,o=void 0!==n&&n,i=t.subscriptionData,a=this.getRealtimeTransport(),c={callbacks:r,isPrivate:o,subscriptionData:i,isSubscribed:!1};switch(this._subscriptions.add(c),this._connectionState){case j.Disconnected:this._connect();break;case j.Connected:this._subscribe(c)}return function(){if(c.isSubscribed&&a.unsubscribe({subscriptionData:i}),e._subscriptions["delete"](c),e._subscriptions.size<1){if([j.Disconnected,j.Disconnecting].includes(e._connectionState))return;e._disconnect()}}}},{key:"_connect",value:function(){var t=this;this._connectionState=j.Connecting,this.getRealtimeTransport().connect({onConnect:function(){return t._handleConnect()},onDisconnect:function(e){return t._handleDisconnect(e)},wrapper:this.getWrapper()})}},{key:"_disconnect",value:function(){this._connectionState=j.Disconnecting,this.getRealtimeTransport().disconnect()}},{key:"_handleConnect",value:function(){this._reconnectDelay=1e3,this._connectionState=j.Connected;var t,e=P(this._subscriptions);try{for(e.s();!(t=e.n()).done;){var r=t.value;r.isSubscribed||this._subscribe(r)}}catch(n){e.e(n)}finally{e.f()}}},{key:"_handleDisconnect",value:function(t){var e=this,r=this._connectionState===j.Disconnecting;this._connectionState=j.Disconnected,t?this._onError(t):this._subscriptions.size<1||(r?this._connect():(this._reconnectDelay<32e3&&(this._reconnectDelay*=2),setTimeout((function(){return e._connect()}),this._reconnectDelay)))}},{key:"_subscribe",value:function(t){var e=t.callbacks,r=t.isPrivate,n=t.subscriptionData;this.getRealtimeTransport().subscribe({callbacks:e,isPrivate:r,subscriptionData:n,onSubscribe:function(){t.isSubscribed=!0},onUnsubscribe:function(){t.isSubscribed=!1}})}}]),t}();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=g(t);if(e){var o=g(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return m(this,r)}}var I=new Map,F=function(t){d(g,t);var e,r,n,i,c,l,f,v,m=C(g);function g(t){var e,r=t.authenticator,n=t.realtimeTransport,i=t.transport;if(u(this,g),!r)throw o(D,a(D.createParameterNotProvidedErrorArgs("authenticator","ApiWrapper","constructor")));if(!n)throw o(D,a(D.createParameterNotProvidedErrorArgs("realtimeTransport","ApiWrapper","constructor")));if(!i)throw o(D,a(D.createParameterNotProvidedErrorArgs("transport","ApiWrapper","constructor")));return(e=m.call(this))._authenticator=r,e._realtimeTransportWrapper=new N({realtimeTransport:n,onError:e._handleRealtimeTransportWrapperError,wrapper:y(e)}),e._transport=i,e}return p(g,[{key:"authenticate",value:(v=s(h().mark((function b(){var t,e,r;return h().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t=this.getAuthenticator(),n.prev=1,n.next=4,this._getAuthenticationPromise();case 4:return e=n.sent,n.next=7,t.saveAuthenticationData(e);case 7:return n.abrupt("return",e);case 10:if(n.prev=10,n.t0=n["catch"](1),!this.getTransport().isAuthenticationFailedError(n.t0)){n.next=16;break}throw r=o(D,a(D.createAuthenticationFailedErrorArgs(n.t0,"ApiWrapper","authenticate"))),this.emit("error",r),r;case 16:throw this.emit("error",n.t0),n.t0;case 18:case"end":return n.stop()}}),b,this,[[1,10]])}))),function(){return v.apply(this,arguments)})},{key:"callMethod",value:(f=s(h().mark((function w(t){var e,r,n=arguments;return h().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return e=n.length>1&&n[1]!==undefined?n[1]:null,r=n.length>2&&n[2]!==undefined&&n[2],o.next=4,this._callMethod({isPrivate:r,methodData:t,requestData:e});case 4:return o.abrupt("return",o.sent);case 5:case"end":return o.stop()}}),w,this)}))),function(t){return f.apply(this,arguments)})},{key:"create",value:(l=s(h().mark((function _(){var t,e,r=arguments;return h().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t=r.length>0&&r[0]!==undefined?r[0]:null,e=r.length>1&&r[1]!==undefined&&r[1],n.next=4,this._callMethod({isPrivate:e,requestData:t,methodData:this.getTransport().getCreateMethodData()});case 4:return n.abrupt("return",n.sent);case 5:case"end":return n.stop()}}),_,this)}))),function(){return l.apply(this,arguments)})},{key:"delete",value:(c=s(h().mark((function A(){var t,e,r=arguments;return h().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t=r.length>0&&r[0]!==undefined?r[0]:null,e=r.length>1&&r[1]!==undefined&&r[1],n.next=4,this._callMethod({isPrivate:e,requestData:t,methodData:this.getTransport().getDeleteMethodData()});case 4:return n.abrupt("return",n.sent);case 5:case"end":return n.stop()}}),A,this)}))),function(){return c.apply(this,arguments)})},{key:"getAuthenticationData",value:(i=s(h().mark((function x(){var t,e;return h().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return t=this.getAuthenticator(),r.next=3,t.loadAuthenticationData();case 3:if(e=r.sent){r.next=8;break}return r.next=7,this.authenticate();case 7:e=r.sent;case 8:return r.abrupt("return",e);case 9:case"end":return r.stop()}}),x,this)}))),function(){return i.apply(this,arguments)})},{key:"getAuthenticator",value:function(){return this._authenticator}},{key:"getRealtimeTransportWrapper",value:function(){return this._realtimeTransportWrapper}},{key:"getTransport",value:function(){return this._transport}},{key:"read",value:(n=s(h().mark((function E(){var t,e,r=arguments;return h().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t=r.length>0&&r[0]!==undefined?r[0]:null,e=r.length>1&&r[1]!==undefined&&r[1],n.next=4,this._callMethod({isPrivate:e,requestData:t,methodData:this.getTransport().getReadMethodData()});case 4:return n.abrupt("return",n.sent);case 5:case"end":return n.stop()}}),E,this)}))),function(){return n.apply(this,arguments)})},{key:"subscribe",value:function(t,e){var r=arguments.length>2&&arguments[2]!==undefined&&arguments[2];return this.getRealtimeTransportWrapper().subscribe({callbacks:e,isPrivate:r,subscriptionData:t})}},{key:"update",value:(r=s(h().mark((function k(){var t,e,r=arguments;return h().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t=r.length>0&&r[0]!==undefined?r[0]:null,e=r.length>1&&r[1]!==undefined&&r[1],n.next=4,this._callMethod({isPrivate:e,requestData:t,methodData:this.getTransport().getUpdateMethodData()});case 4:return n.abrupt("return",n.sent);case 5:case"end":return n.stop()}}),k,this)}))),function(){return r.apply(this,arguments)})},{key:"_callMethod",value:(e=s(h().mark((function T(){var t,e,r,n,o,i,a,c,s,u,l=arguments;return h().wrap((function(p){for(;;)switch(p.prev=p.next){case 0:if(t=l.length>0&&l[0]!==undefined?l[0]:{},e=t.isPrivate,r=void 0!==e&&e,n=t.isRetry,o=void 0!==n&&n,i=t.methodData,a=t.requestData,c=void 0===a?null:a,s=this.getTransport(),!r){p.next=8;break}return p.next=5,this.getAuthenticationData();case 5:p.t0=p.sent,p.next=9;break;case 8:p.t0=null;case 9:return u=p.t0,p.prev=10,p.next=13,s.callMethod({authenticationData:u,methodData:i,requestData:c,wrapper:this});case 13:return p.abrupt("return",p.sent);case 16:if(p.prev=16,p.t1=p["catch"](10),o||!s.isSessionExpiredError(p.t1)){p.next=24;break}return p.next=21,this.authenticate();case 21:return p.next=23,this._callMethod({isPrivate:r,methodData:i,requestData:c,isRetry:!0});case 23:return p.abrupt("return",p.sent);case 24:throw this.emit("error",p.t1),p.t1;case 26:case"end":return p.stop()}}),T,this,[[10,16]])}))),function(){return e.apply(this,arguments)})},{key:"_getAuthenticationPromise",value:function(){var t=this,e=this.getAuthenticator(),r=I.get(e);return r||(r=s(h().mark((function n(){var r;return h().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,e.loadAuthenticationData();case 2:return r=n.sent,n.next=5,e.authenticate(t,r);case 5:return n.abrupt("return",n.sent);case 6:case"end":return n.stop()}}),n)})))(),I.set(e,r),s(h().mark((function o(){return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,r;case 3:t.next=7;break;case 5:t.prev=5,t.t0=t["catch"](0);case 7:return t.prev=7,I["delete"](e),t.finish(7);case 10:case"end":return t.stop()}}),o,null,[[0,5,7,10]])})))(),r)}},{key:"_handleRealtimeTransportWrapperError",value:function(t){this.emit("error",o(D,a(D.createRealtimeTransportErrorArgs(t,"ApiWrapper","_handleRealtimeTransportWrapperEvent"))))}}]),g}(O())})(),n})()})); | ||
//# sourceMappingURL=index.browser.js.map |
{ | ||
"name": "@ololoepepe/api-wrapper", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"description": "A wrapper around your API calls", | ||
@@ -28,20 +28,20 @@ "main": "dist/index.node.js", | ||
"devDependencies": { | ||
"@babel/core": "^7.15.0", | ||
"@babel/core": "^7.15.5", | ||
"@babel/register": "^7.15.3", | ||
"@babel/runtime": "^7.15.3", | ||
"@ololoepepe/babel-preset-default": "^0.1.21", | ||
"@babel/runtime": "^7.15.4", | ||
"@ololoepepe/babel-preset-default": "^0.1.22", | ||
"babel-eslint": "^10.1.0", | ||
"babel-loader": "^8.2.2", | ||
"copy-webpack-plugin": "^9.0.1", | ||
"core-js": "^3.16.3", | ||
"core-js": "^3.18.0", | ||
"eslint": "^7.32.0", | ||
"eslint-config-xo": "^0.38.0", | ||
"eslint-plugin-import": "^2.24.2", | ||
"mocha": "^9.1.0", | ||
"mocha": "^9.1.1", | ||
"regenerator-runtime": "^0.13.9", | ||
"terser-webpack-plugin": "^5.1.4", | ||
"terser-webpack-plugin": "^5.2.4", | ||
"test-console": "^2.0.0", | ||
"webpack": "^5.51.1", | ||
"webpack": "^5.53.0", | ||
"webpack-cli": "^4.8.0" | ||
} | ||
} |
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
246656