From 07f8de757bad292fce3177f2145699de21e8e511 Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Tue, 6 Aug 2024 17:58:40 +0200 Subject: [PATCH] refactor: :recycle: Make User collections extensible --- app/entities/users/page.mdx | 48 +++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/app/entities/users/page.mdx b/app/entities/users/page.mdx index 4cd24f3..313ee50 100644 --- a/app/entities/users/page.mdx +++ b/app/entities/users/page.mdx @@ -93,23 +93,35 @@ Instance **must** be the host of the instance the user is on (hostname with opti Some instances may have a shared inbox, in which case that should be used instead. Refer to [Server Metadata](/entities/server-metadata) for more information. - + + Collections related to the user. Must contain at least `outbox`, `followers`, `following`, and `featured`. + + ```typescript + type URI = string; + + type UserCollections = { + outbox: URI; + followers: URI; + following: URI; + featured: URI; + // Same format as extension_type on Extensions + [key: ExtensionsKey]: URI; + } + ``` + + All URIs must resolve to a [Collection](/structures/collection) of the appropriate entities. Extensions may add additional collections. + + ### Outbox The user's federation outbox. Refer to the [federation documentation](/federation). - - - User's followers. URI must resolve to a [Collection](/structures/collection) of [User](/entities/users) entities. - - - Users that the user follows. URI must resolve to a [Collection](/structures/collection) of [User](/entities/users) entities. - - - User's likes. URI must resolve to a [Collection](/structures/collection) of [Like](/entities/likes) entities. - - - User's dislikes. URI must resolve to a [Collection](/structures/collection) of [Dislike](/entities/dislikes) entities. - - - [Notes](/entities/notes) that the user wants to feature (also known as "pin") on their profile. URI must resolve to a [Collection](/structures/collection) of [Note](/entities/notes) entities. + + ### Followers + User's followers. [Collection](/structures/collection) of [User](/entities/users) entities. + + ### Following + Users that the user follows. [Collection](/structures/collection) of [User](/entities/users) entities. + + ### Featured + [Notes](/entities/notes) that the user wants to feature (also known as "pin") on their profile. [Collection](/structures/collection) of [Note](/entities/notes) entities. @@ -136,11 +148,11 @@ Instance **must** be the host of the instance the user is on (hostname with opti } }, "collections": { - "dislikes": "https://social.lysand.org/users/018ec082-0ae1-761c-b2c5-22275a611771/dislikes", "featured": "https://social.lysand.org/users/018ec082-0ae1-761c-b2c5-22275a611771/featured", "followers": "https://social.lysand.org/users/018ec082-0ae1-761c-b2c5-22275a611771/followers", "following": "https://social.lysand.org/users/018ec082-0ae1-761c-b2c5-22275a611771/following", - "likes": "https://social.lysand.org/users/018ec082-0ae1-761c-b2c5-22275a611771/likes", + "org.lysand:likes/Dislikes": "https://social.lysand.org/users/018ec082-0ae1-761c-b2c5-22275a611771/dislikes", + "org.lysand:likes/Likes": "https://social.lysand.org/users/018ec082-0ae1-761c-b2c5-22275a611771/likes", "outbox": "https://social.lysand.org/users/018ec082-0ae1-761c-b2c5-22275a611771/outbox", }, "display_name": "April The Pink (limited Sand Edition)",