@tinycloud/web-sdk 3.17.0 → 3.18.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/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/modules/tcw.d.ts +30 -0
- package/dist/notifications/types.schema.d.ts +2 -2
- package/dist/panel.cjs +1 -1
- package/dist/panel.mjs +1 -1
- package/dist/ui/panel-toasts.d.ts +1 -1
- package/dist/ui/strings.d.ts +2 -0
- package/dist/ui/toast-store.d.ts +8 -0
- package/package.json +2 -2
package/dist/modules/tcw.d.ts
CHANGED
|
@@ -197,6 +197,20 @@ export interface RequestPermissionsResult {
|
|
|
197
197
|
session?: ClientSession;
|
|
198
198
|
delegations?: readonly PortableDelegation[];
|
|
199
199
|
}
|
|
200
|
+
/**
|
|
201
|
+
* `account.setup.pending`: the owner signed in, but has no account record yet (TC-4344). Their own space is hosted, so
|
|
202
|
+
* nothing is blocked; OpenKey can set the account up in one step.
|
|
203
|
+
*/
|
|
204
|
+
export interface AccountSetupPendingEvent {
|
|
205
|
+
/** The signed-in owner's address. */
|
|
206
|
+
readonly address: string;
|
|
207
|
+
/**
|
|
208
|
+
* Opens OpenKey's account setup for the signing key. Call it from a click: it opens a window. Resolves true once
|
|
209
|
+
* OpenKey reports the account set up; false when the owner closed it, or the owner signed out or changed since.
|
|
210
|
+
* Never rejects. The current session keeps working either way.
|
|
211
|
+
*/
|
|
212
|
+
finishSetup(): Promise<boolean>;
|
|
213
|
+
}
|
|
200
214
|
export type SessionRestoreStatus = "idle" | "disabled" | "restoring" | "restored" | "missing" | "expired" | "corrupt" | "storage-unavailable" | "restore-failed" | "stale" | "logging-in";
|
|
201
215
|
export interface SessionRestoreResult {
|
|
202
216
|
status: Exclude<SessionRestoreStatus, "idle" | "restoring" | "logging-in">;
|
|
@@ -269,6 +283,9 @@ export declare class TinyCloudWeb {
|
|
|
269
283
|
private _shareReceiverService?;
|
|
270
284
|
private readonly storageFullHandlers;
|
|
271
285
|
private readonly purgeFailedHandlers;
|
|
286
|
+
private readonly accountSetupHandlers;
|
|
287
|
+
/** The setup the account-setup toast's button runs: the latest sign-in's offer, which refuses once that session ends. */
|
|
288
|
+
private latestAccountSetupOffer?;
|
|
272
289
|
/** Promise that resolves when WASM + node are ready */
|
|
273
290
|
private _initPromise;
|
|
274
291
|
/** User config */
|
|
@@ -345,6 +362,13 @@ export declare class TinyCloudWeb {
|
|
|
345
362
|
* retries now. Safe to call before initialization finishes. Returns the unsubscribe function.
|
|
346
363
|
*/
|
|
347
364
|
on(event: "replica.purge.failed", handler: (event: LocalCopyPurgeFailedEvent) => void): () => void;
|
|
365
|
+
/**
|
|
366
|
+
* Subscribe to `account.setup.pending`. It fires at the end of a `signIn()` that succeeded for an owner with no
|
|
367
|
+
* account record whose OpenKey key can be set up from here, so the app can offer "finish setup" in its own UI; call
|
|
368
|
+
* the event's `finishSetup` from the owner's click. While any handler is subscribed, the SDK shows no setup toast
|
|
369
|
+
* of its own. Safe to call before initialization finishes. Returns the unsubscribe function.
|
|
370
|
+
*/
|
|
371
|
+
on(event: "account.setup.pending", handler: (event: AccountSetupPendingEvent) => void): () => void;
|
|
348
372
|
/** The owner's TinyCloud storage; `storage.status()` reads usage and plan from the node. */
|
|
349
373
|
get storage(): IStorageService;
|
|
350
374
|
/** Browser UI API: `open`, `close`, `toggle`, `isOpen`, and `available`. Inert when `ui: false` or the page cannot render UI. */
|
|
@@ -469,6 +493,12 @@ export declare class TinyCloudWeb {
|
|
|
469
493
|
* when the owner cancelled or setup did not finish, so the caller keeps its `AccountSetupRequiredError`.
|
|
470
494
|
*/
|
|
471
495
|
private setUpOpenKeyAccount;
|
|
496
|
+
/**
|
|
497
|
+
* After a sign-in that succeeded for an owner with no account record (the hosted-owner proof, TC-4344): the
|
|
498
|
+
* `account.setup.pending` event, or with no handler subscribed, a toast whose button opens OpenKey's setup. It never
|
|
499
|
+
* opens anything by itself and never blocks the sign-in. Only a managed OpenKey key of the signed-in owner is offered.
|
|
500
|
+
*/
|
|
501
|
+
private offerAccountSetup;
|
|
472
502
|
/**
|
|
473
503
|
* The sign-in again once OpenKey set the account up; its preparation reads the registry afresh. The owner's clicks
|
|
474
504
|
* went to OpenKey's window, so this one may no longer open a popup: a blocked popup asks in OpenKey's frame instead.
|
|
@@ -43,11 +43,11 @@ export declare const SpaceCreationResultSchema: z.ZodObject<{
|
|
|
43
43
|
/** Whether the modal was dismissed without creating */
|
|
44
44
|
dismissed: z.ZodBoolean;
|
|
45
45
|
}, "strip", z.ZodTypeAny, {
|
|
46
|
-
dismissed?: boolean;
|
|
47
46
|
success?: boolean;
|
|
48
|
-
}, {
|
|
49
47
|
dismissed?: boolean;
|
|
48
|
+
}, {
|
|
50
49
|
success?: boolean;
|
|
50
|
+
dismissed?: boolean;
|
|
51
51
|
}>;
|
|
52
52
|
export type SpaceCreationResult = z.infer<typeof SpaceCreationResultSchema>;
|
|
53
53
|
/**
|