@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 @@
|
|
|
1
|
+
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../../../src/vta/app-state/put-many/1.0/payload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAC/B;;GAEG;AACH,MAAM,MAAM,KAAK,GACb;IACE,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CAClC,GACD;IACE,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CAClC,CAAC;AACN;;GAEG;AACH,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC;AACzB;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAC7B;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAC9B;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAChD;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,SAAS,CAAC;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,aAAa,GAAG,QAAQ,CAAC;IAChC;;;;;OAKG;IACH,MAAM,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;IAC5B,GAAG,CAAC,EAAE,GAAG,CAAC;CACX;AAC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5
|
+
/** Trust Task type URI. */
|
|
6
|
+
export const TYPE_URI = "https://trusttasks.org/spec/vta/app-state/put-many/1.0";
|
|
7
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
8
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/app-state/put-many/1.0#response";
|
|
9
|
+
/**
|
|
10
|
+
* This specification's payload schema, as a value.
|
|
11
|
+
*
|
|
12
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
13
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
14
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
15
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
16
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
17
|
+
*/
|
|
18
|
+
export const PAYLOAD_SCHEMA = {
|
|
19
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
20
|
+
"$id": "https://trusttasks.org/spec/vta/app-state/put-many/1.0",
|
|
21
|
+
"title": "VTA Application State Put-Many — payload",
|
|
22
|
+
"description": "Write up to 64 application-state records in one round trip, each carrying its own optimistic-concurrency precondition. The batch `mode` decides what a single failure costs: `independent` (the default) applies each write on its own merits, `atomic` applies all or none.",
|
|
23
|
+
"type": "object",
|
|
24
|
+
"additionalProperties": false,
|
|
25
|
+
"required": [
|
|
26
|
+
"contextId",
|
|
27
|
+
"namespace",
|
|
28
|
+
"writes"
|
|
29
|
+
],
|
|
30
|
+
"properties": {
|
|
31
|
+
"contextId": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"minLength": 1,
|
|
34
|
+
"description": "The VTA context the records are scoped to; the isolation boundary."
|
|
35
|
+
},
|
|
36
|
+
"namespace": {
|
|
37
|
+
"$ref": "#/$defs/Namespace",
|
|
38
|
+
"description": "One namespace per batch. Atomicity is only meaningful within the counter the writes take their versions from, and that counter is per (contextId, namespace)."
|
|
39
|
+
},
|
|
40
|
+
"mode": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"enum": [
|
|
43
|
+
"independent",
|
|
44
|
+
"atomic"
|
|
45
|
+
],
|
|
46
|
+
"default": "independent",
|
|
47
|
+
"description": "`independent` applies each write on its own merits, so one conflicted record does not block the other nine — what a flush of unrelated edits wants, and why it is the default. `atomic` applies all or none, for records carrying a joint invariant. An atomic DEFAULT would let one stale record silently wedge an entire flush, and a caller could not tell a wedged flush from a slow one.",
|
|
48
|
+
"$comment": "The default is load-bearing rather than a convenience; see the spec's Abstract."
|
|
49
|
+
},
|
|
50
|
+
"writes": {
|
|
51
|
+
"type": "array",
|
|
52
|
+
"minItems": 1,
|
|
53
|
+
"maxItems": 64,
|
|
54
|
+
"items": {
|
|
55
|
+
"$ref": "#/$defs/Write"
|
|
56
|
+
},
|
|
57
|
+
"description": "The writes to apply. Keys MUST be distinct: two writes to one key in a batch have no defined order and are refused rather than serialised."
|
|
58
|
+
},
|
|
59
|
+
"ext": {
|
|
60
|
+
"$ref": "#/$defs/Ext",
|
|
61
|
+
"description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"$defs": {
|
|
65
|
+
"Write": {
|
|
66
|
+
"title": "Write",
|
|
67
|
+
"description": "One write within the batch. Shaped exactly like a vta/app-state/put payload minus the context and namespace, which the batch supplies.",
|
|
68
|
+
"type": "object",
|
|
69
|
+
"additionalProperties": false,
|
|
70
|
+
"required": [
|
|
71
|
+
"key"
|
|
72
|
+
],
|
|
73
|
+
"oneOf": [
|
|
74
|
+
{
|
|
75
|
+
"required": [
|
|
76
|
+
"value"
|
|
77
|
+
],
|
|
78
|
+
"not": {
|
|
79
|
+
"required": [
|
|
80
|
+
"mergePatch"
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"required": [
|
|
86
|
+
"mergePatch"
|
|
87
|
+
],
|
|
88
|
+
"not": {
|
|
89
|
+
"required": [
|
|
90
|
+
"value"
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
"properties": {
|
|
96
|
+
"key": {
|
|
97
|
+
"$ref": "#/$defs/Key"
|
|
98
|
+
},
|
|
99
|
+
"value": {
|
|
100
|
+
"description": "The complete new value, replacing whatever the record held. Any JSON value, including `null`. Mutually exclusive with `mergePatch`."
|
|
101
|
+
},
|
|
102
|
+
"mergePatch": {
|
|
103
|
+
"type": "object",
|
|
104
|
+
"description": "An RFC 7386 JSON Merge Patch applied to the record's current value. Requires a live record at the address; otherwise this write's outcome is `notFound`. Mutually exclusive with `value`."
|
|
105
|
+
},
|
|
106
|
+
"expectedVersion": {
|
|
107
|
+
"$ref": "#/$defs/ExpectedVersion",
|
|
108
|
+
"description": "This write's own precondition, evaluated independently of every other write in the batch. A positive value requires the record to be at exactly that version; 0 requires that no live record exists."
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"Response": {
|
|
113
|
+
"$anchor": "response",
|
|
114
|
+
"title": "VTA Application State Put-Many — response payload",
|
|
115
|
+
"description": "Success response to vta/app-state/put-many in `independent` mode. Type https://trusttasks.org/spec/vta/app-state/put-many/1.0#response. A response is returned even when some writes conflicted, because the task did what it promised — applied each write on its own merits — and the per-record outcomes are the answer rather than the failure. An `atomic` batch that does not apply is a trust-task-error carrying vta/app-state/put-many:atomicBatchRejected, whose details carry the same per-record outcomes.",
|
|
116
|
+
"type": "object",
|
|
117
|
+
"additionalProperties": false,
|
|
118
|
+
"required": [
|
|
119
|
+
"mode",
|
|
120
|
+
"results"
|
|
121
|
+
],
|
|
122
|
+
"properties": {
|
|
123
|
+
"mode": {
|
|
124
|
+
"type": "string",
|
|
125
|
+
"enum": [
|
|
126
|
+
"independent",
|
|
127
|
+
"atomic"
|
|
128
|
+
],
|
|
129
|
+
"description": "The mode the maintainer applied, echoed so a caller relying on the default sees what it got."
|
|
130
|
+
},
|
|
131
|
+
"results": {
|
|
132
|
+
"type": "array",
|
|
133
|
+
"minItems": 1,
|
|
134
|
+
"maxItems": 64,
|
|
135
|
+
"items": {
|
|
136
|
+
"$ref": "#/$defs/WriteResult"
|
|
137
|
+
},
|
|
138
|
+
"description": "One result per requested write, in request order. Every write is accounted for."
|
|
139
|
+
},
|
|
140
|
+
"highWatermark": {
|
|
141
|
+
"$ref": "#/$defs/Version",
|
|
142
|
+
"description": "The namespace's counter value after the batch. A writer that is also a sync consumer can adopt this instead of issuing a list call to discover where its own writes landed."
|
|
143
|
+
},
|
|
144
|
+
"ext": {
|
|
145
|
+
"$ref": "#/$defs/Ext",
|
|
146
|
+
"description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"Ext": {
|
|
151
|
+
"title": "Ext",
|
|
152
|
+
"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.",
|
|
153
|
+
"type": "object",
|
|
154
|
+
"minProperties": 1,
|
|
155
|
+
"additionalProperties": true,
|
|
156
|
+
"propertyNames": {
|
|
157
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"Version": {
|
|
161
|
+
"title": "Version",
|
|
162
|
+
"description": "A value of the namespace's monotonic write counter (see this schema's description). Server-assigned; a producer never chooses one.",
|
|
163
|
+
"type": "integer",
|
|
164
|
+
"minimum": 1
|
|
165
|
+
},
|
|
166
|
+
"WriteResult": {
|
|
167
|
+
"title": "WriteResult",
|
|
168
|
+
"description": "The outcome of one write within a `vta/app-state/put-many` batch. Per-record rather than per-batch, because the default batch mode applies each write on its own merits: a caller flushing ten unrelated edits needs to know which one conflicted, not merely that something did.",
|
|
169
|
+
"type": "object",
|
|
170
|
+
"additionalProperties": false,
|
|
171
|
+
"required": [
|
|
172
|
+
"key",
|
|
173
|
+
"outcome"
|
|
174
|
+
],
|
|
175
|
+
"properties": {
|
|
176
|
+
"key": {
|
|
177
|
+
"$ref": "#/$defs/Key"
|
|
178
|
+
},
|
|
179
|
+
"outcome": {
|
|
180
|
+
"type": "string",
|
|
181
|
+
"enum": [
|
|
182
|
+
"written",
|
|
183
|
+
"conflict",
|
|
184
|
+
"tooLarge",
|
|
185
|
+
"notFound",
|
|
186
|
+
"skipped"
|
|
187
|
+
],
|
|
188
|
+
"description": "`written`: applied, and `version` carries the new value. `conflict`: `expectedVersion` did not match; `currentVersion`, `currentValue` and `currentDeleted` carry the maintainer's view so the caller can resolve without a re-read. `tooLarge`: the value exceeded the per-record cap; `limitBytes` and `actualBytes` say by how much. `notFound`: a `mergePatch` write named an address with no live record. `skipped`: atomic mode only — this write was not attempted because another in the batch failed."
|
|
189
|
+
},
|
|
190
|
+
"version": {
|
|
191
|
+
"$ref": "#/$defs/Version",
|
|
192
|
+
"description": "The new version, on `written`."
|
|
193
|
+
},
|
|
194
|
+
"created": {
|
|
195
|
+
"type": "boolean",
|
|
196
|
+
"description": "On `written`: true when no live record existed at the address beforehand."
|
|
197
|
+
},
|
|
198
|
+
"currentVersion": {
|
|
199
|
+
"$ref": "#/$defs/Version",
|
|
200
|
+
"description": "On `conflict`: the version the maintainer actually holds. Absent when the conflict is that no record exists (`expectedVersion` was positive and the address is empty)."
|
|
201
|
+
},
|
|
202
|
+
"currentValue": {
|
|
203
|
+
"description": "On `conflict`: the value the maintainer actually holds, returned WITH the rejection rather than left for the caller to re-read. A bare rejection has no fixed point under contention — between the rejection and the re-read the record can change again — so returning the winner's view removes the race rather than narrowing it. Absent when `currentDeleted` is true or no record exists."
|
|
204
|
+
},
|
|
205
|
+
"currentDeleted": {
|
|
206
|
+
"type": "boolean",
|
|
207
|
+
"description": "On `conflict`: true when the address holds a tombstone rather than a live record."
|
|
208
|
+
},
|
|
209
|
+
"limitBytes": {
|
|
210
|
+
"type": "integer",
|
|
211
|
+
"minimum": 0,
|
|
212
|
+
"description": "On `tooLarge`: the maintainer's per-record cap in bytes."
|
|
213
|
+
},
|
|
214
|
+
"actualBytes": {
|
|
215
|
+
"type": "integer",
|
|
216
|
+
"minimum": 0,
|
|
217
|
+
"description": "On `tooLarge`: the size of the rejected value in bytes."
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
"Key": {
|
|
222
|
+
"title": "Key",
|
|
223
|
+
"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.",
|
|
224
|
+
"type": "string",
|
|
225
|
+
"minLength": 1,
|
|
226
|
+
"maxLength": 512,
|
|
227
|
+
"pattern": "^[^\\u0000]+$"
|
|
228
|
+
},
|
|
229
|
+
"ExpectedVersion": {
|
|
230
|
+
"title": "ExpectedVersion",
|
|
231
|
+
"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.",
|
|
232
|
+
"type": "integer",
|
|
233
|
+
"minimum": 0
|
|
234
|
+
},
|
|
235
|
+
"Namespace": {
|
|
236
|
+
"title": "Namespace",
|
|
237
|
+
"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.",
|
|
238
|
+
"type": "string",
|
|
239
|
+
"minLength": 1,
|
|
240
|
+
"maxLength": 64,
|
|
241
|
+
"pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
246
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
247
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
248
|
+
"$ref": "#/$defs/Response",
|
|
249
|
+
"$defs": {
|
|
250
|
+
"Write": {
|
|
251
|
+
"title": "Write",
|
|
252
|
+
"description": "One write within the batch. Shaped exactly like a vta/app-state/put payload minus the context and namespace, which the batch supplies.",
|
|
253
|
+
"type": "object",
|
|
254
|
+
"additionalProperties": false,
|
|
255
|
+
"required": [
|
|
256
|
+
"key"
|
|
257
|
+
],
|
|
258
|
+
"oneOf": [
|
|
259
|
+
{
|
|
260
|
+
"required": [
|
|
261
|
+
"value"
|
|
262
|
+
],
|
|
263
|
+
"not": {
|
|
264
|
+
"required": [
|
|
265
|
+
"mergePatch"
|
|
266
|
+
]
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
"required": [
|
|
271
|
+
"mergePatch"
|
|
272
|
+
],
|
|
273
|
+
"not": {
|
|
274
|
+
"required": [
|
|
275
|
+
"value"
|
|
276
|
+
]
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
],
|
|
280
|
+
"properties": {
|
|
281
|
+
"key": {
|
|
282
|
+
"$ref": "#/$defs/Key"
|
|
283
|
+
},
|
|
284
|
+
"value": {
|
|
285
|
+
"description": "The complete new value, replacing whatever the record held. Any JSON value, including `null`. Mutually exclusive with `mergePatch`."
|
|
286
|
+
},
|
|
287
|
+
"mergePatch": {
|
|
288
|
+
"type": "object",
|
|
289
|
+
"description": "An RFC 7386 JSON Merge Patch applied to the record's current value. Requires a live record at the address; otherwise this write's outcome is `notFound`. Mutually exclusive with `value`."
|
|
290
|
+
},
|
|
291
|
+
"expectedVersion": {
|
|
292
|
+
"$ref": "#/$defs/ExpectedVersion",
|
|
293
|
+
"description": "This write's own precondition, evaluated independently of every other write in the batch. A positive value requires the record to be at exactly that version; 0 requires that no live record exists."
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
"Response": {
|
|
298
|
+
"$anchor": "response",
|
|
299
|
+
"title": "VTA Application State Put-Many — response payload",
|
|
300
|
+
"description": "Success response to vta/app-state/put-many in `independent` mode. Type https://trusttasks.org/spec/vta/app-state/put-many/1.0#response. A response is returned even when some writes conflicted, because the task did what it promised — applied each write on its own merits — and the per-record outcomes are the answer rather than the failure. An `atomic` batch that does not apply is a trust-task-error carrying vta/app-state/put-many:atomicBatchRejected, whose details carry the same per-record outcomes.",
|
|
301
|
+
"type": "object",
|
|
302
|
+
"additionalProperties": false,
|
|
303
|
+
"required": [
|
|
304
|
+
"mode",
|
|
305
|
+
"results"
|
|
306
|
+
],
|
|
307
|
+
"properties": {
|
|
308
|
+
"mode": {
|
|
309
|
+
"type": "string",
|
|
310
|
+
"enum": [
|
|
311
|
+
"independent",
|
|
312
|
+
"atomic"
|
|
313
|
+
],
|
|
314
|
+
"description": "The mode the maintainer applied, echoed so a caller relying on the default sees what it got."
|
|
315
|
+
},
|
|
316
|
+
"results": {
|
|
317
|
+
"type": "array",
|
|
318
|
+
"minItems": 1,
|
|
319
|
+
"maxItems": 64,
|
|
320
|
+
"items": {
|
|
321
|
+
"$ref": "#/$defs/WriteResult"
|
|
322
|
+
},
|
|
323
|
+
"description": "One result per requested write, in request order. Every write is accounted for."
|
|
324
|
+
},
|
|
325
|
+
"highWatermark": {
|
|
326
|
+
"$ref": "#/$defs/Version",
|
|
327
|
+
"description": "The namespace's counter value after the batch. A writer that is also a sync consumer can adopt this instead of issuing a list call to discover where its own writes landed."
|
|
328
|
+
},
|
|
329
|
+
"ext": {
|
|
330
|
+
"$ref": "#/$defs/Ext",
|
|
331
|
+
"description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
"Ext": {
|
|
336
|
+
"title": "Ext",
|
|
337
|
+
"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.",
|
|
338
|
+
"type": "object",
|
|
339
|
+
"minProperties": 1,
|
|
340
|
+
"additionalProperties": true,
|
|
341
|
+
"propertyNames": {
|
|
342
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
"Version": {
|
|
346
|
+
"title": "Version",
|
|
347
|
+
"description": "A value of the namespace's monotonic write counter (see this schema's description). Server-assigned; a producer never chooses one.",
|
|
348
|
+
"type": "integer",
|
|
349
|
+
"minimum": 1
|
|
350
|
+
},
|
|
351
|
+
"WriteResult": {
|
|
352
|
+
"title": "WriteResult",
|
|
353
|
+
"description": "The outcome of one write within a `vta/app-state/put-many` batch. Per-record rather than per-batch, because the default batch mode applies each write on its own merits: a caller flushing ten unrelated edits needs to know which one conflicted, not merely that something did.",
|
|
354
|
+
"type": "object",
|
|
355
|
+
"additionalProperties": false,
|
|
356
|
+
"required": [
|
|
357
|
+
"key",
|
|
358
|
+
"outcome"
|
|
359
|
+
],
|
|
360
|
+
"properties": {
|
|
361
|
+
"key": {
|
|
362
|
+
"$ref": "#/$defs/Key"
|
|
363
|
+
},
|
|
364
|
+
"outcome": {
|
|
365
|
+
"type": "string",
|
|
366
|
+
"enum": [
|
|
367
|
+
"written",
|
|
368
|
+
"conflict",
|
|
369
|
+
"tooLarge",
|
|
370
|
+
"notFound",
|
|
371
|
+
"skipped"
|
|
372
|
+
],
|
|
373
|
+
"description": "`written`: applied, and `version` carries the new value. `conflict`: `expectedVersion` did not match; `currentVersion`, `currentValue` and `currentDeleted` carry the maintainer's view so the caller can resolve without a re-read. `tooLarge`: the value exceeded the per-record cap; `limitBytes` and `actualBytes` say by how much. `notFound`: a `mergePatch` write named an address with no live record. `skipped`: atomic mode only — this write was not attempted because another in the batch failed."
|
|
374
|
+
},
|
|
375
|
+
"version": {
|
|
376
|
+
"$ref": "#/$defs/Version",
|
|
377
|
+
"description": "The new version, on `written`."
|
|
378
|
+
},
|
|
379
|
+
"created": {
|
|
380
|
+
"type": "boolean",
|
|
381
|
+
"description": "On `written`: true when no live record existed at the address beforehand."
|
|
382
|
+
},
|
|
383
|
+
"currentVersion": {
|
|
384
|
+
"$ref": "#/$defs/Version",
|
|
385
|
+
"description": "On `conflict`: the version the maintainer actually holds. Absent when the conflict is that no record exists (`expectedVersion` was positive and the address is empty)."
|
|
386
|
+
},
|
|
387
|
+
"currentValue": {
|
|
388
|
+
"description": "On `conflict`: the value the maintainer actually holds, returned WITH the rejection rather than left for the caller to re-read. A bare rejection has no fixed point under contention — between the rejection and the re-read the record can change again — so returning the winner's view removes the race rather than narrowing it. Absent when `currentDeleted` is true or no record exists."
|
|
389
|
+
},
|
|
390
|
+
"currentDeleted": {
|
|
391
|
+
"type": "boolean",
|
|
392
|
+
"description": "On `conflict`: true when the address holds a tombstone rather than a live record."
|
|
393
|
+
},
|
|
394
|
+
"limitBytes": {
|
|
395
|
+
"type": "integer",
|
|
396
|
+
"minimum": 0,
|
|
397
|
+
"description": "On `tooLarge`: the maintainer's per-record cap in bytes."
|
|
398
|
+
},
|
|
399
|
+
"actualBytes": {
|
|
400
|
+
"type": "integer",
|
|
401
|
+
"minimum": 0,
|
|
402
|
+
"description": "On `tooLarge`: the size of the rejected value in bytes."
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
},
|
|
406
|
+
"Key": {
|
|
407
|
+
"title": "Key",
|
|
408
|
+
"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.",
|
|
409
|
+
"type": "string",
|
|
410
|
+
"minLength": 1,
|
|
411
|
+
"maxLength": 512,
|
|
412
|
+
"pattern": "^[^\\u0000]+$"
|
|
413
|
+
},
|
|
414
|
+
"ExpectedVersion": {
|
|
415
|
+
"title": "ExpectedVersion",
|
|
416
|
+
"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.",
|
|
417
|
+
"type": "integer",
|
|
418
|
+
"minimum": 0
|
|
419
|
+
},
|
|
420
|
+
"Namespace": {
|
|
421
|
+
"title": "Namespace",
|
|
422
|
+
"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.",
|
|
423
|
+
"type": "string",
|
|
424
|
+
"minLength": 1,
|
|
425
|
+
"maxLength": 64,
|
|
426
|
+
"pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
};
|
|
430
|
+
/**
|
|
431
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
432
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
433
|
+
* per-specification and cannot be derived from the document alone, and
|
|
434
|
+
* item 2 needs the schema this carries.
|
|
435
|
+
*/
|
|
436
|
+
export const SPEC = {
|
|
437
|
+
typeUri: TYPE_URI,
|
|
438
|
+
isBearer: false,
|
|
439
|
+
isProofRequired: true,
|
|
440
|
+
isRecipientRequired: true,
|
|
441
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
442
|
+
};
|
|
443
|
+
/**
|
|
444
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
445
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
446
|
+
* parties (§7.3 item 5).
|
|
447
|
+
*/
|
|
448
|
+
export const RESPONSE_SPEC = {
|
|
449
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
450
|
+
isBearer: false,
|
|
451
|
+
isProofRequired: true,
|
|
452
|
+
isRecipientRequired: true,
|
|
453
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
454
|
+
};
|
|
455
|
+
//# sourceMappingURL=payload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload.js","sourceRoot":"","sources":["../../../../../src/vta/app-state/put-many/1.0/payload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAwHH,2BAA2B;AAC3B,MAAM,CAAC,MAAM,QAAQ,GAAG,wDAAiE,CAAC;AAK1F,qEAAqE;AACrE,MAAM,CAAC,MAAM,iBAAiB,GAAG,iEAA0E,CAAC;AAK5G;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,SAAS,EAAE,8CAA8C;IACzD,KAAK,EAAE,wDAAwD;IAC/D,OAAO,EAAE,0CAA0C;IACnD,aAAa,EAAE,8QAA8Q;IAC7R,MAAM,EAAE,QAAQ;IAChB,sBAAsB,EAAE,KAAK;IAC7B,UAAU,EAAE;QACV,WAAW;QACX,WAAW;QACX,QAAQ;KACT;IACD,YAAY,EAAE;QACZ,WAAW,EAAE;YACX,MAAM,EAAE,QAAQ;YAChB,WAAW,EAAE,CAAC;YACd,aAAa,EAAE,oEAAoE;SACpF;QACD,WAAW,EAAE;YACX,MAAM,EAAE,mBAAmB;YAC3B,aAAa,EAAE,+JAA+J;SAC/K;QACD,MAAM,EAAE;YACN,MAAM,EAAE,QAAQ;YAChB,MAAM,EAAE;gBACN,aAAa;gBACb,QAAQ;aACT;YACD,SAAS,EAAE,aAA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AAE,0DAA0D;iBAC1E;gBACD,aAAa,EAAE;oBACb,MAAM,EAAE,SAAS;oBACjB,SAAS,EAAE,CAAC;oBACZ,aAAa,EAAE,yDAAyD;iBACzE;aACF;SACF;QACD,KAAK,EAAE;YACL,OAAO,EAAE,KAAK;YACd,aAAa,EAAE,0dAA0d;YACze,MAAM,EAAE,QAAQ;YAChB,WAAW,EAAE,CAAC;YACd,WAAW,EAAE,GAAG;YAChB,SAAS,EAAE,eAAe;SAC3B;QACD,iBAAiB,EAAE;YACjB,OAAO,EAAE,iBAAiB;YAC1B,aAAa,EAAE,giBAAgiB;YAC/iB,MAAM,EAAE,SAAS;YACjB,SAAS,EAAE,CAAC;SACb;QACD,WAAW,EAAE;YACX,OAAO,EAAE,WAAW;YACpB,aAAa,EAAE,6bAA6b;YAC5c,MAAM,EAAE,QAAQ;YAChB,WAAW,EAAE,CAAC;YACd,WAAW,EAAE,EAAE;YACf,SAAS,EAAE,+BAA+B;SAC3C;KACF;CACO,CAAC;AAEX;;;;;GAKG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,OAAO,EAAE,QAAQ;IACjB,QAAQ,EAAE,KAAK;IACf,eAAe,EAAE,IAAI;IACrB,mBAAmB,EAAE,IAAI;IACzB,aAAa,EAAE,cAAc;CACrB,CAAC;AAEX;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,OAAO,EAAE,iBAAiB;IAC1B,QAAQ,EAAE,KAAK;IACf,eAAe,EAAE,IAAI;IACrB,mBAAmB,EAAE,IAAI;IACzB,aAAa,EAAE,uBAAuB;CAC9B,CAAC"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -251,11 +251,18 @@ export * as VaultUsage_v0_1 from "./vault/usage/0.1/payload.js";
|
|
|
251
251
|
export * as VaultUsage_v0_2 from "./vault/usage/0.2/payload.js";
|
|
252
252
|
export * as VrcRelationshipsIssue_v0_1 from "./vrc/relationships/issue/0.1/payload.js";
|
|
253
253
|
export * as VrcRelationshipsPropose_v0_1 from "./vrc/relationships/propose/0.1/payload.js";
|
|
254
|
+
export * as AppStateRecordShared_v0_1 from "./vta/_shared/0.1/app-state-record.js";
|
|
254
255
|
export * as ContextShared_v0_1 from "./vta/_shared/0.1/context.js";
|
|
255
256
|
export * as DidTemplateShared_v0_1 from "./vta/_shared/0.1/did-template.js";
|
|
256
257
|
export * as PasskeyVmShared_v0_1 from "./vta/_shared/0.1/passkey-vm.js";
|
|
257
258
|
export * as ServiceShared_v0_1 from "./vta/_shared/0.1/service.js";
|
|
258
259
|
export * as WebvhRecordsShared_v0_1 from "./vta/_shared/0.1/webvh-records.js";
|
|
260
|
+
export * as VtaAppStateDelete_v1_0 from "./vta/app-state/delete/1.0/payload.js";
|
|
261
|
+
export * as VtaAppStateGetMany_v1_0 from "./vta/app-state/get-many/1.0/payload.js";
|
|
262
|
+
export * as VtaAppStateGet_v1_0 from "./vta/app-state/get/1.0/payload.js";
|
|
263
|
+
export * as VtaAppStateList_v1_0 from "./vta/app-state/list/1.0/payload.js";
|
|
264
|
+
export * as VtaAppStatePutMany_v1_0 from "./vta/app-state/put-many/1.0/payload.js";
|
|
265
|
+
export * as VtaAppStatePut_v1_0 from "./vta/app-state/put/1.0/payload.js";
|
|
259
266
|
export * as VtaContextsCreate_v1_0 from "./vta/contexts/create/1.0/payload.js";
|
|
260
267
|
export * as VtaContextsDelete_v1_0 from "./vta/contexts/delete/1.0/payload.js";
|
|
261
268
|
export * as VtaContextsDidTemplatesCreate_v1_0 from "./vta/contexts/did-templates/create/1.0/payload.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vta/_shared/0.1/app-state-record.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Application state is versioned, namespaced JSON that an application owns and the VTA stores without interpreting. A record is addressed by the triple `(contextId, namespace, key)`; `AppStateRecord` is the shape every task in the family hands back, defined once here because `get`, `list`, `get-many` and the conflict details of `put` and `put-many` all return the same record and an inline copy per task would fork the moment one of them gained a member.
|
|
8
|
+
*
|
|
9
|
+
* The store is deliberately schema-agnostic: `value` is any JSON, and the maintainer never validates, migrates, or interprets it. It is also deliberately NOT a secret store — the vault (`vault/*`) is where secret material belongs, and a maintainer SHOULD surface application state in operator tooling on that understanding.
|
|
10
|
+
*
|
|
11
|
+
* The version counter is the family's load-bearing invariant and is described once, here. `version` is a monotonically increasing integer maintained per `(contextId, namespace)` pair, NOT per record: every write in a namespace takes the next value of that namespace's counter, and a record's `version` is the counter value its most recent write took. One number therefore serves two purposes that would otherwise need two — it is the optimistic-concurrency token `expectedVersion` is compared against, and it is the watermark `sinceVersion` is compared against. A per-record counter could do the first but not the second, because two records' counters are not comparable to each other and so no single number can mean "everything changed after this point". Consumers MUST treat version numbers as opaque and monotonic: a record's version can jump by any amount between two writes, because writes to its neighbours consumed the intervening values.
|
|
12
|
+
*
|
|
13
|
+
* Timestamp invariants (SHOULD-level, prose — not expressible in JSON Schema): when `createdAt` is present, `updatedAt >= createdAt`; when `deletedAt` is present, `deleted` is true and `deletedAt >= createdAt`. Consumers SHOULD reject documents that violate either.
|
|
14
|
+
*/
|
|
15
|
+
export interface AppStateRecordSharedDefinitionForTheVtaAppStateSpecFamily {
|
|
16
|
+
[k: string]: unknown | undefined;
|
|
17
|
+
}
|