@openvtc/trust-tasks 0.20.1 → 0.20.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/CHANGELOG.md +110 -0
- package/dist/_shared/components.d.ts +175 -0
- package/dist/_shared/components.d.ts.map +1 -1
- package/dist/git-ns/_shared/0.1/git-ns.d.ts +16 -0
- package/dist/git-ns/_shared/0.1/git-ns.d.ts.map +1 -0
- package/dist/git-ns/_shared/0.1/git-ns.js +6 -0
- package/dist/git-ns/_shared/0.1/git-ns.js.map +1 -0
- package/dist/git-ns/account/link/0.1/payload.d.ts +355 -0
- package/dist/git-ns/account/link/0.1/payload.d.ts.map +1 -0
- package/dist/git-ns/account/link/0.1/payload.js +192 -0
- package/dist/git-ns/account/link/0.1/payload.js.map +1 -0
- package/dist/git-ns/account/link-status/0.1/payload.d.ts +403 -0
- package/dist/git-ns/account/link-status/0.1/payload.d.ts.map +1 -0
- package/dist/git-ns/account/link-status/0.1/payload.js +234 -0
- package/dist/git-ns/account/link-status/0.1/payload.js.map +1 -0
- package/dist/git-ns/bridge/event/0.1/payload.d.ts +1348 -0
- package/dist/git-ns/bridge/event/0.1/payload.d.ts.map +1 -0
- package/dist/git-ns/bridge/event/0.1/payload.js +785 -0
- package/dist/git-ns/bridge/event/0.1/payload.js.map +1 -0
- package/dist/git-ns/bridge/job/0.1/payload.d.ts +1044 -0
- package/dist/git-ns/bridge/job/0.1/payload.d.ts.map +1 -0
- package/dist/git-ns/bridge/job/0.1/payload.js +564 -0
- package/dist/git-ns/bridge/job/0.1/payload.js.map +1 -0
- package/dist/git-ns/bridge/result/0.1/payload.d.ts +462 -0
- package/dist/git-ns/bridge/result/0.1/payload.d.ts.map +1 -0
- package/dist/git-ns/bridge/result/0.1/payload.js +248 -0
- package/dist/git-ns/bridge/result/0.1/payload.js.map +1 -0
- package/dist/git-ns/namespace/bind/0.1/payload.d.ts +547 -0
- package/dist/git-ns/namespace/bind/0.1/payload.d.ts.map +1 -0
- package/dist/git-ns/namespace/bind/0.1/payload.js +322 -0
- package/dist/git-ns/namespace/bind/0.1/payload.js.map +1 -0
- package/dist/git-ns/namespace/unbind/0.1/payload.d.ts +300 -0
- package/dist/git-ns/namespace/unbind/0.1/payload.d.ts.map +1 -0
- package/dist/git-ns/namespace/unbind/0.1/payload.js +168 -0
- package/dist/git-ns/namespace/unbind/0.1/payload.js.map +1 -0
- package/dist/git-ns/repo/adopt/0.1/payload.d.ts +962 -0
- package/dist/git-ns/repo/adopt/0.1/payload.d.ts.map +1 -0
- package/dist/git-ns/repo/adopt/0.1/payload.js +583 -0
- package/dist/git-ns/repo/adopt/0.1/payload.js.map +1 -0
- package/dist/git-ns/repo/archive/0.1/payload.d.ts +959 -0
- package/dist/git-ns/repo/archive/0.1/payload.d.ts.map +1 -0
- package/dist/git-ns/repo/archive/0.1/payload.js +584 -0
- package/dist/git-ns/repo/archive/0.1/payload.js.map +1 -0
- package/dist/git-ns/repo/create/0.1/payload.d.ts +1074 -0
- package/dist/git-ns/repo/create/0.1/payload.d.ts.map +1 -0
- package/dist/git-ns/repo/create/0.1/payload.js +636 -0
- package/dist/git-ns/repo/create/0.1/payload.js.map +1 -0
- package/dist/git-ns/repo/transfer/0.1/payload.d.ts +947 -0
- package/dist/git-ns/repo/transfer/0.1/payload.d.ts.map +1 -0
- package/dist/git-ns/repo/transfer/0.1/payload.js +577 -0
- package/dist/git-ns/repo/transfer/0.1/payload.js.map +1 -0
- package/dist/git-ns/right/grant/0.1/payload.d.ts +506 -0
- package/dist/git-ns/right/grant/0.1/payload.d.ts.map +1 -0
- package/dist/git-ns/right/grant/0.1/payload.js +289 -0
- package/dist/git-ns/right/grant/0.1/payload.js.map +1 -0
- package/dist/git-ns/right/revoke/0.1/payload.d.ts +492 -0
- package/dist/git-ns/right/revoke/0.1/payload.d.ts.map +1 -0
- package/dist/git-ns/right/revoke/0.1/payload.js +284 -0
- package/dist/git-ns/right/revoke/0.1/payload.js.map +1 -0
- package/dist/git-ns/view/0.1/payload.d.ts +1407 -0
- package/dist/git-ns/view/0.1/payload.d.ts.map +1 -0
- package/dist/git-ns/view/0.1/payload.js +860 -0
- package/dist/git-ns/view/0.1/payload.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -1
- package/dist/vetting/attestation/0.1/payload.d.ts +690 -0
- package/dist/vetting/attestation/0.1/payload.d.ts.map +1 -0
- package/dist/vetting/attestation/0.1/payload.js +374 -0
- package/dist/vetting/attestation/0.1/payload.js.map +1 -0
- package/dist/vtc/vetting/pcs-challenge/0.1/payload.d.ts +261 -0
- package/dist/vtc/vetting/pcs-challenge/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/vetting/pcs-challenge/0.1/payload.js +145 -0
- package/dist/vtc/vetting/pcs-challenge/0.1/payload.js.map +1 -0
- package/dist/vtc/vetting/vetters/event-mode/0.1/payload.d.ts +546 -0
- package/dist/vtc/vetting/vetters/event-mode/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/vetting/vetters/event-mode/0.1/payload.js +290 -0
- package/dist/vtc/vetting/vetters/event-mode/0.1/payload.js.map +1 -0
- package/dist/vtc/vetting/vetters/pcs-root/0.1/payload.d.ts +336 -0
- package/dist/vtc/vetting/vetters/pcs-root/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/vetting/vetters/pcs-root/0.1/payload.js +178 -0
- package/dist/vtc/vetting/vetters/pcs-root/0.1/payload.js.map +1 -0
- package/dist/vtc/vetting/vetters/pcs-tokens/0.1/payload.d.ts +402 -0
- package/dist/vtc/vetting/vetters/pcs-tokens/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/vetting/vetters/pcs-tokens/0.1/payload.js +205 -0
- package/dist/vtc/vetting/vetters/pcs-tokens/0.1/payload.js.map +1 -0
- package/package.json +1 -1
- package/src/_shared/components.ts +181 -0
- package/src/git-ns/_shared/0.1/git-ns.ts +17 -0
- package/src/git-ns/account/link/0.1/payload.ts +242 -0
- package/src/git-ns/account/link-status/0.1/payload.ts +276 -0
- package/src/git-ns/bridge/event/0.1/payload.ts +902 -0
- package/src/git-ns/bridge/job/0.1/payload.ts +676 -0
- package/src/git-ns/bridge/result/0.1/payload.ts +321 -0
- package/src/git-ns/namespace/bind/0.1/payload.ts +374 -0
- package/src/git-ns/namespace/unbind/0.1/payload.ts +211 -0
- package/src/git-ns/repo/adopt/0.1/payload.ts +628 -0
- package/src/git-ns/repo/archive/0.1/payload.ts +626 -0
- package/src/git-ns/repo/create/0.1/payload.ts +689 -0
- package/src/git-ns/repo/transfer/0.1/payload.ts +619 -0
- package/src/git-ns/right/grant/0.1/payload.ts +340 -0
- package/src/git-ns/right/revoke/0.1/payload.ts +331 -0
- package/src/git-ns/view/0.1/payload.ts +906 -0
- package/src/index.ts +20 -0
- package/src/vetting/attestation/0.1/payload.ts +493 -0
- package/src/vtc/vetting/pcs-challenge/0.1/payload.ts +187 -0
- package/src/vtc/vetting/vetters/event-mode/0.1/payload.ts +375 -0
- package/src/vtc/vetting/vetters/pcs-root/0.1/payload.ts +241 -0
- package/src/vtc/vetting/vetters/pcs-tokens/0.1/payload.ts +286 -0
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vtc/vetting/pcs-challenge/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { Ext } from "../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* An applicant asks the community for the single-use challenge its hidden-vetting proof must be bound to. The community issues one per applicant and spends it when the proof is counted, so a proof cannot be submitted twice.
|
|
11
|
+
*/
|
|
12
|
+
export interface VTCVettingPCSChallengePayload {
|
|
13
|
+
/**
|
|
14
|
+
* OPTIONAL. The `id` of the admission criterion the coming submission answers. A community running one hidden-vetting criterion needs no hint; one running several may use it to refuse early rather than at submit.
|
|
15
|
+
*/
|
|
16
|
+
criterionId?: string;
|
|
17
|
+
ext?: Ext;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The challenge, and when it stops being accepted.
|
|
21
|
+
*/
|
|
22
|
+
export interface VTCVettingPCSChallengeResponsePayload {
|
|
23
|
+
/**
|
|
24
|
+
* Lowercase hex, 16 bytes. Compared for equality and never parsed; the applicant binds it into the proof's context.
|
|
25
|
+
*/
|
|
26
|
+
challenge: string;
|
|
27
|
+
/**
|
|
28
|
+
* After this instant the challenge is refused. A submission that misses it asks for another.
|
|
29
|
+
*/
|
|
30
|
+
expiresAt: string;
|
|
31
|
+
ext?: Ext;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
35
|
+
export type { Ext };
|
|
36
|
+
|
|
37
|
+
/** Trust Task type URI. */
|
|
38
|
+
export const TYPE_URI = "https://trusttasks.org/spec/vtc/vetting/pcs-challenge/0.1" as const;
|
|
39
|
+
|
|
40
|
+
/** Stable alias for this specification's request payload shape. */
|
|
41
|
+
export type Payload = VTCVettingPCSChallengePayload;
|
|
42
|
+
|
|
43
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
44
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/vetting/pcs-challenge/0.1#response" as const;
|
|
45
|
+
|
|
46
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
47
|
+
export type Response = VTCVettingPCSChallengeResponsePayload;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* This specification's payload schema, as a value.
|
|
51
|
+
*
|
|
52
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
53
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
54
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
55
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
56
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
57
|
+
*/
|
|
58
|
+
export const PAYLOAD_SCHEMA = {
|
|
59
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
60
|
+
"$id": "https://trusttasks.org/spec/vtc/vetting/pcs-challenge/0.1",
|
|
61
|
+
"title": "VTC — Vetting PCS Challenge — payload",
|
|
62
|
+
"description": "An applicant asks the community for the single-use challenge its hidden-vetting proof must be bound to. The community issues one per applicant and spends it when the proof is counted, so a proof cannot be submitted twice.",
|
|
63
|
+
"type": "object",
|
|
64
|
+
"additionalProperties": false,
|
|
65
|
+
"properties": {
|
|
66
|
+
"criterionId": {
|
|
67
|
+
"type": "string",
|
|
68
|
+
"minLength": 1,
|
|
69
|
+
"maxLength": 128,
|
|
70
|
+
"description": "OPTIONAL. The `id` of the admission criterion the coming submission answers. A community running one hidden-vetting criterion needs no hint; one running several may use it to refuse early rather than at submit."
|
|
71
|
+
},
|
|
72
|
+
"ext": {
|
|
73
|
+
"$ref": "#/$defs/Ext"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"$defs": {
|
|
77
|
+
"Response": {
|
|
78
|
+
"$anchor": "response",
|
|
79
|
+
"title": "VTC Vetting PCS Challenge — response payload",
|
|
80
|
+
"type": "object",
|
|
81
|
+
"additionalProperties": false,
|
|
82
|
+
"required": [
|
|
83
|
+
"challenge",
|
|
84
|
+
"expiresAt"
|
|
85
|
+
],
|
|
86
|
+
"description": "The challenge, and when it stops being accepted.",
|
|
87
|
+
"properties": {
|
|
88
|
+
"challenge": {
|
|
89
|
+
"type": "string",
|
|
90
|
+
"pattern": "^[0-9a-f]{32}$",
|
|
91
|
+
"description": "Lowercase hex, 16 bytes. Compared for equality and never parsed; the applicant binds it into the proof's context."
|
|
92
|
+
},
|
|
93
|
+
"expiresAt": {
|
|
94
|
+
"type": "string",
|
|
95
|
+
"format": "date-time",
|
|
96
|
+
"description": "After this instant the challenge is refused. A submission that misses it asks for another."
|
|
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
|
+
}
|
|
114
|
+
} as const;
|
|
115
|
+
|
|
116
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
117
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
118
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
119
|
+
"$ref": "#/$defs/Response",
|
|
120
|
+
"$defs": {
|
|
121
|
+
"Response": {
|
|
122
|
+
"$anchor": "response",
|
|
123
|
+
"title": "VTC Vetting PCS Challenge — response payload",
|
|
124
|
+
"type": "object",
|
|
125
|
+
"additionalProperties": false,
|
|
126
|
+
"required": [
|
|
127
|
+
"challenge",
|
|
128
|
+
"expiresAt"
|
|
129
|
+
],
|
|
130
|
+
"description": "The challenge, and when it stops being accepted.",
|
|
131
|
+
"properties": {
|
|
132
|
+
"challenge": {
|
|
133
|
+
"type": "string",
|
|
134
|
+
"pattern": "^[0-9a-f]{32}$",
|
|
135
|
+
"description": "Lowercase hex, 16 bytes. Compared for equality and never parsed; the applicant binds it into the proof's context."
|
|
136
|
+
},
|
|
137
|
+
"expiresAt": {
|
|
138
|
+
"type": "string",
|
|
139
|
+
"format": "date-time",
|
|
140
|
+
"description": "After this instant the challenge is refused. A submission that misses it asks for another."
|
|
141
|
+
},
|
|
142
|
+
"ext": {
|
|
143
|
+
"$ref": "#/$defs/Ext"
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"Ext": {
|
|
148
|
+
"title": "Ext",
|
|
149
|
+
"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.",
|
|
150
|
+
"type": "object",
|
|
151
|
+
"minProperties": 1,
|
|
152
|
+
"additionalProperties": true,
|
|
153
|
+
"propertyNames": {
|
|
154
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
} as const;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
162
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
163
|
+
* per-specification and cannot be derived from the document alone, and
|
|
164
|
+
* item 2 needs the schema this carries.
|
|
165
|
+
*/
|
|
166
|
+
export const SPEC = {
|
|
167
|
+
typeUri: TYPE_URI,
|
|
168
|
+
isBearer: false,
|
|
169
|
+
isProofRequired: true,
|
|
170
|
+
isRecipientRequired: true,
|
|
171
|
+
isIssuedAtRequired: true,
|
|
172
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
173
|
+
} as const;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
177
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
178
|
+
* parties (§7.3 item 5).
|
|
179
|
+
*/
|
|
180
|
+
export const RESPONSE_SPEC = {
|
|
181
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
182
|
+
isBearer: false,
|
|
183
|
+
isProofRequired: true,
|
|
184
|
+
isRecipientRequired: true,
|
|
185
|
+
isIssuedAtRequired: true,
|
|
186
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
187
|
+
} as const;
|
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vtc/vetting/vetters/event-mode/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { Ext } from "../../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A vetter asks to vet at a named event, at one of the rates the community publishes. The community answers where the request stands; it does not answer whether it was granted, because a vetter cannot raise its own cap and the group it would join may not exist yet.
|
|
11
|
+
*/
|
|
12
|
+
export interface VTCVettingEventModePayload {
|
|
13
|
+
/**
|
|
14
|
+
* The event, as the community names it. It is the whole anonymity set for anything spent under this event's tokens, so it names a gathering people attend — never one desk, one day or one vetter.
|
|
15
|
+
*/
|
|
16
|
+
eventId: string;
|
|
17
|
+
/**
|
|
18
|
+
* One of the tiers the community publishes. A tier is picked from a menu rather than a number being named, so that no vetter's requested rate is itself a distinguishing detail.
|
|
19
|
+
*/
|
|
20
|
+
tier: string;
|
|
21
|
+
window: EventWindow;
|
|
22
|
+
ext?: Ext;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The days the event runs. Dates, not timestamps: an hour would say when a vetter expects to be at a desk, and the tokens are day-scale anyway.
|
|
26
|
+
*/
|
|
27
|
+
export interface EventWindow {
|
|
28
|
+
/**
|
|
29
|
+
* First day of the event, inclusive.
|
|
30
|
+
*/
|
|
31
|
+
startDate: string;
|
|
32
|
+
/**
|
|
33
|
+
* Last day of the event, inclusive. It is not before `startDate`.
|
|
34
|
+
*/
|
|
35
|
+
endDate: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Where the request stands. `pending` is the ordinary answer to a first request and is not a refusal — a refusal is a `trust-task-error`.
|
|
39
|
+
*/
|
|
40
|
+
export interface VTCVettingEventModeResponsePayload {
|
|
41
|
+
/**
|
|
42
|
+
* The event the request names.
|
|
43
|
+
*/
|
|
44
|
+
eventId: string;
|
|
45
|
+
/**
|
|
46
|
+
* `pending`: recorded, awaiting an approver and the group floor. `approved`: the event's label is live and this vetter may draw under it.
|
|
47
|
+
*/
|
|
48
|
+
state: "pending" | "approved";
|
|
49
|
+
/**
|
|
50
|
+
* The tier recorded for this vetter at this event.
|
|
51
|
+
*/
|
|
52
|
+
tier: string;
|
|
53
|
+
window: EventWindow;
|
|
54
|
+
/**
|
|
55
|
+
* How many vetters have asked for this event so far, including this one. A count, never a list: who else is at the event is the anonymity set, and naming its members would hand out the very thing the set exists to hide.
|
|
56
|
+
*/
|
|
57
|
+
groupSize: number;
|
|
58
|
+
/**
|
|
59
|
+
* How many vetters this community requires before an event may be approved at all. A one-vetter event is an event key with one holder, which is a name.
|
|
60
|
+
*/
|
|
61
|
+
groupFloor: number;
|
|
62
|
+
/**
|
|
63
|
+
* Present when `state` is `approved`: the token label to draw under, for `vtc/vetting/vetters/pcs-tokens`.
|
|
64
|
+
*/
|
|
65
|
+
label?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Present when `state` is `approved`: how many tokens a tick under this label yields. It is the tier's rate, and it is the community's cap, not the vetter's request.
|
|
68
|
+
*/
|
|
69
|
+
dripPerTick?: number;
|
|
70
|
+
/**
|
|
71
|
+
* Present when `state` is `approved`: the last day this label will be accepted. It is after `window.endDate` by the community's grace period, so an applicant met on the final day still has time to submit.
|
|
72
|
+
*/
|
|
73
|
+
closesAfter?: string;
|
|
74
|
+
ext?: Ext;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
78
|
+
export type { Ext };
|
|
79
|
+
|
|
80
|
+
/** Trust Task type URI. */
|
|
81
|
+
export const TYPE_URI = "https://trusttasks.org/spec/vtc/vetting/vetters/event-mode/0.1" as const;
|
|
82
|
+
|
|
83
|
+
/** Stable alias for this specification's request payload shape. */
|
|
84
|
+
export type Payload = VTCVettingEventModePayload;
|
|
85
|
+
|
|
86
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
87
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/vetting/vetters/event-mode/0.1#response" as const;
|
|
88
|
+
|
|
89
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
90
|
+
export type Response = VTCVettingEventModeResponsePayload;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* This specification's payload schema, as a value.
|
|
94
|
+
*
|
|
95
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
96
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
97
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
98
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
99
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
100
|
+
*/
|
|
101
|
+
export const PAYLOAD_SCHEMA = {
|
|
102
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
103
|
+
"$id": "https://trusttasks.org/spec/vtc/vetting/vetters/event-mode/0.1",
|
|
104
|
+
"title": "VTC — Vetting Event Mode — payload",
|
|
105
|
+
"description": "A vetter asks to vet at a named event, at one of the rates the community publishes. The community answers where the request stands; it does not answer whether it was granted, because a vetter cannot raise its own cap and the group it would join may not exist yet.",
|
|
106
|
+
"type": "object",
|
|
107
|
+
"additionalProperties": false,
|
|
108
|
+
"required": [
|
|
109
|
+
"eventId",
|
|
110
|
+
"tier",
|
|
111
|
+
"window"
|
|
112
|
+
],
|
|
113
|
+
"properties": {
|
|
114
|
+
"eventId": {
|
|
115
|
+
"type": "string",
|
|
116
|
+
"minLength": 1,
|
|
117
|
+
"maxLength": 64,
|
|
118
|
+
"pattern": "^[a-z0-9]([a-z0-9-]*[a-z0-9])?$",
|
|
119
|
+
"description": "The event, as the community names it. It is the whole anonymity set for anything spent under this event's tokens, so it names a gathering people attend — never one desk, one day or one vetter."
|
|
120
|
+
},
|
|
121
|
+
"tier": {
|
|
122
|
+
"type": "string",
|
|
123
|
+
"minLength": 1,
|
|
124
|
+
"maxLength": 64,
|
|
125
|
+
"description": "One of the tiers the community publishes. A tier is picked from a menu rather than a number being named, so that no vetter's requested rate is itself a distinguishing detail."
|
|
126
|
+
},
|
|
127
|
+
"window": {
|
|
128
|
+
"$ref": "#/$defs/Window"
|
|
129
|
+
},
|
|
130
|
+
"ext": {
|
|
131
|
+
"$ref": "#/$defs/Ext"
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"$defs": {
|
|
135
|
+
"Window": {
|
|
136
|
+
"title": "Event window",
|
|
137
|
+
"type": "object",
|
|
138
|
+
"additionalProperties": false,
|
|
139
|
+
"required": [
|
|
140
|
+
"startDate",
|
|
141
|
+
"endDate"
|
|
142
|
+
],
|
|
143
|
+
"description": "The days the event runs. Dates, not timestamps: an hour would say when a vetter expects to be at a desk, and the tokens are day-scale anyway.",
|
|
144
|
+
"properties": {
|
|
145
|
+
"startDate": {
|
|
146
|
+
"type": "string",
|
|
147
|
+
"format": "date",
|
|
148
|
+
"description": "First day of the event, inclusive."
|
|
149
|
+
},
|
|
150
|
+
"endDate": {
|
|
151
|
+
"type": "string",
|
|
152
|
+
"format": "date",
|
|
153
|
+
"description": "Last day of the event, inclusive. It is not before `startDate`."
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
"Response": {
|
|
158
|
+
"$anchor": "response",
|
|
159
|
+
"title": "VTC Vetting Event Mode — response payload",
|
|
160
|
+
"type": "object",
|
|
161
|
+
"additionalProperties": false,
|
|
162
|
+
"required": [
|
|
163
|
+
"eventId",
|
|
164
|
+
"state",
|
|
165
|
+
"tier",
|
|
166
|
+
"window",
|
|
167
|
+
"groupSize",
|
|
168
|
+
"groupFloor"
|
|
169
|
+
],
|
|
170
|
+
"description": "Where the request stands. `pending` is the ordinary answer to a first request and is not a refusal — a refusal is a `trust-task-error`.",
|
|
171
|
+
"properties": {
|
|
172
|
+
"eventId": {
|
|
173
|
+
"type": "string",
|
|
174
|
+
"minLength": 1,
|
|
175
|
+
"maxLength": 64,
|
|
176
|
+
"description": "The event the request names."
|
|
177
|
+
},
|
|
178
|
+
"state": {
|
|
179
|
+
"type": "string",
|
|
180
|
+
"enum": [
|
|
181
|
+
"pending",
|
|
182
|
+
"approved"
|
|
183
|
+
],
|
|
184
|
+
"description": "`pending`: recorded, awaiting an approver and the group floor. `approved`: the event's label is live and this vetter may draw under it."
|
|
185
|
+
},
|
|
186
|
+
"tier": {
|
|
187
|
+
"type": "string",
|
|
188
|
+
"minLength": 1,
|
|
189
|
+
"maxLength": 64,
|
|
190
|
+
"description": "The tier recorded for this vetter at this event."
|
|
191
|
+
},
|
|
192
|
+
"window": {
|
|
193
|
+
"$ref": "#/$defs/Window"
|
|
194
|
+
},
|
|
195
|
+
"groupSize": {
|
|
196
|
+
"type": "integer",
|
|
197
|
+
"minimum": 0,
|
|
198
|
+
"description": "How many vetters have asked for this event so far, including this one. A count, never a list: who else is at the event is the anonymity set, and naming its members would hand out the very thing the set exists to hide."
|
|
199
|
+
},
|
|
200
|
+
"groupFloor": {
|
|
201
|
+
"type": "integer",
|
|
202
|
+
"minimum": 2,
|
|
203
|
+
"description": "How many vetters this community requires before an event may be approved at all. A one-vetter event is an event key with one holder, which is a name."
|
|
204
|
+
},
|
|
205
|
+
"label": {
|
|
206
|
+
"type": "string",
|
|
207
|
+
"minLength": 1,
|
|
208
|
+
"maxLength": 128,
|
|
209
|
+
"description": "Present when `state` is `approved`: the token label to draw under, for `vtc/vetting/vetters/pcs-tokens`."
|
|
210
|
+
},
|
|
211
|
+
"dripPerTick": {
|
|
212
|
+
"type": "integer",
|
|
213
|
+
"minimum": 1,
|
|
214
|
+
"description": "Present when `state` is `approved`: how many tokens a tick under this label yields. It is the tier's rate, and it is the community's cap, not the vetter's request."
|
|
215
|
+
},
|
|
216
|
+
"closesAfter": {
|
|
217
|
+
"type": "string",
|
|
218
|
+
"format": "date",
|
|
219
|
+
"description": "Present when `state` is `approved`: the last day this label will be accepted. It is after `window.endDate` by the community's grace period, so an applicant met on the final day still has time to submit."
|
|
220
|
+
},
|
|
221
|
+
"ext": {
|
|
222
|
+
"$ref": "#/$defs/Ext"
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
"Ext": {
|
|
227
|
+
"title": "Ext",
|
|
228
|
+
"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.",
|
|
229
|
+
"type": "object",
|
|
230
|
+
"minProperties": 1,
|
|
231
|
+
"additionalProperties": true,
|
|
232
|
+
"propertyNames": {
|
|
233
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
} as const;
|
|
238
|
+
|
|
239
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
240
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
241
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
242
|
+
"$ref": "#/$defs/Response",
|
|
243
|
+
"$defs": {
|
|
244
|
+
"Window": {
|
|
245
|
+
"title": "Event window",
|
|
246
|
+
"type": "object",
|
|
247
|
+
"additionalProperties": false,
|
|
248
|
+
"required": [
|
|
249
|
+
"startDate",
|
|
250
|
+
"endDate"
|
|
251
|
+
],
|
|
252
|
+
"description": "The days the event runs. Dates, not timestamps: an hour would say when a vetter expects to be at a desk, and the tokens are day-scale anyway.",
|
|
253
|
+
"properties": {
|
|
254
|
+
"startDate": {
|
|
255
|
+
"type": "string",
|
|
256
|
+
"format": "date",
|
|
257
|
+
"description": "First day of the event, inclusive."
|
|
258
|
+
},
|
|
259
|
+
"endDate": {
|
|
260
|
+
"type": "string",
|
|
261
|
+
"format": "date",
|
|
262
|
+
"description": "Last day of the event, inclusive. It is not before `startDate`."
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
"Response": {
|
|
267
|
+
"$anchor": "response",
|
|
268
|
+
"title": "VTC Vetting Event Mode — response payload",
|
|
269
|
+
"type": "object",
|
|
270
|
+
"additionalProperties": false,
|
|
271
|
+
"required": [
|
|
272
|
+
"eventId",
|
|
273
|
+
"state",
|
|
274
|
+
"tier",
|
|
275
|
+
"window",
|
|
276
|
+
"groupSize",
|
|
277
|
+
"groupFloor"
|
|
278
|
+
],
|
|
279
|
+
"description": "Where the request stands. `pending` is the ordinary answer to a first request and is not a refusal — a refusal is a `trust-task-error`.",
|
|
280
|
+
"properties": {
|
|
281
|
+
"eventId": {
|
|
282
|
+
"type": "string",
|
|
283
|
+
"minLength": 1,
|
|
284
|
+
"maxLength": 64,
|
|
285
|
+
"description": "The event the request names."
|
|
286
|
+
},
|
|
287
|
+
"state": {
|
|
288
|
+
"type": "string",
|
|
289
|
+
"enum": [
|
|
290
|
+
"pending",
|
|
291
|
+
"approved"
|
|
292
|
+
],
|
|
293
|
+
"description": "`pending`: recorded, awaiting an approver and the group floor. `approved`: the event's label is live and this vetter may draw under it."
|
|
294
|
+
},
|
|
295
|
+
"tier": {
|
|
296
|
+
"type": "string",
|
|
297
|
+
"minLength": 1,
|
|
298
|
+
"maxLength": 64,
|
|
299
|
+
"description": "The tier recorded for this vetter at this event."
|
|
300
|
+
},
|
|
301
|
+
"window": {
|
|
302
|
+
"$ref": "#/$defs/Window"
|
|
303
|
+
},
|
|
304
|
+
"groupSize": {
|
|
305
|
+
"type": "integer",
|
|
306
|
+
"minimum": 0,
|
|
307
|
+
"description": "How many vetters have asked for this event so far, including this one. A count, never a list: who else is at the event is the anonymity set, and naming its members would hand out the very thing the set exists to hide."
|
|
308
|
+
},
|
|
309
|
+
"groupFloor": {
|
|
310
|
+
"type": "integer",
|
|
311
|
+
"minimum": 2,
|
|
312
|
+
"description": "How many vetters this community requires before an event may be approved at all. A one-vetter event is an event key with one holder, which is a name."
|
|
313
|
+
},
|
|
314
|
+
"label": {
|
|
315
|
+
"type": "string",
|
|
316
|
+
"minLength": 1,
|
|
317
|
+
"maxLength": 128,
|
|
318
|
+
"description": "Present when `state` is `approved`: the token label to draw under, for `vtc/vetting/vetters/pcs-tokens`."
|
|
319
|
+
},
|
|
320
|
+
"dripPerTick": {
|
|
321
|
+
"type": "integer",
|
|
322
|
+
"minimum": 1,
|
|
323
|
+
"description": "Present when `state` is `approved`: how many tokens a tick under this label yields. It is the tier's rate, and it is the community's cap, not the vetter's request."
|
|
324
|
+
},
|
|
325
|
+
"closesAfter": {
|
|
326
|
+
"type": "string",
|
|
327
|
+
"format": "date",
|
|
328
|
+
"description": "Present when `state` is `approved`: the last day this label will be accepted. It is after `window.endDate` by the community's grace period, so an applicant met on the final day still has time to submit."
|
|
329
|
+
},
|
|
330
|
+
"ext": {
|
|
331
|
+
"$ref": "#/$defs/Ext"
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
"Ext": {
|
|
336
|
+
"title": "Ext",
|
|
337
|
+
"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.",
|
|
338
|
+
"type": "object",
|
|
339
|
+
"minProperties": 1,
|
|
340
|
+
"additionalProperties": true,
|
|
341
|
+
"propertyNames": {
|
|
342
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
} as const;
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
350
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
351
|
+
* per-specification and cannot be derived from the document alone, and
|
|
352
|
+
* item 2 needs the schema this carries.
|
|
353
|
+
*/
|
|
354
|
+
export const SPEC = {
|
|
355
|
+
typeUri: TYPE_URI,
|
|
356
|
+
isBearer: false,
|
|
357
|
+
isProofRequired: true,
|
|
358
|
+
isRecipientRequired: true,
|
|
359
|
+
isIssuedAtRequired: true,
|
|
360
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
361
|
+
} as const;
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
365
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
366
|
+
* parties (§7.3 item 5).
|
|
367
|
+
*/
|
|
368
|
+
export const RESPONSE_SPEC = {
|
|
369
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
370
|
+
isBearer: false,
|
|
371
|
+
isProofRequired: true,
|
|
372
|
+
isRecipientRequired: true,
|
|
373
|
+
isIssuedAtRequired: true,
|
|
374
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
375
|
+
} as const;
|