@coasys/ad4m-connect 0.12.0-rc1-dev.5 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/icons/CreditIcon.d.ts +1 -0
- package/dist/components/icons/GlobeIcon.d.ts +1 -0
- package/dist/components/icons/WalletIcon.d.ts +1 -0
- package/dist/components/shared/avatar.d.ts +8 -0
- package/dist/components/views/HostBrowser.d.ts +29 -0
- package/dist/components/views/HostDetail.d.ts +17 -0
- package/dist/components/views/LoggedInDashboard.d.ts +26 -0
- package/dist/core.js +350 -324
- package/dist/index.js +392 -366
- package/dist/services/hostIndex.d.ts +11 -0
- package/dist/utils.js +1 -1
- package/dist/web.js +354 -328
- package/package.json +15 -15
- package/dist/components/icons/CheckCircleIcon.d.ts +0 -1
- package/dist/components/icons/TickIcon.d.ts +0 -1
- package/dist/components/shared/Ad4mLogo.d.ts +0 -1
- package/dist/components/shared/AppLogo.d.ts +0 -1
- package/dist/components/shared/Header.d.ts +0 -1
- package/dist/components/shared/Logo.d.ts +0 -1
- package/dist/components/states/ErrorState.d.ts +0 -6
- package/dist/components/views/ConnectionOverview.d.ts +0 -22
- package/dist/components/views/Hosting.d.ts +0 -22
- package/dist/components/views/MultiUserAuth.d.ts +0 -26
- package/dist/components/views/RemoteConnection.d.ts +0 -19
- package/dist/components/views/RequestCapability.d.ts +0 -16
- package/dist/components/views/ScanQRCode.d.ts +0 -14
- package/dist/components/views/Settings.d.ts +0 -19
- package/dist/components/views/Start.d.ts +0 -19
- package/dist/components/views/old/Hosting.d.ts +0 -22
- package/dist/components/views/old/MultiUserAuth.d.ts +0 -26
- package/dist/components/views/old/RemoteConnection.d.ts +0 -19
- package/dist/components/views/old/RequestCapability.d.ts +0 -16
- package/dist/components/views/old/ScanQRCode.d.ts +0 -14
- package/dist/components/views/old/Settings.d.ts +0 -19
- package/dist/components/views/old/Start.d.ts +0 -19
- package/dist/old/components/InvalidToken.d.ts +0 -0
- package/dist/old/components/VerifyCode.d.ts +0 -0
- package/dist/old/core.d.ts +0 -0
- package/dist/old/electron.d.ts +0 -0
- package/dist/old/state/ConnectState.d.ts +0 -0
- package/dist/old/state/index.d.ts +0 -0
- package/dist/old/utils.d.ts +0 -0
- package/dist/old/views/Hosting.d.ts +0 -0
- package/dist/old/views/MultiUserAuth.d.ts +0 -0
- package/dist/old/views/RemoteConnection.d.ts +0 -0
- package/dist/old/views/RequestCapability.d.ts +0 -0
- package/dist/old/views/ScanQRCode.d.ts +0 -0
- package/dist/old/views/Settings.d.ts +0 -0
- package/dist/old/views/Start.d.ts +0 -0
- package/dist/old/web.d.ts +0 -0
- package/dist/state/ConnectState.d.ts +0 -101
- package/dist/state/index.d.ts +0 -2
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RemoteHost, UserInfo } from '../types';
|
|
2
|
+
import type { Ad4mClient } from '@coasys/ad4m';
|
|
3
|
+
/** Fetch available hosts from the central index API */
|
|
4
|
+
export declare function fetchHosts(indexUrl?: string): Promise<RemoteHost[]>;
|
|
5
|
+
/** Fetch current user info from the executor via GraphQL */
|
|
6
|
+
export declare function fetchUserInfo(ad4mClient: Ad4mClient): Promise<UserInfo>;
|
|
7
|
+
/** Trigger a payment request via the executor's GraphQL API */
|
|
8
|
+
export declare function requestPayment(ad4mClient: Ad4mClient, amountHOT: number): Promise<{
|
|
9
|
+
success: boolean;
|
|
10
|
+
message: string;
|
|
11
|
+
}>;
|
package/dist/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var l=(o,s,t)=>new Promise((c,e)=>{var r=n=>{try{u(t.next(n))}catch(d){e(d)}},p=n=>{try{u(t.throw(n))}catch(d){e(d)}},u=n=>n.done?c(n.value):Promise.resolve(n.value).then(r,p);u((t=t.apply(o,s)).next())});var a="0.12.0
|
|
1
|
+
var l=(o,s,t)=>new Promise((c,e)=>{var r=n=>{try{u(t.next(n))}catch(d){e(d)}},p=n=>{try{u(t.throw(n))}catch(d){e(d)}},u=n=>n.done?c(n.value):Promise.resolve(n.value).then(r,p);u((t=t.apply(o,s)).next())});var a="0.12.0";function f(){return typeof window!="undefined"&&window.self!==window.top}function i(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(o){return!1}return!0}function w(o,s){i()&&localStorage.setItem(`${a}/${o}`,s)}function k(o){return i()?localStorage.getItem(`${a}/${o}`):null}function y(o){i()&&localStorage.removeItem(`${a}/${o}`)}function v(o,s=1e4){return l(this,null,function*(){return Promise.race([new Promise((t,c)=>{let e;try{e=new WebSocket(o,"graphql-transport-ws"),e.onopen=()=>{e.close(),t(e)},e.onerror=r=>{c(r)},e.onclose=r=>{r.code!==1e3&&c(new Error(`WebSocket closed with code ${r.code}: ${r.reason}`))}}catch(r){e&&e.close(),c(r)}}),new Promise((t,c)=>{setTimeout(()=>{c(new Error("WebSocket connection timed out"))},s)})])})}export{v as connectWebSocket,k as getLocal,f as isEmbedded,y as removeLocal,w as setLocal};
|