@openvtc/trust-tasks 0.19.4 → 0.19.6

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.
Files changed (32) hide show
  1. package/CHANGELOG.md +95 -0
  2. package/dist/index.d.ts +5 -0
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +5 -0
  5. package/dist/index.js.map +1 -1
  6. package/dist/vta/webvh/dids/realign-keys/1.0/payload.d.ts +484 -0
  7. package/dist/vta/webvh/dids/realign-keys/1.0/payload.d.ts.map +1 -0
  8. package/dist/vta/webvh/dids/realign-keys/1.0/payload.js +259 -0
  9. package/dist/vta/webvh/dids/realign-keys/1.0/payload.js.map +1 -0
  10. package/dist/vtc/registry/records/list/0.1/payload.d.ts +576 -0
  11. package/dist/vtc/registry/records/list/0.1/payload.d.ts.map +1 -0
  12. package/dist/vtc/registry/records/list/0.1/payload.js +312 -0
  13. package/dist/vtc/registry/records/list/0.1/payload.js.map +1 -0
  14. package/dist/vtc/registry/sync-jobs/discard/0.1/payload.d.ts +254 -0
  15. package/dist/vtc/registry/sync-jobs/discard/0.1/payload.d.ts.map +1 -0
  16. package/dist/vtc/registry/sync-jobs/discard/0.1/payload.js +145 -0
  17. package/dist/vtc/registry/sync-jobs/discard/0.1/payload.js.map +1 -0
  18. package/dist/vtc/registry/sync-jobs/list/0.1/payload.d.ts +584 -0
  19. package/dist/vtc/registry/sync-jobs/list/0.1/payload.d.ts.map +1 -0
  20. package/dist/vtc/registry/sync-jobs/list/0.1/payload.js +343 -0
  21. package/dist/vtc/registry/sync-jobs/list/0.1/payload.js.map +1 -0
  22. package/dist/vtc/registry/sync-jobs/retry/0.1/payload.d.ts +474 -0
  23. package/dist/vtc/registry/sync-jobs/retry/0.1/payload.d.ts.map +1 -0
  24. package/dist/vtc/registry/sync-jobs/retry/0.1/payload.js +269 -0
  25. package/dist/vtc/registry/sync-jobs/retry/0.1/payload.js.map +1 -0
  26. package/package.json +1 -1
  27. package/src/index.ts +5 -0
  28. package/src/vta/webvh/dids/realign-keys/1.0/payload.ts +332 -0
  29. package/src/vtc/registry/records/list/0.1/payload.ts +407 -0
  30. package/src/vtc/registry/sync-jobs/discard/0.1/payload.ts +184 -0
  31. package/src/vtc/registry/sync-jobs/list/0.1/payload.ts +433 -0
  32. package/src/vtc/registry/sync-jobs/retry/0.1/payload.ts +331 -0
