@coasys/ad4m-connect
Advanced tools
Comparing version 0.9.0-rc3 to 0.9.0-rc4
@@ -1,1 +0,1 @@ | ||
var a=(e,t,o)=>new Promise((n,r)=>{var c=s=>{try{l(o.next(s))}catch(u){r(u)}},p=s=>{try{l(o.throw(s))}catch(u){r(u)}},l=s=>s.done?n(s.value):Promise.resolve(s.value).then(c,p);l((o=o.apply(e,t)).next())});var i="0.9.0-rc3";function b(){let e=new AbortController;return setTimeout(()=>e.abort(),20),e}function w(e,t=1e4){return a(this,null,function*(){return Promise.race([new Promise((o,n)=>{e.includes("localhost")||o(new WebSocket(e));let r=new WebSocket(e);r.onopen=()=>{o(r)},r.onerror=c=>{n(c)}}),new Promise((o,n)=>{setTimeout(()=>{n(new Error("WebSocket connection timed out"))},t)})])})}function j(e){return a(this,null,function*(){try{let t=yield fetch(`http://localhost:${e}/graphql/`,{signal:b().signal,mode:"no-cors"});if(t.status===400||t.status===0)return e;throw new Error(`Could not connect to port ${e}`)}catch(t){throw new Error(`Could not connect to port ${e}`)}})}function v(){return new Promise((e,t)=>{let o=document.querySelector("ad4m-connect"),n=o==null?void 0:o.getAd4mClient();n?e(n):t("No Ad4mClient found")})}function y(e){let t=document.querySelector("ad4m-connect");t==null||t.addEventListener("authstatechange",o=>{e(o.detail)})}function S(){let e=navigator.userAgent,t="";return e.search("Windows")!==-1?t="Windows":e.search("Mac")!==-1?t="MacOS":e.search("X11")!==-1&&e.search("Linux")===-1?t="UNIX":e.search("Linux")!==-1&&e.search("X11")!==-1&&(t="Linux"),t}function d(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(e){return!1}return!0}function x(e,t){d()&&localStorage.setItem(`${i}/${e}`,t)}function A(e){return d()?localStorage.getItem(`${i}/${e}`):null}function C(e){d()&&localStorage.removeItem(`${i}/${e}`)}export{j as checkPort,w as connectWebSocket,S as detectOS,v as getAd4mClient,A as getForVersion,y as onAuthStateChanged,C as removeForVersion,x as setForVersion}; | ||
var a=(e,t,o)=>new Promise((n,r)=>{var c=s=>{try{l(o.next(s))}catch(u){r(u)}},p=s=>{try{l(o.throw(s))}catch(u){r(u)}},l=s=>s.done?n(s.value):Promise.resolve(s.value).then(c,p);l((o=o.apply(e,t)).next())});var i="0.9.0-rc4";function b(){let e=new AbortController;return setTimeout(()=>e.abort(),20),e}function w(e,t=1e4){return a(this,null,function*(){return Promise.race([new Promise((o,n)=>{e.includes("localhost")||o(new WebSocket(e));let r=new WebSocket(e);r.onopen=()=>{o(r)},r.onerror=c=>{n(c)}}),new Promise((o,n)=>{setTimeout(()=>{n(new Error("WebSocket connection timed out"))},t)})])})}function j(e){return a(this,null,function*(){try{let t=yield fetch(`http://localhost:${e}/graphql/`,{signal:b().signal,mode:"no-cors"});if(t.status===400||t.status===0)return e;throw new Error(`Could not connect to port ${e}`)}catch(t){throw new Error(`Could not connect to port ${e}`)}})}function v(){return new Promise((e,t)=>{let o=document.querySelector("ad4m-connect"),n=o==null?void 0:o.getAd4mClient();n?e(n):t("No Ad4mClient found")})}function y(e){let t=document.querySelector("ad4m-connect");t==null||t.addEventListener("authstatechange",o=>{e(o.detail)})}function S(){let e=navigator.userAgent,t="";return e.search("Windows")!==-1?t="Windows":e.search("Mac")!==-1?t="MacOS":e.search("X11")!==-1&&e.search("Linux")===-1?t="UNIX":e.search("Linux")!==-1&&e.search("X11")!==-1&&(t="Linux"),t}function d(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(e){return!1}return!0}function x(e,t){d()&&localStorage.setItem(`${i}/${e}`,t)}function A(e){return d()?localStorage.getItem(`${i}/${e}`):null}function C(e){d()&&localStorage.removeItem(`${i}/${e}`)}export{j as checkPort,w as connectWebSocket,S as detectOS,v as getAd4mClient,A as getForVersion,y as onAuthStateChanged,C as removeForVersion,x as setForVersion}; |
@@ -69,3 +69,3 @@ { | ||
}, | ||
"version": "0.9.0-rc3" | ||
"version": "0.9.0-rc4" | ||
} |
Sorry, the diff of this file is too big to display