diff --git a/mobile/openapi/lib/api/assets_api.dart b/mobile/openapi/lib/api/assets_api.dart index 063f9ea43b..7d328ab9b2 100644 --- a/mobile/openapi/lib/api/assets_api.dart +++ b/mobile/openapi/lib/api/assets_api.dart @@ -608,8 +608,8 @@ class AssetsApi { /// /// Parameters: /// - /// * [num] count: - Future getRandomWithHttpInfo({ num? count, }) async { + /// * [int] count: + Future getRandomWithHttpInfo({ int? count, }) async { // ignore: prefer_const_declarations final apiPath = r'/assets/random'; @@ -642,8 +642,8 @@ class AssetsApi { /// /// Parameters: /// - /// * [num] count: - Future?> getRandom({ num? count, }) async { + /// * [int] count: + Future?> getRandom({ int? count, }) async { final response = await getRandomWithHttpInfo( count: count, ); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); diff --git a/mobile/openapi/lib/api/deprecated_api.dart b/mobile/openapi/lib/api/deprecated_api.dart index 9246998ca2..173de6d228 100644 --- a/mobile/openapi/lib/api/deprecated_api.dart +++ b/mobile/openapi/lib/api/deprecated_api.dart @@ -75,8 +75,8 @@ class DeprecatedApi { /// /// Parameters: /// - /// * [num] count: - Future getRandomWithHttpInfo({ num? count, }) async { + /// * [int] count: + Future getRandomWithHttpInfo({ int? count, }) async { // ignore: prefer_const_declarations final apiPath = r'/assets/random'; @@ -109,8 +109,8 @@ class DeprecatedApi { /// /// Parameters: /// - /// * [num] count: - Future?> getRandom({ num? count, }) async { + /// * [int] count: + Future?> getRandom({ int? count, }) async { final response = await getRandomWithHttpInfo( count: count, ); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); diff --git a/mobile/openapi/lib/api/people_api.dart b/mobile/openapi/lib/api/people_api.dart index 68c16785cc..02bcbf749d 100644 --- a/mobile/openapi/lib/api/people_api.dart +++ b/mobile/openapi/lib/api/people_api.dart @@ -167,14 +167,14 @@ class PeopleApi { /// /// * [String] closestPersonId: /// - /// * [num] page: + /// * [int] page: /// Page number for pagination /// - /// * [num] size: + /// * [int] size: /// Number of items per page /// /// * [bool] withHidden: - Future getAllPeopleWithHttpInfo({ String? closestAssetId, String? closestPersonId, num? page, num? size, bool? withHidden, }) async { + Future getAllPeopleWithHttpInfo({ String? closestAssetId, String? closestPersonId, int? page, int? size, bool? withHidden, }) async { // ignore: prefer_const_declarations final apiPath = r'/people'; @@ -223,14 +223,14 @@ class PeopleApi { /// /// * [String] closestPersonId: /// - /// * [num] page: + /// * [int] page: /// Page number for pagination /// - /// * [num] size: + /// * [int] size: /// Number of items per page /// /// * [bool] withHidden: - Future getAllPeople({ String? closestAssetId, String? closestPersonId, num? page, num? size, bool? withHidden, }) async { + Future getAllPeople({ String? closestAssetId, String? closestPersonId, int? page, int? size, bool? withHidden, }) async { final response = await getAllPeopleWithHttpInfo( closestAssetId: closestAssetId, closestPersonId: closestPersonId, page: page, size: size, withHidden: withHidden, ); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); diff --git a/mobile/openapi/lib/api/search_api.dart b/mobile/openapi/lib/api/search_api.dart index 4d9e1172b8..c2b9ffce13 100644 --- a/mobile/openapi/lib/api/search_api.dart +++ b/mobile/openapi/lib/api/search_api.dart @@ -348,9 +348,9 @@ class SearchApi { /// /// * [List] personIds: /// - /// * [num] rating: + /// * [int] rating: /// - /// * [num] size: + /// * [int] size: /// /// * [String] state: /// @@ -375,7 +375,7 @@ class SearchApi { /// * [bool] withDeleted: /// /// * [bool] withExif: - Future searchLargeAssetsWithHttpInfo({ List? albumIds, String? city, String? country, DateTime? createdAfter, DateTime? createdBefore, String? deviceId, bool? isEncoded, bool? isFavorite, bool? isMotion, bool? isNotInAlbum, bool? isOffline, String? lensModel, String? libraryId, String? make, int? minFileSize, String? model, List? personIds, num? rating, num? size, String? state, List? tagIds, DateTime? takenAfter, DateTime? takenBefore, DateTime? trashedAfter, DateTime? trashedBefore, AssetTypeEnum? type, DateTime? updatedAfter, DateTime? updatedBefore, AssetVisibility? visibility, bool? withDeleted, bool? withExif, }) async { + Future searchLargeAssetsWithHttpInfo({ List? albumIds, String? city, String? country, DateTime? createdAfter, DateTime? createdBefore, String? deviceId, bool? isEncoded, bool? isFavorite, bool? isMotion, bool? isNotInAlbum, bool? isOffline, String? lensModel, String? libraryId, String? make, int? minFileSize, String? model, List? personIds, int? rating, int? size, String? state, List? tagIds, DateTime? takenAfter, DateTime? takenBefore, DateTime? trashedAfter, DateTime? trashedBefore, AssetTypeEnum? type, DateTime? updatedAfter, DateTime? updatedBefore, AssetVisibility? visibility, bool? withDeleted, bool? withExif, }) async { // ignore: prefer_const_declarations final apiPath = r'/search/large-assets'; @@ -532,9 +532,9 @@ class SearchApi { /// /// * [List] personIds: /// - /// * [num] rating: + /// * [int] rating: /// - /// * [num] size: + /// * [int] size: /// /// * [String] state: /// @@ -559,7 +559,7 @@ class SearchApi { /// * [bool] withDeleted: /// /// * [bool] withExif: - Future?> searchLargeAssets({ List? albumIds, String? city, String? country, DateTime? createdAfter, DateTime? createdBefore, String? deviceId, bool? isEncoded, bool? isFavorite, bool? isMotion, bool? isNotInAlbum, bool? isOffline, String? lensModel, String? libraryId, String? make, int? minFileSize, String? model, List? personIds, num? rating, num? size, String? state, List? tagIds, DateTime? takenAfter, DateTime? takenBefore, DateTime? trashedAfter, DateTime? trashedBefore, AssetTypeEnum? type, DateTime? updatedAfter, DateTime? updatedBefore, AssetVisibility? visibility, bool? withDeleted, bool? withExif, }) async { + Future?> searchLargeAssets({ List? albumIds, String? city, String? country, DateTime? createdAfter, DateTime? createdBefore, String? deviceId, bool? isEncoded, bool? isFavorite, bool? isMotion, bool? isNotInAlbum, bool? isOffline, String? lensModel, String? libraryId, String? make, int? minFileSize, String? model, List? personIds, int? rating, int? size, String? state, List? tagIds, DateTime? takenAfter, DateTime? takenBefore, DateTime? trashedAfter, DateTime? trashedBefore, AssetTypeEnum? type, DateTime? updatedAfter, DateTime? updatedBefore, AssetVisibility? visibility, bool? withDeleted, bool? withExif, }) async { final response = await searchLargeAssetsWithHttpInfo( albumIds: albumIds, city: city, country: country, createdAfter: createdAfter, createdBefore: createdBefore, deviceId: deviceId, isEncoded: isEncoded, isFavorite: isFavorite, isMotion: isMotion, isNotInAlbum: isNotInAlbum, isOffline: isOffline, lensModel: lensModel, libraryId: libraryId, make: make, minFileSize: minFileSize, model: model, personIds: personIds, rating: rating, size: size, state: state, tagIds: tagIds, takenAfter: takenAfter, takenBefore: takenBefore, trashedAfter: trashedAfter, trashedBefore: trashedBefore, type: type, updatedAfter: updatedAfter, updatedBefore: updatedBefore, visibility: visibility, withDeleted: withDeleted, withExif: withExif, ); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); diff --git a/mobile/openapi/lib/model/asset_bulk_update_dto.dart b/mobile/openapi/lib/model/asset_bulk_update_dto.dart index d7e75ae365..3d64df6390 100644 --- a/mobile/openapi/lib/model/asset_bulk_update_dto.dart +++ b/mobile/openapi/lib/model/asset_bulk_update_dto.dart @@ -40,7 +40,7 @@ class AssetBulkUpdateDto { /// source code must fall back to having a nullable type. /// Consider adding a "default:" property in the specification file to hide this note. /// - num? dateTimeRelative; + int? dateTimeRelative; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -68,7 +68,7 @@ class AssetBulkUpdateDto { /// source code must fall back to having a nullable type. /// Consider adding a "default:" property in the specification file to hide this note. /// - num? latitude; + double? latitude; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -76,7 +76,7 @@ class AssetBulkUpdateDto { /// source code must fall back to having a nullable type. /// Consider adding a "default:" property in the specification file to hide this note. /// - num? longitude; + double? longitude; /// Minimum value: -1 /// Maximum value: 5 @@ -86,7 +86,7 @@ class AssetBulkUpdateDto { /// source code must fall back to having a nullable type. /// Consider adding a "default:" property in the specification file to hide this note. /// - num? rating; + int? rating; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -202,16 +202,16 @@ class AssetBulkUpdateDto { return AssetBulkUpdateDto( dateTimeOriginal: mapValueOfType(json, r'dateTimeOriginal'), - dateTimeRelative: num.parse('${json[r'dateTimeRelative']}'), + dateTimeRelative: mapValueOfType(json, r'dateTimeRelative'), description: mapValueOfType(json, r'description'), duplicateId: mapValueOfType(json, r'duplicateId'), ids: json[r'ids'] is Iterable ? (json[r'ids'] as Iterable).cast().toList(growable: false) : const [], isFavorite: mapValueOfType(json, r'isFavorite'), - latitude: num.parse('${json[r'latitude']}'), - longitude: num.parse('${json[r'longitude']}'), - rating: num.parse('${json[r'rating']}'), + latitude: (mapValueOfType(json, r'latitude')).toDouble(), + longitude: (mapValueOfType(json, r'longitude')).toDouble(), + rating: mapValueOfType(json, r'rating'), timeZone: mapValueOfType(json, r'timeZone'), visibility: AssetVisibility.fromJson(json[r'visibility']), ); diff --git a/mobile/openapi/lib/model/database_backup_config.dart b/mobile/openapi/lib/model/database_backup_config.dart index d82128bd44..dfe1cd9095 100644 --- a/mobile/openapi/lib/model/database_backup_config.dart +++ b/mobile/openapi/lib/model/database_backup_config.dart @@ -23,7 +23,7 @@ class DatabaseBackupConfig { bool enabled; /// Minimum value: 1 - num keepLastAmount; + int keepLastAmount; @override bool operator ==(Object other) => identical(this, other) || other is DatabaseBackupConfig && @@ -60,7 +60,7 @@ class DatabaseBackupConfig { return DatabaseBackupConfig( cronExpression: mapValueOfType(json, r'cronExpression')!, enabled: mapValueOfType(json, r'enabled')!, - keepLastAmount: num.parse('${json[r'keepLastAmount']}'), + keepLastAmount: mapValueOfType(json, r'keepLastAmount')!, ); } return null; diff --git a/mobile/openapi/lib/model/exif_response_dto.dart b/mobile/openapi/lib/model/exif_response_dto.dart index 17397b2081..e91d58b3c5 100644 --- a/mobile/openapi/lib/model/exif_response_dto.dart +++ b/mobile/openapi/lib/model/exif_response_dto.dart @@ -45,25 +45,25 @@ class ExifResponseDto { String? description; - num? exifImageHeight; + int? exifImageHeight; - num? exifImageWidth; + int? exifImageWidth; String? exposureTime; - num? fNumber; + double? fNumber; int? fileSizeInByte; - num? focalLength; + double? focalLength; - num? iso; + int? iso; - num? latitude; + double? latitude; String? lensModel; - num? longitude; + double? longitude; String? make; @@ -75,7 +75,7 @@ class ExifResponseDto { String? projectionType; - num? rating; + int? rating; String? state; @@ -263,38 +263,22 @@ class ExifResponseDto { country: mapValueOfType(json, r'country'), dateTimeOriginal: mapDateTime(json, r'dateTimeOriginal', r''), description: mapValueOfType(json, r'description'), - exifImageHeight: json[r'exifImageHeight'] == null - ? null - : num.parse('${json[r'exifImageHeight']}'), - exifImageWidth: json[r'exifImageWidth'] == null - ? null - : num.parse('${json[r'exifImageWidth']}'), + exifImageHeight: mapValueOfType(json, r'exifImageHeight'), + exifImageWidth: mapValueOfType(json, r'exifImageWidth'), exposureTime: mapValueOfType(json, r'exposureTime'), - fNumber: json[r'fNumber'] == null - ? null - : num.parse('${json[r'fNumber']}'), + fNumber: (mapValueOfType(json, r'fNumber'))?.toDouble(), fileSizeInByte: mapValueOfType(json, r'fileSizeInByte'), - focalLength: json[r'focalLength'] == null - ? null - : num.parse('${json[r'focalLength']}'), - iso: json[r'iso'] == null - ? null - : num.parse('${json[r'iso']}'), - latitude: json[r'latitude'] == null - ? null - : num.parse('${json[r'latitude']}'), + focalLength: (mapValueOfType(json, r'focalLength'))?.toDouble(), + iso: mapValueOfType(json, r'iso'), + latitude: (mapValueOfType(json, r'latitude'))?.toDouble(), lensModel: mapValueOfType(json, r'lensModel'), - longitude: json[r'longitude'] == null - ? null - : num.parse('${json[r'longitude']}'), + longitude: (mapValueOfType(json, r'longitude'))?.toDouble(), make: mapValueOfType(json, r'make'), model: mapValueOfType(json, r'model'), modifyDate: mapDateTime(json, r'modifyDate', r''), orientation: mapValueOfType(json, r'orientation'), projectionType: mapValueOfType(json, r'projectionType'), - rating: json[r'rating'] == null - ? null - : num.parse('${json[r'rating']}'), + rating: mapValueOfType(json, r'rating'), state: mapValueOfType(json, r'state'), timeZone: mapValueOfType(json, r'timeZone'), ); diff --git a/mobile/openapi/lib/model/metadata_search_dto.dart b/mobile/openapi/lib/model/metadata_search_dto.dart index b7e637d4b4..633271f246 100644 --- a/mobile/openapi/lib/model/metadata_search_dto.dart +++ b/mobile/openapi/lib/model/metadata_search_dto.dart @@ -207,7 +207,7 @@ class MetadataSearchDto { /// source code must fall back to having a nullable type. /// Consider adding a "default:" property in the specification file to hide this note. /// - num? page; + int? page; List personIds; @@ -227,7 +227,7 @@ class MetadataSearchDto { /// source code must fall back to having a nullable type. /// Consider adding a "default:" property in the specification file to hide this note. /// - num? rating; + int? rating; /// Minimum value: 1 /// Maximum value: 1000 @@ -237,7 +237,7 @@ class MetadataSearchDto { /// source code must fall back to having a nullable type. /// Consider adding a "default:" property in the specification file to hide this note. /// - num? size; + int? size; String? state; @@ -685,13 +685,13 @@ class MetadataSearchDto { order: AssetOrder.fromJson(json[r'order']) ?? AssetOrder.desc, originalFileName: mapValueOfType(json, r'originalFileName'), originalPath: mapValueOfType(json, r'originalPath'), - page: num.parse('${json[r'page']}'), + page: mapValueOfType(json, r'page'), personIds: json[r'personIds'] is Iterable ? (json[r'personIds'] as Iterable).cast().toList(growable: false) : const [], previewPath: mapValueOfType(json, r'previewPath'), - rating: num.parse('${json[r'rating']}'), - size: num.parse('${json[r'size']}'), + rating: mapValueOfType(json, r'rating'), + size: mapValueOfType(json, r'size'), state: mapValueOfType(json, r'state'), tagIds: json[r'tagIds'] is Iterable ? (json[r'tagIds'] as Iterable).cast().toList(growable: false) diff --git a/mobile/openapi/lib/model/on_this_day_dto.dart b/mobile/openapi/lib/model/on_this_day_dto.dart index bfcc4fd630..0250980778 100644 --- a/mobile/openapi/lib/model/on_this_day_dto.dart +++ b/mobile/openapi/lib/model/on_this_day_dto.dart @@ -17,7 +17,7 @@ class OnThisDayDto { }); /// Minimum value: 1 - num year; + int year; @override bool operator ==(Object other) => identical(this, other) || other is OnThisDayDto && @@ -46,7 +46,7 @@ class OnThisDayDto { final json = value.cast(); return OnThisDayDto( - year: num.parse('${json[r'year']}'), + year: mapValueOfType(json, r'year')!, ); } return null; diff --git a/mobile/openapi/lib/model/places_response_dto.dart b/mobile/openapi/lib/model/places_response_dto.dart index 4f77788263..7646f5c11c 100644 --- a/mobile/openapi/lib/model/places_response_dto.dart +++ b/mobile/openapi/lib/model/places_response_dto.dart @@ -36,9 +36,9 @@ class PlacesResponseDto { /// String? admin2name; - num latitude; + double latitude; - num longitude; + double longitude; String name; @@ -91,8 +91,8 @@ class PlacesResponseDto { return PlacesResponseDto( admin1name: mapValueOfType(json, r'admin1name'), admin2name: mapValueOfType(json, r'admin2name'), - latitude: num.parse('${json[r'latitude']}'), - longitude: num.parse('${json[r'longitude']}'), + latitude: (mapValueOfType(json, r'latitude')!).toDouble(), + longitude: (mapValueOfType(json, r'longitude')!).toDouble(), name: mapValueOfType(json, r'name')!, ); } diff --git a/mobile/openapi/lib/model/random_search_dto.dart b/mobile/openapi/lib/model/random_search_dto.dart index 98cc715af4..86ab66fdb5 100644 --- a/mobile/openapi/lib/model/random_search_dto.dart +++ b/mobile/openapi/lib/model/random_search_dto.dart @@ -141,7 +141,7 @@ class RandomSearchDto { /// source code must fall back to having a nullable type. /// Consider adding a "default:" property in the specification file to hide this note. /// - num? rating; + int? rating; /// Minimum value: 1 /// Maximum value: 1000 @@ -151,7 +151,7 @@ class RandomSearchDto { /// source code must fall back to having a nullable type. /// Consider adding a "default:" property in the specification file to hide this note. /// - num? size; + int? size; String? state; @@ -513,8 +513,8 @@ class RandomSearchDto { personIds: json[r'personIds'] is Iterable ? (json[r'personIds'] as Iterable).cast().toList(growable: false) : const [], - rating: num.parse('${json[r'rating']}'), - size: num.parse('${json[r'size']}'), + rating: mapValueOfType(json, r'rating'), + size: mapValueOfType(json, r'size'), state: mapValueOfType(json, r'state'), tagIds: json[r'tagIds'] is Iterable ? (json[r'tagIds'] as Iterable).cast().toList(growable: false) diff --git a/mobile/openapi/lib/model/session_create_dto.dart b/mobile/openapi/lib/model/session_create_dto.dart index aacf1150a5..820b552c13 100644 --- a/mobile/openapi/lib/model/session_create_dto.dart +++ b/mobile/openapi/lib/model/session_create_dto.dart @@ -43,7 +43,7 @@ class SessionCreateDto { /// source code must fall back to having a nullable type. /// Consider adding a "default:" property in the specification file to hide this note. /// - num? duration; + int? duration; @override bool operator ==(Object other) => identical(this, other) || other is SessionCreateDto && @@ -92,7 +92,7 @@ class SessionCreateDto { return SessionCreateDto( deviceOS: mapValueOfType(json, r'deviceOS'), deviceType: mapValueOfType(json, r'deviceType'), - duration: num.parse('${json[r'duration']}'), + duration: mapValueOfType(json, r'duration'), ); } return null; diff --git a/mobile/openapi/lib/model/smart_search_dto.dart b/mobile/openapi/lib/model/smart_search_dto.dart index 90902b9791..345e528f22 100644 --- a/mobile/openapi/lib/model/smart_search_dto.dart +++ b/mobile/openapi/lib/model/smart_search_dto.dart @@ -148,7 +148,7 @@ class SmartSearchDto { /// source code must fall back to having a nullable type. /// Consider adding a "default:" property in the specification file to hide this note. /// - num? page; + int? page; List personIds; @@ -176,7 +176,7 @@ class SmartSearchDto { /// source code must fall back to having a nullable type. /// Consider adding a "default:" property in the specification file to hide this note. /// - num? rating; + int? rating; /// Minimum value: 1 /// Maximum value: 1000 @@ -186,7 +186,7 @@ class SmartSearchDto { /// source code must fall back to having a nullable type. /// Consider adding a "default:" property in the specification file to hide this note. /// - num? size; + int? size; String? state; @@ -544,14 +544,14 @@ class SmartSearchDto { libraryId: mapValueOfType(json, r'libraryId'), make: mapValueOfType(json, r'make'), model: mapValueOfType(json, r'model'), - page: num.parse('${json[r'page']}'), + page: mapValueOfType(json, r'page'), personIds: json[r'personIds'] is Iterable ? (json[r'personIds'] as Iterable).cast().toList(growable: false) : const [], query: mapValueOfType(json, r'query'), queryAssetId: mapValueOfType(json, r'queryAssetId'), - rating: num.parse('${json[r'rating']}'), - size: num.parse('${json[r'size']}'), + rating: mapValueOfType(json, r'rating'), + size: mapValueOfType(json, r'size'), state: mapValueOfType(json, r'state'), tagIds: json[r'tagIds'] is Iterable ? (json[r'tagIds'] as Iterable).cast().toList(growable: false) diff --git a/mobile/openapi/lib/model/statistics_search_dto.dart b/mobile/openapi/lib/model/statistics_search_dto.dart index 73d80c9e36..a51bb88191 100644 --- a/mobile/openapi/lib/model/statistics_search_dto.dart +++ b/mobile/openapi/lib/model/statistics_search_dto.dart @@ -145,7 +145,7 @@ class StatisticsSearchDto { /// source code must fall back to having a nullable type. /// Consider adding a "default:" property in the specification file to hide this note. /// - num? rating; + int? rating; String? state; @@ -448,7 +448,7 @@ class StatisticsSearchDto { personIds: json[r'personIds'] is Iterable ? (json[r'personIds'] as Iterable).cast().toList(growable: false) : const [], - rating: num.parse('${json[r'rating']}'), + rating: mapValueOfType(json, r'rating'), state: mapValueOfType(json, r'state'), tagIds: json[r'tagIds'] is Iterable ? (json[r'tagIds'] as Iterable).cast().toList(growable: false) diff --git a/mobile/openapi/lib/model/system_config_smtp_transport_dto.dart b/mobile/openapi/lib/model/system_config_smtp_transport_dto.dart index bdaaa426c5..0db5e0a474 100644 --- a/mobile/openapi/lib/model/system_config_smtp_transport_dto.dart +++ b/mobile/openapi/lib/model/system_config_smtp_transport_dto.dart @@ -28,7 +28,7 @@ class SystemConfigSmtpTransportDto { /// Minimum value: 0 /// Maximum value: 65535 - num port; + int port; String username; @@ -74,7 +74,7 @@ class SystemConfigSmtpTransportDto { host: mapValueOfType(json, r'host')!, ignoreCert: mapValueOfType(json, r'ignoreCert')!, password: mapValueOfType(json, r'password')!, - port: num.parse('${json[r'port']}'), + port: mapValueOfType(json, r'port')!, username: mapValueOfType(json, r'username')!, ); } diff --git a/mobile/openapi/lib/model/update_asset_dto.dart b/mobile/openapi/lib/model/update_asset_dto.dart index 7b364f1387..6cbd568112 100644 --- a/mobile/openapi/lib/model/update_asset_dto.dart +++ b/mobile/openapi/lib/model/update_asset_dto.dart @@ -53,7 +53,7 @@ class UpdateAssetDto { /// source code must fall back to having a nullable type. /// Consider adding a "default:" property in the specification file to hide this note. /// - num? latitude; + double? latitude; String? livePhotoVideoId; @@ -63,7 +63,7 @@ class UpdateAssetDto { /// source code must fall back to having a nullable type. /// Consider adding a "default:" property in the specification file to hide this note. /// - num? longitude; + double? longitude; /// Minimum value: -1 /// Maximum value: 5 @@ -73,7 +73,7 @@ class UpdateAssetDto { /// source code must fall back to having a nullable type. /// Consider adding a "default:" property in the specification file to hide this note. /// - num? rating; + int? rating; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -166,10 +166,10 @@ class UpdateAssetDto { dateTimeOriginal: mapValueOfType(json, r'dateTimeOriginal'), description: mapValueOfType(json, r'description'), isFavorite: mapValueOfType(json, r'isFavorite'), - latitude: num.parse('${json[r'latitude']}'), + latitude: (mapValueOfType(json, r'latitude')).toDouble(), livePhotoVideoId: mapValueOfType(json, r'livePhotoVideoId'), - longitude: num.parse('${json[r'longitude']}'), - rating: num.parse('${json[r'rating']}'), + longitude: (mapValueOfType(json, r'longitude')).toDouble(), + rating: mapValueOfType(json, r'rating'), visibility: AssetVisibility.fromJson(json[r'visibility']), ); } diff --git a/open-api/immich-openapi-specs.json b/open-api/immich-openapi-specs.json index 7caf215042..61b40e956f 100644 --- a/open-api/immich-openapi-specs.json +++ b/open-api/immich-openapi-specs.json @@ -2035,7 +2035,7 @@ "in": "query", "schema": { "minimum": 1, - "type": "number" + "type": "integer" } } ], @@ -5242,7 +5242,7 @@ "schema": { "minimum": 1, "default": 1, - "type": "number" + "type": "integer" } }, { @@ -5254,7 +5254,7 @@ "minimum": 1, "maximum": 1000, "default": 500, - "type": "number" + "type": "integer" } }, { @@ -5955,7 +5955,7 @@ "schema": { "minimum": -1, "maximum": 5, - "type": "number" + "type": "integer" } }, { @@ -5965,7 +5965,7 @@ "schema": { "minimum": 1, "maximum": 1000, - "type": "number" + "type": "integer" } }, { @@ -10408,7 +10408,7 @@ "type": "string" }, "dateTimeRelative": { - "type": "number" + "type": "integer" }, "description": { "type": "string" @@ -10428,15 +10428,17 @@ "type": "boolean" }, "latitude": { + "format": "double", "type": "number" }, "longitude": { + "format": "double", "type": "number" }, "rating": { "maximum": 5, "minimum": -1, - "type": "number" + "type": "integer" }, "timeZone": { "type": "string" @@ -11571,7 +11573,7 @@ }, "keepLastAmount": { "minimum": 1, - "type": "number" + "type": "integer" } }, "required": [ @@ -11764,12 +11766,12 @@ "exifImageHeight": { "default": null, "nullable": true, - "type": "number" + "type": "integer" }, "exifImageWidth": { "default": null, "nullable": true, - "type": "number" + "type": "integer" }, "exposureTime": { "default": null, @@ -11778,6 +11780,7 @@ }, "fNumber": { "default": null, + "format": "double", "nullable": true, "type": "number" }, @@ -11789,16 +11792,18 @@ }, "focalLength": { "default": null, + "format": "double", "nullable": true, "type": "number" }, "iso": { "default": null, "nullable": true, - "type": "number" + "type": "integer" }, "latitude": { "default": null, + "format": "double", "nullable": true, "type": "number" }, @@ -11809,6 +11814,7 @@ }, "longitude": { "default": null, + "format": "double", "nullable": true, "type": "number" }, @@ -11841,7 +11847,7 @@ "rating": { "default": null, "nullable": true, - "type": "number" + "type": "integer" }, "state": { "default": null, @@ -12594,7 +12600,7 @@ }, "page": { "minimum": 1, - "type": "number" + "type": "integer" }, "personIds": { "items": { @@ -12609,12 +12615,12 @@ "rating": { "maximum": 5, "minimum": -1, - "type": "number" + "type": "integer" }, "size": { "maximum": 1000, "minimum": 1, - "type": "number" + "type": "integer" }, "state": { "nullable": true, @@ -12891,7 +12897,7 @@ "properties": { "year": { "minimum": 1, - "type": "number" + "type": "integer" } }, "required": [ @@ -13440,9 +13446,11 @@ "type": "string" }, "latitude": { + "format": "double", "type": "number" }, "longitude": { + "format": "double", "type": "number" }, "name": { @@ -13566,12 +13574,12 @@ "rating": { "maximum": 5, "minimum": -1, - "type": "number" + "type": "integer" }, "size": { "maximum": 1000, "minimum": 1, - "type": "number" + "type": "integer" }, "state": { "nullable": true, @@ -14254,7 +14262,7 @@ "duration": { "description": "session duration, in seconds", "minimum": 1, - "type": "number" + "type": "integer" } }, "type": "object" @@ -14650,7 +14658,7 @@ }, "page": { "minimum": 1, - "type": "number" + "type": "integer" }, "personIds": { "items": { @@ -14669,12 +14677,12 @@ "rating": { "maximum": 5, "minimum": -1, - "type": "number" + "type": "integer" }, "size": { "maximum": 1000, "minimum": 1, - "type": "number" + "type": "integer" }, "state": { "nullable": true, @@ -14863,7 +14871,7 @@ "rating": { "maximum": 5, "minimum": -1, - "type": "number" + "type": "integer" }, "state": { "nullable": true, @@ -16683,7 +16691,7 @@ "port": { "maximum": 65535, "minimum": 0, - "type": "number" + "type": "integer" }, "username": { "type": "string" @@ -17299,6 +17307,7 @@ "type": "boolean" }, "latitude": { + "format": "double", "type": "number" }, "livePhotoVideoId": { @@ -17307,12 +17316,13 @@ "type": "string" }, "longitude": { + "format": "double", "type": "number" }, "rating": { "maximum": 5, "minimum": -1, - "type": "number" + "type": "integer" }, "visibility": { "allOf": [ diff --git a/server/src/dtos/asset.dto.ts b/server/src/dtos/asset.dto.ts index 6a89b7e2cf..03d80ab0ae 100644 --- a/server/src/dtos/asset.dto.ts +++ b/server/src/dtos/asset.dto.ts @@ -1,4 +1,4 @@ -import { ApiProperty } from '@nestjs/swagger'; +import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; import { Type } from 'class-transformer'; import { IsArray, @@ -46,17 +46,20 @@ export class UpdateAssetBase { @ValidateGPS() @IsLatitude() @IsNotEmpty() + @ApiPropertyOptional({ type: 'number', format: 'double' }) latitude?: number; @ValidateGPS() @IsLongitude() @IsNotEmpty() + @ApiPropertyOptional({ type: 'number', format: 'double' }) longitude?: number; @Optional() @IsInt() @Max(5) @Min(-1) + @ApiPropertyOptional({ type: 'integer' }) rating?: number; @Optional() @@ -74,6 +77,7 @@ export class AssetBulkUpdateDto extends UpdateAssetBase { @IsNotSiblingOf(['dateTimeOriginal']) @Optional() @IsInt() + @ApiPropertyOptional({ type: 'integer' }) dateTimeRelative?: number; @IsNotSiblingOf(['dateTimeOriginal']) @@ -92,6 +96,7 @@ export class RandomAssetsDto { @IsInt() @IsPositive() @Type(() => Number) + @ApiPropertyOptional({ type: 'integer' }) count?: number; } diff --git a/server/src/dtos/exif.dto.ts b/server/src/dtos/exif.dto.ts index 9fa61d93c8..1051754586 100644 --- a/server/src/dtos/exif.dto.ts +++ b/server/src/dtos/exif.dto.ts @@ -1,30 +1,37 @@ -import { ApiProperty } from '@nestjs/swagger'; +import { ApiPropertyOptional } from '@nestjs/swagger'; import { Exif } from 'src/database'; export class ExifResponseDto { make?: string | null = null; model?: string | null = null; + @ApiPropertyOptional({ type: 'integer' }) exifImageWidth?: number | null = null; + @ApiPropertyOptional({ type: 'integer' }) exifImageHeight?: number | null = null; - - @ApiProperty({ type: 'integer', format: 'int64' }) + @ApiPropertyOptional({ type: 'integer', format: 'int64' }) fileSizeInByte?: number | null = null; orientation?: string | null = null; dateTimeOriginal?: Date | null = null; modifyDate?: Date | null = null; timeZone?: string | null = null; lensModel?: string | null = null; + @ApiPropertyOptional({ type: 'number', format: 'double' }) fNumber?: number | null = null; + @ApiPropertyOptional({ type: 'number', format: 'double' }) focalLength?: number | null = null; + @ApiPropertyOptional({ type: 'integer' }) iso?: number | null = null; exposureTime?: string | null = null; + @ApiPropertyOptional({ type: 'number', format: 'double' }) latitude?: number | null = null; + @ApiPropertyOptional({ type: 'number', format: 'double' }) longitude?: number | null = null; city?: string | null = null; state?: string | null = null; country?: string | null = null; description?: string | null = null; projectionType?: string | null = null; + @ApiPropertyOptional({ type: 'integer' }) rating?: number | null = null; } diff --git a/server/src/dtos/map.dto.ts b/server/src/dtos/map.dto.ts index 1d0b84a4d0..607569dda3 100644 --- a/server/src/dtos/map.dto.ts +++ b/server/src/dtos/map.dto.ts @@ -4,12 +4,12 @@ import { IsLatitude, IsLongitude } from 'class-validator'; import { ValidateBoolean, ValidateDate } from 'src/validation'; export class MapReverseGeocodeDto { - @ApiProperty({ format: 'double' }) + @ApiProperty({ type: 'number', format: 'double' }) @Type(() => Number) @IsLatitude({ message: ({ property }) => `${property} must be a number between -90 and 90` }) lat!: number; - @ApiProperty({ format: 'double' }) + @ApiProperty({ type: 'number', format: 'double' }) @Type(() => Number) @IsLongitude({ message: ({ property }) => `${property} must be a number between -180 and 180` }) lon!: number; diff --git a/server/src/dtos/memory.dto.ts b/server/src/dtos/memory.dto.ts index a79511c73e..7d94592dae 100644 --- a/server/src/dtos/memory.dto.ts +++ b/server/src/dtos/memory.dto.ts @@ -32,6 +32,7 @@ export class MemorySearchDto { class OnThisDayDto { @IsInt() @IsPositive() + @ApiProperty({ type: 'integer' }) year!: number; } diff --git a/server/src/dtos/person.dto.ts b/server/src/dtos/person.dto.ts index f9b41627d9..2aaec83b95 100644 --- a/server/src/dtos/person.dto.ts +++ b/server/src/dtos/person.dto.ts @@ -89,14 +89,14 @@ export class PersonSearchDto { closestAssetId?: string; /** Page number for pagination */ - @ApiPropertyOptional() + @ApiPropertyOptional({ type: 'integer' }) @IsInt() @Min(1) @Type(() => Number) page: number = 1; /** Number of items per page */ - @ApiPropertyOptional() + @ApiPropertyOptional({ type: 'integer' }) @IsInt() @Min(1) @Max(1000) diff --git a/server/src/dtos/search.dto.ts b/server/src/dtos/search.dto.ts index ac7bf4feb2..636fe4c399 100644 --- a/server/src/dtos/search.dto.ts +++ b/server/src/dtos/search.dto.ts @@ -1,4 +1,4 @@ -import { ApiProperty } from '@nestjs/swagger'; +import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; import { Type } from 'class-transformer'; import { IsInt, IsNotEmpty, IsString, Max, Min } from 'class-validator'; import { Place } from 'src/database'; @@ -100,6 +100,7 @@ class BaseSearchDto { @IsInt() @Max(5) @Min(-1) + @ApiPropertyOptional({ type: 'integer' }) rating?: number; } @@ -115,6 +116,7 @@ class BaseSearchWithResultsDto extends BaseSearchDto { @Max(1000) @Type(() => Number) @Optional() + @ApiPropertyOptional({ type: 'integer' }) size?: number; } @@ -186,6 +188,7 @@ export class MetadataSearchDto extends RandomSearchDto { @Min(1) @Type(() => Number) @Optional() + @ApiPropertyOptional({ type: 'integer' }) page?: number; } @@ -215,6 +218,7 @@ export class SmartSearchDto extends BaseSearchWithResultsDto { @Min(1) @Type(() => Number) @Optional() + @ApiPropertyOptional({ type: 'integer' }) page?: number; } @@ -235,7 +239,9 @@ export class SearchPeopleDto { export class PlacesResponseDto { name!: string; + @ApiProperty({ type: 'number', format: 'double' }) latitude!: number; + @ApiProperty({ type: 'number', format: 'double' }) longitude!: number; admin1name?: string; admin2name?: string; diff --git a/server/src/dtos/session.dto.ts b/server/src/dtos/session.dto.ts index 7ccc72a5f1..3bac6f104a 100644 --- a/server/src/dtos/session.dto.ts +++ b/server/src/dtos/session.dto.ts @@ -1,3 +1,4 @@ +import { ApiPropertyOptional } from '@nestjs/swagger'; import { Equals, IsInt, IsPositive, IsString } from 'class-validator'; import { Session } from 'src/database'; import { Optional, ValidateBoolean } from 'src/validation'; @@ -9,6 +10,7 @@ export class SessionCreateDto { @IsInt() @IsPositive() @Optional() + @ApiPropertyOptional({ type: 'integer' }) duration?: number; @IsString() diff --git a/server/src/dtos/system-config.dto.ts b/server/src/dtos/system-config.dto.ts index 8a58995de7..71a558e2ca 100644 --- a/server/src/dtos/system-config.dto.ts +++ b/server/src/dtos/system-config.dto.ts @@ -53,6 +53,7 @@ export class DatabaseBackupConfig { @IsInt() @IsPositive() @IsNotEmpty() + @ApiProperty({ type: 'integer' }) keepLastAmount!: number; } @@ -451,6 +452,7 @@ class SystemConfigSmtpTransportDto { @IsNumber() @Min(0) @Max(65_535) + @ApiProperty({ type: 'integer' }) port!: number; @IsString() diff --git a/server/src/dtos/user-preferences.dto.ts b/server/src/dtos/user-preferences.dto.ts index b258158ae2..3ff80b7239 100644 --- a/server/src/dtos/user-preferences.dto.ts +++ b/server/src/dtos/user-preferences.dto.ts @@ -1,4 +1,4 @@ -import { ApiProperty } from '@nestjs/swagger'; +import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; import { Type } from 'class-transformer'; import { IsDateString, IsInt, IsPositive, ValidateNested } from 'class-validator'; import { AssetOrder, UserAvatarColor } from 'src/enum'; @@ -72,7 +72,7 @@ class DownloadUpdate implements Partial { @Optional() @IsInt() @IsPositive() - @ApiProperty({ type: 'integer' }) + @ApiPropertyOptional({ type: 'integer' }) archiveSize?: number; @ValidateBoolean({ optional: true }) diff --git a/server/src/dtos/user.dto.ts b/server/src/dtos/user.dto.ts index 443178aa10..ac6c16bb33 100644 --- a/server/src/dtos/user.dto.ts +++ b/server/src/dtos/user.dto.ts @@ -1,4 +1,4 @@ -import { ApiProperty } from '@nestjs/swagger'; +import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; import { Transform } from 'class-transformer'; import { IsEmail, IsInt, IsNotEmpty, IsString, Min } from 'class-validator'; import { User, UserAdmin } from 'src/database'; @@ -93,7 +93,7 @@ export class UserAdminCreateDto { @Optional({ nullable: true }) @IsInt() @Min(0) - @ApiProperty({ type: 'integer', format: 'int64' }) + @ApiPropertyOptional({ type: 'integer', format: 'int64' }) quotaSizeInBytes?: number | null; @ValidateBoolean({ optional: true }) @@ -139,7 +139,7 @@ export class UserAdminUpdateDto { @Optional({ nullable: true }) @IsInt() @Min(0) - @ApiProperty({ type: 'integer', format: 'int64' }) + @ApiPropertyOptional({ type: 'integer', format: 'int64' }) quotaSizeInBytes?: number | null; @ValidateBoolean({ optional: true })