@interop/was-react 0.1.9 → 0.1.11
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 +83 -3
- package/dist/auth/loginFlow.d.ts +4 -7
- package/dist/auth/loginFlow.d.ts.map +1 -1
- package/dist/auth/loginFlow.js +1 -4
- package/dist/auth/loginFlow.js.map +1 -1
- package/dist/auth/loginRequest.d.ts +29 -3
- package/dist/auth/loginRequest.d.ts.map +1 -1
- package/dist/auth/loginRequest.js +12 -4
- package/dist/auth/loginRequest.js.map +1 -1
- package/dist/auth/verifyResponse.d.ts +1 -4
- package/dist/auth/verifyResponse.d.ts.map +1 -1
- package/dist/auth/verifyResponse.js +4 -9
- package/dist/auth/verifyResponse.js.map +1 -1
- package/dist/config.d.ts +15 -7
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +0 -0
- package/dist/config.js.map +1 -1
- package/dist/identity/documentLoader.d.ts +2 -8
- package/dist/identity/documentLoader.d.ts.map +1 -1
- package/dist/identity/documentLoader.js +7 -88
- package/dist/identity/documentLoader.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/react/documentApp.d.ts +8 -5
- package/dist/react/documentApp.d.ts.map +1 -1
- package/dist/react/documentApp.js +1 -3
- package/dist/react/documentApp.js.map +1 -1
- package/dist/react/hooks.d.ts +3 -1
- package/dist/react/hooks.d.ts.map +1 -1
- package/dist/react/hooks.js.map +1 -1
- package/dist/session/authStore.d.ts +10 -2
- package/dist/session/authStore.d.ts.map +1 -1
- package/dist/session/authStore.js +35 -24
- package/dist/session/authStore.js.map +1 -1
- package/dist/storage/entityStore.d.ts +20 -0
- package/dist/storage/entityStore.d.ts.map +1 -1
- package/dist/storage/entityStore.js +24 -1
- package/dist/storage/entityStore.js.map +1 -1
- package/dist/storage/localStore.d.ts +10 -0
- package/dist/storage/localStore.d.ts.map +1 -1
- package/dist/storage/localStore.js +24 -2
- package/dist/storage/localStore.js.map +1 -1
- package/dist/storage/publicUrl.d.ts +20 -0
- package/dist/storage/publicUrl.d.ts.map +1 -0
- package/dist/storage/publicUrl.js +33 -0
- package/dist/storage/publicUrl.js.map +1 -0
- package/dist/storage/storageManager.d.ts +28 -0
- package/dist/storage/storageManager.d.ts.map +1 -1
- package/dist/storage/storageManager.js +42 -2
- package/dist/storage/storageManager.js.map +1 -1
- package/dist/storage/wasRemoteStore.d.ts +91 -2
- package/dist/storage/wasRemoteStore.d.ts.map +1 -1
- package/dist/storage/wasRemoteStore.js +159 -9
- package/dist/storage/wasRemoteStore.js.map +1 -1
- package/dist/storage/wasSync.d.ts +2 -1
- package/dist/storage/wasSync.d.ts.map +1 -1
- package/dist/storage/wasSync.js +13 -6
- package/dist/storage/wasSync.js.map +1 -1
- package/package.json +8 -8
|
@@ -55,12 +55,14 @@ export class LocalStore {
|
|
|
55
55
|
_db;
|
|
56
56
|
_collections;
|
|
57
57
|
_ciphers;
|
|
58
|
+
_configs;
|
|
58
59
|
// Per-collection logical-uuid -> envelope (RxDB primary key) index.
|
|
59
60
|
_index;
|
|
60
|
-
constructor({ db, collections, ciphers }) {
|
|
61
|
+
constructor({ db, collections, ciphers, configs }) {
|
|
61
62
|
this._db = db;
|
|
62
63
|
this._collections = collections;
|
|
63
64
|
this._ciphers = ciphers;
|
|
65
|
+
this._configs = configs;
|
|
64
66
|
this._index = {};
|
|
65
67
|
}
|
|
66
68
|
/**
|
|
@@ -126,7 +128,12 @@ export class LocalStore {
|
|
|
126
128
|
];
|
|
127
129
|
}));
|
|
128
130
|
const collectionsMap = (await db.addCollections(collectionsConfig));
|
|
129
|
-
return new LocalStore({
|
|
131
|
+
return new LocalStore({
|
|
132
|
+
db,
|
|
133
|
+
collections: collectionsMap,
|
|
134
|
+
ciphers,
|
|
135
|
+
configs: Object.fromEntries(collections.map(entry => [entry.key, entry]))
|
|
136
|
+
});
|
|
130
137
|
}
|
|
131
138
|
_collection(key) {
|
|
132
139
|
const collection = this._collections[key];
|
|
@@ -135,6 +142,21 @@ export class LocalStore {
|
|
|
135
142
|
}
|
|
136
143
|
return collection;
|
|
137
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* The registered {@link WasCollectionConfig} for one collection key (the
|
|
147
|
+
* WAS collection id, visibility, and declared indexes the storage layer
|
|
148
|
+
* routes on).
|
|
149
|
+
*
|
|
150
|
+
* @param key {string} the collection logical key
|
|
151
|
+
* @returns {WasCollectionConfig}
|
|
152
|
+
*/
|
|
153
|
+
collectionConfig(key) {
|
|
154
|
+
const config = this._configs[key];
|
|
155
|
+
if (!config) {
|
|
156
|
+
throw new Error(`Unknown collection "${key}".`);
|
|
157
|
+
}
|
|
158
|
+
return config;
|
|
159
|
+
}
|
|
138
160
|
_cipher(key) {
|
|
139
161
|
const cipher = this._ciphers[key];
|
|
140
162
|
if (!cipher) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localStore.js","sourceRoot":"","sources":["../../src/storage/localStore.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAIjB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EACL,eAAe,EACf,mBAAmB,EAEpB,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,eAAe,EACf,eAAe,EACf,uBAAuB,EACvB,sBAAsB,EACtB,iBAAiB,EAIlB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAO5D;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAClC,MAAM,EACN,aAAa,EAId;IACC,IAAI,IAAI,GAAG,UAAU,CAAA;IACrB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,aAAa,CAAC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AKG;IACH,KAAK,CAAC,MAAM;QACV,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAA;IACzB,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,EAC1B,MAAM,EACN,OAAO,EAIR;QACC,MAAM,gBAAgB,CAAC,MAAM,EAAE,OAAO,IAAI,iBAAiB,EAAE,CAAC,CAAA;IAChE,CAAC;CACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Composes the world-readable share URL for one document in a public
|
|
3
|
+
* (plaintext) collection. The returned URL is what an unauthenticated reader
|
|
4
|
+
* fetches (e.g. via `WasClient.publicRead`) to consume the share link, and it
|
|
5
|
+
* is stable across edits because a public collection stores the payload under
|
|
6
|
+
* its own logical uuid. Requires an open store and a wallet-connected session,
|
|
7
|
+
* and throws (fails closed) on a non-public / unprovisioned collection or an
|
|
8
|
+
* empty id. The URL resolves publicly only once the document has replicated to
|
|
9
|
+
* the server -- a locally-inserted doc shares after the next sync push.
|
|
10
|
+
*
|
|
11
|
+
* @param options {object}
|
|
12
|
+
* @param options.collectionKey {string} the app-side local collection key
|
|
13
|
+
* @param options.id {string} the document's logical uuid
|
|
14
|
+
* @returns {string}
|
|
15
|
+
*/
|
|
16
|
+
export declare function publicUrlFor({ collectionKey, id }: {
|
|
17
|
+
collectionKey: string;
|
|
18
|
+
id: string;
|
|
19
|
+
}): string;
|
|
20
|
+
//# sourceMappingURL=publicUrl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publicUrl.d.ts","sourceRoot":"","sources":["../../src/storage/publicUrl.ts"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,EAC3B,aAAa,EACb,EAAE,EACH,EAAE;IACD,aAAa,EAAE,MAAM,CAAA;IACrB,EAAE,EAAE,MAAM,CAAA;CACX,GAAG,MAAM,CAGT"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The app-facing share-URL helper for the publish-copy share pattern: given a
|
|
6
|
+
* logical collection key and a document id, composes the stable,
|
|
7
|
+
* world-readable resource URL of that document in a public (plaintext)
|
|
8
|
+
* collection. It routes the logical key to its WAS collection id through the
|
|
9
|
+
* process-wide holders exactly as {@link EntityStore.query} does, so it
|
|
10
|
+
* requires an open {@link LocalStore} and a wallet-connected session (the
|
|
11
|
+
* remote-store holder), and fails closed on non-public collections.
|
|
12
|
+
*/
|
|
13
|
+
import { requireStore, requireRemoteStore } from './storageManager.js';
|
|
14
|
+
/**
|
|
15
|
+
* Composes the world-readable share URL for one document in a public
|
|
16
|
+
* (plaintext) collection. The returned URL is what an unauthenticated reader
|
|
17
|
+
* fetches (e.g. via `WasClient.publicRead`) to consume the share link, and it
|
|
18
|
+
* is stable across edits because a public collection stores the payload under
|
|
19
|
+
* its own logical uuid. Requires an open store and a wallet-connected session,
|
|
20
|
+
* and throws (fails closed) on a non-public / unprovisioned collection or an
|
|
21
|
+
* empty id. The URL resolves publicly only once the document has replicated to
|
|
22
|
+
* the server -- a locally-inserted doc shares after the next sync push.
|
|
23
|
+
*
|
|
24
|
+
* @param options {object}
|
|
25
|
+
* @param options.collectionKey {string} the app-side local collection key
|
|
26
|
+
* @param options.id {string} the document's logical uuid
|
|
27
|
+
* @returns {string}
|
|
28
|
+
*/
|
|
29
|
+
export function publicUrlFor({ collectionKey, id }) {
|
|
30
|
+
const { id: collectionId } = requireStore().collectionConfig(collectionKey);
|
|
31
|
+
return requireRemoteStore().publicUrlFor({ collectionId, id });
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=publicUrl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publicUrl.js","sourceRoot":"","sources":["../../src/storage/publicUrl.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;GAQG;AACH,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAEtE;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,YAAY,CAAC,EAC3B,aAAa,EACb,EAAE,EAIH;IACC,MAAM,EAAE,EAAE,EAAE,YAAY,EAAE,GAAG,YAAY,EAAE,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAA;IAC3E,OAAO,kBAAkB,EAAE,CAAC,YAAY,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,CAAA;AAChE,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { LocalStore } from './localStore.js';
|
|
2
|
+
import type { WasRemoteStore } from './wasRemoteStore.js';
|
|
2
3
|
/**
|
|
3
4
|
* Installs the opened store (called once by the app bootstrap).
|
|
4
5
|
*
|
|
@@ -24,6 +25,33 @@ export declare function hasStore(): boolean;
|
|
|
24
25
|
* @returns {void}
|
|
25
26
|
*/
|
|
26
27
|
export declare function clearLocalStore(): void;
|
|
28
|
+
/**
|
|
29
|
+
* Installs the per-session delegated remote store (set once background sync
|
|
30
|
+
* has bootstrapped it from the granted zcaps).
|
|
31
|
+
*
|
|
32
|
+
* @param store {WasRemoteStore}
|
|
33
|
+
* @returns {void}
|
|
34
|
+
*/
|
|
35
|
+
export declare function setRemoteStore(store: WasRemoteStore): void;
|
|
36
|
+
/**
|
|
37
|
+
* The connected session's remote store, or throws while no wallet-connected
|
|
38
|
+
* session is active (local-only mode, or sync has not bootstrapped yet).
|
|
39
|
+
*
|
|
40
|
+
* @returns {WasRemoteStore}
|
|
41
|
+
*/
|
|
42
|
+
export declare function requireRemoteStore(): WasRemoteStore;
|
|
43
|
+
/**
|
|
44
|
+
* Whether a connected session's remote store is available.
|
|
45
|
+
*
|
|
46
|
+
* @returns {boolean}
|
|
47
|
+
*/
|
|
48
|
+
export declare function hasRemoteStore(): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Releases the held remote store reference (logout / sync teardown).
|
|
51
|
+
*
|
|
52
|
+
* @returns {void}
|
|
53
|
+
*/
|
|
54
|
+
export declare function clearRemoteStore(): void;
|
|
27
55
|
/**
|
|
28
56
|
* A stable per-install device id (the last-write-wins tiebreak stamped into
|
|
29
57
|
* every payload), persisted in localStorage under `<prefix>deviceId`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storageManager.d.ts","sourceRoot":"","sources":["../../src/storage/storageManager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"storageManager.d.ts","sourceRoot":"","sources":["../../src/storage/storageManager.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAKzD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAErD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,UAAU,CAKzC;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,IAAI,OAAO,CAElC;AAED;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAE1D;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAAI,cAAc,CAOnD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAExC;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,EAC1B,gBAA6C,EAC9C,GAAE;IAAE,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,MAAM,CAQ7C"}
|
|
@@ -3,14 +3,16 @@
|
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* The storage manager: a thin process-wide holder for the one {@link LocalStore}
|
|
6
|
-
* instance
|
|
7
|
-
*
|
|
6
|
+
* instance, the per-session {@link WasRemoteStore}, plus the per-install device
|
|
7
|
+
* id. Entity stores reach for the stores through {@link requireStore} /
|
|
8
|
+
* {@link requireRemoteStore} inside their verbs rather than importing them
|
|
8
9
|
* directly, which keeps this module free of store imports (no cycle) and lets
|
|
9
10
|
* the app own the init/hydrate ordering.
|
|
10
11
|
*/
|
|
11
12
|
import { uuidv7 } from 'uuidv7';
|
|
12
13
|
import { DEFAULT_STORAGE_KEY_PREFIX } from '../config.js';
|
|
13
14
|
let localStore = null;
|
|
15
|
+
let remoteStore = null;
|
|
14
16
|
/**
|
|
15
17
|
* Installs the opened store (called once by the app bootstrap).
|
|
16
18
|
*
|
|
@@ -47,6 +49,44 @@ export function hasStore() {
|
|
|
47
49
|
export function clearLocalStore() {
|
|
48
50
|
localStore = null;
|
|
49
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Installs the per-session delegated remote store (set once background sync
|
|
54
|
+
* has bootstrapped it from the granted zcaps).
|
|
55
|
+
*
|
|
56
|
+
* @param store {WasRemoteStore}
|
|
57
|
+
* @returns {void}
|
|
58
|
+
*/
|
|
59
|
+
export function setRemoteStore(store) {
|
|
60
|
+
remoteStore = store;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The connected session's remote store, or throws while no wallet-connected
|
|
64
|
+
* session is active (local-only mode, or sync has not bootstrapped yet).
|
|
65
|
+
*
|
|
66
|
+
* @returns {WasRemoteStore}
|
|
67
|
+
*/
|
|
68
|
+
export function requireRemoteStore() {
|
|
69
|
+
if (!remoteStore) {
|
|
70
|
+
throw new Error('No WAS remote store is available; connect a wallet session first.');
|
|
71
|
+
}
|
|
72
|
+
return remoteStore;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Whether a connected session's remote store is available.
|
|
76
|
+
*
|
|
77
|
+
* @returns {boolean}
|
|
78
|
+
*/
|
|
79
|
+
export function hasRemoteStore() {
|
|
80
|
+
return remoteStore !== null;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Releases the held remote store reference (logout / sync teardown).
|
|
84
|
+
*
|
|
85
|
+
* @returns {void}
|
|
86
|
+
*/
|
|
87
|
+
export function clearRemoteStore() {
|
|
88
|
+
remoteStore = null;
|
|
89
|
+
}
|
|
50
90
|
/**
|
|
51
91
|
* A stable per-install device id (the last-write-wins tiebreak stamped into
|
|
52
92
|
* every payload), persisted in localStorage under `<prefix>deviceId`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storageManager.js","sourceRoot":"","sources":["../../src/storage/storageManager.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"storageManager.js","sourceRoot":"","sources":["../../src/storage/storageManager.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;GAOG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAA;AAIzD,IAAI,UAAU,GAAsB,IAAI,CAAA;AACxC,IAAI,WAAW,GAA0B,IAAI,CAAA;AAE7C;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,KAAiB;IAC7C,UAAU,GAAG,KAAK,CAAA;AACpB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY;IAC1B,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAA;IAClE,CAAC;IACD,OAAO,UAAU,CAAA;AACnB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ;IACtB,OAAO,UAAU,KAAK,IAAI,CAAA;AAC5B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe;IAC7B,UAAU,GAAG,IAAI,CAAA;AACnB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,KAAqB;IAClD,WAAW,GAAG,KAAK,CAAA;AACrB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB;IAChC,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CACb,mEAAmE,CACpE,CAAA;IACH,CAAC;IACD,OAAO,WAAW,CAAA;AACpB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,WAAW,KAAK,IAAI,CAAA;AAC7B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB;IAC9B,WAAW,GAAG,IAAI,CAAA;AACpB,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CAAC,EAC1B,gBAAgB,GAAG,0BAA0B,KACZ,EAAE;IACnC,MAAM,WAAW,GAAG,GAAG,gBAAgB,UAAU,CAAA;IACjD,IAAI,EAAE,GAAG,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;IAC1C,IAAI,CAAC,EAAE,EAAE,CAAC;QACR,EAAE,GAAG,MAAM,EAAE,CAAA;QACb,YAAY,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;IACvC,CAAC;IACD,OAAO,EAAE,CAAA;AACX,CAAC"}
|
|
@@ -16,7 +16,12 @@
|
|
|
16
16
|
* RW zcap authorizes writing the collection description). It is non-fatal
|
|
17
17
|
* either way -- envelopes replicate into an unmarked (plaintext) collection
|
|
18
18
|
* just the same. A PUBLIC collection is never marked: public implies
|
|
19
|
-
* plaintext, so the marker PUT is skipped outright
|
|
19
|
+
* plaintext, so the marker PUT is skipped outright;
|
|
20
|
+
* - the sibling best-effort `indexes` declaration PUT for public collections
|
|
21
|
+
* that declare equality-indexed attributes, plus the equality query verb
|
|
22
|
+
* itself ({@link WasRemoteStore.queryCollectionByEquality}): the canonical
|
|
23
|
+
* sorted `filter[attr]=value` GET on the collection list endpoint, parsed
|
|
24
|
+
* into the `{ documents, hasMore, cursor? }` page shape.
|
|
20
25
|
*/
|
|
21
26
|
import type { ZcapClient } from '@interop/ezcap';
|
|
22
27
|
import type { IZcap } from '@interop/data-integrity-core';
|
|
@@ -37,12 +42,28 @@ export interface MarkerResult {
|
|
|
37
42
|
*/
|
|
38
43
|
skipped?: boolean;
|
|
39
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* One page of equality-query results: the shared shape of the GET
|
|
47
|
+
* `filter[attr]=value` filter and the POST `equality` query profile. `data` is
|
|
48
|
+
* the stored JSON content (absent for a blob resource); `custom` is the
|
|
49
|
+
* resource's custom metadata object, present when it has one. The opaque
|
|
50
|
+
* `cursor` continues the page walk when `hasMore` is true.
|
|
51
|
+
*/
|
|
52
|
+
export interface EqualityQueryPage {
|
|
53
|
+
documents: Array<{
|
|
54
|
+
id: string;
|
|
55
|
+
data?: unknown;
|
|
56
|
+
custom?: unknown;
|
|
57
|
+
}>;
|
|
58
|
+
hasMore: boolean;
|
|
59
|
+
cursor?: string;
|
|
60
|
+
}
|
|
40
61
|
export declare class WasRemoteStore {
|
|
41
62
|
readonly was: WasClient;
|
|
42
63
|
readonly serverUrl: string;
|
|
43
64
|
readonly spaceId: string;
|
|
44
65
|
private readonly _byCollectionId;
|
|
45
|
-
private readonly
|
|
66
|
+
private readonly _configById;
|
|
46
67
|
private constructor();
|
|
47
68
|
/**
|
|
48
69
|
* Builds a delegated remote store from a parsed grant set and the app's
|
|
@@ -84,5 +105,73 @@ export declare class WasRemoteStore {
|
|
|
84
105
|
* @returns {Promise<MarkerResult>}
|
|
85
106
|
*/
|
|
86
107
|
markCollectionEncrypted(collectionId: string): Promise<MarkerResult>;
|
|
108
|
+
/**
|
|
109
|
+
* Best-effort declaration of a public collection's equality-indexed
|
|
110
|
+
* attributes (`{ indexes: [...] }`) on its collection description, invoked
|
|
111
|
+
* with that collection's delegated RW zcap. The server rejects
|
|
112
|
+
* `filter[attr]=value` queries on undeclared attributes fail-closed, so a
|
|
113
|
+
* public collection that wants `store.query()` must announce its `indexes`
|
|
114
|
+
* here. Non-fatal like the encryption marker: returns the outcome rather
|
|
115
|
+
* than throwing. Skipped (reported `ok` + `skipped`) for a private
|
|
116
|
+
* collection or one that declares no indexes.
|
|
117
|
+
*
|
|
118
|
+
* @param collectionId {string} the WAS collection id
|
|
119
|
+
* @returns {Promise<MarkerResult>}
|
|
120
|
+
*/
|
|
121
|
+
declareCollectionIndexes(collectionId: string): Promise<MarkerResult>;
|
|
122
|
+
/**
|
|
123
|
+
* Runs one equality query against a public collection: the canonical GET
|
|
124
|
+
* `filter[attr]=value` form of the server's `equality` profile, invoked with
|
|
125
|
+
* the collection's delegated zcap (an anonymous reader would issue the same
|
|
126
|
+
* URL unsigned against a `PublicCanRead` collection). Filter attributes are
|
|
127
|
+
* emitted in sorted order so identical queries produce identical URLs
|
|
128
|
+
* (cache-friendly); values are string equality only. Fails closed before any
|
|
129
|
+
* network round trip on a non-public collection (the encrypted
|
|
130
|
+
* `blinded-index` path is not yet supported), an empty term set, or an
|
|
131
|
+
* attribute missing from the collection's declared `indexes`.
|
|
132
|
+
*
|
|
133
|
+
* @param options {object}
|
|
134
|
+
* @param options.collectionId {string} the WAS collection id
|
|
135
|
+
* @param options.equals {Record<string, string>} equality terms; multiple
|
|
136
|
+
* attributes AND together
|
|
137
|
+
* @param [options.limit] {number} page size (server default when omitted)
|
|
138
|
+
* @param [options.cursor] {string} opaque continuation cursor from the
|
|
139
|
+
* prior page
|
|
140
|
+
* @returns {Promise<EqualityQueryPage>}
|
|
141
|
+
*/
|
|
142
|
+
queryCollectionByEquality({ collectionId, equals, limit, cursor }: {
|
|
143
|
+
collectionId: string;
|
|
144
|
+
equals: Record<string, string>;
|
|
145
|
+
limit?: number;
|
|
146
|
+
cursor?: string;
|
|
147
|
+
}): Promise<EqualityQueryPage>;
|
|
148
|
+
/**
|
|
149
|
+
* The world-readable share URL for one document in a public (plaintext)
|
|
150
|
+
* collection: the exact URL an unauthenticated reader fetches (e.g. via
|
|
151
|
+
* `WasClient.publicRead`) to consume a share link. Because a public
|
|
152
|
+
* collection stores the payload under its own logical `id`, this URL is
|
|
153
|
+
* stable across edits of the document. Fails closed before composing
|
|
154
|
+
* anything on a non-public collection (the encrypted path stores under a
|
|
155
|
+
* random envelope id, so no stable public URL exists), an empty id, or a
|
|
156
|
+
* collection no delegated capability covers (catching typo'd or
|
|
157
|
+
* unprovisioned collection ids). The URL resolves publicly only once the
|
|
158
|
+
* document has replicated to the server -- a locally-inserted doc shares
|
|
159
|
+
* after the next sync push.
|
|
160
|
+
*
|
|
161
|
+
* @param options {object}
|
|
162
|
+
* @param options.collectionId {string} the WAS collection id
|
|
163
|
+
* @param options.id {string} the document's logical uuid
|
|
164
|
+
* @returns {string}
|
|
165
|
+
*/
|
|
166
|
+
publicUrlFor({ collectionId, id }: {
|
|
167
|
+
collectionId: string;
|
|
168
|
+
id: string;
|
|
169
|
+
}): string;
|
|
170
|
+
/**
|
|
171
|
+
* The shared best-effort collection-description PUT behind the encryption
|
|
172
|
+
* marker and the indexes declaration: invokes the collection's delegated RW
|
|
173
|
+
* zcap and reports the outcome rather than throwing.
|
|
174
|
+
*/
|
|
175
|
+
private _putDescription;
|
|
87
176
|
}
|
|
88
177
|
//# sourceMappingURL=wasRemoteStore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wasRemoteStore.d.ts","sourceRoot":"","sources":["../../src/storage/wasRemoteStore.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"wasRemoteStore.d.ts","sourceRoot":"","sources":["../../src/storage/wasRemoteStore.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAG/C,OAAO,KAAK,EAAE,mBAA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,wBAAwB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAe3E;;;;;;;;;;;;;;;;;;;OAmBG;IACG,yBAAyB,CAAC,EAC9B,YAAY,EACZ,MAAM,EACN,KAAK,EACL,MAAM,EACP,EAAE;QACD,YAAY,EAAE,MAAM,CAAA;QACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;QAC9B,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAgE9B;;;;;;;;;;;;;;;;;OAiBG;IACH,YAAY,CAAC,EACX,YAAY,EACZ,EAAE,EACH,EAAE;QACD,YAAY,EAAE,MAAM,CAAA;QACpB,EAAE,EAAE,MAAM,CAAA;KACX,GAAG,MAAM;IAyBV;;;;OAIG;YACW,eAAe;CAyB9B"}
|
|
@@ -6,13 +6,15 @@ export class WasRemoteStore {
|
|
|
6
6
|
serverUrl;
|
|
7
7
|
spaceId;
|
|
8
8
|
_byCollectionId;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
// Per WAS collection id: the effective visibility + declared equality
|
|
10
|
+
// indexes (the registry guarantees one declaration per id).
|
|
11
|
+
_configById;
|
|
12
|
+
constructor({ was, parsed, configById }) {
|
|
11
13
|
this.was = was;
|
|
12
14
|
this.serverUrl = parsed.serverUrl;
|
|
13
15
|
this.spaceId = parsed.spaceId;
|
|
14
16
|
this._byCollectionId = parsed.byCollectionId;
|
|
15
|
-
this.
|
|
17
|
+
this._configById = configById;
|
|
16
18
|
}
|
|
17
19
|
/**
|
|
18
20
|
* Builds a delegated remote store from a parsed grant set and the app's
|
|
@@ -33,10 +35,14 @@ export class WasRemoteStore {
|
|
|
33
35
|
zcapClient,
|
|
34
36
|
encryption: createEdvEncryption({ resolveKeys: async () => null })
|
|
35
37
|
});
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
const configById = new Map(collections.map(entry => [
|
|
39
|
+
entry.id,
|
|
40
|
+
{
|
|
41
|
+
visibility: entry.visibility ?? 'private',
|
|
42
|
+
...(entry.indexes && { indexes: entry.indexes })
|
|
43
|
+
}
|
|
44
|
+
]));
|
|
45
|
+
return new WasRemoteStore({ was, parsed, configById });
|
|
40
46
|
}
|
|
41
47
|
/**
|
|
42
48
|
* The delegated capability for one WAS collection, or `undefined` when no
|
|
@@ -62,9 +68,153 @@ export class WasRemoteStore {
|
|
|
62
68
|
* @returns {Promise<MarkerResult>}
|
|
63
69
|
*/
|
|
64
70
|
async markCollectionEncrypted(collectionId) {
|
|
65
|
-
if (this.
|
|
71
|
+
if (this._configById.get(collectionId)?.visibility === 'public') {
|
|
66
72
|
return { collectionId, ok: true, skipped: true };
|
|
67
73
|
}
|
|
74
|
+
return this._putDescription({
|
|
75
|
+
collectionId,
|
|
76
|
+
description: { id: collectionId, encryption: { scheme: 'edv' } }
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Best-effort declaration of a public collection's equality-indexed
|
|
81
|
+
* attributes (`{ indexes: [...] }`) on its collection description, invoked
|
|
82
|
+
* with that collection's delegated RW zcap. The server rejects
|
|
83
|
+
* `filter[attr]=value` queries on undeclared attributes fail-closed, so a
|
|
84
|
+
* public collection that wants `store.query()` must announce its `indexes`
|
|
85
|
+
* here. Non-fatal like the encryption marker: returns the outcome rather
|
|
86
|
+
* than throwing. Skipped (reported `ok` + `skipped`) for a private
|
|
87
|
+
* collection or one that declares no indexes.
|
|
88
|
+
*
|
|
89
|
+
* @param collectionId {string} the WAS collection id
|
|
90
|
+
* @returns {Promise<MarkerResult>}
|
|
91
|
+
*/
|
|
92
|
+
async declareCollectionIndexes(collectionId) {
|
|
93
|
+
const config = this._configById.get(collectionId);
|
|
94
|
+
if (config?.visibility !== 'public' ||
|
|
95
|
+
!config.indexes ||
|
|
96
|
+
config.indexes.length === 0) {
|
|
97
|
+
return { collectionId, ok: true, skipped: true };
|
|
98
|
+
}
|
|
99
|
+
return this._putDescription({
|
|
100
|
+
collectionId,
|
|
101
|
+
description: { id: collectionId, indexes: config.indexes }
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Runs one equality query against a public collection: the canonical GET
|
|
106
|
+
* `filter[attr]=value` form of the server's `equality` profile, invoked with
|
|
107
|
+
* the collection's delegated zcap (an anonymous reader would issue the same
|
|
108
|
+
* URL unsigned against a `PublicCanRead` collection). Filter attributes are
|
|
109
|
+
* emitted in sorted order so identical queries produce identical URLs
|
|
110
|
+
* (cache-friendly); values are string equality only. Fails closed before any
|
|
111
|
+
* network round trip on a non-public collection (the encrypted
|
|
112
|
+
* `blinded-index` path is not yet supported), an empty term set, or an
|
|
113
|
+
* attribute missing from the collection's declared `indexes`.
|
|
114
|
+
*
|
|
115
|
+
* @param options {object}
|
|
116
|
+
* @param options.collectionId {string} the WAS collection id
|
|
117
|
+
* @param options.equals {Record<string, string>} equality terms; multiple
|
|
118
|
+
* attributes AND together
|
|
119
|
+
* @param [options.limit] {number} page size (server default when omitted)
|
|
120
|
+
* @param [options.cursor] {string} opaque continuation cursor from the
|
|
121
|
+
* prior page
|
|
122
|
+
* @returns {Promise<EqualityQueryPage>}
|
|
123
|
+
*/
|
|
124
|
+
async queryCollectionByEquality({ collectionId, equals, limit, cursor }) {
|
|
125
|
+
const config = this._configById.get(collectionId);
|
|
126
|
+
if (config?.visibility !== 'public') {
|
|
127
|
+
throw new Error(`Equality queries require a public (plaintext) collection; ` +
|
|
128
|
+
`"${collectionId}" is not registered as public (the encrypted ` +
|
|
129
|
+
`blinded-index query path is not yet supported).`);
|
|
130
|
+
}
|
|
131
|
+
const attributes = Object.keys(equals);
|
|
132
|
+
if (attributes.length === 0) {
|
|
133
|
+
throw new Error('An equality query needs at least one term.');
|
|
134
|
+
}
|
|
135
|
+
const declared = new Set(config.indexes ?? []);
|
|
136
|
+
for (const name of attributes) {
|
|
137
|
+
if (!declared.has(name)) {
|
|
138
|
+
throw new Error(`Attribute "${name}" is not declared in collection ` +
|
|
139
|
+
`"${collectionId}" indexes; declare it in the collection config.`);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
const capability = this.collectionCapability(collectionId);
|
|
143
|
+
if (!capability) {
|
|
144
|
+
throw new Error(`No delegated capability covers collection "${collectionId}".`);
|
|
145
|
+
}
|
|
146
|
+
// Canonical query string: sorted filter attributes first, then the
|
|
147
|
+
// reserved pagination params. Literal brackets around a percent-encoded
|
|
148
|
+
// attribute name; the server decodes either spelling identically.
|
|
149
|
+
const params = attributes
|
|
150
|
+
.sort()
|
|
151
|
+
.map(name => `filter[${encodeURIComponent(name)}]=` +
|
|
152
|
+
encodeURIComponent(equals[name]));
|
|
153
|
+
if (limit !== undefined) {
|
|
154
|
+
params.push(`limit=${encodeURIComponent(String(limit))}`);
|
|
155
|
+
}
|
|
156
|
+
if (cursor !== undefined) {
|
|
157
|
+
params.push(`cursor=${encodeURIComponent(cursor)}`);
|
|
158
|
+
}
|
|
159
|
+
// The list endpoint is the trailing-slash collection items URL.
|
|
160
|
+
const response = await this.was.request({
|
|
161
|
+
capability,
|
|
162
|
+
path: `/space/${this.spaceId}/${collectionId}/?${params.join('&')}`,
|
|
163
|
+
method: 'GET'
|
|
164
|
+
});
|
|
165
|
+
const page = response.data;
|
|
166
|
+
if (!page || !Array.isArray(page.documents)) {
|
|
167
|
+
throw new Error(`Malformed equality query response for "${collectionId}": expected a ` +
|
|
168
|
+
`{ documents, hasMore } page.`);
|
|
169
|
+
}
|
|
170
|
+
return {
|
|
171
|
+
documents: page.documents,
|
|
172
|
+
hasMore: page.hasMore === true,
|
|
173
|
+
...(typeof page.cursor === 'string' && { cursor: page.cursor })
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* The world-readable share URL for one document in a public (plaintext)
|
|
178
|
+
* collection: the exact URL an unauthenticated reader fetches (e.g. via
|
|
179
|
+
* `WasClient.publicRead`) to consume a share link. Because a public
|
|
180
|
+
* collection stores the payload under its own logical `id`, this URL is
|
|
181
|
+
* stable across edits of the document. Fails closed before composing
|
|
182
|
+
* anything on a non-public collection (the encrypted path stores under a
|
|
183
|
+
* random envelope id, so no stable public URL exists), an empty id, or a
|
|
184
|
+
* collection no delegated capability covers (catching typo'd or
|
|
185
|
+
* unprovisioned collection ids). The URL resolves publicly only once the
|
|
186
|
+
* document has replicated to the server -- a locally-inserted doc shares
|
|
187
|
+
* after the next sync push.
|
|
188
|
+
*
|
|
189
|
+
* @param options {object}
|
|
190
|
+
* @param options.collectionId {string} the WAS collection id
|
|
191
|
+
* @param options.id {string} the document's logical uuid
|
|
192
|
+
* @returns {string}
|
|
193
|
+
*/
|
|
194
|
+
publicUrlFor({ collectionId, id }) {
|
|
195
|
+
const config = this._configById.get(collectionId);
|
|
196
|
+
if (config?.visibility !== 'public') {
|
|
197
|
+
throw new Error(`Public share URLs require a public (plaintext) collection; ` +
|
|
198
|
+
`"${collectionId}" is not registered as public (a private ` +
|
|
199
|
+
`collection stores documents under a random envelope id, so no ` +
|
|
200
|
+
`stable public URL exists).`);
|
|
201
|
+
}
|
|
202
|
+
if (typeof id !== 'string' || id.length === 0) {
|
|
203
|
+
throw new Error('A public share URL needs a non-empty document id.');
|
|
204
|
+
}
|
|
205
|
+
const capability = this.collectionCapability(collectionId);
|
|
206
|
+
if (!capability) {
|
|
207
|
+
throw new Error(`No delegated capability covers collection "${collectionId}".`);
|
|
208
|
+
}
|
|
209
|
+
return (`${this.serverUrl}/space/${this.spaceId}/${collectionId}/` +
|
|
210
|
+
`${encodeURIComponent(id)}`);
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* The shared best-effort collection-description PUT behind the encryption
|
|
214
|
+
* marker and the indexes declaration: invokes the collection's delegated RW
|
|
215
|
+
* zcap and reports the outcome rather than throwing.
|
|
216
|
+
*/
|
|
217
|
+
async _putDescription({ collectionId, description }) {
|
|
68
218
|
const capability = this.collectionCapability(collectionId);
|
|
69
219
|
if (!capability) {
|
|
70
220
|
return { collectionId, ok: false, error: 'no capability' };
|
|
@@ -74,7 +224,7 @@ export class WasRemoteStore {
|
|
|
74
224
|
capability,
|
|
75
225
|
path: `/space/${this.spaceId}/${collectionId}`,
|
|
76
226
|
method: 'PUT',
|
|
77
|
-
json:
|
|
227
|
+
json: description
|
|
78
228
|
});
|
|
79
229
|
return { collectionId, ok: true, status: response.status };
|
|
80
230
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wasRemoteStore.js","sourceRoot":"","sources":["../../src/storage/wasRemoteStore.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wasRemoteStore.js","sourceRoot":"","sources":["../../src/storage/wasRemoteStore.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAgC5D,MAAM,OAAO,cAAc;IACT,GAAG,CAAW;IACd,SAAS,CAAQ;IACjB,OAAO,CAAQ;IACd,eAAe,CAAuB;IACvD,sEAAsE;IACtE,4DAA4D;IAC3C,WAAW,CAG3B;IAED,YAAoB,EAClB,GAAG,EACH,MAAM,EACN,UAAU,EAQX;QACC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAA;QACjC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAA;QAC7B,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,cAAc,CAAA;QAC5C,IAAI,CAAC,WAAW,GAAG,UAAU,CAAA;IAC/B,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,UAAU,CAAC,EAChB,MAAM,EACN,UAAU,EACV,WAAW,GAAG,E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Y,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,CAAA;QAC5D,CAAC;QACD,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC;gBACtC,UAAU;gBACV,IAAI,EAAE,UAAU,IAAI,CAAC,OAAO,IAAI,YAAY,EAAE;gBAC9C,MAAM,EAAE,KAAK;gBACb,IAAI,EAAE,WAAW;aAClB,CAAC,CAAA;YACF,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAA;QAC5D,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,CAAA;YAC/B,MAAM,OAAO,GAAG,YAAY,CAAC,GAAG,CAAC,CAAA;YACjC,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,CAAA;QAC5D,CAAC;IACH,CAAC;CACF"}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* Shared WAS replication bootstrap: given a parsed grant set and the invoking
|
|
6
6
|
* ZcapClient, builds the delegated {@link WasRemoteStore}, best-effort marks
|
|
7
|
-
* each collection encrypted
|
|
7
|
+
* each private collection encrypted and declares each public collection's
|
|
8
|
+
* equality `indexes`, and starts the supplied {@link SyncController} with
|
|
8
9
|
* reactive store patching. The caller injects the opened localStore, the
|
|
9
10
|
* controller, and the per-doc `onRemoteChange` patcher (typically wired to the
|
|
10
11
|
* rehydrate mechanism over the app's store registry) rather than this module
|