diff --git a/.changeset/remove-collection-project.md b/.changeset/remove-collection-project.md new file mode 100644 index 00000000..2e377b72 --- /dev/null +++ b/.changeset/remove-collection-project.md @@ -0,0 +1,5 @@ +--- +"@hypercerts-org/lexicon": minor +--- + +Remove org.hypercerts.claim.collection.project lexicon diff --git a/ERD.puml b/ERD.puml index b7bb0ba8..b3bf1cd0 100644 --- a/ERD.puml +++ b/ERD.puml @@ -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 @@ -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 diff --git a/README.md b/README.md index 93fa0169..f41ad1d8 100644 --- a/README.md +++ b/README.md @@ -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"; @@ -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", @@ -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. diff --git a/SCHEMAS.md b/SCHEMAS.md index 5fada197..af1e80cb 100644 --- a/SCHEMAS.md +++ b/SCHEMAS.md @@ -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. diff --git a/lexicons/org/hypercerts/claim/collection/project.json b/lexicons/org/hypercerts/claim/collection/project.json deleted file mode 100644 index a1385694..00000000 --- a/lexicons/org/hypercerts/claim/collection/project.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "lexicon": 1, - "id": "org.hypercerts.claim.collection.project", - "defs": { - "main": { - "type": "record", - "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", - "record": { - "type": "object", - "required": ["projectDescription", "createdAt"], - "properties": { - "projectTitle": { - "type": "string", - "description": "The title of this collection", - "maxLength": 800, - "maxGraphemes": 80 - }, - "shortProjectDescription": { - "type": "string", - "maxLength": 3000, - "maxGraphemes": 300, - "description": "Short summary of this project, suitable for previews and list views" - }, - "projectDescription": { - "type": "ref", - "ref": "pub.leaflet.pages.linearDocument#main", - "description": "Rich-text description of this project, represented as a Leaflet linear document." - }, - "avatar": { - "type": "blob", - "description": "Primary avatar image representing this project across apps and views; typically a square logo or project identity image.", - "accept": ["image/png", "image/jpeg"], - "maxSize": 1000000 - }, - "coverPhoto": { - "type": "blob", - "description": "The cover photo of this project.", - "accept": ["image/png", "image/jpeg"], - "maxSize": 1000000 - }, - "createdAt": { - "type": "string", - "format": "datetime", - "description": "Client-declared timestamp when this project metadata was created" - } - } - } - } - } -} diff --git a/scripts/generate-schemas.js b/scripts/generate-schemas.js index dca45299..51764cbc 100644 --- a/scripts/generate-schemas.js +++ b/scripts/generate-schemas.js @@ -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", ];