mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
Add ContributorCountResponseDto and expose contributorCounts
on AlbumResponseDto in OpenAPI spec. Regenerate TypeScript SDK and mobile OpenAPI clients to include new types. No breaking changes; fields are additive.
This commit is contained in:
parent
5b333fc03e
commit
bd87d2bd08
7 changed files with 145 additions and 1 deletions
1
mobile/openapi/README.md
generated
1
mobile/openapi/README.md
generated
|
|
@ -359,6 +359,7 @@ Class | Method | HTTP request | Description
|
|||
- [CheckExistingAssetsDto](doc//CheckExistingAssetsDto.md)
|
||||
- [CheckExistingAssetsResponseDto](doc//CheckExistingAssetsResponseDto.md)
|
||||
- [Colorspace](doc//Colorspace.md)
|
||||
- [ContributorCountResponseDto](doc//ContributorCountResponseDto.md)
|
||||
- [CreateAlbumDto](doc//CreateAlbumDto.md)
|
||||
- [CreateLibraryDto](doc//CreateLibraryDto.md)
|
||||
- [CreateProfileImageResponseDto](doc//CreateProfileImageResponseDto.md)
|
||||
|
|
|
|||
1
mobile/openapi/lib/api.dart
generated
1
mobile/openapi/lib/api.dart
generated
|
|
@ -130,6 +130,7 @@ part 'model/change_password_dto.dart';
|
|||
part 'model/check_existing_assets_dto.dart';
|
||||
part 'model/check_existing_assets_response_dto.dart';
|
||||
part 'model/colorspace.dart';
|
||||
part 'model/contributor_count_response_dto.dart';
|
||||
part 'model/create_album_dto.dart';
|
||||
part 'model/create_library_dto.dart';
|
||||
part 'model/create_profile_image_response_dto.dart';
|
||||
|
|
|
|||
2
mobile/openapi/lib/api_client.dart
generated
2
mobile/openapi/lib/api_client.dart
generated
|
|
@ -314,6 +314,8 @@ class ApiClient {
|
|||
return CheckExistingAssetsResponseDto.fromJson(value);
|
||||
case 'Colorspace':
|
||||
return ColorspaceTypeTransformer().decode(value);
|
||||
case 'ContributorCountResponseDto':
|
||||
return ContributorCountResponseDto.fromJson(value);
|
||||
case 'CreateAlbumDto':
|
||||
return CreateAlbumDto.fromJson(value);
|
||||
case 'CreateLibraryDto':
|
||||
|
|
|
|||
9
mobile/openapi/lib/model/album_response_dto.dart
generated
9
mobile/openapi/lib/model/album_response_dto.dart
generated
|
|
@ -18,6 +18,7 @@ class AlbumResponseDto {
|
|||
this.albumUsers = const [],
|
||||
required this.assetCount,
|
||||
this.assets = const [],
|
||||
this.contributorCounts = const [],
|
||||
required this.createdAt,
|
||||
required this.description,
|
||||
this.endDate,
|
||||
|
|
@ -43,6 +44,8 @@ class AlbumResponseDto {
|
|||
|
||||
List<AssetResponseDto> assets;
|
||||
|
||||
List<ContributorCountResponseDto> contributorCounts;
|
||||
|
||||
DateTime createdAt;
|
||||
|
||||
String description;
|
||||
|
|
@ -100,6 +103,7 @@ class AlbumResponseDto {
|
|||
_deepEquality.equals(other.albumUsers, albumUsers) &&
|
||||
other.assetCount == assetCount &&
|
||||
_deepEquality.equals(other.assets, assets) &&
|
||||
_deepEquality.equals(other.contributorCounts, contributorCounts) &&
|
||||
other.createdAt == createdAt &&
|
||||
other.description == description &&
|
||||
other.endDate == endDate &&
|
||||
|
|
@ -122,6 +126,7 @@ class AlbumResponseDto {
|
|||
(albumUsers.hashCode) +
|
||||
(assetCount.hashCode) +
|
||||
(assets.hashCode) +
|
||||
(contributorCounts.hashCode) +
|
||||
(createdAt.hashCode) +
|
||||
(description.hashCode) +
|
||||
(endDate == null ? 0 : endDate!.hashCode) +
|
||||
|
|
@ -137,7 +142,7 @@ class AlbumResponseDto {
|
|||
(updatedAt.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'AlbumResponseDto[albumName=$albumName, albumThumbnailAssetId=$albumThumbnailAssetId, albumUsers=$albumUsers, assetCount=$assetCount, assets=$assets, createdAt=$createdAt, description=$description, endDate=$endDate, hasSharedLink=$hasSharedLink, id=$id, isActivityEnabled=$isActivityEnabled, lastModifiedAssetTimestamp=$lastModifiedAssetTimestamp, order=$order, owner=$owner, ownerId=$ownerId, shared=$shared, startDate=$startDate, updatedAt=$updatedAt]';
|
||||
String toString() => 'AlbumResponseDto[albumName=$albumName, albumThumbnailAssetId=$albumThumbnailAssetId, albumUsers=$albumUsers, assetCount=$assetCount, assets=$assets, contributorCounts=$contributorCounts, createdAt=$createdAt, description=$description, endDate=$endDate, hasSharedLink=$hasSharedLink, id=$id, isActivityEnabled=$isActivityEnabled, lastModifiedAssetTimestamp=$lastModifiedAssetTimestamp, order=$order, owner=$owner, ownerId=$ownerId, shared=$shared, startDate=$startDate, updatedAt=$updatedAt]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
|
|
@ -150,6 +155,7 @@ class AlbumResponseDto {
|
|||
json[r'albumUsers'] = this.albumUsers;
|
||||
json[r'assetCount'] = this.assetCount;
|
||||
json[r'assets'] = this.assets;
|
||||
json[r'contributorCounts'] = this.contributorCounts;
|
||||
json[r'createdAt'] = this.createdAt.toUtc().toIso8601String();
|
||||
json[r'description'] = this.description;
|
||||
if (this.endDate != null) {
|
||||
|
|
@ -196,6 +202,7 @@ class AlbumResponseDto {
|
|||
albumUsers: AlbumUserResponseDto.listFromJson(json[r'albumUsers']),
|
||||
assetCount: mapValueOfType<int>(json, r'assetCount')!,
|
||||
assets: AssetResponseDto.listFromJson(json[r'assets']),
|
||||
contributorCounts: ContributorCountResponseDto.listFromJson(json[r'contributorCounts']),
|
||||
createdAt: mapDateTime(json, r'createdAt', r'')!,
|
||||
description: mapValueOfType<String>(json, r'description')!,
|
||||
endDate: mapDateTime(json, r'endDate', r''),
|
||||
|
|
|
|||
107
mobile/openapi/lib/model/contributor_count_response_dto.dart
generated
Normal file
107
mobile/openapi/lib/model/contributor_count_response_dto.dart
generated
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.18
|
||||
|
||||
// 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 ContributorCountResponseDto {
|
||||
/// Returns a new [ContributorCountResponseDto] instance.
|
||||
ContributorCountResponseDto({
|
||||
required this.assetCount,
|
||||
required this.userId,
|
||||
});
|
||||
|
||||
int assetCount;
|
||||
|
||||
String userId;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is ContributorCountResponseDto &&
|
||||
other.assetCount == assetCount &&
|
||||
other.userId == userId;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(assetCount.hashCode) +
|
||||
(userId.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'ContributorCountResponseDto[assetCount=$assetCount, userId=$userId]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
json[r'assetCount'] = this.assetCount;
|
||||
json[r'userId'] = this.userId;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [ContributorCountResponseDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static ContributorCountResponseDto? fromJson(dynamic value) {
|
||||
upgradeDto(value, "ContributorCountResponseDto");
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return ContributorCountResponseDto(
|
||||
assetCount: mapValueOfType<int>(json, r'assetCount')!,
|
||||
userId: mapValueOfType<String>(json, r'userId')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<ContributorCountResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <ContributorCountResponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = ContributorCountResponseDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, ContributorCountResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, ContributorCountResponseDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = ContributorCountResponseDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of ContributorCountResponseDto-objects as value to a dart map
|
||||
static Map<String, List<ContributorCountResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<ContributorCountResponseDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
// ignore: parameter_assignments
|
||||
json = json.cast<String, dynamic>();
|
||||
for (final entry in json.entries) {
|
||||
map[entry.key] = ContributorCountResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'assetCount',
|
||||
'userId',
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -10096,6 +10096,12 @@
|
|||
},
|
||||
"type": "array"
|
||||
},
|
||||
"contributorCounts": {
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/ContributorCountResponseDto"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"createdAt": {
|
||||
"format": "date-time",
|
||||
"type": "string"
|
||||
|
|
@ -11471,6 +11477,21 @@
|
|||
],
|
||||
"type": "string"
|
||||
},
|
||||
"ContributorCountResponseDto": {
|
||||
"properties": {
|
||||
"assetCount": {
|
||||
"type": "integer"
|
||||
},
|
||||
"userId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"assetCount",
|
||||
"userId"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"CreateAlbumDto": {
|
||||
"properties": {
|
||||
"albumName": {
|
||||
|
|
|
|||
|
|
@ -356,12 +356,17 @@ export type AssetResponseDto = {
|
|||
updatedAt: string;
|
||||
visibility: AssetVisibility;
|
||||
};
|
||||
export type ContributorCountResponseDto = {
|
||||
assetCount: number;
|
||||
userId: string;
|
||||
};
|
||||
export type AlbumResponseDto = {
|
||||
albumName: string;
|
||||
albumThumbnailAssetId: string | null;
|
||||
albumUsers: AlbumUserResponseDto[];
|
||||
assetCount: number;
|
||||
assets: AssetResponseDto[];
|
||||
contributorCounts?: ContributorCountResponseDto[];
|
||||
createdAt: string;
|
||||
description: string;
|
||||
endDate?: string;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue