@openvtc/trust-tasks 0.12.13 → 0.12.14

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.
@@ -0,0 +1,413 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vtc/relationships/graph/0.2/payload.schema.json
4
+ */
5
+
6
+ export interface VTCRelationshipsGraphPayload {
7
+ ext?: Ext;
8
+ }
9
+ /**
10
+ * Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.
11
+ */
12
+ export interface Ext {
13
+ [k: string]: unknown | undefined;
14
+ }
15
+ export interface VTCRelationshipsGraphResponsePayload {
16
+ /**
17
+ * One per distinct DID appearing in a live edge. No isolated nodes.
18
+ */
19
+ nodes: GraphNode[];
20
+ /**
21
+ * One per **pair** of identifiers with at least one live credential between them, not one per credential.
22
+ */
23
+ edges: GraphEdge[];
24
+ ext?: Ext;
25
+ }
26
+ export interface GraphNode {
27
+ /**
28
+ * A DID participating in at least one live relationship.
29
+ */
30
+ did: string;
31
+ }
32
+ /**
33
+ * One edge between a **pair** of identifiers, carrying every half published between them.
34
+ *
35
+ * `0.1` called each credential an edge, which made a DTG edge inexpressible: the two directed halves between the same pair are one relationship, and a consumer given a flat list had to re-derive that pairing — sorting DIDs, grouping, and deciding for itself what `complete` means. Two implementations doing that independently will disagree at the margins, which is exactly the reasoning a schema exists to settle once.
36
+ */
37
+ export interface GraphEdge {
38
+ /**
39
+ * The two endpoints, DID-sorted. Sorting gives the pair one identity whichever half was published first. Both entries are equal only for a self-issued credential.
40
+ *
41
+ * @minItems 2
42
+ * @maxItems 2
43
+ */
44
+ endpoints: [string, string];
45
+ /**
46
+ * Every credential published between the endpoints, oldest first. One for a half-edge, two for the ordinary reciprocated edge, more where a party has re-issued.
47
+ *
48
+ * @minItems 1
49
+ */
50
+ halves: [GraphHalf, ...GraphHalf[]];
51
+ /**
52
+ * True when both endpoints have asserted about each other. The distinction a flat list cannot make: an edge asserted by one party is a claim, and an edge asserted by both is a relationship.
53
+ */
54
+ complete: boolean;
55
+ }
56
+ /**
57
+ * One published relationship credential: a **directed half** of an edge, asserted by `issuerDid` about `subjectDid`.
58
+ *
59
+ * Body-free on purpose — the graph shows the shape of the trust network, not credential contents. `id` is the row identifier a revoke takes.
60
+ */
61
+ export interface GraphHalf {
62
+ id: string;
63
+ /**
64
+ * The asserting party.
65
+ */
66
+ issuerDid: string;
67
+ /**
68
+ * The party asserted about.
69
+ */
70
+ subjectDid: string;
71
+ createdAt: string;
72
+ /**
73
+ * The persona this issuer has asserted on this half, when they have.
74
+ *
75
+ * The one place deliberate correlation becomes visible: two pairwise halves carrying the same `personaDid` are the same party, said so by that party. A consumer that cannot read it cannot honour a correlation its subject chose to publish.
76
+ */
77
+ personaDid?: string | null;
78
+ }
79
+
80
+ /** Trust Task type URI. */
81
+ export const TYPE_URI = "https://trusttasks.org/spec/vtc/relationships/graph/0.2" as const;
82
+
83
+ /** Stable alias for this specification's request payload shape. */
84
+ export type Payload = VTCRelationshipsGraphPayload;
85
+
86
+ /** Trust Task response type URI (request type URI + "#response"). */
87
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/relationships/graph/0.2#response" as const;
88
+
89
+ /** Stable alias for this specification's success-response payload shape. */
90
+ export type Response = VTCRelationshipsGraphResponsePayload;
91
+
92
+ /**
93
+ * This specification's payload schema, as a value.
94
+ *
95
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
96
+ * rather than only as a `.json` file because TypeScript types are erased
97
+ * at runtime: without a schema a consumer has nothing to validate, and
98
+ * every REQUIRED payload member is optional in practice. Cross-file
99
+ * `$ref`s are already inlined, so it needs no resolver.
100
+ */
101
+ export const PAYLOAD_SCHEMA = {
102
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
103
+ "$id": "https://trusttasks.org/spec/vtc/relationships/graph/0.2",
104
+ "title": "VTC Relationships Graph — payload",
105
+ "type": "object",
106
+ "additionalProperties": false,
107
+ "properties": {
108
+ "ext": {
109
+ "$ref": "#/$defs/Ext"
110
+ }
111
+ },
112
+ "$defs": {
113
+ "Response": {
114
+ "$anchor": "response",
115
+ "title": "VTC Relationships Graph — response payload",
116
+ "type": "object",
117
+ "additionalProperties": false,
118
+ "required": [
119
+ "nodes",
120
+ "edges"
121
+ ],
122
+ "properties": {
123
+ "nodes": {
124
+ "type": "array",
125
+ "items": {
126
+ "$ref": "#/$defs/GraphNode"
127
+ },
128
+ "description": "One per distinct DID appearing in a live edge. No isolated nodes."
129
+ },
130
+ "edges": {
131
+ "type": "array",
132
+ "items": {
133
+ "$ref": "#/$defs/GraphEdge"
134
+ },
135
+ "description": "One per **pair** of identifiers with at least one live credential between them, not one per credential."
136
+ },
137
+ "ext": {
138
+ "$ref": "#/$defs/Ext"
139
+ }
140
+ }
141
+ },
142
+ "GraphNode": {
143
+ "$anchor": "graphNode",
144
+ "title": "GraphNode",
145
+ "type": "object",
146
+ "additionalProperties": false,
147
+ "required": [
148
+ "did"
149
+ ],
150
+ "properties": {
151
+ "did": {
152
+ "type": "string",
153
+ "minLength": 1,
154
+ "description": "A DID participating in at least one live relationship."
155
+ }
156
+ }
157
+ },
158
+ "GraphEdge": {
159
+ "$anchor": "graphEdge",
160
+ "title": "GraphEdge",
161
+ "type": "object",
162
+ "additionalProperties": false,
163
+ "required": [
164
+ "endpoints",
165
+ "halves",
166
+ "complete"
167
+ ],
168
+ "properties": {
169
+ "endpoints": {
170
+ "type": "array",
171
+ "items": {
172
+ "type": "string",
173
+ "pattern": "^did:"
174
+ },
175
+ "minItems": 2,
176
+ "maxItems": 2,
177
+ "description": "The two endpoints, DID-sorted. Sorting gives the pair one identity whichever half was published first. Both entries are equal only for a self-issued credential."
178
+ },
179
+ "halves": {
180
+ "type": "array",
181
+ "items": {
182
+ "$ref": "#/$defs/GraphHalf"
183
+ },
184
+ "minItems": 1,
185
+ "description": "Every credential published between the endpoints, oldest first. One for a half-edge, two for the ordinary reciprocated edge, more where a party has re-issued."
186
+ },
187
+ "complete": {
188
+ "type": "boolean",
189
+ "description": "True when both endpoints have asserted about each other. The distinction a flat list cannot make: an edge asserted by one party is a claim, and an edge asserted by both is a relationship."
190
+ }
191
+ },
192
+ "description": "One edge between a **pair** of identifiers, carrying every half published between them.\n\n`0.1` called each credential an edge, which made a DTG edge inexpressible: the two directed halves between the same pair are one relationship, and a consumer given a flat list had to re-derive that pairing — sorting DIDs, grouping, and deciding for itself what `complete` means. Two implementations doing that independently will disagree at the margins, which is exactly the reasoning a schema exists to settle once."
193
+ },
194
+ "GraphHalf": {
195
+ "$anchor": "graphHalf",
196
+ "title": "GraphHalf",
197
+ "type": "object",
198
+ "additionalProperties": false,
199
+ "description": "One published relationship credential: a **directed half** of an edge, asserted by `issuerDid` about `subjectDid`.\n\nBody-free on purpose — the graph shows the shape of the trust network, not credential contents. `id` is the row identifier a revoke takes.",
200
+ "required": [
201
+ "id",
202
+ "issuerDid",
203
+ "subjectDid",
204
+ "createdAt"
205
+ ],
206
+ "properties": {
207
+ "id": {
208
+ "type": "string",
209
+ "minLength": 1
210
+ },
211
+ "issuerDid": {
212
+ "type": "string",
213
+ "pattern": "^did:",
214
+ "description": "The asserting party."
215
+ },
216
+ "subjectDid": {
217
+ "type": "string",
218
+ "pattern": "^did:",
219
+ "description": "The party asserted about."
220
+ },
221
+ "createdAt": {
222
+ "type": "string",
223
+ "format": "date-time"
224
+ },
225
+ "personaDid": {
226
+ "type": [
227
+ "string",
228
+ "null"
229
+ ],
230
+ "pattern": "^did:|^$",
231
+ "description": "The persona this issuer has asserted on this half, when they have.\n\nThe one place deliberate correlation becomes visible: two pairwise halves carrying the same `personaDid` are the same party, said so by that party. A consumer that cannot read it cannot honour a correlation its subject chose to publish."
232
+ }
233
+ }
234
+ },
235
+ "Ext": {
236
+ "title": "Ext",
237
+ "description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
238
+ "type": "object",
239
+ "minProperties": 1,
240
+ "additionalProperties": true,
241
+ "propertyNames": {
242
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
243
+ }
244
+ }
245
+ }
246
+ } as const;
247
+
248
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
249
+ export const RESPONSE_PAYLOAD_SCHEMA = {
250
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
251
+ "$ref": "#/$defs/Response",
252
+ "$defs": {
253
+ "Response": {
254
+ "$anchor": "response",
255
+ "title": "VTC Relationships Graph — response payload",
256
+ "type": "object",
257
+ "additionalProperties": false,
258
+ "required": [
259
+ "nodes",
260
+ "edges"
261
+ ],
262
+ "properties": {
263
+ "nodes": {
264
+ "type": "array",
265
+ "items": {
266
+ "$ref": "#/$defs/GraphNode"
267
+ },
268
+ "description": "One per distinct DID appearing in a live edge. No isolated nodes."
269
+ },
270
+ "edges": {
271
+ "type": "array",
272
+ "items": {
273
+ "$ref": "#/$defs/GraphEdge"
274
+ },
275
+ "description": "One per **pair** of identifiers with at least one live credential between them, not one per credential."
276
+ },
277
+ "ext": {
278
+ "$ref": "#/$defs/Ext"
279
+ }
280
+ }
281
+ },
282
+ "GraphNode": {
283
+ "$anchor": "graphNode",
284
+ "title": "GraphNode",
285
+ "type": "object",
286
+ "additionalProperties": false,
287
+ "required": [
288
+ "did"
289
+ ],
290
+ "properties": {
291
+ "did": {
292
+ "type": "string",
293
+ "minLength": 1,
294
+ "description": "A DID participating in at least one live relationship."
295
+ }
296
+ }
297
+ },
298
+ "GraphEdge": {
299
+ "$anchor": "graphEdge",
300
+ "title": "GraphEdge",
301
+ "type": "object",
302
+ "additionalProperties": false,
303
+ "required": [
304
+ "endpoints",
305
+ "halves",
306
+ "complete"
307
+ ],
308
+ "properties": {
309
+ "endpoints": {
310
+ "type": "array",
311
+ "items": {
312
+ "type": "string",
313
+ "pattern": "^did:"
314
+ },
315
+ "minItems": 2,
316
+ "maxItems": 2,
317
+ "description": "The two endpoints, DID-sorted. Sorting gives the pair one identity whichever half was published first. Both entries are equal only for a self-issued credential."
318
+ },
319
+ "halves": {
320
+ "type": "array",
321
+ "items": {
322
+ "$ref": "#/$defs/GraphHalf"
323
+ },
324
+ "minItems": 1,
325
+ "description": "Every credential published between the endpoints, oldest first. One for a half-edge, two for the ordinary reciprocated edge, more where a party has re-issued."
326
+ },
327
+ "complete": {
328
+ "type": "boolean",
329
+ "description": "True when both endpoints have asserted about each other. The distinction a flat list cannot make: an edge asserted by one party is a claim, and an edge asserted by both is a relationship."
330
+ }
331
+ },
332
+ "description": "One edge between a **pair** of identifiers, carrying every half published between them.\n\n`0.1` called each credential an edge, which made a DTG edge inexpressible: the two directed halves between the same pair are one relationship, and a consumer given a flat list had to re-derive that pairing — sorting DIDs, grouping, and deciding for itself what `complete` means. Two implementations doing that independently will disagree at the margins, which is exactly the reasoning a schema exists to settle once."
333
+ },
334
+ "GraphHalf": {
335
+ "$anchor": "graphHalf",
336
+ "title": "GraphHalf",
337
+ "type": "object",
338
+ "additionalProperties": false,
339
+ "description": "One published relationship credential: a **directed half** of an edge, asserted by `issuerDid` about `subjectDid`.\n\nBody-free on purpose — the graph shows the shape of the trust network, not credential contents. `id` is the row identifier a revoke takes.",
340
+ "required": [
341
+ "id",
342
+ "issuerDid",
343
+ "subjectDid",
344
+ "createdAt"
345
+ ],
346
+ "properties": {
347
+ "id": {
348
+ "type": "string",
349
+ "minLength": 1
350
+ },
351
+ "issuerDid": {
352
+ "type": "string",
353
+ "pattern": "^did:",
354
+ "description": "The asserting party."
355
+ },
356
+ "subjectDid": {
357
+ "type": "string",
358
+ "pattern": "^did:",
359
+ "description": "The party asserted about."
360
+ },
361
+ "createdAt": {
362
+ "type": "string",
363
+ "format": "date-time"
364
+ },
365
+ "personaDid": {
366
+ "type": [
367
+ "string",
368
+ "null"
369
+ ],
370
+ "pattern": "^did:|^$",
371
+ "description": "The persona this issuer has asserted on this half, when they have.\n\nThe one place deliberate correlation becomes visible: two pairwise halves carrying the same `personaDid` are the same party, said so by that party. A consumer that cannot read it cannot honour a correlation its subject chose to publish."
372
+ }
373
+ }
374
+ },
375
+ "Ext": {
376
+ "title": "Ext",
377
+ "description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
378
+ "type": "object",
379
+ "minProperties": 1,
380
+ "additionalProperties": true,
381
+ "propertyNames": {
382
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
383
+ }
384
+ }
385
+ }
386
+ } as const;
387
+
388
+ /**
389
+ * SPEC.md §7.2 policy for the request variant, from this specification's
390
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
391
+ * per-specification and cannot be derived from the document alone, and
392
+ * item 2 needs the schema this carries.
393
+ */
394
+ export const SPEC = {
395
+ typeUri: TYPE_URI,
396
+ isBearer: false,
397
+ isProofRequired: false,
398
+ isRecipientRequired: true,
399
+ payloadSchema: PAYLOAD_SCHEMA,
400
+ } as const;
401
+
402
+ /**
403
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
404
+ * tracks the *issuer* party's requirement because a response swaps the
405
+ * parties (§7.3 item 5).
406
+ */
407
+ export const RESPONSE_SPEC = {
408
+ typeUri: RESPONSE_TYPE_URI,
409
+ isBearer: false,
410
+ isProofRequired: false,
411
+ isRecipientRequired: true,
412
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
413
+ } as const;