@openvtc/trust-tasks 0.19.10 → 0.19.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.
@@ -0,0 +1,199 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vtc/join-requests/withdraw/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { Ext } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * What an applicant sends to close their own open join request. Every member is optional: the authenticated issuer identifies the applicant, and a community that allows at most one open request per applicant can resolve the request from that alone. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.
11
+ */
12
+ export interface VTCJoinRequestsWithdrawPayload {
13
+ /**
14
+ * The request to withdraw. Optional: an applicant whose submit response was lost never received an id, and the id-less form — resolved from the authenticated applicant's own identifier — is the only one available to them. Supply it when you have it; a consumer that has it MUST prefer it over inferring the request from the caller.
15
+ */
16
+ requestId?: string;
17
+ /**
18
+ * Free text for the humans who will read the community's record of this withdrawal — a vetter who attested, or a maintainer mid-review. A consumer MUST NOT interpret it or branch on its content. A producer MUST NOT put credentials, secrets, or personal data about anyone other than the applicant into it.
19
+ */
20
+ reason?: string;
21
+ ext?: Ext;
22
+ }
23
+ /**
24
+ * Confirms which request was closed. Failures use trust-task-error, not this shape.
25
+ */
26
+ export interface VTCJoinRequestsWithdrawResponsePayload {
27
+ /**
28
+ * The request that was withdrawn. Returned even when the request omitted it, so an applicant who used the id-less form learns which request they closed.
29
+ */
30
+ requestId: string;
31
+ /**
32
+ * The request's state after the withdrawal. Always `withdrawn`; returned rather than implied so the response is self-describing to a reader holding only this document.
33
+ */
34
+ status: "withdrawn";
35
+ ext?: Ext;
36
+ }
37
+
38
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
39
+ export type { Ext };
40
+
41
+ /** Trust Task type URI. */
42
+ export const TYPE_URI = "https://trusttasks.org/spec/vtc/join-requests/withdraw/0.1" as const;
43
+
44
+ /** Stable alias for this specification's request payload shape. */
45
+ export type Payload = VTCJoinRequestsWithdrawPayload;
46
+
47
+ /** Trust Task response type URI (request type URI + "#response"). */
48
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/join-requests/withdraw/0.1#response" as const;
49
+
50
+ /** Stable alias for this specification's success-response payload shape. */
51
+ export type Response = VTCJoinRequestsWithdrawResponsePayload;
52
+
53
+ /**
54
+ * This specification's payload schema, as a value.
55
+ *
56
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
57
+ * rather than only as a `.json` file because TypeScript types are erased
58
+ * at runtime: without a schema a consumer has nothing to validate, and
59
+ * every REQUIRED payload member is optional in practice. Cross-file
60
+ * `$ref`s are already inlined, so it needs no resolver.
61
+ */
62
+ export const PAYLOAD_SCHEMA = {
63
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
64
+ "$id": "https://trusttasks.org/spec/vtc/join-requests/withdraw/0.1",
65
+ "title": "VTC Join-Requests — Withdraw — payload",
66
+ "description": "What an applicant sends to close their own open join request. Every member is optional: the authenticated issuer identifies the applicant, and a community that allows at most one open request per applicant can resolve the request from that alone. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.",
67
+ "type": "object",
68
+ "additionalProperties": false,
69
+ "properties": {
70
+ "requestId": {
71
+ "type": "string",
72
+ "minLength": 1,
73
+ "description": "The request to withdraw. Optional: an applicant whose submit response was lost never received an id, and the id-less form — resolved from the authenticated applicant's own identifier — is the only one available to them. Supply it when you have it; a consumer that has it MUST prefer it over inferring the request from the caller."
74
+ },
75
+ "reason": {
76
+ "type": "string",
77
+ "maxLength": 1024,
78
+ "description": "Free text for the humans who will read the community's record of this withdrawal — a vetter who attested, or a maintainer mid-review. A consumer MUST NOT interpret it or branch on its content. A producer MUST NOT put credentials, secrets, or personal data about anyone other than the applicant into it."
79
+ },
80
+ "ext": {
81
+ "$ref": "#/$defs/Ext"
82
+ }
83
+ },
84
+ "$defs": {
85
+ "Response": {
86
+ "$anchor": "response",
87
+ "title": "VTC Join-Requests — Withdraw — response payload",
88
+ "type": "object",
89
+ "additionalProperties": false,
90
+ "required": [
91
+ "requestId",
92
+ "status"
93
+ ],
94
+ "description": "Confirms which request was closed. Failures use trust-task-error, not this shape.",
95
+ "properties": {
96
+ "requestId": {
97
+ "type": "string",
98
+ "minLength": 1,
99
+ "description": "The request that was withdrawn. Returned even when the request omitted it, so an applicant who used the id-less form learns which request they closed."
100
+ },
101
+ "status": {
102
+ "type": "string",
103
+ "enum": [
104
+ "withdrawn"
105
+ ],
106
+ "description": "The request's state after the withdrawal. Always `withdrawn`; returned rather than implied so the response is self-describing to a reader holding only this document."
107
+ },
108
+ "ext": {
109
+ "$ref": "#/$defs/Ext"
110
+ }
111
+ }
112
+ },
113
+ "Ext": {
114
+ "title": "Ext",
115
+ "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.",
116
+ "type": "object",
117
+ "minProperties": 1,
118
+ "additionalProperties": true,
119
+ "propertyNames": {
120
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
121
+ }
122
+ }
123
+ }
124
+ } as const;
125
+
126
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
127
+ export const RESPONSE_PAYLOAD_SCHEMA = {
128
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
129
+ "$ref": "#/$defs/Response",
130
+ "$defs": {
131
+ "Response": {
132
+ "$anchor": "response",
133
+ "title": "VTC Join-Requests — Withdraw — response payload",
134
+ "type": "object",
135
+ "additionalProperties": false,
136
+ "required": [
137
+ "requestId",
138
+ "status"
139
+ ],
140
+ "description": "Confirms which request was closed. Failures use trust-task-error, not this shape.",
141
+ "properties": {
142
+ "requestId": {
143
+ "type": "string",
144
+ "minLength": 1,
145
+ "description": "The request that was withdrawn. Returned even when the request omitted it, so an applicant who used the id-less form learns which request they closed."
146
+ },
147
+ "status": {
148
+ "type": "string",
149
+ "enum": [
150
+ "withdrawn"
151
+ ],
152
+ "description": "The request's state after the withdrawal. Always `withdrawn`; returned rather than implied so the response is self-describing to a reader holding only this document."
153
+ },
154
+ "ext": {
155
+ "$ref": "#/$defs/Ext"
156
+ }
157
+ }
158
+ },
159
+ "Ext": {
160
+ "title": "Ext",
161
+ "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.",
162
+ "type": "object",
163
+ "minProperties": 1,
164
+ "additionalProperties": true,
165
+ "propertyNames": {
166
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
167
+ }
168
+ }
169
+ }
170
+ } as const;
171
+
172
+ /**
173
+ * SPEC.md §7.2 policy for the request variant, from this specification's
174
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
175
+ * per-specification and cannot be derived from the document alone, and
176
+ * item 2 needs the schema this carries.
177
+ */
178
+ export const SPEC = {
179
+ typeUri: TYPE_URI,
180
+ isBearer: false,
181
+ isProofRequired: true,
182
+ isRecipientRequired: true,
183
+ isIssuedAtRequired: true,
184
+ payloadSchema: PAYLOAD_SCHEMA,
185
+ } as const;
186
+
187
+ /**
188
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
189
+ * tracks the *issuer* party's requirement because a response swaps the
190
+ * parties (§7.3 item 5).
191
+ */
192
+ export const RESPONSE_SPEC = {
193
+ typeUri: RESPONSE_TYPE_URI,
194
+ isBearer: false,
195
+ isProofRequired: false,
196
+ isRecipientRequired: true,
197
+ isIssuedAtRequired: true,
198
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
199
+ } as const;