@interop/was-react 0.8.2 → 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 +55 -44
- package/dist/auth/chapi.d.ts.map +1 -1
- package/dist/auth/chapi.js +16 -5
- package/dist/auth/chapi.js.map +1 -1
- package/dist/auth/loginFlow.d.ts.map +1 -1
- package/dist/auth/loginFlow.js +55 -49
- package/dist/auth/loginFlow.js.map +1 -1
- package/dist/auth/verifyResponse.d.ts.map +1 -1
- package/dist/auth/verifyResponse.js +27 -10
- 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 +203 -112
- 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 +146 -77
- package/dist/storage/localStore.js.map +1 -1
- package/dist/storage/rehydrate.d.ts.map +1 -1
- package/dist/storage/rehydrate.js +20 -4
- package/dist/storage/rehydrate.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 -64
- 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 +48 -37
- 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 -9
- package/dist/sync/changesQuery.js.map +1 -1
- package/dist/sync/docCipher.d.ts +23 -10
- 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 -37
- 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 +27 -18
- package/dist/sync/lww.d.ts.map +1 -1
- package/dist/sync/lww.js +35 -8
- package/dist/sync/lww.js.map +1 -1
- package/dist/sync/lwwConflictHandler.d.ts +15 -14
- package/dist/sync/lwwConflictHandler.d.ts.map +1 -1
- package/dist/sync/lwwConflictHandler.js +37 -26
- package/dist/sync/lwwConflictHandler.js.map +1 -1
- package/dist/sync/pushWrites.d.ts +9 -9
- package/dist/sync/pushWrites.d.ts.map +1 -1
- package/dist/sync/pushWrites.js +102 -68
- package/dist/sync/pushWrites.js.map +1 -1
- package/dist/sync/syncedDocSchema.d.ts.map +1 -1
- package/dist/sync/syncedDocSchema.js +3 -0
- package/dist/sync/syncedDocSchema.js.map +1 -1
- package/dist/sync/types.d.ts +115 -15
- 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 +20 -36
- package/dist/sync/wasSyncPort.js.map +1 -1
- package/package.json +6 -6
- 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
package/dist/sync/wasSyncPort.js
CHANGED
|
@@ -24,21 +24,9 @@
|
|
|
24
24
|
* encrypted fork here.
|
|
25
25
|
*/
|
|
26
26
|
import { readEtag, writeHeaders } from '@interop/was-client';
|
|
27
|
+
import { errorStatus, parseEtag } from '@interop/was-client/sync';
|
|
28
|
+
import { collectionPath } from '../grants.js';
|
|
27
29
|
import { WasSyncAuthError, WasSyncConflictError } from './types.js';
|
|
28
|
-
/**
|
|
29
|
-
* Extracts an HTTP status from a raw ky/ezcap error. `was.request()` rejects on
|
|
30
|
-
* any non-2xx with `err.status` set (see `@interop/http-client`'s error
|
|
31
|
-
* normaliser); this reads it defensively from either location. Shared with the
|
|
32
|
-
* remote store's descriptor PUT and the dev-grant provisioner, which need the raw
|
|
33
|
-
* status for diagnostics rather than the mapped sync error.
|
|
34
|
-
*
|
|
35
|
-
* @param err {unknown}
|
|
36
|
-
* @returns {number | undefined}
|
|
37
|
-
*/
|
|
38
|
-
export function errorStatus(err) {
|
|
39
|
-
return (err.status ??
|
|
40
|
-
err.response?.status);
|
|
41
|
-
}
|
|
42
30
|
/**
|
|
43
31
|
* Normalizes an unknown caught error into a display string: the `Error`'s
|
|
44
32
|
* `message` when it is one, else its `String(...)` coercion. Shared by the
|
|
@@ -79,21 +67,6 @@ function toPortError(err) {
|
|
|
79
67
|
}
|
|
80
68
|
return err;
|
|
81
69
|
}
|
|
82
|
-
/**
|
|
83
|
-
* Parses a quoted strong ETag (`"3"`, as read by `readEtag`) into its numeric
|
|
84
|
-
* revision, or `undefined` when the header was absent (the resource has no such
|
|
85
|
-
* revision yet).
|
|
86
|
-
*
|
|
87
|
-
* @param etag {string | undefined}
|
|
88
|
-
* @returns {number | undefined}
|
|
89
|
-
*/
|
|
90
|
-
function parseEtag(etag) {
|
|
91
|
-
if (etag === undefined) {
|
|
92
|
-
return undefined;
|
|
93
|
-
}
|
|
94
|
-
const revision = Number(etag.replace(/"/g, ''));
|
|
95
|
-
return Number.isFinite(revision) ? revision : undefined;
|
|
96
|
-
}
|
|
97
70
|
/**
|
|
98
71
|
* Builds a `WasSyncPort` bound to a single Space + Collection on the remote WAS
|
|
99
72
|
* server, backed by the session's signed `WasClient`.
|
|
@@ -108,8 +81,8 @@ function parseEtag(etag) {
|
|
|
108
81
|
* @returns {WasSyncBasePort}
|
|
109
82
|
*/
|
|
110
83
|
export function createWasSyncPort({ was, spaceId, collectionId, capability }) {
|
|
111
|
-
const
|
|
112
|
-
const resourcePath = (id) => `${
|
|
84
|
+
const basePath = collectionPath({ spaceId, collectionId });
|
|
85
|
+
const resourcePath = (id) => `${basePath}/${encodeURIComponent(id)}`;
|
|
113
86
|
/**
|
|
114
87
|
* Runs a conditional write, mapping the server's `412 precondition-failed`
|
|
115
88
|
* into the core's `WasSyncConflictError` and a `401` / `403` into
|
|
@@ -125,7 +98,9 @@ export function createWasSyncPort({ was, spaceId, collectionId, capability }) {
|
|
|
125
98
|
run) => {
|
|
126
99
|
try {
|
|
127
100
|
const response = await run();
|
|
128
|
-
|
|
101
|
+
// `readEtag` reports an absent header as `undefined`; `parseEtag` reads
|
|
102
|
+
// the `null` spelling of the same thing.
|
|
103
|
+
return parseEtag(readEtag(response) ?? null);
|
|
129
104
|
}
|
|
130
105
|
catch (err) {
|
|
131
106
|
throw toPortError(err);
|
|
@@ -136,7 +111,7 @@ export function createWasSyncPort({ was, spaceId, collectionId, capability }) {
|
|
|
136
111
|
try {
|
|
137
112
|
const response = await was.request({
|
|
138
113
|
capability,
|
|
139
|
-
path: `${
|
|
114
|
+
path: `${basePath}/query`,
|
|
140
115
|
method: 'POST',
|
|
141
116
|
json: {
|
|
142
117
|
profile: 'changes',
|
|
@@ -153,13 +128,19 @@ export function createWasSyncPort({ was, spaceId, collectionId, capability }) {
|
|
|
153
128
|
throw toPortError(err);
|
|
154
129
|
}
|
|
155
130
|
},
|
|
156
|
-
async putContent({ id, data, ifMatch, ifNoneMatch }) {
|
|
131
|
+
async putContent({ id, data, ifMatch, ifNoneMatch, epoch }) {
|
|
157
132
|
return conditionalWrite(() => was.request({
|
|
158
133
|
capability,
|
|
159
134
|
path: resourcePath(id),
|
|
160
135
|
method: 'PUT',
|
|
161
136
|
json: data,
|
|
162
|
-
|
|
137
|
+
// `epoch` rides as the `WAS-Key-Epoch` header so the server's stamp
|
|
138
|
+
// stays in step with the envelope (an absent epoch clears any prior
|
|
139
|
+
// stamp, per the `key-epochs` feature).
|
|
140
|
+
headers: writeHeaders({
|
|
141
|
+
precondition: { ifMatch, ifNoneMatch },
|
|
142
|
+
epoch
|
|
143
|
+
})
|
|
163
144
|
}));
|
|
164
145
|
},
|
|
165
146
|
async deleteContent({ id, ifMatch }) {
|
|
@@ -193,7 +174,10 @@ export function createWasSyncPort({ was, spaceId, collectionId, capability }) {
|
|
|
193
174
|
capability,
|
|
194
175
|
path: `${resourcePath(id)}/meta`,
|
|
195
176
|
method: 'PUT',
|
|
196
|
-
|
|
177
|
+
// The `/meta` PUT is a full replacement of `custom`: a body with no
|
|
178
|
+
// `custom` member writes the CLEARED state (the server clears every
|
|
179
|
+
// property the body omits), which is how a metadata clear replicates.
|
|
180
|
+
json: custom === undefined ? {} : { custom },
|
|
197
181
|
headers: writeHeaders({ precondition: { ifMatch, ifNoneMatch } })
|
|
198
182
|
}));
|
|
199
183
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wasSyncPort.js","sourceRoot":"","sources":["../../src/sync/wasSyncPort.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAkB,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"wasSyncPort.js","sourceRoot":"","sources":["../../src/sync/wasSyncPort.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAkB,MAAM,qBAAqB,CAAA;AAC5E,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EAIrB,MAAM,YAAY,CAAA;AAEnB;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,GAAY;IACvC,OAAO,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;AACzD,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAS,WAAW,CAAC,GAAY;IAC/B,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,CAAA;IAC/B,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;QACnB,OAAO,IAAI,oBAAoB,EAAE,CAAA;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,CAAC,GAAG,CAAC,KAAK,GAAG,EAAE,CAAC;oBAC7B,OAAO,SAAS,CAAA;gBAClB,CAAC;gBACD,MAAM,GAAG,CAAA;YACX,CAAC;QACH,CAAC;QAED,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE;YAChD,OAAO,gBAAgB,CAAC,GAAG,EAAE,CAC3B,GAAG,CAAC,OAAO,CAAC;gBACV,UAAU;gBACV,IAAI,EAAE,GAAG,YAAY,CAAC,EAAE,CAAC,OAAO;gBAChC,MAAM,EAAE,KAAK;gBACb,oEAAoE;gBACpE,oEAAoE;gBACpE,sEAAsE;gBACtE,IAAI,EAAE,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE;gBAC5C,OAAO,EAAE,YAAY,CAAC,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE,CAAC;aAClE,CAAC,CACH,CAAA;QACH,CAAC;KACF,CAAA;AACH,CAAC"}
|
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.9.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "pnpm run clear && tsc",
|
|
@@ -52,11 +52,10 @@
|
|
|
52
52
|
"@interop/ezcap": "^7.4.1",
|
|
53
53
|
"@interop/security-document-loader": "^9.5.1",
|
|
54
54
|
"@interop/vc": "^11.0.6",
|
|
55
|
-
"@interop/verifier-core": "^3.5.
|
|
56
|
-
"@interop/wallet-core": "^0.
|
|
57
|
-
"@interop/was-client": "^0.
|
|
55
|
+
"@interop/verifier-core": "^3.5.3",
|
|
56
|
+
"@interop/wallet-core": "^0.20.0",
|
|
57
|
+
"@interop/was-client": "^0.27.0",
|
|
58
58
|
"@interop/webkms-client": "^14.7.1",
|
|
59
|
-
"@interop/x25519-key-agreement-key": "^5.2.1",
|
|
60
59
|
"@scure/base": "^2.2.0",
|
|
61
60
|
"byoe-context": "^0.2.0",
|
|
62
61
|
"credential-handler-polyfill": "^4.1.0",
|
|
@@ -85,6 +84,7 @@
|
|
|
85
84
|
"@emotion/react": "^11.14.0",
|
|
86
85
|
"@emotion/styled": "^11.14.1",
|
|
87
86
|
"@eslint/js": "^10.0.1",
|
|
87
|
+
"@interop/x25519-key-agreement-key": "^5.2.1",
|
|
88
88
|
"@mui/icons-material": "^9.0.0",
|
|
89
89
|
"@mui/material": "^9.0.0",
|
|
90
90
|
"@playwright/test": "^1.60.0",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"typescript-eslint": "^8.59.4",
|
|
112
112
|
"vite": "^8.0.14",
|
|
113
113
|
"vitest": "^4.1.7",
|
|
114
|
-
"was-teaching-server": "^0.
|
|
114
|
+
"was-teaching-server": "^0.17.1",
|
|
115
115
|
"zustand": "^5.0.12"
|
|
116
116
|
},
|
|
117
117
|
"publishConfig": {
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* App-session identity bootstrap: everything derivable from the master seed in
|
|
6
|
-
* one call. Thin composition over the pinned derivation in `agents.ts` (which
|
|
7
|
-
* is the shared-key contract: `CapabilityAgent.fromSeed` on raw bytes, keyName
|
|
8
|
-
* `app-key` -- never change it without a migration plan).
|
|
9
|
-
*
|
|
10
|
-
* The agents it returns carry the app's identity key-agreement key, which is
|
|
11
|
-
* the ONE key every encrypted collection is read with: the local replica's
|
|
12
|
-
* ciphers (`LocalStore.init`) and every key-epoch roster entry the wallet
|
|
13
|
-
* writes for this app alike.
|
|
14
|
-
*/
|
|
15
|
-
import { type IdentityAgents } from './agents.js';
|
|
16
|
-
/**
|
|
17
|
-
* Derives the app's identity agents (stable did:key controller, signer,
|
|
18
|
-
* ZcapClient) from the master seed.
|
|
19
|
-
*
|
|
20
|
-
* @param options {object}
|
|
21
|
-
* @param options.seed {Uint8Array} the 32-byte master seed
|
|
22
|
-
* @returns {Promise<IdentityAgents>}
|
|
23
|
-
*/
|
|
24
|
-
export declare function initAppSession({ seed }: {
|
|
25
|
-
seed: Uint8Array;
|
|
26
|
-
}): Promise<IdentityAgents>;
|
|
27
|
-
//# sourceMappingURL=initAppSession.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"initAppSession.d.ts","sourceRoot":"","sources":["../../src/identity/initAppSession.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;GAUG;AACH,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjE;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAAC,EACnC,IAAI,EACL,EAAE;IACD,IAAI,EAAE,UAAU,CAAA;CACjB,GAAG,OAAO,CAAC,cAAc,CAAC,CAK1B"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* App-session identity bootstrap: everything derivable from the master seed in
|
|
6
|
-
* one call. Thin composition over the pinned derivation in `agents.ts` (which
|
|
7
|
-
* is the shared-key contract: `CapabilityAgent.fromSeed` on raw bytes, keyName
|
|
8
|
-
* `app-key` -- never change it without a migration plan).
|
|
9
|
-
*
|
|
10
|
-
* The agents it returns carry the app's identity key-agreement key, which is
|
|
11
|
-
* the ONE key every encrypted collection is read with: the local replica's
|
|
12
|
-
* ciphers (`LocalStore.init`) and every key-epoch roster entry the wallet
|
|
13
|
-
* writes for this app alike.
|
|
14
|
-
*/
|
|
15
|
-
import { deriveIdentity } from './agents.js';
|
|
16
|
-
/**
|
|
17
|
-
* Derives the app's identity agents (stable did:key controller, signer,
|
|
18
|
-
* ZcapClient) from the master seed.
|
|
19
|
-
*
|
|
20
|
-
* @param options {object}
|
|
21
|
-
* @param options.seed {Uint8Array} the 32-byte master seed
|
|
22
|
-
* @returns {Promise<IdentityAgents>}
|
|
23
|
-
*/
|
|
24
|
-
export async function initAppSession({ seed }) {
|
|
25
|
-
if (seed.length !== 32) {
|
|
26
|
-
throw new Error(`Master seed must be 32 bytes (got ${seed.length}).`);
|
|
27
|
-
}
|
|
28
|
-
return await deriveIdentity({ seed });
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=initAppSession.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"initAppSession.js","sourceRoot":"","sources":["../../src/identity/initAppSession.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;GAUG;AACH,OAAO,EAAE,cAAc,EAAuB,MAAM,aAAa,CAAA;AAEjE;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,EACnC,IAAI,EAGL;IACC,IAAI,IAAI,CAAC,MAAM,KAAK,EAAE,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,qCAAqC,IAAI,CAAC,MAAM,IAAI,CAAC,CAAA;IACvE,CAAC;IACD,OAAO,MAAM,cAAc,CAAC,EAAE,IAAI,EAAE,CAAC,CAAA;AACvC,CAAC"}
|