diff options
Diffstat (limited to 'internal/api/client/status')
-rw-r--r-- | internal/api/client/status/status_test.go | 2 | ||||
-rw-r--r-- | internal/api/client/status/statusboost.go | 67 | ||||
-rw-r--r-- | internal/api/client/status/statusboostedby.go | 57 | ||||
-rw-r--r-- | internal/api/client/status/statuscontext.go | 65 | ||||
-rw-r--r-- | internal/api/client/status/statuscreate.go | 58 | ||||
-rw-r--r-- | internal/api/client/status/statusdelete.go | 63 | ||||
-rw-r--r-- | internal/api/client/status/statusfave.go | 63 | ||||
-rw-r--r-- | internal/api/client/status/statusfavedby.go | 65 | ||||
-rw-r--r-- | internal/api/client/status/statusget.go | 63 | ||||
-rw-r--r-- | internal/api/client/status/statusunboost.go | 65 | ||||
-rw-r--r-- | internal/api/client/status/statusunfave.go | 63 |
11 files changed, 321 insertions, 310 deletions
diff --git a/internal/api/client/status/status_test.go b/internal/api/client/status/status_test.go index ad6901d9d..def13a23a 100644 --- a/internal/api/client/status/status_test.go +++ b/internal/api/client/status/status_test.go @@ -88,6 +88,8 @@ func (suite *StatusStandardTestSuite) SetupTest() { suite.emailSender = testrig.NewEmailSender("../../../../web/template/", nil) suite.processor = testrig.NewTestProcessor(suite.db, suite.storage, suite.federator, suite.emailSender, suite.mediaManager, clientWorker, fedWorker) suite.statusModule = status.New(suite.processor).(*status.Module) + + suite.NoError(suite.processor.Start()) } func (suite *StatusStandardTestSuite) TearDownTest() { diff --git a/internal/api/client/status/statusboost.go b/internal/api/client/status/statusboost.go index 0642ad92e..d43bedd6c 100644 --- a/internal/api/client/status/statusboost.go +++ b/internal/api/client/status/statusboost.go @@ -33,44 +33,45 @@ import ( // Reblog/boost status with the given ID. // // If the target status is rebloggable/boostable, it will be shared with your followers. -// This is equivalent to an activitypub 'announce' activity. +// This is equivalent to an ActivityPub 'Announce' activity. // -// --- -// tags: -// - statuses +// --- +// tags: +// - statuses // -// produces: -// - application/json +// produces: +// - application/json // -// parameters: -// - name: id -// type: string -// description: Target status ID. -// in: path -// required: true +// parameters: +// - +// name: id +// type: string +// description: Target status ID. +// in: path +// required: true // -// security: -// - OAuth2 Bearer: -// - write:statuses +// security: +// - OAuth2 Bearer: +// - write:statuses // -// responses: -// '200': -// name: status -// description: The boost of 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 +// responses: +// '200': +// name: status +// description: The boost of 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 func (m *Module) StatusBoostPOSTHandler(c *gin.Context) { authed, err := oauth.Authed(c, true, true, true, true) if err != nil { diff --git a/internal/api/client/status/statusboostedby.go b/internal/api/client/status/statusboostedby.go index fbe447bf4..883f07fac 100644 --- a/internal/api/client/status/statusboostedby.go +++ b/internal/api/client/status/statusboostedby.go @@ -32,38 +32,39 @@ import ( // // View accounts that have reblogged/boosted the target status. // -// --- -// tags: -// - statuses +// --- +// tags: +// - statuses // -// produces: -// - application/json +// produces: +// - application/json // -// parameters: -// - name: id -// type: string -// description: Target status ID. -// in: path -// required: true +// parameters: +// - +// name: id +// type: string +// description: Target status ID. +// in: path +// required: true // -// security: -// - OAuth2 Bearer: -// - read:accounts +// security: +// - OAuth2 Bearer: +// - read:accounts // -// responses: -// '200': -// schema: -// type: array -// items: -// "$ref": "#/definitions/account" -// '400': -// description: bad request -// '401': -// description: unauthorized -// '403': -// description: forbidden -// '404': -// description: not found +// responses: +// '200': +// schema: +// type: array +// items: +// "$ref": "#/definitions/account" +// '400': +// description: bad request +// '401': +// description: unauthorized +// '403': +// description: forbidden +// '404': +// description: not found func (m *Module) StatusBoostedByGETHandler(c *gin.Context) { l := log.WithFields(kv.Fields{ diff --git a/internal/api/client/status/statuscontext.go b/internal/api/client/status/statuscontext.go index 0daefaec1..632a151d5 100644 --- a/internal/api/client/status/statuscontext.go +++ b/internal/api/client/status/statuscontext.go @@ -34,42 +34,43 @@ import ( // // 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. // -// --- -// tags: -// - statuses +// --- +// tags: +// - statuses // -// produces: -// - application/json +// produces: +// - application/json // -// parameters: -// - name: id -// type: string -// description: Target status ID. -// in: path -// required: true +// parameters: +// - +// name: id +// type: string +// description: Target status ID. +// in: path +// required: true // -// security: -// - OAuth2 Bearer: -// - read:statuses +// security: +// - OAuth2 Bearer: +// - read:statuses // -// responses: -// '200': -// name: statuses -// description: Status context object. -// schema: -// "$ref": "#/definitions/statusContext" -// '400': -// description: bad request -// '401': -// description: unauthorized -// '403': -// description: forbidden -// '404': -// description: not found -// '406': -// description: not acceptable -// '500': -// description: internal server error +// responses: +// '200': +// name: statuses +// description: Status context object. +// schema: +// "$ref": "#/definitions/statusContext" +// '400': +// description: bad request +// '401': +// description: unauthorized +// '403': +// description: forbidden +// '404': +// description: not found +// '406': +// description: not acceptable +// '500': +// description: internal server error func (m *Module) StatusContextGETHandler(c *gin.Context) { authed, err := oauth.Authed(c, true, true, true, true) if err != nil { diff --git a/internal/api/client/status/statuscreate.go b/internal/api/client/status/statuscreate.go index 4218c9d48..13aa5d173 100644 --- a/internal/api/client/status/statuscreate.go +++ b/internal/api/client/status/statuscreate.go @@ -39,39 +39,39 @@ import ( // The parameters can also be given in the body of the request, as JSON, if the content-type is set to 'application/json'. // The parameters can also be given in the body of the request, as XML, if the content-type is set to 'application/xml'. // -// --- -// tags: -// - statuses +// --- +// tags: +// - statuses // -// consumes: -// - application/json -// - application/xml -// - application/x-www-form-urlencoded +// consumes: +// - application/json +// - application/xml +// - application/x-www-form-urlencoded // -// produces: -// - application/json +// produces: +// - application/json // -// security: -// - OAuth2 Bearer: -// - write:statuses +// security: +// - OAuth2 Bearer: +// - write:statuses // -// responses: -// '200': -// description: "The newly created 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 +// responses: +// '200': +// description: "The newly created 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 func (m *Module) StatusCreatePOSTHandler(c *gin.Context) { authed, err := oauth.Authed(c, true, true, true, true) if err != nil { diff --git a/internal/api/client/status/statusdelete.go b/internal/api/client/status/statusdelete.go index f9adccb57..b37dd5f14 100644 --- a/internal/api/client/status/statusdelete.go +++ b/internal/api/client/status/statusdelete.go @@ -35,41 +35,42 @@ import ( // The deleted status will be returned in the response. The `text` field will contain the original text of the status as it was submitted. // This is useful when doing a 'delete and redraft' type operation. // -// --- -// tags: -// - statuses +// --- +// tags: +// - statuses // -// produces: -// - application/json +// produces: +// - application/json // -// parameters: -// - name: id -// type: string -// description: Target status ID. -// in: path -// required: true +// parameters: +// - +// name: id +// type: string +// description: Target status ID. +// in: path +// required: true // -// security: -// - OAuth2 Bearer: -// - write:statuses +// security: +// - OAuth2 Bearer: +// - write:statuses // -// responses: -// '200': -// description: "The newly deleted 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 +// responses: +// '200': +// description: "The status that was just deleted." +// 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 func (m *Module) StatusDELETEHandler(c *gin.Context) { authed, err := oauth.Authed(c, true, true, true, true) if err != nil { diff --git a/internal/api/client/status/statusfave.go b/internal/api/client/status/statusfave.go index 29f74316a..3117e7ef2 100644 --- a/internal/api/client/status/statusfave.go +++ b/internal/api/client/status/statusfave.go @@ -32,41 +32,42 @@ import ( // // Star/like/favourite the given status, if permitted. // -// --- -// tags: -// - statuses +// --- +// tags: +// - statuses // -// produces: -// - application/json +// produces: +// - application/json // -// parameters: -// - name: id -// type: string -// description: Target status ID. -// in: path -// required: true +// parameters: +// - +// name: id +// type: string +// description: Target status ID. +// in: path +// required: true // -// security: -// - OAuth2 Bearer: -// - write:statuses +// security: +// - OAuth2 Bearer: +// - write:statuses // -// responses: -// '200': -// description: "The newly faved 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 +// responses: +// '200': +// description: "The newly faved 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 func (m *Module) StatusFavePOSTHandler(c *gin.Context) { authed, err := oauth.Authed(c, true, true, true, true) if err != nil { diff --git a/internal/api/client/status/statusfavedby.go b/internal/api/client/status/statusfavedby.go index 579df6432..20ef86ded 100644 --- a/internal/api/client/status/statusfavedby.go +++ b/internal/api/client/status/statusfavedby.go @@ -32,42 +32,43 @@ import ( // // View accounts that have faved/starred/liked the target status. // -// --- -// tags: -// - statuses +// --- +// tags: +// - statuses // -// produces: -// - application/json +// produces: +// - application/json // -// parameters: -// - name: id -// type: string -// description: Target status ID. -// in: path -// required: true +// parameters: +// - +// name: id +// type: string +// description: Target status ID. +// in: path +// required: true // -// security: -// - OAuth2 Bearer: -// - read:accounts +// security: +// - OAuth2 Bearer: +// - read:accounts // -// responses: -// '200': -// schema: -// type: array -// items: -// "$ref": "#/definitions/account" -// '400': -// description: bad request -// '401': -// description: unauthorized -// '403': -// description: forbidden -// '404': -// description: not found -// '406': -// description: not acceptable -// '500': -// description: internal server error +// responses: +// '200': +// schema: +// type: array +// items: +// "$ref": "#/definitions/account" +// '400': +// description: bad request +// '401': +// description: unauthorized +// '403': +// description: forbidden +// '404': +// description: not found +// '406': +// description: not acceptable +// '500': +// description: internal server error func (m *Module) StatusFavedByGETHandler(c *gin.Context) { authed, err := oauth.Authed(c, true, true, true, true) if err != nil { diff --git a/internal/api/client/status/statusget.go b/internal/api/client/status/statusget.go index 9a8b406dc..a0d0e913c 100644 --- a/internal/api/client/status/statusget.go +++ b/internal/api/client/status/statusget.go @@ -32,41 +32,42 @@ import ( // // View status with the given ID. // -// --- -// tags: -// - statuses +// --- +// tags: +// - statuses // -// produces: -// - application/json +// produces: +// - application/json // -// parameters: -// - name: id -// type: string -// description: Target status ID. -// in: path -// required: true +// parameters: +// - +// name: id +// type: string +// description: Target status ID. +// in: path +// required: true // -// security: -// - OAuth2 Bearer: -// - read:statuses +// security: +// - OAuth2 Bearer: +// - read:statuses // -// responses: -// '200': -// description: "The requested created 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 +// responses: +// '200': +// description: "The requested 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 func (m *Module) StatusGETHandler(c *gin.Context) { authed, err := oauth.Authed(c, true, true, true, true) if err != nil { diff --git a/internal/api/client/status/statusunboost.go b/internal/api/client/status/statusunboost.go index b3e921bb7..45a8e0ece 100644 --- a/internal/api/client/status/statusunboost.go +++ b/internal/api/client/status/statusunboost.go @@ -32,42 +32,43 @@ import ( // // Unreblog/unboost status with the given ID. // -// --- -// tags: -// - statuses +// --- +// tags: +// - statuses // -// produces: -// - application/json +// produces: +// - application/json // -// parameters: -// - name: id -// type: string -// description: Target status ID. -// in: path -// required: true +// parameters: +// - +// name: id +// type: string +// description: Target status ID. +// in: path +// required: true // -// security: -// - OAuth2 Bearer: -// - write:statuses +// security: +// - OAuth2 Bearer: +// - write:statuses // -// responses: -// '200': -// name: status -// description: The unboosted 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 +// responses: +// '200': +// name: status +// description: The unboosted 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 func (m *Module) StatusUnboostPOSTHandler(c *gin.Context) { authed, err := oauth.Authed(c, true, true, true, true) if err != nil { diff --git a/internal/api/client/status/statusunfave.go b/internal/api/client/status/statusunfave.go index 19f217160..19d3da3bd 100644 --- a/internal/api/client/status/statusunfave.go +++ b/internal/api/client/status/statusunfave.go @@ -32,41 +32,42 @@ import ( // // Unstar/unlike/unfavourite the given status. // -// --- -// tags: -// - statuses +// --- +// tags: +// - statuses // -// produces: -// - application/json +// produces: +// - application/json // -// parameters: -// - name: id -// type: string -// description: Target status ID. -// in: path -// required: true +// parameters: +// - +// name: id +// type: string +// description: Target status ID. +// in: path +// required: true // -// security: -// - OAuth2 Bearer: -// - write:statuses +// security: +// - OAuth2 Bearer: +// - write:statuses // -// responses: -// '200': -// description: "The unfaved 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 +// responses: +// '200': +// description: "The unfaved 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 func (m *Module) StatusUnfavePOSTHandler(c *gin.Context) { authed, err := oauth.Authed(c, true, true, true, true) if err != nil { |