summaryrefslogtreecommitdiff
path: root/docs/api
diff options
context:
space:
mode:
authorLibravatar Vyr Cossont <VyrCossont@users.noreply.github.com>2024-05-06 04:49:08 -0700
committerLibravatar GitHub <noreply@github.com>2024-05-06 12:49:08 +0100
commit45f4afe60e29e147e3adfaa4d7b66ca58e22b1de (patch)
tree85b14b05516274f504c7237540f8c8fb3b9ae68e /docs/api
parent[chore]: Bump golang.org/x/oauth2 from 0.19.0 to 0.20.0 (#2900) (diff)
downloadgotosocial-45f4afe60e29e147e3adfaa4d7b66ca58e22b1de.tar.xz
feature: filters v2 server-side warning/hiding (#2793)
* Remove dead code * Filter statuses when converting to frontend representation * status.filtered is an array * Make matching case-insensitive * Remove TODOs that don't need to be done now * Add missing filter check for notification * lint: rename ErrHideStatus * APIFilterActionToFilterAction not used yet * swaggerino docseroni * Address review comments * Add apimodel.FilterActionNone --------- Co-authored-by: tobi <31960611+tsmethurst@users.noreply.github.com> Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Diffstat (limited to 'docs/api')
-rw-r--r--docs/api/swagger.yaml116
1 files changed, 116 insertions, 0 deletions
diff --git a/docs/api/swagger.yaml b/docs/api/swagger.yaml
index dda090c52..8bd43ae8e 100644
--- a/docs/api/swagger.yaml
+++ b/docs/api/swagger.yaml
@@ -1,5 +1,9 @@
basePath: /
definitions:
+ FilterAction:
+ title: FilterAction is the action to apply to statuses matching a filter.
+ type: string
+ x-go-package: github.com/superseriousbusiness/gotosocial/internal/api/model
InstanceConfigurationEmojis:
properties:
emoji_size_limit:
@@ -1037,6 +1041,60 @@ definitions:
type: string
x-go-name: FilterContext
x-go-package: github.com/superseriousbusiness/gotosocial/internal/api/model
+ filterKeyword:
+ properties:
+ id:
+ description: The ID of the filter keyword entry in the database.
+ type: string
+ x-go-name: ID
+ keyword:
+ description: The text to be filtered.
+ example: fnord
+ type: string
+ x-go-name: Keyword
+ whole_word:
+ description: Should the filter consider word boundaries?
+ example: true
+ type: boolean
+ x-go-name: WholeWord
+ title: FilterKeyword represents text to filter within a v2 filter.
+ type: object
+ x-go-name: FilterKeyword
+ x-go-package: github.com/superseriousbusiness/gotosocial/internal/api/model
+ filterResult:
+ properties:
+ filter:
+ $ref: '#/definitions/filterV2'
+ keyword_matches:
+ description: The keywords within the filter that were matched.
+ items:
+ type: string
+ type: array
+ x-go-name: KeywordMatches
+ status_matches:
+ description: The status IDs within the filter that were matched.
+ items:
+ type: string
+ type: array
+ x-go-name: StatusMatches
+ title: FilterResult is returned along with a filtered status to explain why it was filtered.
+ type: object
+ x-go-name: FilterResult
+ x-go-package: github.com/superseriousbusiness/gotosocial/internal/api/model
+ filterStatus:
+ properties:
+ id:
+ description: The ID of the filter status entry in the database.
+ type: string
+ x-go-name: ID
+ phrase:
+ description: The status ID to be filtered.
+ type: string
+ x-go-name: StatusID
+ title: FilterStatus represents a single status to filter within a v2 filter.
+ type: object
+ x-go-name: FilterStatus
+ x-go-package: github.com/superseriousbusiness/gotosocial/internal/api/model
filterV1:
description: |-
Note that v1 filters are mapped to v2 filters and v2 filter keywords internally.
@@ -1086,6 +1144,52 @@ definitions:
type: object
x-go-name: FilterV1
x-go-package: github.com/superseriousbusiness/gotosocial/internal/api/model
+ filterV2:
+ description: v2 filters have names and can include multiple phrases and status IDs to filter.
+ properties:
+ context:
+ description: The contexts in which the filter should be applied.
+ example:
+ - home
+ - public
+ items:
+ $ref: '#/definitions/filterContext'
+ minItems: 1
+ type: array
+ uniqueItems: true
+ x-go-name: Context
+ expires_at:
+ description: When the filter should no longer be applied. Null if the filter does not expire.
+ example: "2024-02-01T02:57:49Z"
+ type: string
+ x-go-name: ExpiresAt
+ filter_action:
+ $ref: '#/definitions/FilterAction'
+ id:
+ description: The ID of the filter in the database.
+ type: string
+ x-go-name: ID
+ keywords:
+ description: The keywords grouped under this filter.
+ items:
+ $ref: '#/definitions/filterKeyword'
+ type: array
+ x-go-name: Keywords
+ statuses:
+ description: The statuses grouped under this filter.
+ items:
+ $ref: '#/definitions/filterStatus'
+ type: array
+ x-go-name: Statuses
+ title:
+ description: The name of the filter.
+ example: Linux Words
+ type: string
+ x-go-name: Title
+ title: FilterV2 represents a user-defined filter for determining which statuses should not be shown to the user.
+ type: object
+ x-go-name: FilterV2
+ x-go-package: github.com/superseriousbusiness/gotosocial/internal/api/model
headerFilter:
properties:
created_at:
@@ -2118,6 +2222,12 @@ definitions:
format: int64
type: integer
x-go-name: FavouritesCount
+ filtered:
+ description: A list of filters that matched this status and why they matched, if there are any such filters.
+ items:
+ $ref: '#/definitions/filterResult'
+ type: array
+ x-go-name: Filtered
id:
description: ID of the status.
example: 01FBVD42CQ3ZEEVMW180SBX03B
@@ -2321,6 +2431,12 @@ definitions:
format: int64
type: integer
x-go-name: FavouritesCount
+ filtered:
+ description: A list of filters that matched this status and why they matched, if there are any such filters.
+ items:
+ $ref: '#/definitions/filterResult'
+ type: array
+ x-go-name: Filtered
id:
description: ID of the status.
example: 01FBVD42CQ3ZEEVMW180SBX03B