@openvtc/trust-tasks 0.19.4 → 0.19.5

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,259 @@
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
+ /** Trust Task type URI. */
6
+ export const TYPE_URI = "https://trusttasks.org/spec/vta/webvh/dids/realign-keys/1.0";
7
+ /** Trust Task response type URI (request type URI + "#response"). */
8
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/webvh/dids/realign-keys/1.0#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/vta/webvh/dids/realign-keys/1.0",
21
+ "title": "VTA WebVH DIDs Realign-Keys — payload",
22
+ "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.",
23
+ "type": "object",
24
+ "additionalProperties": false,
25
+ "required": [
26
+ "did"
27
+ ],
28
+ "properties": {
29
+ "did": {
30
+ "type": "string",
31
+ "minLength": 1,
32
+ "description": "The DID whose key records are to be realigned. The only identifier the producer chooses."
33
+ },
34
+ "dryRun": {
35
+ "type": "boolean",
36
+ "description": "Compute and report the realignment without performing it. Absent reads as false."
37
+ },
38
+ "ext": {
39
+ "$ref": "#/$defs/Ext"
40
+ }
41
+ },
42
+ "$defs": {
43
+ "Response": {
44
+ "$anchor": "response",
45
+ "title": "VTA WebVH DIDs Realign-Keys — response payload",
46
+ "description": "Success response to vta/webvh/dids/realign-keys. Type https://trusttasks.org/spec/vta/webvh/dids/realign-keys/1.0#response.",
47
+ "type": "object",
48
+ "additionalProperties": false,
49
+ "required": [
50
+ "did",
51
+ "moved",
52
+ "alreadyAligned",
53
+ "unmatched",
54
+ "nextFragmentId",
55
+ "dryRun"
56
+ ],
57
+ "properties": {
58
+ "did": {
59
+ "type": "string"
60
+ },
61
+ "moved": {
62
+ "type": "array",
63
+ "description": "The renames performed, or in a dry run the ones that would be.",
64
+ "items": {
65
+ "$ref": "#/$defs/RealignedKey"
66
+ }
67
+ },
68
+ "alreadyAligned": {
69
+ "type": "array",
70
+ "description": "Verification-method identifiers whose record was already correct.",
71
+ "items": {
72
+ "type": "string"
73
+ }
74
+ },
75
+ "unmatched": {
76
+ "type": "array",
77
+ "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.",
78
+ "items": {
79
+ "type": "string"
80
+ }
81
+ },
82
+ "nextFragmentId": {
83
+ "type": "integer",
84
+ "minimum": 0,
85
+ "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."
86
+ },
87
+ "dryRun": {
88
+ "type": "boolean",
89
+ "description": "True when nothing was written. Echoed so a report is self-describing: a plan and a receipt are otherwise the same shape."
90
+ },
91
+ "ext": {
92
+ "$ref": "#/$defs/Ext"
93
+ }
94
+ }
95
+ },
96
+ "RealignedKey": {
97
+ "title": "A record renamed onto the identifier its key is published under",
98
+ "type": "object",
99
+ "additionalProperties": false,
100
+ "required": [
101
+ "from",
102
+ "to",
103
+ "publicKey"
104
+ ],
105
+ "properties": {
106
+ "from": {
107
+ "type": "string",
108
+ "minLength": 1,
109
+ "description": "The identifier the record had."
110
+ },
111
+ "to": {
112
+ "type": "string",
113
+ "minLength": 1,
114
+ "description": "The verification-method identifier it takes."
115
+ },
116
+ "publicKey": {
117
+ "type": "string",
118
+ "minLength": 1,
119
+ "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."
120
+ }
121
+ }
122
+ },
123
+ "Ext": {
124
+ "title": "Ext",
125
+ "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.",
126
+ "type": "object",
127
+ "minProperties": 1,
128
+ "additionalProperties": true,
129
+ "propertyNames": {
130
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
131
+ }
132
+ }
133
+ }
134
+ };
135
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
136
+ export const RESPONSE_PAYLOAD_SCHEMA = {
137
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
138
+ "$ref": "#/$defs/Response",
139
+ "$defs": {
140
+ "Response": {
141
+ "$anchor": "response",
142
+ "title": "VTA WebVH DIDs Realign-Keys — response payload",
143
+ "description": "Success response to vta/webvh/dids/realign-keys. Type https://trusttasks.org/spec/vta/webvh/dids/realign-keys/1.0#response.",
144
+ "type": "object",
145
+ "additionalProperties": false,
146
+ "required": [
147
+ "did",
148
+ "moved",
149
+ "alreadyAligned",
150
+ "unmatched",
151
+ "nextFragmentId",
152
+ "dryRun"
153
+ ],
154
+ "properties": {
155
+ "did": {
156
+ "type": "string"
157
+ },
158
+ "moved": {
159
+ "type": "array",
160
+ "description": "The renames performed, or in a dry run the ones that would be.",
161
+ "items": {
162
+ "$ref": "#/$defs/RealignedKey"
163
+ }
164
+ },
165
+ "alreadyAligned": {
166
+ "type": "array",
167
+ "description": "Verification-method identifiers whose record was already correct.",
168
+ "items": {
169
+ "type": "string"
170
+ }
171
+ },
172
+ "unmatched": {
173
+ "type": "array",
174
+ "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.",
175
+ "items": {
176
+ "type": "string"
177
+ }
178
+ },
179
+ "nextFragmentId": {
180
+ "type": "integer",
181
+ "minimum": 0,
182
+ "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."
183
+ },
184
+ "dryRun": {
185
+ "type": "boolean",
186
+ "description": "True when nothing was written. Echoed so a report is self-describing: a plan and a receipt are otherwise the same shape."
187
+ },
188
+ "ext": {
189
+ "$ref": "#/$defs/Ext"
190
+ }
191
+ }
192
+ },
193
+ "RealignedKey": {
194
+ "title": "A record renamed onto the identifier its key is published under",
195
+ "type": "object",
196
+ "additionalProperties": false,
197
+ "required": [
198
+ "from",
199
+ "to",
200
+ "publicKey"
201
+ ],
202
+ "properties": {
203
+ "from": {
204
+ "type": "string",
205
+ "minLength": 1,
206
+ "description": "The identifier the record had."
207
+ },
208
+ "to": {
209
+ "type": "string",
210
+ "minLength": 1,
211
+ "description": "The verification-method identifier it takes."
212
+ },
213
+ "publicKey": {
214
+ "type": "string",
215
+ "minLength": 1,
216
+ "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."
217
+ }
218
+ }
219
+ },
220
+ "Ext": {
221
+ "title": "Ext",
222
+ "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.",
223
+ "type": "object",
224
+ "minProperties": 1,
225
+ "additionalProperties": true,
226
+ "propertyNames": {
227
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
228
+ }
229
+ }
230
+ }
231
+ };
232
+ /**
233
+ * SPEC.md §7.2 policy for the request variant, from this specification's
234
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
235
+ * per-specification and cannot be derived from the document alone, and
236
+ * item 2 needs the schema this carries.
237
+ */
238
+ export const SPEC = {
239
+ typeUri: TYPE_URI,
240
+ isBearer: false,
241
+ isProofRequired: true,
242
+ isRecipientRequired: true,
243
+ isIssuedAtRequired: true,
244
+ payloadSchema: PAYLOAD_SCHEMA,
245
+ };
246
+ /**
247
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
248
+ * tracks the *issuer* party's requirement because a response swaps the
249
+ * parties (§7.3 item 5).
250
+ */
251
+ export const RESPONSE_SPEC = {
252
+ typeUri: RESPONSE_TYPE_URI,
253
+ isBearer: false,
254
+ isProofRequired: true,
255
+ isRecipientRequired: true,
256
+ isIssuedAtRequired: true,
257
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
258
+ };
259
+ //# sourceMappingURL=payload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payload.js","sourceRoot":"","sources":["../../../../../../src/vta/webvh/dids/realign-keys/1.0/payload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAgEH,2BAA2B;AAC3B,MAAM,CAAC,MAAM,QAAQ,GAAG,6DAAsE,CAAC;AAK/F,qEAAqE;AACrE,MAAM,CAAC,MAAM,iBAAiB,GAAG,sEAA+E,CAAC;AAKjH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,SAAS,EAAE,8CAA8C;IACzD,KAAK,EAAE,6DAA6D;IACpE,OAAO,EAAE,uCAAuC;IAChD,aAAa,EAAE,kPAAkP;IACjQ,MAAM,EAAE,QAAQ;IAChB,sBAAsB,EAAE,KAAK;IAC7B,UAAU,EAAE;QACV,KAAK;KACN;IACD,YAAY,EAAE;QACZ,KAAK,EAAE;YACL,MAAM,EAAE,QAAQ;YAChB,WAAW,EAAE,CAAC;YACd,aAAa,EAAE,0FAA0F;SAC1G;QACD,QAAQ,EAAE;YACR,MAAM,EAAE,SAAS;YACjB,aAAa,EAAE,kFAAkF;SAClG;QACD,KAAK,EAAE;YACL,MAAM,EAAE,aAAa;SACtB;KACF;IACD,OAAO,EAAE;QACP,UAAU,EAAE;YACV,SAAS,EAAE,UAAU;YACrB,OAAO,EAAE,gDAAgD;YACzD,aAAa,EAAE,6HAA6H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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.5",
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";
@@ -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;