@openvtc/trust-tasks 0.10.0 → 0.12.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.
Files changed (51) hide show
  1. package/dist/index.d.ts +9 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +9 -0
  4. package/dist/index.js.map +1 -1
  5. package/dist/vta/_shared/0.1/service.d.ts +11 -0
  6. package/dist/vta/_shared/0.1/service.d.ts.map +1 -0
  7. package/dist/vta/_shared/0.1/service.js +6 -0
  8. package/dist/vta/_shared/0.1/service.js.map +1 -0
  9. package/dist/vta/services/disable/1.0/payload.d.ts +452 -0
  10. package/dist/vta/services/disable/1.0/payload.d.ts.map +1 -0
  11. package/dist/vta/services/disable/1.0/payload.js +240 -0
  12. package/dist/vta/services/disable/1.0/payload.js.map +1 -0
  13. package/dist/vta/services/drain/cancel/1.0/payload.d.ts +234 -0
  14. package/dist/vta/services/drain/cancel/1.0/payload.d.ts.map +1 -0
  15. package/dist/vta/services/drain/cancel/1.0/payload.js +131 -0
  16. package/dist/vta/services/drain/cancel/1.0/payload.js.map +1 -0
  17. package/dist/vta/services/drain/list/1.0/payload.d.ts +352 -0
  18. package/dist/vta/services/drain/list/1.0/payload.d.ts.map +1 -0
  19. package/dist/vta/services/drain/list/1.0/payload.js +189 -0
  20. package/dist/vta/services/drain/list/1.0/payload.js.map +1 -0
  21. package/dist/vta/services/enable/1.0/payload.d.ts +511 -0
  22. package/dist/vta/services/enable/1.0/payload.d.ts.map +1 -0
  23. package/dist/vta/services/enable/1.0/payload.js +262 -0
  24. package/dist/vta/services/enable/1.0/payload.js.map +1 -0
  25. package/dist/vta/services/get/1.0/payload.d.ts +399 -0
  26. package/dist/vta/services/get/1.0/payload.d.ts.map +1 -0
  27. package/dist/vta/services/get/1.0/payload.js +219 -0
  28. package/dist/vta/services/get/1.0/payload.js.map +1 -0
  29. package/dist/vta/services/list/1.0/payload.d.ts +409 -0
  30. package/dist/vta/services/list/1.0/payload.d.ts.map +1 -0
  31. package/dist/vta/services/list/1.0/payload.js +221 -0
  32. package/dist/vta/services/list/1.0/payload.js.map +1 -0
  33. package/dist/vta/services/rollback/1.0/payload.d.ts +458 -0
  34. package/dist/vta/services/rollback/1.0/payload.d.ts.map +1 -0
  35. package/dist/vta/services/rollback/1.0/payload.js +251 -0
  36. package/dist/vta/services/rollback/1.0/payload.js.map +1 -0
  37. package/dist/vta/services/update/1.0/payload.d.ts +511 -0
  38. package/dist/vta/services/update/1.0/payload.d.ts.map +1 -0
  39. package/dist/vta/services/update/1.0/payload.js +262 -0
  40. package/dist/vta/services/update/1.0/payload.js.map +1 -0
  41. package/package.json +1 -1
  42. package/src/index.ts +9 -0
  43. package/src/vta/_shared/0.1/service.ts +11 -0
  44. package/src/vta/services/disable/1.0/payload.ts +311 -0
  45. package/src/vta/services/drain/cancel/1.0/payload.ts +169 -0
  46. package/src/vta/services/drain/list/1.0/payload.ts +241 -0
  47. package/src/vta/services/enable/1.0/payload.ts +350 -0
  48. package/src/vta/services/get/1.0/payload.ts +279 -0
  49. package/src/vta/services/list/1.0/payload.ts +283 -0
  50. package/src/vta/services/rollback/1.0/payload.ts +322 -0
  51. package/src/vta/services/update/1.0/payload.ts +350 -0
