@interop/wallet-core 0.58.0 → 0.59.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provisioning.d.ts","sourceRoot":"","sources":["../../src/space/provisioning.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;GAMG;AACH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"provisioning.d.ts","sourceRoot":"","sources":["../../src/space/provisioning.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;GAMG;AACH,OAAO,KAAK,EAAoB,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAStE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAsB,oBAAoB,CAAC,EACzC,GAAG,EACH,OAAO,EACP,aAAa,EACd,EAAE;IACD,GAAG,EAAE,SAAS,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,aAAa,EAAE,MAAM,CAAA;CACtB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBhB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ensureSpaceAndCollection } from '@interop/was-client/sync';
|
|
1
|
+
import { ensureSpace, ensureSpaceAndCollection } from '@interop/was-client/sync';
|
|
2
2
|
import { WALLET_SPACE_NAME, WALLET_SPACE_PROVISION_ROSTER } from './collections.js';
|
|
3
3
|
/**
|
|
4
4
|
* Ensures the Space exists and every collection in the wallet Space roster is
|
|
@@ -30,9 +30,20 @@ import { WALLET_SPACE_NAME, WALLET_SPACE_PROVISION_ROSTER } from './collections.
|
|
|
30
30
|
* @returns {Promise<void>}
|
|
31
31
|
*/
|
|
32
32
|
export async function provisionWalletSpace({ was, spaceId, controllerDid }) {
|
|
33
|
-
|
|
33
|
+
// The Space is ensured ONCE, before the fan-out, and its description is
|
|
34
|
+
// threaded into every branch. Ensuring it inside the fan-out instead had
|
|
35
|
+
// each of the roster's branches describe and configure the same Space
|
|
36
|
+
// concurrently -- nine reads and nine racing writes where one of each does,
|
|
37
|
+
// since none of them can observe another's create.
|
|
38
|
+
const spaceDescription = await ensureSpace({
|
|
39
|
+
was,
|
|
40
|
+
spaceId,
|
|
41
|
+
controllerDid,
|
|
42
|
+
spaceName: WALLET_SPACE_NAME
|
|
43
|
+
});
|
|
44
|
+
await Promise.all(WALLET_SPACE_PROVISION_ROSTER.map(spec => ensureCollection({ was, spaceId, controllerDid, spaceDescription, spec })));
|
|
34
45
|
}
|
|
35
|
-
async function ensureCollection({ was, spaceId, controllerDid, spec: { collectionId, name, encryption, isPublic } }) {
|
|
46
|
+
async function ensureCollection({ was, spaceId, controllerDid, spaceDescription, spec: { collectionId, name, encryption, isPublic } }) {
|
|
36
47
|
try {
|
|
37
48
|
await ensureSpaceAndCollection({
|
|
38
49
|
was,
|
|
@@ -42,6 +53,7 @@ async function ensureCollection({ was, spaceId, controllerDid, spec: { collectio
|
|
|
42
53
|
collectionName: name,
|
|
43
54
|
encryption,
|
|
44
55
|
isPublic,
|
|
56
|
+
spaceDescription,
|
|
45
57
|
spaceName: WALLET_SPACE_NAME
|
|
46
58
|
});
|
|
47
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provisioning.js","sourceRoot":"","sources":["../../src/space/provisioning.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"provisioning.js","sourceRoot":"","sources":["../../src/space/provisioning.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAA;AAEhF,OAAO,EACL,iBAAiB,EACjB,6BAA6B,EAC9B,MAAM,kBAAkB,CAAA;AAGzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,EACzC,GAAG,EACH,OAAO,EACP,aAAa,EAKd;IACC,wEAAwE;IACxE,yEAAyE;IACzE,sEAAsE;IACtE,4EAA4E;IAC5E,mDAAmD;IACnD,MAAM,gBAAgB,GAAG,MAAM,WAAW,CAAC;QACzC,GAAG;QACH,OAAO;QACP,aAAa;QACb,SAAS,EAAE,iBAAiB;KAC7B,CAAC,CAAA;IACF,MAAM,OAAO,CAAC,GAAG,CACf,6BAA6B,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CACvC,gBAAgB,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAC1E,CACF,CAAA;AACH,CAAC;AAED,KAAK,UAAU,gBAAgB,CAAC,EAC9B,GAAG,EACH,OAAO,EACP,aAAa,EACb,gBAAgB,EAChB,IAAI,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,EAOnD;IACC,IAAI,CAAC;QACH,MAAM,wBAAwB,CAAC;YAC7B,GAAG;YACH,OAAO;YACP,aAAa;YACb,YAAY;YACZ,cAAc,EAAE,IAAI;YACpB,UAAU;YACV,QAAQ;YACR,gBAAgB;YAChB,SAAS,EAAE,iBAAiB;SAC7B,CAAC,CAAA;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,kCAAkC,YAAY,eAAe,OAAO,IAAI,EACxE,EAAE,KAAK,EAAE,GAAG,EAAE,CACf,CAAA;IACH,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interop/wallet-core",
|
|
3
3
|
"description": "Shared wallet-domain logic (WAS sync engine core and wallet Space layout contracts) for Interop wallet apps.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.59.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "pnpm run clear && tsc",
|
|
@@ -22,17 +22,17 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@interop/data-integrity-core": "^8.7.1",
|
|
24
24
|
"@interop/data-integrity-proof": "^3.4.5",
|
|
25
|
-
"@interop/did-method-webvh": "^5.
|
|
25
|
+
"@interop/did-method-webvh": "^5.6.0",
|
|
26
26
|
"@interop/ed25519-signature": "^7.1.4",
|
|
27
27
|
"@interop/ed25519-verification-key": "^8.0.4",
|
|
28
|
-
"@interop/ezcap": "^7.4.
|
|
28
|
+
"@interop/ezcap": "^7.4.4",
|
|
29
29
|
"@interop/security-document-loader": "^10.0.4",
|
|
30
30
|
"@interop/social-core": "^0.8.1",
|
|
31
31
|
"@interop/storage-core": "^0.9.1",
|
|
32
32
|
"@interop/vc": "^11.0.7",
|
|
33
33
|
"@interop/vh-resource-log": "^0.4.1",
|
|
34
|
-
"@interop/was-client": "^0.
|
|
35
|
-
"@interop/webkms-client": "^14.7.
|
|
34
|
+
"@interop/was-client": "^0.45.0",
|
|
35
|
+
"@interop/webkms-client": "^14.7.4",
|
|
36
36
|
"@interop/x25519-key-agreement-key": "^5.2.2",
|
|
37
37
|
"@noble/ciphers": "^2.3.0",
|
|
38
38
|
"@noble/hashes": "^2.3.0",
|