@le-space/ui 0.6.46 → 0.8.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@le-space/ui",
3
- "version": "0.6.46",
3
+ "version": "0.8.0",
4
4
  "description": "Floating Aleph Relay Button UI components for Svelte and React.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -44,8 +44,8 @@
44
44
  "url": "https://github.com/NiKrause/relay-button/issues"
45
45
  },
46
46
  "dependencies": {
47
- "@le-space/browser": "0.6.46",
48
- "@le-space/core": "0.6.46",
47
+ "@le-space/browser": "0.8.0",
48
+ "@le-space/core": "0.8.0",
49
49
  "viem": "^2.53.1"
50
50
  },
51
51
  "peerDependencies": {
package/react/index.d.ts CHANGED
@@ -255,6 +255,12 @@ interface CompactInstanceDetails {
255
255
  vmIpv4: string | null;
256
256
  webUrl: string | null;
257
257
  sshCommand: string | null;
258
+ /**
259
+ * Hostname of the deployment's HTTPS proxy. The mapped ports are plain HTTP,
260
+ * which a browser on an HTTPS page refuses to fetch, so this is the only
261
+ * address the card can read the relay's own documents from.
262
+ */
263
+ proxyHostname: string | null;
258
264
  mappedPorts: Array<{
259
265
  label: string;
260
266
  hostPort: number | null;
@@ -262,6 +268,32 @@ interface CompactInstanceDetails {
262
268
  execution: InstanceExecution | null;
263
269
  error: string | null;
264
270
  }
271
+ /** One transport's worth of addresses, as the relay itself groups them. */
272
+ interface SponsorRelayAddressGroup {
273
+ key: string;
274
+ label: string;
275
+ addresses: string[];
276
+ }
277
+ /**
278
+ * What a deployment reports about itself at `/multiaddrs`. Deliberately not
279
+ * normalised into "the best address": the card shows what the relay says, and
280
+ * choosing between addresses is the consumer's business, not this UI's.
281
+ */
282
+ interface SponsorRelayInstanceAddresses {
283
+ status: 'idle' | 'loading' | 'ready' | 'unsupported' | 'error';
284
+ /** Transport groups, empty for a profile that publishes no libp2p addresses. */
285
+ groups: SponsorRelayAddressGroup[];
286
+ /** Ready-to-paste environment block, when the profile publishes one. */
287
+ pwaEnv: Record<string, string> | null;
288
+ /** Raw payload, rendered verbatim on the health tab. */
289
+ payload: Record<string, unknown> | null;
290
+ peerId: string | null;
291
+ version: string | null;
292
+ fetchedAt: number | null;
293
+ error: string | null;
294
+ /** Source URL, shown so a person can curl exactly what the card read. */
295
+ sourceUrl: string | null;
296
+ }
265
297
  interface CompactInstanceRecord {
266
298
  instance: InstanceMessage;
267
299
  details: CompactInstanceDetails;
@@ -326,6 +358,13 @@ interface SponsorRelayState {
326
358
  orphanBootstrapRegistrations: CompactBootstrapRegistrationRecord[];
327
359
  lastDeploymentHash: string | null;
328
360
  deploymentProgress: DeploymentProgressEvent;
361
+ /**
362
+ * What each deployment reports at `/multiaddrs`, keyed by instance item hash.
363
+ * Fetched on demand rather than with the instance list: AutoTLS addresses only
364
+ * appear a minute or two after a deploy reports success, so this is state that
365
+ * has to be refreshable on its own.
366
+ */
367
+ instanceAddresses: Record<string, SponsorRelayInstanceAddresses>;
329
368
  }
330
369
  type SponsorRelaySubscriber = (state: SponsorRelayState) => void;
331
370
 
@@ -379,6 +418,18 @@ declare class SponsorRelayController {
379
418
  private refreshWalletDerivedState;
380
419
  refresh(): Promise<void>;
381
420
  deploy(): Promise<void>;
421
+ /**
422
+ * Read one deployment's own address document over its HTTPS proxy.
423
+ *
424
+ * The mapped ports are plain HTTP, which a browser on an HTTPS page refuses to
425
+ * fetch, so the proxy hostname is the only way in. Deliberately single-shot:
426
+ * unlike the deploy-time readiness probe this backs a button someone pressed,
427
+ * and a caller who wants newer data presses it again.
428
+ */
429
+ loadInstanceAddresses(instanceHash: string, options?: {
430
+ force?: boolean;
431
+ }): Promise<void>;
432
+ private patchInstanceAddresses;
382
433
  deleteInstance(instanceHash: string): Promise<void>;
383
434
  deleteBootstrapRegistration(registrationHash: string): Promise<void>;
384
435
  }