[feature] Allow users to create + delete bookbarks, and view bookmarked statuses (#1168)

* Implement Bookmarks

* Update based on review comments

* Update swagger doc

* Fix argument passing to status.Bookmark

* Update changed test

* Updates based on latest PR review
This commit is contained in:
Matthew Phillips
2022-12-09 05:37:12 -05:00
committed by GitHub
parent e58d2d8122
commit 477ae50933
26 changed files with 1230 additions and 5 deletions

View File

@@ -3326,6 +3326,34 @@ paths:
summary: Get an array of accounts that requesting account has blocked.
tags:
- blocks
/api/v1/bookmarks:
get:
description: Get an array of statuses bookmarked in the instance
operationId: bookmarksGet
produces:
- application/json
responses:
"200":
description: Array of bookmarked statuses
headers:
Link:
description: Links to the next and previous queries.
type: string
schema:
items:
$ref: '#/definitions/status'
type: array
"401":
description: unauthorized
"406":
description: not acceptable
"500":
description: internal server error
security:
- OAuth2 Bearer:
- read:bookmarks
tags:
- bookmarks
/api/v1/custom_emojis:
get:
operationId: customEmojisGet
@@ -4111,6 +4139,40 @@ paths:
summary: View status with the given ID.
tags:
- statuses
/api/v1/statuses/{id}/bookmark:
post:
operationId: statusBookmark
parameters:
- description: Target status ID.
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: The status.
schema:
$ref: '#/definitions/status'
"400":
description: bad request
"401":
description: unauthorized
"403":
description: forbidden
"404":
description: not found
"406":
description: not acceptable
"500":
description: internal server error
security:
- OAuth2 Bearer:
- write:statuses
summary: Bookmark status with the given ID.
tags:
- statuses
/api/v1/statuses/{id}/context:
get:
description: The returned statuses will be ordered in a thread structure, so they are suitable to be displayed in the order in which they were returned.
@@ -4285,6 +4347,40 @@ paths:
summary: View accounts that have reblogged/boosted the target status.
tags:
- statuses
/api/v1/statuses/{id}/unbookmark:
post:
operationId: statusUnbookmark
parameters:
- description: Target status ID.
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: The status.
schema:
$ref: '#/definitions/status'
"400":
description: bad request
"401":
description: unauthorized
"403":
description: forbidden
"404":
description: not found
"406":
description: not acceptable
"500":
description: internal server error
security:
- OAuth2 Bearer:
- write:statuses
summary: Unbookmark status with the given ID.
tags:
- statuses
/api/v1/statuses/{id}/unfavourite:
post:
operationId: statusUnfave