cesr-ts 0.4.0 → 0.6.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/esm/src/adapters/async-iterable.js +8 -0
- package/esm/src/adapters/effection.js +6 -0
- package/esm/src/annotate/annotator.js +12 -0
- package/esm/src/annotate/cli.js +12 -0
- package/esm/src/annotate/comments.js +5 -1
- package/esm/src/annotate/denot.js +6 -0
- package/esm/src/annotate/render.js +15 -3
- package/esm/src/core/bytes.js +9 -0
- package/esm/src/core/errors.js +3 -0
- package/esm/src/core/parser-engine.js +1 -1
- package/esm/src/core/parser-frame-parser.js +22 -18
- package/esm/src/core/vocabulary.js +47 -0
- package/esm/src/index.js +5 -0
- package/esm/src/parser/attachment-parser.js +4 -0
- package/esm/src/parser/cold-start.js +6 -0
- package/esm/src/parser/group-dispatch.js +2 -2
- package/esm/src/primitives/aggor.js +374 -30
- package/esm/src/primitives/bexter.js +2 -3
- package/esm/src/primitives/blinder.js +6 -0
- package/esm/src/primitives/byte-like.js +19 -0
- package/esm/src/primitives/cigar.js +17 -3
- package/esm/src/primitives/cipher.js +91 -6
- package/esm/src/primitives/codex.js +39 -6
- package/esm/src/primitives/compactor.js +307 -3
- package/esm/src/primitives/counter.js +6 -2
- package/esm/src/primitives/dater.js +1 -2
- package/esm/src/primitives/decimer.js +7 -11
- package/esm/src/primitives/decrypter.js +123 -7
- package/esm/src/primitives/diger.js +57 -3
- package/esm/src/primitives/disclosure.js +300 -0
- package/esm/src/primitives/encrypter.js +130 -7
- package/esm/src/primitives/hydrate.js +49 -0
- package/esm/src/primitives/ilker.js +2 -3
- package/esm/src/primitives/indexer.js +21 -4
- package/esm/src/primitives/labeler.js +1 -2
- package/esm/src/primitives/mapper.js +612 -35
- package/esm/src/primitives/matter.js +133 -3
- package/esm/src/primitives/mediar.js +6 -0
- package/esm/src/primitives/noncer.js +2 -3
- package/esm/src/primitives/number.js +1 -2
- package/esm/src/primitives/pather.js +102 -5
- package/esm/src/primitives/prefixer.js +1 -2
- package/esm/src/primitives/primitive.js +14 -0
- package/esm/src/primitives/registry.js +2 -0
- package/esm/src/primitives/saider.js +80 -3
- package/esm/src/primitives/salter.js +96 -2
- package/esm/src/primitives/sealed-box.js +41 -0
- package/esm/src/primitives/seqner.js +1 -2
- package/esm/src/primitives/siger.js +58 -3
- package/esm/src/primitives/signer.js +243 -9
- package/esm/src/primitives/streamer.js +28 -0
- package/esm/src/primitives/structing.js +727 -0
- package/esm/src/primitives/structor.js +20 -0
- package/esm/src/primitives/tagger.js +1 -2
- package/esm/src/primitives/texter.js +1 -2
- package/esm/src/primitives/tholder.js +552 -10
- package/esm/src/primitives/traitor.js +2 -3
- package/esm/src/primitives/verfer.js +50 -6
- package/esm/src/primitives/verser.js +16 -6
- package/esm/src/router/router-stub.js +1 -0
- package/esm/src/serder/native.js +1326 -0
- package/esm/src/serder/serder.js +1558 -59
- package/esm/src/serder/serdery.js +92 -7
- package/esm/src/serder/smell.js +26 -1
- package/esm/src/tables/codex-utils.js +2 -0
- package/esm/src/tables/counter-codex.js +2 -0
- package/esm/src/tables/counter-groups.js +6 -0
- package/esm/src/tables/versions.js +4 -0
- package/esm/src/version.js +5 -2
- package/package.json +5 -2
- package/types/src/adapters/async-iterable.d.ts +8 -0
- package/types/src/adapters/async-iterable.d.ts.map +1 -1
- package/types/src/adapters/effection.d.ts +7 -0
- package/types/src/adapters/effection.d.ts.map +1 -1
- package/types/src/annotate/annotator.d.ts +12 -0
- package/types/src/annotate/annotator.d.ts.map +1 -1
- package/types/src/annotate/cli.d.ts +13 -0
- package/types/src/annotate/cli.d.ts.map +1 -1
- package/types/src/annotate/comments.d.ts +4 -0
- package/types/src/annotate/comments.d.ts.map +1 -1
- package/types/src/annotate/denot.d.ts +6 -0
- package/types/src/annotate/denot.d.ts.map +1 -1
- package/types/src/annotate/render.d.ts.map +1 -1
- package/types/src/annotate/types.d.ts +2 -0
- package/types/src/annotate/types.d.ts.map +1 -1
- package/types/src/bench/parser-benchmark.d.ts +3 -0
- package/types/src/bench/parser-benchmark.d.ts.map +1 -1
- package/types/src/core/bytes.d.ts +9 -0
- package/types/src/core/bytes.d.ts.map +1 -1
- package/types/src/core/errors.d.ts +3 -0
- package/types/src/core/errors.d.ts.map +1 -1
- package/types/src/core/parser-engine.d.ts +4 -0
- package/types/src/core/parser-engine.d.ts.map +1 -1
- package/types/src/core/parser-frame-parser.d.ts.map +1 -1
- package/types/src/core/types.d.ts +2 -0
- package/types/src/core/types.d.ts.map +1 -1
- package/types/src/core/vocabulary.d.ts +48 -0
- package/types/src/core/vocabulary.d.ts.map +1 -0
- package/types/src/index.d.ts +5 -0
- package/types/src/index.d.ts.map +1 -1
- package/types/src/parser/attachment-parser.d.ts +4 -0
- package/types/src/parser/attachment-parser.d.ts.map +1 -1
- package/types/src/parser/cold-start.d.ts +6 -0
- package/types/src/parser/cold-start.d.ts.map +1 -1
- package/types/src/parser/group-dispatch.d.ts.map +1 -1
- package/types/src/primitives/aggor.d.ts +100 -13
- package/types/src/primitives/aggor.d.ts.map +1 -1
- package/types/src/primitives/bexter.d.ts.map +1 -1
- package/types/src/primitives/blinder.d.ts +6 -0
- package/types/src/primitives/blinder.d.ts.map +1 -1
- package/types/src/primitives/byte-like.d.ts +7 -0
- package/types/src/primitives/byte-like.d.ts.map +1 -0
- package/types/src/primitives/cigar.d.ts +11 -1
- package/types/src/primitives/cigar.d.ts.map +1 -1
- package/types/src/primitives/cipher.d.ts +73 -2
- package/types/src/primitives/cipher.d.ts.map +1 -1
- package/types/src/primitives/codex.d.ts +34 -4
- package/types/src/primitives/codex.d.ts.map +1 -1
- package/types/src/primitives/compactor.d.ts +94 -2
- package/types/src/primitives/compactor.d.ts.map +1 -1
- package/types/src/primitives/counter.d.ts.map +1 -1
- package/types/src/primitives/dater.d.ts.map +1 -1
- package/types/src/primitives/decimer.d.ts.map +1 -1
- package/types/src/primitives/decrypter.d.ts +64 -3
- package/types/src/primitives/decrypter.d.ts.map +1 -1
- package/types/src/primitives/diger.d.ts +16 -0
- package/types/src/primitives/diger.d.ts.map +1 -1
- package/types/src/primitives/disclosure.d.ts +201 -0
- package/types/src/primitives/disclosure.d.ts.map +1 -0
- package/types/src/primitives/encrypter.d.ts +66 -4
- package/types/src/primitives/encrypter.d.ts.map +1 -1
- package/types/src/primitives/hydrate.d.ts +20 -0
- package/types/src/primitives/hydrate.d.ts.map +1 -0
- package/types/src/primitives/ilker.d.ts.map +1 -1
- package/types/src/primitives/indexer.d.ts.map +1 -1
- package/types/src/primitives/labeler.d.ts.map +1 -1
- package/types/src/primitives/mapper.d.ts +132 -11
- package/types/src/primitives/mapper.d.ts.map +1 -1
- package/types/src/primitives/matter.d.ts +33 -1
- package/types/src/primitives/matter.d.ts.map +1 -1
- package/types/src/primitives/mediar.d.ts +6 -0
- package/types/src/primitives/mediar.d.ts.map +1 -1
- package/types/src/primitives/noncer.d.ts.map +1 -1
- package/types/src/primitives/number.d.ts.map +1 -1
- package/types/src/primitives/pather.d.ts +21 -0
- package/types/src/primitives/pather.d.ts.map +1 -1
- package/types/src/primitives/prefixer.d.ts.map +1 -1
- package/types/src/primitives/primitive.d.ts +26 -0
- package/types/src/primitives/primitive.d.ts.map +1 -1
- package/types/src/primitives/registry.d.ts +3 -0
- package/types/src/primitives/registry.d.ts.map +1 -1
- package/types/src/primitives/saider.d.ts +41 -0
- package/types/src/primitives/saider.d.ts.map +1 -1
- package/types/src/primitives/salter.d.ts +56 -1
- package/types/src/primitives/salter.d.ts.map +1 -1
- package/types/src/primitives/sealed-box.d.ts +29 -0
- package/types/src/primitives/sealed-box.d.ts.map +1 -0
- package/types/src/primitives/seqner.d.ts.map +1 -1
- package/types/src/primitives/siger.d.ts +14 -0
- package/types/src/primitives/siger.d.ts.map +1 -1
- package/types/src/primitives/signer.d.ts +80 -4
- package/types/src/primitives/signer.d.ts.map +1 -1
- package/types/src/primitives/streamer.d.ts +31 -0
- package/types/src/primitives/streamer.d.ts.map +1 -0
- package/types/src/primitives/structing.d.ts +4114 -0
- package/types/src/primitives/structing.d.ts.map +1 -0
- package/types/src/primitives/structor.d.ts +6 -0
- package/types/src/primitives/structor.d.ts.map +1 -1
- package/types/src/primitives/tagger.d.ts.map +1 -1
- package/types/src/primitives/texter.d.ts.map +1 -1
- package/types/src/primitives/tholder.d.ts +150 -5
- package/types/src/primitives/tholder.d.ts.map +1 -1
- package/types/src/primitives/traitor.d.ts.map +1 -1
- package/types/src/primitives/unknown.d.ts +1 -0
- package/types/src/primitives/unknown.d.ts.map +1 -1
- package/types/src/primitives/verfer.d.ts +12 -0
- package/types/src/primitives/verfer.d.ts.map +1 -1
- package/types/src/primitives/verser.d.ts +14 -3
- package/types/src/primitives/verser.d.ts.map +1 -1
- package/types/src/router/router-stub.d.ts +3 -0
- package/types/src/router/router-stub.d.ts.map +1 -1
- package/types/src/serder/native.d.ts +115 -0
- package/types/src/serder/native.d.ts.map +1 -0
- package/types/src/serder/serder.d.ts +187 -9
- package/types/src/serder/serder.d.ts.map +1 -1
- package/types/src/serder/serdery.d.ts +42 -0
- package/types/src/serder/serdery.d.ts.map +1 -1
- package/types/src/serder/smell.d.ts +22 -0
- package/types/src/serder/smell.d.ts.map +1 -1
- package/types/src/tables/codex-utils.d.ts +3 -0
- package/types/src/tables/codex-utils.d.ts.map +1 -1
- package/types/src/tables/counter-codex.d.ts +4 -0
- package/types/src/tables/counter-codex.d.ts.map +1 -1
- package/types/src/tables/counter-groups.d.ts +6 -0
- package/types/src/tables/counter-groups.d.ts.map +1 -1
- package/types/src/tables/counter.tables.generated.d.ts.map +1 -1
- package/types/src/tables/indexer.codex.generated.d.ts.map +1 -1
- package/types/src/tables/matter.codex.generated.d.ts.map +1 -1
- package/types/src/tables/table-types.d.ts +6 -0
- package/types/src/tables/table-types.d.ts.map +1 -1
- package/types/src/tables/versions.d.ts +6 -0
- package/types/src/tables/versions.d.ts.map +1 -1
- package/types/src/version.d.ts +5 -2
- package/types/src/version.d.ts.map +1 -1
|
@@ -1,11 +1,72 @@
|
|
|
1
|
+
import { type ByteLike } from "./byte-like.js";
|
|
2
|
+
import { Cipher } from "./cipher.js";
|
|
1
3
|
import { Matter, type MatterInit } from "./matter.js";
|
|
4
|
+
import type { CipherHydratable, CipherHydratableCtor } from "./primitive.js";
|
|
5
|
+
/**
|
|
6
|
+
* Supported constructor inputs for one private-key decrypter.
|
|
7
|
+
*
|
|
8
|
+
* Accepted forms mirror KERIpy's two entry points:
|
|
9
|
+
* - provide already-qualified X25519 private box material directly
|
|
10
|
+
* - provide an Ed25519 signer seed through `seed` and derive the matching
|
|
11
|
+
* X25519 private box key during construction
|
|
12
|
+
*/
|
|
13
|
+
export interface DecrypterInit extends Omit<MatterInit, "raw" | "qb64b" | "qb64" | "qb2"> {
|
|
14
|
+
raw?: Uint8Array | ArrayBufferView;
|
|
15
|
+
qb64b?: Uint8Array | ArrayBufferView;
|
|
16
|
+
qb64?: ByteLike;
|
|
17
|
+
qb2?: Uint8Array | ArrayBufferView;
|
|
18
|
+
code?: string;
|
|
19
|
+
seed?: ByteLike;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Cipher inputs and hydration controls for `Decrypter.decrypt(...)`.
|
|
23
|
+
*
|
|
24
|
+
* Precedence mirrors KERIpy:
|
|
25
|
+
* - explicit `cipher`
|
|
26
|
+
* - otherwise parse `qb64`
|
|
27
|
+
* - otherwise parse `qb2`
|
|
28
|
+
*
|
|
29
|
+
* `ctor` controls semantic plaintext rehydration; `bare` bypasses that and
|
|
30
|
+
* returns plaintext bytes directly.
|
|
31
|
+
*/
|
|
32
|
+
export interface DecrypterDecryptOptions<T extends CipherHydratable = CipherHydratable> {
|
|
33
|
+
cipher?: Cipher;
|
|
34
|
+
qb64?: ByteLike;
|
|
35
|
+
qb2?: Uint8Array | ArrayBufferView;
|
|
36
|
+
ctor?: CipherHydratableCtor<T>;
|
|
37
|
+
transferable?: boolean;
|
|
38
|
+
bare?: boolean;
|
|
39
|
+
}
|
|
2
40
|
/**
|
|
3
41
|
* Private-key decryption primitive for asymmetric envelope payloads.
|
|
4
42
|
*
|
|
5
|
-
* KERIpy substance:
|
|
6
|
-
* recover
|
|
43
|
+
* KERIpy substance: `Decrypter` owns the private X25519 material used to
|
|
44
|
+
* recover CESR payloads from sealed-box ciphers, optionally deriving it from
|
|
45
|
+
* an Ed25519 signing seed.
|
|
7
46
|
*/
|
|
8
47
|
export declare class Decrypter extends Matter {
|
|
9
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Construct one X25519 private-key decrypter.
|
|
50
|
+
*
|
|
51
|
+
* Default code remains the KERIpy private-box family
|
|
52
|
+
* `MtrDex.X25519_Private`.
|
|
53
|
+
*/
|
|
54
|
+
constructor(init?: Matter | DecrypterInit);
|
|
55
|
+
/**
|
|
56
|
+
* Decrypt one cipher and rehydrate the plaintext with the requested
|
|
57
|
+
* constructor.
|
|
58
|
+
*
|
|
59
|
+
* Resolution rules:
|
|
60
|
+
* - `cipher` wins when supplied
|
|
61
|
+
* - otherwise `qb64` is parsed before `qb2`
|
|
62
|
+
* - omitted `ctor` is only inferred for the KERIpy families that already
|
|
63
|
+
* name their semantic plaintext shape
|
|
64
|
+
*
|
|
65
|
+
* Output rules:
|
|
66
|
+
* - `bare=true` returns plaintext bytes directly
|
|
67
|
+
* - otherwise `transferable` is forwarded only to qb64-family primitive
|
|
68
|
+
* constructors such as `Signer`, matching the KERIpy init seam
|
|
69
|
+
*/
|
|
70
|
+
decrypt<T extends CipherHydratable = CipherHydratable>({ cipher, qb64, qb2, ctor, transferable, bare, }?: DecrypterDecryptOptions<T>): T | Uint8Array;
|
|
10
71
|
}
|
|
11
72
|
//# sourceMappingURL=decrypter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decrypter.d.ts","sourceRoot":"","sources":["../../../src/src/primitives/decrypter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"decrypter.d.ts","sourceRoot":"","sources":["../../../src/src/primitives/decrypter.ts"],"names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B,EACpB,IAAY,GACb,GAAE,uBAAuB,CAAC,CAAC,CAAM,GACjC,CAAC,GAAG,UAAU;CA8BlB"}
|
|
@@ -3,16 +3,32 @@ import { Matter, type MatterInit } from "./matter.js";
|
|
|
3
3
|
interface DigerOptions {
|
|
4
4
|
strict?: boolean;
|
|
5
5
|
}
|
|
6
|
+
type DigestFn = (ser: Uint8Array) => Uint8Array;
|
|
6
7
|
/**
|
|
7
8
|
* Digest primitive family.
|
|
8
9
|
*
|
|
9
10
|
* KERIpy substance: `Diger` encapsulates self-addressing digest material and
|
|
10
11
|
* optionally constrains codes to digest codex membership (`strict=true`).
|
|
12
|
+
*
|
|
13
|
+
* Maintainer note:
|
|
14
|
+
* `DigDex` remains the canonical namespace of supported digest codes, but this
|
|
15
|
+
* class is the runtime authority for "code -> hash implementation" dispatch.
|
|
16
|
+
* Keep new digest algorithms centralized here so `Saider`, `Serder`, and app
|
|
17
|
+
* flows do not grow their own private digest switches.
|
|
11
18
|
*/
|
|
12
19
|
export declare class Diger extends Matter {
|
|
20
|
+
/** Shared KERIpy-style digest registry keyed by canonical `DigDex` values. */
|
|
21
|
+
static readonly Digests: Map<string, DigestFn>;
|
|
13
22
|
constructor(init: Matter | MatterInit, options?: DigerOptions);
|
|
14
23
|
get digest(): Uint8Array;
|
|
15
24
|
get algorithm(): string;
|
|
25
|
+
/** Compute raw digest bytes for `ser` using the digest family selected by `code`. */
|
|
26
|
+
static digest(ser: Uint8Array, code: string): Uint8Array;
|
|
27
|
+
verify(ser: Uint8Array): boolean;
|
|
28
|
+
/** Compare `ser` against either the instance digest or an override digest. */
|
|
29
|
+
compare(ser: Uint8Array, dig?: Uint8Array): boolean;
|
|
30
|
+
/** Constant-shape byte comparison helper used by higher-level SAID/serder verification. */
|
|
31
|
+
static compare(ser: Uint8Array, code: string, dig: Uint8Array): boolean;
|
|
16
32
|
}
|
|
17
33
|
/** Parse and hydrate `Diger` from txt/qb2 bytes. */
|
|
18
34
|
export declare function parseDiger(input: Uint8Array, cold: Extract<ColdCode, "txt" | "bny">): Diger;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diger.d.ts","sourceRoot":"","sources":["../../../src/src/primitives/diger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"diger.d.ts","sourceRoot":"","sources":["../../../src/src/primitives/diger.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,MAAM,EAAE,KAAK,UAAU,EAAe,MAAM,aAAa,CAAC;AAEnE,UAAU,YAAY;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,KAAK,QAAQ,GAAG,CAAC,GAAG,EAAE,UAAU,KAAK,UAAU,CAAC;AAEhD;;;;;;;;;;;GAWG;AACH,qBAAa,KAAM,SAAQ,MAAM;IAC/B,8EAA8E;IAC9E,MAAM,CAAC,QAAQ,CAAC,OAAO,wBAUpB;gBAES,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE,OAAO,GAAE,YAAiB;IAOjE,IAAI,MAAM,IAAI,UAAU,CAEvB;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,qFAAqF;IACrF,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU;IAQxD,MAAM,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO;IAIhC,8EAA8E;IAC9E,OAAO,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,CAAC,EAAE,UAAU,GAAG,OAAO;IAInD,2FAA2F;IAC3F,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO;CAYxE;AAED,oDAAoD;AACpD,wBAAgB,UAAU,CACxB,KAAK,EAAE,UAAU,EACjB,IAAI,EAAE,OAAO,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,CAAC,GACrC,KAAK,CAEP"}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import type { Tier } from "../core/vocabulary.js";
|
|
2
|
+
import { Labeler } from "./labeler.js";
|
|
3
|
+
import { Noncer } from "./noncer.js";
|
|
4
|
+
import { NumberPrimitive } from "./number.js";
|
|
5
|
+
import { type BlindState as BlindStateRecord, type BoundState as BoundStateRecord, type TypeMedia as TypeMediaRecord } from "./structing.js";
|
|
6
|
+
import { Texter } from "./texter.js";
|
|
7
|
+
/**
|
|
8
|
+
* Disclosure-workflow input accepted for sequence-number slots.
|
|
9
|
+
*
|
|
10
|
+
* TypeScript-specific convenience:
|
|
11
|
+
* - KERIpy takes flexible Python values through keyword arguments; this union
|
|
12
|
+
* keeps the same ergonomic range while staying explicit in TS.
|
|
13
|
+
*/
|
|
14
|
+
export type NumberLike = NumberPrimitive | number | bigint | string;
|
|
15
|
+
/**
|
|
16
|
+
* Disclosure-workflow input accepted for nonce-like slots.
|
|
17
|
+
*
|
|
18
|
+
* Empty string / null / undefined preserve KERIpy placeholder semantics.
|
|
19
|
+
*/
|
|
20
|
+
export type NoncerLike = Noncer | string | null | undefined;
|
|
21
|
+
/** Disclosure-workflow input accepted for label-text slots. */
|
|
22
|
+
export type LabelerLike = Labeler | string | null | undefined;
|
|
23
|
+
/** Disclosure-workflow input accepted for text-payload slots. */
|
|
24
|
+
export type TexterLike = Texter | string | null | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Inputs used to derive the deterministic disclosure UUID.
|
|
27
|
+
*
|
|
28
|
+
* KERIpy correspondence:
|
|
29
|
+
* - mirrors the keyword-argument surface accepted by `Blinder.makeUUID(...)`
|
|
30
|
+
*
|
|
31
|
+
* Defaults:
|
|
32
|
+
* - `sn=1`
|
|
33
|
+
* - if `raw`, `salt`, and `tier` are omitted, a fresh `Salter` is generated
|
|
34
|
+
*/
|
|
35
|
+
export interface MakeBlindUuidOptions {
|
|
36
|
+
/** Raw salt bytes fed into `Salter` when the caller already has them. */
|
|
37
|
+
raw?: Uint8Array;
|
|
38
|
+
/** Qualified CESR salt (`Salter.qb64`) used instead of `raw`. */
|
|
39
|
+
salt?: string;
|
|
40
|
+
/** Sequence number projected through `numh` before entering the salty path. */
|
|
41
|
+
sn?: NumberLike;
|
|
42
|
+
/** Salty derivation tier forwarded into `Salter.stretch(...)`. */
|
|
43
|
+
tier?: Tier;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Inputs for building one `BlindState`.
|
|
47
|
+
*
|
|
48
|
+
* Placeholder semantics intentionally match KERIpy:
|
|
49
|
+
* - omitted `uuid` means "derive it deterministically"
|
|
50
|
+
* - omitted `acdc` / `state` mean "use empty disclosure placeholders"
|
|
51
|
+
* - omitted `code` means "reuse an existing digest-capable code or default to
|
|
52
|
+
* Blake3-256"
|
|
53
|
+
*/
|
|
54
|
+
export interface MakeBlindStateOptions extends MakeBlindUuidOptions {
|
|
55
|
+
/** Disclosure UUID. Omit to derive via `makeBlindUuid(...)`. */
|
|
56
|
+
uuid?: NoncerLike;
|
|
57
|
+
/** Disclosed ACDC/TEL SAID, or empty placeholder. */
|
|
58
|
+
acdc?: NoncerLike;
|
|
59
|
+
/** Disclosed state label, or empty placeholder. */
|
|
60
|
+
state?: LabelerLike;
|
|
61
|
+
/** Optional digest/noncer code for the committed `d` field. */
|
|
62
|
+
code?: string;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Inputs for building one `BoundState`.
|
|
66
|
+
*
|
|
67
|
+
* Adds the issuee key-state cross-anchor pair used by bound-state sextuples.
|
|
68
|
+
*/
|
|
69
|
+
export interface MakeBoundStateOptions extends MakeBlindStateOptions {
|
|
70
|
+
/** Bound issuee key-state sequence number. Defaults to placeholder `0`. */
|
|
71
|
+
bsn?: NumberLike;
|
|
72
|
+
/** Bound issuee key-state digest/nonce. Defaults to empty placeholder. */
|
|
73
|
+
bd?: NoncerLike;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Inputs for building one `TypeMedia`.
|
|
77
|
+
*
|
|
78
|
+
* This is the typed-media sibling to blind/bound state disclosure helpers.
|
|
79
|
+
*/
|
|
80
|
+
export interface MakeTypeMediaOptions extends MakeBlindUuidOptions {
|
|
81
|
+
/** Disclosure UUID. Omit to derive via `makeBlindUuid(...)`. */
|
|
82
|
+
uuid?: NoncerLike;
|
|
83
|
+
/** Media type label, such as `application/json`. */
|
|
84
|
+
mt?: LabelerLike;
|
|
85
|
+
/** Media value/payload text. */
|
|
86
|
+
mv?: TexterLike;
|
|
87
|
+
/** Optional digest/noncer code for the committed `d` field. */
|
|
88
|
+
code?: string;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Inputs for rebuilding one matching `BlindState` from a disclosed commitment.
|
|
92
|
+
*
|
|
93
|
+
* Search semantics:
|
|
94
|
+
* - `said` is the commitment being matched
|
|
95
|
+
* - `states` is the candidate state-label search space
|
|
96
|
+
* - the helper automatically includes the empty placeholder state and empty
|
|
97
|
+
* placeholder ACDC value so callers do not need to remember those cases
|
|
98
|
+
*/
|
|
99
|
+
export interface UnblindBlindStateOptions extends MakeBlindUuidOptions {
|
|
100
|
+
/** Target commitment nonce (`BlindState.d.nonce`) to match. */
|
|
101
|
+
said: string;
|
|
102
|
+
/** Disclosure UUID. Omit to deterministically reconstruct it. */
|
|
103
|
+
uuid?: NoncerLike;
|
|
104
|
+
/** Candidate disclosed ACDC/TEL SAID. Empty placeholder is auto-included. */
|
|
105
|
+
acdc?: NoncerLike;
|
|
106
|
+
/** Candidate state labels to try while searching for the matching record. */
|
|
107
|
+
states?: readonly LabelerLike[];
|
|
108
|
+
/** Optional digest/noncer code for recomputed candidates. */
|
|
109
|
+
code?: string;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Inputs for rebuilding one matching `BoundState` from a disclosed commitment.
|
|
113
|
+
*
|
|
114
|
+
* Search semantics:
|
|
115
|
+
* - `bounds` is the candidate `(bn, bd)` cross-anchor search space
|
|
116
|
+
* - the helper automatically includes placeholder `(0, "")`
|
|
117
|
+
*/
|
|
118
|
+
export interface UnblindBoundStateOptions extends UnblindBlindStateOptions {
|
|
119
|
+
/** Candidate issuee key-state cross-anchor pairs to try. */
|
|
120
|
+
bounds?: readonly (readonly [NumberLike, NoncerLike])[];
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Derive the deterministic disclosure UUID used by blinded/bound/media
|
|
124
|
+
* commitment records.
|
|
125
|
+
*
|
|
126
|
+
* KERIpy correspondence:
|
|
127
|
+
* - mirrors `Blinder.makeUUID(...)`
|
|
128
|
+
* - sequence numbers feed the salty path through `numh`, not decimal text
|
|
129
|
+
*/
|
|
130
|
+
export declare function makeBlindUuid({ raw, salt, sn, tier, }?: MakeBlindUuidOptions): Noncer;
|
|
131
|
+
/**
|
|
132
|
+
* Recompute the committed `d` field for one `BlindState`.
|
|
133
|
+
*
|
|
134
|
+
* KERIpy correspondence:
|
|
135
|
+
* - same semantic role as building `Blinder(..., makify=True)` for the
|
|
136
|
+
* blind-state quadruple without instantiating a transport wrapper
|
|
137
|
+
*/
|
|
138
|
+
export declare function commitBlindState(value: BlindStateRecord, code?: string): BlindStateRecord;
|
|
139
|
+
/**
|
|
140
|
+
* Recompute the committed `d` field for one `BoundState`.
|
|
141
|
+
*
|
|
142
|
+
* KERIpy correspondence:
|
|
143
|
+
* - same semantic role as the bound-state branch of `Blinder.blind(...)`
|
|
144
|
+
*/
|
|
145
|
+
export declare function commitBoundState(value: BoundStateRecord, code?: string): BoundStateRecord;
|
|
146
|
+
/**
|
|
147
|
+
* Recompute the committed `d` field for one `TypeMedia`.
|
|
148
|
+
*
|
|
149
|
+
* KERIpy correspondence:
|
|
150
|
+
* - same semantic role as `Mediar(..., makify=True)` for typed-media records
|
|
151
|
+
*/
|
|
152
|
+
export declare function commitTypeMedia(value: TypeMediaRecord, code?: string): TypeMediaRecord;
|
|
153
|
+
/**
|
|
154
|
+
* Build one blinded disclosure-state record and compute its `d` commitment.
|
|
155
|
+
*
|
|
156
|
+
* KERIpy correspondence:
|
|
157
|
+
* - mirrors `Blinder.blind(..., bound=False)`
|
|
158
|
+
*/
|
|
159
|
+
export declare function makeBlindState({ uuid, raw, salt, sn, tier, acdc, state, code, }?: MakeBlindStateOptions): BlindStateRecord;
|
|
160
|
+
/**
|
|
161
|
+
* Build one bound blinded-state record and compute its `d` commitment.
|
|
162
|
+
*
|
|
163
|
+
* KERIpy correspondence:
|
|
164
|
+
* - mirrors `Blinder.blind(..., bound=True)`
|
|
165
|
+
*/
|
|
166
|
+
export declare function makeBoundState({ uuid, raw, salt, sn, tier, acdc, state, bsn, bd, code, }?: MakeBoundStateOptions): BoundStateRecord;
|
|
167
|
+
/**
|
|
168
|
+
* Build one typed-media disclosure record and compute its `d` commitment.
|
|
169
|
+
*
|
|
170
|
+
* KERIpy correspondence:
|
|
171
|
+
* - matches `Mediar(..., makify=True)` without recreating a wrapper object
|
|
172
|
+
*/
|
|
173
|
+
export declare function makeTypeMedia({ uuid, raw, salt, sn, tier, mt, mv, code, }?: MakeTypeMediaOptions): TypeMediaRecord;
|
|
174
|
+
/**
|
|
175
|
+
* Rebuild the matching blinded-state candidate if one exists.
|
|
176
|
+
*
|
|
177
|
+
* KERIpy correspondence:
|
|
178
|
+
* - mirrors `Blinder.unblind(..., bound=False)`
|
|
179
|
+
* - tries the placeholder combinations too, so callers do not need to add the
|
|
180
|
+
* empty `acdc` / empty `state` cases themselves
|
|
181
|
+
*
|
|
182
|
+
* Search strategy:
|
|
183
|
+
* - derive or validate the UUID
|
|
184
|
+
* - try the candidate `acdc` plus empty placeholder
|
|
185
|
+
* - try each caller-supplied state plus empty placeholder
|
|
186
|
+
* - return the first candidate whose recomputed `d` matches `said`
|
|
187
|
+
*/
|
|
188
|
+
export declare function unblindBlindState({ said, uuid, raw, salt, sn, tier, acdc, states, code, }: UnblindBlindStateOptions): BlindStateRecord | null;
|
|
189
|
+
/**
|
|
190
|
+
* Rebuild the matching bound blinded-state candidate if one exists.
|
|
191
|
+
*
|
|
192
|
+
* KERIpy correspondence:
|
|
193
|
+
* - mirrors `Blinder.unblind(..., bound=True)`
|
|
194
|
+
* - tries placeholder bound pairs automatically by including `(0, "")`
|
|
195
|
+
*
|
|
196
|
+
* Search strategy:
|
|
197
|
+
* - same placeholder search as `unblindBlindState(...)`
|
|
198
|
+
* - plus candidate `(bn, bd)` pairs, with placeholder `(0, "")` always added
|
|
199
|
+
*/
|
|
200
|
+
export declare function unblindBoundState({ said, uuid, raw, salt, sn, tier, acdc, states, bounds, code, }: UnblindBoundStateOptions): BoundStateRecord | null;
|
|
201
|
+
//# sourceMappingURL=disclosure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disclosure.d.ts","sourceRoot":"","sources":["../../../src/src/primitives/disclosure.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAGlD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,EAEL,KAAK,UAAU,IAAI,gBAAgB,EAEnC,KAAK,UAAU,IAAI,gBAAgB,EAEnC,KAAK,SAAS,IAAI,eAAe,EAClC,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,eAAe,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEpE;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;AAE5D,+DAA+D;AAC/D,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;AAE9D,iEAAiE;AACjE,MAAM,MAAM,UAAU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O,EACP,IAAI,GACL,GAAE,oBAAyB,GAC3B,eAAe,CAUjB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAC/B,EACE,IAAI,EACJ,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,EAAM,EACN,IAAI,EACJ,IAAS,EACT,MAAW,EACX,IAAI,GACL,EAAE,wBAAwB,GAC1B,gBAAgB,GAAG,IAAI,CAuBzB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,EACE,IAAI,EACJ,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,EAAM,EACN,IAAI,EACJ,IAAS,EACT,MAAW,EACX,MAAW,EACX,IAAI,GACL,EAAE,wBAAwB,GAC1B,gBAAgB,GAAG,IAAI,CAmCzB"}
|
|
@@ -1,12 +1,74 @@
|
|
|
1
|
+
import { type ByteLike } from "./byte-like.js";
|
|
2
|
+
import { Cipher } from "./cipher.js";
|
|
1
3
|
import { Matter, type MatterInit } from "./matter.js";
|
|
4
|
+
import { type CipherHydratable } from "./primitive.js";
|
|
5
|
+
/**
|
|
6
|
+
* Supported constructor inputs for one public-key encrypter.
|
|
7
|
+
*
|
|
8
|
+
* Accepted forms mirror KERIpy's two mental models:
|
|
9
|
+
* - provide already-qualified X25519 public box material directly
|
|
10
|
+
* - provide an Ed25519 verifier key through `verkey` and derive the matching
|
|
11
|
+
* X25519 public box key during construction
|
|
12
|
+
*/
|
|
13
|
+
export interface EncrypterInit extends Omit<MatterInit, "raw" | "qb64b" | "qb64" | "qb2"> {
|
|
14
|
+
raw?: Uint8Array | ArrayBufferView;
|
|
15
|
+
qb64b?: Uint8Array | ArrayBufferView;
|
|
16
|
+
qb64?: ByteLike;
|
|
17
|
+
qb2?: Uint8Array | ArrayBufferView;
|
|
18
|
+
code?: string;
|
|
19
|
+
verkey?: ByteLike;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Plaintext inputs accepted by `Encrypter.encrypt(...)`.
|
|
23
|
+
*
|
|
24
|
+
* Precedence follows KERIpy:
|
|
25
|
+
* - explicit raw serialization through `ser`
|
|
26
|
+
* - otherwise one CESR primitive through `prim`
|
|
27
|
+
* - optional `code` names the plaintext family the resulting `Cipher` should
|
|
28
|
+
* preserve for later decryption/hydration
|
|
29
|
+
*/
|
|
30
|
+
export interface EncrypterEncryptOptions {
|
|
31
|
+
ser?: ByteLike;
|
|
32
|
+
prim?: CipherHydratable;
|
|
33
|
+
code?: string;
|
|
34
|
+
}
|
|
2
35
|
/**
|
|
3
36
|
* Public-key encryption primitive for asymmetric envelope encryption.
|
|
4
37
|
*
|
|
5
|
-
* KERIpy substance: Encrypter
|
|
6
|
-
*
|
|
7
|
-
* This TS class validates material type; encryption ops live in crypto layers.
|
|
38
|
+
* KERIpy substance: `Encrypter` owns the public X25519 material and can derive
|
|
39
|
+
* it from Ed25519 verifier keys used by non-transferable/basic AIDs.
|
|
8
40
|
*/
|
|
9
41
|
export declare class Encrypter extends Matter {
|
|
10
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Construct one X25519 public-key encrypter.
|
|
44
|
+
*
|
|
45
|
+
* Default code remains the KERIpy public-box family `MtrDex.X25519`.
|
|
46
|
+
*/
|
|
47
|
+
constructor(init: Matter | EncrypterInit);
|
|
48
|
+
/**
|
|
49
|
+
* Confirm whether the supplied Ed25519 seed maps to this X25519 public key.
|
|
50
|
+
*
|
|
51
|
+
* Boundary contract:
|
|
52
|
+
* - only Ed25519 signer seeds are accepted here
|
|
53
|
+
* - the check proves that the seed belongs to the AEID/verkey that was used
|
|
54
|
+
* to derive this encrypter's public box key
|
|
55
|
+
*/
|
|
56
|
+
verifySeed(seed: ByteLike): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Encrypt raw or primitive plaintext into one CESR `Cipher`.
|
|
59
|
+
*
|
|
60
|
+
* KERIpy parity:
|
|
61
|
+
* - `ser` wins when supplied
|
|
62
|
+
* - otherwise one primitive is required
|
|
63
|
+
* - omitted `code` defaults to stream-family `L0` only for raw `ser` input
|
|
64
|
+
*
|
|
65
|
+
* Plaintext-family rules:
|
|
66
|
+
* - `Salter` and `Signer` may infer fixed qb64 cipher families when `code`
|
|
67
|
+
* is omitted
|
|
68
|
+
* - other primitives require an explicit family so decrypt-time hydration
|
|
69
|
+
* knows whether the plaintext was stored as qb64, qb2, or a sniffable
|
|
70
|
+
* stream
|
|
71
|
+
*/
|
|
72
|
+
encrypt({ ser, prim, code }?: EncrypterEncryptOptions): Cipher;
|
|
11
73
|
}
|
|
12
74
|
//# sourceMappingURL=encrypter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encrypter.d.ts","sourceRoot":"","sources":["../../../src/src/primitives/encrypter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"encrypter.d.ts","sourceRoot":"","sources":["../../../src/src/primitives/encrypter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAAqB,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAQrC,OAAO,EAAE,MAAM,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,KAAK,gBAAgB,EAAwB,MAAM,gBAAgB,CAAC;AAO7E;;;;;;;GAOG;AACH,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,UAAU,EAAE,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;IACvF,GAAG,CAAC,EAAE,UAAU,GAAG,eAAe,CAAC;IACnC,KAAK,CAAC,EAAE,UAAU,GAAG,eAAe,CAAC;IACrC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,GAAG,CAAC,EAAE,UAAU,GAAG,eAAe,CAAC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,QAAQ,CAAC;CACnB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,uBAAuB;IACtC,GAAG,CAAC,EAAE,QAAQ,CAAC;IACf,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAuCD;;;;;GAKG;AACH,qBAAa,SAAU,SAAQ,MAAM;IACnC;;;;OAIG;gBACS,IAAI,EAAE,MAAM,GAAG,aAAa;IASxC;;;;;;;OAOG;IACH,UAAU,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO;IAWnC;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,GAAE,uBAA4B,GAAG,MAAM;CAkEnE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ColdCode } from "../core/types.js";
|
|
2
|
+
import { Indexer, type IndexerInit } from "./indexer.js";
|
|
3
|
+
import { Matter, type MatterInit } from "./matter.js";
|
|
4
|
+
/**
|
|
5
|
+
* Hydrate one low-level `Matter` into the narrowest safe primitive class.
|
|
6
|
+
*
|
|
7
|
+
* Maintainer rule:
|
|
8
|
+
* this is intentionally conservative, not aggressive. Many CESR codes are
|
|
9
|
+
* semantically overloaded across families (`0A`, `B`, `E`, tag/label codes,
|
|
10
|
+
* numeric threshold codes, etc.), so generic callers should only get an
|
|
11
|
+
* automatic narrowing when the code family is genuinely unambiguous.
|
|
12
|
+
*/
|
|
13
|
+
export declare function hydrateMatter(init: Matter | MatterInit): Matter;
|
|
14
|
+
/** Parse one text/binary matter token and hydrate it through `hydrateMatter()`. */
|
|
15
|
+
export declare function parseQualifiedMatter(input: Uint8Array, cold: Extract<ColdCode, "txt" | "bny">): Matter;
|
|
16
|
+
/** Hydrate one low-level `Indexer` into the narrowest safe primitive class. */
|
|
17
|
+
export declare function hydrateIndexer(init: Indexer | IndexerInit): Indexer;
|
|
18
|
+
/** Parse one text/binary indexer token and hydrate it through `hydrateIndexer()`. */
|
|
19
|
+
export declare function parseQualifiedIndexer(input: Uint8Array, cold: Extract<ColdCode, "txt" | "bny">): Indexer;
|
|
20
|
+
//# sourceMappingURL=hydrate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hydrate.d.ts","sourceRoot":"","sources":["../../../src/src/primitives/hydrate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAKjD,OAAO,EAAE,OAAO,EAAE,KAAK,WAAW,EAAgB,MAAM,cAAc,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,KAAK,UAAU,EAAe,MAAM,aAAa,CAAC;AAInE;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,CAiB/D;AAED,mFAAmF;AACnF,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,UAAU,EACjB,IAAI,EAAE,OAAO,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,CAAC,GACrC,MAAM,CAER;AAED,+EAA+E;AAC/E,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,WAAW,GAAG,OAAO,CAQnE;AAED,qFAAqF;AACrF,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,UAAU,EACjB,IAAI,EAAE,OAAO,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,CAAC,GACrC,OAAO,CAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ilker.d.ts","sourceRoot":"","sources":["../../../src/src/primitives/ilker.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,MAAM,EAAE,KAAK,UAAU,EAAe,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;;;GAKG;AACH,qBAAa,KAAM,SAAQ,MAAM;gBACnB,IAAI,EAAE,MAAM,GAAG,UAAU;
|
|
1
|
+
{"version":3,"file":"ilker.d.ts","sourceRoot":"","sources":["../../../src/src/primitives/ilker.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,MAAM,EAAE,KAAK,UAAU,EAAe,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;;;GAKG;AACH,qBAAa,KAAM,SAAQ,MAAM;gBACnB,IAAI,EAAE,MAAM,GAAG,UAAU;IAOrC,kEAAkE;IAClE,IAAI,GAAG,IAAI,MAAM,CAEhB;CACF;AAED,oDAAoD;AACpD,wBAAgB,UAAU,CACxB,KAAK,EAAE,UAAU,EACjB,IAAI,EAAE,OAAO,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,CAAC,GACrC,KAAK,CAEP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexer.d.ts","sourceRoot":"","sources":["../../../src/src/primitives/indexer.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"indexer.d.ts","sourceRoot":"","sources":["../../../src/src/primitives/indexer.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAIjD;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,UAAU,CAAC;CAClB;AAED,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,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OAAO,CAE/D;AAED,4DAA4D;AAC5D,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAEjE;AAED,mFAAmF;AACnF,wBAAgB,YAAY,CAC1B,KAAK,EAAE,UAAU,EACjB,IAAI,EAAE,OAAO,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,CAAC,GACrC,OAAO,CAIT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"labeler.d.ts","sourceRoot":"","sources":["../../../src/src/primitives/labeler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EAAE,MAAM,EAAE,KAAK,UAAU,EAAe,MAAM,aAAa,CAAC;AAKnE,mFAAmF;AACnF,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEnD;AAqBD;;;;;;GAMG;AACH,qBAAa,OAAQ,SAAQ,MAAM;gBACrB,IAAI,EAAE,MAAM,GAAG,UAAU;
|
|
1
|
+
{"version":3,"file":"labeler.d.ts","sourceRoot":"","sources":["../../../src/src/primitives/labeler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EAAE,MAAM,EAAE,KAAK,UAAU,EAAe,MAAM,aAAa,CAAC;AAKnE,mFAAmF;AACnF,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEnD;AAqBD;;;;;;GAMG;AACH,qBAAa,OAAQ,SAAQ,MAAM;gBACrB,IAAI,EAAE,MAAM,GAAG,UAAU;IAOrC,qDAAqD;IACrD,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,kEAAkE;IAClE,IAAI,KAAK,IAAI,MAAM,CAMlB;IAED,6DAA6D;IAC7D,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,2EAA2E;IAC3E,IAAI,KAAK,IAAI,MAAM,CAMlB;IAED,sDAAsD;IACtD,IAAI,KAAK,IAAI,UAAU,CAEtB;CACF;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,UAAU,EACjB,IAAI,EAAE,OAAO,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,CAAC,GACrC,OAAO,CAET"}
|
|
@@ -1,22 +1,50 @@
|
|
|
1
1
|
import type { ColdCode } from "../core/types.js";
|
|
2
2
|
import type { Versionage } from "../tables/table-types.js";
|
|
3
|
+
import type { Kind } from "../tables/versions.js";
|
|
3
4
|
import type { Primitive } from "./primitive.js";
|
|
4
5
|
type ParseDomain = Extract<ColdCode, "txt" | "bny">;
|
|
6
|
+
/** Scalar semantic values representable by CESR-native `Mapper` leaves. */
|
|
7
|
+
export type MapperScalar = null | boolean | number | string;
|
|
8
|
+
/** Recursive semantic map value representable by CESR-native `Mapper`. */
|
|
9
|
+
export type MapperValue = MapperScalar | MapperValue[] | MapperMap;
|
|
10
|
+
/** Semantic map form owned by `Mapper.mad`, aligned with KERIpy `dict` usage. */
|
|
11
|
+
export type MapperMap = {
|
|
12
|
+
[key: string]: MapperValue;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* `Mapper` is the base semantic primitive for CESR-native field maps.
|
|
16
|
+
*
|
|
17
|
+
* Read this file as three stacked layers:
|
|
18
|
+
* 1. syntax probing/tokenization helpers (`parse*Syntax`)
|
|
19
|
+
* 2. semantic value encode/decode helpers (`serializeValue`/`deserializeValue`)
|
|
20
|
+
* 3. the `Mapper` class that owns end-to-end map lifecycle
|
|
21
|
+
*
|
|
22
|
+
* Disclosure boundary:
|
|
23
|
+
* - `Mapper` / `Compactor` own arbitrary map disclosure
|
|
24
|
+
* - `Aggor` owns aggregate-list disclosure
|
|
25
|
+
* - fixed-field blinded disclosure lives separately in `structing.ts` +
|
|
26
|
+
* `disclosure.ts`
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* Semantic projection of one field in a native map body.
|
|
30
|
+
*
|
|
31
|
+
* Maintainer model:
|
|
32
|
+
* - `label` is the decoded field name from the map key token
|
|
33
|
+
* - `primitive` is the first token that represents the field value on the wire
|
|
34
|
+
* - `isCounter` distinguishes scalar primitives from grouped list/map values
|
|
35
|
+
* - `children` is only populated when the field value is itself a nested map
|
|
36
|
+
*
|
|
37
|
+
* This type intentionally sits between two worlds:
|
|
38
|
+
* syntax-oriented parser artifacts (`MapperBodySyntax`) and fully semantic
|
|
39
|
+
* `mad` values on `Mapper`. It is the readable middle layer used by tests,
|
|
40
|
+
* annotators, and maintainers inspecting native structure.
|
|
41
|
+
*/
|
|
5
42
|
export interface MapperField {
|
|
6
43
|
label: string | null;
|
|
7
44
|
primitive: Primitive;
|
|
8
45
|
isCounter: boolean;
|
|
9
46
|
children?: MapperField[];
|
|
10
47
|
}
|
|
11
|
-
export interface Mapper {
|
|
12
|
-
code: string;
|
|
13
|
-
count: number;
|
|
14
|
-
fullSize: number;
|
|
15
|
-
fullSizeB2: number;
|
|
16
|
-
totalSize: number;
|
|
17
|
-
totalSizeB2: number;
|
|
18
|
-
fields: MapperField[];
|
|
19
|
-
}
|
|
20
48
|
/** Label token artifact produced during map payload syntax parsing. */
|
|
21
49
|
export interface MapperLabelTokenSyntax {
|
|
22
50
|
kind: "label";
|
|
@@ -51,6 +79,29 @@ export interface MapperBodySyntax {
|
|
|
51
79
|
/** Ordered token artifacts from payload tokenization. */
|
|
52
80
|
entries: MapperSyntaxEntry[];
|
|
53
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Supported constructor inputs for `Mapper`.
|
|
84
|
+
*
|
|
85
|
+
* The important split is semantic-vs-wire:
|
|
86
|
+
* - provide `mad` when you already have a semantic map and want mapper-owned
|
|
87
|
+
* serialization / optional top-level saidification
|
|
88
|
+
* - provide `raw`/`qb64`/`qb64b`/`qb2` when you want mapper-owned inhale from
|
|
89
|
+
* an existing wire representation
|
|
90
|
+
*/
|
|
91
|
+
export interface MapperInit {
|
|
92
|
+
mad?: MapperMap;
|
|
93
|
+
raw?: Uint8Array;
|
|
94
|
+
qb64?: string;
|
|
95
|
+
qb64b?: Uint8Array;
|
|
96
|
+
qb2?: Uint8Array;
|
|
97
|
+
version?: Versionage;
|
|
98
|
+
strict?: boolean;
|
|
99
|
+
saids?: Record<string, string>;
|
|
100
|
+
saidive?: boolean;
|
|
101
|
+
makify?: boolean;
|
|
102
|
+
verify?: boolean;
|
|
103
|
+
kind?: Kind;
|
|
104
|
+
}
|
|
54
105
|
/** Convert syntax entries into labeled semantic map fields. */
|
|
55
106
|
export declare function interpretMapperBodySyntax(syntax: MapperBodySyntax): MapperField[];
|
|
56
107
|
/**
|
|
@@ -59,8 +110,78 @@ export declare function interpretMapperBodySyntax(syntax: MapperBodySyntax): Map
|
|
|
59
110
|
*/
|
|
60
111
|
export declare function parseMapperBodySyntax(input: Uint8Array, version: Versionage, domain: ParseDomain): MapperBodySyntax;
|
|
61
112
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
113
|
+
* Semantic CESR-native map primitive.
|
|
114
|
+
*
|
|
115
|
+
* KERIpy substance: `Mapper` is the reusable native field-map engine beneath
|
|
116
|
+
* compactable ACDC sections. It owns both the semantic map view (`mad`) and the
|
|
117
|
+
* exact enclosed native group serialization (`raw`, `qb64`, `qb2`).
|
|
118
|
+
*
|
|
119
|
+
* Cohesive mental model:
|
|
120
|
+
* 1. `parseMapperBodySyntax()` tokenizes raw native bytes into syntax artifacts.
|
|
121
|
+
* 2. `interpretMapperBodySyntax()` pairs those artifacts into readable fields.
|
|
122
|
+
* 3. `Mapper` owns the full semantic lifecycle: build from `mad`, or inhale
|
|
123
|
+
* from raw, then expose both semantic (`mad`) and wire (`raw`, `qb64`,
|
|
124
|
+
* `qb2`) views.
|
|
125
|
+
*
|
|
126
|
+
* Put differently:
|
|
127
|
+
* syntax helpers are for inspection and parser diagnostics;
|
|
128
|
+
* `Mapper` is for truth.
|
|
129
|
+
*
|
|
130
|
+
* Compare carefully:
|
|
131
|
+
* - use `Mapper` when the disclosed thing is a general map
|
|
132
|
+
* - do not use it for fixed-field blind/bound/media tuples, which have their
|
|
133
|
+
* own explicit schema and workflow layer
|
|
134
|
+
*/
|
|
135
|
+
export declare class Mapper {
|
|
136
|
+
code: string;
|
|
137
|
+
count: number;
|
|
138
|
+
fullSize: number;
|
|
139
|
+
fullSizeB2: number;
|
|
140
|
+
totalSize: number;
|
|
141
|
+
totalSizeB2: number;
|
|
142
|
+
fields: MapperField[];
|
|
143
|
+
raw: Uint8Array;
|
|
144
|
+
strict: boolean;
|
|
145
|
+
saids: Record<string, string>;
|
|
146
|
+
saidive: boolean;
|
|
147
|
+
kind: Kind;
|
|
148
|
+
_mad: MapperMap;
|
|
149
|
+
/**
|
|
150
|
+
* Create one semantic mapper from either a field map (`mad`) or raw bytes.
|
|
151
|
+
*
|
|
152
|
+
* Constructor modes:
|
|
153
|
+
* - semantic mode: caller provides `mad`, optional `makify`, optional
|
|
154
|
+
* `saidive`, and the constructor serializes deterministically
|
|
155
|
+
* - native inhale mode: caller provides `raw`/`qb64`/`qb64b`/`qb2` with
|
|
156
|
+
* `kind="CESR"` and the constructor decodes grouped native content
|
|
157
|
+
* - non-native inhale mode: caller provides raw JSON/CBOR/MGPK with
|
|
158
|
+
* `kind!="CESR"` and the constructor decodes via the corresponding codec
|
|
159
|
+
*/
|
|
160
|
+
constructor(init?: MapperInit);
|
|
161
|
+
static fromSad(mad: MapperMap, options?: Omit<MapperInit, "mad">): Mapper;
|
|
162
|
+
/**
|
|
163
|
+
* Serialize one semantic map into an enclosed CESR native map-group.
|
|
164
|
+
*
|
|
165
|
+
* The result includes the leading group counter. Nested maps/lists are
|
|
166
|
+
* recursively enclosed in their own grouped payloads.
|
|
167
|
+
*/
|
|
168
|
+
static serializeCesrMap(mad: MapperMap, strict?: boolean, dummy?: boolean, saids?: Record<string, string>): Uint8Array;
|
|
169
|
+
static serializeNonNativeMap(mad: MapperMap, kind: Exclude<Kind, "CESR">): Uint8Array;
|
|
170
|
+
static deserializeNonNativeMap(raw: Uint8Array, kind: Exclude<Kind, "CESR">): MapperMap;
|
|
171
|
+
get mad(): MapperMap;
|
|
172
|
+
get qb64b(): Uint8Array;
|
|
173
|
+
get qb64(): string;
|
|
174
|
+
get qb2(): Uint8Array;
|
|
175
|
+
get said(): string | null;
|
|
176
|
+
get size(): number;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Parse map-style native bodies/counters into a semantic `Mapper`.
|
|
180
|
+
*
|
|
181
|
+
* Compatibility wrapper: existing parser-oriented tests can keep calling this
|
|
182
|
+
* helper, while newer code can instantiate `Mapper` directly from `mad` or
|
|
183
|
+
* raw. This wrapper preserves the older parser-friendly feel while the class
|
|
184
|
+
* itself is the new semantic authority.
|
|
64
185
|
*/
|
|
65
186
|
export declare function parseMapperBody(input: Uint8Array, version: Versionage, domain: ParseDomain): Mapper;
|
|
66
187
|
/** True for counter codes that represent map/list-native aggregate primitives. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapper.d.ts","sourceRoot":"","sources":["../../../src/src/primitives/mapper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mapper.d.ts","sourceRoot":"","sources":["../../../src/src/primitives/mapper.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAKjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAQlD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD,KAAK,WAAW,GAAG,OAAO,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,CAAC,CAAC;AAEpD,2EAA2E;AAC3E,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAE5D,0EAA0E;AAC1E,MAAM,MAAM,WAAW,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