@interop/was-react 0.8.3 → 0.9.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 +50 -44
- package/dist/auth/chapi.d.ts.map +1 -1
- package/dist/auth/chapi.js +5 -4
- package/dist/auth/chapi.js.map +1 -1
- package/dist/auth/loginFlow.d.ts.map +1 -1
- package/dist/auth/loginFlow.js +39 -43
- package/dist/auth/loginFlow.js.map +1 -1
- package/dist/auth/verifyResponse.d.ts.map +1 -1
- package/dist/auth/verifyResponse.js +4 -4
- package/dist/auth/verifyResponse.js.map +1 -1
- package/dist/auth/walletRequestTypes.d.ts +9 -90
- package/dist/auth/walletRequestTypes.d.ts.map +1 -1
- package/dist/config.d.ts +9 -9
- package/dist/config.js +0 -0
- package/dist/dev/provisionDevGrants.d.ts.map +1 -1
- package/dist/dev/provisionDevGrants.js +18 -19
- package/dist/dev/provisionDevGrants.js.map +1 -1
- package/dist/grants.d.ts +19 -9
- package/dist/grants.d.ts.map +1 -1
- package/dist/grants.js +17 -2
- package/dist/grants.js.map +1 -1
- package/dist/identity/agents.d.ts +1 -1
- package/dist/identity/agents.d.ts.map +1 -1
- package/dist/identity/agents.js +10 -25
- package/dist/identity/agents.js.map +1 -1
- package/dist/identity/appSession.d.ts +27 -0
- package/dist/identity/appSession.d.ts.map +1 -1
- package/dist/identity/appSession.js +51 -13
- package/dist/identity/appSession.js.map +1 -1
- package/dist/identity/seedCredential.d.ts +7 -0
- package/dist/identity/seedCredential.d.ts.map +1 -1
- package/dist/identity/seedCredential.js +11 -14
- package/dist/identity/seedCredential.js.map +1 -1
- package/dist/identity/seedStore.d.ts +19 -0
- package/dist/identity/seedStore.d.ts.map +1 -1
- package/dist/identity/seedStore.js +40 -13
- package/dist/identity/seedStore.js.map +1 -1
- package/dist/index.d.ts +4 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -4
- package/dist/index.js.map +1 -1
- package/dist/jsonLd.d.ts +19 -0
- package/dist/jsonLd.d.ts.map +1 -0
- package/dist/jsonLd.js +24 -0
- package/dist/jsonLd.js.map +1 -0
- package/dist/mui/AdoptDialog.d.ts.map +1 -1
- package/dist/mui/AdoptDialog.js +7 -3
- package/dist/mui/AdoptDialog.js.map +1 -1
- package/dist/mui/ClearDataDialog.d.ts.map +1 -1
- package/dist/mui/ClearDataDialog.js +12 -11
- package/dist/mui/ClearDataDialog.js.map +1 -1
- package/dist/mui/ConfirmDialog.d.ts +35 -0
- package/dist/mui/ConfirmDialog.d.ts.map +1 -0
- package/dist/mui/ConfirmDialog.js +18 -0
- package/dist/mui/ConfirmDialog.js.map +1 -0
- package/dist/mui/LogoutDialog.d.ts.map +1 -1
- package/dist/mui/LogoutDialog.js +7 -3
- package/dist/mui/LogoutDialog.js.map +1 -1
- package/dist/react/documentApp.d.ts +29 -0
- package/dist/react/documentApp.d.ts.map +1 -1
- package/dist/react/documentApp.js +9 -38
- package/dist/react/documentApp.js.map +1 -1
- package/dist/react/hooks.d.ts +13 -7
- package/dist/react/hooks.d.ts.map +1 -1
- package/dist/react/hooks.js +17 -11
- package/dist/react/hooks.js.map +1 -1
- package/dist/session/authStore.d.ts +9 -9
- package/dist/session/authStore.d.ts.map +1 -1
- package/dist/session/authStore.js +100 -96
- package/dist/session/authStore.js.map +1 -1
- package/dist/storage/adopt.d.ts +5 -1
- package/dist/storage/adopt.d.ts.map +1 -1
- package/dist/storage/adopt.js +8 -24
- package/dist/storage/adopt.js.map +1 -1
- package/dist/storage/entityStore.d.ts.map +1 -1
- package/dist/storage/entityStore.js +27 -20
- package/dist/storage/entityStore.js.map +1 -1
- package/dist/storage/localStore.d.ts +12 -6
- package/dist/storage/localStore.d.ts.map +1 -1
- package/dist/storage/localStore.js +118 -74
- package/dist/storage/localStore.js.map +1 -1
- package/dist/storage/sharedCollectionReader.d.ts +1 -1
- package/dist/storage/sharedCollectionReader.d.ts.map +1 -1
- package/dist/storage/sharedCollectionReader.js +79 -81
- package/dist/storage/sharedCollectionReader.js.map +1 -1
- package/dist/storage/storageManager.d.ts +3 -1
- package/dist/storage/storageManager.d.ts.map +1 -1
- package/dist/storage/storageManager.js +20 -6
- package/dist/storage/storageManager.js.map +1 -1
- package/dist/storage/syncController.d.ts +1 -16
- package/dist/storage/syncController.d.ts.map +1 -1
- package/dist/storage/syncController.js +38 -58
- package/dist/storage/syncController.js.map +1 -1
- package/dist/storage/syncStatusStore.d.ts +8 -6
- package/dist/storage/syncStatusStore.d.ts.map +1 -1
- package/dist/storage/syncStatusStore.js +6 -6
- package/dist/storage/syncStatusStore.js.map +1 -1
- package/dist/storage/wasRemoteStore.d.ts +34 -2
- package/dist/storage/wasRemoteStore.d.ts.map +1 -1
- package/dist/storage/wasRemoteStore.js +45 -7
- package/dist/storage/wasRemoteStore.js.map +1 -1
- package/dist/storage/wasSync.d.ts.map +1 -1
- package/dist/storage/wasSync.js +47 -38
- package/dist/storage/wasSync.js.map +1 -1
- package/dist/sync/changesQuery.d.ts.map +1 -1
- package/dist/sync/changesQuery.js +2 -12
- package/dist/sync/changesQuery.js.map +1 -1
- package/dist/sync/docCipher.d.ts +17 -9
- package/dist/sync/docCipher.d.ts.map +1 -1
- package/dist/sync/docCipher.js +17 -11
- package/dist/sync/docCipher.js.map +1 -1
- package/dist/sync/feedMasterPort.d.ts +6 -0
- package/dist/sync/feedMasterPort.d.ts.map +1 -1
- package/dist/sync/feedMasterPort.js +82 -40
- package/dist/sync/feedMasterPort.js.map +1 -1
- package/dist/sync/index.d.ts +6 -5
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +6 -3
- package/dist/sync/index.js.map +1 -1
- package/dist/sync/lww.d.ts +15 -14
- package/dist/sync/lww.d.ts.map +1 -1
- package/dist/sync/lww.js +3 -3
- package/dist/sync/lww.js.map +1 -1
- package/dist/sync/lwwConflictHandler.d.ts +3 -10
- package/dist/sync/lwwConflictHandler.d.ts.map +1 -1
- package/dist/sync/lwwConflictHandler.js +7 -17
- package/dist/sync/lwwConflictHandler.js.map +1 -1
- package/dist/sync/pushWrites.d.ts +6 -8
- package/dist/sync/pushWrites.d.ts.map +1 -1
- package/dist/sync/pushWrites.js +56 -83
- package/dist/sync/pushWrites.js.map +1 -1
- package/dist/sync/types.d.ts +80 -4
- package/dist/sync/types.d.ts.map +1 -1
- package/dist/sync/types.js +36 -18
- package/dist/sync/types.js.map +1 -1
- package/dist/sync/wasSyncPort.d.ts +0 -11
- package/dist/sync/wasSyncPort.d.ts.map +1 -1
- package/dist/sync/wasSyncPort.js +8 -33
- package/dist/sync/wasSyncPort.js.map +1 -1
- package/package.json +5 -5
- package/dist/identity/initAppSession.d.ts +0 -27
- package/dist/identity/initAppSession.d.ts.map +0 -1
- package/dist/identity/initAppSession.js +0 -30
- package/dist/identity/initAppSession.js.map +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { EncryptionDescriptorCache } from '@interop/wallet-core/descriptors';
|
|
1
2
|
/**
|
|
2
3
|
* The bound seed-store operations returned by `createSeedStore`.
|
|
3
4
|
*/
|
|
@@ -46,4 +47,22 @@ export declare function createSeedStore({ dbName, idb }: {
|
|
|
46
47
|
dbName: string;
|
|
47
48
|
idb?: IDBFactory;
|
|
48
49
|
}): SeedStore;
|
|
50
|
+
/**
|
|
51
|
+
* Presents a {@link SeedStore}'s persisted descriptor record as the
|
|
52
|
+
* `EncryptionDescriptorCache` seam that `@interop/wallet-core/descriptors`
|
|
53
|
+
* acquires through: per-collection get/put over the single stored blob, already
|
|
54
|
+
* scoped to one session's Space by the store it is bound to.
|
|
55
|
+
*
|
|
56
|
+
* The blob is read-modify-written on every put. That is fine at this scale (an
|
|
57
|
+
* app registers a handful of collections) and it is the only shape the existing
|
|
58
|
+
* one-record persistence allows; concurrent puts are serialized through a
|
|
59
|
+
* promise chain so two of them cannot lose one another's entry.
|
|
60
|
+
*
|
|
61
|
+
* @param options {object}
|
|
62
|
+
* @param options.store {SeedStore} the session seed store to persist through
|
|
63
|
+
* @returns {EncryptionDescriptorCache}
|
|
64
|
+
*/
|
|
65
|
+
export declare function createDescriptorCache({ store }: {
|
|
66
|
+
store: SeedStore;
|
|
67
|
+
}): EncryptionDescriptorCache;
|
|
49
68
|
//# sourceMappingURL=seedStore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seedStore.d.ts","sourceRoot":"","sources":["../../src/identity/seedStore.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"seedStore.d.ts","sourceRoot":"","sources":["../../src/identity/seedStore.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAA;AAOjF;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACzC;;OAEG;IACH,QAAQ,IAAI,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAA;IACtC;;OAEG;IACH,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC1C;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAA;IACrC;;;;OAIG;IACH,eAAe,CAAC,WAAW,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACpD;;OAEG;IACH,eAAe,IAAI,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAA;IAC1C;;OAEG;IACH,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CAChC;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,EAC9B,MAAM,EACN,GAAe,EAChB,EAAE;IACD,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,UAAU,CAAA;CACjB,GAAG,SAAS,CAyEZ;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACN,EAAE;IACD,KAAK,EAAE,SAAS,CAAA;CACjB,GAAG,yBAAyB,CAmC5B"}
|
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Seed persistence: the master seed at rest in the app's own IndexedDB, so a
|
|
6
|
-
* reload restores the session with zero wallet popups. A raw-IndexedDB pattern
|
|
7
|
-
* (one db, one object store, fixed record keys, `db.close()` after every
|
|
8
|
-
* operation). Wiped on logout.
|
|
9
|
-
*
|
|
10
|
-
* `createSeedStore` binds a database name (each app supplies its own) and an
|
|
11
|
-
* optional `idb` factory (injectable for tests, e.g. fake-indexeddb), returning
|
|
12
|
-
* the five bound operations.
|
|
13
|
-
*/
|
|
14
1
|
const SESSION_STORE = 'session';
|
|
15
2
|
const SEED_RECORD = 'seed';
|
|
16
3
|
const SESSION_RECORD = 'record';
|
|
@@ -80,4 +67,44 @@ export function createSeedStore({ dbName, idb = indexedDB }) {
|
|
|
80
67
|
}
|
|
81
68
|
};
|
|
82
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* Presents a {@link SeedStore}'s persisted descriptor record as the
|
|
72
|
+
* `EncryptionDescriptorCache` seam that `@interop/wallet-core/descriptors`
|
|
73
|
+
* acquires through: per-collection get/put over the single stored blob, already
|
|
74
|
+
* scoped to one session's Space by the store it is bound to.
|
|
75
|
+
*
|
|
76
|
+
* The blob is read-modify-written on every put. That is fine at this scale (an
|
|
77
|
+
* app registers a handful of collections) and it is the only shape the existing
|
|
78
|
+
* one-record persistence allows; concurrent puts are serialized through a
|
|
79
|
+
* promise chain so two of them cannot lose one another's entry.
|
|
80
|
+
*
|
|
81
|
+
* @param options {object}
|
|
82
|
+
* @param options.store {SeedStore} the session seed store to persist through
|
|
83
|
+
* @returns {EncryptionDescriptorCache}
|
|
84
|
+
*/
|
|
85
|
+
export function createDescriptorCache({ store }) {
|
|
86
|
+
async function readAll() {
|
|
87
|
+
const stored = await store.loadDescriptors();
|
|
88
|
+
if (stored && typeof stored === 'object' && !Array.isArray(stored)) {
|
|
89
|
+
return { ...stored };
|
|
90
|
+
}
|
|
91
|
+
return {};
|
|
92
|
+
}
|
|
93
|
+
// Serializes the read-modify-write of the single stored record.
|
|
94
|
+
let writes = Promise.resolve();
|
|
95
|
+
return {
|
|
96
|
+
async readDescriptor({ collectionId }) {
|
|
97
|
+
return (await readAll())[collectionId];
|
|
98
|
+
},
|
|
99
|
+
writeDescriptor({ collectionId, descriptor }) {
|
|
100
|
+
const next = writes.then(async () => {
|
|
101
|
+
const descriptors = await readAll();
|
|
102
|
+
descriptors[collectionId] = descriptor;
|
|
103
|
+
await store.saveDescriptors(descriptors);
|
|
104
|
+
});
|
|
105
|
+
writes = next.then(() => { }, () => { });
|
|
106
|
+
return next;
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
}
|
|
83
110
|
//# sourceMappingURL=seedStore.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seedStore.js","sourceRoot":"","sources":["../../src/identity/seedStore.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"seedStore.js","sourceRoot":"","sources":["../../src/identity/seedStore.ts"],"names":[],"mappings":"AAqBA,MAAM,aAAa,GAAG,SAAS,CAAA;AAC/B,MAAM,WAAW,GAAG,MAAM,CAAA;AAC1B,MAAM,cAAc,GAAG,QAAQ,CAAA;AAC/B,MAAM,kBAAkB,GAAG,aAAa,CAAA;AAsCxC;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAAC,EAC9B,MAAM,EACN,GAAG,GAAG,SAAS,EAIhB;IACC,KAAK,UAAU,aAAa;QAC1B,OAAO,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC3C,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;YACnC,OAAO,CAAC,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ED
|
@@ -14,25 +14,24 @@ export { DEFAULT_DB_NAME, DEFAULT_STORAGE_KEY_PREFIX, DEFAULT_SYNC_POLL_MS, DEFA
|
|
|
14
14
|
export { parseInvocationTarget, parseGrants, type ParsedGrants } from './grants.js';
|
|
15
15
|
export { deriveIdentity, DEFAULT_IDENTITY_HANDLE, type IdentityAgents } from './identity/agents.js';
|
|
16
16
|
export { createDocumentLoader, type DocumentLoader } from './identity/documentLoader.js';
|
|
17
|
-
export { createSeedStore, type SeedStore } from './identity/seedStore.js';
|
|
17
|
+
export { createSeedStore, createDescriptorCache, type SeedStore } from './identity/seedStore.js';
|
|
18
18
|
export { APP_KEY_CREDENTIAL_TYPE, issueSeedCredential, parseSeedCredential, findSeedCredential, bytesToBase64url, base64urlToBytes, type SeedCredentialConfig, type ParsedSeedCredential } from './identity/seedCredential.js';
|
|
19
|
-
export { initAppSession } from './identity/initAppSession.js';
|
|
20
19
|
export { persistAppSession, restoreAppSession, clearAppSession, isExpired, isNearExpiry, earliestExpiry, type AppSessionRecord, type RestoredAppSession } from './identity/appSession.js';
|
|
21
20
|
export { DEFAULT_MEDIATOR_BASE, loadChapi, chapiGet } from './auth/chapi.js';
|
|
22
21
|
export { RW_ACTIONS, SHARED_ACTIONS, newChallenge, buildAppConnectVpr, type GrantRequestCollection } from './auth/loginRequest.js';
|
|
23
22
|
export { verifyLoginPresentation, grantsOf, checkGrants, type CheckedGrants } from './auth/verifyResponse.js';
|
|
24
23
|
export { loginWithWallet, requestGrants, LoginCancelledError, WalletUnsupportedError, type LoginConfig, type LoginPhase, type LoginOutcome } from './auth/loginFlow.js';
|
|
25
|
-
export type {
|
|
24
|
+
export type { IVPRDetails, IVPRQuery, IDIDAuthenticationQuery, IAppConnectQuery, IAppConnectCapabilityQuery, ICapabilityQueryDetail, IVerifiableCredential, IVerifiablePresentation, IZcap } from './auth/walletRequestTypes.js';
|
|
26
25
|
export * from './sync/index.js';
|
|
27
26
|
export { LocalStore } from './storage/localStore.js';
|
|
28
27
|
export { setLocalStore, requireStore, hasStore, clearLocalStore, setRemoteStore, requireRemoteStore, hasRemoteStore, clearRemoteStore, getClientId } from './storage/storageManager.js';
|
|
29
28
|
export { createEntityStore, type EntityStore } from './storage/entityStore.js';
|
|
30
|
-
export { WasRemoteStore, type DeclarationResult, type EqualityQueryPage } from './storage/wasRemoteStore.js';
|
|
29
|
+
export { WasRemoteStore, remoteDescriptorSource, type DeclarationResult, type EqualityQueryPage } from './storage/wasRemoteStore.js';
|
|
31
30
|
export { SharedCollectionReader, SharedCollectionUnavailableError, SHARED_CHANGES_PAGE_SIZE, type SharedResource } from './storage/sharedCollectionReader.js';
|
|
32
31
|
export { publicUrlFor } from './storage/publicUrl.js';
|
|
33
32
|
export { useSyncStatusStore, deriveSyncRollup, type SyncStatus } from './storage/syncStatusStore.js';
|
|
34
33
|
export { hydrateAll, clearAllEntityStores, patchFromChange, scheduleRehydrate, cancelScheduledRehydrates } from './storage/rehydrate.js';
|
|
35
|
-
export { isAuthError, SyncController
|
|
34
|
+
export { isAuthError, SyncController } from './storage/syncController.js';
|
|
36
35
|
export { startWasSync, type WasSyncBootstrap } from './storage/wasSync.js';
|
|
37
36
|
export { createAuthStore, type SessionStatus, type AuthState, type WasAuthStore } from './session/index.js';
|
|
38
37
|
export { WasSessionProvider, WasSessionContext, useAuthStore, useSession, useLogin, useLogout, useClearData, useHasLocalData, useReconnect, useSharedCollection, useSyncStatus, type SyncRollup, defineDocumentApp, DOCUMENT_COLLECTION_KEY, DOCUMENT_EXPORT_FORMAT, type DocumentApp } from './react/index.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;GAQG;AAGH,OAAO,EACL,eAAe,EACf,0BAA0B,EAC1B,oBAAoB,EACpB,yBAAyB,EACzB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EACzB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EACnB,MAAM,aAAa,CAAA;AAGpB,OAAO,EACL,qBAAqB,EACrB,WAAW,EACX,KAAK,YAAY,EAClB,MAAM,aAAa,CAAA;AAIpB,OAAO,EACL,cAAc,EACd,uBAAuB,EACvB,KAAK,cAAc,EACpB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EACL,oBAAoB,EACpB,KAAK,cAAc,EACpB,MAAM,8BAA8B,CAAA;AACrC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;GAQG;AAGH,OAAO,EACL,eAAe,EACf,0BAA0B,EAC1B,oBAAoB,EACpB,yBAAyB,EACzB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EACzB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EACnB,MAAM,aAAa,CAAA;AAGpB,OAAO,EACL,qBAAqB,EACrB,WAAW,EACX,KAAK,YAAY,EAClB,MAAM,aAAa,CAAA;AAIpB,OAAO,EACL,cAAc,EACd,uBAAuB,EACvB,KAAK,cAAc,EACpB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EACL,oBAAoB,EACpB,KAAK,cAAc,EACpB,MAAM,8BAA8B,CAAA;AACrC,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,KAAK,SAAS,EACf,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,oBAAo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AAwB,EACxB,KAAK,cAAc,EACpB,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,UAAU,EAChB,MAAM,8BAA8B,CAAA;AACrC,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,yBAAyB,EAC1B,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AACzE,OAAO,EAAE,YAAY,EAAE,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAG1E,OAAO,EACL,eAAe,EACf,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,YAAY,EAClB,MAAM,oBAAoB,CAAA;AAG3B,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACb,KAAK,UAAU,EACf,iBAAiB,EACjB,uBAAuB,EACvB,sBAAsB,EACtB,KAAK,WAAW,EACjB,MAAM,kBAAkB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -18,9 +18,8 @@ export { parseInvocationTarget, parseGrants } from './grants.js';
|
|
|
18
18
|
// every encrypted collection is read with.
|
|
19
19
|
export { deriveIdentity, DEFAULT_IDENTITY_HANDLE } from './identity/agents.js';
|
|
20
20
|
export { createDocumentLoader } from './identity/documentLoader.js';
|
|
21
|
-
export { createSeedStore } from './identity/seedStore.js';
|
|
21
|
+
export { createSeedStore, createDescriptorCache } from './identity/seedStore.js';
|
|
22
22
|
export { APP_KEY_CREDENTIAL_TYPE, issueSeedCredential, parseSeedCredential, findSeedCredential, bytesToBase64url, base64urlToBytes } from './identity/seedCredential.js';
|
|
23
|
-
export { initAppSession } from './identity/initAppSession.js';
|
|
24
23
|
export { persistAppSession, restoreAppSession, clearAppSession, isExpired, isNearExpiry, earliestExpiry } from './identity/appSession.js';
|
|
25
24
|
// Auth: CHAPI bridge, VPR construction, response verification, login flow.
|
|
26
25
|
export { DEFAULT_MEDIATOR_BASE, loadChapi, chapiGet } from './auth/chapi.js';
|
|
@@ -35,12 +34,12 @@ export * from './sync/index.js';
|
|
|
35
34
|
export { LocalStore } from './storage/localStore.js';
|
|
36
35
|
export { setLocalStore, requireStore, hasStore, clearLocalStore, setRemoteStore, requireRemoteStore, hasRemoteStore, clearRemoteStore, getClientId } from './storage/storageManager.js';
|
|
37
36
|
export { createEntityStore } from './storage/entityStore.js';
|
|
38
|
-
export { WasRemoteStore } from './storage/wasRemoteStore.js';
|
|
37
|
+
export { WasRemoteStore, remoteDescriptorSource } from './storage/wasRemoteStore.js';
|
|
39
38
|
export { SharedCollectionReader, SharedCollectionUnavailableError, SHARED_CHANGES_PAGE_SIZE } from './storage/sharedCollectionReader.js';
|
|
40
39
|
export { publicUrlFor } from './storage/publicUrl.js';
|
|
41
40
|
export { useSyncStatusStore, deriveSyncRollup } from './storage/syncStatusStore.js';
|
|
42
41
|
export { hydrateAll, clearAllEntityStores, patchFromChange, scheduleRehydrate, cancelScheduledRehydrates } from './storage/rehydrate.js';
|
|
43
|
-
export { isAuthError, SyncController
|
|
42
|
+
export { isAuthError, SyncController } from './storage/syncController.js';
|
|
44
43
|
export { startWasSync } from './storage/wasSync.js';
|
|
45
44
|
// Session lifecycle: the session auth store factory (the four-state machine).
|
|
46
45
|
export { createAuthStore } from './session/index.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;GAQG;AAEH,0BAA0B;AAC1B,OAAO,EACL,eAAe,EACf,0BAA0B,EAC1B,oBAAoB,EACpB,yBAAyB,EACzB,uBAAuB,EACvB,kBAAkB,EAClB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Z,mBAAmB,EACnB,aAAa,EAEb,iBAAiB,EACjB,uBAAuB,EACvB,sBAAsB,EAEvB,MAAM,kBAAkB,CAAA"}
|
package/dist/jsonLd.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Small JSON-LD shape helpers shared by the identity and auth layers (auth
|
|
6
|
+
* already depends on identity, so this sits above both rather than inside
|
|
7
|
+
* either).
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Normalizes a JSON-LD term that may appear as a single value, as an array, or
|
|
11
|
+
* not at all into an array. A missing (or otherwise empty) term becomes the
|
|
12
|
+
* empty array. This is the `type` / `proof` / `allowedAction` idiom, in one
|
|
13
|
+
* place.
|
|
14
|
+
*
|
|
15
|
+
* @param value {unknown} the raw term value
|
|
16
|
+
* @returns {Array}
|
|
17
|
+
*/
|
|
18
|
+
export declare function asArray<T>(value: T | T[] | undefined): T[];
|
|
19
|
+
//# sourceMappingURL=jsonLd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonLd.d.ts","sourceRoot":"","sources":["../src/jsonLd.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;GAIG;AAEH;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,SAAS,GAAG,CAAC,EAAE,CAK1D"}
|
package/dist/jsonLd.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Small JSON-LD shape helpers shared by the identity and auth layers (auth
|
|
6
|
+
* already depends on identity, so this sits above both rather than inside
|
|
7
|
+
* either).
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Normalizes a JSON-LD term that may appear as a single value, as an array, or
|
|
11
|
+
* not at all into an array. A missing (or otherwise empty) term becomes the
|
|
12
|
+
* empty array. This is the `type` / `proof` / `allowedAction` idiom, in one
|
|
13
|
+
* place.
|
|
14
|
+
*
|
|
15
|
+
* @param value {unknown} the raw term value
|
|
16
|
+
* @returns {Array}
|
|
17
|
+
*/
|
|
18
|
+
export function asArray(value) {
|
|
19
|
+
if (Array.isArray(value)) {
|
|
20
|
+
return value;
|
|
21
|
+
}
|
|
22
|
+
return value ? [value] : [];
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=jsonLd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonLd.js","sourceRoot":"","sources":["../src/jsonLd.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;GAIG;AAEH;;;;;;;;GAQG;AACH,MAAM,UAAU,OAAO,CAAI,KAA0B;IACnD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAA;IACd,CAAC;IACD,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;AAC7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdoptDialog.d.ts","sourceRoot":"","sources":["../../src/mui/AdoptDialog.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AdoptDialog.d.ts","sourceRoot":"","sources":["../../src/mui/AdoptDialog.tsx"],"names":[],"mappings":"AAgBA;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,OAAO,EACR,EAAE;IACD,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB,+BAsCA"}
|
package/dist/mui/AdoptDialog.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/*!
|
|
3
3
|
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
4
4
|
*/
|
|
@@ -11,7 +11,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
11
11
|
* this device and returns after a logout. Dismissing the dialog (backdrop /
|
|
12
12
|
* escape / Cancel) runs no login at all.
|
|
13
13
|
*/
|
|
14
|
-
import { Button
|
|
14
|
+
import { Button } from '@mui/material';
|
|
15
|
+
import { ConfirmDialog } from './ConfirmDialog.js';
|
|
15
16
|
import { useLogin } from '../react/hooks.js';
|
|
16
17
|
/**
|
|
17
18
|
* @param props {object}
|
|
@@ -26,6 +27,9 @@ export function AdoptDialog({ open, onClose }) {
|
|
|
26
27
|
onClose();
|
|
27
28
|
void login({ adopt });
|
|
28
29
|
}
|
|
29
|
-
return (
|
|
30
|
+
return (_jsx(ConfirmDialog, { testId: "adopt", open: open, onClose: onClose, title: "Bring your data with you?", body: 'You created data on this device before logging in. Bring it into ' +
|
|
31
|
+
'your own storage so it syncs everywhere you log in, or set it ' +
|
|
32
|
+
'aside -- it then stays on this device only and comes back if you ' +
|
|
33
|
+
'log out.', actions: _jsxs(_Fragment, { children: [_jsx(Button, { onClick: () => handleLogin('leave'), "data-testid": "adopt-leave", children: "Set it aside" }), _jsx(Button, { onClick: () => handleLogin('merge'), "data-testid": "adopt-merge", children: "Bring my data" })] }) }));
|
|
30
34
|
}
|
|
31
35
|
//# sourceMappingURL=AdoptDialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdoptDialog.js","sourceRoot":"","sources":["../../src/mui/AdoptDialog.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH;;;;;;;;GAQG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"AdoptDialog.js","sourceRoot":"","sources":["../../src/mui/AdoptDialog.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH;;;;;;;;GAQG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE5C;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,EAC1B,IAAI,EACJ,OAAO,EAIR;IACC,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAA;IAE5B,SAAS,WAAW,CAAC,KAAwB;QAC3C,OAAO,EAAE,CAAA;QACT,KAAK,KAAK,CAAC,EAAE,KAAK,EAAE,CAAC,CAAA;IACvB,CAAC;IAED,OAAO,CACL,KAAC,aAAa,IACZ,MAAM,EAAC,OAAO,EACd,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,KAAK,EAAC,2BAA2B,EACjC,IAAI,EACF,mEAAmE;YACnE,gEAAgE;YAChE,mEAAmE;YACnE,UAAU,EAEZ,OAAO,EACL,8BACE,KAAC,MAAM,IACL,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,iBACvB,aAAa,6BAGlB,EACT,KAAC,MAAM,IACL,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,iBACvB,aAAa,8BAGlB,IACR,GAEL,CACH,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClearDataDialog.d.ts","sourceRoot":"","sources":["../../src/mui/ClearDataDialog.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ClearDataDialog.d.ts","sourceRoot":"","sources":["../../src/mui/ClearDataDialog.tsx"],"names":[],"mappings":"AAiBA;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,OAAO,EACR,EAAE;IACD,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB,+BAsCA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
/*!
|
|
3
3
|
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
4
4
|
*/
|
|
@@ -12,7 +12,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
12
12
|
* threatening total loss. Dismissing the dialog (backdrop / escape / Cancel)
|
|
13
13
|
* leaves the data untouched.
|
|
14
14
|
*/
|
|
15
|
-
import { Button
|
|
15
|
+
import { Button } from '@mui/material';
|
|
16
|
+
import { ConfirmDialog } from './ConfirmDialog.js';
|
|
16
17
|
import { useClearData, useSession } from '../react/hooks.js';
|
|
17
18
|
/**
|
|
18
19
|
* @param props {object}
|
|
@@ -29,14 +30,14 @@ export function ClearDataDialog({ open, onClose }) {
|
|
|
29
30
|
await clearData();
|
|
30
31
|
onClose();
|
|
31
32
|
}
|
|
32
|
-
return (
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
return (_jsx(ConfirmDialog, { testId: "clear-data", open: open, onClose: onClose, title: "Clear data", body: connected
|
|
34
|
+
? 'This erases the copy stored on this device and disconnects it ' +
|
|
35
|
+
'from your Web Space. The data already saved to your Web Space ' +
|
|
36
|
+
'stays there -- reconnect with your wallet to bring it back ' +
|
|
37
|
+
'onto this device.'
|
|
38
|
+
: 'This permanently erases everything stored on this device and ' +
|
|
39
|
+
'starts you over fresh. Your data lives only on this device, ' +
|
|
40
|
+
'so once cleared it cannot be recovered -- export a copy first ' +
|
|
41
|
+
'if you want to keep it.', actions: _jsx(Button, { color: "error", onClick: () => void handleClear(), "data-testid": "clear-data-confirm", children: "Clear data" }) }));
|
|
41
42
|
}
|
|
42
43
|
//# sourceMappingURL=ClearDataDialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClearDataDialog.js","sourceRoot":"","sources":["../../src/mui/ClearDataDialog.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH;;;;;;;;;GASG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"ClearDataDialog.js","sourceRoot":"","sources":["../../src/mui/ClearDataDialog.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH;;;;;;;;;GASG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAE5D;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,EAC9B,IAAI,EACJ,OAAO,EAIR;IACC,MAAM,SAAS,GAAG,YAAY,EAAE,CAAA;IAChC,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,EAAE,CAAA;IAC/B,MAAM,SAAS,GAAG,MAAM,KAAK,WAAW,IAAI,MAAM,KAAK,WAAW,CAAA;IAElE,KAAK,UAAU,WAAW;QACxB,MAAM,SAAS,EAAE,CAAA;QACjB,OAAO,EAAE,CAAA;IACX,CAAC;IAED,OAAO,CACL,KAAC,aAAa,IACZ,MAAM,EAAC,YAAY,EACnB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,KAAK,EAAC,YAAY,EAClB,IAAI,EACF,SAAS;YACP,CAAC,CAAC,gEAAgE;gBAChE,gEAAgE;gBAChE,6DAA6D;gBAC7D,mBAAmB;YACrB,CAAC,CAAC,+DAA+D;gBAC/D,8DAA8D;gBAC9D,gEAAgE;gBAChE,yBAAyB,EAE/B,OAAO,EACL,KAAC,MAAM,IACL,KAAK,EAAC,OAAO,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,WAAW,EAAE,iBACrB,oBAAoB,2BAGzB,GAEX,CACH,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The confirmation-dialog frame the library's three dialogs (adopt, clear data,
|
|
6
|
+
* logout) share: a MUI `Dialog` carrying a `<testId>-dialog` test id, a title, a
|
|
7
|
+
* one-paragraph body, and an actions row that always opens with a Cancel button
|
|
8
|
+
* (`<testId>-cancel`) wired to `onClose`. Each dialog supplies its own confirm
|
|
9
|
+
* buttons after it.
|
|
10
|
+
*
|
|
11
|
+
* Internal to `src/mui/` -- deliberately NOT exported from the `./mui` entry
|
|
12
|
+
* point, so it stays a refactoring detail rather than public API.
|
|
13
|
+
*/
|
|
14
|
+
import type { ReactNode } from 'react';
|
|
15
|
+
/**
|
|
16
|
+
* @param props {object}
|
|
17
|
+
* @param props.testId {string} test-id stem: the dialog gets
|
|
18
|
+
* `<testId>-dialog`, the Cancel button `<testId>-cancel`
|
|
19
|
+
* @param props.title {string} the dialog title
|
|
20
|
+
* @param props.body {ReactNode} the body copy, rendered in a
|
|
21
|
+
* `DialogContentText`
|
|
22
|
+
* @param props.actions {ReactNode} the confirm buttons, rendered after Cancel
|
|
23
|
+
* @param props.open {boolean} whether the dialog is shown
|
|
24
|
+
* @param props.onClose {() => void} dismiss/cancel handler
|
|
25
|
+
* @returns {ReactNode}
|
|
26
|
+
*/
|
|
27
|
+
export declare function ConfirmDialog({ testId, title, body, actions, open, onClose }: {
|
|
28
|
+
testId: string;
|
|
29
|
+
title: string;
|
|
30
|
+
body: ReactNode;
|
|
31
|
+
actions: ReactNode;
|
|
32
|
+
open: boolean;
|
|
33
|
+
onClose: () => void;
|
|
34
|
+
}): import("react").JSX.Element;
|
|
35
|
+
//# sourceMappingURL=ConfirmDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfirmDialog.d.ts","sourceRoot":"","sources":["../../src/mui/ConfirmDialog.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAUtC;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,KAAK,EACL,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,OAAO,EACR,EAAE;IACD,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,SAAS,CAAA;IACf,OAAO,EAAE,SAAS,CAAA;IAClB,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB,+BAeA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle } from '@mui/material';
|
|
3
|
+
/**
|
|
4
|
+
* @param props {object}
|
|
5
|
+
* @param props.testId {string} test-id stem: the dialog gets
|
|
6
|
+
* `<testId>-dialog`, the Cancel button `<testId>-cancel`
|
|
7
|
+
* @param props.title {string} the dialog title
|
|
8
|
+
* @param props.body {ReactNode} the body copy, rendered in a
|
|
9
|
+
* `DialogContentText`
|
|
10
|
+
* @param props.actions {ReactNode} the confirm buttons, rendered after Cancel
|
|
11
|
+
* @param props.open {boolean} whether the dialog is shown
|
|
12
|
+
* @param props.onClose {() => void} dismiss/cancel handler
|
|
13
|
+
* @returns {ReactNode}
|
|
14
|
+
*/
|
|
15
|
+
export function ConfirmDialog({ testId, title, body, actions, open, onClose }) {
|
|
16
|
+
return (_jsxs(Dialog, { open: open, onClose: onClose, "data-testid": `${testId}-dialog`, children: [_jsx(DialogTitle, { children: title }), _jsx(DialogContent, { children: _jsx(DialogContentText, { children: body }) }), _jsxs(DialogActions, { children: [_jsx(Button, { onClick: onClose, "data-testid": `${testId}-cancel`, children: "Cancel" }), actions] })] }));
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=ConfirmDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfirmDialog.js","sourceRoot":"","sources":["../../src/mui/ConfirmDialog.tsx"],"names":[],"mappings":";AAcA,OAAO,EACL,MAAM,EACN,MAAM,EACN,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,WAAW,EACZ,MAAM,eAAe,CAAA;AAEtB;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,aAAa,CAAC,EAC5B,MAAM,EACN,KAAK,EACL,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,OAAO,EAQR;IACC,OAAO,CACL,MAAC,MAAM,IAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,iBAAe,GAAG,MAAM,SAAS,aACnE,KAAC,WAAW,cAAE,KAAK,GAAe,EAClC,KAAC,aAAa,cACZ,KAAC,iBAAiB,cAAE,IAAI,GAAqB,GAC/B,EAChB,MAAC,aAAa,eACZ,KAAC,MAAM,IAAC,OAAO,EAAE,OAAO,iBAAe,GAAG,MAAM,SAAS,uBAEhD,EACR,OAAO,IACM,IACT,CACV,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogoutDialog.d.ts","sourceRoot":"","sources":["../../src/mui/LogoutDialog.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LogoutDialog.d.ts","sourceRoot":"","sources":["../../src/mui/LogoutDialog.tsx"],"names":[],"mappings":"AAeA;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,OAAO,EACR,EAAE;IACD,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB,+BAuCA"}
|
package/dist/mui/LogoutDialog.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/*!
|
|
3
3
|
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
4
4
|
*/
|
|
@@ -10,7 +10,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
10
10
|
* Dismissing the dialog (backdrop / escape / Cancel) cancels logout entirely; no
|
|
11
11
|
* action runs and the session stays connected.
|
|
12
12
|
*/
|
|
13
|
-
import { Button
|
|
13
|
+
import { Button } from '@mui/material';
|
|
14
|
+
import { ConfirmDialog } from './ConfirmDialog.js';
|
|
14
15
|
import { useLogout } from '../react/hooks.js';
|
|
15
16
|
/**
|
|
16
17
|
* @param props {object}
|
|
@@ -25,6 +26,9 @@ export function LogoutDialog({ open, onClose }) {
|
|
|
25
26
|
await logout({ wipe });
|
|
26
27
|
onClose();
|
|
27
28
|
}
|
|
28
|
-
return (
|
|
29
|
+
return (_jsx(ConfirmDialog, { testId: "logout", open: open, onClose: onClose, title: "Log out", body: 'Keep your data on this device for next time, or erase it now. ' +
|
|
30
|
+
'Erasing removes the local copy from this device only -- data ' +
|
|
31
|
+
'already synced to your storage stays there and returns when you ' +
|
|
32
|
+
'log back in.', actions: _jsxs(_Fragment, { children: [_jsx(Button, { onClick: () => void handleLogout(false), "data-testid": "logout-keep", children: "Log out, keep data" }), _jsx(Button, { color: "error", onClick: () => void handleLogout(true), "data-testid": "logout-wipe", children: "Log out, erase data" })] }) }));
|
|
29
33
|
}
|
|
30
34
|
//# sourceMappingURL=LogoutDialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogoutDialog.js","sourceRoot":"","sources":["../../src/mui/LogoutDialog.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH;;;;;;;GAOG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"LogoutDialog.js","sourceRoot":"","sources":["../../src/mui/LogoutDialog.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH;;;;;;;GAOG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAE7C;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,EAC3B,IAAI,EACJ,OAAO,EAIR;IACC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAE1B,KAAK,UAAU,YAAY,CAAC,IAAa;QACvC,MAAM,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAA;QACtB,OAAO,EAAE,CAAA;IACX,CAAC;IAED,OAAO,CACL,KAAC,aAAa,IACZ,MAAM,EAAC,QAAQ,EACf,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,KAAK,EAAC,SAAS,EACf,IAAI,EACF,gEAAgE;YAChE,+DAA+D;YAC/D,kEAAkE;YAClE,cAAc,EAEhB,OAAO,EACL,8BACE,KAAC,MAAM,IACL,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,YAAY,CAAC,KAAK,CAAC,iBAC3B,aAAa,mCAGlB,EACT,KAAC,MAAM,IACL,KAAK,EAAC,OAAO,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,YAAY,CAAC,IAAI,CAAC,iBAC1B,aAAa,oCAGlB,IACR,GAEL,CACH,CAAA;AACH,CAAC"}
|
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The tier-1 "one sandbox document" facade: `defineDocumentApp` builds the
|
|
6
|
+
* whole was-react wiring (config, store registry, entity store) for an app
|
|
7
|
+
* whose entire model is a single key-value document -- an Excalidraw-style
|
|
8
|
+
* editor, a browser-game save file -- and returns a typed `useAppDocument` hook
|
|
9
|
+
* over it. The app never sees `createEntityStore`, grants parsing, or sync
|
|
10
|
+
* internals: it renders `doc`, calls `update`, and optionally offers file
|
|
11
|
+
* export/import and a "Save to Web Spaces" connect button.
|
|
12
|
+
*
|
|
13
|
+
* The facade is a degenerate entity store: one collection (the app-named
|
|
14
|
+
* sandbox collection) holding one logical document under a fixed id. The
|
|
15
|
+
* stored row wraps the app's data (`{ id, updatedAt, clientId, data }`) so app
|
|
16
|
+
* fields can never collide with the LWW fields the sync layer requires, and
|
|
17
|
+
* the facade stamps `updatedAt`/`clientId` on every write itself. Hydration
|
|
18
|
+
* goes through `LocalStore.hydrateSingleton`, which LWW-reconciles the
|
|
19
|
+
* duplicate envelope rows two devices can mint for the same logical document.
|
|
20
|
+
*
|
|
21
|
+
* `connect()` is plain `login()`: the config registers exactly one collection,
|
|
22
|
+
* so the wallet consent screen shows a single legible request, and the default
|
|
23
|
+
* adopt-on-login merge carries the local document into the granted collection.
|
|
24
|
+
*
|
|
25
|
+
* Multi-document ("slot") variants are deliberately not supported yet:
|
|
26
|
+
* `hydrateSingleton` reconciles ALL rows of the collection down to one winner,
|
|
27
|
+
* so named slots need a grouped per-id reconciler first. An app that has
|
|
28
|
+
* outgrown one document should move to `createEntityStore`.
|
|
29
|
+
*/
|
|
1
30
|
import type { StoreRegistry, WasAppConfig, WasExpiryConfig, WasSyncConfig } from '../config.js';
|
|
2
31
|
import type { SeedCredentialConfig } from '../identity/seedCredential.js';
|
|
3
32
|
import type { SessionStatus } from '../session/authStore.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentApp.d.ts","sourceRoot":"","sources":["../../src/react/documentApp.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"documentApp.d.ts","sourceRoot":"","sources":["../../src/react/documentApp.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACZ,eAAe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G,IAAI,CAAA;KACrB,CAAA;CACF;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,EAAE,EAClD,OAAO,EACP,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,MAAM,EACN,gBAAgB,EAChB,IAAI,EACJ,MAAM,EACP,EAAE;IACD,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,CAAC,CAAA;KAAE,CAAA;IAC9C,UAAU,EAAE,oBAAoB,CAAA;IAChC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,IAAI,CAAC,EAAE,aAAa,CAAA;IACpB,MAAM,CAAC,EAAE,eAAe,CAAA;CACzB,GAAG,WAAW,CAAC,CAAC,CAAC,CAiIjB"}
|
|
@@ -1,36 +1,6 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* The tier-1 "one sandbox document" facade: `defineDocumentApp` builds the
|
|
6
|
-
* whole was-react wiring (config, store registry, entity store) for an app
|
|
7
|
-
* whose entire model is a single key-value document -- an Excalidraw-style
|
|
8
|
-
* editor, a browser-game save file -- and returns a typed `useAppDocument` hook
|
|
9
|
-
* over it. The app never sees `createEntityStore`, grants parsing, or sync
|
|
10
|
-
* internals: it renders `doc`, calls `update`, and optionally offers file
|
|
11
|
-
* export/import and a "Save to Web Spaces" connect button.
|
|
12
|
-
*
|
|
13
|
-
* The facade is a degenerate entity store: one collection (the app-named
|
|
14
|
-
* sandbox collection) holding one logical document under a fixed id. The
|
|
15
|
-
* stored row wraps the app's data (`{ id, updatedAt, clientId, data }`) so app
|
|
16
|
-
* fields can never collide with the LWW fields the sync layer requires, and
|
|
17
|
-
* the facade stamps `updatedAt`/`clientId` on every write itself. Hydration
|
|
18
|
-
* goes through `LocalStore.hydrateSingleton`, which LWW-reconciles the
|
|
19
|
-
* duplicate envelope rows two devices can mint for the same logical document.
|
|
20
|
-
*
|
|
21
|
-
* `connect()` is plain `login()`: the config registers exactly one collection,
|
|
22
|
-
* so the wallet consent screen shows a single legible request, and the default
|
|
23
|
-
* adopt-on-login merge carries the local document into the granted collection.
|
|
24
|
-
*
|
|
25
|
-
* Multi-document ("slot") variants are deliberately not supported yet:
|
|
26
|
-
* `hydrateSingleton` reconciles ALL rows of the collection down to one winner,
|
|
27
|
-
* so named slots need a grouped per-id reconciler first. An app that has
|
|
28
|
-
* outgrown one document should move to `createEntityStore`.
|
|
29
|
-
*/
|
|
30
|
-
import { useStore } from 'zustand';
|
|
31
1
|
import { createEntityStore } from '../storage/entityStore.js';
|
|
32
2
|
import { getClientId, requireStore } from '../storage/storageManager.js';
|
|
33
|
-
import {
|
|
3
|
+
import { useLogin, useLogout, useSyncStatus } from './hooks.js';
|
|
34
4
|
/**
|
|
35
5
|
* The localStore / RxDB collection key the facade's one collection uses.
|
|
36
6
|
*/
|
|
@@ -64,6 +34,11 @@ export const DOCUMENT_EXPORT_FORMAT = 'was-document/v1';
|
|
|
64
34
|
export function defineDocumentApp({ appName, appOrigin, mediatorBase, document, credential, dbName, storageKeyPrefix, sync, expiry }) {
|
|
65
35
|
const { collectionId, initial } = document;
|
|
66
36
|
const docStore = createEntityStore(DOCUMENT_COLLECTION_KEY);
|
|
37
|
+
// Resolved once, under the same prefix the config hands the session layer,
|
|
38
|
+
// so the facade's stamps and the adoption repair share one identity.
|
|
39
|
+
const clientId = getClientId({
|
|
40
|
+
...(storageKeyPrefix !== undefined && { storageKeyPrefix })
|
|
41
|
+
});
|
|
67
42
|
const config = {
|
|
68
43
|
appName,
|
|
69
44
|
appOrigin,
|
|
@@ -103,9 +78,7 @@ export function defineDocumentApp({ appName, appOrigin, mediatorBase, document,
|
|
|
103
78
|
await docStore.getState().upsert({
|
|
104
79
|
id: DOCUMENT_ID,
|
|
105
80
|
updatedAt: new Date().toISOString(),
|
|
106
|
-
clientId
|
|
107
|
-
...(storageKeyPrefix !== undefined && { storageKeyPrefix })
|
|
108
|
-
}),
|
|
81
|
+
clientId,
|
|
109
82
|
data
|
|
110
83
|
});
|
|
111
84
|
}
|
|
@@ -154,11 +127,9 @@ export function defineDocumentApp({ appName, appOrigin, mediatorBase, document,
|
|
|
154
127
|
}
|
|
155
128
|
function useAppDocument() {
|
|
156
129
|
const held = docStore(state => state.byId.get(DOCUMENT_ID));
|
|
157
|
-
const {
|
|
130
|
+
const { login, authenticating, status, error } = useLogin();
|
|
158
131
|
const { state: syncState } = useSyncStatus();
|
|
159
|
-
const
|
|
160
|
-
const login = useStore(store, state => state.login);
|
|
161
|
-
const logout = useStore(store, state => state.logout);
|
|
132
|
+
const logout = useLogout();
|
|
162
133
|
// Hydration completes before the machine leaves `boot`, so "left boot" is
|
|
163
134
|
// exactly "the stored document (or its absence) is now known".
|
|
164
135
|
const doc = status === 'boot' ? undefined : (held?.data ?? initial);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentApp.js","sourceRoot":"","sources":["../../src/react/documentApp.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"documentApp.js","sourceRoot":"","sources":["../../src/react/documentApp.ts"],"names":[],"mappings":"AAqCA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAExE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/D;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,UAAU,CAAA;AAEjD;;GAEG;AACH,MAAM,WAAW,GAAG,MAAM,CAAA;AAE1B;;GAEG;AACH,MAAM,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