@openvtc/trust-tasks 0.28.11 → 0.28.12

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.
Files changed (30) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/dist/_shared/components.d.ts +38 -0
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/index.d.ts +12 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +12 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/vta/collection/_shared/0.1/collection.d.ts +16 -0
  9. package/dist/vta/collection/_shared/0.1/collection.d.ts.map +1 -0
  10. package/dist/vta/collection/_shared/0.1/collection.js +6 -0
  11. package/dist/vta/collection/_shared/0.1/collection.js.map +1 -0
  12. package/dist/vta/collection/claim/0.1/payload.d.ts +352 -0
  13. package/dist/vta/collection/claim/0.1/payload.d.ts.map +1 -0
  14. package/dist/vta/collection/claim/0.1/payload.js +198 -0
  15. package/dist/vta/collection/claim/0.1/payload.js.map +1 -0
  16. package/dist/vta/collection/list/0.1/payload.d.ts +740 -0
  17. package/dist/vta/collection/list/0.1/payload.d.ts.map +1 -0
  18. package/dist/vta/collection/list/0.1/payload.js +447 -0
  19. package/dist/vta/collection/list/0.1/payload.js.map +1 -0
  20. package/dist/vta/collection/release/0.1/payload.d.ts +316 -0
  21. package/dist/vta/collection/release/0.1/payload.d.ts.map +1 -0
  22. package/dist/vta/collection/release/0.1/payload.js +182 -0
  23. package/dist/vta/collection/release/0.1/payload.js.map +1 -0
  24. package/package.json +1 -1
  25. package/src/_shared/components.ts +38 -0
  26. package/src/index.ts +12 -0
  27. package/src/vta/collection/_shared/0.1/collection.ts +17 -0
  28. package/src/vta/collection/claim/0.1/payload.ts +247 -0
  29. package/src/vta/collection/list/0.1/payload.ts +500 -0
  30. package/src/vta/collection/release/0.1/payload.ts +223 -0
