mirror of
https://github.com/versia-pub/docs.git
synced 2026-01-26 03:56:02 +01:00
feat: 📝 Document the Follow stack
This commit is contained in:
parent
909b7ec115
commit
4df2d8194d
42
app/entities/follow-accepts/page.mdx
Normal file
42
app/entities/follow-accepts/page.mdx
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
export const metadata = {
|
||||||
|
title: 'FollowAccept',
|
||||||
|
description: 'FollowAccept lets users accept follow requests',
|
||||||
|
}
|
||||||
|
|
||||||
|
# FollowAccept
|
||||||
|
|
||||||
|
<Note>
|
||||||
|
Refer to the [Follow](/entities/follow) entity for information on how follow relationships work.
|
||||||
|
</Note>
|
||||||
|
|
||||||
|
## Entity Definition
|
||||||
|
|
||||||
|
<Row>
|
||||||
|
<Col>
|
||||||
|
<Properties>
|
||||||
|
<Property name="uri" type="null" required={false}>
|
||||||
|
This entity does not have a URI.
|
||||||
|
</Property>
|
||||||
|
<Property name="author" type="URI" required={true} typeLink="/types#uri">
|
||||||
|
URI of the `User` considered the 'followee', i.e. the user who is being followed.
|
||||||
|
</Property>
|
||||||
|
<Property name="follower" type="URI" required={true} typeLink="/types#uri">
|
||||||
|
URI of the `User` considered the 'follower', i.e. the user who is trying to follow the author.
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Col>
|
||||||
|
|
||||||
|
<Col sticky>
|
||||||
|
|
||||||
|
```jsonc {{ title: 'Example FollowAccept' }}
|
||||||
|
{
|
||||||
|
"type": "FollowAccept",
|
||||||
|
"id": "3e7e4750-afd4-4d99-a256-02f0710a0520",
|
||||||
|
"author": "https://example.com/users/6e0204a2-746c-4972-8602-c4f37fc63bbe",
|
||||||
|
"created_at": "2021-01-01T00:00:00.000Z",
|
||||||
|
"follower": "https://example.com/users/02e1e3b2-cb1f-4e4a-b82e-98866bee5de7"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
52
app/entities/follow-rejects/page.mdx
Normal file
52
app/entities/follow-rejects/page.mdx
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
export const metadata = {
|
||||||
|
title: 'FollowReject',
|
||||||
|
description: 'FollowReject lets users reject follow requests',
|
||||||
|
}
|
||||||
|
|
||||||
|
# FollowReject
|
||||||
|
|
||||||
|
<Note>
|
||||||
|
Refer to the [Follow](/entities/follow) entity for information on how follow relationships work.
|
||||||
|
</Note>
|
||||||
|
|
||||||
|
## Removing followers
|
||||||
|
|
||||||
|
`FollowReject` can also be used *after* a follow relationship has been established to remove a follower.
|
||||||
|
|
||||||
|
For example, if Bob requests to follow Alice, this entity is used when:
|
||||||
|
- Alice wants to reject Bob's follow request.
|
||||||
|
|
||||||
|
But it can also be used when Bob is already following Alice, in the case that:
|
||||||
|
- Alice wants to remove Bob as a follower.
|
||||||
|
|
||||||
|
## Entity Definition
|
||||||
|
|
||||||
|
<Row>
|
||||||
|
<Col>
|
||||||
|
<Properties>
|
||||||
|
<Property name="uri" type="null" required={false}>
|
||||||
|
This entity does not have a URI.
|
||||||
|
</Property>
|
||||||
|
<Property name="author" type="URI" required={true} typeLink="/types#uri">
|
||||||
|
URI of the `User` considered the 'followee', i.e. the user who is being followed.
|
||||||
|
</Property>
|
||||||
|
<Property name="follower" type="URI" required={true} typeLink="/types#uri">
|
||||||
|
URI of the `User` considered the 'follower', i.e. the user who is trying to follow the author.
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Col>
|
||||||
|
|
||||||
|
<Col sticky>
|
||||||
|
|
||||||
|
```jsonc {{ title: 'Example FollowReject' }}
|
||||||
|
{
|
||||||
|
"type": "FollowReject",
|
||||||
|
"id": "3e7e4750-afd4-4d99-a256-02f0710a0520",
|
||||||
|
"author": "https://example.com/users/6e0204a2-746c-4972-8602-c4f37fc63bbe",
|
||||||
|
"created_at": "2021-01-01T00:00:00.000Z",
|
||||||
|
"follower": "https://example.com/users/02e1e3b2-cb1f-4e4a-b82e-98866bee5de7"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
82
app/entities/follows/page.mdx
Normal file
82
app/entities/follows/page.mdx
Normal file
|
|
@ -0,0 +1,82 @@
|
||||||
|
export const metadata = {
|
||||||
|
title: 'Follow',
|
||||||
|
description: 'The Follow entity allows users to subscribe to each other',
|
||||||
|
}
|
||||||
|
|
||||||
|
# Follow
|
||||||
|
|
||||||
|
Sometimes, [Users](/entities/users) want to subscribe to each other to see each other's content. The `Follow` entity facilitates this, by definining a subscription relationship between two users. {{ className: 'lead' }}
|
||||||
|
|
||||||
|
## Vocabulary
|
||||||
|
|
||||||
|
- **Follower**: The user who is subscribing to another user. If `Joe` is following `Alice`, `Joe` is the follower.
|
||||||
|
- **Followee**: The user who is being subscribed to. If `Joe` is following `Alice`, `Alice` is the followee.
|
||||||
|
- **Subscribing**: Identical to **Following**. The act of subscribing to another user's content.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Consider the following example:
|
||||||
|
|
||||||
|
`Joe`, a user on `social.joe.org`, wants to follow `Alice`, a user on `alice.dev`.
|
||||||
|
|
||||||
|
### Sending a Follow Request
|
||||||
|
|
||||||
|
To establish a follow relationship, `social.joe.org` can do the following:
|
||||||
|
|
||||||
|
1. Create a `Follow` entity with `Joe` as the author and `Alice` as the followee.
|
||||||
|
2. Send the `Follow` entity to `Alice`'s inbox.
|
||||||
|
3. Mark the relationship as "processing" in its database until `Alice` accepts the follow request.
|
||||||
|
|
||||||
|
### Accepting the Follow Request
|
||||||
|
|
||||||
|
To accept the follow request, `Alice` can do the following:
|
||||||
|
|
||||||
|
1. Create a [FollowAccept](/entities/follow-accepts) entity with `Alice` as the author and `Joe` as the follower.
|
||||||
|
2. Send the `FollowAccept` entity to `Joe`'s inbox.
|
||||||
|
|
||||||
|
### Rejecting the Follow Request
|
||||||
|
|
||||||
|
To reject the follow request, `Alice` can do the following:
|
||||||
|
|
||||||
|
1. Create a [FollowReject](/entities/follow-rejects) entity with `Alice` as the author and `Joe` as the follower.
|
||||||
|
2. Send the `FollowReject` entity to `Joe`'s inbox.
|
||||||
|
|
||||||
|
### Final Steps
|
||||||
|
|
||||||
|
Depending on whether the follow request is accepted or rejected, `social.joe.org` can then update the relationship status accordingly in its database.
|
||||||
|
|
||||||
|
## Behaviour
|
||||||
|
|
||||||
|
Once a follow relationship is established, the **followee**'s instance should send all new notes from the **followee** to the **follower**'s inbox.
|
||||||
|
|
||||||
|
## Entity Definition
|
||||||
|
|
||||||
|
<Row>
|
||||||
|
<Col>
|
||||||
|
<Properties>
|
||||||
|
<Property name="uri" type="null" required={false}>
|
||||||
|
This entity does not have a URI.
|
||||||
|
</Property>
|
||||||
|
<Property name="author" type="URI" required={true} typeLink="/types#uri">
|
||||||
|
URI of the `User` considered the 'follower'.
|
||||||
|
</Property>
|
||||||
|
<Property name="followee" type="URI" required={true} typeLink="/types#uri">
|
||||||
|
URI of the `User` that is being followed.
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Col>
|
||||||
|
|
||||||
|
<Col sticky>
|
||||||
|
|
||||||
|
```jsonc {{ title: 'Example Follow' }}
|
||||||
|
{
|
||||||
|
"type": "Follow",
|
||||||
|
"id": "3e7e4750-afd4-4d99-a256-02f0710a0520",
|
||||||
|
"author": "https://example.com/users/6e0204a2-746c-4972-8602-c4f37fc63bbe",
|
||||||
|
"created_at": "2021-01-01T00:00:00.000Z",
|
||||||
|
"followee": "https://example.com/users/02e1e3b2-cb1f-4e4a-b82e-98866bee5de7"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
57
app/entities/unfollows/page.mdx
Normal file
57
app/entities/unfollows/page.mdx
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
export const metadata = {
|
||||||
|
title: 'Unfollow',
|
||||||
|
description: 'The Unfollow entity allows users to unsubscribe from each other',
|
||||||
|
}
|
||||||
|
|
||||||
|
# Unfollow
|
||||||
|
|
||||||
|
Sometimes, [Users](/entities/users) want to unsubscribe from each other to stop seeing each other's content. The `Unfollow` defines such a change. {{ className: 'lead' }}
|
||||||
|
|
||||||
|
<Note>
|
||||||
|
Refer to the [Follow](/entities/follow) entity for information on how follow relationships work.
|
||||||
|
</Note>
|
||||||
|
|
||||||
|
<Note>
|
||||||
|
This is **not** used to remove a follower from a followee.
|
||||||
|
|
||||||
|
For example, if Bob follows Alice, this entity is used when:
|
||||||
|
- Bob wants to stop following Alice.
|
||||||
|
|
||||||
|
**NOT** when:
|
||||||
|
|
||||||
|
- Alice wants to remove Bob as a follower.
|
||||||
|
|
||||||
|
For the latter, use [FollowReject](/entities/follow-rejects).
|
||||||
|
</Note>
|
||||||
|
|
||||||
|
## Entity Definition
|
||||||
|
|
||||||
|
<Row>
|
||||||
|
<Col>
|
||||||
|
<Properties>
|
||||||
|
<Property name="uri" type="null" required={false}>
|
||||||
|
This entity does not have a URI.
|
||||||
|
</Property>
|
||||||
|
<Property name="author" type="URI" required={true} typeLink="/types#uri">
|
||||||
|
URI of the `User` considered the 'follower', i.e. the user who is unsubscribing from the followee.
|
||||||
|
</Property>
|
||||||
|
<Property name="followee" type="URI" required={true} typeLink="/types#uri">
|
||||||
|
URI of the `User` considered the 'followee', i.e. the user who is being unsubscribed from.
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Col>
|
||||||
|
|
||||||
|
<Col sticky>
|
||||||
|
|
||||||
|
```jsonc {{ title: 'Example Unfollow' }}
|
||||||
|
{
|
||||||
|
"type": "Unfollow",
|
||||||
|
"id": "3e7e4750-afd4-4d99-a256-02f0710a0520",
|
||||||
|
"author": "https://example.com/users/6e0204a2-746c-4972-8602-c4f37fc63bbe",
|
||||||
|
"created_at": "2021-01-01T00:00:00.000Z",
|
||||||
|
"followee": "https://example.com/users/02e1e3b2-cb1f-4e4a-b82e-98866bee5de7"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
|
@ -273,6 +273,10 @@ export const navigation: NavGroup[] = [
|
||||||
links: [
|
links: [
|
||||||
{ title: "Users", href: "/entities/users" },
|
{ title: "Users", href: "/entities/users" },
|
||||||
{ title: "Notes", href: "/entities/notes" },
|
{ title: "Notes", href: "/entities/notes" },
|
||||||
|
{ title: "Follow", href: "/entities/follows" },
|
||||||
|
{ title: "FollowAccept", href: "/entities/follow-accepts" },
|
||||||
|
{ title: "FollowReject", href: "/entities/follow-rejects" },
|
||||||
|
{ title: "Unfollow", href: "/entities/unfollows" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue