@hypercerts-org/lexicon 0.8.0-beta.0 → 0.10.0-beta.0

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.
Files changed (45) hide show
  1. package/README.md +249 -180
  2. package/README.md.orig +267 -0
  3. package/lexicons/app/certified/badge/award.json +36 -0
  4. package/lexicons/app/certified/badge/definition.json +53 -0
  5. package/lexicons/app/certified/badge/response.json +36 -0
  6. package/lexicons/app/certified/defs.json +4 -16
  7. package/lexicons/app/certified/location.json +5 -8
  8. package/lexicons/com/atproto/repo/strongRef.json +1 -1
  9. package/lexicons/org/hypercerts/claim/activity.json +135 -0
  10. package/lexicons/org/hypercerts/claim/collection.json +54 -0
  11. package/lexicons/org/hypercerts/claim/contribution.json +4 -11
  12. package/lexicons/org/hypercerts/claim/evaluation.json +50 -9
  13. package/lexicons/org/hypercerts/claim/evidence.json +29 -16
  14. package/lexicons/org/hypercerts/claim/measurement.json +18 -8
  15. package/lexicons/org/hypercerts/claim/project.json +64 -0
  16. package/lexicons/org/hypercerts/claim/rights.json +16 -3
  17. package/lexicons/org/hypercerts/defs.json +71 -0
  18. package/lexicons/org/hypercerts/funding/receipt.json +66 -0
  19. package/package.json +31 -38
  20. package/types/index.ts +1257 -0
  21. package/types/lexicons.ts +1071 -0
  22. package/types/types/app/certified/badge/award.ts +48 -0
  23. package/types/types/app/certified/badge/definition.ts +49 -0
  24. package/types/types/app/certified/badge/response.ts +44 -0
  25. package/types/types/app/certified/defs.ts +14 -0
  26. package/types/types/app/certified/location.ts +49 -0
  27. package/types/types/com/atproto/repo/strongRef.ts +31 -0
  28. package/types/types/org/hypercerts/claim/activity.ts +99 -0
  29. package/types/types/org/hypercerts/claim/collection.ts +49 -0
  30. package/types/types/org/hypercerts/claim/contribution.ts +48 -0
  31. package/types/types/org/hypercerts/claim/evaluation.ts +77 -0
  32. package/types/types/org/hypercerts/claim/evidence.ts +53 -0
  33. package/types/types/org/hypercerts/claim/measurement.ts +54 -0
  34. package/types/types/org/hypercerts/claim/project.ts +53 -0
  35. package/types/types/org/hypercerts/claim/rights.ts +49 -0
  36. package/types/types/org/hypercerts/defs.ts +96 -0
  37. package/types/types/org/hypercerts/funding/receipt.ts +58 -0
  38. package/types/util.ts +82 -0
  39. package/dist/index.cjs +0 -1472
  40. package/dist/index.cjs.map +0 -1
  41. package/dist/index.d.ts +0 -2094
  42. package/dist/index.mjs +0 -1441
  43. package/dist/index.mjs.map +0 -1
  44. package/lexicons/org/hypercerts/claim.json +0 -95
  45. package/lexicons/org/hypercerts/collection.json +0 -62
package/README.md.orig ADDED
@@ -0,0 +1,267 @@
1
+ # Hypercerts Lexicon Documentation
2
+
3
+ This repository contains ATProto lexicon definitions for the
4
+ Hypercerts protocol. Each lexicon defines a record type that can be
5
+ stored on the ATProto network.
6
+
7
+ ## Entity Relationship Diagram
8
+
9
+ ![Hypercert ERD](ERD.svg)
10
+
11
+ <details>
12
+ <summary>View ERD with field details</summary>
13
+
14
+ ![Hypercert ERD with fields](ERD-with-fields.svg)
15
+
16
+ </details>
17
+
18
+ ## Installation
19
+
20
+ ```
21
+ npm i @hypercerts-org/lexicon
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ ```typescript
27
+ import { AtpBaseClient } from '@hypercerts-org/lexicon'
28
+ import type { HypercertClaim } from '@hypercerts-org/lexicon'
29
+
30
+ const client = new AtpBaseClient({
31
+ service: 'https://bsky.social',
32
+ headers: { Authorization: `Bearer ${token}` }
33
+ })
34
+
35
+ const hypercert: HypercertClaim = {
36
+ $type: 'org.hypercerts.claim.activity',
37
+ title: 'My Impact Work',
38
+ shortDescription: 'Description here',
39
+ workScope: 'Scope of work',
40
+ startDate: '2023-01-01T00:00:00Z',
41
+ endDate: '2023-12-31T23:59:59Z',
42
+ createdAt: new Date().toISOString()
43
+ }
44
+
45
+ await client.org.hypercerts.claim.activity.create(
46
+ { repo: 'did:plc:example' },
47
+ hypercert
48
+ )
49
+ ```
50
+
51
+ ## Certified Lexicons
52
+
53
+ Certified lexicons are common/shared lexicons that can be used across multiple protocols.
54
+
55
+ ### Common Definitions
56
+
57
+ **Lexicon ID:** `org.hypercerts.defs`
58
+
59
+ **Description:** Common type definitions used across all certified protocols.
60
+
61
+ #### Defs
62
+
63
+ | Def | Type | Description | Comments |
64
+ |--------------|----------|-------------------------------------------|-----------------------------------------|
65
+ | `uri` | `object` | Object containing a URI to external data | Has `uri` property (string, format uri) |
66
+ | `smallBlob` | `object` | Object containing a blob to external data | Has `blob` property (blob, up to 10MB) |
67
+ | `largeBlob` | `object` | Object containing a blob to external data | Has `blob` property (blob, up to 100MB) |
68
+ | `smallImage` | `object` | Object containing a small image | Has `image` property (blob, up to 5MB) |
69
+ | `largeImage` | `object` | Object containing a large image | Has `image` property (blob, up to 10MB) |
70
+
71
+ ---
72
+
73
+ ### Location Lexicon
74
+
75
+ **Lexicon ID:** `app.certified.location`
76
+
77
+ **Description:** A location reference for use across certified protocols. For more information about
78
+
79
+ **Key:** `any`
80
+
81
+ #### Properties
82
+
83
+ | Property | Type | Required | Description | Comments |
84
+ | -------------- | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------- | -------- |
85
+ | `lpVersion` | `string` | ✅ | The version of the Location Protocol | |
86
+ | `srs` | `string` | ✅ | The Spatial Reference System URI (e.g., http://www.opengis.net/def/crs/OGC/1.3/CRS84) that defines the coordinate system. | |
87
+ | `locationType` | `string` | ✅ | An identifier for the format of the location data (e.g., coordinate-decimal, geojson-point) | |
88
+ | `location` | `union` | ✅ | The location of where the work was performed as a URI or blob. | |
89
+ | `name` | `string` | ❌ | Optional name for this location | |
90
+ | `description` | `string` | ❌ | Optional description for this location | |
91
+ | `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
92
+
93
+ ---
94
+
95
+ ## Hypercerts Lexicons
96
+
97
+ Hypercerts-specific lexicons for tracking impact work and claims.
98
+
99
+ ### Hypercerts Activity Claim
100
+
101
+ **Lexicon ID:** `org.hypercerts.claim.activity`
102
+
103
+ **Description:** The main lexicon where everything is connected to. This is the hypercert record that tracks impact work.
104
+
105
+ **Key:** `any`
106
+
107
+ #### Properties
108
+
109
+ | Property | Type | Required | Description | Comments |
110
+ | ------------------- | -------- | -------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
111
+ | `title` | `string` | ✅ | Title of the hypercert | |
112
+ | `shortDescription` | `string` | ✅ | Short blurb of the impact work done. | |
113
+ | `description` | `string` | ❌ | Optional longer description of the impact work done. | |
114
+ | `image` | `union` | ❌ | The hypercert visual representation as a URI or image blob | |
115
+ | `workScope` | `object` | ❌ | Logical scope of the work using label-based conditions | Object with `allOf`, `anyOf`, `noneOf` arrays of labels |
116
+ | `startDate` | `string` | ✅ | When the work began | |
117
+ | `endDate` | `string` | ✅ | When the work ended | |
118
+ | `contributions` | `array` | ❌ | A strong reference to the contributions done to create the impact in the hypercerts | References must conform to `org.hypercerts.claim.contribution` |
119
+ | `rights` | `ref` | ❌ | A strong reference to the rights that this hypercert has | References must conform to `org.hypercerts.claim.rights` |
120
+ | `location` | `ref` | ❌ | A strong reference to the location where the work for done hypercert was located | References must conform to `app.certified.location` |
121
+ | `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
122
+
123
+ ---
124
+
125
+ ### Hypercerts Contribution
126
+
127
+ **Lexicon ID:** `org.hypercerts.claim.contribution`
128
+
129
+ **Description:** A contribution made toward a hypercert's impact.
130
+
131
+ **Key:** `any`
132
+
133
+ #### Properties
134
+
135
+ | Property | Type | Required | Description | Comments |
136
+ | ------------------- | -------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
137
+ | `role` | `string` | ❌ | Role or title of the contributor(s). | |
138
+ | `contributors` | `array` | ✅ | List of the contributors (names, pseudonyms, or DIDs). If multiple contributors are stored in the same hypercertContribution, then they would have the exact same role. | |
139
+ | `description` | `string` | ❌ | What the contribution concretely achieved | |
140
+ | `startDate` | `string` | ❌ | When this contribution started. This should be a subset of the hypercert timeframe. | |
141
+ | `endDate` | `string` | ❌ | When this contribution finished. This should be a subset of the hypercert timeframe. | |
142
+ | `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
143
+
144
+ ---
145
+
146
+ ### Hypercerts Evaluation
147
+
148
+ **Lexicon ID:** `org.hypercerts.claim.evaluation`
149
+
150
+ **Description:** An evaluation of a hypercert or other claim
151
+
152
+ **Key:** `tid`
153
+
154
+ #### Properties
155
+
156
+ | Property | Type | Required | Description | Comments |
157
+ | ------------- | -------- | -------- | -------------------------------------------------------------------------- | -------------------------------------------------------------- |
158
+ | `subject` | `ref` | ✅ | A strong reference to the evaluated claim | (e.g measurement, hypercert, contribution, etc) |
159
+ | `evaluators` | `array` | ✅ | DIDs of the evaluators | |
160
+ | `evaluations` | `array` | ❌ | Evaluation data (URIs or blobs) containing detailed reports or methodology | |
161
+ | `summary` | `string` | ✅ | Brief evaluation summary | |
162
+ | `location` | `ref` | ❌ | An optional reference for georeferenced evaluations | References must conform to `app.certified.location` |
163
+ | `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
164
+
165
+ ---
166
+
167
+ ### Hypercerts Evidence
168
+
169
+ **Lexicon ID:** `org.hypercerts.claim.evidence`
170
+
171
+ **Description:** A piece of evidence supporting a hypercert claim
172
+
173
+ **Key:** `any`
174
+
175
+ #### Properties
176
+
177
+ | Property | Type | Required | Description | Comments |
178
+ |--------------------|----------|----------|----------------------------------------------------------------------------|-------------------------------------------------------------------------------------|
179
+ | `activity` | `ref` | ❌ | A strong reference to the activity this evidence is for | The record referenced must conform with the lexicon `org.hypercerts.claim.activity` |
180
+ | `content` | `union` | ✅ | A piece of evidence (URI or blobs) supporting a hypercert claim | |
181
+ | `title` | `string` | ✅ | Title to describe the nature of the evidence | |
182
+ | `shortDescription` | `string` | ❌ | Short description explaining what this evidence demonstrates or proves | |
183
+ | `description` | `string` | ❌ | Optional longer description describing the impact claim evidence. | |
184
+ | `createdAt` | `string` | ✅ | Client-declared timestamp when this hypercert claim was originally created | |
185
+
186
+ ---
187
+
188
+ ### org.hypercerts.claim.measurement
189
+
190
+ **Lexicon ID:** `org.hypercerts.claim.measurement`
191
+
192
+ **Description:** External measurement data supporting a hypercert claim
193
+
194
+ **Key:** `tid`
195
+
196
+ #### Properties
197
+
198
+ | Property | Type | Required | Description | Comments |
199
+ | ---------------------- | -------- | -------- | ----------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
200
+ | `activity` | `ref` | ✅ | A strong reference to the activity that this measurement is for | The record referenced must conform with the lexicon `org.hypercerts.claim.activity` |
201
+ | `measurers` | `array` | ✅ | DIDs of the entity (or entities) that measured this data | |
202
+ | `metric` | `string` | ✅ | The metric being measured | |
203
+ | `value` | `string` | ✅ | The measured value | |
204
+ | `measurementMethodType`| `string` | ❌ | Short identifier for the measurement methodology | |
205
+ | `measurementMethodURI` | `string` | ❌ | URI to methodology documentation, standard protocol, or measurement procedure | |
206
+ | `evidenceURI` | `array` | ❌ | URIs to supporting evidence or data | |
207
+ | `location` | `ref` | ❌ | A strong reference to the location where the measurement was taken | References must conform to `app.certified.location` |
208
+ | `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
209
+
210
+ ---
211
+
212
+ ### org.hypercerts.claim.collection
213
+
214
+ **Lexicon ID:** `org.hypercerts.claim.collection`
215
+
216
+ **Description:** A collection/group of hypercerts that have a specific property.
217
+
218
+ **Key:** `tid`
219
+
220
+ #### Properties
221
+
222
+ | Property | Type | Required | Description | Comments |
223
+ | ------------------ | -------- | -------- | ----------------------------------------------------------------------- | --------------------------------- |
224
+ | `title` | `string` | ✅ | The title of this collection | |
225
+ | `shortDescription` | `string` | ❌ | A short description of this collection | |
226
+ | `coverPhoto` | `union` | ❌ | The cover photo of this collection (either in URI format or in a blob). | |
227
+ | `claims` | `array` | ✅ | Array of claims with their associated weights in this collection | Each item references `#claimItem` |
228
+ | `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
229
+
230
+ #### Defs
231
+
232
+ ##### claimItem
233
+
234
+ | Property | Type | Required | Description | Comments |
235
+ | -------- | -------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
236
+ | `claim` | `ref` | ✅ | A strong reference to a hypercert claim record. This claim must conform to the lexicon org.hypercerts.claim.activity | |
237
+ | `weight` | `string` | ✅ | The weight/importance of this hypercert claim in the collection (a percentage from 0-100, stored as a string to avoid float precision issues). The total claim weights should add up to 100. | |
238
+
239
+ ---
240
+
241
+ ### org.hypercerts.claim.rights
242
+
243
+ **Lexicon ID:** `org.hypercerts.claim.rights`
244
+
245
+ **Description:** Describes the rights that a user has with a hypercert, such as whether it can be sold, transferred, and under what conditions.
246
+
247
+ **Key:** `any`
248
+
249
+ #### Properties
250
+
251
+ | Property | Type | Required | Description | Comments |
252
+ | ------------------- | -------- | -------- | ----------------------------------------------------------------- | -------- |
253
+ | `rightsName` | `string` | ✅ | Full name of the rights | |
254
+ | `rightsType` | `string` | ✅ | Short rights identifier for easier search | |
255
+ | `rightsDescription` | `string` | ✅ | Description of the rights of this hypercert | |
256
+ | `attachment` | `union` | ❌ | An attachment to define the rights further, e.g. a legal document | URI or blob |
257
+ | `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
258
+
259
+ ---
260
+
261
+ ## Notes
262
+
263
+ - All timestamps use the `datetime` format (ISO 8601)
264
+ - Strong references (`com.atproto.repo.strongRef`) include both the URI and CID of the referenced record
265
+ - Union types allow multiple possible formats (e.g., URI or blob)
266
+ - Array items may have constraints like `maxLength` to limit the number of elements
267
+ - String fields may have both `maxLength` (bytes) and `maxGraphemes` (Unicode grapheme clusters) constraints
@@ -0,0 +1,36 @@
1
+ {
2
+ "lexicon": 1,
3
+ "id": "app.certified.badge.award",
4
+ "defs": {
5
+ "main": {
6
+ "type": "record",
7
+ "description": "Records a badge award to a user, project, or activity claim.",
8
+ "key": "tid",
9
+ "record": {
10
+ "type": "object",
11
+ "required": ["badge", "subject", "createdAt"],
12
+ "properties": {
13
+ "badge": {
14
+ "type": "ref",
15
+ "ref": "app.certified.badge.definition",
16
+ "description": "Reference to the badge definition for this award."
17
+ },
18
+ "subject": {
19
+ "type": "union",
20
+ "description": "Entity the badge award is for (either an account DID or any specific AT Protocol record), e.g. a user, a project, or a specific activity claim.",
21
+ "refs": ["app.certified.defs#did", "com.atproto.repo.strongRef"]
22
+ },
23
+ "note": {
24
+ "type": "string",
25
+ "description": "Optional statement explaining the reason for this badge award."
26
+ },
27
+ "createdAt": {
28
+ "type": "string",
29
+ "format": "datetime",
30
+ "description": "Client-declared timestamp when this record was originally created"
31
+ }
32
+ }
33
+ }
34
+ }
35
+ }
36
+ }
@@ -0,0 +1,53 @@
1
+ {
2
+ "lexicon": 1,
3
+ "id": "app.certified.badge.definition",
4
+ "defs": {
5
+ "main": {
6
+ "type": "record",
7
+ "description": "Defines a badge that can be awarded via badge award records to users, projects, or activity claims.",
8
+ "key": "tid",
9
+ "record": {
10
+ "type": "object",
11
+ "required": ["title", "badgeType", "icon", "createdAt"],
12
+ "properties": {
13
+ "badgeType": {
14
+ "type": "string",
15
+ "description": "Category of the badge (e.g. endorsement, participation, affiliation)."
16
+ },
17
+ "title": {
18
+ "type": "string",
19
+ "description": "Human-readable title of the badge."
20
+ },
21
+ "icon": {
22
+ "type": "blob",
23
+ "description": "Icon representing the badge, stored as a blob for compact visual display.",
24
+ "accept": [
25
+ "image/png",
26
+ "image/jpeg",
27
+ "image/webp",
28
+ "image/svg+xml"
29
+ ],
30
+ "maxSize": 1048576
31
+ },
32
+ "description": {
33
+ "type": "string",
34
+ "description": "Optional short statement describing what the badge represents."
35
+ },
36
+ "allowedIssuers": {
37
+ "type": "array",
38
+ "description": "Optional allowlist of DIDs allowed to issue this badge. If omitted, anyone may issue it.",
39
+ "items": {
40
+ "type": "ref",
41
+ "ref": "app.certified.defs#did"
42
+ }
43
+ },
44
+ "createdAt": {
45
+ "type": "string",
46
+ "format": "datetime",
47
+ "description": "Client-declared timestamp when this record was originally created"
48
+ }
49
+ }
50
+ }
51
+ }
52
+ }
53
+ }
@@ -0,0 +1,36 @@
1
+ {
2
+ "lexicon": 1,
3
+ "id": "app.certified.badge.response",
4
+ "defs": {
5
+ "main": {
6
+ "type": "record",
7
+ "description": "Recipient response to a badge award.",
8
+ "key": "tid",
9
+ "record": {
10
+ "type": "object",
11
+ "required": ["badgeAward", "response", "createdAt"],
12
+ "properties": {
13
+ "badgeAward": {
14
+ "type": "ref",
15
+ "ref": "app.certified.badge.award",
16
+ "description": "Reference to the badge award."
17
+ },
18
+ "response": {
19
+ "type": "string",
20
+ "enum": ["accepted", "rejected"],
21
+ "description": "The recipient’s response for the badge (accepted or rejected)."
22
+ },
23
+ "weight": {
24
+ "type": "string",
25
+ "description": "Optional relative weight for accepted badges, assigned by the recipient."
26
+ },
27
+ "createdAt": {
28
+ "type": "string",
29
+ "format": "datetime",
30
+ "description": "Client-declared timestamp when this record was originally created"
31
+ }
32
+ }
33
+ }
34
+ }
35
+ }
36
+ }
@@ -1,24 +1,12 @@
1
1
  {
2
2
  "lexicon": 1,
3
3
  "id": "app.certified.defs",
4
+ "description": "Common type definitions used across certified protocols.",
4
5
  "defs": {
5
- "uri": {
6
+ "did": {
6
7
  "type": "string",
7
- "format": "uri",
8
- "maxGraphemes": 1000,
9
- "description": "URI to external data"
10
- },
11
- "smallBlob": {
12
- "type": "blob",
13
- "accept": ["*/*"],
14
- "maxSize": 10485760,
15
- "description": "Blob to external data (up to 10MB)"
16
- },
17
- "largeBlob": {
18
- "type": "blob",
19
- "accept": ["*/*"],
20
- "maxSize": 104857600,
21
- "description": "Blob to external data (up to 100MB)"
8
+ "format": "did",
9
+ "description": "A Decentralized Identifier (DID) string."
22
10
  }
23
11
  }
24
12
  }
@@ -5,7 +5,7 @@
5
5
  "main": {
6
6
  "type": "record",
7
7
  "description": "A location reference",
8
- "key": "any",
8
+ "key": "tid",
9
9
  "record": {
10
10
  "type": "object",
11
11
  "required": [
@@ -30,17 +30,14 @@
30
30
  "locationType": {
31
31
  "type": "string",
32
32
  "description": "An identifier for the format of the location data (e.g., coordinate-decimal, geojson-point)",
33
- "knownValues": [
34
- "coordinate-decimal",
35
- "geojson-point"
36
- ],
33
+ "knownValues": ["coordinate-decimal", "geojson-point"],
37
34
  "maxLength": 20
38
35
  },
39
36
  "location": {
40
37
  "type": "union",
41
38
  "refs": [
42
- "app.certified.defs#uri",
43
- "app.certified.defs#smallBlob"
39
+ "org.hypercerts.defs#uri",
40
+ "org.hypercerts.defs#smallBlob"
44
41
  ],
45
42
  "description": "The location of where the work was performed as a URI or blob."
46
43
  },
@@ -65,4 +62,4 @@
65
62
  }
66
63
  }
67
64
  }
68
- }
65
+ }
@@ -12,4 +12,4 @@
12
12
  }
13
13
  }
14
14
  }
15
- }
15
+ }
@@ -0,0 +1,135 @@
1
+ {
2
+ "lexicon": 1,
3
+ "id": "org.hypercerts.claim.activity",
4
+ "defs": {
5
+ "main": {
6
+ "type": "record",
7
+ "description": "A hypercert record tracking impact work.",
8
+ "key": "any",
9
+ "record": {
10
+ "type": "object",
11
+ "required": [
12
+ "title",
13
+ "shortDescription",
14
+ "createdAt",
15
+ "startDate",
16
+ "endDate"
17
+ ],
18
+ "properties": {
19
+ "title": {
20
+ "type": "string",
21
+ "description": "Title of the hypercert.",
22
+ "maxLength": 256
23
+ },
24
+ "shortDescription": {
25
+ "type": "string",
26
+ "description": "Short blurb of the impact work done.",
27
+ "maxLength": 3000,
28
+ "maxGraphemes": 300
29
+ },
30
+ "description": {
31
+ "type": "string",
32
+ "description": "Optional longer description of the impact work done.",
33
+ "maxLength": 30000,
34
+ "maxGraphemes": 3000
35
+ },
36
+ "image": {
37
+ "type": "union",
38
+ "refs": [
39
+ "org.hypercerts.defs#uri",
40
+ "org.hypercerts.defs#smallImage"
41
+ ],
42
+ "description": "The hypercert visual representation as a URI or image blob."
43
+ },
44
+ "workScope": {
45
+ "type": "ref",
46
+ "ref": "#workScope"
47
+ },
48
+ "startDate": {
49
+ "type": "string",
50
+ "format": "datetime",
51
+ "description": "When the work began"
52
+ },
53
+ "endDate": {
54
+ "type": "string",
55
+ "format": "datetime",
56
+ "description": "When the work ended"
57
+ },
58
+ "contributions": {
59
+ "type": "array",
60
+ "description": "A strong reference to the contributions done to create the impact in the hypercerts. The record referenced must conform with the lexicon org.hypercerts.claim.contribution.",
61
+ "items": {
62
+ "type": "ref",
63
+ "ref": "com.atproto.repo.strongRef"
64
+ }
65
+ },
66
+ "rights": {
67
+ "type": "ref",
68
+ "ref": "com.atproto.repo.strongRef",
69
+ "description": "A strong reference to the rights that this hypercert has. The record referenced must conform with the lexicon org.hypercerts.claim.rights."
70
+ },
71
+ "location": {
72
+ "type": "ref",
73
+ "ref": "com.atproto.repo.strongRef",
74
+ "description": "A strong reference to the location where the activity was performed. The record referenced must conform with the lexicon app.certified.location."
75
+ },
76
+ "project": {
77
+ "type": "string",
78
+ "format": "at-uri",
79
+ "description": "A reference (AT-URI) to the project record that this activity is part of. The record referenced must conform with the lexicon org.hypercerts.claim.project. This activity must also be referenced by the project, establishing a bidirectional link."
80
+ },
81
+ "createdAt": {
82
+ "type": "string",
83
+ "format": "datetime",
84
+ "description": "Client-declared timestamp when this record was originally created"
85
+ }
86
+ }
87
+ }
88
+ },
89
+ "workScope": {
90
+ "type": "object",
91
+ "description": "Logical scope of the work using label-based conditions. All labels in `withinAllOf` must apply; at least one label in `withinAnyOf` must apply if provided; no label in `withinNoneOf` may apply.",
92
+ "properties": {
93
+ "withinAllOf": {
94
+ "type": "array",
95
+ "description": "Labels that MUST all hold for the scope to apply.",
96
+ "items": {
97
+ "type": "string"
98
+ },
99
+ "maxLength": 100
100
+ },
101
+ "withinAnyOf": {
102
+ "type": "array",
103
+ "description": "Labels of which AT LEAST ONE must hold (optional). If omitted or empty, imposes no additional condition.",
104
+ "items": {
105
+ "type": "string"
106
+ },
107
+ "maxLength": 100
108
+ },
109
+ "withinNoneOf": {
110
+ "type": "array",
111
+ "description": "Labels that MUST NOT hold for the scope to apply.",
112
+ "items": {
113
+ "type": "string"
114
+ },
115
+ "maxLength": 100
116
+ }
117
+ }
118
+ },
119
+ "activityWeight": {
120
+ "type": "object",
121
+ "required": ["activity", "weight"],
122
+ "properties": {
123
+ "activity": {
124
+ "type": "ref",
125
+ "ref": "com.atproto.repo.strongRef",
126
+ "description": "A strong reference to a hypercert activity record. This activity must conform to the lexicon org.hypercerts.claim.activity"
127
+ },
128
+ "weight": {
129
+ "type": "string",
130
+ "description": "The relative weight/importance of this hypercert activity (stored as a string to avoid float precision issues). Weights can be any positive numeric values and do not need to sum to a specific total; normalization can be performed by the consuming application as needed."
131
+ }
132
+ }
133
+ }
134
+ }
135
+ }
@@ -0,0 +1,54 @@
1
+ {
2
+ "lexicon": 1,
3
+ "id": "org.hypercerts.claim.collection",
4
+ "defs": {
5
+ "main": {
6
+ "type": "record",
7
+ "description": "A collection/group of hypercerts that have a specific property.",
8
+ "key": "tid",
9
+ "record": {
10
+ "type": "object",
11
+ "required": ["title", "activities", "createdAt"],
12
+ "properties": {
13
+ "title": {
14
+ "type": "string",
15
+ "description": "The title of this collection",
16
+ "maxLength": 800,
17
+ "maxGraphemes": 80
18
+ },
19
+ "shortDescription": {
20
+ "type": "string",
21
+ "maxLength": 3000,
22
+ "maxGraphemes": 300,
23
+ "description": "A short description of this collection"
24
+ },
25
+ "avatar": {
26
+ "type": "blob",
27
+ "description": "Primary avatar image representing this collection across apps and views; typically a square image.",
28
+ "accept": ["image/png", "image/jpeg"],
29
+ "maxSize": 1000000
30
+ },
31
+ "coverPhoto": {
32
+ "type": "blob",
33
+ "description": "The cover photo of this collection.",
34
+ "accept": ["image/png", "image/jpeg"],
35
+ "maxSize": 1000000
36
+ },
37
+ "activities": {
38
+ "type": "array",
39
+ "description": "Array of activities with their associated weights in this collection",
40
+ "items": {
41
+ "type": "ref",
42
+ "ref": "org.hypercerts.claim.activity#activityWeight"
43
+ }
44
+ },
45
+ "createdAt": {
46
+ "type": "string",
47
+ "format": "datetime",
48
+ "description": "Client-declared timestamp when this record was originally created"
49
+ }
50
+ }
51
+ }
52
+ }
53
+ }
54
+ }