diff --git a/static/scripts/asyncapi.yaml b/static/scripts/asyncapi.yaml index 3d30f76..e72e939 100644 --- a/static/scripts/asyncapi.yaml +++ b/static/scripts/asyncapi.yaml @@ -66,7 +66,7 @@ channels: $ref: '#/components/messages/loginRequest' subscribe: summary: Login (response) - description: 'You will receive an authentication string (`jwt`)' + description: Returns an authentication string (`jwt`) for the supplied username or emal operationId: loginResponseMessage tags: - name: User, authentication and admin @@ -125,7 +125,7 @@ channels: summary: GetUserDetails (request) description: |- - Use the `username` field to return details about a local user - - Use the `user-id` field to return details about a federated user. + - Use the `user_id` field to return details about a federated user. #### HTTP API - operation and endpoint. @@ -601,7 +601,16 @@ channels: - name: Site message: $ref: '#/components/messages/createSiteRequest' - # COMMENT. Not sure how to set up virgin server to test CreateSite, hence no 'subscribe' option documented + subscribe: + summary: CreateSite (response) + description: Returns site details + operationId: createSiteResponseMessage + tags: + - name: Site + message: + oneOf: + - $ref: '#/components/messages/createSiteResponse' + - $ref: '#/components/messages/errorResponse' EditSite: publish: summary: EditSite (Request) @@ -724,7 +733,6 @@ channels: oneOf: - $ref: '#/components/messages/saveSiteConfigResponse' - $ref: '#/components/messages/errorResponse' - # SaveSiteConfig response not verified. Did not get response from server GetCommunity: publish: summary: GetCommunity (request) @@ -811,7 +819,16 @@ channels: - name: Community message: $ref: '#/components/messages/banFromCommunityRequest' - # COMMENT Issues with Docker, hence subscribe not documented + subscribe: + summary: BanFromCommunity (response) + description: Confirmation after a ban request + operationId: banFromCommunityResponseMessage + tags: + - name: Community + message: + oneOf: + - $ref: '#/components/messages/banFromCommunityResponse' + - $ref: '#/components/messages/errorResponse' AddModToCommunity: publish: summary: AddModToCommunity (request) @@ -828,7 +845,141 @@ channels: - name: Community message: $ref: '#/components/messages/addModToCommunityRequest' - # COMMENT Issues with Docker, hence subscribe not documented + subscribe: + summary: AddModToCommunity (response) + description: Confirmation that the new moderator has been added + operationId: addModToCommunityResponseMessage + tags: + - name: Community + message: + oneOf: + - $ref: '#/components/messages/addModToCommunityResponse' + - $ref: '#/components/messages/errorResponse' + EditCommunity: + publish: + description: |- + Request to edit a community. + + The account making the request (`auth`) must be either an admin or a moderator of that community. + + #### HTTP API - operation and endpoint. + + `PUT /community` + operationId: editCommunityRequestMessage + tags: + - name: Community + message: + $ref: '#/components/messages/editCommunityRequest' + subscribe: + summary: EditCommunity (response) + description: Return the details for the requested community + operationId: editCommunityResponseMessage + tags: + - name: Community + message: + oneOf: + - $ref: '#/components/messages/editCommunityResponse' + - $ref: '#/components/messages/errorResponse' + DeleteCommunity: + publish: + summary: DeleteCommunity (request) + description: |- + Request to delete a community. + + The account making the request (`auth`) must be the creator of that community. + + #### HTTP API - operation and endpoint. + + `POST /community/delete` + operationId: deleteCommunityRequestMessage + tags: + - name: Community + message: + $ref: '#/components/messages/deleteCommunityRequest' + subscribe: + summary: DeleteCommunity (response) + description: Return the details for the deleted community + operationId: deleteCommunityResponseMessage + tags: + - name: Community + message: + oneOf: + - $ref: '#/components/messages/deleteCommunityResponse' + - $ref: '#/components/messages/errorResponse' + RemoveCommunity: + publish: + summary: RemoveCommunity (request) + description: |- + Request to *permanently* delete a community. + + The account making the request (`auth`) must be and admin. + + #### HTTP API - operation and endpoint. + + `POST /community/remove` + operationId: removeCommunityRequestMessage + tags: + - name: Community + message: + $ref: '#/components/messages/removeCommunityRequest' + subscribe: + summary: RemoveCommunity (response) + description: Return the details for the deleted community + operationId: removeCommunityResponseMessage + tags: + - name: Community + message: + oneOf: + - $ref: '#/components/messages/removeCommunityResponse' + - $ref: '#/components/messages/errorResponse' + FollowCommunity: + publish: + summary: FollowCommunity (request) + description: |- + Request to follow (join) a community. + + #### HTTP API - operation and endpoint. + + `POST /community/follow` + operationId: followCommunityRequestMessage + tags: + - name: Community + message: + $ref: '#/components/messages/followCommunityRequest' + subscribe: + summary: FollowCommunity (response) + description: Return the details for the followed community + operationId: followCommunityResponseMessage + tags: + - name: Community + message: + oneOf: + - $ref: '#/components/messages/followCommunityResponse' + - $ref: '#/components/messages/errorResponse' + GetFollowedCommunities: + publish: + summary: GetFollowedCommunities (request) + description: |- + Request to list all followed (joined) communities. + + #### HTTP API - operation and endpoint. + + `GET /user/followed_communities` + operationId: getFollowedCommunitiesRequestMessage + tags: + - name: Community + message: + $ref: '#/components/messages/getFollowedCommunitiesRequest' + subscribe: + summary: GetFollowedCommunities (response) + description: Return the details for the followed communities + operationId: getFollowedCommunitiesResponseMessage + tags: + - name: Community + message: + oneOf: + - $ref: '#/components/messages/getFollowedCommunitiesResponse' + - $ref: '#/components/messages/errorResponse' TransferCommunity: publish: summary: TransferCommunity (Request) @@ -845,7 +996,16 @@ channels: - name: Community message: $ref: '#/components/messages/transferCommunityRequest' - # COMMENT Issues with Docker, hence subscribe not documented + subscribe: + summary: TransferCommunity (response) + description: Response to a request to transfer community ownership + operationId: transferCommunityResponseMessage + tags: + - name: Community + message: + oneOf: + - $ref: '#/components/messages/transferCommunityResponse' + - $ref: '#/components/messages/errorResponse' CommunityJoin: publish: summary: CommunityJoin (request) @@ -995,6 +1155,30 @@ channels: oneOf: - $ref: '#/components/messages/createPostLikeResponse' - $ref: '#/components/messages/errorResponse' + EditPost: + publish: + summary: EditPost (request) + description: |- + Request to edit an existing post + + #### HTTP API - operation and endpoint. + + `PUT /post` + operationId: editPostRequestMessage + tags: + - name: Post + message: + $ref: '#/components/messages/editPostRequest' + subscribe: + summary: EditPost (response) + description: Response to request to edit a post + operationId: editPostResponseMessage + tags: + - name: Post + message: + oneOf: + - $ref: '#/components/messages/editPostResponse' + - $ref: '#/components/messages/errorResponse' DeletePost: publish: summary: DeletePost (request) @@ -1071,7 +1255,6 @@ channels: oneOf: - $ref: '#/components/messages/postLockResponse' - $ref: '#/components/messages/errorResponse' - # COMMENT. Request would not work ('variant not found') with post id set to either edit_id (as in the docs) or to post_id (as in StickyPost) StickyPost: publish: summary: StickyPost (request) @@ -1511,6 +1694,9 @@ components: name: Login request payload: type: object + required: + - op + - data properties: op: type: string @@ -1518,13 +1704,16 @@ components: default: 'Login' data: type: object + required: + - username_or_email + - password properties: username_or_email: type: string - description: '**(Required)** Username or registered email' + description: 'Username or registered email' example: 'lemmy' password: - $ref: '#/components/schemas/passwordRequired' + $ref: '#/components/schemas/password' loginResponse: name: Login response payload: @@ -1540,6 +1729,9 @@ components: name: User replies request payload: type: object + required: + - op + - data properties: op: type: string @@ -1551,6 +1743,9 @@ components: name: User mentions request payload: type: object + required: + - op + - data properties: op: type: string @@ -1562,6 +1757,9 @@ components: name: Captcha request payload: type: object + required: + - op + - data properties: op: type: string @@ -1599,6 +1797,9 @@ components: name: Register a user on the Lemmy server payload: type: object + required: + - op + - data properties: op: type: string @@ -1606,15 +1807,26 @@ components: default: 'Register' data: type: object + required: + - username + - password + - admin + - password_verify + - show_nsfw properties: username: type: string - description: '**(Required)** The username for the new user' + description: 'The name for the new user' example: 'testuser' + email: + description: |- + The user's email address + type: string + format: email password: - $ref: '#/components/schemas/passwordRequired' + $ref: '#/components/schemas/password' password_verify: - $ref: '#/components/schemas/passwordRequired' + $ref: '#/components/schemas/password' admin: type: boolean description: 'Set to *true* if this is to be the admin user. Only the user who was *first* registered on the Lemmy server is allowed to be admin.' @@ -1645,6 +1857,9 @@ components: name: Save user settings - response payload: type: object + required: + - op + - data properties: op: type: string @@ -1652,6 +1867,8 @@ components: default: 'SaveUserSettings' data: type: object + required: + - show_nsfw properties: show_nsfw: $ref: '#/components/schemas/show_nsfw' @@ -1676,11 +1893,11 @@ components: matrix_user_id: $ref: '#/components/schemas/matrix_user_id' new_password: - $ref: '#/components/schemas/passwordOptional' + $ref: '#/components/schemas/password' new_password_verify: - $ref: '#/components/schemas/passwordOptional' + $ref: '#/components/schemas/password' old_password: - $ref: '#/components/schemas/passwordOptional' + $ref: '#/components/schemas/password' show_avatars: $ref: '#/components/schemas/show_avatars' send_notifications_to_email: @@ -1691,6 +1908,9 @@ components: name: Return requested user details payload: type: object + required: + - op + - data properties: op: type: string @@ -1698,7 +1918,14 @@ components: default: 'GetUserDetails' data: type: object + required: + - sort + - saved_only properties: + user_id: + $ref: '#/components/schemas/user_id' + username: + $ref: '#/components/schemas/user_name' sort: $ref: '#/components/schemas/sort' page: @@ -1719,14 +1946,17 @@ components: payload: type: object properties: - jwt: - $ref: '#/components/schemas/authStringSchema' op: type: string pattern: '^SaveUserSettings$' default: 'SaveUserSettings' + data: + type: object + properties: + jwt: + $ref: '#/components/schemas/authStringSchema' getUserDetailsResponse: - name: Registration request response + name: User details request response payload: type: object properties: @@ -1790,6 +2020,9 @@ components: name: Request to make a user mention as read payload: type: object + required: + - op + - data properties: op: type: string @@ -1813,19 +2046,22 @@ components: payload: type: object properties: + op: + type: string + pattern: '^MarkUserMentionAsRead$' + default: 'MarkUserMentionAsRead' data: type: object properties: mention: $ref: '#/components/schemas/mentions' - op: - type: string - pattern: '^MarkUserMentionAsRead$' - default: 'MarkUserMentionAsRead' privateMessageRequest: name: Request to list all a user's private messages payload: type: object + required: + - op + - data properties: op: type: string @@ -1833,6 +2069,9 @@ components: default: 'GetPrivateMessages' data: type: object + required: + - unread_only + - auth properties: unread_only: $ref: '#/components/schemas/unread_only' @@ -1863,6 +2102,9 @@ components: Request to create a private message payload: type: object + required: + - op + - data properties: op: type: string @@ -1870,6 +2112,10 @@ components: default: 'CreatePrivateMessage' data: type: object + required: + - content + - recipient_id + - auth properties: content: $ref: '#/components/schemas/content' @@ -1896,6 +2142,9 @@ components: name: Request to edit a private message payload: type: object + required: + - op + - data properties: op: type: string @@ -1903,6 +2152,10 @@ components: default: 'EditPrivateMessage' data: type: object + required: + - private_message_id + - content + - auth properties: private_message_id: $ref: '#/components/schemas/private_message_id' @@ -1928,6 +2181,9 @@ components: name: Request to delete a private message payload: type: object + required: + - op + - data properties: op: type: string @@ -1935,6 +2191,10 @@ components: default: 'DeletePrivateMessage' data: type: object + required: + - private_message_id + - deleted + - auth properties: private_message_id: $ref: '#/components/schemas/private_message_id' @@ -1960,6 +2220,9 @@ components: name: Request to mark a private message as read payload: type: object + required: + - op + - data properties: op: type: string @@ -1967,6 +2230,10 @@ components: default: 'MarkPrivateMessageAsRead' data: type: object + required: + - private_message_id + - read + - auth properties: private_message_id: $ref: '#/components/schemas/private_message_id' @@ -1992,6 +2259,9 @@ components: name: Request to mark all user replies and mentions as read payload: type: object + required: + - op + - data properties: op: type: string @@ -1999,6 +2269,8 @@ components: default: 'MarkAllAsRead' data: type: object + required: + - auth properties: auth: $ref: '#/components/schemas/authStringSchema' @@ -2020,6 +2292,9 @@ components: name: Request to delete a user account payload: type: object + required: + - op + - data properties: op: type: string @@ -2027,9 +2302,12 @@ components: default: 'DeleteAccount' data: type: object + required: + - password + - auth properties: password: - $ref: '#/components/schemas/passwordRequired' + $ref: '#/components/schemas/password' auth: $ref: '#/components/schemas/authStringSchema' deleteAccountResponse: @@ -2050,6 +2328,9 @@ components: name: Request to grant admin privileges to a user payload: type: object + required: + - op + - data properties: op: type: string @@ -2057,6 +2338,10 @@ components: default: 'AddAdmin' data: type: object + required: + - user_id + - added + - auth properties: user_id: $ref: '#/components/schemas/user_id' @@ -2082,6 +2367,9 @@ components: name: Request to ban a user payload: type: object + required: + - op + - data properties: op: type: string @@ -2089,6 +2377,10 @@ components: default: 'BanUser' data: type: object + required: + - user_id + - ban + - auth properties: user_id: $ref: '#/components/schemas/user_id' @@ -2117,6 +2409,9 @@ components: name: Forthcoming... payload: type: object + required: + - op + - data properties: op: type: string @@ -2124,6 +2419,8 @@ components: default: 'UserJoin' data: type: object + required: + - auth properties: auth: $ref: '#/components/schemas/authStringSchema' @@ -2145,6 +2442,9 @@ components: name: Request to return report count numbers payload: type: object + required: + - op + - data properties: op: type: string @@ -2152,6 +2452,8 @@ components: default: 'GetReportCount' data: type: object + required: + - auth properties: community: $ref: '#/components/schemas/community_id' @@ -2162,6 +2464,10 @@ components: payload: type: object properties: + op: + type: string + pattern: '^GetReportCount$' + default: 'GetReportCount' data: type: object properties: @@ -2177,14 +2483,12 @@ components: type: integer format: int64 example: 23 - op: - type: string - pattern: '^GetReportCount$' - default: 'GetReportCount' getCategoriesRequest: name: Request to list categories on the Lemmy server payload: type: object + required: + - op properties: op: type: string @@ -2216,6 +2520,9 @@ components: name: Request to find information on the Lemmy server payload: type: object + required: + - op + - data properties: op: type: string @@ -2223,6 +2530,10 @@ components: default: 'Search' data: type: object + required: + - q + - type_ + - sort properties: q: description: The text to search for on the Lemmy server @@ -2276,6 +2587,9 @@ components: name: Request the site's Modlog payload: type: object + required: + - op + - data properties: op: type: string @@ -2296,6 +2610,9 @@ components: name: Modlog request results payload: type: object + required: + - op + - data properties: op: type: string @@ -2382,6 +2699,9 @@ components: name: Create Lemmy site on a server payload: type: object + required: + - op + - data properties: op: type: string @@ -2389,10 +2709,27 @@ components: default: 'CreateSite' data: $ref: '#/components/schemas/site_properties' + createSiteResponse: + name: Returns Lemmy site details + payload: + type: object + properties: + op: + type: string + pattern: '^CreateSite$' + default: 'CreateSite' + data: + type: object + properties: + site_view: + $ref: '#/components/schemas/site_view' editSiteRequest: name: Request to edit Lemmy site details payload: type: object + required: + - op + - data properties: op: type: string @@ -2418,6 +2755,9 @@ components: name: Request to return Lemmy site details payload: type: object + required: + - op + - data properties: op: type: string @@ -2425,6 +2765,8 @@ components: default: 'GetSite' data: type: object + required: + - auth properties: auth: $ref: '#/components/schemas/authStringSchema' @@ -2433,16 +2775,15 @@ components: payload: type: object properties: + op: + type: string + pattern: '^GetSite$' + default: 'GetSite' data: type: object properties: site_view: - counts: - $ref: '#/components/schemas/site_counts' - site: - $ref: '#/components/schemas/site' - creator: - $ref: '#/components/schemas/creator' + $ref: '#/components/schemas/site_view' federated_instances: $ref: '#/components/schemas/federated_instances' my_user: @@ -2465,9 +2806,7 @@ components: type: number example: 8 user_id: - description: Forthcoming... - type: number - example: 2 + $ref: '#/components/schemas/user_id' post_score: description: Forthcoming... type: number @@ -2486,14 +2825,13 @@ components: example: 9 user: $ref: '#/components/schemas/creator' - op: - type: string - pattern: '^GetSite$' - default: 'GetSite' transferSiteRequest: name: Request to transfer ownership of the site payload: type: object + required: + - op + - data properties: op: type: string @@ -2501,6 +2839,9 @@ components: default: 'TransferSite' data: type: object + required: + - user_id + - auth properties: user_id: $ref: '#/components/schemas/user_id' @@ -2510,6 +2851,9 @@ components: name: Request to transfer ownership of the site payload: type: object + required: + - op + - data properties: op: type: string @@ -2543,6 +2887,9 @@ components: name: Request the configuration data for a Lemmy server payload: type: object + required: + - op + - data properties: op: type: string @@ -2550,6 +2897,8 @@ components: default: 'GetSiteConfig' data: type: object + required: + - auth properties: auth: $ref: '#/components/schemas/authStringSchema' @@ -2571,6 +2920,9 @@ components: name: Request to send a configuration data file for a Lemmy server payload: type: object + required: + - op + - data properties: op: type: string @@ -2578,6 +2930,9 @@ components: default: 'SaveSiteConfig' data: type: object + required: + - config_hjson + - auth properties: config_hjson: $ref: '#/components/schemas/config_hjson' @@ -2601,6 +2956,9 @@ components: name: Request to get details of a commmunity payload: type: object + required: + - op + - data properties: op: type: string @@ -2637,6 +2995,9 @@ components: name: Request to get details of a commmunity payload: type: object + required: + - op + - data properties: op: type: string @@ -2644,15 +3005,19 @@ components: default: 'CreateCommunity' data: type: object + required: + - name + - title + - category_id + - nsfw + - auth properties: name: $ref: '#/components/schemas/community_name' title: - description: Forthcoming... - type: string + $ref: '#/components/schemas/title' description: - description: Forthcoming... - type: string + $ref: '#/components/schemas/description' icon: $ref: '#/components/schemas/icon' banner: @@ -2667,6 +3032,9 @@ components: name: Response to the request to create a community payload: type: object + required: + - op + - data properties: op: type: string @@ -2678,9 +3046,12 @@ components: community_view: $ref: '#/components/schemas/community_view' listCommunityRequest: - name: Request to get list of commmunities on the Lemmy server + name: Request list of communities on the Lemmy server payload: type: object + required: + - op + - data properties: op: type: string @@ -2688,6 +3059,9 @@ components: default: 'ListCommunities' data: type: object + required: + - type_ + - sort properties: type_: $ref: '#/components/schemas/type_' @@ -2700,7 +3074,7 @@ components: auth: $ref: '#/components/schemas/authStringSchema' listCommunityResponse: - name: Response to the request to create a community + name: Response to the request to list all communities payload: type: object properties: @@ -2718,6 +3092,9 @@ components: name: Request to ban a user from a specified community. payload: type: object + required: + - op + - data properties: op: type: string @@ -2725,6 +3102,11 @@ components: default: 'BanFromCommunity' data: type: object + required: + - community_id + - user_id + - ban + - auth properties: community_id: $ref: '#/components/schemas/community_id' @@ -2755,6 +3137,9 @@ components: name: Request to add a moderator to a community payload: type: object + required: + - op + - data properties: op: type: string @@ -2762,6 +3147,11 @@ components: default: 'AddModToCommunity' data: type: object + required: + - community_id + - user_id + - added + - auth properties: community_id: $ref: '#/components/schemas/community_id' @@ -2771,8 +3161,260 @@ components: $ref: '#/components/schemas/added' auth: $ref: '#/components/schemas/authStringSchema' + addModToCommunityResponse: + name: Confirmation that a moderator has been added to the community + payload: + type: object + properties: + op: + type: string + pattern: '^AddModToCommunity$' + default: 'AddModToCommunity' + data: + type: object + properties: + moderators: + $ref: '#/components/schemas/moderators' + editCommunityRequest: + name: Request to edit a community + payload: + type: object + required: + - op + - data + properties: + op: + type: string + pattern: '^EditCommunity$' + default: 'EditCommunity' + data: + type: object + required: + - community_id + - title + - category_id + - nsfw + - auth + properties: + community_id: + $ref: '#/components/schemas/community_id' + title: + $ref: '#/components/schemas/title' + description: + $ref: '#/components/schemas/description' + icon: + $ref: '#/components/schemas/icon' + banner: + $ref: '#/components/schemas/banner' + category_id: + $ref: '#/components/schemas/category_id' + nsfw: + $ref: '#/components/schemas/nsfw' + auth: + $ref: '#/components/schemas/authStringSchema' + editCommunityResponse: + name: Response to the request to edit a community + payload: + type: object + properties: + op: + type: string + pattern: '^EditCommunity$' + default: 'EditCommunity' + data: + type: object + properties: + community_view: + $ref: '#/components/schemas/community_view' + deleteCommunityRequest: + name: Request to delete a community + payload: + type: object + required: + - op + - data + properties: + op: + type: string + pattern: '^DeleteCommunity$' + default: 'DeleteCommunity' + data: + type: object + required: + - community_id + - deleted + - auth + properties: + community_id: + $ref: '#/components/schemas/community_id' + deleted: + $ref: '#/components/schemas/deleted' + auth: + $ref: '#/components/schemas/authStringSchema' + deleteCommunityResponse: + name: Response to the request to delete a community + payload: + type: object + properties: + op: + type: string + pattern: '^DeleteCommunity$' + default: 'DeleteCommunity' + data: + type: object + properties: + community_view: + $ref: '#/components/schemas/community_view' + removeCommunityRequest: + name: Request to permanently delete a community + payload: + type: object + required: + - op + - data + properties: + op: + type: string + pattern: '^RemoveCommunity$' + default: 'RemoveCommunity' + data: + type: object + required: + - community_id + - removed + - auth + properties: + community_id: + $ref: '#/components/schemas/community_id' + removed: + $ref: '#/components/schemas/removed' + reason: + $ref: '#/components/schemas/reason' + expires: + $ref: '#/components/schemas/expires' + auth: + $ref: '#/components/schemas/authStringSchema' + removeCommunityResponse: + name: Response to the request to permanently delete a community + payload: + type: object + properties: + op: + type: string + pattern: '^RemoveCommunity$' + default: 'RemoveCommunity' + data: + type: object + properties: + community_view: + $ref: '#/components/schemas/community_view' + followCommunityRequest: + name: Request to follow a community + payload: + type: object + required: + - op + - data + properties: + op: + type: string + pattern: '^FollowCommunity$' + default: 'FollowCommunity' + data: + type: object + required: + - community_id + - follow + - auth + properties: + community_id: + $ref: '#/components/schemas/community_id' + follow: + description: Forthcoming... + type: boolean + example: true + auth: + $ref: '#/components/schemas/authStringSchema' + followCommunityResponse: + name: Response to the request to follow a community + payload: + type: object + properties: + op: + type: string + pattern: '^FollowCommunity$' + default: 'FollowCommunity' + data: + type: object + properties: + community_view: + $ref: '#/components/schemas/community_view' + getFollowedCommunitiesRequest: + name: Request to list all followed communities + payload: + type: object + required: + - op + - data + properties: + op: + type: string + pattern: '^GetFollowedCommunities$' + default: 'GetFollowedCommunities' + data: + type: object + required: + - auth + properties: + auth: + $ref: '#/components/schemas/authStringSchema' + getFollowedCommunitiesResponse: + name: List of followed communities + payload: + type: object + properties: + op: + type: string + pattern: '^GetFollowedCommunities$' + default: 'GetFollowedCommunities' + data: + type: object + properties: + communities: + type: array + items: + properties: + community: + $ref: '#/components/schemas/community' + follower: + $ref: '#/components/schemas/user' transferCommunityRequest: name: Request to transfer ownership of a community from one person to another + payload: + type: object + required: + - op + - data + properties: + op: + type: string + pattern: '^TransferCommunity$' + default: 'TransferCommunity' + data: + type: object + required: + - community_id + - user_id + - auth + properties: + community_id: + $ref: '#/components/schemas/community_id' + user_id: + $ref: '#/components/schemas/user_id' + auth: + $ref: '#/components/schemas/authStringSchema' + transferCommunityResponse: + name: Response to a request to transfer community ownership payload: type: object properties: @@ -2783,16 +3425,19 @@ components: data: type: object properties: - community_id: - $ref: '#/components/schemas/community_id' - user_id: - $ref: '#/components/schemas/user_id' - auth: - $ref: '#/components/schemas/authStringSchema' + moderators: + $ref: '#/components/schemas/moderators' + online: + $ref: '#/components/schemas/online' + community_view: + $ref: '#/components/schemas/community_view' communityJoinRequest: name: Forthcoming... payload: type: object + required: + - op + - data properties: op: type: string @@ -2800,6 +3445,8 @@ components: default: 'CommunityJoin' data: type: object + required: + - community_id properties: community_id: $ref: '#/components/schemas/community_id' @@ -2820,6 +3467,9 @@ components: name: Forthcoming... payload: type: object + required: + - op + - data properties: op: type: string @@ -2827,6 +3477,8 @@ components: default: 'ModJoin' data: type: object + required: + - community_id properties: community_id: $ref: '#/components/schemas/community_id' @@ -2847,6 +3499,9 @@ components: name: Request to create a new post payload: type: object + required: + - op + - data properties: op: type: string @@ -2854,6 +3509,11 @@ components: default: 'CreatePost' data: type: object + required: + - name + - nsfw + - community_id + - auth properties: name: $ref: '#/components/schemas/post_name' @@ -2885,6 +3545,9 @@ components: name: Request details of a post payload: type: object + required: + - op + - data properties: op: type: string @@ -2892,6 +3555,9 @@ components: default: 'GetPost' data: type: object + required: + - id + - auth properties: id: $ref: '#/components/schemas/post_id' @@ -2921,6 +3587,9 @@ components: name: Request details of all posts payload: type: object + required: + - op + - data properties: op: type: string @@ -2950,6 +3619,9 @@ components: name: Forthcoming... payload: type: object + required: + - op + - data properties: op: type: string @@ -2957,6 +3629,10 @@ components: default: 'CreatePostLike' data: type: object + required: + - post_id + - score + - auth properties: post_id: $ref: '#/components/schemas/post_id' @@ -2978,10 +3654,57 @@ components: properties: post_view: $ref: '#/components/schemas/post_view' + editPostRequest: + name: Request to edit an existing post + payload: + type: object + required: + - op + - data + properties: + op: + type: string + pattern: '^EditPost$' + default: 'EditPost' + data: + type: object + required: + - post_id + - name + - nsfw + - auth + properties: + post_id: + $ref: '#/components/schemas/post_id' + name: + $ref: '#/components/schemas/post_name' + url: + $ref: '#/components/schemas/url' + nsfw: + $ref: '#/components/schemas/nsfw' + auth: + $ref: '#/components/schemas/authStringSchema' + editPostResponse: + name: Response to request to edit a post + payload: + type: object + properties: + op: + type: string + pattern: '^EditPost$' + default: 'EditPost' + data: + type: object + properties: + post_view: + $ref: '#/components/schemas/post_view' deletePostRequest: name: Request that a post be deleted payload: type: object + required: + - op + - data properties: op: type: string @@ -2989,6 +3712,10 @@ components: default: 'DeletePost' data: type: object + required: + - post_id + - deleted + - auth properties: post_id: $ref: '#/components/schemas/post_id' @@ -3014,6 +3741,9 @@ components: name: Request that a post be removed payload: type: object + required: + - op + - data properties: op: type: string @@ -3021,6 +3751,10 @@ components: default: 'RemovePost' data: type: object + required: + - post_id + - removed + - auth properties: post_id: $ref: '#/components/schemas/post_id' @@ -3048,13 +3782,20 @@ components: name: Request that a post be locked payload: type: object + required: + - op + - data properties: op: type: string - pattern: '^PostLock$' - default: 'PostLock' + pattern: '^LockPost$' + default: 'LockPost' data: type: object + required: + - post_id + - locked + - auth properties: post_id: $ref: '#/components/schemas/post_id' @@ -3069,8 +3810,8 @@ components: properties: op: type: string - pattern: '^PostLock$' - default: 'PostLock' + pattern: '^LockPost$' + default: 'LockPost' data: type: object properties: @@ -3080,6 +3821,9 @@ components: name: Request that a post be made 'sticky' payload: type: object + required: + - op + - data properties: op: type: string @@ -3087,6 +3831,10 @@ components: default: 'StickyPost' data: type: object + required: + - post_id + - stickied + - auth properties: post_id: $ref: '#/components/schemas/post_id' @@ -3112,6 +3860,9 @@ components: name: Request to add a post to the user's list of saved posts payload: type: object + required: + - op + - data properties: op: type: string @@ -3119,6 +3870,10 @@ components: default: 'SavePost' data: type: object + required: + - post_id + - save + - auth properties: post_id: $ref: '#/components/schemas/post_id' @@ -3144,6 +3899,9 @@ components: name: Forthcoming... payload: type: object + required: + - op + - data properties: op: type: string @@ -3151,6 +3909,8 @@ components: default: 'PostJoin' data: type: object + required: + - post_id properties: post_id: $ref: '#/components/schemas/post_id' @@ -3179,6 +3939,10 @@ components: default: 'CreatePostReport' data: type: object + required: + - post_id + - reason + - auth properties: post_id: $ref: '#/components/schemas/post_id' @@ -3204,6 +3968,9 @@ components: name: Request to resolve a report against a post payload: type: object + required: + - op + - data properties: op: type: string @@ -3226,6 +3993,9 @@ components: name: Request to list all reports against posts payload: type: object + required: + - op + - data properties: op: type: string @@ -3292,6 +4062,9 @@ components: name: Request to create a comment on a post payload: type: object + required: + - op + - data properties: op: type: string @@ -3317,6 +4090,9 @@ components: name: Request to edit a comment payload: type: object + required: + - op + - data properties: op: type: string @@ -3349,6 +4125,10 @@ components: default: 'DeleteComment' data: type: object + required: + - comment_id + - deleted + - auth properties: comment_id: $ref: '#/components/schemas/comment_id' @@ -3374,6 +4154,9 @@ components: name: Request to permanently delete a comment payload: type: object + required: + - op + - data properties: op: type: string @@ -3381,6 +4164,10 @@ components: default: 'RemoveComment' data: type: object + required: + - comment_id + - removed + - auth properties: comment_id: $ref: '#/components/schemas/comment_id' @@ -3408,6 +4195,9 @@ components: name: Request to retrieve all comments payload: type: object + required: + - op + - data properties: op: type: string @@ -3438,6 +4228,9 @@ components: name: Request to mark a commment as read payload: type: object + required: + - op + - data properties: op: type: string @@ -3445,6 +4238,10 @@ components: default: 'MarkCommentAsRead' data: type: object + required: + - comment_id + - read + - auth properties: comment_id: $ref: '#/components/schemas/comment_id' @@ -3470,6 +4267,9 @@ components: name: Request to save a commment payload: type: object + required: + - op + - data properties: op: type: string @@ -3477,6 +4277,10 @@ components: default: 'SaveComment' data: type: object + required: + - comment_id + - save + - auth properties: comment_id: $ref: '#/components/schemas/comment_id' @@ -3502,6 +4306,9 @@ components: name: Forthcoming... payload: type: object + required: + - op + - data properties: op: type: string @@ -3509,6 +4316,10 @@ components: default: 'CreateCommentLike' data: type: object + required: + - comment_id + - score + - auth properties: comment_id: $ref: '#/components/schemas/comment_id' @@ -3534,6 +4345,9 @@ components: name: Request to report a comment payload: type: object + required: + - op + - data properties: op: type: string @@ -3541,6 +4355,10 @@ components: default: 'CreateCommentReport' data: type: object + required: + - comment_id + - reason + - auth properties: comment_id: $ref: '#/components/schemas/comment_id' @@ -3566,6 +4384,9 @@ components: name: Request to clear a report against a comment payload: type: object + required: + - op + - data properties: op: type: string @@ -3588,6 +4409,9 @@ components: name: Request to list all reports against comments payload: type: object + required: + - op + - data properties: op: type: string @@ -3670,7 +4494,7 @@ components: example: 'https:\/\/enterprise.lemmy.ml\/post\/223' 'authSchema': type: object - description: 'The authentication string returned by **Login**, **Register** and **Save user settings**.' + description: 'The authentication string returned by **Login** and **Register**' properties: jwt: $ref: '#/components/schemas/authStringSchema' @@ -3694,9 +4518,7 @@ components: user: $ref: '#/components/schemas/user_view' banned: - description: Forthcoming... - type: boolean - example: true + $ref: '#/components/schemas/banned' 'banned': type: boolean description: 'Set to *true* if this account (username) has been banned from posting on the Lemmy server' @@ -3770,6 +4592,10 @@ components: example: 374 'comment_request': type: object + required: + - content + - post_id + - auth properties: content: $ref: '#/components/schemas/content' @@ -3859,20 +4685,13 @@ components: id: $ref: '#/components/schemas/community_id' description: - type: string - description: |- - The title for the community's **Sidebar** area - example: 'All about the Rolex/Björn Borg collaboration' + $ref: '#/components/schemas/description' actor_id: $ref: '#/components/schemas/actor_id' local: $ref: '#/components/schemas/local' title: - type: string - description: |- - The title (**Display name**) of this community. - - If set, this is the name shown instead of, or as well as, *name* in some contexts + $ref: '#/components/schemas/title' banner: $ref: '#/components/schemas/banner' 'community_id': @@ -4037,6 +4856,11 @@ components: description: |- Set to *true* if this community, post, comment, message or user account should be or has been deleted. Unlike *removal*, deletion is not permanent. Deleted items can be recovered example: false + 'description': + type: string + description: |- + The information in the community's **Sidebar** area + example: 'All about the Rolex/Björn Borg collaboration' 'downvotes': type: number description: Forthcoming... @@ -4048,8 +4872,7 @@ components: format: email example: 'jane.doe@humanity.org' 'enable_downvotes': - description: |- - **(Required)** Set to *true* if downvoting is allowed on this site + description: Set to *true* if downvoting is allowed on this site type: boolean example: false 'expires': @@ -4078,7 +4901,7 @@ components: type: array items: properties: - # 'instance' is a guess at the name for this field + # COMMENT 'instance' is a guess at the name for this field. Unable to test federation instance: description: Forthcoming... type: string @@ -4110,6 +4933,9 @@ components: example: 20 'list_request': type: object + required: + - type_ + - sort properties: type_: $ref: '#/components/schemas/type_listing' @@ -4130,8 +4956,21 @@ components: nullable: true description: 'The [Matrix](https://matrix.org/docs/projects/try-matrix-now/) id of the user' 'mentions': - description: 'Description and structure forthcoming...' + description: 'Forthcoming...' type: object + required: + - user_mention_id + - read + - auth + properties: + user_mention_id: + description: Forthcoming... + type: integer + format: int32 + read: + $ref: '#/components/schemas/read' + auth: + $ref: '#/components/schemas/authStringSchema' 'moderators': description: The list of moderators for each community type: array @@ -4143,6 +4982,8 @@ components: $ref: '#/components/schemas/community' 'my_user': type: object + required: + - show_nsfw properties: show_nsfw: $ref: '#/components/schemas/show_nsfw' @@ -4205,8 +5046,7 @@ components: type: number example: 1 'open_registration': - description: |- - **(Required)** Forthcoming... + description: Forthcoming... type: boolean example: true 'page': @@ -4215,11 +5055,7 @@ components: minimum: 1 description: Forthcoming... example: 1 - 'passwordRequired': - type: string - description: '**(Required)** *Exact* password' - example: 'lemmy' - 'passwordOptional': + 'password': type: string description: '*Exact* password' example: 'lemmy' @@ -4316,6 +5152,10 @@ components: description: 'The date and time of the most recent comment (in [ISO8601 format](https://www.w3.org/TR/NOTE-datetime))' type: string example: '2021-02-16T11:22:27.615111' + newest_comment_time_necro: + description: Forthcoming... + type: string + example: '2021-02-23T13:26:54.956691' stickied: $ref: '#/components/schemas/stickied' downvotes: @@ -4436,6 +5276,10 @@ components: $ref: '#/components/schemas/subscribed' 'repliesMentionsRequest': type: object + required: + - sort + - unread_only + - auth properties: sort: $ref: '#/components/schemas/sort' @@ -4465,6 +5309,10 @@ components: $ref: '#/components/schemas/authStringSchema' 'resolve_request': type: object + required: + - report_id + - resolved + - auth properties: report_id: $ref: '#/components/schemas/report_id' @@ -4515,11 +5363,13 @@ components: 'show_nsfw': type: boolean description: |- - **(Required)** Set to *true* if you wish [NSFW](https://en.wikipedia.org/wiki/Not_safe_for_work) content to be viewable by this person/site + Set to *true* if you wish [NSFW](https://en.wikipedia.org/wiki/Not_safe_for_work) content to be viewable by this person/site example: false default: false 'site': type: object + required: + - show_nsfw properties: description: $ref: '#/components/schemas/site_description' @@ -4583,12 +5433,17 @@ components: type: string example: 'Federation test instance' 'site_name': - description: |- - **(Required) ** The name of this site + description: The name of this site type: string example: 'Enterprise' 'site_properties': type: object + required: + - name + - auth + - enable_downvotes + - open_registration + - enable_nsfw properties: name: $ref: '#/components/schemas/site_name' @@ -4618,8 +5473,6 @@ components: 'sort': type: string description: |- - **(Required)** - Sort the response from the server according to one of the following criteria: - *Active* - the hottest posts/communities, depending on votes, and newest comment publish date - *Hot* - the hottest posts/communities, depending on votes and publish date @@ -4670,6 +5523,13 @@ components: - united - vaporwave - vaporwave-dark + 'title': + type: string + description: |- + The title (**Display name**) of this community. + + If set, this is the name shown instead of, or as well as, *name* in some contexts + example: 'BorgWatch' 'type_': description: What is the scope of the search? type: string