@openvtc/trust-tasks 0.28.21 → 0.28.22
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 +9 -0
- package/dist/_shared/components.d.ts +48 -4
- package/dist/_shared/components.d.ts.map +1 -1
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/vtc/badges/_shared/0.1/badge.d.ts +1 -1
- package/dist/vtc/badges/_shared/0.1/badge.d.ts.map +1 -1
- package/dist/vtc/badges/claims/create/0.1/payload.d.ts +595 -0
- package/dist/vtc/badges/claims/create/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/badges/claims/create/0.1/payload.js +345 -0
- package/dist/vtc/badges/claims/create/0.1/payload.js.map +1 -0
- package/dist/vtc/badges/claims/list/0.1/payload.d.ts +586 -0
- package/dist/vtc/badges/claims/list/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/badges/claims/list/0.1/payload.js +335 -0
- package/dist/vtc/badges/claims/list/0.1/payload.js.map +1 -0
- package/dist/vtc/badges/claims/redeem/0.1/payload.d.ts +720 -0
- package/dist/vtc/badges/claims/redeem/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/badges/claims/redeem/0.1/payload.js +417 -0
- package/dist/vtc/badges/claims/redeem/0.1/payload.js.map +1 -0
- package/dist/vtc/badges/claims/withdraw/0.1/payload.d.ts +512 -0
- package/dist/vtc/badges/claims/withdraw/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/badges/claims/withdraw/0.1/payload.js +305 -0
- package/dist/vtc/badges/claims/withdraw/0.1/payload.js.map +1 -0
- package/dist/vtc/badges/create/0.1/payload.d.ts +40 -16
- package/dist/vtc/badges/create/0.1/payload.d.ts.map +1 -1
- package/dist/vtc/badges/create/0.1/payload.js +28 -8
- package/dist/vtc/badges/create/0.1/payload.js.map +1 -1
- package/dist/vtc/badges/promote/0.1/payload.d.ts +40 -16
- package/dist/vtc/badges/promote/0.1/payload.d.ts.map +1 -1
- package/dist/vtc/badges/promote/0.1/payload.js +28 -8
- package/dist/vtc/badges/promote/0.1/payload.js.map +1 -1
- package/dist/vtc/groups/create/0.1/payload.d.ts +40 -16
- package/dist/vtc/groups/create/0.1/payload.d.ts.map +1 -1
- package/dist/vtc/groups/create/0.1/payload.js +28 -8
- package/dist/vtc/groups/create/0.1/payload.js.map +1 -1
- package/dist/vtc/groups/list/0.1/payload.d.ts +40 -16
- package/dist/vtc/groups/list/0.1/payload.d.ts.map +1 -1
- package/dist/vtc/groups/list/0.1/payload.js +28 -8
- package/dist/vtc/groups/list/0.1/payload.js.map +1 -1
- package/dist/vtc/groups/list/0.2/payload.d.ts +40 -16
- package/dist/vtc/groups/list/0.2/payload.d.ts.map +1 -1
- package/dist/vtc/groups/list/0.2/payload.js +28 -8
- package/dist/vtc/groups/list/0.2/payload.js.map +1 -1
- package/dist/vtc/groups/show/0.1/payload.d.ts +40 -16
- package/dist/vtc/groups/show/0.1/payload.d.ts.map +1 -1
- package/dist/vtc/groups/show/0.1/payload.js +28 -8
- package/dist/vtc/groups/show/0.1/payload.js.map +1 -1
- package/dist/vtc/groups/update/0.1/payload.d.ts +40 -16
- package/dist/vtc/groups/update/0.1/payload.d.ts.map +1 -1
- package/dist/vtc/groups/update/0.1/payload.js +28 -8
- package/dist/vtc/groups/update/0.1/payload.js.map +1 -1
- package/package.json +1 -1
- package/src/_shared/components.ts +48 -4
- package/src/index.ts +12 -0
- package/src/vtc/badges/_shared/0.1/badge.ts +1 -1
- package/src/vtc/badges/claims/create/0.1/payload.ts +395 -0
- package/src/vtc/badges/claims/list/0.1/payload.ts +386 -0
- package/src/vtc/badges/claims/redeem/0.1/payload.ts +454 -0
- package/src/vtc/badges/claims/withdraw/0.1/payload.ts +342 -0
- package/src/vtc/badges/create/0.1/payload.ts +28 -8
- package/src/vtc/badges/promote/0.1/payload.ts +28 -8
- package/src/vtc/groups/create/0.1/payload.ts +28 -8
- package/src/vtc/groups/list/0.1/payload.ts +28 -8
- package/src/vtc/groups/list/0.2/payload.ts +28 -8
- package/src/vtc/groups/show/0.1/payload.ts +28 -8
- package/src/vtc/groups/update/0.1/payload.ts +28 -8
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vtc/badges/claims/withdraw/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { BadgeId, ClaimCode, ClaimId, EntryId, Ext } from "../../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Withdraw a claim code: it admits no one from now on; claims already made stand. The outer document members are owned by the framework — SPEC §6.3.
|
|
11
|
+
*/
|
|
12
|
+
export interface VTCBadgesClaimsWithdrawPayload {
|
|
13
|
+
claimId: ClaimId;
|
|
14
|
+
ext?: Ext;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The success response to a vtc/badges/claims/withdraw/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/badges/claims/withdraw/0.1#response.
|
|
18
|
+
*/
|
|
19
|
+
export interface VTCBadgesClaimsWithdrawResponsePayload {
|
|
20
|
+
/**
|
|
21
|
+
* The code's record as it now stands, `withdrawn`.
|
|
22
|
+
*/
|
|
23
|
+
claim: ClaimCode;
|
|
24
|
+
ext?: Ext;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
28
|
+
export type { BadgeId, ClaimCode, ClaimId, EntryId, Ext };
|
|
29
|
+
|
|
30
|
+
/** Trust Task type URI. */
|
|
31
|
+
export const TYPE_URI = "https://trusttasks.org/spec/vtc/badges/claims/withdraw/0.1" as const;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The earlier version of this specification that this one declares it
|
|
35
|
+
* extends (front matter `extends`, SPEC §5.2 "Declared extension"), or
|
|
36
|
+
* `null`. Only the direct declaration — follow the chain with
|
|
37
|
+
* `extendsChain` / `readForSpec`.
|
|
38
|
+
*/
|
|
39
|
+
export const EXTENDS: string | null = null;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Why this version is deprecated, or `null` while it is current. A
|
|
43
|
+
* superseded or retired version is still supported, and is withdrawn from
|
|
44
|
+
* this package in a later scheduled batch (SPEC "Superseded and Withdrawn
|
|
45
|
+
* Versions").
|
|
46
|
+
*/
|
|
47
|
+
export const DEPRECATION: string | null = null;
|
|
48
|
+
|
|
49
|
+
/** Stable alias for this specification's request payload shape. */
|
|
50
|
+
export type Payload = VTCBadgesClaimsWithdrawPayload;
|
|
51
|
+
|
|
52
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
53
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/badges/claims/withdraw/0.1#response" as const;
|
|
54
|
+
|
|
55
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
56
|
+
export type Response = VTCBadgesClaimsWithdrawResponsePayload;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* This specification's payload schema, as a value.
|
|
60
|
+
*
|
|
61
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
62
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
63
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
64
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
65
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
66
|
+
*/
|
|
67
|
+
export const PAYLOAD_SCHEMA = {
|
|
68
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
69
|
+
"$id": "https://trusttasks.org/spec/vtc/badges/claims/withdraw/0.1",
|
|
70
|
+
"title": "VTC Badges — Claims — Withdraw — payload",
|
|
71
|
+
"description": "Withdraw a claim code: it admits no one from now on; claims already made stand. The outer document members are owned by the framework — SPEC §6.3.",
|
|
72
|
+
"type": "object",
|
|
73
|
+
"additionalProperties": false,
|
|
74
|
+
"required": [
|
|
75
|
+
"claimId"
|
|
76
|
+
],
|
|
77
|
+
"properties": {
|
|
78
|
+
"claimId": {
|
|
79
|
+
"$ref": "#/$defs/ClaimId"
|
|
80
|
+
},
|
|
81
|
+
"ext": {
|
|
82
|
+
"$ref": "#/$defs/Ext"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"$defs": {
|
|
86
|
+
"Response": {
|
|
87
|
+
"$anchor": "response",
|
|
88
|
+
"title": "VTC Badges — Claims — Withdraw — response payload",
|
|
89
|
+
"description": "The success response to a vtc/badges/claims/withdraw/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/badges/claims/withdraw/0.1#response.",
|
|
90
|
+
"type": "object",
|
|
91
|
+
"additionalProperties": false,
|
|
92
|
+
"required": [
|
|
93
|
+
"claim"
|
|
94
|
+
],
|
|
95
|
+
"properties": {
|
|
96
|
+
"claim": {
|
|
97
|
+
"$ref": "#/$defs/ClaimCode",
|
|
98
|
+
"description": "The code's record as it now stands, `withdrawn`."
|
|
99
|
+
},
|
|
100
|
+
"ext": {
|
|
101
|
+
"$ref": "#/$defs/Ext"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"Ext": {
|
|
106
|
+
"title": "Ext",
|
|
107
|
+
"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.",
|
|
108
|
+
"type": "object",
|
|
109
|
+
"minProperties": 1,
|
|
110
|
+
"additionalProperties": true,
|
|
111
|
+
"propertyNames": {
|
|
112
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"ClaimCode": {
|
|
116
|
+
"title": "ClaimCode",
|
|
117
|
+
"description": "A claim code's record, as the badge's owners and administrators see it: never the code (VTI-BDG-027).",
|
|
118
|
+
"type": "object",
|
|
119
|
+
"additionalProperties": false,
|
|
120
|
+
"required": [
|
|
121
|
+
"claimId",
|
|
122
|
+
"badgeId",
|
|
123
|
+
"label",
|
|
124
|
+
"validUntil",
|
|
125
|
+
"limit",
|
|
126
|
+
"claims",
|
|
127
|
+
"state",
|
|
128
|
+
"createdAt"
|
|
129
|
+
],
|
|
130
|
+
"properties": {
|
|
131
|
+
"claimId": {
|
|
132
|
+
"$ref": "#/$defs/ClaimId"
|
|
133
|
+
},
|
|
134
|
+
"badgeId": {
|
|
135
|
+
"$ref": "#/$defs/BadgeId"
|
|
136
|
+
},
|
|
137
|
+
"label": {
|
|
138
|
+
"type": "string",
|
|
139
|
+
"minLength": 1,
|
|
140
|
+
"maxLength": 120,
|
|
141
|
+
"description": "What the code is for — the event, say — shown to the badge's owners. Never shown to whoever redeems it."
|
|
142
|
+
},
|
|
143
|
+
"validUntil": {
|
|
144
|
+
"type": "string",
|
|
145
|
+
"format": "date-time",
|
|
146
|
+
"description": "After this the code admits no one."
|
|
147
|
+
},
|
|
148
|
+
"limit": {
|
|
149
|
+
"type": "integer",
|
|
150
|
+
"minimum": 1,
|
|
151
|
+
"maximum": 10000,
|
|
152
|
+
"description": "How many claims the code admits."
|
|
153
|
+
},
|
|
154
|
+
"claims": {
|
|
155
|
+
"type": "integer",
|
|
156
|
+
"minimum": 0,
|
|
157
|
+
"description": "How many members have redeemed it."
|
|
158
|
+
},
|
|
159
|
+
"state": {
|
|
160
|
+
"type": "string",
|
|
161
|
+
"enum": [
|
|
162
|
+
"active",
|
|
163
|
+
"withdrawn"
|
|
164
|
+
],
|
|
165
|
+
"description": "`withdrawn` once its issuer withdrew it or the badge was retired. A code past `validUntil` or out of claims stays `active` and admits no one."
|
|
166
|
+
},
|
|
167
|
+
"createdAt": {
|
|
168
|
+
"type": "string",
|
|
169
|
+
"format": "date-time"
|
|
170
|
+
},
|
|
171
|
+
"createdBy": {
|
|
172
|
+
"$ref": "#/$defs/EntryId",
|
|
173
|
+
"description": "The issuer's entry, where they have one; the giver of every award the code admits."
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
"BadgeId": {
|
|
178
|
+
"title": "BadgeId",
|
|
179
|
+
"description": "Opaque identifier of a badge: `bdg_` followed by 16 to 64 base64url characters. Random, community-scoped, never reused (VTI-BDG-001).",
|
|
180
|
+
"type": "string",
|
|
181
|
+
"pattern": "^bdg_[A-Za-z0-9_-]{16,64}$"
|
|
182
|
+
},
|
|
183
|
+
"ClaimId": {
|
|
184
|
+
"title": "ClaimId",
|
|
185
|
+
"description": "Opaque identifier of a claim code's record: `bcl_` followed by 16 to 64 base64url characters. Random; never the code itself, which the community keeps only as a digest (VTI-BDG-025).",
|
|
186
|
+
"type": "string",
|
|
187
|
+
"pattern": "^bcl_[A-Za-z0-9_-]{16,64}$"
|
|
188
|
+
},
|
|
189
|
+
"EntryId": {
|
|
190
|
+
"title": "EntryId",
|
|
191
|
+
"description": "Opaque identifier of one directory entry: `dir_` followed by 16 to 64 base64url characters. Random, scoped to one community, and stable for the life of the membership — it survives a rotation of the member's DID, which is why groups, notes and cards are keyed by it. It MUST NOT be derived from, and MUST NOT reveal, any DID of the member, and the same person's entries in two communities MUST NOT share one. Compared by exact string equality.",
|
|
192
|
+
"type": "string",
|
|
193
|
+
"pattern": "^dir_[A-Za-z0-9_-]{16,64}$"
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
} as const;
|
|
197
|
+
|
|
198
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
199
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
200
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
201
|
+
"$ref": "#/$defs/Response",
|
|
202
|
+
"$defs": {
|
|
203
|
+
"Response": {
|
|
204
|
+
"$anchor": "response",
|
|
205
|
+
"title": "VTC Badges — Claims — Withdraw — response payload",
|
|
206
|
+
"description": "The success response to a vtc/badges/claims/withdraw/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/badges/claims/withdraw/0.1#response.",
|
|
207
|
+
"type": "object",
|
|
208
|
+
"additionalProperties": false,
|
|
209
|
+
"required": [
|
|
210
|
+
"claim"
|
|
211
|
+
],
|
|
212
|
+
"properties": {
|
|
213
|
+
"claim": {
|
|
214
|
+
"$ref": "#/$defs/ClaimCode",
|
|
215
|
+
"description": "The code's record as it now stands, `withdrawn`."
|
|
216
|
+
},
|
|
217
|
+
"ext": {
|
|
218
|
+
"$ref": "#/$defs/Ext"
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
"Ext": {
|
|
223
|
+
"title": "Ext",
|
|
224
|
+
"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.",
|
|
225
|
+
"type": "object",
|
|
226
|
+
"minProperties": 1,
|
|
227
|
+
"additionalProperties": true,
|
|
228
|
+
"propertyNames": {
|
|
229
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
"ClaimCode": {
|
|
233
|
+
"title": "ClaimCode",
|
|
234
|
+
"description": "A claim code's record, as the badge's owners and administrators see it: never the code (VTI-BDG-027).",
|
|
235
|
+
"type": "object",
|
|
236
|
+
"additionalProperties": false,
|
|
237
|
+
"required": [
|
|
238
|
+
"claimId",
|
|
239
|
+
"badgeId",
|
|
240
|
+
"label",
|
|
241
|
+
"validUntil",
|
|
242
|
+
"limit",
|
|
243
|
+
"claims",
|
|
244
|
+
"state",
|
|
245
|
+
"createdAt"
|
|
246
|
+
],
|
|
247
|
+
"properties": {
|
|
248
|
+
"claimId": {
|
|
249
|
+
"$ref": "#/$defs/ClaimId"
|
|
250
|
+
},
|
|
251
|
+
"badgeId": {
|
|
252
|
+
"$ref": "#/$defs/BadgeId"
|
|
253
|
+
},
|
|
254
|
+
"label": {
|
|
255
|
+
"type": "string",
|
|
256
|
+
"minLength": 1,
|
|
257
|
+
"maxLength": 120,
|
|
258
|
+
"description": "What the code is for — the event, say — shown to the badge's owners. Never shown to whoever redeems it."
|
|
259
|
+
},
|
|
260
|
+
"validUntil": {
|
|
261
|
+
"type": "string",
|
|
262
|
+
"format": "date-time",
|
|
263
|
+
"description": "After this the code admits no one."
|
|
264
|
+
},
|
|
265
|
+
"limit": {
|
|
266
|
+
"type": "integer",
|
|
267
|
+
"minimum": 1,
|
|
268
|
+
"maximum": 10000,
|
|
269
|
+
"description": "How many claims the code admits."
|
|
270
|
+
},
|
|
271
|
+
"claims": {
|
|
272
|
+
"type": "integer",
|
|
273
|
+
"minimum": 0,
|
|
274
|
+
"description": "How many members have redeemed it."
|
|
275
|
+
},
|
|
276
|
+
"state": {
|
|
277
|
+
"type": "string",
|
|
278
|
+
"enum": [
|
|
279
|
+
"active",
|
|
280
|
+
"withdrawn"
|
|
281
|
+
],
|
|
282
|
+
"description": "`withdrawn` once its issuer withdrew it or the badge was retired. A code past `validUntil` or out of claims stays `active` and admits no one."
|
|
283
|
+
},
|
|
284
|
+
"createdAt": {
|
|
285
|
+
"type": "string",
|
|
286
|
+
"format": "date-time"
|
|
287
|
+
},
|
|
288
|
+
"createdBy": {
|
|
289
|
+
"$ref": "#/$defs/EntryId",
|
|
290
|
+
"description": "The issuer's entry, where they have one; the giver of every award the code admits."
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
"BadgeId": {
|
|
295
|
+
"title": "BadgeId",
|
|
296
|
+
"description": "Opaque identifier of a badge: `bdg_` followed by 16 to 64 base64url characters. Random, community-scoped, never reused (VTI-BDG-001).",
|
|
297
|
+
"type": "string",
|
|
298
|
+
"pattern": "^bdg_[A-Za-z0-9_-]{16,64}$"
|
|
299
|
+
},
|
|
300
|
+
"ClaimId": {
|
|
301
|
+
"title": "ClaimId",
|
|
302
|
+
"description": "Opaque identifier of a claim code's record: `bcl_` followed by 16 to 64 base64url characters. Random; never the code itself, which the community keeps only as a digest (VTI-BDG-025).",
|
|
303
|
+
"type": "string",
|
|
304
|
+
"pattern": "^bcl_[A-Za-z0-9_-]{16,64}$"
|
|
305
|
+
},
|
|
306
|
+
"EntryId": {
|
|
307
|
+
"title": "EntryId",
|
|
308
|
+
"description": "Opaque identifier of one directory entry: `dir_` followed by 16 to 64 base64url characters. Random, scoped to one community, and stable for the life of the membership — it survives a rotation of the member's DID, which is why groups, notes and cards are keyed by it. It MUST NOT be derived from, and MUST NOT reveal, any DID of the member, and the same person's entries in two communities MUST NOT share one. Compared by exact string equality.",
|
|
309
|
+
"type": "string",
|
|
310
|
+
"pattern": "^dir_[A-Za-z0-9_-]{16,64}$"
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
} as const;
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
317
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
318
|
+
* per-specification and cannot be derived from the document alone, and
|
|
319
|
+
* item 2 needs the schema this carries.
|
|
320
|
+
*/
|
|
321
|
+
export const SPEC = {
|
|
322
|
+
typeUri: TYPE_URI,
|
|
323
|
+
isBearer: false,
|
|
324
|
+
isProofRequired: true,
|
|
325
|
+
isRecipientRequired: true,
|
|
326
|
+
isIssuedAtRequired: true,
|
|
327
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
328
|
+
} as const;
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
332
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
333
|
+
* parties (§7.3 item 5).
|
|
334
|
+
*/
|
|
335
|
+
export const RESPONSE_SPEC = {
|
|
336
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
337
|
+
isBearer: false,
|
|
338
|
+
isProofRequired: true,
|
|
339
|
+
isRecipientRequired: true,
|
|
340
|
+
isIssuedAtRequired: true,
|
|
341
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
342
|
+
} as const;
|
|
@@ -381,7 +381,7 @@ export const PAYLOAD_SCHEMA = {
|
|
|
381
381
|
},
|
|
382
382
|
"RuleCondition": {
|
|
383
383
|
"title": "RuleCondition",
|
|
384
|
-
"description": "One test over a verified fact about a member. `fact: role` tests the member's community role; `fact: field` tests an `admin`- or `credential`-sourced directory field named by `field`; `fact: personhood` tests whether a personhood assertion is on file; `fact: joinedAt` tests when they joined. A rule never reads a self-asserted (`member`-sourced) field: a member must not be able to join a group by editing their card.",
|
|
384
|
+
"description": "One test over a verified fact about a member. `fact: role` tests the member's community role; `fact: field` tests an `admin`- or `credential`-sourced directory field named by `field`; `fact: personhood` tests whether a personhood assertion is on file; `fact: joinedAt` tests when they joined. A rule never reads a self-asserted (`member`-sourced) field: a member must not be able to join a group by editing their card. `kudosReceived`, `ideasSelected` and `electionTickets` are counts the community keeps of its own records (kudos the member accepted, ideas of theirs a board selected, elections it issued them a ticket in), compared with `atLeast`; only a badge's group reads them (VTI-BDG-015), and any other group refuses them with `ruleInvalid`.",
|
|
385
385
|
"type": "object",
|
|
386
386
|
"additionalProperties": false,
|
|
387
387
|
"required": [
|
|
@@ -395,7 +395,10 @@ export const PAYLOAD_SCHEMA = {
|
|
|
395
395
|
"role",
|
|
396
396
|
"field",
|
|
397
397
|
"personhood",
|
|
398
|
-
"joinedAt"
|
|
398
|
+
"joinedAt",
|
|
399
|
+
"kudosReceived",
|
|
400
|
+
"ideasSelected",
|
|
401
|
+
"electionTickets"
|
|
399
402
|
]
|
|
400
403
|
},
|
|
401
404
|
"field": {
|
|
@@ -409,9 +412,10 @@ export const PAYLOAD_SCHEMA = {
|
|
|
409
412
|
"oneOf",
|
|
410
413
|
"exists",
|
|
411
414
|
"before",
|
|
412
|
-
"after"
|
|
415
|
+
"after",
|
|
416
|
+
"atLeast"
|
|
413
417
|
],
|
|
414
|
-
"description": "`equals` compares with `value`; `oneOf` with any of `values`; `exists` needs neither; `before` and `after` compare a date fact with `value`."
|
|
418
|
+
"description": "`equals` compares with `value`; `oneOf` with any of `values`; `exists` needs neither; `before` and `after` compare a date fact with `value`; `atLeast` compares a count fact with `count`."
|
|
415
419
|
},
|
|
416
420
|
"value": {
|
|
417
421
|
"anyOf": [
|
|
@@ -432,6 +436,12 @@ export const PAYLOAD_SCHEMA = {
|
|
|
432
436
|
"type": "string",
|
|
433
437
|
"maxLength": 256
|
|
434
438
|
}
|
|
439
|
+
},
|
|
440
|
+
"count": {
|
|
441
|
+
"type": "integer",
|
|
442
|
+
"minimum": 1,
|
|
443
|
+
"maximum": 100000,
|
|
444
|
+
"description": "With `atLeast`: the least a count fact (`kudosReceived`, `ideasSelected`, `electionTickets`) must be. Present exactly when `op` is `atLeast`."
|
|
435
445
|
}
|
|
436
446
|
}
|
|
437
447
|
},
|
|
@@ -833,7 +843,7 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
|
833
843
|
},
|
|
834
844
|
"RuleCondition": {
|
|
835
845
|
"title": "RuleCondition",
|
|
836
|
-
"description": "One test over a verified fact about a member. `fact: role` tests the member's community role; `fact: field` tests an `admin`- or `credential`-sourced directory field named by `field`; `fact: personhood` tests whether a personhood assertion is on file; `fact: joinedAt` tests when they joined. A rule never reads a self-asserted (`member`-sourced) field: a member must not be able to join a group by editing their card.",
|
|
846
|
+
"description": "One test over a verified fact about a member. `fact: role` tests the member's community role; `fact: field` tests an `admin`- or `credential`-sourced directory field named by `field`; `fact: personhood` tests whether a personhood assertion is on file; `fact: joinedAt` tests when they joined. A rule never reads a self-asserted (`member`-sourced) field: a member must not be able to join a group by editing their card. `kudosReceived`, `ideasSelected` and `electionTickets` are counts the community keeps of its own records (kudos the member accepted, ideas of theirs a board selected, elections it issued them a ticket in), compared with `atLeast`; only a badge's group reads them (VTI-BDG-015), and any other group refuses them with `ruleInvalid`.",
|
|
837
847
|
"type": "object",
|
|
838
848
|
"additionalProperties": false,
|
|
839
849
|
"required": [
|
|
@@ -847,7 +857,10 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
|
847
857
|
"role",
|
|
848
858
|
"field",
|
|
849
859
|
"personhood",
|
|
850
|
-
"joinedAt"
|
|
860
|
+
"joinedAt",
|
|
861
|
+
"kudosReceived",
|
|
862
|
+
"ideasSelected",
|
|
863
|
+
"electionTickets"
|
|
851
864
|
]
|
|
852
865
|
},
|
|
853
866
|
"field": {
|
|
@@ -861,9 +874,10 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
|
861
874
|
"oneOf",
|
|
862
875
|
"exists",
|
|
863
876
|
"before",
|
|
864
|
-
"after"
|
|
877
|
+
"after",
|
|
878
|
+
"atLeast"
|
|
865
879
|
],
|
|
866
|
-
"description": "`equals` compares with `value`; `oneOf` with any of `values`; `exists` needs neither; `before` and `after` compare a date fact with `value`."
|
|
880
|
+
"description": "`equals` compares with `value`; `oneOf` with any of `values`; `exists` needs neither; `before` and `after` compare a date fact with `value`; `atLeast` compares a count fact with `count`."
|
|
867
881
|
},
|
|
868
882
|
"value": {
|
|
869
883
|
"anyOf": [
|
|
@@ -884,6 +898,12 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
|
884
898
|
"type": "string",
|
|
885
899
|
"maxLength": 256
|
|
886
900
|
}
|
|
901
|
+
},
|
|
902
|
+
"count": {
|
|
903
|
+
"type": "integer",
|
|
904
|
+
"minimum": 1,
|
|
905
|
+
"maximum": 100000,
|
|
906
|
+
"description": "With `atLeast`: the least a count fact (`kudosReceived`, `ideasSelected`, `electionTickets`) must be. Present exactly when `op` is `atLeast`."
|
|
887
907
|
}
|
|
888
908
|
}
|
|
889
909
|
},
|
|
@@ -325,7 +325,7 @@ export const PAYLOAD_SCHEMA = {
|
|
|
325
325
|
},
|
|
326
326
|
"RuleCondition": {
|
|
327
327
|
"title": "RuleCondition",
|
|
328
|
-
"description": "One test over a verified fact about a member. `fact: role` tests the member's community role; `fact: field` tests an `admin`- or `credential`-sourced directory field named by `field`; `fact: personhood` tests whether a personhood assertion is on file; `fact: joinedAt` tests when they joined. A rule never reads a self-asserted (`member`-sourced) field: a member must not be able to join a group by editing their card.",
|
|
328
|
+
"description": "One test over a verified fact about a member. `fact: role` tests the member's community role; `fact: field` tests an `admin`- or `credential`-sourced directory field named by `field`; `fact: personhood` tests whether a personhood assertion is on file; `fact: joinedAt` tests when they joined. A rule never reads a self-asserted (`member`-sourced) field: a member must not be able to join a group by editing their card. `kudosReceived`, `ideasSelected` and `electionTickets` are counts the community keeps of its own records (kudos the member accepted, ideas of theirs a board selected, elections it issued them a ticket in), compared with `atLeast`; only a badge's group reads them (VTI-BDG-015), and any other group refuses them with `ruleInvalid`.",
|
|
329
329
|
"type": "object",
|
|
330
330
|
"additionalProperties": false,
|
|
331
331
|
"required": [
|
|
@@ -339,7 +339,10 @@ export const PAYLOAD_SCHEMA = {
|
|
|
339
339
|
"role",
|
|
340
340
|
"field",
|
|
341
341
|
"personhood",
|
|
342
|
-
"joinedAt"
|
|
342
|
+
"joinedAt",
|
|
343
|
+
"kudosReceived",
|
|
344
|
+
"ideasSelected",
|
|
345
|
+
"electionTickets"
|
|
343
346
|
]
|
|
344
347
|
},
|
|
345
348
|
"field": {
|
|
@@ -353,9 +356,10 @@ export const PAYLOAD_SCHEMA = {
|
|
|
353
356
|
"oneOf",
|
|
354
357
|
"exists",
|
|
355
358
|
"before",
|
|
356
|
-
"after"
|
|
359
|
+
"after",
|
|
360
|
+
"atLeast"
|
|
357
361
|
],
|
|
358
|
-
"description": "`equals` compares with `value`; `oneOf` with any of `values`; `exists` needs neither; `before` and `after` compare a date fact with `value`."
|
|
362
|
+
"description": "`equals` compares with `value`; `oneOf` with any of `values`; `exists` needs neither; `before` and `after` compare a date fact with `value`; `atLeast` compares a count fact with `count`."
|
|
359
363
|
},
|
|
360
364
|
"value": {
|
|
361
365
|
"anyOf": [
|
|
@@ -376,6 +380,12 @@ export const PAYLOAD_SCHEMA = {
|
|
|
376
380
|
"type": "string",
|
|
377
381
|
"maxLength": 256
|
|
378
382
|
}
|
|
383
|
+
},
|
|
384
|
+
"count": {
|
|
385
|
+
"type": "integer",
|
|
386
|
+
"minimum": 1,
|
|
387
|
+
"maximum": 100000,
|
|
388
|
+
"description": "With `atLeast`: the least a count fact (`kudosReceived`, `ideasSelected`, `electionTickets`) must be. Present exactly when `op` is `atLeast`."
|
|
379
389
|
}
|
|
380
390
|
}
|
|
381
391
|
},
|
|
@@ -784,7 +794,7 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
|
784
794
|
},
|
|
785
795
|
"RuleCondition": {
|
|
786
796
|
"title": "RuleCondition",
|
|
787
|
-
"description": "One test over a verified fact about a member. `fact: role` tests the member's community role; `fact: field` tests an `admin`- or `credential`-sourced directory field named by `field`; `fact: personhood` tests whether a personhood assertion is on file; `fact: joinedAt` tests when they joined. A rule never reads a self-asserted (`member`-sourced) field: a member must not be able to join a group by editing their card.",
|
|
797
|
+
"description": "One test over a verified fact about a member. `fact: role` tests the member's community role; `fact: field` tests an `admin`- or `credential`-sourced directory field named by `field`; `fact: personhood` tests whether a personhood assertion is on file; `fact: joinedAt` tests when they joined. A rule never reads a self-asserted (`member`-sourced) field: a member must not be able to join a group by editing their card. `kudosReceived`, `ideasSelected` and `electionTickets` are counts the community keeps of its own records (kudos the member accepted, ideas of theirs a board selected, elections it issued them a ticket in), compared with `atLeast`; only a badge's group reads them (VTI-BDG-015), and any other group refuses them with `ruleInvalid`.",
|
|
788
798
|
"type": "object",
|
|
789
799
|
"additionalProperties": false,
|
|
790
800
|
"required": [
|
|
@@ -798,7 +808,10 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
|
798
808
|
"role",
|
|
799
809
|
"field",
|
|
800
810
|
"personhood",
|
|
801
|
-
"joinedAt"
|
|
811
|
+
"joinedAt",
|
|
812
|
+
"kudosReceived",
|
|
813
|
+
"ideasSelected",
|
|
814
|
+
"electionTickets"
|
|
802
815
|
]
|
|
803
816
|
},
|
|
804
817
|
"field": {
|
|
@@ -812,9 +825,10 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
|
812
825
|
"oneOf",
|
|
813
826
|
"exists",
|
|
814
827
|
"before",
|
|
815
|
-
"after"
|
|
828
|
+
"after",
|
|
829
|
+
"atLeast"
|
|
816
830
|
],
|
|
817
|
-
"description": "`equals` compares with `value`; `oneOf` with any of `values`; `exists` needs neither; `before` and `after` compare a date fact with `value`."
|
|
831
|
+
"description": "`equals` compares with `value`; `oneOf` with any of `values`; `exists` needs neither; `before` and `after` compare a date fact with `value`; `atLeast` compares a count fact with `count`."
|
|
818
832
|
},
|
|
819
833
|
"value": {
|
|
820
834
|
"anyOf": [
|
|
@@ -835,6 +849,12 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
|
835
849
|
"type": "string",
|
|
836
850
|
"maxLength": 256
|
|
837
851
|
}
|
|
852
|
+
},
|
|
853
|
+
"count": {
|
|
854
|
+
"type": "integer",
|
|
855
|
+
"minimum": 1,
|
|
856
|
+
"maximum": 100000,
|
|
857
|
+
"description": "With `atLeast`: the least a count fact (`kudosReceived`, `ideasSelected`, `electionTickets`) must be. Present exactly when `op` is `atLeast`."
|
|
838
858
|
}
|
|
839
859
|
}
|
|
840
860
|
},
|
|
@@ -303,7 +303,7 @@ export const PAYLOAD_SCHEMA = {
|
|
|
303
303
|
},
|
|
304
304
|
"RuleCondition": {
|
|
305
305
|
"title": "RuleCondition",
|
|
306
|
-
"description": "One test over a verified fact about a member. `fact: role` tests the member's community role; `fact: field` tests an `admin`- or `credential`-sourced directory field named by `field`; `fact: personhood` tests whether a personhood assertion is on file; `fact: joinedAt` tests when they joined. A rule never reads a self-asserted (`member`-sourced) field: a member must not be able to join a group by editing their card.",
|
|
306
|
+
"description": "One test over a verified fact about a member. `fact: role` tests the member's community role; `fact: field` tests an `admin`- or `credential`-sourced directory field named by `field`; `fact: personhood` tests whether a personhood assertion is on file; `fact: joinedAt` tests when they joined. A rule never reads a self-asserted (`member`-sourced) field: a member must not be able to join a group by editing their card. `kudosReceived`, `ideasSelected` and `electionTickets` are counts the community keeps of its own records (kudos the member accepted, ideas of theirs a board selected, elections it issued them a ticket in), compared with `atLeast`; only a badge's group reads them (VTI-BDG-015), and any other group refuses them with `ruleInvalid`.",
|
|
307
307
|
"type": "object",
|
|
308
308
|
"additionalProperties": false,
|
|
309
309
|
"required": [
|
|
@@ -317,7 +317,10 @@ export const PAYLOAD_SCHEMA = {
|
|
|
317
317
|
"role",
|
|
318
318
|
"field",
|
|
319
319
|
"personhood",
|
|
320
|
-
"joinedAt"
|
|
320
|
+
"joinedAt",
|
|
321
|
+
"kudosReceived",
|
|
322
|
+
"ideasSelected",
|
|
323
|
+
"electionTickets"
|
|
321
324
|
]
|
|
322
325
|
},
|
|
323
326
|
"field": {
|
|
@@ -331,9 +334,10 @@ export const PAYLOAD_SCHEMA = {
|
|
|
331
334
|
"oneOf",
|
|
332
335
|
"exists",
|
|
333
336
|
"before",
|
|
334
|
-
"after"
|
|
337
|
+
"after",
|
|
338
|
+
"atLeast"
|
|
335
339
|
],
|
|
336
|
-
"description": "`equals` compares with `value`; `oneOf` with any of `values`; `exists` needs neither; `before` and `after` compare a date fact with `value`."
|
|
340
|
+
"description": "`equals` compares with `value`; `oneOf` with any of `values`; `exists` needs neither; `before` and `after` compare a date fact with `value`; `atLeast` compares a count fact with `count`."
|
|
337
341
|
},
|
|
338
342
|
"value": {
|
|
339
343
|
"anyOf": [
|
|
@@ -354,6 +358,12 @@ export const PAYLOAD_SCHEMA = {
|
|
|
354
358
|
"type": "string",
|
|
355
359
|
"maxLength": 256
|
|
356
360
|
}
|
|
361
|
+
},
|
|
362
|
+
"count": {
|
|
363
|
+
"type": "integer",
|
|
364
|
+
"minimum": 1,
|
|
365
|
+
"maximum": 100000,
|
|
366
|
+
"description": "With `atLeast`: the least a count fact (`kudosReceived`, `ideasSelected`, `electionTickets`) must be. Present exactly when `op` is `atLeast`."
|
|
357
367
|
}
|
|
358
368
|
}
|
|
359
369
|
},
|
|
@@ -583,7 +593,7 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
|
583
593
|
},
|
|
584
594
|
"RuleCondition": {
|
|
585
595
|
"title": "RuleCondition",
|
|
586
|
-
"description": "One test over a verified fact about a member. `fact: role` tests the member's community role; `fact: field` tests an `admin`- or `credential`-sourced directory field named by `field`; `fact: personhood` tests whether a personhood assertion is on file; `fact: joinedAt` tests when they joined. A rule never reads a self-asserted (`member`-sourced) field: a member must not be able to join a group by editing their card.",
|
|
596
|
+
"description": "One test over a verified fact about a member. `fact: role` tests the member's community role; `fact: field` tests an `admin`- or `credential`-sourced directory field named by `field`; `fact: personhood` tests whether a personhood assertion is on file; `fact: joinedAt` tests when they joined. A rule never reads a self-asserted (`member`-sourced) field: a member must not be able to join a group by editing their card. `kudosReceived`, `ideasSelected` and `electionTickets` are counts the community keeps of its own records (kudos the member accepted, ideas of theirs a board selected, elections it issued them a ticket in), compared with `atLeast`; only a badge's group reads them (VTI-BDG-015), and any other group refuses them with `ruleInvalid`.",
|
|
587
597
|
"type": "object",
|
|
588
598
|
"additionalProperties": false,
|
|
589
599
|
"required": [
|
|
@@ -597,7 +607,10 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
|
597
607
|
"role",
|
|
598
608
|
"field",
|
|
599
609
|
"personhood",
|
|
600
|
-
"joinedAt"
|
|
610
|
+
"joinedAt",
|
|
611
|
+
"kudosReceived",
|
|
612
|
+
"ideasSelected",
|
|
613
|
+
"electionTickets"
|
|
601
614
|
]
|
|
602
615
|
},
|
|
603
616
|
"field": {
|
|
@@ -611,9 +624,10 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
|
611
624
|
"oneOf",
|
|
612
625
|
"exists",
|
|
613
626
|
"before",
|
|
614
|
-
"after"
|
|
627
|
+
"after",
|
|
628
|
+
"atLeast"
|
|
615
629
|
],
|
|
616
|
-
"description": "`equals` compares with `value`; `oneOf` with any of `values`; `exists` needs neither; `before` and `after` compare a date fact with `value`."
|
|
630
|
+
"description": "`equals` compares with `value`; `oneOf` with any of `values`; `exists` needs neither; `before` and `after` compare a date fact with `value`; `atLeast` compares a count fact with `count`."
|
|
617
631
|
},
|
|
618
632
|
"value": {
|
|
619
633
|
"anyOf": [
|
|
@@ -634,6 +648,12 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
|
634
648
|
"type": "string",
|
|
635
649
|
"maxLength": 256
|
|
636
650
|
}
|
|
651
|
+
},
|
|
652
|
+
"count": {
|
|
653
|
+
"type": "integer",
|
|
654
|
+
"minimum": 1,
|
|
655
|
+
"maximum": 100000,
|
|
656
|
+
"description": "With `atLeast`: the least a count fact (`kudosReceived`, `ideasSelected`, `electionTickets`) must be. Present exactly when `op` is `atLeast`."
|
|
637
657
|
}
|
|
638
658
|
}
|
|
639
659
|
},
|