@freeappstore/sdk 0.16.47 → 0.16.48
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 +5 -5
- package/dist/db.d.ts +25 -11
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +26 -9
- package/dist/db.js.map +1 -1
- package/dist/logger.d.ts +1 -1
- package/dist/logger.js +1 -1
- package/dist/persist/index.d.ts +1 -1
- package/dist/persist/index.js +1 -1
- package/dist/persist/status.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -66,10 +66,10 @@ await fas.auth.init(); // capture callback, must be called once
|
|
|
66
66
|
| --- | --- | --- |
|
|
67
67
|
| Device-local | `@freeappstore/sdk/persist` | This browser profile and origin only; not account sync. |
|
|
68
68
|
| Private per-account | `fas.kv` | Server-side `(appId, userId)` isolation; authentication required. |
|
|
69
|
-
|
|
|
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
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
71
|
|
|
72
|
-
`fas.collections.collection(name, { visibility: 'public-read' })`
|
|
72
|
+
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
73
|
|
|
74
74
|
### Per-user KV
|
|
75
75
|
|
|
@@ -129,7 +129,7 @@ Rooms provide ephemeral realtime broadcast, not durable storage or a room-member
|
|
|
129
129
|
|
|
130
130
|
### Collections (document database)
|
|
131
131
|
|
|
132
|
-
|
|
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.
|
|
133
133
|
|
|
134
134
|
```ts
|
|
135
135
|
const posts = fas.collections.collection('posts', { visibility: 'public-read' });
|
|
@@ -137,12 +137,12 @@ const posts = fas.collections.collection('posts', { visibility: 'public-read' })
|
|
|
137
137
|
// Create (auth required, you become the owner)
|
|
138
138
|
const post = await posts.create({ title: 'Hello', body: '...' });
|
|
139
139
|
|
|
140
|
-
// Query (
|
|
140
|
+
// Query (your own documents, or everyone's once shared)
|
|
141
141
|
const { documents, total } = await posts.query({
|
|
142
142
|
limit: 20,
|
|
143
143
|
orderBy: 'created_at',
|
|
144
144
|
order: 'desc',
|
|
145
|
-
owner: userId, // optional:
|
|
145
|
+
owner: userId, // optional: only ever your own id
|
|
146
146
|
});
|
|
147
147
|
|
|
148
148
|
// Get single document
|
package/dist/db.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export interface GeoBBox {
|
|
|
8
8
|
lonField?: string;
|
|
9
9
|
}
|
|
10
10
|
export interface QueryOptions {
|
|
11
|
+
/** Your own user id. Another user's id is refused (403). */
|
|
11
12
|
owner?: string;
|
|
12
13
|
limit?: number;
|
|
13
14
|
offset?: number;
|
|
@@ -22,9 +23,16 @@ export interface QueryResult<T> {
|
|
|
22
23
|
})[];
|
|
23
24
|
total: number;
|
|
24
25
|
}
|
|
25
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* Who can read a collection's documents (#467). The server decides: a collection
|
|
28
|
+
* is `'private'` (owner-only) until its app owner marks it shared with
|
|
29
|
+
* `fas db share <collection>`. `'public-read'` states in code that the
|
|
30
|
+
* collection is shared, so readers know other users' documents will be listed.
|
|
31
|
+
* Writes are always owner-only.
|
|
32
|
+
*/
|
|
33
|
+
export type CollectionVisibility = 'private' | 'public-read';
|
|
26
34
|
export interface CollectionOptions {
|
|
27
|
-
visibility:
|
|
35
|
+
visibility: CollectionVisibility;
|
|
28
36
|
}
|
|
29
37
|
/** Document database — organize data into named collections. */
|
|
30
38
|
export declare class Collections {
|
|
@@ -32,11 +40,8 @@ export declare class Collections {
|
|
|
32
40
|
private readonly apiBase;
|
|
33
41
|
private readonly auth;
|
|
34
42
|
constructor(appId: string, apiBase: string, auth: Auth);
|
|
35
|
-
/**
|
|
36
|
-
|
|
37
|
-
collection(name: string): Collection;
|
|
38
|
-
/** Select a collection and acknowledge its server-enforced public-read visibility. */
|
|
39
|
-
collection(name: string, options: CollectionOptions): Collection;
|
|
43
|
+
/** Select a collection. Without options it is private: you read only your own documents. */
|
|
44
|
+
collection(name: string, options?: CollectionOptions): Collection;
|
|
40
45
|
}
|
|
41
46
|
/** A named collection of JSON documents. */
|
|
42
47
|
export declare class Collection {
|
|
@@ -44,17 +49,26 @@ export declare class Collection {
|
|
|
44
49
|
private readonly name;
|
|
45
50
|
private readonly apiBase;
|
|
46
51
|
private readonly auth;
|
|
47
|
-
readonly visibility:
|
|
48
|
-
constructor(appId: string, name: string, apiBase: string, auth: Auth);
|
|
52
|
+
readonly visibility: CollectionVisibility;
|
|
53
|
+
constructor(appId: string, name: string, apiBase: string, auth: Auth, visibility: CollectionVisibility);
|
|
54
|
+
/**
|
|
55
|
+
* GET with the session when signed in: a private collection needs it, and a
|
|
56
|
+
* shared one shows `_owner` only to the document's owner. A 401 on a signed-in
|
|
57
|
+
* read drops the stale session, like a write does.
|
|
58
|
+
*/
|
|
59
|
+
private read;
|
|
49
60
|
/** Create a new document. Auth required. Returns the document with its generated `id`. */
|
|
50
61
|
create<T extends Record<string, unknown>>(doc: T): Promise<T & {
|
|
51
62
|
id: string;
|
|
52
63
|
}>;
|
|
53
|
-
/** Get a document by ID. Returns null if not found
|
|
64
|
+
/** Get a document by ID. Returns null if not found (or not yours, in a private collection). */
|
|
54
65
|
get<T = Record<string, unknown>>(id: string): Promise<(T & {
|
|
55
66
|
id: string;
|
|
56
67
|
}) | null>;
|
|
57
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* Query documents with optional filtering and pagination. A private collection
|
|
70
|
+
* lists only your documents; `owner` can only be your own id.
|
|
71
|
+
*/
|
|
58
72
|
query<T = Record<string, unknown>>(opts?: QueryOptions): Promise<QueryResult<T>>;
|
|
59
73
|
/** Update a document by merging the patch into the existing data. Auth required, owner only. */
|
|
60
74
|
update<T extends Record<string, unknown>>(id: string, patch: Partial<T>): Promise<T & {
|
package/dist/db.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../src/db.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IACvB,8EAA8E;IAC9E,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,SAAS,EAAE,CAAC,CAAC,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,
|
|
1
|
+
{"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../src/db.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,C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AI;IACrB,QAAQ,CAAC,UAAU,EAAE,oBAAoB;gBAJxB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,IAAI,EAClB,UAAU,EAAE,oBAAoB;IAG3C;;;;OAIG;YACW,IAAI;IAUlB,0FAA0F;IACpF,MAAM,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IA0BpF,+FAA+F;IACzF,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,IAAI,CAAC;IAWxF;;;OAGG;IACG,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAuBtF,gGAAgG;IAC1F,MAAM,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5C,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,GAChB,OAAO,CAAC,CAAC,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IA0B9B,oDAAoD;IAC9C,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAoBxC"}
|
package/dist/db.js
CHANGED
|
@@ -8,11 +8,12 @@ export class Collections {
|
|
|
8
8
|
this.apiBase = apiBase;
|
|
9
9
|
this.auth = auth;
|
|
10
10
|
}
|
|
11
|
+
/** Select a collection. Without options it is private: you read only your own documents. */
|
|
11
12
|
collection(name, options) {
|
|
12
|
-
if (options && options.visibility !== 'public-read') {
|
|
13
|
-
throw new Error(
|
|
13
|
+
if (options && options.visibility !== 'private' && options.visibility !== 'public-read') {
|
|
14
|
+
throw new Error("Collection visibility must be 'private' or 'public-read'.");
|
|
14
15
|
}
|
|
15
|
-
return new Collection(this.appId, name, this.apiBase, this.auth);
|
|
16
|
+
return new Collection(this.appId, name, this.apiBase, this.auth, options?.visibility ?? 'private');
|
|
16
17
|
}
|
|
17
18
|
}
|
|
18
19
|
/** A named collection of JSON documents. */
|
|
@@ -21,12 +22,25 @@ export class Collection {
|
|
|
21
22
|
name;
|
|
22
23
|
apiBase;
|
|
23
24
|
auth;
|
|
24
|
-
visibility
|
|
25
|
-
constructor(appId, name, apiBase, auth) {
|
|
25
|
+
visibility;
|
|
26
|
+
constructor(appId, name, apiBase, auth, visibility) {
|
|
26
27
|
this.appId = appId;
|
|
27
28
|
this.name = name;
|
|
28
29
|
this.apiBase = apiBase;
|
|
29
30
|
this.auth = auth;
|
|
31
|
+
this.visibility = visibility;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* GET with the session when signed in: a private collection needs it, and a
|
|
35
|
+
* shared one shows `_owner` only to the document's owner. A 401 on a signed-in
|
|
36
|
+
* read drops the stale session, like a write does.
|
|
37
|
+
*/
|
|
38
|
+
async read(url) {
|
|
39
|
+
const token = this.auth.token;
|
|
40
|
+
const response = await fetch(url, token ? { headers: { Authorization: `Bearer ${token}` } } : {});
|
|
41
|
+
if (response.status === 401 && token)
|
|
42
|
+
this.auth.handleUnauthorized(token);
|
|
43
|
+
return response;
|
|
30
44
|
}
|
|
31
45
|
/** Create a new document. Auth required. Returns the document with its generated `id`. */
|
|
32
46
|
async create(doc) {
|
|
@@ -52,17 +66,20 @@ export class Collection {
|
|
|
52
66
|
}
|
|
53
67
|
return (await response.json());
|
|
54
68
|
}
|
|
55
|
-
/** Get a document by ID. Returns null if not found
|
|
69
|
+
/** Get a document by ID. Returns null if not found (or not yours, in a private collection). */
|
|
56
70
|
async get(id) {
|
|
57
71
|
const url = new URL(`/v1/apps/${encodeURIComponent(this.appId)}/db/${encodeURIComponent(this.name)}/${encodeURIComponent(id)}`, this.apiBase);
|
|
58
|
-
const response = await
|
|
72
|
+
const response = await this.read(url);
|
|
59
73
|
if (response.status === 404)
|
|
60
74
|
return null;
|
|
61
75
|
if (!response.ok)
|
|
62
76
|
throw new Error(`db.get failed: ${response.status}`);
|
|
63
77
|
return (await response.json());
|
|
64
78
|
}
|
|
65
|
-
/**
|
|
79
|
+
/**
|
|
80
|
+
* Query documents with optional filtering and pagination. A private collection
|
|
81
|
+
* lists only your documents; `owner` can only be your own id.
|
|
82
|
+
*/
|
|
66
83
|
async query(opts) {
|
|
67
84
|
const url = new URL(`/v1/apps/${encodeURIComponent(this.appId)}/db/${encodeURIComponent(this.name)}`, this.apiBase);
|
|
68
85
|
if (opts?.owner)
|
|
@@ -85,7 +102,7 @@ export class Collection {
|
|
|
85
102
|
if (opts.bbox.lonField)
|
|
86
103
|
url.searchParams.set('lon_field', opts.bbox.lonField);
|
|
87
104
|
}
|
|
88
|
-
const response = await
|
|
105
|
+
const response = await this.read(url);
|
|
89
106
|
if (!response.ok)
|
|
90
107
|
throw new Error(`db.query failed: ${response.status}`);
|
|
91
108
|
return (await response.json());
|
package/dist/db.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db.js","sourceRoot":"","sources":["../src/db.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"db.js","sourceRoot":"","sources":["../src/db.ts"],"names":[],"mappings":"AAwCA,gEAAgE;AAChE,MAAM,OAAO,WAAW;IAEH;IACA;IACA;IAHnB,YACmB,KAAa,EACb,OAAe,EACf,IAAU;QAFV,UAAK,GAAL,KAAK,CAAQ;QACb,YAAO,GAAP,OAAO,CAAQ;QACf,SAAI,GAAJ,IAAI,CAAM;IAC1B,CAAC;IAEJ,4FAA4F;IAC5F,UAAU,CAAC,IAAY,EAAE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AAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;YAChC,MAAM,EAAE,QAAQ;YAChB,OAAO,EAAE,EAAE,aAAa,EAAE,UAAU,KAAK,EAAE,EAAE;SAC9C,CAAC,CAAC;QACH,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YAC5B,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;YACpC,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;QACpC,CAAC;QACD,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YAC5C,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YACnC,MAAM,IAAI,KAAK,CAAC,qBAAqB,QAAQ,CAAC,MAAM,MAAM,IAAI,EAAE,CAAC,CAAC;QACpE,CAAC;IACH,CAAC;CACF"}
|
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.16.
|
|
38
|
+
export declare const SDK_VERSION = "0.16.48";
|
|
39
39
|
export declare class Logger {
|
|
40
40
|
private readonly appId;
|
|
41
41
|
private readonly apiBase;
|
package/dist/logger.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Must track package.json version — bumped on release. Guarded by version.test.ts
|
|
2
2
|
// so a forgotten bump fails CI instead of silently misattributing telemetry.
|
|
3
|
-
export const SDK_VERSION = '0.16.
|
|
3
|
+
export const SDK_VERSION = '0.16.48';
|
|
4
4
|
const MEMORY_LIMIT = 200;
|
|
5
5
|
const STORAGE_LIMIT = 500;
|
|
6
6
|
const STORAGE_KEY_PREFIX = 'fas_logs:';
|
package/dist/persist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Account-backed and shared data use different APIs:
|
|
8
8
|
* - Private account: `fas.kv` (the signed-in user's keys for this app, on the server).
|
|
9
|
-
* -
|
|
9
|
+
* - Shared documents: `fas.collections` (owner-only until the app owner shares the collection; then public read, owner writes).
|
|
10
10
|
* - Room fan-out: `fas.rooms` (ephemeral; not an access-control list).
|
|
11
11
|
*
|
|
12
12
|
* A failed save returns `{ ok: false, reason }` and must not be presented as
|
package/dist/persist/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Account-backed and shared data use different APIs:
|
|
8
8
|
* - Private account: `fas.kv` (the signed-in user's keys for this app, on the server).
|
|
9
|
-
* -
|
|
9
|
+
* - Shared documents: `fas.collections` (owner-only until the app owner shares the collection; then public read, owner writes).
|
|
10
10
|
* - Room fan-out: `fas.rooms` (ephemeral; not an access-control list).
|
|
11
11
|
*
|
|
12
12
|
* A failed save returns `{ ok: false, reason }` and must not be presented as
|
package/dist/persist/status.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* These helpers never report success before the write is committed, and they
|
|
5
5
|
* never delete unreadable data. Account-backed data is a different API:
|
|
6
|
-
* `fas.kv` stores the signed-in user's keys on the server.
|
|
6
|
+
* `fas.kv` stores the signed-in user's keys on the server. Documents
|
|
7
7
|
* use `fas.collections`. Room messages are ephemeral. None of those are
|
|
8
8
|
* replaced by this module.
|
|
9
9
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@freeappstore/sdk",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.48",
|
|
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",
|