feat(server): user preferences (#9736)

* refactor(server): user endpoints

* feat(server): user preferences

* mobile: user preference

* wording

---------

Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
Jason Rasmussen
2024-05-27 22:16:53 -04:00
committed by GitHub
parent 1f9158c545
commit 0fc6d69824
39 changed files with 1392 additions and 327 deletions

View File

@@ -432,6 +432,98 @@
]
}
},
"/admin/users/{id}/preferences": {
"get": {
"operationId": "getUserPreferencesAdmin",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"format": "uuid",
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserPreferencesResponseDto"
}
}
},
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"tags": [
"User"
]
},
"put": {
"operationId": "updateUserPreferencesAdmin",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"format": "uuid",
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserPreferencesUpdateDto"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserPreferencesResponseDto"
}
}
},
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"tags": [
"User"
]
}
},
"/admin/users/{id}/restore": {
"post": {
"operationId": "restoreUserAdmin",
@@ -6403,6 +6495,78 @@
]
}
},
"/users/me/preferences": {
"get": {
"operationId": "getMyPreferences",
"parameters": [],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserPreferencesResponseDto"
}
}
},
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"tags": [
"User"
]
},
"put": {
"operationId": "updateMyPreferences",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserPreferencesUpdateDto"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserPreferencesResponseDto"
}
}
},
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"tags": [
"User"
]
}
},
"/users/profile-image": {
"delete": {
"operationId": "deleteProfileImage",
@@ -7621,6 +7785,25 @@
],
"type": "object"
},
"AvatarResponse": {
"properties": {
"color": {
"$ref": "#/components/schemas/UserAvatarColor"
}
},
"required": [
"color"
],
"type": "object"
},
"AvatarUpdate": {
"properties": {
"color": {
"$ref": "#/components/schemas/UserAvatarColor"
}
},
"type": "object"
},
"BulkIdResponseDto": {
"properties": {
"error": {
@@ -8584,6 +8767,17 @@
],
"type": "object"
},
"MemoryResponse": {
"properties": {
"enabled": {
"type": "boolean"
}
},
"required": [
"enabled"
],
"type": "object"
},
"MemoryResponseDto": {
"properties": {
"assets": {
@@ -8650,6 +8844,14 @@
],
"type": "string"
},
"MemoryUpdate": {
"properties": {
"enabled": {
"type": "boolean"
}
},
"type": "object"
},
"MemoryUpdateDto": {
"properties": {
"isSaved": {
@@ -10878,9 +11080,6 @@
"email": {
"type": "string"
},
"memoriesEnabled": {
"type": "boolean"
},
"name": {
"type": "string"
},
@@ -10942,9 +11141,6 @@
"isAdmin": {
"type": "boolean"
},
"memoriesEnabled": {
"type": "boolean"
},
"name": {
"type": "string"
},
@@ -11000,15 +11196,9 @@
},
"UserAdminUpdateDto": {
"properties": {
"avatarColor": {
"$ref": "#/components/schemas/UserAvatarColor"
},
"email": {
"type": "string"
},
"memoriesEnabled": {
"type": "boolean"
},
"name": {
"type": "string"
},
@@ -11046,6 +11236,32 @@
],
"type": "string"
},
"UserPreferencesResponseDto": {
"properties": {
"avatar": {
"$ref": "#/components/schemas/AvatarResponse"
},
"memories": {
"$ref": "#/components/schemas/MemoryResponse"
}
},
"required": [
"avatar",
"memories"
],
"type": "object"
},
"UserPreferencesUpdateDto": {
"properties": {
"avatar": {
"$ref": "#/components/schemas/AvatarUpdate"
},
"memories": {
"$ref": "#/components/schemas/MemoryUpdate"
}
},
"type": "object"
},
"UserResponseDto": {
"properties": {
"avatarColor": {
@@ -11083,15 +11299,9 @@
},
"UserUpdateMeDto": {
"properties": {
"avatarColor": {
"$ref": "#/components/schemas/UserAvatarColor"
},
"email": {
"type": "string"
},
"memoriesEnabled": {
"type": "boolean"
},
"name": {
"type": "string"
},