@coasys/ad4m-connect 0.12.1-dev → 0.13.0-postmessage-ws-proxy.1
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/PostMessageWebSocket.d.ts +30 -0
- package/dist/components/icons/CheckCircleIcon.d.ts +1 -0
- package/dist/components/icons/MapPinIcon.d.ts +1 -0
- package/dist/components/icons/TickIcon.d.ts +1 -0
- package/dist/components/icons/index.d.ts +1 -0
- package/dist/components/shared/Ad4mLogo.d.ts +1 -0
- package/dist/components/shared/AppLogo.d.ts +1 -0
- package/dist/components/shared/Header.d.ts +1 -0
- package/dist/components/shared/Logo.d.ts +1 -0
- package/dist/components/states/ErrorState.d.ts +6 -0
- package/dist/components/views/ConnectionOverview.d.ts +22 -0
- package/dist/components/views/HostBrowser.d.ts +0 -1
- package/dist/components/views/HostDetail.d.ts +2 -1
- package/dist/components/views/Hosting.d.ts +22 -0
- package/dist/components/views/LocalAuthentication.d.ts +2 -1
- package/dist/components/views/LoggedInDashboard.d.ts +20 -2
- package/dist/components/views/MultiUserAuth.d.ts +26 -0
- package/dist/components/views/RemoteAuthentication.d.ts +3 -1
- package/dist/components/views/RemoteConnection.d.ts +19 -0
- package/dist/components/views/RequestCapability.d.ts +16 -0
- package/dist/components/views/ScanQRCode.d.ts +14 -0
- package/dist/components/views/Settings.d.ts +19 -0
- package/dist/components/views/Start.d.ts +19 -0
- package/dist/components/views/old/Hosting.d.ts +22 -0
- package/dist/components/views/old/MultiUserAuth.d.ts +26 -0
- package/dist/components/views/old/RemoteConnection.d.ts +19 -0
- package/dist/components/views/old/RequestCapability.d.ts +16 -0
- package/dist/components/views/old/ScanQRCode.d.ts +14 -0
- package/dist/components/views/old/Settings.d.ts +19 -0
- package/dist/components/views/old/Start.d.ts +19 -0
- package/dist/core.d.ts +10 -6
- package/dist/core.js +11361 -1581
- package/dist/core.js.map +7 -0
- package/dist/index.js +14079 -1931
- package/dist/index.js.map +7 -0
- 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/services/hostIndex.d.ts +2 -2
- package/dist/state/ConnectState.d.ts +101 -0
- package/dist/state/index.d.ts +2 -0
- package/dist/types.d.ts +13 -0
- package/dist/utils.d.ts +4 -1
- package/dist/utils.js +99 -1
- package/dist/utils.js.map +7 -0
- package/dist/web.d.ts +4 -0
- package/dist/web.js +12736 -1864
- package/dist/web.js.map +7 -0
- package/package.json +21 -19
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A WebSocket-compatible class that proxies all communication through
|
|
3
|
+
* window.parent via postMessage instead of opening a real WebSocket.
|
|
4
|
+
*
|
|
5
|
+
* Used in embedded mode when the host/parent application sends AD4M_CONFIG
|
|
6
|
+
* with proxy: true. The host opens a real WebSocket to the AD4M daemon and
|
|
7
|
+
* forwards raw frames bidirectionally via the AD4M_PROXY_WS_* protocol.
|
|
8
|
+
*
|
|
9
|
+
* The constructor URL is intentionally ignored — the connection target is
|
|
10
|
+
* determined by the host, not the embedded app.
|
|
11
|
+
*/
|
|
12
|
+
export declare class PostMessageWebSocket {
|
|
13
|
+
static readonly CONNECTING = 0;
|
|
14
|
+
static readonly OPEN = 1;
|
|
15
|
+
static readonly CLOSING = 2;
|
|
16
|
+
static readonly CLOSED = 3;
|
|
17
|
+
readyState: number;
|
|
18
|
+
onopen: ((e: Event) => void) | null;
|
|
19
|
+
onmessage: ((e: MessageEvent) => void) | null;
|
|
20
|
+
onerror: ((e: Event) => void) | null;
|
|
21
|
+
onclose: ((e: CloseEvent) => void) | null;
|
|
22
|
+
private readonly _messageHandler;
|
|
23
|
+
private _connectTimeout;
|
|
24
|
+
private readonly _targetOrigin;
|
|
25
|
+
static readonly CONNECT_TIMEOUT_MS = 30000;
|
|
26
|
+
constructor(_url: string, targetOrigin: string);
|
|
27
|
+
private _clearConnectTimeout;
|
|
28
|
+
send(data: string): void;
|
|
29
|
+
close(code?: number, reason?: string): void;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function ArrowLeftRightIcon(): import("lit").TemplateResult<1>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function MapPinIcon(): import("lit").TemplateResult<1>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function TickIcon(): import("lit").TemplateResult<1>;
|
|
@@ -11,3 +11,4 @@ export { default as ArrowLeftIcon } from "./ArrowLeftIcon";
|
|
|
11
11
|
export { default as GlobeIcon } from "./GlobeIcon";
|
|
12
12
|
export { default as CreditIcon } from "./CreditIcon";
|
|
13
13
|
export { default as WalletIcon } from "./WalletIcon";
|
|
14
|
+
export { default as MapPinIcon } from "./MapPinIcon";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function Ad4mLogo(): import("lit").TemplateResult<1>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function AppLogo(): import("lit").TemplateResult<1>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function Header(): import("lit").TemplateResult<1>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function Logo(): import("lit").TemplateResult<1>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
export declare class ConnectionOverview extends LitElement {
|
|
3
|
+
localDetected: boolean;
|
|
4
|
+
defaultRemoteUrl?: string;
|
|
5
|
+
remoteUrl?: string;
|
|
6
|
+
isMobile: boolean;
|
|
7
|
+
port: number;
|
|
8
|
+
private portInput;
|
|
9
|
+
static styles: import("lit").CSSResult[];
|
|
10
|
+
private detectLocal;
|
|
11
|
+
private handleConnectLocal;
|
|
12
|
+
private handleConnectRemote;
|
|
13
|
+
private handleScanQR;
|
|
14
|
+
private handleDownload;
|
|
15
|
+
private changePort;
|
|
16
|
+
render(): import("lit").TemplateResult<1>;
|
|
17
|
+
}
|
|
18
|
+
declare global {
|
|
19
|
+
interface HTMLElementTagNameMap {
|
|
20
|
+
"connection-overview": ConnectionOverview;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -11,7 +11,6 @@ export declare class HostBrowser extends LitElement {
|
|
|
11
11
|
private defaultApplied;
|
|
12
12
|
static styles: import("lit").CSSResult[];
|
|
13
13
|
willUpdate(changedProps: import("lit").PropertyValues): void;
|
|
14
|
-
private back;
|
|
15
14
|
private selectHost;
|
|
16
15
|
private connectManualUrl;
|
|
17
16
|
private renderAvatar;
|
|
@@ -3,9 +3,10 @@ import type { RemoteHost } from "../../types";
|
|
|
3
3
|
export declare class HostDetail extends LitElement {
|
|
4
4
|
host: RemoteHost;
|
|
5
5
|
static styles: import("lit").CSSResult[];
|
|
6
|
-
private back;
|
|
7
6
|
private proceedToAuth;
|
|
8
7
|
private renderAvatar;
|
|
8
|
+
private static OPERATION_RATES;
|
|
9
|
+
private isOperationRate;
|
|
9
10
|
private rateLabel;
|
|
10
11
|
private formatPrice;
|
|
11
12
|
render(): TemplateResult<1>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
export declare class HostingView extends LitElement {
|
|
3
|
+
step: number;
|
|
4
|
+
email: string;
|
|
5
|
+
password: string;
|
|
6
|
+
passwordError: string;
|
|
7
|
+
isHostingRunning: boolean | null;
|
|
8
|
+
static styles: import("lit").CSSResult[];
|
|
9
|
+
private handleBack;
|
|
10
|
+
private handleEmailChange;
|
|
11
|
+
private handlePasswordChange;
|
|
12
|
+
private handleCheckEmail;
|
|
13
|
+
private handleLogin;
|
|
14
|
+
private handleResetHosting;
|
|
15
|
+
private handleClearRunning;
|
|
16
|
+
render(): import("lit").TemplateResult<1>;
|
|
17
|
+
}
|
|
18
|
+
declare global {
|
|
19
|
+
interface HTMLElementTagNameMap {
|
|
20
|
+
"hosting-view": HostingView;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -6,8 +6,9 @@ export declare class LocalAuthentication extends LitElement {
|
|
|
6
6
|
verificationError: boolean;
|
|
7
7
|
private requestSent;
|
|
8
8
|
private securityCode;
|
|
9
|
+
private verifying;
|
|
9
10
|
static styles: import("lit").CSSResult[];
|
|
10
|
-
|
|
11
|
+
willUpdate(changedProps: import("lit").PropertyValues): void;
|
|
11
12
|
private requestCapability;
|
|
12
13
|
private verifyCode;
|
|
13
14
|
private onInputChange;
|
|
@@ -1,21 +1,39 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
-
import type { RemoteHost, UserInfo } from "../../types";
|
|
2
|
+
import type { RemoteHost, UserInfo, ComputeLogEntryData } from "../../types";
|
|
3
3
|
export declare class LoggedInDashboard extends LitElement {
|
|
4
4
|
connectedHost: RemoteHost | null;
|
|
5
5
|
userInfo: UserInfo | null;
|
|
6
6
|
requestingPayment: boolean;
|
|
7
7
|
paymentError: string | null;
|
|
8
|
+
/** When true (credit-depletion session), the X close button is hidden — the only exits are "Use App" or "Disconnect" */
|
|
9
|
+
forceOpen: boolean;
|
|
8
10
|
private walletInput;
|
|
9
11
|
private editingWallet;
|
|
10
|
-
private
|
|
12
|
+
private walletSaveSuccess;
|
|
13
|
+
private topUpAmount;
|
|
14
|
+
private awaitingApproval;
|
|
15
|
+
private creditsUpdated;
|
|
16
|
+
private activityLogOpen;
|
|
17
|
+
private activityLog;
|
|
18
|
+
private activityLogLoading;
|
|
19
|
+
private previousCredits;
|
|
11
20
|
static styles: import("lit").CSSResult[];
|
|
12
21
|
private close;
|
|
22
|
+
private _useApp;
|
|
13
23
|
private disconnect;
|
|
14
24
|
private setWalletAddress;
|
|
15
25
|
private requestTopUp;
|
|
26
|
+
private truncateMiddle;
|
|
27
|
+
private toggleActivityLog;
|
|
28
|
+
private loadActivityLog;
|
|
29
|
+
/** Call this externally to push a realtime log entry */
|
|
30
|
+
pushLogEntry(entry: ComputeLogEntryData): void;
|
|
31
|
+
private formatTimeAgo;
|
|
32
|
+
private formatOperation;
|
|
16
33
|
private get hasWallet();
|
|
17
34
|
private get isFreeAccess();
|
|
18
35
|
private get isDepleted();
|
|
36
|
+
private get topUpDisabled();
|
|
19
37
|
updated(changed: Map<string, unknown>): void;
|
|
20
38
|
render(): import("lit").TemplateResult<1>;
|
|
21
39
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
export declare class MultiUserAuth extends LitElement {
|
|
3
|
+
email: string;
|
|
4
|
+
password: string;
|
|
5
|
+
verificationCode: string;
|
|
6
|
+
error: string | null;
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
backendUrl?: string;
|
|
9
|
+
step: "email" | "password" | "code";
|
|
10
|
+
verificationType: "signup" | "login";
|
|
11
|
+
static styles: import("lit").CSSResult[];
|
|
12
|
+
private handleEmailChange;
|
|
13
|
+
private handlePasswordChange;
|
|
14
|
+
private handleCodeChange;
|
|
15
|
+
private handleEmailSubmit;
|
|
16
|
+
private handlePasswordSubmit;
|
|
17
|
+
private handleCodeSubmit;
|
|
18
|
+
private handleBackToEmail;
|
|
19
|
+
private handleKeyPress;
|
|
20
|
+
render(): import("lit").TemplateResult<1>;
|
|
21
|
+
}
|
|
22
|
+
declare global {
|
|
23
|
+
interface HTMLElementTagNameMap {
|
|
24
|
+
"multi-user-auth": MultiUserAuth;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -13,8 +13,10 @@ export declare class RemoteAuthentication extends LitElement {
|
|
|
13
13
|
private emailSecurityCode;
|
|
14
14
|
private confirmPassword;
|
|
15
15
|
static styles: import("lit").CSSResult[];
|
|
16
|
-
private back;
|
|
17
16
|
private emailLogin;
|
|
17
|
+
disconnectedCallback(): void;
|
|
18
|
+
private clearSensitiveState;
|
|
19
|
+
private tryAgain;
|
|
18
20
|
private verifyEmailCode;
|
|
19
21
|
private passwordLogin;
|
|
20
22
|
private createAccount;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
export declare class RemoteConnection extends LitElement {
|
|
3
|
+
initialUrl?: string;
|
|
4
|
+
detecting: boolean;
|
|
5
|
+
multiUserDetected: boolean | null;
|
|
6
|
+
error: string | null;
|
|
7
|
+
static styles: import("lit").CSSResult[];
|
|
8
|
+
private handleBack;
|
|
9
|
+
private handleUrlChange;
|
|
10
|
+
private handleConnect;
|
|
11
|
+
private handleMultiUserAuth;
|
|
12
|
+
private handleRequestCapability;
|
|
13
|
+
render(): import("lit").TemplateResult<1>;
|
|
14
|
+
}
|
|
15
|
+
declare global {
|
|
16
|
+
interface HTMLElementTagNameMap {
|
|
17
|
+
"remote-connection": RemoteConnection;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
export declare class RequestCapability extends LitElement {
|
|
3
|
+
capabilities: string[];
|
|
4
|
+
appname: string;
|
|
5
|
+
appiconpath: string;
|
|
6
|
+
static styles: import("lit").CSSResult[];
|
|
7
|
+
private handleCancel;
|
|
8
|
+
private handleAuthorize;
|
|
9
|
+
private handleSettings;
|
|
10
|
+
render(): import("lit").TemplateResult<1>;
|
|
11
|
+
}
|
|
12
|
+
declare global {
|
|
13
|
+
interface HTMLElementTagNameMap {
|
|
14
|
+
"request-capability": RequestCapability;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
export declare class ScanQRCode extends LitElement {
|
|
3
|
+
uiState: string;
|
|
4
|
+
static styles: import("lit").CSSResult[];
|
|
5
|
+
private handleStop;
|
|
6
|
+
private handleSuccess;
|
|
7
|
+
private scanQrcode;
|
|
8
|
+
render(): import("lit").TemplateResult<1>;
|
|
9
|
+
}
|
|
10
|
+
declare global {
|
|
11
|
+
interface HTMLElementTagNameMap {
|
|
12
|
+
"scan-qr-code": ScanQRCode;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
export declare class ConnectionSettings extends LitElement {
|
|
3
|
+
port: number;
|
|
4
|
+
url: string;
|
|
5
|
+
isRemote: boolean;
|
|
6
|
+
static styles: import("lit").CSSResult[];
|
|
7
|
+
private handleModeChange;
|
|
8
|
+
private handleUrlChange;
|
|
9
|
+
private handlePortChange;
|
|
10
|
+
private handleConnect;
|
|
11
|
+
private handleBack;
|
|
12
|
+
private handleClearState;
|
|
13
|
+
render(): import("lit").TemplateResult<1>;
|
|
14
|
+
}
|
|
15
|
+
declare global {
|
|
16
|
+
interface HTMLElementTagNameMap {
|
|
17
|
+
"connection-settings": ConnectionSettings;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
export declare class StartView extends LitElement {
|
|
3
|
+
isMobile: boolean;
|
|
4
|
+
hasClickedDownload: boolean;
|
|
5
|
+
hosting: boolean;
|
|
6
|
+
static styles: import("lit").CSSResult[];
|
|
7
|
+
private handleConnect;
|
|
8
|
+
private handleSettings;
|
|
9
|
+
private handleScanQR;
|
|
10
|
+
private handleHosting;
|
|
11
|
+
private handleDownloaded;
|
|
12
|
+
private handleDownloadClick;
|
|
13
|
+
render(): import("lit").TemplateResult<1>;
|
|
14
|
+
}
|
|
15
|
+
declare global {
|
|
16
|
+
interface HTMLElementTagNameMap {
|
|
17
|
+
"start-view": StartView;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
export declare class HostingView extends LitElement {
|
|
3
|
+
step: number;
|
|
4
|
+
email: string;
|
|
5
|
+
password: string;
|
|
6
|
+
passwordError: string;
|
|
7
|
+
isHostingRunning: boolean | null;
|
|
8
|
+
static styles: import("lit").CSSResult[];
|
|
9
|
+
private handleBack;
|
|
10
|
+
private handleEmailChange;
|
|
11
|
+
private handlePasswordChange;
|
|
12
|
+
private handleCheckEmail;
|
|
13
|
+
private handleLogin;
|
|
14
|
+
private handleResetHosting;
|
|
15
|
+
private handleClearRunning;
|
|
16
|
+
render(): import("lit").TemplateResult<1>;
|
|
17
|
+
}
|
|
18
|
+
declare global {
|
|
19
|
+
interface HTMLElementTagNameMap {
|
|
20
|
+
"hosting-view": HostingView;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
export declare class MultiUserAuth extends LitElement {
|
|
3
|
+
email: string;
|
|
4
|
+
password: string;
|
|
5
|
+
verificationCode: string;
|
|
6
|
+
error: string | null;
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
backendUrl?: string;
|
|
9
|
+
step: "email" | "password" | "code";
|
|
10
|
+
verificationType: "signup" | "login";
|
|
11
|
+
static styles: import("lit").CSSResult[];
|
|
12
|
+
private handleEmailChange;
|
|
13
|
+
private handlePasswordChange;
|
|
14
|
+
private handleCodeChange;
|
|
15
|
+
private handleEmailSubmit;
|
|
16
|
+
private handlePasswordSubmit;
|
|
17
|
+
private handleCodeSubmit;
|
|
18
|
+
private handleBackToEmail;
|
|
19
|
+
private handleKeyPress;
|
|
20
|
+
render(): import("lit").TemplateResult<1>;
|
|
21
|
+
}
|
|
22
|
+
declare global {
|
|
23
|
+
interface HTMLElementTagNameMap {
|
|
24
|
+
"multi-user-auth": MultiUserAuth;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
export declare class RemoteConnection extends LitElement {
|
|
3
|
+
initialUrl?: string;
|
|
4
|
+
detecting: boolean;
|
|
5
|
+
multiUserDetected: boolean | null;
|
|
6
|
+
error: string | null;
|
|
7
|
+
static styles: import("lit").CSSResult[];
|
|
8
|
+
private handleBack;
|
|
9
|
+
private handleUrlChange;
|
|
10
|
+
private handleConnect;
|
|
11
|
+
private handleMultiUserAuth;
|
|
12
|
+
private handleRequestCapability;
|
|
13
|
+
render(): import("lit").TemplateResult<1>;
|
|
14
|
+
}
|
|
15
|
+
declare global {
|
|
16
|
+
interface HTMLElementTagNameMap {
|
|
17
|
+
"remote-connection": RemoteConnection;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
export declare class RequestCapability extends LitElement {
|
|
3
|
+
capabilities: string[];
|
|
4
|
+
appname: string;
|
|
5
|
+
appiconpath: string;
|
|
6
|
+
static styles: import("lit").CSSResult[];
|
|
7
|
+
private handleCancel;
|
|
8
|
+
private handleAuthorize;
|
|
9
|
+
private handleSettings;
|
|
10
|
+
render(): import("lit").TemplateResult<1>;
|
|
11
|
+
}
|
|
12
|
+
declare global {
|
|
13
|
+
interface HTMLElementTagNameMap {
|
|
14
|
+
"request-capability": RequestCapability;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
export declare class ScanQRCode extends LitElement {
|
|
3
|
+
uiState: string;
|
|
4
|
+
static styles: import("lit").CSSResult[];
|
|
5
|
+
private handleStop;
|
|
6
|
+
private handleSuccess;
|
|
7
|
+
private scanQrcode;
|
|
8
|
+
render(): import("lit").TemplateResult<1>;
|
|
9
|
+
}
|
|
10
|
+
declare global {
|
|
11
|
+
interface HTMLElementTagNameMap {
|
|
12
|
+
"scan-qr-code": ScanQRCode;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
export declare class ConnectionSettings extends LitElement {
|
|
3
|
+
port: number;
|
|
4
|
+
url: string;
|
|
5
|
+
isRemote: boolean;
|
|
6
|
+
static styles: import("lit").CSSResult[];
|
|
7
|
+
private handleModeChange;
|
|
8
|
+
private handleUrlChange;
|
|
9
|
+
private handlePortChange;
|
|
10
|
+
private handleConnect;
|
|
11
|
+
private handleBack;
|
|
12
|
+
private handleClearState;
|
|
13
|
+
render(): import("lit").TemplateResult<1>;
|
|
14
|
+
}
|
|
15
|
+
declare global {
|
|
16
|
+
interface HTMLElementTagNameMap {
|
|
17
|
+
"connection-settings": ConnectionSettings;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
export declare class StartView extends LitElement {
|
|
3
|
+
isMobile: boolean;
|
|
4
|
+
hasClickedDownload: boolean;
|
|
5
|
+
hosting: boolean;
|
|
6
|
+
static styles: import("lit").CSSResult[];
|
|
7
|
+
private handleConnect;
|
|
8
|
+
private handleSettings;
|
|
9
|
+
private handleScanQR;
|
|
10
|
+
private handleHosting;
|
|
11
|
+
private handleDownloaded;
|
|
12
|
+
private handleDownloadClick;
|
|
13
|
+
render(): import("lit").TemplateResult<1>;
|
|
14
|
+
}
|
|
15
|
+
declare global {
|
|
16
|
+
interface HTMLElementTagNameMap {
|
|
17
|
+
"start-view": StartView;
|
|
18
|
+
}
|
|
19
|
+
}
|
package/dist/core.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { ApolloClient, NormalizedCacheObject } from "@apollo/client/core";
|
|
2
|
-
import { Client as WSClient } from "graphql-ws";
|
|
3
1
|
import { Ad4mClient, VerificationRequestResult } from "@coasys/ad4m";
|
|
4
2
|
import { Ad4mConnectOptions, ConnectionStates, AuthStates, RemoteHost, UserInfo } from './types';
|
|
5
3
|
export default class Ad4mConnect extends EventTarget {
|
|
@@ -11,30 +9,36 @@ export default class Ad4mConnect extends EventTarget {
|
|
|
11
9
|
connectionState: ConnectionStates;
|
|
12
10
|
authState: AuthStates;
|
|
13
11
|
ad4mClient?: Ad4mClient;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
activeSocket: WebSocket | null;
|
|
12
|
+
/** HTTP base URL (normalizes legacy ws:// URLs from localStorage) */
|
|
13
|
+
get baseUrl(): string;
|
|
17
14
|
requestId?: string;
|
|
18
15
|
requestedRestart: boolean;
|
|
19
16
|
connectedHost: RemoteHost | null;
|
|
20
17
|
userInfo: UserInfo | null;
|
|
21
18
|
hostIndexUrl: string;
|
|
19
|
+
lowCreditThreshold: number;
|
|
22
20
|
private creditPollInterval;
|
|
23
21
|
private embeddedResolve?;
|
|
24
22
|
private embeddedReject?;
|
|
25
23
|
constructor(options: Ad4mConnectOptions);
|
|
26
24
|
connect(): Promise<Ad4mClient>;
|
|
27
25
|
private buildClient;
|
|
28
|
-
private createApolloClient;
|
|
29
26
|
private withTempClient;
|
|
30
27
|
checkAuth(): Promise<boolean>;
|
|
31
28
|
disconnect(): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Subscribe to real-time credit updates.
|
|
31
|
+
* Falls back to polling if the subscription is not supported by the executor.
|
|
32
|
+
*/
|
|
33
|
+
startCreditSubscription(): void;
|
|
32
34
|
startCreditPolling(): void;
|
|
33
35
|
stopCreditPolling(): void;
|
|
34
36
|
requestTopUp(amountHOT: number): Promise<{
|
|
35
37
|
success: boolean;
|
|
36
38
|
message: string;
|
|
37
39
|
}>;
|
|
40
|
+
/** Fetch recent compute log entries. */
|
|
41
|
+
fetchComputeLog(since?: string, limit?: number): Promise<import('./types').ComputeLogEntryData[]>;
|
|
38
42
|
/** Persist selected host after successful auth */
|
|
39
43
|
setConnectedHost(host: RemoteHost): void;
|
|
40
44
|
private initializeEmbeddedMode;
|