@@ -0,0 +1,283 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vta/services/list/1.0/payload.schema.json
4
+ */
5
+
6
+ /**
7
+ * Which transport a task is acting on. This is the discriminator: it selects which member of `config` is meaningful, and a payload naming one kind with another's config is malformed rather than merely ignored.
8
+ */
9
+ export type ServiceKind = "didcomm" | "rest" | "tsp" | "webauthn";
10
+
11
+ /**
12
+ * Request payload for vta/services/list. Takes no filters: the answer is the agent's whole advertised surface, which is public in its DID document anyway.
13
+ */
14
+ export interface VTAServicesListPayload {
15
+ ext?: Ext;
16
+ }
17
+ /**
18
+ * 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.
19
+ */
20
+ export interface Ext {
21
+ [k: string]: unknown | undefined;
22
+ }
23
+ /**
24
+ * Success response to vta/services/list. Type https://trusttasks.org/spec/vta/services/list/1.0#response.
25
+ */
26
+ export interface VTAServicesListResponsePayload {
27
+ /**
28
+ * Every transport the agent knows about, advertised or not. A kind absent from this array has never been configured — distinct from one present with `enabled: false`.
29
+ */
30
+ services: ServiceState[];
31
+ ext?: Ext;
32
+ }
33
+ /**
34
+ * What the agent currently advertises for one service. `enabled` is the only member every kind carries; the rest are kind-specific and absent when they do not apply. Note that `enabled: false` and an absent entry are different: the first says the agent knows about this transport and is not advertising it, the second says it has never been configured.
35
+ */
36
+ export interface ServiceState {
37
+ kind: ServiceKind;
38
+ /**
39
+ * Whether the agent currently advertises this transport in its DID document.
40
+ */
41
+ enabled: boolean;
42
+ /**
43
+ * The mediator this transport routes through. Present for `didcomm` and `tsp`.
44
+ */
45
+ mediatorDid?: string;
46
+ /**
47
+ * The advertised endpoint. Present for `rest` and `webauthn`.
48
+ */
49
+ url?: string;
50
+ /**
51
+ * RFC 3339 instant at which a scheduled drain completes. Present only while a `didcomm` mediator is draining — see `vta/services/drain/list`.
52
+ */
53
+ drainsUntil?: string;
54
+ ext?: Ext;
55
+ }
56
+
57
+ /** Trust Task type URI. */
58
+ export const TYPE_URI = "https://trusttasks.org/spec/vta/services/list/1.0" as const;
59
+
60
+ /** Stable alias for this specification's request payload shape. */
61
+ export type Payload = VTAServicesListPayload;
62
+
63
+ /** Trust Task response type URI (request type URI + "#response"). */
64
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/services/list/1.0#response" as const;
65
+
66
+ /** Stable alias for this specification's success-response payload shape. */
67
+ export type Response = VTAServicesListResponsePayload;
68
+
69
+ /**
70
+ * This specification's payload schema, as a value.
71
+ *
72
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
73
+ * rather than only as a `.json` file because TypeScript types are erased
74
+ * at runtime: without a schema a consumer has nothing to validate, and
75
+ * every REQUIRED payload member is optional in practice. Cross-file
76
+ * `$ref`s are already inlined, so it needs no resolver.
77
+ */
78
+ export const PAYLOAD_SCHEMA = {
79
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
80
+ "$id": "https://trusttasks.org/spec/vta/services/list/1.0",
81
+ "title": "VTA Services — List — payload",
82
+ "description": "Request payload for vta/services/list. Takes no filters: the answer is the agent's whole advertised surface, which is public in its DID document anyway.",
83
+ "type": "object",
84
+ "additionalProperties": false,
85
+ "properties": {
86
+ "ext": {
87
+ "$ref": "#/$defs/Ext"
88
+ }
89
+ },
90
+ "$defs": {
91
+ "Response": {
92
+ "$anchor": "response",
93
+ "title": "VTA Services — List — response payload",
94
+ "description": "Success response to vta/services/list. Type https://trusttasks.org/spec/vta/services/list/1.0#response.",
95
+ "type": "object",
96
+ "additionalProperties": false,
97
+ "required": [
98
+ "services"
99
+ ],
100
+ "properties": {
101
+ "services": {
102
+ "type": "array",
103
+ "description": "Every transport the agent knows about, advertised or not. A kind absent from this array has never been configured — distinct from one present with `enabled: false`.",
104
+ "items": {
105
+ "$ref": "#/$defs/ServiceState"
106
+ }
107
+ },
108
+ "ext": {
109
+ "$ref": "#/$defs/Ext"
110
+ }
111
+ }
112
+ },
113
+ "Ext": {
114
+ "title": "Ext",
115
+ "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.",
116
+ "type": "object",
117
+ "minProperties": 1,
118
+ "additionalProperties": true,
119
+ "propertyNames": {
120
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
121
+ }
122
+ },
123
+ "ServiceState": {
124
+ "title": "ServiceState",
125
+ "description": "What the agent currently advertises for one service. `enabled` is the only member every kind carries; the rest are kind-specific and absent when they do not apply. Note that `enabled: false` and an absent entry are different: the first says the agent knows about this transport and is not advertising it, the second says it has never been configured.",
126
+ "type": "object",
127
+ "additionalProperties": false,
128
+ "required": [
129
+ "kind",
130
+ "enabled"
131
+ ],
132
+ "properties": {
133
+ "kind": {
134
+ "$ref": "#/$defs/ServiceKind"
135
+ },
136
+ "enabled": {
137
+ "type": "boolean",
138
+ "description": "Whether the agent currently advertises this transport in its DID document."
139
+ },
140
+ "mediatorDid": {
141
+ "type": "string",
142
+ "description": "The mediator this transport routes through. Present for `didcomm` and `tsp`."
143
+ },
144
+ "url": {
145
+ "type": "string",
146
+ "description": "The advertised endpoint. Present for `rest` and `webauthn`."
147
+ },
148
+ "drainsUntil": {
149
+ "type": "string",
150
+ "format": "date-time",
151
+ "description": "RFC 3339 instant at which a scheduled drain completes. Present only while a `didcomm` mediator is draining — see `vta/services/drain/list`."
152
+ },
153
+ "ext": {
154
+ "$ref": "#/$defs/Ext"
155
+ }
156
+ }
157
+ },
158
+ "ServiceKind": {
159
+ "title": "ServiceKind",
160
+ "description": "Which transport a task is acting on. This is the discriminator: it selects which member of `config` is meaningful, and a payload naming one kind with another's config is malformed rather than merely ignored.",
161
+ "type": "string",
162
+ "enum": [
163
+ "didcomm",
164
+ "rest",
165
+ "tsp",
166
+ "webauthn"
167
+ ]
168
+ }
169
+ }
170
+ } as const;
171
+
172
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
173
+ export const RESPONSE_PAYLOAD_SCHEMA = {
174
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
175
+ "$ref": "#/$defs/Response",
176
+ "$defs": {
177
+ "Response": {
178
+ "$anchor": "response",
179
+ "title": "VTA Services — List — response payload",
180
+ "description": "Success response to vta/services/list. Type https://trusttasks.org/spec/vta/services/list/1.0#response.",
181
+ "type": "object",
182
+ "additionalProperties": false,
183
+ "required": [
184
+ "services"
185
+ ],
186
+ "properties": {
187
+ "services": {
188
+ "type": "array",
189
+ "description": "Every transport the agent knows about, advertised or not. A kind absent from this array has never been configured — distinct from one present with `enabled: false`.",
190
+ "items": {
191
+ "$ref": "#/$defs/ServiceState"
192
+ }
193
+ },
194
+ "ext": {
195
+ "$ref": "#/$defs/Ext"
196
+ }
197
+ }
198
+ },
199
+ "Ext": {
200
+ "title": "Ext",
201
+ "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.",
202
+ "type": "object",
203
+ "minProperties": 1,
204
+ "additionalProperties": true,
205
+ "propertyNames": {
206
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
207
+ }
208
+ },
209
+ "ServiceState": {
210
+ "title": "ServiceState",
211
+ "description": "What the agent currently advertises for one service. `enabled` is the only member every kind carries; the rest are kind-specific and absent when they do not apply. Note that `enabled: false` and an absent entry are different: the first says the agent knows about this transport and is not advertising it, the second says it has never been configured.",
212
+ "type": "object",
213
+ "additionalProperties": false,
214
+ "required": [
215
+ "kind",
216
+ "enabled"
217
+ ],
218
+ "properties": {
219
+ "kind": {
220
+ "$ref": "#/$defs/ServiceKind"
221
+ },
222
+ "enabled": {
223
+ "type": "boolean",
224
+ "description": "Whether the agent currently advertises this transport in its DID document."
225
+ },
226
+ "mediatorDid": {
227
+ "type": "string",
228
+ "description": "The mediator this transport routes through. Present for `didcomm` and `tsp`."
229
+ },
230
+ "url": {
231
+ "type": "string",
232
+ "description": "The advertised endpoint. Present for `rest` and `webauthn`."
233
+ },
234
+ "drainsUntil": {
235
+ "type": "string",
236
+ "format": "date-time",
237
+ "description": "RFC 3339 instant at which a scheduled drain completes. Present only while a `didcomm` mediator is draining — see `vta/services/drain/list`."
238
+ },
239
+ "ext": {
240
+ "$ref": "#/$defs/Ext"
241
+ }
242
+ }
243
+ },
244
+ "ServiceKind": {
245
+ "title": "ServiceKind",
246
+ "description": "Which transport a task is acting on. This is the discriminator: it selects which member of `config` is meaningful, and a payload naming one kind with another's config is malformed rather than merely ignored.",
247
+ "type": "string",
248
+ "enum": [
249
+ "didcomm",
250
+ "rest",
251
+ "tsp",
252
+ "webauthn"
253
+ ]
254
+ }
255
+ }
256
+ } as const;
257
+
258
+ /**
259
+ * SPEC.md §7.2 policy for the request variant, from this specification's
260
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
261
+ * per-specification and cannot be derived from the document alone, and
262
+ * item 2 needs the schema this carries.
263
+ */
264
+ export const SPEC = {
265
+ typeUri: TYPE_URI,
266
+ isBearer: false,
267
+ isProofRequired: false,
268
+ isRecipientRequired: true,
269
+ payloadSchema: PAYLOAD_SCHEMA,
270
+ } as const;
271
+
272
+ /**
273
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
274
+ * tracks the *issuer* party's requirement because a response swaps the
275
+ * parties (§7.3 item 5).
276
+ */
277
+ export const RESPONSE_SPEC = {
278
+ typeUri: RESPONSE_TYPE_URI,
279
+ isBearer: false,
280
+ isProofRequired: false,
281
+ isRecipientRequired: true,
282
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
283
+ } as const;
@@ -0,0 +1,322 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vta/services/rollback/1.0/payload.schema.json
4
+ */
5
+
6
+ /**
7
+ * Which transport a task is acting on. This is the discriminator: it selects which member of `config` is meaningful, and a payload naming one kind with another's config is malformed rather than merely ignored.
8
+ */
9
+ export type ServiceKind = "didcomm" | "rest" | "tsp" | "webauthn";
10
+
11
+ /**
12
+ * Request payload for vta/services/rollback. Reverts a transport to its previous advertised settings by writing a NEW log entry — the history is append-only, so a rollback is a forward step that restores an earlier state, never an erasure of what happened.
13
+ */
14
+ export interface VTAServicesRollbackPayload {
15
+ service: ServiceKind;
16
+ ext?: Ext;
17
+ }
18
+ /**
19
+ * 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.
20
+ */
21
+ export interface Ext {
22
+ [k: string]: unknown | undefined;
23
+ }
24
+ /**
25
+ * Success response to vta/services/rollback. Type https://trusttasks.org/spec/vta/services/rollback/1.0#response.
26
+ */
27
+ export interface VTAServicesRollbackResponsePayload {
28
+ result: RollbackResult;
29
+ ext?: Ext;
30
+ }
31
+ /**
32
+ * The outcome of a rollback. Distinct from ServiceMutationResult because a rollback can legitimately publish nothing: if the previous state already equals the current one there is no change to write, and `kind: "noOp"` says so with `logEntryVersionId` absent. Treating that as a failure would be wrong — the requested state holds — and treating it as an ordinary success would report a log entry that does not exist.
33
+ */
34
+ export interface RollbackResult {
35
+ /**
36
+ * What the rollback did. `disabled` re-disabled the transport, `enabled` re-advertised it at its prior settings, `updated` restored prior settings on an entry that stayed advertised, and `noOp` means the previous state already matched — nothing was written.
37
+ */
38
+ kind: "disabled" | "enabled" | "updated" | "noOp";
39
+ /**
40
+ * Version id of the log entry the rollback wrote. **Absent when `kind` is `noOp`**, and present otherwise.
41
+ */
42
+ logEntryVersionId?: string;
43
+ /**
44
+ * RFC 3339 instant the rollback took effect. Absent for `noOp`.
45
+ */
46
+ effectiveAt?: string;
47
+ /**
48
+ * Present when rolling back DIDComm left a mediator draining.
49
+ */
50
+ drainingMediator?: string;
51
+ /**
52
+ * When that drain completes.
53
+ */
54
+ drainUntil?: string;
55
+ /**
56
+ * The agent's own DID.
57
+ */
58
+ vtaDid?: string;
59
+ /**
60
+ * True when the entry was written locally but not published — the operator must redeploy before any verifier sees it.
61
+ */
62
+ serverless?: boolean;
63
+ ext?: Ext;
64
+ }
65
+
66
+ /** Trust Task type URI. */
67
+ export const TYPE_URI = "https://trusttasks.org/spec/vta/services/rollback/1.0" as const;
68
+
69
+ /** Stable alias for this specification's request payload shape. */
70
+ export type Payload = VTAServicesRollbackPayload;
71
+
72
+ /** Trust Task response type URI (request type URI + "#response"). */
73
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/services/rollback/1.0#response" as const;
74
+
75
+ /** Stable alias for this specification's success-response payload shape. */
76
+ export type Response = VTAServicesRollbackResponsePayload;
77
+
78
+ /**
79
+ * This specification's payload schema, as a value.
80
+ *
81
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
82
+ * rather than only as a `.json` file because TypeScript types are erased
83
+ * at runtime: without a schema a consumer has nothing to validate, and
84
+ * every REQUIRED payload member is optional in practice. Cross-file
85
+ * `$ref`s are already inlined, so it needs no resolver.
86
+ */
87
+ export const PAYLOAD_SCHEMA = {
88
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
89
+ "$id": "https://trusttasks.org/spec/vta/services/rollback/1.0",
90
+ "title": "VTA Services — Rollback — payload",
91
+ "description": "Request payload for vta/services/rollback. Reverts a transport to its previous advertised settings by writing a NEW log entry — the history is append-only, so a rollback is a forward step that restores an earlier state, never an erasure of what happened.",
92
+ "type": "object",
93
+ "additionalProperties": false,
94
+ "required": [
95
+ "service"
96
+ ],
97
+ "properties": {
98
+ "service": {
99
+ "$ref": "#/$defs/ServiceKind"
100
+ },
101
+ "ext": {
102
+ "$ref": "#/$defs/Ext"
103
+ }
104
+ },
105
+ "$defs": {
106
+ "Response": {
107
+ "$anchor": "response",
108
+ "title": "VTA Services — Rollback — response payload",
109
+ "description": "Success response to vta/services/rollback. Type https://trusttasks.org/spec/vta/services/rollback/1.0#response.",
110
+ "type": "object",
111
+ "additionalProperties": false,
112
+ "required": [
113
+ "result"
114
+ ],
115
+ "properties": {
116
+ "result": {
117
+ "$ref": "#/$defs/RollbackResult"
118
+ },
119
+ "ext": {
120
+ "$ref": "#/$defs/Ext"
121
+ }
122
+ }
123
+ },
124
+ "Ext": {
125
+ "title": "Ext",
126
+ "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.",
127
+ "type": "object",
128
+ "minProperties": 1,
129
+ "additionalProperties": true,
130
+ "propertyNames": {
131
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
132
+ }
133
+ },
134
+ "RollbackResult": {
135
+ "title": "RollbackResult",
136
+ "description": "The outcome of a rollback. Distinct from ServiceMutationResult because a rollback can legitimately publish nothing: if the previous state already equals the current one there is no change to write, and `kind: \"noOp\"` says so with `logEntryVersionId` absent. Treating that as a failure would be wrong — the requested state holds — and treating it as an ordinary success would report a log entry that does not exist.",
137
+ "type": "object",
138
+ "additionalProperties": false,
139
+ "required": [
140
+ "kind"
141
+ ],
142
+ "properties": {
143
+ "kind": {
144
+ "type": "string",
145
+ "enum": [
146
+ "disabled",
147
+ "enabled",
148
+ "updated",
149
+ "noOp"
150
+ ],
151
+ "description": "What the rollback did. `disabled` re-disabled the transport, `enabled` re-advertised it at its prior settings, `updated` restored prior settings on an entry that stayed advertised, and `noOp` means the previous state already matched — nothing was written."
152
+ },
153
+ "logEntryVersionId": {
154
+ "type": "string",
155
+ "description": "Version id of the log entry the rollback wrote. **Absent when `kind` is `noOp`**, and present otherwise."
156
+ },
157
+ "effectiveAt": {
158
+ "type": "string",
159
+ "format": "date-time",
160
+ "description": "RFC 3339 instant the rollback took effect. Absent for `noOp`."
161
+ },
162
+ "drainingMediator": {
163
+ "type": "string",
164
+ "description": "Present when rolling back DIDComm left a mediator draining."
165
+ },
166
+ "drainUntil": {
167
+ "type": "string",
168
+ "format": "date-time",
169
+ "description": "When that drain completes."
170
+ },
171
+ "vtaDid": {
172
+ "type": "string",
173
+ "description": "The agent's own DID."
174
+ },
175
+ "serverless": {
176
+ "type": "boolean",
177
+ "default": false,
178
+ "description": "True when the entry was written locally but not published — the operator must redeploy before any verifier sees it."
179
+ },
180
+ "ext": {
181
+ "$ref": "#/$defs/Ext"
182
+ }
183
+ }
184
+ },
185
+ "ServiceKind": {
186
+ "title": "ServiceKind",
187
+ "description": "Which transport a task is acting on. This is the discriminator: it selects which member of `config` is meaningful, and a payload naming one kind with another's config is malformed rather than merely ignored.",
188
+ "type": "string",
189
+ "enum": [
190
+ "didcomm",
191
+ "rest",
192
+ "tsp",
193
+ "webauthn"
194
+ ]
195
+ }
196
+ }
197
+ } as const;
198
+
199
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
200
+ export const RESPONSE_PAYLOAD_SCHEMA = {
201
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
202
+ "$ref": "#/$defs/Response",
203
+ "$defs": {
204
+ "Response": {
205
+ "$anchor": "response",
206
+ "title": "VTA Services — Rollback — response payload",
207
+ "description": "Success response to vta/services/rollback. Type https://trusttasks.org/spec/vta/services/rollback/1.0#response.",
208
+ "type": "object",
209
+ "additionalProperties": false,
210
+ "required": [
211
+ "result"
212
+ ],
213
+ "properties": {
214
+ "result": {
215
+ "$ref": "#/$defs/RollbackResult"
216
+ },
217
+ "ext": {
218
+ "$ref": "#/$defs/Ext"
219
+ }
220
+ }
221
+ },
222
+ "Ext": {
223
+ "title": "Ext",
224
+ "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.",
225
+ "type": "object",
226
+ "minProperties": 1,
227
+ "additionalProperties": true,
228
+ "propertyNames": {
229
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
230
+ }
231
+ },
232
+ "RollbackResult": {
233
+ "title": "RollbackResult",
234
+ "description": "The outcome of a rollback. Distinct from ServiceMutationResult because a rollback can legitimately publish nothing: if the previous state already equals the current one there is no change to write, and `kind: \"noOp\"` says so with `logEntryVersionId` absent. Treating that as a failure would be wrong — the requested state holds — and treating it as an ordinary success would report a log entry that does not exist.",
235
+ "type": "object",
236
+ "additionalProperties": false,
237
+ "required": [
238
+ "kind"
239
+ ],
240
+ "properties": {
241
+ "kind": {
242
+ "type": "string",
243
+ "enum": [
244
+ "disabled",
245
+ "enabled",
246
+ "updated",
247
+ "noOp"
248
+ ],
249
+ "description": "What the rollback did. `disabled` re-disabled the transport, `enabled` re-advertised it at its prior settings, `updated` restored prior settings on an entry that stayed advertised, and `noOp` means the previous state already matched — nothing was written."
250
+ },
251
+ "logEntryVersionId": {
252
+ "type": "string",
253
+ "description": "Version id of the log entry the rollback wrote. **Absent when `kind` is `noOp`**, and present otherwise."
254
+ },
255
+ "effectiveAt": {
256
+ "type": "string",
257
+ "format": "date-time",
258
+ "description": "RFC 3339 instant the rollback took effect. Absent for `noOp`."
259
+ },
260
+ "drainingMediator": {
261
+ "type": "string",
262
+ "description": "Present when rolling back DIDComm left a mediator draining."
263
+ },
264
+ "drainUntil": {
265
+ "type": "string",
266
+ "format": "date-time",
267
+ "description": "When that drain completes."
268
+ },
269
+ "vtaDid": {
270
+ "type": "string",
271
+ "description": "The agent's own DID."
272
+ },
273
+ "serverless": {
274
+ "type": "boolean",
275
+ "default": false,
276
+ "description": "True when the entry was written locally but not published — the operator must redeploy before any verifier sees it."
277
+ },
278
+ "ext": {
279
+ "$ref": "#/$defs/Ext"
280
+ }
281
+ }
282
+ },
283
+ "ServiceKind": {
284
+ "title": "ServiceKind",
285
+ "description": "Which transport a task is acting on. This is the discriminator: it selects which member of `config` is meaningful, and a payload naming one kind with another's config is malformed rather than merely ignored.",
286
+ "type": "string",
287
+ "enum": [
288
+ "didcomm",
289
+ "rest",
290
+ "tsp",
291
+ "webauthn"
292
+ ]
293
+ }
294
+ }
295
+ } as const;
296
+
297
+ /**
298
+ * SPEC.md §7.2 policy for the request variant, from this specification's
299
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
300
+ * per-specification and cannot be derived from the document alone, and
301
+ * item 2 needs the schema this carries.
302
+ */
303
+ export const SPEC = {
304
+ typeUri: TYPE_URI,
305
+ isBearer: false,
306
+ isProofRequired: true,
307
+ isRecipientRequired: true,
308
+ payloadSchema: PAYLOAD_SCHEMA,
309
+ } as const;
310
+
311
+ /**
312
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
313
+ * tracks the *issuer* party's requirement because a response swaps the
314
+ * parties (§7.3 item 5).
315
+ */
316
+ export const RESPONSE_SPEC = {
317
+ typeUri: RESPONSE_TYPE_URI,
318
+ isBearer: false,
319
+ isProofRequired: true,
320
+ isRecipientRequired: true,
321
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
322
+ } as const;