@openvtc/trust-tasks 0.28.22 → 0.28.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +87 -0
- package/dist/_shared/components.d.ts +520 -0
- package/dist/_shared/components.d.ts.map +1 -1
- package/dist/index.d.ts +45 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -1
- package/dist/messaging/mux/_shared/0.1/mux.d.ts +16 -0
- package/dist/messaging/mux/_shared/0.1/mux.d.ts.map +1 -0
- package/dist/messaging/mux/_shared/0.1/mux.js +6 -0
- package/dist/messaging/mux/_shared/0.1/mux.js.map +1 -0
- package/dist/messaging/mux/attach/0.1/payload.d.ts +996 -0
- package/dist/messaging/mux/attach/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/mux/attach/0.1/payload.js +594 -0
- package/dist/messaging/mux/attach/0.1/payload.js.map +1 -0
- package/dist/messaging/mux/detach/0.1/payload.d.ts +398 -0
- package/dist/messaging/mux/detach/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/mux/detach/0.1/payload.js +215 -0
- package/dist/messaging/mux/detach/0.1/payload.js.map +1 -0
- package/dist/messaging/mux/event/0.1/payload.d.ts +513 -0
- package/dist/messaging/mux/event/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/mux/event/0.1/payload.js +260 -0
- package/dist/messaging/mux/event/0.1/payload.js.map +1 -0
- package/dist/messaging/mux/grant/0.1/payload.d.ts +1008 -0
- package/dist/messaging/mux/grant/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/mux/grant/0.1/payload.js +606 -0
- package/dist/messaging/mux/grant/0.1/payload.js.map +1 -0
- package/dist/messaging/mux/list/0.1/payload.d.ts +1241 -0
- package/dist/messaging/mux/list/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/mux/list/0.1/payload.js +715 -0
- package/dist/messaging/mux/list/0.1/payload.js.map +1 -0
- package/dist/messaging/mux/notice/0.1/payload.d.ts +489 -0
- package/dist/messaging/mux/notice/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/mux/notice/0.1/payload.js +249 -0
- package/dist/messaging/mux/notice/0.1/payload.js.map +1 -0
- package/dist/messaging/mux/revoke/0.1/payload.d.ts +585 -0
- package/dist/messaging/mux/revoke/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/mux/revoke/0.1/payload.js +311 -0
- package/dist/messaging/mux/revoke/0.1/payload.js.map +1 -0
- package/dist/messaging/mux/revoke-all/0.1/payload.d.ts +682 -0
- package/dist/messaging/mux/revoke-all/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/mux/revoke-all/0.1/payload.js +397 -0
- package/dist/messaging/mux/revoke-all/0.1/payload.js.map +1 -0
- package/dist/messaging/mux/update/0.1/payload.d.ts +995 -0
- package/dist/messaging/mux/update/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/mux/update/0.1/payload.js +586 -0
- package/dist/messaging/mux/update/0.1/payload.js.map +1 -0
- package/dist/vta/_shared/0.1/memory-record.d.ts +22 -0
- package/dist/vta/_shared/0.1/memory-record.d.ts.map +1 -0
- package/dist/vta/_shared/0.1/memory-record.js +6 -0
- package/dist/vta/_shared/0.1/memory-record.js.map +1 -0
- package/dist/vta/memory/delete/0.1/payload.d.ts +13 -2
- package/dist/vta/memory/delete/0.1/payload.d.ts.map +1 -1
- package/dist/vta/memory/delete/0.1/payload.js +1 -1
- package/dist/vta/memory/delete/0.1/payload.js.map +1 -1
- package/dist/vta/memory/delete/0.2/payload.d.ts +415 -0
- package/dist/vta/memory/delete/0.2/payload.d.ts.map +1 -0
- package/dist/vta/memory/delete/0.2/payload.js +224 -0
- package/dist/vta/memory/delete/0.2/payload.js.map +1 -0
- package/dist/vta/memory/get/0.1/payload.d.ts +646 -0
- package/dist/vta/memory/get/0.1/payload.d.ts.map +1 -0
- package/dist/vta/memory/get/0.1/payload.js +349 -0
- package/dist/vta/memory/get/0.1/payload.js.map +1 -0
- package/dist/vta/memory/list/0.1/payload.d.ts +13 -2
- package/dist/vta/memory/list/0.1/payload.d.ts.map +1 -1
- package/dist/vta/memory/list/0.1/payload.js +1 -1
- package/dist/vta/memory/list/0.1/payload.js.map +1 -1
- package/dist/vta/memory/list/0.2/payload.d.ts +693 -0
- package/dist/vta/memory/list/0.2/payload.d.ts.map +1 -0
- package/dist/vta/memory/list/0.2/payload.js +363 -0
- package/dist/vta/memory/list/0.2/payload.js.map +1 -0
- package/dist/vta/memory/put/0.1/payload.d.ts +13 -2
- package/dist/vta/memory/put/0.1/payload.d.ts.map +1 -1
- package/dist/vta/memory/put/0.1/payload.js +1 -1
- package/dist/vta/memory/put/0.1/payload.js.map +1 -1
- package/dist/vta/memory/put/0.2/payload.d.ts +490 -0
- package/dist/vta/memory/put/0.2/payload.d.ts.map +1 -0
- package/dist/vta/memory/put/0.2/payload.js +264 -0
- package/dist/vta/memory/put/0.2/payload.js.map +1 -0
- package/dist/vtc/members/rotate/0.1/payload.d.ts +12 -5
- package/dist/vtc/members/rotate/0.1/payload.d.ts.map +1 -1
- package/dist/vtc/members/rotate/0.1/payload.js +8 -2
- package/dist/vtc/members/rotate/0.1/payload.js.map +1 -1
- package/package.json +1 -1
- package/src/_shared/components.ts +581 -0
- package/src/index.ts +45 -0
- package/src/messaging/mux/_shared/0.1/mux.ts +17 -0
- package/src/messaging/mux/attach/0.1/payload.ts +682 -0
- package/src/messaging/mux/detach/0.1/payload.ts +278 -0
- package/src/messaging/mux/event/0.1/payload.ts +371 -0
- package/src/messaging/mux/grant/0.1/payload.ts +710 -0
- package/src/messaging/mux/list/0.1/payload.ts +793 -0
- package/src/messaging/mux/notice/0.1/payload.ts +362 -0
- package/src/messaging/mux/revoke/0.1/payload.ts +389 -0
- package/src/messaging/mux/revoke-all/0.1/payload.ts +452 -0
- package/src/messaging/mux/update/0.1/payload.ts +644 -0
- package/src/vta/_shared/0.1/memory-record.ts +23 -0
- package/src/vta/memory/delete/0.1/payload.ts +14 -3
- package/src/vta/memory/delete/0.2/payload.ts +288 -0
- package/src/vta/memory/get/0.1/payload.ts +414 -0
- package/src/vta/memory/list/0.1/payload.ts +14 -3
- package/src/vta/memory/list/0.2/payload.ts +445 -0
- package/src/vta/memory/put/0.1/payload.ts +14 -3
- package/src/vta/memory/put/0.2/payload.ts +333 -0
- package/src/vtc/members/rotate/0.1/payload.ts +12 -3
|
@@ -0,0 +1,490 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vta/memory/put/0.2/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
import type { Ext, MemoryExpectedVersion, MemoryKey, MemoryValue, MemoryVersion } from "../../../../_shared/components.js";
|
|
6
|
+
/**
|
|
7
|
+
* Store one memory item at its `(contextId, key)` address. `expectedVersion` makes the write conditional: a positive value requires the item to be at exactly that version, and zero requires that no live item exists.
|
|
8
|
+
*/
|
|
9
|
+
export interface VTAMemoryPutPayload {
|
|
10
|
+
/**
|
|
11
|
+
* The VTA context the item is scoped to; the isolation boundary.
|
|
12
|
+
*/
|
|
13
|
+
contextId: string;
|
|
14
|
+
key: MemoryKey;
|
|
15
|
+
value: MemoryValue;
|
|
16
|
+
/**
|
|
17
|
+
* Optional precondition. Omit for a last-writer-wins upsert, as in 0.1. Supply the version a prior read returned to make the write conditional; supply 0 to create only.
|
|
18
|
+
*/
|
|
19
|
+
expectedVersion?: MemoryExpectedVersion;
|
|
20
|
+
/**
|
|
21
|
+
* Ecosystem-defined extension members per SPEC.md §4.5.1.
|
|
22
|
+
*/
|
|
23
|
+
ext?: Ext;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Success response to vta/memory/put. Type https://trusttasks.org/spec/vta/memory/put/0.2#response. A failed precondition is not a success: it is a trust-task-error carrying vta/memory/put:versionConflict, whose details carry the maintainer's current version and value.
|
|
27
|
+
*/
|
|
28
|
+
export interface VTAMemoryPutResponsePayload {
|
|
29
|
+
/**
|
|
30
|
+
* Echoed from the request.
|
|
31
|
+
*/
|
|
32
|
+
contextId: string;
|
|
33
|
+
key: MemoryKey;
|
|
34
|
+
/**
|
|
35
|
+
* The version this write took. Supply it as `expectedVersion` on the next write to chain conditional updates without an intervening read.
|
|
36
|
+
*/
|
|
37
|
+
version: MemoryVersion;
|
|
38
|
+
/**
|
|
39
|
+
* True when no live item existed at the key beforehand — including when the key held a tombstone, since a tombstone is not a live item.
|
|
40
|
+
*/
|
|
41
|
+
wasCreated: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* When the write was applied.
|
|
44
|
+
*/
|
|
45
|
+
updatedAt: string;
|
|
46
|
+
/**
|
|
47
|
+
* Size of the stored value in bytes as the maintainer measured it against its per-item cap.
|
|
48
|
+
*/
|
|
49
|
+
valueBytes?: number;
|
|
50
|
+
/**
|
|
51
|
+
* Ecosystem-defined extension members per SPEC.md §4.5.1.
|
|
52
|
+
*/
|
|
53
|
+
ext?: Ext;
|
|
54
|
+
}
|
|
55
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
56
|
+
export type { Ext, MemoryExpectedVersion, MemoryKey, MemoryValue, MemoryVersion };
|
|
57
|
+
/** Trust Task type URI. */
|
|
58
|
+
export declare const TYPE_URI: "https://trusttasks.org/spec/vta/memory/put/0.2";
|
|
59
|
+
/**
|
|
60
|
+
* The earlier version of this specification that this one declares it
|
|
61
|
+
* extends (front matter `extends`, SPEC §5.2 "Declared extension"), or
|
|
62
|
+
* `null`. Only the direct declaration — follow the chain with
|
|
63
|
+
* `extendsChain` / `readForSpec`.
|
|
64
|
+
*/
|
|
65
|
+
export declare const EXTENDS: string | null;
|
|
66
|
+
/**
|
|
67
|
+
* Why this version is deprecated, or `null` while it is current. A
|
|
68
|
+
* superseded or retired version is still supported, and is withdrawn from
|
|
69
|
+
* this package in a later scheduled batch (SPEC "Superseded and Withdrawn
|
|
70
|
+
* Versions").
|
|
71
|
+
*/
|
|
72
|
+
export declare const DEPRECATION: string | null;
|
|
73
|
+
/** Stable alias for this specification's request payload shape. */
|
|
74
|
+
export type Payload = VTAMemoryPutPayload;
|
|
75
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
76
|
+
export declare const RESPONSE_TYPE_URI: "https://trusttasks.org/spec/vta/memory/put/0.2#response";
|
|
77
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
78
|
+
export type Response = VTAMemoryPutResponsePayload;
|
|
79
|
+
/**
|
|
80
|
+
* This specification's payload schema, as a value.
|
|
81
|
+
*
|
|
82
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
83
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
84
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
85
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
86
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
87
|
+
*/
|
|
88
|
+
export declare const PAYLOAD_SCHEMA: {
|
|
89
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
90
|
+
readonly $id: "https://trusttasks.org/spec/vta/memory/put/0.2";
|
|
91
|
+
readonly title: "VTA Memory Put — payload";
|
|
92
|
+
readonly description: "Store one memory item at its `(contextId, key)` address. `expectedVersion` makes the write conditional: a positive value requires the item to be at exactly that version, and zero requires that no live item exists.";
|
|
93
|
+
readonly type: "object";
|
|
94
|
+
readonly additionalProperties: false;
|
|
95
|
+
readonly required: readonly ["contextId", "key", "value"];
|
|
96
|
+
readonly properties: {
|
|
97
|
+
readonly contextId: {
|
|
98
|
+
readonly type: "string";
|
|
99
|
+
readonly minLength: 1;
|
|
100
|
+
readonly description: "The VTA context the item is scoped to; the isolation boundary.";
|
|
101
|
+
};
|
|
102
|
+
readonly key: {
|
|
103
|
+
readonly $ref: "#/$defs/MemoryKey";
|
|
104
|
+
};
|
|
105
|
+
readonly value: {
|
|
106
|
+
readonly $ref: "#/$defs/MemoryValue";
|
|
107
|
+
};
|
|
108
|
+
readonly expectedVersion: {
|
|
109
|
+
readonly $ref: "#/$defs/MemoryExpectedVersion";
|
|
110
|
+
readonly description: "Optional precondition. Omit for a last-writer-wins upsert, as in 0.1. Supply the version a prior read returned to make the write conditional; supply 0 to create only.";
|
|
111
|
+
};
|
|
112
|
+
readonly ext: {
|
|
113
|
+
readonly $ref: "#/$defs/Ext";
|
|
114
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
readonly $defs: {
|
|
118
|
+
readonly Response: {
|
|
119
|
+
readonly $anchor: "response";
|
|
120
|
+
readonly title: "VTA Memory Put — response payload";
|
|
121
|
+
readonly description: "Success response to vta/memory/put. Type https://trusttasks.org/spec/vta/memory/put/0.2#response. A failed precondition is not a success: it is a trust-task-error carrying vta/memory/put:versionConflict, whose details carry the maintainer's current version and value.";
|
|
122
|
+
readonly type: "object";
|
|
123
|
+
readonly additionalProperties: false;
|
|
124
|
+
readonly required: readonly ["contextId", "key", "version", "wasCreated", "updatedAt"];
|
|
125
|
+
readonly properties: {
|
|
126
|
+
readonly contextId: {
|
|
127
|
+
readonly type: "string";
|
|
128
|
+
readonly minLength: 1;
|
|
129
|
+
readonly description: "Echoed from the request.";
|
|
130
|
+
};
|
|
131
|
+
readonly key: {
|
|
132
|
+
readonly $ref: "#/$defs/MemoryKey";
|
|
133
|
+
};
|
|
134
|
+
readonly version: {
|
|
135
|
+
readonly $ref: "#/$defs/MemoryVersion";
|
|
136
|
+
readonly description: "The version this write took. Supply it as `expectedVersion` on the next write to chain conditional updates without an intervening read.";
|
|
137
|
+
};
|
|
138
|
+
readonly wasCreated: {
|
|
139
|
+
readonly type: "boolean";
|
|
140
|
+
readonly description: "True when no live item existed at the key beforehand — including when the key held a tombstone, since a tombstone is not a live item.";
|
|
141
|
+
};
|
|
142
|
+
readonly updatedAt: {
|
|
143
|
+
readonly type: "string";
|
|
144
|
+
readonly format: "date-time";
|
|
145
|
+
readonly description: "When the write was applied.";
|
|
146
|
+
};
|
|
147
|
+
readonly valueBytes: {
|
|
148
|
+
readonly type: "integer";
|
|
149
|
+
readonly minimum: 0;
|
|
150
|
+
readonly description: "Size of the stored value in bytes as the maintainer measured it against its per-item cap.";
|
|
151
|
+
};
|
|
152
|
+
readonly ext: {
|
|
153
|
+
readonly $ref: "#/$defs/Ext";
|
|
154
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
readonly Ext: {
|
|
159
|
+
readonly title: "Ext";
|
|
160
|
+
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.";
|
|
161
|
+
readonly type: "object";
|
|
162
|
+
readonly minProperties: 1;
|
|
163
|
+
readonly additionalProperties: true;
|
|
164
|
+
readonly propertyNames: {
|
|
165
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
readonly MemoryVersion: {
|
|
169
|
+
readonly title: "MemoryVersion";
|
|
170
|
+
readonly description: "A value of the context's monotonic write counter (see this schema's description). Server-assigned; a producer never chooses one.";
|
|
171
|
+
readonly type: "integer";
|
|
172
|
+
readonly minimum: 1;
|
|
173
|
+
};
|
|
174
|
+
readonly MemoryKey: {
|
|
175
|
+
readonly title: "MemoryKey";
|
|
176
|
+
readonly description: "Agent-chosen identifier for an item within a context. Opaque to the maintainer: it MUST NOT be parsed, normalized, or case-folded, and prefix matching in `vta/memory/list` is a byte-prefix comparison over the UTF-8 encoding. Agents SHOULD use `/`-delimited hierarchical keys (`contact/billing`, `preference/timezone`) so that `prefix` can address a family of items, but the delimiter is a convention between an agent and itself. A key is content as well as an address: a key naming a person, a condition or a dispute discloses something to anyone who can list the context, even without its value.";
|
|
177
|
+
readonly type: "string";
|
|
178
|
+
readonly minLength: 1;
|
|
179
|
+
readonly maxLength: 512;
|
|
180
|
+
readonly pattern: "^[^\\u0000]+$";
|
|
181
|
+
};
|
|
182
|
+
readonly MemoryExpectedVersion: {
|
|
183
|
+
readonly title: "MemoryExpectedVersion";
|
|
184
|
+
readonly description: "Optimistic-concurrency precondition on a write. A positive value requires that the item's current `version` equals it exactly. Zero means \"create only\" — the write applies only if no LIVE item exists at the key. A tombstone is not a live item, so `expectedVersion: 0` succeeds over one; the created item takes the context's next counter value, which is necessarily greater than the tombstone's.";
|
|
185
|
+
readonly type: "integer";
|
|
186
|
+
readonly minimum: 0;
|
|
187
|
+
};
|
|
188
|
+
readonly MemoryValue: {
|
|
189
|
+
readonly title: "MemoryValue";
|
|
190
|
+
readonly description: "The remembered text: a fact, a summary, a preference. Opaque to the maintainer, which stores it as given and never interprets, rewrites or summarises it. The maintainer enforces a documented per-item cap on its size (see `vta/memory/put`).";
|
|
191
|
+
readonly type: "string";
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
196
|
+
export declare const RESPONSE_PAYLOAD_SCHEMA: {
|
|
197
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
198
|
+
readonly $ref: "#/$defs/Response";
|
|
199
|
+
readonly $defs: {
|
|
200
|
+
readonly Response: {
|
|
201
|
+
readonly $anchor: "response";
|
|
202
|
+
readonly title: "VTA Memory Put — response payload";
|
|
203
|
+
readonly description: "Success response to vta/memory/put. Type https://trusttasks.org/spec/vta/memory/put/0.2#response. A failed precondition is not a success: it is a trust-task-error carrying vta/memory/put:versionConflict, whose details carry the maintainer's current version and value.";
|
|
204
|
+
readonly type: "object";
|
|
205
|
+
readonly additionalProperties: false;
|
|
206
|
+
readonly required: readonly ["contextId", "key", "version", "wasCreated", "updatedAt"];
|
|
207
|
+
readonly properties: {
|
|
208
|
+
readonly contextId: {
|
|
209
|
+
readonly type: "string";
|
|
210
|
+
readonly minLength: 1;
|
|
211
|
+
readonly description: "Echoed from the request.";
|
|
212
|
+
};
|
|
213
|
+
readonly key: {
|
|
214
|
+
readonly $ref: "#/$defs/MemoryKey";
|
|
215
|
+
};
|
|
216
|
+
readonly version: {
|
|
217
|
+
readonly $ref: "#/$defs/MemoryVersion";
|
|
218
|
+
readonly description: "The version this write took. Supply it as `expectedVersion` on the next write to chain conditional updates without an intervening read.";
|
|
219
|
+
};
|
|
220
|
+
readonly wasCreated: {
|
|
221
|
+
readonly type: "boolean";
|
|
222
|
+
readonly description: "True when no live item existed at the key beforehand — including when the key held a tombstone, since a tombstone is not a live item.";
|
|
223
|
+
};
|
|
224
|
+
readonly updatedAt: {
|
|
225
|
+
readonly type: "string";
|
|
226
|
+
readonly format: "date-time";
|
|
227
|
+
readonly description: "When the write was applied.";
|
|
228
|
+
};
|
|
229
|
+
readonly valueBytes: {
|
|
230
|
+
readonly type: "integer";
|
|
231
|
+
readonly minimum: 0;
|
|
232
|
+
readonly description: "Size of the stored value in bytes as the maintainer measured it against its per-item cap.";
|
|
233
|
+
};
|
|
234
|
+
readonly ext: {
|
|
235
|
+
readonly $ref: "#/$defs/Ext";
|
|
236
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
readonly Ext: {
|
|
241
|
+
readonly title: "Ext";
|
|
242
|
+
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.";
|
|
243
|
+
readonly type: "object";
|
|
244
|
+
readonly minProperties: 1;
|
|
245
|
+
readonly additionalProperties: true;
|
|
246
|
+
readonly propertyNames: {
|
|
247
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
248
|
+
};
|
|
249
|
+
};
|
|
250
|
+
readonly MemoryVersion: {
|
|
251
|
+
readonly title: "MemoryVersion";
|
|
252
|
+
readonly description: "A value of the context's monotonic write counter (see this schema's description). Server-assigned; a producer never chooses one.";
|
|
253
|
+
readonly type: "integer";
|
|
254
|
+
readonly minimum: 1;
|
|
255
|
+
};
|
|
256
|
+
readonly MemoryKey: {
|
|
257
|
+
readonly title: "MemoryKey";
|
|
258
|
+
readonly description: "Agent-chosen identifier for an item within a context. Opaque to the maintainer: it MUST NOT be parsed, normalized, or case-folded, and prefix matching in `vta/memory/list` is a byte-prefix comparison over the UTF-8 encoding. Agents SHOULD use `/`-delimited hierarchical keys (`contact/billing`, `preference/timezone`) so that `prefix` can address a family of items, but the delimiter is a convention between an agent and itself. A key is content as well as an address: a key naming a person, a condition or a dispute discloses something to anyone who can list the context, even without its value.";
|
|
259
|
+
readonly type: "string";
|
|
260
|
+
readonly minLength: 1;
|
|
261
|
+
readonly maxLength: 512;
|
|
262
|
+
readonly pattern: "^[^\\u0000]+$";
|
|
263
|
+
};
|
|
264
|
+
readonly MemoryExpectedVersion: {
|
|
265
|
+
readonly title: "MemoryExpectedVersion";
|
|
266
|
+
readonly description: "Optimistic-concurrency precondition on a write. A positive value requires that the item's current `version` equals it exactly. Zero means \"create only\" — the write applies only if no LIVE item exists at the key. A tombstone is not a live item, so `expectedVersion: 0` succeeds over one; the created item takes the context's next counter value, which is necessarily greater than the tombstone's.";
|
|
267
|
+
readonly type: "integer";
|
|
268
|
+
readonly minimum: 0;
|
|
269
|
+
};
|
|
270
|
+
readonly MemoryValue: {
|
|
271
|
+
readonly title: "MemoryValue";
|
|
272
|
+
readonly description: "The remembered text: a fact, a summary, a preference. Opaque to the maintainer, which stores it as given and never interprets, rewrites or summarises it. The maintainer enforces a documented per-item cap on its size (see `vta/memory/put`).";
|
|
273
|
+
readonly type: "string";
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
/**
|
|
278
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
279
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
280
|
+
* per-specification and cannot be derived from the document alone, and
|
|
281
|
+
* item 2 needs the schema this carries.
|
|
282
|
+
*/
|
|
283
|
+
export declare const SPEC: {
|
|
284
|
+
readonly typeUri: "https://trusttasks.org/spec/vta/memory/put/0.2";
|
|
285
|
+
readonly isBearer: false;
|
|
286
|
+
readonly isProofRequired: true;
|
|
287
|
+
readonly isRecipientRequired: true;
|
|
288
|
+
readonly isIssuedAtRequired: true;
|
|
289
|
+
readonly payloadSchema: {
|
|
290
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
291
|
+
readonly $id: "https://trusttasks.org/spec/vta/memory/put/0.2";
|
|
292
|
+
readonly title: "VTA Memory Put — payload";
|
|
293
|
+
readonly description: "Store one memory item at its `(contextId, key)` address. `expectedVersion` makes the write conditional: a positive value requires the item to be at exactly that version, and zero requires that no live item exists.";
|
|
294
|
+
readonly type: "object";
|
|
295
|
+
readonly additionalProperties: false;
|
|
296
|
+
readonly required: readonly ["contextId", "key", "value"];
|
|
297
|
+
readonly properties: {
|
|
298
|
+
readonly contextId: {
|
|
299
|
+
readonly type: "string";
|
|
300
|
+
readonly minLength: 1;
|
|
301
|
+
readonly description: "The VTA context the item is scoped to; the isolation boundary.";
|
|
302
|
+
};
|
|
303
|
+
readonly key: {
|
|
304
|
+
readonly $ref: "#/$defs/MemoryKey";
|
|
305
|
+
};
|
|
306
|
+
readonly value: {
|
|
307
|
+
readonly $ref: "#/$defs/MemoryValue";
|
|
308
|
+
};
|
|
309
|
+
readonly expectedVersion: {
|
|
310
|
+
readonly $ref: "#/$defs/MemoryExpectedVersion";
|
|
311
|
+
readonly description: "Optional precondition. Omit for a last-writer-wins upsert, as in 0.1. Supply the version a prior read returned to make the write conditional; supply 0 to create only.";
|
|
312
|
+
};
|
|
313
|
+
readonly ext: {
|
|
314
|
+
readonly $ref: "#/$defs/Ext";
|
|
315
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
316
|
+
};
|
|
317
|
+
};
|
|
318
|
+
readonly $defs: {
|
|
319
|
+
readonly Response: {
|
|
320
|
+
readonly $anchor: "response";
|
|
321
|
+
readonly title: "VTA Memory Put — response payload";
|
|
322
|
+
readonly description: "Success response to vta/memory/put. Type https://trusttasks.org/spec/vta/memory/put/0.2#response. A failed precondition is not a success: it is a trust-task-error carrying vta/memory/put:versionConflict, whose details carry the maintainer's current version and value.";
|
|
323
|
+
readonly type: "object";
|
|
324
|
+
readonly additionalProperties: false;
|
|
325
|
+
readonly required: readonly ["contextId", "key", "version", "wasCreated", "updatedAt"];
|
|
326
|
+
readonly properties: {
|
|
327
|
+
readonly contextId: {
|
|
328
|
+
readonly type: "string";
|
|
329
|
+
readonly minLength: 1;
|
|
330
|
+
readonly description: "Echoed from the request.";
|
|
331
|
+
};
|
|
332
|
+
readonly key: {
|
|
333
|
+
readonly $ref: "#/$defs/MemoryKey";
|
|
334
|
+
};
|
|
335
|
+
readonly version: {
|
|
336
|
+
readonly $ref: "#/$defs/MemoryVersion";
|
|
337
|
+
readonly description: "The version this write took. Supply it as `expectedVersion` on the next write to chain conditional updates without an intervening read.";
|
|
338
|
+
};
|
|
339
|
+
readonly wasCreated: {
|
|
340
|
+
readonly type: "boolean";
|
|
341
|
+
readonly description: "True when no live item existed at the key beforehand — including when the key held a tombstone, since a tombstone is not a live item.";
|
|
342
|
+
};
|
|
343
|
+
readonly updatedAt: {
|
|
344
|
+
readonly type: "string";
|
|
345
|
+
readonly format: "date-time";
|
|
346
|
+
readonly description: "When the write was applied.";
|
|
347
|
+
};
|
|
348
|
+
readonly valueBytes: {
|
|
349
|
+
readonly type: "integer";
|
|
350
|
+
readonly minimum: 0;
|
|
351
|
+
readonly description: "Size of the stored value in bytes as the maintainer measured it against its per-item cap.";
|
|
352
|
+
};
|
|
353
|
+
readonly ext: {
|
|
354
|
+
readonly $ref: "#/$defs/Ext";
|
|
355
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
356
|
+
};
|
|
357
|
+
};
|
|
358
|
+
};
|
|
359
|
+
readonly Ext: {
|
|
360
|
+
readonly title: "Ext";
|
|
361
|
+
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.";
|
|
362
|
+
readonly type: "object";
|
|
363
|
+
readonly minProperties: 1;
|
|
364
|
+
readonly additionalProperties: true;
|
|
365
|
+
readonly propertyNames: {
|
|
366
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
367
|
+
};
|
|
368
|
+
};
|
|
369
|
+
readonly MemoryVersion: {
|
|
370
|
+
readonly title: "MemoryVersion";
|
|
371
|
+
readonly description: "A value of the context's monotonic write counter (see this schema's description). Server-assigned; a producer never chooses one.";
|
|
372
|
+
readonly type: "integer";
|
|
373
|
+
readonly minimum: 1;
|
|
374
|
+
};
|
|
375
|
+
readonly MemoryKey: {
|
|
376
|
+
readonly title: "MemoryKey";
|
|
377
|
+
readonly description: "Agent-chosen identifier for an item within a context. Opaque to the maintainer: it MUST NOT be parsed, normalized, or case-folded, and prefix matching in `vta/memory/list` is a byte-prefix comparison over the UTF-8 encoding. Agents SHOULD use `/`-delimited hierarchical keys (`contact/billing`, `preference/timezone`) so that `prefix` can address a family of items, but the delimiter is a convention between an agent and itself. A key is content as well as an address: a key naming a person, a condition or a dispute discloses something to anyone who can list the context, even without its value.";
|
|
378
|
+
readonly type: "string";
|
|
379
|
+
readonly minLength: 1;
|
|
380
|
+
readonly maxLength: 512;
|
|
381
|
+
readonly pattern: "^[^\\u0000]+$";
|
|
382
|
+
};
|
|
383
|
+
readonly MemoryExpectedVersion: {
|
|
384
|
+
readonly title: "MemoryExpectedVersion";
|
|
385
|
+
readonly description: "Optimistic-concurrency precondition on a write. A positive value requires that the item's current `version` equals it exactly. Zero means \"create only\" — the write applies only if no LIVE item exists at the key. A tombstone is not a live item, so `expectedVersion: 0` succeeds over one; the created item takes the context's next counter value, which is necessarily greater than the tombstone's.";
|
|
386
|
+
readonly type: "integer";
|
|
387
|
+
readonly minimum: 0;
|
|
388
|
+
};
|
|
389
|
+
readonly MemoryValue: {
|
|
390
|
+
readonly title: "MemoryValue";
|
|
391
|
+
readonly description: "The remembered text: a fact, a summary, a preference. Opaque to the maintainer, which stores it as given and never interprets, rewrites or summarises it. The maintainer enforces a documented per-item cap on its size (see `vta/memory/put`).";
|
|
392
|
+
readonly type: "string";
|
|
393
|
+
};
|
|
394
|
+
};
|
|
395
|
+
};
|
|
396
|
+
};
|
|
397
|
+
/**
|
|
398
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
399
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
400
|
+
* parties (§7.3 item 5).
|
|
401
|
+
*/
|
|
402
|
+
export declare const RESPONSE_SPEC: {
|
|
403
|
+
readonly typeUri: "https://trusttasks.org/spec/vta/memory/put/0.2#response";
|
|
404
|
+
readonly isBearer: false;
|
|
405
|
+
readonly isProofRequired: true;
|
|
406
|
+
readonly isRecipientRequired: true;
|
|
407
|
+
readonly isIssuedAtRequired: true;
|
|
408
|
+
readonly payloadSchema: {
|
|
409
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
410
|
+
readonly $ref: "#/$defs/Response";
|
|
411
|
+
readonly $defs: {
|
|
412
|
+
readonly Response: {
|
|
413
|
+
readonly $anchor: "response";
|
|
414
|
+
readonly title: "VTA Memory Put — response payload";
|
|
415
|
+
readonly description: "Success response to vta/memory/put. Type https://trusttasks.org/spec/vta/memory/put/0.2#response. A failed precondition is not a success: it is a trust-task-error carrying vta/memory/put:versionConflict, whose details carry the maintainer's current version and value.";
|
|
416
|
+
readonly type: "object";
|
|
417
|
+
readonly additionalProperties: false;
|
|
418
|
+
readonly required: readonly ["contextId", "key", "version", "wasCreated", "updatedAt"];
|
|
419
|
+
readonly properties: {
|
|
420
|
+
readonly contextId: {
|
|
421
|
+
readonly type: "string";
|
|
422
|
+
readonly minLength: 1;
|
|
423
|
+
readonly description: "Echoed from the request.";
|
|
424
|
+
};
|
|
425
|
+
readonly key: {
|
|
426
|
+
readonly $ref: "#/$defs/MemoryKey";
|
|
427
|
+
};
|
|
428
|
+
readonly version: {
|
|
429
|
+
readonly $ref: "#/$defs/MemoryVersion";
|
|
430
|
+
readonly description: "The version this write took. Supply it as `expectedVersion` on the next write to chain conditional updates without an intervening read.";
|
|
431
|
+
};
|
|
432
|
+
readonly wasCreated: {
|
|
433
|
+
readonly type: "boolean";
|
|
434
|
+
readonly description: "True when no live item existed at the key beforehand — including when the key held a tombstone, since a tombstone is not a live item.";
|
|
435
|
+
};
|
|
436
|
+
readonly updatedAt: {
|
|
437
|
+
readonly type: "string";
|
|
438
|
+
readonly format: "date-time";
|
|
439
|
+
readonly description: "When the write was applied.";
|
|
440
|
+
};
|
|
441
|
+
readonly valueBytes: {
|
|
442
|
+
readonly type: "integer";
|
|
443
|
+
readonly minimum: 0;
|
|
444
|
+
readonly description: "Size of the stored value in bytes as the maintainer measured it against its per-item cap.";
|
|
445
|
+
};
|
|
446
|
+
readonly ext: {
|
|
447
|
+
readonly $ref: "#/$defs/Ext";
|
|
448
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
449
|
+
};
|
|
450
|
+
};
|
|
451
|
+
};
|
|
452
|
+
readonly Ext: {
|
|
453
|
+
readonly title: "Ext";
|
|
454
|
+
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.";
|
|
455
|
+
readonly type: "object";
|
|
456
|
+
readonly minProperties: 1;
|
|
457
|
+
readonly additionalProperties: true;
|
|
458
|
+
readonly propertyNames: {
|
|
459
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
460
|
+
};
|
|
461
|
+
};
|
|
462
|
+
readonly MemoryVersion: {
|
|
463
|
+
readonly title: "MemoryVersion";
|
|
464
|
+
readonly description: "A value of the context's monotonic write counter (see this schema's description). Server-assigned; a producer never chooses one.";
|
|
465
|
+
readonly type: "integer";
|
|
466
|
+
readonly minimum: 1;
|
|
467
|
+
};
|
|
468
|
+
readonly MemoryKey: {
|
|
469
|
+
readonly title: "MemoryKey";
|
|
470
|
+
readonly description: "Agent-chosen identifier for an item within a context. Opaque to the maintainer: it MUST NOT be parsed, normalized, or case-folded, and prefix matching in `vta/memory/list` is a byte-prefix comparison over the UTF-8 encoding. Agents SHOULD use `/`-delimited hierarchical keys (`contact/billing`, `preference/timezone`) so that `prefix` can address a family of items, but the delimiter is a convention between an agent and itself. A key is content as well as an address: a key naming a person, a condition or a dispute discloses something to anyone who can list the context, even without its value.";
|
|
471
|
+
readonly type: "string";
|
|
472
|
+
readonly minLength: 1;
|
|
473
|
+
readonly maxLength: 512;
|
|
474
|
+
readonly pattern: "^[^\\u0000]+$";
|
|
475
|
+
};
|
|
476
|
+
readonly MemoryExpectedVersion: {
|
|
477
|
+
readonly title: "MemoryExpectedVersion";
|
|
478
|
+
readonly description: "Optimistic-concurrency precondition on a write. A positive value requires that the item's current `version` equals it exactly. Zero means \"create only\" — the write applies only if no LIVE item exists at the key. A tombstone is not a live item, so `expectedVersion: 0` succeeds over one; the created item takes the context's next counter value, which is necessarily greater than the tombstone's.";
|
|
479
|
+
readonly type: "integer";
|
|
480
|
+
readonly minimum: 0;
|
|
481
|
+
};
|
|
482
|
+
readonly MemoryValue: {
|
|
483
|
+
readonly title: "MemoryValue";
|
|
484
|
+
readonly description: "The remembered text: a fact, a summary, a preference. Opaque to the maintainer, which stores it as given and never interprets, rewrites or summarises it. The maintainer enforces a documented per-item cap on its size (see `vta/memory/put`).";
|
|
485
|
+
readonly type: "string";
|
|
486
|
+
};
|
|
487
|
+
};
|
|
488
|
+
};
|
|
489
|
+
};
|
|
490
|
+
//# sourceMappingURL=payload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../../../src/vta/memory/put/0.2/payload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,qBAAqB,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAG3H;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,SAAS,CAAC;IACf,KAAK,EAAE,WAAW,CAAC;IACnB;;OAEG;IACH,eAAe,CAAC,EAAE,qBAAqB,CAAC;IACxC;;OAEG;IACH,GAAG,CAAC,EAAE,GAAG,CAAC;CACX;AACD;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,SAAS,CAAC;IACf;;OAEG;IACH,OAAO,EAAE,aAAa,CAAC;IACvB;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,GAAG,CAAC,EAAE,GAAG,CAAC;CACX;AAED,kHAAkH;AAClH,YAAY,EAAE,GAAG,EAAE,qBAAqB,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC;AAElF,2BAA2B;AAC3B,eAAO,MAAM,QAAQ,EAAG,gDAAyD,CAAC;AAElF;;;;;GAKG;AACH,eAAO,MAAM,OAAO,EAAE,MAAM,GAAG,IAAW,CAAC;AAE3C;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,GAAG,IAAW,CAAC;AAE/C,mEAAmE;AACnE,MAAM,MAAM,OAAO,GAAG,mBAAmB,CAAC;AAE1C,qEAAqE;AACrE,eAAO,MAAM,iBAAiB,EAAG,yDAAkE,CAAC;AAEpG,4EAA4E;AAC5E,MAAM,MAAM,QAAQ,GAAG,2BAA2B,CAAC;AAEnD;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoHjB,CAAC;AAEX,mEAAmE;AACnE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsF1B,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOP,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOhB,CAAC"}
|