Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/remove-collection-project.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hypercerts-org/lexicon": minor
---

Remove org.hypercerts.claim.collection.project lexicon
13 changes: 0 additions & 13 deletions ERD.puml
Original file line number Diff line number Diff line change
Expand Up @@ -193,18 +193,6 @@ dataclass collection {
!endif
}

' org.hypercerts.claim.collection.project (sidecar)
dataclass collectionProject {
!if (SHOW_FIELDS == "true")
projectTitle?
shortProjectDescription?
projectDescription (Leaflet ref)
avatar?
coverPhoto?
createdAt
!endif
}

'together {

' Funders are represented by DIDs or human-readable strings
Expand Down Expand Up @@ -298,7 +286,6 @@ measurement --> location

collection::items --> activity
collection::items --> collection : "recursive\nnesting"
collection ..|> collectionProject : "sidecar\n(same TID)"

activity::contributions -l--> contributor
activity::rights --> rights
Expand Down
50 changes: 15 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ property tables, see [SCHEMAS.md](SCHEMAS.md).

## Examples

### Example: Creating a Collection with Nested Items
### Creating a Collection with Nested Items

```typescript
import { TID } from "@atproto/common";
Expand Down Expand Up @@ -222,17 +222,21 @@ const collectionRecord = {
};
```

### Example: Creating a Project (Collection + Project Sidecar)
### Creating a Project

```typescript
import { TID } from "@atproto/common";

const tid = TID.nextStr(); // Same TID for both records
Projects are collections with a `type` field set to "project" and can
include rich-text descriptions:

// Base collection record
const collectionRecord = {
```typescript
const projectRecord = {
$type: "org.hypercerts.claim.collection",
type: "project",
title: "Carbon Offset Initiative",
shortDescription: "A project focused on carbon reduction and reforestation",
description: {
uri: "at://did:plc:alice/pub.leaflet.pages.linearDocument/abc123",
cid: "...",
},
items: [
{
uri: "at://did:plc:alice/org.hypercerts.claim.activity/3k2abc",
Expand All @@ -245,32 +249,8 @@ const collectionRecord = {
],
createdAt: new Date().toISOString(),
};

// Project sidecar with rich-text description and assets
const projectSidecar = {
$type: "org.hypercerts.claim.collection.project",
projectTitle: "Carbon Offset Initiative",
shortProjectDescription: "A project focused on carbon reduction",
projectDescription: {
uri: "at://did:plc:alice/pub.leaflet.pages.linearDocument/abc123",
cid: "...",
},
avatar: avatarBlob,
coverPhoto: coverPhotoBlob,
createdAt: new Date().toISOString(),
};

// Create both with same TID
await createRecord({
collection: "org.hypercerts.claim.collection",
rkey: tid,
record: collectionRecord,
});
await createRecord({
collection: "org.hypercerts.claim.collection.project",
rkey: tid,
record: projectSidecar,
});
```

**Note**: The project sidecar is optional. Collections without this sidecar are simple groupings; collections with it are "projects" with rich documentation.
**Note**: The `type` field is optional and can be set to "project",
"favorites", or any other collection type. The `description` field
supports rich-text via Leaflet linear documents.
19 changes: 0 additions & 19 deletions SCHEMAS.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,25 +132,6 @@ Hypercerts-specific lexicons for tracking impact work and claims.

---

### `org.hypercerts.claim.collection.project`

**Description:** Project-specific metadata for a collection. Uses the sidecar pattern with the same record key (TID) as the collection record. Provides rich-text description capabilities for project-type collections.

**Key:** `tid`

#### Properties

| Property | Type | Required | Description | Comments |
| ------------------------- | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------ |
| `projectTitle` | `string` | no | The title of this collection | maxLength: 800, maxGraphemes: 80 |
| `shortProjectDescription` | `string` | no | Short summary of this project, suitable for previews and list views | maxLength: 3000, maxGraphemes: 300 |
| `projectDescription` | `ref` | yes | Rich-text description of this project, represented as a Leaflet linear document. | |
| `avatar` | `blob` | no | Primary avatar image representing this project across apps and views; typically a square logo or project identity image. | maxSize: 1000000, accepts: image/png, image/jpeg |
| `coverPhoto` | `blob` | no | The cover photo of this project. | maxSize: 1000000, accepts: image/png, image/jpeg |
| `createdAt` | `string` | yes | Client-declared timestamp when this project metadata was created | |

---

### `org.hypercerts.claim.rights`

**Description:** Describes the rights that a contributor and/or an owner has, such as whether the hypercert can be sold, transferred, and under what conditions.
Expand Down
51 changes: 0 additions & 51 deletions lexicons/org/hypercerts/claim/collection/project.json

This file was deleted.

1 change: 0 additions & 1 deletion scripts/generate-schemas.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,6 @@ function generateMarkdown() {
"org.hypercerts.claim.evidence",
"org.hypercerts.claim.measurement",
"org.hypercerts.claim.collection",
"org.hypercerts.claim.collection.project",
"org.hypercerts.claim.rights",
"org.hypercerts.funding.receipt",
];
Expand Down