@freeappstore/sdk 0.21.6 → 0.21.7

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 CHANGED
@@ -6,8 +6,11 @@ PWA lifecycle APIs live at `@freeappstore/sdk/pwa`, with Vite options at
6
6
  `@freeappstore/sdk/pwa-config`. See [safe updates and offline capabilities](https://github.com/freeappstore-online/platform/blob/main/docs/pwa-lifecycle.md).
7
7
 
8
8
  Device-local preferences, IndexedDB, and large-file metadata live at
9
- `@freeappstore/sdk/persist`. That data is not the signed-in account. Account
10
- keys remain `fas.kv`. A failed save returns a status instead of throwing a
9
+ `@freeappstore/sdk/persist`. This is where app data lives: FreeAppStore stores
10
+ no application data on the server ([ADR-004](https://github.com/freeappstore-online/platform/blob/main/docs/adr/004-no-server-app-data.md)).
11
+ `fas.kv`, `fas.collections`, data rooms and `fas.photos` are deprecated for app
12
+ data and kept only for existing apps; multi-user or server-backed data belongs on
13
+ [ProAppStore](https://proappstore.online). A failed save returns a status instead of throwing a
11
14
  success path, and corrupt values are left in place. See
12
15
  [device-local persistence](https://github.com/freeappstore-online/platform/blob/main/docs/sdk.md#device-local-persistence-freeappstoresdkpersist).
13
16
 
@@ -65,15 +68,15 @@ await fas.auth.init(); // capture callback, must be called once
65
68
  | Model | Service | Guarantee |
66
69
  | --- | --- | --- |
67
70
  | Device-local | `@freeappstore/sdk/persist` | This browser profile and origin only; not account sync. |
68
- | Private per-account | `fas.kv` | Server-side `(appId, userId)` isolation; authentication required. |
69
- | Shared documents | `fas.collections` | Owner-only until the app owner shares the collection (`fas db share`); then public reads, owner-only writes. A shared collection is public even when a query filters by owner. |
70
- | Room-restricted | Backend data-room HTTP API | Authenticated endpoints enforce room membership. They are separate from public collections and realtime room broadcasts; the SDK does not yet provide a wrapper. See the [data-room API](../../docs/data-rooms.md). |
71
+ | Private per-account (deprecated, ADR-004) | `fas.kv` | Server-side `(appId, userId)` isolation; authentication required. |
72
+ | Shared documents (deprecated, ADR-004) | `fas.collections` | Owner-only until the app owner shares the collection (`fas db share`); then public reads, owner-only writes. A shared collection is public even when a query filters by owner. |
73
+ | Room-restricted (deprecated, ADR-004) | Backend data-room HTTP API | Authenticated endpoints enforce room membership. They are separate from public collections and realtime room broadcasts; the SDK does not yet provide a wrapper. See the [data-room API](../../docs/data-rooms.md). |
71
74
 
72
75
  A collection is `'private'` (owner-only) by default. `fas.collections.collection(name, { visibility: 'public-read' })` declares in code that the collection is shared; the server enforces what the app owner set with `fas db share`. Any other visibility is rejected by the SDK type and runtime.
73
76
 
74
77
  ### Per-user KV
75
78
 
76
- Private per-account cloud storage scoped to `(appId, userId)` server-side. Use it for data that follows a signed-in user across devices. Requests require the account; do not gate unrelated public screens behind sign-in.
79
+ **Deprecated for app data (ADR-004); existing apps only.** Private per-account cloud storage scoped to `(appId, userId)` server-side. Use it for data that follows a signed-in user across devices. Requests require the account; do not gate unrelated public screens behind sign-in.
77
80
 
78
81
  ```ts
79
82
  await fas.kv.set('theme', { color: 'plum' });
@@ -129,7 +132,7 @@ Rooms provide ephemeral realtime broadcast, not durable storage. Rooms are open
129
132
 
130
133
  ### Collections (document database)
131
134
 
132
- Document store for queryable data. Documents are private to their owner by default; `fas db share <collection>` lets everyone read a collection (authenticated owners still write only their own). `owner` can only be your own id, and `_owner` is hidden from other users. No SQL required — just JSON in, JSON out.
135
+ **Deprecated for app data (ADR-004); existing apps only.** Document store for queryable data. Documents are private to their owner by default; `fas db share <collection>` lets everyone read a collection (authenticated owners still write only their own). `owner` can only be your own id, and `_owner` is hidden from other users. No SQL required — just JSON in, JSON out.
133
136
 
134
137
  ```ts
135
138
  const posts = fas.collections.collection('posts', { visibility: 'public-read' });
@@ -332,6 +335,8 @@ The connected draft hook and example are a supported SDK recipe. The canonical g
332
335
 
333
336
  ## Temporary photos (`fas.photos`)
334
337
 
338
+ **Deprecated for app data (ADR-004); existing apps only.** Keep new photos on the device (`openFileStore` / `putFile`).
339
+
335
340
  ```ts
336
341
  const photo = await fas.photos.upload(file, { visibility: 'public' });
337
342
  // photo.url works in <img>; photo.expiresAt is an epoch timestamp in milliseconds.
package/dist/logger.d.ts CHANGED
@@ -35,7 +35,7 @@ export interface BuildMeta {
35
35
  viewport: string;
36
36
  theme?: string | undefined;
37
37
  }
38
- export declare const SDK_VERSION = "0.21.6";
38
+ export declare const SDK_VERSION = "0.21.7";
39
39
  export declare class Logger {
40
40
  private readonly appId;
41
41
  private readonly apiBase;
package/dist/logger.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { authedFetch } from './authed-fetch.js';
2
2
  // Must track package.json version — bumped on release. Guarded by version.test.ts
3
3
  // so a forgotten bump fails CI instead of silently misattributing telemetry.
4
- export const SDK_VERSION = '0.21.6';
4
+ export const SDK_VERSION = '0.21.7';
5
5
  const MEMORY_LIMIT = 200;
6
6
  const STORAGE_LIMIT = 500;
7
7
  const STORAGE_KEY_PREFIX = 'fas_logs:';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@freeappstore/sdk",
3
- "version": "0.21.6",
3
+ "version": "0.21.7",
4
4
  "description": "Browser SDK for FreeAppStore — auth, KV, collections, counters, rooms, proxy, encrypted user keys, roles, friends, email, push reminders, device-local persistence, validated backup and file export, React hooks, and UI components.",
5
5
  "license": "MIT",
6
6
  "type": "module",