@openvtc/trust-tasks 0.12.1 → 0.12.3
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,382 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vta/app-state/put/1.0/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Write one application-state record at its `(contextId, namespace, key)` address. Exactly one of `value` (whole-record replacement) or `mergePatch` (RFC 7386 partial update) is supplied. `expectedVersion` makes the write conditional: a positive value requires the record to be at exactly that version, and zero requires that no live record exists.
|
|
8
|
+
*/
|
|
9
|
+
export type VTAApplicationStatePutPayload = {
|
|
10
|
+
/**
|
|
11
|
+
* The VTA context the record is scoped to; the isolation boundary.
|
|
12
|
+
*/
|
|
13
|
+
contextId: string;
|
|
14
|
+
namespace: Namespace;
|
|
15
|
+
key: Key;
|
|
16
|
+
/**
|
|
17
|
+
* The complete new value, replacing whatever the record held. Any JSON value, including `null` — a present-and-null `value` stores the JSON literal null and is not the same as omitting the member. Mutually exclusive with `mergePatch`.
|
|
18
|
+
*/
|
|
19
|
+
value?: {
|
|
20
|
+
[k: string]: unknown | undefined;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* An RFC 7386 JSON Merge Patch applied to the record's current value. Cuts payload, and more usefully cuts conflicts: two instances editing different members of one record stop colliding entirely rather than serialising behind `expectedVersion`. Requires a live record at the address. Note RFC 7386's one sharp edge — a member set to `null` in the patch DELETES that member from the value, and there is no way to set a member to the JSON literal null through a patch; a writer that needs to do so must send a whole `value`. Mutually exclusive with `value`.
|
|
24
|
+
*/
|
|
25
|
+
mergePatch?: {};
|
|
26
|
+
expectedVersion?: ExpectedVersion;
|
|
27
|
+
ext?: Ext;
|
|
28
|
+
} & {
|
|
29
|
+
[k: string]: unknown | undefined;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* 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.
|
|
33
|
+
*/
|
|
34
|
+
export type Namespace = string;
|
|
35
|
+
/**
|
|
36
|
+
* 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.
|
|
37
|
+
*/
|
|
38
|
+
export type Key = string;
|
|
39
|
+
/**
|
|
40
|
+
* Optional precondition. Omit for a last-writer-wins upsert. Supply the version a prior read returned to make the write conditional; supply 0 to create only.
|
|
41
|
+
*/
|
|
42
|
+
export type ExpectedVersion = number;
|
|
43
|
+
/**
|
|
44
|
+
* The version this write took. Supply it as `expectedVersion` on the next write to chain conditional updates without an intervening read.
|
|
45
|
+
*/
|
|
46
|
+
export type Version = number;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Ecosystem-defined extension members per SPEC.md §4.5.1.
|
|
50
|
+
*/
|
|
51
|
+
export interface Ext {
|
|
52
|
+
[k: string]: unknown | undefined;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Success response to vta/app-state/put. Type https://trusttasks.org/spec/vta/app-state/put/1.0#response. A failed precondition is not a success: it is a trust-task-error carrying vta/app-state/put:versionConflict, whose details carry the maintainer's current version and value.
|
|
56
|
+
*/
|
|
57
|
+
export interface VTAApplicationStatePutResponsePayload {
|
|
58
|
+
/**
|
|
59
|
+
* Echoed from the request.
|
|
60
|
+
*/
|
|
61
|
+
contextId: string;
|
|
62
|
+
namespace: Namespace;
|
|
63
|
+
key: Key;
|
|
64
|
+
version: Version;
|
|
65
|
+
/**
|
|
66
|
+
* True when no live record existed at the address beforehand — including when the address held a tombstone, since a tombstone is not a live record.
|
|
67
|
+
*/
|
|
68
|
+
created: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* When the write was applied.
|
|
71
|
+
*/
|
|
72
|
+
updatedAt: string;
|
|
73
|
+
/**
|
|
74
|
+
* Size of the stored value in bytes as the maintainer measured it against its per-record cap. Lets a writer see how close it is to the limit before it hits it.
|
|
75
|
+
*/
|
|
76
|
+
valueBytes?: number;
|
|
77
|
+
ext?: Ext1;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Ecosystem-defined extension members per SPEC.md §4.5.1.
|
|
81
|
+
*/
|
|
82
|
+
export interface Ext1 {
|
|
83
|
+
[k: string]: unknown | undefined;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** Trust Task type URI. */
|
|
87
|
+
export const TYPE_URI = "https://trusttasks.org/spec/vta/app-state/put/1.0" as const;
|
|
88
|
+
|
|
89
|
+
/** Stable alias for this specification's request payload shape. */
|
|
90
|
+
export type Payload = VTAApplicationStatePutPayload;
|
|
91
|
+
|
|
92
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
93
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/app-state/put/1.0#response" as const;
|
|
94
|
+
|
|
95
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
96
|
+
export type Response = VTAApplicationStatePutResponsePayload;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* This specification's payload schema, as a value.
|
|
100
|
+
*
|
|
101
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
102
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
103
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
104
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
105
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
106
|
+
*/
|
|
107
|
+
export const PAYLOAD_SCHEMA = {
|
|
108
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
109
|
+
"$id": "https://trusttasks.org/spec/vta/app-state/put/1.0",
|
|
110
|
+
"title": "VTA Application State Put — payload",
|
|
111
|
+
"description": "Write one application-state record at its `(contextId, namespace, key)` address. Exactly one of `value` (whole-record replacement) or `mergePatch` (RFC 7386 partial update) is supplied. `expectedVersion` makes the write conditional: a positive value requires the record to be at exactly that version, and zero requires that no live record exists.",
|
|
112
|
+
"type": "object",
|
|
113
|
+
"additionalProperties": false,
|
|
114
|
+
"required": [
|
|
115
|
+
"contextId",
|
|
116
|
+
"namespace",
|
|
117
|
+
"key"
|
|
118
|
+
],
|
|
119
|
+
"oneOf": [
|
|
120
|
+
{
|
|
121
|
+
"required": [
|
|
122
|
+
"value"
|
|
123
|
+
],
|
|
124
|
+
"not": {
|
|
125
|
+
"required": [
|
|
126
|
+
"mergePatch"
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"required": [
|
|
132
|
+
"mergePatch"
|
|
133
|
+
],
|
|
134
|
+
"not": {
|
|
135
|
+
"required": [
|
|
136
|
+
"value"
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
],
|
|
141
|
+
"properties": {
|
|
142
|
+
"contextId": {
|
|
143
|
+
"type": "string",
|
|
144
|
+
"minLength": 1,
|
|
145
|
+
"description": "The VTA context the record is scoped to; the isolation boundary."
|
|
146
|
+
},
|
|
147
|
+
"namespace": {
|
|
148
|
+
"$ref": "#/$defs/Namespace"
|
|
149
|
+
},
|
|
150
|
+
"key": {
|
|
151
|
+
"$ref": "#/$defs/Key"
|
|
152
|
+
},
|
|
153
|
+
"value": {
|
|
154
|
+
"description": "The complete new value, replacing whatever the record held. Any JSON value, including `null` — a present-and-null `value` stores the JSON literal null and is not the same as omitting the member. Mutually exclusive with `mergePatch`."
|
|
155
|
+
},
|
|
156
|
+
"mergePatch": {
|
|
157
|
+
"description": "An RFC 7386 JSON Merge Patch applied to the record's current value. Cuts payload, and more usefully cuts conflicts: two instances editing different members of one record stop colliding entirely rather than serialising behind `expectedVersion`. Requires a live record at the address. Note RFC 7386's one sharp edge — a member set to `null` in the patch DELETES that member from the value, and there is no way to set a member to the JSON literal null through a patch; a writer that needs to do so must send a whole `value`. Mutually exclusive with `value`.",
|
|
158
|
+
"type": "object"
|
|
159
|
+
},
|
|
160
|
+
"expectedVersion": {
|
|
161
|
+
"$ref": "#/$defs/ExpectedVersion",
|
|
162
|
+
"description": "Optional precondition. Omit for a last-writer-wins upsert. Supply the version a prior read returned to make the write conditional; supply 0 to create only."
|
|
163
|
+
},
|
|
164
|
+
"ext": {
|
|
165
|
+
"$ref": "#/$defs/Ext",
|
|
166
|
+
"description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
"$defs": {
|
|
170
|
+
"Response": {
|
|
171
|
+
"$anchor": "response",
|
|
172
|
+
"title": "VTA Application State Put — response payload",
|
|
173
|
+
"description": "Success response to vta/app-state/put. Type https://trusttasks.org/spec/vta/app-state/put/1.0#response. A failed precondition is not a success: it is a trust-task-error carrying vta/app-state/put:versionConflict, whose details carry the maintainer's current version and value.",
|
|
174
|
+
"type": "object",
|
|
175
|
+
"additionalProperties": false,
|
|
176
|
+
"required": [
|
|
177
|
+
"contextId",
|
|
178
|
+
"namespace",
|
|
179
|
+
"key",
|
|
180
|
+
"version",
|
|
181
|
+
"created",
|
|
182
|
+
"updatedAt"
|
|
183
|
+
],
|
|
184
|
+
"properties": {
|
|
185
|
+
"contextId": {
|
|
186
|
+
"type": "string",
|
|
187
|
+
"minLength": 1,
|
|
188
|
+
"description": "Echoed from the request."
|
|
189
|
+
},
|
|
190
|
+
"namespace": {
|
|
191
|
+
"$ref": "#/$defs/Namespace"
|
|
192
|
+
},
|
|
193
|
+
"key": {
|
|
194
|
+
"$ref": "#/$defs/Key"
|
|
195
|
+
},
|
|
196
|
+
"version": {
|
|
197
|
+
"$ref": "#/$defs/Version",
|
|
198
|
+
"description": "The version this write took. Supply it as `expectedVersion` on the next write to chain conditional updates without an intervening read."
|
|
199
|
+
},
|
|
200
|
+
"created": {
|
|
201
|
+
"type": "boolean",
|
|
202
|
+
"description": "True when no live record existed at the address beforehand — including when the address held a tombstone, since a tombstone is not a live record."
|
|
203
|
+
},
|
|
204
|
+
"updatedAt": {
|
|
205
|
+
"type": "string",
|
|
206
|
+
"format": "date-time",
|
|
207
|
+
"description": "When the write was applied."
|
|
208
|
+
},
|
|
209
|
+
"valueBytes": {
|
|
210
|
+
"type": "integer",
|
|
211
|
+
"minimum": 0,
|
|
212
|
+
"description": "Size of the stored value in bytes as the maintainer measured it against its per-record cap. Lets a writer see how close it is to the limit before it hits it."
|
|
213
|
+
},
|
|
214
|
+
"ext": {
|
|
215
|
+
"$ref": "#/$defs/Ext",
|
|
216
|
+
"description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
"Ext": {
|
|
221
|
+
"title": "Ext",
|
|
222
|
+
"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.",
|
|
223
|
+
"type": "object",
|
|
224
|
+
"minProperties": 1,
|
|
225
|
+
"additionalProperties": true,
|
|
226
|
+
"propertyNames": {
|
|
227
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
"Version": {
|
|
231
|
+
"title": "Version",
|
|
232
|
+
"description": "A value of the namespace's monotonic write counter (see this schema's description). Server-assigned; a producer never chooses one.",
|
|
233
|
+
"type": "integer",
|
|
234
|
+
"minimum": 1
|
|
235
|
+
},
|
|
236
|
+
"Key": {
|
|
237
|
+
"title": "Key",
|
|
238
|
+
"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.",
|
|
239
|
+
"type": "string",
|
|
240
|
+
"minLength": 1,
|
|
241
|
+
"maxLength": 512,
|
|
242
|
+
"pattern": "^[^\\u0000]+$"
|
|
243
|
+
},
|
|
244
|
+
"Namespace": {
|
|
245
|
+
"title": "Namespace",
|
|
246
|
+
"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.",
|
|
247
|
+
"type": "string",
|
|
248
|
+
"minLength": 1,
|
|
249
|
+
"maxLength": 64,
|
|
250
|
+
"pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
|
|
251
|
+
},
|
|
252
|
+
"ExpectedVersion": {
|
|
253
|
+
"title": "ExpectedVersion",
|
|
254
|
+
"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.",
|
|
255
|
+
"type": "integer",
|
|
256
|
+
"minimum": 0
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
} as const;
|
|
260
|
+
|
|
261
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
262
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
263
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
264
|
+
"$ref": "#/$defs/Response",
|
|
265
|
+
"$defs": {
|
|
266
|
+
"Response": {
|
|
267
|
+
"$anchor": "response",
|
|
268
|
+
"title": "VTA Application State Put — response payload",
|
|
269
|
+
"description": "Success response to vta/app-state/put. Type https://trusttasks.org/spec/vta/app-state/put/1.0#response. A failed precondition is not a success: it is a trust-task-error carrying vta/app-state/put:versionConflict, whose details carry the maintainer's current version and value.",
|
|
270
|
+
"type": "object",
|
|
271
|
+
"additionalProperties": false,
|
|
272
|
+
"required": [
|
|
273
|
+
"contextId",
|
|
274
|
+
"namespace",
|
|
275
|
+
"key",
|
|
276
|
+
"version",
|
|
277
|
+
"created",
|
|
278
|
+
"updatedAt"
|
|
279
|
+
],
|
|
280
|
+
"properties": {
|
|
281
|
+
"contextId": {
|
|
282
|
+
"type": "string",
|
|
283
|
+
"minLength": 1,
|
|
284
|
+
"description": "Echoed from the request."
|
|
285
|
+
},
|
|
286
|
+
"namespace": {
|
|
287
|
+
"$ref": "#/$defs/Namespace"
|
|
288
|
+
},
|
|
289
|
+
"key": {
|
|
290
|
+
"$ref": "#/$defs/Key"
|
|
291
|
+
},
|
|
292
|
+
"version": {
|
|
293
|
+
"$ref": "#/$defs/Version",
|
|
294
|
+
"description": "The version this write took. Supply it as `expectedVersion` on the next write to chain conditional updates without an intervening read."
|
|
295
|
+
},
|
|
296
|
+
"created": {
|
|
297
|
+
"type": "boolean",
|
|
298
|
+
"description": "True when no live record existed at the address beforehand — including when the address held a tombstone, since a tombstone is not a live record."
|
|
299
|
+
},
|
|
300
|
+
"updatedAt": {
|
|
301
|
+
"type": "string",
|
|
302
|
+
"format": "date-time",
|
|
303
|
+
"description": "When the write was applied."
|
|
304
|
+
},
|
|
305
|
+
"valueBytes": {
|
|
306
|
+
"type": "integer",
|
|
307
|
+
"minimum": 0,
|
|
308
|
+
"description": "Size of the stored value in bytes as the maintainer measured it against its per-record cap. Lets a writer see how close it is to the limit before it hits it."
|
|
309
|
+
},
|
|
310
|
+
"ext": {
|
|
311
|
+
"$ref": "#/$defs/Ext",
|
|
312
|
+
"description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
"Ext": {
|
|
317
|
+
"title": "Ext",
|
|
318
|
+
"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.",
|
|
319
|
+
"type": "object",
|
|
320
|
+
"minProperties": 1,
|
|
321
|
+
"additionalProperties": true,
|
|
322
|
+
"propertyNames": {
|
|
323
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
"Version": {
|
|
327
|
+
"title": "Version",
|
|
328
|
+
"description": "A value of the namespace's monotonic write counter (see this schema's description). Server-assigned; a producer never chooses one.",
|
|
329
|
+
"type": "integer",
|
|
330
|
+
"minimum": 1
|
|
331
|
+
},
|
|
332
|
+
"Key": {
|
|
333
|
+
"title": "Key",
|
|
334
|
+
"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.",
|
|
335
|
+
"type": "string",
|
|
336
|
+
"minLength": 1,
|
|
337
|
+
"maxLength": 512,
|
|
338
|
+
"pattern": "^[^\\u0000]+$"
|
|
339
|
+
},
|
|
340
|
+
"Namespace": {
|
|
341
|
+
"title": "Namespace",
|
|
342
|
+
"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.",
|
|
343
|
+
"type": "string",
|
|
344
|
+
"minLength": 1,
|
|
345
|
+
"maxLength": 64,
|
|
346
|
+
"pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
|
|
347
|
+
},
|
|
348
|
+
"ExpectedVersion": {
|
|
349
|
+
"title": "ExpectedVersion",
|
|
350
|
+
"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.",
|
|
351
|
+
"type": "integer",
|
|
352
|
+
"minimum": 0
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
} as const;
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
359
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
360
|
+
* per-specification and cannot be derived from the document alone, and
|
|
361
|
+
* item 2 needs the schema this carries.
|
|
362
|
+
*/
|
|
363
|
+
export const SPEC = {
|
|
364
|
+
typeUri: TYPE_URI,
|
|
365
|
+
isBearer: false,
|
|
366
|
+
isProofRequired: true,
|
|
367
|
+
isRecipientRequired: true,
|
|
368
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
369
|
+
} as const;
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
373
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
374
|
+
* parties (§7.3 item 5).
|
|
375
|
+
*/
|
|
376
|
+
export const RESPONSE_SPEC = {
|
|
377
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
378
|
+
isBearer: false,
|
|
379
|
+
isProofRequired: true,
|
|
380
|
+
isRecipientRequired: true,
|
|
381
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
382
|
+
} as const;
|