@openvtc/trust-tasks 0.10.0 → 0.12.0

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 (51) hide show
  1. package/dist/index.d.ts +9 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +9 -0
  4. package/dist/index.js.map +1 -1
  5. package/dist/vta/_shared/0.1/service.d.ts +11 -0
  6. package/dist/vta/_shared/0.1/service.d.ts.map +1 -0
  7. package/dist/vta/_shared/0.1/service.js +6 -0
  8. package/dist/vta/_shared/0.1/service.js.map +1 -0
  9. package/dist/vta/services/disable/1.0/payload.d.ts +452 -0
  10. package/dist/vta/services/disable/1.0/payload.d.ts.map +1 -0
  11. package/dist/vta/services/disable/1.0/payload.js +240 -0
  12. package/dist/vta/services/disable/1.0/payload.js.map +1 -0
  13. package/dist/vta/services/drain/cancel/1.0/payload.d.ts +234 -0
  14. package/dist/vta/services/drain/cancel/1.0/payload.d.ts.map +1 -0
  15. package/dist/vta/services/drain/cancel/1.0/payload.js +131 -0
  16. package/dist/vta/services/drain/cancel/1.0/payload.js.map +1 -0
  17. package/dist/vta/services/drain/list/1.0/payload.d.ts +352 -0
  18. package/dist/vta/services/drain/list/1.0/payload.d.ts.map +1 -0
  19. package/dist/vta/services/drain/list/1.0/payload.js +189 -0
  20. package/dist/vta/services/drain/list/1.0/payload.js.map +1 -0
  21. package/dist/vta/services/enable/1.0/payload.d.ts +511 -0
  22. package/dist/vta/services/enable/1.0/payload.d.ts.map +1 -0
  23. package/dist/vta/services/enable/1.0/payload.js +262 -0
  24. package/dist/vta/services/enable/1.0/payload.js.map +1 -0
  25. package/dist/vta/services/get/1.0/payload.d.ts +399 -0
  26. package/dist/vta/services/get/1.0/payload.d.ts.map +1 -0
  27. package/dist/vta/services/get/1.0/payload.js +219 -0
  28. package/dist/vta/services/get/1.0/payload.js.map +1 -0
  29. package/dist/vta/services/list/1.0/payload.d.ts +409 -0
  30. package/dist/vta/services/list/1.0/payload.d.ts.map +1 -0
  31. package/dist/vta/services/list/1.0/payload.js +221 -0
  32. package/dist/vta/services/list/1.0/payload.js.map +1 -0
  33. package/dist/vta/services/rollback/1.0/payload.d.ts +458 -0
  34. package/dist/vta/services/rollback/1.0/payload.d.ts.map +1 -0
  35. package/dist/vta/services/rollback/1.0/payload.js +251 -0
  36. package/dist/vta/services/rollback/1.0/payload.js.map +1 -0
  37. package/dist/vta/services/update/1.0/payload.d.ts +511 -0
  38. package/dist/vta/services/update/1.0/payload.d.ts.map +1 -0
  39. package/dist/vta/services/update/1.0/payload.js +262 -0
  40. package/dist/vta/services/update/1.0/payload.js.map +1 -0
  41. package/package.json +1 -1
  42. package/src/index.ts +9 -0
  43. package/src/vta/_shared/0.1/service.ts +11 -0
  44. package/src/vta/services/disable/1.0/payload.ts +311 -0
  45. package/src/vta/services/drain/cancel/1.0/payload.ts +169 -0
  46. package/src/vta/services/drain/list/1.0/payload.ts +241 -0
  47. package/src/vta/services/enable/1.0/payload.ts +350 -0
  48. package/src/vta/services/get/1.0/payload.ts +279 -0
  49. package/src/vta/services/list/1.0/payload.ts +283 -0
  50. package/src/vta/services/rollback/1.0/payload.ts +322 -0
  51. package/src/vta/services/update/1.0/payload.ts +350 -0
@@ -0,0 +1,169 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vta/services/drain/cancel/1.0/payload.schema.json
4
+ */
5
+
6
+ /**
7
+ * Request payload for vta/services/drain/cancel. Ends a drain early, dropping the mediator now instead of at `drainsUntil`. Messages still in flight through it are lost, which is the whole reason the drain window existed.
8
+ */
9
+ export interface VTAServicesDrainCancelPayload {
10
+ /**
11
+ * The draining mediator to drop. Refused if it is not draining, and refused if it is the currently advertised mediator — cancelling a drain on the active mediator would strand every route the agent depends on.
12
+ */
13
+ mediatorDid: string;
14
+ ext?: Ext;
15
+ }
16
+ /**
17
+ * 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.
18
+ */
19
+ export interface Ext {
20
+ [k: string]: unknown | undefined;
21
+ }
22
+ /**
23
+ * Success response to vta/services/drain/cancel. Type https://trusttasks.org/spec/vta/services/drain/cancel/1.0#response.
24
+ */
25
+ export interface VTAServicesDrainCancelResponsePayload {
26
+ /**
27
+ * The mediator that was dropped.
28
+ */
29
+ mediatorDid: string;
30
+ ext?: Ext;
31
+ }
32
+
33
+ /** Trust Task type URI. */
34
+ export const TYPE_URI = "https://trusttasks.org/spec/vta/services/drain/cancel/1.0" as const;
35
+
36
+ /** Stable alias for this specification's request payload shape. */
37
+ export type Payload = VTAServicesDrainCancelPayload;
38
+
39
+ /** Trust Task response type URI (request type URI + "#response"). */
40
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/services/drain/cancel/1.0#response" as const;
41
+
42
+ /** Stable alias for this specification's success-response payload shape. */
43
+ export type Response = VTAServicesDrainCancelResponsePayload;
44
+
45
+ /**
46
+ * This specification's payload schema, as a value.
47
+ *
48
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
49
+ * rather than only as a `.json` file because TypeScript types are erased
50
+ * at runtime: without a schema a consumer has nothing to validate, and
51
+ * every REQUIRED payload member is optional in practice. Cross-file
52
+ * `$ref`s are already inlined, so it needs no resolver.
53
+ */
54
+ export const PAYLOAD_SCHEMA = {
55
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
56
+ "$id": "https://trusttasks.org/spec/vta/services/drain/cancel/1.0",
57
+ "title": "VTA Services Drain — Cancel — payload",
58
+ "description": "Request payload for vta/services/drain/cancel. Ends a drain early, dropping the mediator now instead of at `drainsUntil`. Messages still in flight through it are lost, which is the whole reason the drain window existed.",
59
+ "type": "object",
60
+ "additionalProperties": false,
61
+ "required": [
62
+ "mediatorDid"
63
+ ],
64
+ "properties": {
65
+ "mediatorDid": {
66
+ "type": "string",
67
+ "minLength": 1,
68
+ "description": "The draining mediator to drop. Refused if it is not draining, and refused if it is the currently advertised mediator — cancelling a drain on the active mediator would strand every route the agent depends on."
69
+ },
70
+ "ext": {
71
+ "$ref": "#/$defs/Ext"
72
+ }
73
+ },
74
+ "$defs": {
75
+ "Response": {
76
+ "$anchor": "response",
77
+ "title": "VTA Services Drain — Cancel — response payload",
78
+ "description": "Success response to vta/services/drain/cancel. Type https://trusttasks.org/spec/vta/services/drain/cancel/1.0#response.",
79
+ "type": "object",
80
+ "additionalProperties": false,
81
+ "required": [
82
+ "mediatorDid"
83
+ ],
84
+ "properties": {
85
+ "mediatorDid": {
86
+ "type": "string",
87
+ "description": "The mediator that was dropped."
88
+ },
89
+ "ext": {
90
+ "$ref": "#/$defs/Ext"
91
+ }
92
+ }
93
+ },
94
+ "Ext": {
95
+ "title": "Ext",
96
+ "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.",
97
+ "type": "object",
98
+ "minProperties": 1,
99
+ "additionalProperties": true,
100
+ "propertyNames": {
101
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
102
+ }
103
+ }
104
+ }
105
+ } as const;
106
+
107
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
108
+ export const RESPONSE_PAYLOAD_SCHEMA = {
109
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
110
+ "$ref": "#/$defs/Response",
111
+ "$defs": {
112
+ "Response": {
113
+ "$anchor": "response",
114
+ "title": "VTA Services Drain — Cancel — response payload",
115
+ "description": "Success response to vta/services/drain/cancel. Type https://trusttasks.org/spec/vta/services/drain/cancel/1.0#response.",
116
+ "type": "object",
117
+ "additionalProperties": false,
118
+ "required": [
119
+ "mediatorDid"
120
+ ],
121
+ "properties": {
122
+ "mediatorDid": {
123
+ "type": "string",
124
+ "description": "The mediator that was dropped."
125
+ },
126
+ "ext": {
127
+ "$ref": "#/$defs/Ext"
128
+ }
129
+ }
130
+ },
131
+ "Ext": {
132
+ "title": "Ext",
133
+ "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.",
134
+ "type": "object",
135
+ "minProperties": 1,
136
+ "additionalProperties": true,
137
+ "propertyNames": {
138
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
139
+ }
140
+ }
141
+ }
142
+ } as const;
143
+
144
+ /**
145
+ * SPEC.md §7.2 policy for the request variant, from this specification's
146
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
147
+ * per-specification and cannot be derived from the document alone, and
148
+ * item 2 needs the schema this carries.
149
+ */
150
+ export const SPEC = {
151
+ typeUri: TYPE_URI,
152
+ isBearer: false,
153
+ isProofRequired: true,
154
+ isRecipientRequired: true,
155
+ payloadSchema: PAYLOAD_SCHEMA,
156
+ } as const;
157
+
158
+ /**
159
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
160
+ * tracks the *issuer* party's requirement because a response swaps the
161
+ * parties (§7.3 item 5).
162
+ */
163
+ export const RESPONSE_SPEC = {
164
+ typeUri: RESPONSE_TYPE_URI,
165
+ isBearer: false,
166
+ isProofRequired: true,
167
+ isRecipientRequired: true,
168
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
169
+ } as const;
@@ -0,0 +1,241 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vta/services/drain/list/1.0/payload.schema.json
4
+ */
5
+
6
+ /**
7
+ * Request payload for vta/services/drain/list. Enumerates DIDComm mediators that are no longer advertised but are still accepting delivery.
8
+ */
9
+ export interface VTAServicesDrainListPayload {
10
+ ext?: Ext;
11
+ }
12
+ /**
13
+ * 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.
14
+ */
15
+ export interface Ext {
16
+ [k: string]: unknown | undefined;
17
+ }
18
+ /**
19
+ * Success response to vta/services/drain/list. Type https://trusttasks.org/spec/vta/services/drain/list/1.0#response.
20
+ */
21
+ export interface VTAServicesDrainListResponsePayload {
22
+ /**
23
+ * Mediators currently draining. An empty array means nothing is draining — which is the ordinary state, not an error.
24
+ */
25
+ entries: DrainEntry[];
26
+ ext?: Ext;
27
+ }
28
+ /**
29
+ * A DIDComm mediator that is no longer advertised but is still accepting delivery, so in-flight messages routed through it are not stranded.
30
+ */
31
+ export interface DrainEntry {
32
+ /**
33
+ * The mediator being drained.
34
+ */
35
+ mediatorDid: string;
36
+ /**
37
+ * Where it is still reachable for the remainder of the drain.
38
+ */
39
+ endpoint: string;
40
+ /**
41
+ * RFC 3339 instant after which the mediator is dropped and messages routed through it are lost.
42
+ */
43
+ drainsUntil: string;
44
+ ext?: Ext;
45
+ }
46
+
47
+ /** Trust Task type URI. */
48
+ export const TYPE_URI = "https://trusttasks.org/spec/vta/services/drain/list/1.0" as const;
49
+
50
+ /** Stable alias for this specification's request payload shape. */
51
+ export type Payload = VTAServicesDrainListPayload;
52
+
53
+ /** Trust Task response type URI (request type URI + "#response"). */
54
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/services/drain/list/1.0#response" as const;
55
+
56
+ /** Stable alias for this specification's success-response payload shape. */
57
+ export type Response = VTAServicesDrainListResponsePayload;
58
+
59
+ /**
60
+ * This specification's payload schema, as a value.
61
+ *
62
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
63
+ * rather than only as a `.json` file because TypeScript types are erased
64
+ * at runtime: without a schema a consumer has nothing to validate, and
65
+ * every REQUIRED payload member is optional in practice. Cross-file
66
+ * `$ref`s are already inlined, so it needs no resolver.
67
+ */
68
+ export const PAYLOAD_SCHEMA = {
69
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
70
+ "$id": "https://trusttasks.org/spec/vta/services/drain/list/1.0",
71
+ "title": "VTA Services Drain — List — payload",
72
+ "description": "Request payload for vta/services/drain/list. Enumerates DIDComm mediators that are no longer advertised but are still accepting delivery.",
73
+ "type": "object",
74
+ "additionalProperties": false,
75
+ "properties": {
76
+ "ext": {
77
+ "$ref": "#/$defs/Ext"
78
+ }
79
+ },
80
+ "$defs": {
81
+ "Response": {
82
+ "$anchor": "response",
83
+ "title": "VTA Services Drain — List — response payload",
84
+ "description": "Success response to vta/services/drain/list. Type https://trusttasks.org/spec/vta/services/drain/list/1.0#response.",
85
+ "type": "object",
86
+ "additionalProperties": false,
87
+ "required": [
88
+ "entries"
89
+ ],
90
+ "properties": {
91
+ "entries": {
92
+ "type": "array",
93
+ "description": "Mediators currently draining. An empty array means nothing is draining — which is the ordinary state, not an error.",
94
+ "items": {
95
+ "$ref": "#/$defs/DrainEntry"
96
+ }
97
+ },
98
+ "ext": {
99
+ "$ref": "#/$defs/Ext"
100
+ }
101
+ }
102
+ },
103
+ "Ext": {
104
+ "title": "Ext",
105
+ "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.",
106
+ "type": "object",
107
+ "minProperties": 1,
108
+ "additionalProperties": true,
109
+ "propertyNames": {
110
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
111
+ }
112
+ },
113
+ "DrainEntry": {
114
+ "title": "DrainEntry",
115
+ "description": "A DIDComm mediator that is no longer advertised but is still accepting delivery, so in-flight messages routed through it are not stranded.",
116
+ "type": "object",
117
+ "additionalProperties": false,
118
+ "required": [
119
+ "mediatorDid",
120
+ "endpoint",
121
+ "drainsUntil"
122
+ ],
123
+ "properties": {
124
+ "mediatorDid": {
125
+ "type": "string",
126
+ "minLength": 1,
127
+ "description": "The mediator being drained."
128
+ },
129
+ "endpoint": {
130
+ "type": "string",
131
+ "description": "Where it is still reachable for the remainder of the drain."
132
+ },
133
+ "drainsUntil": {
134
+ "type": "string",
135
+ "format": "date-time",
136
+ "description": "RFC 3339 instant after which the mediator is dropped and messages routed through it are lost."
137
+ },
138
+ "ext": {
139
+ "$ref": "#/$defs/Ext"
140
+ }
141
+ }
142
+ }
143
+ }
144
+ } as const;
145
+
146
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
147
+ export const RESPONSE_PAYLOAD_SCHEMA = {
148
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
149
+ "$ref": "#/$defs/Response",
150
+ "$defs": {
151
+ "Response": {
152
+ "$anchor": "response",
153
+ "title": "VTA Services Drain — List — response payload",
154
+ "description": "Success response to vta/services/drain/list. Type https://trusttasks.org/spec/vta/services/drain/list/1.0#response.",
155
+ "type": "object",
156
+ "additionalProperties": false,
157
+ "required": [
158
+ "entries"
159
+ ],
160
+ "properties": {
161
+ "entries": {
162
+ "type": "array",
163
+ "description": "Mediators currently draining. An empty array means nothing is draining — which is the ordinary state, not an error.",
164
+ "items": {
165
+ "$ref": "#/$defs/DrainEntry"
166
+ }
167
+ },
168
+ "ext": {
169
+ "$ref": "#/$defs/Ext"
170
+ }
171
+ }
172
+ },
173
+ "Ext": {
174
+ "title": "Ext",
175
+ "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.",
176
+ "type": "object",
177
+ "minProperties": 1,
178
+ "additionalProperties": true,
179
+ "propertyNames": {
180
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
181
+ }
182
+ },
183
+ "DrainEntry": {
184
+ "title": "DrainEntry",
185
+ "description": "A DIDComm mediator that is no longer advertised but is still accepting delivery, so in-flight messages routed through it are not stranded.",
186
+ "type": "object",
187
+ "additionalProperties": false,
188
+ "required": [
189
+ "mediatorDid",
190
+ "endpoint",
191
+ "drainsUntil"
192
+ ],
193
+ "properties": {
194
+ "mediatorDid": {
195
+ "type": "string",
196
+ "minLength": 1,
197
+ "description": "The mediator being drained."
198
+ },
199
+ "endpoint": {
200
+ "type": "string",
201
+ "description": "Where it is still reachable for the remainder of the drain."
202
+ },
203
+ "drainsUntil": {
204
+ "type": "string",
205
+ "format": "date-time",
206
+ "description": "RFC 3339 instant after which the mediator is dropped and messages routed through it are lost."
207
+ },
208
+ "ext": {
209
+ "$ref": "#/$defs/Ext"
210
+ }
211
+ }
212
+ }
213
+ }
214
+ } as const;
215
+
216
+ /**
217
+ * SPEC.md §7.2 policy for the request variant, from this specification's
218
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
219
+ * per-specification and cannot be derived from the document alone, and
220
+ * item 2 needs the schema this carries.
221
+ */
222
+ export const SPEC = {
223
+ typeUri: TYPE_URI,
224
+ isBearer: false,
225
+ isProofRequired: false,
226
+ isRecipientRequired: true,
227
+ payloadSchema: PAYLOAD_SCHEMA,
228
+ } as const;
229
+
230
+ /**
231
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
232
+ * tracks the *issuer* party's requirement because a response swaps the
233
+ * parties (§7.3 item 5).
234
+ */
235
+ export const RESPONSE_SPEC = {
236
+ typeUri: RESPONSE_TYPE_URI,
237
+ isBearer: false,
238
+ isProofRequired: false,
239
+ isRecipientRequired: true,
240
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
241
+ } as const;