mirror of
https://github.com/versia-pub/docs.git
synced 2026-03-13 02:49:16 +01:00
feat: ✨ Add collections field to Notes
This commit is contained in:
parent
b59b6b8ebb
commit
e97b86f983
9 changed files with 95 additions and 38 deletions
|
|
@ -87,6 +87,10 @@ Custom Emojis can be added to any entity with text content. The extension ID is
|
|||
"type": "Note",
|
||||
"uri": "https://versia.social/notes/456df8ed-daf1-4062-abab-491071c7b8dd",
|
||||
"created_at": "2024-04-09T01:38:51.743Z",
|
||||
"collections": {
|
||||
"replies": "https://versia.social/notes/456df8ed-daf1-4062-abab-491071c7b8dd/replies",
|
||||
"quotes": "https://versia.social/notes/456df8ed-daf1-4062-abab-491071c7b8dd/quotes"
|
||||
},
|
||||
"content": {
|
||||
"text/plain": {
|
||||
"content": "Hello, world :happy_face:!"
|
||||
|
|
|
|||
|
|
@ -17,6 +17,10 @@ The entity defined in this document must be inserted in the `pub.versia:interact
|
|||
"type": "Note",
|
||||
"uri": "https://versia.social/notes/456df8ed-daf1-4062-abab-491071c7b8dd",
|
||||
"created_at": "2024-04-09T01:38:51.743Z",
|
||||
"collections": {
|
||||
"replies": "https://versia.social/notes/456df8ed-daf1-4062-abab-491071c7b8dd/replies",
|
||||
"quotes": "https://versia.social/notes/456df8ed-daf1-4062-abab-491071c7b8dd/quotes"
|
||||
},
|
||||
"content": {
|
||||
"text/plain": {
|
||||
"content": "Hello, world :happy_face:!"
|
||||
|
|
|
|||
|
|
@ -107,6 +107,25 @@ The Likes extension adds the following collections to the [User](/entities/user)
|
|||
}
|
||||
```
|
||||
|
||||
## Note Collections
|
||||
|
||||
The Likes extension adds the following collections to the [Note](/entities/note) entity:
|
||||
|
||||
- `likes`: A [URI Collection](/structures/collection#uri-collection) of all the likes the note has received.
|
||||
- `dislikes`: A [URI Collection](/structures/collection#uri-collection) of all the dislikes the note has received.
|
||||
|
||||
```jsonc
|
||||
{
|
||||
"type": "Note",
|
||||
...
|
||||
"collections": {
|
||||
...
|
||||
"pub.versia:likes/Likes": "https://example.com/notes/fmKZ763jzIU8/likes",
|
||||
"pub.versia:likes/Dislikes": "https://example.com/notes/fmKZ763jzIU8/dislikes"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Interaction Types
|
||||
|
||||
<Note>
|
||||
|
|
|
|||
|
|
@ -45,6 +45,10 @@ Note that there is no `question` field: the question should be included in the `
|
|||
"created_at": "2024-06-19T01:07:44.139Z",
|
||||
"author": "https://versia.social/users/018eb863-753f-76ff-83d6-fd590de7740a",
|
||||
"category": "microblog",
|
||||
"collections": {
|
||||
"replies": "https://versia.social/notes/01902e09-0f8b-72de-8ee3-9afc0cf5eae1/replies",
|
||||
"quotes": "https://versia.social/notes/01902e09-0f8b-72de-8ee3-9afc0cf5eae1/quotes"
|
||||
},
|
||||
"content": {
|
||||
"text/plain": {
|
||||
"content": "What is your favourite color?"
|
||||
|
|
|
|||
|
|
@ -50,48 +50,22 @@ User reactions are (like every other entity) federated to all followers, and can
|
|||
</Col>
|
||||
</Row>
|
||||
|
||||
## Extensions to Note
|
||||
## Note Collections
|
||||
|
||||
The Reactions Extension extends the [Note](/entities/note) entity with the following fields:
|
||||
The Likes extension adds the following collections to the [Note](/entities/note) entity:
|
||||
|
||||
<Row>
|
||||
<Col>
|
||||
<Properties>
|
||||
<Property name="reactions" type="array" required>
|
||||
URI to a [URI Collection](/structures/collection#uri-collection) of the [Reactions](#entity-definition) attached to the note.
|
||||
</Property>
|
||||
</Properties>
|
||||
</Col>
|
||||
- `reactions`: A [URI Collection](/structures/collection#uri-collection) of all the reactions to the note.
|
||||
|
||||
<Col sticky>
|
||||
|
||||
```jsonc {{ title: "Example Note" }}
|
||||
{
|
||||
"id": "01902e09-0f8b-72de-8ee3-9afc0cf5eae1",
|
||||
"type": "Note", // [!code focus]
|
||||
"uri": "https://versia.social/notes/01902e09-0f8b-72de-8ee3-9afc0cf5eae1",
|
||||
"created_at": "2024-06-19T01:07:44.139Z",
|
||||
"author": "https://versia.social/users/018eb863-753f-76ff-83d6-fd590de7740a",
|
||||
"category": "microblog",
|
||||
"content": {
|
||||
"text/plain": {
|
||||
"content": "Bababooey."
|
||||
}
|
||||
},
|
||||
"extensions": { // [!code focus:5]
|
||||
"pub.versia:reactions": {
|
||||
"reactions": "https://versia.social/notes/01902e09-0f8b-72de-8ee3-9afc0cf5eae1/reactions"
|
||||
}
|
||||
},
|
||||
"group": "public",
|
||||
"is_sensitive": false,
|
||||
"mentions": [],
|
||||
```jsonc
|
||||
{
|
||||
"type": "Note",
|
||||
...
|
||||
"collections": {
|
||||
...
|
||||
"pub.versia:reactions/Reactions": "https://example.com/publications/f08a124e-fe90-439e-8be4-15a428a72a19/reactions"
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
</Col>
|
||||
</Row>
|
||||
}
|
||||
```
|
||||
|
||||
## Interaction Types
|
||||
|
||||
|
|
|
|||
|
|
@ -46,6 +46,23 @@ When a user shares a note, the note's original author **must** receive the entit
|
|||
</Col>
|
||||
</Row>
|
||||
|
||||
## Note Collections
|
||||
|
||||
The Share extension adds the following collections to the [Note](/entities/note) entity:
|
||||
|
||||
- `shares`: A [URI Collection](/structures/collection#uri-collection) of all the shares of the note.
|
||||
|
||||
```jsonc
|
||||
{
|
||||
"type": "Note",
|
||||
...
|
||||
"collections": {
|
||||
...
|
||||
"pub.versia:share/Shares": "https://example.com/notes/fmKZ763jzIU8/shares"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Interaction Types
|
||||
|
||||
<Note>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue