mirror of
https://github.com/versia-pub/docs.git
synced 2025-12-06 14:28:20 +01:00
feat: 📝 Document Delete entity
This commit is contained in:
parent
6db5aee6cd
commit
4b773e114a
|
|
@ -28,4 +28,5 @@ This page lists changes since Working Draft 03. {{ className: 'lead' }}
|
||||||
- Made `subject` optional in [Notes](/entities/notes).
|
- Made `subject` optional in [Notes](/entities/notes).
|
||||||
- Clarified the way [Follows](/entities/follows) work.
|
- Clarified the way [Follows](/entities/follows) work.
|
||||||
- Removed the use of `Undo` entities for anything except than deleting entities.
|
- Removed the use of `Undo` entities for anything except than deleting entities.
|
||||||
|
- Renamed `Undo` to [Delete](/entities/deletes).
|
||||||
- Added [Unfollow](/entities/unfollows) entity.
|
- Added [Unfollow](/entities/unfollows) entity.
|
||||||
48
app/entities/deletes/page.mdx
Normal file
48
app/entities/deletes/page.mdx
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
export const metadata = {
|
||||||
|
title: 'Delete',
|
||||||
|
description: 'Deletes are used to remove entities from the system',
|
||||||
|
}
|
||||||
|
|
||||||
|
# Delete
|
||||||
|
|
||||||
|
Signals the deletion of an entity. {{ className: 'lead' }}
|
||||||
|
|
||||||
|
## Authorization
|
||||||
|
|
||||||
|
Implementations **must** ensure that the author of the `Delete` entity has the authorization to delete the target entity.
|
||||||
|
|
||||||
|
Having the authorization is defined as:
|
||||||
|
- The author is the creator of the target entity (including [delegation](/delegation)).
|
||||||
|
- The author is the server actor.
|
||||||
|
|
||||||
|
## 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` who is deleting the entity.
|
||||||
|
</Property>
|
||||||
|
<Property name="target" type="URI" required={true} typeLink="/types#uri">
|
||||||
|
URI of the entity being deleted.
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Col>
|
||||||
|
|
||||||
|
<Col sticky>
|
||||||
|
|
||||||
|
```jsonc {{ title: 'Example Delete' }}
|
||||||
|
{
|
||||||
|
"type": "Delete",
|
||||||
|
"id": "9b3212b8-529c-435a-8798-09ebbc17ca74",
|
||||||
|
"created_at": "2021-01-01T00:00:00.000Z",
|
||||||
|
"author": "https://example.com/users/6e0204a2-746c-4972-8602-c4f37fc63bbe",
|
||||||
|
"deleted": "https://example.com/notes/02e1e3b2-cb1f-4e4a-b82e-98866bee5de7"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
|
@ -48,11 +48,10 @@ Any field in an entity not marked as `required` may be omitted or set to `null`.
|
||||||
```jsonc {{ 'title': 'Example Entity' }}
|
```jsonc {{ 'title': 'Example Entity' }}
|
||||||
{
|
{
|
||||||
"id": "9a8928b6-2526-4979-aab1-ef2f88cd5700",
|
"id": "9a8928b6-2526-4979-aab1-ef2f88cd5700",
|
||||||
"type": "Undo",
|
"type": "Delete",
|
||||||
"created_at": "2022-01-01T12:00:00Z",
|
"created_at": "2022-01-01T12:00:00Z",
|
||||||
"uri": "https://bongo.social/objects/9a8928b6-2526-4979-aab1-ef2f88cd5700",
|
|
||||||
"author": "https://bongo.social/users/63a00ab3-39b1-49eb-b88e-ed65d2361f3e",
|
"author": "https://bongo.social/users/63a00ab3-39b1-49eb-b88e-ed65d2361f3e",
|
||||||
"object": "https://bongo.social/notes/54059ce2-9332-46fa-bf6a-598b5493b81b",
|
"deleted": "https://bongo.social/notes/54059ce2-9332-46fa-bf6a-598b5493b81b",
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ Dislikes are a way for users to show disapproval for a note, like YouTube's "dis
|
||||||
|
|
||||||
## Undoing Likes and Dislikes
|
## Undoing Likes and Dislikes
|
||||||
|
|
||||||
To undo a like or dislike, an [Undo](/entities/undo) entity should be used. The `object` property of the Undo entity should link to the Like or Dislike entity to be removed.
|
To undo a like or dislike, a [Delete](/entities/deletes) entity should be used. The `deleted` property of the Delete entity should link to the Like or Dislike entity to be removed.
|
||||||
|
|
||||||
## User Collections
|
## User Collections
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ Messages sent over the WebSocket connection are JSON objects.
|
||||||
"signature": "post /users/1/inbox a2ebc29eb6762a9164fbcffc9271e8a53562a5e725e7187ea7d88d03cbe59341 n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg=",
|
"signature": "post /users/1/inbox a2ebc29eb6762a9164fbcffc9271e8a53562a5e725e7187ea7d88d03cbe59341 n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg=",
|
||||||
"nonce": "a2ebc29eb6762a9164fbcffc9271e8a53562a5e725e7187ea7d88d03cbe59341",
|
"nonce": "a2ebc29eb6762a9164fbcffc9271e8a53562a5e725e7187ea7d88d03cbe59341",
|
||||||
"signed_by": "https://bongo.social/users/63a00ab3-39b1-49eb-b88e-ed65d2361f3e",
|
"signed_by": "https://bongo.social/users/63a00ab3-39b1-49eb-b88e-ed65d2361f3e",
|
||||||
"entity": "{\"id\":\"9a8928b6-2526-4979-aab1-ef2f88cd5700\",\"type\":\"Undo\",\"created_at\":\"2022-01-01T12:00:00Z\",\"uri\":\"https://bongo.social/objects/9a8928b6-2526-4979-aab1-ef2f88cd5700\",\"author\":\"https://bongo.social/users/63a00ab3-39b1-49eb-b88e-ed65d2361f3e\",\"object\":\"https://bongo.social/notes/54059ce2-9332-46fa-bf6a-598b5493b81b\"}"
|
"entity": "{\"id\":\"9a8928b6-2526-4979-aab1-ef2f88cd5700\",\"type\":\"Delete\",\"created_at\":\"2022-01-01T12:00:00Z\",\"author\":\"https://bongo.social/users/63a00ab3-39b1-49eb-b88e-ed65d2361f3e\",\"deleted\":\"https://bongo.social/notes/54059ce2-9332-46fa-bf6a-598b5493b81b\"}"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -271,12 +271,13 @@ export const navigation: NavGroup[] = [
|
||||||
{
|
{
|
||||||
title: "Entities",
|
title: "Entities",
|
||||||
links: [
|
links: [
|
||||||
{ title: "Users", href: "/entities/users" },
|
{ title: "Delete", href: "/entities/deletes" },
|
||||||
{ title: "Notes", href: "/entities/notes" },
|
|
||||||
{ title: "Follow", href: "/entities/follows" },
|
{ title: "Follow", href: "/entities/follows" },
|
||||||
{ title: "FollowAccept", href: "/entities/follow-accepts" },
|
{ title: "FollowAccept", href: "/entities/follow-accepts" },
|
||||||
{ title: "FollowReject", href: "/entities/follow-rejects" },
|
{ title: "FollowReject", href: "/entities/follow-rejects" },
|
||||||
|
{ title: "Notes", href: "/entities/notes" },
|
||||||
{ title: "Unfollow", href: "/entities/unfollows" },
|
{ title: "Unfollow", href: "/entities/unfollows" },
|
||||||
|
{ title: "Users", href: "/entities/users" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue