@openvtc/trust-tasks 0.28.17 → 0.28.19
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 +68 -0
- package/dist/_shared/components.d.ts +254 -1
- package/dist/_shared/components.d.ts.map +1 -1
- package/dist/index.d.ts +87 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +87 -0
- package/dist/index.js.map +1 -1
- package/dist/vta/collection/_shared/0.1/collection.d.ts +2 -2
- package/dist/vta/collection/_shared/0.1/collection.d.ts.map +1 -1
- package/dist/vta/collection/list/0.1/payload.d.ts +4 -4
- package/dist/vta/collection/list/0.1/payload.js +2 -2
- package/dist/vta/collection/list/0.1/payload.js.map +1 -1
- package/dist/vta/collection/settings/set/0.1/payload.d.ts +469 -0
- package/dist/vta/collection/settings/set/0.1/payload.d.ts.map +1 -0
- package/dist/vta/collection/settings/set/0.1/payload.js +275 -0
- package/dist/vta/collection/settings/set/0.1/payload.js.map +1 -0
- package/dist/vta/collection/settings/show/0.1/payload.d.ts +437 -0
- package/dist/vta/collection/settings/show/0.1/payload.d.ts.map +1 -0
- package/dist/vta/collection/settings/show/0.1/payload.js +260 -0
- package/dist/vta/collection/settings/show/0.1/payload.js.map +1 -0
- package/dist/vtc/badges/_shared/0.1/badge.d.ts +22 -0
- package/dist/vtc/badges/_shared/0.1/badge.d.ts.map +1 -0
- package/dist/vtc/badges/_shared/0.1/badge.js +6 -0
- package/dist/vtc/badges/_shared/0.1/badge.js.map +1 -0
- package/dist/vtc/badges/awards/list/0.1/payload.d.ts +1228 -0
- package/dist/vtc/badges/awards/list/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/badges/awards/list/0.1/payload.js +699 -0
- package/dist/vtc/badges/awards/list/0.1/payload.js.map +1 -0
- package/dist/vtc/badges/awards/offer/0.1/payload.d.ts +793 -0
- package/dist/vtc/badges/awards/offer/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/badges/awards/offer/0.1/payload.js +461 -0
- package/dist/vtc/badges/awards/offer/0.1/payload.js.map +1 -0
- package/dist/vtc/badges/awards/revoke/0.1/payload.d.ts +605 -0
- package/dist/vtc/badges/awards/revoke/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/badges/awards/revoke/0.1/payload.js +351 -0
- package/dist/vtc/badges/awards/revoke/0.1/payload.js.map +1 -0
- package/dist/vtc/badges/awards/withdraw/0.1/payload.d.ts +605 -0
- package/dist/vtc/badges/awards/withdraw/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/badges/awards/withdraw/0.1/payload.js +351 -0
- package/dist/vtc/badges/awards/withdraw/0.1/payload.js.map +1 -0
- package/dist/vtc/badges/create/0.1/payload.d.ts +1829 -0
- package/dist/vtc/badges/create/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/badges/create/0.1/payload.js +1051 -0
- package/dist/vtc/badges/create/0.1/payload.js.map +1 -0
- package/dist/vtc/badges/holders/list/0.1/payload.d.ts +984 -0
- package/dist/vtc/badges/holders/list/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/badges/holders/list/0.1/payload.js +555 -0
- package/dist/vtc/badges/holders/list/0.1/payload.js.map +1 -0
- package/dist/vtc/badges/images/get/0.1/payload.d.ts +454 -0
- package/dist/vtc/badges/images/get/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/badges/images/get/0.1/payload.js +266 -0
- package/dist/vtc/badges/images/get/0.1/payload.js.map +1 -0
- package/dist/vtc/badges/images/upload/0.1/payload.d.ts +455 -0
- package/dist/vtc/badges/images/upload/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/badges/images/upload/0.1/payload.js +276 -0
- package/dist/vtc/badges/images/upload/0.1/payload.js.map +1 -0
- package/dist/vtc/badges/kudos/give/0.1/payload.d.ts +613 -0
- package/dist/vtc/badges/kudos/give/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/badges/kudos/give/0.1/payload.js +353 -0
- package/dist/vtc/badges/kudos/give/0.1/payload.js.map +1 -0
- package/dist/vtc/badges/kudos/list/0.1/payload.d.ts +1766 -0
- package/dist/vtc/badges/kudos/list/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/badges/kudos/list/0.1/payload.js +995 -0
- package/dist/vtc/badges/kudos/list/0.1/payload.js.map +1 -0
- package/dist/vtc/badges/list/0.1/payload.d.ts +1096 -0
- package/dist/vtc/badges/list/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/badges/list/0.1/payload.js +617 -0
- package/dist/vtc/badges/list/0.1/payload.js.map +1 -0
- package/dist/vtc/badges/mine/accept/0.1/payload.d.ts +1376 -0
- package/dist/vtc/badges/mine/accept/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/badges/mine/accept/0.1/payload.js +799 -0
- package/dist/vtc/badges/mine/accept/0.1/payload.js.map +1 -0
- package/dist/vtc/badges/mine/arrange/0.1/payload.d.ts +1217 -0
- package/dist/vtc/badges/mine/arrange/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/badges/mine/arrange/0.1/payload.js +698 -0
- package/dist/vtc/badges/mine/arrange/0.1/payload.js.map +1 -0
- package/dist/vtc/badges/mine/decline/0.1/payload.d.ts +589 -0
- package/dist/vtc/badges/mine/decline/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/badges/mine/decline/0.1/payload.js +344 -0
- package/dist/vtc/badges/mine/decline/0.1/payload.js.map +1 -0
- package/dist/vtc/badges/mine/hide/0.1/payload.d.ts +1093 -0
- package/dist/vtc/badges/mine/hide/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/badges/mine/hide/0.1/payload.js +630 -0
- package/dist/vtc/badges/mine/hide/0.1/payload.js.map +1 -0
- package/dist/vtc/badges/mine/list/0.1/payload.d.ts +1897 -0
- package/dist/vtc/badges/mine/list/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/badges/mine/list/0.1/payload.js +1087 -0
- package/dist/vtc/badges/mine/list/0.1/payload.js.map +1 -0
- package/dist/vtc/badges/mine/show/0.1/payload.d.ts +1093 -0
- package/dist/vtc/badges/mine/show/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/badges/mine/show/0.1/payload.js +630 -0
- package/dist/vtc/badges/mine/show/0.1/payload.js.map +1 -0
- package/dist/vtc/badges/promote/0.1/payload.d.ts +1757 -0
- package/dist/vtc/badges/promote/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/badges/promote/0.1/payload.js +1018 -0
- package/dist/vtc/badges/promote/0.1/payload.js.map +1 -0
- package/dist/vtc/badges/retire/0.1/payload.d.ts +904 -0
- package/dist/vtc/badges/retire/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/badges/retire/0.1/payload.js +524 -0
- package/dist/vtc/badges/retire/0.1/payload.js.map +1 -0
- package/dist/vtc/badges/settings/show/0.1/payload.d.ts +731 -0
- package/dist/vtc/badges/settings/show/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/badges/settings/show/0.1/payload.js +421 -0
- package/dist/vtc/badges/settings/show/0.1/payload.js.map +1 -0
- package/dist/vtc/badges/settings/update/0.1/payload.d.ts +775 -0
- package/dist/vtc/badges/settings/update/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/badges/settings/update/0.1/payload.js +444 -0
- package/dist/vtc/badges/settings/update/0.1/payload.js.map +1 -0
- package/dist/vtc/badges/show/0.1/payload.d.ts +1056 -0
- package/dist/vtc/badges/show/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/badges/show/0.1/payload.js +613 -0
- package/dist/vtc/badges/show/0.1/payload.js.map +1 -0
- package/dist/vtc/badges/update/0.1/payload.d.ts +1033 -0
- package/dist/vtc/badges/update/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/badges/update/0.1/payload.js +588 -0
- package/dist/vtc/badges/update/0.1/payload.js.map +1 -0
- package/dist/vtc/badges/wall/show/0.1/payload.d.ts +1099 -0
- package/dist/vtc/badges/wall/show/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/badges/wall/show/0.1/payload.js +634 -0
- package/dist/vtc/badges/wall/show/0.1/payload.js.map +1 -0
- package/dist/vtc/groups/create/0.1/payload.d.ts +42 -2
- package/dist/vtc/groups/create/0.1/payload.d.ts.map +1 -1
- package/dist/vtc/groups/create/0.1/payload.js +20 -0
- package/dist/vtc/groups/create/0.1/payload.js.map +1 -1
- package/dist/vtc/groups/list/0.1/payload.d.ts +42 -2
- package/dist/vtc/groups/list/0.1/payload.d.ts.map +1 -1
- package/dist/vtc/groups/list/0.1/payload.js +20 -0
- package/dist/vtc/groups/list/0.1/payload.js.map +1 -1
- package/dist/vtc/groups/list/0.2/payload.d.ts +42 -2
- package/dist/vtc/groups/list/0.2/payload.d.ts.map +1 -1
- package/dist/vtc/groups/list/0.2/payload.js +20 -0
- package/dist/vtc/groups/list/0.2/payload.js.map +1 -1
- package/dist/vtc/groups/show/0.1/payload.d.ts +42 -2
- package/dist/vtc/groups/show/0.1/payload.d.ts.map +1 -1
- package/dist/vtc/groups/show/0.1/payload.js +20 -0
- package/dist/vtc/groups/show/0.1/payload.js.map +1 -1
- package/dist/vtc/groups/update/0.1/payload.d.ts +42 -2
- package/dist/vtc/groups/update/0.1/payload.d.ts.map +1 -1
- package/dist/vtc/groups/update/0.1/payload.js +20 -0
- package/dist/vtc/groups/update/0.1/payload.js.map +1 -1
- package/dist/vtn/registry/check/0.1/payload.d.ts +528 -0
- package/dist/vtn/registry/check/0.1/payload.d.ts.map +1 -0
- package/dist/vtn/registry/check/0.1/payload.js +282 -0
- package/dist/vtn/registry/check/0.1/payload.js.map +1 -0
- package/dist/vtn/registry/status/0.1/payload.d.ts +736 -0
- package/dist/vtn/registry/status/0.1/payload.d.ts.map +1 -0
- package/dist/vtn/registry/status/0.1/payload.js +421 -0
- package/dist/vtn/registry/status/0.1/payload.js.map +1 -0
- package/package.json +1 -1
- package/src/_shared/components.ts +254 -1
- package/src/index.ts +87 -0
- package/src/vta/collection/_shared/0.1/collection.ts +2 -2
- package/src/vta/collection/list/0.1/payload.ts +2 -2
- package/src/vta/collection/settings/set/0.1/payload.ts +319 -0
- package/src/vta/collection/settings/show/0.1/payload.ts +296 -0
- package/src/vtc/badges/_shared/0.1/badge.ts +23 -0
- package/src/vtc/badges/awards/list/0.1/payload.ts +768 -0
- package/src/vtc/badges/awards/offer/0.1/payload.ts +530 -0
- package/src/vtc/badges/awards/revoke/0.1/payload.ts +395 -0
- package/src/vtc/badges/awards/withdraw/0.1/payload.ts +395 -0
- package/src/vtc/badges/create/0.1/payload.ts +1137 -0
- package/src/vtc/badges/holders/list/0.1/payload.ts +628 -0
- package/src/vtc/badges/images/get/0.1/payload.ts +311 -0
- package/src/vtc/badges/images/upload/0.1/payload.ts +324 -0
- package/src/vtc/badges/kudos/give/0.1/payload.ts +401 -0
- package/src/vtc/badges/kudos/list/0.1/payload.ts +1080 -0
- package/src/vtc/badges/list/0.1/payload.ts +695 -0
- package/src/vtc/badges/mine/accept/0.1/payload.ts +840 -0
- package/src/vtc/badges/mine/arrange/0.1/payload.ts +768 -0
- package/src/vtc/badges/mine/decline/0.1/payload.ts +384 -0
- package/src/vtc/badges/mine/hide/0.1/payload.ts +670 -0
- package/src/vtc/badges/mine/list/0.1/payload.ts +1153 -0
- package/src/vtc/badges/mine/show/0.1/payload.ts +670 -0
- package/src/vtc/badges/promote/0.1/payload.ts +1088 -0
- package/src/vtc/badges/retire/0.1/payload.ts +565 -0
- package/src/vtc/badges/settings/show/0.1/payload.ts +457 -0
- package/src/vtc/badges/settings/update/0.1/payload.ts +490 -0
- package/src/vtc/badges/show/0.1/payload.ts +675 -0
- package/src/vtc/badges/update/0.1/payload.ts +656 -0
- package/src/vtc/badges/wall/show/0.1/payload.ts +684 -0
- package/src/vtc/groups/create/0.1/payload.ts +22 -2
- package/src/vtc/groups/list/0.1/payload.ts +22 -2
- package/src/vtc/groups/list/0.2/payload.ts +22 -2
- package/src/vtc/groups/show/0.1/payload.ts +22 -2
- package/src/vtc/groups/update/0.1/payload.ts +22 -2
- package/src/vtn/registry/check/0.1/payload.ts +365 -0
- package/src/vtn/registry/status/0.1/payload.ts +502 -0
|
@@ -0,0 +1,799 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vtc/badges/mine/accept/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
/** Trust Task type URI. */
|
|
6
|
+
export const TYPE_URI = "https://trusttasks.org/spec/vtc/badges/mine/accept/0.1";
|
|
7
|
+
/**
|
|
8
|
+
* The earlier version of this specification that this one declares it
|
|
9
|
+
* extends (front matter `extends`, SPEC §5.2 "Declared extension"), or
|
|
10
|
+
* `null`. Only the direct declaration — follow the chain with
|
|
11
|
+
* `extendsChain` / `readForSpec`.
|
|
12
|
+
*/
|
|
13
|
+
export const EXTENDS = null;
|
|
14
|
+
/**
|
|
15
|
+
* Why this version is deprecated, or `null` while it is current. A
|
|
16
|
+
* superseded or retired version is still supported, and is withdrawn from
|
|
17
|
+
* this package in a later scheduled batch (SPEC "Superseded and Withdrawn
|
|
18
|
+
* Versions").
|
|
19
|
+
*/
|
|
20
|
+
export const DEPRECATION = null;
|
|
21
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
22
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/badges/mine/accept/0.1#response";
|
|
23
|
+
/**
|
|
24
|
+
* This specification's payload schema, as a value.
|
|
25
|
+
*
|
|
26
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
27
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
28
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
29
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
30
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
31
|
+
*/
|
|
32
|
+
export const PAYLOAD_SCHEMA = {
|
|
33
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
34
|
+
"$id": "https://trusttasks.org/spec/vtc/badges/mine/accept/0.1",
|
|
35
|
+
"title": "VTC Badges — Mine — Accept — payload",
|
|
36
|
+
"description": "A member accepts a badge offered to them. For a community badge the badge group's DID issues their badge credential first and the membership is recorded after; for a kudos badge the giving is counted. The outer document members are owned by the framework — SPEC §6.3.",
|
|
37
|
+
"type": "object",
|
|
38
|
+
"additionalProperties": false,
|
|
39
|
+
"required": [
|
|
40
|
+
"awardId"
|
|
41
|
+
],
|
|
42
|
+
"properties": {
|
|
43
|
+
"awardId": {
|
|
44
|
+
"$ref": "#/$defs/AwardId"
|
|
45
|
+
},
|
|
46
|
+
"ext": {
|
|
47
|
+
"$ref": "#/$defs/Ext"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"$defs": {
|
|
51
|
+
"Response": {
|
|
52
|
+
"$anchor": "response",
|
|
53
|
+
"title": "VTC Badges — Mine — Accept — response payload",
|
|
54
|
+
"description": "The success response to a vtc/badges/mine/accept/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/badges/mine/accept/0.1#response.",
|
|
55
|
+
"type": "object",
|
|
56
|
+
"additionalProperties": false,
|
|
57
|
+
"required": [
|
|
58
|
+
"award",
|
|
59
|
+
"badge"
|
|
60
|
+
],
|
|
61
|
+
"properties": {
|
|
62
|
+
"award": {
|
|
63
|
+
"$ref": "#/$defs/Award",
|
|
64
|
+
"description": "The award, now `accepted`, with `credentialId` for a community badge."
|
|
65
|
+
},
|
|
66
|
+
"badge": {
|
|
67
|
+
"$ref": "#/$defs/MyBadge",
|
|
68
|
+
"description": "The badge as the holder now sees it, with their count."
|
|
69
|
+
},
|
|
70
|
+
"ext": {
|
|
71
|
+
"$ref": "#/$defs/Ext"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"Ext": {
|
|
76
|
+
"title": "Ext",
|
|
77
|
+
"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.",
|
|
78
|
+
"type": "object",
|
|
79
|
+
"minProperties": 1,
|
|
80
|
+
"additionalProperties": true,
|
|
81
|
+
"propertyNames": {
|
|
82
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"MyBadge": {
|
|
86
|
+
"title": "MyBadge",
|
|
87
|
+
"description": "A badge as its holder sees it in their own list: the wall entry plus what only the holder knows — whether they hid it, their position for it, and the credential that evidences it.",
|
|
88
|
+
"type": "object",
|
|
89
|
+
"additionalProperties": false,
|
|
90
|
+
"required": [
|
|
91
|
+
"badge",
|
|
92
|
+
"count",
|
|
93
|
+
"since",
|
|
94
|
+
"pinned",
|
|
95
|
+
"hidden"
|
|
96
|
+
],
|
|
97
|
+
"properties": {
|
|
98
|
+
"badge": {
|
|
99
|
+
"$ref": "#/$defs/Badge"
|
|
100
|
+
},
|
|
101
|
+
"count": {
|
|
102
|
+
"type": "integer",
|
|
103
|
+
"minimum": 1
|
|
104
|
+
},
|
|
105
|
+
"since": {
|
|
106
|
+
"type": "string",
|
|
107
|
+
"format": "date-time"
|
|
108
|
+
},
|
|
109
|
+
"latestAt": {
|
|
110
|
+
"type": "string",
|
|
111
|
+
"format": "date-time"
|
|
112
|
+
},
|
|
113
|
+
"pinned": {
|
|
114
|
+
"type": "boolean"
|
|
115
|
+
},
|
|
116
|
+
"hidden": {
|
|
117
|
+
"type": "boolean",
|
|
118
|
+
"description": "The holder hid it: off their wall, out of the badge's holder list for members, out of its count; the awards, the membership and the credential stand (VTI-BDG-030)."
|
|
119
|
+
},
|
|
120
|
+
"position": {
|
|
121
|
+
"type": "integer",
|
|
122
|
+
"minimum": 0,
|
|
123
|
+
"description": "The holder's order on their wall, lowest first."
|
|
124
|
+
},
|
|
125
|
+
"credentialId": {
|
|
126
|
+
"$ref": "#/$defs/GroupCredentialId"
|
|
127
|
+
},
|
|
128
|
+
"credentialValidUntil": {
|
|
129
|
+
"type": "string",
|
|
130
|
+
"format": "date-time"
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"Badge": {
|
|
135
|
+
"title": "Badge",
|
|
136
|
+
"description": "A badge as a caller who may see it sees it. `groupId` is present exactly when `kind` is `community`. `holderCount` only to callers who may see the badge's holders, counted over holders who have not hidden it (VTI-BDG-030, VTI-BDG-033). `createdBy` is the directory entry of the administrator or member who made it, where they have one.",
|
|
137
|
+
"type": "object",
|
|
138
|
+
"additionalProperties": false,
|
|
139
|
+
"required": [
|
|
140
|
+
"badgeId",
|
|
141
|
+
"kind",
|
|
142
|
+
"name",
|
|
143
|
+
"description",
|
|
144
|
+
"image",
|
|
145
|
+
"repeatable",
|
|
146
|
+
"listed",
|
|
147
|
+
"state",
|
|
148
|
+
"createdAt"
|
|
149
|
+
],
|
|
150
|
+
"properties": {
|
|
151
|
+
"badgeId": {
|
|
152
|
+
"$ref": "#/$defs/BadgeId"
|
|
153
|
+
},
|
|
154
|
+
"kind": {
|
|
155
|
+
"$ref": "#/$defs/BadgeKind"
|
|
156
|
+
},
|
|
157
|
+
"name": {
|
|
158
|
+
"$ref": "#/$defs/BadgeName"
|
|
159
|
+
},
|
|
160
|
+
"description": {
|
|
161
|
+
"$ref": "#/$defs/BadgeDescription"
|
|
162
|
+
},
|
|
163
|
+
"criteria": {
|
|
164
|
+
"$ref": "#/$defs/BadgeCriteria"
|
|
165
|
+
},
|
|
166
|
+
"image": {
|
|
167
|
+
"$ref": "#/$defs/CardBlobRef",
|
|
168
|
+
"description": "The badge's picture, re-encoded and stored by the community (vtc/badges/images/upload), read with vtc/badges/images/get. `url` and `urlExpiresAt` MAY appear in a projection as for a card picture; for a badge whose holders may show it outside, `url` MAY be the picture's stable public location."
|
|
169
|
+
},
|
|
170
|
+
"repeatable": {
|
|
171
|
+
"type": "boolean",
|
|
172
|
+
"description": "Whether one member may hold the badge more than once, each giving an award of its own (VTI-BDG-022). Always true for a kudos badge."
|
|
173
|
+
},
|
|
174
|
+
"requestable": {
|
|
175
|
+
"type": "boolean",
|
|
176
|
+
"description": "Community badges only. Whether a member may ask for it: a request to join its badge group, decided by its owners (VTI-BDG-014). Absent reads as false."
|
|
177
|
+
},
|
|
178
|
+
"listed": {
|
|
179
|
+
"type": "boolean",
|
|
180
|
+
"description": "Whether members who do not hold the badge see it in the community's badge list. An unlisted badge is seen by its holders, its owners and administrators."
|
|
181
|
+
},
|
|
182
|
+
"shareableOutside": {
|
|
183
|
+
"type": "boolean",
|
|
184
|
+
"description": "Community badges only. Whether its holders may show it outside the community, which decides the credential's regime: short-lived and renewed with no status when false, long-lived with a status in the community's own status set when true (VTI-BDG-061, VTI-BDG-062). Absent reads as false."
|
|
185
|
+
},
|
|
186
|
+
"groupId": {
|
|
187
|
+
"$ref": "#/$defs/GroupId",
|
|
188
|
+
"description": "The badge group that backs a community badge: its managers are the badge's owners, its members the holders, its DID the credential's issuer."
|
|
189
|
+
},
|
|
190
|
+
"state": {
|
|
191
|
+
"$ref": "#/$defs/BadgeState"
|
|
192
|
+
},
|
|
193
|
+
"holderCount": {
|
|
194
|
+
"type": "integer",
|
|
195
|
+
"minimum": 0,
|
|
196
|
+
"description": "Holders who show the badge. Only to callers who may see the holders."
|
|
197
|
+
},
|
|
198
|
+
"createdAt": {
|
|
199
|
+
"type": "string",
|
|
200
|
+
"format": "date-time"
|
|
201
|
+
},
|
|
202
|
+
"createdBy": {
|
|
203
|
+
"$ref": "#/$defs/EntryId"
|
|
204
|
+
},
|
|
205
|
+
"updatedAt": {
|
|
206
|
+
"type": "string",
|
|
207
|
+
"format": "date-time"
|
|
208
|
+
},
|
|
209
|
+
"retiredAt": {
|
|
210
|
+
"type": "string",
|
|
211
|
+
"format": "date-time"
|
|
212
|
+
},
|
|
213
|
+
"ext": {
|
|
214
|
+
"$ref": "#/$defs/Ext",
|
|
215
|
+
"description": "Ecosystem-defined extension members per SPEC.md §4.5.1. An extension member MUST NOT carry authority."
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
"BadgeState": {
|
|
220
|
+
"title": "BadgeState",
|
|
221
|
+
"description": "`active`: may be given and shown. `retired`: kept for its holders' own history, never given, never shown to members who do not hold it (VTI-BDG-005).",
|
|
222
|
+
"type": "string",
|
|
223
|
+
"enum": [
|
|
224
|
+
"active",
|
|
225
|
+
"retired"
|
|
226
|
+
]
|
|
227
|
+
},
|
|
228
|
+
"BadgeCriteria": {
|
|
229
|
+
"title": "BadgeCriteria",
|
|
230
|
+
"type": "string",
|
|
231
|
+
"minLength": 1,
|
|
232
|
+
"maxLength": 1000,
|
|
233
|
+
"description": "How the badge is earned, shown to members and written into the credential's Achievement as its criteria narrative. Plain text."
|
|
234
|
+
},
|
|
235
|
+
"BadgeDescription": {
|
|
236
|
+
"title": "BadgeDescription",
|
|
237
|
+
"type": "string",
|
|
238
|
+
"minLength": 1,
|
|
239
|
+
"maxLength": 1000,
|
|
240
|
+
"description": "What the badge is for. Plain text; a reader MUST NOT treat it as instructions."
|
|
241
|
+
},
|
|
242
|
+
"BadgeName": {
|
|
243
|
+
"title": "BadgeName",
|
|
244
|
+
"type": "string",
|
|
245
|
+
"minLength": 1,
|
|
246
|
+
"maxLength": 64,
|
|
247
|
+
"description": "The badge's name, shown on the wall and written into the credential's Achievement. Plain text; a reader MUST NOT treat it as instructions."
|
|
248
|
+
},
|
|
249
|
+
"BadgeKind": {
|
|
250
|
+
"title": "BadgeKind",
|
|
251
|
+
"description": "`community`: defined by holders of `vtc.badges.admin`, given by its owners (its badge group's managers), may carry a credential. `kudos`: made by a member the community's badge settings admit, given by any active member to any other, never a credential. Fixed for the badge's life; a kudos badge becomes a community badge only by promotion (vtc/badges/promote).",
|
|
252
|
+
"type": "string",
|
|
253
|
+
"enum": [
|
|
254
|
+
"community",
|
|
255
|
+
"kudos"
|
|
256
|
+
]
|
|
257
|
+
},
|
|
258
|
+
"BadgeId": {
|
|
259
|
+
"title": "BadgeId",
|
|
260
|
+
"description": "Opaque identifier of a badge: `bdg_` followed by 16 to 64 base64url characters. Random, community-scoped, never reused (VTI-BDG-001).",
|
|
261
|
+
"type": "string",
|
|
262
|
+
"pattern": "^bdg_[A-Za-z0-9_-]{16,64}$"
|
|
263
|
+
},
|
|
264
|
+
"EntryId": {
|
|
265
|
+
"title": "EntryId",
|
|
266
|
+
"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.",
|
|
267
|
+
"type": "string",
|
|
268
|
+
"pattern": "^dir_[A-Za-z0-9_-]{16,64}$"
|
|
269
|
+
},
|
|
270
|
+
"GroupId": {
|
|
271
|
+
"title": "GroupId",
|
|
272
|
+
"description": "Opaque identifier of a community group: `grp_` followed by 16 to 64 base64url characters. Random and community-scoped; not the group's DID.",
|
|
273
|
+
"type": "string",
|
|
274
|
+
"pattern": "^grp_[A-Za-z0-9_-]{16,64}$"
|
|
275
|
+
},
|
|
276
|
+
"CardBlobRef": {
|
|
277
|
+
"title": "CardBlobRef",
|
|
278
|
+
"description": "A content-addressed image held in the community's blob store — an avatar or an `image` field. At most 256 KiB, images only, re-encoded by the community on upload (vtc/directory/images/upload: metadata stripped, dimensions capped) so its digest does not link the member across communities. A viewer reads the bytes with vtc/directory/images/get, which answers only where the same projection shows the value. `url` and `urlExpiresAt` MAY appear in a projection: a short-lived URL the community checks against the same projection, so a member-only image is never a public URL. A community that does not offer one leaves both out.",
|
|
279
|
+
"type": "object",
|
|
280
|
+
"additionalProperties": false,
|
|
281
|
+
"required": [
|
|
282
|
+
"sha256",
|
|
283
|
+
"mediaType"
|
|
284
|
+
],
|
|
285
|
+
"properties": {
|
|
286
|
+
"sha256": {
|
|
287
|
+
"type": "string",
|
|
288
|
+
"pattern": "^[0-9a-f]{64}$",
|
|
289
|
+
"description": "Lowercase hex SHA-256 of the stored, re-encoded bytes."
|
|
290
|
+
},
|
|
291
|
+
"mediaType": {
|
|
292
|
+
"type": "string",
|
|
293
|
+
"enum": [
|
|
294
|
+
"image/png",
|
|
295
|
+
"image/jpeg",
|
|
296
|
+
"image/webp",
|
|
297
|
+
"image/avif"
|
|
298
|
+
],
|
|
299
|
+
"description": "Media type of the stored bytes."
|
|
300
|
+
},
|
|
301
|
+
"size": {
|
|
302
|
+
"type": "integer",
|
|
303
|
+
"minimum": 1,
|
|
304
|
+
"maximum": 262144,
|
|
305
|
+
"description": "Size in bytes of the stored bytes."
|
|
306
|
+
},
|
|
307
|
+
"url": {
|
|
308
|
+
"type": "string",
|
|
309
|
+
"format": "uri",
|
|
310
|
+
"maxLength": 2048,
|
|
311
|
+
"description": "Projection only: a URL the viewer can fetch the image from until `urlExpiresAt`."
|
|
312
|
+
},
|
|
313
|
+
"urlExpiresAt": {
|
|
314
|
+
"type": "string",
|
|
315
|
+
"format": "date-time",
|
|
316
|
+
"description": "Projection only: when `url` stops working."
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
"GroupCredentialId": {
|
|
321
|
+
"title": "GroupCredentialId",
|
|
322
|
+
"description": "Identifier (`id`) of a group membership credential issued to a member. Each renewal issues a new credential with a new identifier. Validity is the community's setting; a community SHOULD default to 30 days, renewed when 10 days remain.",
|
|
323
|
+
"type": "string",
|
|
324
|
+
"minLength": 1,
|
|
325
|
+
"maxLength": 512
|
|
326
|
+
},
|
|
327
|
+
"Award": {
|
|
328
|
+
"title": "Award",
|
|
329
|
+
"description": "One giving of a badge to one member. `givenBy` is the giver's directory entry, absent for an award a dynamic badge group's rule made. `note` is shown to the recipient, the giver, the badge's owners and administrators, never to other members. `credentialId` is present on an accepted award of a community badge: the badge credential that evidences it, renewed or re-issued as the badge's regime requires.",
|
|
330
|
+
"type": "object",
|
|
331
|
+
"additionalProperties": false,
|
|
332
|
+
"required": [
|
|
333
|
+
"awardId",
|
|
334
|
+
"badgeId",
|
|
335
|
+
"entryId",
|
|
336
|
+
"state",
|
|
337
|
+
"offeredAt"
|
|
338
|
+
],
|
|
339
|
+
"properties": {
|
|
340
|
+
"awardId": {
|
|
341
|
+
"$ref": "#/$defs/AwardId"
|
|
342
|
+
},
|
|
343
|
+
"badgeId": {
|
|
344
|
+
"$ref": "#/$defs/BadgeId"
|
|
345
|
+
},
|
|
346
|
+
"entryId": {
|
|
347
|
+
"$ref": "#/$defs/EntryId",
|
|
348
|
+
"description": "The recipient."
|
|
349
|
+
},
|
|
350
|
+
"givenBy": {
|
|
351
|
+
"$ref": "#/$defs/EntryId"
|
|
352
|
+
},
|
|
353
|
+
"note": {
|
|
354
|
+
"$ref": "#/$defs/AwardNote"
|
|
355
|
+
},
|
|
356
|
+
"state": {
|
|
357
|
+
"$ref": "#/$defs/AwardState"
|
|
358
|
+
},
|
|
359
|
+
"offeredAt": {
|
|
360
|
+
"type": "string",
|
|
361
|
+
"format": "date-time"
|
|
362
|
+
},
|
|
363
|
+
"decidedAt": {
|
|
364
|
+
"type": "string",
|
|
365
|
+
"format": "date-time",
|
|
366
|
+
"description": "When the recipient accepted or declined, the giver withdrew, the offer expired, or the award was revoked."
|
|
367
|
+
},
|
|
368
|
+
"expiresAt": {
|
|
369
|
+
"type": "string",
|
|
370
|
+
"format": "date-time",
|
|
371
|
+
"description": "When an unanswered offer lapses, where the community expires offers."
|
|
372
|
+
},
|
|
373
|
+
"credentialId": {
|
|
374
|
+
"$ref": "#/$defs/GroupCredentialId"
|
|
375
|
+
},
|
|
376
|
+
"ext": {
|
|
377
|
+
"$ref": "#/$defs/Ext"
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
},
|
|
381
|
+
"AwardState": {
|
|
382
|
+
"title": "AwardState",
|
|
383
|
+
"description": "`offered`: waiting for the recipient. `accepted`: the recipient took it; for a community badge the credential was issued and the membership recorded. `declined`: the recipient declined; nothing was recorded in the group and nothing issued. `withdrawn`: the giver withdrew the offer before a decision. `expired`: the offer lapsed unanswered. `revoked`: taken back after acceptance (VTI-BDG-023).",
|
|
384
|
+
"type": "string",
|
|
385
|
+
"enum": [
|
|
386
|
+
"offered",
|
|
387
|
+
"accepted",
|
|
388
|
+
"declined",
|
|
389
|
+
"withdrawn",
|
|
390
|
+
"expired",
|
|
391
|
+
"revoked"
|
|
392
|
+
]
|
|
393
|
+
},
|
|
394
|
+
"AwardNote": {
|
|
395
|
+
"title": "AwardNote",
|
|
396
|
+
"type": "string",
|
|
397
|
+
"minLength": 1,
|
|
398
|
+
"maxLength": 500,
|
|
399
|
+
"description": "What the award is for, from the giver, shown to the recipient and written as the award's evidence narrative where the badge carries a credential. Plain text; erased with its author (VTI-BDG-090)."
|
|
400
|
+
},
|
|
401
|
+
"AwardId": {
|
|
402
|
+
"title": "AwardId",
|
|
403
|
+
"description": "Opaque identifier of one giving of a badge to one member: `awd_` followed by 16 to 64 base64url characters. Random and unique within the community.",
|
|
404
|
+
"type": "string",
|
|
405
|
+
"pattern": "^awd_[A-Za-z0-9_-]{16,64}$"
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
410
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
411
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
412
|
+
"$ref": "#/$defs/Response",
|
|
413
|
+
"$defs": {
|
|
414
|
+
"Response": {
|
|
415
|
+
"$anchor": "response",
|
|
416
|
+
"title": "VTC Badges — Mine — Accept — response payload",
|
|
417
|
+
"description": "The success response to a vtc/badges/mine/accept/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/badges/mine/accept/0.1#response.",
|
|
418
|
+
"type": "object",
|
|
419
|
+
"additionalProperties": false,
|
|
420
|
+
"required": [
|
|
421
|
+
"award",
|
|
422
|
+
"badge"
|
|
423
|
+
],
|
|
424
|
+
"properties": {
|
|
425
|
+
"award": {
|
|
426
|
+
"$ref": "#/$defs/Award",
|
|
427
|
+
"description": "The award, now `accepted`, with `credentialId` for a community badge."
|
|
428
|
+
},
|
|
429
|
+
"badge": {
|
|
430
|
+
"$ref": "#/$defs/MyBadge",
|
|
431
|
+
"description": "The badge as the holder now sees it, with their count."
|
|
432
|
+
},
|
|
433
|
+
"ext": {
|
|
434
|
+
"$ref": "#/$defs/Ext"
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
},
|
|
438
|
+
"Ext": {
|
|
439
|
+
"title": "Ext",
|
|
440
|
+
"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.",
|
|
441
|
+
"type": "object",
|
|
442
|
+
"minProperties": 1,
|
|
443
|
+
"additionalProperties": true,
|
|
444
|
+
"propertyNames": {
|
|
445
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
446
|
+
}
|
|
447
|
+
},
|
|
448
|
+
"MyBadge": {
|
|
449
|
+
"title": "MyBadge",
|
|
450
|
+
"description": "A badge as its holder sees it in their own list: the wall entry plus what only the holder knows — whether they hid it, their position for it, and the credential that evidences it.",
|
|
451
|
+
"type": "object",
|
|
452
|
+
"additionalProperties": false,
|
|
453
|
+
"required": [
|
|
454
|
+
"badge",
|
|
455
|
+
"count",
|
|
456
|
+
"since",
|
|
457
|
+
"pinned",
|
|
458
|
+
"hidden"
|
|
459
|
+
],
|
|
460
|
+
"properties": {
|
|
461
|
+
"badge": {
|
|
462
|
+
"$ref": "#/$defs/Badge"
|
|
463
|
+
},
|
|
464
|
+
"count": {
|
|
465
|
+
"type": "integer",
|
|
466
|
+
"minimum": 1
|
|
467
|
+
},
|
|
468
|
+
"since": {
|
|
469
|
+
"type": "string",
|
|
470
|
+
"format": "date-time"
|
|
471
|
+
},
|
|
472
|
+
"latestAt": {
|
|
473
|
+
"type": "string",
|
|
474
|
+
"format": "date-time"
|
|
475
|
+
},
|
|
476
|
+
"pinned": {
|
|
477
|
+
"type": "boolean"
|
|
478
|
+
},
|
|
479
|
+
"hidden": {
|
|
480
|
+
"type": "boolean",
|
|
481
|
+
"description": "The holder hid it: off their wall, out of the badge's holder list for members, out of its count; the awards, the membership and the credential stand (VTI-BDG-030)."
|
|
482
|
+
},
|
|
483
|
+
"position": {
|
|
484
|
+
"type": "integer",
|
|
485
|
+
"minimum": 0,
|
|
486
|
+
"description": "The holder's order on their wall, lowest first."
|
|
487
|
+
},
|
|
488
|
+
"credentialId": {
|
|
489
|
+
"$ref": "#/$defs/GroupCredentialId"
|
|
490
|
+
},
|
|
491
|
+
"credentialValidUntil": {
|
|
492
|
+
"type": "string",
|
|
493
|
+
"format": "date-time"
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
},
|
|
497
|
+
"Badge": {
|
|
498
|
+
"title": "Badge",
|
|
499
|
+
"description": "A badge as a caller who may see it sees it. `groupId` is present exactly when `kind` is `community`. `holderCount` only to callers who may see the badge's holders, counted over holders who have not hidden it (VTI-BDG-030, VTI-BDG-033). `createdBy` is the directory entry of the administrator or member who made it, where they have one.",
|
|
500
|
+
"type": "object",
|
|
501
|
+
"additionalProperties": false,
|
|
502
|
+
"required": [
|
|
503
|
+
"badgeId",
|
|
504
|
+
"kind",
|
|
505
|
+
"name",
|
|
506
|
+
"description",
|
|
507
|
+
"image",
|
|
508
|
+
"repeatable",
|
|
509
|
+
"listed",
|
|
510
|
+
"state",
|
|
511
|
+
"createdAt"
|
|
512
|
+
],
|
|
513
|
+
"properties": {
|
|
514
|
+
"badgeId": {
|
|
515
|
+
"$ref": "#/$defs/BadgeId"
|
|
516
|
+
},
|
|
517
|
+
"kind": {
|
|
518
|
+
"$ref": "#/$defs/BadgeKind"
|
|
519
|
+
},
|
|
520
|
+
"name": {
|
|
521
|
+
"$ref": "#/$defs/BadgeName"
|
|
522
|
+
},
|
|
523
|
+
"description": {
|
|
524
|
+
"$ref": "#/$defs/BadgeDescription"
|
|
525
|
+
},
|
|
526
|
+
"criteria": {
|
|
527
|
+
"$ref": "#/$defs/BadgeCriteria"
|
|
528
|
+
},
|
|
529
|
+
"image": {
|
|
530
|
+
"$ref": "#/$defs/CardBlobRef",
|
|
531
|
+
"description": "The badge's picture, re-encoded and stored by the community (vtc/badges/images/upload), read with vtc/badges/images/get. `url` and `urlExpiresAt` MAY appear in a projection as for a card picture; for a badge whose holders may show it outside, `url` MAY be the picture's stable public location."
|
|
532
|
+
},
|
|
533
|
+
"repeatable": {
|
|
534
|
+
"type": "boolean",
|
|
535
|
+
"description": "Whether one member may hold the badge more than once, each giving an award of its own (VTI-BDG-022). Always true for a kudos badge."
|
|
536
|
+
},
|
|
537
|
+
"requestable": {
|
|
538
|
+
"type": "boolean",
|
|
539
|
+
"description": "Community badges only. Whether a member may ask for it: a request to join its badge group, decided by its owners (VTI-BDG-014). Absent reads as false."
|
|
540
|
+
},
|
|
541
|
+
"listed": {
|
|
542
|
+
"type": "boolean",
|
|
543
|
+
"description": "Whether members who do not hold the badge see it in the community's badge list. An unlisted badge is seen by its holders, its owners and administrators."
|
|
544
|
+
},
|
|
545
|
+
"shareableOutside": {
|
|
546
|
+
"type": "boolean",
|
|
547
|
+
"description": "Community badges only. Whether its holders may show it outside the community, which decides the credential's regime: short-lived and renewed with no status when false, long-lived with a status in the community's own status set when true (VTI-BDG-061, VTI-BDG-062). Absent reads as false."
|
|
548
|
+
},
|
|
549
|
+
"groupId": {
|
|
550
|
+
"$ref": "#/$defs/GroupId",
|
|
551
|
+
"description": "The badge group that backs a community badge: its managers are the badge's owners, its members the holders, its DID the credential's issuer."
|
|
552
|
+
},
|
|
553
|
+
"state": {
|
|
554
|
+
"$ref": "#/$defs/BadgeState"
|
|
555
|
+
},
|
|
556
|
+
"holderCount": {
|
|
557
|
+
"type": "integer",
|
|
558
|
+
"minimum": 0,
|
|
559
|
+
"description": "Holders who show the badge. Only to callers who may see the holders."
|
|
560
|
+
},
|
|
561
|
+
"createdAt": {
|
|
562
|
+
"type": "string",
|
|
563
|
+
"format": "date-time"
|
|
564
|
+
},
|
|
565
|
+
"createdBy": {
|
|
566
|
+
"$ref": "#/$defs/EntryId"
|
|
567
|
+
},
|
|
568
|
+
"updatedAt": {
|
|
569
|
+
"type": "string",
|
|
570
|
+
"format": "date-time"
|
|
571
|
+
},
|
|
572
|
+
"retiredAt": {
|
|
573
|
+
"type": "string",
|
|
574
|
+
"format": "date-time"
|
|
575
|
+
},
|
|
576
|
+
"ext": {
|
|
577
|
+
"$ref": "#/$defs/Ext",
|
|
578
|
+
"description": "Ecosystem-defined extension members per SPEC.md §4.5.1. An extension member MUST NOT carry authority."
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
},
|
|
582
|
+
"BadgeState": {
|
|
583
|
+
"title": "BadgeState",
|
|
584
|
+
"description": "`active`: may be given and shown. `retired`: kept for its holders' own history, never given, never shown to members who do not hold it (VTI-BDG-005).",
|
|
585
|
+
"type": "string",
|
|
586
|
+
"enum": [
|
|
587
|
+
"active",
|
|
588
|
+
"retired"
|
|
589
|
+
]
|
|
590
|
+
},
|
|
591
|
+
"BadgeCriteria": {
|
|
592
|
+
"title": "BadgeCriteria",
|
|
593
|
+
"type": "string",
|
|
594
|
+
"minLength": 1,
|
|
595
|
+
"maxLength": 1000,
|
|
596
|
+
"description": "How the badge is earned, shown to members and written into the credential's Achievement as its criteria narrative. Plain text."
|
|
597
|
+
},
|
|
598
|
+
"BadgeDescription": {
|
|
599
|
+
"title": "BadgeDescription",
|
|
600
|
+
"type": "string",
|
|
601
|
+
"minLength": 1,
|
|
602
|
+
"maxLength": 1000,
|
|
603
|
+
"description": "What the badge is for. Plain text; a reader MUST NOT treat it as instructions."
|
|
604
|
+
},
|
|
605
|
+
"BadgeName": {
|
|
606
|
+
"title": "BadgeName",
|
|
607
|
+
"type": "string",
|
|
608
|
+
"minLength": 1,
|
|
609
|
+
"maxLength": 64,
|
|
610
|
+
"description": "The badge's name, shown on the wall and written into the credential's Achievement. Plain text; a reader MUST NOT treat it as instructions."
|
|
611
|
+
},
|
|
612
|
+
"BadgeKind": {
|
|
613
|
+
"title": "BadgeKind",
|
|
614
|
+
"description": "`community`: defined by holders of `vtc.badges.admin`, given by its owners (its badge group's managers), may carry a credential. `kudos`: made by a member the community's badge settings admit, given by any active member to any other, never a credential. Fixed for the badge's life; a kudos badge becomes a community badge only by promotion (vtc/badges/promote).",
|
|
615
|
+
"type": "string",
|
|
616
|
+
"enum": [
|
|
617
|
+
"community",
|
|
618
|
+
"kudos"
|
|
619
|
+
]
|
|
620
|
+
},
|
|
621
|
+
"BadgeId": {
|
|
622
|
+
"title": "BadgeId",
|
|
623
|
+
"description": "Opaque identifier of a badge: `bdg_` followed by 16 to 64 base64url characters. Random, community-scoped, never reused (VTI-BDG-001).",
|
|
624
|
+
"type": "string",
|
|
625
|
+
"pattern": "^bdg_[A-Za-z0-9_-]{16,64}$"
|
|
626
|
+
},
|
|
627
|
+
"EntryId": {
|
|
628
|
+
"title": "EntryId",
|
|
629
|
+
"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.",
|
|
630
|
+
"type": "string",
|
|
631
|
+
"pattern": "^dir_[A-Za-z0-9_-]{16,64}$"
|
|
632
|
+
},
|
|
633
|
+
"GroupId": {
|
|
634
|
+
"title": "GroupId",
|
|
635
|
+
"description": "Opaque identifier of a community group: `grp_` followed by 16 to 64 base64url characters. Random and community-scoped; not the group's DID.",
|
|
636
|
+
"type": "string",
|
|
637
|
+
"pattern": "^grp_[A-Za-z0-9_-]{16,64}$"
|
|
638
|
+
},
|
|
639
|
+
"CardBlobRef": {
|
|
640
|
+
"title": "CardBlobRef",
|
|
641
|
+
"description": "A content-addressed image held in the community's blob store — an avatar or an `image` field. At most 256 KiB, images only, re-encoded by the community on upload (vtc/directory/images/upload: metadata stripped, dimensions capped) so its digest does not link the member across communities. A viewer reads the bytes with vtc/directory/images/get, which answers only where the same projection shows the value. `url` and `urlExpiresAt` MAY appear in a projection: a short-lived URL the community checks against the same projection, so a member-only image is never a public URL. A community that does not offer one leaves both out.",
|
|
642
|
+
"type": "object",
|
|
643
|
+
"additionalProperties": false,
|
|
644
|
+
"required": [
|
|
645
|
+
"sha256",
|
|
646
|
+
"mediaType"
|
|
647
|
+
],
|
|
648
|
+
"properties": {
|
|
649
|
+
"sha256": {
|
|
650
|
+
"type": "string",
|
|
651
|
+
"pattern": "^[0-9a-f]{64}$",
|
|
652
|
+
"description": "Lowercase hex SHA-256 of the stored, re-encoded bytes."
|
|
653
|
+
},
|
|
654
|
+
"mediaType": {
|
|
655
|
+
"type": "string",
|
|
656
|
+
"enum": [
|
|
657
|
+
"image/png",
|
|
658
|
+
"image/jpeg",
|
|
659
|
+
"image/webp",
|
|
660
|
+
"image/avif"
|
|
661
|
+
],
|
|
662
|
+
"description": "Media type of the stored bytes."
|
|
663
|
+
},
|
|
664
|
+
"size": {
|
|
665
|
+
"type": "integer",
|
|
666
|
+
"minimum": 1,
|
|
667
|
+
"maximum": 262144,
|
|
668
|
+
"description": "Size in bytes of the stored bytes."
|
|
669
|
+
},
|
|
670
|
+
"url": {
|
|
671
|
+
"type": "string",
|
|
672
|
+
"format": "uri",
|
|
673
|
+
"maxLength": 2048,
|
|
674
|
+
"description": "Projection only: a URL the viewer can fetch the image from until `urlExpiresAt`."
|
|
675
|
+
},
|
|
676
|
+
"urlExpiresAt": {
|
|
677
|
+
"type": "string",
|
|
678
|
+
"format": "date-time",
|
|
679
|
+
"description": "Projection only: when `url` stops working."
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
},
|
|
683
|
+
"GroupCredentialId": {
|
|
684
|
+
"title": "GroupCredentialId",
|
|
685
|
+
"description": "Identifier (`id`) of a group membership credential issued to a member. Each renewal issues a new credential with a new identifier. Validity is the community's setting; a community SHOULD default to 30 days, renewed when 10 days remain.",
|
|
686
|
+
"type": "string",
|
|
687
|
+
"minLength": 1,
|
|
688
|
+
"maxLength": 512
|
|
689
|
+
},
|
|
690
|
+
"Award": {
|
|
691
|
+
"title": "Award",
|
|
692
|
+
"description": "One giving of a badge to one member. `givenBy` is the giver's directory entry, absent for an award a dynamic badge group's rule made. `note` is shown to the recipient, the giver, the badge's owners and administrators, never to other members. `credentialId` is present on an accepted award of a community badge: the badge credential that evidences it, renewed or re-issued as the badge's regime requires.",
|
|
693
|
+
"type": "object",
|
|
694
|
+
"additionalProperties": false,
|
|
695
|
+
"required": [
|
|
696
|
+
"awardId",
|
|
697
|
+
"badgeId",
|
|
698
|
+
"entryId",
|
|
699
|
+
"state",
|
|
700
|
+
"offeredAt"
|
|
701
|
+
],
|
|
702
|
+
"properties": {
|
|
703
|
+
"awardId": {
|
|
704
|
+
"$ref": "#/$defs/AwardId"
|
|
705
|
+
},
|
|
706
|
+
"badgeId": {
|
|
707
|
+
"$ref": "#/$defs/BadgeId"
|
|
708
|
+
},
|
|
709
|
+
"entryId": {
|
|
710
|
+
"$ref": "#/$defs/EntryId",
|
|
711
|
+
"description": "The recipient."
|
|
712
|
+
},
|
|
713
|
+
"givenBy": {
|
|
714
|
+
"$ref": "#/$defs/EntryId"
|
|
715
|
+
},
|
|
716
|
+
"note": {
|
|
717
|
+
"$ref": "#/$defs/AwardNote"
|
|
718
|
+
},
|
|
719
|
+
"state": {
|
|
720
|
+
"$ref": "#/$defs/AwardState"
|
|
721
|
+
},
|
|
722
|
+
"offeredAt": {
|
|
723
|
+
"type": "string",
|
|
724
|
+
"format": "date-time"
|
|
725
|
+
},
|
|
726
|
+
"decidedAt": {
|
|
727
|
+
"type": "string",
|
|
728
|
+
"format": "date-time",
|
|
729
|
+
"description": "When the recipient accepted or declined, the giver withdrew, the offer expired, or the award was revoked."
|
|
730
|
+
},
|
|
731
|
+
"expiresAt": {
|
|
732
|
+
"type": "string",
|
|
733
|
+
"format": "date-time",
|
|
734
|
+
"description": "When an unanswered offer lapses, where the community expires offers."
|
|
735
|
+
},
|
|
736
|
+
"credentialId": {
|
|
737
|
+
"$ref": "#/$defs/GroupCredentialId"
|
|
738
|
+
},
|
|
739
|
+
"ext": {
|
|
740
|
+
"$ref": "#/$defs/Ext"
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
},
|
|
744
|
+
"AwardState": {
|
|
745
|
+
"title": "AwardState",
|
|
746
|
+
"description": "`offered`: waiting for the recipient. `accepted`: the recipient took it; for a community badge the credential was issued and the membership recorded. `declined`: the recipient declined; nothing was recorded in the group and nothing issued. `withdrawn`: the giver withdrew the offer before a decision. `expired`: the offer lapsed unanswered. `revoked`: taken back after acceptance (VTI-BDG-023).",
|
|
747
|
+
"type": "string",
|
|
748
|
+
"enum": [
|
|
749
|
+
"offered",
|
|
750
|
+
"accepted",
|
|
751
|
+
"declined",
|
|
752
|
+
"withdrawn",
|
|
753
|
+
"expired",
|
|
754
|
+
"revoked"
|
|
755
|
+
]
|
|
756
|
+
},
|
|
757
|
+
"AwardNote": {
|
|
758
|
+
"title": "AwardNote",
|
|
759
|
+
"type": "string",
|
|
760
|
+
"minLength": 1,
|
|
761
|
+
"maxLength": 500,
|
|
762
|
+
"description": "What the award is for, from the giver, shown to the recipient and written as the award's evidence narrative where the badge carries a credential. Plain text; erased with its author (VTI-BDG-090)."
|
|
763
|
+
},
|
|
764
|
+
"AwardId": {
|
|
765
|
+
"title": "AwardId",
|
|
766
|
+
"description": "Opaque identifier of one giving of a badge to one member: `awd_` followed by 16 to 64 base64url characters. Random and unique within the community.",
|
|
767
|
+
"type": "string",
|
|
768
|
+
"pattern": "^awd_[A-Za-z0-9_-]{16,64}$"
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
};
|
|
772
|
+
/**
|
|
773
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
774
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
775
|
+
* per-specification and cannot be derived from the document alone, and
|
|
776
|
+
* item 2 needs the schema this carries.
|
|
777
|
+
*/
|
|
778
|
+
export const SPEC = {
|
|
779
|
+
typeUri: TYPE_URI,
|
|
780
|
+
isBearer: false,
|
|
781
|
+
isProofRequired: true,
|
|
782
|
+
isRecipientRequired: true,
|
|
783
|
+
isIssuedAtRequired: true,
|
|
784
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
785
|
+
};
|
|
786
|
+
/**
|
|
787
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
788
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
789
|
+
* parties (§7.3 item 5).
|
|
790
|
+
*/
|
|
791
|
+
export const RESPONSE_SPEC = {
|
|
792
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
793
|
+
isBearer: false,
|
|
794
|
+
isProofRequired: true,
|
|
795
|
+
isRecipientRequired: true,
|
|
796
|
+
isIssuedAtRequired: true,
|
|
797
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
798
|
+
};
|
|
799
|
+
//# sourceMappingURL=payload.js.map
|