@coasys/ad4m-connect 0.13.0-test-flows-1 → 0.13.1-staging.10
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/core.d.ts +24 -2
- package/dist/core.js +7688 -6050
- package/dist/core.js.map +3 -3
- package/dist/index.js +7714 -6059
- package/dist/index.js.map +3 -3
- package/dist/services/hostIndex.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/dist/web.js +4108 -6192
- package/dist/web.js.map +3 -3
- package/package.json +21 -20
- package/dist/components/AgentLocked.d.ts +0 -4
- package/dist/components/AppLogo.d.ts +0 -1
- package/dist/components/CapNotMatching.d.ts +0 -1
- package/dist/components/ConnectionOverview.d.ts +0 -13
- package/dist/components/CouldNotMakeRequest.d.ts +0 -1
- package/dist/components/Disconnected.d.ts +0 -3
- package/dist/components/Header.d.ts +0 -1
- package/dist/components/Hosting.d.ts +0 -14
- package/dist/components/InvalidToken.d.ts +0 -3
- package/dist/components/Loading.d.ts +0 -1
- package/dist/components/Logo.d.ts +0 -1
- package/dist/components/MobileAppLogoButton.d.ts +0 -3
- package/dist/components/MultiUserAuth.d.ts +0 -19
- package/dist/components/RemoteConnection.d.ts +0 -13
- package/dist/components/RequestCapability.d.ts +0 -8
- package/dist/components/ScanQRCode.d.ts +0 -5
- package/dist/components/Settings.d.ts +0 -12
- package/dist/components/Start.d.ts +0 -9
- package/dist/components/VerifyCode.d.ts +0 -8
- 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/electron.d.ts +0 -2
- package/dist/electron.js +0 -1
- 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
package/dist/core.d.ts
CHANGED
|
@@ -18,24 +18,46 @@ export default class Ad4mConnect extends EventTarget {
|
|
|
18
18
|
hostIndexUrl: string;
|
|
19
19
|
lowCreditThreshold: number;
|
|
20
20
|
private creditPollInterval;
|
|
21
|
+
private releaseCreditListener?;
|
|
22
|
+
/** How \`buildClient\` reaches the executor in embedded proxy mode; unset for a direct connection. */
|
|
23
|
+
private proxy?;
|
|
21
24
|
private embeddedResolve?;
|
|
22
25
|
private embeddedReject?;
|
|
23
26
|
constructor(options: Ad4mConnectOptions);
|
|
24
27
|
connect(): Promise<Ad4mClient>;
|
|
28
|
+
/** Make this client the connection, closing the one it replaces. */
|
|
29
|
+
private adoptClient;
|
|
25
30
|
private buildClient;
|
|
31
|
+
/**
|
|
32
|
+
* A client whose token the executor refuses mid-session fails every call and stops reconnecting.
|
|
33
|
+
* Drop the token and move to 'unauthenticated', so the app asks the user to log in again.
|
|
34
|
+
*/
|
|
35
|
+
private watchAuth;
|
|
36
|
+
/** Forget the token (memory and localStorage) and rebuild the client without it. */
|
|
37
|
+
private discardToken;
|
|
26
38
|
private withTempClient;
|
|
27
39
|
checkAuth(): Promise<boolean>;
|
|
40
|
+
/**
|
|
41
|
+
* What the executor says about this session, with nothing applied yet.
|
|
42
|
+
*
|
|
43
|
+
* \`agent.status\` first: on an authorised session — every connect after the first — it answers
|
|
44
|
+
* in one call. \`agent.isLocked\` needs no capability, so when \`status\` fails
|
|
45
|
+
* it is the one that can tell a locked wallet from a refused token.
|
|
46
|
+
*/
|
|
47
|
+
private readAuth;
|
|
48
|
+
/** Act on what \`readAuth\` found. Answers whether it found anything usable — see \`checkAuth\`. */
|
|
49
|
+
private applyAuth;
|
|
28
50
|
disconnect(): Promise<void>;
|
|
29
51
|
/**
|
|
30
52
|
* Subscribe to real-time credit updates.
|
|
31
|
-
*
|
|
53
|
+
* Polling runs beside it as a safety net.
|
|
32
54
|
*/
|
|
33
55
|
startCreditSubscription(): void;
|
|
34
56
|
startCreditPolling(): void;
|
|
35
57
|
stopCreditPolling(): void;
|
|
36
58
|
requestTopUp(amountHOT: number): Promise<{
|
|
37
59
|
success: boolean;
|
|
38
|
-
|
|
60
|
+
amountHOT: string;
|
|
39
61
|
}>;
|
|
40
62
|
/** Fetch recent compute log entries. */
|
|
41
63
|
fetchComputeLog(since?: string, limit?: number): Promise<import('./types').ComputeLogEntryData[]>;
|