@bsv/vsc 0.2.0-beta.1
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 +58 -0
- package/README.md +107 -0
- package/artifacts/context-0.1.0.jsonld +127 -0
- package/artifacts/disclosure-0.1.0.schema.json +526 -0
- package/artifacts/epcis/NOTICE.md +11 -0
- package/artifacts/epcis/epcis-context-2.0.1.jsonld +593 -0
- package/artifacts/epcis/epcis-json-schema-2.0.1.json +2352 -0
- package/artifacts/epcis/query-schema-2.0.1.json +968 -0
- package/artifacts/external/NOTICE.md +3 -0
- package/artifacts/external/dpp-external-passport-1.context.jsonld +8 -0
- package/artifacts/external/dpp-external-passport-1.schema.json +158 -0
- package/artifacts/profile-0.1.0.json +100 -0
- package/artifacts/seal-0.1.0.schema.json +535 -0
- package/artifacts/w3c/NOTICE.md +3 -0
- package/artifacts/w3c/credentials-v2.jsonld +340 -0
- package/dist/context.d.ts +9 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +50 -0
- package/dist/context.js.map +1 -0
- package/dist/crypto.d.ts +50 -0
- package/dist/crypto.d.ts.map +1 -0
- package/dist/crypto.js +141 -0
- package/dist/crypto.js.map +1 -0
- package/dist/did-web.d.ts +9 -0
- package/dist/did-web.d.ts.map +1 -0
- package/dist/did-web.js +66 -0
- package/dist/did-web.js.map +1 -0
- package/dist/epcis-source.d.ts +251 -0
- package/dist/epcis-source.d.ts.map +1 -0
- package/dist/epcis-source.js +573 -0
- package/dist/epcis-source.js.map +1 -0
- package/dist/epcis.d.ts +51 -0
- package/dist/epcis.d.ts.map +1 -0
- package/dist/epcis.js +171 -0
- package/dist/epcis.js.map +1 -0
- package/dist/exchange.d.ts +175 -0
- package/dist/exchange.d.ts.map +1 -0
- package/dist/exchange.js +491 -0
- package/dist/exchange.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/jcs.d.ts +25 -0
- package/dist/jcs.d.ts.map +1 -0
- package/dist/jcs.js +67 -0
- package/dist/jcs.js.map +1 -0
- package/dist/schema.d.ts +414 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +537 -0
- package/dist/schema.js.map +1 -0
- package/dist/types.d.ts +159 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/validation.d.ts +22 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +147 -0
- package/dist/validation.js.map +1 -0
- package/dist/verification.d.ts +10 -0
- package/dist/verification.d.ts.map +1 -0
- package/dist/verification.js +350 -0
- package/dist/verification.js.map +1 -0
- package/package.json +68 -0
package/dist/jcs.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RFC 8785, the JSON Canonicalization Scheme, as one small exact function.
|
|
3
|
+
*
|
|
4
|
+
* Object members are sorted by the UTF-16 code units of their names, which
|
|
5
|
+
* is what JavaScript's default string comparison does; numbers are written
|
|
6
|
+
* as ECMAScript's Number-to-string conversion writes them, which is what
|
|
7
|
+
* JSON.stringify writes for a finite number; strings are escaped as
|
|
8
|
+
* JSON.stringify escapes them (section 3.2.2.2: the short escapes, then
|
|
9
|
+
* \u00xx for the remaining control characters, everything else literal).
|
|
10
|
+
* Anything JSON cannot carry (undefined, a function, a symbol, a bigint, a
|
|
11
|
+
* non-finite number, a lone surrogate) is refused by name, so two
|
|
12
|
+
* implementations that both accept a value hash the same bytes.
|
|
13
|
+
*
|
|
14
|
+
* The EPCIS event-body digest (epcis-source.ts) is the reason this exists in
|
|
15
|
+
* this package: a retained source is compared by the digest of its canonical
|
|
16
|
+
* form, never by its formatting.
|
|
17
|
+
*/
|
|
18
|
+
export class JcsError extends Error {
|
|
19
|
+
constructor(path, detail) {
|
|
20
|
+
super(`${path} has no canonical form: ${detail}`);
|
|
21
|
+
this.name = 'JcsError';
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const LONE_SURROGATE = /[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/;
|
|
25
|
+
function serialise(value, path) {
|
|
26
|
+
if (value === null)
|
|
27
|
+
return 'null';
|
|
28
|
+
switch (typeof value) {
|
|
29
|
+
case 'boolean':
|
|
30
|
+
return value ? 'true' : 'false';
|
|
31
|
+
case 'number':
|
|
32
|
+
if (!Number.isFinite(value))
|
|
33
|
+
throw new JcsError(path, 'JSON has no representation of a non-finite number');
|
|
34
|
+
// JSON.stringify writes -0 as 0 and otherwise exactly the ES Number-to-string form the RFC requires.
|
|
35
|
+
return JSON.stringify(value);
|
|
36
|
+
case 'string':
|
|
37
|
+
if (LONE_SURROGATE.test(value))
|
|
38
|
+
throw new JcsError(path, 'a lone surrogate cannot be encoded as UTF-8');
|
|
39
|
+
return JSON.stringify(value);
|
|
40
|
+
case 'object': {
|
|
41
|
+
if (Array.isArray(value))
|
|
42
|
+
return `[${value.map((item, index) => serialise(item, `${path}/${index}`)).join(',')}]`;
|
|
43
|
+
const record = value;
|
|
44
|
+
const keys = Object.keys(record).sort();
|
|
45
|
+
const members = [];
|
|
46
|
+
for (const key of keys) {
|
|
47
|
+
if (LONE_SURROGATE.test(key))
|
|
48
|
+
throw new JcsError(`${path}/${key}`, 'a lone surrogate cannot be encoded as UTF-8');
|
|
49
|
+
if (record[key] === undefined)
|
|
50
|
+
throw new JcsError(`${path}/${key}`, 'undefined is not a JSON value');
|
|
51
|
+
members.push(`${JSON.stringify(key)}:${serialise(record[key], `${path}/${key}`)}`);
|
|
52
|
+
}
|
|
53
|
+
return `{${members.join(',')}}`;
|
|
54
|
+
}
|
|
55
|
+
default:
|
|
56
|
+
throw new JcsError(path, `${typeof value} is not a JSON value`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/** The RFC 8785 canonical JSON text of a value. Throws JcsError for anything JSON cannot carry. */
|
|
60
|
+
export function canonicalizeJcs(value) {
|
|
61
|
+
return serialise(value, '');
|
|
62
|
+
}
|
|
63
|
+
/** The canonical text as UTF-8 bytes, the form a digest is taken over. */
|
|
64
|
+
export function canonicalJcsBytes(value) {
|
|
65
|
+
return new TextEncoder().encode(canonicalizeJcs(value));
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=jcs.js.map
|
package/dist/jcs.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jcs.js","sourceRoot":"","sources":["../src/jcs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,QAAS,SAAQ,KAAK;IACjC,YAAY,IAAY,EAAE,MAAc;QACtC,KAAK,CAAC,GAAG,IAAI,2BAA2B,MAAM,EAAE,CAAC,CAAC;QAClD,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;IACzB,CAAC;CACF;AAED,MAAM,cAAc,GAAG,wEAAwE,CAAC;AAEhG,SAAS,SAAS,CAAC,KAAc,EAAE,IAAY;IAC7C,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,MAAM,CAAC;IAClC,QAAQ,OAAO,KAAK,EAAE,CAAC;QACrB,KAAK,SAAS;YACZ,OAAO,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;QAClC,KAAK,QAAQ;YACX,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;gBAAE,MAAM,IAAI,QAAQ,CAAC,IAAI,EAAE,mDAAmD,CAAC,CAAC;YAC3G,qGAAqG;YACrG,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC/B,KAAK,QAAQ;YACX,IAAI,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC;gBAAE,MAAM,IAAI,QAAQ,CAAC,IAAI,EAAE,6CAA6C,CAAC,CAAC;YACxG,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC/B,KAAK,QAAQ,CAAC,CAAC,CAAC;YACd,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;gBAAE,OAAO,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,IAAI,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;YAClH,MAAM,MAAM,GAAG,KAAgC,CAAC;YAChD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;YACxC,MAAM,OAAO,GAAa,EAAE,CAAC;YAC7B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;gBACvB,IAAI,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC;oBAAE,MAAM,IAAI,QAAQ,CAAC,GAAG,IAAI,IAAI,GAAG,EAAE,EAAE,6CAA6C,CAAC,CAAC;gBAClH,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,SAAS;oBAAE,MAAM,IAAI,QAAQ,CAAC,GAAG,IAAI,IAAI,GAAG,EAAE,EAAE,+BAA+B,CAAC,CAAC;gBACrG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,IAAI,IAAI,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;YACrF,CAAC;YACD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;QAClC,CAAC;QACD;YACE,MAAM,IAAI,QAAQ,CAAC,IAAI,EAAE,GAAG,OAAO,KAAK,sBAAsB,CAAC,CAAC;IACpE,CAAC;AACH,CAAC;AAED,mGAAmG;AACnG,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,OAAO,SAAS,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,iBAAiB,CAAC,KAAc;IAC9C,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;AAC1D,CAAC"}
|
package/dist/schema.d.ts
ADDED
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
export declare const sealSchema: {
|
|
2
|
+
readonly type: "object";
|
|
3
|
+
readonly properties: {
|
|
4
|
+
readonly "@context": {
|
|
5
|
+
readonly type: "array";
|
|
6
|
+
readonly items: {
|
|
7
|
+
readonly enum: readonly ["https://www.w3.org/ns/credentials/v2", "urn:bsv:vsc:context:0.1.0", "https://w3id.org/security/suites/ed25519-2020/v1", "https://w3id.org/security/data-integrity/v2"];
|
|
8
|
+
};
|
|
9
|
+
readonly minItems: 2;
|
|
10
|
+
};
|
|
11
|
+
readonly type: {
|
|
12
|
+
readonly const: readonly ["VerifiableCredential", "VSC-SEAL"];
|
|
13
|
+
};
|
|
14
|
+
readonly id: {
|
|
15
|
+
readonly type: "string";
|
|
16
|
+
readonly minLength: 1;
|
|
17
|
+
readonly format: "uri";
|
|
18
|
+
};
|
|
19
|
+
readonly issuer: {
|
|
20
|
+
readonly type: "string";
|
|
21
|
+
readonly minLength: 1;
|
|
22
|
+
readonly pattern: "^did:[a-z0-9]+:[^\\s]+$";
|
|
23
|
+
};
|
|
24
|
+
readonly issuanceDate: {
|
|
25
|
+
readonly type: "string";
|
|
26
|
+
readonly minLength: 1;
|
|
27
|
+
readonly format: "date-time";
|
|
28
|
+
};
|
|
29
|
+
readonly validFrom: {
|
|
30
|
+
readonly type: "string";
|
|
31
|
+
readonly minLength: 1;
|
|
32
|
+
readonly format: "date-time";
|
|
33
|
+
};
|
|
34
|
+
readonly validUntil: {
|
|
35
|
+
readonly type: "string";
|
|
36
|
+
readonly minLength: 1;
|
|
37
|
+
readonly format: "date-time";
|
|
38
|
+
};
|
|
39
|
+
readonly sealVersion: {
|
|
40
|
+
readonly const: "1.0";
|
|
41
|
+
};
|
|
42
|
+
readonly sealTimestamp: {
|
|
43
|
+
readonly type: "string";
|
|
44
|
+
readonly minLength: 1;
|
|
45
|
+
readonly format: "date-time";
|
|
46
|
+
};
|
|
47
|
+
readonly correctionOf: {
|
|
48
|
+
readonly anyOf: readonly [{
|
|
49
|
+
readonly type: "string";
|
|
50
|
+
readonly minLength: 1;
|
|
51
|
+
readonly format: "uri";
|
|
52
|
+
}, {
|
|
53
|
+
readonly type: "null";
|
|
54
|
+
}];
|
|
55
|
+
};
|
|
56
|
+
readonly credentialSubject: {
|
|
57
|
+
readonly type: "object";
|
|
58
|
+
readonly properties: {
|
|
59
|
+
readonly id: {
|
|
60
|
+
readonly type: "string";
|
|
61
|
+
readonly minLength: 1;
|
|
62
|
+
readonly format: "uri";
|
|
63
|
+
};
|
|
64
|
+
readonly predecessorCredentials: {
|
|
65
|
+
readonly type: "array";
|
|
66
|
+
readonly items: {
|
|
67
|
+
readonly type: "string";
|
|
68
|
+
readonly minLength: 1;
|
|
69
|
+
readonly format: "uri";
|
|
70
|
+
};
|
|
71
|
+
readonly minItems: 0;
|
|
72
|
+
readonly uniqueItems: true;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
readonly required: readonly ["id"];
|
|
76
|
+
readonly additionalProperties: false;
|
|
77
|
+
};
|
|
78
|
+
readonly credentialStatus: {
|
|
79
|
+
readonly type: "object";
|
|
80
|
+
readonly properties: {
|
|
81
|
+
readonly id: {
|
|
82
|
+
readonly type: "string";
|
|
83
|
+
readonly minLength: 1;
|
|
84
|
+
readonly format: "uri";
|
|
85
|
+
};
|
|
86
|
+
readonly type: {
|
|
87
|
+
readonly const: "BitstringStatusListEntry";
|
|
88
|
+
};
|
|
89
|
+
readonly statusPurpose: {
|
|
90
|
+
readonly enum: readonly ["revocation", "suspension"];
|
|
91
|
+
};
|
|
92
|
+
readonly statusListIndex: {
|
|
93
|
+
readonly type: "string";
|
|
94
|
+
readonly pattern: "^(0|[1-9][0-9]*)$";
|
|
95
|
+
};
|
|
96
|
+
readonly statusListCredential: {
|
|
97
|
+
readonly type: "string";
|
|
98
|
+
readonly minLength: 1;
|
|
99
|
+
readonly format: "uri";
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
readonly required: readonly ["id", "type", "statusPurpose", "statusListIndex", "statusListCredential"];
|
|
103
|
+
readonly additionalProperties: false;
|
|
104
|
+
};
|
|
105
|
+
readonly eventVector: {
|
|
106
|
+
readonly type: "object";
|
|
107
|
+
readonly properties: {
|
|
108
|
+
readonly what: {
|
|
109
|
+
readonly type: "object";
|
|
110
|
+
readonly properties: {
|
|
111
|
+
readonly productIdentifiers: {
|
|
112
|
+
readonly type: "array";
|
|
113
|
+
readonly items: {
|
|
114
|
+
readonly type: "object";
|
|
115
|
+
readonly properties: {
|
|
116
|
+
readonly scheme: {
|
|
117
|
+
readonly type: "string";
|
|
118
|
+
readonly minLength: 1;
|
|
119
|
+
};
|
|
120
|
+
readonly value: {
|
|
121
|
+
readonly type: "string";
|
|
122
|
+
readonly minLength: 1;
|
|
123
|
+
};
|
|
124
|
+
readonly schemeAuthority: {
|
|
125
|
+
readonly type: "string";
|
|
126
|
+
readonly minLength: 1;
|
|
127
|
+
};
|
|
128
|
+
readonly serialNumber: {
|
|
129
|
+
readonly type: "string";
|
|
130
|
+
readonly minLength: 1;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
readonly required: readonly ["scheme", "value", "schemeAuthority"];
|
|
134
|
+
readonly additionalProperties: false;
|
|
135
|
+
};
|
|
136
|
+
readonly minItems: 1;
|
|
137
|
+
};
|
|
138
|
+
readonly classifications: {
|
|
139
|
+
readonly type: "array";
|
|
140
|
+
readonly items: {
|
|
141
|
+
readonly type: "object";
|
|
142
|
+
};
|
|
143
|
+
readonly minItems: 0;
|
|
144
|
+
};
|
|
145
|
+
readonly batchOrLot: {
|
|
146
|
+
readonly type: "string";
|
|
147
|
+
readonly minLength: 1;
|
|
148
|
+
};
|
|
149
|
+
readonly expiryDate: {
|
|
150
|
+
readonly type: "string";
|
|
151
|
+
readonly format: "date";
|
|
152
|
+
};
|
|
153
|
+
readonly quantity: {
|
|
154
|
+
readonly type: "number";
|
|
155
|
+
readonly minimum: 0;
|
|
156
|
+
};
|
|
157
|
+
readonly quantityUnit: {
|
|
158
|
+
readonly type: "string";
|
|
159
|
+
readonly minLength: 1;
|
|
160
|
+
};
|
|
161
|
+
readonly description: {
|
|
162
|
+
readonly type: "string";
|
|
163
|
+
readonly minLength: 1;
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
readonly required: readonly ["productIdentifiers"];
|
|
167
|
+
readonly additionalProperties: false;
|
|
168
|
+
readonly dependencies: {
|
|
169
|
+
readonly quantity: readonly ["quantityUnit"];
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
readonly when: {
|
|
173
|
+
readonly type: "object";
|
|
174
|
+
readonly properties: {
|
|
175
|
+
readonly eventTime: {
|
|
176
|
+
readonly type: "string";
|
|
177
|
+
readonly minLength: 1;
|
|
178
|
+
readonly format: "date-time";
|
|
179
|
+
};
|
|
180
|
+
readonly recordedAt: {
|
|
181
|
+
readonly type: "string";
|
|
182
|
+
readonly minLength: 1;
|
|
183
|
+
readonly format: "date-time";
|
|
184
|
+
};
|
|
185
|
+
readonly timezone: {
|
|
186
|
+
readonly type: "string";
|
|
187
|
+
readonly minLength: 1;
|
|
188
|
+
};
|
|
189
|
+
readonly timePrecision: {
|
|
190
|
+
readonly enum: readonly ["millisecond", "second", "minute"];
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
readonly required: readonly ["eventTime", "recordedAt", "timezone", "timePrecision"];
|
|
194
|
+
readonly additionalProperties: false;
|
|
195
|
+
};
|
|
196
|
+
readonly where: {
|
|
197
|
+
readonly type: "object";
|
|
198
|
+
readonly properties: {
|
|
199
|
+
readonly jurisdiction: {
|
|
200
|
+
readonly type: "string";
|
|
201
|
+
readonly pattern: "^[A-Z]{2}$";
|
|
202
|
+
};
|
|
203
|
+
readonly readPoint: {
|
|
204
|
+
readonly type: "object";
|
|
205
|
+
};
|
|
206
|
+
readonly businessLocation: {
|
|
207
|
+
readonly type: "object";
|
|
208
|
+
};
|
|
209
|
+
readonly geoCoordinates: {
|
|
210
|
+
readonly type: "object";
|
|
211
|
+
readonly properties: {
|
|
212
|
+
readonly latitude: {
|
|
213
|
+
readonly type: "number";
|
|
214
|
+
readonly minimum: -90;
|
|
215
|
+
readonly maximum: 90;
|
|
216
|
+
};
|
|
217
|
+
readonly longitude: {
|
|
218
|
+
readonly type: "number";
|
|
219
|
+
readonly minimum: -180;
|
|
220
|
+
readonly maximum: 180;
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
readonly required: readonly ["latitude", "longitude"];
|
|
224
|
+
readonly additionalProperties: false;
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
readonly required: readonly ["jurisdiction"];
|
|
228
|
+
readonly additionalProperties: false;
|
|
229
|
+
};
|
|
230
|
+
readonly who: {
|
|
231
|
+
readonly type: "object";
|
|
232
|
+
readonly properties: {
|
|
233
|
+
readonly actorDid: {
|
|
234
|
+
readonly type: "string";
|
|
235
|
+
readonly minLength: 1;
|
|
236
|
+
readonly pattern: "^did:[a-z0-9]+:[^\\s]+$";
|
|
237
|
+
};
|
|
238
|
+
readonly actorRole: {
|
|
239
|
+
readonly type: "string";
|
|
240
|
+
readonly minLength: 1;
|
|
241
|
+
};
|
|
242
|
+
readonly assertionMethod: {
|
|
243
|
+
readonly type: "string";
|
|
244
|
+
readonly minLength: 1;
|
|
245
|
+
readonly pattern: "^did:[a-z0-9]+:[^\\s]+$";
|
|
246
|
+
};
|
|
247
|
+
readonly actorLicense: {
|
|
248
|
+
readonly type: "object";
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
readonly required: readonly ["actorDid", "actorRole", "assertionMethod"];
|
|
252
|
+
readonly additionalProperties: false;
|
|
253
|
+
};
|
|
254
|
+
readonly how: {
|
|
255
|
+
readonly type: "object";
|
|
256
|
+
readonly properties: {
|
|
257
|
+
readonly eventType: {
|
|
258
|
+
readonly type: "string";
|
|
259
|
+
readonly minLength: 1;
|
|
260
|
+
};
|
|
261
|
+
readonly eventTypeVocab: {
|
|
262
|
+
readonly type: "string";
|
|
263
|
+
readonly minLength: 1;
|
|
264
|
+
readonly pattern: "^urn:";
|
|
265
|
+
};
|
|
266
|
+
readonly businessStep: {
|
|
267
|
+
readonly type: "string";
|
|
268
|
+
readonly minLength: 1;
|
|
269
|
+
};
|
|
270
|
+
readonly disposition: {
|
|
271
|
+
readonly enum: readonly ["active", "in_transit", "stored", "transshipped", "returned", "transformed", "received", "dispensed", "destroyed"];
|
|
272
|
+
};
|
|
273
|
+
readonly action: {
|
|
274
|
+
readonly enum: readonly ["ADD", "OBSERVE", "DELETE"];
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
readonly required: readonly ["eventType", "eventTypeVocab", "businessStep", "disposition", "action"];
|
|
278
|
+
readonly additionalProperties: false;
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
readonly required: readonly ["what", "when", "where", "who", "how"];
|
|
282
|
+
readonly additionalProperties: false;
|
|
283
|
+
};
|
|
284
|
+
readonly extensions: {
|
|
285
|
+
readonly type: "object";
|
|
286
|
+
readonly properties: {
|
|
287
|
+
readonly "+Dn": {
|
|
288
|
+
readonly type: "object";
|
|
289
|
+
readonly additionalProperties: {
|
|
290
|
+
readonly type: "object";
|
|
291
|
+
};
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
readonly required: readonly ["+Dn"];
|
|
295
|
+
readonly additionalProperties: false;
|
|
296
|
+
};
|
|
297
|
+
readonly chainOfCustody: {
|
|
298
|
+
readonly type: "object";
|
|
299
|
+
readonly properties: {
|
|
300
|
+
readonly chainId: {
|
|
301
|
+
readonly type: "string";
|
|
302
|
+
readonly minLength: 1;
|
|
303
|
+
readonly format: "uri";
|
|
304
|
+
};
|
|
305
|
+
readonly sequenceNumber: {
|
|
306
|
+
readonly type: "integer";
|
|
307
|
+
readonly minimum: 1;
|
|
308
|
+
readonly maximum: 9007199254740991;
|
|
309
|
+
};
|
|
310
|
+
readonly parentSeals: {
|
|
311
|
+
readonly type: "array";
|
|
312
|
+
readonly items: {
|
|
313
|
+
readonly type: "string";
|
|
314
|
+
readonly minLength: 1;
|
|
315
|
+
readonly format: "uri";
|
|
316
|
+
};
|
|
317
|
+
readonly minItems: 0;
|
|
318
|
+
readonly uniqueItems: true;
|
|
319
|
+
};
|
|
320
|
+
readonly childSeals: {
|
|
321
|
+
readonly type: "array";
|
|
322
|
+
readonly items: {
|
|
323
|
+
readonly type: "string";
|
|
324
|
+
readonly minLength: 1;
|
|
325
|
+
readonly format: "uri";
|
|
326
|
+
};
|
|
327
|
+
readonly minItems: 0;
|
|
328
|
+
readonly uniqueItems: true;
|
|
329
|
+
};
|
|
330
|
+
readonly topology: {
|
|
331
|
+
readonly enum: readonly ["linear", "fork", "merge", "transform", "correction"];
|
|
332
|
+
};
|
|
333
|
+
readonly topologyNote: {
|
|
334
|
+
readonly type: "string";
|
|
335
|
+
readonly minLength: 1;
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
readonly required: readonly ["chainId", "sequenceNumber", "parentSeals", "topology"];
|
|
339
|
+
readonly additionalProperties: false;
|
|
340
|
+
};
|
|
341
|
+
readonly proof: {
|
|
342
|
+
readonly anyOf: readonly [{
|
|
343
|
+
readonly type: "object";
|
|
344
|
+
readonly properties: {
|
|
345
|
+
readonly type: {
|
|
346
|
+
readonly enum: readonly ["Ed25519Signature2020", "DataIntegrityProof"];
|
|
347
|
+
};
|
|
348
|
+
readonly verificationMethod: {
|
|
349
|
+
readonly type: "string";
|
|
350
|
+
readonly minLength: 1;
|
|
351
|
+
readonly pattern: "^did:[a-z0-9]+:[^\\s]+$";
|
|
352
|
+
};
|
|
353
|
+
readonly proofPurpose: {
|
|
354
|
+
readonly const: "assertionMethod";
|
|
355
|
+
};
|
|
356
|
+
readonly proofValue: {
|
|
357
|
+
readonly type: "string";
|
|
358
|
+
readonly minLength: 1;
|
|
359
|
+
readonly pattern: "^[zu][A-Za-z0-9_-]+$";
|
|
360
|
+
};
|
|
361
|
+
readonly created: {
|
|
362
|
+
readonly type: "string";
|
|
363
|
+
readonly minLength: 1;
|
|
364
|
+
readonly format: "date-time";
|
|
365
|
+
};
|
|
366
|
+
readonly cryptosuite: {
|
|
367
|
+
readonly const: "bbs-2023";
|
|
368
|
+
};
|
|
369
|
+
};
|
|
370
|
+
readonly required: readonly ["type", "verificationMethod", "proofPurpose", "proofValue"];
|
|
371
|
+
readonly additionalProperties: false;
|
|
372
|
+
}, {
|
|
373
|
+
readonly type: "array";
|
|
374
|
+
readonly items: {
|
|
375
|
+
readonly type: "object";
|
|
376
|
+
readonly properties: {
|
|
377
|
+
readonly type: {
|
|
378
|
+
readonly enum: readonly ["Ed25519Signature2020", "DataIntegrityProof"];
|
|
379
|
+
};
|
|
380
|
+
readonly verificationMethod: {
|
|
381
|
+
readonly type: "string";
|
|
382
|
+
readonly minLength: 1;
|
|
383
|
+
readonly pattern: "^did:[a-z0-9]+:[^\\s]+$";
|
|
384
|
+
};
|
|
385
|
+
readonly proofPurpose: {
|
|
386
|
+
readonly const: "assertionMethod";
|
|
387
|
+
};
|
|
388
|
+
readonly proofValue: {
|
|
389
|
+
readonly type: "string";
|
|
390
|
+
readonly minLength: 1;
|
|
391
|
+
readonly pattern: "^[zu][A-Za-z0-9_-]+$";
|
|
392
|
+
};
|
|
393
|
+
readonly created: {
|
|
394
|
+
readonly type: "string";
|
|
395
|
+
readonly minLength: 1;
|
|
396
|
+
readonly format: "date-time";
|
|
397
|
+
};
|
|
398
|
+
readonly cryptosuite: {
|
|
399
|
+
readonly const: "bbs-2023";
|
|
400
|
+
};
|
|
401
|
+
};
|
|
402
|
+
readonly required: readonly ["type", "verificationMethod", "proofPurpose", "proofValue"];
|
|
403
|
+
readonly additionalProperties: false;
|
|
404
|
+
};
|
|
405
|
+
readonly minItems: 1;
|
|
406
|
+
}];
|
|
407
|
+
};
|
|
408
|
+
};
|
|
409
|
+
readonly required: readonly ["@context", "type", "id", "issuer", "issuanceDate", "validFrom", "sealVersion", "sealTimestamp", "correctionOf", "credentialSubject", "credentialStatus", "eventVector", "extensions", "chainOfCustody", "proof"];
|
|
410
|
+
readonly additionalProperties: false;
|
|
411
|
+
readonly $schema: "http://json-schema.org/draft-07/schema#";
|
|
412
|
+
readonly $id: "urn:bsv:vsc:schema:0.1.0";
|
|
413
|
+
};
|
|
414
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAshBb,CAAC"}
|