@le-space/ui 0.3.31 → 0.4.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/package.json +3 -3
- package/react/index.d.ts +34 -0
- package/react/index.js +451 -492
- package/shared/index.d.ts +38 -2
- package/shared/index.js +269 -443
- package/svelte/SponsorRelayFab.svelte +96 -0
package/shared/index.d.ts
CHANGED
|
@@ -187,6 +187,7 @@ type DeploymentProgressListener = (event: DeploymentProgressEvent) => void;
|
|
|
187
187
|
|
|
188
188
|
type SponsorRelayHealthTone = 'ok' | 'caution' | 'error' | 'idle';
|
|
189
189
|
interface SponsorRelayProps {
|
|
190
|
+
libp2p?: unknown;
|
|
190
191
|
debug?: boolean;
|
|
191
192
|
manifestUrl?: string;
|
|
192
193
|
manifestJson?: string;
|
|
@@ -221,6 +222,16 @@ interface SponsorRelayRootfsHealth {
|
|
|
221
222
|
label: string;
|
|
222
223
|
detail: string | null;
|
|
223
224
|
}
|
|
225
|
+
interface RelayPingState {
|
|
226
|
+
tone: SponsorRelayHealthTone;
|
|
227
|
+
sent: boolean;
|
|
228
|
+
received: boolean;
|
|
229
|
+
lastPeerId: string | null;
|
|
230
|
+
lastLatencyMs: number | null;
|
|
231
|
+
lastSentAt: number | null;
|
|
232
|
+
lastReceivedAt: number | null;
|
|
233
|
+
error: string | null;
|
|
234
|
+
}
|
|
224
235
|
interface CompactInstanceDetails {
|
|
225
236
|
messageStatus: string;
|
|
226
237
|
allocationSource: string | null;
|
|
@@ -241,6 +252,22 @@ interface CompactInstanceRecord {
|
|
|
241
252
|
instance: InstanceMessage;
|
|
242
253
|
details: CompactInstanceDetails;
|
|
243
254
|
}
|
|
255
|
+
interface CompactBootstrapRegistrationRecord {
|
|
256
|
+
messageHash: string | null;
|
|
257
|
+
hash: string | null;
|
|
258
|
+
itemHash: string | null;
|
|
259
|
+
address: string | null;
|
|
260
|
+
time: number | null;
|
|
261
|
+
instanceItemHash: string | null;
|
|
262
|
+
confirmed: boolean;
|
|
263
|
+
content: {
|
|
264
|
+
peerId: string;
|
|
265
|
+
registrationId?: string;
|
|
266
|
+
multiaddrs: string[];
|
|
267
|
+
browserMultiaddrs?: string[];
|
|
268
|
+
updatedAt: number;
|
|
269
|
+
} | null;
|
|
270
|
+
}
|
|
244
271
|
interface SponsorRelayState {
|
|
245
272
|
ready: boolean;
|
|
246
273
|
open: boolean;
|
|
@@ -258,6 +285,7 @@ interface SponsorRelayState {
|
|
|
258
285
|
refreshing: boolean;
|
|
259
286
|
deploying: boolean;
|
|
260
287
|
deletingInstanceHash: string | null;
|
|
288
|
+
deletingRegistrationHash: string | null;
|
|
261
289
|
};
|
|
262
290
|
statusText: string;
|
|
263
291
|
errorText: string | null;
|
|
@@ -271,6 +299,9 @@ interface SponsorRelayState {
|
|
|
271
299
|
crns: Crn[];
|
|
272
300
|
selectedCrn: Crn | null;
|
|
273
301
|
instances: CompactInstanceRecord[];
|
|
302
|
+
bootstrapRegistrations: CompactBootstrapRegistrationRecord[];
|
|
303
|
+
orphanBootstrapRegistrations: CompactBootstrapRegistrationRecord[];
|
|
304
|
+
relayPing: RelayPingState;
|
|
274
305
|
lastDeploymentHash: string | null;
|
|
275
306
|
deploymentProgress: DeploymentProgressEvent;
|
|
276
307
|
}
|
|
@@ -280,8 +311,10 @@ declare const DEFAULT_INSTANCE_NAME = "sponsor-relay";
|
|
|
280
311
|
declare const DEFAULT_MANIFEST_URL = "./rootfs-manifest.json";
|
|
281
312
|
declare const DEFAULT_TIER_ID = "tier-1";
|
|
282
313
|
declare const ROOTFS_MISSING_STATE: SponsorRelayRootfsHealth;
|
|
314
|
+
declare const RELAY_PING_IDLE_STATE: RelayPingState;
|
|
283
315
|
declare const IDLE_DEPLOYMENT_PROGRESS: DeploymentProgressEvent;
|
|
284
316
|
declare const REFRESH_INTERVAL_MS = 30000;
|
|
317
|
+
declare const RELAY_PING_INTERVAL_MS = 20000;
|
|
285
318
|
declare const MANIFEST_SOURCE_REFRESH_DEBOUNCE_MS = 400;
|
|
286
319
|
declare const INSTANCE_RUNTIME_READY_REFRESH_MS = 30000;
|
|
287
320
|
declare const INSTANCE_RUNTIME_PENDING_REFRESH_MS = 45000;
|
|
@@ -290,7 +323,7 @@ declare const STALE_INSTANCE_ALLOCATION_COOLDOWN_MS: number;
|
|
|
290
323
|
declare const RECENT_INSTANCE_RUNTIME_GRACE_MS: number;
|
|
291
324
|
declare const DEPLOYMENT_PENDING_WARNING_MS: number;
|
|
292
325
|
|
|
293
|
-
declare const UI_PACKAGE_VERSION = "0.
|
|
326
|
+
declare const UI_PACKAGE_VERSION = "0.4.0";
|
|
294
327
|
|
|
295
328
|
interface RootfsRequiredPortForward {
|
|
296
329
|
port: number;
|
|
@@ -331,6 +364,7 @@ declare class SponsorRelayController {
|
|
|
331
364
|
private subscribers;
|
|
332
365
|
private client;
|
|
333
366
|
private refreshTimer;
|
|
367
|
+
private pingTimer;
|
|
334
368
|
private manifestRefreshTimer;
|
|
335
369
|
private stopWalletWatch;
|
|
336
370
|
private props;
|
|
@@ -370,8 +404,10 @@ declare class SponsorRelayController {
|
|
|
370
404
|
connectWallet(): Promise<void>;
|
|
371
405
|
private refreshWalletDerivedState;
|
|
372
406
|
refresh(): Promise<void>;
|
|
407
|
+
refreshRelayPing(): Promise<void>;
|
|
373
408
|
deploy(): Promise<void>;
|
|
374
409
|
deleteInstance(instanceHash: string): Promise<void>;
|
|
410
|
+
deleteBootstrapRegistration(registrationHash: string): Promise<void>;
|
|
375
411
|
}
|
|
376
412
|
declare function createSponsorRelayController(props?: SponsorRelayProps): SponsorRelayController;
|
|
377
413
|
|
|
@@ -382,4 +418,4 @@ interface DeploymentProgressEmitter {
|
|
|
382
418
|
}
|
|
383
419
|
declare function createDeploymentProgressEmitter(): DeploymentProgressEmitter;
|
|
384
420
|
|
|
385
|
-
export { type CompactInstanceDetails, type CompactInstanceRecord, DEFAULT_INSTANCE_NAME, DEFAULT_MANIFEST_URL, DEFAULT_TIER_ID, DEPLOYMENT_PENDING_WARNING_MS, type DeploymentProgressEmitter, type EthereumProviderLike, IDLE_DEPLOYMENT_PROGRESS, INSTANCE_RUNTIME_PENDING_REFRESH_MS, INSTANCE_RUNTIME_READY_REFRESH_MS, INSTANCE_RUNTIME_STALE_REFRESH_MS, MANIFEST_SOURCE_REFRESH_DEBOUNCE_MS, RECENT_INSTANCE_RUNTIME_GRACE_MS, REFRESH_INTERVAL_MS, ROOTFS_MISSING_STATE, STALE_INSTANCE_ALLOCATION_COOLDOWN_MS, SponsorRelayController, type SponsorRelayHealthTone, type SponsorRelayPricingSummary, type SponsorRelayProps, type SponsorRelayRootfsHealth, type SponsorRelayState, type SponsorRelaySubscriber, type SponsorRelayWalletState, UI_PACKAGE_VERSION, buildSshCommand, connectWallet, createDeploymentProgressEmitter, createSponsorRelayController, formatDateTime, formatNumber, formatTierSpecLabel, getEthereumProvider, joinMappedPorts, joinRequiredPortForwards, personalSign, resolveManifestSource, shortHash, toChecksumAddress, watchWallet };
|
|
421
|
+
export { type CompactBootstrapRegistrationRecord, type CompactInstanceDetails, type CompactInstanceRecord, DEFAULT_INSTANCE_NAME, DEFAULT_MANIFEST_URL, DEFAULT_TIER_ID, DEPLOYMENT_PENDING_WARNING_MS, type DeploymentProgressEmitter, type EthereumProviderLike, IDLE_DEPLOYMENT_PROGRESS, INSTANCE_RUNTIME_PENDING_REFRESH_MS, INSTANCE_RUNTIME_READY_REFRESH_MS, INSTANCE_RUNTIME_STALE_REFRESH_MS, MANIFEST_SOURCE_REFRESH_DEBOUNCE_MS, RECENT_INSTANCE_RUNTIME_GRACE_MS, REFRESH_INTERVAL_MS, RELAY_PING_IDLE_STATE, RELAY_PING_INTERVAL_MS, ROOTFS_MISSING_STATE, type RelayPingState, STALE_INSTANCE_ALLOCATION_COOLDOWN_MS, SponsorRelayController, type SponsorRelayHealthTone, type SponsorRelayPricingSummary, type SponsorRelayProps, type SponsorRelayRootfsHealth, type SponsorRelayState, type SponsorRelaySubscriber, type SponsorRelayWalletState, UI_PACKAGE_VERSION, buildSshCommand, connectWallet, createDeploymentProgressEmitter, createSponsorRelayController, formatDateTime, formatNumber, formatTierSpecLabel, getEthereumProvider, joinMappedPorts, joinRequiredPortForwards, personalSign, resolveManifestSource, shortHash, toChecksumAddress, watchWallet };
|