Added admin-only responses

This commit is contained in:
Gary Conroy 2021-02-23 14:38:17 +00:00
parent 5280929b33
commit 44caeec792

View file

@ -66,7 +66,7 @@ channels:
$ref: '#/components/messages/loginRequest' $ref: '#/components/messages/loginRequest'
subscribe: subscribe:
summary: Login (response) summary: Login (response)
description: 'You will receive an authentication string (`jwt`)' description: Returns authentication string (`jwt`) for the supplier username or emal
operationId: loginResponseMessage operationId: loginResponseMessage
tags: tags:
- name: User, authentication and admin - name: User, authentication and admin
@ -125,7 +125,7 @@ channels:
summary: GetUserDetails (request) summary: GetUserDetails (request)
description: |- description: |-
- Use the `username` field to return details about a local user - 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. #### HTTP API - operation and endpoint.
@ -601,7 +601,16 @@ channels:
- name: Site - name: Site
message: message:
$ref: '#/components/messages/createSiteRequest' $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: EditSite:
publish: publish:
summary: EditSite (Request) summary: EditSite (Request)
@ -724,7 +733,6 @@ channels:
oneOf: oneOf:
- $ref: '#/components/messages/saveSiteConfigResponse' - $ref: '#/components/messages/saveSiteConfigResponse'
- $ref: '#/components/messages/errorResponse' - $ref: '#/components/messages/errorResponse'
# SaveSiteConfig response not verified. Did not get response from server
GetCommunity: GetCommunity:
publish: publish:
summary: GetCommunity (request) summary: GetCommunity (request)
@ -811,7 +819,16 @@ channels:
- name: Community - name: Community
message: message:
$ref: '#/components/messages/banFromCommunityRequest' $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: AddModToCommunity:
publish: publish:
summary: AddModToCommunity (request) summary: AddModToCommunity (request)
@ -828,7 +845,16 @@ channels:
- name: Community - name: Community
message: message:
$ref: '#/components/messages/addModToCommunityRequest' $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: EditCommunity:
publish: publish:
description: |- description: |-
@ -899,14 +925,13 @@ channels:
subscribe: subscribe:
summary: RemoveCommunity (response) summary: RemoveCommunity (response)
description: Return the details for the deleted community description: Return the details for the deleted community
operationId: deleteCommunityResponseMessage operationId: removeCommunityResponseMessage
tags: tags:
- name: Community - name: Community
message: message:
oneOf: oneOf:
- $ref: '#/components/messages/removeCommunityResponse' - $ref: '#/components/messages/removeCommunityResponse'
- $ref: '#/components/messages/errorResponse' - $ref: '#/components/messages/errorResponse'
# COMMENT Issues with Docker, hence not tested
FollowCommunity: FollowCommunity:
publish: publish:
summary: FollowCommunity (request) summary: FollowCommunity (request)
@ -971,7 +996,16 @@ channels:
- name: Community - name: Community
message: message:
$ref: '#/components/messages/transferCommunityRequest' $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: CommunityJoin:
publish: publish:
summary: CommunityJoin (request) summary: CommunityJoin (request)
@ -1221,7 +1255,6 @@ channels:
oneOf: oneOf:
- $ref: '#/components/messages/postLockResponse' - $ref: '#/components/messages/postLockResponse'
- $ref: '#/components/messages/errorResponse' - $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: StickyPost:
publish: publish:
summary: StickyPost (request) summary: StickyPost (request)
@ -1889,6 +1922,10 @@ components:
- sort - sort
- saved_only - saved_only
properties: properties:
user_id:
$ref: '#/components/schemas/user_id'
username:
$ref: '#/components/schemas/user_name'
sort: sort:
$ref: '#/components/schemas/sort' $ref: '#/components/schemas/sort'
page: page:
@ -1909,19 +1946,19 @@ components:
payload: payload:
type: object type: object
properties: properties:
jwt:
$ref: '#/components/schemas/authStringSchema'
op: op:
type: string type: string
pattern: '^SaveUserSettings$' pattern: '^SaveUserSettings$'
default: 'SaveUserSettings' default: 'SaveUserSettings'
data:
type: object
properties:
jwt:
$ref: '#/components/schemas/authStringSchema'
getUserDetailsResponse: getUserDetailsResponse:
name: Registration request response name: User details request response
payload: payload:
type: object type: object
required:
- op
- data
properties: properties:
op: op:
type: string type: string
@ -2672,6 +2709,20 @@ components:
default: 'CreateSite' default: 'CreateSite'
data: data:
$ref: '#/components/schemas/site_properties' $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: editSiteRequest:
name: Request to edit Lemmy site details name: Request to edit Lemmy site details
payload: payload:
@ -2724,16 +2775,15 @@ components:
payload: payload:
type: object type: object
properties: properties:
op:
type: string
pattern: '^GetSite$'
default: 'GetSite'
data: data:
type: object type: object
properties: properties:
site_view: site_view:
counts: $ref: '#/components/schemas/site_view'
$ref: '#/components/schemas/site_counts'
site:
$ref: '#/components/schemas/site'
creator:
$ref: '#/components/schemas/creator'
federated_instances: federated_instances:
$ref: '#/components/schemas/federated_instances' $ref: '#/components/schemas/federated_instances'
my_user: my_user:
@ -2756,9 +2806,7 @@ components:
type: number type: number
example: 8 example: 8
user_id: user_id:
description: Forthcoming... $ref: '#/components/schemas/user_id'
type: number
example: 2
post_score: post_score:
description: Forthcoming... description: Forthcoming...
type: number type: number
@ -2777,10 +2825,6 @@ components:
example: 9 example: 9
user: user:
$ref: '#/components/schemas/creator' $ref: '#/components/schemas/creator'
op:
type: string
pattern: '^GetSite$'
default: 'GetSite'
transferSiteRequest: transferSiteRequest:
name: Request to transfer ownership of the site name: Request to transfer ownership of the site
payload: payload:
@ -3002,7 +3046,7 @@ components:
community_view: community_view:
$ref: '#/components/schemas/community_view' $ref: '#/components/schemas/community_view'
listCommunityRequest: listCommunityRequest:
name: Request to get list of communities on the Lemmy server name: Request list of communities on the Lemmy server
payload: payload:
type: object type: object
required: required:
@ -3016,6 +3060,7 @@ components:
data: data:
type: object type: object
required: required:
- type_
- sort - sort
properties: properties:
type_: type_:
@ -3116,6 +3161,20 @@ components:
$ref: '#/components/schemas/added' $ref: '#/components/schemas/added'
auth: auth:
$ref: '#/components/schemas/authStringSchema' $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: editCommunityRequest:
name: Request to edit a community name: Request to edit a community
payload: payload:
@ -3354,6 +3413,24 @@ components:
$ref: '#/components/schemas/user_id' $ref: '#/components/schemas/user_id'
auth: auth:
$ref: '#/components/schemas/authStringSchema' $ref: '#/components/schemas/authStringSchema'
transferCommunityResponse:
name: Response to a request to transfer community ownership
payload:
type: object
properties:
op:
type: string
pattern: '^TransferCommunity$'
default: 'TransferCommunity'
data:
type: object
properties:
moderators:
$ref: '#/components/schemas/moderators'
online:
$ref: '#/components/schemas/online'
community_view:
$ref: '#/components/schemas/community_view'
communityJoinRequest: communityJoinRequest:
name: Forthcoming... name: Forthcoming...
payload: payload:
@ -3711,8 +3788,8 @@ components:
properties: properties:
op: op:
type: string type: string
pattern: '^PostLock$' pattern: '^LockPost$'
default: 'PostLock' default: 'LockPost'
data: data:
type: object type: object
required: required:
@ -3733,8 +3810,8 @@ components:
properties: properties:
op: op:
type: string type: string
pattern: '^PostLock$' pattern: '^LockPost$'
default: 'PostLock' default: 'LockPost'
data: data:
type: object type: object
properties: properties:
@ -4417,7 +4494,7 @@ components:
example: 'https:\/\/enterprise.lemmy.ml\/post\/223' example: 'https:\/\/enterprise.lemmy.ml\/post\/223'
'authSchema': 'authSchema':
type: object type: object
description: 'The authentication string returned by **Login**, **Register** and **Save user settings**.' description: 'The authentication string returned by **Login** and **Register**'
properties: properties:
jwt: jwt:
$ref: '#/components/schemas/authStringSchema' $ref: '#/components/schemas/authStringSchema'
@ -4441,9 +4518,7 @@ components:
user: user:
$ref: '#/components/schemas/user_view' $ref: '#/components/schemas/user_view'
banned: banned:
description: Forthcoming... $ref: '#/components/schemas/banned'
type: boolean
example: true
'banned': 'banned':
type: boolean type: boolean
description: 'Set to *true* if this account (username) has been banned from posting on the Lemmy server' description: 'Set to *true* if this account (username) has been banned from posting on the Lemmy server'
@ -4826,7 +4901,7 @@ components:
type: array type: array
items: items:
properties: 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: instance:
description: Forthcoming... description: Forthcoming...
type: string type: string
@ -5077,6 +5152,10 @@ components:
description: 'The date and time of the most recent comment (in [ISO8601 format](https://www.w3.org/TR/NOTE-datetime))' description: 'The date and time of the most recent comment (in [ISO8601 format](https://www.w3.org/TR/NOTE-datetime))'
type: string type: string
example: '2021-02-16T11:22:27.615111' example: '2021-02-16T11:22:27.615111'
newest_comment_time_necro:
description: Forthcoming...
type: string
example: '2021-02-23T13:26:54.956691'
stickied: stickied:
$ref: '#/components/schemas/stickied' $ref: '#/components/schemas/stickied'
downvotes: downvotes: