diff --git a/stream-feeds-android-client/src/main/kotlin/io/getstream/feeds/android/client/api/state/query/ActivitiesQuery.kt b/stream-feeds-android-client/src/main/kotlin/io/getstream/feeds/android/client/api/state/query/ActivitiesQuery.kt index 5f6b40dc5..a74e91347 100644 --- a/stream-feeds-android-client/src/main/kotlin/io/getstream/feeds/android/client/api/state/query/ActivitiesQuery.kt +++ b/stream-feeds-android-client/src/main/kotlin/io/getstream/feeds/android/client/api/state/query/ActivitiesQuery.kt @@ -18,10 +18,14 @@ package io.getstream.feeds.android.client.api.state.query import io.getstream.android.core.api.filter.Filter import io.getstream.android.core.api.filter.FilterField +import io.getstream.android.core.api.model.location.BoundingBox +import io.getstream.android.core.api.model.location.CircularRegion import io.getstream.android.core.api.sort.Sort import io.getstream.android.core.api.sort.SortDirection import io.getstream.android.core.api.sort.SortField import io.getstream.feeds.android.client.api.model.ActivityData +import io.getstream.feeds.android.client.internal.model.toCoordinate +import io.getstream.feeds.android.client.internal.state.query.unsupportedLocalValue /** * A query for retrieving activities with filtering, sorting, and pagination options. @@ -84,6 +88,14 @@ public data class ActivitiesFilterField( */ public val id: ActivitiesFilterField = ActivitiesFilterField("id", ActivityData::id) + /** + * Filter by the feed ID(s) that the activity belongs to. + * + * Supported operators: `equal`, `in` + */ + public val feed: ActivitiesFilterField = + ActivitiesFilterField("feed", unsupportedLocalValue) + /** * Filter by activity filter tags. * @@ -120,7 +132,7 @@ public data class ActivitiesFilterField( * * Supported operators: `equal`, `in` */ - public val type: ActivitiesFilterField = + public val activityType: ActivitiesFilterField = ActivitiesFilterField("activity_type", ActivityData::type) /** @@ -146,6 +158,28 @@ public data class ActivitiesFilterField( */ public val interestTags: ActivitiesFilterField = ActivitiesFilterField("interest_tags", ActivityData::interestTags) + + /** + * Filter by proximity to a location. + * + * Requires matching against [CircularRegion] or a [Map] with `lat` (latitude), `lng` + * (longitude), and `distance` (in kilometers). + * + * Supported operators: `equal` + */ + public val near: ActivitiesFilterField = + ActivitiesFilterField("near") { it.location?.toCoordinate() } + + /** + * Filter by activities within a bounding box. + * + * Can be matched against [BoundingBox] or a [Map] with `ne_lat`, `ne_lng` (northeast + * corner), `sw_lat`, `sw_lng` (southwest corner). + * + * Supported operators: `equal` + */ + public val withinBounds: ActivitiesFilterField = + ActivitiesFilterField("within_bounds") { it.location?.toCoordinate() } } } diff --git a/stream-feeds-android-client/src/main/kotlin/io/getstream/feeds/android/client/api/state/query/ModerationConfigsQuery.kt b/stream-feeds-android-client/src/main/kotlin/io/getstream/feeds/android/client/api/state/query/ModerationConfigsQuery.kt index d569ddcc3..60f2fe4d7 100644 --- a/stream-feeds-android-client/src/main/kotlin/io/getstream/feeds/android/client/api/state/query/ModerationConfigsQuery.kt +++ b/stream-feeds-android-client/src/main/kotlin/io/getstream/feeds/android/client/api/state/query/ModerationConfigsQuery.kt @@ -127,7 +127,7 @@ public sealed interface ModerationConfigsSortField : SortField by SortField.create("id", ModerationConfigData::key) + SortField by SortField.create("key", ModerationConfigData::key) /** * Sort by the creation timestamp of the configuration. This field allows sorting configurations @@ -140,6 +140,14 @@ public sealed interface ModerationConfigsSortField : SortField by SortField.create("team", ModerationConfigData::team) + /** * Sort by the last update timestamp of the configuration. This field allows sorting * configurations by when they were last updated (newest/oldest first). @@ -151,5 +159,3 @@ public sealed interface ModerationConfigsSortField : SortField