@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,1137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vtc/badges/create/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { Badge, BadgeCriteria, BadgeDescription, BadgeId, BadgeKind, BadgeName, BadgeState, CardBlobRef, DynamicRule, EntryId, Ext, FieldKey, Group, GroupAudience, GroupDescription, GroupId, GroupKind, GroupName, JoinPolicy, RuleCondition } from "../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Define a badge: a community badge, which creates the badge group that backs it, or a kudos badge a member makes. The outer document members are owned by the framework — SPEC §6.3.
|
|
11
|
+
*/
|
|
12
|
+
export interface VTCBadgesCreatePayload {
|
|
13
|
+
kind: BadgeKind;
|
|
14
|
+
name: BadgeName;
|
|
15
|
+
description: BadgeDescription;
|
|
16
|
+
criteria?: BadgeCriteria;
|
|
17
|
+
/**
|
|
18
|
+
* The picture, as the signer uploaded it with vtc/badges/images/upload.
|
|
19
|
+
*/
|
|
20
|
+
image: {
|
|
21
|
+
/**
|
|
22
|
+
* The digest vtc/badges/images/upload answered to this signer.
|
|
23
|
+
*/
|
|
24
|
+
sha256: string;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Whether one member may hold the badge more than once. Absent: false for a community badge; a kudos badge is always repeatable and refuses `false`.
|
|
28
|
+
*/
|
|
29
|
+
repeatable?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Community badges only. Whether members may ask for it (a request to join the badge group). Absent: false.
|
|
32
|
+
*/
|
|
33
|
+
requestable?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Whether members who do not hold it see it in the badge list. Absent: true.
|
|
36
|
+
*/
|
|
37
|
+
listed?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Community badges only. Whether holders may show it outside the community, which fixes the credential's regime. Absent: false.
|
|
40
|
+
*/
|
|
41
|
+
shareableOutside?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Community badges only. Who may see the badge's holders: the badge group's `showMembers`. Absent: `members`.
|
|
44
|
+
*/
|
|
45
|
+
holdersVisibleTo?: GroupAudience;
|
|
46
|
+
/**
|
|
47
|
+
* Community badges only. Present: the badge is automatic, backed by a dynamic badge group computed from `rule`; nobody gives it by hand and `requestable` is refused.
|
|
48
|
+
*/
|
|
49
|
+
automatic?: {
|
|
50
|
+
rule: DynamicRule;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Community badges only. Members to appoint as the badge's owners — the badge group's managers — as vtc/groups/managers/add appoints them, bounded by the signer's own holding.
|
|
54
|
+
*
|
|
55
|
+
* @maxItems 32
|
|
56
|
+
*/
|
|
57
|
+
owners?: EntryId[];
|
|
58
|
+
/**
|
|
59
|
+
* Why, recorded with the change.
|
|
60
|
+
*/
|
|
61
|
+
reason: string;
|
|
62
|
+
ext?: Ext;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The success response to a vtc/badges/create/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/badges/create/0.1#response.
|
|
66
|
+
*/
|
|
67
|
+
export interface VTCBadgesCreateResponsePayload {
|
|
68
|
+
badge: Badge;
|
|
69
|
+
/**
|
|
70
|
+
* The badge group, as vtc/groups/create answers it. Present exactly for a community badge.
|
|
71
|
+
*/
|
|
72
|
+
group?: Group;
|
|
73
|
+
ext?: Ext;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
77
|
+
export type { Badge, BadgeCriteria, BadgeDescription, BadgeId, BadgeKind, BadgeName, BadgeState, CardBlobRef, DynamicRule, EntryId, Ext, FieldKey, Group, GroupAudience, GroupDescription, GroupId, GroupKind, GroupName, JoinPolicy, RuleCondition };
|
|
78
|
+
|
|
79
|
+
/** Trust Task type URI. */
|
|
80
|
+
export const TYPE_URI = "https://trusttasks.org/spec/vtc/badges/create/0.1" as const;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* The earlier version of this specification that this one declares it
|
|
84
|
+
* extends (front matter `extends`, SPEC §5.2 "Declared extension"), or
|
|
85
|
+
* `null`. Only the direct declaration — follow the chain with
|
|
86
|
+
* `extendsChain` / `readForSpec`.
|
|
87
|
+
*/
|
|
88
|
+
export const EXTENDS: string | null = null;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Why this version is deprecated, or `null` while it is current. A
|
|
92
|
+
* superseded or retired version is still supported, and is withdrawn from
|
|
93
|
+
* this package in a later scheduled batch (SPEC "Superseded and Withdrawn
|
|
94
|
+
* Versions").
|
|
95
|
+
*/
|
|
96
|
+
export const DEPRECATION: string | null = null;
|
|
97
|
+
|
|
98
|
+
/** Stable alias for this specification's request payload shape. */
|
|
99
|
+
export type Payload = VTCBadgesCreatePayload;
|
|
100
|
+
|
|
101
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
102
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/badges/create/0.1#response" as const;
|
|
103
|
+
|
|
104
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
105
|
+
export type Response = VTCBadgesCreateResponsePayload;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* This specification's payload schema, as a value.
|
|
109
|
+
*
|
|
110
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
111
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
112
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
113
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
114
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
115
|
+
*/
|
|
116
|
+
export const PAYLOAD_SCHEMA = {
|
|
117
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
118
|
+
"$id": "https://trusttasks.org/spec/vtc/badges/create/0.1",
|
|
119
|
+
"title": "VTC Badges — Create — payload",
|
|
120
|
+
"description": "Define a badge: a community badge, which creates the badge group that backs it, or a kudos badge a member makes. The outer document members are owned by the framework — SPEC §6.3.",
|
|
121
|
+
"type": "object",
|
|
122
|
+
"additionalProperties": false,
|
|
123
|
+
"required": [
|
|
124
|
+
"kind",
|
|
125
|
+
"name",
|
|
126
|
+
"description",
|
|
127
|
+
"image",
|
|
128
|
+
"reason"
|
|
129
|
+
],
|
|
130
|
+
"properties": {
|
|
131
|
+
"kind": {
|
|
132
|
+
"$ref": "#/$defs/BadgeKind"
|
|
133
|
+
},
|
|
134
|
+
"name": {
|
|
135
|
+
"$ref": "#/$defs/BadgeName"
|
|
136
|
+
},
|
|
137
|
+
"description": {
|
|
138
|
+
"$ref": "#/$defs/BadgeDescription"
|
|
139
|
+
},
|
|
140
|
+
"criteria": {
|
|
141
|
+
"$ref": "#/$defs/BadgeCriteria"
|
|
142
|
+
},
|
|
143
|
+
"image": {
|
|
144
|
+
"type": "object",
|
|
145
|
+
"additionalProperties": false,
|
|
146
|
+
"required": [
|
|
147
|
+
"sha256"
|
|
148
|
+
],
|
|
149
|
+
"properties": {
|
|
150
|
+
"sha256": {
|
|
151
|
+
"type": "string",
|
|
152
|
+
"pattern": "^[0-9a-f]{64}$",
|
|
153
|
+
"description": "The digest vtc/badges/images/upload answered to this signer."
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
"description": "The picture, as the signer uploaded it with vtc/badges/images/upload."
|
|
157
|
+
},
|
|
158
|
+
"repeatable": {
|
|
159
|
+
"type": "boolean",
|
|
160
|
+
"description": "Whether one member may hold the badge more than once. Absent: false for a community badge; a kudos badge is always repeatable and refuses `false`."
|
|
161
|
+
},
|
|
162
|
+
"requestable": {
|
|
163
|
+
"type": "boolean",
|
|
164
|
+
"description": "Community badges only. Whether members may ask for it (a request to join the badge group). Absent: false."
|
|
165
|
+
},
|
|
166
|
+
"listed": {
|
|
167
|
+
"type": "boolean",
|
|
168
|
+
"description": "Whether members who do not hold it see it in the badge list. Absent: true."
|
|
169
|
+
},
|
|
170
|
+
"shareableOutside": {
|
|
171
|
+
"type": "boolean",
|
|
172
|
+
"description": "Community badges only. Whether holders may show it outside the community, which fixes the credential's regime. Absent: false."
|
|
173
|
+
},
|
|
174
|
+
"holdersVisibleTo": {
|
|
175
|
+
"$ref": "#/$defs/GroupAudience",
|
|
176
|
+
"description": "Community badges only. Who may see the badge's holders: the badge group's `showMembers`. Absent: `members`."
|
|
177
|
+
},
|
|
178
|
+
"automatic": {
|
|
179
|
+
"type": "object",
|
|
180
|
+
"additionalProperties": false,
|
|
181
|
+
"required": [
|
|
182
|
+
"rule"
|
|
183
|
+
],
|
|
184
|
+
"properties": {
|
|
185
|
+
"rule": {
|
|
186
|
+
"$ref": "#/$defs/DynamicRule"
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
"description": "Community badges only. Present: the badge is automatic, backed by a dynamic badge group computed from `rule`; nobody gives it by hand and `requestable` is refused."
|
|
190
|
+
},
|
|
191
|
+
"owners": {
|
|
192
|
+
"type": "array",
|
|
193
|
+
"maxItems": 32,
|
|
194
|
+
"uniqueItems": true,
|
|
195
|
+
"items": {
|
|
196
|
+
"$ref": "#/$defs/EntryId"
|
|
197
|
+
},
|
|
198
|
+
"description": "Community badges only. Members to appoint as the badge's owners — the badge group's managers — as vtc/groups/managers/add appoints them, bounded by the signer's own holding."
|
|
199
|
+
},
|
|
200
|
+
"reason": {
|
|
201
|
+
"type": "string",
|
|
202
|
+
"minLength": 1,
|
|
203
|
+
"maxLength": 1024,
|
|
204
|
+
"description": "Why, recorded with the change."
|
|
205
|
+
},
|
|
206
|
+
"ext": {
|
|
207
|
+
"$ref": "#/$defs/Ext"
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
"$defs": {
|
|
211
|
+
"Response": {
|
|
212
|
+
"$anchor": "response",
|
|
213
|
+
"title": "VTC Badges — Create — response payload",
|
|
214
|
+
"description": "The success response to a vtc/badges/create/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/badges/create/0.1#response.",
|
|
215
|
+
"type": "object",
|
|
216
|
+
"additionalProperties": false,
|
|
217
|
+
"required": [
|
|
218
|
+
"badge"
|
|
219
|
+
],
|
|
220
|
+
"properties": {
|
|
221
|
+
"badge": {
|
|
222
|
+
"$ref": "#/$defs/Badge"
|
|
223
|
+
},
|
|
224
|
+
"group": {
|
|
225
|
+
"$ref": "#/$defs/Group",
|
|
226
|
+
"description": "The badge group, as vtc/groups/create answers it. Present exactly for a community badge."
|
|
227
|
+
},
|
|
228
|
+
"ext": {
|
|
229
|
+
"$ref": "#/$defs/Ext"
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
"Ext": {
|
|
234
|
+
"title": "Ext",
|
|
235
|
+
"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.",
|
|
236
|
+
"type": "object",
|
|
237
|
+
"minProperties": 1,
|
|
238
|
+
"additionalProperties": true,
|
|
239
|
+
"propertyNames": {
|
|
240
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
"Group": {
|
|
244
|
+
"title": "Group",
|
|
245
|
+
"description": "A community group, as a caller who may see it sees it. Members a caller may not see are absent: `memberCount` only to those who may see the group's members, `managers` and `credentialAuthorityValidUntil` only to its managers.",
|
|
246
|
+
"type": "object",
|
|
247
|
+
"additionalProperties": false,
|
|
248
|
+
"required": [
|
|
249
|
+
"groupId",
|
|
250
|
+
"groupDid",
|
|
251
|
+
"name",
|
|
252
|
+
"kind",
|
|
253
|
+
"visibility",
|
|
254
|
+
"showMembers",
|
|
255
|
+
"issuesCredentials",
|
|
256
|
+
"carriesAuthority",
|
|
257
|
+
"createdAt"
|
|
258
|
+
],
|
|
259
|
+
"properties": {
|
|
260
|
+
"groupId": {
|
|
261
|
+
"$ref": "#/$defs/GroupId"
|
|
262
|
+
},
|
|
263
|
+
"groupDid": {
|
|
264
|
+
"type": "string",
|
|
265
|
+
"pattern": "^did:",
|
|
266
|
+
"maxLength": 2048,
|
|
267
|
+
"description": "The group's own DID, minted by the community's VTA for this group alone. It issues the group's membership credentials. Its DID document carries no name or description."
|
|
268
|
+
},
|
|
269
|
+
"name": {
|
|
270
|
+
"$ref": "#/$defs/GroupName"
|
|
271
|
+
},
|
|
272
|
+
"description": {
|
|
273
|
+
"$ref": "#/$defs/GroupDescription"
|
|
274
|
+
},
|
|
275
|
+
"kind": {
|
|
276
|
+
"$ref": "#/$defs/GroupKind"
|
|
277
|
+
},
|
|
278
|
+
"rule": {
|
|
279
|
+
"$ref": "#/$defs/DynamicRule",
|
|
280
|
+
"description": "Present exactly when `kind` is `dynamic`."
|
|
281
|
+
},
|
|
282
|
+
"joinPolicy": {
|
|
283
|
+
"$ref": "#/$defs/JoinPolicy",
|
|
284
|
+
"description": "Present exactly when `kind` is `static`."
|
|
285
|
+
},
|
|
286
|
+
"visibility": {
|
|
287
|
+
"$ref": "#/$defs/GroupAudience",
|
|
288
|
+
"description": "Who may see that the group exists, and its name and description."
|
|
289
|
+
},
|
|
290
|
+
"showMembers": {
|
|
291
|
+
"$ref": "#/$defs/GroupAudience",
|
|
292
|
+
"description": "Who may see the group's member list. Separate from `visibility`: a group everyone sees may show its members only to administrators. Never wider than `visibility`."
|
|
293
|
+
},
|
|
294
|
+
"issuesCredentials": {
|
|
295
|
+
"type": "boolean",
|
|
296
|
+
"description": "Whether the group's DID issues its members a membership credential. Default true."
|
|
297
|
+
},
|
|
298
|
+
"carriesAuthority": {
|
|
299
|
+
"type": "boolean",
|
|
300
|
+
"description": "`true` while the group has a `grants` or `role` binding. Such a group is `static` and `closed` for as long as it does."
|
|
301
|
+
},
|
|
302
|
+
"badgeId": {
|
|
303
|
+
"$ref": "#/$defs/BadgeId",
|
|
304
|
+
"description": "Present exactly when the group backs a community badge (vtc/badges/*): its managers are the badge's owners, its members the badge's holders, and its DID issues the badge credential in place of a membership credential. A badge group never carries authority, is not counted among the groups two members share, and is listed among the community's groups only to a caller who asks for badge groups (VTI-BDG-010 – VTI-BDG-012)."
|
|
305
|
+
},
|
|
306
|
+
"memberCount": {
|
|
307
|
+
"type": "integer",
|
|
308
|
+
"minimum": 0,
|
|
309
|
+
"description": "Active members. Only to callers who may see the member list."
|
|
310
|
+
},
|
|
311
|
+
"managers": {
|
|
312
|
+
"type": "array",
|
|
313
|
+
"maxItems": 256,
|
|
314
|
+
"uniqueItems": true,
|
|
315
|
+
"items": {
|
|
316
|
+
"$ref": "#/$defs/EntryId"
|
|
317
|
+
},
|
|
318
|
+
"description": "Entries holding `vtc.groups.manage` qualified to this group, read from the access-control list. Informational: managers are appointed by an access-control grant (vtc/groups/managers/add), never by this record."
|
|
319
|
+
},
|
|
320
|
+
"credentialAuthorityValidUntil": {
|
|
321
|
+
"type": "string",
|
|
322
|
+
"format": "date-time",
|
|
323
|
+
"description": "When the community's authorization credential to the group expires. The community renews it well before."
|
|
324
|
+
},
|
|
325
|
+
"createdAt": {
|
|
326
|
+
"type": "string",
|
|
327
|
+
"format": "date-time"
|
|
328
|
+
},
|
|
329
|
+
"createdBy": {
|
|
330
|
+
"$ref": "#/$defs/EntryId",
|
|
331
|
+
"description": "The creating administrator's directory entry, where they have one."
|
|
332
|
+
},
|
|
333
|
+
"updatedAt": {
|
|
334
|
+
"type": "string",
|
|
335
|
+
"format": "date-time"
|
|
336
|
+
},
|
|
337
|
+
"ext": {
|
|
338
|
+
"$ref": "#/$defs/Ext",
|
|
339
|
+
"description": "Ecosystem-defined extension members per SPEC.md §4.5.1. An extension member MUST NOT carry authority."
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
"GroupAudience": {
|
|
344
|
+
"title": "GroupAudience",
|
|
345
|
+
"description": "Who may see something about a group, narrowest first. `admins`: holders of `vtc.groups.manage` for the group (unqualified, or qualified `group:<groupId>`). `groupMembers`: the group's own members, and its managers. `members`: every active member of the community.",
|
|
346
|
+
"type": "string",
|
|
347
|
+
"enum": [
|
|
348
|
+
"admins",
|
|
349
|
+
"groupMembers",
|
|
350
|
+
"members"
|
|
351
|
+
]
|
|
352
|
+
},
|
|
353
|
+
"JoinPolicy": {
|
|
354
|
+
"title": "JoinPolicy",
|
|
355
|
+
"description": "How a member enters a static group by themselves. `closed`: only a manager adds them. `request`: a member asks and a manager decides. `open`: a member joins at once, subject to the community's `groups` policy. A group carrying authority is always `closed`.",
|
|
356
|
+
"type": "string",
|
|
357
|
+
"enum": [
|
|
358
|
+
"closed",
|
|
359
|
+
"request",
|
|
360
|
+
"open"
|
|
361
|
+
]
|
|
362
|
+
},
|
|
363
|
+
"DynamicRule": {
|
|
364
|
+
"title": "DynamicRule",
|
|
365
|
+
"description": "A dynamic group's membership rule: a member belongs when every condition holds and they have not opted out. The community evaluates it under its `groups` policy and recomputes membership whenever a fact it reads changes, always excluding opted-out entries.",
|
|
366
|
+
"type": "object",
|
|
367
|
+
"additionalProperties": false,
|
|
368
|
+
"required": [
|
|
369
|
+
"all"
|
|
370
|
+
],
|
|
371
|
+
"properties": {
|
|
372
|
+
"all": {
|
|
373
|
+
"type": "array",
|
|
374
|
+
"minItems": 1,
|
|
375
|
+
"maxItems": 16,
|
|
376
|
+
"items": {
|
|
377
|
+
"$ref": "#/$defs/RuleCondition"
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
},
|
|
382
|
+
"RuleCondition": {
|
|
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.",
|
|
385
|
+
"type": "object",
|
|
386
|
+
"additionalProperties": false,
|
|
387
|
+
"required": [
|
|
388
|
+
"fact",
|
|
389
|
+
"op"
|
|
390
|
+
],
|
|
391
|
+
"properties": {
|
|
392
|
+
"fact": {
|
|
393
|
+
"type": "string",
|
|
394
|
+
"enum": [
|
|
395
|
+
"role",
|
|
396
|
+
"field",
|
|
397
|
+
"personhood",
|
|
398
|
+
"joinedAt"
|
|
399
|
+
]
|
|
400
|
+
},
|
|
401
|
+
"field": {
|
|
402
|
+
"$ref": "#/$defs/FieldKey",
|
|
403
|
+
"description": "Present exactly when `fact` is `field`."
|
|
404
|
+
},
|
|
405
|
+
"op": {
|
|
406
|
+
"type": "string",
|
|
407
|
+
"enum": [
|
|
408
|
+
"equals",
|
|
409
|
+
"oneOf",
|
|
410
|
+
"exists",
|
|
411
|
+
"before",
|
|
412
|
+
"after"
|
|
413
|
+
],
|
|
414
|
+
"description": "`equals` compares with `value`; `oneOf` with any of `values`; `exists` needs neither; `before` and `after` compare a date fact with `value`."
|
|
415
|
+
},
|
|
416
|
+
"value": {
|
|
417
|
+
"anyOf": [
|
|
418
|
+
{
|
|
419
|
+
"type": "string",
|
|
420
|
+
"maxLength": 256
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
"type": "boolean"
|
|
424
|
+
}
|
|
425
|
+
]
|
|
426
|
+
},
|
|
427
|
+
"values": {
|
|
428
|
+
"type": "array",
|
|
429
|
+
"minItems": 1,
|
|
430
|
+
"maxItems": 64,
|
|
431
|
+
"items": {
|
|
432
|
+
"type": "string",
|
|
433
|
+
"maxLength": 256
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
},
|
|
438
|
+
"FieldKey": {
|
|
439
|
+
"title": "FieldKey",
|
|
440
|
+
"description": "Identifier of a directory field. A key with no `.` is a BASE field, the same in every community: `displayName`, `nickname`, `avatar`, `pronouns`, `bio`, `links` (written by the member) and `role`, `joinedAt`, `did`, `personhood` (derived from the community's own records, never stored on a card). A community-defined field MUST use a reverse-DNS key (`org.example.employer`), so a base key never collides with one, and a key is never reused with a different meaning once defined.",
|
|
441
|
+
"type": "string",
|
|
442
|
+
"minLength": 1,
|
|
443
|
+
"maxLength": 128,
|
|
444
|
+
"pattern": "^([a-z][a-z0-9-]*\\.)*[a-z][a-zA-Z0-9]{0,63}$"
|
|
445
|
+
},
|
|
446
|
+
"GroupKind": {
|
|
447
|
+
"title": "GroupKind",
|
|
448
|
+
"description": "`static`: membership is explicit — added, joined, or granted on request. `dynamic`: membership is computed from `rule` over verified facts only; nobody is added by hand, but a member may opt out (vtc/groups/leave), an exclusion the rule cannot override, and undo it (vtc/groups/join). A dynamic group never confers authority. Fixed for the group's life.",
|
|
449
|
+
"type": "string",
|
|
450
|
+
"enum": [
|
|
451
|
+
"static",
|
|
452
|
+
"dynamic"
|
|
453
|
+
]
|
|
454
|
+
},
|
|
455
|
+
"GroupDescription": {
|
|
456
|
+
"title": "GroupDescription",
|
|
457
|
+
"type": "string",
|
|
458
|
+
"minLength": 1,
|
|
459
|
+
"maxLength": 1000,
|
|
460
|
+
"description": "What the group is for. Plain text; a reader MUST NOT treat it as instructions. Same placement rules as `GroupName`."
|
|
461
|
+
},
|
|
462
|
+
"GroupName": {
|
|
463
|
+
"title": "GroupName",
|
|
464
|
+
"type": "string",
|
|
465
|
+
"minLength": 1,
|
|
466
|
+
"maxLength": 128,
|
|
467
|
+
"description": "The group's name, shown to those who may see the group. The community's own record: never in the group's DID document or its credentials' subject beyond the group's DID. Plain text."
|
|
468
|
+
},
|
|
469
|
+
"GroupId": {
|
|
470
|
+
"title": "GroupId",
|
|
471
|
+
"description": "Opaque identifier of a community group: `grp_` followed by 16 to 64 base64url characters. Random and community-scoped; not the group's DID.",
|
|
472
|
+
"type": "string",
|
|
473
|
+
"pattern": "^grp_[A-Za-z0-9_-]{16,64}$"
|
|
474
|
+
},
|
|
475
|
+
"EntryId": {
|
|
476
|
+
"title": "EntryId",
|
|
477
|
+
"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.",
|
|
478
|
+
"type": "string",
|
|
479
|
+
"pattern": "^dir_[A-Za-z0-9_-]{16,64}$"
|
|
480
|
+
},
|
|
481
|
+
"BadgeId": {
|
|
482
|
+
"title": "BadgeId",
|
|
483
|
+
"description": "Opaque identifier of a badge: `bdg_` followed by 16 to 64 base64url characters. Random, community-scoped, never reused (VTI-BDG-001).",
|
|
484
|
+
"type": "string",
|
|
485
|
+
"pattern": "^bdg_[A-Za-z0-9_-]{16,64}$"
|
|
486
|
+
},
|
|
487
|
+
"Badge": {
|
|
488
|
+
"title": "Badge",
|
|
489
|
+
"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.",
|
|
490
|
+
"type": "object",
|
|
491
|
+
"additionalProperties": false,
|
|
492
|
+
"required": [
|
|
493
|
+
"badgeId",
|
|
494
|
+
"kind",
|
|
495
|
+
"name",
|
|
496
|
+
"description",
|
|
497
|
+
"image",
|
|
498
|
+
"repeatable",
|
|
499
|
+
"listed",
|
|
500
|
+
"state",
|
|
501
|
+
"createdAt"
|
|
502
|
+
],
|
|
503
|
+
"properties": {
|
|
504
|
+
"badgeId": {
|
|
505
|
+
"$ref": "#/$defs/BadgeId"
|
|
506
|
+
},
|
|
507
|
+
"kind": {
|
|
508
|
+
"$ref": "#/$defs/BadgeKind"
|
|
509
|
+
},
|
|
510
|
+
"name": {
|
|
511
|
+
"$ref": "#/$defs/BadgeName"
|
|
512
|
+
},
|
|
513
|
+
"description": {
|
|
514
|
+
"$ref": "#/$defs/BadgeDescription"
|
|
515
|
+
},
|
|
516
|
+
"criteria": {
|
|
517
|
+
"$ref": "#/$defs/BadgeCriteria"
|
|
518
|
+
},
|
|
519
|
+
"image": {
|
|
520
|
+
"$ref": "#/$defs/CardBlobRef",
|
|
521
|
+
"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."
|
|
522
|
+
},
|
|
523
|
+
"repeatable": {
|
|
524
|
+
"type": "boolean",
|
|
525
|
+
"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."
|
|
526
|
+
},
|
|
527
|
+
"requestable": {
|
|
528
|
+
"type": "boolean",
|
|
529
|
+
"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."
|
|
530
|
+
},
|
|
531
|
+
"listed": {
|
|
532
|
+
"type": "boolean",
|
|
533
|
+
"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."
|
|
534
|
+
},
|
|
535
|
+
"shareableOutside": {
|
|
536
|
+
"type": "boolean",
|
|
537
|
+
"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."
|
|
538
|
+
},
|
|
539
|
+
"groupId": {
|
|
540
|
+
"$ref": "#/$defs/GroupId",
|
|
541
|
+
"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."
|
|
542
|
+
},
|
|
543
|
+
"state": {
|
|
544
|
+
"$ref": "#/$defs/BadgeState"
|
|
545
|
+
},
|
|
546
|
+
"holderCount": {
|
|
547
|
+
"type": "integer",
|
|
548
|
+
"minimum": 0,
|
|
549
|
+
"description": "Holders who show the badge. Only to callers who may see the holders."
|
|
550
|
+
},
|
|
551
|
+
"createdAt": {
|
|
552
|
+
"type": "string",
|
|
553
|
+
"format": "date-time"
|
|
554
|
+
},
|
|
555
|
+
"createdBy": {
|
|
556
|
+
"$ref": "#/$defs/EntryId"
|
|
557
|
+
},
|
|
558
|
+
"updatedAt": {
|
|
559
|
+
"type": "string",
|
|
560
|
+
"format": "date-time"
|
|
561
|
+
},
|
|
562
|
+
"retiredAt": {
|
|
563
|
+
"type": "string",
|
|
564
|
+
"format": "date-time"
|
|
565
|
+
},
|
|
566
|
+
"ext": {
|
|
567
|
+
"$ref": "#/$defs/Ext",
|
|
568
|
+
"description": "Ecosystem-defined extension members per SPEC.md §4.5.1. An extension member MUST NOT carry authority."
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
},
|
|
572
|
+
"BadgeState": {
|
|
573
|
+
"title": "BadgeState",
|
|
574
|
+
"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).",
|
|
575
|
+
"type": "string",
|
|
576
|
+
"enum": [
|
|
577
|
+
"active",
|
|
578
|
+
"retired"
|
|
579
|
+
]
|
|
580
|
+
},
|
|
581
|
+
"BadgeCriteria": {
|
|
582
|
+
"title": "BadgeCriteria",
|
|
583
|
+
"type": "string",
|
|
584
|
+
"minLength": 1,
|
|
585
|
+
"maxLength": 1000,
|
|
586
|
+
"description": "How the badge is earned, shown to members and written into the credential's Achievement as its criteria narrative. Plain text."
|
|
587
|
+
},
|
|
588
|
+
"BadgeDescription": {
|
|
589
|
+
"title": "BadgeDescription",
|
|
590
|
+
"type": "string",
|
|
591
|
+
"minLength": 1,
|
|
592
|
+
"maxLength": 1000,
|
|
593
|
+
"description": "What the badge is for. Plain text; a reader MUST NOT treat it as instructions."
|
|
594
|
+
},
|
|
595
|
+
"BadgeName": {
|
|
596
|
+
"title": "BadgeName",
|
|
597
|
+
"type": "string",
|
|
598
|
+
"minLength": 1,
|
|
599
|
+
"maxLength": 64,
|
|
600
|
+
"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."
|
|
601
|
+
},
|
|
602
|
+
"BadgeKind": {
|
|
603
|
+
"title": "BadgeKind",
|
|
604
|
+
"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).",
|
|
605
|
+
"type": "string",
|
|
606
|
+
"enum": [
|
|
607
|
+
"community",
|
|
608
|
+
"kudos"
|
|
609
|
+
]
|
|
610
|
+
},
|
|
611
|
+
"CardBlobRef": {
|
|
612
|
+
"title": "CardBlobRef",
|
|
613
|
+
"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.",
|
|
614
|
+
"type": "object",
|
|
615
|
+
"additionalProperties": false,
|
|
616
|
+
"required": [
|
|
617
|
+
"sha256",
|
|
618
|
+
"mediaType"
|
|
619
|
+
],
|
|
620
|
+
"properties": {
|
|
621
|
+
"sha256": {
|
|
622
|
+
"type": "string",
|
|
623
|
+
"pattern": "^[0-9a-f]{64}$",
|
|
624
|
+
"description": "Lowercase hex SHA-256 of the stored, re-encoded bytes."
|
|
625
|
+
},
|
|
626
|
+
"mediaType": {
|
|
627
|
+
"type": "string",
|
|
628
|
+
"enum": [
|
|
629
|
+
"image/png",
|
|
630
|
+
"image/jpeg",
|
|
631
|
+
"image/webp",
|
|
632
|
+
"image/avif"
|
|
633
|
+
],
|
|
634
|
+
"description": "Media type of the stored bytes."
|
|
635
|
+
},
|
|
636
|
+
"size": {
|
|
637
|
+
"type": "integer",
|
|
638
|
+
"minimum": 1,
|
|
639
|
+
"maximum": 262144,
|
|
640
|
+
"description": "Size in bytes of the stored bytes."
|
|
641
|
+
},
|
|
642
|
+
"url": {
|
|
643
|
+
"type": "string",
|
|
644
|
+
"format": "uri",
|
|
645
|
+
"maxLength": 2048,
|
|
646
|
+
"description": "Projection only: a URL the viewer can fetch the image from until `urlExpiresAt`."
|
|
647
|
+
},
|
|
648
|
+
"urlExpiresAt": {
|
|
649
|
+
"type": "string",
|
|
650
|
+
"format": "date-time",
|
|
651
|
+
"description": "Projection only: when `url` stops working."
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
} as const;
|
|
657
|
+
|
|
658
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
659
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
660
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
661
|
+
"$ref": "#/$defs/Response",
|
|
662
|
+
"$defs": {
|
|
663
|
+
"Response": {
|
|
664
|
+
"$anchor": "response",
|
|
665
|
+
"title": "VTC Badges — Create — response payload",
|
|
666
|
+
"description": "The success response to a vtc/badges/create/0.1 request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vtc/badges/create/0.1#response.",
|
|
667
|
+
"type": "object",
|
|
668
|
+
"additionalProperties": false,
|
|
669
|
+
"required": [
|
|
670
|
+
"badge"
|
|
671
|
+
],
|
|
672
|
+
"properties": {
|
|
673
|
+
"badge": {
|
|
674
|
+
"$ref": "#/$defs/Badge"
|
|
675
|
+
},
|
|
676
|
+
"group": {
|
|
677
|
+
"$ref": "#/$defs/Group",
|
|
678
|
+
"description": "The badge group, as vtc/groups/create answers it. Present exactly for a community badge."
|
|
679
|
+
},
|
|
680
|
+
"ext": {
|
|
681
|
+
"$ref": "#/$defs/Ext"
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
},
|
|
685
|
+
"Ext": {
|
|
686
|
+
"title": "Ext",
|
|
687
|
+
"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.",
|
|
688
|
+
"type": "object",
|
|
689
|
+
"minProperties": 1,
|
|
690
|
+
"additionalProperties": true,
|
|
691
|
+
"propertyNames": {
|
|
692
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
693
|
+
}
|
|
694
|
+
},
|
|
695
|
+
"Group": {
|
|
696
|
+
"title": "Group",
|
|
697
|
+
"description": "A community group, as a caller who may see it sees it. Members a caller may not see are absent: `memberCount` only to those who may see the group's members, `managers` and `credentialAuthorityValidUntil` only to its managers.",
|
|
698
|
+
"type": "object",
|
|
699
|
+
"additionalProperties": false,
|
|
700
|
+
"required": [
|
|
701
|
+
"groupId",
|
|
702
|
+
"groupDid",
|
|
703
|
+
"name",
|
|
704
|
+
"kind",
|
|
705
|
+
"visibility",
|
|
706
|
+
"showMembers",
|
|
707
|
+
"issuesCredentials",
|
|
708
|
+
"carriesAuthority",
|
|
709
|
+
"createdAt"
|
|
710
|
+
],
|
|
711
|
+
"properties": {
|
|
712
|
+
"groupId": {
|
|
713
|
+
"$ref": "#/$defs/GroupId"
|
|
714
|
+
},
|
|
715
|
+
"groupDid": {
|
|
716
|
+
"type": "string",
|
|
717
|
+
"pattern": "^did:",
|
|
718
|
+
"maxLength": 2048,
|
|
719
|
+
"description": "The group's own DID, minted by the community's VTA for this group alone. It issues the group's membership credentials. Its DID document carries no name or description."
|
|
720
|
+
},
|
|
721
|
+
"name": {
|
|
722
|
+
"$ref": "#/$defs/GroupName"
|
|
723
|
+
},
|
|
724
|
+
"description": {
|
|
725
|
+
"$ref": "#/$defs/GroupDescription"
|
|
726
|
+
},
|
|
727
|
+
"kind": {
|
|
728
|
+
"$ref": "#/$defs/GroupKind"
|
|
729
|
+
},
|
|
730
|
+
"rule": {
|
|
731
|
+
"$ref": "#/$defs/DynamicRule",
|
|
732
|
+
"description": "Present exactly when `kind` is `dynamic`."
|
|
733
|
+
},
|
|
734
|
+
"joinPolicy": {
|
|
735
|
+
"$ref": "#/$defs/JoinPolicy",
|
|
736
|
+
"description": "Present exactly when `kind` is `static`."
|
|
737
|
+
},
|
|
738
|
+
"visibility": {
|
|
739
|
+
"$ref": "#/$defs/GroupAudience",
|
|
740
|
+
"description": "Who may see that the group exists, and its name and description."
|
|
741
|
+
},
|
|
742
|
+
"showMembers": {
|
|
743
|
+
"$ref": "#/$defs/GroupAudience",
|
|
744
|
+
"description": "Who may see the group's member list. Separate from `visibility`: a group everyone sees may show its members only to administrators. Never wider than `visibility`."
|
|
745
|
+
},
|
|
746
|
+
"issuesCredentials": {
|
|
747
|
+
"type": "boolean",
|
|
748
|
+
"description": "Whether the group's DID issues its members a membership credential. Default true."
|
|
749
|
+
},
|
|
750
|
+
"carriesAuthority": {
|
|
751
|
+
"type": "boolean",
|
|
752
|
+
"description": "`true` while the group has a `grants` or `role` binding. Such a group is `static` and `closed` for as long as it does."
|
|
753
|
+
},
|
|
754
|
+
"badgeId": {
|
|
755
|
+
"$ref": "#/$defs/BadgeId",
|
|
756
|
+
"description": "Present exactly when the group backs a community badge (vtc/badges/*): its managers are the badge's owners, its members the badge's holders, and its DID issues the badge credential in place of a membership credential. A badge group never carries authority, is not counted among the groups two members share, and is listed among the community's groups only to a caller who asks for badge groups (VTI-BDG-010 – VTI-BDG-012)."
|
|
757
|
+
},
|
|
758
|
+
"memberCount": {
|
|
759
|
+
"type": "integer",
|
|
760
|
+
"minimum": 0,
|
|
761
|
+
"description": "Active members. Only to callers who may see the member list."
|
|
762
|
+
},
|
|
763
|
+
"managers": {
|
|
764
|
+
"type": "array",
|
|
765
|
+
"maxItems": 256,
|
|
766
|
+
"uniqueItems": true,
|
|
767
|
+
"items": {
|
|
768
|
+
"$ref": "#/$defs/EntryId"
|
|
769
|
+
},
|
|
770
|
+
"description": "Entries holding `vtc.groups.manage` qualified to this group, read from the access-control list. Informational: managers are appointed by an access-control grant (vtc/groups/managers/add), never by this record."
|
|
771
|
+
},
|
|
772
|
+
"credentialAuthorityValidUntil": {
|
|
773
|
+
"type": "string",
|
|
774
|
+
"format": "date-time",
|
|
775
|
+
"description": "When the community's authorization credential to the group expires. The community renews it well before."
|
|
776
|
+
},
|
|
777
|
+
"createdAt": {
|
|
778
|
+
"type": "string",
|
|
779
|
+
"format": "date-time"
|
|
780
|
+
},
|
|
781
|
+
"createdBy": {
|
|
782
|
+
"$ref": "#/$defs/EntryId",
|
|
783
|
+
"description": "The creating administrator's directory entry, where they have one."
|
|
784
|
+
},
|
|
785
|
+
"updatedAt": {
|
|
786
|
+
"type": "string",
|
|
787
|
+
"format": "date-time"
|
|
788
|
+
},
|
|
789
|
+
"ext": {
|
|
790
|
+
"$ref": "#/$defs/Ext",
|
|
791
|
+
"description": "Ecosystem-defined extension members per SPEC.md §4.5.1. An extension member MUST NOT carry authority."
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
},
|
|
795
|
+
"GroupAudience": {
|
|
796
|
+
"title": "GroupAudience",
|
|
797
|
+
"description": "Who may see something about a group, narrowest first. `admins`: holders of `vtc.groups.manage` for the group (unqualified, or qualified `group:<groupId>`). `groupMembers`: the group's own members, and its managers. `members`: every active member of the community.",
|
|
798
|
+
"type": "string",
|
|
799
|
+
"enum": [
|
|
800
|
+
"admins",
|
|
801
|
+
"groupMembers",
|
|
802
|
+
"members"
|
|
803
|
+
]
|
|
804
|
+
},
|
|
805
|
+
"JoinPolicy": {
|
|
806
|
+
"title": "JoinPolicy",
|
|
807
|
+
"description": "How a member enters a static group by themselves. `closed`: only a manager adds them. `request`: a member asks and a manager decides. `open`: a member joins at once, subject to the community's `groups` policy. A group carrying authority is always `closed`.",
|
|
808
|
+
"type": "string",
|
|
809
|
+
"enum": [
|
|
810
|
+
"closed",
|
|
811
|
+
"request",
|
|
812
|
+
"open"
|
|
813
|
+
]
|
|
814
|
+
},
|
|
815
|
+
"DynamicRule": {
|
|
816
|
+
"title": "DynamicRule",
|
|
817
|
+
"description": "A dynamic group's membership rule: a member belongs when every condition holds and they have not opted out. The community evaluates it under its `groups` policy and recomputes membership whenever a fact it reads changes, always excluding opted-out entries.",
|
|
818
|
+
"type": "object",
|
|
819
|
+
"additionalProperties": false,
|
|
820
|
+
"required": [
|
|
821
|
+
"all"
|
|
822
|
+
],
|
|
823
|
+
"properties": {
|
|
824
|
+
"all": {
|
|
825
|
+
"type": "array",
|
|
826
|
+
"minItems": 1,
|
|
827
|
+
"maxItems": 16,
|
|
828
|
+
"items": {
|
|
829
|
+
"$ref": "#/$defs/RuleCondition"
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
},
|
|
834
|
+
"RuleCondition": {
|
|
835
|
+
"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.",
|
|
837
|
+
"type": "object",
|
|
838
|
+
"additionalProperties": false,
|
|
839
|
+
"required": [
|
|
840
|
+
"fact",
|
|
841
|
+
"op"
|
|
842
|
+
],
|
|
843
|
+
"properties": {
|
|
844
|
+
"fact": {
|
|
845
|
+
"type": "string",
|
|
846
|
+
"enum": [
|
|
847
|
+
"role",
|
|
848
|
+
"field",
|
|
849
|
+
"personhood",
|
|
850
|
+
"joinedAt"
|
|
851
|
+
]
|
|
852
|
+
},
|
|
853
|
+
"field": {
|
|
854
|
+
"$ref": "#/$defs/FieldKey",
|
|
855
|
+
"description": "Present exactly when `fact` is `field`."
|
|
856
|
+
},
|
|
857
|
+
"op": {
|
|
858
|
+
"type": "string",
|
|
859
|
+
"enum": [
|
|
860
|
+
"equals",
|
|
861
|
+
"oneOf",
|
|
862
|
+
"exists",
|
|
863
|
+
"before",
|
|
864
|
+
"after"
|
|
865
|
+
],
|
|
866
|
+
"description": "`equals` compares with `value`; `oneOf` with any of `values`; `exists` needs neither; `before` and `after` compare a date fact with `value`."
|
|
867
|
+
},
|
|
868
|
+
"value": {
|
|
869
|
+
"anyOf": [
|
|
870
|
+
{
|
|
871
|
+
"type": "string",
|
|
872
|
+
"maxLength": 256
|
|
873
|
+
},
|
|
874
|
+
{
|
|
875
|
+
"type": "boolean"
|
|
876
|
+
}
|
|
877
|
+
]
|
|
878
|
+
},
|
|
879
|
+
"values": {
|
|
880
|
+
"type": "array",
|
|
881
|
+
"minItems": 1,
|
|
882
|
+
"maxItems": 64,
|
|
883
|
+
"items": {
|
|
884
|
+
"type": "string",
|
|
885
|
+
"maxLength": 256
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
},
|
|
890
|
+
"FieldKey": {
|
|
891
|
+
"title": "FieldKey",
|
|
892
|
+
"description": "Identifier of a directory field. A key with no `.` is a BASE field, the same in every community: `displayName`, `nickname`, `avatar`, `pronouns`, `bio`, `links` (written by the member) and `role`, `joinedAt`, `did`, `personhood` (derived from the community's own records, never stored on a card). A community-defined field MUST use a reverse-DNS key (`org.example.employer`), so a base key never collides with one, and a key is never reused with a different meaning once defined.",
|
|
893
|
+
"type": "string",
|
|
894
|
+
"minLength": 1,
|
|
895
|
+
"maxLength": 128,
|
|
896
|
+
"pattern": "^([a-z][a-z0-9-]*\\.)*[a-z][a-zA-Z0-9]{0,63}$"
|
|
897
|
+
},
|
|
898
|
+
"GroupKind": {
|
|
899
|
+
"title": "GroupKind",
|
|
900
|
+
"description": "`static`: membership is explicit — added, joined, or granted on request. `dynamic`: membership is computed from `rule` over verified facts only; nobody is added by hand, but a member may opt out (vtc/groups/leave), an exclusion the rule cannot override, and undo it (vtc/groups/join). A dynamic group never confers authority. Fixed for the group's life.",
|
|
901
|
+
"type": "string",
|
|
902
|
+
"enum": [
|
|
903
|
+
"static",
|
|
904
|
+
"dynamic"
|
|
905
|
+
]
|
|
906
|
+
},
|
|
907
|
+
"GroupDescription": {
|
|
908
|
+
"title": "GroupDescription",
|
|
909
|
+
"type": "string",
|
|
910
|
+
"minLength": 1,
|
|
911
|
+
"maxLength": 1000,
|
|
912
|
+
"description": "What the group is for. Plain text; a reader MUST NOT treat it as instructions. Same placement rules as `GroupName`."
|
|
913
|
+
},
|
|
914
|
+
"GroupName": {
|
|
915
|
+
"title": "GroupName",
|
|
916
|
+
"type": "string",
|
|
917
|
+
"minLength": 1,
|
|
918
|
+
"maxLength": 128,
|
|
919
|
+
"description": "The group's name, shown to those who may see the group. The community's own record: never in the group's DID document or its credentials' subject beyond the group's DID. Plain text."
|
|
920
|
+
},
|
|
921
|
+
"GroupId": {
|
|
922
|
+
"title": "GroupId",
|
|
923
|
+
"description": "Opaque identifier of a community group: `grp_` followed by 16 to 64 base64url characters. Random and community-scoped; not the group's DID.",
|
|
924
|
+
"type": "string",
|
|
925
|
+
"pattern": "^grp_[A-Za-z0-9_-]{16,64}$"
|
|
926
|
+
},
|
|
927
|
+
"EntryId": {
|
|
928
|
+
"title": "EntryId",
|
|
929
|
+
"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.",
|
|
930
|
+
"type": "string",
|
|
931
|
+
"pattern": "^dir_[A-Za-z0-9_-]{16,64}$"
|
|
932
|
+
},
|
|
933
|
+
"BadgeId": {
|
|
934
|
+
"title": "BadgeId",
|
|
935
|
+
"description": "Opaque identifier of a badge: `bdg_` followed by 16 to 64 base64url characters. Random, community-scoped, never reused (VTI-BDG-001).",
|
|
936
|
+
"type": "string",
|
|
937
|
+
"pattern": "^bdg_[A-Za-z0-9_-]{16,64}$"
|
|
938
|
+
},
|
|
939
|
+
"Badge": {
|
|
940
|
+
"title": "Badge",
|
|
941
|
+
"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.",
|
|
942
|
+
"type": "object",
|
|
943
|
+
"additionalProperties": false,
|
|
944
|
+
"required": [
|
|
945
|
+
"badgeId",
|
|
946
|
+
"kind",
|
|
947
|
+
"name",
|
|
948
|
+
"description",
|
|
949
|
+
"image",
|
|
950
|
+
"repeatable",
|
|
951
|
+
"listed",
|
|
952
|
+
"state",
|
|
953
|
+
"createdAt"
|
|
954
|
+
],
|
|
955
|
+
"properties": {
|
|
956
|
+
"badgeId": {
|
|
957
|
+
"$ref": "#/$defs/BadgeId"
|
|
958
|
+
},
|
|
959
|
+
"kind": {
|
|
960
|
+
"$ref": "#/$defs/BadgeKind"
|
|
961
|
+
},
|
|
962
|
+
"name": {
|
|
963
|
+
"$ref": "#/$defs/BadgeName"
|
|
964
|
+
},
|
|
965
|
+
"description": {
|
|
966
|
+
"$ref": "#/$defs/BadgeDescription"
|
|
967
|
+
},
|
|
968
|
+
"criteria": {
|
|
969
|
+
"$ref": "#/$defs/BadgeCriteria"
|
|
970
|
+
},
|
|
971
|
+
"image": {
|
|
972
|
+
"$ref": "#/$defs/CardBlobRef",
|
|
973
|
+
"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."
|
|
974
|
+
},
|
|
975
|
+
"repeatable": {
|
|
976
|
+
"type": "boolean",
|
|
977
|
+
"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."
|
|
978
|
+
},
|
|
979
|
+
"requestable": {
|
|
980
|
+
"type": "boolean",
|
|
981
|
+
"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."
|
|
982
|
+
},
|
|
983
|
+
"listed": {
|
|
984
|
+
"type": "boolean",
|
|
985
|
+
"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."
|
|
986
|
+
},
|
|
987
|
+
"shareableOutside": {
|
|
988
|
+
"type": "boolean",
|
|
989
|
+
"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."
|
|
990
|
+
},
|
|
991
|
+
"groupId": {
|
|
992
|
+
"$ref": "#/$defs/GroupId",
|
|
993
|
+
"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."
|
|
994
|
+
},
|
|
995
|
+
"state": {
|
|
996
|
+
"$ref": "#/$defs/BadgeState"
|
|
997
|
+
},
|
|
998
|
+
"holderCount": {
|
|
999
|
+
"type": "integer",
|
|
1000
|
+
"minimum": 0,
|
|
1001
|
+
"description": "Holders who show the badge. Only to callers who may see the holders."
|
|
1002
|
+
},
|
|
1003
|
+
"createdAt": {
|
|
1004
|
+
"type": "string",
|
|
1005
|
+
"format": "date-time"
|
|
1006
|
+
},
|
|
1007
|
+
"createdBy": {
|
|
1008
|
+
"$ref": "#/$defs/EntryId"
|
|
1009
|
+
},
|
|
1010
|
+
"updatedAt": {
|
|
1011
|
+
"type": "string",
|
|
1012
|
+
"format": "date-time"
|
|
1013
|
+
},
|
|
1014
|
+
"retiredAt": {
|
|
1015
|
+
"type": "string",
|
|
1016
|
+
"format": "date-time"
|
|
1017
|
+
},
|
|
1018
|
+
"ext": {
|
|
1019
|
+
"$ref": "#/$defs/Ext",
|
|
1020
|
+
"description": "Ecosystem-defined extension members per SPEC.md §4.5.1. An extension member MUST NOT carry authority."
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
},
|
|
1024
|
+
"BadgeState": {
|
|
1025
|
+
"title": "BadgeState",
|
|
1026
|
+
"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).",
|
|
1027
|
+
"type": "string",
|
|
1028
|
+
"enum": [
|
|
1029
|
+
"active",
|
|
1030
|
+
"retired"
|
|
1031
|
+
]
|
|
1032
|
+
},
|
|
1033
|
+
"BadgeCriteria": {
|
|
1034
|
+
"title": "BadgeCriteria",
|
|
1035
|
+
"type": "string",
|
|
1036
|
+
"minLength": 1,
|
|
1037
|
+
"maxLength": 1000,
|
|
1038
|
+
"description": "How the badge is earned, shown to members and written into the credential's Achievement as its criteria narrative. Plain text."
|
|
1039
|
+
},
|
|
1040
|
+
"BadgeDescription": {
|
|
1041
|
+
"title": "BadgeDescription",
|
|
1042
|
+
"type": "string",
|
|
1043
|
+
"minLength": 1,
|
|
1044
|
+
"maxLength": 1000,
|
|
1045
|
+
"description": "What the badge is for. Plain text; a reader MUST NOT treat it as instructions."
|
|
1046
|
+
},
|
|
1047
|
+
"BadgeName": {
|
|
1048
|
+
"title": "BadgeName",
|
|
1049
|
+
"type": "string",
|
|
1050
|
+
"minLength": 1,
|
|
1051
|
+
"maxLength": 64,
|
|
1052
|
+
"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."
|
|
1053
|
+
},
|
|
1054
|
+
"BadgeKind": {
|
|
1055
|
+
"title": "BadgeKind",
|
|
1056
|
+
"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).",
|
|
1057
|
+
"type": "string",
|
|
1058
|
+
"enum": [
|
|
1059
|
+
"community",
|
|
1060
|
+
"kudos"
|
|
1061
|
+
]
|
|
1062
|
+
},
|
|
1063
|
+
"CardBlobRef": {
|
|
1064
|
+
"title": "CardBlobRef",
|
|
1065
|
+
"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.",
|
|
1066
|
+
"type": "object",
|
|
1067
|
+
"additionalProperties": false,
|
|
1068
|
+
"required": [
|
|
1069
|
+
"sha256",
|
|
1070
|
+
"mediaType"
|
|
1071
|
+
],
|
|
1072
|
+
"properties": {
|
|
1073
|
+
"sha256": {
|
|
1074
|
+
"type": "string",
|
|
1075
|
+
"pattern": "^[0-9a-f]{64}$",
|
|
1076
|
+
"description": "Lowercase hex SHA-256 of the stored, re-encoded bytes."
|
|
1077
|
+
},
|
|
1078
|
+
"mediaType": {
|
|
1079
|
+
"type": "string",
|
|
1080
|
+
"enum": [
|
|
1081
|
+
"image/png",
|
|
1082
|
+
"image/jpeg",
|
|
1083
|
+
"image/webp",
|
|
1084
|
+
"image/avif"
|
|
1085
|
+
],
|
|
1086
|
+
"description": "Media type of the stored bytes."
|
|
1087
|
+
},
|
|
1088
|
+
"size": {
|
|
1089
|
+
"type": "integer",
|
|
1090
|
+
"minimum": 1,
|
|
1091
|
+
"maximum": 262144,
|
|
1092
|
+
"description": "Size in bytes of the stored bytes."
|
|
1093
|
+
},
|
|
1094
|
+
"url": {
|
|
1095
|
+
"type": "string",
|
|
1096
|
+
"format": "uri",
|
|
1097
|
+
"maxLength": 2048,
|
|
1098
|
+
"description": "Projection only: a URL the viewer can fetch the image from until `urlExpiresAt`."
|
|
1099
|
+
},
|
|
1100
|
+
"urlExpiresAt": {
|
|
1101
|
+
"type": "string",
|
|
1102
|
+
"format": "date-time",
|
|
1103
|
+
"description": "Projection only: when `url` stops working."
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1108
|
+
} as const;
|
|
1109
|
+
|
|
1110
|
+
/**
|
|
1111
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
1112
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
1113
|
+
* per-specification and cannot be derived from the document alone, and
|
|
1114
|
+
* item 2 needs the schema this carries.
|
|
1115
|
+
*/
|
|
1116
|
+
export const SPEC = {
|
|
1117
|
+
typeUri: TYPE_URI,
|
|
1118
|
+
isBearer: false,
|
|
1119
|
+
isProofRequired: true,
|
|
1120
|
+
isRecipientRequired: true,
|
|
1121
|
+
isIssuedAtRequired: true,
|
|
1122
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
1123
|
+
} as const;
|
|
1124
|
+
|
|
1125
|
+
/**
|
|
1126
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
1127
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
1128
|
+
* parties (§7.3 item 5).
|
|
1129
|
+
*/
|
|
1130
|
+
export const RESPONSE_SPEC = {
|
|
1131
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
1132
|
+
isBearer: false,
|
|
1133
|
+
isProofRequired: true,
|
|
1134
|
+
isRecipientRequired: true,
|
|
1135
|
+
isIssuedAtRequired: true,
|
|
1136
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
1137
|
+
} as const;
|