Ver Fonte

pr feedback

martabal há 1 ano atrás
pai
commit
46d640b7a1

+ 24 - 22
cli/src/api/open-api/api.ts

@@ -4257,10 +4257,10 @@ export interface UpdateTagDto {
 export interface UpdateUserDto {
 export interface UpdateUserDto {
     /**
     /**
      * 
      * 
-     * @type {string}
+     * @type {UserAvatarColor}
      * @memberof UpdateUserDto
      * @memberof UpdateUserDto
      */
      */
-    'avatarColor'?: UpdateUserDtoAvatarColorEnum;
+    'avatarColor'?: UserAvatarColor;
     /**
     /**
      * 
      * 
      * @type {string}
      * @type {string}
@@ -4309,12 +4309,6 @@ export interface UpdateUserDto {
      * @memberof UpdateUserDto
      * @memberof UpdateUserDto
      */
      */
     'password'?: string;
     'password'?: string;
-    /**
-     * 
-     * @type {string}
-     * @memberof UpdateUserDto
-     */
-    'profileImagePath'?: string;
     /**
     /**
      * 
      * 
      * @type {boolean}
      * @type {boolean}
@@ -4329,20 +4323,6 @@ export interface UpdateUserDto {
     'storageLabel'?: string;
     'storageLabel'?: string;
 }
 }
 
 
-export const UpdateUserDtoAvatarColorEnum = {
-    Primary: 'primary',
-    Pink: 'pink',
-    Red: 'red',
-    Yellow: 'yellow',
-    Blue: 'blue',
-    Green: 'green',
-    Purple: 'purple',
-    Orange: 'orange',
-    Gray: 'gray',
-    Amber: 'amber'
-} as const;
-
-export type UpdateUserDtoAvatarColorEnum = typeof UpdateUserDtoAvatarColorEnum[keyof typeof UpdateUserDtoAvatarColorEnum];
 
 
 /**
 /**
  * 
  * 
@@ -4387,6 +4367,28 @@ export interface UsageByUserDto {
      */
      */
     'videos': number;
     'videos': number;
 }
 }
+/**
+ * 
+ * @export
+ * @enum {string}
+ */
+
+export const UserAvatarColor = {
+    Primary: 'primary',
+    Pink: 'pink',
+    Red: 'red',
+    Yellow: 'yellow',
+    Blue: 'blue',
+    Green: 'green',
+    Purple: 'purple',
+    Orange: 'orange',
+    Gray: 'gray',
+    Amber: 'amber'
+} as const;
+
+export type UserAvatarColor = typeof UserAvatarColor[keyof typeof UserAvatarColor];
+
+
 /**
 /**
  * 
  * 
  * @export
  * @export

+ 3 - 0
mobile/openapi/.openapi-generator/FILES

@@ -163,6 +163,7 @@ doc/UpdateTagDto.md
 doc/UpdateUserDto.md
 doc/UpdateUserDto.md
 doc/UsageByUserDto.md
 doc/UsageByUserDto.md
 doc/UserApi.md
 doc/UserApi.md
+doc/UserAvatarColor.md
 doc/UserDto.md
 doc/UserDto.md
 doc/UserResponseDto.md
 doc/UserResponseDto.md
 doc/ValidateAccessTokenResponseDto.md
 doc/ValidateAccessTokenResponseDto.md
@@ -337,6 +338,7 @@ lib/model/update_stack_parent_dto.dart
 lib/model/update_tag_dto.dart
 lib/model/update_tag_dto.dart
 lib/model/update_user_dto.dart
 lib/model/update_user_dto.dart
 lib/model/usage_by_user_dto.dart
 lib/model/usage_by_user_dto.dart
+lib/model/user_avatar_color.dart
 lib/model/user_dto.dart
 lib/model/user_dto.dart
 lib/model/user_response_dto.dart
 lib/model/user_response_dto.dart
 lib/model/validate_access_token_response_dto.dart
 lib/model/validate_access_token_response_dto.dart
@@ -502,6 +504,7 @@ test/update_tag_dto_test.dart
 test/update_user_dto_test.dart
 test/update_user_dto_test.dart
 test/usage_by_user_dto_test.dart
 test/usage_by_user_dto_test.dart
 test/user_api_test.dart
 test/user_api_test.dart
+test/user_avatar_color_test.dart
 test/user_dto_test.dart
 test/user_dto_test.dart
 test/user_response_dto_test.dart
 test/user_response_dto_test.dart
 test/validate_access_token_response_dto_test.dart
 test/validate_access_token_response_dto_test.dart

+ 1 - 0
mobile/openapi/README.md

@@ -348,6 +348,7 @@ Class | Method | HTTP request | Description
  - [UpdateTagDto](doc//UpdateTagDto.md)
  - [UpdateTagDto](doc//UpdateTagDto.md)
  - [UpdateUserDto](doc//UpdateUserDto.md)
  - [UpdateUserDto](doc//UpdateUserDto.md)
  - [UsageByUserDto](doc//UsageByUserDto.md)
  - [UsageByUserDto](doc//UsageByUserDto.md)
+ - [UserAvatarColor](doc//UserAvatarColor.md)
  - [UserDto](doc//UserDto.md)
  - [UserDto](doc//UserDto.md)
  - [UserResponseDto](doc//UserResponseDto.md)
  - [UserResponseDto](doc//UserResponseDto.md)
  - [ValidateAccessTokenResponseDto](doc//ValidateAccessTokenResponseDto.md)
  - [ValidateAccessTokenResponseDto](doc//ValidateAccessTokenResponseDto.md)

+ 1 - 2
mobile/openapi/doc/UpdateUserDto.md

@@ -8,7 +8,7 @@ import 'package:openapi/api.dart';
 ## Properties
 ## Properties
 Name | Type | Description | Notes
 Name | Type | Description | Notes
 ------------ | ------------- | ------------- | -------------
 ------------ | ------------- | ------------- | -------------
-**avatarColor** | **String** |  | [optional] 
+**avatarColor** | [**UserAvatarColor**](UserAvatarColor.md) |  | [optional] 
 **email** | **String** |  | [optional] 
 **email** | **String** |  | [optional] 
 **externalPath** | **String** |  | [optional] 
 **externalPath** | **String** |  | [optional] 
 **firstName** | **String** |  | [optional] 
 **firstName** | **String** |  | [optional] 
@@ -17,7 +17,6 @@ Name | Type | Description | Notes
 **lastName** | **String** |  | [optional] 
 **lastName** | **String** |  | [optional] 
 **memoriesEnabled** | **bool** |  | [optional] 
 **memoriesEnabled** | **bool** |  | [optional] 
 **password** | **String** |  | [optional] 
 **password** | **String** |  | [optional] 
-**profileImagePath** | **String** |  | [optional] 
 **shouldChangePassword** | **bool** |  | [optional] 
 **shouldChangePassword** | **bool** |  | [optional] 
 **storageLabel** | **String** |  | [optional] 
 **storageLabel** | **String** |  | [optional] 
 
 

+ 14 - 0
mobile/openapi/doc/UserAvatarColor.md

@@ -0,0 +1,14 @@
+# openapi.model.UserAvatarColor
+
+## Load the model package
+```dart
+import 'package:openapi/api.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+

+ 1 - 0
mobile/openapi/lib/api.dart

@@ -189,6 +189,7 @@ part 'model/update_stack_parent_dto.dart';
 part 'model/update_tag_dto.dart';
 part 'model/update_tag_dto.dart';
 part 'model/update_user_dto.dart';
 part 'model/update_user_dto.dart';
 part 'model/usage_by_user_dto.dart';
 part 'model/usage_by_user_dto.dart';
+part 'model/user_avatar_color.dart';
 part 'model/user_dto.dart';
 part 'model/user_dto.dart';
 part 'model/user_response_dto.dart';
 part 'model/user_response_dto.dart';
 part 'model/validate_access_token_response_dto.dart';
 part 'model/validate_access_token_response_dto.dart';

+ 2 - 0
mobile/openapi/lib/api_client.dart

@@ -467,6 +467,8 @@ class ApiClient {
           return UpdateUserDto.fromJson(value);
           return UpdateUserDto.fromJson(value);
         case 'UsageByUserDto':
         case 'UsageByUserDto':
           return UsageByUserDto.fromJson(value);
           return UsageByUserDto.fromJson(value);
+        case 'UserAvatarColor':
+          return UserAvatarColorTypeTransformer().decode(value);
         case 'UserDto':
         case 'UserDto':
           return UserDto.fromJson(value);
           return UserDto.fromJson(value);
         case 'UserResponseDto':
         case 'UserResponseDto':

+ 3 - 0
mobile/openapi/lib/api_helper.dart

@@ -121,6 +121,9 @@ String parameterToString(dynamic value) {
   if (value is TranscodePolicy) {
   if (value is TranscodePolicy) {
     return TranscodePolicyTypeTransformer().encode(value).toString();
     return TranscodePolicyTypeTransformer().encode(value).toString();
   }
   }
+  if (value is UserAvatarColor) {
+    return UserAvatarColorTypeTransformer().encode(value).toString();
+  }
   if (value is VideoCodec) {
   if (value is VideoCodec) {
     return VideoCodecTypeTransformer().encode(value).toString();
     return VideoCodecTypeTransformer().encode(value).toString();
   }
   }

+ 9 - 118
mobile/openapi/lib/model/update_user_dto.dart

@@ -22,12 +22,17 @@ class UpdateUserDto {
     this.lastName,
     this.lastName,
     this.memoriesEnabled,
     this.memoriesEnabled,
     this.password,
     this.password,
-    this.profileImagePath,
     this.shouldChangePassword,
     this.shouldChangePassword,
     this.storageLabel,
     this.storageLabel,
   });
   });
 
 
-  UpdateUserDtoAvatarColorEnum? avatarColor;
+  ///
+  /// Please note: This property should have been non-nullable! Since the specification file
+  /// does not include a default value (using the "default:" property), however, the generated
+  /// source code must fall back to having a nullable type.
+  /// Consider adding a "default:" property in the specification file to hide this note.
+  ///
+  UserAvatarColor? avatarColor;
 
 
   ///
   ///
   /// Please note: This property should have been non-nullable! Since the specification file
   /// Please note: This property should have been non-nullable! Since the specification file
@@ -87,14 +92,6 @@ class UpdateUserDto {
   ///
   ///
   String? password;
   String? password;
 
 
-  ///
-  /// Please note: This property should have been non-nullable! Since the specification file
-  /// does not include a default value (using the "default:" property), however, the generated
-  /// source code must fall back to having a nullable type.
-  /// Consider adding a "default:" property in the specification file to hide this note.
-  ///
-  String? profileImagePath;
-
   ///
   ///
   /// Please note: This property should have been non-nullable! Since the specification file
   /// Please note: This property should have been non-nullable! Since the specification file
   /// does not include a default value (using the "default:" property), however, the generated
   /// does not include a default value (using the "default:" property), however, the generated
@@ -122,7 +119,6 @@ class UpdateUserDto {
      other.lastName == lastName &&
      other.lastName == lastName &&
      other.memoriesEnabled == memoriesEnabled &&
      other.memoriesEnabled == memoriesEnabled &&
      other.password == password &&
      other.password == password &&
-     other.profileImagePath == profileImagePath &&
      other.shouldChangePassword == shouldChangePassword &&
      other.shouldChangePassword == shouldChangePassword &&
      other.storageLabel == storageLabel;
      other.storageLabel == storageLabel;
 
 
@@ -138,12 +134,11 @@ class UpdateUserDto {
     (lastName == null ? 0 : lastName!.hashCode) +
     (lastName == null ? 0 : lastName!.hashCode) +
     (memoriesEnabled == null ? 0 : memoriesEnabled!.hashCode) +
     (memoriesEnabled == null ? 0 : memoriesEnabled!.hashCode) +
     (password == null ? 0 : password!.hashCode) +
     (password == null ? 0 : password!.hashCode) +
-    (profileImagePath == null ? 0 : profileImagePath!.hashCode) +
     (shouldChangePassword == null ? 0 : shouldChangePassword!.hashCode) +
     (shouldChangePassword == null ? 0 : shouldChangePassword!.hashCode) +
     (storageLabel == null ? 0 : storageLabel!.hashCode);
     (storageLabel == null ? 0 : storageLabel!.hashCode);
 
 
   @override
   @override
-  String toString() => 'UpdateUserDto[avatarColor=$avatarColor, email=$email, externalPath=$externalPath, firstName=$firstName, id=$id, isAdmin=$isAdmin, lastName=$lastName, memoriesEnabled=$memoriesEnabled, password=$password, profileImagePath=$profileImagePath, shouldChangePassword=$shouldChangePassword, storageLabel=$storageLabel]';
+  String toString() => 'UpdateUserDto[avatarColor=$avatarColor, email=$email, externalPath=$externalPath, firstName=$firstName, id=$id, isAdmin=$isAdmin, lastName=$lastName, memoriesEnabled=$memoriesEnabled, password=$password, shouldChangePassword=$shouldChangePassword, storageLabel=$storageLabel]';
 
 
   Map<String, dynamic> toJson() {
   Map<String, dynamic> toJson() {
     final json = <String, dynamic>{};
     final json = <String, dynamic>{};
@@ -188,11 +183,6 @@ class UpdateUserDto {
     } else {
     } else {
     //  json[r'password'] = null;
     //  json[r'password'] = null;
     }
     }
-    if (this.profileImagePath != null) {
-      json[r'profileImagePath'] = this.profileImagePath;
-    } else {
-    //  json[r'profileImagePath'] = null;
-    }
     if (this.shouldChangePassword != null) {
     if (this.shouldChangePassword != null) {
       json[r'shouldChangePassword'] = this.shouldChangePassword;
       json[r'shouldChangePassword'] = this.shouldChangePassword;
     } else {
     } else {
@@ -214,7 +204,7 @@ class UpdateUserDto {
       final json = value.cast<String, dynamic>();
       final json = value.cast<String, dynamic>();
 
 
       return UpdateUserDto(
       return UpdateUserDto(
-        avatarColor: UpdateUserDtoAvatarColorEnum.fromJson(json[r'avatarColor']),
+        avatarColor: UserAvatarColor.fromJson(json[r'avatarColor']),
         email: mapValueOfType<String>(json, r'email'),
         email: mapValueOfType<String>(json, r'email'),
         externalPath: mapValueOfType<String>(json, r'externalPath'),
         externalPath: mapValueOfType<String>(json, r'externalPath'),
         firstName: mapValueOfType<String>(json, r'firstName'),
         firstName: mapValueOfType<String>(json, r'firstName'),
@@ -223,7 +213,6 @@ class UpdateUserDto {
         lastName: mapValueOfType<String>(json, r'lastName'),
         lastName: mapValueOfType<String>(json, r'lastName'),
         memoriesEnabled: mapValueOfType<bool>(json, r'memoriesEnabled'),
         memoriesEnabled: mapValueOfType<bool>(json, r'memoriesEnabled'),
         password: mapValueOfType<String>(json, r'password'),
         password: mapValueOfType<String>(json, r'password'),
-        profileImagePath: mapValueOfType<String>(json, r'profileImagePath'),
         shouldChangePassword: mapValueOfType<bool>(json, r'shouldChangePassword'),
         shouldChangePassword: mapValueOfType<bool>(json, r'shouldChangePassword'),
         storageLabel: mapValueOfType<String>(json, r'storageLabel'),
         storageLabel: mapValueOfType<String>(json, r'storageLabel'),
       );
       );
@@ -277,101 +266,3 @@ class UpdateUserDto {
   };
   };
 }
 }
 
 
-
-class UpdateUserDtoAvatarColorEnum {
-  /// Instantiate a new enum with the provided [value].
-  const UpdateUserDtoAvatarColorEnum._(this.value);
-
-  /// The underlying value of this enum member.
-  final String value;
-
-  @override
-  String toString() => value;
-
-  String toJson() => value;
-
-  static const primary = UpdateUserDtoAvatarColorEnum._(r'primary');
-  static const pink = UpdateUserDtoAvatarColorEnum._(r'pink');
-  static const red = UpdateUserDtoAvatarColorEnum._(r'red');
-  static const yellow = UpdateUserDtoAvatarColorEnum._(r'yellow');
-  static const blue = UpdateUserDtoAvatarColorEnum._(r'blue');
-  static const green = UpdateUserDtoAvatarColorEnum._(r'green');
-  static const purple = UpdateUserDtoAvatarColorEnum._(r'purple');
-  static const orange = UpdateUserDtoAvatarColorEnum._(r'orange');
-  static const gray = UpdateUserDtoAvatarColorEnum._(r'gray');
-  static const amber = UpdateUserDtoAvatarColorEnum._(r'amber');
-
-  /// List of all possible values in this [enum][UpdateUserDtoAvatarColorEnum].
-  static const values = <UpdateUserDtoAvatarColorEnum>[
-    primary,
-    pink,
-    red,
-    yellow,
-    blue,
-    green,
-    purple,
-    orange,
-    gray,
-    amber,
-  ];
-
-  static UpdateUserDtoAvatarColorEnum? fromJson(dynamic value) => UpdateUserDtoAvatarColorEnumTypeTransformer().decode(value);
-
-  static List<UpdateUserDtoAvatarColorEnum>? listFromJson(dynamic json, {bool growable = false,}) {
-    final result = <UpdateUserDtoAvatarColorEnum>[];
-    if (json is List && json.isNotEmpty) {
-      for (final row in json) {
-        final value = UpdateUserDtoAvatarColorEnum.fromJson(row);
-        if (value != null) {
-          result.add(value);
-        }
-      }
-    }
-    return result.toList(growable: growable);
-  }
-}
-
-/// Transformation class that can [encode] an instance of [UpdateUserDtoAvatarColorEnum] to String,
-/// and [decode] dynamic data back to [UpdateUserDtoAvatarColorEnum].
-class UpdateUserDtoAvatarColorEnumTypeTransformer {
-  factory UpdateUserDtoAvatarColorEnumTypeTransformer() => _instance ??= const UpdateUserDtoAvatarColorEnumTypeTransformer._();
-
-  const UpdateUserDtoAvatarColorEnumTypeTransformer._();
-
-  String encode(UpdateUserDtoAvatarColorEnum data) => data.value;
-
-  /// Decodes a [dynamic value][data] to a UpdateUserDtoAvatarColorEnum.
-  ///
-  /// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully,
-  /// then null is returned. However, if [allowNull] is false and the [dynamic value][data]
-  /// cannot be decoded successfully, then an [UnimplementedError] is thrown.
-  ///
-  /// The [allowNull] is very handy when an API changes and a new enum value is added or removed,
-  /// and users are still using an old app with the old code.
-  UpdateUserDtoAvatarColorEnum? decode(dynamic data, {bool allowNull = true}) {
-    if (data != null) {
-      switch (data) {
-        case r'primary': return UpdateUserDtoAvatarColorEnum.primary;
-        case r'pink': return UpdateUserDtoAvatarColorEnum.pink;
-        case r'red': return UpdateUserDtoAvatarColorEnum.red;
-        case r'yellow': return UpdateUserDtoAvatarColorEnum.yellow;
-        case r'blue': return UpdateUserDtoAvatarColorEnum.blue;
-        case r'green': return UpdateUserDtoAvatarColorEnum.green;
-        case r'purple': return UpdateUserDtoAvatarColorEnum.purple;
-        case r'orange': return UpdateUserDtoAvatarColorEnum.orange;
-        case r'gray': return UpdateUserDtoAvatarColorEnum.gray;
-        case r'amber': return UpdateUserDtoAvatarColorEnum.amber;
-        default:
-          if (!allowNull) {
-            throw ArgumentError('Unknown enum value to decode: $data');
-          }
-      }
-    }
-    return null;
-  }
-
-  /// Singleton [UpdateUserDtoAvatarColorEnumTypeTransformer] instance.
-  static UpdateUserDtoAvatarColorEnumTypeTransformer? _instance;
-}
-
-

+ 109 - 0
mobile/openapi/lib/model/user_avatar_color.dart

@@ -0,0 +1,109 @@
+//
+// AUTO-GENERATED FILE, DO NOT MODIFY!
+//
+// @dart=2.12
+
+// ignore_for_file: unused_element, unused_import
+// ignore_for_file: always_put_required_named_parameters_first
+// ignore_for_file: constant_identifier_names
+// ignore_for_file: lines_longer_than_80_chars
+
+part of openapi.api;
+
+
+class UserAvatarColor {
+  /// Instantiate a new enum with the provided [value].
+  const UserAvatarColor._(this.value);
+
+  /// The underlying value of this enum member.
+  final String value;
+
+  @override
+  String toString() => value;
+
+  String toJson() => value;
+
+  static const primary = UserAvatarColor._(r'primary');
+  static const pink = UserAvatarColor._(r'pink');
+  static const red = UserAvatarColor._(r'red');
+  static const yellow = UserAvatarColor._(r'yellow');
+  static const blue = UserAvatarColor._(r'blue');
+  static const green = UserAvatarColor._(r'green');
+  static const purple = UserAvatarColor._(r'purple');
+  static const orange = UserAvatarColor._(r'orange');
+  static const gray = UserAvatarColor._(r'gray');
+  static const amber = UserAvatarColor._(r'amber');
+
+  /// List of all possible values in this [enum][UserAvatarColor].
+  static const values = <UserAvatarColor>[
+    primary,
+    pink,
+    red,
+    yellow,
+    blue,
+    green,
+    purple,
+    orange,
+    gray,
+    amber,
+  ];
+
+  static UserAvatarColor? fromJson(dynamic value) => UserAvatarColorTypeTransformer().decode(value);
+
+  static List<UserAvatarColor>? listFromJson(dynamic json, {bool growable = false,}) {
+    final result = <UserAvatarColor>[];
+    if (json is List && json.isNotEmpty) {
+      for (final row in json) {
+        final value = UserAvatarColor.fromJson(row);
+        if (value != null) {
+          result.add(value);
+        }
+      }
+    }
+    return result.toList(growable: growable);
+  }
+}
+
+/// Transformation class that can [encode] an instance of [UserAvatarColor] to String,
+/// and [decode] dynamic data back to [UserAvatarColor].
+class UserAvatarColorTypeTransformer {
+  factory UserAvatarColorTypeTransformer() => _instance ??= const UserAvatarColorTypeTransformer._();
+
+  const UserAvatarColorTypeTransformer._();
+
+  String encode(UserAvatarColor data) => data.value;
+
+  /// Decodes a [dynamic value][data] to a UserAvatarColor.
+  ///
+  /// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully,
+  /// then null is returned. However, if [allowNull] is false and the [dynamic value][data]
+  /// cannot be decoded successfully, then an [UnimplementedError] is thrown.
+  ///
+  /// The [allowNull] is very handy when an API changes and a new enum value is added or removed,
+  /// and users are still using an old app with the old code.
+  UserAvatarColor? decode(dynamic data, {bool allowNull = true}) {
+    if (data != null) {
+      switch (data) {
+        case r'primary': return UserAvatarColor.primary;
+        case r'pink': return UserAvatarColor.pink;
+        case r'red': return UserAvatarColor.red;
+        case r'yellow': return UserAvatarColor.yellow;
+        case r'blue': return UserAvatarColor.blue;
+        case r'green': return UserAvatarColor.green;
+        case r'purple': return UserAvatarColor.purple;
+        case r'orange': return UserAvatarColor.orange;
+        case r'gray': return UserAvatarColor.gray;
+        case r'amber': return UserAvatarColor.amber;
+        default:
+          if (!allowNull) {
+            throw ArgumentError('Unknown enum value to decode: $data');
+          }
+      }
+    }
+    return null;
+  }
+
+  /// Singleton [UserAvatarColorTypeTransformer] instance.
+  static UserAvatarColorTypeTransformer? _instance;
+}
+

+ 1 - 6
mobile/openapi/test/update_user_dto_test.dart

@@ -16,7 +16,7 @@ void main() {
   // final instance = UpdateUserDto();
   // final instance = UpdateUserDto();
 
 
   group('test UpdateUserDto', () {
   group('test UpdateUserDto', () {
-    // String avatarColor
+    // UserAvatarColor avatarColor
     test('to test the property `avatarColor`', () async {
     test('to test the property `avatarColor`', () async {
       // TODO
       // TODO
     });
     });
@@ -61,11 +61,6 @@ void main() {
       // TODO
       // TODO
     });
     });
 
 
-    // String profileImagePath
-    test('to test the property `profileImagePath`', () async {
-      // TODO
-    });
-
     // bool shouldChangePassword
     // bool shouldChangePassword
     test('to test the property `shouldChangePassword`', () async {
     test('to test the property `shouldChangePassword`', () async {
       // TODO
       // TODO

+ 21 - 0
mobile/openapi/test/user_avatar_color_test.dart

@@ -0,0 +1,21 @@
+//
+// AUTO-GENERATED FILE, DO NOT MODIFY!
+//
+// @dart=2.12
+
+// ignore_for_file: unused_element, unused_import
+// ignore_for_file: always_put_required_named_parameters_first
+// ignore_for_file: constant_identifier_names
+// ignore_for_file: lines_longer_than_80_chars
+
+import 'package:openapi/api.dart';
+import 'package:test/test.dart';
+
+// tests for UserAvatarColor
+void main() {
+
+  group('test UserAvatarColor', () {
+
+  });
+
+}

+ 17 - 17
server/immich-openapi-specs.json

@@ -5444,7 +5444,7 @@
         "operationId": "deleteProfileImage",
         "operationId": "deleteProfileImage",
         "parameters": [],
         "parameters": [],
         "responses": {
         "responses": {
-          "200": {
+          "204": {
             "description": ""
             "description": ""
           }
           }
         },
         },
@@ -8978,19 +8978,7 @@
       "UpdateUserDto": {
       "UpdateUserDto": {
         "properties": {
         "properties": {
           "avatarColor": {
           "avatarColor": {
-            "enum": [
-              "primary",
-              "pink",
-              "red",
-              "yellow",
-              "blue",
-              "green",
-              "purple",
-              "orange",
-              "gray",
-              "amber"
-            ],
-            "type": "string"
+            "$ref": "#/components/schemas/UserAvatarColor"
           },
           },
           "email": {
           "email": {
             "type": "string"
             "type": "string"
@@ -9017,9 +9005,6 @@
           "password": {
           "password": {
             "type": "string"
             "type": "string"
           },
           },
-          "profileImagePath": {
-            "type": "string"
-          },
           "shouldChangePassword": {
           "shouldChangePassword": {
             "type": "boolean"
             "type": "boolean"
           },
           },
@@ -9064,6 +9049,21 @@
         ],
         ],
         "type": "object"
         "type": "object"
       },
       },
+      "UserAvatarColor": {
+        "enum": [
+          "primary",
+          "pink",
+          "red",
+          "yellow",
+          "blue",
+          "green",
+          "purple",
+          "orange",
+          "gray",
+          "amber"
+        ],
+        "type": "string"
+      },
       "UserDto": {
       "UserDto": {
         "properties": {
         "properties": {
           "avatarColor": {
           "avatarColor": {

+ 2 - 1
server/src/domain/partner/partner.service.spec.ts

@@ -1,6 +1,7 @@
+import { UserAvatarColor } from '@app/infra/entities';
 import { BadRequestException } from '@nestjs/common';
 import { BadRequestException } from '@nestjs/common';
 import { authStub, newPartnerRepositoryMock, partnerStub } from '@test';
 import { authStub, newPartnerRepositoryMock, partnerStub } from '@test';
-import { UserAvatarColor, UserResponseDto } from '../index';
+import { UserResponseDto } from '../index';
 import { IPartnerRepository, PartnerDirection } from '../repositories';
 import { IPartnerRepository, PartnerDirection } from '../repositories';
 import { PartnerService } from './partner.service';
 import { PartnerService } from './partner.service';
 
 

+ 4 - 8
server/src/domain/user/dto/update-user.dto.ts

@@ -1,7 +1,7 @@
+import { UserAvatarColor } from '@app/infra/entities';
 import { ApiProperty } from '@nestjs/swagger';
 import { ApiProperty } from '@nestjs/swagger';
 import { Transform } from 'class-transformer';
 import { Transform } from 'class-transformer';
-import { IsBoolean, IsEmail, IsNotEmpty, IsString, IsUUID } from 'class-validator';
-import { UserAvatarColor } from '..';
+import { IsBoolean, IsEmail, IsEnum, IsNotEmpty, IsString, IsUUID } from 'class-validator';
 import { Optional, toEmail, toSanitized } from '../../domain.util';
 import { Optional, toEmail, toSanitized } from '../../domain.util';
 
 
 export class UpdateUserDto {
 export class UpdateUserDto {
@@ -52,11 +52,7 @@ export class UpdateUserDto {
   memoriesEnabled?: boolean;
   memoriesEnabled?: boolean;
 
 
   @Optional()
   @Optional()
-  @IsString()
-  @IsNotEmpty()
+  @IsEnum(UserAvatarColor)
+  @ApiProperty({ enumName: 'UserAvatarColor', enum: UserAvatarColor })
   avatarColor?: UserAvatarColor;
   avatarColor?: UserAvatarColor;
-
-  @Optional()
-  @IsString()
-  profileImagePath?: string;
 }
 }

+ 1 - 14
server/src/domain/user/response-dto/user-response.dto.ts

@@ -1,17 +1,4 @@
-import { UserEntity } from '@app/infra/entities';
-
-export enum UserAvatarColor {
-  PRIMARY = 'primary',
-  PINK = 'pink',
-  RED = 'red',
-  YELLOW = 'yellow',
-  BLUE = 'blue',
-  GREEN = 'green',
-  PURPLE = 'purple',
-  ORANGE = 'orange',
-  GRAY = 'gray',
-  AMBER = 'amber',
-}
+import { UserAvatarColor, UserEntity } from '@app/infra/entities';
 
 
 export const getRandomAvatarColor = (): UserAvatarColor => {
 export const getRandomAvatarColor = (): UserAvatarColor => {
   const values = Object.values(UserAvatarColor);
   const values = Object.values(UserAvatarColor);

+ 2 - 2
server/src/domain/user/user.service.spec.ts

@@ -339,7 +339,7 @@ describe(UserService.name, () => {
       await expect(sut.createProfileImage(userStub.admin, file)).rejects.toThrowError(InternalServerErrorException);
       await expect(sut.createProfileImage(userStub.admin, file)).rejects.toThrowError(InternalServerErrorException);
     });
     });
 
 
-    it('should delete previous profile image', async () => {
+    it('should delete the previous profile image', async () => {
       const file = { path: '/profile/path' } as Express.Multer.File;
       const file = { path: '/profile/path' } as Express.Multer.File;
       userMock.get.mockResolvedValue(userStub.profilePath);
       userMock.get.mockResolvedValue(userStub.profilePath);
       const files = [userStub.profilePath.profileImagePath];
       const files = [userStub.profilePath.profileImagePath];
@@ -349,7 +349,7 @@ describe(UserService.name, () => {
       await expect(jobMock.queue.mock.calls).toEqual([[{ name: JobName.DELETE_FILES, data: { files } }]]);
       await expect(jobMock.queue.mock.calls).toEqual([[{ name: JobName.DELETE_FILES, data: { files } }]]);
     });
     });
 
 
-    it('should not delete profile image if it has not been set', async () => {
+    it('should not delete the profile image if it has not been set', async () => {
       const file = { path: '/profile/path' } as Express.Multer.File;
       const file = { path: '/profile/path' } as Express.Multer.File;
       userMock.get.mockResolvedValue(userStub.admin);
       userMock.get.mockResolvedValue(userStub.admin);
       userMock.update.mockResolvedValue({ ...userStub.admin, profileImagePath: file.path });
       userMock.update.mockResolvedValue({ ...userStub.admin, profileImagePath: file.path });

+ 2 - 2
server/src/domain/user/user.service.ts

@@ -93,7 +93,7 @@ export class UserService {
     authUser: AuthUserDto,
     authUser: AuthUserDto,
     fileInfo: Express.Multer.File,
     fileInfo: Express.Multer.File,
   ): Promise<CreateProfileImageResponseDto> {
   ): Promise<CreateProfileImageResponseDto> {
-    const user = await this.findOrFail(authUser.id, { withDeleted: true });
+    const user = await this.findOrFail(authUser.id, { withDeleted: false });
     const updatedUser = await this.userRepository.update(authUser.id, { profileImagePath: fileInfo.path });
     const updatedUser = await this.userRepository.update(authUser.id, { profileImagePath: fileInfo.path });
     if (user.profileImagePath !== '') {
     if (user.profileImagePath !== '') {
       const files = [user.profileImagePath];
       const files = [user.profileImagePath];
@@ -103,7 +103,7 @@ export class UserService {
   }
   }
 
 
   async deleteProfileImage(authUser: AuthUserDto): Promise<void> {
   async deleteProfileImage(authUser: AuthUserDto): Promise<void> {
-    const user = await this.findOrFail(authUser.id, { withDeleted: true });
+    const user = await this.findOrFail(authUser.id, { withDeleted: false });
     if (user.profileImagePath !== '') {
     if (user.profileImagePath !== '') {
       await this.userRepository.update(authUser.id, { profileImagePath: '' });
       await this.userRepository.update(authUser.id, { profileImagePath: '' });
       const files = [user.profileImagePath];
       const files = [user.profileImagePath];

+ 3 - 0
server/src/immich/controllers/user.controller.ts

@@ -13,6 +13,8 @@ import {
   Delete,
   Delete,
   Get,
   Get,
   Header,
   Header,
+  HttpCode,
+  HttpStatus,
   Param,
   Param,
   Post,
   Post,
   Put,
   Put,
@@ -55,6 +57,7 @@ export class UserController {
   }
   }
 
 
   @Delete('profile-image')
   @Delete('profile-image')
+  @HttpCode(HttpStatus.NO_CONTENT)
   deleteProfileImage(@AuthUser() authUser: AuthUserDto): Promise<void> {
   deleteProfileImage(@AuthUser() authUser: AuthUserDto): Promise<void> {
     return this.service.deleteProfileImage(authUser);
     return this.service.deleteProfileImage(authUser);
   }
   }

+ 13 - 1
server/src/infra/entities/user.entity.ts

@@ -1,4 +1,3 @@
-import { UserAvatarColor } from '@app/domain/user/response-dto/user-response.dto';
 import {
 import {
   Column,
   Column,
   CreateDateColumn,
   CreateDateColumn,
@@ -11,6 +10,19 @@ import {
 import { AssetEntity } from './asset.entity';
 import { AssetEntity } from './asset.entity';
 import { TagEntity } from './tag.entity';
 import { TagEntity } from './tag.entity';
 
 
+export enum UserAvatarColor {
+  PRIMARY = 'primary',
+  PINK = 'pink',
+  RED = 'red',
+  YELLOW = 'yellow',
+  BLUE = 'blue',
+  GREEN = 'green',
+  PURPLE = 'purple',
+  ORANGE = 'orange',
+  GRAY = 'gray',
+  AMBER = 'amber',
+}
+
 @Entity('users')
 @Entity('users')
 export class UserEntity {
 export class UserEntity {
   @PrimaryGeneratedColumn('uuid')
   @PrimaryGeneratedColumn('uuid')

+ 1 - 2
server/test/fixtures/user.stub.ts

@@ -1,5 +1,4 @@
-import { UserAvatarColor } from '@app/domain';
-import { UserEntity } from '@app/infra/entities';
+import { UserAvatarColor, UserEntity } from '@app/infra/entities';
 import { authStub } from './auth.stub';
 import { authStub } from './auth.stub';
 
 
 export const userStub = {
 export const userStub = {

+ 24 - 22
web/src/api/open-api/api.ts

@@ -4257,10 +4257,10 @@ export interface UpdateTagDto {
 export interface UpdateUserDto {
 export interface UpdateUserDto {
     /**
     /**
      * 
      * 
-     * @type {string}
+     * @type {UserAvatarColor}
      * @memberof UpdateUserDto
      * @memberof UpdateUserDto
      */
      */
-    'avatarColor'?: UpdateUserDtoAvatarColorEnum;
+    'avatarColor'?: UserAvatarColor;
     /**
     /**
      * 
      * 
      * @type {string}
      * @type {string}
@@ -4309,12 +4309,6 @@ export interface UpdateUserDto {
      * @memberof UpdateUserDto
      * @memberof UpdateUserDto
      */
      */
     'password'?: string;
     'password'?: string;
-    /**
-     * 
-     * @type {string}
-     * @memberof UpdateUserDto
-     */
-    'profileImagePath'?: string;
     /**
     /**
      * 
      * 
      * @type {boolean}
      * @type {boolean}
@@ -4329,20 +4323,6 @@ export interface UpdateUserDto {
     'storageLabel'?: string;
     'storageLabel'?: string;
 }
 }
 
 
-export const UpdateUserDtoAvatarColorEnum = {
-    Primary: 'primary',
-    Pink: 'pink',
-    Red: 'red',
-    Yellow: 'yellow',
-    Blue: 'blue',
-    Green: 'green',
-    Purple: 'purple',
-    Orange: 'orange',
-    Gray: 'gray',
-    Amber: 'amber'
-} as const;
-
-export type UpdateUserDtoAvatarColorEnum = typeof UpdateUserDtoAvatarColorEnum[keyof typeof UpdateUserDtoAvatarColorEnum];
 
 
 /**
 /**
  * 
  * 
@@ -4387,6 +4367,28 @@ export interface UsageByUserDto {
      */
      */
     'videos': number;
     'videos': number;
 }
 }
+/**
+ * 
+ * @export
+ * @enum {string}
+ */
+
+export const UserAvatarColor = {
+    Primary: 'primary',
+    Pink: 'pink',
+    Red: 'red',
+    Yellow: 'yellow',
+    Blue: 'blue',
+    Green: 'green',
+    Purple: 'purple',
+    Orange: 'orange',
+    Gray: 'gray',
+    Amber: 'amber'
+} as const;
+
+export type UserAvatarColor = typeof UserAvatarColor[keyof typeof UserAvatarColor];
+
+
 /**
 /**
  * 
  * 
  * @export
  * @export

+ 1 - 1
web/src/lib/components/shared-components/user-avatar.svelte

@@ -46,7 +46,7 @@
     lg: 'w-12 h-12',
     lg: 'w-12 h-12',
     xl: 'w-20 h-20',
     xl: 'w-20 h-20',
     xxl: 'w-24 h-24',
     xxl: 'w-24 h-24',
-    xxxl: 'w-24 h-24',
+    xxxl: 'w-28 h-28',
   };
   };
 
 
   // Get color based on the user UUID.
   // Get color based on the user UUID.