From 548eb72a8ad09c5fcb33f614afd5efc885aab2ef Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Wed, 14 Jan 2026 14:54:02 +0100 Subject: [PATCH 1/5] Regenerate open api --- packages/feeds-client/src/feed/feed.ts | 11 +- .../feeds-client/src/gen/feeds/FeedsApi.ts | 1 + .../src/gen/model-decoders/decoders.ts | 334 +----- .../model-decoders/event-decoder-mapping.ts | 10 - packages/feeds-client/src/gen/models/index.ts | 975 +++++------------- .../src/gen/moderation/ModerationApi.ts | 78 ++ .../src/test-utils/response-generators.ts | 5 +- packages/feeds-client/src/types.ts | 4 +- 8 files changed, 391 insertions(+), 1027 deletions(-) diff --git a/packages/feeds-client/src/feed/feed.ts b/packages/feeds-client/src/feed/feed.ts index 0916a96f..4a6fe89b 100644 --- a/packages/feeds-client/src/feed/feed.ts +++ b/packages/feeds-client/src/feed/feed.ts @@ -213,10 +213,10 @@ export class Feed extends FeedApi { 'moderation.mark_reviewed': Feed.noop, 'health.check': Feed.noop, 'app.updated': Feed.noop, - 'user.banned': Feed.noop, - 'user.deactivated': Feed.noop, - 'user.muted': Feed.noop, - 'user.reactivated': Feed.noop, + // 'user.banned': Feed.noop, + // 'user.deactivated': Feed.noop, + //'user.muted': Feed.noop, + //'user.reactivated': Feed.noop, 'user.updated': Feed.noop, 'feeds.activity.feedback': handleActivityFeedback.bind(this), }; @@ -493,6 +493,7 @@ export class Feed extends FeedApi { traverseArray.push({ entityId: comment.id, entityParentId: entityId, + // @ts-expect-error open api refactor issue comments: comment.replies, next: comment.meta?.next_cursor, }); @@ -626,6 +627,7 @@ export class Feed extends FeedApi { await this.loadNextPageComments({ entityId: entityId, base: () => + // @ts-expect-error open api refactor issue this.client.getComments({ ...request, sort, @@ -661,6 +663,7 @@ export class Feed extends FeedApi { await this.loadNextPageComments({ entityId: comment.id, base: () => + // @ts-expect-error open api refactor issue this.client.getCommentReplies({ ...request, id: comment.id, diff --git a/packages/feeds-client/src/gen/feeds/FeedsApi.ts b/packages/feeds-client/src/gen/feeds/FeedsApi.ts index fd28448b..339a0d3d 100644 --- a/packages/feeds-client/src/gen/feeds/FeedsApi.ts +++ b/packages/feeds-client/src/gen/feeds/FeedsApi.ts @@ -745,6 +745,7 @@ export class FeedsApi { skip_enrich_url: request?.skip_enrich_url, text: request?.text, visibility: request?.visibility, + visibility_tag: request?.visibility_tag, attachments: request?.attachments, collection_refs: request?.collection_refs, feeds: request?.feeds, diff --git a/packages/feeds-client/src/gen/model-decoders/decoders.ts b/packages/feeds-client/src/gen/model-decoders/decoders.ts index d5ab5a55..1661cd8e 100644 --- a/packages/feeds-client/src/gen/model-decoders/decoders.ts +++ b/packages/feeds-client/src/gen/model-decoders/decoders.ts @@ -193,7 +193,7 @@ decoders.ActivityResponse = (input?: Record) => { collections: { type: 'EnrichedCollectionResponse', isSingle: false }, - reaction_groups: { type: 'ReactionGroupResponse', isSingle: false }, + reaction_groups: { type: 'FeedsReactionGroupResponse', isSingle: false }, user: { type: 'UserResponse', isSingle: true }, @@ -300,17 +300,26 @@ decoders.AppUpdatedEvent = (input?: Record) => { return decode(typeMappings, input); }; -decoders.Ban = (input?: Record) => { +decoders.AppealItemResponse = (input?: Record) => { const typeMappings: TypeMapping = { created_at: { type: 'DatetimeType', isSingle: true }, - expires: { type: 'DatetimeType', isSingle: true }, + updated_at: { type: 'DatetimeType', isSingle: true }, + + user: { type: 'UserResponse', isSingle: true }, + }; + return decode(typeMappings, input); +}; - channel: { type: 'Channel', isSingle: true }, +decoders.BanInfoResponse = (input?: Record) => { + const typeMappings: TypeMapping = { + created_at: { type: 'DatetimeType', isSingle: true }, + + expires: { type: 'DatetimeType', isSingle: true }, - created_by: { type: 'User', isSingle: true }, + created_by: { type: 'UserResponse', isSingle: true }, - target: { type: 'User', isSingle: true }, + user: { type: 'UserResponse', isSingle: true }, }; return decode(typeMappings, input); }; @@ -472,44 +481,6 @@ decoders.CallSessionResponse = (input?: Record) => { return decode(typeMappings, input); }; -decoders.Channel = (input?: Record) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - - last_message_at: { type: 'DatetimeType', isSingle: true }, - - message_count_updated_at: { type: 'DatetimeType', isSingle: true }, - - active_live_locations: { type: 'SharedLocation', isSingle: false }, - - invites: { type: 'ChannelMember', isSingle: false }, - - members: { type: 'ChannelMember', isSingle: false }, - - config: { type: 'ChannelConfig', isSingle: true }, - - created_by: { type: 'User', isSingle: true }, - - members_lookup: { type: 'ChannelMemberLookup', isSingle: false }, - - truncated_by: { type: 'User', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders.ChannelConfig = (input?: Record) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - decoders.ChannelConfigWithInfo = (input?: Record) => { const typeMappings: TypeMapping = { created_at: { type: 'DatetimeType', isSingle: true }, @@ -521,40 +492,6 @@ decoders.ChannelConfigWithInfo = (input?: Record) => { return decode(typeMappings, input); }; -decoders.ChannelMember = (input?: Record) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - archived_at: { type: 'DatetimeType', isSingle: true }, - - ban_expires: { type: 'DatetimeType', isSingle: true }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - - invite_accepted_at: { type: 'DatetimeType', isSingle: true }, - - invite_rejected_at: { type: 'DatetimeType', isSingle: true }, - - pinned_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'User', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders.ChannelMemberLookup = (input?: Record) => { - const typeMappings: TypeMapping = { - archived_at: { type: 'DatetimeType', isSingle: true }, - - ban_expires: { type: 'DatetimeType', isSingle: true }, - - pinned_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - decoders.ChannelMemberResponse = (input?: Record) => { const typeMappings: TypeMapping = { created_at: { type: 'DatetimeType', isSingle: true }, @@ -721,7 +658,7 @@ decoders.CommentResponse = (input?: Record) => { latest_reactions: { type: 'FeedsReactionResponse', isSingle: false }, - reaction_groups: { type: 'ReactionGroupResponse', isSingle: false }, + reaction_groups: { type: 'FeedsReactionGroupResponse', isSingle: false }, }; return decode(typeMappings, input); }; @@ -808,13 +745,6 @@ decoders.DeleteCommentResponse = (input?: Record) => { return decode(typeMappings, input); }; -decoders.Device = (input?: Record) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - decoders.DeviceResponse = (input?: Record) => { const typeMappings: TypeMapping = { created_at: { type: 'DatetimeType', isSingle: true }, @@ -1025,6 +955,15 @@ decoders.FeedUpdatedEvent = (input?: Record) => { return decode(typeMappings, input); }; +decoders.FeedsReactionGroupResponse = (input?: Record) => { + const typeMappings: TypeMapping = { + first_reaction_at: { type: 'DatetimeType', isSingle: true }, + + last_reaction_at: { type: 'DatetimeType', isSingle: true }, + }; + return decode(typeMappings, input); +}; + decoders.FeedsReactionResponse = (input?: Record) => { const typeMappings: TypeMapping = { created_at: { type: 'DatetimeType', isSingle: true }, @@ -1127,6 +1066,13 @@ decoders.GetActivityResponse = (input?: Record) => { return decode(typeMappings, input); }; +decoders.GetAppealResponse = (input?: Record) => { + const typeMappings: TypeMapping = { + item: { type: 'AppealItemResponse', isSingle: true }, + }; + return decode(typeMappings, input); +}; + decoders.GetBlockedUsersResponse = (input?: Record) => { const typeMappings: TypeMapping = { blocks: { type: 'BlockedUserResponse', isSingle: false }, @@ -1198,6 +1144,8 @@ decoders.HealthCheckEvent = (input?: Record) => { created_at: { type: 'DatetimeType', isSingle: true }, received_at: { type: 'DatetimeType', isSingle: true }, + + me: { type: 'OwnUserResponse', isSingle: true }, }; return decode(typeMappings, input); }; @@ -1225,64 +1173,6 @@ decoders.MembershipLevelResponse = (input?: Record) => { return decode(typeMappings, input); }; -decoders.Message = (input?: Record) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - latest_reactions: { type: 'Reaction', isSingle: false }, - - mentioned_users: { type: 'User', isSingle: false }, - - own_reactions: { type: 'Reaction', isSingle: false }, - - reaction_groups: { type: 'ReactionGroupResponse', isSingle: false }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - - message_text_updated_at: { type: 'DatetimeType', isSingle: true }, - - pin_expires: { type: 'DatetimeType', isSingle: true }, - - pinned_at: { type: 'DatetimeType', isSingle: true }, - - thread_participants: { type: 'User', isSingle: false }, - - member: { type: 'ChannelMember', isSingle: true }, - - pinned_by: { type: 'User', isSingle: true }, - - poll: { type: 'Poll', isSingle: true }, - - quoted_message: { type: 'Message', isSingle: true }, - - reminder: { type: 'MessageReminder', isSingle: true }, - - shared_location: { type: 'SharedLocation', isSingle: true }, - - user: { type: 'User', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders.MessageReminder = (input?: Record) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - remind_at: { type: 'DatetimeType', isSingle: true }, - - channel: { type: 'Channel', isSingle: true }, - - message: { type: 'Message', isSingle: true }, - - user: { type: 'User', isSingle: true }, - }; - return decode(typeMappings, input); -}; - decoders.MessageResponse = (input?: Record) => { const typeMappings: TypeMapping = { created_at: { type: 'DatetimeType', isSingle: true }, @@ -1356,7 +1246,7 @@ decoders.ModerationFlaggedEvent = (input?: Record) => { const typeMappings: TypeMapping = { created_at: { type: 'DatetimeType', isSingle: true }, - user: { type: 'User', isSingle: true }, + received_at: { type: 'DatetimeType', isSingle: true }, }; return decode(typeMappings, input); }; @@ -1376,9 +1266,9 @@ decoders.ModerationMarkReviewedEvent = (input?: Record) => { decoders.MuteResponse = (input?: Record) => { const typeMappings: TypeMapping = { - mutes: { type: 'UserMute', isSingle: false }, + mutes: { type: 'UserMuteResponse', isSingle: false }, - own_user: { type: 'OwnUser', isSingle: true }, + own_user: { type: 'OwnUserResponse', isSingle: true }, }; return decode(typeMappings, input); }; @@ -1415,7 +1305,7 @@ decoders.OwnBatchResponse = (input?: Record) => { return decode(typeMappings, input); }; -decoders.OwnUser = (input?: Record) => { +decoders.OwnUserResponse = (input?: Record) => { const typeMappings: TypeMapping = { created_at: { type: 'DatetimeType', isSingle: true }, @@ -1423,9 +1313,9 @@ decoders.OwnUser = (input?: Record) => { channel_mutes: { type: 'ChannelMute', isSingle: false }, - devices: { type: 'Device', isSingle: false }, + devices: { type: 'DeviceResponse', isSingle: false }, - mutes: { type: 'UserMute', isSingle: false }, + mutes: { type: 'UserMuteResponse', isSingle: false }, deactivated_at: { type: 'DatetimeType', isSingle: true }, @@ -1433,9 +1323,9 @@ decoders.OwnUser = (input?: Record) => { last_active: { type: 'DatetimeType', isSingle: true }, - last_engaged_at: { type: 'DatetimeType', isSingle: true }, + revoke_tokens_issued_before: { type: 'DatetimeType', isSingle: true }, - push_preferences: { type: 'PushPreferences', isSingle: true }, + push_preferences: { type: 'PushPreferencesResponse', isSingle: true }, }; return decode(typeMappings, input); }; @@ -1449,21 +1339,6 @@ decoders.PinActivityResponse = (input?: Record) => { return decode(typeMappings, input); }; -decoders.Poll = (input?: Record) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - latest_answers: { type: 'PollVote', isSingle: false }, - - own_votes: { type: 'PollVote', isSingle: false }, - - created_by: { type: 'User', isSingle: true }, - }; - return decode(typeMappings, input); -}; - decoders.PollClosedFeedEvent = (input?: Record) => { const typeMappings: TypeMapping = { created_at: { type: 'DatetimeType', isSingle: true }, @@ -1519,17 +1394,6 @@ decoders.PollUpdatedFeedEvent = (input?: Record) => { return decode(typeMappings, input); }; -decoders.PollVote = (input?: Record) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'User', isSingle: true }, - }; - return decode(typeMappings, input); -}; - decoders.PollVoteCastedFeedEvent = (input?: Record) => { const typeMappings: TypeMapping = { created_at: { type: 'DatetimeType', isSingle: true }, @@ -1596,7 +1460,7 @@ decoders.PollVotesResponse = (input?: Record) => { return decode(typeMappings, input); }; -decoders.PushPreferences = (input?: Record) => { +decoders.PushPreferencesResponse = (input?: Record) => { const typeMappings: TypeMapping = { disabled_until: { type: 'DatetimeType', isSingle: true }, }; @@ -1617,6 +1481,13 @@ decoders.QueryActivityReactionsResponse = (input?: Record) => { return decode(typeMappings, input); }; +decoders.QueryAppealsResponse = (input?: Record) => { + const typeMappings: TypeMapping = { + items: { type: 'AppealItemResponse', isSingle: false }, + }; + return decode(typeMappings, input); +}; + decoders.QueryBookmarkFoldersResponse = (input?: Record) => { const typeMappings: TypeMapping = { bookmark_folders: { type: 'BookmarkFolderResponse', isSingle: false }, @@ -1694,8 +1565,6 @@ decoders.Reaction = (input?: Record) => { updated_at: { type: 'DatetimeType', isSingle: true }, deleted_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'User', isSingle: true }, }; return decode(typeMappings, input); }; @@ -1766,7 +1635,7 @@ decoders.ReviewQueueItemResponse = (input?: Record) => { actions: { type: 'ActionLogResponse', isSingle: false }, - bans: { type: 'Ban', isSingle: false }, + bans: { type: 'BanInfoResponse', isSingle: false }, flags: { type: 'ModerationFlagResponse', isSingle: false }, @@ -1774,6 +1643,8 @@ decoders.ReviewQueueItemResponse = (input?: Record) => { reviewed_at: { type: 'DatetimeType', isSingle: true }, + appeal: { type: 'AppealItemResponse', isSingle: true }, + assigned_to: { type: 'UserResponse', isSingle: true }, call: { type: 'CallResponse', isSingle: true }, @@ -1793,21 +1664,6 @@ decoders.ReviewQueueItemResponse = (input?: Record) => { return decode(typeMappings, input); }; -decoders.SharedLocation = (input?: Record) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - end_at: { type: 'DatetimeType', isSingle: true }, - - channel: { type: 'Channel', isSingle: true }, - - message: { type: 'Message', isSingle: true }, - }; - return decode(typeMappings, input); -}; - decoders.SharedLocationResponse = (input?: Record) => { const typeMappings: TypeMapping = { created_at: { type: 'DatetimeType', isSingle: true }, @@ -1873,6 +1729,8 @@ decoders.StoriesFeedUpdatedEvent = (input?: Record) => { decoders.SubmitActionResponse = (input?: Record) => { const typeMappings: TypeMapping = { + appeal_item: { type: 'AppealItemResponse', isSingle: true }, + item: { type: 'ReviewQueueItemResponse', isSingle: true }, }; return decode(typeMappings, input); @@ -1896,7 +1754,7 @@ decoders.ThreadedCommentResponse = (input?: Record) => { replies: { type: 'ThreadedCommentResponse', isSingle: false }, - reaction_groups: { type: 'ReactionGroupResponse', isSingle: false }, + reaction_groups: { type: 'FeedsReactionGroupResponse', isSingle: false }, }; return decode(typeMappings, input); }; @@ -2017,67 +1875,7 @@ decoders.UpsertConfigResponse = (input?: Record) => { decoders.UpsertPushPreferencesResponse = (input?: Record) => { const typeMappings: TypeMapping = { - user_preferences: { type: 'PushPreferences', isSingle: false }, - }; - return decode(typeMappings, input); -}; - -decoders.User = (input?: Record) => { - const typeMappings: TypeMapping = { - ban_expires: { type: 'DatetimeType', isSingle: true }, - - created_at: { type: 'DatetimeType', isSingle: true }, - - deactivated_at: { type: 'DatetimeType', isSingle: true }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - - last_active: { type: 'DatetimeType', isSingle: true }, - - last_engaged_at: { type: 'DatetimeType', isSingle: true }, - - revoke_tokens_issued_before: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders.UserBannedEvent = (input?: Record) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - created_by: { type: 'User', isSingle: true }, - - expiration: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'User', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders.UserDeactivatedEvent = (input?: Record) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - created_by: { type: 'User', isSingle: true }, - - user: { type: 'User', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders.UserMute = (input?: Record) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - expires: { type: 'DatetimeType', isSingle: true }, - - target: { type: 'User', isSingle: true }, - - user: { type: 'User', isSingle: true }, + user_preferences: { type: 'PushPreferencesResponse', isSingle: false }, }; return decode(typeMappings, input); }; @@ -2097,24 +1895,6 @@ decoders.UserMuteResponse = (input?: Record) => { return decode(typeMappings, input); }; -decoders.UserMutedEvent = (input?: Record) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'User', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders.UserReactivatedEvent = (input?: Record) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'User', isSingle: true }, - }; - return decode(typeMappings, input); -}; - decoders.UserResponse = (input?: Record) => { const typeMappings: TypeMapping = { created_at: { type: 'DatetimeType', isSingle: true }, diff --git a/packages/feeds-client/src/gen/model-decoders/event-decoder-mapping.ts b/packages/feeds-client/src/gen/model-decoders/event-decoder-mapping.ts index 3aa4fb2c..17b2add6 100644 --- a/packages/feeds-client/src/gen/model-decoders/event-decoder-mapping.ts +++ b/packages/feeds-client/src/gen/model-decoders/event-decoder-mapping.ts @@ -142,16 +142,6 @@ const eventDecoderMapping: Record< 'moderation.mark_reviewed': (data: Record) => decoders.ModerationMarkReviewedEvent(data), - 'user.banned': (data: Record) => decoders.UserBannedEvent(data), - - 'user.deactivated': (data: Record) => - decoders.UserDeactivatedEvent(data), - - 'user.muted': (data: Record) => decoders.UserMutedEvent(data), - - 'user.reactivated': (data: Record) => - decoders.UserReactivatedEvent(data), - 'user.updated': (data: Record) => decoders.UserUpdatedEvent(data), }; diff --git a/packages/feeds-client/src/gen/models/index.ts b/packages/feeds-client/src/gen/models/index.ts index 6c0b6daa..8bf6c335 100644 --- a/packages/feeds-client/src/gen/models/index.ts +++ b/packages/feeds-client/src/gen/models/index.ts @@ -451,7 +451,7 @@ export interface ActivityResponse { custom: Record; - reaction_groups: Record; + reaction_groups: Record; search_data: Record; @@ -754,6 +754,46 @@ export interface AppUpdatedEvent { received_at?: Date; } +export interface AppealItemResponse { + appeal_reason: string; + + created_at: Date; + + entity_id: string; + + entity_type: string; + + id: string; + + status: string; + + updated_at: Date; + + decision_reason?: string; + + attachments?: string[]; + + entity_content?: ModerationPayload; + + user?: UserResponse; +} + +export interface AppealRequest { + appeal_reason: string; + + entity_id: string; + + entity_type: string; + + attachments?: string[]; +} + +export interface AppealResponse { + appeal_id: string; + + duration: string; +} + export interface Attachment { custom: Record; @@ -870,34 +910,32 @@ export interface BackstageSettingsResponse { join_ahead_time_seconds?: number; } -export interface Ban { - created_at: Date; +export interface BanActionRequestPayload { + channel_ban_only?: boolean; - shadow: boolean; + delete_messages?: 'soft' | 'pruning' | 'hard'; - expires?: Date; + ip_ban?: boolean; reason?: string; - channel?: Channel; - - created_by?: User; + shadow?: boolean; - target?: User; + timeout?: number; } -export interface BanActionRequest { - channel_ban_only?: boolean; - - delete_messages?: 'soft' | 'pruning' | 'hard'; +export interface BanInfoResponse { + created_at: Date; - ip_ban?: boolean; + expires?: Date; reason?: string; shadow?: boolean; - timeout?: number; + created_by?: UserResponse; + + user?: UserResponse; } export interface BanOptions { @@ -936,7 +974,7 @@ export interface BanResponse { duration: string; } -export interface BlockActionRequest { +export interface BlockActionRequestPayload { reason?: string; } @@ -961,7 +999,13 @@ export interface BlockListResponse { name: string; - type: string; + type: + | 'regex' + | 'domain' + | 'domain_allowlist' + | 'email' + | 'email_allowlist' + | 'word'; words: string[]; @@ -1252,8 +1296,12 @@ export interface CallSettingsResponse { geofencing: GeofenceSettingsResponse; + individual_recording: IndividualRecordingSettingsResponse; + limits: LimitsSettingsResponse; + raw_recording: RawRecordingSettingsResponse; + recording: RecordSettingsResponse; ring: RingSettingsResponse; @@ -1275,132 +1323,6 @@ export interface CastPollVoteRequest { vote?: VoteData; } -export interface Channel { - auto_translation_language: string; - - cid: string; - - created_at: Date; - - disabled: boolean; - - frozen: boolean; - - id: string; - - type: string; - - updated_at: Date; - - custom: Record; - - auto_translation_enabled?: boolean; - - cooldown?: number; - - deleted_at?: Date; - - last_campaigns?: string; - - last_message_at?: Date; - - member_count?: number; - - message_count?: number; - - message_count_updated_at?: Date; - - team?: string; - - active_live_locations?: SharedLocation[]; - - filter_tags?: string[]; - - invites?: ChannelMember[]; - - members?: ChannelMember[]; - - config?: ChannelConfig; - - config_overrides?: ConfigOverrides; - - created_by?: User; - - members_lookup?: Record; - - truncated_by?: User; -} - -export interface ChannelConfig { - automod: 'disabled' | 'simple' | 'AI'; - - automod_behavior: 'flag' | 'block' | 'shadow_block'; - - connect_events: boolean; - - count_messages: boolean; - - created_at: Date; - - custom_events: boolean; - - delivery_events: boolean; - - mark_messages_pending: boolean; - - max_message_length: number; - - mutes: boolean; - - name: string; - - polls: boolean; - - push_notifications: boolean; - - quotes: boolean; - - reactions: boolean; - - read_events: boolean; - - reminders: boolean; - - replies: boolean; - - search: boolean; - - shared_locations: boolean; - - skip_last_msg_update_for_system_msgs: boolean; - - typing_events: boolean; - - updated_at: Date; - - uploads: boolean; - - url_enrichment: boolean; - - user_message_reminders: boolean; - - commands: string[]; - - blocklist?: string; - - blocklist_behavior?: 'flag' | 'block' | 'shadow_block'; - - partition_size?: number; - - partition_ttl?: number; - - allowed_flag_reasons?: string[]; - - blocklists?: BlockListOptions[]; - - automod_thresholds?: Thresholds; -} - export interface ChannelConfigWithInfo { automod: 'disabled' | 'simple' | 'AI'; @@ -1473,72 +1395,6 @@ export interface ChannelConfigWithInfo { grants?: Record; } -export interface ChannelMember { - banned: boolean; - - channel_role: string; - - created_at: Date; - - is_global_banned: boolean; - - notifications_muted: boolean; - - shadow_banned: boolean; - - updated_at: Date; - - custom: Record; - - archived_at?: Date; - - ban_expires?: Date; - - blocked?: boolean; - - deleted_at?: Date; - - hidden?: boolean; - - invite_accepted_at?: Date; - - invite_rejected_at?: Date; - - invited?: boolean; - - is_moderator?: boolean; - - pinned_at?: Date; - - status?: string; - - user_id?: string; - - deleted_messages?: string[]; - - channel?: DenormalizedChannelFields; - - user?: User; -} - -export interface ChannelMemberLookup { - archived: boolean; - - banned: boolean; - - blocked: boolean; - - hidden: boolean; - - pinned: boolean; - - archived_at?: Date; - - ban_expires?: Date; - - pinned_at?: Date; -} - export interface ChannelMemberResponse { banned: boolean; @@ -1636,7 +1492,7 @@ export const ChannelOwnCapability = { export type ChannelOwnCapability = (typeof ChannelOwnCapability)[keyof typeof ChannelOwnCapability]; -export interface ChannelPushPreferences { +export interface ChannelPushPreferencesResponse { chat_level?: string; disabled_until?: Date; @@ -1855,7 +1711,7 @@ export interface CommentResponse { score: number; - status: string; + status: 'active' | 'deleted' | 'removed' | 'hidden'; updated_at: Date; @@ -1883,7 +1739,7 @@ export interface CommentResponse { moderation?: ModerationV2Response; - reaction_groups?: Record; + reaction_groups?: Record; } export interface CommentUpdatedEvent { @@ -1904,34 +1760,8 @@ export interface CommentUpdatedEvent { user?: UserResponseCommonFields; } -export interface ConfigOverrides { - commands: string[]; - - grants: Record; - - blocklist?: string; - - blocklist_behavior?: 'flag' | 'block'; - - count_messages?: boolean; - - max_message_length?: number; - - quotes?: boolean; - - reactions?: boolean; - - replies?: boolean; - - shared_locations?: boolean; - - typing_events?: boolean; - - uploads?: boolean; - - url_enrichment?: boolean; - - user_message_reminders?: boolean; +export interface CompositeRecordingResponse { + status: string; } export interface ConfigResponse { @@ -2088,7 +1918,7 @@ export interface CreatePollRequest { custom?: Record; } -export interface CustomActionRequest { +export interface CustomActionRequestPayload { id?: string; options?: Record; @@ -2132,7 +1962,7 @@ export interface DeleteActivityReactionResponse { reaction: FeedsReactionResponse; } -export interface DeleteActivityRequest { +export interface DeleteActivityRequestPayload { hard_delete?: boolean; reason?: string; @@ -2164,7 +1994,7 @@ export interface DeleteCommentReactionResponse { reaction: FeedsReactionResponse; } -export interface DeleteCommentRequest { +export interface DeleteCommentRequestPayload { hard_delete?: boolean; reason?: string; @@ -2184,7 +2014,7 @@ export interface DeleteFeedResponse { task_id: string; } -export interface DeleteMessageRequest { +export interface DeleteMessageRequestPayload { hard_delete?: boolean; reason?: string; @@ -2194,13 +2024,13 @@ export interface DeleteModerationConfigResponse { duration: string; } -export interface DeleteReactionRequest { +export interface DeleteReactionRequestPayload { hard_delete?: boolean; reason?: string; } -export interface DeleteUserRequest { +export interface DeleteUserRequestPayload { delete_conversation_channels?: boolean; delete_feeds_content?: boolean; @@ -2212,56 +2042,10 @@ export interface DeleteUserRequest { reason?: string; } -export interface DeliveryReceipts { - enabled: boolean; -} - export interface DeliveryReceiptsResponse { enabled: boolean; } -export interface DenormalizedChannelFields { - created_at?: string; - - created_by_id?: string; - - disabled?: boolean; - - frozen?: boolean; - - id?: string; - - last_message_at?: string; - - member_count?: number; - - team?: string; - - type?: string; - - updated_at?: string; - - custom?: Record; -} - -export interface Device { - created_at: Date; - - id: string; - - push_provider: 'firebase' | 'apn' | 'huawei' | 'xiaomi'; - - user_id: string; - - disabled?: boolean; - - disabled_reason?: string; - - push_provider_name?: string; - - voip?: boolean; -} - export interface DeviceResponse { created_at: Date; @@ -2301,7 +2085,7 @@ export interface DraftPayloadResponse { silent?: boolean; - type?: string; + type?: '' | 'regular' | 'system'; attachments?: Attachment[]; @@ -2345,9 +2129,15 @@ export interface EgressResponse { rtmps: EgressRTMPResponse[]; + composite_recording?: CompositeRecordingResponse; + frame_recording?: FrameRecordingResponse; hls?: EgressHLSResponse; + + individual_recording?: IndividualRecordingResponse; + + raw_recording?: RawRecordingResponse; } export interface EnrichedActivity { @@ -2904,6 +2694,8 @@ export interface FeedsPreferencesResponse { comment_reaction?: string; + comment_reply?: string; + follow?: string; mention?: string; @@ -2913,6 +2705,14 @@ export interface FeedsPreferencesResponse { custom_activity_types?: Record; } +export interface FeedsReactionGroupResponse { + count: number; + + first_reaction_at: Date; + + last_reaction_at: Date; +} + export interface FeedsReactionResponse { activity_id: string; @@ -3183,6 +2983,12 @@ export interface GetActivityResponse { activity: ActivityResponse; } +export interface GetAppealResponse { + duration: string; + + item?: AppealItemResponse; +} + export interface GetApplicationResponse { duration: string; @@ -3453,6 +3259,14 @@ export interface Images { original: ImageData; } +export interface IndividualRecordingResponse { + status: string; +} + +export interface IndividualRecordingSettingsResponse { + mode: 'available' | 'disabled' | 'auto-on'; +} + export interface IngressAudioEncodingResponse { bitrate: number; @@ -3564,9 +3378,11 @@ export interface MarkActivityRequest { mark_watched?: string[]; } -export interface MarkReviewedRequest { +export interface MarkReviewedRequestPayload { content_to_mark_as_reviewed_limit?: number; + decision_reason?: string; + disable_marking_content_as_reviewed?: boolean; } @@ -3588,118 +3404,6 @@ export interface MembershipLevelResponse { custom?: Record; } -export interface Message { - cid: string; - - created_at: Date; - - deleted_reply_count: number; - - html: string; - - id: string; - - pinned: boolean; - - reply_count: number; - - shadowed: boolean; - - silent: boolean; - - text: string; - - type: string; - - updated_at: Date; - - attachments: Attachment[]; - - latest_reactions: Reaction[]; - - mentioned_users: User[]; - - own_reactions: Reaction[]; - - restricted_visibility: string[]; - - custom: Record; - - reaction_counts: Record; - - reaction_groups: Record; - - reaction_scores: Record; - - before_message_send_failed?: boolean; - - command?: string; - - deleted_at?: Date; - - deleted_for_me?: boolean; - - message_text_updated_at?: Date; - - mml?: string; - - parent_id?: string; - - pin_expires?: Date; - - pinned_at?: Date; - - poll_id?: string; - - quoted_message_id?: string; - - show_in_channel?: boolean; - - thread_participants?: User[]; - - i18n?: Record; - - image_labels?: Record; - - member?: ChannelMember; - - moderation?: ModerationV2Response; - - pinned_by?: User; - - poll?: Poll; - - quoted_message?: Message; - - reminder?: MessageReminder; - - shared_location?: SharedLocation; - - user?: User; -} - -export interface MessageReminder { - channel_cid: string; - - created_at: Date; - - message_id: string; - - task_id: string; - - updated_at: Date; - - user_id: string; - - remind_at?: Date; - - channel?: Channel; - - message?: Message; - - user?: User; -} - export interface MessageResponse { cid: string; @@ -3790,7 +3494,7 @@ export interface MessageResponse { shared_location?: SharedLocationResponseData; } -export interface ModerationActionConfig { +export interface ModerationActionConfigResponse { action: string; description: string; @@ -3801,7 +3505,7 @@ export interface ModerationActionConfig { order: number; - custom: Record; + custom?: Record; } export interface ModerationCustomActionEvent { @@ -3847,7 +3551,7 @@ export interface ModerationFlagResponse { custom?: Record; - moderation_payload?: ModerationPayload; + moderation_payload?: ModerationPayloadResponse; review_queue_item?: ReviewQueueItemResponse; @@ -3855,15 +3559,17 @@ export interface ModerationFlagResponse { } export interface ModerationFlaggedEvent { + content_type: string; + created_at: Date; - type: string; + object_id: string; - item?: string; + custom: Record; - object_id?: string; + type: string; - user?: User; + received_at?: Date; } export interface ModerationMarkReviewedEvent { @@ -3890,6 +3596,16 @@ export interface ModerationPayload { custom?: Record; } +export interface ModerationPayloadResponse { + images?: string[]; + + texts?: string[]; + + videos?: string[]; + + custom?: Record; +} + export interface ModerationV2Response { action: string; @@ -3915,11 +3631,11 @@ export interface MuteRequest { export interface MuteResponse { duration: string; - mutes?: UserMute[]; + mutes?: UserMuteResponse[]; non_existing_users?: string[]; - own_user?: OwnUser; + own_user?: OwnUserResponse; } export interface NoiseCancellationSettings { @@ -4024,74 +3740,16 @@ export interface OnlyUserID { id: string; } -export interface OwnBatchRequest { - feeds: string[]; - - fields?: string[]; -} - -export interface OwnBatchResponse { - duration: string; - - data: Record; -} - -export interface OwnUser { - banned: boolean; - - created_at: Date; - - id: string; - - language: string; - - online: boolean; - - role: string; - - total_unread_count: number; - - unread_channels: number; - - unread_count: number; - - unread_threads: number; - - updated_at: Date; - - channel_mutes: ChannelMute[]; - - devices: Device[]; - - mutes: UserMute[]; - - custom: Record; - - total_unread_count_by_team: Record; - - avg_response_time?: number; - - deactivated_at?: Date; - - deleted_at?: Date; - - invisible?: boolean; - - last_active?: Date; - - last_engaged_at?: Date; - - blocked_user_ids?: string[]; - - latest_hidden_channels?: string[]; - - teams?: string[]; +export interface OwnBatchRequest { + feeds: string[]; - privacy_settings?: PrivacySettings; + fields?: string[]; +} - push_preferences?: PushPreferences; +export interface OwnBatchResponse { + duration: string; - teams_role?: Record; + data: Record; } export interface OwnUserResponse { @@ -4184,50 +3842,6 @@ export interface PinActivityResponse { activity: ActivityResponse; } -export interface Poll { - allow_answers: boolean; - - allow_user_suggested_options: boolean; - - answers_count: number; - - created_at: Date; - - created_by_id: string; - - description: string; - - enforce_unique_vote: boolean; - - id: string; - - name: string; - - updated_at: Date; - - vote_count: number; - - latest_answers: PollVote[]; - - options: PollOption[]; - - own_votes: PollVote[]; - - custom: Record; - - latest_votes_by_option: Record; - - vote_counts_by_option: Record; - - is_closed?: boolean; - - max_votes_allowed?: number; - - voting_visibility?: string; - - created_by?: User; -} - export interface PollClosedFeedEvent { created_at: Date; @@ -4260,14 +3874,6 @@ export interface PollDeletedFeedEvent { received_at?: Date; } -export interface PollOption { - id: string; - - text: string; - - custom: Record; -} - export interface PollOptionInput { text?: string; @@ -4362,26 +3968,6 @@ export interface PollUpdatedFeedEvent { received_at?: Date; } -export interface PollVote { - created_at: Date; - - id: string; - - option_id: string; - - poll_id: string; - - updated_at: Date; - - answer_text?: string; - - is_answer?: boolean; - - user_id?: string; - - user?: User; -} - export interface PollVoteCastedFeedEvent { created_at: Date; @@ -4474,14 +4060,6 @@ export interface PollVotesResponse { prev?: string; } -export interface PrivacySettings { - delivery_receipts?: DeliveryReceipts; - - read_receipts?: ReadReceipts; - - typing_indicators?: TypingIndicators; -} - export interface PrivacySettingsResponse { delivery_receipts?: DeliveryReceiptsResponse; @@ -4514,18 +4092,6 @@ export interface PushPreferenceInput { feeds_preferences?: FeedsPreferences; } -export interface PushPreferences { - call_level?: string; - - chat_level?: string; - - disabled_until?: Date; - - feeds_level?: string; - - feeds_preferences?: FeedsPreferences; -} - export interface PushPreferencesResponse { call_level?: string; @@ -4582,6 +4148,28 @@ export interface QueryActivityReactionsResponse { prev?: string; } +export interface QueryAppealsRequest { + limit?: number; + + next?: string; + + prev?: string; + + sort?: SortParamRequest[]; + + filter?: Record; +} + +export interface QueryAppealsResponse { + duration: string; + + items: AppealItemResponse[]; + + next?: string; + + prev?: string; +} + export interface QueryBookmarkFoldersRequest { limit?: number; @@ -4819,7 +4407,7 @@ export interface QueryReviewQueueResponse { items: ReviewQueueItemResponse[]; - action_config: Record; + action_config: Record; stats: Record; @@ -4870,6 +4458,14 @@ export interface RankingConfig { functions?: Record; } +export interface RawRecordingResponse { + status: string; +} + +export interface RawRecordingSettingsResponse { + mode: 'available' | 'disabled' | 'auto-on'; +} + export interface Reaction { activity_id: string; @@ -4940,10 +4536,6 @@ export interface ReadCollectionsResponse { collections: CollectionResponse[]; } -export interface ReadReceipts { - enabled: boolean; -} - export interface ReadReceiptsResponse { enabled: boolean; } @@ -4956,6 +4548,10 @@ export interface RecordSettingsResponse { quality: string; } +export interface RejectAppealRequestPayload { + decision_reason: string; +} + export interface RejectFeedMemberInviteRequest {} export interface RejectFeedMemberInviteResponse { @@ -5010,7 +4606,9 @@ export interface Response { duration: string; } -export interface RestoreActionRequest {} +export interface RestoreActionRequestPayload { + decision_reason?: string; +} export interface ReviewQueueItemResponse { ai_text_severity: string; @@ -5039,7 +4637,7 @@ export interface ReviewQueueItemResponse { actions: ActionLogResponse[]; - bans: Ban[]; + bans: BanInfoResponse[]; flags: ModerationFlagResponse[]; @@ -5057,6 +4655,8 @@ export interface ReviewQueueItemResponse { activity?: EnrichedActivity; + appeal?: AppealItemResponse; + assigned_to?: UserResponse; call?: CallResponse; @@ -5073,7 +4673,7 @@ export interface ReviewQueueItemResponse { message?: MessageResponse; - moderation_payload?: ModerationPayload; + moderation_payload?: ModerationPayloadResponse; reaction?: Reaction; } @@ -5125,6 +4725,10 @@ export interface RuleBuilderCondition { user_flag_count_rule_params?: FlagCountRuleParameters; + user_identical_content_count_params?: UserIdenticalContentCountParameters; + + user_role_params?: UserRoleParameters; + user_rule_params?: UserRuleParameters; video_content_params?: VideoContentParameters; @@ -5176,34 +4780,10 @@ export interface SessionSettingsResponse { inactivity_timeout_seconds: number; } -export interface ShadowBlockActionRequest { +export interface ShadowBlockActionRequestPayload { reason?: string; } -export interface SharedLocation { - channel_cid: string; - - created_at: Date; - - created_by_device_id: string; - - message_id: string; - - updated_at: Date; - - user_id: string; - - end_at?: Date; - - latitude?: number; - - longitude?: number; - - channel?: Channel; - - message?: Message; -} - export interface SharedLocationResponse { channel_cid: string; @@ -5272,12 +4852,16 @@ export interface SortParam { direction: number; field: string; + + type: string; } export interface SortParamRequest { direction?: number; field?: string; + + type?: '' | 'number' | 'boolean'; } export interface SpeechSegmentConfig { @@ -5331,34 +4915,44 @@ export interface SubmitActionRequest { | 'kick_user' | 'end_call'; - item_id: string; + appeal_id?: string; + + item_id?: string; - ban?: BanActionRequest; + ban?: BanActionRequestPayload; - block?: BlockActionRequest; + block?: BlockActionRequestPayload; - custom?: CustomActionRequest; + custom?: CustomActionRequestPayload; - delete_activity?: DeleteActivityRequest; + delete_activity?: DeleteActivityRequestPayload; - delete_comment?: DeleteCommentRequest; + delete_comment?: DeleteCommentRequestPayload; - delete_message?: DeleteMessageRequest; + delete_message?: DeleteMessageRequestPayload; - delete_reaction?: DeleteReactionRequest; + delete_reaction?: DeleteReactionRequestPayload; - delete_user?: DeleteUserRequest; + delete_user?: DeleteUserRequestPayload; - mark_reviewed?: MarkReviewedRequest; + mark_reviewed?: MarkReviewedRequestPayload; - shadow_block?: ShadowBlockActionRequest; + reject_appeal?: RejectAppealRequestPayload; - unban?: UnbanActionRequest; + restore?: RestoreActionRequestPayload; + + shadow_block?: ShadowBlockActionRequestPayload; + + unban?: UnbanActionRequestPayload; + + unblock?: UnblockActionRequestPayload; } export interface SubmitActionResponse { duration: string; + appeal_item?: AppealItemResponse; + item?: ReviewQueueItemResponse; } @@ -5385,6 +4979,8 @@ export interface TextContentParameters { export interface TextRuleParameters { contains_url?: boolean; + semantic_filter_min_threshold?: number; + severity?: string; threshold?: number; @@ -5395,6 +4991,8 @@ export interface TextRuleParameters { harm_labels?: string[]; + semantic_filter_names?: string[]; + llm_harm_labels?: Record; } @@ -5449,7 +5047,7 @@ export interface ThreadedCommentResponse { moderation?: ModerationV2Response; - reaction_groups?: Record; + reaction_groups?: Record; } export interface Thresholds { @@ -5525,17 +5123,19 @@ export interface TranslationSettings { languages: string[]; } -export interface TypingIndicators { - enabled: boolean; -} - export interface TypingIndicatorsResponse { enabled: boolean; } -export interface UnbanActionRequest {} +export interface UnbanActionRequestPayload { + channel_cid?: string; + + decision_reason?: string; +} -export interface UnblockActionRequest {} +export interface UnblockActionRequestPayload { + decision_reason?: string; +} export interface UnblockUsersRequest { blocked_user_id: string; @@ -5594,7 +5194,9 @@ export interface UpdateActivityRequest { text?: string; - visibility?: string; + visibility?: 'public' | 'private' | 'tag'; + + visibility_tag?: string; attachments?: Attachment[]; @@ -5892,74 +5494,16 @@ export interface UpsertPushPreferencesResponse { user_channel_preferences: Record< string, - Record + Record >; - user_preferences: Record; + user_preferences: Record; } export interface User { - banned: boolean; - id: string; - online: boolean; - - role: string; - - custom: Record; - - teams_role: Record; - - avg_response_time?: number; - - ban_expires?: Date; - - created_at?: Date; - - deactivated_at?: Date; - - deleted_at?: Date; - - invisible?: boolean; - - language?: string; - - last_active?: Date; - - last_engaged_at?: Date; - - revoke_tokens_issued_before?: Date; - - updated_at?: Date; - - teams?: string[]; - - privacy_settings?: PrivacySettings; -} - -export interface UserBannedEvent { - channel_id: string; - - channel_type: string; - - cid: string; - - created_at: Date; - - shadow: boolean; - - created_by: User; - - type: string; - - expiration?: Date; - - reason?: string; - - team?: string; - - user?: User; + data?: Record; } export interface UserCreatedWithinParameters { @@ -5972,26 +5516,10 @@ export interface UserCustomPropertyParameters { property_key?: string; } -export interface UserDeactivatedEvent { - created_at: Date; - - created_by: User; - - type: string; - - user?: User; -} - -export interface UserMute { - created_at: Date; - - updated_at: Date; - - expires?: Date; - - target?: User; +export interface UserIdenticalContentCountParameters { + threshold?: number; - user?: User; + time_window?: string; } export interface UserMuteResponse { @@ -6006,26 +5534,6 @@ export interface UserMuteResponse { user?: UserResponse; } -export interface UserMutedEvent { - created_at: Date; - - type: string; - - target_user?: string; - - target_users?: string[]; - - user?: User; -} - -export interface UserReactivatedEvent { - created_at: Date; - - type: string; - - user?: User; -} - export interface UserRequest { id: string; @@ -6160,6 +5668,12 @@ export interface UserResponsePrivacyFields { teams_role?: Record; } +export interface UserRoleParameters { + operator?: string; + + role?: string; +} + export interface UserRuleParameters { max_age?: string; } @@ -6234,9 +5748,9 @@ export interface VideoContentParameters { harm_labels?: string[]; } -export interface VideoEndCallRequest {} +export interface VideoEndCallRequestPayload {} -export interface VideoKickUserRequest {} +export interface VideoKickUserRequestPayload {} export interface VideoRuleParameters { threshold?: number; @@ -6273,7 +5787,7 @@ export interface WSAuthMessage { user_details: ConnectUserDetailsRequest; - products?: string[]; + products?: 'chat' | 'video' | 'feeds'; } export type WSClientEvent = @@ -6323,6 +5837,7 @@ export type WSClientEvent = | ({ type: 'feeds.stories_feed.updated' } & StoriesFeedUpdatedEvent) | ({ type: 'health.check' } & HealthCheckEvent) | ({ type: 'moderation.custom_action' } & ModerationCustomActionEvent) + | ({ type: 'moderation.flagged' } & ModerationFlaggedEvent) | ({ type: 'moderation.mark_reviewed' } & ModerationMarkReviewedEvent) | ({ type: 'user.updated' } & UserUpdatedEvent); @@ -6375,8 +5890,4 @@ export type WSEvent = | ({ type: 'moderation.custom_action' } & ModerationCustomActionEvent) | ({ type: 'moderation.flagged' } & ModerationFlaggedEvent) | ({ type: 'moderation.mark_reviewed' } & ModerationMarkReviewedEvent) - | ({ type: 'user.banned' } & UserBannedEvent) - | ({ type: 'user.deactivated' } & UserDeactivatedEvent) - | ({ type: 'user.muted' } & UserMutedEvent) - | ({ type: 'user.reactivated' } & UserReactivatedEvent) | ({ type: 'user.updated' } & UserUpdatedEvent); diff --git a/packages/feeds-client/src/gen/moderation/ModerationApi.ts b/packages/feeds-client/src/gen/moderation/ModerationApi.ts index a5b5a80d..71aaee08 100644 --- a/packages/feeds-client/src/gen/moderation/ModerationApi.ts +++ b/packages/feeds-client/src/gen/moderation/ModerationApi.ts @@ -1,13 +1,18 @@ import type { ApiClient, StreamResponse } from '../../gen-imports'; import type { + AppealRequest, + AppealResponse, BanRequest, BanResponse, DeleteModerationConfigResponse, FlagRequest, FlagResponse, + GetAppealResponse, GetConfigResponse, MuteRequest, MuteResponse, + QueryAppealsRequest, + QueryAppealsResponse, QueryModerationConfigsRequest, QueryModerationConfigsResponse, QueryReviewQueueRequest, @@ -22,6 +27,75 @@ import { decoders } from '../model-decoders/decoders'; export class ModerationApi { constructor(public readonly apiClient: ApiClient) {} + async appeal( + request: AppealRequest, + ): Promise> { + const body = { + appeal_reason: request?.appeal_reason, + entity_id: request?.entity_id, + entity_type: request?.entity_type, + attachments: request?.attachments, + }; + + const response = await this.apiClient.sendRequest< + StreamResponse + >( + 'POST', + '/api/v2/moderation/appeal', + undefined, + undefined, + body, + 'application/json', + ); + + decoders.AppealResponse?.(response.body); + + return { ...response.body, metadata: response.metadata }; + } + + async getAppeal(request: { + id: string; + }): Promise> { + const pathParams = { + id: request?.id, + }; + + const response = await this.apiClient.sendRequest< + StreamResponse + >('GET', '/api/v2/moderation/appeal/{id}', pathParams, undefined); + + decoders.GetAppealResponse?.(response.body); + + return { ...response.body, metadata: response.metadata }; + } + + async queryAppeals( + request?: QueryAppealsRequest, + ): Promise> { + const body = { + limit: request?.limit, + next: request?.next, + prev: request?.prev, + sort: request?.sort, + filter: request?.filter, + }; + + const response = await this.apiClient.sendRequest< + StreamResponse + >( + 'POST', + '/api/v2/moderation/appeals', + undefined, + undefined, + body, + 'application/json', + ); + + decoders.QueryAppealsResponse?.(response.body); + + return { ...response.body, metadata: response.metadata }; + } + async ban(request: BanRequest): Promise> { const body = { target_user_id: request?.target_user_id, @@ -242,6 +316,7 @@ export class ModerationApi { ): Promise> { const body = { action_type: request?.action_type, + appeal_id: request?.appeal_id, item_id: request?.item_id, ban: request?.ban, block: request?.block, @@ -252,8 +327,11 @@ export class ModerationApi { delete_reaction: request?.delete_reaction, delete_user: request?.delete_user, mark_reviewed: request?.mark_reviewed, + reject_appeal: request?.reject_appeal, + restore: request?.restore, shadow_block: request?.shadow_block, unban: request?.unban, + unblock: request?.unblock, }; const response = await this.apiClient.sendRequest< diff --git a/packages/feeds-client/src/test-utils/response-generators.ts b/packages/feeds-client/src/test-utils/response-generators.ts index 65616fcf..83ad23d7 100644 --- a/packages/feeds-client/src/test-utils/response-generators.ts +++ b/packages/feeds-client/src/test-utils/response-generators.ts @@ -8,7 +8,6 @@ import type { FeedResponse, FeedsReactionResponse, FollowResponse, - OwnUser, OwnUserResponse, PinActivityResponse, UserResponse, @@ -73,7 +72,9 @@ export const generateOwnUserResponse = ( ...overrides, }); -export const generateOwnUser = (overrides: Partial = {}): OwnUser => ({ +export const generateOwnUser = ( + overrides: Partial = {}, +): OwnUserResponse => ({ ...generateOwnUserResponse(), devices: [], mutes: [], diff --git a/packages/feeds-client/src/types.ts b/packages/feeds-client/src/types.ts index a88ad9af..a76a1e3d 100644 --- a/packages/feeds-client/src/types.ts +++ b/packages/feeds-client/src/types.ts @@ -3,7 +3,7 @@ import type { UnhandledErrorEvent, } from './common/real-time/event-models'; import type { NetworkChangedEvent } from './common/types'; -import type { OwnUser, PagerResponse, WSEvent } from './gen/models'; +import type { OwnUserResponse, PagerResponse, WSEvent } from './gen/models'; import type { ActivityResponse, CommentResponse } from './gen/models'; import type { FeedsClient } from './feeds-client'; @@ -35,4 +35,4 @@ export type StreamFile = File | { name: string; uri: string; type: string }; export type CommentParent = ActivityResponse | CommentResponse; -export type ConnectedUser = OwnUser & { name?: string; image?: string }; +export type ConnectedUser = OwnUserResponse; From 655db64d7f508dbb1c5aee4d68cdeebbbf27f8a5 Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Wed, 14 Jan 2026 16:27:52 +0100 Subject: [PATCH 2/5] Regen from open api --- .../src/gen/model-decoders/decoders.ts | 38 ++++++++ .../model-decoders/event-decoder-mapping.ts | 10 +++ packages/feeds-client/src/gen/models/index.ts | 88 +++++++++++++++++++ 3 files changed, 136 insertions(+) diff --git a/packages/feeds-client/src/gen/model-decoders/decoders.ts b/packages/feeds-client/src/gen/model-decoders/decoders.ts index 1661cd8e..66a8b760 100644 --- a/packages/feeds-client/src/gen/model-decoders/decoders.ts +++ b/packages/feeds-client/src/gen/model-decoders/decoders.ts @@ -1880,6 +1880,26 @@ decoders.UpsertPushPreferencesResponse = (input?: Record) => { return decode(typeMappings, input); }; +decoders.UserBannedEvent = (input?: Record) => { + const typeMappings: TypeMapping = { + created_at: { type: 'DatetimeType', isSingle: true }, + + expiration: { type: 'DatetimeType', isSingle: true }, + + received_at: { type: 'DatetimeType', isSingle: true }, + }; + return decode(typeMappings, input); +}; + +decoders.UserDeactivatedEvent = (input?: Record) => { + const typeMappings: TypeMapping = { + created_at: { type: 'DatetimeType', isSingle: true }, + + received_at: { type: 'DatetimeType', isSingle: true }, + }; + return decode(typeMappings, input); +}; + decoders.UserMuteResponse = (input?: Record) => { const typeMappings: TypeMapping = { created_at: { type: 'DatetimeType', isSingle: true }, @@ -1895,6 +1915,24 @@ decoders.UserMuteResponse = (input?: Record) => { return decode(typeMappings, input); }; +decoders.UserMutedEvent = (input?: Record) => { + const typeMappings: TypeMapping = { + created_at: { type: 'DatetimeType', isSingle: true }, + + received_at: { type: 'DatetimeType', isSingle: true }, + }; + return decode(typeMappings, input); +}; + +decoders.UserReactivatedEvent = (input?: Record) => { + const typeMappings: TypeMapping = { + created_at: { type: 'DatetimeType', isSingle: true }, + + received_at: { type: 'DatetimeType', isSingle: true }, + }; + return decode(typeMappings, input); +}; + decoders.UserResponse = (input?: Record) => { const typeMappings: TypeMapping = { created_at: { type: 'DatetimeType', isSingle: true }, diff --git a/packages/feeds-client/src/gen/model-decoders/event-decoder-mapping.ts b/packages/feeds-client/src/gen/model-decoders/event-decoder-mapping.ts index 17b2add6..3aa4fb2c 100644 --- a/packages/feeds-client/src/gen/model-decoders/event-decoder-mapping.ts +++ b/packages/feeds-client/src/gen/model-decoders/event-decoder-mapping.ts @@ -142,6 +142,16 @@ const eventDecoderMapping: Record< 'moderation.mark_reviewed': (data: Record) => decoders.ModerationMarkReviewedEvent(data), + 'user.banned': (data: Record) => decoders.UserBannedEvent(data), + + 'user.deactivated': (data: Record) => + decoders.UserDeactivatedEvent(data), + + 'user.muted': (data: Record) => decoders.UserMutedEvent(data), + + 'user.reactivated': (data: Record) => + decoders.UserReactivatedEvent(data), + 'user.updated': (data: Record) => decoders.UserUpdatedEvent(data), }; diff --git a/packages/feeds-client/src/gen/models/index.ts b/packages/feeds-client/src/gen/models/index.ts index 8bf6c335..63b503e9 100644 --- a/packages/feeds-client/src/gen/models/index.ts +++ b/packages/feeds-client/src/gen/models/index.ts @@ -5506,6 +5506,42 @@ export interface User { data?: Record; } +export interface UserBannedEvent { + created_at: Date; + + custom: Record; + + user: UserResponseCommonFields; + + type: string; + + channel_id?: string; + + channel_member_count?: number; + + channel_message_count?: number; + + channel_type?: string; + + cid?: string; + + expiration?: Date; + + reason?: string; + + received_at?: Date; + + shadow?: boolean; + + team?: string; + + total_bans?: number; + + channel_custom?: Record; + + created_by?: UserResponseCommonFields; +} + export interface UserCreatedWithinParameters { max_age?: string; } @@ -5516,6 +5552,20 @@ export interface UserCustomPropertyParameters { property_key?: string; } +export interface UserDeactivatedEvent { + created_at: Date; + + custom: Record; + + user: UserResponseCommonFields; + + type: string; + + received_at?: Date; + + created_by?: UserResponseCommonFields; +} + export interface UserIdenticalContentCountParameters { threshold?: number; @@ -5534,6 +5584,36 @@ export interface UserMuteResponse { user?: UserResponse; } +export interface UserMutedEvent { + created_at: Date; + + custom: Record; + + user: UserResponseCommonFields; + + type: string; + + received_at?: Date; + + target_users?: UserResponseCommonFields[]; + + target_user?: UserResponseCommonFields; +} + +export interface UserReactivatedEvent { + created_at: Date; + + custom: Record; + + user: UserResponseCommonFields; + + type: string; + + received_at?: Date; + + created_by?: UserResponseCommonFields; +} + export interface UserRequest { id: string; @@ -5839,6 +5919,10 @@ export type WSClientEvent = | ({ type: 'moderation.custom_action' } & ModerationCustomActionEvent) | ({ type: 'moderation.flagged' } & ModerationFlaggedEvent) | ({ type: 'moderation.mark_reviewed' } & ModerationMarkReviewedEvent) + | ({ type: 'user.banned' } & UserBannedEvent) + | ({ type: 'user.deactivated' } & UserDeactivatedEvent) + | ({ type: 'user.muted' } & UserMutedEvent) + | ({ type: 'user.reactivated' } & UserReactivatedEvent) | ({ type: 'user.updated' } & UserUpdatedEvent); export type WSEvent = @@ -5890,4 +5974,8 @@ export type WSEvent = | ({ type: 'moderation.custom_action' } & ModerationCustomActionEvent) | ({ type: 'moderation.flagged' } & ModerationFlaggedEvent) | ({ type: 'moderation.mark_reviewed' } & ModerationMarkReviewedEvent) + | ({ type: 'user.banned' } & UserBannedEvent) + | ({ type: 'user.deactivated' } & UserDeactivatedEvent) + | ({ type: 'user.muted' } & UserMutedEvent) + | ({ type: 'user.reactivated' } & UserReactivatedEvent) | ({ type: 'user.updated' } & UserUpdatedEvent); From 1cad1d67ce1c155b112243e9acc245ae1e6eff2d Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Thu, 15 Jan 2026 10:06:55 +0100 Subject: [PATCH 3/5] regenerate API --- packages/feeds-client/src/feed/feed.ts | 11 ++++------- packages/feeds-client/src/gen/models/index.ts | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/feeds-client/src/feed/feed.ts b/packages/feeds-client/src/feed/feed.ts index 4a6fe89b..0916a96f 100644 --- a/packages/feeds-client/src/feed/feed.ts +++ b/packages/feeds-client/src/feed/feed.ts @@ -213,10 +213,10 @@ export class Feed extends FeedApi { 'moderation.mark_reviewed': Feed.noop, 'health.check': Feed.noop, 'app.updated': Feed.noop, - // 'user.banned': Feed.noop, - // 'user.deactivated': Feed.noop, - //'user.muted': Feed.noop, - //'user.reactivated': Feed.noop, + 'user.banned': Feed.noop, + 'user.deactivated': Feed.noop, + 'user.muted': Feed.noop, + 'user.reactivated': Feed.noop, 'user.updated': Feed.noop, 'feeds.activity.feedback': handleActivityFeedback.bind(this), }; @@ -493,7 +493,6 @@ export class Feed extends FeedApi { traverseArray.push({ entityId: comment.id, entityParentId: entityId, - // @ts-expect-error open api refactor issue comments: comment.replies, next: comment.meta?.next_cursor, }); @@ -627,7 +626,6 @@ export class Feed extends FeedApi { await this.loadNextPageComments({ entityId: entityId, base: () => - // @ts-expect-error open api refactor issue this.client.getComments({ ...request, sort, @@ -663,7 +661,6 @@ export class Feed extends FeedApi { await this.loadNextPageComments({ entityId: comment.id, base: () => - // @ts-expect-error open api refactor issue this.client.getCommentReplies({ ...request, id: comment.id, diff --git a/packages/feeds-client/src/gen/models/index.ts b/packages/feeds-client/src/gen/models/index.ts index 63b503e9..747facf9 100644 --- a/packages/feeds-client/src/gen/models/index.ts +++ b/packages/feeds-client/src/gen/models/index.ts @@ -5015,7 +5015,7 @@ export interface ThreadedCommentResponse { score: number; - status: string; + status: 'active' | 'deleted' | 'removed' | 'hidden'; updated_at: Date; From 7cfbb05dcd7895e8734f4eb0b9a833270d9e1978 Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Thu, 15 Jan 2026 10:25:57 +0100 Subject: [PATCH 4/5] Adjust sample app --- sample-apps/react-sample-app/app/components/Poll.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample-apps/react-sample-app/app/components/Poll.tsx b/sample-apps/react-sample-app/app/components/Poll.tsx index 775a5d62..50fbcd07 100644 --- a/sample-apps/react-sample-app/app/components/Poll.tsx +++ b/sample-apps/react-sample-app/app/components/Poll.tsx @@ -2,7 +2,7 @@ import React, { useCallback } from 'react'; import type { ActivityResponse, PollState, - PollOption as StreamPollOption, + PollOptionResponseData as StreamPollOption, } from '@stream-io/feeds-react-sdk'; import { useFeedsClient, useStateStore } from '@stream-io/feeds-react-sdk'; import { PollContextProvider, usePollContext } from '@/app/poll-context'; From ec32a36a81a1864ba453bc3df2934bf6fbd1283e Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Fri, 16 Jan 2026 09:23:26 +0100 Subject: [PATCH 5/5] Regenerate open api --- .../docs-snippets/activities.test.ts | 1 - .../docs-snippets/file-uploads.test.ts | 1 - .../__integration-tests__/docs-snippets/stories.test.ts | 1 - .../feeds-client/__integration-tests__/stories.test.ts | 2 -- packages/feeds-client/src/gen/models/index.ts | 8 ++++---- 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/packages/feeds-client/__integration-tests__/docs-snippets/activities.test.ts b/packages/feeds-client/__integration-tests__/docs-snippets/activities.test.ts index c79ec12b..f84ab56b 100644 --- a/packages/feeds-client/__integration-tests__/docs-snippets/activities.test.ts +++ b/packages/feeds-client/__integration-tests__/docs-snippets/activities.test.ts @@ -45,7 +45,6 @@ describe('Activities page', () => { { type: 'image', image_url: 'https://example.com/image.png', - custom: {}, }, ], }); diff --git a/packages/feeds-client/__integration-tests__/docs-snippets/file-uploads.test.ts b/packages/feeds-client/__integration-tests__/docs-snippets/file-uploads.test.ts index 10b59d86..c0f2ca43 100644 --- a/packages/feeds-client/__integration-tests__/docs-snippets/file-uploads.test.ts +++ b/packages/feeds-client/__integration-tests__/docs-snippets/file-uploads.test.ts @@ -78,7 +78,6 @@ describe('File uploads page', () => { return { type: isImage ? 'image' : 'file', [isImage ? 'image_url' : 'asset_url']: response?.file, - custom: {}, }; }), }); diff --git a/packages/feeds-client/__integration-tests__/docs-snippets/stories.test.ts b/packages/feeds-client/__integration-tests__/docs-snippets/stories.test.ts index 15ab7ca2..650c7c69 100644 --- a/packages/feeds-client/__integration-tests__/docs-snippets/stories.test.ts +++ b/packages/feeds-client/__integration-tests__/docs-snippets/stories.test.ts @@ -35,7 +35,6 @@ describe('Stories page', () => { attachments: [ { image_url: 'https://example.com/image.jpg', - custom: {}, }, ], expires_at: tomorrow.toISOString(), diff --git a/packages/feeds-client/__integration-tests__/stories.test.ts b/packages/feeds-client/__integration-tests__/stories.test.ts index cab55734..fe2a93c6 100644 --- a/packages/feeds-client/__integration-tests__/stories.test.ts +++ b/packages/feeds-client/__integration-tests__/stories.test.ts @@ -54,7 +54,6 @@ describe('Stories Feed', () => { { type: 'image', image_url: 'https://example.com/image.png', - custom: {}, }, ], }); @@ -112,7 +111,6 @@ describe('Stories Feed', () => { { type: 'video', image_url: 'https://example.com/video.mp3', - custom: {}, }, ], }), diff --git a/packages/feeds-client/src/gen/models/index.ts b/packages/feeds-client/src/gen/models/index.ts index 747facf9..5aca5bf7 100644 --- a/packages/feeds-client/src/gen/models/index.ts +++ b/packages/feeds-client/src/gen/models/index.ts @@ -795,8 +795,6 @@ export interface AppealResponse { } export interface Attachment { - custom: Record; - asset_url?: string; author_icon?: string; @@ -837,6 +835,8 @@ export interface Attachment { fields?: Field[]; + custom?: Record; + giphy?: Images; } @@ -3044,8 +3044,6 @@ export interface GetFollowSuggestionsResponse { export interface GetOGResponse { duration: string; - custom: Record; - asset_url?: string; author_icon?: string; @@ -3086,6 +3084,8 @@ export interface GetOGResponse { fields?: Field[]; + custom?: Record; + giphy?: Images; }