diff options
Diffstat (limited to 'docs/api')
-rw-r--r-- | docs/api/swagger.yaml | 334 |
1 files changed, 314 insertions, 20 deletions
diff --git a/docs/api/swagger.yaml b/docs/api/swagger.yaml index da25d29c5..a717139cf 100644 --- a/docs/api/swagger.yaml +++ b/docs/api/swagger.yaml @@ -566,11 +566,12 @@ definitions: example: 01FBVD42CQ3ZEEVMW180SBX03B type: string x-go-name: ID - rule_ids: + rules: description: |- - Array of rule IDs that were submitted along with this report. - NOT IMPLEMENTED, will always be empty array. - items: {} + Array of rules that were broken according to this report. + Will be empty if no rule IDs were submitted with the report. + items: + $ref: '#/definitions/instanceRule' type: array x-go-name: Rules statuses: @@ -1274,6 +1275,36 @@ definitions: type: object x-go-name: InstanceConfigurationStatuses x-go-package: github.com/superseriousbusiness/gotosocial/internal/api/model + instanceRule: + properties: + id: + type: string + x-go-name: ID + text: + type: string + x-go-name: Text + title: InstanceRule represents a single instance rule. + type: object + x-go-name: InstanceRule + x-go-package: github.com/superseriousbusiness/gotosocial/internal/api/model + instanceRuleCreateRequest: + properties: + Text: + type: string + title: InstanceRuleCreateRequest represents a request to create a new instance rule, made through the admin API. + type: object + x-go-name: InstanceRuleCreateRequest + x-go-package: github.com/superseriousbusiness/gotosocial/internal/api/model + instanceRuleUpdateRequest: + properties: + ID: + type: string + Text: + type: string + title: InstanceRuleUpdateRequest represents a request to update the text of an instance rule, made through the admin API. + type: object + x-go-name: InstanceRuleUpdateRequest + x-go-package: github.com/superseriousbusiness/gotosocial/internal/api/model instanceV1: properties: account_domain: @@ -1330,6 +1361,12 @@ definitions: description: New account registrations are enabled on this instance. type: boolean x-go-name: Registrations + rules: + description: An itemized list of rules for this instance. + items: + $ref: '#/definitions/instanceRule' + type: array + x-go-name: Rules short_description: description: |- A shorter description of the instance. @@ -1453,10 +1490,9 @@ definitions: registrations: $ref: '#/definitions/instanceV2Registrations' rules: - description: |- - An itemized list of rules for this website. - Currently not implemented (will always be empty array). - items: {} + description: An itemized list of rules for this instance. + items: + $ref: '#/definitions/instanceRule' type: array x-go-name: Rules source_url: @@ -1755,6 +1791,72 @@ definitions: type: object x-go-name: MediaMeta x-go-package: github.com/superseriousbusiness/gotosocial/internal/api/model + multiStatus: + description: |- + This model should be transmitted along with http code + 207 MULTI-STATUS to indicate a mixture of responses. + See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/207 + properties: + data: + items: + $ref: '#/definitions/multiStatusEntry' + type: array + x-go-name: Data + metadata: + $ref: '#/definitions/multiStatusMetadata' + title: MultiStatus models a multistatus HTTP response body. + type: object + x-go-name: MultiStatus + x-go-package: github.com/superseriousbusiness/gotosocial/internal/api/model + multiStatusEntry: + description: |- + It can model either a success or a failure. The type + and value of `Resource` is left to the discretion of + the caller, but at minimum it should be expected to be + JSON-serializable. + properties: + message: + description: Message/error message for this entry. + type: string + x-go-name: Message + resource: + description: |- + The resource/result for this entry. + Value may be any type, check the docs + per endpoint to see which to expect. + x-go-name: Resource + status: + description: HTTP status code of this entry. + format: int64 + type: integer + x-go-name: Status + title: MultiStatusEntry models one entry in multistatus data. + type: object + x-go-name: MultiStatusEntry + x-go-package: github.com/superseriousbusiness/gotosocial/internal/api/model + multiStatusMetadata: + description: |- + MultiStatusMetadata models an at-a-glance summary of + the data contained in the MultiStatus. + properties: + failure: + description: Count of unsuccessful results (!2xx). + format: int64 + type: integer + x-go-name: Failure + success: + description: Count of successful results (2xx). + format: int64 + type: integer + x-go-name: Success + total: + description: Success count + failure count. + format: int64 + type: integer + x-go-name: Total + type: object + x-go-name: MultiStatusMetadata + x-go-package: github.com/superseriousbusiness/gotosocial/internal/api/model nodeinfo: description: 'See: https://nodeinfo.diaspora.software/schema.html' properties: @@ -1971,11 +2073,10 @@ definitions: Array of rule IDs that were submitted along with this report. Will be empty if no rule IDs were submitted. example: - - 1 - - 2 + - 01GPBN5YDY6JKBWE44H7YQBDCQ + - 01GPBN65PDWSBPWVDD0SQCFFY3 items: - format: int64 - type: integer + type: string type: array x-go-name: RuleIDs status_ids: @@ -4036,6 +4137,118 @@ paths: summary: Send a generic test email to a specified email address. tags: - admin + /api/v1/admin/instance/rules: + post: + consumes: + - multipart/form-data + operationId: ruleCreate + parameters: + - description: Text body for the instance rule, plaintext. + in: formData + name: text + required: true + type: string + produces: + - application/json + responses: + "200": + description: The newly-created instance rule. + schema: + $ref: '#/definitions/instanceRule' + "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: + - admin + summary: Create a new instance rule. + tags: + - admin + /api/v1/admin/instance/rules{id}: + delete: + consumes: + - multipart/form-data + operationId: ruleDelete + parameters: + - description: The id of the rule to delete. + in: formData + name: id + required: true + type: path + produces: + - application/json + responses: + "200": + description: The deleted instance rule. + schema: + $ref: '#/definitions/instanceRule' + "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: + - admin + summary: Delete an existing instance rule. + tags: + - admin + patch: + consumes: + - multipart/form-data + operationId: ruleUpdate + parameters: + - description: The id of the rule to update. + in: formData + name: id + required: true + type: path + - description: Text body for the updated instance rule, plaintext. + in: formData + name: text + required: true + type: string + produces: + - application/json + responses: + "200": + description: The updated instance rule. + schema: + $ref: '#/definitions/instanceRule' + "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: + - admin + summary: Update an existing instance rule. + tags: + - admin /api/v1/admin/media_cleanup: post: consumes: @@ -4251,6 +4464,67 @@ paths: summary: Mark a report as resolved. tags: - admin + /api/v1/admin/rules: + get: + description: The rules will be returned in order (sorted by Order ascending). + operationId: rules + produces: + - application/json + responses: + "200": + description: An array with all the rules for the local instance. + schema: + items: + $ref: '#/definitions/instanceRule' + type: array + "400": + description: bad request + "401": + description: unauthorized + "404": + description: not found + "406": + description: not acceptable + "500": + description: internal server error + security: + - OAuth2 Bearer: + - admin + summary: View instance rules, with IDs. + tags: + - admin + /api/v1/admin/rules/{id}: + get: + operationId: adminRuleGet + parameters: + - description: The id of the rule. + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: The requested rule. + schema: + $ref: '#/definitions/instanceRule' + "400": + description: bad request + "401": + description: unauthorized + "404": + description: not found + "406": + description: not acceptable + "500": + description: internal server error + security: + - OAuth2 Bearer: + - admin + summary: View instance rule with the given id. + tags: + - admin /api/v1/apps: post: consumes: @@ -4750,6 +5024,30 @@ paths: description: internal server error tags: - instance + /api/v1/instance/rules: + get: + description: The rules will be returned in order (sorted by Order ascending). + operationId: rules + produces: + - application/json + responses: + "200": + description: An array with all the rules for the local instance. + schema: + items: + $ref: '#/definitions/instanceRule' + type: array + "400": + description: bad request + "404": + description: not found + "406": + description: not acceptable + "500": + description: internal server error + summary: View instance rules (public). + tags: + - instance /api/v1/lists: get: operationId: lists @@ -5505,17 +5803,13 @@ paths: name: category type: string x-go-name: Category - - description: |- - IDs of rules on this instance which have been broken according to the reporter. - This is currently not supported, provided only for API compatibility. + - description: IDs of rules on this instance which have been broken according to the reporter. example: - - 1 - - 2 - - 3 + - 01GPBN5YDY6JKBWE44H7YQBDCQ + - 01GPBN65PDWSBPWVDD0SQCFFY3 in: formData items: - format: int64 - type: integer + type: string name: rule_ids type: array x-go-name: RuleIDs |