More avatar providers (#622)
Don't fail if the last avatar file does not exist when deleting it Fix lint Remove old global avatar setting and update docs Generate docs Invalidate the avatar cache when uploading a new one Add debug logs Add caching for upload avatars Add cache locks Fix encoding Resize the uploaded image to a max of 1024 pixels Remove the old uploaded avatar if one already exists Add mimetype check for images Set avatar provider to upload when uploading an avatar Add upload avatar provider Make font size smaller to let the initials still look good in smaller sizes Add debug log Add cache and resizing of initials avatars Make font size depend on avatar size Add drawing initials avatar Add initials provider Make the initials avatar provider the default Add routes Add user avatar settings handler methods Add user avatar provider field Co-authored-by: kolaente <k@knt.li> Reviewed-on: https://kolaente.dev/vikunja/api/pulls/622
This commit is contained in:
@ -906,6 +906,12 @@
|
||||
"$ref": "#/definitions/models.Message"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "File is no image.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.Message"
|
||||
}
|
||||
},
|
||||
"403": {
|
||||
"description": "File too large.",
|
||||
"schema": {
|
||||
@ -1500,6 +1506,70 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/lists/{listID}/duplicate": {
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
"JWTKeyAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Copies the list, tasks, files, kanban data, assignees, comments, attachments, lables, relations, backgrounds, user/team rights and link shares from one list to a new namespace. The user needs read access in the list and write access in the namespace of the new list.",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"list"
|
||||
],
|
||||
"summary": "Duplicate an existing list",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "The list ID to duplicate",
|
||||
"name": "listID",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "The target namespace which should hold the copied list.",
|
||||
"name": "list",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.ListDuplicate"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "The created list.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.ListDuplicate"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid list duplicate object provided.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/web.HTTPError"
|
||||
}
|
||||
},
|
||||
"403": {
|
||||
"description": "The user does not have access to the list or namespace",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/web.HTTPError"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.Message"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/lists/{listID}/tasks": {
|
||||
"get": {
|
||||
"security": [
|
||||
@ -5459,6 +5529,150 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/user/settings/avatar": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"JWTKeyAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Returns the current user's avatar setting.",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"user"
|
||||
],
|
||||
"summary": "Return user avatar setting",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/v1.UserAvatarProvider"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Something's invalid.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/web.HTTPError"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.Message"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"JWTKeyAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Changes the user avatar. Valid types are gravatar (uses the user email), upload, initials, default.",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"user"
|
||||
],
|
||||
"summary": "Set the user's avatar",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "The user's avatar setting",
|
||||
"name": "avatar",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/v1.UserAvatarProvider"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/v1.UserAvatarProvider"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Something's invalid.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/web.HTTPError"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.Message"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/user/settings/avatar/upload": {
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
"JWTKeyAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Upload a user avatar. This will also set the user's avatar provider to \"upload\"",
|
||||
"consumes": [
|
||||
"multipart/form-data"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"user"
|
||||
],
|
||||
"summary": "Upload a user avatar",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "The avatar as single file.",
|
||||
"name": "avatar",
|
||||
"in": "formData",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "The avatar was set successfully.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.Message"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "File is no image.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.Message"
|
||||
}
|
||||
},
|
||||
"403": {
|
||||
"description": "File too large.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.Message"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.Message"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/user/settings/email": {
|
||||
"post": {
|
||||
"security": [
|
||||
@ -6279,6 +6493,20 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"models.ListDuplicate": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"list": {
|
||||
"description": "The copied list",
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/models.List"
|
||||
},
|
||||
"namespace_id": {
|
||||
"description": "The target namespace ID",
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"models.ListUser": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@ -7019,6 +7247,14 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1.UserAvatarProvider": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"avatar_provider": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1.UserPassword": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@ -7030,6 +7266,17 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1.legalInfo": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"imprint_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"privacy_policy_url": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1.vikunjaInfos": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@ -7048,6 +7295,10 @@
|
||||
"frontend_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"legal": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/v1.legalInfo"
|
||||
},
|
||||
"link_sharing_enabled": {
|
||||
"type": "boolean"
|
||||
},
|
||||
|
Reference in New Issue
Block a user