@charter-agreement-protocol/verifier 0.1.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/LICENSE +190 -0
- package/NOTICE +4 -0
- package/README.md +95 -0
- package/conformance/cases/acceptance-equivocation.json +1 -0
- package/conformance/cases/acceptance-verify.json +1 -0
- package/conformance/cases/base64url-decode.json +1 -0
- package/conformance/cases/canonicalization-encode.json +1 -0
- package/conformance/cases/chain-verify.json +1 -0
- package/conformance/cases/charter_revision-decode.json +1 -0
- package/conformance/cases/descriptor_chain-verify.json +1 -0
- package/conformance/cases/digest-hash.json +1 -0
- package/conformance/cases/governing_revision.json +1 -0
- package/conformance/cases/json-decode.json +1 -0
- package/conformance/cases/party_descriptor-verify.json +1 -0
- package/conformance/cases/receipt-verify.json +1 -0
- package/conformance/cases/schema-validate.json +1 -0
- package/conformance/cases/termination-verify.json +1 -0
- package/conformance/index.json +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +32 -0
- package/dist/core.d.ts +102 -0
- package/dist/core.js +1296 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +8 -0
- package/package.json +48 -0
package/dist/core.d.ts
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
export declare const CERTIFIED_INDEX_SHA256_BASE64URL = "SQYrs8WyUX4Bj_QlupjB_KYaMyjVjrnwvQ79sNkyIao";
|
|
2
|
+
export declare const CERTIFIED_REGISTRY_DIGEST = "sha-256:u754joyHGcLCTm1LYV2s6eHauUUdDfJDwwyhbAbxvzc";
|
|
3
|
+
export type CanonicalValue = null | boolean | number | string | CanonicalValue[] | {
|
|
4
|
+
[key: string]: CanonicalValue;
|
|
5
|
+
} | Number;
|
|
6
|
+
export type Projection = {
|
|
7
|
+
tag: "null";
|
|
8
|
+
} | {
|
|
9
|
+
tag: "boolean";
|
|
10
|
+
value: boolean;
|
|
11
|
+
} | {
|
|
12
|
+
tag: "integer";
|
|
13
|
+
value: number;
|
|
14
|
+
} | {
|
|
15
|
+
tag: "float";
|
|
16
|
+
value: number;
|
|
17
|
+
} | {
|
|
18
|
+
tag: "string";
|
|
19
|
+
value: string;
|
|
20
|
+
} | {
|
|
21
|
+
tag: "array";
|
|
22
|
+
items: Projection[];
|
|
23
|
+
} | {
|
|
24
|
+
tag: "object";
|
|
25
|
+
members: [string, Projection][];
|
|
26
|
+
};
|
|
27
|
+
export type DecodeResult = {
|
|
28
|
+
ok: true;
|
|
29
|
+
value: CanonicalValue;
|
|
30
|
+
} | {
|
|
31
|
+
ok: false;
|
|
32
|
+
code: string;
|
|
33
|
+
};
|
|
34
|
+
export type CaseResult = {
|
|
35
|
+
status: "valid";
|
|
36
|
+
output: unknown;
|
|
37
|
+
} | {
|
|
38
|
+
status: "invalid";
|
|
39
|
+
error_code: string;
|
|
40
|
+
};
|
|
41
|
+
export type CorpusFile = {
|
|
42
|
+
path: string;
|
|
43
|
+
sha256_base64url: string;
|
|
44
|
+
cases: number;
|
|
45
|
+
};
|
|
46
|
+
export type CorpusIndex = {
|
|
47
|
+
format: string;
|
|
48
|
+
corpus_digest: string;
|
|
49
|
+
registry_digest: string;
|
|
50
|
+
total_cases: number;
|
|
51
|
+
files: CorpusFile[];
|
|
52
|
+
applicability: Record<string, Record<string, unknown>>;
|
|
53
|
+
};
|
|
54
|
+
export type ConformanceCase = {
|
|
55
|
+
id: string;
|
|
56
|
+
surface: string;
|
|
57
|
+
class: string;
|
|
58
|
+
input: Record<string, any>;
|
|
59
|
+
expect: CaseResult;
|
|
60
|
+
};
|
|
61
|
+
export type LoadedCorpus = {
|
|
62
|
+
index: CorpusIndex;
|
|
63
|
+
indexBytes: Buffer;
|
|
64
|
+
cases: ConformanceCase[];
|
|
65
|
+
};
|
|
66
|
+
export type CaseOutcome = {
|
|
67
|
+
id: string;
|
|
68
|
+
surface: string;
|
|
69
|
+
agree: boolean;
|
|
70
|
+
expected: CaseResult;
|
|
71
|
+
actual: CaseResult;
|
|
72
|
+
};
|
|
73
|
+
export type ConformanceReport = {
|
|
74
|
+
format: string;
|
|
75
|
+
agreement: boolean;
|
|
76
|
+
exit_status: number;
|
|
77
|
+
total: number;
|
|
78
|
+
agreed: number;
|
|
79
|
+
disagreed: number;
|
|
80
|
+
corpus_digest: string;
|
|
81
|
+
registry_digest: string;
|
|
82
|
+
index_sha256_base64url: string;
|
|
83
|
+
results: CaseOutcome[];
|
|
84
|
+
};
|
|
85
|
+
export type ReportOutput = {
|
|
86
|
+
bytes: string;
|
|
87
|
+
exitStatus: number;
|
|
88
|
+
};
|
|
89
|
+
type Result<T> = {
|
|
90
|
+
ok: true;
|
|
91
|
+
value: T;
|
|
92
|
+
} | {
|
|
93
|
+
ok: false;
|
|
94
|
+
code: string;
|
|
95
|
+
};
|
|
96
|
+
export declare function canonical(value: CanonicalValue): string;
|
|
97
|
+
export declare function decodeJsonText(text: string): Result<CanonicalValue>;
|
|
98
|
+
export declare function jsonProjection(value: any): Projection;
|
|
99
|
+
export declare function loadCorpus(root: string): LoadedCorpus;
|
|
100
|
+
export declare function reportFor(root: string): ReportOutput;
|
|
101
|
+
export declare function selfChecks(): void;
|
|
102
|
+
export {};
|