diff --git a/Makefile b/Makefile index 9e6ac904..f9898503 100644 --- a/Makefile +++ b/Makefile @@ -192,7 +192,7 @@ do-the-swag: @hash swag > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ go install $(GOFLAGS) github.com/swaggo/swag/cmd/swag; \ fi - swag init -g pkg/routes/routes.go -o ./pkg/swagger; + swag init -g pkg/routes/routes.go --parseDependency -o ./pkg/swagger; # Fix the generated swagger file, currently a workaround until swaggo can properly use go mod sed -i '/"definitions": {/a "code.vikunja.io.web.HTTPError": {"type": "object","properties": {"code": {"type": "integer"},"message": {"type": "string"}}},' pkg/swagger/docs.go; sed -i 's/code.vikunja.io\/web.HTTPError/code.vikunja.io.web.HTTPError/g' pkg/swagger/docs.go; diff --git a/pkg/models/bulk_task.go b/pkg/models/bulk_task.go index cb052751..ff7b0a78 100644 --- a/pkg/models/bulk_task.go +++ b/pkg/models/bulk_task.go @@ -73,8 +73,8 @@ func (bt *BulkTask) CanUpdate(a web.Auth) (bool, error) { // @Security JWTKeyAuth // @Param task body models.BulkTask true "The task object. Looks like a normal task, the only difference is it uses an array of list_ids to update." // @Success 200 {object} models.Task "The updated task object." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid task object provided." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the task (aka its list)" +// @Failure 400 {object} web.HTTPError "Invalid task object provided." +// @Failure 403 {object} web.HTTPError "The user does not have access to the task (aka its list)" // @Failure 500 {object} models.Message "Internal error" // @Router /tasks/bulk [post] func (bt *BulkTask) Update() (err error) { diff --git a/pkg/models/kanban.go b/pkg/models/kanban.go index fee49037..aaaecda3 100644 --- a/pkg/models/kanban.go +++ b/pkg/models/kanban.go @@ -154,8 +154,8 @@ func (b *Bucket) ReadAll(auth web.Auth, search string, page int, perPage int) (r // @Param id path int true "List Id" // @Param bucket body models.Bucket true "The bucket object" // @Success 200 {object} models.Bucket "The created bucket object." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid bucket object provided." -// @Failure 404 {object} code.vikunja.io/web.HTTPError "The list does not exist." +// @Failure 400 {object} web.HTTPError "Invalid bucket object provided." +// @Failure 404 {object} web.HTTPError "The list does not exist." // @Failure 500 {object} models.Message "Internal error" // @Router /lists/{id}/buckets [put] func (b *Bucket) Create(a web.Auth) (err error) { @@ -176,8 +176,8 @@ func (b *Bucket) Create(a web.Auth) (err error) { // @Param bucketID path int true "Bucket Id" // @Param bucket body models.Bucket true "The bucket object" // @Success 200 {object} models.Bucket "The created bucket object." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid bucket object provided." -// @Failure 404 {object} code.vikunja.io/web.HTTPError "The bucket does not exist." +// @Failure 400 {object} web.HTTPError "Invalid bucket object provided." +// @Failure 404 {object} web.HTTPError "The bucket does not exist." // @Failure 500 {object} models.Message "Internal error" // @Router /lists/{listID}/buckets/{bucketID} [post] func (b *Bucket) Update() (err error) { @@ -195,7 +195,7 @@ func (b *Bucket) Update() (err error) { // @Param listID path int true "List Id" // @Param bucketID path int true "Bucket Id" // @Success 200 {object} models.Message "Successfully deleted." -// @Failure 404 {object} code.vikunja.io/web.HTTPError "The bucket does not exist." +// @Failure 404 {object} web.HTTPError "The bucket does not exist." // @Failure 500 {object} models.Message "Internal error" // @Router /lists/{listID}/buckets/{bucketID} [delete] func (b *Bucket) Delete() (err error) { diff --git a/pkg/models/label.go b/pkg/models/label.go index 4799619a..9a23f768 100644 --- a/pkg/models/label.go +++ b/pkg/models/label.go @@ -60,7 +60,7 @@ func (Label) TableName() string { // @Security JWTKeyAuth // @Param label body models.Label true "The label object" // @Success 200 {object} models.Label "The created label object." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid label object provided." +// @Failure 400 {object} web.HTTPError "Invalid label object provided." // @Failure 500 {object} models.Message "Internal error" // @Router /labels [put] func (l *Label) Create(a web.Auth) (err error) { @@ -86,9 +86,9 @@ func (l *Label) Create(a web.Auth) (err error) { // @Param id path int true "Label ID" // @Param label body models.Label true "The label object" // @Success 200 {object} models.Label "The created label object." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid label object provided." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "Not allowed to update the label." -// @Failure 404 {object} code.vikunja.io/web.HTTPError "Label not found." +// @Failure 400 {object} web.HTTPError "Invalid label object provided." +// @Failure 403 {object} web.HTTPError "Not allowed to update the label." +// @Failure 404 {object} web.HTTPError "Label not found." // @Failure 500 {object} models.Message "Internal error" // @Router /labels/{id} [put] func (l *Label) Update() (err error) { @@ -117,8 +117,8 @@ func (l *Label) Update() (err error) { // @Security JWTKeyAuth // @Param id path int true "Label ID" // @Success 200 {object} models.Label "The label was successfully deleted." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "Not allowed to delete the label." -// @Failure 404 {object} code.vikunja.io/web.HTTPError "Label not found." +// @Failure 403 {object} web.HTTPError "Not allowed to delete the label." +// @Failure 404 {object} web.HTTPError "Label not found." // @Failure 500 {object} models.Message "Internal error" // @Router /labels/{id} [delete] func (l *Label) Delete() (err error) { @@ -172,8 +172,8 @@ func (l *Label) ReadAll(a web.Auth, search string, page int, perPage int) (ls in // @Param id path int true "Label ID" // @Security JWTKeyAuth // @Success 200 {object} models.Label "The label" -// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the label" -// @Failure 404 {object} code.vikunja.io/web.HTTPError "Label not found" +// @Failure 403 {object} web.HTTPError "The user does not have access to the label" +// @Failure 404 {object} web.HTTPError "Label not found" // @Failure 500 {object} models.Message "Internal error" // @Router /labels/{id} [get] func (l *Label) ReadOne() (err error) { diff --git a/pkg/models/label_task.go b/pkg/models/label_task.go index 4f8a333c..60f26061 100644 --- a/pkg/models/label_task.go +++ b/pkg/models/label_task.go @@ -52,8 +52,8 @@ func (LabelTask) TableName() string { // @Param task path int true "Task ID" // @Param label path int true "Label ID" // @Success 200 {object} models.Message "The label was successfully removed." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "Not allowed to remove the label." -// @Failure 404 {object} code.vikunja.io/web.HTTPError "Label not found." +// @Failure 403 {object} web.HTTPError "Not allowed to remove the label." +// @Failure 404 {object} web.HTTPError "Label not found." // @Failure 500 {object} models.Message "Internal error" // @Router /tasks/{task}/labels/{label} [delete] func (lt *LabelTask) Delete() (err error) { @@ -71,9 +71,9 @@ func (lt *LabelTask) Delete() (err error) { // @Param task path int true "Task ID" // @Param label body models.LabelTask true "The label object" // @Success 200 {object} models.LabelTask "The created label relation object." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid label object provided." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "Not allowed to add the label." -// @Failure 404 {object} code.vikunja.io/web.HTTPError "The label does not exist." +// @Failure 400 {object} web.HTTPError "Invalid label object provided." +// @Failure 403 {object} web.HTTPError "Not allowed to add the label." +// @Failure 404 {object} web.HTTPError "The label does not exist." // @Failure 500 {object} models.Message "Internal error" // @Router /tasks/{task}/labels [put] func (lt *LabelTask) Create(a web.Auth) (err error) { @@ -332,7 +332,7 @@ type LabelTaskBulk struct { // @Param label body models.LabelTaskBulk true "The array of labels" // @Param taskID path int true "Task ID" // @Success 200 {object} models.LabelTaskBulk "The updated labels object." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid label object provided." +// @Failure 400 {object} web.HTTPError "Invalid label object provided." // @Failure 500 {object} models.Message "Internal error" // @Router /tasks/{taskID}/labels/bulk [post] func (ltb *LabelTaskBulk) Create(a web.Auth) (err error) { diff --git a/pkg/models/link_sharing.go b/pkg/models/link_sharing.go index d17d7e76..e0a59cd2 100644 --- a/pkg/models/link_sharing.go +++ b/pkg/models/link_sharing.go @@ -93,9 +93,9 @@ func GetLinkShareFromClaims(claims jwt.MapClaims) (share *LinkSharing, err error // @Param list path int true "List ID" // @Param label body models.LinkSharing true "The new link share object" // @Success 200 {object} models.LinkSharing "The created link share object." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid link share object provided." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "Not allowed to add the list share." -// @Failure 404 {object} code.vikunja.io/web.HTTPError "The list does not exist." +// @Failure 400 {object} web.HTTPError "Invalid link share object provided." +// @Failure 403 {object} web.HTTPError "Not allowed to add the list share." +// @Failure 404 {object} web.HTTPError "The list does not exist." // @Failure 500 {object} models.Message "Internal error" // @Router /lists/{list}/shares [put] func (share *LinkSharing) Create(a web.Auth) (err error) { @@ -122,8 +122,8 @@ func (share *LinkSharing) Create(a web.Auth) (err error) { // @Param share path int true "Share ID" // @Security JWTKeyAuth // @Success 200 {object} models.LinkSharing "The share links" -// @Failure 403 {object} code.vikunja.io/web.HTTPError "No access to the list" -// @Failure 404 {object} code.vikunja.io/web.HTTPError "Share Link not found." +// @Failure 403 {object} web.HTTPError "No access to the list" +// @Failure 404 {object} web.HTTPError "Share Link not found." // @Failure 500 {object} models.Message "Internal error" // @Router /lists/{list}/shares/{share} [get] func (share *LinkSharing) ReadOne() (err error) { @@ -211,8 +211,8 @@ func (share *LinkSharing) ReadAll(a web.Auth, search string, page int, perPage i // @Param list path int true "List ID" // @Param share path int true "Share Link ID" // @Success 200 {object} models.Message "The link was successfully removed." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "Not allowed to remove the link." -// @Failure 404 {object} code.vikunja.io/web.HTTPError "Share Link not found." +// @Failure 403 {object} web.HTTPError "Not allowed to remove the link." +// @Failure 404 {object} web.HTTPError "Share Link not found." // @Failure 500 {object} models.Message "Internal error" // @Router /lists/{list}/shares/{share} [delete] func (share *LinkSharing) Delete() (err error) { diff --git a/pkg/models/list.go b/pkg/models/list.go index 0fbc33d3..e5c3ddd5 100644 --- a/pkg/models/list.go +++ b/pkg/models/list.go @@ -119,7 +119,7 @@ func GetListsByNamespaceID(nID int64, doer *user.User) (lists []*List, err error // @Param is_archived query bool false "If true, also returns all archived lists." // @Security JWTKeyAuth // @Success 200 {array} models.List "The lists" -// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the list" +// @Failure 403 {object} web.HTTPError "The user does not have access to the list" // @Failure 500 {object} models.Message "Internal error" // @Router /lists [get] func (l *List) ReadAll(a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, totalItems int64, err error) { @@ -161,7 +161,7 @@ func (l *List) ReadAll(a web.Auth, search string, page int, perPage int) (result // @Security JWTKeyAuth // @Param id path int true "List ID" // @Success 200 {object} models.List "The list" -// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the list" +// @Failure 403 {object} web.HTTPError "The user does not have access to the list" // @Failure 500 {object} models.Message "Internal error" // @Router /lists/{id} [get] func (l *List) ReadOne() (err error) { @@ -512,8 +512,8 @@ func CreateOrUpdateList(list *List) (err error) { // @Param id path int true "List ID" // @Param list body models.List true "The list with updated values you want to update." // @Success 200 {object} models.List "The updated list." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid list object provided." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the list" +// @Failure 400 {object} web.HTTPError "Invalid list object provided." +// @Failure 403 {object} web.HTTPError "The user does not have access to the list" // @Failure 500 {object} models.Message "Internal error" // @Router /lists/{id} [post] func (l *List) Update() (err error) { @@ -545,8 +545,8 @@ func updateListByTaskID(taskID int64) (err error) { // @Param namespaceID path int true "Namespace ID" // @Param list body models.List true "The list you want to create." // @Success 200 {object} models.List "The created list." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid list object provided." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the list" +// @Failure 400 {object} web.HTTPError "Invalid list object provided." +// @Failure 403 {object} web.HTTPError "The user does not have access to the list" // @Failure 500 {object} models.Message "Internal error" // @Router /namespaces/{namespaceID}/lists [put] func (l *List) Create(a web.Auth) (err error) { @@ -585,8 +585,8 @@ func (l *List) Create(a web.Auth) (err error) { // @Security JWTKeyAuth // @Param id path int true "List ID" // @Success 200 {object} models.Message "The list was successfully deleted." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid list object provided." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the list" +// @Failure 400 {object} web.HTTPError "Invalid list object provided." +// @Failure 403 {object} web.HTTPError "The user does not have access to the list" // @Failure 500 {object} models.Message "Internal error" // @Router /lists/{id} [delete] func (l *List) Delete() (err error) { diff --git a/pkg/models/list_team.go b/pkg/models/list_team.go index af98f735..81d0c259 100644 --- a/pkg/models/list_team.go +++ b/pkg/models/list_team.go @@ -62,9 +62,9 @@ type TeamWithRight struct { // @Param id path int true "List ID" // @Param list body models.TeamList true "The team you want to add to the list." // @Success 200 {object} models.TeamList "The created team<->list relation." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid team list object provided." -// @Failure 404 {object} code.vikunja.io/web.HTTPError "The team does not exist." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the list" +// @Failure 400 {object} web.HTTPError "Invalid team list object provided." +// @Failure 404 {object} web.HTTPError "The team does not exist." +// @Failure 403 {object} web.HTTPError "The user does not have access to the list" // @Failure 500 {object} models.Message "Internal error" // @Router /lists/{id}/teams [put] func (tl *TeamList) Create(a web.Auth) (err error) { @@ -116,8 +116,8 @@ func (tl *TeamList) Create(a web.Auth) (err error) { // @Param listID path int true "List ID" // @Param teamID path int true "Team ID" // @Success 200 {object} models.Message "The team was successfully deleted." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the list" -// @Failure 404 {object} code.vikunja.io/web.HTTPError "Team or list does not exist." +// @Failure 403 {object} web.HTTPError "The user does not have access to the list" +// @Failure 404 {object} web.HTTPError "Team or list does not exist." // @Failure 500 {object} models.Message "Internal error" // @Router /lists/{listID}/teams/{teamID} [delete] func (tl *TeamList) Delete() (err error) { @@ -162,7 +162,7 @@ func (tl *TeamList) Delete() (err error) { // @Param s query string false "Search teams by its name." // @Security JWTKeyAuth // @Success 200 {array} models.TeamWithRight "The teams with their right." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "No right to see the list." +// @Failure 403 {object} web.HTTPError "No right to see the list." // @Failure 500 {object} models.Message "Internal error" // @Router /lists/{id}/teams [get] func (tl *TeamList) ReadAll(a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, totalItems int64, err error) { @@ -227,8 +227,8 @@ func (tl *TeamList) ReadAll(a web.Auth, search string, page int, perPage int) (r // @Param list body models.TeamList true "The team you want to update." // @Security JWTKeyAuth // @Success 200 {object} models.TeamList "The updated team <-> list relation." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have admin-access to the list" -// @Failure 404 {object} code.vikunja.io/web.HTTPError "Team or list does not exist." +// @Failure 403 {object} web.HTTPError "The user does not have admin-access to the list" +// @Failure 404 {object} web.HTTPError "Team or list does not exist." // @Failure 500 {object} models.Message "Internal error" // @Router /lists/{listID}/teams/{teamID} [post] func (tl *TeamList) Update() (err error) { diff --git a/pkg/models/list_users.go b/pkg/models/list_users.go index ef43951c..89bd542e 100644 --- a/pkg/models/list_users.go +++ b/pkg/models/list_users.go @@ -65,9 +65,9 @@ type UserWithRight struct { // @Param id path int true "List ID" // @Param list body models.ListUser true "The user you want to add to the list." // @Success 200 {object} models.ListUser "The created user<->list relation." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid user list object provided." -// @Failure 404 {object} code.vikunja.io/web.HTTPError "The user does not exist." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the list" +// @Failure 400 {object} web.HTTPError "Invalid user list object provided." +// @Failure 404 {object} web.HTTPError "The user does not exist." +// @Failure 403 {object} web.HTTPError "The user does not have access to the list" // @Failure 500 {object} models.Message "Internal error" // @Router /lists/{id}/users [put] func (lu *ListUser) Create(a web.Auth) (err error) { @@ -123,8 +123,8 @@ func (lu *ListUser) Create(a web.Auth) (err error) { // @Param listID path int true "List ID" // @Param userID path int true "User ID" // @Success 200 {object} models.Message "The user was successfully removed from the list." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the list" -// @Failure 404 {object} code.vikunja.io/web.HTTPError "user or list does not exist." +// @Failure 403 {object} web.HTTPError "The user does not have access to the list" +// @Failure 404 {object} web.HTTPError "user or list does not exist." // @Failure 500 {object} models.Message "Internal error" // @Router /lists/{listID}/users/{userID} [delete] func (lu *ListUser) Delete() (err error) { @@ -168,7 +168,7 @@ func (lu *ListUser) Delete() (err error) { // @Param s query string false "Search users by its name." // @Security JWTKeyAuth // @Success 200 {array} models.UserWithRight "The users with the right they have." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "No right to see the list." +// @Failure 403 {object} web.HTTPError "No right to see the list." // @Failure 500 {object} models.Message "Internal error" // @Router /lists/{id}/users [get] func (lu *ListUser) ReadAll(a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, numberOfTotalItems int64, err error) { @@ -223,8 +223,8 @@ func (lu *ListUser) ReadAll(a web.Auth, search string, page int, perPage int) (r // @Param list body models.ListUser true "The user you want to update." // @Security JWTKeyAuth // @Success 200 {object} models.ListUser "The updated user <-> list relation." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have admin-access to the list" -// @Failure 404 {object} code.vikunja.io/web.HTTPError "User or list does not exist." +// @Failure 403 {object} web.HTTPError "The user does not have admin-access to the list" +// @Failure 404 {object} web.HTTPError "User or list does not exist." // @Failure 500 {object} models.Message "Internal error" // @Router /lists/{listID}/users/{userID} [post] func (lu *ListUser) Update() (err error) { diff --git a/pkg/models/namespace.go b/pkg/models/namespace.go index ba4604e5..1d3a2a74 100644 --- a/pkg/models/namespace.go +++ b/pkg/models/namespace.go @@ -132,7 +132,7 @@ func (n *Namespace) CheckIsArchived() error { // @Security JWTKeyAuth // @Param id path int true "Namespace ID" // @Success 200 {object} models.Namespace "The Namespace" -// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to that namespace." +// @Failure 403 {object} web.HTTPError "The user does not have access to that namespace." // @Failure 500 {object} models.Message "Internal error" // @Router /namespaces/{id} [get] func (n *Namespace) ReadOne() (err error) { @@ -318,8 +318,8 @@ func (n *Namespace) ReadAll(a web.Auth, search string, page int, perPage int) (r // @Security JWTKeyAuth // @Param namespace body models.Namespace true "The namespace you want to create." // @Success 200 {object} models.Namespace "The created namespace." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid namespace object provided." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the namespace" +// @Failure 400 {object} web.HTTPError "Invalid namespace object provided." +// @Failure 403 {object} web.HTTPError "The user does not have access to the namespace" // @Failure 500 {object} models.Message "Internal error" // @Router /namespaces [put] func (n *Namespace) Create(a web.Auth) (err error) { @@ -353,8 +353,8 @@ func (n *Namespace) Create(a web.Auth) (err error) { // @Security JWTKeyAuth // @Param id path int true "Namespace ID" // @Success 200 {object} models.Message "The namespace was successfully deleted." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid namespace object provided." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the namespace" +// @Failure 400 {object} web.HTTPError "Invalid namespace object provided." +// @Failure 403 {object} web.HTTPError "The user does not have access to the namespace" // @Failure 500 {object} models.Message "Internal error" // @Router /namespaces/{id} [delete] func (n *Namespace) Delete() (err error) { @@ -411,8 +411,8 @@ func (n *Namespace) Delete() (err error) { // @Param id path int true "Namespace ID" // @Param namespace body models.Namespace true "The namespace with updated values you want to update." // @Success 200 {object} models.Namespace "The updated namespace." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid namespace object provided." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the namespace" +// @Failure 400 {object} web.HTTPError "Invalid namespace object provided." +// @Failure 403 {object} web.HTTPError "The user does not have access to the namespace" // @Failure 500 {object} models.Message "Internal error" // @Router /namespace/{id} [post] func (n *Namespace) Update() (err error) { diff --git a/pkg/models/namespace_team.go b/pkg/models/namespace_team.go index 70f5af8e..fe14b4ce 100644 --- a/pkg/models/namespace_team.go +++ b/pkg/models/namespace_team.go @@ -56,9 +56,9 @@ func (TeamNamespace) TableName() string { // @Param id path int true "Namespace ID" // @Param namespace body models.TeamNamespace true "The team you want to add to the namespace." // @Success 200 {object} models.TeamNamespace "The created team<->namespace relation." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid team namespace object provided." -// @Failure 404 {object} code.vikunja.io/web.HTTPError "The team does not exist." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "The team does not have access to the namespace" +// @Failure 400 {object} web.HTTPError "Invalid team namespace object provided." +// @Failure 404 {object} web.HTTPError "The team does not exist." +// @Failure 403 {object} web.HTTPError "The team does not have access to the namespace" // @Failure 500 {object} models.Message "Internal error" // @Router /namespaces/{id}/teams [put] func (tn *TeamNamespace) Create(a web.Auth) (err error) { @@ -105,8 +105,8 @@ func (tn *TeamNamespace) Create(a web.Auth) (err error) { // @Param namespaceID path int true "Namespace ID" // @Param teamID path int true "team ID" // @Success 200 {object} models.Message "The team was successfully deleted." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "The team does not have access to the namespace" -// @Failure 404 {object} code.vikunja.io/web.HTTPError "team or namespace does not exist." +// @Failure 403 {object} web.HTTPError "The team does not have access to the namespace" +// @Failure 404 {object} web.HTTPError "team or namespace does not exist." // @Failure 500 {object} models.Message "Internal error" // @Router /namespaces/{namespaceID}/teams/{teamID} [delete] func (tn *TeamNamespace) Delete() (err error) { @@ -147,7 +147,7 @@ func (tn *TeamNamespace) Delete() (err error) { // @Param s query string false "Search teams by its name." // @Security JWTKeyAuth // @Success 200 {array} models.TeamWithRight "The teams with the right they have." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "No right to see the namespace." +// @Failure 403 {object} web.HTTPError "No right to see the namespace." // @Failure 500 {object} models.Message "Internal error" // @Router /namespaces/{id}/teams [get] func (tn *TeamNamespace) ReadAll(a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, numberOfTotalItems int64, err error) { @@ -208,8 +208,8 @@ func (tn *TeamNamespace) ReadAll(a web.Auth, search string, page int, perPage in // @Param namespace body models.TeamNamespace true "The team you want to update." // @Security JWTKeyAuth // @Success 200 {object} models.TeamNamespace "The updated team <-> namespace relation." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "The team does not have admin-access to the namespace" -// @Failure 404 {object} code.vikunja.io/web.HTTPError "Team or namespace does not exist." +// @Failure 403 {object} web.HTTPError "The team does not have admin-access to the namespace" +// @Failure 404 {object} web.HTTPError "Team or namespace does not exist." // @Failure 500 {object} models.Message "Internal error" // @Router /namespaces/{namespaceID}/teams/{teamID} [post] func (tn *TeamNamespace) Update() (err error) { diff --git a/pkg/models/namespace_users.go b/pkg/models/namespace_users.go index 7d787a4d..115bc81d 100644 --- a/pkg/models/namespace_users.go +++ b/pkg/models/namespace_users.go @@ -58,9 +58,9 @@ func (NamespaceUser) TableName() string { // @Param id path int true "Namespace ID" // @Param namespace body models.NamespaceUser true "The user you want to add to the namespace." // @Success 200 {object} models.NamespaceUser "The created user<->namespace relation." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid user namespace object provided." -// @Failure 404 {object} code.vikunja.io/web.HTTPError "The user does not exist." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the namespace" +// @Failure 400 {object} web.HTTPError "Invalid user namespace object provided." +// @Failure 404 {object} web.HTTPError "The user does not exist." +// @Failure 403 {object} web.HTTPError "The user does not have access to the namespace" // @Failure 500 {object} models.Message "Internal error" // @Router /namespaces/{id}/users [put] func (nu *NamespaceUser) Create(a web.Auth) (err error) { @@ -114,8 +114,8 @@ func (nu *NamespaceUser) Create(a web.Auth) (err error) { // @Param namespaceID path int true "Namespace ID" // @Param userID path int true "user ID" // @Success 200 {object} models.Message "The user was successfully deleted." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the namespace" -// @Failure 404 {object} code.vikunja.io/web.HTTPError "user or namespace does not exist." +// @Failure 403 {object} web.HTTPError "The user does not have access to the namespace" +// @Failure 404 {object} web.HTTPError "user or namespace does not exist." // @Failure 500 {object} models.Message "Internal error" // @Router /namespaces/{namespaceID}/users/{userID} [delete] func (nu *NamespaceUser) Delete() (err error) { @@ -154,7 +154,7 @@ func (nu *NamespaceUser) Delete() (err error) { // @Param s query string false "Search users by its name." // @Security JWTKeyAuth // @Success 200 {array} models.UserWithRight "The users with the right they have." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "No right to see the namespace." +// @Failure 403 {object} web.HTTPError "No right to see the namespace." // @Failure 500 {object} models.Message "Internal error" // @Router /namespaces/{id}/users [get] func (nu *NamespaceUser) ReadAll(a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, numberOfTotalItems int64, err error) { @@ -210,8 +210,8 @@ func (nu *NamespaceUser) ReadAll(a web.Auth, search string, page int, perPage in // @Param namespace body models.NamespaceUser true "The user you want to update." // @Security JWTKeyAuth // @Success 200 {object} models.NamespaceUser "The updated user <-> namespace relation." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have admin-access to the namespace" -// @Failure 404 {object} code.vikunja.io/web.HTTPError "User or namespace does not exist." +// @Failure 403 {object} web.HTTPError "The user does not have admin-access to the namespace" +// @Failure 404 {object} web.HTTPError "User or namespace does not exist." // @Failure 500 {object} models.Message "Internal error" // @Router /namespaces/{namespaceID}/users/{userID} [post] func (nu *NamespaceUser) Update() (err error) { diff --git a/pkg/models/task_assignees.go b/pkg/models/task_assignees.go index 11daefa0..4853a336 100644 --- a/pkg/models/task_assignees.go +++ b/pkg/models/task_assignees.go @@ -162,7 +162,7 @@ func (t *Task) setTaskAssignees(assignees []*user.User) { // @Param taskID path int true "Task ID" // @Param userID path int true "Assignee user ID" // @Success 200 {object} models.Message "The assignee was successfully deleted." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "Not allowed to delete the assignee." +// @Failure 403 {object} web.HTTPError "Not allowed to delete the assignee." // @Failure 500 {object} models.Message "Internal error" // @Router /tasks/{taskID}/assignees/{userID} [delete] func (la *TaskAssginee) Delete() (err error) { @@ -185,7 +185,7 @@ func (la *TaskAssginee) Delete() (err error) { // @Param assignee body models.TaskAssginee true "The assingee object" // @Param taskID path int true "Task ID" // @Success 200 {object} models.TaskAssginee "The created assingee object." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid assignee object provided." +// @Failure 400 {object} web.HTTPError "Invalid assignee object provided." // @Failure 500 {object} models.Message "Internal error" // @Router /tasks/{taskID}/assignees [put] func (la *TaskAssginee) Create(a web.Auth) (err error) { @@ -296,7 +296,7 @@ type BulkAssignees struct { // @Param assignee body models.BulkAssignees true "The array of assignees" // @Param taskID path int true "Task ID" // @Success 200 {object} models.TaskAssginee "The created assingees object." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid assignee object provided." +// @Failure 400 {object} web.HTTPError "Invalid assignee object provided." // @Failure 500 {object} models.Message "Internal error" // @Router /tasks/{taskID}/assignees/bulk [post] func (ba *BulkAssignees) Create(a web.Auth) (err error) { diff --git a/pkg/models/task_comments.go b/pkg/models/task_comments.go index 81da0d53..98658dc4 100644 --- a/pkg/models/task_comments.go +++ b/pkg/models/task_comments.go @@ -53,7 +53,7 @@ func (tc *TaskComment) TableName() string { // @Param relation body models.TaskComment true "The task comment object" // @Param taskID path int true "Task ID" // @Success 200 {object} models.TaskComment "The created task comment object." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid task comment object provided." +// @Failure 400 {object} web.HTTPError "Invalid task comment object provided." // @Failure 500 {object} models.Message "Internal error" // @Router /tasks/{taskID}/comments [put] func (tc *TaskComment) Create(a web.Auth) (err error) { @@ -82,8 +82,8 @@ func (tc *TaskComment) Create(a web.Auth) (err error) { // @Param taskID path int true "Task ID" // @Param commentID path int true "Comment ID" // @Success 200 {object} models.Message "The task comment was successfully deleted." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid task comment object provided." -// @Failure 404 {object} code.vikunja.io/web.HTTPError "The task comment was not found." +// @Failure 400 {object} web.HTTPError "Invalid task comment object provided." +// @Failure 404 {object} web.HTTPError "The task comment was not found." // @Failure 500 {object} models.Message "Internal error" // @Router /tasks/{taskID}/comments/{commentID} [delete] func (tc *TaskComment) Delete() error { @@ -104,8 +104,8 @@ func (tc *TaskComment) Delete() error { // @Param taskID path int true "Task ID" // @Param commentID path int true "Comment ID" // @Success 200 {object} models.TaskComment "The updated task comment object." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid task comment object provided." -// @Failure 404 {object} code.vikunja.io/web.HTTPError "The task comment was not found." +// @Failure 400 {object} web.HTTPError "Invalid task comment object provided." +// @Failure 404 {object} web.HTTPError "The task comment was not found." // @Failure 500 {object} models.Message "Internal error" // @Router /tasks/{taskID}/comments/{commentID} [post] func (tc *TaskComment) Update() error { @@ -126,8 +126,8 @@ func (tc *TaskComment) Update() error { // @Param taskID path int true "Task ID" // @Param commentID path int true "Comment ID" // @Success 200 {object} models.TaskComment "The task comment object." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid task comment object provided." -// @Failure 404 {object} code.vikunja.io/web.HTTPError "The task comment was not found." +// @Failure 400 {object} web.HTTPError "Invalid task comment object provided." +// @Failure 404 {object} web.HTTPError "The task comment was not found." // @Failure 500 {object} models.Message "Internal error" // @Router /tasks/{taskID}/comments/{commentID} [get] func (tc *TaskComment) ReadOne() (err error) { diff --git a/pkg/models/task_relation.go b/pkg/models/task_relation.go index f894d6cd..640e8567 100644 --- a/pkg/models/task_relation.go +++ b/pkg/models/task_relation.go @@ -113,7 +113,7 @@ type RelatedTaskMap map[RelationKind][]*Task // @Param relation body models.TaskRelation true "The relation object" // @Param taskID path int true "Task ID" // @Success 200 {object} models.TaskRelation "The created task relation object." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid task relation object provided." +// @Failure 400 {object} web.HTTPError "Invalid task relation object provided." // @Failure 500 {object} models.Message "Internal error" // @Router /tasks/{taskID}/relations [put] func (rel *TaskRelation) Create(a web.Auth) error { @@ -193,8 +193,8 @@ func (rel *TaskRelation) Create(a web.Auth) error { // @Param relation body models.TaskRelation true "The relation object" // @Param taskID path int true "Task ID" // @Success 200 {object} models.Message "The task relation was successfully deleted." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid task relation object provided." -// @Failure 404 {object} code.vikunja.io/web.HTTPError "The task relation was not found." +// @Failure 400 {object} web.HTTPError "Invalid task relation object provided." +// @Failure 404 {object} web.HTTPError "The task relation was not found." // @Failure 500 {object} models.Message "Internal error" // @Router /tasks/{taskID}/relations [delete] func (rel *TaskRelation) Delete() error { diff --git a/pkg/models/tasks.go b/pkg/models/tasks.go index 48848312..d63e53a5 100644 --- a/pkg/models/tasks.go +++ b/pkg/models/tasks.go @@ -569,8 +569,8 @@ func checkBucketAndTaskBelongToSameList(fullTask *Task, bucketID int64) (err err // @Param id path int true "List ID" // @Param task body models.Task true "The task object" // @Success 200 {object} models.Task "The created task object." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid task object provided." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the list" +// @Failure 400 {object} web.HTTPError "Invalid task object provided." +// @Failure 403 {object} web.HTTPError "The user does not have access to the list" // @Failure 500 {object} models.Message "Internal error" // @Router /lists/{id} [put] func (t *Task) Create(a web.Auth) (err error) { @@ -662,8 +662,8 @@ func (t *Task) Create(a web.Auth) (err error) { // @Param id path int true "Task ID" // @Param task body models.Task true "The task object" // @Success 200 {object} models.Task "The updated task object." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid task object provided." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the task (aka its list)" +// @Failure 400 {object} web.HTTPError "Invalid task object provided." +// @Failure 403 {object} web.HTTPError "The user does not have access to the task (aka its list)" // @Failure 500 {object} models.Message "Internal error" // @Router /tasks/{id} [post] func (t *Task) Update() (err error) { @@ -1000,8 +1000,8 @@ func (t *Task) updateReminders(reminders []time.Time) (err error) { // @Security JWTKeyAuth // @Param id path int true "Task ID" // @Success 200 {object} models.Message "The created task object." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid task ID provided." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the list" +// @Failure 400 {object} web.HTTPError "Invalid task ID provided." +// @Failure 403 {object} web.HTTPError "The user does not have access to the list" // @Failure 500 {object} models.Message "Internal error" // @Router /tasks/{id} [delete] func (t *Task) Delete() (err error) { diff --git a/pkg/models/team_members.go b/pkg/models/team_members.go index e976348c..62dc133c 100644 --- a/pkg/models/team_members.go +++ b/pkg/models/team_members.go @@ -31,8 +31,8 @@ import ( // @Param id path int true "Team ID" // @Param team body models.TeamMember true "The user to be added to a team." // @Success 200 {object} models.TeamMember "The newly created member object" -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid member object provided." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the team" +// @Failure 400 {object} web.HTTPError "Invalid member object provided." +// @Failure 403 {object} web.HTTPError "The user does not have access to the team" // @Failure 500 {object} models.Message "Internal error" // @Router /teams/{id}/members [put] func (tm *TeamMember) Create(a web.Auth) (err error) { diff --git a/pkg/models/teams.go b/pkg/models/teams.go index df052dc6..781f14ba 100644 --- a/pkg/models/teams.go +++ b/pkg/models/teams.go @@ -174,7 +174,7 @@ func addMoreInfoToTeams(teams []*Team) (err error) { // @Security JWTKeyAuth // @Param id path int true "Team ID" // @Success 200 {object} models.Team "The team" -// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the team" +// @Failure 403 {object} web.HTTPError "The user does not have access to the team" // @Failure 500 {object} models.Message "Internal error" // @Router /teams/{id} [get] func (t *Team) ReadOne() (err error) { @@ -242,7 +242,7 @@ func (t *Team) ReadAll(a web.Auth, search string, page int, perPage int) (result // @Security JWTKeyAuth // @Param team body models.Team true "The team you want to create." // @Success 200 {object} models.Team "The created team." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid team object provided." +// @Failure 400 {object} web.HTTPError "Invalid team object provided." // @Failure 500 {object} models.Message "Internal error" // @Router /teams [put] func (t *Team) Create(a web.Auth) (err error) { @@ -282,7 +282,7 @@ func (t *Team) Create(a web.Auth) (err error) { // @Security JWTKeyAuth // @Param id path int true "Team ID" // @Success 200 {object} models.Message "The team was successfully deleted." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid team object provided." +// @Failure 400 {object} web.HTTPError "Invalid team object provided." // @Failure 500 {object} models.Message "Internal error" // @Router /teams/{id} [delete] func (t *Team) Delete() (err error) { @@ -325,7 +325,7 @@ func (t *Team) Delete() (err error) { // @Param id path int true "Team ID" // @Param team body models.Team true "The team with updated values you want to update." // @Success 200 {object} models.Team "The updated team." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid team object provided." +// @Failure 400 {object} web.HTTPError "Invalid team object provided." // @Failure 500 {object} models.Message "Internal error" // @Router /teams/{id} [post] func (t *Team) Update() (err error) { diff --git a/pkg/modules/background/unsplash/unsplash.go b/pkg/modules/background/unsplash/unsplash.go index 73e9d546..f2c6db42 100644 --- a/pkg/modules/background/unsplash/unsplash.go +++ b/pkg/modules/background/unsplash/unsplash.go @@ -229,8 +229,8 @@ func (p *Provider) Search(search string, page int64) (result []*background.Image // @Param id path int true "List ID" // @Param list body background.Image true "The image you want to set as background" // @Success 200 {object} models.List "The background has been successfully set." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid image object provided." -// @Failure 403 {object} code.vikunja.io/web.HTTPError "The user does not have access to the list" +// @Failure 400 {object} web.HTTPError "Invalid image object provided." +// @Failure 403 {object} web.HTTPError "The user does not have access to the list" // @Failure 500 {object} models.Message "Internal error" // @Router /lists/{id}/backgrounds/unsplash [post] func (p *Provider) Set(image *background.Image, list *models.List, auth web.Auth) (err error) { diff --git a/pkg/routes/api/v1/link_sharing_auth.go b/pkg/routes/api/v1/link_sharing_auth.go index 161999ed..914b3ceb 100644 --- a/pkg/routes/api/v1/link_sharing_auth.go +++ b/pkg/routes/api/v1/link_sharing_auth.go @@ -38,7 +38,7 @@ type LinkShareToken struct { // @Produce json // @Param share path string true "The share hash" // @Success 200 {object} v1.Token "The valid jwt auth token." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Invalid link share object provided." +// @Failure 400 {object} web.HTTPError "Invalid link share object provided." // @Failure 500 {object} models.Message "Internal error" // @Router /shares/{share}/auth [post] func AuthenticateLinkShare(c echo.Context) error { diff --git a/pkg/routes/api/v1/login.go b/pkg/routes/api/v1/login.go index e3360274..893328ab 100644 --- a/pkg/routes/api/v1/login.go +++ b/pkg/routes/api/v1/login.go @@ -36,7 +36,7 @@ type Token struct { // @tags user // @Accept json // @Produce json -// @Param credentials body user.UserLogin true "The login credentials" +// @Param credentials body user.Login true "The login credentials" // @Success 200 {object} v1.Token // @Failure 400 {object} models.Message "Invalid user password model." // @Failure 412 {object} models.Message "Invalid totp passcode." diff --git a/pkg/routes/api/v1/user_add_update.go b/pkg/routes/api/v1/user_add_update.go index 6adc347c..03724518 100644 --- a/pkg/routes/api/v1/user_add_update.go +++ b/pkg/routes/api/v1/user_add_update.go @@ -33,7 +33,7 @@ import ( // @Produce json // @Param credentials body user.APIUserPassword true "The user credentials" // @Success 200 {object} user.User -// @Failure 400 {object} code.vikunja.io/web.HTTPError "No or invalid user register object provided / User already exists." +// @Failure 400 {object} web.HTTPError "No or invalid user register object provided / User already exists." // @Failure 500 {object} models.Message "Internal error" // @Router /register [post] func RegisterUser(c echo.Context) error { diff --git a/pkg/routes/api/v1/user_confirm_email.go b/pkg/routes/api/v1/user_confirm_email.go index 4bf24e57..994c0418 100644 --- a/pkg/routes/api/v1/user_confirm_email.go +++ b/pkg/routes/api/v1/user_confirm_email.go @@ -30,9 +30,9 @@ import ( // @tags user // @Accept json // @Produce json -// @Param credentials body models.EmailConfirm true "The token." +// @Param credentials body user.EmailConfirm true "The token." // @Success 200 {object} models.Message -// @Failure 412 {object} code.vikunja.io/web.HTTPError "Bad token provided." +// @Failure 412 {object} web.HTTPError "Bad token provided." // @Failure 500 {object} models.Message "Internal error" // @Router /user/confirm [post] func UserConfirmEmail(c echo.Context) error { diff --git a/pkg/routes/api/v1/user_list.go b/pkg/routes/api/v1/user_list.go index 2aa8bb55..ad22d569 100644 --- a/pkg/routes/api/v1/user_list.go +++ b/pkg/routes/api/v1/user_list.go @@ -34,7 +34,7 @@ import ( // @Param s query string false "Search for a user by its name." // @Security JWTKeyAuth // @Success 200 {array} user.User "All (found) users." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Something's invalid." +// @Failure 400 {object} web.HTTPError "Something's invalid." // @Failure 500 {object} models.Message "Internal server error." // @Router /users [get] func UserList(c echo.Context) error { @@ -62,8 +62,8 @@ func UserList(c echo.Context) error { // @Security JWTKeyAuth // @Param id path int true "List ID" // @Success 200 {array} user.User "All (found) users." -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Something's invalid." -// @Failure 401 {object} code.vikunja.io/web.HTTPError "The user does not have the right to see the list." +// @Failure 400 {object} web.HTTPError "Something's invalid." +// @Failure 401 {object} web.HTTPError "The user does not have the right to see the list." // @Failure 500 {object} models.Message "Internal server error." // @Router /lists/{id}/listusers [get] func ListUsersForList(c echo.Context) error { diff --git a/pkg/routes/api/v1/user_password_reset.go b/pkg/routes/api/v1/user_password_reset.go index f4e8589c..84cdce6e 100644 --- a/pkg/routes/api/v1/user_password_reset.go +++ b/pkg/routes/api/v1/user_password_reset.go @@ -30,9 +30,9 @@ import ( // @tags user // @Accept json // @Produce json -// @Param credentials body models.PasswordReset true "The token with the new password." +// @Param credentials body user.PasswordReset true "The token with the new password." // @Success 200 {object} models.Message -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Bad token provided." +// @Failure 400 {object} web.HTTPError "Bad token provided." // @Failure 500 {object} models.Message "Internal error" // @Router /user/password/reset [post] func UserResetPassword(c echo.Context) error { @@ -56,9 +56,9 @@ func UserResetPassword(c echo.Context) error { // @tags user // @Accept json // @Produce json -// @Param credentials body models.PasswordTokenRequest true "The username of the user to request a token for." +// @Param credentials body user.PasswordTokenRequest true "The username of the user to request a token for." // @Success 200 {object} models.Message -// @Failure 404 {object} code.vikunja.io/web.HTTPError "The user does not exist." +// @Failure 404 {object} web.HTTPError "The user does not exist." // @Failure 500 {object} models.Message "Internal error" // @Router /user/password/token [post] func UserRequestResetPasswordToken(c echo.Context) error { diff --git a/pkg/routes/api/v1/user_show.go b/pkg/routes/api/v1/user_show.go index 270a3ede..a48a8199 100644 --- a/pkg/routes/api/v1/user_show.go +++ b/pkg/routes/api/v1/user_show.go @@ -31,7 +31,7 @@ import ( // @Produce json // @Security JWTKeyAuth // @Success 200 {object} user.User -// @Failure 404 {object} code.vikunja.io/web.HTTPError "User does not exist." +// @Failure 404 {object} web.HTTPError "User does not exist." // @Failure 500 {object} models.Message "Internal server error." // @Router /user [get] func UserShow(c echo.Context) error { diff --git a/pkg/routes/api/v1/user_totp.go b/pkg/routes/api/v1/user_totp.go index db81a760..b218ae77 100644 --- a/pkg/routes/api/v1/user_totp.go +++ b/pkg/routes/api/v1/user_totp.go @@ -36,8 +36,8 @@ import ( // @Produce json // @Security JWTKeyAuth // @Success 200 {object} user.TOTP -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Something's invalid." -// @Failure 404 {object} code.vikunja.io/web.HTTPError "User does not exist." +// @Failure 400 {object} web.HTTPError "Something's invalid." +// @Failure 404 {object} web.HTTPError "User does not exist." // @Failure 500 {object} models.Message "Internal server error." // @Router /user/settings/totp/enroll [post] func UserTOTPEnroll(c echo.Context) error { @@ -63,9 +63,9 @@ func UserTOTPEnroll(c echo.Context) error { // @Param totp body user.TOTPPasscode true "The totp passcode." // @Security JWTKeyAuth // @Success 200 {object} models.Message "Successfully enabled" -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Something's invalid." -// @Failure 404 {object} code.vikunja.io/web.HTTPError "User does not exist." -// @Failure 412 {object} code.vikunja.io/web.HTTPError "TOTP is not enrolled." +// @Failure 400 {object} web.HTTPError "Something's invalid." +// @Failure 404 {object} web.HTTPError "User does not exist." +// @Failure 412 {object} web.HTTPError "TOTP is not enrolled." // @Failure 500 {object} models.Message "Internal server error." // @Router /user/settings/totp/enable [post] func UserTOTPEnable(c echo.Context) error { @@ -102,8 +102,8 @@ func UserTOTPEnable(c echo.Context) error { // @Security JWTKeyAuth // @Param totp body user.Login true "The current user's password (only password is enough)." // @Success 200 {object} models.Message "Successfully disabled" -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Something's invalid." -// @Failure 404 {object} code.vikunja.io/web.HTTPError "User does not exist." +// @Failure 400 {object} web.HTTPError "Something's invalid." +// @Failure 404 {object} web.HTTPError "User does not exist." // @Failure 500 {object} models.Message "Internal server error." // @Router /user/settings/totp/disable [post] func UserTOTPDisable(c echo.Context) error { diff --git a/pkg/routes/api/v1/user_update_email.go b/pkg/routes/api/v1/user_update_email.go index b308904d..6e8cb2f9 100644 --- a/pkg/routes/api/v1/user_update_email.go +++ b/pkg/routes/api/v1/user_update_email.go @@ -35,8 +35,8 @@ import ( // @Param userEmailUpdate body user.EmailUpdate true "The new email address and current password." // @Security JWTKeyAuth // @Success 200 {object} models.Message -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Something's invalid." -// @Failure 404 {object} code.vikunja.io/web.HTTPError "User does not exist." +// @Failure 400 {object} web.HTTPError "Something's invalid." +// @Failure 404 {object} web.HTTPError "User does not exist." // @Failure 500 {object} models.Message "Internal server error." // @Router /user/settings/email [post] func UpdateUserEmail(c echo.Context) (err error) { diff --git a/pkg/routes/api/v1/user_update_password.go b/pkg/routes/api/v1/user_update_password.go index 31d19b01..3fafb9fd 100644 --- a/pkg/routes/api/v1/user_update_password.go +++ b/pkg/routes/api/v1/user_update_password.go @@ -39,8 +39,8 @@ type UserPassword struct { // @Param userPassword body v1.UserPassword true "The current and new password." // @Security JWTKeyAuth // @Success 200 {object} models.Message -// @Failure 400 {object} code.vikunja.io/web.HTTPError "Something's invalid." -// @Failure 404 {object} code.vikunja.io/web.HTTPError "User does not exist." +// @Failure 400 {object} web.HTTPError "Something's invalid." +// @Failure 404 {object} web.HTTPError "User does not exist." // @Failure 500 {object} models.Message "Internal server error." // @Router /user/password [post] func UserChangePassword(c echo.Context) error { diff --git a/pkg/swagger/docs.go b/pkg/swagger/docs.go index 6744b48e..0ea99829 100644 --- a/pkg/swagger/docs.go +++ b/pkg/swagger/docs.go @@ -1,6 +1,5 @@ // GENERATED BY THE COMMAND ABOVE; DO NOT EDIT -// This file was generated by swaggo/swag at -// 2020-01-20 20:27:54.414478978 +0100 CET m=+0.171577588 +// This file was generated by swaggo/swag package swagger @@ -33,6 +32,146 @@ var doc = `{ "host": "{{.Host}}", "basePath": "{{.BasePath}}", "paths": { + "/backgrounds/unsplash/image/{image}": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Get an unsplash image. **Returns json on error.**", + "produces": [ + "application/octet-stream" + ], + "tags": [ + "list" + ], + "summary": "Get an unsplash image", + "parameters": [ + { + "type": "integer", + "description": "Unsplash Image ID", + "name": "thumb", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The image", + "schema": { + "type": "" + } + }, + "404": { + "description": "The image does not exist.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/backgrounds/unsplash/image/{image}/thumb": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Get an unsplash thumbnail image. The thumbnail is cropped to a max width of 200px. **Returns json on error.**", + "produces": [ + "application/octet-stream" + ], + "tags": [ + "list" + ], + "summary": "Get an unsplash thumbnail image", + "parameters": [ + { + "type": "integer", + "description": "Unsplash Image ID", + "name": "thumb", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The thumbnail", + "schema": { + "type": "" + } + }, + "404": { + "description": "The image does not exist.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/backgrounds/unsplash/search": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Search for a list background from unsplash", + "produces": [ + "application/json" + ], + "tags": [ + "list" + ], + "summary": "Search for a background from unsplash", + "parameters": [ + { + "type": "string", + "description": "Search backgrounds from unsplash with this search term.", + "name": "s", + "in": "query" + }, + { + "type": "integer", + "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", + "name": "p", + "in": "query" + } + ], + "responses": { + "200": { + "description": "An array with photos", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/background.Image" + } + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, "/info": { "get": { "description": "Returns the version, frontendurl, motd and various settings of Vikunja", @@ -133,7 +272,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.Label" } } @@ -148,7 +286,7 @@ var doc = `{ "400": { "description": "Invalid label object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -197,13 +335,13 @@ var doc = `{ "403": { "description": "The user does not have access to the label", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "Label not found", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -245,7 +383,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.Label" } } @@ -260,19 +397,19 @@ var doc = `{ "400": { "description": "Invalid label object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "Not allowed to update the label.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "Label not found.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -319,13 +456,13 @@ var doc = `{ "403": { "description": "Not allowed to delete the label.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "Label not found.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -373,6 +510,12 @@ var doc = `{ "description": "Search lists by title.", "name": "s", "in": "query" + }, + { + "type": "boolean", + "description": "If true, also returns all archived lists.", + "name": "is_archived", + "in": "query" } ], "responses": { @@ -388,7 +531,7 @@ var doc = `{ "403": { "description": "The user does not have access to the list", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -437,7 +580,7 @@ var doc = `{ "403": { "description": "The user does not have access to the list", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -479,7 +622,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.Task" } } @@ -494,13 +636,13 @@ var doc = `{ "400": { "description": "Invalid task object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "The user does not have access to the list", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -542,7 +684,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.List" } } @@ -557,13 +698,13 @@ var doc = `{ "400": { "description": "Invalid list object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "The user does not have access to the list", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -607,13 +748,299 @@ var doc = `{ "400": { "description": "Invalid list object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "The user does not have access to the list", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/lists/{id}/background": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Get the list background of a specific list. **Returns json on error.**", + "produces": [ + "application/octet-stream" + ], + "tags": [ + "list" + ], + "summary": "Get the list background", + "parameters": [ + { + "type": "integer", + "description": "List ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The list background file.", + "schema": { + "type": "" + } + }, + "403": { + "description": "No access to this list.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "404": { + "description": "The list does not exist.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/lists/{id}/backgrounds/unsplash": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Sets a photo from unsplash as list background.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "list" + ], + "summary": "Set an unsplash photo as list background", + "parameters": [ + { + "type": "integer", + "description": "List ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "The image you want to set as background", + "name": "list", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/background.Image" + } + } + ], + "responses": { + "200": { + "description": "The background has been successfully set.", + "schema": { + "$ref": "#/definitions/models.List" + } + }, + "400": { + "description": "Invalid image object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "The user does not have access to the list", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/lists/{id}/backgrounds/upload": { + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Upload a list background.", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "list" + ], + "summary": "Upload a list background", + "parameters": [ + { + "type": "integer", + "description": "List ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "The file as single file.", + "name": "background", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "The background was set successfully.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "403": { + "description": "File too large.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "404": { + "description": "The list does not exist.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/lists/{id}/buckets": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns all kanban buckets with belong to a list including their tasks.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Get all kanban buckets of a list", + "parameters": [ + { + "type": "integer", + "description": "List Id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The buckets with their tasks", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Bucket" + } + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Creates a new kanban bucket on a list.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Create a new bucket", + "parameters": [ + { + "type": "integer", + "description": "List Id", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "The bucket object", + "name": "bucket", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.Bucket" + } + } + ], + "responses": { + "200": { + "description": "The created bucket object.", + "schema": { + "$ref": "#/definitions/models.Bucket" + } + }, + "400": { + "description": "Invalid bucket object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The list does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -671,13 +1098,13 @@ var doc = `{ "400": { "description": "Something's invalid.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "401": { "description": "The user does not have the right to see the list.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -747,7 +1174,7 @@ var doc = `{ "403": { "description": "No right to see the list.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -789,7 +1216,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.TeamList" } } @@ -804,19 +1230,19 @@ var doc = `{ "400": { "description": "Invalid team list object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "The user does not have access to the list", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "The team does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -886,7 +1312,7 @@ var doc = `{ "403": { "description": "No right to see the list.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -928,7 +1354,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.ListUser" } } @@ -943,19 +1368,144 @@ var doc = `{ "400": { "description": "Invalid user list object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "The user does not have access to the list", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "The user does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/lists/{listID}/buckets/{bucketID}": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Updates an existing kanban bucket.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Update an existing bucket", + "parameters": [ + { + "type": "integer", + "description": "List Id", + "name": "listID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Bucket Id", + "name": "bucketID", + "in": "path", + "required": true + }, + { + "description": "The bucket object", + "name": "bucket", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.Bucket" + } + } + ], + "responses": { + "200": { + "description": "The created bucket object.", + "schema": { + "$ref": "#/definitions/models.Bucket" + } + }, + "400": { + "description": "Invalid bucket object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The bucket does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Deletes an existing kanban bucket and dissociates all of its task. It does not delete any tasks. You cannot delete the last bucket on a list.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Deletes an existing bucket", + "parameters": [ + { + "type": "integer", + "description": "List Id", + "name": "listID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Bucket Id", + "name": "bucketID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully deleted.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "404": { + "description": "The bucket does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -989,7 +1539,7 @@ var doc = `{ { "type": "integer", "description": "The list ID.", - "name": "list_id", + "name": "listID", "in": "path", "required": true }, @@ -1013,7 +1563,7 @@ var doc = `{ }, { "type": "string", - "description": "The sorting parameter. You can pass this multiple times to get the tasks ordered by multiple different parametes, along with ` + "`" + `order_by` + "`" + `. Possible values to sort by are ` + "`" + `id` + "`" + `, ` + "`" + `text` + "`" + `, ` + "`" + `description` + "`" + `, ` + "`" + `done` + "`" + `, ` + "`" + `done_at` + "`" + `, ` + "`" + `due_date` + "`" + `, ` + "`" + `created_by_id` + "`" + `, ` + "`" + `list_id` + "`" + `, ` + "`" + `repeat_after` + "`" + `, ` + "`" + `priority` + "`" + `, ` + "`" + `start_date` + "`" + `, ` + "`" + `end_date` + "`" + `, ` + "`" + `hex_color` + "`" + `, ` + "`" + `percent_done` + "`" + `, ` + "`" + `uid` + "`" + `, ` + "`" + `created` + "`" + `, ` + "`" + `updated` + "`" + `. Default is ` + "`" + `id` + "`" + `.", + "description": "The sorting parameter. You can pass this multiple times to get the tasks ordered by multiple different parametes, along with ` + "`" + `order_by` + "`" + `. Possible values to sort by are ` + "`" + `id` + "`" + `, ` + "`" + `title` + "`" + `, ` + "`" + `description` + "`" + `, ` + "`" + `done` + "`" + `, ` + "`" + `done_at` + "`" + `, ` + "`" + `due_date` + "`" + `, ` + "`" + `created_by_id` + "`" + `, ` + "`" + `list_id` + "`" + `, ` + "`" + `repeat_after` + "`" + `, ` + "`" + `priority` + "`" + `, ` + "`" + `start_date` + "`" + `, ` + "`" + `end_date` + "`" + `, ` + "`" + `hex_color` + "`" + `, ` + "`" + `percent_done` + "`" + `, ` + "`" + `uid` + "`" + `, ` + "`" + `created` + "`" + `, ` + "`" + `updated` + "`" + `. Default is ` + "`" + `id` + "`" + `.", "name": "sort_by", "in": "query" }, @@ -1024,15 +1574,33 @@ var doc = `{ "in": "query" }, { - "type": "integer", - "description": "The start date parameter to filter by. Expects a unix timestamp. If no end date, but a start date is specified, the end date is set to the current time.", - "name": "start_date", + "type": "string", + "description": "The name of the field to filter by. Accepts an array for multiple filters which will be chanied together, all supplied filter must match.", + "name": "filter_by", "in": "query" }, { - "type": "integer", - "description": "The end date parameter to filter by. Expects a unix timestamp. If no start date, but an end date is specified, the start date is set to the current time.", - "name": "end_date", + "type": "string", + "description": "The value to filter for.", + "name": "filter_value", + "in": "query" + }, + { + "type": "string", + "description": "The comparator to use for a filter. Available values are ` + "`" + `equals` + "`" + `, ` + "`" + `greater` + "`" + `, ` + "`" + `greater_equals` + "`" + `, ` + "`" + `less` + "`" + ` and ` + "`" + `less_equals` + "`" + `. Defaults to ` + "`" + `equals` + "`" + `", + "name": "filter_comparator", + "in": "query" + }, + { + "type": "string", + "description": "The concatinator to use for filters. Available values are ` + "`" + `and` + "`" + ` or ` + "`" + `or` + "`" + `. Defaults to ` + "`" + `or` + "`" + `.", + "name": "filter_concat", + "in": "query" + }, + { + "type": "string", + "description": "If set to true the result will include filtered fields whose value is set to ` + "`" + `null` + "`" + `. Available values are ` + "`" + `true` + "`" + ` or ` + "`" + `false` + "`" + `. Defaults to ` + "`" + `false` + "`" + `.", + "name": "filter_include_nulls", "in": "query" } ], @@ -1077,14 +1645,14 @@ var doc = `{ { "type": "integer", "description": "List ID", - "name": "list_id", + "name": "listID", "in": "path", "required": true }, { "type": "integer", "description": "Team ID", - "name": "team_id", + "name": "teamID", "in": "path", "required": true }, @@ -1094,7 +1662,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.TeamList" } } @@ -1109,13 +1676,13 @@ var doc = `{ "403": { "description": "The user does not have admin-access to the list", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "Team or list does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -1144,14 +1711,14 @@ var doc = `{ { "type": "integer", "description": "List ID", - "name": "list_id", + "name": "listID", "in": "path", "required": true }, { "type": "integer", "description": "Team ID", - "name": "team_id", + "name": "teamID", "in": "path", "required": true } @@ -1166,13 +1733,13 @@ var doc = `{ "403": { "description": "The user does not have access to the list", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "Team or list does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -1206,14 +1773,14 @@ var doc = `{ { "type": "integer", "description": "List ID", - "name": "list_id", + "name": "listID", "in": "path", "required": true }, { "type": "integer", "description": "User ID", - "name": "user_id", + "name": "userID", "in": "path", "required": true }, @@ -1223,7 +1790,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.ListUser" } } @@ -1238,13 +1804,13 @@ var doc = `{ "403": { "description": "The user does not have admin-access to the list", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "User or list does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -1273,14 +1839,14 @@ var doc = `{ { "type": "integer", "description": "List ID", - "name": "list_id", + "name": "listID", "in": "path", "required": true }, { "type": "integer", "description": "User ID", - "name": "user_id", + "name": "userID", "in": "path", "required": true } @@ -1295,13 +1861,13 @@ var doc = `{ "403": { "description": "The user does not have access to the list", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "user or list does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -1407,7 +1973,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.LinkSharing" } } @@ -1422,19 +1987,19 @@ var doc = `{ "400": { "description": "Invalid link share object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "Not allowed to add the list share.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "The list does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -1490,13 +2055,13 @@ var doc = `{ "403": { "description": "No access to the list", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "Share Link not found.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -1550,13 +2115,13 @@ var doc = `{ "403": { "description": "Not allowed to remove the link.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "Share Link not found.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -1588,8 +2153,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", - "$ref": "#/definitions/user.UserLogin" + "$ref": "#/definitions/user.Login" } } ], @@ -1611,6 +2175,119 @@ var doc = `{ "schema": { "$ref": "#/definitions/models.Message" } + }, + "412": { + "description": "Invalid totp passcode.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/migration/todoist/auth": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns the auth url where the user needs to get its auth code. This code can then be used to migrate everything from todoist to Vikunja.", + "produces": [ + "application/json" + ], + "tags": [ + "migration" + ], + "summary": "Get the auth url from todoist", + "responses": { + "200": { + "description": "The auth url.", + "schema": { + "$ref": "#/definitions/handler.AuthURL" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/migration/todoist/migrate": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Migrates all projects, tasks, notes, reminders, subtasks and files from todoist to vikunja.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "migration" + ], + "summary": "Migrate all lists, tasks etc. from todoist", + "parameters": [ + { + "description": "The auth code previously obtained from the auth url. See the docs for /migration/todoist/auth.", + "name": "migrationCode", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/todoist.Migration" + } + } + ], + "responses": { + "200": { + "description": "A message telling you everything was migrated successfully.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/migration/todoist/status": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns if the current user already did the migation or not. This is useful to show a confirmation message in the frontend if the user is trying to do the same migration again.", + "produces": [ + "application/json" + ], + "tags": [ + "migration" + ], + "summary": "Get migration status", + "responses": { + "200": { + "description": "The migration status", + "schema": { + "$ref": "#/definitions/migration.Status" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } } } } @@ -1671,7 +2348,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/wunderlist.Migration" } } @@ -1755,7 +2431,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.Namespace" } } @@ -1770,13 +2445,13 @@ var doc = `{ "400": { "description": "Invalid namespace object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "The user does not have access to the namespace", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -1824,6 +2499,12 @@ var doc = `{ "description": "Search namespaces by name.", "name": "s", "in": "query" + }, + { + "type": "boolean", + "description": "If true, also returns all archived namespaces.", + "name": "is_archived", + "in": "query" } ], "responses": { @@ -1868,7 +2549,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.Namespace" } } @@ -1883,13 +2563,13 @@ var doc = `{ "400": { "description": "Invalid namespace object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "The user does not have access to the namespace", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -1938,7 +2618,7 @@ var doc = `{ "403": { "description": "The user does not have access to that namespace.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -1982,13 +2662,13 @@ var doc = `{ "400": { "description": "Invalid namespace object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "The user does not have access to the namespace", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -2116,7 +2796,7 @@ var doc = `{ "403": { "description": "No right to see the namespace.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -2158,7 +2838,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.TeamNamespace" } } @@ -2173,19 +2852,19 @@ var doc = `{ "400": { "description": "Invalid team namespace object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "The team does not have access to the namespace", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "The team does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -2255,7 +2934,7 @@ var doc = `{ "403": { "description": "No right to see the namespace.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -2297,7 +2976,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.NamespaceUser" } } @@ -2312,19 +2990,19 @@ var doc = `{ "400": { "description": "Invalid user namespace object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "The user does not have access to the namespace", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "The user does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -2368,7 +3046,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.List" } } @@ -2383,13 +3060,13 @@ var doc = `{ "400": { "description": "Invalid list object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "The user does not have access to the list", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -2430,7 +3107,7 @@ var doc = `{ { "type": "integer", "description": "Team ID", - "name": "team_id", + "name": "teamID", "in": "path", "required": true }, @@ -2440,7 +3117,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.TeamNamespace" } } @@ -2455,13 +3131,13 @@ var doc = `{ "403": { "description": "The team does not have admin-access to the namespace", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "Team or namespace does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -2497,7 +3173,7 @@ var doc = `{ { "type": "integer", "description": "team ID", - "name": "team_id", + "name": "teamID", "in": "path", "required": true } @@ -2512,13 +3188,13 @@ var doc = `{ "403": { "description": "The team does not have access to the namespace", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "team or namespace does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -2559,7 +3235,7 @@ var doc = `{ { "type": "integer", "description": "User ID", - "name": "user_id", + "name": "userID", "in": "path", "required": true }, @@ -2569,7 +3245,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.NamespaceUser" } } @@ -2584,13 +3259,13 @@ var doc = `{ "403": { "description": "The user does not have admin-access to the namespace", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "User or namespace does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -2626,7 +3301,7 @@ var doc = `{ { "type": "integer", "description": "user ID", - "name": "user_id", + "name": "userID", "in": "path", "required": true } @@ -2641,13 +3316,13 @@ var doc = `{ "403": { "description": "The user does not have access to the namespace", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "user or namespace does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -2679,8 +3354,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", - "$ref": "#/definitions/models.APIUserPassword" + "$ref": "#/definitions/user.APIUserPassword" } } ], @@ -2694,7 +3368,7 @@ var doc = `{ "400": { "description": "No or invalid user register object provided / User already exists.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -2738,7 +3412,7 @@ var doc = `{ "400": { "description": "Invalid link share object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -2789,20 +3463,38 @@ var doc = `{ }, { "type": "string", - "description": "The sorting parameter. Possible values to sort by are priority, prioritydesc, priorityasc, duedate, duedatedesc, duedateasc.", - "name": "sort", + "description": "The sorting parameter. You can pass this multiple times to get the tasks ordered by multiple different parametes, along with ` + "`" + `order_by` + "`" + `. Possible values to sort by are ` + "`" + `id` + "`" + `, ` + "`" + `text` + "`" + `, ` + "`" + `description` + "`" + `, ` + "`" + `done` + "`" + `, ` + "`" + `done_at` + "`" + `, ` + "`" + `due_date` + "`" + `, ` + "`" + `created_by_id` + "`" + `, ` + "`" + `list_id` + "`" + `, ` + "`" + `repeat_after` + "`" + `, ` + "`" + `priority` + "`" + `, ` + "`" + `start_date` + "`" + `, ` + "`" + `end_date` + "`" + `, ` + "`" + `hex_color` + "`" + `, ` + "`" + `percent_done` + "`" + `, ` + "`" + `uid` + "`" + `, ` + "`" + `created` + "`" + `, ` + "`" + `updated` + "`" + `. Default is ` + "`" + `id` + "`" + `.", + "name": "sort_by", "in": "query" }, { - "type": "integer", - "description": "The start date parameter to filter by. Expects a unix timestamp. If no end date, but a start date is specified, the end date is set to the current time.", - "name": "start_date", + "type": "string", + "description": "The ordering parameter. Possible values to order by are ` + "`" + `asc` + "`" + ` or ` + "`" + `desc` + "`" + `. Default is ` + "`" + `asc` + "`" + `.", + "name": "order_by", "in": "query" }, { - "type": "integer", - "description": "The end date parameter to filter by. Expects a unix timestamp. If no start date, but an end date is specified, the start date is set to the current time.", - "name": "end_date", + "type": "string", + "description": "The name of the field to filter by. Accepts an array for multiple filters which will be chanied together, all supplied filter must match.", + "name": "filter_by", + "in": "query" + }, + { + "type": "string", + "description": "The value to filter for.", + "name": "filter_value", + "in": "query" + }, + { + "type": "string", + "description": "The comparator to use for a filter. Available values are ` + "`" + `equals` + "`" + `, ` + "`" + `greater` + "`" + `, ` + "`" + `greater_equals` + "`" + `, ` + "`" + `less` + "`" + ` and ` + "`" + `less_equals` + "`" + `. Defaults to ` + "`" + `equals` + "`" + `", + "name": "filter_comparator", + "in": "query" + }, + { + "type": "string", + "description": "The concatinator to use for filters. Available values are ` + "`" + `and` + "`" + ` or ` + "`" + `or` + "`" + `. Defaults to ` + "`" + `or` + "`" + `.", + "name": "filter_concat", "in": "query" } ], @@ -2850,7 +3542,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.BulkTask" } } @@ -2865,13 +3556,13 @@ var doc = `{ "400": { "description": "Invalid task object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "The user does not have access to the task (aka its list)", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -2964,7 +3655,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.Task" } } @@ -2979,13 +3669,13 @@ var doc = `{ "400": { "description": "Invalid task object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "The user does not have access to the task (aka its list)", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -3029,13 +3719,13 @@ var doc = `{ "400": { "description": "Invalid task ID provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "The user does not have access to the list", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -3383,7 +4073,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.TaskAssginee" } }, @@ -3405,7 +4094,7 @@ var doc = `{ "400": { "description": "Invalid assignee object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -3442,7 +4131,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.BulkAssignees" } }, @@ -3464,7 +4152,7 @@ var doc = `{ "400": { "description": "Invalid assignee object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -3505,7 +4193,7 @@ var doc = `{ { "type": "integer", "description": "Assignee user ID", - "name": "user_id", + "name": "userID", "in": "path", "required": true } @@ -3520,7 +4208,291 @@ var doc = `{ "403": { "description": "Not allowed to delete the assignee.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/{taskID}/comments": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Get all task comments. The user doing this need to have at least read access to the task.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Get all task comments", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The array with all task comments", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.TaskComment" + } + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Create a new task comment. The user doing this need to have at least write access to the task this comment should belong to.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Create a new task comment", + "parameters": [ + { + "description": "The task comment object", + "name": "relation", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.TaskComment" + } + }, + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The created task comment object.", + "schema": { + "$ref": "#/definitions/models.TaskComment" + } + }, + "400": { + "description": "Invalid task comment object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/{taskID}/comments/{commentID}": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Remove a task comment. The user doing this need to have at least read access to the task this comment belongs to.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Remove a task comment", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Comment ID", + "name": "commentID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The task comment object.", + "schema": { + "$ref": "#/definitions/models.TaskComment" + } + }, + "400": { + "description": "Invalid task comment object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The task comment was not found.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Update an existing task comment. The user doing this need to have at least write access to the task this comment belongs to.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Update an existing task comment", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Comment ID", + "name": "commentID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The updated task comment object.", + "schema": { + "$ref": "#/definitions/models.TaskComment" + } + }, + "400": { + "description": "Invalid task comment object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The task comment was not found.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Remove a task comment. The user doing this need to have at least write access to the task this comment belongs to.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Remove a task comment", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Comment ID", + "name": "commentID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The task comment was successfully deleted.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Invalid task comment object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The task comment was not found.", + "schema": { + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -3557,7 +4529,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.LabelTaskBulk" } }, @@ -3579,7 +4550,7 @@ var doc = `{ "400": { "description": "Invalid label object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -3616,7 +4587,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.TaskRelation" } }, @@ -3638,7 +4608,7 @@ var doc = `{ "400": { "description": "Invalid task relation object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -3672,7 +4642,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.TaskRelation" } }, @@ -3694,13 +4663,13 @@ var doc = `{ "400": { "description": "Invalid task relation object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "The task relation was not found.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -3806,7 +4775,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.LabelTask" } } @@ -3821,19 +4789,19 @@ var doc = `{ "400": { "description": "Invalid label object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "Not allowed to add the label.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "The label does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -3889,13 +4857,13 @@ var doc = `{ "403": { "description": "Not allowed to remove the label.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "Label not found.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -3987,7 +4955,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.Team" } } @@ -4002,7 +4969,7 @@ var doc = `{ "400": { "description": "Invalid team object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -4015,6 +4982,53 @@ var doc = `{ } }, "/teams/{id}": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns a team by its ID.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "team" + ], + "summary": "Gets one team", + "parameters": [ + { + "type": "integer", + "description": "Team ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The team", + "schema": { + "$ref": "#/definitions/models.Team" + } + }, + "403": { + "description": "The user does not have access to the team", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, "post": { "security": [ { @@ -4046,7 +5060,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.Team" } } @@ -4061,7 +5074,7 @@ var doc = `{ "400": { "description": "Invalid team object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -4105,7 +5118,7 @@ var doc = `{ "400": { "description": "Invalid team object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -4149,7 +5162,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.TeamMember" } } @@ -4164,13 +5176,13 @@ var doc = `{ "400": { "description": "Invalid member object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "The user does not have access to the team", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -4208,7 +5220,7 @@ var doc = `{ { "type": "integer", "description": "User ID", - "name": "user_id", + "name": "userID", "in": "path", "required": true } @@ -4257,7 +5269,7 @@ var doc = `{ "404": { "description": "User does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -4289,8 +5301,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", - "$ref": "#/definitions/models.EmailConfirm" + "$ref": "#/definitions/user.EmailConfirm" } } ], @@ -4304,7 +5315,7 @@ var doc = `{ "412": { "description": "Bad token provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -4341,7 +5352,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/v1.UserPassword" } } @@ -4356,13 +5366,13 @@ var doc = `{ "400": { "description": "Something's invalid.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "User does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -4394,8 +5404,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", - "$ref": "#/definitions/models.PasswordReset" + "$ref": "#/definitions/user.PasswordReset" } } ], @@ -4409,7 +5418,7 @@ var doc = `{ "400": { "description": "Bad token provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -4441,8 +5450,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", - "$ref": "#/definitions/models.PasswordTokenRequest" + "$ref": "#/definitions/user.PasswordTokenRequest" } } ], @@ -4456,7 +5464,7 @@ var doc = `{ "404": { "description": "The user does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -4468,6 +5476,297 @@ var doc = `{ } } }, + "/user/settings/email": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Lets the current user change their email address.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Update email address", + "parameters": [ + { + "description": "The new email address and current password.", + "name": "userEmailUpdate", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user.EmailUpdate" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "User does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/settings/totp": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns the current user totp setting or an error if it is not enabled.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Totp setting for the current user", + "responses": { + "200": { + "description": "The totp settings.", + "schema": { + "$ref": "#/definitions/user.TOTP" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/settings/totp/disable": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Disables any totp settings for the current user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Disable totp settings", + "parameters": [ + { + "description": "The current user's password (only password is enough).", + "name": "totp", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user.Login" + } + } + ], + "responses": { + "200": { + "description": "Successfully disabled", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "User does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/settings/totp/enable": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Enables a previously enrolled totp setting by providing a totp passcode.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Enable a previously enrolled totp setting.", + "parameters": [ + { + "description": "The totp passcode.", + "name": "totp", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user.TOTPPasscode" + } + } + ], + "responses": { + "200": { + "description": "Successfully enabled", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "User does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "412": { + "description": "TOTP is not enrolled.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/settings/totp/enroll": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Creates an initial setup for the user in the db. After this step, the user needs to verify they have a working totp setup with the \"enable totp\" endpoint.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Enroll a user into totp", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.TOTP" + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "User does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/settings/totp/qrcode": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns a qr code for easier setup at end user's devices.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Totp QR Code", + "responses": { + "200": { + "description": "The qr code as jpeg image", + "schema": { + "type": "" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, "/user/token": { "post": { "description": "Returns a new valid jwt user token with an extended length.", @@ -4536,7 +5835,7 @@ var doc = `{ "400": { "description": "Something's invalid.", "schema": { - "$ref": "#/definitions/code.vikunja.io.web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -4547,10 +5846,78 @@ var doc = `{ } } } + }, + "/{username}/avatar": { + "get": { + "description": "Returns the user avatar as image.", + "produces": [ + "application/octet-stream" + ], + "tags": [ + "user" + ], + "summary": "User Avatar", + "parameters": [ + { + "type": "string", + "description": "The username of the user who's avatar you want to get", + "name": "username", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "The size of the avatar you want to get", + "name": "size", + "in": "query" + } + ], + "responses": { + "200": { + "description": "The avatar", + "schema": { + "type": "" + } + }, + "404": { + "description": "The user does not exist.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } } }, "definitions": { "code.vikunja.io.web.HTTPError": {"type": "object","properties": {"code": {"type": "integer"},"message": {"type": "string"}}}, + "afero.File": { + "type": "object" + }, + "background.Image": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "info": { + "description": "This can be used to supply extra information from an image provider to clients", + "type": "object" + }, + "thumb": { + "type": "string" + }, + "url": { + "type": "string" + } + } + }, "files.File": { "type": "object", "properties": { @@ -4589,33 +5956,45 @@ var doc = `{ "type": "string" }, "time": { - "type": "integer" + "type": "string" } } }, - "models.APIUserPassword": { + "models.Bucket": { "type": "object", "properties": { - "email": { - "description": "The user's email address", - "type": "string", - "maxLength": 250 + "created": { + "description": "A timestamp when this bucket was created. You cannot change this value.", + "type": "string" + }, + "created_by": { + "description": "The user who initially created the bucket.", + "type": "object", + "$ref": "#/definitions/user.User" }, "id": { - "description": "The unique, numeric id of this user.", + "description": "The unique, numeric id of this bucket.", "type": "integer" }, - "password": { - "description": "The user's password in clear text. Only used when registering the user.", - "type": "string", - "maxLength": 250, - "minLength": 8 + "list_id": { + "description": "The list this bucket belongs to.", + "type": "integer" }, - "username": { - "description": "The username of the username. Is always unique.", + "tasks": { + "description": "All tasks which belong to this bucket.", + "type": "array", + "items": { + "$ref": "#/definitions/models.Task" + } + }, + "title": { + "description": "The title of this bucket.", "type": "string", - "maxLength": 250, - "minLength": 3 + "minLength": 1 + }, + "updated": { + "description": "A timestamp when this bucket was last updated. You cannot change this value.", + "type": "string" } } }, @@ -4648,10 +6027,14 @@ var doc = `{ "$ref": "#/definitions/models.TaskAttachment" } }, - "created": { - "description": "A unix timestamp when this task was created. You cannot change this value.", + "bucket_id": { + "description": "BucketID is the ID of the kanban bucket this task belongs to.", "type": "integer" }, + "created": { + "description": "A timestamp when this task was created. You cannot change this value.", + "type": "string" + }, "created_by": { "description": "The user who initially created the task.", "type": "object", @@ -4666,16 +6049,16 @@ var doc = `{ "type": "boolean" }, "done_at": { - "description": "The unix timestamp when a task was marked as done.", - "type": "integer" + "description": "The time when a task was marked as done.", + "type": "string" }, "due_date": { - "description": "A unix timestamp when the task is due.", - "type": "integer" + "description": "The time when the task is due.", + "type": "string" }, "end_date": { "description": "When this task ends.", - "type": "integer" + "type": "string" }, "hex_color": { "description": "The task color in hex", @@ -4709,6 +6092,10 @@ var doc = `{ "description": "Determines how far a task is left from being done", "type": "number" }, + "position": { + "description": "The position of the task - any task list can be sorted as usual by this parameter.\nWhen accessing tasks via kanban buckets, this is primarily used to sort them based on a range\nWe're using a float64 here to make it possible to put any task within any two other tasks (by changing the number).\nYou would calculate the new position between two tasks with something like task3.position = (task2.position - task1.position) / 2.\nA 64-Bit float leaves plenty of room to initially give tasks a position with 2^16 difference to the previous task\nwhich also leaves a lot of room for rearranging and sorting later.", + "type": "number" + }, "priority": { "description": "The task priority. Can be anything you want, it is possible to sort by this later.", "type": "integer" @@ -4719,19 +6106,23 @@ var doc = `{ "$ref": "#/definitions/models.RelatedTaskMap" }, "reminder_dates": { - "description": "An array of unix timestamps when the user wants to be reminded of the task.", + "description": "An array of datetimes when the user wants to be reminded of the task.", "type": "array", "items": { - "type": "integer" + "type": "string" } }, "repeat_after": { "description": "An amount in seconds this task repeats itself. If this is set, when marking the task as done, it will mark itself as \"undone\" and then increase all remindes and the due date by its amount.", "type": "integer" }, + "repeat_from_current_date": { + "description": "If specified, a repeating task will repeat from the current date rather than the last set date.", + "type": "boolean" + }, "start_date": { "description": "When this task starts.", - "type": "integer" + "type": "string" }, "task_ids": { "description": "A list of task ids to update", @@ -4740,23 +6131,14 @@ var doc = `{ "type": "integer" } }, - "text": { + "title": { "description": "The task text. This is what you'll see in the list.", "type": "string", "maxLength": 250, "minLength": 3 }, "updated": { - "description": "A unix timestamp when this task was last updated. You cannot change this value.", - "type": "integer" - } - } - }, - "models.EmailConfirm": { - "type": "object", - "properties": { - "token": { - "description": "The email confirm token sent via email.", + "description": "A timestamp when this task was last updated. You cannot change this value.", "type": "string" } } @@ -4765,8 +6147,8 @@ var doc = `{ "type": "object", "properties": { "created": { - "description": "A unix timestamp when this label was created. You cannot change this value.", - "type": "integer" + "description": "A timestamp when this label was created. You cannot change this value.", + "type": "string" }, "created_by": { "description": "The user who created this label", @@ -4793,8 +6175,8 @@ var doc = `{ "minLength": 3 }, "updated": { - "description": "A unix timestamp when this label was last updated. You cannot change this value.", - "type": "integer" + "description": "A timestamp when this label was last updated. You cannot change this value.", + "type": "string" } } }, @@ -4802,8 +6184,8 @@ var doc = `{ "type": "object", "properties": { "created": { - "description": "A unix timestamp when this task was created. You cannot change this value.", - "type": "integer" + "description": "A timestamp when this task was created. You cannot change this value.", + "type": "string" }, "label_id": { "description": "The label id you want to associate with a task.", @@ -4827,8 +6209,8 @@ var doc = `{ "type": "object", "properties": { "created": { - "description": "A unix timestamp when this list was shared. You cannot change this value.", - "type": "integer" + "description": "A timestamp when this list was shared. You cannot change this value.", + "type": "string" }, "hash": { "description": "The public id to get this shared list", @@ -4856,22 +6238,31 @@ var doc = `{ "maximum": 2 }, "updated": { - "description": "A unix timestamp when this share was last updated. You cannot change this value.", - "type": "integer" + "description": "A timestamp when this share was last updated. You cannot change this value.", + "type": "string" } } }, "models.List": { "type": "object", "properties": { + "background_information": { + "description": "Holds extra information about the background set since some background providers require attribution or similar. If not null, the background can be accessed at /lists/{listID}/background", + "type": "object" + }, "created": { - "description": "A unix timestamp when this list was created. You cannot change this value.", - "type": "integer" + "description": "A timestamp when this list was created. You cannot change this value.", + "type": "string" }, "description": { "description": "The description of the list.", "type": "string" }, + "hex_color": { + "description": "The hex color of this list", + "type": "string", + "maxLength": 6 + }, "id": { "description": "The unique, numeric id of this list.", "type": "integer" @@ -4882,6 +6273,13 @@ var doc = `{ "maxLength": 10, "minLength": 0 }, + "is_archived": { + "description": "Whether or not a list is archived.", + "type": "boolean" + }, + "namespace_id": { + "type": "integer" + }, "owner": { "description": "The user who created this list.", "type": "object", @@ -4894,8 +6292,8 @@ var doc = `{ "minLength": 3 }, "updated": { - "description": "A unix timestamp when this list was last updated. You cannot change this value.", - "type": "integer" + "description": "A timestamp when this list was last updated. You cannot change this value.", + "type": "string" } } }, @@ -4903,8 +6301,8 @@ var doc = `{ "type": "object", "properties": { "created": { - "description": "A unix timestamp when this relation was created. You cannot change this value.", - "type": "integer" + "description": "A timestamp when this relation was created. You cannot change this value.", + "type": "string" }, "id": { "description": "The unique, numeric id of this list \u003c-\u003e user relation.", @@ -4917,8 +6315,8 @@ var doc = `{ "maximum": 2 }, "updated": { - "description": "A unix timestamp when this relation was last updated. You cannot change this value.", - "type": "integer" + "description": "A timestamp when this relation was last updated. You cannot change this value.", + "type": "string" }, "user_id": { "description": "The username.", @@ -4939,31 +6337,40 @@ var doc = `{ "type": "object", "properties": { "created": { - "description": "A unix timestamp when this namespace was created. You cannot change this value.", - "type": "integer" + "description": "A timestamp when this namespace was created. You cannot change this value.", + "type": "string" }, "description": { "description": "The description of the namespace", "type": "string" }, + "hex_color": { + "description": "The hex color of this namespace", + "type": "string", + "maxLength": 6 + }, "id": { "description": "The unique, numeric id of this namespace.", "type": "integer" }, - "name": { - "description": "The name of this namespace.", - "type": "string", - "maxLength": 250, - "minLength": 5 + "is_archived": { + "description": "Whether or not a namespace is archived.", + "type": "boolean" }, "owner": { "description": "The user who owns this namespace", "type": "object", "$ref": "#/definitions/user.User" }, + "title": { + "description": "The name of this namespace.", + "type": "string", + "maxLength": 250, + "minLength": 5 + }, "updated": { - "description": "A unix timestamp when this namespace was last updated. You cannot change this value.", - "type": "integer" + "description": "A timestamp when this namespace was last updated. You cannot change this value.", + "type": "string" } } }, @@ -4971,8 +6378,8 @@ var doc = `{ "type": "object", "properties": { "created": { - "description": "A unix timestamp when this relation was created. You cannot change this value.", - "type": "integer" + "description": "A timestamp when this relation was created. You cannot change this value.", + "type": "string" }, "id": { "description": "The unique, numeric id of this namespace \u003c-\u003e user relation.", @@ -4985,8 +6392,8 @@ var doc = `{ "maximum": 2 }, "updated": { - "description": "A unix timestamp when this relation was last updated. You cannot change this value.", - "type": "integer" + "description": "A timestamp when this relation was last updated. You cannot change this value.", + "type": "string" }, "user_id": { "description": "The username.", @@ -4998,59 +6405,46 @@ var doc = `{ "type": "object", "properties": { "created": { - "description": "A unix timestamp when this namespace was created. You cannot change this value.", - "type": "integer" + "description": "A timestamp when this namespace was created. You cannot change this value.", + "type": "string" }, "description": { "description": "The description of the namespace", "type": "string" }, + "hex_color": { + "description": "The hex color of this namespace", + "type": "string", + "maxLength": 6 + }, "id": { "description": "The unique, numeric id of this namespace.", "type": "integer" }, + "is_archived": { + "description": "Whether or not a namespace is archived.", + "type": "boolean" + }, "lists": { "type": "array", "items": { "$ref": "#/definitions/models.List" } }, - "name": { - "description": "The name of this namespace.", - "type": "string", - "maxLength": 250, - "minLength": 5 - }, "owner": { "description": "The user who owns this namespace", "type": "object", "$ref": "#/definitions/user.User" }, - "updated": { - "description": "A unix timestamp when this namespace was last updated. You cannot change this value.", - "type": "integer" - } - } - }, - "models.PasswordReset": { - "type": "object", - "properties": { - "new_password": { - "description": "The new password for this user.", - "type": "string" - }, - "token": { - "description": "The previously issued reset token.", - "type": "string" - } - } - }, - "models.PasswordTokenRequest": { - "type": "object", - "properties": { - "email": { + "title": { + "description": "The name of this namespace.", "type": "string", - "maxLength": 250 + "maxLength": 250, + "minLength": 5 + }, + "updated": { + "description": "A timestamp when this namespace was last updated. You cannot change this value.", + "type": "string" } } }, @@ -5059,118 +6453,7 @@ var doc = `{ "additionalProperties": { "type": "array", "items": { - "type": "object", - "properties": { - "assignees": { - "description": "An array of users who are assigned to this task", - "type": "array", - "items": { - "$ref": "#/definitions/user.User" - } - }, - "attachments": { - "description": "All attachments this task has", - "type": "array", - "items": { - "$ref": "#/definitions/models.TaskAttachment" - } - }, - "created": { - "description": "A unix timestamp when this task was created. You cannot change this value.", - "type": "integer" - }, - "created_by": { - "description": "The user who initially created the task.", - "type": "object", - "$ref": "#/definitions/user.User" - }, - "description": { - "description": "The task description.", - "type": "string" - }, - "done": { - "description": "Whether a task is done or not.", - "type": "boolean" - }, - "done_at": { - "description": "The unix timestamp when a task was marked as done.", - "type": "integer" - }, - "due_date": { - "description": "A unix timestamp when the task is due.", - "type": "integer" - }, - "end_date": { - "description": "When this task ends.", - "type": "integer" - }, - "hex_color": { - "description": "The task color in hex", - "type": "string", - "maxLength": 6 - }, - "id": { - "description": "The unique, numeric id of this task.", - "type": "integer" - }, - "identifier": { - "description": "The task identifier, based on the list identifier and the task's index", - "type": "string" - }, - "index": { - "description": "The task index, calculated per list", - "type": "integer" - }, - "labels": { - "description": "An array of labels which are associated with this task.", - "type": "array", - "items": { - "$ref": "#/definitions/models.Label" - } - }, - "list_id": { - "description": "The list this task belongs to.", - "type": "integer" - }, - "percent_done": { - "description": "Determines how far a task is left from being done", - "type": "number" - }, - "priority": { - "description": "The task priority. Can be anything you want, it is possible to sort by this later.", - "type": "integer" - }, - "related_tasks": { - "description": "All related tasks, grouped by their relation kind", - "type": "object", - "$ref": "#/definitions/models.RelatedTaskMap" - }, - "reminder_dates": { - "description": "An array of unix timestamps when the user wants to be reminded of the task.", - "type": "array", - "items": { - "type": "integer" - } - }, - "repeat_after": { - "description": "An amount in seconds this task repeats itself. If this is set, when marking the task as done, it will mark itself as \"undone\" and then increase all remindes and the due date by its amount.", - "type": "integer" - }, - "start_date": { - "description": "When this task starts.", - "type": "integer" - }, - "text": { - "description": "The task text. This is what you'll see in the list.", - "type": "string", - "maxLength": 250, - "minLength": 3 - }, - "updated": { - "description": "A unix timestamp when this task was last updated. You cannot change this value.", - "type": "integer" - } - } + "$ref": "#/definitions/models.Task" } } }, @@ -5191,10 +6474,14 @@ var doc = `{ "$ref": "#/definitions/models.TaskAttachment" } }, - "created": { - "description": "A unix timestamp when this task was created. You cannot change this value.", + "bucket_id": { + "description": "BucketID is the ID of the kanban bucket this task belongs to.", "type": "integer" }, + "created": { + "description": "A timestamp when this task was created. You cannot change this value.", + "type": "string" + }, "created_by": { "description": "The user who initially created the task.", "type": "object", @@ -5209,16 +6496,16 @@ var doc = `{ "type": "boolean" }, "done_at": { - "description": "The unix timestamp when a task was marked as done.", - "type": "integer" + "description": "The time when a task was marked as done.", + "type": "string" }, "due_date": { - "description": "A unix timestamp when the task is due.", - "type": "integer" + "description": "The time when the task is due.", + "type": "string" }, "end_date": { "description": "When this task ends.", - "type": "integer" + "type": "string" }, "hex_color": { "description": "The task color in hex", @@ -5252,6 +6539,10 @@ var doc = `{ "description": "Determines how far a task is left from being done", "type": "number" }, + "position": { + "description": "The position of the task - any task list can be sorted as usual by this parameter.\nWhen accessing tasks via kanban buckets, this is primarily used to sort them based on a range\nWe're using a float64 here to make it possible to put any task within any two other tasks (by changing the number).\nYou would calculate the new position between two tasks with something like task3.position = (task2.position - task1.position) / 2.\nA 64-Bit float leaves plenty of room to initially give tasks a position with 2^16 difference to the previous task\nwhich also leaves a lot of room for rearranging and sorting later.", + "type": "number" + }, "priority": { "description": "The task priority. Can be anything you want, it is possible to sort by this later.", "type": "integer" @@ -5262,29 +6553,33 @@ var doc = `{ "$ref": "#/definitions/models.RelatedTaskMap" }, "reminder_dates": { - "description": "An array of unix timestamps when the user wants to be reminded of the task.", + "description": "An array of datetimes when the user wants to be reminded of the task.", "type": "array", "items": { - "type": "integer" + "type": "string" } }, "repeat_after": { "description": "An amount in seconds this task repeats itself. If this is set, when marking the task as done, it will mark itself as \"undone\" and then increase all remindes and the due date by its amount.", "type": "integer" }, + "repeat_from_current_date": { + "description": "If specified, a repeating task will repeat from the current date rather than the last set date.", + "type": "boolean" + }, "start_date": { "description": "When this task starts.", - "type": "integer" + "type": "string" }, - "text": { + "title": { "description": "The task text. This is what you'll see in the list.", "type": "string", "maxLength": 250, "minLength": 3 }, "updated": { - "description": "A unix timestamp when this task was last updated. You cannot change this value.", - "type": "integer" + "description": "A timestamp when this task was last updated. You cannot change this value.", + "type": "string" } } }, @@ -5292,7 +6587,7 @@ var doc = `{ "type": "object", "properties": { "created": { - "type": "integer" + "type": "string" }, "user_id": { "type": "integer" @@ -5303,7 +6598,7 @@ var doc = `{ "type": "object", "properties": { "created": { - "type": "integer" + "type": "string" }, "created_by": { "type": "object", @@ -5321,12 +6616,33 @@ var doc = `{ } } }, + "models.TaskComment": { + "type": "object", + "properties": { + "author": { + "type": "object", + "$ref": "#/definitions/user.User" + }, + "comment": { + "type": "string" + }, + "created": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "updated": { + "type": "string" + } + } + }, "models.TaskRelation": { "type": "object", "properties": { "created": { - "description": "A unix timestamp when this label was created. You cannot change this value.", - "type": "integer" + "description": "A timestamp when this label was created. You cannot change this value.", + "type": "string" }, "created_by": { "description": "The user who created this relation", @@ -5351,8 +6667,8 @@ var doc = `{ "type": "object", "properties": { "created": { - "description": "A unix timestamp when this relation was created. You cannot change this value.", - "type": "integer" + "description": "A timestamp when this relation was created. You cannot change this value.", + "type": "string" }, "created_by": { "description": "The user who created this team.", @@ -5381,8 +6697,8 @@ var doc = `{ "minLength": 5 }, "updated": { - "description": "A unix timestamp when this relation was last updated. You cannot change this value.", - "type": "integer" + "description": "A timestamp when this relation was last updated. You cannot change this value.", + "type": "string" } } }, @@ -5390,8 +6706,8 @@ var doc = `{ "type": "object", "properties": { "created": { - "description": "A unix timestamp when this relation was created. You cannot change this value.", - "type": "integer" + "description": "A timestamp when this relation was created. You cannot change this value.", + "type": "string" }, "id": { "description": "The unique, numeric id of this list \u003c-\u003e team relation.", @@ -5408,8 +6724,8 @@ var doc = `{ "type": "integer" }, "updated": { - "description": "A unix timestamp when this relation was last updated. You cannot change this value.", - "type": "integer" + "description": "A timestamp when this relation was last updated. You cannot change this value.", + "type": "string" } } }, @@ -5421,8 +6737,8 @@ var doc = `{ "type": "boolean" }, "created": { - "description": "A unix timestamp when this relation was created. You cannot change this value.", - "type": "integer" + "description": "A timestamp when this relation was created. You cannot change this value.", + "type": "string" }, "id": { "description": "The unique, numeric id of this team member relation.", @@ -5438,8 +6754,8 @@ var doc = `{ "type": "object", "properties": { "created": { - "description": "A unix timestamp when this relation was created. You cannot change this value.", - "type": "integer" + "description": "A timestamp when this relation was created. You cannot change this value.", + "type": "string" }, "id": { "description": "The unique, numeric id of this namespace \u003c-\u003e team relation.", @@ -5456,8 +6772,8 @@ var doc = `{ "type": "integer" }, "updated": { - "description": "A unix timestamp when this relation was last updated. You cannot change this value.", - "type": "integer" + "description": "A timestamp when this relation was last updated. You cannot change this value.", + "type": "string" } } }, @@ -5468,13 +6784,9 @@ var doc = `{ "description": "Whether or not the member is an admin of the team. See the docs for more about what a team admin can do", "type": "boolean" }, - "avatarUrl": { - "description": "The users md5-hashed email address, used to get the avatar from gravatar and the likes.", - "type": "string" - }, "created": { - "description": "A unix timestamp when this task was created. You cannot change this value.", - "type": "integer" + "description": "A timestamp when this task was created. You cannot change this value.", + "type": "string" }, "email": { "description": "The user's email address.", @@ -5486,8 +6798,8 @@ var doc = `{ "type": "integer" }, "updated": { - "description": "A unix timestamp when this task was last updated. You cannot change this value.", - "type": "integer" + "description": "A timestamp when this task was last updated. You cannot change this value.", + "type": "string" }, "username": { "description": "The username of the user. Is always unique.", @@ -5501,8 +6813,8 @@ var doc = `{ "type": "object", "properties": { "created": { - "description": "A unix timestamp when this relation was created. You cannot change this value.", - "type": "integer" + "description": "A timestamp when this relation was created. You cannot change this value.", + "type": "string" }, "created_by": { "description": "The user who created this team.", @@ -5534,52 +6846,7 @@ var doc = `{ "type": "integer" }, "updated": { - "description": "A unix timestamp when this relation was last updated. You cannot change this value.", - "type": "integer" - } - } - }, - "user.User": { - "type": "object", - "properties": { - "avatarUrl": { - "description": "The users md5-hashed email address, used to get the avatar from gravatar and the likes.", - "type": "string" - }, - "created": { - "description": "A unix timestamp when this task was created. You cannot change this value.", - "type": "integer" - }, - "email": { - "description": "The user's email address.", - "type": "string", - "maxLength": 250 - }, - "id": { - "description": "The unique, numeric id of this user.", - "type": "integer" - }, - "updated": { - "description": "A unix timestamp when this task was last updated. You cannot change this value.", - "type": "integer" - }, - "username": { - "description": "The username of the user. Is always unique.", - "type": "string", - "maxLength": 250, - "minLength": 3 - } - } - }, - "user.UserLogin": { - "type": "object", - "properties": { - "password": { - "description": "The password for the user.", - "type": "string" - }, - "username": { - "description": "The username used to log in.", + "description": "A timestamp when this relation was last updated. You cannot change this value.", "type": "string" } } @@ -5587,13 +6854,9 @@ var doc = `{ "models.UserWithRight": { "type": "object", "properties": { - "avatarUrl": { - "description": "The users md5-hashed email address, used to get the avatar from gravatar and the likes.", - "type": "string" - }, "created": { - "description": "A unix timestamp when this task was created. You cannot change this value.", - "type": "integer" + "description": "A timestamp when this task was created. You cannot change this value.", + "type": "string" }, "email": { "description": "The user's email address.", @@ -5608,9 +6871,156 @@ var doc = `{ "type": "integer" }, "updated": { - "description": "A unix timestamp when this task was last updated. You cannot change this value.", + "description": "A timestamp when this task was last updated. You cannot change this value.", + "type": "string" + }, + "username": { + "description": "The username of the user. Is always unique.", + "type": "string", + "maxLength": 250, + "minLength": 3 + } + } + }, + "todoist.Migration": { + "type": "object", + "properties": { + "code": { + "type": "string" + } + } + }, + "user.APIUserPassword": { + "type": "object", + "properties": { + "email": { + "description": "The user's email address", + "type": "string", + "maxLength": 250 + }, + "id": { + "description": "The unique, numeric id of this user.", "type": "integer" }, + "password": { + "description": "The user's password in clear text. Only used when registering the user.", + "type": "string", + "maxLength": 250, + "minLength": 8 + }, + "username": { + "description": "The username of the username. Is always unique.", + "type": "string", + "maxLength": 250, + "minLength": 3 + } + } + }, + "user.EmailConfirm": { + "type": "object", + "properties": { + "token": { + "description": "The email confirm token sent via email.", + "type": "string" + } + } + }, + "user.EmailUpdate": { + "type": "object", + "properties": { + "new_email": { + "description": "The new email address. Needs to be a valid email address.", + "type": "string" + }, + "password": { + "description": "The password of the user for confirmation.", + "type": "string" + } + } + }, + "user.Login": { + "type": "object", + "properties": { + "password": { + "description": "The password for the user.", + "type": "string" + }, + "totp_passcode": { + "description": "The totp passcode of a user. Only needs to be provided when enabled.", + "type": "string" + }, + "username": { + "description": "The username used to log in.", + "type": "string" + } + } + }, + "user.PasswordReset": { + "type": "object", + "properties": { + "new_password": { + "description": "The new password for this user.", + "type": "string" + }, + "token": { + "description": "The previously issued reset token.", + "type": "string" + } + } + }, + "user.PasswordTokenRequest": { + "type": "object", + "properties": { + "email": { + "type": "string", + "maxLength": 250 + } + } + }, + "user.TOTP": { + "type": "object", + "properties": { + "enabled": { + "description": "The totp entry will only be enabled after the user verified they have a working totp setup.", + "type": "boolean" + }, + "secret": { + "type": "string" + }, + "url": { + "description": "The totp url used to be able to enroll the user later", + "type": "string" + } + } + }, + "user.TOTPPasscode": { + "type": "object", + "properties": { + "passcode": { + "type": "string" + } + } + }, + "user.User": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this task was created. You cannot change this value.", + "type": "string" + }, + "email": { + "description": "The user's email address.", + "type": "string", + "maxLength": 250 + }, + "id": { + "description": "The unique, numeric id of this user.", + "type": "integer" + }, + "updated": { + "description": "A timestamp when this task was last updated. You cannot change this value.", + "type": "string" + }, "username": { "description": "The username of the user. Is always unique.", "type": "string", @@ -5647,6 +7057,12 @@ var doc = `{ "type": "string" } }, + "enabled_background_providers": { + "type": "array", + "items": { + "type": "string" + } + }, "frontend_url": { "type": "string" }, @@ -5662,11 +7078,28 @@ var doc = `{ "registration_enabled": { "type": "boolean" }, + "task_attachments_enabled": { + "type": "boolean" + }, + "totp_enabled": { + "type": "boolean" + }, "version": { "type": "string" } } }, + "web.HTTPError": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "message": { + "type": "string" + } + } + }, "wunderlist.Migration": { "type": "object", "properties": { diff --git a/pkg/swagger/swagger.json b/pkg/swagger/swagger.json index 295522af..8a3dcc34 100644 --- a/pkg/swagger/swagger.json +++ b/pkg/swagger/swagger.json @@ -15,6 +15,146 @@ }, "basePath": "/api/v1", "paths": { + "/backgrounds/unsplash/image/{image}": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Get an unsplash image. **Returns json on error.**", + "produces": [ + "application/octet-stream" + ], + "tags": [ + "list" + ], + "summary": "Get an unsplash image", + "parameters": [ + { + "type": "integer", + "description": "Unsplash Image ID", + "name": "thumb", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The image", + "schema": { + "type": "" + } + }, + "404": { + "description": "The image does not exist.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/backgrounds/unsplash/image/{image}/thumb": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Get an unsplash thumbnail image. The thumbnail is cropped to a max width of 200px. **Returns json on error.**", + "produces": [ + "application/octet-stream" + ], + "tags": [ + "list" + ], + "summary": "Get an unsplash thumbnail image", + "parameters": [ + { + "type": "integer", + "description": "Unsplash Image ID", + "name": "thumb", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The thumbnail", + "schema": { + "type": "" + } + }, + "404": { + "description": "The image does not exist.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/backgrounds/unsplash/search": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Search for a list background from unsplash", + "produces": [ + "application/json" + ], + "tags": [ + "list" + ], + "summary": "Search for a background from unsplash", + "parameters": [ + { + "type": "string", + "description": "Search backgrounds from unsplash with this search term.", + "name": "s", + "in": "query" + }, + { + "type": "integer", + "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", + "name": "p", + "in": "query" + } + ], + "responses": { + "200": { + "description": "An array with photos", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/background.Image" + } + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, "/info": { "get": { "description": "Returns the version, frontendurl, motd and various settings of Vikunja", @@ -115,7 +255,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.Label" } } @@ -130,7 +269,7 @@ "400": { "description": "Invalid label object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -179,13 +318,13 @@ "403": { "description": "The user does not have access to the label", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "Label not found", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -227,7 +366,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.Label" } } @@ -242,19 +380,19 @@ "400": { "description": "Invalid label object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "Not allowed to update the label.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "Label not found.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -301,13 +439,13 @@ "403": { "description": "Not allowed to delete the label.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "Label not found.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -355,6 +493,12 @@ "description": "Search lists by title.", "name": "s", "in": "query" + }, + { + "type": "boolean", + "description": "If true, also returns all archived lists.", + "name": "is_archived", + "in": "query" } ], "responses": { @@ -370,7 +514,7 @@ "403": { "description": "The user does not have access to the list", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -419,7 +563,7 @@ "403": { "description": "The user does not have access to the list", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -461,7 +605,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.Task" } } @@ -476,13 +619,13 @@ "400": { "description": "Invalid task object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "The user does not have access to the list", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -524,7 +667,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.List" } } @@ -539,13 +681,13 @@ "400": { "description": "Invalid list object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "The user does not have access to the list", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -589,13 +731,299 @@ "400": { "description": "Invalid list object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "The user does not have access to the list", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/lists/{id}/background": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Get the list background of a specific list. **Returns json on error.**", + "produces": [ + "application/octet-stream" + ], + "tags": [ + "list" + ], + "summary": "Get the list background", + "parameters": [ + { + "type": "integer", + "description": "List ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The list background file.", + "schema": { + "type": "" + } + }, + "403": { + "description": "No access to this list.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "404": { + "description": "The list does not exist.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/lists/{id}/backgrounds/unsplash": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Sets a photo from unsplash as list background.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "list" + ], + "summary": "Set an unsplash photo as list background", + "parameters": [ + { + "type": "integer", + "description": "List ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "The image you want to set as background", + "name": "list", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/background.Image" + } + } + ], + "responses": { + "200": { + "description": "The background has been successfully set.", + "schema": { + "$ref": "#/definitions/models.List" + } + }, + "400": { + "description": "Invalid image object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "The user does not have access to the list", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/lists/{id}/backgrounds/upload": { + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Upload a list background.", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "list" + ], + "summary": "Upload a list background", + "parameters": [ + { + "type": "integer", + "description": "List ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "The file as single file.", + "name": "background", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "The background was set successfully.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "403": { + "description": "File too large.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "404": { + "description": "The list does not exist.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/lists/{id}/buckets": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns all kanban buckets with belong to a list including their tasks.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Get all kanban buckets of a list", + "parameters": [ + { + "type": "integer", + "description": "List Id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The buckets with their tasks", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Bucket" + } + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Creates a new kanban bucket on a list.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Create a new bucket", + "parameters": [ + { + "type": "integer", + "description": "List Id", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "The bucket object", + "name": "bucket", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.Bucket" + } + } + ], + "responses": { + "200": { + "description": "The created bucket object.", + "schema": { + "$ref": "#/definitions/models.Bucket" + } + }, + "400": { + "description": "Invalid bucket object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The list does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -646,20 +1074,20 @@ "schema": { "type": "array", "items": { - "$ref": "#/definitions/models.User" + "$ref": "#/definitions/user.User" } } }, "400": { "description": "Something's invalid.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "401": { "description": "The user does not have the right to see the list.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -729,7 +1157,7 @@ "403": { "description": "No right to see the list.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -771,7 +1199,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.TeamList" } } @@ -786,19 +1213,19 @@ "400": { "description": "Invalid team list object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "The user does not have access to the list", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "The team does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -868,7 +1295,7 @@ "403": { "description": "No right to see the list.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -910,7 +1337,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.ListUser" } } @@ -925,19 +1351,144 @@ "400": { "description": "Invalid user list object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "The user does not have access to the list", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "The user does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/lists/{listID}/buckets/{bucketID}": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Updates an existing kanban bucket.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Update an existing bucket", + "parameters": [ + { + "type": "integer", + "description": "List Id", + "name": "listID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Bucket Id", + "name": "bucketID", + "in": "path", + "required": true + }, + { + "description": "The bucket object", + "name": "bucket", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.Bucket" + } + } + ], + "responses": { + "200": { + "description": "The created bucket object.", + "schema": { + "$ref": "#/definitions/models.Bucket" + } + }, + "400": { + "description": "Invalid bucket object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The bucket does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Deletes an existing kanban bucket and dissociates all of its task. It does not delete any tasks. You cannot delete the last bucket on a list.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Deletes an existing bucket", + "parameters": [ + { + "type": "integer", + "description": "List Id", + "name": "listID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Bucket Id", + "name": "bucketID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully deleted.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "404": { + "description": "The bucket does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -995,7 +1546,7 @@ }, { "type": "string", - "description": "The sorting parameter. You can pass this multiple times to get the tasks ordered by multiple different parametes, along with `order_by`. Possible values to sort by are `id`, `text`, `description`, `done`, `done_at_unix`, `due_date_unix`, `created_by_id`, `list_id`, `repeat_after`, `priority`, `start_date_unix`, `end_date_unix`, `hex_color`, `percent_done`, `uid`, `created`, `updated`. Default is `id`.", + "description": "The sorting parameter. You can pass this multiple times to get the tasks ordered by multiple different parametes, along with `order_by`. Possible values to sort by are `id`, `title`, `description`, `done`, `done_at`, `due_date`, `created_by_id`, `list_id`, `repeat_after`, `priority`, `start_date`, `end_date`, `hex_color`, `percent_done`, `uid`, `created`, `updated`. Default is `id`.", "name": "sort_by", "in": "query" }, @@ -1006,15 +1557,33 @@ "in": "query" }, { - "type": "integer", - "description": "The start date parameter to filter by. Expects a unix timestamp. If no end date, but a start date is specified, the end date is set to the current time.", - "name": "startdate", + "type": "string", + "description": "The name of the field to filter by. Accepts an array for multiple filters which will be chanied together, all supplied filter must match.", + "name": "filter_by", "in": "query" }, { - "type": "integer", - "description": "The end date parameter to filter by. Expects a unix timestamp. If no start date, but an end date is specified, the start date is set to the current time.", - "name": "enddate", + "type": "string", + "description": "The value to filter for.", + "name": "filter_value", + "in": "query" + }, + { + "type": "string", + "description": "The comparator to use for a filter. Available values are `equals`, `greater`, `greater_equals`, `less` and `less_equals`. Defaults to `equals`", + "name": "filter_comparator", + "in": "query" + }, + { + "type": "string", + "description": "The concatinator to use for filters. Available values are `and` or `or`. Defaults to `or`.", + "name": "filter_concat", + "in": "query" + }, + { + "type": "string", + "description": "If set to true the result will include filtered fields whose value is set to `null`. Available values are `true` or `false`. Defaults to `false`.", + "name": "filter_include_nulls", "in": "query" } ], @@ -1076,7 +1645,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.TeamList" } } @@ -1091,13 +1659,13 @@ "403": { "description": "The user does not have admin-access to the list", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "Team or list does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -1148,13 +1716,13 @@ "403": { "description": "The user does not have access to the list", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "Team or list does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -1205,7 +1773,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.ListUser" } } @@ -1220,13 +1787,13 @@ "403": { "description": "The user does not have admin-access to the list", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "User or list does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -1277,13 +1844,13 @@ "403": { "description": "The user does not have access to the list", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "user or list does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -1389,7 +1956,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.LinkSharing" } } @@ -1404,19 +1970,19 @@ "400": { "description": "Invalid link share object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "Not allowed to add the list share.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "The list does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -1472,13 +2038,13 @@ "403": { "description": "No access to the list", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "Share Link not found.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -1532,13 +2098,13 @@ "403": { "description": "Not allowed to remove the link.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "Share Link not found.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -1570,8 +2136,7 @@ "in": "body", "required": true, "schema": { - "type": "object", - "$ref": "#/definitions/models.UserLogin" + "$ref": "#/definitions/user.Login" } } ], @@ -1593,6 +2158,119 @@ "schema": { "$ref": "#/definitions/models.Message" } + }, + "412": { + "description": "Invalid totp passcode.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/migration/todoist/auth": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns the auth url where the user needs to get its auth code. This code can then be used to migrate everything from todoist to Vikunja.", + "produces": [ + "application/json" + ], + "tags": [ + "migration" + ], + "summary": "Get the auth url from todoist", + "responses": { + "200": { + "description": "The auth url.", + "schema": { + "$ref": "#/definitions/handler.AuthURL" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/migration/todoist/migrate": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Migrates all projects, tasks, notes, reminders, subtasks and files from todoist to vikunja.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "migration" + ], + "summary": "Migrate all lists, tasks etc. from todoist", + "parameters": [ + { + "description": "The auth code previously obtained from the auth url. See the docs for /migration/todoist/auth.", + "name": "migrationCode", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/todoist.Migration" + } + } + ], + "responses": { + "200": { + "description": "A message telling you everything was migrated successfully.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/migration/todoist/status": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns if the current user already did the migation or not. This is useful to show a confirmation message in the frontend if the user is trying to do the same migration again.", + "produces": [ + "application/json" + ], + "tags": [ + "migration" + ], + "summary": "Get migration status", + "responses": { + "200": { + "description": "The migration status", + "schema": { + "$ref": "#/definitions/migration.Status" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } } } } @@ -1653,7 +2331,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/wunderlist.Migration" } } @@ -1737,7 +2414,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.Namespace" } } @@ -1752,13 +2428,13 @@ "400": { "description": "Invalid namespace object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "The user does not have access to the namespace", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -1806,6 +2482,12 @@ "description": "Search namespaces by name.", "name": "s", "in": "query" + }, + { + "type": "boolean", + "description": "If true, also returns all archived namespaces.", + "name": "is_archived", + "in": "query" } ], "responses": { @@ -1850,7 +2532,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.Namespace" } } @@ -1865,13 +2546,13 @@ "400": { "description": "Invalid namespace object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "The user does not have access to the namespace", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -1920,7 +2601,7 @@ "403": { "description": "The user does not have access to that namespace.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -1964,13 +2645,13 @@ "400": { "description": "Invalid namespace object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "The user does not have access to the namespace", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -2098,7 +2779,7 @@ "403": { "description": "No right to see the namespace.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -2140,7 +2821,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.TeamNamespace" } } @@ -2155,19 +2835,19 @@ "400": { "description": "Invalid team namespace object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "The team does not have access to the namespace", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "The team does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -2237,7 +2917,7 @@ "403": { "description": "No right to see the namespace.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -2279,7 +2959,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.NamespaceUser" } } @@ -2294,19 +2973,19 @@ "400": { "description": "Invalid user namespace object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "The user does not have access to the namespace", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "The user does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -2350,7 +3029,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.List" } } @@ -2365,13 +3043,13 @@ "400": { "description": "Invalid list object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "The user does not have access to the list", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -2422,7 +3100,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.TeamNamespace" } } @@ -2437,13 +3114,13 @@ "403": { "description": "The team does not have admin-access to the namespace", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "Team or namespace does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -2494,13 +3171,13 @@ "403": { "description": "The team does not have access to the namespace", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "team or namespace does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -2551,7 +3228,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.NamespaceUser" } } @@ -2566,13 +3242,13 @@ "403": { "description": "The user does not have admin-access to the namespace", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "User or namespace does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -2623,13 +3299,13 @@ "403": { "description": "The user does not have access to the namespace", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "user or namespace does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -2661,8 +3337,7 @@ "in": "body", "required": true, "schema": { - "type": "object", - "$ref": "#/definitions/models.APIUserPassword" + "$ref": "#/definitions/user.APIUserPassword" } } ], @@ -2670,13 +3345,13 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/models.User" + "$ref": "#/definitions/user.User" } }, "400": { "description": "No or invalid user register object provided / User already exists.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -2720,7 +3395,7 @@ "400": { "description": "Invalid link share object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -2771,20 +3446,38 @@ }, { "type": "string", - "description": "The sorting parameter. Possible values to sort by are priority, prioritydesc, priorityasc, duedate, duedatedesc, duedateasc.", - "name": "sort", + "description": "The sorting parameter. You can pass this multiple times to get the tasks ordered by multiple different parametes, along with `order_by`. Possible values to sort by are `id`, `text`, `description`, `done`, `done_at`, `due_date`, `created_by_id`, `list_id`, `repeat_after`, `priority`, `start_date`, `end_date`, `hex_color`, `percent_done`, `uid`, `created`, `updated`. Default is `id`.", + "name": "sort_by", "in": "query" }, { - "type": "integer", - "description": "The start date parameter to filter by. Expects a unix timestamp. If no end date, but a start date is specified, the end date is set to the current time.", - "name": "startdate", + "type": "string", + "description": "The ordering parameter. Possible values to order by are `asc` or `desc`. Default is `asc`.", + "name": "order_by", "in": "query" }, { - "type": "integer", - "description": "The end date parameter to filter by. Expects a unix timestamp. If no start date, but an end date is specified, the start date is set to the current time.", - "name": "enddate", + "type": "string", + "description": "The name of the field to filter by. Accepts an array for multiple filters which will be chanied together, all supplied filter must match.", + "name": "filter_by", + "in": "query" + }, + { + "type": "string", + "description": "The value to filter for.", + "name": "filter_value", + "in": "query" + }, + { + "type": "string", + "description": "The comparator to use for a filter. Available values are `equals`, `greater`, `greater_equals`, `less` and `less_equals`. Defaults to `equals`", + "name": "filter_comparator", + "in": "query" + }, + { + "type": "string", + "description": "The concatinator to use for filters. Available values are `and` or `or`. Defaults to `or`.", + "name": "filter_concat", "in": "query" } ], @@ -2832,7 +3525,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.BulkTask" } } @@ -2847,13 +3539,13 @@ "400": { "description": "Invalid task object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "The user does not have access to the task (aka its list)", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -2946,7 +3638,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.Task" } } @@ -2961,13 +3652,13 @@ "400": { "description": "Invalid task object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "The user does not have access to the task (aka its list)", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -3011,13 +3702,13 @@ "400": { "description": "Invalid task ID provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "The user does not have access to the list", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -3329,7 +4020,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/definitions/models.User" + "$ref": "#/definitions/user.User" } } }, @@ -3365,7 +4056,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.TaskAssginee" } }, @@ -3387,7 +4077,7 @@ "400": { "description": "Invalid assignee object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -3424,7 +4114,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.BulkAssignees" } }, @@ -3446,7 +4135,7 @@ "400": { "description": "Invalid assignee object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -3502,7 +4191,291 @@ "403": { "description": "Not allowed to delete the assignee.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/{taskID}/comments": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Get all task comments. The user doing this need to have at least read access to the task.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Get all task comments", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The array with all task comments", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.TaskComment" + } + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Create a new task comment. The user doing this need to have at least write access to the task this comment should belong to.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Create a new task comment", + "parameters": [ + { + "description": "The task comment object", + "name": "relation", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.TaskComment" + } + }, + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The created task comment object.", + "schema": { + "$ref": "#/definitions/models.TaskComment" + } + }, + "400": { + "description": "Invalid task comment object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/{taskID}/comments/{commentID}": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Remove a task comment. The user doing this need to have at least read access to the task this comment belongs to.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Remove a task comment", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Comment ID", + "name": "commentID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The task comment object.", + "schema": { + "$ref": "#/definitions/models.TaskComment" + } + }, + "400": { + "description": "Invalid task comment object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The task comment was not found.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Update an existing task comment. The user doing this need to have at least write access to the task this comment belongs to.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Update an existing task comment", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Comment ID", + "name": "commentID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The updated task comment object.", + "schema": { + "$ref": "#/definitions/models.TaskComment" + } + }, + "400": { + "description": "Invalid task comment object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The task comment was not found.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Remove a task comment. The user doing this need to have at least write access to the task this comment belongs to.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Remove a task comment", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Comment ID", + "name": "commentID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The task comment was successfully deleted.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Invalid task comment object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The task comment was not found.", + "schema": { + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -3539,7 +4512,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.LabelTaskBulk" } }, @@ -3561,7 +4533,7 @@ "400": { "description": "Invalid label object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -3598,7 +4570,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.TaskRelation" } }, @@ -3620,7 +4591,7 @@ "400": { "description": "Invalid task relation object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -3654,7 +4625,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.TaskRelation" } }, @@ -3676,13 +4646,13 @@ "400": { "description": "Invalid task relation object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "The task relation was not found.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -3788,7 +4758,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.LabelTask" } } @@ -3803,19 +4772,19 @@ "400": { "description": "Invalid label object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "Not allowed to add the label.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "The label does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -3871,13 +4840,13 @@ "403": { "description": "Not allowed to remove the label.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "Label not found.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -3969,7 +4938,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.Team" } } @@ -3984,7 +4952,7 @@ "400": { "description": "Invalid team object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -3997,6 +4965,53 @@ } }, "/teams/{id}": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns a team by its ID.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "team" + ], + "summary": "Gets one team", + "parameters": [ + { + "type": "integer", + "description": "Team ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The team", + "schema": { + "$ref": "#/definitions/models.Team" + } + }, + "403": { + "description": "The user does not have access to the team", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, "post": { "security": [ { @@ -4028,7 +5043,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.Team" } } @@ -4043,7 +5057,7 @@ "400": { "description": "Invalid team object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -4087,7 +5101,7 @@ "400": { "description": "Invalid team object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -4131,7 +5145,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.TeamMember" } } @@ -4146,13 +5159,13 @@ "400": { "description": "Invalid member object provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "403": { "description": "The user does not have access to the team", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -4233,13 +5246,13 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/models.User" + "$ref": "#/definitions/user.User" } }, "404": { "description": "User does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -4271,8 +5284,7 @@ "in": "body", "required": true, "schema": { - "type": "object", - "$ref": "#/definitions/models.EmailConfirm" + "$ref": "#/definitions/user.EmailConfirm" } } ], @@ -4286,7 +5298,7 @@ "412": { "description": "Bad token provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -4323,7 +5335,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/v1.UserPassword" } } @@ -4338,13 +5349,13 @@ "400": { "description": "Something's invalid.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "404": { "description": "User does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -4376,8 +5387,7 @@ "in": "body", "required": true, "schema": { - "type": "object", - "$ref": "#/definitions/models.PasswordReset" + "$ref": "#/definitions/user.PasswordReset" } } ], @@ -4391,7 +5401,7 @@ "400": { "description": "Bad token provided.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -4423,8 +5433,7 @@ "in": "body", "required": true, "schema": { - "type": "object", - "$ref": "#/definitions/models.PasswordTokenRequest" + "$ref": "#/definitions/user.PasswordTokenRequest" } } ], @@ -4438,7 +5447,7 @@ "404": { "description": "The user does not exist.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -4450,6 +5459,297 @@ } } }, + "/user/settings/email": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Lets the current user change their email address.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Update email address", + "parameters": [ + { + "description": "The new email address and current password.", + "name": "userEmailUpdate", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user.EmailUpdate" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "User does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/settings/totp": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns the current user totp setting or an error if it is not enabled.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Totp setting for the current user", + "responses": { + "200": { + "description": "The totp settings.", + "schema": { + "$ref": "#/definitions/user.TOTP" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/settings/totp/disable": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Disables any totp settings for the current user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Disable totp settings", + "parameters": [ + { + "description": "The current user's password (only password is enough).", + "name": "totp", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user.Login" + } + } + ], + "responses": { + "200": { + "description": "Successfully disabled", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "User does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/settings/totp/enable": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Enables a previously enrolled totp setting by providing a totp passcode.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Enable a previously enrolled totp setting.", + "parameters": [ + { + "description": "The totp passcode.", + "name": "totp", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user.TOTPPasscode" + } + } + ], + "responses": { + "200": { + "description": "Successfully enabled", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "User does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "412": { + "description": "TOTP is not enrolled.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/settings/totp/enroll": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Creates an initial setup for the user in the db. After this step, the user needs to verify they have a working totp setup with the \"enable totp\" endpoint.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Enroll a user into totp", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.TOTP" + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "User does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/settings/totp/qrcode": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns a qr code for easier setup at end user's devices.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Totp QR Code", + "responses": { + "200": { + "description": "The qr code as jpeg image", + "schema": { + "type": "" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, "/user/token": { "post": { "description": "Returns a new valid jwt user token with an extended length.", @@ -4511,14 +5811,14 @@ "schema": { "type": "array", "items": { - "$ref": "#/definitions/models.User" + "$ref": "#/definitions/user.User" } } }, "400": { "description": "Something's invalid.", "schema": { - "$ref": "#/definitions/code.vikunja.io/web.HTTPError" + "$ref": "#/definitions/web.HTTPError" } }, "500": { @@ -4529,9 +5829,77 @@ } } } + }, + "/{username}/avatar": { + "get": { + "description": "Returns the user avatar as image.", + "produces": [ + "application/octet-stream" + ], + "tags": [ + "user" + ], + "summary": "User Avatar", + "parameters": [ + { + "type": "string", + "description": "The username of the user who's avatar you want to get", + "name": "username", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "The size of the avatar you want to get", + "name": "size", + "in": "query" + } + ], + "responses": { + "200": { + "description": "The avatar", + "schema": { + "type": "" + } + }, + "404": { + "description": "The user does not exist.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } } }, "definitions": { + "afero.File": { + "type": "object" + }, + "background.Image": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "info": { + "description": "This can be used to supply extra information from an image provider to clients", + "type": "object" + }, + "thumb": { + "type": "string" + }, + "url": { + "type": "string" + } + } + }, "files.File": { "type": "object", "properties": { @@ -4569,12 +5937,942 @@ "migrator_name": { "type": "string" }, - "time_unix": { + "time": { + "type": "string" + } + } + }, + "models.Bucket": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this bucket was created. You cannot change this value.", + "type": "string" + }, + "created_by": { + "description": "The user who initially created the bucket.", + "type": "object", + "$ref": "#/definitions/user.User" + }, + "id": { + "description": "The unique, numeric id of this bucket.", + "type": "integer" + }, + "list_id": { + "description": "The list this bucket belongs to.", + "type": "integer" + }, + "tasks": { + "description": "All tasks which belong to this bucket.", + "type": "array", + "items": { + "$ref": "#/definitions/models.Task" + } + }, + "title": { + "description": "The title of this bucket.", + "type": "string", + "minLength": 1 + }, + "updated": { + "description": "A timestamp when this bucket was last updated. You cannot change this value.", + "type": "string" + } + } + }, + "models.BulkAssignees": { + "type": "object", + "properties": { + "assignees": { + "description": "A list with all assignees", + "type": "array", + "items": { + "$ref": "#/definitions/user.User" + } + } + } + }, + "models.BulkTask": { + "type": "object", + "properties": { + "assignees": { + "description": "An array of users who are assigned to this task", + "type": "array", + "items": { + "$ref": "#/definitions/user.User" + } + }, + "attachments": { + "description": "All attachments this task has", + "type": "array", + "items": { + "$ref": "#/definitions/models.TaskAttachment" + } + }, + "bucket_id": { + "description": "BucketID is the ID of the kanban bucket this task belongs to.", + "type": "integer" + }, + "created": { + "description": "A timestamp when this task was created. You cannot change this value.", + "type": "string" + }, + "created_by": { + "description": "The user who initially created the task.", + "type": "object", + "$ref": "#/definitions/user.User" + }, + "description": { + "description": "The task description.", + "type": "string" + }, + "done": { + "description": "Whether a task is done or not.", + "type": "boolean" + }, + "done_at": { + "description": "The time when a task was marked as done.", + "type": "string" + }, + "due_date": { + "description": "The time when the task is due.", + "type": "string" + }, + "end_date": { + "description": "When this task ends.", + "type": "string" + }, + "hex_color": { + "description": "The task color in hex", + "type": "string", + "maxLength": 6 + }, + "id": { + "description": "The unique, numeric id of this task.", + "type": "integer" + }, + "identifier": { + "description": "The task identifier, based on the list identifier and the task's index", + "type": "string" + }, + "index": { + "description": "The task index, calculated per list", + "type": "integer" + }, + "labels": { + "description": "An array of labels which are associated with this task.", + "type": "array", + "items": { + "$ref": "#/definitions/models.Label" + } + }, + "list_id": { + "description": "The list this task belongs to.", + "type": "integer" + }, + "percent_done": { + "description": "Determines how far a task is left from being done", + "type": "number" + }, + "position": { + "description": "The position of the task - any task list can be sorted as usual by this parameter.\nWhen accessing tasks via kanban buckets, this is primarily used to sort them based on a range\nWe're using a float64 here to make it possible to put any task within any two other tasks (by changing the number).\nYou would calculate the new position between two tasks with something like task3.position = (task2.position - task1.position) / 2.\nA 64-Bit float leaves plenty of room to initially give tasks a position with 2^16 difference to the previous task\nwhich also leaves a lot of room for rearranging and sorting later.", + "type": "number" + }, + "priority": { + "description": "The task priority. Can be anything you want, it is possible to sort by this later.", + "type": "integer" + }, + "related_tasks": { + "description": "All related tasks, grouped by their relation kind", + "type": "object", + "$ref": "#/definitions/models.RelatedTaskMap" + }, + "reminder_dates": { + "description": "An array of datetimes when the user wants to be reminded of the task.", + "type": "array", + "items": { + "type": "string" + } + }, + "repeat_after": { + "description": "An amount in seconds this task repeats itself. If this is set, when marking the task as done, it will mark itself as \"undone\" and then increase all remindes and the due date by its amount.", + "type": "integer" + }, + "repeat_from_current_date": { + "description": "If specified, a repeating task will repeat from the current date rather than the last set date.", + "type": "boolean" + }, + "start_date": { + "description": "When this task starts.", + "type": "string" + }, + "task_ids": { + "description": "A list of task ids to update", + "type": "array", + "items": { + "type": "integer" + } + }, + "title": { + "description": "The task text. This is what you'll see in the list.", + "type": "string", + "maxLength": 250, + "minLength": 3 + }, + "updated": { + "description": "A timestamp when this task was last updated. You cannot change this value.", + "type": "string" + } + } + }, + "models.Label": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this label was created. You cannot change this value.", + "type": "string" + }, + "created_by": { + "description": "The user who created this label", + "type": "object", + "$ref": "#/definitions/user.User" + }, + "description": { + "description": "The label description.", + "type": "string" + }, + "hex_color": { + "description": "The color this label has", + "type": "string", + "maxLength": 6 + }, + "id": { + "description": "The unique, numeric id of this label.", + "type": "integer" + }, + "title": { + "description": "The title of the lable. You'll see this one on tasks associated with it.", + "type": "string", + "maxLength": 250, + "minLength": 3 + }, + "updated": { + "description": "A timestamp when this label was last updated. You cannot change this value.", + "type": "string" + } + } + }, + "models.LabelTask": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this task was created. You cannot change this value.", + "type": "string" + }, + "label_id": { + "description": "The label id you want to associate with a task.", "type": "integer" } } }, - "models.APIUserPassword": { + "models.LabelTaskBulk": { + "type": "object", + "properties": { + "labels": { + "description": "All labels you want to update at once.", + "type": "array", + "items": { + "$ref": "#/definitions/models.Label" + } + } + } + }, + "models.LinkSharing": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this list was shared. You cannot change this value.", + "type": "string" + }, + "hash": { + "description": "The public id to get this shared list", + "type": "string" + }, + "id": { + "description": "The ID of the shared thing", + "type": "integer" + }, + "right": { + "description": "The right this list is shared with. 0 = Read only, 1 = Read \u0026 Write, 2 = Admin. See the docs for more details.", + "type": "integer", + "default": 0, + "maximum": 2 + }, + "shared_by": { + "description": "The user who shared this list", + "type": "object", + "$ref": "#/definitions/user.User" + }, + "sharing_type": { + "description": "The kind of this link. 0 = undefined, 1 = without password, 2 = with password (currently not implemented).", + "type": "integer", + "default": 0, + "maximum": 2 + }, + "updated": { + "description": "A timestamp when this share was last updated. You cannot change this value.", + "type": "string" + } + } + }, + "models.List": { + "type": "object", + "properties": { + "background_information": { + "description": "Holds extra information about the background set since some background providers require attribution or similar. If not null, the background can be accessed at /lists/{listID}/background", + "type": "object" + }, + "created": { + "description": "A timestamp when this list was created. You cannot change this value.", + "type": "string" + }, + "description": { + "description": "The description of the list.", + "type": "string" + }, + "hex_color": { + "description": "The hex color of this list", + "type": "string", + "maxLength": 6 + }, + "id": { + "description": "The unique, numeric id of this list.", + "type": "integer" + }, + "identifier": { + "description": "The unique list short identifier. Used to build task identifiers.", + "type": "string", + "maxLength": 10, + "minLength": 0 + }, + "is_archived": { + "description": "Whether or not a list is archived.", + "type": "boolean" + }, + "namespace_id": { + "type": "integer" + }, + "owner": { + "description": "The user who created this list.", + "type": "object", + "$ref": "#/definitions/user.User" + }, + "title": { + "description": "The title of the list. You'll see this in the namespace overview.", + "type": "string", + "maxLength": 250, + "minLength": 3 + }, + "updated": { + "description": "A timestamp when this list was last updated. You cannot change this value.", + "type": "string" + } + } + }, + "models.ListUser": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this relation was created. You cannot change this value.", + "type": "string" + }, + "id": { + "description": "The unique, numeric id of this list \u003c-\u003e user relation.", + "type": "integer" + }, + "right": { + "description": "The right this user has. 0 = Read only, 1 = Read \u0026 Write, 2 = Admin. See the docs for more details.", + "type": "integer", + "default": 0, + "maximum": 2 + }, + "updated": { + "description": "A timestamp when this relation was last updated. You cannot change this value.", + "type": "string" + }, + "user_id": { + "description": "The username.", + "type": "string" + } + } + }, + "models.Message": { + "type": "object", + "properties": { + "message": { + "description": "A standard message.", + "type": "string" + } + } + }, + "models.Namespace": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this namespace was created. You cannot change this value.", + "type": "string" + }, + "description": { + "description": "The description of the namespace", + "type": "string" + }, + "hex_color": { + "description": "The hex color of this namespace", + "type": "string", + "maxLength": 6 + }, + "id": { + "description": "The unique, numeric id of this namespace.", + "type": "integer" + }, + "is_archived": { + "description": "Whether or not a namespace is archived.", + "type": "boolean" + }, + "owner": { + "description": "The user who owns this namespace", + "type": "object", + "$ref": "#/definitions/user.User" + }, + "title": { + "description": "The name of this namespace.", + "type": "string", + "maxLength": 250, + "minLength": 5 + }, + "updated": { + "description": "A timestamp when this namespace was last updated. You cannot change this value.", + "type": "string" + } + } + }, + "models.NamespaceUser": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this relation was created. You cannot change this value.", + "type": "string" + }, + "id": { + "description": "The unique, numeric id of this namespace \u003c-\u003e user relation.", + "type": "integer" + }, + "right": { + "description": "The right this user has. 0 = Read only, 1 = Read \u0026 Write, 2 = Admin. See the docs for more details.", + "type": "integer", + "default": 0, + "maximum": 2 + }, + "updated": { + "description": "A timestamp when this relation was last updated. You cannot change this value.", + "type": "string" + }, + "user_id": { + "description": "The username.", + "type": "string" + } + } + }, + "models.NamespaceWithLists": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this namespace was created. You cannot change this value.", + "type": "string" + }, + "description": { + "description": "The description of the namespace", + "type": "string" + }, + "hex_color": { + "description": "The hex color of this namespace", + "type": "string", + "maxLength": 6 + }, + "id": { + "description": "The unique, numeric id of this namespace.", + "type": "integer" + }, + "is_archived": { + "description": "Whether or not a namespace is archived.", + "type": "boolean" + }, + "lists": { + "type": "array", + "items": { + "$ref": "#/definitions/models.List" + } + }, + "owner": { + "description": "The user who owns this namespace", + "type": "object", + "$ref": "#/definitions/user.User" + }, + "title": { + "description": "The name of this namespace.", + "type": "string", + "maxLength": 250, + "minLength": 5 + }, + "updated": { + "description": "A timestamp when this namespace was last updated. You cannot change this value.", + "type": "string" + } + } + }, + "models.RelatedTaskMap": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Task" + } + } + }, + "models.Task": { + "type": "object", + "properties": { + "assignees": { + "description": "An array of users who are assigned to this task", + "type": "array", + "items": { + "$ref": "#/definitions/user.User" + } + }, + "attachments": { + "description": "All attachments this task has", + "type": "array", + "items": { + "$ref": "#/definitions/models.TaskAttachment" + } + }, + "bucket_id": { + "description": "BucketID is the ID of the kanban bucket this task belongs to.", + "type": "integer" + }, + "created": { + "description": "A timestamp when this task was created. You cannot change this value.", + "type": "string" + }, + "created_by": { + "description": "The user who initially created the task.", + "type": "object", + "$ref": "#/definitions/user.User" + }, + "description": { + "description": "The task description.", + "type": "string" + }, + "done": { + "description": "Whether a task is done or not.", + "type": "boolean" + }, + "done_at": { + "description": "The time when a task was marked as done.", + "type": "string" + }, + "due_date": { + "description": "The time when the task is due.", + "type": "string" + }, + "end_date": { + "description": "When this task ends.", + "type": "string" + }, + "hex_color": { + "description": "The task color in hex", + "type": "string", + "maxLength": 6 + }, + "id": { + "description": "The unique, numeric id of this task.", + "type": "integer" + }, + "identifier": { + "description": "The task identifier, based on the list identifier and the task's index", + "type": "string" + }, + "index": { + "description": "The task index, calculated per list", + "type": "integer" + }, + "labels": { + "description": "An array of labels which are associated with this task.", + "type": "array", + "items": { + "$ref": "#/definitions/models.Label" + } + }, + "list_id": { + "description": "The list this task belongs to.", + "type": "integer" + }, + "percent_done": { + "description": "Determines how far a task is left from being done", + "type": "number" + }, + "position": { + "description": "The position of the task - any task list can be sorted as usual by this parameter.\nWhen accessing tasks via kanban buckets, this is primarily used to sort them based on a range\nWe're using a float64 here to make it possible to put any task within any two other tasks (by changing the number).\nYou would calculate the new position between two tasks with something like task3.position = (task2.position - task1.position) / 2.\nA 64-Bit float leaves plenty of room to initially give tasks a position with 2^16 difference to the previous task\nwhich also leaves a lot of room for rearranging and sorting later.", + "type": "number" + }, + "priority": { + "description": "The task priority. Can be anything you want, it is possible to sort by this later.", + "type": "integer" + }, + "related_tasks": { + "description": "All related tasks, grouped by their relation kind", + "type": "object", + "$ref": "#/definitions/models.RelatedTaskMap" + }, + "reminder_dates": { + "description": "An array of datetimes when the user wants to be reminded of the task.", + "type": "array", + "items": { + "type": "string" + } + }, + "repeat_after": { + "description": "An amount in seconds this task repeats itself. If this is set, when marking the task as done, it will mark itself as \"undone\" and then increase all remindes and the due date by its amount.", + "type": "integer" + }, + "repeat_from_current_date": { + "description": "If specified, a repeating task will repeat from the current date rather than the last set date.", + "type": "boolean" + }, + "start_date": { + "description": "When this task starts.", + "type": "string" + }, + "title": { + "description": "The task text. This is what you'll see in the list.", + "type": "string", + "maxLength": 250, + "minLength": 3 + }, + "updated": { + "description": "A timestamp when this task was last updated. You cannot change this value.", + "type": "string" + } + } + }, + "models.TaskAssginee": { + "type": "object", + "properties": { + "created": { + "type": "string" + }, + "user_id": { + "type": "integer" + } + } + }, + "models.TaskAttachment": { + "type": "object", + "properties": { + "created": { + "type": "string" + }, + "created_by": { + "type": "object", + "$ref": "#/definitions/user.User" + }, + "file": { + "type": "object", + "$ref": "#/definitions/files.File" + }, + "id": { + "type": "integer" + }, + "task_id": { + "type": "integer" + } + } + }, + "models.TaskComment": { + "type": "object", + "properties": { + "author": { + "type": "object", + "$ref": "#/definitions/user.User" + }, + "comment": { + "type": "string" + }, + "created": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "updated": { + "type": "string" + } + } + }, + "models.TaskRelation": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this label was created. You cannot change this value.", + "type": "string" + }, + "created_by": { + "description": "The user who created this relation", + "type": "object", + "$ref": "#/definitions/user.User" + }, + "other_task_id": { + "description": "The ID of the other task, the task which is being related.", + "type": "integer" + }, + "relation_kind": { + "description": "The kind of the relation.", + "type": "string" + }, + "task_id": { + "description": "The ID of the \"base\" task, the task which has a relation to another.", + "type": "integer" + } + } + }, + "models.Team": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this relation was created. You cannot change this value.", + "type": "string" + }, + "created_by": { + "description": "The user who created this team.", + "type": "object", + "$ref": "#/definitions/user.User" + }, + "description": { + "description": "The team's description.", + "type": "string" + }, + "id": { + "description": "The unique, numeric id of this team.", + "type": "integer" + }, + "members": { + "description": "An array of all members in this team.", + "type": "array", + "items": { + "$ref": "#/definitions/models.TeamUser" + } + }, + "name": { + "description": "The name of this team.", + "type": "string", + "maxLength": 250, + "minLength": 5 + }, + "updated": { + "description": "A timestamp when this relation was last updated. You cannot change this value.", + "type": "string" + } + } + }, + "models.TeamList": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this relation was created. You cannot change this value.", + "type": "string" + }, + "id": { + "description": "The unique, numeric id of this list \u003c-\u003e team relation.", + "type": "integer" + }, + "right": { + "description": "The right this team has. 0 = Read only, 1 = Read \u0026 Write, 2 = Admin. See the docs for more details.", + "type": "integer", + "default": 0, + "maximum": 2 + }, + "team_id": { + "description": "The team id.", + "type": "integer" + }, + "updated": { + "description": "A timestamp when this relation was last updated. You cannot change this value.", + "type": "string" + } + } + }, + "models.TeamMember": { + "type": "object", + "properties": { + "admin": { + "description": "Whether or not the member is an admin of the team. See the docs for more about what a team admin can do", + "type": "boolean" + }, + "created": { + "description": "A timestamp when this relation was created. You cannot change this value.", + "type": "string" + }, + "id": { + "description": "The unique, numeric id of this team member relation.", + "type": "integer" + }, + "username": { + "description": "The username of the member. We use this to prevent automated user id entering.", + "type": "string" + } + } + }, + "models.TeamNamespace": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this relation was created. You cannot change this value.", + "type": "string" + }, + "id": { + "description": "The unique, numeric id of this namespace \u003c-\u003e team relation.", + "type": "integer" + }, + "right": { + "description": "The right this team has. 0 = Read only, 1 = Read \u0026 Write, 2 = Admin. See the docs for more details.", + "type": "integer", + "default": 0, + "maximum": 2 + }, + "team_id": { + "description": "The team id.", + "type": "integer" + }, + "updated": { + "description": "A timestamp when this relation was last updated. You cannot change this value.", + "type": "string" + } + } + }, + "models.TeamUser": { + "type": "object", + "properties": { + "admin": { + "description": "Whether or not the member is an admin of the team. See the docs for more about what a team admin can do", + "type": "boolean" + }, + "created": { + "description": "A timestamp when this task was created. You cannot change this value.", + "type": "string" + }, + "email": { + "description": "The user's email address.", + "type": "string", + "maxLength": 250 + }, + "id": { + "description": "The unique, numeric id of this user.", + "type": "integer" + }, + "updated": { + "description": "A timestamp when this task was last updated. You cannot change this value.", + "type": "string" + }, + "username": { + "description": "The username of the user. Is always unique.", + "type": "string", + "maxLength": 250, + "minLength": 3 + } + } + }, + "models.TeamWithRight": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this relation was created. You cannot change this value.", + "type": "string" + }, + "created_by": { + "description": "The user who created this team.", + "type": "object", + "$ref": "#/definitions/user.User" + }, + "description": { + "description": "The team's description.", + "type": "string" + }, + "id": { + "description": "The unique, numeric id of this team.", + "type": "integer" + }, + "members": { + "description": "An array of all members in this team.", + "type": "array", + "items": { + "$ref": "#/definitions/models.TeamUser" + } + }, + "name": { + "description": "The name of this team.", + "type": "string", + "maxLength": 250, + "minLength": 5 + }, + "right": { + "type": "integer" + }, + "updated": { + "description": "A timestamp when this relation was last updated. You cannot change this value.", + "type": "string" + } + } + }, + "models.UserWithRight": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this task was created. You cannot change this value.", + "type": "string" + }, + "email": { + "description": "The user's email address.", + "type": "string", + "maxLength": 250 + }, + "id": { + "description": "The unique, numeric id of this user.", + "type": "integer" + }, + "right": { + "type": "integer" + }, + "updated": { + "description": "A timestamp when this task was last updated. You cannot change this value.", + "type": "string" + }, + "username": { + "description": "The username of the user. Is always unique.", + "type": "string", + "maxLength": 250, + "minLength": 3 + } + } + }, + "todoist.Migration": { + "type": "object", + "properties": { + "code": { + "type": "string" + } + } + }, + "user.APIUserPassword": { "type": "object", "properties": { "email": { @@ -4600,140 +6898,7 @@ } } }, - "models.BulkAssignees": { - "type": "object", - "properties": { - "assignees": { - "description": "A list with all assignees", - "type": "array", - "items": { - "$ref": "#/definitions/models.User" - } - } - } - }, - "models.BulkTask": { - "type": "object", - "properties": { - "assignees": { - "description": "An array of users who are assigned to this task", - "type": "array", - "items": { - "$ref": "#/definitions/models.User" - } - }, - "attachments": { - "description": "All attachments this task has", - "type": "array", - "items": { - "$ref": "#/definitions/models.TaskAttachment" - } - }, - "created": { - "description": "A unix timestamp when this task was created. You cannot change this value.", - "type": "integer" - }, - "createdBy": { - "description": "The user who initially created the task.", - "type": "object", - "$ref": "#/definitions/models.User" - }, - "description": { - "description": "The task description.", - "type": "string" - }, - "done": { - "description": "Whether a task is done or not.", - "type": "boolean" - }, - "doneAt": { - "description": "The unix timestamp when a task was marked as done.", - "type": "integer" - }, - "dueDate": { - "description": "A unix timestamp when the task is due.", - "type": "integer" - }, - "endDate": { - "description": "When this task ends.", - "type": "integer" - }, - "hexColor": { - "description": "The task color in hex", - "type": "string", - "maxLength": 6 - }, - "id": { - "description": "The unique, numeric id of this task.", - "type": "integer" - }, - "identifier": { - "description": "The task identifier, based on the list identifier and the task's index", - "type": "string" - }, - "index": { - "description": "The task index, calculated per list", - "type": "integer" - }, - "labels": { - "description": "An array of labels which are associated with this task.", - "type": "array", - "items": { - "$ref": "#/definitions/models.Label" - } - }, - "listID": { - "description": "The list this task belongs to.", - "type": "integer" - }, - "percentDone": { - "description": "Determines how far a task is left from being done", - "type": "number" - }, - "priority": { - "description": "The task priority. Can be anything you want, it is possible to sort by this later.", - "type": "integer" - }, - "related_tasks": { - "description": "All related tasks, grouped by their relation kind", - "type": "object", - "$ref": "#/definitions/models.RelatedTaskMap" - }, - "reminderDates": { - "description": "An array of unix timestamps when the user wants to be reminded of the task.", - "type": "array", - "items": { - "type": "integer" - } - }, - "repeatAfter": { - "description": "An amount in seconds this task repeats itself. If this is set, when marking the task as done, it will mark itself as \"undone\" and then increase all remindes and the due date by its amount.", - "type": "integer" - }, - "startDate": { - "description": "When this task starts.", - "type": "integer" - }, - "task_ids": { - "description": "A list of task ids to update", - "type": "array", - "items": { - "type": "integer" - } - }, - "text": { - "description": "The task text. This is what you'll see in the list.", - "type": "string", - "maxLength": 250, - "minLength": 3 - }, - "updated": { - "description": "A unix timestamp when this task was last updated. You cannot change this value.", - "type": "integer" - } - } - }, - "models.EmailConfirm": { + "user.EmailConfirm": { "type": "object", "properties": { "token": { @@ -4742,278 +6907,37 @@ } } }, - "models.Label": { + "user.EmailUpdate": { "type": "object", "properties": { - "created": { - "description": "A unix timestamp when this label was created. You cannot change this value.", - "type": "integer" - }, - "created_by": { - "description": "The user who created this label", - "type": "object", - "$ref": "#/definitions/models.User" - }, - "description": { - "description": "The label description.", + "new_email": { + "description": "The new email address. Needs to be a valid email address.", "type": "string" }, - "hex_color": { - "description": "The color this label has", - "type": "string", - "maxLength": 6 - }, - "id": { - "description": "The unique, numeric id of this label.", - "type": "integer" - }, - "title": { - "description": "The title of the lable. You'll see this one on tasks associated with it.", - "type": "string", - "maxLength": 250, - "minLength": 3 - }, - "updated": { - "description": "A unix timestamp when this label was last updated. You cannot change this value.", - "type": "integer" - } - } - }, - "models.LabelTask": { - "type": "object", - "properties": { - "created": { - "description": "A unix timestamp when this task was created. You cannot change this value.", - "type": "integer" - }, - "label_id": { - "description": "The label id you want to associate with a task.", - "type": "integer" - } - } - }, - "models.LabelTaskBulk": { - "type": "object", - "properties": { - "labels": { - "description": "All labels you want to update at once.", - "type": "array", - "items": { - "$ref": "#/definitions/models.Label" - } - } - } - }, - "models.LinkSharing": { - "type": "object", - "properties": { - "created": { - "description": "A unix timestamp when this list was shared. You cannot change this value.", - "type": "integer" - }, - "hash": { - "description": "The public id to get this shared list", - "type": "string" - }, - "id": { - "description": "The ID of the shared thing", - "type": "integer" - }, - "right": { - "description": "The right this list is shared with. 0 = Read only, 1 = Read \u0026 Write, 2 = Admin. See the docs for more details.", - "type": "integer", - "default": 0, - "maximum": 2 - }, - "shared_by": { - "description": "The user who shared this list", - "type": "object", - "$ref": "#/definitions/models.User" - }, - "sharing_type": { - "description": "The kind of this link. 0 = undefined, 1 = without password, 2 = with password (currently not implemented).", - "type": "integer", - "default": 0, - "maximum": 2 - }, - "updated": { - "description": "A unix timestamp when this share was last updated. You cannot change this value.", - "type": "integer" - } - } - }, - "models.List": { - "type": "object", - "properties": { - "created": { - "description": "A unix timestamp when this list was created. You cannot change this value.", - "type": "integer" - }, - "description": { - "description": "The description of the list.", - "type": "string" - }, - "id": { - "description": "The unique, numeric id of this list.", - "type": "integer" - }, - "identifier": { - "description": "The unique list short identifier. Used to build task identifiers.", - "type": "string", - "maxLength": 10, - "minLength": 0 - }, - "owner": { - "description": "The user who created this list.", - "type": "object", - "$ref": "#/definitions/models.User" - }, - "title": { - "description": "The title of the list. You'll see this in the namespace overview.", - "type": "string", - "maxLength": 250, - "minLength": 3 - }, - "updated": { - "description": "A unix timestamp when this list was last updated. You cannot change this value.", - "type": "integer" - } - } - }, - "models.ListUser": { - "type": "object", - "properties": { - "created": { - "description": "A unix timestamp when this relation was created. You cannot change this value.", - "type": "integer" - }, - "id": { - "description": "The unique, numeric id of this list \u003c-\u003e user relation.", - "type": "integer" - }, - "right": { - "description": "The right this user has. 0 = Read only, 1 = Read \u0026 Write, 2 = Admin. See the docs for more details.", - "type": "integer", - "default": 0, - "maximum": 2 - }, - "updated": { - "description": "A unix timestamp when this relation was last updated. You cannot change this value.", - "type": "integer" - }, - "userID": { - "description": "The username.", + "password": { + "description": "The password of the user for confirmation.", "type": "string" } } }, - "models.Message": { + "user.Login": { "type": "object", "properties": { - "message": { - "description": "A standard message.", + "password": { + "description": "The password for the user.", + "type": "string" + }, + "totp_passcode": { + "description": "The totp passcode of a user. Only needs to be provided when enabled.", + "type": "string" + }, + "username": { + "description": "The username used to log in.", "type": "string" } } }, - "models.Namespace": { - "type": "object", - "properties": { - "created": { - "description": "A unix timestamp when this namespace was created. You cannot change this value.", - "type": "integer" - }, - "description": { - "description": "The description of the namespace", - "type": "string" - }, - "id": { - "description": "The unique, numeric id of this namespace.", - "type": "integer" - }, - "name": { - "description": "The name of this namespace.", - "type": "string", - "maxLength": 250, - "minLength": 5 - }, - "owner": { - "description": "The user who owns this namespace", - "type": "object", - "$ref": "#/definitions/models.User" - }, - "updated": { - "description": "A unix timestamp when this namespace was last updated. You cannot change this value.", - "type": "integer" - } - } - }, - "models.NamespaceUser": { - "type": "object", - "properties": { - "created": { - "description": "A unix timestamp when this relation was created. You cannot change this value.", - "type": "integer" - }, - "id": { - "description": "The unique, numeric id of this namespace \u003c-\u003e user relation.", - "type": "integer" - }, - "right": { - "description": "The right this user has. 0 = Read only, 1 = Read \u0026 Write, 2 = Admin. See the docs for more details.", - "type": "integer", - "default": 0, - "maximum": 2 - }, - "updated": { - "description": "A unix timestamp when this relation was last updated. You cannot change this value.", - "type": "integer" - }, - "userID": { - "description": "The username.", - "type": "string" - } - } - }, - "models.NamespaceWithLists": { - "type": "object", - "properties": { - "created": { - "description": "A unix timestamp when this namespace was created. You cannot change this value.", - "type": "integer" - }, - "description": { - "description": "The description of the namespace", - "type": "string" - }, - "id": { - "description": "The unique, numeric id of this namespace.", - "type": "integer" - }, - "lists": { - "type": "array", - "items": { - "$ref": "#/definitions/models.List" - } - }, - "name": { - "description": "The name of this namespace.", - "type": "string", - "maxLength": 250, - "minLength": 5 - }, - "owner": { - "description": "The user who owns this namespace", - "type": "object", - "$ref": "#/definitions/models.User" - }, - "updated": { - "description": "A unix timestamp when this namespace was last updated. You cannot change this value.", - "type": "integer" - } - } - }, - "models.PasswordReset": { + "user.PasswordReset": { "type": "object", "properties": { "new_password": { @@ -5026,7 +6950,7 @@ } } }, - "models.PasswordTokenRequest": { + "user.PasswordTokenRequest": { "type": "object", "properties": { "email": { @@ -5035,427 +6959,36 @@ } } }, - "models.RelatedTaskMap": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "object", - "properties": { - "assignees": { - "description": "An array of users who are assigned to this task", - "type": "array", - "items": { - "$ref": "#/definitions/models.User" - } - }, - "attachments": { - "description": "All attachments this task has", - "type": "array", - "items": { - "$ref": "#/definitions/models.TaskAttachment" - } - }, - "created": { - "description": "A unix timestamp when this task was created. You cannot change this value.", - "type": "integer" - }, - "createdBy": { - "description": "The user who initially created the task.", - "type": "object", - "$ref": "#/definitions/models.User" - }, - "description": { - "description": "The task description.", - "type": "string" - }, - "done": { - "description": "Whether a task is done or not.", - "type": "boolean" - }, - "doneAt": { - "description": "The unix timestamp when a task was marked as done.", - "type": "integer" - }, - "dueDate": { - "description": "A unix timestamp when the task is due.", - "type": "integer" - }, - "endDate": { - "description": "When this task ends.", - "type": "integer" - }, - "hexColor": { - "description": "The task color in hex", - "type": "string", - "maxLength": 6 - }, - "id": { - "description": "The unique, numeric id of this task.", - "type": "integer" - }, - "identifier": { - "description": "The task identifier, based on the list identifier and the task's index", - "type": "string" - }, - "index": { - "description": "The task index, calculated per list", - "type": "integer" - }, - "labels": { - "description": "An array of labels which are associated with this task.", - "type": "array", - "items": { - "$ref": "#/definitions/models.Label" - } - }, - "listID": { - "description": "The list this task belongs to.", - "type": "integer" - }, - "percentDone": { - "description": "Determines how far a task is left from being done", - "type": "number" - }, - "priority": { - "description": "The task priority. Can be anything you want, it is possible to sort by this later.", - "type": "integer" - }, - "related_tasks": { - "description": "All related tasks, grouped by their relation kind", - "type": "object", - "$ref": "#/definitions/models.RelatedTaskMap" - }, - "reminderDates": { - "description": "An array of unix timestamps when the user wants to be reminded of the task.", - "type": "array", - "items": { - "type": "integer" - } - }, - "repeatAfter": { - "description": "An amount in seconds this task repeats itself. If this is set, when marking the task as done, it will mark itself as \"undone\" and then increase all remindes and the due date by its amount.", - "type": "integer" - }, - "startDate": { - "description": "When this task starts.", - "type": "integer" - }, - "text": { - "description": "The task text. This is what you'll see in the list.", - "type": "string", - "maxLength": 250, - "minLength": 3 - }, - "updated": { - "description": "A unix timestamp when this task was last updated. You cannot change this value.", - "type": "integer" - } - } - } - } - }, - "models.Task": { + "user.TOTP": { "type": "object", "properties": { - "assignees": { - "description": "An array of users who are assigned to this task", - "type": "array", - "items": { - "$ref": "#/definitions/models.User" - } - }, - "attachments": { - "description": "All attachments this task has", - "type": "array", - "items": { - "$ref": "#/definitions/models.TaskAttachment" - } - }, - "created": { - "description": "A unix timestamp when this task was created. You cannot change this value.", - "type": "integer" - }, - "createdBy": { - "description": "The user who initially created the task.", - "type": "object", - "$ref": "#/definitions/models.User" - }, - "description": { - "description": "The task description.", - "type": "string" - }, - "done": { - "description": "Whether a task is done or not.", + "enabled": { + "description": "The totp entry will only be enabled after the user verified they have a working totp setup.", "type": "boolean" }, - "doneAt": { - "description": "The unix timestamp when a task was marked as done.", - "type": "integer" - }, - "dueDate": { - "description": "A unix timestamp when the task is due.", - "type": "integer" - }, - "endDate": { - "description": "When this task ends.", - "type": "integer" - }, - "hexColor": { - "description": "The task color in hex", - "type": "string", - "maxLength": 6 - }, - "id": { - "description": "The unique, numeric id of this task.", - "type": "integer" - }, - "identifier": { - "description": "The task identifier, based on the list identifier and the task's index", + "secret": { "type": "string" }, - "index": { - "description": "The task index, calculated per list", - "type": "integer" - }, - "labels": { - "description": "An array of labels which are associated with this task.", - "type": "array", - "items": { - "$ref": "#/definitions/models.Label" - } - }, - "listID": { - "description": "The list this task belongs to.", - "type": "integer" - }, - "percentDone": { - "description": "Determines how far a task is left from being done", - "type": "number" - }, - "priority": { - "description": "The task priority. Can be anything you want, it is possible to sort by this later.", - "type": "integer" - }, - "related_tasks": { - "description": "All related tasks, grouped by their relation kind", - "type": "object", - "$ref": "#/definitions/models.RelatedTaskMap" - }, - "reminderDates": { - "description": "An array of unix timestamps when the user wants to be reminded of the task.", - "type": "array", - "items": { - "type": "integer" - } - }, - "repeatAfter": { - "description": "An amount in seconds this task repeats itself. If this is set, when marking the task as done, it will mark itself as \"undone\" and then increase all remindes and the due date by its amount.", - "type": "integer" - }, - "startDate": { - "description": "When this task starts.", - "type": "integer" - }, - "text": { - "description": "The task text. This is what you'll see in the list.", - "type": "string", - "maxLength": 250, - "minLength": 3 - }, - "updated": { - "description": "A unix timestamp when this task was last updated. You cannot change this value.", - "type": "integer" - } - } - }, - "models.TaskAssginee": { - "type": "object", - "properties": { - "created": { - "type": "integer" - }, - "user_id": { - "type": "integer" - } - } - }, - "models.TaskAttachment": { - "type": "object", - "properties": { - "created": { - "type": "integer" - }, - "created_by": { - "type": "object", - "$ref": "#/definitions/models.User" - }, - "file": { - "type": "object", - "$ref": "#/definitions/files.File" - }, - "id": { - "type": "integer" - }, - "task_id": { - "type": "integer" - } - } - }, - "models.TaskRelation": { - "type": "object", - "properties": { - "created": { - "description": "A unix timestamp when this label was created. You cannot change this value.", - "type": "integer" - }, - "created_by": { - "description": "The user who created this relation", - "type": "object", - "$ref": "#/definitions/models.User" - }, - "other_task_id": { - "description": "The ID of the other task, the task which is being related.", - "type": "integer" - }, - "relation_kind": { - "description": "The kind of the relation.", - "type": "string" - }, - "task_id": { - "description": "The ID of the \"base\" task, the task which has a relation to another.", - "type": "integer" - } - } - }, - "models.Team": { - "type": "object", - "properties": { - "created": { - "description": "A unix timestamp when this relation was created. You cannot change this value.", - "type": "integer" - }, - "createdBy": { - "description": "The user who created this team.", - "type": "object", - "$ref": "#/definitions/models.User" - }, - "description": { - "description": "The team's description.", - "type": "string" - }, - "id": { - "description": "The unique, numeric id of this team.", - "type": "integer" - }, - "members": { - "description": "An array of all members in this team.", - "type": "array", - "items": { - "$ref": "#/definitions/models.TeamUser" - } - }, - "name": { - "description": "The name of this team.", - "type": "string", - "maxLength": 250, - "minLength": 5 - }, - "updated": { - "description": "A unix timestamp when this relation was last updated. You cannot change this value.", - "type": "integer" - } - } - }, - "models.TeamList": { - "type": "object", - "properties": { - "created": { - "description": "A unix timestamp when this relation was created. You cannot change this value.", - "type": "integer" - }, - "id": { - "description": "The unique, numeric id of this list \u003c-\u003e team relation.", - "type": "integer" - }, - "right": { - "description": "The right this team has. 0 = Read only, 1 = Read \u0026 Write, 2 = Admin. See the docs for more details.", - "type": "integer", - "default": 0, - "maximum": 2 - }, - "teamID": { - "description": "The team id.", - "type": "integer" - }, - "updated": { - "description": "A unix timestamp when this relation was last updated. You cannot change this value.", - "type": "integer" - } - } - }, - "models.TeamMember": { - "type": "object", - "properties": { - "admin": { - "description": "Whether or not the member is an admin of the team. See the docs for more about what a team admin can do", - "type": "boolean" - }, - "created": { - "description": "A unix timestamp when this relation was created. You cannot change this value.", - "type": "integer" - }, - "id": { - "description": "The unique, numeric id of this team member relation.", - "type": "integer" - }, - "username": { - "description": "The username of the member. We use this to prevent automated user id entering.", + "url": { + "description": "The totp url used to be able to enroll the user later", "type": "string" } } }, - "models.TeamNamespace": { + "user.TOTPPasscode": { "type": "object", "properties": { - "created": { - "description": "A unix timestamp when this relation was created. You cannot change this value.", - "type": "integer" - }, - "id": { - "description": "The unique, numeric id of this namespace \u003c-\u003e team relation.", - "type": "integer" - }, - "right": { - "description": "The right this team has. 0 = Read only, 1 = Read \u0026 Write, 2 = Admin. See the docs for more details.", - "type": "integer", - "default": 0, - "maximum": 2 - }, - "teamID": { - "description": "The team id.", - "type": "integer" - }, - "updated": { - "description": "A unix timestamp when this relation was last updated. You cannot change this value.", - "type": "integer" + "passcode": { + "type": "string" } } }, - "models.TeamUser": { + "user.User": { "type": "object", "properties": { - "admin": { - "description": "Whether or not the member is an admin of the team. See the docs for more about what a team admin can do", - "type": "boolean" - }, - "avatarUrl": { - "description": "The users md5-hashed email address, used to get the avatar from gravatar and the likes.", - "type": "string" - }, "created": { - "description": "A unix timestamp when this task was created. You cannot change this value.", - "type": "integer" + "description": "A timestamp when this task was created. You cannot change this value.", + "type": "string" }, "email": { "description": "The user's email address.", @@ -5467,131 +7000,9 @@ "type": "integer" }, "updated": { - "description": "A unix timestamp when this task was last updated. You cannot change this value.", - "type": "integer" - }, - "username": { - "description": "The username of the user. Is always unique.", - "type": "string", - "maxLength": 250, - "minLength": 3 - } - } - }, - "models.TeamWithRight": { - "type": "object", - "properties": { - "created": { - "description": "A unix timestamp when this relation was created. You cannot change this value.", - "type": "integer" - }, - "createdBy": { - "description": "The user who created this team.", - "type": "object", - "$ref": "#/definitions/models.User" - }, - "description": { - "description": "The team's description.", + "description": "A timestamp when this task was last updated. You cannot change this value.", "type": "string" }, - "id": { - "description": "The unique, numeric id of this team.", - "type": "integer" - }, - "members": { - "description": "An array of all members in this team.", - "type": "array", - "items": { - "$ref": "#/definitions/models.TeamUser" - } - }, - "name": { - "description": "The name of this team.", - "type": "string", - "maxLength": 250, - "minLength": 5 - }, - "right": { - "type": "integer" - }, - "updated": { - "description": "A unix timestamp when this relation was last updated. You cannot change this value.", - "type": "integer" - } - } - }, - "models.User": { - "type": "object", - "properties": { - "avatarUrl": { - "description": "The users md5-hashed email address, used to get the avatar from gravatar and the likes.", - "type": "string" - }, - "created": { - "description": "A unix timestamp when this task was created. You cannot change this value.", - "type": "integer" - }, - "email": { - "description": "The user's email address.", - "type": "string", - "maxLength": 250 - }, - "id": { - "description": "The unique, numeric id of this user.", - "type": "integer" - }, - "updated": { - "description": "A unix timestamp when this task was last updated. You cannot change this value.", - "type": "integer" - }, - "username": { - "description": "The username of the user. Is always unique.", - "type": "string", - "maxLength": 250, - "minLength": 3 - } - } - }, - "models.UserLogin": { - "type": "object", - "properties": { - "password": { - "description": "The password for the user.", - "type": "string" - }, - "username": { - "description": "The username used to log in.", - "type": "string" - } - } - }, - "models.UserWithRight": { - "type": "object", - "properties": { - "avatarUrl": { - "description": "The users md5-hashed email address, used to get the avatar from gravatar and the likes.", - "type": "string" - }, - "created": { - "description": "A unix timestamp when this task was created. You cannot change this value.", - "type": "integer" - }, - "email": { - "description": "The user's email address.", - "type": "string", - "maxLength": 250 - }, - "id": { - "description": "The unique, numeric id of this user.", - "type": "integer" - }, - "right": { - "type": "integer" - }, - "updated": { - "description": "A unix timestamp when this task was last updated. You cannot change this value.", - "type": "integer" - }, "username": { "description": "The username of the user. Is always unique.", "type": "string", @@ -5628,6 +7039,12 @@ "type": "string" } }, + "enabled_background_providers": { + "type": "array", + "items": { + "type": "string" + } + }, "frontend_url": { "type": "string" }, @@ -5643,11 +7060,28 @@ "registration_enabled": { "type": "boolean" }, + "task_attachments_enabled": { + "type": "boolean" + }, + "totp_enabled": { + "type": "boolean" + }, "version": { "type": "string" } } }, + "web.HTTPError": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "message": { + "type": "string" + } + } + }, "wunderlist.Migration": { "type": "object", "properties": { diff --git a/pkg/swagger/swagger.yaml b/pkg/swagger/swagger.yaml index 5e0206d3..5fa6ac2d 100644 --- a/pkg/swagger/swagger.yaml +++ b/pkg/swagger/swagger.yaml @@ -1,5 +1,20 @@ basePath: /api/v1 definitions: + afero.File: + type: object + background.Image: + properties: + id: + type: string + info: + description: This can be used to supply extra information from an image provider + to clients + type: object + thumb: + type: string + url: + type: string + type: object files.File: properties: created: @@ -24,10 +39,765 @@ definitions: type: integer migrator_name: type: string - time_unix: + time: + type: string + type: object + models.Bucket: + properties: + created: + description: A timestamp when this bucket was created. You cannot change this + value. + type: string + created_by: + $ref: '#/definitions/user.User' + description: The user who initially created the bucket. + type: object + id: + description: The unique, numeric id of this bucket. + type: integer + list_id: + description: The list this bucket belongs to. + type: integer + tasks: + description: All tasks which belong to this bucket. + items: + $ref: '#/definitions/models.Task' + type: array + title: + description: The title of this bucket. + minLength: 1 + type: string + updated: + description: A timestamp when this bucket was last updated. You cannot change + this value. + type: string + type: object + models.BulkAssignees: + properties: + assignees: + description: A list with all assignees + items: + $ref: '#/definitions/user.User' + type: array + type: object + models.BulkTask: + properties: + assignees: + description: An array of users who are assigned to this task + items: + $ref: '#/definitions/user.User' + type: array + attachments: + description: All attachments this task has + items: + $ref: '#/definitions/models.TaskAttachment' + type: array + bucket_id: + description: BucketID is the ID of the kanban bucket this task belongs to. + type: integer + created: + description: A timestamp when this task was created. You cannot change this + value. + type: string + created_by: + $ref: '#/definitions/user.User' + description: The user who initially created the task. + type: object + description: + description: The task description. + type: string + done: + description: Whether a task is done or not. + type: boolean + done_at: + description: The time when a task was marked as done. + type: string + due_date: + description: The time when the task is due. + type: string + end_date: + description: When this task ends. + type: string + hex_color: + description: The task color in hex + maxLength: 6 + type: string + id: + description: The unique, numeric id of this task. + type: integer + identifier: + description: The task identifier, based on the list identifier and the task's + index + type: string + index: + description: The task index, calculated per list + type: integer + labels: + description: An array of labels which are associated with this task. + items: + $ref: '#/definitions/models.Label' + type: array + list_id: + description: The list this task belongs to. + type: integer + percent_done: + description: Determines how far a task is left from being done + type: number + position: + description: |- + The position of the task - any task list can be sorted as usual by this parameter. + When accessing tasks via kanban buckets, this is primarily used to sort them based on a range + We're using a float64 here to make it possible to put any task within any two other tasks (by changing the number). + You would calculate the new position between two tasks with something like task3.position = (task2.position - task1.position) / 2. + A 64-Bit float leaves plenty of room to initially give tasks a position with 2^16 difference to the previous task + which also leaves a lot of room for rearranging and sorting later. + type: number + priority: + description: The task priority. Can be anything you want, it is possible to + sort by this later. + type: integer + related_tasks: + $ref: '#/definitions/models.RelatedTaskMap' + description: All related tasks, grouped by their relation kind + type: object + reminder_dates: + description: An array of datetimes when the user wants to be reminded of the + task. + items: + type: string + type: array + repeat_after: + description: An amount in seconds this task repeats itself. If this is set, + when marking the task as done, it will mark itself as "undone" and then + increase all remindes and the due date by its amount. + type: integer + repeat_from_current_date: + description: If specified, a repeating task will repeat from the current date + rather than the last set date. + type: boolean + start_date: + description: When this task starts. + type: string + task_ids: + description: A list of task ids to update + items: + type: integer + type: array + title: + description: The task text. This is what you'll see in the list. + maxLength: 250 + minLength: 3 + type: string + updated: + description: A timestamp when this task was last updated. You cannot change + this value. + type: string + type: object + models.Label: + properties: + created: + description: A timestamp when this label was created. You cannot change this + value. + type: string + created_by: + $ref: '#/definitions/user.User' + description: The user who created this label + type: object + description: + description: The label description. + type: string + hex_color: + description: The color this label has + maxLength: 6 + type: string + id: + description: The unique, numeric id of this label. + type: integer + title: + description: The title of the lable. You'll see this one on tasks associated + with it. + maxLength: 250 + minLength: 3 + type: string + updated: + description: A timestamp when this label was last updated. You cannot change + this value. + type: string + type: object + models.LabelTask: + properties: + created: + description: A timestamp when this task was created. You cannot change this + value. + type: string + label_id: + description: The label id you want to associate with a task. type: integer type: object - models.APIUserPassword: + models.LabelTaskBulk: + properties: + labels: + description: All labels you want to update at once. + items: + $ref: '#/definitions/models.Label' + type: array + type: object + models.LinkSharing: + properties: + created: + description: A timestamp when this list was shared. You cannot change this + value. + type: string + hash: + description: The public id to get this shared list + type: string + id: + description: The ID of the shared thing + type: integer + right: + default: 0 + description: The right this list is shared with. 0 = Read only, 1 = Read & + Write, 2 = Admin. See the docs for more details. + maximum: 2 + type: integer + shared_by: + $ref: '#/definitions/user.User' + description: The user who shared this list + type: object + sharing_type: + default: 0 + description: The kind of this link. 0 = undefined, 1 = without password, 2 + = with password (currently not implemented). + maximum: 2 + type: integer + updated: + description: A timestamp when this share was last updated. You cannot change + this value. + type: string + type: object + models.List: + properties: + background_information: + description: Holds extra information about the background set since some background + providers require attribution or similar. If not null, the background can + be accessed at /lists/{listID}/background + type: object + created: + description: A timestamp when this list was created. You cannot change this + value. + type: string + description: + description: The description of the list. + type: string + hex_color: + description: The hex color of this list + maxLength: 6 + type: string + id: + description: The unique, numeric id of this list. + type: integer + identifier: + description: The unique list short identifier. Used to build task identifiers. + maxLength: 10 + minLength: 0 + type: string + is_archived: + description: Whether or not a list is archived. + type: boolean + namespace_id: + type: integer + owner: + $ref: '#/definitions/user.User' + description: The user who created this list. + type: object + title: + description: The title of the list. You'll see this in the namespace overview. + maxLength: 250 + minLength: 3 + type: string + updated: + description: A timestamp when this list was last updated. You cannot change + this value. + type: string + type: object + models.ListUser: + properties: + created: + description: A timestamp when this relation was created. You cannot change + this value. + type: string + id: + description: The unique, numeric id of this list <-> user relation. + type: integer + right: + default: 0 + description: The right this user has. 0 = Read only, 1 = Read & Write, 2 = + Admin. See the docs for more details. + maximum: 2 + type: integer + updated: + description: A timestamp when this relation was last updated. You cannot change + this value. + type: string + user_id: + description: The username. + type: string + type: object + models.Message: + properties: + message: + description: A standard message. + type: string + type: object + models.Namespace: + properties: + created: + description: A timestamp when this namespace was created. You cannot change + this value. + type: string + description: + description: The description of the namespace + type: string + hex_color: + description: The hex color of this namespace + maxLength: 6 + type: string + id: + description: The unique, numeric id of this namespace. + type: integer + is_archived: + description: Whether or not a namespace is archived. + type: boolean + owner: + $ref: '#/definitions/user.User' + description: The user who owns this namespace + type: object + title: + description: The name of this namespace. + maxLength: 250 + minLength: 5 + type: string + updated: + description: A timestamp when this namespace was last updated. You cannot + change this value. + type: string + type: object + models.NamespaceUser: + properties: + created: + description: A timestamp when this relation was created. You cannot change + this value. + type: string + id: + description: The unique, numeric id of this namespace <-> user relation. + type: integer + right: + default: 0 + description: The right this user has. 0 = Read only, 1 = Read & Write, 2 = + Admin. See the docs for more details. + maximum: 2 + type: integer + updated: + description: A timestamp when this relation was last updated. You cannot change + this value. + type: string + user_id: + description: The username. + type: string + type: object + models.NamespaceWithLists: + properties: + created: + description: A timestamp when this namespace was created. You cannot change + this value. + type: string + description: + description: The description of the namespace + type: string + hex_color: + description: The hex color of this namespace + maxLength: 6 + type: string + id: + description: The unique, numeric id of this namespace. + type: integer + is_archived: + description: Whether or not a namespace is archived. + type: boolean + lists: + items: + $ref: '#/definitions/models.List' + type: array + owner: + $ref: '#/definitions/user.User' + description: The user who owns this namespace + type: object + title: + description: The name of this namespace. + maxLength: 250 + minLength: 5 + type: string + updated: + description: A timestamp when this namespace was last updated. You cannot + change this value. + type: string + type: object + models.RelatedTaskMap: + additionalProperties: + items: + $ref: '#/definitions/models.Task' + type: array + type: object + models.Task: + properties: + assignees: + description: An array of users who are assigned to this task + items: + $ref: '#/definitions/user.User' + type: array + attachments: + description: All attachments this task has + items: + $ref: '#/definitions/models.TaskAttachment' + type: array + bucket_id: + description: BucketID is the ID of the kanban bucket this task belongs to. + type: integer + created: + description: A timestamp when this task was created. You cannot change this + value. + type: string + created_by: + $ref: '#/definitions/user.User' + description: The user who initially created the task. + type: object + description: + description: The task description. + type: string + done: + description: Whether a task is done or not. + type: boolean + done_at: + description: The time when a task was marked as done. + type: string + due_date: + description: The time when the task is due. + type: string + end_date: + description: When this task ends. + type: string + hex_color: + description: The task color in hex + maxLength: 6 + type: string + id: + description: The unique, numeric id of this task. + type: integer + identifier: + description: The task identifier, based on the list identifier and the task's + index + type: string + index: + description: The task index, calculated per list + type: integer + labels: + description: An array of labels which are associated with this task. + items: + $ref: '#/definitions/models.Label' + type: array + list_id: + description: The list this task belongs to. + type: integer + percent_done: + description: Determines how far a task is left from being done + type: number + position: + description: |- + The position of the task - any task list can be sorted as usual by this parameter. + When accessing tasks via kanban buckets, this is primarily used to sort them based on a range + We're using a float64 here to make it possible to put any task within any two other tasks (by changing the number). + You would calculate the new position between two tasks with something like task3.position = (task2.position - task1.position) / 2. + A 64-Bit float leaves plenty of room to initially give tasks a position with 2^16 difference to the previous task + which also leaves a lot of room for rearranging and sorting later. + type: number + priority: + description: The task priority. Can be anything you want, it is possible to + sort by this later. + type: integer + related_tasks: + $ref: '#/definitions/models.RelatedTaskMap' + description: All related tasks, grouped by their relation kind + type: object + reminder_dates: + description: An array of datetimes when the user wants to be reminded of the + task. + items: + type: string + type: array + repeat_after: + description: An amount in seconds this task repeats itself. If this is set, + when marking the task as done, it will mark itself as "undone" and then + increase all remindes and the due date by its amount. + type: integer + repeat_from_current_date: + description: If specified, a repeating task will repeat from the current date + rather than the last set date. + type: boolean + start_date: + description: When this task starts. + type: string + title: + description: The task text. This is what you'll see in the list. + maxLength: 250 + minLength: 3 + type: string + updated: + description: A timestamp when this task was last updated. You cannot change + this value. + type: string + type: object + models.TaskAssginee: + properties: + created: + type: string + user_id: + type: integer + type: object + models.TaskAttachment: + properties: + created: + type: string + created_by: + $ref: '#/definitions/user.User' + type: object + file: + $ref: '#/definitions/files.File' + type: object + id: + type: integer + task_id: + type: integer + type: object + models.TaskComment: + properties: + author: + $ref: '#/definitions/user.User' + type: object + comment: + type: string + created: + type: string + id: + type: integer + updated: + type: string + type: object + models.TaskRelation: + properties: + created: + description: A timestamp when this label was created. You cannot change this + value. + type: string + created_by: + $ref: '#/definitions/user.User' + description: The user who created this relation + type: object + other_task_id: + description: The ID of the other task, the task which is being related. + type: integer + relation_kind: + description: The kind of the relation. + type: string + task_id: + description: The ID of the "base" task, the task which has a relation to another. + type: integer + type: object + models.Team: + properties: + created: + description: A timestamp when this relation was created. You cannot change + this value. + type: string + created_by: + $ref: '#/definitions/user.User' + description: The user who created this team. + type: object + description: + description: The team's description. + type: string + id: + description: The unique, numeric id of this team. + type: integer + members: + description: An array of all members in this team. + items: + $ref: '#/definitions/models.TeamUser' + type: array + name: + description: The name of this team. + maxLength: 250 + minLength: 5 + type: string + updated: + description: A timestamp when this relation was last updated. You cannot change + this value. + type: string + type: object + models.TeamList: + properties: + created: + description: A timestamp when this relation was created. You cannot change + this value. + type: string + id: + description: The unique, numeric id of this list <-> team relation. + type: integer + right: + default: 0 + description: The right this team has. 0 = Read only, 1 = Read & Write, 2 = + Admin. See the docs for more details. + maximum: 2 + type: integer + team_id: + description: The team id. + type: integer + updated: + description: A timestamp when this relation was last updated. You cannot change + this value. + type: string + type: object + models.TeamMember: + properties: + admin: + description: Whether or not the member is an admin of the team. See the docs + for more about what a team admin can do + type: boolean + created: + description: A timestamp when this relation was created. You cannot change + this value. + type: string + id: + description: The unique, numeric id of this team member relation. + type: integer + username: + description: The username of the member. We use this to prevent automated + user id entering. + type: string + type: object + models.TeamNamespace: + properties: + created: + description: A timestamp when this relation was created. You cannot change + this value. + type: string + id: + description: The unique, numeric id of this namespace <-> team relation. + type: integer + right: + default: 0 + description: The right this team has. 0 = Read only, 1 = Read & Write, 2 = + Admin. See the docs for more details. + maximum: 2 + type: integer + team_id: + description: The team id. + type: integer + updated: + description: A timestamp when this relation was last updated. You cannot change + this value. + type: string + type: object + models.TeamUser: + properties: + admin: + description: Whether or not the member is an admin of the team. See the docs + for more about what a team admin can do + type: boolean + created: + description: A timestamp when this task was created. You cannot change this + value. + type: string + email: + description: The user's email address. + maxLength: 250 + type: string + id: + description: The unique, numeric id of this user. + type: integer + updated: + description: A timestamp when this task was last updated. You cannot change + this value. + type: string + username: + description: The username of the user. Is always unique. + maxLength: 250 + minLength: 3 + type: string + type: object + models.TeamWithRight: + properties: + created: + description: A timestamp when this relation was created. You cannot change + this value. + type: string + created_by: + $ref: '#/definitions/user.User' + description: The user who created this team. + type: object + description: + description: The team's description. + type: string + id: + description: The unique, numeric id of this team. + type: integer + members: + description: An array of all members in this team. + items: + $ref: '#/definitions/models.TeamUser' + type: array + name: + description: The name of this team. + maxLength: 250 + minLength: 5 + type: string + right: + type: integer + updated: + description: A timestamp when this relation was last updated. You cannot change + this value. + type: string + type: object + models.UserWithRight: + properties: + created: + description: A timestamp when this task was created. You cannot change this + value. + type: string + email: + description: The user's email address. + maxLength: 250 + type: string + id: + description: The unique, numeric id of this user. + type: integer + right: + type: integer + updated: + description: A timestamp when this task was last updated. You cannot change + this value. + type: string + username: + description: The username of the user. Is always unique. + maxLength: 250 + minLength: 3 + type: string + type: object + todoist.Migration: + properties: + code: + type: string + type: object + user.APIUserPassword: properties: email: description: The user's email address @@ -48,339 +818,34 @@ definitions: minLength: 3 type: string type: object - models.BulkAssignees: - properties: - assignees: - description: A list with all assignees - items: - $ref: '#/definitions/models.User' - type: array - type: object - models.BulkTask: - properties: - assignees: - description: An array of users who are assigned to this task - items: - $ref: '#/definitions/models.User' - type: array - attachments: - description: All attachments this task has - items: - $ref: '#/definitions/models.TaskAttachment' - type: array - created: - description: A unix timestamp when this task was created. You cannot change - this value. - type: integer - createdBy: - $ref: '#/definitions/models.User' - description: The user who initially created the task. - type: object - description: - description: The task description. - type: string - done: - description: Whether a task is done or not. - type: boolean - doneAt: - description: The unix timestamp when a task was marked as done. - type: integer - dueDate: - description: A unix timestamp when the task is due. - type: integer - endDate: - description: When this task ends. - type: integer - hexColor: - description: The task color in hex - maxLength: 6 - type: string - id: - description: The unique, numeric id of this task. - type: integer - identifier: - description: The task identifier, based on the list identifier and the task's - index - type: string - index: - description: The task index, calculated per list - type: integer - labels: - description: An array of labels which are associated with this task. - items: - $ref: '#/definitions/models.Label' - type: array - listID: - description: The list this task belongs to. - type: integer - percentDone: - description: Determines how far a task is left from being done - type: number - priority: - description: The task priority. Can be anything you want, it is possible to - sort by this later. - type: integer - related_tasks: - $ref: '#/definitions/models.RelatedTaskMap' - description: All related tasks, grouped by their relation kind - type: object - reminderDates: - description: An array of unix timestamps when the user wants to be reminded - of the task. - items: - type: integer - type: array - repeatAfter: - description: An amount in seconds this task repeats itself. If this is set, - when marking the task as done, it will mark itself as "undone" and then - increase all remindes and the due date by its amount. - type: integer - startDate: - description: When this task starts. - type: integer - task_ids: - description: A list of task ids to update - items: - type: integer - type: array - text: - description: The task text. This is what you'll see in the list. - maxLength: 250 - minLength: 3 - type: string - updated: - description: A unix timestamp when this task was last updated. You cannot - change this value. - type: integer - type: object - models.EmailConfirm: + user.EmailConfirm: properties: token: description: The email confirm token sent via email. type: string type: object - models.Label: + user.EmailUpdate: properties: - created: - description: A unix timestamp when this label was created. You cannot change - this value. - type: integer - created_by: - $ref: '#/definitions/models.User' - description: The user who created this label - type: object - description: - description: The label description. + new_email: + description: The new email address. Needs to be a valid email address. type: string - hex_color: - description: The color this label has - maxLength: 6 - type: string - id: - description: The unique, numeric id of this label. - type: integer - title: - description: The title of the lable. You'll see this one on tasks associated - with it. - maxLength: 250 - minLength: 3 - type: string - updated: - description: A unix timestamp when this label was last updated. You cannot - change this value. - type: integer - type: object - models.LabelTask: - properties: - created: - description: A unix timestamp when this task was created. You cannot change - this value. - type: integer - label_id: - description: The label id you want to associate with a task. - type: integer - type: object - models.LabelTaskBulk: - properties: - labels: - description: All labels you want to update at once. - items: - $ref: '#/definitions/models.Label' - type: array - type: object - models.LinkSharing: - properties: - created: - description: A unix timestamp when this list was shared. You cannot change - this value. - type: integer - hash: - description: The public id to get this shared list - type: string - id: - description: The ID of the shared thing - type: integer - right: - default: 0 - description: The right this list is shared with. 0 = Read only, 1 = Read & - Write, 2 = Admin. See the docs for more details. - maximum: 2 - type: integer - shared_by: - $ref: '#/definitions/models.User' - description: The user who shared this list - type: object - sharing_type: - default: 0 - description: The kind of this link. 0 = undefined, 1 = without password, 2 - = with password (currently not implemented). - maximum: 2 - type: integer - updated: - description: A unix timestamp when this share was last updated. You cannot - change this value. - type: integer - type: object - models.List: - properties: - created: - description: A unix timestamp when this list was created. You cannot change - this value. - type: integer - description: - description: The description of the list. - type: string - id: - description: The unique, numeric id of this list. - type: integer - identifier: - description: The unique list short identifier. Used to build task identifiers. - maxLength: 10 - minLength: 0 - type: string - owner: - $ref: '#/definitions/models.User' - description: The user who created this list. - type: object - title: - description: The title of the list. You'll see this in the namespace overview. - maxLength: 250 - minLength: 3 - type: string - updated: - description: A unix timestamp when this list was last updated. You cannot - change this value. - type: integer - type: object - models.ListUser: - properties: - created: - description: A unix timestamp when this relation was created. You cannot change - this value. - type: integer - id: - description: The unique, numeric id of this list <-> user relation. - type: integer - right: - default: 0 - description: The right this user has. 0 = Read only, 1 = Read & Write, 2 = - Admin. See the docs for more details. - maximum: 2 - type: integer - updated: - description: A unix timestamp when this relation was last updated. You cannot - change this value. - type: integer - userID: - description: The username. + password: + description: The password of the user for confirmation. type: string type: object - models.Message: + user.Login: properties: - message: - description: A standard message. + password: + description: The password for the user. + type: string + totp_passcode: + description: The totp passcode of a user. Only needs to be provided when enabled. + type: string + username: + description: The username used to log in. type: string type: object - models.Namespace: - properties: - created: - description: A unix timestamp when this namespace was created. You cannot - change this value. - type: integer - description: - description: The description of the namespace - type: string - id: - description: The unique, numeric id of this namespace. - type: integer - name: - description: The name of this namespace. - maxLength: 250 - minLength: 5 - type: string - owner: - $ref: '#/definitions/models.User' - description: The user who owns this namespace - type: object - updated: - description: A unix timestamp when this namespace was last updated. You cannot - change this value. - type: integer - type: object - models.NamespaceUser: - properties: - created: - description: A unix timestamp when this relation was created. You cannot change - this value. - type: integer - id: - description: The unique, numeric id of this namespace <-> user relation. - type: integer - right: - default: 0 - description: The right this user has. 0 = Read only, 1 = Read & Write, 2 = - Admin. See the docs for more details. - maximum: 2 - type: integer - updated: - description: A unix timestamp when this relation was last updated. You cannot - change this value. - type: integer - userID: - description: The username. - type: string - type: object - models.NamespaceWithLists: - properties: - created: - description: A unix timestamp when this namespace was created. You cannot - change this value. - type: integer - description: - description: The description of the namespace - type: string - id: - description: The unique, numeric id of this namespace. - type: integer - lists: - items: - $ref: '#/definitions/models.List' - type: array - name: - description: The name of this namespace. - maxLength: 250 - minLength: 5 - type: string - owner: - $ref: '#/definitions/models.User' - description: The user who owns this namespace - type: object - updated: - description: A unix timestamp when this namespace was last updated. You cannot - change this value. - type: integer - type: object - models.PasswordReset: + user.PasswordReset: properties: new_password: description: The new password for this user. @@ -389,351 +854,35 @@ definitions: description: The previously issued reset token. type: string type: object - models.PasswordTokenRequest: + user.PasswordTokenRequest: properties: email: maxLength: 250 type: string type: object - models.RelatedTaskMap: - additionalProperties: - items: - properties: - assignees: - description: An array of users who are assigned to this task - items: - $ref: '#/definitions/models.User' - type: array - attachments: - description: All attachments this task has - items: - $ref: '#/definitions/models.TaskAttachment' - type: array - created: - description: A unix timestamp when this task was created. You cannot change - this value. - type: integer - createdBy: - $ref: '#/definitions/models.User' - description: The user who initially created the task. - type: object - description: - description: The task description. - type: string - done: - description: Whether a task is done or not. - type: boolean - doneAt: - description: The unix timestamp when a task was marked as done. - type: integer - dueDate: - description: A unix timestamp when the task is due. - type: integer - endDate: - description: When this task ends. - type: integer - hexColor: - description: The task color in hex - maxLength: 6 - type: string - id: - description: The unique, numeric id of this task. - type: integer - identifier: - description: The task identifier, based on the list identifier and the - task's index - type: string - index: - description: The task index, calculated per list - type: integer - labels: - description: An array of labels which are associated with this task. - items: - $ref: '#/definitions/models.Label' - type: array - listID: - description: The list this task belongs to. - type: integer - percentDone: - description: Determines how far a task is left from being done - type: number - priority: - description: The task priority. Can be anything you want, it is possible - to sort by this later. - type: integer - related_tasks: - $ref: '#/definitions/models.RelatedTaskMap' - description: All related tasks, grouped by their relation kind - type: object - reminderDates: - description: An array of unix timestamps when the user wants to be reminded - of the task. - items: - type: integer - type: array - repeatAfter: - description: An amount in seconds this task repeats itself. If this is - set, when marking the task as done, it will mark itself as "undone" - and then increase all remindes and the due date by its amount. - type: integer - startDate: - description: When this task starts. - type: integer - text: - description: The task text. This is what you'll see in the list. - maxLength: 250 - minLength: 3 - type: string - updated: - description: A unix timestamp when this task was last updated. You cannot - change this value. - type: integer - type: object - type: array - type: object - models.Task: + user.TOTP: properties: - assignees: - description: An array of users who are assigned to this task - items: - $ref: '#/definitions/models.User' - type: array - attachments: - description: All attachments this task has - items: - $ref: '#/definitions/models.TaskAttachment' - type: array - created: - description: A unix timestamp when this task was created. You cannot change - this value. - type: integer - createdBy: - $ref: '#/definitions/models.User' - description: The user who initially created the task. - type: object - description: - description: The task description. - type: string - done: - description: Whether a task is done or not. + enabled: + description: The totp entry will only be enabled after the user verified they + have a working totp setup. type: boolean - doneAt: - description: The unix timestamp when a task was marked as done. - type: integer - dueDate: - description: A unix timestamp when the task is due. - type: integer - endDate: - description: When this task ends. - type: integer - hexColor: - description: The task color in hex - maxLength: 6 + secret: type: string - id: - description: The unique, numeric id of this task. - type: integer - identifier: - description: The task identifier, based on the list identifier and the task's - index - type: string - index: - description: The task index, calculated per list - type: integer - labels: - description: An array of labels which are associated with this task. - items: - $ref: '#/definitions/models.Label' - type: array - listID: - description: The list this task belongs to. - type: integer - percentDone: - description: Determines how far a task is left from being done - type: number - priority: - description: The task priority. Can be anything you want, it is possible to - sort by this later. - type: integer - related_tasks: - $ref: '#/definitions/models.RelatedTaskMap' - description: All related tasks, grouped by their relation kind - type: object - reminderDates: - description: An array of unix timestamps when the user wants to be reminded - of the task. - items: - type: integer - type: array - repeatAfter: - description: An amount in seconds this task repeats itself. If this is set, - when marking the task as done, it will mark itself as "undone" and then - increase all remindes and the due date by its amount. - type: integer - startDate: - description: When this task starts. - type: integer - text: - description: The task text. This is what you'll see in the list. - maxLength: 250 - minLength: 3 - type: string - updated: - description: A unix timestamp when this task was last updated. You cannot - change this value. - type: integer - type: object - models.TaskAssginee: - properties: - created: - type: integer - user_id: - type: integer - type: object - models.TaskAttachment: - properties: - created: - type: integer - created_by: - $ref: '#/definitions/models.User' - type: object - file: - $ref: '#/definitions/files.File' - type: object - id: - type: integer - task_id: - type: integer - type: object - models.TaskRelation: - properties: - created: - description: A unix timestamp when this label was created. You cannot change - this value. - type: integer - created_by: - $ref: '#/definitions/models.User' - description: The user who created this relation - type: object - other_task_id: - description: The ID of the other task, the task which is being related. - type: integer - relation_kind: - description: The kind of the relation. - type: string - task_id: - description: The ID of the "base" task, the task which has a relation to another. - type: integer - type: object - models.Team: - properties: - created: - description: A unix timestamp when this relation was created. You cannot change - this value. - type: integer - createdBy: - $ref: '#/definitions/models.User' - description: The user who created this team. - type: object - description: - description: The team's description. - type: string - id: - description: The unique, numeric id of this team. - type: integer - members: - description: An array of all members in this team. - items: - $ref: '#/definitions/models.TeamUser' - type: array - name: - description: The name of this team. - maxLength: 250 - minLength: 5 - type: string - updated: - description: A unix timestamp when this relation was last updated. You cannot - change this value. - type: integer - type: object - models.TeamList: - properties: - created: - description: A unix timestamp when this relation was created. You cannot change - this value. - type: integer - id: - description: The unique, numeric id of this list <-> team relation. - type: integer - right: - default: 0 - description: The right this team has. 0 = Read only, 1 = Read & Write, 2 = - Admin. See the docs for more details. - maximum: 2 - type: integer - teamID: - description: The team id. - type: integer - updated: - description: A unix timestamp when this relation was last updated. You cannot - change this value. - type: integer - type: object - models.TeamMember: - properties: - admin: - description: Whether or not the member is an admin of the team. See the docs - for more about what a team admin can do - type: boolean - created: - description: A unix timestamp when this relation was created. You cannot change - this value. - type: integer - id: - description: The unique, numeric id of this team member relation. - type: integer - username: - description: The username of the member. We use this to prevent automated - user id entering. + url: + description: The totp url used to be able to enroll the user later type: string type: object - models.TeamNamespace: + user.TOTPPasscode: properties: - created: - description: A unix timestamp when this relation was created. You cannot change - this value. - type: integer - id: - description: The unique, numeric id of this namespace <-> team relation. - type: integer - right: - default: 0 - description: The right this team has. 0 = Read only, 1 = Read & Write, 2 = - Admin. See the docs for more details. - maximum: 2 - type: integer - teamID: - description: The team id. - type: integer - updated: - description: A unix timestamp when this relation was last updated. You cannot - change this value. - type: integer - type: object - models.TeamUser: - properties: - admin: - description: Whether or not the member is an admin of the team. See the docs - for more about what a team admin can do - type: boolean - avatarUrl: - description: The users md5-hashed email address, used to get the avatar from - gravatar and the likes. + passcode: type: string + type: object + user.User: + properties: created: - description: A unix timestamp when this task was created. You cannot change - this value. - type: integer + description: A timestamp when this task was created. You cannot change this + value. + type: string email: description: The user's email address. maxLength: 250 @@ -742,107 +891,9 @@ definitions: description: The unique, numeric id of this user. type: integer updated: - description: A unix timestamp when this task was last updated. You cannot - change this value. - type: integer - username: - description: The username of the user. Is always unique. - maxLength: 250 - minLength: 3 - type: string - type: object - models.TeamWithRight: - properties: - created: - description: A unix timestamp when this relation was created. You cannot change + description: A timestamp when this task was last updated. You cannot change this value. - type: integer - createdBy: - $ref: '#/definitions/models.User' - description: The user who created this team. - type: object - description: - description: The team's description. type: string - id: - description: The unique, numeric id of this team. - type: integer - members: - description: An array of all members in this team. - items: - $ref: '#/definitions/models.TeamUser' - type: array - name: - description: The name of this team. - maxLength: 250 - minLength: 5 - type: string - right: - type: integer - updated: - description: A unix timestamp when this relation was last updated. You cannot - change this value. - type: integer - type: object - models.User: - properties: - avatarUrl: - description: The users md5-hashed email address, used to get the avatar from - gravatar and the likes. - type: string - created: - description: A unix timestamp when this task was created. You cannot change - this value. - type: integer - email: - description: The user's email address. - maxLength: 250 - type: string - id: - description: The unique, numeric id of this user. - type: integer - updated: - description: A unix timestamp when this task was last updated. You cannot - change this value. - type: integer - username: - description: The username of the user. Is always unique. - maxLength: 250 - minLength: 3 - type: string - type: object - models.UserLogin: - properties: - password: - description: The password for the user. - type: string - username: - description: The username used to log in. - type: string - type: object - models.UserWithRight: - properties: - avatarUrl: - description: The users md5-hashed email address, used to get the avatar from - gravatar and the likes. - type: string - created: - description: A unix timestamp when this task was created. You cannot change - this value. - type: integer - email: - description: The user's email address. - maxLength: 250 - type: string - id: - description: The unique, numeric id of this user. - type: integer - right: - type: integer - updated: - description: A unix timestamp when this task was last updated. You cannot - change this value. - type: integer username: description: The username of the user. Is always unique. maxLength: 250 @@ -867,6 +918,10 @@ definitions: items: type: string type: array + enabled_background_providers: + items: + type: string + type: array frontend_url: type: string link_sharing_enabled: @@ -877,9 +932,20 @@ definitions: type: string registration_enabled: type: boolean + task_attachments_enabled: + type: boolean + totp_enabled: + type: boolean version: type: string type: object + web.HTTPError: + properties: + code: + type: integer + message: + type: string + type: object wunderlist.Migration: properties: code: @@ -906,6 +972,127 @@ info: url: http://code.vikunja.io/api/src/branch/master/LICENSE title: Vikunja API paths: + /{username}/avatar: + get: + description: Returns the user avatar as image. + parameters: + - description: The username of the user who's avatar you want to get + in: path + name: username + required: true + type: string + - description: The size of the avatar you want to get + in: query + name: size + type: integer + produces: + - application/octet-stream + responses: + "200": + description: The avatar + schema: + type: "" + "404": + description: The user does not exist. + schema: + $ref: '#/definitions/models.Message' + "500": + description: Internal error + schema: + $ref: '#/definitions/models.Message' + summary: User Avatar + tags: + - user + /backgrounds/unsplash/image/{image}: + get: + description: Get an unsplash image. **Returns json on error.** + parameters: + - description: Unsplash Image ID + in: path + name: thumb + required: true + type: integer + produces: + - application/octet-stream + responses: + "200": + description: The image + schema: + type: "" + "404": + description: The image does not exist. + schema: + $ref: '#/definitions/models.Message' + "500": + description: Internal error + schema: + $ref: '#/definitions/models.Message' + security: + - JWTKeyAuth: [] + summary: Get an unsplash image + tags: + - list + /backgrounds/unsplash/image/{image}/thumb: + get: + description: Get an unsplash thumbnail image. The thumbnail is cropped to a + max width of 200px. **Returns json on error.** + parameters: + - description: Unsplash Image ID + in: path + name: thumb + required: true + type: integer + produces: + - application/octet-stream + responses: + "200": + description: The thumbnail + schema: + type: "" + "404": + description: The image does not exist. + schema: + $ref: '#/definitions/models.Message' + "500": + description: Internal error + schema: + $ref: '#/definitions/models.Message' + security: + - JWTKeyAuth: [] + summary: Get an unsplash thumbnail image + tags: + - list + /backgrounds/unsplash/search: + get: + description: Search for a list background from unsplash + parameters: + - description: Search backgrounds from unsplash with this search term. + in: query + name: s + type: string + - description: The page number. Used for pagination. If not provided, the first + page of results is returned. + in: query + name: p + type: integer + produces: + - application/json + responses: + "200": + description: An array with photos + schema: + items: + $ref: '#/definitions/background.Image' + type: array + "500": + description: Internal error + schema: + $ref: '#/definitions/models.Message' + security: + - JWTKeyAuth: [] + summary: Search for a background from unsplash + tags: + - list /info: get: description: Returns the version, frontendurl, motd and various settings of @@ -970,7 +1157,6 @@ paths: required: true schema: $ref: '#/definitions/models.Label' - type: object produces: - application/json responses: @@ -981,7 +1167,7 @@ paths: "400": description: Invalid label object provided. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -1013,11 +1199,11 @@ paths: "403": description: Not allowed to delete the label. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "404": description: Label not found. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -1047,11 +1233,11 @@ paths: "403": description: The user does not have access to the label schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "404": description: Label not found schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -1078,7 +1264,6 @@ paths: required: true schema: $ref: '#/definitions/models.Label' - type: object produces: - application/json responses: @@ -1089,15 +1274,15 @@ paths: "400": description: Invalid label object provided. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "403": description: Not allowed to update the label. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "404": description: Label not found. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -1127,6 +1312,10 @@ paths: in: query name: s type: string + - description: If true, also returns all archived lists. + in: query + name: is_archived + type: boolean produces: - application/json responses: @@ -1139,7 +1328,7 @@ paths: "403": description: The user does not have access to the list schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -1168,11 +1357,11 @@ paths: "400": description: Invalid list object provided. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "403": description: The user does not have access to the list schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -1202,7 +1391,7 @@ paths: "403": description: The user does not have access to the list schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -1228,7 +1417,6 @@ paths: required: true schema: $ref: '#/definitions/models.List' - type: object produces: - application/json responses: @@ -1239,11 +1427,11 @@ paths: "400": description: Invalid list object provided. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "403": description: The user does not have access to the list schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -1269,7 +1457,6 @@ paths: required: true schema: $ref: '#/definitions/models.Task' - type: object produces: - application/json responses: @@ -1280,11 +1467,11 @@ paths: "400": description: Invalid task object provided. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "403": description: The user does not have access to the list schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -1294,6 +1481,190 @@ paths: summary: Create a task tags: - task + /lists/{id}/background: + get: + description: Get the list background of a specific list. **Returns json on error.** + parameters: + - description: List ID + in: path + name: id + required: true + type: integer + produces: + - application/octet-stream + responses: + "200": + description: The list background file. + schema: + type: "" + "403": + description: No access to this list. + schema: + $ref: '#/definitions/models.Message' + "404": + description: The list does not exist. + schema: + $ref: '#/definitions/models.Message' + "500": + description: Internal error + schema: + $ref: '#/definitions/models.Message' + security: + - JWTKeyAuth: [] + summary: Get the list background + tags: + - list + /lists/{id}/backgrounds/unsplash: + post: + consumes: + - application/json + description: Sets a photo from unsplash as list background. + parameters: + - description: List ID + in: path + name: id + required: true + type: integer + - description: The image you want to set as background + in: body + name: list + required: true + schema: + $ref: '#/definitions/background.Image' + produces: + - application/json + responses: + "200": + description: The background has been successfully set. + schema: + $ref: '#/definitions/models.List' + "400": + description: Invalid image object provided. + schema: + $ref: '#/definitions/web.HTTPError' + "403": + description: The user does not have access to the list + schema: + $ref: '#/definitions/web.HTTPError' + "500": + description: Internal error + schema: + $ref: '#/definitions/models.Message' + security: + - JWTKeyAuth: [] + summary: Set an unsplash photo as list background + tags: + - list + /lists/{id}/backgrounds/upload: + put: + consumes: + - multipart/form-data + description: Upload a list background. + parameters: + - description: List ID + in: path + name: id + required: true + type: integer + - description: The file as single file. + in: formData + name: background + required: true + type: string + produces: + - application/json + responses: + "200": + description: The background was set successfully. + schema: + $ref: '#/definitions/models.Message' + "403": + description: File too large. + schema: + $ref: '#/definitions/models.Message' + "404": + description: The list does not exist. + schema: + $ref: '#/definitions/models.Message' + "500": + description: Internal error + schema: + $ref: '#/definitions/models.Message' + security: + - JWTKeyAuth: [] + summary: Upload a list background + tags: + - list + /lists/{id}/buckets: + get: + consumes: + - application/json + description: Returns all kanban buckets with belong to a list including their + tasks. + parameters: + - description: List Id + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: The buckets with their tasks + schema: + items: + $ref: '#/definitions/models.Bucket' + type: array + "500": + description: Internal server error + schema: + $ref: '#/definitions/models.Message' + security: + - JWTKeyAuth: [] + summary: Get all kanban buckets of a list + tags: + - task + put: + consumes: + - application/json + description: Creates a new kanban bucket on a list. + parameters: + - description: List Id + in: path + name: id + required: true + type: integer + - description: The bucket object + in: body + name: bucket + required: true + schema: + $ref: '#/definitions/models.Bucket' + produces: + - application/json + responses: + "200": + description: The created bucket object. + schema: + $ref: '#/definitions/models.Bucket' + "400": + description: Invalid bucket object provided. + schema: + $ref: '#/definitions/web.HTTPError' + "404": + description: The list does not exist. + schema: + $ref: '#/definitions/web.HTTPError' + "500": + description: Internal error + schema: + $ref: '#/definitions/models.Message' + security: + - JWTKeyAuth: [] + summary: Create a new bucket + tags: + - task /lists/{id}/listusers: get: consumes: @@ -1317,16 +1688,16 @@ paths: description: All (found) users. schema: items: - $ref: '#/definitions/models.User' + $ref: '#/definitions/user.User' type: array "400": description: Something's invalid. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "401": description: The user does not have the right to see the list. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal server error. schema: @@ -1373,7 +1744,7 @@ paths: "403": description: No right to see the list. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -1399,7 +1770,6 @@ paths: required: true schema: $ref: '#/definitions/models.TeamList' - type: object produces: - application/json responses: @@ -1410,15 +1780,15 @@ paths: "400": description: Invalid team list object provided. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "403": description: The user does not have access to the list schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "404": description: The team does not exist. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -1465,7 +1835,7 @@ paths: "403": description: No right to see the list. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -1491,7 +1861,6 @@ paths: required: true schema: $ref: '#/definitions/models.ListUser' - type: object produces: - application/json responses: @@ -1502,15 +1871,15 @@ paths: "400": description: Invalid user list object provided. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "403": description: The user does not have access to the list schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "404": description: The user does not exist. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -1580,7 +1949,6 @@ paths: required: true schema: $ref: '#/definitions/models.LinkSharing' - type: object produces: - application/json responses: @@ -1591,15 +1959,15 @@ paths: "400": description: Invalid link share object provided. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "403": description: Not allowed to add the list share. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "404": description: The list does not exist. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -1636,11 +2004,11 @@ paths: "403": description: Not allowed to remove the link. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "404": description: Share Link not found. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -1675,11 +2043,11 @@ paths: "403": description: No access to the list schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "404": description: Share Link not found. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -1689,6 +2057,88 @@ paths: summary: Get one link shares for a list tags: - sharing + /lists/{listID}/buckets/{bucketID}: + delete: + consumes: + - application/json + description: Deletes an existing kanban bucket and dissociates all of its task. + It does not delete any tasks. You cannot delete the last bucket on a list. + parameters: + - description: List Id + in: path + name: listID + required: true + type: integer + - description: Bucket Id + in: path + name: bucketID + required: true + type: integer + produces: + - application/json + responses: + "200": + description: Successfully deleted. + schema: + $ref: '#/definitions/models.Message' + "404": + description: The bucket does not exist. + schema: + $ref: '#/definitions/web.HTTPError' + "500": + description: Internal error + schema: + $ref: '#/definitions/models.Message' + security: + - JWTKeyAuth: [] + summary: Deletes an existing bucket + tags: + - task + post: + consumes: + - application/json + description: Updates an existing kanban bucket. + parameters: + - description: List Id + in: path + name: listID + required: true + type: integer + - description: Bucket Id + in: path + name: bucketID + required: true + type: integer + - description: The bucket object + in: body + name: bucket + required: true + schema: + $ref: '#/definitions/models.Bucket' + produces: + - application/json + responses: + "200": + description: The created bucket object. + schema: + $ref: '#/definitions/models.Bucket' + "400": + description: Invalid bucket object provided. + schema: + $ref: '#/definitions/web.HTTPError' + "404": + description: The bucket does not exist. + schema: + $ref: '#/definitions/web.HTTPError' + "500": + description: Internal error + schema: + $ref: '#/definitions/models.Message' + security: + - JWTKeyAuth: [] + summary: Update an existing bucket + tags: + - task /lists/{listID}/tasks: get: consumes: @@ -1716,10 +2166,10 @@ paths: type: string - description: The sorting parameter. You can pass this multiple times to get the tasks ordered by multiple different parametes, along with `order_by`. - Possible values to sort by are `id`, `text`, `description`, `done`, `done_at_unix`, - `due_date_unix`, `created_by_id`, `list_id`, `repeat_after`, `priority`, - `start_date_unix`, `end_date_unix`, `hex_color`, `percent_done`, `uid`, - `created`, `updated`. Default is `id`. + Possible values to sort by are `id`, `title`, `description`, `done`, `done_at`, + `due_date`, `created_by_id`, `list_id`, `repeat_after`, `priority`, `start_date`, + `end_date`, `hex_color`, `percent_done`, `uid`, `created`, `updated`. Default + is `id`. in: query name: sort_by type: string @@ -1728,18 +2178,31 @@ paths: in: query name: order_by type: string - - description: The start date parameter to filter by. Expects a unix timestamp. - If no end date, but a start date is specified, the end date is set to the - current time. + - description: The name of the field to filter by. Accepts an array for multiple + filters which will be chanied together, all supplied filter must match. in: query - name: startdate - type: integer - - description: The end date parameter to filter by. Expects a unix timestamp. - If no start date, but an end date is specified, the start date is set to - the current time. + name: filter_by + type: string + - description: The value to filter for. in: query - name: enddate - type: integer + name: filter_value + type: string + - description: The comparator to use for a filter. Available values are `equals`, + `greater`, `greater_equals`, `less` and `less_equals`. Defaults to `equals` + in: query + name: filter_comparator + type: string + - description: The concatinator to use for filters. Available values are `and` + or `or`. Defaults to `or`. + in: query + name: filter_concat + type: string + - description: If set to true the result will include filtered fields whose + value is set to `null`. Available values are `true` or `false`. Defaults + to `false`. + in: query + name: filter_include_nulls + type: string produces: - application/json responses: @@ -1783,11 +2246,11 @@ paths: "403": description: The user does not have access to the list schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "404": description: Team or list does not exist. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -1819,7 +2282,6 @@ paths: required: true schema: $ref: '#/definitions/models.TeamList' - type: object produces: - application/json responses: @@ -1830,11 +2292,11 @@ paths: "403": description: The user does not have admin-access to the list schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "404": description: Team or list does not exist. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -1869,11 +2331,11 @@ paths: "403": description: The user does not have access to the list schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "404": description: user or list does not exist. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -1905,7 +2367,6 @@ paths: required: true schema: $ref: '#/definitions/models.ListUser' - type: object produces: - application/json responses: @@ -1916,11 +2377,11 @@ paths: "403": description: The user does not have admin-access to the list schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "404": description: User or list does not exist. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -1941,8 +2402,7 @@ paths: name: credentials required: true schema: - $ref: '#/definitions/models.UserLogin' - type: object + $ref: '#/definitions/user.Login' produces: - application/json responses: @@ -1958,9 +2418,84 @@ paths: description: Invalid username or password. schema: $ref: '#/definitions/models.Message' + "412": + description: Invalid totp passcode. + schema: + $ref: '#/definitions/models.Message' summary: Login tags: - user + /migration/todoist/auth: + get: + description: Returns the auth url where the user needs to get its auth code. + This code can then be used to migrate everything from todoist to Vikunja. + produces: + - application/json + responses: + "200": + description: The auth url. + schema: + $ref: '#/definitions/handler.AuthURL' + "500": + description: Internal server error + schema: + $ref: '#/definitions/models.Message' + security: + - JWTKeyAuth: [] + summary: Get the auth url from todoist + tags: + - migration + /migration/todoist/migrate: + post: + consumes: + - application/json + description: Migrates all projects, tasks, notes, reminders, subtasks and files + from todoist to vikunja. + parameters: + - description: The auth code previously obtained from the auth url. See the + docs for /migration/todoist/auth. + in: body + name: migrationCode + required: true + schema: + $ref: '#/definitions/todoist.Migration' + produces: + - application/json + responses: + "200": + description: A message telling you everything was migrated successfully. + schema: + $ref: '#/definitions/models.Message' + "500": + description: Internal server error + schema: + $ref: '#/definitions/models.Message' + security: + - JWTKeyAuth: [] + summary: Migrate all lists, tasks etc. from todoist + tags: + - migration + /migration/todoist/status: + get: + description: Returns if the current user already did the migation or not. This + is useful to show a confirmation message in the frontend if the user is trying + to do the same migration again. + produces: + - application/json + responses: + "200": + description: The migration status + schema: + $ref: '#/definitions/migration.Status' + "500": + description: Internal server error + schema: + $ref: '#/definitions/models.Message' + security: + - JWTKeyAuth: [] + summary: Get migration status + tags: + - migration /migration/wunderlist/auth: get: description: Returns the auth url where the user needs to get its auth code. @@ -1995,7 +2530,6 @@ paths: required: true schema: $ref: '#/definitions/wunderlist.Migration' - type: object produces: - application/json responses: @@ -2050,7 +2584,6 @@ paths: required: true schema: $ref: '#/definitions/models.Namespace' - type: object produces: - application/json responses: @@ -2061,11 +2594,11 @@ paths: "400": description: Invalid namespace object provided. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "403": description: The user does not have access to the namespace schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -2095,6 +2628,10 @@ paths: in: query name: s type: string + - description: If true, also returns all archived namespaces. + in: query + name: is_archived + type: boolean produces: - application/json responses: @@ -2124,7 +2661,6 @@ paths: required: true schema: $ref: '#/definitions/models.Namespace' - type: object produces: - application/json responses: @@ -2135,11 +2671,11 @@ paths: "400": description: Invalid namespace object provided. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "403": description: The user does not have access to the namespace schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -2168,11 +2704,11 @@ paths: "400": description: Invalid namespace object provided. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "403": description: The user does not have access to the namespace schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -2202,7 +2738,7 @@ paths: "403": description: The user does not have access to that namespace. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -2287,7 +2823,7 @@ paths: "403": description: No right to see the namespace. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -2313,7 +2849,6 @@ paths: required: true schema: $ref: '#/definitions/models.TeamNamespace' - type: object produces: - application/json responses: @@ -2324,15 +2859,15 @@ paths: "400": description: Invalid team namespace object provided. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "403": description: The team does not have access to the namespace schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "404": description: The team does not exist. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -2380,7 +2915,7 @@ paths: "403": description: No right to see the namespace. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -2406,7 +2941,6 @@ paths: required: true schema: $ref: '#/definitions/models.NamespaceUser' - type: object produces: - application/json responses: @@ -2417,15 +2951,15 @@ paths: "400": description: Invalid user namespace object provided. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "403": description: The user does not have access to the namespace schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "404": description: The user does not exist. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -2453,7 +2987,6 @@ paths: required: true schema: $ref: '#/definitions/models.List' - type: object produces: - application/json responses: @@ -2464,11 +2997,11 @@ paths: "400": description: Invalid list object provided. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "403": description: The user does not have access to the list schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -2503,11 +3036,11 @@ paths: "403": description: The team does not have access to the namespace schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "404": description: team or namespace does not exist. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -2539,7 +3072,6 @@ paths: required: true schema: $ref: '#/definitions/models.TeamNamespace' - type: object produces: - application/json responses: @@ -2550,11 +3082,11 @@ paths: "403": description: The team does not have admin-access to the namespace schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "404": description: Team or namespace does not exist. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -2589,11 +3121,11 @@ paths: "403": description: The user does not have access to the namespace schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "404": description: user or namespace does not exist. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -2625,7 +3157,6 @@ paths: required: true schema: $ref: '#/definitions/models.NamespaceUser' - type: object produces: - application/json responses: @@ -2636,11 +3167,11 @@ paths: "403": description: The user does not have admin-access to the namespace schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "404": description: User or namespace does not exist. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -2661,20 +3192,19 @@ paths: name: credentials required: true schema: - $ref: '#/definitions/models.APIUserPassword' - type: object + $ref: '#/definitions/user.APIUserPassword' produces: - application/json responses: "200": description: OK schema: - $ref: '#/definitions/models.User' + $ref: '#/definitions/user.User' "400": description: No or invalid user register object provided / User already exists. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -2703,7 +3233,7 @@ paths: "400": description: Invalid link share object provided. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -2761,11 +3291,11 @@ paths: "400": description: Invalid task ID provided. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "403": description: The user does not have access to the list schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -2793,7 +3323,6 @@ paths: required: true schema: $ref: '#/definitions/models.Task' - type: object produces: - application/json responses: @@ -2804,11 +3333,11 @@ paths: "400": description: Invalid task object provided. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "403": description: The user does not have access to the task (aka its list) schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -3042,7 +3571,6 @@ paths: required: true schema: $ref: '#/definitions/models.LabelTask' - type: object produces: - application/json responses: @@ -3053,15 +3581,15 @@ paths: "400": description: Invalid label object provided. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "403": description: Not allowed to add the label. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "404": description: The label does not exist. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -3098,11 +3626,11 @@ paths: "403": description: Not allowed to remove the label. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "404": description: Label not found. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -3144,7 +3672,7 @@ paths: description: The assignees schema: items: - $ref: '#/definitions/models.User' + $ref: '#/definitions/user.User' type: array "500": description: Internal error @@ -3167,7 +3695,6 @@ paths: required: true schema: $ref: '#/definitions/models.TaskAssginee' - type: object - description: Task ID in: path name: taskID @@ -3183,7 +3710,7 @@ paths: "400": description: Invalid assignee object provided. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -3219,7 +3746,7 @@ paths: "403": description: Not allowed to delete the assignee. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -3244,7 +3771,6 @@ paths: required: true schema: $ref: '#/definitions/models.BulkAssignees' - type: object - description: Task ID in: path name: taskID @@ -3260,7 +3786,7 @@ paths: "400": description: Invalid assignee object provided. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -3270,6 +3796,194 @@ paths: summary: Add multiple new assignees to a task tags: - assignees + /tasks/{taskID}/comments: + get: + consumes: + - application/json + description: Get all task comments. The user doing this need to have at least + read access to the task. + parameters: + - description: Task ID + in: path + name: taskID + required: true + type: integer + produces: + - application/json + responses: + "200": + description: The array with all task comments + schema: + items: + $ref: '#/definitions/models.TaskComment' + type: array + "500": + description: Internal error + schema: + $ref: '#/definitions/models.Message' + security: + - JWTKeyAuth: [] + summary: Get all task comments + tags: + - task + put: + consumes: + - application/json + description: Create a new task comment. The user doing this need to have at + least write access to the task this comment should belong to. + parameters: + - description: The task comment object + in: body + name: relation + required: true + schema: + $ref: '#/definitions/models.TaskComment' + - description: Task ID + in: path + name: taskID + required: true + type: integer + produces: + - application/json + responses: + "200": + description: The created task comment object. + schema: + $ref: '#/definitions/models.TaskComment' + "400": + description: Invalid task comment object provided. + schema: + $ref: '#/definitions/web.HTTPError' + "500": + description: Internal error + schema: + $ref: '#/definitions/models.Message' + security: + - JWTKeyAuth: [] + summary: Create a new task comment + tags: + - task + /tasks/{taskID}/comments/{commentID}: + delete: + consumes: + - application/json + description: Remove a task comment. The user doing this need to have at least + write access to the task this comment belongs to. + parameters: + - description: Task ID + in: path + name: taskID + required: true + type: integer + - description: Comment ID + in: path + name: commentID + required: true + type: integer + produces: + - application/json + responses: + "200": + description: The task comment was successfully deleted. + schema: + $ref: '#/definitions/models.Message' + "400": + description: Invalid task comment object provided. + schema: + $ref: '#/definitions/web.HTTPError' + "404": + description: The task comment was not found. + schema: + $ref: '#/definitions/web.HTTPError' + "500": + description: Internal error + schema: + $ref: '#/definitions/models.Message' + security: + - JWTKeyAuth: [] + summary: Remove a task comment + tags: + - task + get: + consumes: + - application/json + description: Remove a task comment. The user doing this need to have at least + read access to the task this comment belongs to. + parameters: + - description: Task ID + in: path + name: taskID + required: true + type: integer + - description: Comment ID + in: path + name: commentID + required: true + type: integer + produces: + - application/json + responses: + "200": + description: The task comment object. + schema: + $ref: '#/definitions/models.TaskComment' + "400": + description: Invalid task comment object provided. + schema: + $ref: '#/definitions/web.HTTPError' + "404": + description: The task comment was not found. + schema: + $ref: '#/definitions/web.HTTPError' + "500": + description: Internal error + schema: + $ref: '#/definitions/models.Message' + security: + - JWTKeyAuth: [] + summary: Remove a task comment + tags: + - task + post: + consumes: + - application/json + description: Update an existing task comment. The user doing this need to have + at least write access to the task this comment belongs to. + parameters: + - description: Task ID + in: path + name: taskID + required: true + type: integer + - description: Comment ID + in: path + name: commentID + required: true + type: integer + produces: + - application/json + responses: + "200": + description: The updated task comment object. + schema: + $ref: '#/definitions/models.TaskComment' + "400": + description: Invalid task comment object provided. + schema: + $ref: '#/definitions/web.HTTPError' + "404": + description: The task comment was not found. + schema: + $ref: '#/definitions/web.HTTPError' + "500": + description: Internal error + schema: + $ref: '#/definitions/models.Message' + security: + - JWTKeyAuth: [] + summary: Update an existing task comment + tags: + - task /tasks/{taskID}/labels/bulk: post: consumes: @@ -3285,7 +3999,6 @@ paths: required: true schema: $ref: '#/definitions/models.LabelTaskBulk' - type: object - description: Task ID in: path name: taskID @@ -3301,7 +4014,7 @@ paths: "400": description: Invalid label object provided. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -3322,7 +4035,6 @@ paths: required: true schema: $ref: '#/definitions/models.TaskRelation' - type: object - description: Task ID in: path name: taskID @@ -3338,11 +4050,11 @@ paths: "400": description: Invalid task relation object provided. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "404": description: The task relation was not found. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -3366,7 +4078,6 @@ paths: required: true schema: $ref: '#/definitions/models.TaskRelation' - type: object - description: Task ID in: path name: taskID @@ -3382,7 +4093,7 @@ paths: "400": description: Invalid task relation object provided. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -3412,23 +4123,39 @@ paths: in: query name: s type: string - - description: The sorting parameter. Possible values to sort by are priority, - prioritydesc, priorityasc, duedate, duedatedesc, duedateasc. + - description: The sorting parameter. You can pass this multiple times to get + the tasks ordered by multiple different parametes, along with `order_by`. + Possible values to sort by are `id`, `text`, `description`, `done`, `done_at`, + `due_date`, `created_by_id`, `list_id`, `repeat_after`, `priority`, `start_date`, + `end_date`, `hex_color`, `percent_done`, `uid`, `created`, `updated`. Default + is `id`. in: query - name: sort + name: sort_by type: string - - description: The start date parameter to filter by. Expects a unix timestamp. - If no end date, but a start date is specified, the end date is set to the - current time. + - description: The ordering parameter. Possible values to order by are `asc` + or `desc`. Default is `asc`. in: query - name: startdate - type: integer - - description: The end date parameter to filter by. Expects a unix timestamp. - If no start date, but an end date is specified, the start date is set to - the current time. + name: order_by + type: string + - description: The name of the field to filter by. Accepts an array for multiple + filters which will be chanied together, all supplied filter must match. in: query - name: enddate - type: integer + name: filter_by + type: string + - description: The value to filter for. + in: query + name: filter_value + type: string + - description: The comparator to use for a filter. Available values are `equals`, + `greater`, `greater_equals`, `less` and `less_equals`. Defaults to `equals` + in: query + name: filter_comparator + type: string + - description: The concatinator to use for filters. Available values are `and` + or `or`. Defaults to `or`. + in: query + name: filter_concat + type: string produces: - application/json responses: @@ -3462,7 +4189,6 @@ paths: required: true schema: $ref: '#/definitions/models.BulkTask' - type: object produces: - application/json responses: @@ -3473,11 +4199,11 @@ paths: "400": description: Invalid task object provided. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "403": description: The user does not have access to the task (aka its list) schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -3537,7 +4263,6 @@ paths: required: true schema: $ref: '#/definitions/models.Team' - type: object produces: - application/json responses: @@ -3548,7 +4273,7 @@ paths: "400": description: Invalid team object provided. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -3578,7 +4303,7 @@ paths: "400": description: Invalid team object provided. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -3588,6 +4313,36 @@ paths: summary: Deletes a team tags: - team + get: + consumes: + - application/json + description: Returns a team by its ID. + parameters: + - description: Team ID + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: The team + schema: + $ref: '#/definitions/models.Team' + "403": + description: The user does not have access to the team + schema: + $ref: '#/definitions/web.HTTPError' + "500": + description: Internal error + schema: + $ref: '#/definitions/models.Message' + security: + - JWTKeyAuth: [] + summary: Gets one team + tags: + - team post: consumes: - application/json @@ -3604,7 +4359,6 @@ paths: required: true schema: $ref: '#/definitions/models.Team' - type: object produces: - application/json responses: @@ -3615,7 +4369,7 @@ paths: "400": description: Invalid team object provided. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -3642,7 +4396,6 @@ paths: required: true schema: $ref: '#/definitions/models.TeamMember' - type: object produces: - application/json responses: @@ -3653,11 +4406,11 @@ paths: "400": description: Invalid member object provided. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "403": description: The user does not have access to the team schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -3709,11 +4462,11 @@ paths: "200": description: OK schema: - $ref: '#/definitions/models.User' + $ref: '#/definitions/user.User' "404": description: User does not exist. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal server error. schema: @@ -3734,8 +4487,7 @@ paths: name: credentials required: true schema: - $ref: '#/definitions/models.EmailConfirm' - type: object + $ref: '#/definitions/user.EmailConfirm' produces: - application/json responses: @@ -3746,7 +4498,7 @@ paths: "412": description: Bad token provided. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -3766,7 +4518,6 @@ paths: required: true schema: $ref: '#/definitions/v1.UserPassword' - type: object produces: - application/json responses: @@ -3777,11 +4528,11 @@ paths: "400": description: Something's invalid. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "404": description: User does not exist. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal server error. schema: @@ -3802,8 +4553,7 @@ paths: name: credentials required: true schema: - $ref: '#/definitions/models.PasswordReset' - type: object + $ref: '#/definitions/user.PasswordReset' produces: - application/json responses: @@ -3814,7 +4564,7 @@ paths: "400": description: Bad token provided. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -3834,8 +4584,7 @@ paths: name: credentials required: true schema: - $ref: '#/definitions/models.PasswordTokenRequest' - type: object + $ref: '#/definitions/user.PasswordTokenRequest' produces: - application/json responses: @@ -3846,7 +4595,7 @@ paths: "404": description: The user does not exist. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal error schema: @@ -3854,6 +4603,193 @@ paths: summary: Request password reset token tags: - user + /user/settings/email: + post: + consumes: + - application/json + description: Lets the current user change their email address. + parameters: + - description: The new email address and current password. + in: body + name: userEmailUpdate + required: true + schema: + $ref: '#/definitions/user.EmailUpdate' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/models.Message' + "400": + description: Something's invalid. + schema: + $ref: '#/definitions/web.HTTPError' + "404": + description: User does not exist. + schema: + $ref: '#/definitions/web.HTTPError' + "500": + description: Internal server error. + schema: + $ref: '#/definitions/models.Message' + security: + - JWTKeyAuth: [] + summary: Update email address + tags: + - user + /user/settings/totp: + get: + consumes: + - application/json + description: Returns the current user totp setting or an error if it is not + enabled. + produces: + - application/json + responses: + "200": + description: The totp settings. + schema: + $ref: '#/definitions/user.TOTP' + "500": + description: Internal server error. + schema: + $ref: '#/definitions/models.Message' + security: + - JWTKeyAuth: [] + summary: Totp setting for the current user + tags: + - user + /user/settings/totp/disable: + post: + consumes: + - application/json + description: Disables any totp settings for the current user. + parameters: + - description: The current user's password (only password is enough). + in: body + name: totp + required: true + schema: + $ref: '#/definitions/user.Login' + produces: + - application/json + responses: + "200": + description: Successfully disabled + schema: + $ref: '#/definitions/models.Message' + "400": + description: Something's invalid. + schema: + $ref: '#/definitions/web.HTTPError' + "404": + description: User does not exist. + schema: + $ref: '#/definitions/web.HTTPError' + "500": + description: Internal server error. + schema: + $ref: '#/definitions/models.Message' + security: + - JWTKeyAuth: [] + summary: Disable totp settings + tags: + - user + /user/settings/totp/enable: + post: + consumes: + - application/json + description: Enables a previously enrolled totp setting by providing a totp + passcode. + parameters: + - description: The totp passcode. + in: body + name: totp + required: true + schema: + $ref: '#/definitions/user.TOTPPasscode' + produces: + - application/json + responses: + "200": + description: Successfully enabled + schema: + $ref: '#/definitions/models.Message' + "400": + description: Something's invalid. + schema: + $ref: '#/definitions/web.HTTPError' + "404": + description: User does not exist. + schema: + $ref: '#/definitions/web.HTTPError' + "412": + description: TOTP is not enrolled. + schema: + $ref: '#/definitions/web.HTTPError' + "500": + description: Internal server error. + schema: + $ref: '#/definitions/models.Message' + security: + - JWTKeyAuth: [] + summary: Enable a previously enrolled totp setting. + tags: + - user + /user/settings/totp/enroll: + post: + consumes: + - application/json + description: Creates an initial setup for the user in the db. After this step, + the user needs to verify they have a working totp setup with the "enable totp" + endpoint. + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/user.TOTP' + "400": + description: Something's invalid. + schema: + $ref: '#/definitions/web.HTTPError' + "404": + description: User does not exist. + schema: + $ref: '#/definitions/web.HTTPError' + "500": + description: Internal server error. + schema: + $ref: '#/definitions/models.Message' + security: + - JWTKeyAuth: [] + summary: Enroll a user into totp + tags: + - user + /user/settings/totp/qrcode: + get: + consumes: + - application/json + description: Returns a qr code for easier setup at end user's devices. + produces: + - application/json + responses: + "200": + description: The qr code as jpeg image + schema: + type: "" + "500": + description: Internal server error. + schema: + $ref: '#/definitions/models.Message' + security: + - JWTKeyAuth: [] + summary: Totp QR Code + tags: + - user /user/token: post: consumes: @@ -3891,12 +4827,12 @@ paths: description: All (found) users. schema: items: - $ref: '#/definitions/models.User' + $ref: '#/definitions/user.User' type: array "400": description: Something's invalid. schema: - $ref: '#/definitions/code.vikunja.io/web.HTTPError' + $ref: '#/definitions/web.HTTPError' "500": description: Internal server error. schema: