From 1b9670a15727d1f936ebc0a0596330e6409a2ba1 Mon Sep 17 00:00:00 2001 From: poppingmoon <63451158+poppingmoon@users.noreply.github.com> Date: Sat, 5 Oct 2024 13:39:36 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=E3=82=A8=E3=82=AF=E3=82=B9=E3=83=9D?= =?UTF-8?q?=E3=83=BC=E3=83=88=E6=99=82=E3=81=AE=E9=80=9A=E7=9F=A5=E3=81=AB?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/src/data/i/i_notifications_request.g.dart | 1 + lib/src/data/i/i_notifications_response.dart | 14 +++++ .../i/i_notifications_response.freezed.dart | 58 ++++++++++++++++--- .../data/i/i_notifications_response.g.dart | 19 ++++++ lib/src/enums/notification_type.dart | 1 + 5 files changed, 86 insertions(+), 7 deletions(-) diff --git a/lib/src/data/i/i_notifications_request.g.dart b/lib/src/data/i/i_notifications_request.g.dart index 59b83774..c902f9c8 100644 --- a/lib/src/data/i/i_notifications_request.g.dart +++ b/lib/src/data/i/i_notifications_request.g.dart @@ -59,4 +59,5 @@ const _$NotificationTypeEnumMap = { NotificationType.reactionGrouped: 'reaction:grouped', NotificationType.renoteGrouped: 'renote:grouped', NotificationType.roleAssigned: 'roleAssigned', + NotificationType.exportCompleted: 'exportCompleted', }; diff --git a/lib/src/data/i/i_notifications_response.dart b/lib/src/data/i/i_notifications_response.dart index 8fc8bea6..cefeede9 100644 --- a/lib/src/data/i/i_notifications_response.dart +++ b/lib/src/data/i/i_notifications_response.dart @@ -25,8 +25,22 @@ class INotificationsResponse with _$INotificationsResponse { UserLite? user, Note? note, RolesListResponse? role, + UserExportableEntities? exportedEntity, + String? fileId, }) = _INotificationsResponse; factory INotificationsResponse.fromJson(Map json) => _$INotificationsResponseFromJson(json); } + +enum UserExportableEntities { + note, + antenna, + blocking, + clip, + customEmoji, + favorite, + following, + muting, + userList +} diff --git a/lib/src/data/i/i_notifications_response.freezed.dart b/lib/src/data/i/i_notifications_response.freezed.dart index 30f84dfd..f9de76f5 100644 --- a/lib/src/data/i/i_notifications_response.freezed.dart +++ b/lib/src/data/i/i_notifications_response.freezed.dart @@ -39,6 +39,9 @@ mixin _$INotificationsResponse { UserLite? get user => throw _privateConstructorUsedError; Note? get note => throw _privateConstructorUsedError; RolesListResponse? get role => throw _privateConstructorUsedError; + UserExportableEntities? get exportedEntity => + throw _privateConstructorUsedError; + String? get fileId => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) @@ -68,7 +71,9 @@ abstract class $INotificationsResponseCopyWith<$Res> { String? userId, UserLite? user, Note? note, - RolesListResponse? role}); + RolesListResponse? role, + UserExportableEntities? exportedEntity, + String? fileId}); $UserLiteCopyWith<$Res>? get user; $NoteCopyWith<$Res>? get note; @@ -105,6 +110,8 @@ class _$INotificationsResponseCopyWithImpl<$Res, Object? user = freezed, Object? note = freezed, Object? role = freezed, + Object? exportedEntity = freezed, + Object? fileId = freezed, }) { return _then(_value.copyWith( id: null == id @@ -171,6 +178,14 @@ class _$INotificationsResponseCopyWithImpl<$Res, ? _value.role : role // ignore: cast_nullable_to_non_nullable as RolesListResponse?, + exportedEntity: freezed == exportedEntity + ? _value.exportedEntity + : exportedEntity // ignore: cast_nullable_to_non_nullable + as UserExportableEntities?, + fileId: freezed == fileId + ? _value.fileId + : fileId // ignore: cast_nullable_to_non_nullable + as String?, ) as $Val); } @@ -236,7 +251,9 @@ abstract class _$$INotificationsResponseImplCopyWith<$Res> String? userId, UserLite? user, Note? note, - RolesListResponse? role}); + RolesListResponse? role, + UserExportableEntities? exportedEntity, + String? fileId}); @override $UserLiteCopyWith<$Res>? get user; @@ -275,6 +292,8 @@ class __$$INotificationsResponseImplCopyWithImpl<$Res> Object? user = freezed, Object? note = freezed, Object? role = freezed, + Object? exportedEntity = freezed, + Object? fileId = freezed, }) { return _then(_$INotificationsResponseImpl( id: null == id @@ -341,6 +360,14 @@ class __$$INotificationsResponseImplCopyWithImpl<$Res> ? _value.role : role // ignore: cast_nullable_to_non_nullable as RolesListResponse?, + exportedEntity: freezed == exportedEntity + ? _value.exportedEntity + : exportedEntity // ignore: cast_nullable_to_non_nullable + as UserExportableEntities?, + fileId: freezed == fileId + ? _value.fileId + : fileId // ignore: cast_nullable_to_non_nullable + as String?, )); } } @@ -364,7 +391,9 @@ class _$INotificationsResponseImpl implements _INotificationsResponse { this.userId, this.user, this.note, - this.role}); + this.role, + this.exportedEntity, + this.fileId}); factory _$INotificationsResponseImpl.fromJson(Map json) => _$$INotificationsResponseImplFromJson(json); @@ -403,10 +432,14 @@ class _$INotificationsResponseImpl implements _INotificationsResponse { final Note? note; @override final RolesListResponse? role; + @override + final UserExportableEntities? exportedEntity; + @override + final String? fileId; @override String toString() { - return 'INotificationsResponse(id: $id, createdAt: $createdAt, type: $type, noteId: $noteId, followRequestId: $followRequestId, reaction: $reaction, choice: $choice, achievement: $achievement, body: $body, header: $header, icon: $icon, appAccessTokenId: $appAccessTokenId, userId: $userId, user: $user, note: $note, role: $role)'; + return 'INotificationsResponse(id: $id, createdAt: $createdAt, type: $type, noteId: $noteId, followRequestId: $followRequestId, reaction: $reaction, choice: $choice, achievement: $achievement, body: $body, header: $header, icon: $icon, appAccessTokenId: $appAccessTokenId, userId: $userId, user: $user, note: $note, role: $role, exportedEntity: $exportedEntity, fileId: $fileId)'; } @override @@ -434,7 +467,10 @@ class _$INotificationsResponseImpl implements _INotificationsResponse { (identical(other.userId, userId) || other.userId == userId) && (identical(other.user, user) || other.user == user) && (identical(other.note, note) || other.note == note) && - (identical(other.role, role) || other.role == role)); + (identical(other.role, role) || other.role == role) && + (identical(other.exportedEntity, exportedEntity) || + other.exportedEntity == exportedEntity) && + (identical(other.fileId, fileId) || other.fileId == fileId)); } @JsonKey(ignore: true) @@ -456,7 +492,9 @@ class _$INotificationsResponseImpl implements _INotificationsResponse { userId, user, note, - role); + role, + exportedEntity, + fileId); @JsonKey(ignore: true) @override @@ -490,7 +528,9 @@ abstract class _INotificationsResponse implements INotificationsResponse { final String? userId, final UserLite? user, final Note? note, - final RolesListResponse? role}) = _$INotificationsResponseImpl; + final RolesListResponse? role, + final UserExportableEntities? exportedEntity, + final String? fileId}) = _$INotificationsResponseImpl; factory _INotificationsResponse.fromJson(Map json) = _$INotificationsResponseImpl.fromJson; @@ -530,6 +570,10 @@ abstract class _INotificationsResponse implements INotificationsResponse { @override RolesListResponse? get role; @override + UserExportableEntities? get exportedEntity; + @override + String? get fileId; + @override @JsonKey(ignore: true) _$$INotificationsResponseImplCopyWith<_$INotificationsResponseImpl> get copyWith => throw _privateConstructorUsedError; diff --git a/lib/src/data/i/i_notifications_response.g.dart b/lib/src/data/i/i_notifications_response.g.dart index 125af0b8..4c9709e2 100644 --- a/lib/src/data/i/i_notifications_response.g.dart +++ b/lib/src/data/i/i_notifications_response.g.dart @@ -33,6 +33,9 @@ _$INotificationsResponseImpl _$$INotificationsResponseImplFromJson( role: json['role'] == null ? null : RolesListResponse.fromJson(json['role'] as Map), + exportedEntity: $enumDecodeNullable( + _$UserExportableEntitiesEnumMap, json['exportedEntity']), + fileId: json['fileId'] as String?, ); Map _$$INotificationsResponseImplToJson( @@ -54,6 +57,9 @@ Map _$$INotificationsResponseImplToJson( 'user': instance.user?.toJson(), 'note': instance.note?.toJson(), 'role': instance.role?.toJson(), + 'exportedEntity': + _$UserExportableEntitiesEnumMap[instance.exportedEntity], + 'fileId': instance.fileId, }; const _$NotificationTypeEnumMap = { @@ -75,6 +81,7 @@ const _$NotificationTypeEnumMap = { NotificationType.reactionGrouped: 'reaction:grouped', NotificationType.renoteGrouped: 'renote:grouped', NotificationType.roleAssigned: 'roleAssigned', + NotificationType.exportCompleted: 'exportCompleted', }; Value? _$JsonConverterFromJson( @@ -82,3 +89,15 @@ Value? _$JsonConverterFromJson( Value? Function(Json json) fromJson, ) => json == null ? null : fromJson(json as Json); + +const _$UserExportableEntitiesEnumMap = { + UserExportableEntities.note: 'note', + UserExportableEntities.antenna: 'antenna', + UserExportableEntities.blocking: 'blocking', + UserExportableEntities.clip: 'clip', + UserExportableEntities.customEmoji: 'customEmoji', + UserExportableEntities.favorite: 'favorite', + UserExportableEntities.following: 'following', + UserExportableEntities.muting: 'muting', + UserExportableEntities.userList: 'userList', +}; diff --git a/lib/src/enums/notification_type.dart b/lib/src/enums/notification_type.dart index 91f8812a..c7615f6d 100644 --- a/lib/src/enums/notification_type.dart +++ b/lib/src/enums/notification_type.dart @@ -21,4 +21,5 @@ enum NotificationType { @JsonValue("renote:grouped") renoteGrouped, roleAssigned, + exportCompleted, } From e3aea0e4685b072bbfce64ad3b3d83eaca28322d Mon Sep 17 00:00:00 2001 From: poppingmoon <63451158+poppingmoon@users.noreply.github.com> Date: Sat, 5 Oct 2024 13:43:36 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=E3=83=95=E3=82=A9=E3=83=AD=E3=83=BC?= =?UTF-8?q?=E6=99=82=E3=81=AE=E3=83=A1=E3=83=83=E3=82=BB=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=81=AB=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/src/data/i/i_notifications_response.dart | 1 + .../i/i_notifications_response.freezed.dart | 74 ++++++++++++------- .../data/i/i_notifications_response.g.dart | 2 + 3 files changed, 51 insertions(+), 26 deletions(-) diff --git a/lib/src/data/i/i_notifications_response.dart b/lib/src/data/i/i_notifications_response.dart index cefeede9..a25c4a44 100644 --- a/lib/src/data/i/i_notifications_response.dart +++ b/lib/src/data/i/i_notifications_response.dart @@ -27,6 +27,7 @@ class INotificationsResponse with _$INotificationsResponse { RolesListResponse? role, UserExportableEntities? exportedEntity, String? fileId, + String? message, }) = _INotificationsResponse; factory INotificationsResponse.fromJson(Map json) => diff --git a/lib/src/data/i/i_notifications_response.freezed.dart b/lib/src/data/i/i_notifications_response.freezed.dart index f9de76f5..0ff64de3 100644 --- a/lib/src/data/i/i_notifications_response.freezed.dart +++ b/lib/src/data/i/i_notifications_response.freezed.dart @@ -42,6 +42,7 @@ mixin _$INotificationsResponse { UserExportableEntities? get exportedEntity => throw _privateConstructorUsedError; String? get fileId => throw _privateConstructorUsedError; + String? get message => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) @@ -73,7 +74,8 @@ abstract class $INotificationsResponseCopyWith<$Res> { Note? note, RolesListResponse? role, UserExportableEntities? exportedEntity, - String? fileId}); + String? fileId, + String? message}); $UserLiteCopyWith<$Res>? get user; $NoteCopyWith<$Res>? get note; @@ -112,6 +114,7 @@ class _$INotificationsResponseCopyWithImpl<$Res, Object? role = freezed, Object? exportedEntity = freezed, Object? fileId = freezed, + Object? message = freezed, }) { return _then(_value.copyWith( id: null == id @@ -186,6 +189,10 @@ class _$INotificationsResponseCopyWithImpl<$Res, ? _value.fileId : fileId // ignore: cast_nullable_to_non_nullable as String?, + message: freezed == message + ? _value.message + : message // ignore: cast_nullable_to_non_nullable + as String?, ) as $Val); } @@ -253,7 +260,8 @@ abstract class _$$INotificationsResponseImplCopyWith<$Res> Note? note, RolesListResponse? role, UserExportableEntities? exportedEntity, - String? fileId}); + String? fileId, + String? message}); @override $UserLiteCopyWith<$Res>? get user; @@ -294,6 +302,7 @@ class __$$INotificationsResponseImplCopyWithImpl<$Res> Object? role = freezed, Object? exportedEntity = freezed, Object? fileId = freezed, + Object? message = freezed, }) { return _then(_$INotificationsResponseImpl( id: null == id @@ -368,6 +377,10 @@ class __$$INotificationsResponseImplCopyWithImpl<$Res> ? _value.fileId : fileId // ignore: cast_nullable_to_non_nullable as String?, + message: freezed == message + ? _value.message + : message // ignore: cast_nullable_to_non_nullable + as String?, )); } } @@ -393,7 +406,8 @@ class _$INotificationsResponseImpl implements _INotificationsResponse { this.note, this.role, this.exportedEntity, - this.fileId}); + this.fileId, + this.message}); factory _$INotificationsResponseImpl.fromJson(Map json) => _$$INotificationsResponseImplFromJson(json); @@ -436,10 +450,12 @@ class _$INotificationsResponseImpl implements _INotificationsResponse { final UserExportableEntities? exportedEntity; @override final String? fileId; + @override + final String? message; @override String toString() { - return 'INotificationsResponse(id: $id, createdAt: $createdAt, type: $type, noteId: $noteId, followRequestId: $followRequestId, reaction: $reaction, choice: $choice, achievement: $achievement, body: $body, header: $header, icon: $icon, appAccessTokenId: $appAccessTokenId, userId: $userId, user: $user, note: $note, role: $role, exportedEntity: $exportedEntity, fileId: $fileId)'; + return 'INotificationsResponse(id: $id, createdAt: $createdAt, type: $type, noteId: $noteId, followRequestId: $followRequestId, reaction: $reaction, choice: $choice, achievement: $achievement, body: $body, header: $header, icon: $icon, appAccessTokenId: $appAccessTokenId, userId: $userId, user: $user, note: $note, role: $role, exportedEntity: $exportedEntity, fileId: $fileId, message: $message)'; } @override @@ -470,31 +486,34 @@ class _$INotificationsResponseImpl implements _INotificationsResponse { (identical(other.role, role) || other.role == role) && (identical(other.exportedEntity, exportedEntity) || other.exportedEntity == exportedEntity) && - (identical(other.fileId, fileId) || other.fileId == fileId)); + (identical(other.fileId, fileId) || other.fileId == fileId) && + (identical(other.message, message) || other.message == message)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash( - runtimeType, - id, - createdAt, - type, - noteId, - followRequestId, - reaction, - choice, - achievement, - body, - header, - icon, - appAccessTokenId, - userId, - user, - note, - role, - exportedEntity, - fileId); + int get hashCode => Object.hashAll([ + runtimeType, + id, + createdAt, + type, + noteId, + followRequestId, + reaction, + choice, + achievement, + body, + header, + icon, + appAccessTokenId, + userId, + user, + note, + role, + exportedEntity, + fileId, + message + ]); @JsonKey(ignore: true) @override @@ -530,7 +549,8 @@ abstract class _INotificationsResponse implements INotificationsResponse { final Note? note, final RolesListResponse? role, final UserExportableEntities? exportedEntity, - final String? fileId}) = _$INotificationsResponseImpl; + final String? fileId, + final String? message}) = _$INotificationsResponseImpl; factory _INotificationsResponse.fromJson(Map json) = _$INotificationsResponseImpl.fromJson; @@ -574,6 +594,8 @@ abstract class _INotificationsResponse implements INotificationsResponse { @override String? get fileId; @override + String? get message; + @override @JsonKey(ignore: true) _$$INotificationsResponseImplCopyWith<_$INotificationsResponseImpl> get copyWith => throw _privateConstructorUsedError; diff --git a/lib/src/data/i/i_notifications_response.g.dart b/lib/src/data/i/i_notifications_response.g.dart index 4c9709e2..bbb75cbb 100644 --- a/lib/src/data/i/i_notifications_response.g.dart +++ b/lib/src/data/i/i_notifications_response.g.dart @@ -36,6 +36,7 @@ _$INotificationsResponseImpl _$$INotificationsResponseImplFromJson( exportedEntity: $enumDecodeNullable( _$UserExportableEntitiesEnumMap, json['exportedEntity']), fileId: json['fileId'] as String?, + message: json['message'] as String?, ); Map _$$INotificationsResponseImplToJson( @@ -60,6 +61,7 @@ Map _$$INotificationsResponseImplToJson( 'exportedEntity': _$UserExportableEntitiesEnumMap[instance.exportedEntity], 'fileId': instance.fileId, + 'message': instance.message, }; const _$NotificationTypeEnumMap = { From 81b956d17a946142525da5eb0f44303a4f8edcfe Mon Sep 17 00:00:00 2001 From: poppingmoon <63451158+poppingmoon@users.noreply.github.com> Date: Sat, 5 Oct 2024 13:44:48 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=E3=83=AD=E3=82=B0=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E6=99=82=E3=81=AE=E9=80=9A=E7=9F=A5=E3=81=AB=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/src/data/i/i_notifications_request.g.dart | 1 + lib/src/data/i/i_notifications_response.g.dart | 1 + lib/src/enums/notification_type.dart | 1 + 3 files changed, 3 insertions(+) diff --git a/lib/src/data/i/i_notifications_request.g.dart b/lib/src/data/i/i_notifications_request.g.dart index c902f9c8..ae689d1d 100644 --- a/lib/src/data/i/i_notifications_request.g.dart +++ b/lib/src/data/i/i_notifications_request.g.dart @@ -60,4 +60,5 @@ const _$NotificationTypeEnumMap = { NotificationType.renoteGrouped: 'renote:grouped', NotificationType.roleAssigned: 'roleAssigned', NotificationType.exportCompleted: 'exportCompleted', + NotificationType.login: 'login', }; diff --git a/lib/src/data/i/i_notifications_response.g.dart b/lib/src/data/i/i_notifications_response.g.dart index bbb75cbb..ade3631e 100644 --- a/lib/src/data/i/i_notifications_response.g.dart +++ b/lib/src/data/i/i_notifications_response.g.dart @@ -84,6 +84,7 @@ const _$NotificationTypeEnumMap = { NotificationType.renoteGrouped: 'renote:grouped', NotificationType.roleAssigned: 'roleAssigned', NotificationType.exportCompleted: 'exportCompleted', + NotificationType.login: 'login', }; Value? _$JsonConverterFromJson( diff --git a/lib/src/enums/notification_type.dart b/lib/src/enums/notification_type.dart index c7615f6d..78eb7dbb 100644 --- a/lib/src/enums/notification_type.dart +++ b/lib/src/enums/notification_type.dart @@ -22,4 +22,5 @@ enum NotificationType { renoteGrouped, roleAssigned, exportCompleted, + login, }