@openvtc/trust-tasks 0.12.1 → 0.12.2
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/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/vta/_shared/0.1/app-state-record.d.ts +17 -0
- package/dist/vta/_shared/0.1/app-state-record.d.ts.map +1 -0
- package/dist/vta/_shared/0.1/app-state-record.js +6 -0
- package/dist/vta/_shared/0.1/app-state-record.js.map +1 -0
- package/dist/vta/app-state/delete/1.0/payload.d.ts +488 -0
- package/dist/vta/app-state/delete/1.0/payload.d.ts.map +1 -0
- package/dist/vta/app-state/delete/1.0/payload.js +248 -0
- package/dist/vta/app-state/delete/1.0/payload.js.map +1 -0
- package/dist/vta/app-state/get/1.0/payload.d.ts +611 -0
- package/dist/vta/app-state/get/1.0/payload.d.ts.map +1 -0
- package/dist/vta/app-state/get/1.0/payload.js +306 -0
- package/dist/vta/app-state/get/1.0/payload.js.map +1 -0
- package/dist/vta/app-state/get-many/1.0/payload.d.ts +716 -0
- package/dist/vta/app-state/get-many/1.0/payload.d.ts.map +1 -0
- package/dist/vta/app-state/get-many/1.0/payload.js +350 -0
- package/dist/vta/app-state/get-many/1.0/payload.js.map +1 -0
- package/dist/vta/app-state/list/1.0/payload.d.ts +778 -0
- package/dist/vta/app-state/list/1.0/payload.d.ts.map +1 -0
- package/dist/vta/app-state/list/1.0/payload.js +368 -0
- package/dist/vta/app-state/list/1.0/payload.js.map +1 -0
- package/dist/vta/app-state/put/1.0/payload.d.ts +560 -0
- package/dist/vta/app-state/put/1.0/payload.d.ts.map +1 -0
- package/dist/vta/app-state/put/1.0/payload.js +291 -0
- package/dist/vta/app-state/put/1.0/payload.js.map +1 -0
- package/dist/vta/app-state/put-many/1.0/payload.d.ts +856 -0
- package/dist/vta/app-state/put-many/1.0/payload.d.ts.map +1 -0
- package/dist/vta/app-state/put-many/1.0/payload.js +455 -0
- package/dist/vta/app-state/put-many/1.0/payload.js.map +1 -0
- package/package.json +1 -1
- package/src/index.ts +7 -0
- package/src/vta/_shared/0.1/app-state-record.ts +17 -0
- package/src/vta/app-state/delete/1.0/payload.ts +323 -0
- package/src/vta/app-state/get/1.0/payload.ts +404 -0
- package/src/vta/app-state/get-many/1.0/payload.ts +469 -0
- package/src/vta/app-state/list/1.0/payload.ts +509 -0
- package/src/vta/app-state/put/1.0/payload.ts +382 -0
- package/src/vta/app-state/put-many/1.0/payload.ts +584 -0
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vta/app-state/delete/1.0/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Scopes one application's records within a context, so several tools can share a context without colliding — `openvtc`, `cnm`, an agent runtime. The maintainer MUST NOT interpret the value; it is an opaque partition name. Namespaces are first-come and unreserved, so an application SHOULD pick a stable, specific one: a future per-namespace ACL would grant on this exact string, which makes renaming a namespace a migration rather than an edit.
|
|
7
|
+
*/
|
|
8
|
+
export type Namespace = string;
|
|
9
|
+
/**
|
|
10
|
+
* Application-chosen identifier for a record within a namespace. Opaque to the maintainer: it MUST NOT be parsed, normalized, or case-folded, and prefix matching in `list` is a byte-prefix comparison over the UTF-8 encoding. Applications SHOULD use `/`-delimited hierarchical keys (`community/acme`, `contact/z6Mk…`) so that `prefix` can address a record family, but the delimiter is a convention between an application and itself — the maintainer attaches no meaning to it.
|
|
11
|
+
*/
|
|
12
|
+
export type Key = string;
|
|
13
|
+
/**
|
|
14
|
+
* Optional precondition, on the same terms as vta/app-state/put. A positive value requires the live record to be at exactly that version — so a delete cannot discard an edit the caller never saw. Zero is meaningless here (a create-only precondition on a delete can never be satisfiable and never useful) and MUST be refused.
|
|
15
|
+
*/
|
|
16
|
+
export type ExpectedVersion = number;
|
|
17
|
+
/**
|
|
18
|
+
* The tombstone's version — the counter value this delete took, or the value the existing tombstone already held when `existed` is false. Absent only when the address held nothing and no tombstone was written.
|
|
19
|
+
*/
|
|
20
|
+
export type Version = number;
|
|
21
|
+
/**
|
|
22
|
+
* Delete one application-state record, leaving a versioned tombstone so that consumers syncing incrementally learn of the deletion rather than resurrecting the record on their next rebuild. The tombstone is reaped after the maintainer's retention window.
|
|
23
|
+
*/
|
|
24
|
+
export interface VTAApplicationStateDeletePayload {
|
|
25
|
+
/**
|
|
26
|
+
* The VTA context the record is scoped to; the isolation boundary.
|
|
27
|
+
*/
|
|
28
|
+
contextId: string;
|
|
29
|
+
namespace: Namespace;
|
|
30
|
+
key: Key;
|
|
31
|
+
expectedVersion?: ExpectedVersion;
|
|
32
|
+
ext?: Ext;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Ecosystem-defined extension members per SPEC.md §4.5.1.
|
|
36
|
+
*/
|
|
37
|
+
export interface Ext {
|
|
38
|
+
[k: string]: unknown | undefined;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Success response to vta/app-state/delete. Type https://trusttasks.org/spec/vta/app-state/delete/1.0#response. Deleting an address that holds nothing is a success, not an error — that is what makes the task converge under replay.
|
|
42
|
+
*/
|
|
43
|
+
export interface VTAApplicationStateDeleteResponsePayload {
|
|
44
|
+
/**
|
|
45
|
+
* Echoed from the request.
|
|
46
|
+
*/
|
|
47
|
+
contextId: string;
|
|
48
|
+
namespace: Namespace;
|
|
49
|
+
key: Key;
|
|
50
|
+
/**
|
|
51
|
+
* True when a live record was removed by this request. False when the address already held a tombstone, or held nothing at all — both of which are successes, because the caller's intent is satisfied either way.
|
|
52
|
+
*/
|
|
53
|
+
existed: boolean;
|
|
54
|
+
version?: Version;
|
|
55
|
+
/**
|
|
56
|
+
* When the deletion was recorded. Absent on the same terms as `version`.
|
|
57
|
+
*/
|
|
58
|
+
deletedAt?: string;
|
|
59
|
+
ext?: Ext1;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Ecosystem-defined extension members per SPEC.md §4.5.1.
|
|
63
|
+
*/
|
|
64
|
+
export interface Ext1 {
|
|
65
|
+
[k: string]: unknown | undefined;
|
|
66
|
+
}
|
|
67
|
+
/** Trust Task type URI. */
|
|
68
|
+
export declare const TYPE_URI: "https://trusttasks.org/spec/vta/app-state/delete/1.0";
|
|
69
|
+
/** Stable alias for this specification's request payload shape. */
|
|
70
|
+
export type Payload = VTAApplicationStateDeletePayload;
|
|
71
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
72
|
+
export declare const RESPONSE_TYPE_URI: "https://trusttasks.org/spec/vta/app-state/delete/1.0#response";
|
|
73
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
74
|
+
export type Response = VTAApplicationStateDeleteResponsePayload;
|
|
75
|
+
/**
|
|
76
|
+
* This specification's payload schema, as a value.
|
|
77
|
+
*
|
|
78
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
79
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
80
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
81
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
82
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
83
|
+
*/
|
|
84
|
+
export declare const PAYLOAD_SCHEMA: {
|
|
85
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
86
|
+
readonly $id: "https://trusttasks.org/spec/vta/app-state/delete/1.0";
|
|
87
|
+
readonly title: "VTA Application State Delete — payload";
|
|
88
|
+
readonly description: "Delete one application-state record, leaving a versioned tombstone so that consumers syncing incrementally learn of the deletion rather than resurrecting the record on their next rebuild. The tombstone is reaped after the maintainer's retention window.";
|
|
89
|
+
readonly type: "object";
|
|
90
|
+
readonly additionalProperties: false;
|
|
91
|
+
readonly required: readonly ["contextId", "namespace", "key"];
|
|
92
|
+
readonly properties: {
|
|
93
|
+
readonly contextId: {
|
|
94
|
+
readonly type: "string";
|
|
95
|
+
readonly minLength: 1;
|
|
96
|
+
readonly description: "The VTA context the record is scoped to; the isolation boundary.";
|
|
97
|
+
};
|
|
98
|
+
readonly namespace: {
|
|
99
|
+
readonly $ref: "#/$defs/Namespace";
|
|
100
|
+
};
|
|
101
|
+
readonly key: {
|
|
102
|
+
readonly $ref: "#/$defs/Key";
|
|
103
|
+
};
|
|
104
|
+
readonly expectedVersion: {
|
|
105
|
+
readonly $ref: "#/$defs/ExpectedVersion";
|
|
106
|
+
readonly description: "Optional precondition, on the same terms as vta/app-state/put. A positive value requires the live record to be at exactly that version — so a delete cannot discard an edit the caller never saw. Zero is meaningless here (a create-only precondition on a delete can never be satisfiable and never useful) and MUST be refused.";
|
|
107
|
+
};
|
|
108
|
+
readonly ext: {
|
|
109
|
+
readonly $ref: "#/$defs/Ext";
|
|
110
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
readonly $defs: {
|
|
114
|
+
readonly Response: {
|
|
115
|
+
readonly $anchor: "response";
|
|
116
|
+
readonly title: "VTA Application State Delete — response payload";
|
|
117
|
+
readonly description: "Success response to vta/app-state/delete. Type https://trusttasks.org/spec/vta/app-state/delete/1.0#response. Deleting an address that holds nothing is a success, not an error — that is what makes the task converge under replay.";
|
|
118
|
+
readonly type: "object";
|
|
119
|
+
readonly additionalProperties: false;
|
|
120
|
+
readonly required: readonly ["contextId", "namespace", "key", "existed"];
|
|
121
|
+
readonly properties: {
|
|
122
|
+
readonly contextId: {
|
|
123
|
+
readonly type: "string";
|
|
124
|
+
readonly minLength: 1;
|
|
125
|
+
readonly description: "Echoed from the request.";
|
|
126
|
+
};
|
|
127
|
+
readonly namespace: {
|
|
128
|
+
readonly $ref: "#/$defs/Namespace";
|
|
129
|
+
};
|
|
130
|
+
readonly key: {
|
|
131
|
+
readonly $ref: "#/$defs/Key";
|
|
132
|
+
};
|
|
133
|
+
readonly existed: {
|
|
134
|
+
readonly type: "boolean";
|
|
135
|
+
readonly description: "True when a live record was removed by this request. False when the address already held a tombstone, or held nothing at all — both of which are successes, because the caller's intent is satisfied either way.";
|
|
136
|
+
};
|
|
137
|
+
readonly version: {
|
|
138
|
+
readonly $ref: "#/$defs/Version";
|
|
139
|
+
readonly description: "The tombstone's version — the counter value this delete took, or the value the existing tombstone already held when `existed` is false. Absent only when the address held nothing and no tombstone was written.";
|
|
140
|
+
};
|
|
141
|
+
readonly deletedAt: {
|
|
142
|
+
readonly type: "string";
|
|
143
|
+
readonly format: "date-time";
|
|
144
|
+
readonly description: "When the deletion was recorded. Absent on the same terms as `version`.";
|
|
145
|
+
};
|
|
146
|
+
readonly ext: {
|
|
147
|
+
readonly $ref: "#/$defs/Ext";
|
|
148
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
readonly Ext: {
|
|
153
|
+
readonly title: "Ext";
|
|
154
|
+
readonly 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.";
|
|
155
|
+
readonly type: "object";
|
|
156
|
+
readonly minProperties: 1;
|
|
157
|
+
readonly additionalProperties: true;
|
|
158
|
+
readonly propertyNames: {
|
|
159
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
readonly Version: {
|
|
163
|
+
readonly title: "Version";
|
|
164
|
+
readonly description: "A value of the namespace's monotonic write counter (see this schema's description). Server-assigned; a producer never chooses one.";
|
|
165
|
+
readonly type: "integer";
|
|
166
|
+
readonly minimum: 1;
|
|
167
|
+
};
|
|
168
|
+
readonly Key: {
|
|
169
|
+
readonly title: "Key";
|
|
170
|
+
readonly description: "Application-chosen identifier for a record within a namespace. Opaque to the maintainer: it MUST NOT be parsed, normalized, or case-folded, and prefix matching in `list` is a byte-prefix comparison over the UTF-8 encoding. Applications SHOULD use `/`-delimited hierarchical keys (`community/acme`, `contact/z6Mk…`) so that `prefix` can address a record family, but the delimiter is a convention between an application and itself — the maintainer attaches no meaning to it.";
|
|
171
|
+
readonly type: "string";
|
|
172
|
+
readonly minLength: 1;
|
|
173
|
+
readonly maxLength: 512;
|
|
174
|
+
readonly pattern: "^[^\\u0000]+$";
|
|
175
|
+
};
|
|
176
|
+
readonly Namespace: {
|
|
177
|
+
readonly title: "Namespace";
|
|
178
|
+
readonly description: "Scopes one application's records within a context, so several tools can share a context without colliding — `openvtc`, `cnm`, an agent runtime. The maintainer MUST NOT interpret the value; it is an opaque partition name. Namespaces are first-come and unreserved, so an application SHOULD pick a stable, specific one: a future per-namespace ACL would grant on this exact string, which makes renaming a namespace a migration rather than an edit.";
|
|
179
|
+
readonly type: "string";
|
|
180
|
+
readonly minLength: 1;
|
|
181
|
+
readonly maxLength: 64;
|
|
182
|
+
readonly pattern: "^[a-z][a-z0-9]*(-[a-z0-9]+)*$";
|
|
183
|
+
};
|
|
184
|
+
readonly ExpectedVersion: {
|
|
185
|
+
readonly title: "ExpectedVersion";
|
|
186
|
+
readonly description: "Optimistic-concurrency precondition on a write. A positive value requires that the record's current `version` equals it exactly. Zero means \"create only\" — the write applies only if no LIVE record exists at the address, which is what makes lease acquisition safe: without it two instances can each read \"absent\", each write, and each believe it won. A tombstone is not a live record, so `expectedVersion: 0` succeeds over one; the created record takes the namespace's next counter value, which is necessarily greater than the tombstone's.";
|
|
187
|
+
readonly type: "integer";
|
|
188
|
+
readonly minimum: 0;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
193
|
+
export declare const RESPONSE_PAYLOAD_SCHEMA: {
|
|
194
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
195
|
+
readonly $ref: "#/$defs/Response";
|
|
196
|
+
readonly $defs: {
|
|
197
|
+
readonly Response: {
|
|
198
|
+
readonly $anchor: "response";
|
|
199
|
+
readonly title: "VTA Application State Delete — response payload";
|
|
200
|
+
readonly description: "Success response to vta/app-state/delete. Type https://trusttasks.org/spec/vta/app-state/delete/1.0#response. Deleting an address that holds nothing is a success, not an error — that is what makes the task converge under replay.";
|
|
201
|
+
readonly type: "object";
|
|
202
|
+
readonly additionalProperties: false;
|
|
203
|
+
readonly required: readonly ["contextId", "namespace", "key", "existed"];
|
|
204
|
+
readonly properties: {
|
|
205
|
+
readonly contextId: {
|
|
206
|
+
readonly type: "string";
|
|
207
|
+
readonly minLength: 1;
|
|
208
|
+
readonly description: "Echoed from the request.";
|
|
209
|
+
};
|
|
210
|
+
readonly namespace: {
|
|
211
|
+
readonly $ref: "#/$defs/Namespace";
|
|
212
|
+
};
|
|
213
|
+
readonly key: {
|
|
214
|
+
readonly $ref: "#/$defs/Key";
|
|
215
|
+
};
|
|
216
|
+
readonly existed: {
|
|
217
|
+
readonly type: "boolean";
|
|
218
|
+
readonly description: "True when a live record was removed by this request. False when the address already held a tombstone, or held nothing at all — both of which are successes, because the caller's intent is satisfied either way.";
|
|
219
|
+
};
|
|
220
|
+
readonly version: {
|
|
221
|
+
readonly $ref: "#/$defs/Version";
|
|
222
|
+
readonly description: "The tombstone's version — the counter value this delete took, or the value the existing tombstone already held when `existed` is false. Absent only when the address held nothing and no tombstone was written.";
|
|
223
|
+
};
|
|
224
|
+
readonly deletedAt: {
|
|
225
|
+
readonly type: "string";
|
|
226
|
+
readonly format: "date-time";
|
|
227
|
+
readonly description: "When the deletion was recorded. Absent on the same terms as `version`.";
|
|
228
|
+
};
|
|
229
|
+
readonly ext: {
|
|
230
|
+
readonly $ref: "#/$defs/Ext";
|
|
231
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
readonly Ext: {
|
|
236
|
+
readonly title: "Ext";
|
|
237
|
+
readonly 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.";
|
|
238
|
+
readonly type: "object";
|
|
239
|
+
readonly minProperties: 1;
|
|
240
|
+
readonly additionalProperties: true;
|
|
241
|
+
readonly propertyNames: {
|
|
242
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
readonly Version: {
|
|
246
|
+
readonly title: "Version";
|
|
247
|
+
readonly description: "A value of the namespace's monotonic write counter (see this schema's description). Server-assigned; a producer never chooses one.";
|
|
248
|
+
readonly type: "integer";
|
|
249
|
+
readonly minimum: 1;
|
|
250
|
+
};
|
|
251
|
+
readonly Key: {
|
|
252
|
+
readonly title: "Key";
|
|
253
|
+
readonly description: "Application-chosen identifier for a record within a namespace. Opaque to the maintainer: it MUST NOT be parsed, normalized, or case-folded, and prefix matching in `list` is a byte-prefix comparison over the UTF-8 encoding. Applications SHOULD use `/`-delimited hierarchical keys (`community/acme`, `contact/z6Mk…`) so that `prefix` can address a record family, but the delimiter is a convention between an application and itself — the maintainer attaches no meaning to it.";
|
|
254
|
+
readonly type: "string";
|
|
255
|
+
readonly minLength: 1;
|
|
256
|
+
readonly maxLength: 512;
|
|
257
|
+
readonly pattern: "^[^\\u0000]+$";
|
|
258
|
+
};
|
|
259
|
+
readonly Namespace: {
|
|
260
|
+
readonly title: "Namespace";
|
|
261
|
+
readonly description: "Scopes one application's records within a context, so several tools can share a context without colliding — `openvtc`, `cnm`, an agent runtime. The maintainer MUST NOT interpret the value; it is an opaque partition name. Namespaces are first-come and unreserved, so an application SHOULD pick a stable, specific one: a future per-namespace ACL would grant on this exact string, which makes renaming a namespace a migration rather than an edit.";
|
|
262
|
+
readonly type: "string";
|
|
263
|
+
readonly minLength: 1;
|
|
264
|
+
readonly maxLength: 64;
|
|
265
|
+
readonly pattern: "^[a-z][a-z0-9]*(-[a-z0-9]+)*$";
|
|
266
|
+
};
|
|
267
|
+
readonly ExpectedVersion: {
|
|
268
|
+
readonly title: "ExpectedVersion";
|
|
269
|
+
readonly description: "Optimistic-concurrency precondition on a write. A positive value requires that the record's current `version` equals it exactly. Zero means \"create only\" — the write applies only if no LIVE record exists at the address, which is what makes lease acquisition safe: without it two instances can each read \"absent\", each write, and each believe it won. A tombstone is not a live record, so `expectedVersion: 0` succeeds over one; the created record takes the namespace's next counter value, which is necessarily greater than the tombstone's.";
|
|
270
|
+
readonly type: "integer";
|
|
271
|
+
readonly minimum: 0;
|
|
272
|
+
};
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
/**
|
|
276
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
277
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
278
|
+
* per-specification and cannot be derived from the document alone, and
|
|
279
|
+
* item 2 needs the schema this carries.
|
|
280
|
+
*/
|
|
281
|
+
export declare const SPEC: {
|
|
282
|
+
readonly typeUri: "https://trusttasks.org/spec/vta/app-state/delete/1.0";
|
|
283
|
+
readonly isBearer: false;
|
|
284
|
+
readonly isProofRequired: true;
|
|
285
|
+
readonly isRecipientRequired: true;
|
|
286
|
+
readonly payloadSchema: {
|
|
287
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
288
|
+
readonly $id: "https://trusttasks.org/spec/vta/app-state/delete/1.0";
|
|
289
|
+
readonly title: "VTA Application State Delete — payload";
|
|
290
|
+
readonly description: "Delete one application-state record, leaving a versioned tombstone so that consumers syncing incrementally learn of the deletion rather than resurrecting the record on their next rebuild. The tombstone is reaped after the maintainer's retention window.";
|
|
291
|
+
readonly type: "object";
|
|
292
|
+
readonly additionalProperties: false;
|
|
293
|
+
readonly required: readonly ["contextId", "namespace", "key"];
|
|
294
|
+
readonly properties: {
|
|
295
|
+
readonly contextId: {
|
|
296
|
+
readonly type: "string";
|
|
297
|
+
readonly minLength: 1;
|
|
298
|
+
readonly description: "The VTA context the record is scoped to; the isolation boundary.";
|
|
299
|
+
};
|
|
300
|
+
readonly namespace: {
|
|
301
|
+
readonly $ref: "#/$defs/Namespace";
|
|
302
|
+
};
|
|
303
|
+
readonly key: {
|
|
304
|
+
readonly $ref: "#/$defs/Key";
|
|
305
|
+
};
|
|
306
|
+
readonly expectedVersion: {
|
|
307
|
+
readonly $ref: "#/$defs/ExpectedVersion";
|
|
308
|
+
readonly description: "Optional precondition, on the same terms as vta/app-state/put. A positive value requires the live record to be at exactly that version — so a delete cannot discard an edit the caller never saw. Zero is meaningless here (a create-only precondition on a delete can never be satisfiable and never useful) and MUST be refused.";
|
|
309
|
+
};
|
|
310
|
+
readonly ext: {
|
|
311
|
+
readonly $ref: "#/$defs/Ext";
|
|
312
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
313
|
+
};
|
|
314
|
+
};
|
|
315
|
+
readonly $defs: {
|
|
316
|
+
readonly Response: {
|
|
317
|
+
readonly $anchor: "response";
|
|
318
|
+
readonly title: "VTA Application State Delete — response payload";
|
|
319
|
+
readonly description: "Success response to vta/app-state/delete. Type https://trusttasks.org/spec/vta/app-state/delete/1.0#response. Deleting an address that holds nothing is a success, not an error — that is what makes the task converge under replay.";
|
|
320
|
+
readonly type: "object";
|
|
321
|
+
readonly additionalProperties: false;
|
|
322
|
+
readonly required: readonly ["contextId", "namespace", "key", "existed"];
|
|
323
|
+
readonly properties: {
|
|
324
|
+
readonly contextId: {
|
|
325
|
+
readonly type: "string";
|
|
326
|
+
readonly minLength: 1;
|
|
327
|
+
readonly description: "Echoed from the request.";
|
|
328
|
+
};
|
|
329
|
+
readonly namespace: {
|
|
330
|
+
readonly $ref: "#/$defs/Namespace";
|
|
331
|
+
};
|
|
332
|
+
readonly key: {
|
|
333
|
+
readonly $ref: "#/$defs/Key";
|
|
334
|
+
};
|
|
335
|
+
readonly existed: {
|
|
336
|
+
readonly type: "boolean";
|
|
337
|
+
readonly description: "True when a live record was removed by this request. False when the address already held a tombstone, or held nothing at all — both of which are successes, because the caller's intent is satisfied either way.";
|
|
338
|
+
};
|
|
339
|
+
readonly version: {
|
|
340
|
+
readonly $ref: "#/$defs/Version";
|
|
341
|
+
readonly description: "The tombstone's version — the counter value this delete took, or the value the existing tombstone already held when `existed` is false. Absent only when the address held nothing and no tombstone was written.";
|
|
342
|
+
};
|
|
343
|
+
readonly deletedAt: {
|
|
344
|
+
readonly type: "string";
|
|
345
|
+
readonly format: "date-time";
|
|
346
|
+
readonly description: "When the deletion was recorded. Absent on the same terms as `version`.";
|
|
347
|
+
};
|
|
348
|
+
readonly ext: {
|
|
349
|
+
readonly $ref: "#/$defs/Ext";
|
|
350
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
351
|
+
};
|
|
352
|
+
};
|
|
353
|
+
};
|
|
354
|
+
readonly Ext: {
|
|
355
|
+
readonly title: "Ext";
|
|
356
|
+
readonly 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.";
|
|
357
|
+
readonly type: "object";
|
|
358
|
+
readonly minProperties: 1;
|
|
359
|
+
readonly additionalProperties: true;
|
|
360
|
+
readonly propertyNames: {
|
|
361
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
362
|
+
};
|
|
363
|
+
};
|
|
364
|
+
readonly Version: {
|
|
365
|
+
readonly title: "Version";
|
|
366
|
+
readonly description: "A value of the namespace's monotonic write counter (see this schema's description). Server-assigned; a producer never chooses one.";
|
|
367
|
+
readonly type: "integer";
|
|
368
|
+
readonly minimum: 1;
|
|
369
|
+
};
|
|
370
|
+
readonly Key: {
|
|
371
|
+
readonly title: "Key";
|
|
372
|
+
readonly description: "Application-chosen identifier for a record within a namespace. Opaque to the maintainer: it MUST NOT be parsed, normalized, or case-folded, and prefix matching in `list` is a byte-prefix comparison over the UTF-8 encoding. Applications SHOULD use `/`-delimited hierarchical keys (`community/acme`, `contact/z6Mk…`) so that `prefix` can address a record family, but the delimiter is a convention between an application and itself — the maintainer attaches no meaning to it.";
|
|
373
|
+
readonly type: "string";
|
|
374
|
+
readonly minLength: 1;
|
|
375
|
+
readonly maxLength: 512;
|
|
376
|
+
readonly pattern: "^[^\\u0000]+$";
|
|
377
|
+
};
|
|
378
|
+
readonly Namespace: {
|
|
379
|
+
readonly title: "Namespace";
|
|
380
|
+
readonly description: "Scopes one application's records within a context, so several tools can share a context without colliding — `openvtc`, `cnm`, an agent runtime. The maintainer MUST NOT interpret the value; it is an opaque partition name. Namespaces are first-come and unreserved, so an application SHOULD pick a stable, specific one: a future per-namespace ACL would grant on this exact string, which makes renaming a namespace a migration rather than an edit.";
|
|
381
|
+
readonly type: "string";
|
|
382
|
+
readonly minLength: 1;
|
|
383
|
+
readonly maxLength: 64;
|
|
384
|
+
readonly pattern: "^[a-z][a-z0-9]*(-[a-z0-9]+)*$";
|
|
385
|
+
};
|
|
386
|
+
readonly ExpectedVersion: {
|
|
387
|
+
readonly title: "ExpectedVersion";
|
|
388
|
+
readonly description: "Optimistic-concurrency precondition on a write. A positive value requires that the record's current `version` equals it exactly. Zero means \"create only\" — the write applies only if no LIVE record exists at the address, which is what makes lease acquisition safe: without it two instances can each read \"absent\", each write, and each believe it won. A tombstone is not a live record, so `expectedVersion: 0` succeeds over one; the created record takes the namespace's next counter value, which is necessarily greater than the tombstone's.";
|
|
389
|
+
readonly type: "integer";
|
|
390
|
+
readonly minimum: 0;
|
|
391
|
+
};
|
|
392
|
+
};
|
|
393
|
+
};
|
|
394
|
+
};
|
|
395
|
+
/**
|
|
396
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
397
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
398
|
+
* parties (§7.3 item 5).
|
|
399
|
+
*/
|
|
400
|
+
export declare const RESPONSE_SPEC: {
|
|
401
|
+
readonly typeUri: "https://trusttasks.org/spec/vta/app-state/delete/1.0#response";
|
|
402
|
+
readonly isBearer: false;
|
|
403
|
+
readonly isProofRequired: true;
|
|
404
|
+
readonly isRecipientRequired: true;
|
|
405
|
+
readonly payloadSchema: {
|
|
406
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
407
|
+
readonly $ref: "#/$defs/Response";
|
|
408
|
+
readonly $defs: {
|
|
409
|
+
readonly Response: {
|
|
410
|
+
readonly $anchor: "response";
|
|
411
|
+
readonly title: "VTA Application State Delete — response payload";
|
|
412
|
+
readonly description: "Success response to vta/app-state/delete. Type https://trusttasks.org/spec/vta/app-state/delete/1.0#response. Deleting an address that holds nothing is a success, not an error — that is what makes the task converge under replay.";
|
|
413
|
+
readonly type: "object";
|
|
414
|
+
readonly additionalProperties: false;
|
|
415
|
+
readonly required: readonly ["contextId", "namespace", "key", "existed"];
|
|
416
|
+
readonly properties: {
|
|
417
|
+
readonly contextId: {
|
|
418
|
+
readonly type: "string";
|
|
419
|
+
readonly minLength: 1;
|
|
420
|
+
readonly description: "Echoed from the request.";
|
|
421
|
+
};
|
|
422
|
+
readonly namespace: {
|
|
423
|
+
readonly $ref: "#/$defs/Namespace";
|
|
424
|
+
};
|
|
425
|
+
readonly key: {
|
|
426
|
+
readonly $ref: "#/$defs/Key";
|
|
427
|
+
};
|
|
428
|
+
readonly existed: {
|
|
429
|
+
readonly type: "boolean";
|
|
430
|
+
readonly description: "True when a live record was removed by this request. False when the address already held a tombstone, or held nothing at all — both of which are successes, because the caller's intent is satisfied either way.";
|
|
431
|
+
};
|
|
432
|
+
readonly version: {
|
|
433
|
+
readonly $ref: "#/$defs/Version";
|
|
434
|
+
readonly description: "The tombstone's version — the counter value this delete took, or the value the existing tombstone already held when `existed` is false. Absent only when the address held nothing and no tombstone was written.";
|
|
435
|
+
};
|
|
436
|
+
readonly deletedAt: {
|
|
437
|
+
readonly type: "string";
|
|
438
|
+
readonly format: "date-time";
|
|
439
|
+
readonly description: "When the deletion was recorded. Absent on the same terms as `version`.";
|
|
440
|
+
};
|
|
441
|
+
readonly ext: {
|
|
442
|
+
readonly $ref: "#/$defs/Ext";
|
|
443
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
444
|
+
};
|
|
445
|
+
};
|
|
446
|
+
};
|
|
447
|
+
readonly Ext: {
|
|
448
|
+
readonly title: "Ext";
|
|
449
|
+
readonly 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.";
|
|
450
|
+
readonly type: "object";
|
|
451
|
+
readonly minProperties: 1;
|
|
452
|
+
readonly additionalProperties: true;
|
|
453
|
+
readonly propertyNames: {
|
|
454
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
455
|
+
};
|
|
456
|
+
};
|
|
457
|
+
readonly Version: {
|
|
458
|
+
readonly title: "Version";
|
|
459
|
+
readonly description: "A value of the namespace's monotonic write counter (see this schema's description). Server-assigned; a producer never chooses one.";
|
|
460
|
+
readonly type: "integer";
|
|
461
|
+
readonly minimum: 1;
|
|
462
|
+
};
|
|
463
|
+
readonly Key: {
|
|
464
|
+
readonly title: "Key";
|
|
465
|
+
readonly description: "Application-chosen identifier for a record within a namespace. Opaque to the maintainer: it MUST NOT be parsed, normalized, or case-folded, and prefix matching in `list` is a byte-prefix comparison over the UTF-8 encoding. Applications SHOULD use `/`-delimited hierarchical keys (`community/acme`, `contact/z6Mk…`) so that `prefix` can address a record family, but the delimiter is a convention between an application and itself — the maintainer attaches no meaning to it.";
|
|
466
|
+
readonly type: "string";
|
|
467
|
+
readonly minLength: 1;
|
|
468
|
+
readonly maxLength: 512;
|
|
469
|
+
readonly pattern: "^[^\\u0000]+$";
|
|
470
|
+
};
|
|
471
|
+
readonly Namespace: {
|
|
472
|
+
readonly title: "Namespace";
|
|
473
|
+
readonly description: "Scopes one application's records within a context, so several tools can share a context without colliding — `openvtc`, `cnm`, an agent runtime. The maintainer MUST NOT interpret the value; it is an opaque partition name. Namespaces are first-come and unreserved, so an application SHOULD pick a stable, specific one: a future per-namespace ACL would grant on this exact string, which makes renaming a namespace a migration rather than an edit.";
|
|
474
|
+
readonly type: "string";
|
|
475
|
+
readonly minLength: 1;
|
|
476
|
+
readonly maxLength: 64;
|
|
477
|
+
readonly pattern: "^[a-z][a-z0-9]*(-[a-z0-9]+)*$";
|
|
478
|
+
};
|
|
479
|
+
readonly ExpectedVersion: {
|
|
480
|
+
readonly title: "ExpectedVersion";
|
|
481
|
+
readonly description: "Optimistic-concurrency precondition on a write. A positive value requires that the record's current `version` equals it exactly. Zero means \"create only\" — the write applies only if no LIVE record exists at the address, which is what makes lease acquisition safe: without it two instances can each read \"absent\", each write, and each believe it won. A tombstone is not a live record, so `expectedVersion: 0` succeeds over one; the created record takes the namespace's next counter value, which is necessarily greater than the tombstone's.";
|
|
482
|
+
readonly type: "integer";
|
|
483
|
+
readonly minimum: 0;
|
|
484
|
+
};
|
|
485
|
+
};
|
|
486
|
+
};
|
|
487
|
+
};
|
|
488
|
+
//# sourceMappingURL=payload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../../../src/vta/app-state/delete/1.0/payload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAC/B;;GAEG;AACH,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC;AACzB;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC;AACrC;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAE7B;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAC/C;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,SAAS,CAAC;IACrB,GAAG,EAAE,GAAG,CAAC;IACT,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,GAAG,CAAC,EAAE,GAAG,CAAC;CACX;AACD;;GAEG;AACH,MAAM,WAAW,GAAG;IAClB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CAClC;AACD;;GAEG;AACH,MAAM,WAAW,wCAAwC;IACvD;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,SAAS,CAAC;IACrB,GAAG,EAAE,GAAG,CAAC;IACT;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,IAAI,CAAC;CACZ;AACD;;GAEG;AACH,MAAM,WAAW,IAAI;IACnB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CAClC;AAED,2BAA2B;AAC3B,eAAO,MAAM,QAAQ,EAAG,sDAA+D,CAAC;AAExF,mEAAmE;AACnE,MAAM,MAAM,OAAO,GAAG,gCAAgC,CAAC;AAEvD,qEAAqE;AACrE,eAAO,MAAM,iBAAiB,EAAG,+DAAwE,CAAC;AAE1G,4EAA4E;AAC5E,MAAM,MAAM,QAAQ,GAAG,wCAAwC,CAAC;AAEhE;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoHjB,CAAC;AAEX,mEAAmE;AACnE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsF1B,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMP,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMhB,CAAC"}
|