@openvtc/trust-tasks 0.28.0 → 0.28.1

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,228 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vta/contexts/delete/1.1/payload.schema.json
4
+ */
5
+
6
+ import type { Ext } from "../../../../_shared/components.js";
7
+
8
+
9
+ export interface VTAContextsDeletePayload {
10
+ /**
11
+ * Context to delete.
12
+ */
13
+ id: string;
14
+ /**
15
+ * Delete even though the context still holds keys, DIDs or templates. Default false, and the default is the point: without it a context holding anything is refused, so the destructive case is always something a caller asked for explicitly.
16
+ */
17
+ force?: boolean;
18
+ /**
19
+ * Complete the deletion even where the published log of a `did:webvh` DID in the subtree could not be confirmed removed from its hosting server — the server unreachable, refusing, or no longer known to the VTA. Default false: such a deletion is refused with `vta/contexts/delete:hostCleanupFailed` and nothing is deleted locally, so the caller can wait for the host and retry. True accepts that the named DIDs may keep resolving and that removing them is now the caller's responsibility; each is reported in `daemonCleanupErrors`.
20
+ */
21
+ abandonHostCopies?: boolean;
22
+ ext?: Ext;
23
+ }
24
+ /**
25
+ * Success response to vta/contexts/delete. Type https://trusttasks.org/spec/vta/contexts/delete/1.1#response.
26
+ */
27
+ export interface VTAContextsDeleteResponsePayload {
28
+ id: string;
29
+ /**
30
+ * Whether the context was removed. A successful response carrying `false` means the VTA declined to act — it is not an error, and a consumer MUST NOT report the deletion as done on the basis of the response status alone.
31
+ */
32
+ deleted: boolean;
33
+ /**
34
+ * One entry per `did:webvh` DID in the deleted subtree whose local record was removed while its hosting server did not confirm removal of the published log. **Those DIDs may still resolve.** Only ever present when the request set `abandonHostCopies`; a requester that did not is refused instead. A consumer MUST surface it rather than treating the deletion as complete. Absent or empty means every host copy was confirmed gone.
35
+ */
36
+ daemonCleanupErrors?: string[];
37
+ ext?: Ext;
38
+ }
39
+
40
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
41
+ export type { Ext };
42
+
43
+ /** Trust Task type URI. */
44
+ export const TYPE_URI = "https://trusttasks.org/spec/vta/contexts/delete/1.1" as const;
45
+
46
+ /**
47
+ * The earlier version of this specification that this one declares it
48
+ * extends (front matter `extends`, SPEC §5.2 "Declared extension"), or
49
+ * `null`. Only the direct declaration — follow the chain with
50
+ * `extendsChain` / `readForSpec`.
51
+ */
52
+ export const EXTENDS: string | null = null;
53
+
54
+ /**
55
+ * Why this version is deprecated, or `null` while it is current. A
56
+ * superseded or retired version is still supported, and is withdrawn from
57
+ * this package in a later scheduled batch (SPEC "Superseded and Withdrawn
58
+ * Versions").
59
+ */
60
+ export const DEPRECATION: string | null = null;
61
+
62
+ /** Stable alias for this specification's request payload shape. */
63
+ export type Payload = VTAContextsDeletePayload;
64
+
65
+ /** Trust Task response type URI (request type URI + "#response"). */
66
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/contexts/delete/1.1#response" as const;
67
+
68
+ /** Stable alias for this specification's success-response payload shape. */
69
+ export type Response = VTAContextsDeleteResponsePayload;
70
+
71
+ /**
72
+ * This specification's payload schema, as a value.
73
+ *
74
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
75
+ * rather than only as a `.json` file because TypeScript types are erased
76
+ * at runtime: without a schema a consumer has nothing to validate, and
77
+ * every REQUIRED payload member is optional in practice. Cross-file
78
+ * `$ref`s are already inlined, so it needs no resolver.
79
+ */
80
+ export const PAYLOAD_SCHEMA = {
81
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
82
+ "$id": "https://trusttasks.org/spec/vta/contexts/delete/1.1",
83
+ "title": "VTA Contexts Delete — payload",
84
+ "type": "object",
85
+ "additionalProperties": false,
86
+ "required": [
87
+ "id"
88
+ ],
89
+ "properties": {
90
+ "id": {
91
+ "type": "string",
92
+ "minLength": 1,
93
+ "description": "Context to delete."
94
+ },
95
+ "force": {
96
+ "type": "boolean",
97
+ "default": false,
98
+ "description": "Delete even though the context still holds keys, DIDs or templates. Default false, and the default is the point: without it a context holding anything is refused, so the destructive case is always something a caller asked for explicitly."
99
+ },
100
+ "abandonHostCopies": {
101
+ "type": "boolean",
102
+ "default": false,
103
+ "description": "Complete the deletion even where the published log of a `did:webvh` DID in the subtree could not be confirmed removed from its hosting server — the server unreachable, refusing, or no longer known to the VTA. Default false: such a deletion is refused with `vta/contexts/delete:hostCleanupFailed` and nothing is deleted locally, so the caller can wait for the host and retry. True accepts that the named DIDs may keep resolving and that removing them is now the caller's responsibility; each is reported in `daemonCleanupErrors`."
104
+ },
105
+ "ext": {
106
+ "$ref": "#/$defs/Ext"
107
+ }
108
+ },
109
+ "$defs": {
110
+ "Response": {
111
+ "$anchor": "response",
112
+ "title": "VTA Contexts Delete — response payload",
113
+ "description": "Success response to vta/contexts/delete. Type https://trusttasks.org/spec/vta/contexts/delete/1.1#response.",
114
+ "type": "object",
115
+ "additionalProperties": false,
116
+ "required": [
117
+ "id",
118
+ "deleted"
119
+ ],
120
+ "properties": {
121
+ "id": {
122
+ "type": "string"
123
+ },
124
+ "deleted": {
125
+ "type": "boolean",
126
+ "description": "Whether the context was removed. A successful response carrying `false` means the VTA declined to act — it is not an error, and a consumer MUST NOT report the deletion as done on the basis of the response status alone."
127
+ },
128
+ "daemonCleanupErrors": {
129
+ "type": "array",
130
+ "items": {
131
+ "type": "string"
132
+ },
133
+ "description": "One entry per `did:webvh` DID in the deleted subtree whose local record was removed while its hosting server did not confirm removal of the published log. **Those DIDs may still resolve.** Only ever present when the request set `abandonHostCopies`; a requester that did not is refused instead. A consumer MUST surface it rather than treating the deletion as complete. Absent or empty means every host copy was confirmed gone."
134
+ },
135
+ "ext": {
136
+ "$ref": "#/$defs/Ext"
137
+ }
138
+ }
139
+ },
140
+ "Ext": {
141
+ "title": "Ext",
142
+ "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.",
143
+ "type": "object",
144
+ "minProperties": 1,
145
+ "additionalProperties": true,
146
+ "propertyNames": {
147
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
148
+ }
149
+ }
150
+ }
151
+ } as const;
152
+
153
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
154
+ export const RESPONSE_PAYLOAD_SCHEMA = {
155
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
156
+ "$ref": "#/$defs/Response",
157
+ "$defs": {
158
+ "Response": {
159
+ "$anchor": "response",
160
+ "title": "VTA Contexts Delete — response payload",
161
+ "description": "Success response to vta/contexts/delete. Type https://trusttasks.org/spec/vta/contexts/delete/1.1#response.",
162
+ "type": "object",
163
+ "additionalProperties": false,
164
+ "required": [
165
+ "id",
166
+ "deleted"
167
+ ],
168
+ "properties": {
169
+ "id": {
170
+ "type": "string"
171
+ },
172
+ "deleted": {
173
+ "type": "boolean",
174
+ "description": "Whether the context was removed. A successful response carrying `false` means the VTA declined to act — it is not an error, and a consumer MUST NOT report the deletion as done on the basis of the response status alone."
175
+ },
176
+ "daemonCleanupErrors": {
177
+ "type": "array",
178
+ "items": {
179
+ "type": "string"
180
+ },
181
+ "description": "One entry per `did:webvh` DID in the deleted subtree whose local record was removed while its hosting server did not confirm removal of the published log. **Those DIDs may still resolve.** Only ever present when the request set `abandonHostCopies`; a requester that did not is refused instead. A consumer MUST surface it rather than treating the deletion as complete. Absent or empty means every host copy was confirmed gone."
182
+ },
183
+ "ext": {
184
+ "$ref": "#/$defs/Ext"
185
+ }
186
+ }
187
+ },
188
+ "Ext": {
189
+ "title": "Ext",
190
+ "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.",
191
+ "type": "object",
192
+ "minProperties": 1,
193
+ "additionalProperties": true,
194
+ "propertyNames": {
195
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
196
+ }
197
+ }
198
+ }
199
+ } as const;
200
+
201
+ /**
202
+ * SPEC.md §7.2 policy for the request variant, from this specification's
203
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
204
+ * per-specification and cannot be derived from the document alone, and
205
+ * item 2 needs the schema this carries.
206
+ */
207
+ export const SPEC = {
208
+ typeUri: TYPE_URI,
209
+ isBearer: false,
210
+ isProofRequired: true,
211
+ isRecipientRequired: true,
212
+ isIssuedAtRequired: true,
213
+ payloadSchema: PAYLOAD_SCHEMA,
214
+ } as const;
215
+
216
+ /**
217
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
218
+ * tracks the *issuer* party's requirement because a response swaps the
219
+ * parties (§7.3 item 5).
220
+ */
221
+ export const RESPONSE_SPEC = {
222
+ typeUri: RESPONSE_TYPE_URI,
223
+ isBearer: false,
224
+ isProofRequired: true,
225
+ isRecipientRequired: true,
226
+ isIssuedAtRequired: true,
227
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
228
+ } as const;