@interop/was-client 0.42.0 → 0.44.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 +17 -21
- package/dist/codec.d.ts +6 -1
- package/dist/codec.d.ts.map +1 -1
- package/dist/codec.js.map +1 -1
- package/dist/edv/EdvCodec.d.ts +45 -7
- package/dist/edv/EdvCodec.d.ts.map +1 -1
- package/dist/edv/EdvCodec.js +70 -29
- package/dist/edv/EdvCodec.js.map +1 -1
- package/dist/edv/constants.d.ts +0 -8
- package/dist/edv/constants.d.ts.map +1 -1
- package/dist/edv/constants.js +0 -8
- package/dist/edv/constants.js.map +1 -1
- package/dist/edv/docCipher.d.ts.map +1 -1
- package/dist/edv/docCipher.js +12 -9
- package/dist/edv/docCipher.js.map +1 -1
- package/dist/edv/index.d.ts +2 -2
- package/dist/edv/index.d.ts.map +1 -1
- package/dist/edv/index.js +1 -1
- package/dist/edv/index.js.map +1 -1
- package/dist/errors.d.ts +0 -10
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +0 -10
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/log/index.d.ts +16 -18
- package/dist/log/index.d.ts.map +1 -1
- package/dist/log/index.js +16 -16
- package/dist/log/index.js.map +1 -1
- package/dist/log/logStore.d.ts +31 -81
- package/dist/log/logStore.d.ts.map +1 -1
- package/dist/log/logStore.js +53 -64
- package/dist/log/logStore.js.map +1 -1
- package/package.json +3 -2
- package/dist/log/jsonl.d.ts +0 -49
- package/dist/log/jsonl.d.ts.map +0 -1
- package/dist/log/jsonl.js +0 -60
- package/dist/log/jsonl.js.map +0 -1
package/dist/log/logStore.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logStore.js","sourceRoot":"","sources":["../../src/log/logStore.ts"],"names":[],"mappings":"AAAA;;GAEG;A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,EAAE,IAAI;iBAClB,CAAC,CAAA;YACJ,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,IAAI,GAAG,YAAY,uBAAuB,EAAE,CAAC;oBAC3C,MAAM,IAAI,wBAAwB,CAChC,4DAA4D;wBAC1D,iBAAiB,EACnB,EAAE,KAAK,EAAE,GAAG,EAAE,CACf,CAAA;gBACH,CAAC;gBACD,MAAM,GAAG,CAAA;YACX,CAAC;YACD,YAAY,GAAG,oBAAoB,CAAC,CAAC,KAAK,CAAC,CAAC,CAAA;QAC9C,CAAC;KACF,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interop/was-client",
|
|
3
3
|
"description": "A developer-friendly client for Wallet Attached Storage (WAS) servers.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.44.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "pnpm run clear && tsc",
|
|
@@ -68,10 +68,11 @@
|
|
|
68
68
|
"@interop/http-client": "^1.0.5",
|
|
69
69
|
"@interop/minimal-cipher": "^7.8.3",
|
|
70
70
|
"@interop/storage-core": "^0.9.1",
|
|
71
|
+
"@interop/vh-resource-log": "^0.1.2",
|
|
71
72
|
"@interop/x25519-key-agreement-key": "^5.2.2",
|
|
72
73
|
"@noble/hashes": "^2.3.0",
|
|
73
74
|
"@scure/base": "^2.3.0",
|
|
74
|
-
"json-canonicalize": "
|
|
75
|
+
"json-canonicalize": "3.0.0"
|
|
75
76
|
},
|
|
76
77
|
"devDependencies": {
|
|
77
78
|
"@eslint/js": "^10.0.1",
|
package/dist/log/jsonl.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Strict JSON Lines parse/serialize for resource logs (the Resource Log
|
|
6
|
-
* Profile, App Connect spec `#resource-log-profile`): one log entry as one
|
|
7
|
-
* JSON object per line, lines separated by U+000A LINE FEED, with a single
|
|
8
|
-
* terminating LINE FEED after the last line. Strict on purpose -- a non-object
|
|
9
|
-
* line is a parse failure, not a skip, so a truncated or doctored log surfaces
|
|
10
|
-
* as an error instead of a silently shorter history.
|
|
11
|
-
*
|
|
12
|
-
* Wire level only: the parse guarantees each line is one JSON object and
|
|
13
|
-
* nothing deeper. The profile's verifier-side rules (the five-member entry
|
|
14
|
-
* shape, `parameters` per position, SCID and chain-hash recomputation, proofs,
|
|
15
|
-
* authorization) belong to the consuming verifier, which runs over the parsed
|
|
16
|
-
* entries.
|
|
17
|
-
*/
|
|
18
|
-
import type { ResourceLogEntry } from '@interop/storage-core';
|
|
19
|
-
/**
|
|
20
|
-
* Parses a resource-log body into its entries, strictly: the text must be one
|
|
21
|
-
* JSON object per line, with an optional single trailing newline. Any empty
|
|
22
|
-
* line, non-JSON line, or line holding a non-object JSON value (an array, a
|
|
23
|
-
* string, a number, `null`) fails the whole parse. An empty body fails too --
|
|
24
|
-
* a log has at least its genesis entry (an absent resource is the store
|
|
25
|
-
* seam's `null`, not an empty body).
|
|
26
|
-
*
|
|
27
|
-
* @param text {string} the log resource's body
|
|
28
|
-
* @returns {ResourceLogEntry[]} the parsed entries, first line first
|
|
29
|
-
*/
|
|
30
|
-
export declare function parseResourceLog(text: string): ResourceLogEntry[];
|
|
31
|
-
/**
|
|
32
|
-
* Serializes one log entry as its single JSON Lines line, without the line
|
|
33
|
-
* separator. `JSON.stringify` escapes any newline inside string values, so the
|
|
34
|
-
* result never contains an embedded U+000A.
|
|
35
|
-
*
|
|
36
|
-
* @param entry {ResourceLogEntry}
|
|
37
|
-
* @returns {string}
|
|
38
|
-
*/
|
|
39
|
-
export declare function serializeResourceLogEntry(entry: ResourceLogEntry): string;
|
|
40
|
-
/**
|
|
41
|
-
* Serializes a full resource log as JSON Lines: one entry per line, in order,
|
|
42
|
-
* with a terminating newline. Refuses an empty log (a log carries at least
|
|
43
|
-
* its genesis entry).
|
|
44
|
-
*
|
|
45
|
-
* @param entries {ResourceLogEntry[]}
|
|
46
|
-
* @returns {string}
|
|
47
|
-
*/
|
|
48
|
-
export declare function serializeResourceLog(entries: ResourceLogEntry[]): string;
|
|
49
|
-
//# sourceMappingURL=jsonl.d.ts.map
|
package/dist/log/jsonl.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jsonl.d.ts","sourceRoot":"","sources":["../../src/log/jsonl.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAG7D;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,EAAE,CA6BjE;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAEzE;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,gBAAgB,EAAE,GAAG,MAAM,CAOxE"}
|
package/dist/log/jsonl.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { ValidationError } from '../errors.js';
|
|
2
|
-
/**
|
|
3
|
-
* Parses a resource-log body into its entries, strictly: the text must be one
|
|
4
|
-
* JSON object per line, with an optional single trailing newline. Any empty
|
|
5
|
-
* line, non-JSON line, or line holding a non-object JSON value (an array, a
|
|
6
|
-
* string, a number, `null`) fails the whole parse. An empty body fails too --
|
|
7
|
-
* a log has at least its genesis entry (an absent resource is the store
|
|
8
|
-
* seam's `null`, not an empty body).
|
|
9
|
-
*
|
|
10
|
-
* @param text {string} the log resource's body
|
|
11
|
-
* @returns {ResourceLogEntry[]} the parsed entries, first line first
|
|
12
|
-
*/
|
|
13
|
-
export function parseResourceLog(text) {
|
|
14
|
-
const body = text.endsWith('\n') ? text.slice(0, -1) : text;
|
|
15
|
-
if (body === '') {
|
|
16
|
-
throw new ValidationError('Cannot parse resource log: the body is empty (a log carries at least ' +
|
|
17
|
-
'its genesis entry).');
|
|
18
|
-
}
|
|
19
|
-
return body.split('\n').map((line, index) => {
|
|
20
|
-
let parsed;
|
|
21
|
-
try {
|
|
22
|
-
parsed = JSON.parse(line);
|
|
23
|
-
}
|
|
24
|
-
catch (err) {
|
|
25
|
-
throw new ValidationError(`Cannot parse resource log: line ${index + 1} is not valid JSON.`, { cause: err });
|
|
26
|
-
}
|
|
27
|
-
if (parsed === null ||
|
|
28
|
-
typeof parsed !== 'object' ||
|
|
29
|
-
Array.isArray(parsed)) {
|
|
30
|
-
throw new ValidationError(`Cannot parse resource log: line ${index + 1} is not a JSON object.`);
|
|
31
|
-
}
|
|
32
|
-
return parsed;
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Serializes one log entry as its single JSON Lines line, without the line
|
|
37
|
-
* separator. `JSON.stringify` escapes any newline inside string values, so the
|
|
38
|
-
* result never contains an embedded U+000A.
|
|
39
|
-
*
|
|
40
|
-
* @param entry {ResourceLogEntry}
|
|
41
|
-
* @returns {string}
|
|
42
|
-
*/
|
|
43
|
-
export function serializeResourceLogEntry(entry) {
|
|
44
|
-
return JSON.stringify(entry);
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Serializes a full resource log as JSON Lines: one entry per line, in order,
|
|
48
|
-
* with a terminating newline. Refuses an empty log (a log carries at least
|
|
49
|
-
* its genesis entry).
|
|
50
|
-
*
|
|
51
|
-
* @param entries {ResourceLogEntry[]}
|
|
52
|
-
* @returns {string}
|
|
53
|
-
*/
|
|
54
|
-
export function serializeResourceLog(entries) {
|
|
55
|
-
if (entries.length === 0) {
|
|
56
|
-
throw new ValidationError('Cannot serialize resource log: a log carries at least its genesis entry.');
|
|
57
|
-
}
|
|
58
|
-
return entries.map(serializeResourceLogEntry).join('\n') + '\n';
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=jsonl.js.map
|
package/dist/log/jsonl.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jsonl.js","sourceRoot":"","sources":["../../src/log/jsonl.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAE9C;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC3D,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;QAChB,MAAM,IAAI,eAAe,CACvB,uEAAuE;YACrE,qBAAqB,CACxB,CAAA;IACH,CAAC;IACD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QAC1C,IAAI,MAAe,CAAA;QACnB,IAAI,CAAC;YACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAC3B,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,IAAI,eAAe,CACvB,mCAAmC,KAAK,GAAG,CAAC,qBAAqB,EACjE,EAAE,KAAK,EAAE,GAAG,EAAE,CACf,CAAA;QACH,CAAC;QACD,IACE,MAAM,KAAK,IAAI;YACf,OAAO,MAAM,KAAK,QAAQ;YAC1B,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EACrB,CAAC;YACD,MAAM,IAAI,eAAe,CACvB,mCAAmC,KAAK,GAAG,CAAC,wBAAwB,CACrE,CAAA;QACH,CAAC;QACD,OAAO,MAAqC,CAAA;IAC9C,CAAC,CAAC,CAAA;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,U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