From 69ffa9d8ef2260a77a84c206554e9ba2588eea3e Mon Sep 17 00:00:00 2001 From: Oliver Lazoroski Date: Thu, 10 Apr 2025 12:35:36 +0200 Subject: [PATCH 01/10] 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 02/10] 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 03/10] 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 04/10] 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 05/10] 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 06/10] 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, From 5168ebbfb04b8808e66c4bc85786fc0037b09b93 Mon Sep 17 00:00:00 2001 From: Oliver Lazoroski Date: Mon, 10 Nov 2025 17:39:15 +0100 Subject: [PATCH 07/10] update to the latest schema --- .nvmrc | 1 + __tests__/ring-call.test.ts | 12 +- src/StreamCall.ts | 9 - src/gen/models/index.ts | 394 ++++++++++++++++++++++++++++-------- src/gen/video/CallApi.ts | 14 +- src/gen/video/VideoApi.ts | 42 +++- yarn.lock | 2 +- 7 files changed, 358 insertions(+), 116 deletions(-) create mode 100644 .nvmrc diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..54c6511 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v24 diff --git a/__tests__/ring-call.test.ts b/__tests__/ring-call.test.ts index e6235fc..9eb4f9f 100644 --- a/__tests__/ring-call.test.ts +++ b/__tests__/ring-call.test.ts @@ -35,20 +35,16 @@ describe('ring call API', () => { }); it(`ring my-friend`, async () => { - const response = await call.ring({ member_ids: ['my-friend'] }); - - // Dummy expect - expect(response.call.id).toBe(callId); + const response = await call.ring({ members_ids: ['my-friend'] }); + expect(response.members_ids).toEqual(['my-friend']); }); 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); + const response = await call.ring({ members_ids: ['my-other-friend'] }); + expect(response.members_ids).toEqual(['my-other-friend']); }); it('delete call', async () => { diff --git a/src/StreamCall.ts b/src/StreamCall.ts index 3ff29a4..f09bd4b 100644 --- a/src/StreamCall.ts +++ b/src/StreamCall.ts @@ -26,15 +26,6 @@ export class StreamCall extends CallApi { create = (request?: GetOrCreateCallRequest) => this.getOrCreate(request); - ring = (params: { ring_by_id?: string; target_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/models/index.ts b/src/gen/models/index.ts index a2b6248..e6175b4 100644 --- a/src/gen/models/index.ts +++ b/src/gen/models/index.ts @@ -2354,6 +2354,8 @@ export interface CallStatsLocation { country?: string; + country_iso_code?: string; + latitude?: number; longitude?: number; @@ -2378,6 +2380,10 @@ export interface CallStatsParticipantCounts { participants: number; + peak_concurrent_sessions: number; + + peak_concurrent_users: number; + publishers: number; sessions: number; @@ -2404,6 +2410,8 @@ export interface CallStatsParticipantSession { ended_at?: Date; + os?: string; + publisher_type?: string; sdk?: string; @@ -2593,6 +2601,14 @@ export interface CallsPerDayReportResponse { daily: DailyAggregateCallsPerDayReportResponse[]; } +export interface CampaignChannelMember { + user_id: string; + + channel_role?: string; + + custom?: Record; +} + export interface CampaignChannelTemplate { type: string; @@ -2603,6 +2619,8 @@ export interface CampaignChannelTemplate { team?: string; members?: string[]; + + members_template?: CampaignChannelMember[]; } export interface CampaignCompletedEvent { @@ -2750,6 +2768,8 @@ export interface Channel { active_live_locations?: SharedLocation[]; + filter_tags?: string[]; + invites?: ChannelMember[]; members?: ChannelMember[]; @@ -3006,6 +3026,8 @@ export interface ChannelInput { truncated_by_id?: string; + filter_tags?: string[]; + invites?: ChannelMemberRequest[]; members?: ChannelMemberRequest[]; @@ -3254,6 +3276,8 @@ export interface ChannelResponse { truncated_at?: Date; + filter_tags?: string[]; + members?: ChannelMemberResponse[]; own_capabilities?: ChannelOwnCapability[]; @@ -4309,6 +4333,18 @@ export interface CreateRoleResponse { role: Role; } +export interface CreateSIPTrunkRequest { + name: string; + + numbers: string[]; +} + +export interface CreateSIPTrunkResponse { + duration: string; + + sip_trunk?: SIPTrunkResponse; +} + export interface CustomActionRequest { id?: string; @@ -4651,6 +4687,14 @@ export interface DeleteReminderResponse { duration: string; } +export interface DeleteSIPInboundRoutingRuleResponse { + duration: string; +} + +export interface DeleteSIPTrunkResponse { + duration: string; +} + export interface DeleteSegmentTargetsRequest { target_ids: string[]; } @@ -7065,6 +7109,18 @@ export interface ListRolesResponse { roles: Role[]; } +export interface ListSIPInboundRoutingRuleResponse { + duration: string; + + sip_inbound_routing_rules: SIPInboundRoutingRuleResponse[]; +} + +export interface ListSIPTrunksResponse { + duration: string; + + sip_trunks: SIPTrunkResponse[]; +} + export interface ListTranscriptionsResponse { duration: string; @@ -7839,6 +7895,14 @@ export interface MessageWithChannelResponse { shared_location?: SharedLocationResponseData; } +export interface MetricDescriptor { + label: string; + + description?: string; + + unit?: string; +} + export interface MetricThreshold { level: string; @@ -8522,18 +8586,26 @@ export interface ParticipantReportResponse { } export interface ParticipantSeriesPublisherStats { + global_metrics_order?: string[]; + global?: Record; + global_meta?: Record; + global_thresholds?: Record; tracks?: Record; } export interface ParticipantSeriesSubscriberStats { + global_metrics_order?: string[]; + subscriptions?: ParticipantSeriesSubscriptionTrackMetrics[]; global?: Record; + global_meta?: Record; + global_thresholds?: Record; } @@ -8568,14 +8640,22 @@ export interface ParticipantSeriesTrackMetrics { track_type?: string; + metrics_order?: string[]; + metrics?: Record; + metrics_meta?: Record; + thresholds?: Record; } export interface ParticipantSeriesUserStats { + metrics_order?: string[]; + metrics?: Record; + metrics_meta?: Record; + thresholds?: Record; } @@ -9176,21 +9256,15 @@ export interface QualityScoreReportResponse { } export interface QueryActivitiesRequest { - include_private_activities?: boolean; - limit?: number; next?: string; prev?: string; - user_id?: string; - sort?: SortParamRequest[]; filter?: Record; - - user?: UserRequest; } export interface QueryActivitiesResponse { @@ -10553,6 +10627,26 @@ export interface ReportResponse { user_ratings: UserRatingReportResponse; } +export interface ResolveSipInboundRequest { + sip_caller_number: string; + + sip_trunk_number: string; + + challenge: SIPChallenge; + + sip_headers?: Record; +} + +export interface ResolveSipInboundResponse { + duration: string; + + credentials: SipInboundCredentials; + + sip_routing_rule?: SIPInboundRoutingRuleResponse; + + sip_trunk?: SIPTrunkResponse; +} + export interface Response { duration: string; } @@ -10661,6 +10755,18 @@ export interface ReviewQueueItemUpdatedEvent { review_queue_item?: ReviewQueueItemResponse; } +export interface RingCallRequest { + video?: boolean; + + members_ids?: string[]; +} + +export interface RingCallResponse { + duration: string; + + members_ids: string[]; +} + export interface RingSettings { auto_cancel_timeout_ms: number; @@ -10785,6 +10891,182 @@ export interface SDKUsageReportResponse { daily: DailyAggregateSDKUsageReportResponse[]; } +export interface SIPCallConfigsRequest { + custom_data?: Record; +} + +export interface SIPCallConfigsResponse { + custom_data: Record; +} + +export interface SIPCallerConfigsRequest { + id: string; + + custom_data?: Record; +} + +export interface SIPCallerConfigsResponse { + id: string; + + custom_data: Record; +} + +export interface SIPChallenge { + a1?: string; + + algorithm?: string; + + charset?: string; + + cnonce?: string; + + method?: string; + + nc?: string; + + nonce?: string; + + opaque?: string; + + realm?: string; + + response?: string; + + stale?: boolean; + + uri?: string; + + userhash?: boolean; + + username?: string; + + domain?: string[]; + + qop?: string[]; +} + +export interface SIPDirectRoutingRuleCallConfigsRequest { + call_id: string; + + call_type: string; +} + +export interface SIPDirectRoutingRuleCallConfigsResponse { + call_id: string; + + call_type: string; +} + +export interface SIPInboundRoutingRulePinConfigsRequest { + custom_webhook_url?: string; + + pin_failed_attempt_prompt?: string; + + pin_hangup_prompt?: string; + + pin_prompt?: string; + + pin_success_prompt?: string; +} + +export interface SIPInboundRoutingRulePinConfigsResponse { + custom_webhook_url?: string; + + pin_failed_attempt_prompt?: string; + + pin_hangup_prompt?: string; + + pin_prompt?: string; + + pin_success_prompt?: string; +} + +export interface SIPInboundRoutingRuleRequest { + name: string; + + trunk_ids: string[]; + + caller_configs: SIPCallerConfigsRequest; + + called_numbers?: string[]; + + caller_numbers?: string[]; + + call_configs?: SIPCallConfigsRequest; + + direct_routing_configs?: SIPDirectRoutingRuleCallConfigsRequest; + + pin_protection_configs?: SIPPinProtectionConfigsRequest; + + pin_routing_configs?: SIPInboundRoutingRulePinConfigsRequest; +} + +export interface SIPInboundRoutingRuleResponse { + created_at: Date; + + duration: string; + + id: string; + + name: string; + + updated_at: Date; + + called_numbers: string[]; + + trunk_ids: string[]; + + caller_numbers?: string[]; + + call_configs?: SIPCallConfigsResponse; + + caller_configs?: SIPCallerConfigsResponse; + + direct_routing_configs?: SIPDirectRoutingRuleCallConfigsResponse; + + pin_protection_configs?: SIPPinProtectionConfigsResponse; + + pin_routing_configs?: SIPInboundRoutingRulePinConfigsResponse; +} + +export interface SIPPinProtectionConfigsRequest { + default_pin?: string; + + enabled?: boolean; + + max_attempts?: number; + + required_pin_digits?: number; +} + +export interface SIPPinProtectionConfigsResponse { + enabled: boolean; + + default_pin?: string; + + max_attempts?: number; + + required_pin_digits?: number; +} + +export interface SIPTrunkResponse { + created_at: Date; + + id: string; + + name: string; + + password: string; + + updated_at: Date; + + uri: string; + + username: string; + + numbers: string[]; +} + export interface SRTIngress { address: string; } @@ -11189,86 +11471,6 @@ export interface SharedLocationsResponse { active_live_locations: SharedLocationResponseData[]; } -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; @@ -11285,6 +11487,20 @@ export interface SingleFollowResponse { follow: FollowResponse; } +export interface SipInboundCredentials { + call_id: string; + + call_type: string; + + token: string; + + user_id: string; + + call_custom_data: Record; + + user_custom_data: Record; +} + export interface SortParam { direction?: number; @@ -12546,12 +12762,16 @@ export interface UpdateChannelRequest { hide_history?: boolean; + hide_history_before?: Date; + reject_invite?: boolean; skip_push?: boolean; user_id?: string; + add_filter_tags?: string[]; + add_members?: ChannelMemberRequest[]; add_moderators?: string[]; @@ -12562,6 +12782,8 @@ export interface UpdateChannelRequest { invites?: ChannelMemberRequest[]; + remove_filter_tags?: string[]; + remove_members?: string[]; data?: ChannelInput; diff --git a/src/gen/video/CallApi.ts b/src/gen/video/CallApi.ts index e5e4d8a..1ebb883 100644 --- a/src/gen/video/CallApi.ts +++ b/src/gen/video/CallApi.ts @@ -25,6 +25,8 @@ import { PinResponse, QueryCallParticipantsRequest, QueryCallParticipantsResponse, + RingCallRequest, + RingCallResponse, SendCallEventRequest, SendCallEventResponse, SendClosedCaptionRequest, @@ -34,10 +36,10 @@ import { StartFrameRecordingRequest, StartFrameRecordingResponse, StartHLSBroadcastingResponse, - StartRecordingRequest, - StartRecordingResponse, StartRTMPBroadcastsRequest, StartRTMPBroadcastsResponse, + StartRecordingRequest, + StartRecordingResponse, StartTranscriptionRequest, StartTranscriptionResponse, StopAllRTMPBroadcastsResponse, @@ -47,9 +49,9 @@ import { StopHLSBroadcastingResponse, StopLiveRequest, StopLiveResponse, - StopRecordingResponse, StopRTMPBroadcastsRequest, StopRTMPBroadcastsResponse, + StopRecordingResponse, StopTranscriptionRequest, StopTranscriptionResponse, UnblockUserRequest, @@ -76,8 +78,6 @@ export class CallApi { ring?: boolean; notify?: boolean; video?: boolean; - ring_by_id?: string; - target_member_ids?: string[]; }): Promise> { return this.videoApi.getCall({ id: this.id, type: this.type, ...request }); } @@ -214,6 +214,10 @@ export class CallApi { }); } + ring(request?: RingCallRequest): Promise> { + return this.videoApi.ringCall({ id: this.id, type: this.type, ...request }); + } + startRTMPBroadcasts( request: StartRTMPBroadcastsRequest, ): Promise> { diff --git a/src/gen/video/VideoApi.ts b/src/gen/video/VideoApi.ts index e40c922..5cffd0c 100644 --- a/src/gen/video/VideoApi.ts +++ b/src/gen/video/VideoApi.ts @@ -43,6 +43,8 @@ import { QueryUserFeedbackRequest, QueryUserFeedbackResponse, Response, + RingCallRequest, + RingCallResponse, SendCallEventRequest, SendCallEventResponse, SendClosedCaptionRequest, @@ -53,10 +55,10 @@ import { StartFrameRecordingRequest, StartFrameRecordingResponse, StartHLSBroadcastingResponse, - StartRecordingRequest, - StartRecordingResponse, StartRTMPBroadcastsRequest, StartRTMPBroadcastsResponse, + StartRecordingRequest, + StartRecordingResponse, StartTranscriptionRequest, StartTranscriptionResponse, StopAllRTMPBroadcastsResponse, @@ -66,9 +68,9 @@ import { StopHLSBroadcastingResponse, StopLiveRequest, StopLiveResponse, - StopRecordingResponse, StopRTMPBroadcastsRequest, StopRTMPBroadcastsResponse, + StopRecordingResponse, StopTranscriptionRequest, StopTranscriptionResponse, UnblockUserRequest, @@ -83,6 +85,8 @@ import { UpdateCallTypeResponse, UpdateUserPermissionsRequest, UpdateUserPermissionsResponse, + QueryCallsRequest, + QueryCallsResponse, } from '../models'; import { decoders } from '../model-decoders/decoders'; @@ -194,16 +198,12 @@ export class VideoApi { ring?: boolean; notify?: boolean; video?: boolean; - ring_by_id?: string; - target_member_ids?: string[]; }): Promise> { const queryParams = { members_limit: request?.members_limit, 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 = { type: request?.type, @@ -683,6 +683,34 @@ export class VideoApi { return { ...response.body, metadata: response.metadata }; } + async ringCall( + request: RingCallRequest & { type: string; id: string }, + ): Promise> { + const pathParams = { + type: request?.type, + id: request?.id, + }; + const body = { + video: request?.video, + members_ids: request?.members_ids, + }; + + const response = await this.apiClient.sendRequest< + StreamResponse + >( + 'POST', + '/api/v2/video/call/{type}/{id}/ring', + pathParams, + undefined, + body, + 'application/json', + ); + + decoders.RingCallResponse?.(response.body); + + return { ...response.body, metadata: response.metadata }; + } + async startRTMPBroadcasts( request: StartRTMPBroadcastsRequest & { type: string; id: string }, ): Promise> { diff --git a/yarn.lock b/yarn.lock index 68a3391..0c13b05 100644 --- a/yarn.lock +++ b/yarn.lock @@ -397,7 +397,7 @@ consola "^2.15.0" node-fetch "^2.6.1" -"@openai/realtime-api-beta@github:openai/openai-realtime-api-beta#a5cb94824f625423858ebacb9f769226ca98945f": +"@openai/realtime-api-beta@openai/openai-realtime-api-beta#a5cb94824f625423858ebacb9f769226ca98945f": version "0.0.0" resolved "https://codeload.github.com/openai/openai-realtime-api-beta/tar.gz/a5cb94824f625423858ebacb9f769226ca98945f" dependencies: From f83c5fe01cabe755fb1a323a584f3001794b09a6 Mon Sep 17 00:00:00 2001 From: Oliver Lazoroski Date: Mon, 10 Nov 2025 17:41:44 +0100 Subject: [PATCH 08/10] remove bad merge --- src/gen/common/CommonApi.ts | 39 ------------------------------------- 1 file changed, 39 deletions(-) diff --git a/src/gen/common/CommonApi.ts b/src/gen/common/CommonApi.ts index 495876c..7ac038b 100644 --- a/src/gen/common/CommonApi.ts +++ b/src/gen/common/CommonApi.ts @@ -1437,45 +1437,6 @@ export class CommonApi { 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 }; - }; - async getUserLiveLocations(request?: { user_id?: string; }): Promise> { From 3c8d4ef4c875038ff41566f643d0a4628bab72cc Mon Sep 17 00:00:00 2001 From: Oliver Lazoroski Date: Mon, 10 Nov 2025 17:42:29 +0100 Subject: [PATCH 09/10] remove empty file --- src/gen/model-decoders/index.ts | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/gen/model-decoders/index.ts diff --git a/src/gen/model-decoders/index.ts b/src/gen/model-decoders/index.ts deleted file mode 100644 index e69de29..0000000 From 6244941d01748599195a95e2a72783c46633bc4d Mon Sep 17 00:00:00 2001 From: Oliver Lazoroski Date: Fri, 14 Nov 2025 11:45:31 +0100 Subject: [PATCH 10/10] chore: newest schema (v205.1.0-4-g965f446553) --- src/gen/chat/ChatApi.ts | 46 +++++- src/gen/common/CommonApi.ts | 2 +- src/gen/model-decoders/decoders.ts | 136 +++++++++++----- src/gen/models/index.ts | 248 ++++++++++++++++++++--------- src/gen/video/VideoApi.ts | 214 ++++++++++++++++++++++++- 5 files changed, 527 insertions(+), 119 deletions(-) diff --git a/src/gen/chat/ChatApi.ts b/src/gen/chat/ChatApi.ts index 02ff339..1169663 100644 --- a/src/gen/chat/ChatApi.ts +++ b/src/gen/chat/ChatApi.ts @@ -36,6 +36,8 @@ import { ListChannelTypesResponse, ListCommandsResponse, MarkChannelsReadRequest, + MarkDeliveredRequest, + MarkDeliveredResponse, MarkReadRequest, MarkReadResponse, MarkUnreadRequest, @@ -62,10 +64,10 @@ import { QueryReactionsResponse, QueryRemindersRequest, QueryRemindersResponse, - QuerySegmentsRequest, - QuerySegmentsResponse, QuerySegmentTargetsRequest, QuerySegmentTargetsResponse, + QuerySegmentsRequest, + QuerySegmentsResponse, QueryThreadsRequest, QueryThreadsResponse, ReminderResponseData, @@ -278,6 +280,32 @@ export class ChatApi { return { ...response.body, metadata: response.metadata }; } + async markDelivered( + request?: MarkDeliveredRequest & { user_id?: string }, + ): Promise> { + const queryParams = { + user_id: request?.user_id, + }; + const body = { + latest_delivered_messages: request?.latest_delivered_messages, + }; + + const response = await this.apiClient.sendRequest< + StreamResponse + >( + 'POST', + '/api/v2/chat/channels/delivered', + undefined, + queryParams, + body, + 'application/json', + ); + + decoders.MarkDeliveredResponse?.(response.body); + + return { ...response.body, metadata: response.metadata }; + } + async markChannelsRead( request?: MarkChannelsReadRequest, ): Promise> { @@ -398,14 +426,17 @@ export class ChatApi { accept_invite: request?.accept_invite, cooldown: request?.cooldown, hide_history: request?.hide_history, + hide_history_before: request?.hide_history_before, reject_invite: request?.reject_invite, skip_push: request?.skip_push, user_id: request?.user_id, + add_filter_tags: request?.add_filter_tags, add_members: request?.add_members, add_moderators: request?.add_moderators, assign_roles: request?.assign_roles, demote_moderators: request?.demote_moderators, invites: request?.invites, + remove_filter_tags: request?.remove_filter_tags, remove_members: request?.remove_members, data: request?.data, message: request?.message, @@ -875,6 +906,7 @@ export class ChatApi { }; const body = { message_id: request?.message_id, + message_timestamp: request?.message_timestamp, thread_id: request?.thread_id, user_id: request?.user_id, user: request?.user, @@ -2122,10 +2154,16 @@ export class ChatApi { return { ...response.body, metadata: response.metadata }; } - async unreadCounts(): Promise> { + async unreadCounts(request?: { + user_id?: string; + }): Promise> { + const queryParams = { + user_id: request?.user_id, + }; + const response = await this.apiClient.sendRequest< StreamResponse - >('GET', '/api/v2/chat/unread', undefined, undefined); + >('GET', '/api/v2/chat/unread', undefined, queryParams); decoders.WrappedUnreadCountsResponse?.(response.body); diff --git a/src/gen/common/CommonApi.ts b/src/gen/common/CommonApi.ts index 7ac038b..1313d29 100644 --- a/src/gen/common/CommonApi.ts +++ b/src/gen/common/CommonApi.ts @@ -37,8 +37,8 @@ import { FileUploadRequest, FileUploadResponse, GetApplicationResponse, - GetBlockedUsersResponse, GetBlockListResponse, + GetBlockedUsersResponse, GetCustomPermissionResponse, GetImportResponse, GetOGResponse, diff --git a/src/gen/model-decoders/decoders.ts b/src/gen/model-decoders/decoders.ts index 78432ea..ee1c141 100644 --- a/src/gen/model-decoders/decoders.ts +++ b/src/gen/model-decoders/decoders.ts @@ -533,6 +533,8 @@ decoders.BookmarkFolderResponse = (input?: Record) => { created_at: { type: 'DatetimeType', isSingle: true }, updated_at: { type: 'DatetimeType', isSingle: true }, + + user: { type: 'UserResponseCommonFields', isSingle: true }, }; return decode(typeMappings, input); }; @@ -558,7 +560,7 @@ decoders.BookmarkResponse = (input?: Record) => { activity: { type: 'ActivityResponse', isSingle: true }, - user: { type: 'UserResponse', isSingle: true }, + user: { type: 'UserResponseCommonFields', isSingle: true }, folder: { type: 'BookmarkFolderResponse', isSingle: true }, }; @@ -1258,14 +1260,12 @@ decoders.ChannelHiddenEvent = (input?: Record) => { 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 }, + created_at: { type: 'DatetimeType', isSingle: true }, + deleted_at: { type: 'DatetimeType', isSingle: true }, invite_accepted_at: { type: 'DatetimeType', isSingle: true }, @@ -1274,6 +1274,8 @@ decoders.ChannelMember = (input?: Record) => { pinned_at: { type: 'DatetimeType', isSingle: true }, + updated_at: { type: 'DatetimeType', isSingle: true }, + user: { type: 'User', isSingle: true }, }; return decode(typeMappings, input); @@ -1335,7 +1337,7 @@ decoders.ChannelMutedEvent = (input?: Record) => { return decode(typeMappings, input); }; -decoders.ChannelPushPreferences = (input?: Record) => { +decoders.ChannelPushPreferencesResponse = (input?: Record) => { const typeMappings: TypeMapping = { disabled_until: { type: 'DatetimeType', isSingle: true }, }; @@ -1398,7 +1400,10 @@ decoders.ChannelStateResponse = (input?: Record) => { membership: { type: 'ChannelMemberResponse', isSingle: true }, - push_preferences: { type: 'ChannelPushPreferences', isSingle: true }, + push_preferences: { + type: 'ChannelPushPreferencesResponse', + isSingle: true, + }, }; return decode(typeMappings, input); }; @@ -1432,7 +1437,10 @@ decoders.ChannelStateResponseFields = (input?: Record) => { membership: { type: 'ChannelMemberResponse', isSingle: true }, - push_preferences: { type: 'ChannelPushPreferences', isSingle: true }, + push_preferences: { + type: 'ChannelPushPreferencesResponse', + isSingle: true, + }, }; return decode(typeMappings, input); }; @@ -1745,6 +1753,13 @@ decoders.CreateRoleResponse = (input?: Record) => { return decode(typeMappings, input); }; +decoders.CreateSIPTrunkResponse = (input?: Record) => { + const typeMappings: TypeMapping = { + sip_trunk: { type: 'SIPTrunkResponse', isSingle: true }, + }; + return decode(typeMappings, input); +}; + decoders.CustomCheckResponse = (input?: Record) => { const typeMappings: TypeMapping = { item: { type: 'ReviewQueueItemResponse', isSingle: true }, @@ -2460,7 +2475,7 @@ decoders.GetPushTemplatesResponse = (input?: Record) => { decoders.GetReactionsResponse = (input?: Record) => { const typeMappings: TypeMapping = { - reactions: { type: 'Reaction', isSingle: false }, + reactions: { type: 'ReactionResponse', isSingle: false }, }; return decode(typeMappings, input); }; @@ -2615,6 +2630,23 @@ decoders.ListRolesResponse = (input?: Record) => { return decode(typeMappings, input); }; +decoders.ListSIPInboundRoutingRuleResponse = (input?: Record) => { + const typeMappings: TypeMapping = { + sip_inbound_routing_rules: { + type: 'SIPInboundRoutingRuleResponse', + isSingle: false, + }, + }; + return decode(typeMappings, input); +}; + +decoders.ListSIPTrunksResponse = (input?: Record) => { + const typeMappings: TypeMapping = { + sip_trunks: { type: 'SIPTrunkResponse', isSingle: false }, + }; + return decode(typeMappings, input); +}; + decoders.ListTranscriptionsResponse = (input?: Record) => { const typeMappings: TypeMapping = { transcriptions: { type: 'CallTranscription', isSingle: false }, @@ -3151,7 +3183,7 @@ decoders.OwnUserResponse = (input?: Record) => { revoke_tokens_issued_before: { type: 'DatetimeType', isSingle: true }, - push_preferences: { type: 'PushPreferences', isSingle: true }, + push_preferences: { type: 'PushPreferencesResponse', isSingle: true }, }; return decode(typeMappings, input); }; @@ -3317,6 +3349,13 @@ decoders.PushPreferences = (input?: Record) => { return decode(typeMappings, input); }; +decoders.PushPreferencesResponse = (input?: Record) => { + const typeMappings: TypeMapping = { + disabled_until: { type: 'DatetimeType', isSingle: true }, + }; + return decode(typeMappings, input); +}; + decoders.PushProvider = (input?: Record) => { const typeMappings: TypeMapping = { created_at: { type: 'DatetimeType', isSingle: true }, @@ -3583,13 +3622,6 @@ decoders.QueryRemindersResponse = (input?: Record) => { return decode(typeMappings, input); }; -decoders.QueryReviewQueueResponse = (input?: Record) => { - const typeMappings: TypeMapping = { - items: { type: 'ReviewQueueItemResponse', isSingle: false }, - }; - return decode(typeMappings, input); -}; - decoders.QuerySegmentTargetsResponse = (input?: Record) => { const typeMappings: TypeMapping = { targets: { type: 'SegmentTargetResponse', isSingle: false }, @@ -3774,9 +3806,9 @@ decoders.ReminderResponseData = (input?: Record) => { channel: { type: 'ChannelResponse', isSingle: true }, - message: { type: 'Message', isSingle: true }, + message: { type: 'MessageResponse', isSingle: true }, - user: { type: 'User', isSingle: true }, + user: { type: 'UserResponse', isSingle: true }, }; return decode(typeMappings, input); }; @@ -3792,6 +3824,15 @@ decoders.ReminderUpdatedEvent = (input?: Record) => { return decode(typeMappings, input); }; +decoders.ResolveSipInboundResponse = (input?: Record) => { + const typeMappings: TypeMapping = { + sip_routing_rule: { type: 'SIPInboundRoutingRuleResponse', isSingle: true }, + + sip_trunk: { type: 'SIPTrunkResponse', isSingle: true }, + }; + return decode(typeMappings, input); +}; + decoders.ReviewQueueItemNewEvent = (input?: Record) => { const typeMappings: TypeMapping = { created_at: { type: 'DatetimeType', isSingle: true }, @@ -3866,6 +3907,24 @@ decoders.Role = (input?: Record) => { return decode(typeMappings, input); }; +decoders.SIPInboundRoutingRuleResponse = (input?: Record) => { + const typeMappings: TypeMapping = { + created_at: { type: 'DatetimeType', isSingle: true }, + + updated_at: { type: 'DatetimeType', isSingle: true }, + }; + return decode(typeMappings, input); +}; + +decoders.SIPTrunkResponse = (input?: Record) => { + const typeMappings: TypeMapping = { + created_at: { type: 'DatetimeType', isSingle: true }, + + updated_at: { type: 'DatetimeType', isSingle: true }, + }; + return decode(typeMappings, input); +}; + decoders.SearchResult = (input?: Record) => { const typeMappings: TypeMapping = { message: { type: 'SearchResultMessage', isSingle: true }, @@ -3965,15 +4024,7 @@ decoders.SendReactionResponse = (input?: Record) => { 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); }; @@ -4405,6 +4456,25 @@ decoders.UpdateReminderResponse = (input?: Record) => { return decode(typeMappings, input); }; +decoders.UpdateSIPInboundRoutingRuleResponse = ( + input?: Record, +) => { + const typeMappings: TypeMapping = { + sip_inbound_routing_rule: { + type: 'SIPInboundRoutingRuleResponse', + isSingle: true, + }, + }; + return decode(typeMappings, input); +}; + +decoders.UpdateSIPTrunkResponse = (input?: Record) => { + const typeMappings: TypeMapping = { + sip_trunk: { type: 'SIPTrunkResponse', isSingle: true }, + }; + return decode(typeMappings, input); +}; + decoders.UpdateThreadPartialResponse = (input?: Record) => { const typeMappings: TypeMapping = { thread: { type: 'ThreadResponse', isSingle: true }, @@ -4490,19 +4560,7 @@ 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); }; diff --git a/src/gen/models/index.ts b/src/gen/models/index.ts index cc78e0c..2658d31 100644 --- a/src/gen/models/index.ts +++ b/src/gen/models/index.ts @@ -1526,6 +1526,8 @@ export interface BookmarkFolderResponse { updated_at: Date; + user: UserResponseCommonFields; + custom?: Record; } @@ -1550,7 +1552,7 @@ export interface BookmarkResponse { activity: ActivityResponse; - user: UserResponse; + user: UserResponseCommonFields; custom?: Record; @@ -2644,6 +2646,8 @@ export interface CampaignCompletedEvent { export interface CampaignMessageTemplate { poll_id: string; + searchable: boolean; + text: string; attachments: Attachment[]; @@ -2852,7 +2856,7 @@ export interface ChannelConfig { partition_size?: number; - partition_ttl?: number; + partition_ttl?: string; allowed_flag_reasons?: string[]; @@ -3045,29 +3049,41 @@ export interface ChannelInput { custom?: Record; } -export interface ChannelMember { - banned: boolean; +export interface ChannelInputRequest { + auto_translation_enabled?: boolean; - channel_role: string; + auto_translation_language?: string; - created_at: Date; + disabled?: boolean; - is_global_banned: boolean; + frozen?: boolean; - notifications_muted: boolean; + team?: string; - shadow_banned: boolean; + invites?: ChannelMember[]; - updated_at: Date; + members?: ChannelMember[]; - custom: Record; + config_overrides?: ConfigOverrides; + + created_by?: User; + + custom?: Record; +} +export interface ChannelMember { archived_at?: Date; ban_expires?: Date; + banned?: boolean; + blocked?: boolean; + channel_role?: string; + + created_at?: Date; + deleted_at?: Date; hidden?: boolean; @@ -3078,18 +3094,28 @@ export interface ChannelMember { invited?: boolean; + is_global_banned?: boolean; + is_moderator?: boolean; + notifications_muted?: boolean; + pinned_at?: Date; + shadow_banned?: boolean; + status?: string; + updated_at?: Date; + user_id?: string; deleted_messages?: string[]; channel?: DenormalizedChannelFields; + custom?: Record; + user?: User; } @@ -3237,6 +3263,12 @@ export interface ChannelPushPreferences { disabled_until?: Date; } +export interface ChannelPushPreferencesResponse { + chat_level?: string; + + disabled_until?: Date; +} + export interface ChannelResponse { cid: string; @@ -3326,7 +3358,7 @@ export interface ChannelStateResponse { membership?: ChannelMemberResponse; - push_preferences?: ChannelPushPreferences; + push_preferences?: ChannelPushPreferencesResponse; } export interface ChannelStateResponseFields { @@ -3358,7 +3390,7 @@ export interface ChannelStateResponseFields { membership?: ChannelMemberResponse; - push_preferences?: ChannelPushPreferences; + push_preferences?: ChannelPushPreferencesResponse; } export interface ChannelTruncatedEvent { @@ -3679,17 +3711,17 @@ export interface CollectionRequest { } export interface CollectionResponse { - created_at: Date; - id: string; name: string; - updated_at: Date; + created_at?: Date; - custom: Record; + updated_at?: Date; user_id?: string; + + custom?: Record; } export interface Command { @@ -3877,10 +3909,6 @@ export interface CommentUpdatedEvent { export interface CommitMessageRequest {} export interface ConfigOverrides { - commands: string[]; - - grants: Record; - blocklist?: string; blocklist_behavior?: 'flag' | 'block'; @@ -3904,6 +3932,10 @@ export interface ConfigOverrides { url_enrichment?: boolean; user_message_reminders?: boolean; + + commands?: string[]; + + grants?: Record; } export interface ConfigResponse { @@ -3963,7 +3995,13 @@ export interface CreateBlockListRequest { team?: string; - type?: 'regex' | 'domain' | 'domain_allowlist' | 'email' | 'word'; + type?: + | 'regex' + | 'domain' + | 'domain_allowlist' + | 'email' + | 'email_allowlist' + | 'word'; } export interface CreateBlockListResponse { @@ -4787,8 +4825,14 @@ export interface DeleteUsersResponse { task_id: string; } +export interface DeliveredMessagePayload { + cid?: string; + + id?: string; +} + export interface DeliveryReceipts { - enabled: boolean; + enabled?: boolean; } export interface DeliveryReceiptsResponse { @@ -4994,19 +5038,19 @@ export interface EnrichedActivity { } export interface EnrichedCollectionResponse { - created_at: Date; - id: string; name: string; status: 'ok' | 'notfound'; - updated_at: Date; + created_at?: Date; - custom: Record; + updated_at?: Date; user_id?: string; + + custom?: Record; } export interface EnrichedReaction { @@ -5667,6 +5711,20 @@ export interface FeedsPreferences { custom_activity_types?: Record; } +export interface FeedsPreferencesResponse { + comment?: string; + + comment_reaction?: string; + + follow?: string; + + mention?: string; + + reaction?: string; + + custom_activity_types?: Record; +} + export interface FeedsReactionResponse { activity_id: string; @@ -5717,6 +5775,12 @@ export interface FileUploadResponse { thumb_url?: string; } +export interface FilterConfigResponse { + llm_labels: string[]; + + ai_text_labels?: string[]; +} + export interface FirebaseConfig { apn_template?: string; @@ -6575,7 +6639,7 @@ export interface GetRateLimitsResponse { export interface GetReactionsResponse { duration: string; - reactions: Reaction[]; + reactions: ReactionResponse[]; } export interface GetRepliesResponse { @@ -7215,6 +7279,14 @@ export interface MarkChannelsReadRequest { user?: UserRequest; } +export interface MarkDeliveredRequest { + latest_delivered_messages?: DeliveredMessagePayload[]; +} + +export interface MarkDeliveredResponse { + duration: string; +} + export interface MarkReadRequest { message_id?: string; @@ -7240,6 +7312,8 @@ export interface MarkReviewedRequest { export interface MarkUnreadRequest { message_id?: string; + message_timestamp?: Date; + thread_id?: string; user_id?: string; @@ -8584,7 +8658,7 @@ export interface OwnUserResponse { privacy_settings?: PrivacySettingsResponse; - push_preferences?: PushPreferences; + push_preferences?: PushPreferencesResponse; teams_role?: Record; @@ -9173,6 +9247,18 @@ export interface PushPreferences { feeds_preferences?: FeedsPreferences; } +export interface PushPreferencesResponse { + call_level?: string; + + chat_level?: string; + + disabled_until?: Date; + + feeds_level?: string; + + feeds_preferences?: FeedsPreferencesResponse; +} + export interface PushProvider { created_at: Date; @@ -9320,15 +9406,21 @@ export interface QualityScoreReportResponse { } export interface QueryActivitiesRequest { + include_private_activities?: boolean; + limit?: number; next?: string; prev?: string; + user_id?: string; + sort?: SortParamRequest[]; filter?: Record; + + user?: UserRequest; } export interface QueryActivitiesResponse { @@ -10115,6 +10207,8 @@ export interface QueryReviewQueueResponse { next?: string; prev?: string; + + filter_config?: FilterConfigResponse; } export interface QuerySegmentTargetsRequest { @@ -10482,7 +10576,7 @@ export interface ReadCollectionsResponse { } export interface ReadReceipts { - enabled: boolean; + enabled?: boolean; } export interface ReadReceiptsResponse { @@ -10642,9 +10736,9 @@ export interface ReminderResponseData { channel?: ChannelResponse; - message?: Message; + message?: MessageResponse; - user?: User; + user?: UserResponse; } export interface ReminderUpdatedEvent { @@ -11462,27 +11556,13 @@ export interface ShadowBlockActionRequest { } export interface SharedLocation { - channel_cid: string; - - created_at: Date; - - created_by_device_id: string; - - message_id: string; + latitude: number; - updated_at: Date; + longitude: number; - user_id: string; + created_by_device_id?: string; end_at?: Date; - - latitude?: number; - - longitude?: number; - - channel?: Channel; - - message?: Message; } export interface SharedLocationResponse { @@ -12390,7 +12470,7 @@ export interface TruncateChannelResponse { } export interface TypingIndicators { - enabled: boolean; + enabled?: boolean; } export interface TypingIndicatorsResponse { @@ -12858,7 +12938,7 @@ export interface UpdateChannelRequest { remove_members?: string[]; - data?: ChannelInput; + data?: ChannelInputRequest; message?: MessageRequest; @@ -13350,6 +13430,44 @@ export interface UpdateReminderResponse { reminder: ReminderResponseData; } +export interface UpdateSIPInboundRoutingRuleRequest { + name: string; + + called_numbers: string[]; + + trunk_ids: string[]; + + caller_configs: SIPCallerConfigsRequest; + + caller_numbers?: string[]; + + call_configs?: SIPCallConfigsRequest; + + direct_routing_configs?: SIPDirectRoutingRuleCallConfigsRequest; + + pin_protection_configs?: SIPPinProtectionConfigsRequest; + + pin_routing_configs?: SIPInboundRoutingRulePinConfigsRequest; +} + +export interface UpdateSIPInboundRoutingRuleResponse { + duration: string; + + sip_inbound_routing_rule?: SIPInboundRoutingRuleResponse; +} + +export interface UpdateSIPTrunkRequest { + name: string; + + numbers: string[]; +} + +export interface UpdateSIPTrunkResponse { + duration: string; + + sip_trunk?: SIPTrunkResponse; +} + export interface UpdateThreadPartialRequest { user_id?: string; @@ -13618,43 +13736,27 @@ export interface UpsertPushTemplateResponse { } 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; + banned?: boolean; invisible?: boolean; language?: string; - last_active?: Date; - - last_engaged_at?: Date; - revoke_tokens_issued_before?: Date; - updated_at?: Date; + role?: string; teams?: string[]; + custom?: Record; + privacy_settings?: PrivacySettings; + + teams_role?: Record; } export interface UserBannedEvent { diff --git a/src/gen/video/VideoApi.ts b/src/gen/video/VideoApi.ts index 5cffd0c..bf59376 100644 --- a/src/gen/video/VideoApi.ts +++ b/src/gen/video/VideoApi.ts @@ -6,9 +6,13 @@ import { CollectUserFeedbackResponse, CreateCallTypeRequest, CreateCallTypeResponse, + CreateSIPTrunkRequest, + CreateSIPTrunkResponse, DeleteCallRequest, DeleteCallResponse, DeleteRecordingResponse, + DeleteSIPInboundRoutingRuleResponse, + DeleteSIPTrunkResponse, DeleteTranscriptionResponse, EndCallResponse, GetActiveCallsStatusResponse, @@ -25,6 +29,8 @@ import { KickUserResponse, ListCallTypeResponse, ListRecordingsResponse, + ListSIPInboundRoutingRuleResponse, + ListSIPTrunksResponse, ListTranscriptionsResponse, MuteUsersRequest, MuteUsersResponse, @@ -40,11 +46,17 @@ import { QueryCallSessionParticipantStatsTimelineResponse, QueryCallStatsRequest, QueryCallStatsResponse, + QueryCallsRequest, + QueryCallsResponse, QueryUserFeedbackRequest, QueryUserFeedbackResponse, + ResolveSipInboundRequest, + ResolveSipInboundResponse, Response, RingCallRequest, RingCallResponse, + SIPInboundRoutingRuleRequest, + SIPInboundRoutingRuleResponse, SendCallEventRequest, SendCallEventResponse, SendClosedCaptionRequest, @@ -83,10 +95,12 @@ import { UpdateCallResponse, UpdateCallTypeRequest, UpdateCallTypeResponse, + UpdateSIPInboundRoutingRuleRequest, + UpdateSIPInboundRoutingRuleResponse, + UpdateSIPTrunkRequest, + UpdateSIPTrunkResponse, UpdateUserPermissionsRequest, UpdateUserPermissionsResponse, - QueryCallsRequest, - QueryCallsResponse, } from '../models'; import { decoders } from '../model-decoders/decoders'; @@ -1487,6 +1501,202 @@ export class VideoApi { return { ...response.body, metadata: response.metadata }; } + async resolveSipInbound( + request: ResolveSipInboundRequest, + ): Promise> { + const body = { + sip_caller_number: request?.sip_caller_number, + sip_trunk_number: request?.sip_trunk_number, + challenge: request?.challenge, + sip_headers: request?.sip_headers, + }; + + const response = await this.apiClient.sendRequest< + StreamResponse + >( + 'POST', + '/api/v2/video/sip/resolve', + undefined, + undefined, + body, + 'application/json', + ); + + decoders.ResolveSipInboundResponse?.(response.body); + + return { ...response.body, metadata: response.metadata }; + } + + async listSIPInboundRoutingRule(): Promise< + StreamResponse + > { + const response = await this.apiClient.sendRequest< + StreamResponse + >('GET', '/api/v2/video/sip/routing_rules', undefined, undefined); + + decoders.ListSIPInboundRoutingRuleResponse?.(response.body); + + return { ...response.body, metadata: response.metadata }; + } + + async createSIPInboundRoutingRule( + request: SIPInboundRoutingRuleRequest, + ): Promise> { + const body = { + name: request?.name, + trunk_ids: request?.trunk_ids, + caller_configs: request?.caller_configs, + called_numbers: request?.called_numbers, + caller_numbers: request?.caller_numbers, + call_configs: request?.call_configs, + direct_routing_configs: request?.direct_routing_configs, + pin_protection_configs: request?.pin_protection_configs, + pin_routing_configs: request?.pin_routing_configs, + }; + + const response = await this.apiClient.sendRequest< + StreamResponse + >( + 'POST', + '/api/v2/video/sip/routing_rules', + undefined, + undefined, + body, + 'application/json', + ); + + decoders.SIPInboundRoutingRuleResponse?.(response.body); + + return { ...response.body, metadata: response.metadata }; + } + + async deleteSIPInboundRoutingRule(request: { + id: string; + }): Promise> { + const pathParams = { + id: request?.id, + }; + + const response = await this.apiClient.sendRequest< + StreamResponse + >('DELETE', '/api/v2/video/sip/routing_rules/{id}', pathParams, undefined); + + decoders.DeleteSIPInboundRoutingRuleResponse?.(response.body); + + return { ...response.body, metadata: response.metadata }; + } + + async updateSIPInboundRoutingRule( + request: UpdateSIPInboundRoutingRuleRequest & { id: string }, + ): Promise> { + const pathParams = { + id: request?.id, + }; + const body = { + name: request?.name, + called_numbers: request?.called_numbers, + trunk_ids: request?.trunk_ids, + caller_configs: request?.caller_configs, + caller_numbers: request?.caller_numbers, + call_configs: request?.call_configs, + direct_routing_configs: request?.direct_routing_configs, + pin_protection_configs: request?.pin_protection_configs, + pin_routing_configs: request?.pin_routing_configs, + }; + + const response = await this.apiClient.sendRequest< + StreamResponse + >( + 'PUT', + '/api/v2/video/sip/routing_rules/{id}', + pathParams, + undefined, + body, + 'application/json', + ); + + decoders.UpdateSIPInboundRoutingRuleResponse?.(response.body); + + return { ...response.body, metadata: response.metadata }; + } + + async listSIPTrunks(): Promise> { + const response = await this.apiClient.sendRequest< + StreamResponse + >('GET', '/api/v2/video/sip/trunks', undefined, undefined); + + decoders.ListSIPTrunksResponse?.(response.body); + + return { ...response.body, metadata: response.metadata }; + } + + async createSIPTrunk( + request: CreateSIPTrunkRequest, + ): Promise> { + const body = { + name: request?.name, + numbers: request?.numbers, + }; + + const response = await this.apiClient.sendRequest< + StreamResponse + >( + 'POST', + '/api/v2/video/sip/trunks', + undefined, + undefined, + body, + 'application/json', + ); + + decoders.CreateSIPTrunkResponse?.(response.body); + + return { ...response.body, metadata: response.metadata }; + } + + async deleteSIPTrunk(request: { + id: string; + }): Promise> { + const pathParams = { + id: request?.id, + }; + + const response = await this.apiClient.sendRequest< + StreamResponse + >('DELETE', '/api/v2/video/sip/trunks/{id}', pathParams, undefined); + + decoders.DeleteSIPTrunkResponse?.(response.body); + + return { ...response.body, metadata: response.metadata }; + } + + async updateSIPTrunk( + request: UpdateSIPTrunkRequest & { id: string }, + ): Promise> { + const pathParams = { + id: request?.id, + }; + const body = { + name: request?.name, + numbers: request?.numbers, + }; + + const response = await this.apiClient.sendRequest< + StreamResponse + >( + 'PUT', + '/api/v2/video/sip/trunks/{id}', + pathParams, + undefined, + body, + 'application/json', + ); + + decoders.UpdateSIPTrunkResponse?.(response.body); + + return { ...response.body, metadata: response.metadata }; + } + async queryAggregateCallStats( request?: QueryAggregateCallStatsRequest, ): Promise> {