@perspect3vism/ad4m-connect
Advanced tools
Comparing version 0.2.3 to 0.2.5
@@ -1,1 +0,1 @@ | ||
var l=(t,e,n)=>new Promise((r,s)=>{var u=o=>{try{c(n.next(o))}catch(i){s(i)}},a=o=>{try{c(n.throw(o))}catch(i){s(i)}},c=o=>o.done?r(o.value):Promise.resolve(o.value).then(u,a);c((n=n.apply(t,e)).next())});function m(){let t=new AbortController;return setTimeout(()=>t.abort(),20),t}function C(t){return l(this,null,function*(){try{return(yield fetch(`http://localhost:${t}/graphql/`,{signal:m().signal,mode:"no-cors"})).status===400?t:null}catch(e){throw e}})}function f(){return new Promise((t,e)=>{let n=document.querySelector("ad4m-connect"),r=n==null?void 0:n.getAd4mClient();r?t(r):e("No Ad4mClient found")})}function h(t){let e=document.querySelector("ad4m-connect");e==null||e.addEventListener("authStateChange",n=>{t(n.detail)})}function g(){return document.querySelector("ad4m-connect").connected()}export{C as checkPort,f as getAd4mClient,g as isConnected,h as onAuthStateChanged}; | ||
var u=(t,e,n)=>new Promise((r,s)=>{var l=o=>{try{c(n.next(o))}catch(i){s(i)}},a=o=>{try{c(n.throw(o))}catch(i){s(i)}},c=o=>o.done?r(o.value):Promise.resolve(o.value).then(l,a);c((n=n.apply(t,e)).next())});function m(){let t=new AbortController;return setTimeout(()=>t.abort(),20),t}function C(t){return u(this,null,function*(){try{let e=yield fetch(`http://localhost:${t}/graphql/`,{signal:m().signal,mode:"no-cors"});return e.status===400||e.status===0?t:null}catch(e){throw e}})}function f(){return new Promise((t,e)=>{let n=document.querySelector("ad4m-connect"),r=n==null?void 0:n.getAd4mClient();r?t(r):e("No Ad4mClient found")})}function h(t){let e=document.querySelector("ad4m-connect");e==null||e.addEventListener("authStateChange",n=>{t(n.detail)})}function g(){return document.querySelector("ad4m-connect").connected()}export{C as checkPort,f as getAd4mClient,g as isConnected,h as onAuthStateChanged}; |
{ | ||
"name": "@perspect3vism/ad4m-connect", | ||
"version": "0.2.3", | ||
"version": "0.2.5", | ||
"description": "Lib for handling everything needed to setup a connection to a local or remote ad4m-executor", | ||
@@ -5,0 +5,0 @@ "license": "CAL-1.0", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
3359200
5376
25