-
Notifications
You must be signed in to change notification settings - Fork 1
feat(llc): add batch follow and unfollow support #85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
46096cf
feat: update generated client and models
xsahil03x 6b5a74b
feat: add activityCount to FeedData model
xsahil03x eb60ee0
feat: add appeal functionality to moderation client
xsahil03x f747d01
chore: update CHANGELOG.md
xsahil03x fbcb0a8
chore: commit missing generated models
xsahil03x d8c23de
test: add tests for moderation appeal
xsahil03x 01618e2
feat: add ownFollowings field to FeedData model to track followed feeds
xsahil03x 61ff972
feat(llc): add batch follow and unfollow support
xsahil03x a069c16
chore: update CHANGELOG.md
xsahil03x d258db7
chore: commit generated files
xsahil03x ab87644
Merge remote-tracking branch 'origin/main' into feat/batch-follow-unf…
xsahil03x File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
packages/stream_feeds/lib/src/models/batch_follow_data.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| import 'package:freezed_annotation/freezed_annotation.dart'; | ||
|
|
||
| import '../generated/api/models.dart'; | ||
| import 'follow_data.dart'; | ||
|
|
||
| part 'batch_follow_data.freezed.dart'; | ||
|
|
||
| /// Represents the result of a batch follow operation. | ||
| /// | ||
| /// Contains information about follows that were created and all follows | ||
| /// (including existing and newly created ones). | ||
| @freezed | ||
| class BatchFollowData with _$BatchFollowData { | ||
| const BatchFollowData({ | ||
| required this.created, | ||
| required this.follows, | ||
| }); | ||
|
|
||
| /// The follows that were created as a result of the batch operation. | ||
| /// | ||
| /// Contains only the newly created follow relationships. For getOrCreate | ||
| /// operations, this will be empty if all follows already existed. | ||
| @override | ||
| final List<FollowData> created; | ||
|
|
||
| /// All follows, including existing and newly created ones. | ||
| /// | ||
| /// Contains the complete list of follow relationships returned from the | ||
| /// batch operation, regardless of whether they were newly created or already existed. | ||
| @override | ||
| final List<FollowData> follows; | ||
| } | ||
|
|
||
| /// Extension function to convert a [FollowBatchResponse] to a [BatchFollowData] model. | ||
| extension FollowBatchResponseMapper on FollowBatchResponse { | ||
| /// Converts this API batch follow response to a domain [BatchFollowData] instance. | ||
| /// | ||
| /// Maps the created and follows lists from API responses to domain models | ||
| /// with proper type conversions. | ||
| BatchFollowData toModel() { | ||
| return BatchFollowData( | ||
| created: created.map((f) => f.toModel()).toList(), | ||
| follows: follows.map((f) => f.toModel()).toList(), | ||
| ); | ||
| } | ||
| } |
88 changes: 88 additions & 0 deletions
88
packages/stream_feeds/lib/src/models/batch_follow_data.freezed.dart
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.