@@ -0,0 +1,269 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vtc/registry/sync-jobs/retry/0.1/payload.schema.json
4
+ */
5
+ /** Trust Task type URI. */
6
+ export const TYPE_URI = "https://trusttasks.org/spec/vtc/registry/sync-jobs/retry/0.1";
7
+ /** Trust Task response type URI (request type URI + "#response"). */
8
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/registry/sync-jobs/retry/0.1#response";
9
+ /**
10
+ * This specification's payload schema, as a value.
11
+ *
12
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
13
+ * rather than only as a `.json` file because TypeScript types are erased
14
+ * at runtime: without a schema a consumer has nothing to validate, and
15
+ * every REQUIRED payload member is optional in practice. Cross-file
16
+ * `$ref`s are already inlined, so it needs no resolver.
17
+ */
18
+ export const PAYLOAD_SCHEMA = {
19
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
20
+ "$id": "https://trusttasks.org/spec/vtc/registry/sync-jobs/retry/0.1",
21
+ "title": "VTC Registry Sync Jobs Retry — payload",
22
+ "description": "Requeue an abandoned trust-registry reconciliation job so the community's reconciler dispatches it again.",
23
+ "type": "object",
24
+ "additionalProperties": false,
25
+ "oneOf": [
26
+ {
27
+ "required": [
28
+ "jobId"
29
+ ],
30
+ "not": {
31
+ "required": [
32
+ "allFailed"
33
+ ]
34
+ }
35
+ },
36
+ {
37
+ "required": [
38
+ "allFailed"
39
+ ],
40
+ "not": {
41
+ "required": [
42
+ "jobId"
43
+ ]
44
+ }
45
+ }
46
+ ],
47
+ "properties": {
48
+ "jobId": {
49
+ "type": "string",
50
+ "minLength": 1,
51
+ "description": "The single job to requeue, from `vtc/registry/sync-jobs/list`."
52
+ },
53
+ "allFailed": {
54
+ "type": "boolean",
55
+ "const": true,
56
+ "description": "Requeue every job in the terminal `failed` state. Spelled as its own member rather than an absent `jobId` so that a client bug which drops the identifier cannot silently become a bulk operation."
57
+ },
58
+ "ext": {
59
+ "$ref": "#/$defs/Ext"
60
+ }
61
+ },
62
+ "$defs": {
63
+ "Requeued": {
64
+ "type": "object",
65
+ "additionalProperties": false,
66
+ "required": [
67
+ "jobId"
68
+ ],
69
+ "properties": {
70
+ "jobId": {
71
+ "type": "string",
72
+ "minLength": 1
73
+ },
74
+ "memberDid": {
75
+ "type": "string",
76
+ "minLength": 1,
77
+ "description": "The member whose record the requeued job carries."
78
+ },
79
+ "ext": {
80
+ "$ref": "#/$defs/Ext"
81
+ }
82
+ }
83
+ },
84
+ "Skipped": {
85
+ "type": "object",
86
+ "additionalProperties": false,
87
+ "required": [
88
+ "jobId",
89
+ "reason"
90
+ ],
91
+ "properties": {
92
+ "jobId": {
93
+ "type": "string",
94
+ "minLength": 1
95
+ },
96
+ "reason": {
97
+ "type": "string",
98
+ "enum": [
99
+ "notFailed",
100
+ "notFound"
101
+ ],
102
+ "description": "`notFailed` — the reconciler still owns the job, so requeueing it would dispatch the same mutation twice. `notFound` — no such job; it may already have been retried, discarded, or swept."
103
+ },
104
+ "ext": {
105
+ "$ref": "#/$defs/Ext"
106
+ }
107
+ }
108
+ },
109
+ "Response": {
110
+ "$anchor": "response",
111
+ "title": "VTC Registry Sync Jobs Retry — response payload",
112
+ "type": "object",
113
+ "additionalProperties": false,
114
+ "required": [
115
+ "requeued",
116
+ "skipped"
117
+ ],
118
+ "properties": {
119
+ "requeued": {
120
+ "type": "array",
121
+ "items": {
122
+ "$ref": "#/$defs/Requeued"
123
+ },
124
+ "description": "Jobs now scheduled for dispatch. Empty is a valid answer and is not an error."
125
+ },
126
+ "skipped": {
127
+ "type": "array",
128
+ "items": {
129
+ "$ref": "#/$defs/Skipped"
130
+ },
131
+ "description": "Jobs the maintainer declined to requeue, each with why. Reported rather than failing the task, so a bulk retry is not defeated by one ineligible row."
132
+ },
133
+ "ext": {
134
+ "$ref": "#/$defs/Ext"
135
+ }
136
+ }
137
+ },
138
+ "Ext": {
139
+ "title": "Ext",
140
+ "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.",
141
+ "type": "object",
142
+ "minProperties": 1,
143
+ "additionalProperties": true,
144
+ "propertyNames": {
145
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
146
+ }
147
+ }
148
+ }
149
+ };
150
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
151
+ export const RESPONSE_PAYLOAD_SCHEMA = {
152
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
153
+ "$ref": "#/$defs/Response",
154
+ "$defs": {
155
+ "Requeued": {
156
+ "type": "object",
157
+ "additionalProperties": false,
158
+ "required": [
159
+ "jobId"
160
+ ],
161
+ "properties": {
162
+ "jobId": {
163
+ "type": "string",
164
+ "minLength": 1
165
+ },
166
+ "memberDid": {
167
+ "type": "string",
168
+ "minLength": 1,
169
+ "description": "The member whose record the requeued job carries."
170
+ },
171
+ "ext": {
172
+ "$ref": "#/$defs/Ext"
173
+ }
174
+ }
175
+ },
176
+ "Skipped": {
177
+ "type": "object",
178
+ "additionalProperties": false,
179
+ "required": [
180
+ "jobId",
181
+ "reason"
182
+ ],
183
+ "properties": {
184
+ "jobId": {
185
+ "type": "string",
186
+ "minLength": 1
187
+ },
188
+ "reason": {
189
+ "type": "string",
190
+ "enum": [
191
+ "notFailed",
192
+ "notFound"
193
+ ],
194
+ "description": "`notFailed` — the reconciler still owns the job, so requeueing it would dispatch the same mutation twice. `notFound` — no such job; it may already have been retried, discarded, or swept."
195
+ },
196
+ "ext": {
197
+ "$ref": "#/$defs/Ext"
198
+ }
199
+ }
200
+ },
201
+ "Response": {
202
+ "$anchor": "response",
203
+ "title": "VTC Registry Sync Jobs Retry — response payload",
204
+ "type": "object",
205
+ "additionalProperties": false,
206
+ "required": [
207
+ "requeued",
208
+ "skipped"
209
+ ],
210
+ "properties": {
211
+ "requeued": {
212
+ "type": "array",
213
+ "items": {
214
+ "$ref": "#/$defs/Requeued"
215
+ },
216
+ "description": "Jobs now scheduled for dispatch. Empty is a valid answer and is not an error."
217
+ },
218
+ "skipped": {
219
+ "type": "array",
220
+ "items": {
221
+ "$ref": "#/$defs/Skipped"
222
+ },
223
+ "description": "Jobs the maintainer declined to requeue, each with why. Reported rather than failing the task, so a bulk retry is not defeated by one ineligible row."
224
+ },
225
+ "ext": {
226
+ "$ref": "#/$defs/Ext"
227
+ }
228
+ }
229
+ },
230
+ "Ext": {
231
+ "title": "Ext",
232
+ "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.",
233
+ "type": "object",
234
+ "minProperties": 1,
235
+ "additionalProperties": true,
236
+ "propertyNames": {
237
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
238
+ }
239
+ }
240
+ }
241
+ };
242
+ /**
243
+ * SPEC.md §7.2 policy for the request variant, from this specification's
244
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
245
+ * per-specification and cannot be derived from the document alone, and
246
+ * item 2 needs the schema this carries.
247
+ */
248
+ export const SPEC = {
249
+ typeUri: TYPE_URI,
250
+ isBearer: false,
251
+ isProofRequired: true,
252
+ isRecipientRequired: true,
253
+ isIssuedAtRequired: true,
254
+ payloadSchema: PAYLOAD_SCHEMA,
255
+ };
256
+ /**
257
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
258
+ * tracks the *issuer* party's requirement because a response swaps the
259
+ * parties (§7.3 item 5).
260
+ */
261
+ export const RESPONSE_SPEC = {
262
+ typeUri: RESPONSE_TYPE_URI,
263
+ isBearer: false,
264
+ isProofRequired: true,
265
+ isRecipientRequired: true,
266
+ isIssuedAtRequired: true,
267
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
268
+ };
269
+ //# sourceMappingURL=payload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payload.js","sourceRoot":"","sources":["../../../../../../src/vtc/registry/sync-jobs/retry/0.1/payload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqDH,2BAA2B;AAC3B,MAAM,CAAC,MAAM,QAAQ,GAAG,8DAAuE,CAAC;AAKhG,qEAAqE;AACrE,MAAM,CAAC,MAAM,iBAAiB,GAAG,uEAAgF,CAAC;AAKlH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,SAAS,EAAE,8CAA8C;IACzD,KAAK,EAAE,8DAA8D;IACrE,OAAO,EAAE,wCAAwC;IACjD,aAAa,EAAE,2GAA2G;IAC1H,MAAM,EAAE,QAAQ;IAChB,sBAAsB,EAAE,KAAK;IAC7B,OAAO,EAAE;QACP;YACE,UAAU,EAAE;gBACV,OAAO;aACR;YACD,KAAK,EAAE;gBACL,UAAU,EAAE;oBACV,WAAW;iBACZ;aACF;SACF;QACD;YACE,UAAU,EAAE;gBACV,WAAW;aACZ;YACD,KAAK,EAAE;gBACL,UAAU,EAAE;oBACV,OAAO;iBACR;aACF;SACF;KACF;IACD,YAAY,EAAE;QACZ,OAAO,EAAE;YACP,MAAM,EAAE,QAAQ;YAChB,WAAW,EAAE,CAAC;YACd,aAAa,EAAE,gEAAgE;SAChF;QACD,WAAW,EAAE;YACX,MAAM,EAAE,SAAS;YACjB,OAAO,EAAE,IAAI;YACb,aAAa,EAAE,oMAAoM;SACpN;QACD,KAAK,EAAE;YACL,MAAM,EAAE,aAAa;SACtB;KACF;IACD,OAAO,EAAE;QACP,UAAU,EAAE;YACV,MAAM,EAAE,QAAQ;YAChB,sBAAsB,EAAE,KAAK;YAC7B,UAAU,EAAE;g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AE;oBACV,MAAM,EAAE,OAAO;oBACf,OAAO,EAAE;wBACP,MAAM,EAAE,kBAAkB;qBAC3B;oBACD,aAAa,EAAE,+EAA+E;iBAC/F;gBACD,SAAS,EAAE;oBACT,MAAM,EAAE,OAAO;oBACf,OAAO,EAAE;wBACP,MAAM,EAAE,iBAAiB;qBAC1B;oBACD,aAAa,EAAE,uJAAuJ;iBACvK;gBACD,KAAK,EAAE;oBACL,MAAM,EAAE,aAAa;iBACtB;aACF;SACF;QACD,KAAK,EAAE;YACL,OAAO,EAAE,KAAK;YACd,aAAa,EAAE,uKAAuK;YACtL,MAAM,EAAE,QAAQ;YAChB,eAAe,EAAE,CAAC;YAClB,sBAAsB,EAAE,IAAI;YAC5B,eAAe,EAAE;gBACf,SAAS,EAAE,mCAAmC;aAC/C;SACF;KACF;CACO,CAAC;AAEX;;;;;GAKG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,OAAO,EAAE,QAAQ;IACjB,QAAQ,EAAE,KAAK;IACf,eAAe,EAAE,IAAI;IACrB,mBAAmB,EAAE,IAAI;IACzB,kBAAkB,EAAE,IAAI;IACxB,aAAa,EAAE,cAAc;CACrB,CAAC;AAEX;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,OAAO,EAAE,iBAAiB;IAC1B,QAAQ,EAAE,KAAK;IACf,eAAe,EAAE,IAAI;IACrB,mBAAmB,EAAE,IAAI;IACzB,kBAAkB,EAAE,IAAI;IACxB,aAAa,EAAE,uBAAuB;CAC9B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openvtc/trust-tasks",
3
- "version": "0.19.4",
3
+ "version": "0.19.6",
4
4
  "description": "Generated TypeScript bindings for the Trust Tasks framework registry.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/index.ts CHANGED
