@interop/wallet-core 0.30.0 → 0.31.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/dist/recovery/recoveryWebvh.d.ts +13 -5
- package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
- package/dist/recovery/recoveryWebvh.js +59 -26
- package/dist/recovery/recoveryWebvh.js.map +1 -1
- package/dist/webvh/didWebvh.d.ts +136 -9
- package/dist/webvh/didWebvh.d.ts.map +1 -1
- package/dist/webvh/didWebvh.js +189 -40
- package/dist/webvh/didWebvh.js.map +1 -1
- package/dist/webvh/index.d.ts +4 -1
- package/dist/webvh/index.d.ts.map +1 -1
- package/dist/webvh/index.js +4 -1
- package/dist/webvh/index.js.map +1 -1
- package/dist/webvh/revokeClient.d.ts +6 -1
- package/dist/webvh/revokeClient.d.ts.map +1 -1
- package/dist/webvh/revokeClient.js +17 -6
- package/dist/webvh/revokeClient.js.map +1 -1
- package/dist/webvh/wasIdStore.d.ts +6 -0
- package/dist/webvh/wasIdStore.d.ts.map +1 -1
- package/dist/webvh/wasIdStore.js +20 -4
- package/dist/webvh/wasIdStore.js.map +1 -1
- package/package.json +2 -2
package/dist/webvh/wasIdStore.js
CHANGED
|
@@ -16,17 +16,33 @@ export function wasWebvhIdStore({ was, spaceId }) {
|
|
|
16
16
|
.resource(resourceId);
|
|
17
17
|
return {
|
|
18
18
|
getIdResourceRaw: async ({ resourceId }) => {
|
|
19
|
-
const
|
|
20
|
-
|
|
19
|
+
const read = await idResource(resourceId).getWithEtag();
|
|
20
|
+
if (read === null) {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
// The log is served as `text/jsonl`, so the body decodes to a Blob; the
|
|
24
|
+
// string and stringify arms are defensive fallbacks for a backend that
|
|
25
|
+
// served (and the codec parsed) a JSON content type instead.
|
|
26
|
+
const { data, etag } = read;
|
|
27
|
+
const text = data instanceof Blob
|
|
28
|
+
? await data.text()
|
|
29
|
+
: typeof data === 'string'
|
|
30
|
+
? data
|
|
31
|
+
: JSON.stringify(data);
|
|
32
|
+
return { text, etag };
|
|
21
33
|
},
|
|
22
34
|
getIdResource: async ({ resourceId }) => {
|
|
23
35
|
const data = await idResource(resourceId).get();
|
|
24
36
|
return data === null ? undefined : data;
|
|
25
37
|
},
|
|
26
|
-
putIdResource: async ({ resourceId, content, contentType = 'application/json' }) => {
|
|
38
|
+
putIdResource: async ({ resourceId, content, contentType = 'application/json', ifMatch, ifNoneMatch }) => {
|
|
27
39
|
const serialized = typeof content === 'string' ? content : JSON.stringify(content);
|
|
40
|
+
// was-client's own PreconditionFailedError propagates as-is: its `name`
|
|
41
|
+
// is exactly what the seam contract names.
|
|
28
42
|
await idResource(resourceId).put(new TextEncoder().encode(serialized), {
|
|
29
|
-
contentType
|
|
43
|
+
contentType,
|
|
44
|
+
ifMatch,
|
|
45
|
+
ifNoneMatch
|
|
30
46
|
});
|
|
31
47
|
},
|
|
32
48
|
putKeyMap: async ({ content }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wasIdStore.js","sourceRoot":"","sources":["../../src/webvh/wasIdStore.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wasIdStore.js","sourceRoot":"","sources":["../../src/webvh/wasIdStore.ts"],"names":[],"mappings":"AAwBA,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EACnB,MAAM,yBAAyB,CAAA;AAGhC;;;;;;;;;GASG;AACH,MAAM,UAAU,eAAe,CAAC,EAC9B,GAAG,EACH,OAAO,EAIR;IACC,MAAM,UAAU,GAAG,CAAC,UAAkB,EAAE,EAAE,CACxC,GAAG;SACA,KAAK,CAAC,OAAO,CAAC;SACd,UAAU,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;SACzD,QAAQ,CAAC,UAAU,CAAC,CAAA;IAEzB,OAAO;QACL,gBAAgB,EAAE,KAAK,EAAE,EAAE,UA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AAC,CAAA;QACJ,CAAC;QACD,SAAS,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;YAC/B,MAAM,GAAG;iBACN,KAAK,CAAC,OAAO,CAAC;iBACd,UAAU,CAAC,kBAAkB,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;iBAC9D,QAAQ,CAAC,iBAAiB,CAAC;iBAC3B,GAAG,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE;gBACtD,WAAW,EAAE,kBAAkB;aAChC,CAAC,CAAA;QACN,CAAC;KACF,CAAA;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.31.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "pnpm run clear && tsc",
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
"@interop/security-document-loader": "^10.0.0",
|
|
136
136
|
"@interop/social-core": "^0.8.0",
|
|
137
137
|
"@interop/vc": "^11.0.6",
|
|
138
|
-
"@interop/was-client": "^0.
|
|
138
|
+
"@interop/was-client": "^0.34.0",
|
|
139
139
|
"@interop/webkms-client": "^14.7.1",
|
|
140
140
|
"@interop/x25519-key-agreement-key": "^5.2.1",
|
|
141
141
|
"@noble/hashes": "^2.3.0",
|