diff --git a/app/changelog/page.mdx b/app/changelog/page.mdx index ac3d8b2..d61857c 100644 --- a/app/changelog/page.mdx +++ b/app/changelog/page.mdx @@ -28,4 +28,5 @@ This page lists changes since Working Draft 03. {{ className: 'lead' }} - Made `subject` optional in [Notes](/entities/notes). - Clarified the way [Follows](/entities/follows) work. - Removed the use of `Undo` entities for anything except than deleting entities. +- Renamed `Undo` to [Delete](/entities/deletes). - Added [Unfollow](/entities/unfollows) entity. \ No newline at end of file diff --git a/app/entities/deletes/page.mdx b/app/entities/deletes/page.mdx new file mode 100644 index 0000000..a40dc5f --- /dev/null +++ b/app/entities/deletes/page.mdx @@ -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 + + + + + + This entity does not have a URI. + + + URI of the `User` who is deleting the entity. + + + URI of the entity being deleted. + + + + + + + ```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" + } + ``` + + + \ No newline at end of file diff --git a/app/entities/page.mdx b/app/entities/page.mdx index 65ac1c1..4a1f4b0 100644 --- a/app/entities/page.mdx +++ b/app/entities/page.mdx @@ -48,11 +48,10 @@ Any field in an entity not marked as `required` may be omitted or set to `null`. ```jsonc {{ 'title': 'Example Entity' }} { "id": "9a8928b6-2526-4979-aab1-ef2f88cd5700", - "type": "Undo", + "type": "Delete", "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", + "deleted": "https://bongo.social/notes/54059ce2-9332-46fa-bf6a-598b5493b81b", } ``` diff --git a/app/extensions/likes/page.mdx b/app/extensions/likes/page.mdx index 1245894..277dc0e 100644 --- a/app/extensions/likes/page.mdx +++ b/app/extensions/likes/page.mdx @@ -88,7 +88,7 @@ Dislikes are a way for users to show disapproval for a note, like YouTube's "dis ## 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 diff --git a/app/extensions/websockets/page.mdx b/app/extensions/websockets/page.mdx index 618fc28..0897207 100644 --- a/app/extensions/websockets/page.mdx +++ b/app/extensions/websockets/page.mdx @@ -45,7 +45,7 @@ Messages sent over the WebSocket connection are JSON objects. "signature": "post /users/1/inbox a2ebc29eb6762a9164fbcffc9271e8a53562a5e725e7187ea7d88d03cbe59341 n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg=", "nonce": "a2ebc29eb6762a9164fbcffc9271e8a53562a5e725e7187ea7d88d03cbe59341", "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\"}" } ``` diff --git a/components/Navigation.tsx b/components/Navigation.tsx index b2241a7..4bd2713 100644 --- a/components/Navigation.tsx +++ b/components/Navigation.tsx @@ -271,12 +271,13 @@ export const navigation: NavGroup[] = [ { title: "Entities", links: [ - { title: "Users", href: "/entities/users" }, - { title: "Notes", href: "/entities/notes" }, + { title: "Delete", href: "/entities/deletes" }, { title: "Follow", href: "/entities/follows" }, { title: "FollowAccept", href: "/entities/follow-accepts" }, { title: "FollowReject", href: "/entities/follow-rejects" }, + { title: "Notes", href: "/entities/notes" }, { title: "Unfollow", href: "/entities/unfollows" }, + { title: "Users", href: "/entities/users" }, ], }, {