diff --git a/src/gen/chat/ChatApi.ts b/src/gen/chat/ChatApi.ts index 408a6c7..3a85d25 100644 --- a/src/gen/chat/ChatApi.ts +++ b/src/gen/chat/ChatApi.ts @@ -882,6 +882,7 @@ export class ChatApi extends BaseApi { read_events: request?.read_events, replies: request?.replies, search: request?.search, + shared_locations: request?.shared_locations, skip_last_msg_update_for_system_msgs: request?.skip_last_msg_update_for_system_msgs, typing_events: request?.typing_events, @@ -964,6 +965,7 @@ export class ChatApi extends BaseApi { reminders: request?.reminders, replies: request?.replies, search: request?.search, + shared_locations: request?.shared_locations, skip_last_msg_update_for_system_msgs: request?.skip_last_msg_update_for_system_msgs, typing_events: request?.typing_events, diff --git a/src/gen/common/CommonApi.ts b/src/gen/common/CommonApi.ts index 6a52ad7..cc5b505 100644 --- a/src/gen/common/CommonApi.ts +++ b/src/gen/common/CommonApi.ts @@ -60,6 +60,8 @@ import { ReactivateUsersResponse, Response, RestoreUsersRequest, + SharedLocationResponse, + SharedLocationsResponse, UnblockUsersRequest, UnblockUsersResponse, UpdateAppRequest, @@ -67,6 +69,7 @@ import { UpdateBlockListResponse, UpdateExternalStorageRequest, UpdateExternalStorageResponse, + UpdateLiveLocationRequest, UpdateUsersPartialRequest, UpdateUsersRequest, UpdateUsersResponse, @@ -966,6 +969,45 @@ export class CommonApi extends BaseApi { return { ...response.body, metadata: response.metadata }; }; + getUserLiveLocations = async (request?: { + user_id?: string; + }): Promise> => { + const queryParams = { + user_id: request?.user_id, + }; + + const response = await this.sendRequest< + StreamResponse + >('GET', '/api/v2/users/live_locations', undefined, queryParams); + + decoders.SharedLocationsResponse?.(response.body); + + return { ...response.body, metadata: response.metadata }; + }; + + updateLiveLocation = async ( + request: UpdateLiveLocationRequest & { user_id?: string }, + ): Promise> => { + const queryParams = { + user_id: request?.user_id, + }; + const body = { + created_by_device_id: request?.created_by_device_id, + message_id: request?.message_id, + end_at: request?.end_at, + latitude: request?.latitude, + longitude: request?.longitude, + }; + + const response = await this.sendRequest< + StreamResponse + >('PUT', '/api/v2/users/live_locations', undefined, queryParams, body); + + decoders.SharedLocationResponse?.(response.body); + + return { ...response.body, metadata: response.metadata }; + }; + reactivateUsers = async ( request: ReactivateUsersRequest, ): Promise> => { diff --git a/src/gen/model-decoders/index.ts b/src/gen/model-decoders/index.ts index 002ee56..7ad41d2 100644 --- a/src/gen/model-decoders/index.ts +++ b/src/gen/model-decoders/index.ts @@ -32,24 +32,11 @@ const decode = (typeMappings: TypeMapping, input?: Record) => { return input; }; -decoders.ActionLog = (input?: Record) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - review_queue_item: { type: 'ReviewQueueItem', isSingle: true }, - - target_user: { type: 'User', isSingle: true }, - - user: { type: 'User', isSingle: true }, - }; - return decode(typeMappings, input); -}; - decoders.ActionLogResponse = (input?: Record) => { const typeMappings: TypeMapping = { created_at: { type: 'DatetimeType', isSingle: true }, - review_queue_item: { type: 'ReviewQueueItem', isSingle: true }, + review_queue_item: { type: 'ReviewQueueItemResponse', isSingle: true }, target_user: { type: 'UserResponse', isSingle: true }, @@ -137,84 +124,6 @@ decoders.BlockedUserResponse = (input?: Record) => { return decode(typeMappings, input); }; -decoders.Call = (input?: Record) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - blocked_users: { type: 'User', isSingle: false }, - - egresses: { type: 'CallEgress', isSingle: false }, - - members: { type: 'CallMember', isSingle: false }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - - egress_updated_at: { type: 'DatetimeType', isSingle: true }, - - ended_at: { type: 'DatetimeType', isSingle: true }, - - last_heartbeat_at: { type: 'DatetimeType', isSingle: true }, - - starts_at: { type: 'DatetimeType', isSingle: true }, - - call_type: { type: 'CallType', isSingle: true }, - - created_by: { type: 'User', isSingle: true }, - - session: { type: 'CallSession', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders.CallEgress = (input?: Record) => { - const typeMappings: TypeMapping = { - started_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - stopped_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders.CallMember = (input?: Record) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - - user: { type: 'User', isSingle: true }, - }; - return decode(typeMappings, input); -}; - -decoders.CallParticipant = (input?: Record) => { - const typeMappings: TypeMapping = { - joined_at: { type: 'DatetimeType', isSingle: true }, - - 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.CallParticipantResponse = (input?: Record) => { const typeMappings: TypeMapping = { joined_at: { type: 'DatetimeType', isSingle: true }, @@ -259,37 +168,6 @@ decoders.CallResponse = (input?: Record) => { return decode(typeMappings, input); }; -decoders.CallSession = (input?: Record) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - active_sf_us: { type: 'SFUIDLastSeen', isSingle: false }, - - participants: { type: 'CallParticipant', isSingle: false }, - - accepted_by: { type: 'DatetimeType', isSingle: false }, - - missed_by: { type: 'DatetimeType', isSingle: false }, - - rejected_by: { type: 'DatetimeType', isSingle: false }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - - ended_at: { type: 'DatetimeType', isSingle: true }, - - live_ended_at: { type: 'DatetimeType', isSingle: true }, - - live_started_at: { type: 'DatetimeType', isSingle: true }, - - ring_at: { type: 'DatetimeType', isSingle: true }, - - started_at: { type: 'DatetimeType', isSingle: true }, - - timer_ends_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - decoders.CallSessionResponse = (input?: Record) => { const typeMappings: TypeMapping = { participants: { type: 'CallParticipantResponse', isSingle: false }, @@ -398,6 +276,8 @@ decoders.Channel = (input?: Record) => { last_message_at: { type: 'DatetimeType', isSingle: true }, + active_live_locations: { type: 'SharedLocation', isSingle: false }, + invites: { type: 'ChannelMember', isSingle: false }, members: { type: 'ChannelMember', isSingle: false }, @@ -538,6 +418,11 @@ decoders.ChannelStateResponse = (input?: Record) => { hide_messages_before: { type: 'DatetimeType', isSingle: true }, + active_live_locations: { + type: 'SharedLocationResponseData', + isSingle: false, + }, + pending_messages: { type: 'PendingMessageResponse', isSingle: false }, read: { type: 'ReadStateResponse', isSingle: false }, @@ -567,6 +452,11 @@ decoders.ChannelStateResponseFields = (input?: Record) => { hide_messages_before: { type: 'DatetimeType', isSingle: true }, + active_live_locations: { + type: 'SharedLocationResponseData', + isSingle: false, + }, + pending_messages: { type: 'PendingMessageResponse', isSingle: false }, read: { type: 'ReadStateResponse', isSingle: false }, @@ -604,7 +494,7 @@ decoders.ChatActivityStatsResponse = (input?: Record) => { decoders.CheckResponse = (input?: Record) => { const typeMappings: TypeMapping = { - item: { type: 'ReviewQueueItem', isSingle: true }, + item: { type: 'ReviewQueueItemResponse', isSingle: true }, }; return decode(typeMappings, input); }; @@ -774,27 +664,6 @@ decoders.EgressRTMPResponse = (input?: Record) => { return decode(typeMappings, input); }; -decoders.EntityCreator = (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.EntityCreatorResponse = (input?: Record) => { const typeMappings: TypeMapping = { created_at: { type: 'DatetimeType', isSingle: true }, @@ -848,19 +717,6 @@ decoders.ExportUserResponse = (input?: Record) => { return decode(typeMappings, input); }; -decoders.Flag = (input?: Record) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - review_queue_item: { type: 'ReviewQueueItem', isSingle: true }, - - user: { type: 'User', isSingle: true }, - }; - return decode(typeMappings, input); -}; - decoders.FlagDetails = (input?: Record) => { const typeMappings: TypeMapping = { automod: { type: 'AutomodDetails', isSingle: true }, @@ -900,6 +756,15 @@ decoders.FullUserResponse = (input?: Record) => { return decode(typeMappings, input); }; +decoders.GetActiveCallsStatusResponse = (input?: Record) => { + const typeMappings: TypeMapping = { + end_time: { type: 'DatetimeType', isSingle: true }, + + start_time: { type: 'DatetimeType', isSingle: true }, + }; + return decode(typeMappings, input); +}; + decoders.GetApplicationResponse = (input?: Record) => { const typeMappings: TypeMapping = { app: { type: 'AppResponseFields', isSingle: true }, @@ -1217,6 +1082,8 @@ decoders.Message = (input?: Record) => { reminder: { type: 'MessageReminder', isSingle: true }, + shared_location: { type: 'SharedLocation', isSingle: true }, + user: { type: 'User', isSingle: true }, }; return decode(typeMappings, input); @@ -1330,6 +1197,8 @@ decoders.MessageResponse = (input?: Record) => { reaction_groups: { type: 'ReactionGroupResponse', isSingle: false }, reminder: { type: 'ReminderResponseData', isSingle: true }, + + shared_location: { type: 'SharedLocationResponseData', isSingle: true }, }; return decode(typeMappings, input); }; @@ -1378,13 +1247,15 @@ decoders.MessageWithChannelResponse = (input?: Record) => { reaction_groups: { type: 'ReactionGroupResponse', isSingle: false }, reminder: { type: 'ReminderResponseData', isSingle: true }, + + shared_location: { type: 'SharedLocationResponseData', isSingle: true }, }; return decode(typeMappings, input); }; decoders.ModerationFlagResponse = (input?: Record) => { const typeMappings: TypeMapping = { - review_queue_item: { type: 'ReviewQueueItem', isSingle: true }, + review_queue_item: { type: 'ReviewQueueItemResponse', isSingle: true }, user: { type: 'UserResponse', isSingle: true }, }; @@ -1846,33 +1717,6 @@ decoders.ReminderResponseData = (input?: Record) => { return decode(typeMappings, input); }; -decoders.ReviewQueueItem = (input?: Record) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - actions: { type: 'ActionLog', isSingle: false }, - - bans: { type: 'Ban', isSingle: false }, - - flags: { type: 'Flag', isSingle: false }, - - assigned_to: { type: 'User', isSingle: true }, - - call: { type: 'Call', isSingle: true }, - - entity_creator: { type: 'EntityCreator', isSingle: true }, - - feeds_v2_reaction: { type: 'Reaction', isSingle: true }, - - message: { type: 'Message', isSingle: true }, - - reaction: { type: 'Reaction', isSingle: true }, - }; - return decode(typeMappings, input); -}; - decoders.ReviewQueueItemResponse = (input?: Record) => { const typeMappings: TypeMapping = { created_at: { type: 'DatetimeType', isSingle: true }, @@ -1911,13 +1755,6 @@ decoders.Role = (input?: Record) => { return decode(typeMappings, input); }; -decoders.SFUIDLastSeen = (input?: Record) => { - const typeMappings: TypeMapping = { - last_seen: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - decoders.SearchResult = (input?: Record) => { const typeMappings: TypeMapping = { message: { type: 'SearchResultMessage', isSingle: true }, @@ -1962,6 +1799,8 @@ decoders.SearchResultMessage = (input?: Record) => { reaction_groups: { type: 'ReactionGroupResponse', isSingle: false }, reminder: { type: 'ReminderResponseData', isSingle: true }, + + shared_location: { type: 'SharedLocationResponseData', isSingle: true }, }; return decode(typeMappings, input); }; @@ -2011,6 +1850,61 @@ decoders.SendReactionResponse = (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 }, + + updated_at: { type: 'DatetimeType', isSingle: true }, + + end_at: { type: 'DatetimeType', isSingle: true }, + + channel: { type: 'ChannelResponse', isSingle: true }, + + message: { type: 'MessageResponse', isSingle: true }, + }; + return decode(typeMappings, input); +}; + +decoders.SharedLocationResponseData = (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: 'ChannelResponse', isSingle: true }, + + message: { type: 'MessageResponse', isSingle: true }, + }; + return decode(typeMappings, input); +}; + +decoders.SharedLocationsResponse = (input?: Record) => { + const typeMappings: TypeMapping = { + active_live_locations: { + type: 'SharedLocationResponseData', + isSingle: false, + }, + }; + return decode(typeMappings, input); +}; + decoders.StopLiveResponse = (input?: Record) => { const typeMappings: TypeMapping = { call: { type: 'CallResponse', isSingle: true }, @@ -2020,7 +1914,7 @@ decoders.StopLiveResponse = (input?: Record) => { decoders.SubmitActionResponse = (input?: Record) => { const typeMappings: TypeMapping = { - item: { type: 'ReviewQueueItem', isSingle: true }, + item: { type: 'ReviewQueueItemResponse', isSingle: true }, }; return decode(typeMappings, input); }; diff --git a/src/gen/models/index.ts b/src/gen/models/index.ts index b746d0e..4cdfa6d 100644 --- a/src/gen/models/index.ts +++ b/src/gen/models/index.ts @@ -169,7 +169,7 @@ export interface ActionLogResponse { custom: Record; - review_queue_item?: ReviewQueueItem; + review_queue_item?: ReviewQueueItemResponse; target_user?: UserResponse; @@ -192,6 +192,40 @@ export interface ActionSequence { warning_text: string; } +export interface ActiveCallsFPSStats { + p05: number; + + p10: number; + + p50: number; + + p90: number; +} + +export interface ActiveCallsLatencyStats { + p50: number; + + p90: number; +} + +export interface ActiveCallsMetrics { + join_call_api?: JoinCallAPIMetrics; + + publishers?: PublishersMetrics; + + subscribers?: SubscribersMetrics; +} + +export interface ActiveCallsSummary { + active_calls: number; + + active_publishers: number; + + active_subscribers: number; + + participants: number; +} + export interface AnyEvent { created_at: Date; @@ -413,10 +447,6 @@ export interface Attachment { image_url?: string; - latitude?: number; - - longitude?: number; - og_scrape_url?: string; original_height?: number; @@ -425,8 +455,6 @@ export interface Attachment { pretext?: string; - stopped_sharing?: boolean; - text?: string; thumb_url?: string; @@ -608,6 +636,16 @@ export interface BanActionRequest { timeout?: number; } +export interface BanOptions { + duration: number; + + ip_ban: boolean; + + reason: string; + + shadow_ban: boolean; +} + export interface BanRequest { target_user_id: string; @@ -644,6 +682,10 @@ export interface BanResponse { user?: UserResponse; } +export interface BlockContentOptions { + reason: string; +} + export interface BlockListConfig { enabled: boolean; @@ -2010,6 +2052,8 @@ export interface Channel { team?: string; + active_live_locations?: SharedLocation[]; + invites?: ChannelMember[]; members?: ChannelMember[]; @@ -2058,6 +2102,8 @@ export interface ChannelConfig { search: boolean; + shared_locations: boolean; + skip_last_msg_update_for_system_msgs: boolean; typing_events: boolean; @@ -2122,6 +2168,8 @@ export interface ChannelConfigWithInfo { search: boolean; + shared_locations: boolean; + skip_last_msg_update_for_system_msgs: boolean; typing_events: boolean; @@ -2394,6 +2442,7 @@ export const ChannelOwnCapability = { SEND_RESTRICTED_VISIBILITY_MESSAGE: 'send-restricted-visibility-message', SEND_TYPING_EVENTS: 'send-typing-events', SET_CHANNEL_COOLDOWN: 'set-channel-cooldown', + SHARE_LOCATION: 'share-location', SKIP_SLOW_MODE: 'skip-slow-mode', SLOW_MODE: 'slow-mode', TYPING_EVENTS: 'typing-events', @@ -2486,6 +2535,8 @@ export interface ChannelStateResponse { watcher_count?: number; + active_live_locations?: SharedLocationResponseData[]; + pending_messages?: PendingMessageResponse[]; read?: ReadStateResponse[]; @@ -2516,6 +2567,8 @@ export interface ChannelStateResponseFields { watcher_count?: number; + active_live_locations?: SharedLocationResponseData[]; + pending_messages?: PendingMessageResponse[]; read?: ReadStateResponse[]; @@ -2582,6 +2635,8 @@ export interface ChannelTypeConfig { search: boolean; + shared_locations: boolean; + skip_last_msg_update_for_system_msgs: boolean; typing_events: boolean; @@ -2755,7 +2810,7 @@ export interface CheckResponse { task_id?: string; - item?: ReviewQueueItem; + item?: ReviewQueueItemResponse; } export interface CheckSNSRequest { @@ -2869,6 +2924,8 @@ export interface ConfigOverrides { replies?: boolean; + shared_locations?: boolean; + typing_events?: boolean; uploads?: boolean; @@ -2903,11 +2960,19 @@ export interface ConfigResponse { block_list_config?: BlockListConfig; + rule_builder_config?: RuleBuilderConfig; + velocity_filter_config?: VelocityFilterConfig; video_call_rule_config?: VideoCallRuleConfig; } +export interface ContentCountRuleParameters { + threshold: number; + + time_window: string; +} + export interface CountByMinuteResponse { count: number; @@ -2999,6 +3064,8 @@ export interface CreateChannelTypeRequest { search?: boolean; + shared_locations?: boolean; + skip_last_msg_update_for_system_msgs?: boolean; typing_events?: boolean; @@ -3055,6 +3122,8 @@ export interface CreateChannelTypeResponse { search: boolean; + shared_locations: boolean; + skip_last_msg_update_for_system_msgs: boolean; typing_events: boolean; @@ -4039,37 +4108,37 @@ export interface FirebaseConfigFields { export interface Flag { created_at: Date; - entity_id: string; - - entity_type: string; + created_by_automod: boolean; updated_at: Date; - result: Array>; - - entity_creator_id?: string; - - is_streamed_content?: boolean; - - moderation_payload_hash?: string; + approved_at?: Date; reason?: string; - review_queue_item_id?: string; + rejected_at?: Date; - type?: string; + reviewed_at?: Date; - labels?: string[]; + reviewed_by?: string; + + target_message_id?: string; custom?: Record; - moderation_payload?: ModerationPayload; + details?: FlagDetails; - review_queue_item?: ReviewQueueItem; + target_message?: Message; + + target_user?: User; user?: User; } +export interface FlagContentOptions { + reason: string; +} + export interface FlagDetails { original_text: string; @@ -4136,6 +4205,10 @@ export interface FlagUpdatedEvent { user?: UserResponse; } +export interface FlagUserOptions { + reason: string; +} + export interface FrameRecordSettings { capture_interval_in_seconds: number; @@ -4256,6 +4329,18 @@ export interface GeofenceSettingsResponse { names: string[]; } +export interface GetActiveCallsStatusResponse { + duration: string; + + end_time: Date; + + start_time: Date; + + metrics?: ActiveCallsMetrics; + + summary?: ActiveCallsSummary; +} + export interface GetApplicationResponse { duration: string; @@ -4359,6 +4444,8 @@ export interface GetChannelTypeResponse { search: boolean; + shared_locations: boolean; + skip_last_msg_update_for_system_msgs: boolean; typing_events: boolean; @@ -4475,10 +4562,6 @@ export interface GetOGResponse { image_url?: string; - latitude?: number; - - longitude?: number; - og_scrape_url?: string; original_height?: number; @@ -4487,8 +4570,6 @@ export interface GetOGResponse { pretext?: string; - stopped_sharing?: boolean; - text?: string; thumb_url?: string; @@ -4698,6 +4779,10 @@ export interface HuaweiConfigFields { secret?: string; } +export interface ImageContentParameters { + harm_labels?: string[]; +} + export interface ImageData { frames: string; @@ -4710,6 +4795,14 @@ export interface ImageData { width: string; } +export interface ImageRuleParameters { + threshold: number; + + time_window: string; + + harm_labels?: string[]; +} + export interface ImageSize { crop?: 'top' | 'bottom' | 'left' | 'right' | 'center'; @@ -4780,6 +4873,14 @@ export interface ImportTaskHistory { prev_state: string; } +export interface JoinCallAPIMetrics { + failures: number; + + total: number; + + latency?: ActiveCallsLatencyStats; +} + export interface Label { name: string; @@ -4839,21 +4940,33 @@ export interface LimitInfo { } export interface LimitsSettings { + max_participants_exclude_roles: string[]; + max_duration_seconds?: number; max_participants?: number; + + max_participants_exclude_owner?: boolean; } export interface LimitsSettingsRequest { max_duration_seconds?: number; max_participants?: number; + + max_participants_exclude_owner?: boolean; + + max_participants_exclude_roles?: string[]; } export interface LimitsSettingsResponse { + max_participants_exclude_roles: string[]; + max_duration_seconds?: number; max_participants?: number; + + max_participants_exclude_owner?: boolean; } export interface ListBlockListResponse { @@ -5135,6 +5248,8 @@ export interface Message { reminder?: MessageReminder; + shared_location?: SharedLocation; + user?: User; } @@ -5383,6 +5498,8 @@ export interface MessageRequest { custom?: Record; + shared_location?: SharedLocation; + user?: UserRequest; } @@ -5468,6 +5585,8 @@ export interface MessageResponse { reaction_groups?: Record; reminder?: ReminderResponseData; + + shared_location?: SharedLocationResponseData; } export interface MessageStatsResponse { @@ -5618,6 +5737,8 @@ export interface MessageWithChannelResponse { reaction_groups?: Record; reminder?: ReminderResponseData; + + shared_location?: SharedLocationResponseData; } export interface ModerationActionConfig { @@ -5665,6 +5786,8 @@ export interface ModerationCustomActionEvent { } export interface ModerationDashboardPreferences { + flag_user_on_flagged_content?: boolean; + media_queue_blur_enabled?: boolean; } @@ -5695,7 +5818,7 @@ export interface ModerationFlagResponse { moderation_payload?: ModerationPayload; - review_queue_item?: ReviewQueueItem; + review_queue_item?: ReviewQueueItemResponse; user?: UserResponse; } @@ -5973,6 +6096,8 @@ export interface OwnUser { custom: Record; + total_unread_count_by_team: Record; + deactivated_at?: Date; deleted_at?: Date; @@ -6052,6 +6177,8 @@ export interface OwnUserResponse { push_preferences?: PushPreferences; teams_role?: Record; + + total_unread_count_by_team?: Record; } export interface PagerResponse { @@ -6104,6 +6231,26 @@ export interface ParticipantReportResponse { subscribers?: SubscriberStatsResponse; } +export interface PendingMessageEvent { + created_at: Date; + + method: string; + + custom: Record; + + type: string; + + received_at?: Date; + + channel?: Channel; + + message?: Message; + + metadata?: Record; + + user?: User; +} + export interface PendingMessageResponse { channel?: ChannelResponse; @@ -6402,6 +6549,18 @@ export interface PrivacySettingsResponse { typing_indicators?: TypingIndicatorsResponse; } +export interface PublisherAllMetrics { + audio?: PublisherAudioMetrics; + + rtt_ms?: ActiveCallsLatencyStats; + + video?: PublisherVideoMetrics; +} + +export interface PublisherAudioMetrics { + jitter_ms?: ActiveCallsLatencyStats; +} + export interface PublisherStatsResponse { total: number; @@ -6410,6 +6569,18 @@ export interface PublisherStatsResponse { by_track?: TrackStatsResponse[]; } +export interface PublisherVideoMetrics { + fps_30?: ActiveCallsFPSStats; + + frame_encoding_time_ms?: ActiveCallsLatencyStats; + + jitter_ms?: ActiveCallsLatencyStats; +} + +export interface PublishersMetrics { + all?: PublisherAllMetrics; +} + export interface PushConfig { version: 'v1' | 'v2' | 'v3'; @@ -6439,6 +6610,8 @@ export interface PushNotificationSettingsResponse { } export interface PushPreferenceInput { + call_level?: 'all' | 'none' | 'default'; + channel_cid?: string; chat_level?: 'all' | 'mentions' | 'none' | 'default'; @@ -7625,6 +7798,8 @@ export interface ReviewQueueItem { teams: string[]; + completed_at: NullTime; + reviewed_at: NullTime; activity?: EnrichedActivity; @@ -7775,45 +7950,71 @@ export interface Role { } export interface RuleBuilderAction { - duration?: number; + type: string; - ip_ban?: boolean; + ban_options?: BanOptions; - reason?: string; + flag_content_options?: FlagContentOptions; - shadow_ban?: boolean; + flag_user_options?: FlagUserOptions; - type?: string; + remove_content_options?: BlockContentOptions; } export interface RuleBuilderCondition { - provider?: string; + type: string; - threshold?: number; + confidence?: number; - time_window?: string; + content_count_rule_params?: ContentCountRuleParameters; - labels?: string[]; + image_content_params?: ImageContentParameters; + + image_rule_params?: ImageRuleParameters; + + text_content_params?: TextContentParameters; + + text_rule_params?: TextRuleParameters; + + user_created_within_params?: UserCreatedWithinParameters; + + user_rule_params?: UserRuleParameters; + + video_content_params?: VideoContentParameters; + + video_rule_params?: VideoRuleParameters; } -export interface RuleBuilderConfig { - async?: boolean; +export interface RuleBuilderConditionGroup { + logic: string; - enabled?: boolean; + conditions: RuleBuilderCondition[]; +} - rules?: RuleBuilderRule[]; +export interface RuleBuilderConfig { + rules: RuleBuilderRule[]; + + async?: boolean; } export interface RuleBuilderRule { - enabled?: boolean; + enabled: boolean; - id?: string; + id: string; - name?: string; + name: string; + + rule_type: string; + + action: RuleBuilderAction; + + cooldown_period?: string; + + logic?: string; conditions?: RuleBuilderCondition[]; - action?: RuleBuilderAction; + groups?: RuleBuilderConditionGroup[]; } export interface S3Request { @@ -8002,6 +8203,8 @@ export interface SearchResultMessage { reaction_groups?: Record; reminder?: ReminderResponseData; + + shared_location?: SharedLocationResponseData; } export interface SearchWarning { @@ -8148,6 +8351,86 @@ export interface SessionSettingsResponse { export interface ShadowBlockActionRequest {} +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; + + created_at: Date; + + created_by_device_id: string; + + duration: string; + + latitude: number; + + longitude: number; + + message_id: string; + + updated_at: Date; + + user_id: string; + + end_at?: Date; + + channel?: ChannelResponse; + + message?: MessageResponse; +} + +export interface SharedLocationResponseData { + channel_cid: string; + + created_at: Date; + + created_by_device_id: string; + + latitude: number; + + longitude: number; + + message_id: string; + + updated_at: Date; + + user_id: string; + + end_at?: Date; + + channel?: ChannelResponse; + + message?: MessageResponse; +} + +export interface SharedLocationsResponse { + duration: string; + + active_live_locations: SharedLocationResponseData[]; +} + export interface ShowChannelRequest { user_id?: string; @@ -8422,7 +8705,23 @@ export interface SubmitActionRequest { export interface SubmitActionResponse { duration: string; - item?: ReviewQueueItem; + item?: ReviewQueueItemResponse; +} + +export interface SubscriberAllMetrics { + audio?: SubscriberAudioMetrics; + + rtt_ms?: ActiveCallsLatencyStats; + + video?: SubscriberVideoMetrics; +} + +export interface SubscriberAudioMetrics { + concealment_pct?: ActiveCallsLatencyStats; + + jitter_ms?: ActiveCallsLatencyStats; + + packets_lost_pct?: ActiveCallsLatencyStats; } export interface SubscriberStatsResponse { @@ -8433,6 +8732,18 @@ export interface SubscriberStatsResponse { unique: number; } +export interface SubscriberVideoMetrics { + fps_30?: ActiveCallsFPSStats; + + jitter_ms?: ActiveCallsLatencyStats; + + packets_lost_pct?: ActiveCallsLatencyStats; +} + +export interface SubscribersMetrics { + all?: SubscriberAllMetrics; +} + export interface TargetResolution { bitrate: number; @@ -8441,6 +8752,30 @@ export interface TargetResolution { width: number; } +export interface TextContentParameters { + contains_url?: boolean; + + severity?: string; + + blocklist_match?: string[]; + + harm_labels?: string[]; +} + +export interface TextRuleParameters { + threshold: number; + + time_window: string; + + contains_url?: boolean; + + severity?: string; + + blocklist_match?: string[]; + + harm_labels?: string[]; +} + export interface ThreadParticipant { app_pk: number; @@ -8927,6 +9262,8 @@ export interface UnreadCountsResponse { channels: UnreadCountsChannel[]; threads: UnreadCountsThread[]; + + total_unread_count_by_team: Record; } export interface UnreadCountsThread { @@ -9200,6 +9537,8 @@ export interface UpdateChannelTypeRequest { search?: boolean; + shared_locations?: boolean; + skip_last_msg_update_for_system_msgs?: boolean; typing_events?: boolean; @@ -9260,6 +9599,8 @@ export interface UpdateChannelTypeResponse { search: boolean; + shared_locations: boolean; + skip_last_msg_update_for_system_msgs: boolean; typing_events: boolean; @@ -9333,6 +9674,18 @@ export interface UpdateExternalStorageResponse { type: 's3' | 'gcs' | 'abs'; } +export interface UpdateLiveLocationRequest { + created_by_device_id: string; + + message_id: string; + + end_at?: Date; + + latitude?: number; + + longitude?: number; +} + export interface UpdateMemberPartialRequest { unset?: string[]; @@ -9680,6 +10033,10 @@ export interface UserBannedEvent { user?: User; } +export interface UserCreatedWithinParameters { + max_age?: string; +} + export interface UserCustomEventRequest { type: string; @@ -9948,6 +10305,10 @@ export interface UserResponsePrivacyFields { teams_role?: Record; } +export interface UserRuleParameters { + max_age?: string; +} + export interface UserUnbannedEvent { channel_id: string; @@ -10050,6 +10411,10 @@ export interface VideoCallRuleConfig { rules: Record; } +export interface VideoContentParameters { + harm_labels?: string[]; +} + export interface VideoEndCallRequest {} export interface VideoKickUserRequest {} @@ -10068,6 +10433,14 @@ export interface VideoReactionsResponse { count_over_time?: VideoReactionOverTimeResponse; } +export interface VideoRuleParameters { + threshold: number; + + time_window: string; + + harm_labels?: string[]; +} + export interface VideoSettings { access_request_enabled: boolean; @@ -10184,6 +10557,8 @@ export interface WrappedUnreadCountsResponse { channels: UnreadCountsChannel[]; threads: UnreadCountsThread[]; + + total_unread_count_by_team: Record; } export interface XiaomiConfig { diff --git a/src/gen/video/VideoApi.ts b/src/gen/video/VideoApi.ts index 1beca82..e03b051 100644 --- a/src/gen/video/VideoApi.ts +++ b/src/gen/video/VideoApi.ts @@ -12,6 +12,7 @@ import { DeleteRecordingResponse, DeleteTranscriptionResponse, EndCallResponse, + GetActiveCallsStatusResponse, GetCallReportResponse, GetCallResponse, GetCallTypeResponse, @@ -81,6 +82,18 @@ import { import { decoders } from '../model-decoders'; export class VideoApi extends BaseApi { + getActiveCallsStatus = async (): Promise< + StreamResponse + > => { + const response = await this.sendRequest< + StreamResponse + >('GET', '/api/v2/video/active_calls_status', undefined, undefined); + + decoders.GetActiveCallsStatusResponse?.(response.body); + + return { ...response.body, metadata: response.metadata }; + }; + queryUserFeedback = async ( request?: QueryUserFeedbackRequest & { full?: boolean }, ): Promise> => {