@@ -0,0 +1,247 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vta/collection/claim/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { ContextId_VtaCollectionV0_1 as ContextId, Did_NotificationsV0_1 as Did, Ext } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * A client with standing in a trust context asks its VTA to make it, until a stated end, the one collector of the messages queued at the mediator for an identifier whose keys the VTA holds there — a persona DID — or renews a claim it already holds. Before it grants, the VTA stops collecting for the identifier and closes every connection it holds for it; the client opens its own only once it holds the grant, and closes it before the claim ends unless it has renewed (VTI-NTF-081 – VTI-NTF-083). The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.
11
+ */
12
+ export interface VTACollectionClaimPayload {
13
+ contextId: ContextId;
14
+ /**
15
+ * The identifier to collect for: one whose messaging keys the VTA holds in `contextId` and whose DID document advertises a transport through a mediator.
16
+ */
17
+ identifier: Did;
18
+ /**
19
+ * How long the client asks the claim to last from the grant. The VTA grants no longer than the maximum it states, and may grant less; absent, it grants its own default. The granted end is `endsAt` in the response.
20
+ */
21
+ durationSeconds?: number;
22
+ ext?: Ext;
23
+ }
24
+ /**
25
+ * The grant: the VTA has stopped collecting for `identifier` and closed every connection it held for it, and the caller is its collector until `endsAt`.
26
+ */
27
+ export interface VTACollectionClaimResponsePayload {
28
+ identifier: Did;
29
+ /**
30
+ * When the claim ends unless renewed. The client stops collecting before this instant less its clock-skew tolerance (VTI-NTF-083).
31
+ */
32
+ endsAt: string;
33
+ /**
34
+ * True when the caller already held a claim for the identifier and this grant moved its end; absent or false for a new claim.
35
+ */
36
+ renewed?: boolean;
37
+ }
38
+
39
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
40
+ export type { ContextId, Did, Ext };
41
+
42
+ /** Trust Task type URI. */
43
+ export const TYPE_URI = "https://trusttasks.org/spec/vta/collection/claim/0.1" as const;
44
+
45
+ /**
46
+ * The earlier version of this specification that this one declares it
47
+ * extends (front matter `extends`, SPEC §5.2 "Declared extension"), or
48
+ * `null`. Only the direct declaration — follow the chain with
49
+ * `extendsChain` / `readForSpec`.
50
+ */
51
+ export const EXTENDS: string | null = null;
52
+
53
+ /**
54
+ * Why this version is deprecated, or `null` while it is current. A
55
+ * superseded or retired version is still supported, and is withdrawn from
56
+ * this package in a later scheduled batch (SPEC "Superseded and Withdrawn
57
+ * Versions").
58
+ */
59
+ export const DEPRECATION: string | null = null;
60
+
61
+ /** Stable alias for this specification's request payload shape. */
62
+ export type Payload = VTACollectionClaimPayload;
63
+
64
+ /** Trust Task response type URI (request type URI + "#response"). */
65
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/collection/claim/0.1#response" as const;
66
+
67
+ /** Stable alias for this specification's success-response payload shape. */
68
+ export type Response = VTACollectionClaimResponsePayload;
69
+
70
+ /**
71
+ * This specification's payload schema, as a value.
72
+ *
73
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
74
+ * rather than only as a `.json` file because TypeScript types are erased
75
+ * at runtime: without a schema a consumer has nothing to validate, and
76
+ * every REQUIRED payload member is optional in practice. Cross-file
77
+ * `$ref`s are already inlined, so it needs no resolver.
78
+ */
79
+ export const PAYLOAD_SCHEMA = {
80
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
81
+ "$id": "https://trusttasks.org/spec/vta/collection/claim/0.1",
82
+ "title": "VTA Collection — Claim — payload",
83
+ "description": "A client with standing in a trust context asks its VTA to make it, until a stated end, the one collector of the messages queued at the mediator for an identifier whose keys the VTA holds there — a persona DID — or renews a claim it already holds. Before it grants, the VTA stops collecting for the identifier and closes every connection it holds for it; the client opens its own only once it holds the grant, and closes it before the claim ends unless it has renewed (VTI-NTF-081 – VTI-NTF-083). The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.",
84
+ "type": "object",
85
+ "additionalProperties": false,
86
+ "required": [
87
+ "contextId",
88
+ "identifier"
89
+ ],
90
+ "properties": {
91
+ "contextId": {
92
+ "$ref": "#/$defs/ContextId"
93
+ },
94
+ "identifier": {
95
+ "$ref": "#/$defs/Did",
96
+ "description": "The identifier to collect for: one whose messaging keys the VTA holds in `contextId` and whose DID document advertises a transport through a mediator."
97
+ },
98
+ "durationSeconds": {
99
+ "type": "integer",
100
+ "minimum": 60,
101
+ "maximum": 2592000,
102
+ "description": "How long the client asks the claim to last from the grant. The VTA grants no longer than the maximum it states, and may grant less; absent, it grants its own default. The granted end is `endsAt` in the response."
103
+ },
104
+ "ext": {
105
+ "$ref": "#/$defs/Ext"
106
+ }
107
+ },
108
+ "$defs": {
109
+ "Response": {
110
+ "$anchor": "response",
111
+ "title": "VTA Collection — Claim — response payload",
112
+ "type": "object",
113
+ "additionalProperties": false,
114
+ "required": [
115
+ "identifier",
116
+ "endsAt"
117
+ ],
118
+ "description": "The grant: the VTA has stopped collecting for `identifier` and closed every connection it held for it, and the caller is its collector until `endsAt`.",
119
+ "properties": {
120
+ "identifier": {
121
+ "$ref": "#/$defs/Did"
122
+ },
123
+ "endsAt": {
124
+ "type": "string",
125
+ "format": "date-time",
126
+ "description": "When the claim ends unless renewed. The client stops collecting before this instant less its clock-skew tolerance (VTI-NTF-083)."
127
+ },
128
+ "renewed": {
129
+ "type": "boolean",
130
+ "description": "True when the caller already held a claim for the identifier and this grant moved its end; absent or false for a new claim."
131
+ }
132
+ }
133
+ },
134
+ "Did": {
135
+ "title": "Did",
136
+ "description": "A DID.",
137
+ "type": "string",
138
+ "minLength": 8,
139
+ "maxLength": 2048,
140
+ "pattern": "^did:[a-z0-9]+:\\S+$"
141
+ },
142
+ "Ext": {
143
+ "title": "Ext",
144
+ "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.",
145
+ "type": "object",
146
+ "minProperties": 1,
147
+ "additionalProperties": true,
148
+ "propertyNames": {
149
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
150
+ }
151
+ },
152
+ "ContextId": {
153
+ "title": "ContextId",
154
+ "description": "The trust context the identifier belongs to.",
155
+ "type": "string",
156
+ "minLength": 1,
157
+ "maxLength": 256
158
+ }
159
+ }
160
+ } as const;
161
+
162
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
163
+ export const RESPONSE_PAYLOAD_SCHEMA = {
164
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
165
+ "$ref": "#/$defs/Response",
166
+ "$defs": {
167
+ "Response": {
168
+ "$anchor": "response",
169
+ "title": "VTA Collection — Claim — response payload",
170
+ "type": "object",
171
+ "additionalProperties": false,
172
+ "required": [
173
+ "identifier",
174
+ "endsAt"
175
+ ],
176
+ "description": "The grant: the VTA has stopped collecting for `identifier` and closed every connection it held for it, and the caller is its collector until `endsAt`.",
177
+ "properties": {
178
+ "identifier": {
179
+ "$ref": "#/$defs/Did"
180
+ },
181
+ "endsAt": {
182
+ "type": "string",
183
+ "format": "date-time",
184
+ "description": "When the claim ends unless renewed. The client stops collecting before this instant less its clock-skew tolerance (VTI-NTF-083)."
185
+ },
186
+ "renewed": {
187
+ "type": "boolean",
188
+ "description": "True when the caller already held a claim for the identifier and this grant moved its end; absent or false for a new claim."
189
+ }
190
+ }
191
+ },
192
+ "Did": {
193
+ "title": "Did",
194
+ "description": "A DID.",
195
+ "type": "string",
196
+ "minLength": 8,
197
+ "maxLength": 2048,
198
+ "pattern": "^did:[a-z0-9]+:\\S+$"
199
+ },
200
+ "Ext": {
201
+ "title": "Ext",
202
+ "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.",
203
+ "type": "object",
204
+ "minProperties": 1,
205
+ "additionalProperties": true,
206
+ "propertyNames": {
207
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
208
+ }
209
+ },
210
+ "ContextId": {
211
+ "title": "ContextId",
212
+ "description": "The trust context the identifier belongs to.",
213
+ "type": "string",
214
+ "minLength": 1,
215
+ "maxLength": 256
216
+ }
217
+ }
218
+ } as const;
219
+
220
+ /**
221
+ * SPEC.md §7.2 policy for the request variant, from this specification's
222
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
223
+ * per-specification and cannot be derived from the document alone, and
224
+ * item 2 needs the schema this carries.
225
+ */
226
+ export const SPEC = {
227
+ typeUri: TYPE_URI,
228
+ isBearer: false,
229
+ isProofRequired: false,
230
+ isRecipientRequired: true,
231
+ isIssuedAtRequired: true,
232
+ payloadSchema: PAYLOAD_SCHEMA,
233
+ } as const;
234
+
235
+ /**
236
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
237
+ * tracks the *issuer* party's requirement because a response swaps the
238
+ * parties (§7.3 item 5).
239
+ */
240
+ export const RESPONSE_SPEC = {
241
+ typeUri: RESPONSE_TYPE_URI,
242
+ isBearer: false,
243
+ isProofRequired: false,
244
+ isRecipientRequired: true,
245
+ isIssuedAtRequired: true,
246
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
247
+ } as const;