@tinycloud/web-sdk 3.14.0-beta.2 → 3.14.0-beta.21
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/README.md +12 -11
- package/dist/adapters/BrowserWasmBindings.d.ts +1 -0
- package/dist/delegations-issued.cjs +1 -1
- package/dist/delegations-issued.mjs +1 -1
- package/dist/delegations-renewal.cjs +1 -1
- package/dist/delegations-renewal.mjs +1 -1
- package/dist/encryption-keys.cjs +1 -1
- package/dist/encryption-keys.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/modals.cjs +1 -1
- package/dist/modals.mjs +1 -1
- package/dist/modules/Storage/tinycloud/types.schema.d.ts +8 -8
- package/dist/modules/WebSecretsService.d.ts +19 -4
- package/dist/modules/browserSessionPersistence.d.ts +2 -0
- package/dist/modules/openKeySignPresentation.d.ts +19 -0
- package/dist/modules/requestPermissionsCore.d.ts +2 -0
- package/dist/modules/runtimeGrantPersistence.d.ts +42 -2
- package/dist/modules/tcw.d.ts +80 -8
- package/dist/replica.cjs +1 -1
- package/dist/replica.mjs +1 -1
- package/dist/runtime-grants.cjs +1 -1
- package/dist/runtime-grants.mjs +1 -1
- package/dist/secret-read.cjs +1 -1
- package/dist/secret-read.mjs +1 -1
- package/dist/session-retire-entry.d.ts +3 -0
- package/dist/session-retire.cjs +1 -0
- package/dist/session-retire.mjs +1 -0
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -31,19 +31,18 @@ bun add @tinycloud/web-sdk
|
|
|
31
31
|
## Quick Start
|
|
32
32
|
|
|
33
33
|
```typescript
|
|
34
|
-
import { TinyCloudWeb } from '@tinycloud/web-sdk';
|
|
34
|
+
import { TinyCloudWeb, type Manifest } from '@tinycloud/web-sdk';
|
|
35
35
|
|
|
36
|
-
//
|
|
37
|
-
|
|
36
|
+
// The manifest names the app. With no `permissions`, the app gets
|
|
37
|
+
// KV and SQL under `com.example.notes/` in the `applications` space.
|
|
38
|
+
const manifest: Manifest = { app_id: 'com.example.notes', name: 'Notes' };
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
await tc.
|
|
40
|
+
const tc = new TinyCloudWeb({ manifest });
|
|
41
|
+
await tc.signIn();
|
|
41
42
|
|
|
42
|
-
//
|
|
43
|
-
|
|
44
|
-
await
|
|
45
|
-
const result = await storage.get('myKey');
|
|
46
|
-
console.log(result.data); // { hello: 'world' }
|
|
43
|
+
// KV storage
|
|
44
|
+
await tc.kv.put('com.example.notes/myKey', { hello: 'world' });
|
|
45
|
+
const result = await tc.kv.get('com.example.notes/myKey');
|
|
47
46
|
```
|
|
48
47
|
|
|
49
48
|
### Stored sessions and `signIn()`
|
|
@@ -58,6 +57,8 @@ expiry. The permission check does not contact the node, so a session the node
|
|
|
58
57
|
rejects (a 401 after a revocation or a reset, for example) is still restored.
|
|
59
58
|
With OpenKey, `prepareSignIn()` makes the same check.
|
|
60
59
|
|
|
60
|
+
Without a `manifest`, `signIn()` asks only for the app's own folder, `applications/<your domain reversed>/` (KV and SQL), and logs a warning. A port other than 80 or 443 is part of the name: `notes.example.com:8443` gets `applications/com.example.notes_8443/`. Outside a browser, set `domain`; without one, apps share `applications/xyz.tinycloud.app/` and log how to get their own. Sessions last 7 days unless you set `sessionExpirationMs`.
|
|
61
|
+
|
|
61
62
|
`restoreSession()` resolves from stored state. It automatically starts a
|
|
62
63
|
background hosting probe, capped at 5 seconds, and reactivates stored panel
|
|
63
64
|
grants. Read `tc.spaceHosting` (`"hosted"`, `"not-hosted"` or `"unknown"`) for
|
|
@@ -566,6 +567,6 @@ The web SDK includes implicit account bootstrap permissions only at the approved
|
|
|
566
567
|
|
|
567
568
|
`autoBootstrapAccount: false` disables account bootstrap and its implicit sign-in permissions, including in the node SDK. `includeAccountRegistryPermissions: false` omits the implicit account registry bundle. Setting either option to `true` does not enable first-party bootstrap at another origin. The policy uses the actual page origin, independently of a configured SIWE domain.
|
|
568
569
|
|
|
569
|
-
A third-party sign-in with no registered account route returns `ACCOUNT_SETUP_REQUIRED` with `setupUrl: "https://
|
|
570
|
+
A third-party sign-in with no registered account route returns `ACCOUNT_SETUP_REQUIRED` with `setupUrl: "https://tinycloud.one/"` before signing. Complete setup there and retry. Registry availability errors retain their existing behavior. Setup status for accounts that already have a registry record is unchanged.
|
|
570
571
|
|
|
571
572
|
Details: TC-2931
|
|
@@ -9,6 +9,7 @@ export declare class BrowserWasmBindings implements IWasmBindings {
|
|
|
9
9
|
get completeSessionSetup(): typeof tinycloud.completeSessionSetup;
|
|
10
10
|
validatePersistedSession(proof: PersistedSessionProof): any;
|
|
11
11
|
validatePersistedSessionForRenewal(proof: PersistedSessionProof): any;
|
|
12
|
+
validateSessionRoot(proof: PersistedSessionProof): any;
|
|
12
13
|
computeCid(data: Uint8Array, codec: bigint): string;
|
|
13
14
|
ensureEip55(address: string): string;
|
|
14
15
|
makeSpaceId(address: string, chainId: number, prefix: string): string;
|