Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ final class ActivitiesRepository: Sendable {
// MARK: - Reactions

func addReaction(activityId: String, request: AddReactionRequest) async throws -> (reaction: FeedsReactionData, activity: ActivityData) {
let response = try await apiClient.addReaction(activityId: activityId, addReactionRequest: request)
let response = try await apiClient.addActivityReaction(activityId: activityId, addReactionRequest: request)
return (response.reaction.toModel(), response.activity.toModel())
}

Expand Down
19 changes: 17 additions & 2 deletions Sources/StreamFeeds/generated/feeds/APIs/DefaultAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ open class DefaultAPI: DefaultAPIEndpoints, @unchecked Sendable {
}
}

open func addReaction(activityId: String, addReactionRequest: AddReactionRequest) async throws -> AddReactionResponse {
open func addActivityReaction(activityId: String, addReactionRequest: AddReactionRequest) async throws -> AddReactionResponse {
var path = "/api/v2/feeds/activities/{activity_id}/reactions"

let activityIdPreEscape = "\(APIHelper.mapValueToPathItem(activityId))"
Expand Down Expand Up @@ -1691,6 +1691,19 @@ open class DefaultAPI: DefaultAPIEndpoints, @unchecked Sendable {
try self.jsonDecoder.decode(UnblockUsersResponse.self, from: $0)
}
}

open func ownCapabilitiesBatch(ownCapabilitiesBatchRequest: OwnCapabilitiesBatchRequest) async throws -> OwnCapabilitiesBatchResponse {
let path = "/api/v2/feeds/feeds/own_capabilities/batch"

let urlRequest = try makeRequest(
uriPath: path,
httpMethod: "POST",
request: ownCapabilitiesBatchRequest
)
return try await send(request: urlRequest) {
try self.jsonDecoder.decode(OwnCapabilitiesBatchResponse.self, from: $0)
}
}
}

