From 69ffa9d8ef2260a77a84c206554e9ba2588eea3e Mon Sep 17 00:00:00 2001 From: Oliver Lazoroski Date: Thu, 10 Apr 2025 12:35:36 +0200 Subject: [PATCH 1/6] feat: ring individual members --- src/StreamCall.ts | 9 +++++++++ src/gen/model-decoders/index.ts | 2 ++ src/gen/models/index.ts | 22 ++++++++++++++++++++++ src/gen/video/CallApi.ts | 7 ++++--- src/gen/video/VideoApi.ts | 12 +++++++----- 5 files changed, 44 insertions(+), 8 deletions(-) diff --git a/src/StreamCall.ts b/src/StreamCall.ts index d7b16f6..a35e730 100644 --- a/src/StreamCall.ts +++ b/src/StreamCall.ts @@ -9,6 +9,15 @@ export class StreamCall extends CallApi { create = this.getOrCreate; + ring = (params: { member_ids?: string[] }) => { + return this.videoApi.getCall({ + ...params, + id: this.id, + type: this.type, + ring: true, + }); + }; + queryMembers = (request?: OmitTypeId) => { return this.videoApi.queryCallMembers({ id: this.id, diff --git a/src/gen/model-decoders/index.ts b/src/gen/model-decoders/index.ts index d2d654d..5fa8378 100644 --- a/src/gen/model-decoders/index.ts +++ b/src/gen/model-decoders/index.ts @@ -181,6 +181,8 @@ decoders.CallResponse = (input?: Record) => { decoders.CallSessionResponse = (input?: Record) => { const typeMappings: TypeMapping = { + created_at: { type: 'DatetimeType', isSingle: true }, + participants: { type: 'CallParticipantResponse', isSingle: false }, accepted_by: { type: 'DatetimeType', isSingle: false }, diff --git a/src/gen/models/index.ts b/src/gen/models/index.ts index bd82397..6d33e33 100644 --- a/src/gen/models/index.ts +++ b/src/gen/models/index.ts @@ -1,6 +1,8 @@ export interface AIImageConfig { enabled: boolean; + ocr_rules: OCRRule[]; + rules: AWSRekognitionRule[]; async?: boolean; @@ -1303,6 +1305,8 @@ export interface CallSessionParticipantLeftEvent { export interface CallSessionResponse { anonymous_participant_count: number; + created_at: Date; + id: string; participants: CallParticipantResponse[]; @@ -1641,6 +1645,8 @@ export interface CampaignResponse { sender_mode: string; + show_channels: boolean; + skip_push: boolean; skip_webhook: boolean; @@ -5430,6 +5436,18 @@ export interface NotificationSettings { export interface NullTime {} +export interface OCRRule { + action: + | 'flag' + | 'shadow' + | 'remove' + | 'bounce' + | 'bounce_flag' + | 'bounce_remove'; + + label: string; +} + export interface OnlyUserID { id: string; } @@ -6941,6 +6959,8 @@ export interface ReviewQueueItem { bounce_count: number; + config_key: string; + content_changed: boolean; created_at: Date; @@ -7049,6 +7069,8 @@ export interface ReviewQueueItemResponse { completed_at?: Date; + config_key?: string; + entity_creator_id?: string; reviewed_at?: Date; diff --git a/src/gen/video/CallApi.ts b/src/gen/video/CallApi.ts index badb928..578a1bb 100644 --- a/src/gen/video/CallApi.ts +++ b/src/gen/video/CallApi.ts @@ -30,10 +30,10 @@ import { StartFrameRecordingRequest, StartFrameRecordingResponse, StartHLSBroadcastingResponse, - StartRTMPBroadcastsRequest, - StartRTMPBroadcastsResponse, StartRecordingRequest, StartRecordingResponse, + StartRTMPBroadcastsRequest, + StartRTMPBroadcastsResponse, StartTranscriptionRequest, StartTranscriptionResponse, StopAllRTMPBroadcastsResponse, @@ -43,9 +43,9 @@ import { StopHLSBroadcastingResponse, StopLiveRequest, StopLiveResponse, + StopRecordingResponse, StopRTMPBroadcastsRequest, StopRTMPBroadcastsResponse, - StopRecordingResponse, StopTranscriptionRequest, StopTranscriptionResponse, UnblockUserRequest, @@ -72,6 +72,7 @@ export class CallApi { ring?: boolean; notify?: boolean; video?: boolean; + member_ids?: string[]; }): Promise> => { return this.videoApi.getCall({ id: this.id, type: this.type, ...request }); }; diff --git a/src/gen/video/VideoApi.ts b/src/gen/video/VideoApi.ts index c12154e..6fcaf6a 100644 --- a/src/gen/video/VideoApi.ts +++ b/src/gen/video/VideoApi.ts @@ -32,10 +32,10 @@ import { QueryAggregateCallStatsResponse, QueryCallMembersRequest, QueryCallMembersResponse, - QueryCallStatsRequest, - QueryCallStatsResponse, QueryCallsRequest, QueryCallsResponse, + QueryCallStatsRequest, + QueryCallStatsResponse, QueryUserFeedbackRequest, QueryUserFeedbackResponse, Response, @@ -46,10 +46,10 @@ import { StartFrameRecordingRequest, StartFrameRecordingResponse, StartHLSBroadcastingResponse, - StartRTMPBroadcastsRequest, - StartRTMPBroadcastsResponse, StartRecordingRequest, StartRecordingResponse, + StartRTMPBroadcastsRequest, + StartRTMPBroadcastsResponse, StartTranscriptionRequest, StartTranscriptionResponse, StopAllRTMPBroadcastsResponse, @@ -59,9 +59,9 @@ import { StopHLSBroadcastingResponse, StopLiveRequest, StopLiveResponse, + StopRecordingResponse, StopRTMPBroadcastsRequest, StopRTMPBroadcastsResponse, - StopRecordingResponse, StopTranscriptionRequest, StopTranscriptionResponse, UnblockUserRequest, @@ -152,12 +152,14 @@ export class VideoApi extends BaseApi { ring?: boolean; notify?: boolean; video?: boolean; + member_ids?: string[]; }): Promise> => { const queryParams = { members_limit: request?.members_limit, ring: request?.ring, notify: request?.notify, video: request?.video, + member_ids: request?.member_ids, }; const pathParams = { type: request?.type, From d35a633bfa9d987d287e9326076a8fe2f61f8bcf Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Fri, 11 Apr 2025 11:15:55 +0200 Subject: [PATCH 2/6] add ring call tests --- __tests__/ring-call.test.ts | 66 +++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 __tests__/ring-call.test.ts diff --git a/__tests__/ring-call.test.ts b/__tests__/ring-call.test.ts new file mode 100644 index 0000000..42bc04b --- /dev/null +++ b/__tests__/ring-call.test.ts @@ -0,0 +1,66 @@ +import { beforeAll, describe, expect, it } from 'vitest'; +import { createTestClient } from './create-test-client'; +import { StreamCall } from '../src/StreamCall'; +import { StreamClient } from '../src/StreamClient'; + +describe('ring call API', () => { + let client: StreamClient; + const callId = `call${crypto.randomUUID()}`; + let call: StreamCall; + + beforeAll(async () => { + client = createTestClient(); + + call = client.video.call('default', callId); + + await client.upsertUsers([ + { id: 'myself' }, + { id: 'my-friend' }, + { id: 'my-other-friend' }, + ]); + }); + + it(`create call without ringing`, async () => { + const response = await call.getOrCreate({ + ring: false, // set to false to avoid ringing the whole call + data: { + created_by_id: 'myself', + members: [{ user_id: 'myself' }, { user_id: 'my-friend' }], + }, + }); + + // Dummy expect + expect(response.call.id).toBe(callId); + }); + + it(`ring my-friend`, async () => { + const response = await call.ring({ member_ids: ['my-friend'] }); + + // Dummy expect + expect(response.call.id).toBe(callId); + }); + + it(`ring my-other-friend`, async () => { + await call.updateCallMembers({ + update_members: [{ user_id: 'my-other-friend' }], + }); + const response = await call.ring({ member_ids: ['my-other-friend'] }); + + // Dummy expect + expect(response.call.id).toBe(callId); + }); + + it('delete call', async () => { + try { + await call.delete({ hard: true }); + } catch (e) { + // the first request fails on backend sometimes + // retry it + await new Promise((resolve) => { + setTimeout(() => resolve(), 2000); + }); + + await call.delete({ hard: true }); + } + }); +}); From d79d25ca7aa42cd487270a56669c6306db65e1c8 Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Fri, 11 Apr 2025 15:13:53 +0200 Subject: [PATCH 3/6] fix node 18 uuid issue --- __tests__/ring-call.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/__tests__/ring-call.test.ts b/__tests__/ring-call.test.ts index 42bc04b..e6235fc 100644 --- a/__tests__/ring-call.test.ts +++ b/__tests__/ring-call.test.ts @@ -2,10 +2,11 @@ import { beforeAll, describe, expect, it } from 'vitest'; import { createTestClient } from './create-test-client'; import { StreamCall } from '../src/StreamCall'; import { StreamClient } from '../src/StreamClient'; +import { v4 as uuidv4 } from 'uuid'; describe('ring call API', () => { let client: StreamClient; - const callId = `call${crypto.randomUUID()}`; + const callId = `call${uuidv4()}`; let call: StreamCall; beforeAll(async () => { From 9ef126fa8eb6d222db87e460aeb32b8f5da76c36 Mon Sep 17 00:00:00 2001 From: Oliver Lazoroski Date: Mon, 7 Jul 2025 11:28:21 +0200 Subject: [PATCH 4/6] fix: adjust to the latest schema --- src/StreamCall.ts | 2 +- src/gen/video/VideoApi.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/StreamCall.ts b/src/StreamCall.ts index a35e730..17cc811 100644 --- a/src/StreamCall.ts +++ b/src/StreamCall.ts @@ -9,7 +9,7 @@ export class StreamCall extends CallApi { create = this.getOrCreate; - ring = (params: { member_ids?: string[] }) => { + ring = (params: { target_member_ids?: string[] }) => { return this.videoApi.getCall({ ...params, id: this.id, diff --git a/src/gen/video/VideoApi.ts b/src/gen/video/VideoApi.ts index 2aeaa53..0268d01 100644 --- a/src/gen/video/VideoApi.ts +++ b/src/gen/video/VideoApi.ts @@ -153,14 +153,14 @@ export class VideoApi extends BaseApi { ring?: boolean; notify?: boolean; video?: boolean; - member_ids?: string[]; + target_member_ids?: string[]; }): Promise> => { const queryParams = { members_limit: request?.members_limit, ring: request?.ring, notify: request?.notify, video: request?.video, - member_ids: request?.member_ids, + target_member_ids: request?.target_member_ids, }; const pathParams = { type: request?.type, From a2950720be022f2deb49adfd3740c472ecac6066 Mon Sep 17 00:00:00 2001 From: Oliver Lazoroski Date: Thu, 10 Jul 2025 16:01:30 +0200 Subject: [PATCH 5/6] chore: regenerate api --- src/gen/chat/ChatApi.ts | 8 +- src/gen/common/CommonApi.ts | 44 ++++- src/gen/model-decoders/index.ts | 275 +++++++++----------------------- src/gen/models/index.ts | 171 +++++++++++++++++--- src/gen/video/CallApi.ts | 3 +- src/gen/video/VideoApi.ts | 2 + 6 files changed, 284 insertions(+), 219 deletions(-) diff --git a/src/gen/chat/ChatApi.ts b/src/gen/chat/ChatApi.ts index 408a6c7..eb4a312 100644 --- a/src/gen/chat/ChatApi.ts +++ b/src/gen/chat/ChatApi.ts @@ -69,17 +69,17 @@ import { QueryMessageFlagsResponse, QueryMessageHistoryRequest, QueryMessageHistoryResponse, - QueryPollVotesRequest, QueryPollsRequest, QueryPollsResponse, + QueryPollVotesRequest, QueryReactionsRequest, QueryReactionsResponse, QueryRemindersRequest, QueryRemindersResponse, - QuerySegmentTargetsRequest, - QuerySegmentTargetsResponse, QuerySegmentsRequest, QuerySegmentsResponse, + QuerySegmentTargetsRequest, + QuerySegmentTargetsResponse, QueryThreadsRequest, QueryThreadsResponse, ReminderResponseData, @@ -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..66d4467 100644 --- a/src/gen/common/CommonApi.ts +++ b/src/gen/common/CommonApi.ts @@ -36,8 +36,8 @@ import { FileUploadRequest, FileUploadResponse, GetApplicationResponse, - GetBlockListResponse, GetBlockedUsersResponse, + GetBlockListResponse, GetCustomPermissionResponse, GetImportResponse, GetOGResponse, @@ -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 cecec70..6b1fdfd 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,41 +168,8 @@ 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 = { - created_at: { type: 'DatetimeType', isSingle: true }, - participants: { type: 'CallParticipantResponse', isSingle: false }, accepted_by: { type: 'DatetimeType', isSingle: false }, @@ -400,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 }, @@ -540,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 }, @@ -569,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 }, @@ -606,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); }; @@ -776,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 }, @@ -850,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 }, @@ -1219,6 +1073,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); @@ -1332,6 +1188,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); }; @@ -1380,13 +1238,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 }, }; @@ -1848,33 +1708,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 }, @@ -1913,13 +1746,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 }, @@ -1964,6 +1790,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); }; @@ -2013,6 +1841,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 }, @@ -2022,7 +1905,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 363bf0f..0f8eecb 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; @@ -413,10 +413,6 @@ export interface Attachment { image_url?: string; - latitude?: number; - - longitude?: number; - og_scrape_url?: string; original_height?: number; @@ -425,8 +421,6 @@ export interface Attachment { pretext?: string; - stopped_sharing?: boolean; - text?: string; thumb_url?: string; @@ -1562,8 +1556,6 @@ export interface CallSessionParticipantLeftEvent { export interface CallSessionResponse { anonymous_participant_count: number; - created_at: Date; - id: string; participants: CallParticipantResponse[]; @@ -2012,6 +2004,8 @@ export interface Channel { team?: string; + active_live_locations?: SharedLocation[]; + invites?: ChannelMember[]; members?: ChannelMember[]; @@ -2060,6 +2054,8 @@ export interface ChannelConfig { search: boolean; + shared_locations: boolean; + skip_last_msg_update_for_system_msgs: boolean; typing_events: boolean; @@ -2124,6 +2120,8 @@ export interface ChannelConfigWithInfo { search: boolean; + shared_locations: boolean; + skip_last_msg_update_for_system_msgs: boolean; typing_events: boolean; @@ -2396,6 +2394,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', @@ -2488,6 +2487,8 @@ export interface ChannelStateResponse { watcher_count?: number; + active_live_locations?: SharedLocationResponseData[]; + pending_messages?: PendingMessageResponse[]; read?: ReadStateResponse[]; @@ -2518,6 +2519,8 @@ export interface ChannelStateResponseFields { watcher_count?: number; + active_live_locations?: SharedLocationResponseData[]; + pending_messages?: PendingMessageResponse[]; read?: ReadStateResponse[]; @@ -2584,6 +2587,8 @@ export interface ChannelTypeConfig { search: boolean; + shared_locations: boolean; + skip_last_msg_update_for_system_msgs: boolean; typing_events: boolean; @@ -2757,7 +2762,7 @@ export interface CheckResponse { task_id?: string; - item?: ReviewQueueItem; + item?: ReviewQueueItemResponse; } export interface CheckSNSRequest { @@ -2871,6 +2876,8 @@ export interface ConfigOverrides { replies?: boolean; + shared_locations?: boolean; + typing_events?: boolean; uploads?: boolean; @@ -3001,6 +3008,8 @@ export interface CreateChannelTypeRequest { search?: boolean; + shared_locations?: boolean; + skip_last_msg_update_for_system_msgs?: boolean; typing_events?: boolean; @@ -3057,6 +3066,8 @@ export interface CreateChannelTypeResponse { search: boolean; + shared_locations: boolean; + skip_last_msg_update_for_system_msgs: boolean; typing_events: boolean; @@ -4361,6 +4372,8 @@ export interface GetChannelTypeResponse { search: boolean; + shared_locations: boolean; + skip_last_msg_update_for_system_msgs: boolean; typing_events: boolean; @@ -4477,10 +4490,6 @@ export interface GetOGResponse { image_url?: string; - latitude?: number; - - longitude?: number; - og_scrape_url?: string; original_height?: number; @@ -4489,8 +4498,6 @@ export interface GetOGResponse { pretext?: string; - stopped_sharing?: boolean; - text?: string; thumb_url?: string; @@ -4841,21 +4848,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 { @@ -5137,6 +5156,8 @@ export interface Message { reminder?: MessageReminder; + shared_location?: SharedLocation; + user?: User; } @@ -5385,6 +5406,8 @@ export interface MessageRequest { custom?: Record; + shared_location?: SharedLocation; + user?: UserRequest; } @@ -5470,6 +5493,8 @@ export interface MessageResponse { reaction_groups?: Record; reminder?: ReminderResponseData; + + shared_location?: SharedLocationResponseData; } export interface MessageStatsResponse { @@ -5620,6 +5645,8 @@ export interface MessageWithChannelResponse { reaction_groups?: Record; reminder?: ReminderResponseData; + + shared_location?: SharedLocationResponseData; } export interface ModerationActionConfig { @@ -5697,7 +5724,7 @@ export interface ModerationFlagResponse { moderation_payload?: ModerationPayload; - review_queue_item?: ReviewQueueItem; + review_queue_item?: ReviewQueueItemResponse; user?: UserResponse; } @@ -5975,6 +6002,8 @@ export interface OwnUser { custom: Record; + total_unread_count_by_team: Record; + deactivated_at?: Date; deleted_at?: Date; @@ -6054,6 +6083,8 @@ export interface OwnUserResponse { push_preferences?: PushPreferences; teams_role?: Record; + + total_unread_count_by_team?: Record; } export interface PagerResponse { @@ -7627,6 +7658,8 @@ export interface ReviewQueueItem { teams: string[]; + completed_at: NullTime; + reviewed_at: NullTime; activity?: EnrichedActivity; @@ -8004,6 +8037,8 @@ export interface SearchResultMessage { reaction_groups?: Record; reminder?: ReminderResponseData; + + shared_location?: SharedLocationResponseData; } export interface SearchWarning { @@ -8150,6 +8185,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; @@ -8424,7 +8539,7 @@ export interface SubmitActionRequest { export interface SubmitActionResponse { duration: string; - item?: ReviewQueueItem; + item?: ReviewQueueItemResponse; } export interface SubscriberStatsResponse { @@ -8929,6 +9044,8 @@ export interface UnreadCountsResponse { channels: UnreadCountsChannel[]; threads: UnreadCountsThread[]; + + total_unread_count_by_team: Record; } export interface UnreadCountsThread { @@ -9202,6 +9319,8 @@ export interface UpdateChannelTypeRequest { search?: boolean; + shared_locations?: boolean; + skip_last_msg_update_for_system_msgs?: boolean; typing_events?: boolean; @@ -9262,6 +9381,8 @@ export interface UpdateChannelTypeResponse { search: boolean; + shared_locations: boolean; + skip_last_msg_update_for_system_msgs: boolean; typing_events: boolean; @@ -9335,6 +9456,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[]; @@ -10186,6 +10319,8 @@ export interface WrappedUnreadCountsResponse { channels: UnreadCountsChannel[]; threads: UnreadCountsThread[]; + + total_unread_count_by_team: Record; } export interface XiaomiConfig { diff --git a/src/gen/video/CallApi.ts b/src/gen/video/CallApi.ts index e395476..d8bfb30 100644 --- a/src/gen/video/CallApi.ts +++ b/src/gen/video/CallApi.ts @@ -73,7 +73,8 @@ export class CallApi { ring?: boolean; notify?: boolean; video?: boolean; - member_ids?: string[]; + ring_by_id?: string; + target_member_ids?: string[]; }): Promise> => { return this.videoApi.getCall({ id: this.id, type: this.type, ...request }); }; diff --git a/src/gen/video/VideoApi.ts b/src/gen/video/VideoApi.ts index 0268d01..173def0 100644 --- a/src/gen/video/VideoApi.ts +++ b/src/gen/video/VideoApi.ts @@ -153,6 +153,7 @@ export class VideoApi extends BaseApi { ring?: boolean; notify?: boolean; video?: boolean; + ring_by_id?: string; target_member_ids?: string[]; }): Promise> => { const queryParams = { @@ -160,6 +161,7 @@ export class VideoApi extends BaseApi { ring: request?.ring, notify: request?.notify, video: request?.video, + ring_by_id: request?.ring_by_id, target_member_ids: request?.target_member_ids, }; const pathParams = { From c14c663e3a269528bd2ccefc1fe7a07f06fb45f5 Mon Sep 17 00:00:00 2001 From: Oliver Lazoroski Date: Thu, 10 Jul 2025 16:15:35 +0200 Subject: [PATCH 6/6] feat: expose ring_by_id --- src/StreamCall.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/StreamCall.ts b/src/StreamCall.ts index 17cc811..45a62b6 100644 --- a/src/StreamCall.ts +++ b/src/StreamCall.ts @@ -9,7 +9,7 @@ export class StreamCall extends CallApi { create = this.getOrCreate; - ring = (params: { target_member_ids?: string[] }) => { + ring = (params: { ring_by_id?: string; target_member_ids?: string[] }) => { return this.videoApi.getCall({ ...params, id: this.id,