@@ -407,6 +407,7 @@ export * as VtaWebvhDidsCreate_v1_0 from "./vta/webvh/dids/create/1.0/payload.js
407
407
  export * as VtaWebvhDidsDelete_v1_0 from "./vta/webvh/dids/delete/1.0/payload.js";
408
408
  export * as VtaWebvhDidsGet_v1_0 from "./vta/webvh/dids/get/1.0/payload.js";
409
409
  export * as VtaWebvhDidsList_v1_0 from "./vta/webvh/dids/list/1.0/payload.js";
410
+ export * as VtaWebvhDidsRealignKeys_v1_0 from "./vta/webvh/dids/realign-keys/1.0/payload.js";
410
411
  export * as VtaWebvhDidsRegisterWithServer_v1_0 from "./vta/webvh/dids/register-with-server/1.0/payload.js";
411
412
  export * as VtaWebvhDidsRotateKeys_v1_0 from "./vta/webvh/dids/rotate-keys/1.0/payload.js";
412
413
  export * as VtaWebvhDidsUpdate_v1_0 from "./vta/webvh/dids/update/1.0/payload.js";
@@ -491,6 +492,10 @@ export * as VtcMembersVmc_v0_1 from "./vtc/members/vmc/0.1/payload.js";
491
492
  export * as VtcPoliciesTest_v0_1 from "./vtc/policies/test/0.1/payload.js";
492
493
  export * as VtcRecognitionCheck_v0_1 from "./vtc/recognition/check/0.1/payload.js";
493
494
  export * as VtcRegistryDiagnostics_v0_1 from "./vtc/registry/diagnostics/0.1/payload.js";
495
+ export * as VtcRegistryRecordsList_v0_1 from "./vtc/registry/records/list/0.1/payload.js";
496
+ export * as VtcRegistrySyncJobsDiscard_v0_1 from "./vtc/registry/sync-jobs/discard/0.1/payload.js";
497
+ export * as VtcRegistrySyncJobsList_v0_1 from "./vtc/registry/sync-jobs/list/0.1/payload.js";
498
+ export * as VtcRegistrySyncJobsRetry_v0_1 from "./vtc/registry/sync-jobs/retry/0.1/payload.js";
494
499
  export * as VtcRelationshipsGraph_v0_1 from "./vtc/relationships/graph/0.1/payload.js";
495
500
  export * as VtcRelationshipsGraph_v0_2 from "./vtc/relationships/graph/0.2/payload.js";
496
501
  export * as VtcRelationshipsList_v0_1 from "./vtc/relationships/list/0.1/payload.js";
@@ -0,0 +1,332 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vta/webvh/dids/realign-keys/1.0/payload.schema.json
4
+ */
5
+
6
+ import type { Ext } from "../../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * Rename a did:webvh's key records so each is addressed by the verification-method identifier its published document declares. The payload names no identifier but the DID: every target is derived by the recipient from that DID's own document.
11
+ */
12
+ export interface VTAWebVHDIDsRealignKeysPayload {
13
+ /**
14
+ * The DID whose key records are to be realigned. The only identifier the producer chooses.
15
+ */
16
+ did: string;
17
+ /**
18
+ * Compute and report the realignment without performing it. Absent reads as false.
19
+ */
20
+ dryRun?: boolean;
21
+ ext?: Ext;
22
+ }
23
+ /**
24
+ * Success response to vta/webvh/dids/realign-keys. Type https://trusttasks.org/spec/vta/webvh/dids/realign-keys/1.0#response.
25
+ */
26
+ export interface VTAWebVHDIDsRealignKeysResponsePayload {
27
+ did: string;
28
+ /**
29
+ * The renames performed, or in a dry run the ones that would be.
30
+ */
31
+ moved: ARecordRenamedOntoTheIdentifierItsKeyIsPublishedUnder[];
32
+ /**
33
+ * Verification-method identifiers whose record was already correct.
34
+ */
35
+ alreadyAligned: string[];
36
+ /**
37
+ * Verification-method identifiers the recipient holds no key for. Not a failure — a DID may publish a method whose private half lives elsewhere — but the difference between this being empty and not is the difference between the DID being consistent and merely unchanged.
38
+ */
39
+ unmatched: string[];
40
+ /**
41
+ * Where the recipient will allocate the next identifier it mints for this DID. Past everything the document already publishes, so a later rotation cannot reissue a published identifier under new key material.
42
+ */
43
+ nextFragmentId: number;
44
+ /**
45
+ * True when nothing was written. Echoed so a report is self-describing: a plan and a receipt are otherwise the same shape.
46
+ */
47
+ dryRun: boolean;
48
+ ext?: Ext;
49
+ }
50
+ export interface ARecordRenamedOntoTheIdentifierItsKeyIsPublishedUnder {
51
+ /**
52
+ * The identifier the record had.
53
+ */
54
+ from: string;
55
+ /**
56
+ * The verification-method identifier it takes.
57
+ */
58
+ to: string;
59
+ /**
60
+ * Multibase public half of the key, which is what identified the record. Reported so the producer can check the rename against the published document rather than trusting this report.
61
+ */
62
+ publicKey: string;
63
+ }
64
+
65
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
66
+ export type { Ext };
67
+
68
+ /** Trust Task type URI. */
69
+ export const TYPE_URI = "https://trusttasks.org/spec/vta/webvh/dids/realign-keys/1.0" as const;
70
+
71
+ /** Stable alias for this specification's request payload shape. */
72
+ export type Payload = VTAWebVHDIDsRealignKeysPayload;
73
+
74
+ /** Trust Task response type URI (request type URI + "#response"). */
75
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/webvh/dids/realign-keys/1.0#response" as const;
76
+
77
+ /** Stable alias for this specification's success-response payload shape. */
78
+ export type Response = VTAWebVHDIDsRealignKeysResponsePayload;
79
+
80
+ /**
81
+ * This specification's payload schema, as a value.
82
+ *
83
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
84
+ * rather than only as a `.json` file because TypeScript types are erased
85
+ * at runtime: without a schema a consumer has nothing to validate, and
86
+ * every REQUIRED payload member is optional in practice. Cross-file
87
+ * `$ref`s are already inlined, so it needs no resolver.
88
+ */
89
+ export const PAYLOAD_SCHEMA = {
90
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
91
+ "$id": "https://trusttasks.org/spec/vta/webvh/dids/realign-keys/1.0",
92
+ "title": "VTA WebVH DIDs Realign-Keys — payload",
93
+ "description": "Rename a did:webvh's key records so each is addressed by the verification-method identifier its published document declares. The payload names no identifier but the DID: every target is derived by the recipient from that DID's own document.",
94
+ "type": "object",
95
+ "additionalProperties": false,
96
+ "required": [
97
+ "did"
98
+ ],
99
+ "properties": {
100
+ "did": {
101
+ "type": "string",
102
+ "minLength": 1,
103
+ "description": "The DID whose key records are to be realigned. The only identifier the producer chooses."
104
+ },
105
+ "dryRun": {
106
+ "type": "boolean",
107
+ "description": "Compute and report the realignment without performing it. Absent reads as false."
108
+ },
109
+ "ext": {
110
+ "$ref": "#/$defs/Ext"
111
+ }
112
+ },
113
+ "$defs": {
114
+ "Response": {
115
+ "$anchor": "response",
116
+ "title": "VTA WebVH DIDs Realign-Keys — response payload",
117
+ "description": "Success response to vta/webvh/dids/realign-keys. Type https://trusttasks.org/spec/vta/webvh/dids/realign-keys/1.0#response.",
118
+ "type": "object",
119
+ "additionalProperties": false,
120
+ "required": [
121
+ "did",
122
+ "moved",
123
+ "alreadyAligned",
124
+ "unmatched",
125
+ "nextFragmentId",
126
+ "dryRun"
127
+ ],
128
+ "properties": {
129
+ "did": {
130
+ "type": "string"
131
+ },
132
+ "moved": {
133
+ "type": "array",
134
+ "description": "The renames performed, or in a dry run the ones that would be.",
135
+ "items": {
136
+ "$ref": "#/$defs/RealignedKey"
137
+ }
138
+ },
139
+ "alreadyAligned": {
140
+ "type": "array",
141
+ "description": "Verification-method identifiers whose record was already correct.",
142
+ "items": {
143
+ "type": "string"
144
+ }
145
+ },
146
+ "unmatched": {
147
+ "type": "array",
148
+ "description": "Verification-method identifiers the recipient holds no key for. Not a failure — a DID may publish a method whose private half lives elsewhere — but the difference between this being empty and not is the difference between the DID being consistent and merely unchanged.",
149
+ "items": {
150
+ "type": "string"
151
+ }
152
+ },
153
+ "nextFragmentId": {
154
+ "type": "integer",
155
+ "minimum": 0,
156
+ "description": "Where the recipient will allocate the next identifier it mints for this DID. Past everything the document already publishes, so a later rotation cannot reissue a published identifier under new key material."
157
+ },
158
+ "dryRun": {
159
+ "type": "boolean",
160
+ "description": "True when nothing was written. Echoed so a report is self-describing: a plan and a receipt are otherwise the same shape."
161
+ },
162
+ "ext": {
163
+ "$ref": "#/$defs/Ext"
164
+ }
165
+ }
166
+ },
167
+ "RealignedKey": {
168
+ "title": "A record renamed onto the identifier its key is published under",
169
+ "type": "object",
170
+ "additionalProperties": false,
171
+ "required": [
172
+ "from",
173
+ "to",
174
+ "publicKey"
175
+ ],
176
+ "properties": {
177
+ "from": {
178
+ "type": "string",
179
+ "minLength": 1,
180
+ "description": "The identifier the record had."
181
+ },
182
+ "to": {
183
+ "type": "string",
184
+ "minLength": 1,
185
+ "description": "The verification-method identifier it takes."
186
+ },
187
+ "publicKey": {
188
+ "type": "string",
189
+ "minLength": 1,
190
+ "description": "Multibase public half of the key, which is what identified the record. Reported so the producer can check the rename against the published document rather than trusting this report."
191
+ }
192
+ }
193
+ },
194
+ "Ext": {
195
+ "title": "Ext",
196
+ "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.",
197
+ "type": "object",
198
+ "minProperties": 1,
199
+ "additionalProperties": true,
200
+ "propertyNames": {
201
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
202
+ }
203
+ }
204
+ }
205
+ } as const;
206
+
207
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
208
+ export const RESPONSE_PAYLOAD_SCHEMA = {
209
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
210
+ "$ref": "#/$defs/Response",
211
+ "$defs": {
212
+ "Response": {
213
+ "$anchor": "response",
214
+ "title": "VTA WebVH DIDs Realign-Keys — response payload",
215
+ "description": "Success response to vta/webvh/dids/realign-keys. Type https://trusttasks.org/spec/vta/webvh/dids/realign-keys/1.0#response.",
216
+ "type": "object",
217
+ "additionalProperties": false,
218
+ "required": [
219
+ "did",
220
+ "moved",
221
+ "alreadyAligned",
222
+ "unmatched",
223
+ "nextFragmentId",
224
+ "dryRun"
225
+ ],
226
+ "properties": {
227
+ "did": {
228
+ "type": "string"
229
+ },
230
+ "moved": {
231
+ "type": "array",
232
+ "description": "The renames performed, or in a dry run the ones that would be.",
233
+ "items": {
234
+ "$ref": "#/$defs/RealignedKey"
235
+ }
236
+ },
237
+ "alreadyAligned": {
238
+ "type": "array",
239
+ "description": "Verification-method identifiers whose record was already correct.",
240
+ "items": {
241
+ "type": "string"
242
+ }
243
+ },
244
+ "unmatched": {
245
+ "type": "array",
246
+ "description": "Verification-method identifiers the recipient holds no key for. Not a failure — a DID may publish a method whose private half lives elsewhere — but the difference between this being empty and not is the difference between the DID being consistent and merely unchanged.",
247
+ "items": {
248
+ "type": "string"
249
+ }
250
+ },
251
+ "nextFragmentId": {
252
+ "type": "integer",
253
+ "minimum": 0,
254
+ "description": "Where the recipient will allocate the next identifier it mints for this DID. Past everything the document already publishes, so a later rotation cannot reissue a published identifier under new key material."
255
+ },
256
+ "dryRun": {
257
+ "type": "boolean",
258
+ "description": "True when nothing was written. Echoed so a report is self-describing: a plan and a receipt are otherwise the same shape."
259
+ },
260
+ "ext": {
261
+ "$ref": "#/$defs/Ext"
262
+ }
263
+ }
264
+ },
265
+ "RealignedKey": {
266
+ "title": "A record renamed onto the identifier its key is published under",
267
+ "type": "object",
268
+ "additionalProperties": false,
269
+ "required": [
270
+ "from",
271
+ "to",
272
+ "publicKey"
273
+ ],
274
+ "properties": {
275
+ "from": {
276
+ "type": "string",
277
+ "minLength": 1,
278
+ "description": "The identifier the record had."
279
+ },
280
+ "to": {
281
+ "type": "string",
282
+ "minLength": 1,
283
+ "description": "The verification-method identifier it takes."
284
+ },
285
+ "publicKey": {
286
+ "type": "string",
287
+ "minLength": 1,
288
+ "description": "Multibase public half of the key, which is what identified the record. Reported so the producer can check the rename against the published document rather than trusting this report."
289
+ }
290
+ }
291
+ },
292
+ "Ext": {
293
+ "title": "Ext",
294
+ "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.",
295
+ "type": "object",
296
+ "minProperties": 1,
297
+ "additionalProperties": true,
298
+ "propertyNames": {
299
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
300
+ }
301
+ }
302
+ }
303
+ } as const;
304
+
305
+ /**
306
+ * SPEC.md §7.2 policy for the request variant, from this specification's
307
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
308
+ * per-specification and cannot be derived from the document alone, and
309
+ * item 2 needs the schema this carries.
310
+ */
311
+ export const SPEC = {
312
+ typeUri: TYPE_URI,
313
+ isBearer: false,
314
+ isProofRequired: true,
315
+ isRecipientRequired: true,
316
+ isIssuedAtRequired: true,
317
+ payloadSchema: PAYLOAD_SCHEMA,
318
+ } as const;
319
+
320
+ /**
321
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
322
+ * tracks the *issuer* party's requirement because a response swaps the
323
+ * parties (§7.3 item 5).
324
+ */
325
+ export const RESPONSE_SPEC = {
326
+ typeUri: RESPONSE_TYPE_URI,
327
+ isBearer: false,
328
+ isProofRequired: true,
329
+ isRecipientRequired: true,
330
+ isIssuedAtRequired: true,
331
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
332
+ } as const;