protocol DefaultAPIEndpoints {
Expand Down Expand Up @@ -1730,7 +1743,7 @@ protocol DefaultAPIEndpoints {

func deletePollVote(activityId: String, pollId: String, voteId: String, userId: String?) async throws -> PollVoteResponse

func addReaction(activityId: String, addReactionRequest: AddReactionRequest) async throws -> AddReactionResponse
func addActivityReaction(activityId: String, addReactionRequest: AddReactionRequest) async throws -> AddReactionResponse

func queryActivityReactions(activityId: String, queryActivityReactionsRequest: QueryActivityReactionsRequest) async throws -> QueryActivityReactionsResponse

Expand Down Expand Up @@ -1887,4 +1900,6 @@ protocol DefaultAPIEndpoints {
func updateLiveLocation(updateLiveLocationRequest: UpdateLiveLocationRequest) async throws -> SharedLocationResponse

func unblockUsers(unblockUsersRequest: UnblockUsersRequest) async throws -> UnblockUsersResponse

func ownCapabilitiesBatch(ownCapabilitiesBatchRequest: OwnCapabilitiesBatchRequest) async throws -> OwnCapabilitiesBatchResponse
}
51 changes: 0 additions & 51 deletions Sources/StreamFeeds/generated/feeds/models/APNS.swift

This file was deleted.

76 changes: 0 additions & 76 deletions Sources/StreamFeeds/generated/feeds/models/ActionLog.swift

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Foundation
import StreamCore

public final class ActionLogResponse: @unchecked Sendable, Codable, JSONEncodable, Hashable {
public var aiProviders: [String]
public var createdAt: Date
public var custom: [String: RawJSON]
public var id: String
Expand All @@ -17,7 +18,8 @@ public final class ActionLogResponse: @unchecked Sendable, Codable, JSONEncodabl
public var user: UserResponse?
public var userId: String

public init(createdAt: Date, custom: [String: RawJSON], id: String, reason: String, reviewQueueItem: ReviewQueueItemResponse? = nil, targetUser: UserResponse? = nil, targetUserId: String, type: String, user: UserResponse? = nil, userId: String) {
public init(aiProviders: [String], createdAt: Date, custom: [String: RawJSON], id: String, reason: String, reviewQueueItem: ReviewQueueItemResponse? = nil, targetUser: UserResponse? = nil, targetUserId: String, type: String, user: UserResponse? = nil, userId: String) {
self.aiProviders = aiProviders
self.createdAt = createdAt
self.custom = custom
self.id = id
Expand All @@ -31,6 +33,7 @@ public final class ActionLogResponse: @unchecked Sendable, Codable, JSONEncodabl
}

public enum CodingKeys: String, CodingKey, CaseIterable {
case aiProviders = "ai_providers"
case createdAt = "created_at"
case custom
case id
Expand All @@ -44,7 +47,8 @@ public final class ActionLogResponse: @unchecked Sendable, Codable, JSONEncodabl
}

public static func == (lhs: ActionLogResponse, rhs: ActionLogResponse) -> Bool {
lhs.createdAt == rhs.createdAt &&
lhs.aiProviders == rhs.aiProviders &&
lhs.createdAt == rhs.createdAt &&
lhs.custom == rhs.custom &&
lhs.id == rhs.id &&
lhs.reason == rhs.reason &&
Expand All @@ -57,6 +61,7 @@ public final class ActionLogResponse: @unchecked Sendable, Codable, JSONEncodabl
}

public func hash(into hasher: inout Hasher) {
hasher.combine(aiProviders)
hasher.combine(createdAt)
hasher.combine(custom)
hasher.combine(id)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
//
// Copyright © 2025 Stream.io Inc. All rights reserved.
//

import Foundation
import StreamCore

public final class ActivityFeedbackEvent: @unchecked Sendable, Event, Codable, JSONEncodable, Hashable {
public var activityFeedback: ActivityFeedbackEventPayload
public var createdAt: Date
public var custom: [String: RawJSON]
public var receivedAt: Date?
public var type: String = "feeds.activity.feedback"
public var user: UserResponseCommonFields?

public init(activityFeedback: ActivityFeedbackEventPayload, createdAt: Date, custom: [String: RawJSON], receivedAt: Date? = nil, user: UserResponseCommonFields? = nil) {
self.activityFeedback = activityFeedback
self.createdAt = createdAt
self.custom = custom
self.receivedAt = receivedAt
self.user = user
}

public enum CodingKeys: String, CodingKey, CaseIterable {
case activityFeedback = "activity_feedback"
case createdAt = "created_at"
case custom
case receivedAt = "received_at"
case type
case user
}

public static func == (lhs: ActivityFeedbackEvent, rhs: ActivityFeedbackEvent) -> Bool {
lhs.activityFeedback == rhs.activityFeedback &&
lhs.createdAt == rhs.createdAt &&
lhs.custom == rhs.custom &&
lhs.receivedAt == rhs.receivedAt &&
lhs.type == rhs.type &&
lhs.user == rhs.user
}

public func hash(into hasher: inout Hasher) {
hasher.combine(activityFeedback)
hasher.combine(createdAt)
hasher.combine(custom)
hasher.combine(receivedAt)
hasher.combine(type)
hasher.combine(user)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
//
// Copyright © 2025 Stream.io Inc. All rights reserved.
//

import Foundation
import StreamCore

public final class ActivityFeedbackEventPayload: @unchecked Sendable, Codable, JSONEncodable, Hashable {

public enum ActivityFeedbackEventPayloadAction: String, Sendable, Codable, CaseIterable {
case hide = "hide"
case showLess = "show_less"
case showMore = "show_more"
case unknown = "_unknown"

public init(from decoder: Decoder) throws {
let container = try decoder.singleValueContainer()
if let decodedValue = try? container.decode(String.self),
let value = Self(rawValue: decodedValue) {
self = value
} else {
self = .unknown
}
}
}
public var action: ActivityFeedbackEventPayloadAction
public var activityId: String
public var createdAt: Date
public var updatedAt: Date
public var user: UserResponse
public var value: String

public init(action: ActivityFeedbackEventPayloadAction, activityId: String, createdAt: Date, updatedAt: Date, user: UserResponse, value: String) {
self.action = action
self.activityId = activityId
self.createdAt = createdAt
self.updatedAt = updatedAt
self.user = user
self.value = value
}

public enum CodingKeys: String, CodingKey, CaseIterable {
case action
case activityId = "activity_id"
case createdAt = "created_at"
case updatedAt = "updated_at"
case user
case value
}

public static func == (lhs: ActivityFeedbackEventPayload, rhs: ActivityFeedbackEventPayload) -> Bool {
lhs.action == rhs.action &&
lhs.activityId == rhs.activityId &&
lhs.createdAt == rhs.createdAt &&
lhs.updatedAt == rhs.updatedAt &&
lhs.user == rhs.user &&
lhs.value == rhs.value
}

public func hash(into hasher: inout Hasher) {
hasher.combine(action)
hasher.combine(activityId)
hasher.combine(createdAt)
hasher.combine(updatedAt)
hasher.combine(user)
hasher.combine(value)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,30 @@ import StreamCore

public final class ActivityFeedbackRequest: @unchecked Sendable, Codable, JSONEncodable, Hashable {
public var hide: Bool?
public var muteUser: Bool?
public var reason: String?
public var report: Bool?
public var showLess: Bool?
public var showMore: Bool?

public init(hide: Bool? = nil, muteUser: Bool? = nil, reason: String? = nil, report: Bool? = nil, showLess: Bool? = nil) {
public init(hide: Bool? = nil, showLess: Bool? = nil, showMore: Bool? = nil) {
self.hide = hide
self.muteUser = muteUser
self.reason = reason
self.report = report
self.showLess = showLess
self.showMore = showMore
}

public enum CodingKeys: String, CodingKey, CaseIterable {
case hide
case muteUser = "mute_user"
case reason
case report
case showLess = "show_less"
case showMore = "show_more"
}

public static func == (lhs: ActivityFeedbackRequest, rhs: ActivityFeedbackRequest) -> Bool {
lhs.hide == rhs.hide &&
lhs.muteUser == rhs.muteUser &&
lhs.reason == rhs.reason &&
lhs.report == rhs.report &&
lhs.showLess == rhs.showLess
lhs.showLess == rhs.showLess &&
lhs.showMore == rhs.showMore
}

public func hash(into hasher: inout Hasher) {
hasher.combine(hide)
hasher.combine(muteUser)
hasher.combine(reason)
hasher.combine(report)
hasher.combine(showLess)
hasher.combine(showMore)
}
}
Loading