@interop/was-react 0.5.0 → 0.7.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/README.md +33 -27
- package/dist/dev/provisionDevGrants.d.ts +2 -2
- package/dist/dev/provisionDevGrants.js +7 -7
- package/dist/dev/provisionDevGrants.js.map +1 -1
- package/dist/identity/agents.d.ts +2 -2
- package/dist/identity/agents.js +2 -2
- package/dist/identity/documentLoader.d.ts.map +1 -1
- package/dist/identity/documentLoader.js +21 -6
- package/dist/identity/documentLoader.js.map +1 -1
- package/dist/identity/seedStore.d.ts +5 -5
- package/dist/identity/seedStore.d.ts.map +1 -1
- package/dist/identity/seedStore.js +6 -6
- package/dist/identity/seedStore.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/session/authStore.js +14 -14
- package/dist/session/authStore.js.map +1 -1
- package/dist/storage/localStore.d.ts +16 -16
- package/dist/storage/localStore.d.ts.map +1 -1
- package/dist/storage/localStore.js +36 -36
- package/dist/storage/localStore.js.map +1 -1
- package/dist/storage/sharedCollectionReader.d.ts +2 -2
- package/dist/storage/sharedCollectionReader.js +8 -8
- package/dist/storage/sharedCollectionReader.js.map +1 -1
- package/dist/storage/wasRemoteStore.d.ts +17 -17
- package/dist/storage/wasRemoteStore.d.ts.map +1 -1
- package/dist/storage/wasRemoteStore.js +11 -11
- package/dist/storage/wasRemoteStore.js.map +1 -1
- package/dist/storage/wasSync.d.ts +5 -5
- package/dist/storage/wasSync.d.ts.map +1 -1
- package/dist/storage/wasSync.js +16 -16
- package/dist/storage/wasSync.js.map +1 -1
- package/dist/sync/docCipher.d.ts +4 -4
- package/dist/sync/docCipher.js +4 -4
- package/dist/sync/wasSyncPort.d.ts +2 -2
- package/dist/sync/wasSyncPort.js +2 -2
- package/package.json +6 -5
|
@@ -56,11 +56,11 @@ export class WasRemoteStore {
|
|
|
56
56
|
return this.#byCollectionId[collectionId];
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
|
-
* Reads one collection's `encryption`
|
|
59
|
+
* Reads one collection's `encryption` descriptor from its Collection Description,
|
|
60
60
|
* invoked with that collection's delegated zcap. Returns the
|
|
61
|
-
* {@link CollectionEncryption} block (a multi-recipient
|
|
62
|
-
* epochs) or `undefined` when the collection carries no
|
|
63
|
-
* the
|
|
61
|
+
* {@link CollectionEncryption} block (a multi-recipient descriptor carries key
|
|
62
|
+
* epochs) or `undefined` when the collection carries no descriptor. Non-fatal like
|
|
63
|
+
* the descriptor PUTs: returns `undefined` rather than throwing when no capability
|
|
64
64
|
* covers the collection or the read fails (offline, unauthorized), so a caller
|
|
65
65
|
* can fall back to its cached copy.
|
|
66
66
|
*
|
|
@@ -86,7 +86,7 @@ export class WasRemoteStore {
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
89
|
-
* Best-effort declaration of the `{ encryption: { scheme: 'edv' } }`
|
|
89
|
+
* Best-effort declaration of the `{ encryption: { scheme: 'edv' } }` descriptor on
|
|
90
90
|
* one collection, invoked with that collection's delegated RW zcap. Non-fatal:
|
|
91
91
|
* returns the outcome rather than throwing, so a server that does not authorize
|
|
92
92
|
* a delegated description write leaves replication untouched (the collection
|
|
@@ -95,13 +95,13 @@ export class WasRemoteStore {
|
|
|
95
95
|
* and reported as `ok` + `skipped`.
|
|
96
96
|
*
|
|
97
97
|
* A collection that ALREADY carries an `encryption` block is also skipped: the
|
|
98
|
-
* wallet provisions a multi-recipient epoch roster on the
|
|
99
|
-
* time, and overwriting it with the bare `{ scheme: 'edv' }`
|
|
98
|
+
* wallet provisions a multi-recipient epoch roster on the descriptor at consent
|
|
99
|
+
* time, and overwriting it with the bare `{ scheme: 'edv' }` descriptor would
|
|
100
100
|
* destroy that roster. The description is read first, so this method is a
|
|
101
101
|
* no-op fallback for servers/wallets that did not provision the roster.
|
|
102
102
|
*
|
|
103
103
|
* @param collectionId {string} the WAS collection id
|
|
104
|
-
* @returns {Promise<
|
|
104
|
+
* @returns {Promise<DeclarationResult>}
|
|
105
105
|
*/
|
|
106
106
|
async markCollectionEncrypted(collectionId) {
|
|
107
107
|
if (this.#configById.get(collectionId)?.visibility === 'public') {
|
|
@@ -122,12 +122,12 @@ export class WasRemoteStore {
|
|
|
122
122
|
* with that collection's delegated RW zcap. The server rejects
|
|
123
123
|
* `filter[attr]=value` queries on undeclared attributes fail-closed, so a
|
|
124
124
|
* public collection that wants `store.query()` must announce its `indexes`
|
|
125
|
-
* here. Non-fatal like the encryption
|
|
125
|
+
* here. Non-fatal like the encryption descriptor: returns the outcome rather
|
|
126
126
|
* than throwing. Skipped (reported `ok` + `skipped`) for a private
|
|
127
127
|
* collection or one that declares no indexes.
|
|
128
128
|
*
|
|
129
129
|
* @param collectionId {string} the WAS collection id
|
|
130
|
-
* @returns {Promise<
|
|
130
|
+
* @returns {Promise<DeclarationResult>}
|
|
131
131
|
*/
|
|
132
132
|
async declareCollectionIndexes(collectionId) {
|
|
133
133
|
const config = this.#configById.get(collectionId);
|
|
@@ -251,7 +251,7 @@ export class WasRemoteStore {
|
|
|
251
251
|
}
|
|
252
252
|
/**
|
|
253
253
|
* The shared best-effort collection-description PUT behind the encryption
|
|
254
|
-
*
|
|
254
|
+
* descriptor and the indexes declaration: invokes the collection's delegated RW
|
|
255
255
|
* zcap and reports the outcome rather than throwing.
|
|
256
256
|
*/
|
|
257
257
|
async #putDescription({ collectionId, description }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wasRemoteStore.js","sourceRoot":"","sources":["../../src/storage/wasRemoteStore.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAE/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAkC5D,MAAM,OAAO,cAAc;IACT,GAAG,CAAW;IACd,SAAS,CAAQ;IACj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ClB,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"}
|
|
@@ -61,12 +61,12 @@ export interface WasSyncBootstrap {
|
|
|
61
61
|
* @param [options.identityKeys.keyResolver] {IKeyResolver}
|
|
62
62
|
* @param [options.onAuthError] {() => void} fired when replication hits a
|
|
63
63
|
* 401/403 (expired/revoked access) -- wired to the reconnect banner
|
|
64
|
-
* @param [options.
|
|
65
|
-
* the freshly fetched per-collection encryption
|
|
66
|
-
* id), to refresh the offline
|
|
64
|
+
* @param [options.onDescriptorsFetched] {(descriptors) => void | Promise<void>} given
|
|
65
|
+
* the freshly fetched per-collection encryption descriptors (by WAS collection
|
|
66
|
+
* id), to refresh the offline descriptor cache
|
|
67
67
|
* @returns {Promise<WasSyncBootstrap>}
|
|
68
68
|
*/
|
|
69
|
-
export declare function startWasSync({ parsed, zcapClient, collections, localStore, syncController, onRemoteChange, sharedCollections, identityKeys, onAuthError,
|
|
69
|
+
export declare function startWasSync({ parsed, zcapClient, collections, localStore, syncController, onRemoteChange, sharedCollections, identityKeys, onAuthError, onDescriptorsFetched }: {
|
|
70
70
|
parsed: ParsedGrants;
|
|
71
71
|
zcapClient: ZcapClient;
|
|
72
72
|
collections: WasCollectionConfig[];
|
|
@@ -79,6 +79,6 @@ export declare function startWasSync({ parsed, zcapClient, collections, localSto
|
|
|
79
79
|
keyResolver: IKeyResolver;
|
|
80
80
|
};
|
|
81
81
|
onAuthError?: () => void;
|
|
82
|
-
|
|
82
|
+
onDescriptorsFetched?: (descriptors: Record<string, CollectionEncryption>) => void | Promise<void>;
|
|
83
83
|
}): Promise<WasSyncBootstrap>;
|
|
84
84
|
//# sourceMappingURL=wasSync.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wasSync.d.ts","sourceRoot":"","sources":["../../src/storage/wasSync.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACb,MAAM,8BAA8B,CAAA;AACrC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEzD;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,cAAc,CAAA;IAC3B,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAA;CAC1D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,YAAY,CAAC,EACjC,MAAM,EACN,UAAU,EACV,WAAW,EACX,UAAU,EACV,cAAc,EACd,cAAc,EACd,i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B,EAAE,CAAA;IAClC,UAAU,EAAE,UAAU,CAAA;IACtB,cAAc,EAAE,cAAc,CAAA;IAC9B,cAAc,EAAE,CACd,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,KAC5B,IAAI,CAAA;IACT,iBAAiB,CAAC,EAAE,sBAAsB,EAAE,CAAA;IAC5C,YAAY,CAAC,EAAE;QACb,eAAe,EAAE,gBAAgB,CAAA;QACjC,WAAW,EAAE,YAAY,CAAA;KAC1B,CAAA;IACD,WAAW,CAAC,EAAE,MAAM,IAAI,CAAA;IACxB,oBAAoB,CAAC,EAAE,CACrB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,KAC9C,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC1B,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAqG5B"}
|
package/dist/storage/wasSync.js
CHANGED
|
@@ -22,12 +22,12 @@ import { SharedCollectionReader } from './sharedCollectionReader.js';
|
|
|
22
22
|
* @param [options.identityKeys.keyResolver] {IKeyResolver}
|
|
23
23
|
* @param [options.onAuthError] {() => void} fired when replication hits a
|
|
24
24
|
* 401/403 (expired/revoked access) -- wired to the reconnect banner
|
|
25
|
-
* @param [options.
|
|
26
|
-
* the freshly fetched per-collection encryption
|
|
27
|
-
* id), to refresh the offline
|
|
25
|
+
* @param [options.onDescriptorsFetched] {(descriptors) => void | Promise<void>} given
|
|
26
|
+
* the freshly fetched per-collection encryption descriptors (by WAS collection
|
|
27
|
+
* id), to refresh the offline descriptor cache
|
|
28
28
|
* @returns {Promise<WasSyncBootstrap>}
|
|
29
29
|
*/
|
|
30
|
-
export async function startWasSync({ parsed, zcapClient, collections, localStore, syncController, onRemoteChange, sharedCollections = [], identityKeys, onAuthError,
|
|
30
|
+
export async function startWasSync({ parsed, zcapClient, collections, localStore, syncController, onRemoteChange, sharedCollections = [], identityKeys, onAuthError, onDescriptorsFetched }) {
|
|
31
31
|
const remoteStore = WasRemoteStore.fromGrants({
|
|
32
32
|
parsed,
|
|
33
33
|
zcapClient,
|
|
@@ -37,43 +37,43 @@ export async function startWasSync({ parsed, zcapClient, collections, localStore
|
|
|
37
37
|
// replicate into an unmarked collection just the same, and a query against
|
|
38
38
|
// undeclared indexes fails with a descriptive 400). Each helper skips the
|
|
39
39
|
// collections it does not apply to (reported ok + skipped): the encryption
|
|
40
|
-
//
|
|
40
|
+
// descriptor skips public collections, the indexes declaration skips private
|
|
41
41
|
// ones and public ones with no declared indexes.
|
|
42
42
|
const sharedIds = new Set(sharedCollections.map(entry => entry.id));
|
|
43
43
|
await Promise.all(Object.keys(parsed.byCollectionId)
|
|
44
44
|
.filter(collectionId => !sharedIds.has(collectionId))
|
|
45
45
|
.map(async (collectionId) => {
|
|
46
|
-
const
|
|
47
|
-
if (!
|
|
48
|
-
console.warn(`Encryption
|
|
46
|
+
const declared = await remoteStore.markCollectionEncrypted(collectionId);
|
|
47
|
+
if (!declared.ok) {
|
|
48
|
+
console.warn(`Encryption descriptor PUT not authorized for "${collectionId}" (status ${declared.status ?? 'n/a'}).`);
|
|
49
49
|
}
|
|
50
50
|
const indexes = await remoteStore.declareCollectionIndexes(collectionId);
|
|
51
51
|
if (!indexes.ok) {
|
|
52
52
|
console.warn(`Indexes declaration PUT not authorized for "${collectionId}" (status ${indexes.status ?? 'n/a'}).`);
|
|
53
53
|
}
|
|
54
54
|
}));
|
|
55
|
-
// Fetch each granted private collection's encryption
|
|
55
|
+
// Fetch each granted private collection's encryption descriptor: rebuild that
|
|
56
56
|
// collection's cipher when its epoch roster differs from what the local store
|
|
57
57
|
// opened with (a wallet-side rotation, or first-ever epochs), and hand the
|
|
58
|
-
// fresh set to the
|
|
58
|
+
// fresh set to the descriptor-cache refresher so an offline session can rebuild
|
|
59
59
|
// its epoch-aware ciphers without a live read.
|
|
60
60
|
const privateIds = collections
|
|
61
61
|
.filter(collection => collection.visibility !== 'public')
|
|
62
62
|
.map(collection => collection.id)
|
|
63
63
|
.filter(id => parsed.byCollectionId[id] !== undefined);
|
|
64
|
-
const
|
|
64
|
+
const descriptors = {};
|
|
65
65
|
await Promise.all(privateIds.map(async (collectionId) => {
|
|
66
66
|
const encryption = await remoteStore.readCollectionEncryption(collectionId);
|
|
67
67
|
if (encryption) {
|
|
68
|
-
|
|
69
|
-
await localStore.
|
|
68
|
+
descriptors[collectionId] = encryption;
|
|
69
|
+
await localStore.applyRemoteDescriptor({ collectionId, encryption });
|
|
70
70
|
}
|
|
71
71
|
}));
|
|
72
72
|
// Install the one-shot epoch refresher so a decrypt that meets an unseen epoch
|
|
73
|
-
// (a rotation on another device) re-reads the
|
|
73
|
+
// (a rotation on another device) re-reads the descriptor and rebuilds the cipher.
|
|
74
74
|
localStore.setEpochRefresher(collectionId => remoteStore.readCollectionEncryption(collectionId));
|
|
75
|
-
if (
|
|
76
|
-
await
|
|
75
|
+
if (onDescriptorsFetched) {
|
|
76
|
+
await onDescriptorsFetched(descriptors);
|
|
77
77
|
}
|
|
78
78
|
// Shared collections stay entirely out of replication: one read-only reader
|
|
79
79
|
// each, opened over the delegated read zcap and the collection's epoch
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wasSync.js","sourceRoot":"","sources":["../../src/storage/wasSync.ts"],"names":[],"mappings":"AA+BA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAcpE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,EACjC,MAAM,EACN,UAAU,EACV,WAAW,EACX,UAAU,EACV,cAAc,EACd,cAAc,EACd,iBAAiB,GAAG,EAAE,EACtB,YAAY,EACZ,WAAW,EACX,
|
|
1
|
+
{"version":3,"file":"wasSync.js","sourceRoot":"","sources":["../../src/storage/wasSync.ts"],"names":[],"mappings":"AA+BA,OAAO,EAAE,cAAc,EAAE,MAAM,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,IAAI,iBAAiB,EAAE,CAAC;QAC5C,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,CAAC;YAC/B,OAAO,CAAC,IAAI,CACV,+BAA+B,EAAE,uCAAuC,CACzE,CAAA;YACD,SAAQ;QACV,CAAC;QACD,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,OAAO,CAAC,IAAI,CACV,+BAA+B,EAAE,uCAAuC;gBACtE,8BAA8B,CACjC,CAAA;YACD,SAAQ;QACV,CAAC;QACD,IAAI,CAAC;YACH,aAAa,CAAC,GAAG,CAAC,GAAG,MAAM,sBAAsB,CAAC,IAAI,CAAC;gBACrD,WAAW;gBACX,eAAe,EAAE,YAAY,CAAC,eAAe;gBAC7C,WAAW,EAAE,YAAY,CAAC,WAAW;gBACrC,YAAY,EAAE,EAAE;aACjB,CAAC,CAAA;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,IAAI,CAAC,+BAA+B,EAAE,IAAI,EAAE,GAAG,CAAC,CAAA;QAC1D,CAAC;IACH,CAAC;IAED,MAAM,cAAc,CAAC,KAAK,CAAC;QACzB,WAAW;QACX,UAAU;QACV,cAAc;QACd,GAAG,CAAC,WAAW,IAAI,EAAE,WAAW,EAAE,CAAC;KACpC,CAAC,CAAA;IACF,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,aAAa,EAAE,CAAA;AAC1D,CAAC"}
|
package/dist/sync/docCipher.d.ts
CHANGED
|
@@ -79,10 +79,10 @@ export declare function createPlaintextDocCodec({ collectionId }: {
|
|
|
79
79
|
* (constant bump / toggle / re-categorize edits).
|
|
80
80
|
*
|
|
81
81
|
* Delegates to `@interop/was-client`'s `createEdvDocCipher`: with no
|
|
82
|
-
* `encryption`
|
|
82
|
+
* `encryption` descriptor (or a descriptor with no key epochs) the cipher is
|
|
83
83
|
* single-recipient (the key-agreement key encrypts and decrypts directly, the
|
|
84
|
-
* behavior every collection has had); with epochs on the
|
|
85
|
-
* becomes multi-recipient -- writes stamp the
|
|
84
|
+
* behavior every collection has had); with epochs on the descriptor the cipher
|
|
85
|
+
* becomes multi-recipient -- writes stamp the descriptor's current epoch and reads
|
|
86
86
|
* route by the envelope's recipient key id, while a pre-epoch envelope still
|
|
87
87
|
* decrypts through the single-key path (a permanent tolerance, not a migration
|
|
88
88
|
* shim). The returned cipher's shape matches {@link DocCipher} exactly; only the
|
|
@@ -93,7 +93,7 @@ export declare function createPlaintextDocCodec({ collectionId }: {
|
|
|
93
93
|
* @param options.keyResolver {IKeyResolver}
|
|
94
94
|
* @param options.collectionId {string} labels errors; the codec is agnostic
|
|
95
95
|
* @param [options.encryption] {CollectionEncryption} the collection's
|
|
96
|
-
* encryption
|
|
96
|
+
* encryption descriptor; when it carries key epochs the cipher becomes
|
|
97
97
|
* multi-recipient
|
|
98
98
|
* @returns {Promise<DocCipher>}
|
|
99
99
|
*/
|
package/dist/sync/docCipher.js
CHANGED
|
@@ -65,10 +65,10 @@ export function createPlaintextDocCodec({ collectionId }) {
|
|
|
65
65
|
* (constant bump / toggle / re-categorize edits).
|
|
66
66
|
*
|
|
67
67
|
* Delegates to `@interop/was-client`'s `createEdvDocCipher`: with no
|
|
68
|
-
* `encryption`
|
|
68
|
+
* `encryption` descriptor (or a descriptor with no key epochs) the cipher is
|
|
69
69
|
* single-recipient (the key-agreement key encrypts and decrypts directly, the
|
|
70
|
-
* behavior every collection has had); with epochs on the
|
|
71
|
-
* becomes multi-recipient -- writes stamp the
|
|
70
|
+
* behavior every collection has had); with epochs on the descriptor the cipher
|
|
71
|
+
* becomes multi-recipient -- writes stamp the descriptor's current epoch and reads
|
|
72
72
|
* route by the envelope's recipient key id, while a pre-epoch envelope still
|
|
73
73
|
* decrypts through the single-key path (a permanent tolerance, not a migration
|
|
74
74
|
* shim). The returned cipher's shape matches {@link DocCipher} exactly; only the
|
|
@@ -79,7 +79,7 @@ export function createPlaintextDocCodec({ collectionId }) {
|
|
|
79
79
|
* @param options.keyResolver {IKeyResolver}
|
|
80
80
|
* @param options.collectionId {string} labels errors; the codec is agnostic
|
|
81
81
|
* @param [options.encryption] {CollectionEncryption} the collection's
|
|
82
|
-
* encryption
|
|
82
|
+
* encryption descriptor; when it carries key epochs the cipher becomes
|
|
83
83
|
* multi-recipient
|
|
84
84
|
* @returns {Promise<DocCipher>}
|
|
85
85
|
*/
|
|
@@ -30,7 +30,7 @@ import { type WasSyncBasePort } from './types.js';
|
|
|
30
30
|
* Extracts an HTTP status from a raw ky/ezcap error. `was.request()` rejects on
|
|
31
31
|
* any non-2xx with `err.status` set (see `@interop/http-client`'s error
|
|
32
32
|
* normaliser); this reads it defensively from either location. Shared with the
|
|
33
|
-
* remote store's
|
|
33
|
+
* remote store's descriptor PUT and the dev-grant provisioner, which need the raw
|
|
34
34
|
* status for diagnostics rather than the mapped sync error.
|
|
35
35
|
*
|
|
36
36
|
* @param err {unknown}
|
|
@@ -40,7 +40,7 @@ export declare function errorStatus(err: unknown): number | undefined;
|
|
|
40
40
|
/**
|
|
41
41
|
* Normalizes an unknown caught error into a display string: the `Error`'s
|
|
42
42
|
* `message` when it is one, else its `String(...)` coercion. Shared by the
|
|
43
|
-
* remote store's
|
|
43
|
+
* remote store's descriptor PUT and the session activation error path.
|
|
44
44
|
*
|
|
45
45
|
* @param err {unknown}
|
|
46
46
|
* @returns {string}
|
package/dist/sync/wasSyncPort.js
CHANGED
|
@@ -29,7 +29,7 @@ import { WasSyncAuthError, WasSyncConflictError } from './types.js';
|
|
|
29
29
|
* Extracts an HTTP status from a raw ky/ezcap error. `was.request()` rejects on
|
|
30
30
|
* any non-2xx with `err.status` set (see `@interop/http-client`'s error
|
|
31
31
|
* normaliser); this reads it defensively from either location. Shared with the
|
|
32
|
-
* remote store's
|
|
32
|
+
* remote store's descriptor PUT and the dev-grant provisioner, which need the raw
|
|
33
33
|
* status for diagnostics rather than the mapped sync error.
|
|
34
34
|
*
|
|
35
35
|
* @param err {unknown}
|
|
@@ -42,7 +42,7 @@ export function errorStatus(err) {
|
|
|
42
42
|
/**
|
|
43
43
|
* Normalizes an unknown caught error into a display string: the `Error`'s
|
|
44
44
|
* `message` when it is one, else its `String(...)` coercion. Shared by the
|
|
45
|
-
* remote store's
|
|
45
|
+
* remote store's descriptor PUT and the session activation error path.
|
|
46
46
|
*
|
|
47
47
|
* @param err {unknown}
|
|
48
48
|
* @returns {string}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interop/was-react",
|
|
3
3
|
"description": "React library for building 'Bring Your Own Everything' (BYOE) apps on Wallet Attached Storage: DID Auth login via CHAPI wallet, local-first encrypted storage, and background sync to a WAS server.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.7.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "pnpm run clear && tsc",
|
|
@@ -47,13 +47,14 @@
|
|
|
47
47
|
"sideEffects": false,
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@interop/data-integrity-core": "^8.4.0",
|
|
50
|
+
"@interop/did-method-webvh": "^5.0.0",
|
|
50
51
|
"@interop/ed25519-signature": "^7.1.4",
|
|
51
52
|
"@interop/ezcap": "^7.4.1",
|
|
52
|
-
"@interop/security-document-loader": "^9.
|
|
53
|
+
"@interop/security-document-loader": "^9.5.0",
|
|
53
54
|
"@interop/vc": "^11.0.6",
|
|
54
55
|
"@interop/verifier-core": "^3.5.0",
|
|
55
|
-
"@interop/wallet-core": "^0.
|
|
56
|
-
"@interop/was-client": "^0.
|
|
56
|
+
"@interop/wallet-core": "^0.8.0",
|
|
57
|
+
"@interop/was-client": "^0.23.0",
|
|
57
58
|
"@interop/webkms-client": "^14.7.1",
|
|
58
59
|
"@interop/x25519-key-agreement-key": "^5.2.1",
|
|
59
60
|
"@scure/base": "^2.2.0",
|
|
@@ -109,7 +110,7 @@
|
|
|
109
110
|
"typescript-eslint": "^8.59.4",
|
|
110
111
|
"vite": "^8.0.14",
|
|
111
112
|
"vitest": "^4.1.7",
|
|
112
|
-
"was-teaching-server": "^0.
|
|
113
|
+
"was-teaching-server": "^0.16.0",
|
|
113
114
|
"zustand": "^5.0.12"
|
|
114
115
|
},
|
|
115
116
|
"publishConfig": {
|