@openvtc/trust-tasks 0.21.8 → 0.21.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +56 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/vta/services/rollback/1.1/payload.d.ts +433 -0
- package/dist/vta/services/rollback/1.1/payload.d.ts.map +1 -0
- package/dist/vta/services/rollback/1.1/payload.js +258 -0
- package/dist/vta/services/rollback/1.1/payload.js.map +1 -0
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/vta/services/rollback/1.1/payload.ts +294 -0
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vta/services/rollback/1.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
/** Trust Task type URI. */
|
|
6
|
+
export const TYPE_URI = "https://trusttasks.org/spec/vta/services/rollback/1.1";
|
|
7
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
8
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/services/rollback/1.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/vta/services/rollback/1.1",
|
|
21
|
+
"title": "VTA Services — Rollback — payload",
|
|
22
|
+
"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.",
|
|
23
|
+
"type": "object",
|
|
24
|
+
"additionalProperties": false,
|
|
25
|
+
"required": [
|
|
26
|
+
"service"
|
|
27
|
+
],
|
|
28
|
+
"properties": {
|
|
29
|
+
"service": {
|
|
30
|
+
"$ref": "#/$defs/ServiceKind"
|
|
31
|
+
},
|
|
32
|
+
"drainTtlSecs": {
|
|
33
|
+
"type": "integer",
|
|
34
|
+
"minimum": 0,
|
|
35
|
+
"description": "Mediated transports only (`didcomm`, `tsp`): when the rollback moves the transport off its current mediator, how long that mediator keeps accepting delivery for correspondents still holding the current DID document. Refused for `rest` and `webauthn`. Absent takes the agent's default; ignored when the rollback leaves no mediator draining. The agent may raise a value below its floor to the floor — and does, over a request that arrived through the mediator being replaced — and one mediator carrying both mediated transports drains once for both, so read `drainUntil` in the result for the window actually applied."
|
|
36
|
+
},
|
|
37
|
+
"ext": {
|
|
38
|
+
"$ref": "#/$defs/Ext"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"$defs": {
|
|
42
|
+
"Response": {
|
|
43
|
+
"$anchor": "response",
|
|
44
|
+
"title": "VTA Services — Rollback — response payload",
|
|
45
|
+
"description": "Success response to vta/services/rollback. Type https://trusttasks.org/spec/vta/services/rollback/1.1#response.",
|
|
46
|
+
"type": "object",
|
|
47
|
+
"additionalProperties": false,
|
|
48
|
+
"required": [
|
|
49
|
+
"result"
|
|
50
|
+
],
|
|
51
|
+
"properties": {
|
|
52
|
+
"result": {
|
|
53
|
+
"$ref": "#/$defs/RollbackResult"
|
|
54
|
+
},
|
|
55
|
+
"ext": {
|
|
56
|
+
"$ref": "#/$defs/Ext"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"Ext": {
|
|
61
|
+
"title": "Ext",
|
|
62
|
+
"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.",
|
|
63
|
+
"type": "object",
|
|
64
|
+
"minProperties": 1,
|
|
65
|
+
"additionalProperties": true,
|
|
66
|
+
"propertyNames": {
|
|
67
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"RollbackResult": {
|
|
71
|
+
"title": "RollbackResult",
|
|
72
|
+
"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.",
|
|
73
|
+
"type": "object",
|
|
74
|
+
"additionalProperties": false,
|
|
75
|
+
"required": [
|
|
76
|
+
"kind"
|
|
77
|
+
],
|
|
78
|
+
"properties": {
|
|
79
|
+
"kind": {
|
|
80
|
+
"type": "string",
|
|
81
|
+
"enum": [
|
|
82
|
+
"disabled",
|
|
83
|
+
"enabled",
|
|
84
|
+
"updated",
|
|
85
|
+
"noOp"
|
|
86
|
+
],
|
|
87
|
+
"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."
|
|
88
|
+
},
|
|
89
|
+
"logEntryVersionId": {
|
|
90
|
+
"type": "string",
|
|
91
|
+
"description": "Version id of the log entry the rollback wrote. **Absent when `kind` is `noOp`**, and present otherwise."
|
|
92
|
+
},
|
|
93
|
+
"effectiveAt": {
|
|
94
|
+
"type": "string",
|
|
95
|
+
"format": "date-time",
|
|
96
|
+
"description": "RFC 3339 instant the rollback took effect. Absent for `noOp`."
|
|
97
|
+
},
|
|
98
|
+
"drainingMediator": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"description": "Present when rolling back DIDComm left a mediator draining."
|
|
101
|
+
},
|
|
102
|
+
"drainUntil": {
|
|
103
|
+
"type": "string",
|
|
104
|
+
"format": "date-time",
|
|
105
|
+
"description": "When that drain completes."
|
|
106
|
+
},
|
|
107
|
+
"vtaDid": {
|
|
108
|
+
"type": "string",
|
|
109
|
+
"description": "The agent's own DID."
|
|
110
|
+
},
|
|
111
|
+
"serverless": {
|
|
112
|
+
"type": "boolean",
|
|
113
|
+
"default": false,
|
|
114
|
+
"description": "True when the entry was written locally but not published — the operator must redeploy before any verifier sees it."
|
|
115
|
+
},
|
|
116
|
+
"ext": {
|
|
117
|
+
"$ref": "#/$defs/Ext"
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"ServiceKind": {
|
|
122
|
+
"title": "ServiceKind",
|
|
123
|
+
"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.",
|
|
124
|
+
"type": "string",
|
|
125
|
+
"enum": [
|
|
126
|
+
"didcomm",
|
|
127
|
+
"rest",
|
|
128
|
+
"tsp",
|
|
129
|
+
"webauthn"
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
135
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
136
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
137
|
+
"$ref": "#/$defs/Response",
|
|
138
|
+
"$defs": {
|
|
139
|
+
"Response": {
|
|
140
|
+
"$anchor": "response",
|
|
141
|
+
"title": "VTA Services — Rollback — response payload",
|
|
142
|
+
"description": "Success response to vta/services/rollback. Type https://trusttasks.org/spec/vta/services/rollback/1.1#response.",
|
|
143
|
+
"type": "object",
|
|
144
|
+
"additionalProperties": false,
|
|
145
|
+
"required": [
|
|
146
|
+
"result"
|
|
147
|
+
],
|
|
148
|
+
"properties": {
|
|
149
|
+
"result": {
|
|
150
|
+
"$ref": "#/$defs/RollbackResult"
|
|
151
|
+
},
|
|
152
|
+
"ext": {
|
|
153
|
+
"$ref": "#/$defs/Ext"
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
"Ext": {
|
|
158
|
+
"title": "Ext",
|
|
159
|
+
"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.",
|
|
160
|
+
"type": "object",
|
|
161
|
+
"minProperties": 1,
|
|
162
|
+
"additionalProperties": true,
|
|
163
|
+
"propertyNames": {
|
|
164
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
"RollbackResult": {
|
|
168
|
+
"title": "RollbackResult",
|
|
169
|
+
"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.",
|
|
170
|
+
"type": "object",
|
|
171
|
+
"additionalProperties": false,
|
|
172
|
+
"required": [
|
|
173
|
+
"kind"
|
|
174
|
+
],
|
|
175
|
+
"properties": {
|
|
176
|
+
"kind": {
|
|
177
|
+
"type": "string",
|
|
178
|
+
"enum": [
|
|
179
|
+
"disabled",
|
|
180
|
+
"enabled",
|
|
181
|
+
"updated",
|
|
182
|
+
"noOp"
|
|
183
|
+
],
|
|
184
|
+
"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."
|
|
185
|
+
},
|
|
186
|
+
"logEntryVersionId": {
|
|
187
|
+
"type": "string",
|
|
188
|
+
"description": "Version id of the log entry the rollback wrote. **Absent when `kind` is `noOp`**, and present otherwise."
|
|
189
|
+
},
|
|
190
|
+
"effectiveAt": {
|
|
191
|
+
"type": "string",
|
|
192
|
+
"format": "date-time",
|
|
193
|
+
"description": "RFC 3339 instant the rollback took effect. Absent for `noOp`."
|
|
194
|
+
},
|
|
195
|
+
"drainingMediator": {
|
|
196
|
+
"type": "string",
|
|
197
|
+
"description": "Present when rolling back DIDComm left a mediator draining."
|
|
198
|
+
},
|
|
199
|
+
"drainUntil": {
|
|
200
|
+
"type": "string",
|
|
201
|
+
"format": "date-time",
|
|
202
|
+
"description": "When that drain completes."
|
|
203
|
+
},
|
|
204
|
+
"vtaDid": {
|
|
205
|
+
"type": "string",
|
|
206
|
+
"description": "The agent's own DID."
|
|
207
|
+
},
|
|
208
|
+
"serverless": {
|
|
209
|
+
"type": "boolean",
|
|
210
|
+
"default": false,
|
|
211
|
+
"description": "True when the entry was written locally but not published — the operator must redeploy before any verifier sees it."
|
|
212
|
+
},
|
|
213
|
+
"ext": {
|
|
214
|
+
"$ref": "#/$defs/Ext"
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
"ServiceKind": {
|
|
219
|
+
"title": "ServiceKind",
|
|
220
|
+
"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.",
|
|
221
|
+
"type": "string",
|
|
222
|
+
"enum": [
|
|
223
|
+
"didcomm",
|
|
224
|
+
"rest",
|
|
225
|
+
"tsp",
|
|
226
|
+
"webauthn"
|
|
227
|
+
]
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
/**
|
|
232
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
233
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
234
|
+
* per-specification and cannot be derived from the document alone, and
|
|
235
|
+
* item 2 needs the schema this carries.
|
|
236
|
+
*/
|
|
237
|
+
export const SPEC = {
|
|
238
|
+
typeUri: TYPE_URI,
|
|
239
|
+
isBearer: false,
|
|
240
|
+
isProofRequired: true,
|
|
241
|
+
isRecipientRequired: true,
|
|
242
|
+
isIssuedAtRequired: true,
|
|
243
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
244
|
+
};
|
|
245
|
+
/**
|
|
246
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
247
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
248
|
+
* parties (§7.3 item 5).
|
|
249
|
+
*/
|
|
250
|
+
export const RESPONSE_SPEC = {
|
|
251
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
252
|
+
isBearer: false,
|
|
253
|
+
isProofRequired: true,
|
|
254
|
+
isRecipientRequired: true,
|
|
255
|
+
isIssuedAtRequired: true,
|
|
256
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
257
|
+
};
|
|
258
|
+
//# sourceMappingURL=payload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload.js","sourceRoot":"","sources":["../../../../../src/vta/services/rollback/1.1/payload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA2BH,2BAA2B;AAC3B,MAAM,CAAC,MAAM,QAAQ,GAAG,uDAAgE,CAAC;AAKzF,qEAAqE;AACrE,MAAM,CAAC,MAAM,iBAAiB,GAAG,gEAAyE,CAAC;AAK3G;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,SAAS,EAAE,8CAA8C;IACzD,KAAK,EAAE,uDAAuD;IAC9D,OAAO,EAAE,mCAAmC;IAC5C,aAAa,EAAE,gQAAgQ;IAC/Q,MAAM,EAAE,QAAQ;IAChB,sBAAsB,EAAE,KAAK;IAC7B,UAAU,EAAE;QACV,SAAS;KACV;IACD,YAAY,EAAE;QACZ,SAAS,EAAE;YACT,MAAM,EAAE,qBAAqB;SAC9B;QACD,cAAc,EAAE;YACd,MAAM,EAAE,SAAS;YACjB,SAAS,EAAE,CAAC;YACZ,aAAa,EAAE,ymBAAymB;SACznB;QACD,KAAK,EAAE;YAC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M,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
package/src/index.ts
CHANGED
|
@@ -534,6 +534,7 @@ export * as VtaServicesGet_v1_0 from "./vta/services/get/1.0/payload.js";
|
|
|
534
534
|
export * as VtaServicesList_v1_0 from "./vta/services/list/1.0/payload.js";
|
|
535
535
|
export * as VtaServicesReport_v0_1 from "./vta/services/report/0.1/payload.js";
|
|
536
536
|
export * as VtaServicesRollback_v1_0 from "./vta/services/rollback/1.0/payload.js";
|
|
537
|
+
export * as VtaServicesRollback_v1_1 from "./vta/services/rollback/1.1/payload.js";
|
|
537
538
|
export * as VtaServicesUpdate_v1_0 from "./vta/services/update/1.0/payload.js";
|
|
538
539
|
export * as VtaServicesUpdate_v1_1 from "./vta/services/update/1.1/payload.js";
|
|
539
540
|
export * as VtaWebvhAgentNameCheck_v1_0 from "./vta/webvh/agent-name/check/1.0/payload.js";
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vta/services/rollback/1.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { Ext, RollbackResult, ServiceKind } from "../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 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.
|
|
11
|
+
*/
|
|
12
|
+
export interface VTAServicesRollbackPayload {
|
|
13
|
+
service: ServiceKind;
|
|
14
|
+
/**
|
|
15
|
+
* Mediated transports only (`didcomm`, `tsp`): when the rollback moves the transport off its current mediator, how long that mediator keeps accepting delivery for correspondents still holding the current DID document. Refused for `rest` and `webauthn`. Absent takes the agent's default; ignored when the rollback leaves no mediator draining. The agent may raise a value below its floor to the floor — and does, over a request that arrived through the mediator being replaced — and one mediator carrying both mediated transports drains once for both, so read `drainUntil` in the result for the window actually applied.
|
|
16
|
+
*/
|
|
17
|
+
drainTtlSecs?: number;
|
|
18
|
+
ext?: Ext;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Success response to vta/services/rollback. Type https://trusttasks.org/spec/vta/services/rollback/1.1#response.
|
|
22
|
+
*/
|
|
23
|
+
export interface VTAServicesRollbackResponsePayload {
|
|
24
|
+
result: RollbackResult;
|
|
25
|
+
ext?: Ext;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
29
|
+
export type { Ext, RollbackResult, ServiceKind };
|
|
30
|
+
|
|
31
|
+
/** Trust Task type URI. */
|
|
32
|
+
export const TYPE_URI = "https://trusttasks.org/spec/vta/services/rollback/1.1" as const;
|
|
33
|
+
|
|
34
|
+
/** Stable alias for this specification's request payload shape. */
|
|
35
|
+
export type Payload = VTAServicesRollbackPayload;
|
|
36
|
+
|
|
37
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
38
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/services/rollback/1.1#response" as const;
|
|
39
|
+
|
|
40
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
41
|
+
export type Response = VTAServicesRollbackResponsePayload;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* This specification's payload schema, as a value.
|
|
45
|
+
*
|
|
46
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
47
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
48
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
49
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
50
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
51
|
+
*/
|
|
52
|
+
export const PAYLOAD_SCHEMA = {
|
|
53
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
54
|
+
"$id": "https://trusttasks.org/spec/vta/services/rollback/1.1",
|
|
55
|
+
"title": "VTA Services — Rollback — payload",
|
|
56
|
+
"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.",
|
|
57
|
+
"type": "object",
|
|
58
|
+
"additionalProperties": false,
|
|
59
|
+
"required": [
|
|
60
|
+
"service"
|
|
61
|
+
],
|
|
62
|
+
"properties": {
|
|
63
|
+
"service": {
|
|
64
|
+
"$ref": "#/$defs/ServiceKind"
|
|
65
|
+
},
|
|
66
|
+
"drainTtlSecs": {
|
|
67
|
+
"type": "integer",
|
|
68
|
+
"minimum": 0,
|
|
69
|
+
"description": "Mediated transports only (`didcomm`, `tsp`): when the rollback moves the transport off its current mediator, how long that mediator keeps accepting delivery for correspondents still holding the current DID document. Refused for `rest` and `webauthn`. Absent takes the agent's default; ignored when the rollback leaves no mediator draining. The agent may raise a value below its floor to the floor — and does, over a request that arrived through the mediator being replaced — and one mediator carrying both mediated transports drains once for both, so read `drainUntil` in the result for the window actually applied."
|
|
70
|
+
},
|
|
71
|
+
"ext": {
|
|
72
|
+
"$ref": "#/$defs/Ext"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"$defs": {
|
|
76
|
+
"Response": {
|
|
77
|
+
"$anchor": "response",
|
|
78
|
+
"title": "VTA Services — Rollback — response payload",
|
|
79
|
+
"description": "Success response to vta/services/rollback. Type https://trusttasks.org/spec/vta/services/rollback/1.1#response.",
|
|
80
|
+
"type": "object",
|
|
81
|
+
"additionalProperties": false,
|
|
82
|
+
"required": [
|
|
83
|
+
"result"
|
|
84
|
+
],
|
|
85
|
+
"properties": {
|
|
86
|
+
"result": {
|
|
87
|
+
"$ref": "#/$defs/RollbackResult"
|
|
88
|
+
},
|
|
89
|
+
"ext": {
|
|
90
|
+
"$ref": "#/$defs/Ext"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"Ext": {
|
|
95
|
+
"title": "Ext",
|
|
96
|
+
"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.",
|
|
97
|
+
"type": "object",
|
|
98
|
+
"minProperties": 1,
|
|
99
|
+
"additionalProperties": true,
|
|
100
|
+
"propertyNames": {
|
|
101
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"RollbackResult": {
|
|
105
|
+
"title": "RollbackResult",
|
|
106
|
+
"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.",
|
|
107
|
+
"type": "object",
|
|
108
|
+
"additionalProperties": false,
|
|
109
|
+
"required": [
|
|
110
|
+
"kind"
|
|
111
|
+
],
|
|
112
|
+
"properties": {
|
|
113
|
+
"kind": {
|
|
114
|
+
"type": "string",
|
|
115
|
+
"enum": [
|
|
116
|
+
"disabled",
|
|
117
|
+
"enabled",
|
|
118
|
+
"updated",
|
|
119
|
+
"noOp"
|
|
120
|
+
],
|
|
121
|
+
"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."
|
|
122
|
+
},
|
|
123
|
+
"logEntryVersionId": {
|
|
124
|
+
"type": "string",
|
|
125
|
+
"description": "Version id of the log entry the rollback wrote. **Absent when `kind` is `noOp`**, and present otherwise."
|
|
126
|
+
},
|
|
127
|
+
"effectiveAt": {
|
|
128
|
+
"type": "string",
|
|
129
|
+
"format": "date-time",
|
|
130
|
+
"description": "RFC 3339 instant the rollback took effect. Absent for `noOp`."
|
|
131
|
+
},
|
|
132
|
+
"drainingMediator": {
|
|
133
|
+
"type": "string",
|
|
134
|
+
"description": "Present when rolling back DIDComm left a mediator draining."
|
|
135
|
+
},
|
|
136
|
+
"drainUntil": {
|
|
137
|
+
"type": "string",
|
|
138
|
+
"format": "date-time",
|
|
139
|
+
"description": "When that drain completes."
|
|
140
|
+
},
|
|
141
|
+
"vtaDid": {
|
|
142
|
+
"type": "string",
|
|
143
|
+
"description": "The agent's own DID."
|
|
144
|
+
},
|
|
145
|
+
"serverless": {
|
|
146
|
+
"type": "boolean",
|
|
147
|
+
"default": false,
|
|
148
|
+
"description": "True when the entry was written locally but not published — the operator must redeploy before any verifier sees it."
|
|
149
|
+
},
|
|
150
|
+
"ext": {
|
|
151
|
+
"$ref": "#/$defs/Ext"
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
"ServiceKind": {
|
|
156
|
+
"title": "ServiceKind",
|
|
157
|
+
"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.",
|
|
158
|
+
"type": "string",
|
|
159
|
+
"enum": [
|
|
160
|
+
"didcomm",
|
|
161
|
+
"rest",
|
|
162
|
+
"tsp",
|
|
163
|
+
"webauthn"
|
|
164
|
+
]
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
} as const;
|
|
168
|
+
|
|
169
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
170
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
171
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
172
|
+
"$ref": "#/$defs/Response",
|
|
173
|
+
"$defs": {
|
|
174
|
+
"Response": {
|
|
175
|
+
"$anchor": "response",
|
|
176
|
+
"title": "VTA Services — Rollback — response payload",
|
|
177
|
+
"description": "Success response to vta/services/rollback. Type https://trusttasks.org/spec/vta/services/rollback/1.1#response.",
|
|
178
|
+
"type": "object",
|
|
179
|
+
"additionalProperties": false,
|
|
180
|
+
"required": [
|
|
181
|
+
"result"
|
|
182
|
+
],
|
|
183
|
+
"properties": {
|
|
184
|
+
"result": {
|
|
185
|
+
"$ref": "#/$defs/RollbackResult"
|
|
186
|
+
},
|
|
187
|
+
"ext": {
|
|
188
|
+
"$ref": "#/$defs/Ext"
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
"Ext": {
|
|
193
|
+
"title": "Ext",
|
|
194
|
+
"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.",
|
|
195
|
+
"type": "object",
|
|
196
|
+
"minProperties": 1,
|
|
197
|
+
"additionalProperties": true,
|
|
198
|
+
"propertyNames": {
|
|
199
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
"RollbackResult": {
|
|
203
|
+
"title": "RollbackResult",
|
|
204
|
+
"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.",
|
|
205
|
+
"type": "object",
|
|
206
|
+
"additionalProperties": false,
|
|
207
|
+
"required": [
|
|
208
|
+
"kind"
|
|
209
|
+
],
|
|
210
|
+
"properties": {
|
|
211
|
+
"kind": {
|
|
212
|
+
"type": "string",
|
|
213
|
+
"enum": [
|
|
214
|
+
"disabled",
|
|
215
|
+
"enabled",
|
|
216
|
+
"updated",
|
|
217
|
+
"noOp"
|
|
218
|
+
],
|
|
219
|
+
"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."
|
|
220
|
+
},
|
|
221
|
+
"logEntryVersionId": {
|
|
222
|
+
"type": "string",
|
|
223
|
+
"description": "Version id of the log entry the rollback wrote. **Absent when `kind` is `noOp`**, and present otherwise."
|
|
224
|
+
},
|
|
225
|
+
"effectiveAt": {
|
|
226
|
+
"type": "string",
|
|
227
|
+
"format": "date-time",
|
|
228
|
+
"description": "RFC 3339 instant the rollback took effect. Absent for `noOp`."
|
|
229
|
+
},
|
|
230
|
+
"drainingMediator": {
|
|
231
|
+
"type": "string",
|
|
232
|
+
"description": "Present when rolling back DIDComm left a mediator draining."
|
|
233
|
+
},
|
|
234
|
+
"drainUntil": {
|
|
235
|
+
"type": "string",
|
|
236
|
+
"format": "date-time",
|
|
237
|
+
"description": "When that drain completes."
|
|
238
|
+
},
|
|
239
|
+
"vtaDid": {
|
|
240
|
+
"type": "string",
|
|
241
|
+
"description": "The agent's own DID."
|
|
242
|
+
},
|
|
243
|
+
"serverless": {
|
|
244
|
+
"type": "boolean",
|
|
245
|
+
"default": false,
|
|
246
|
+
"description": "True when the entry was written locally but not published — the operator must redeploy before any verifier sees it."
|
|
247
|
+
},
|
|
248
|
+
"ext": {
|
|
249
|
+
"$ref": "#/$defs/Ext"
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
"ServiceKind": {
|
|
254
|
+
"title": "ServiceKind",
|
|
255
|
+
"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.",
|
|
256
|
+
"type": "string",
|
|
257
|
+
"enum": [
|
|
258
|
+
"didcomm",
|
|
259
|
+
"rest",
|
|
260
|
+
"tsp",
|
|
261
|
+
"webauthn"
|
|
262
|
+
]
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
} as const;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
269
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
270
|
+
* per-specification and cannot be derived from the document alone, and
|
|
271
|
+
* item 2 needs the schema this carries.
|
|
272
|
+
*/
|
|
273
|
+
export const SPEC = {
|
|
274
|
+
typeUri: TYPE_URI,
|
|
275
|
+
isBearer: false,
|
|
276
|
+
isProofRequired: true,
|
|
277
|
+
isRecipientRequired: true,
|
|
278
|
+
isIssuedAtRequired: true,
|
|
279
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
280
|
+
} as const;
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
284
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
285
|
+
* parties (§7.3 item 5).
|
|
286
|
+
*/
|
|
287
|
+
export const RESPONSE_SPEC = {
|
|
288
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
289
|
+
isBearer: false,
|
|
290
|
+
isProofRequired: true,
|
|
291
|
+
isRecipientRequired: true,
|
|
292
|
+
isIssuedAtRequired: true,
|
|
293
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
294
|
+
} as const;
|