diff --git a/CHANGELOG.md b/CHANGELOG.md index 3043790..1c1855e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,66 +9,57 @@ ## [0.4.24](https://github.com/GetStream/stream-node/compare/v0.4.23...v0.4.24) (2025-05-06) - ### Features -* empty commit to trigger release ([c0890a8](https://github.com/GetStream/stream-node/commit/c0890a8d8b7adc96d4d81717220159321e924480)) +- empty commit to trigger release ([c0890a8](https://github.com/GetStream/stream-node/commit/c0890a8d8b7adc96d4d81717220159321e924480)) ## [0.4.23](https://github.com/GetStream/stream-node/compare/v0.4.22...v0.4.23) (2025-04-30) - ### Features -* update to v171.1.7 ([#107](https://github.com/GetStream/stream-node/issues/107)) ([dd442f0](https://github.com/GetStream/stream-node/commit/dd442f0e6b9acc465781cb748e5c5a03dd51624c)) +- update to v171.1.7 ([#107](https://github.com/GetStream/stream-node/issues/107)) ([dd442f0](https://github.com/GetStream/stream-node/commit/dd442f0e6b9acc465781cb748e5c5a03dd51624c)) ## [0.4.22](https://github.com/GetStream/stream-node/compare/v0.4.21...v0.4.22) (2025-04-09) - ### Bug Fixes -* handle missing optional dependency in declarations ([#103](https://github.com/GetStream/stream-node/issues/103)) ([eb271c5](https://github.com/GetStream/stream-node/commit/eb271c5f3bfb6002d341323af25beabd15516ef2)) +- handle missing optional dependency in declarations ([#103](https://github.com/GetStream/stream-node/issues/103)) ([eb271c5](https://github.com/GetStream/stream-node/commit/eb271c5f3bfb6002d341323af25beabd15516ef2)) ## [0.4.21](https://github.com/GetStream/stream-node/compare/v0.4.20...v0.4.21) (2025-04-08) - ### Bug Fixes -* remove undici dependency ([#101](https://github.com/GetStream/stream-node/issues/101)) ([c943be1](https://github.com/GetStream/stream-node/commit/c943be1b2871b2b010dd4b29d690c46ecacda23b)) +- remove undici dependency ([#101](https://github.com/GetStream/stream-node/issues/101)) ([c943be1](https://github.com/GetStream/stream-node/commit/c943be1b2871b2b010dd4b29d690c46ecacda23b)) ## [0.4.20](https://github.com/GetStream/stream-node/compare/v0.4.19...v0.4.20) (2025-04-07) - ### Features -* set max connections to 100, allow integrators to configure Fetch API ([#98](https://github.com/GetStream/stream-node/issues/98)) ([b044b59](https://github.com/GetStream/stream-node/commit/b044b599867a69b33b3aa9d989d1c1e3277dc92f)) +- set max connections to 100, allow integrators to configure Fetch API ([#98](https://github.com/GetStream/stream-node/issues/98)) ([b044b59](https://github.com/GetStream/stream-node/commit/b044b599867a69b33b3aa9d989d1c1e3277dc92f)) ## [0.4.19](https://github.com/GetStream/stream-node/compare/v0.4.18...v0.4.19) (2025-03-17) - ### Features -* update to API spec v163.0.0 ([#96](https://github.com/GetStream/stream-node/issues/96)) ([dcdfea8](https://github.com/GetStream/stream-node/commit/dcdfea8cfbf83b0ef3426426909c844424f682ab)) +- update to API spec v163.0.0 ([#96](https://github.com/GetStream/stream-node/issues/96)) ([dcdfea8](https://github.com/GetStream/stream-node/commit/dcdfea8cfbf83b0ef3426426909c844424f682ab)) ## [0.4.18](https://github.com/GetStream/stream-node/compare/v0.4.17...v0.4.18) (2025-03-10) - ### Bug Fixes -* support realtime AI model overrides ([#94](https://github.com/GetStream/stream-node/issues/94)) ([1071f75](https://github.com/GetStream/stream-node/commit/1071f75aaf7ffb029f8c3c4c06465e81abf341d6)) +- support realtime AI model overrides ([#94](https://github.com/GetStream/stream-node/issues/94)) ([1071f75](https://github.com/GetStream/stream-node/commit/1071f75aaf7ffb029f8c3c4c06465e81abf341d6)) ## [0.4.17](https://github.com/GetStream/stream-node/compare/v0.4.16...v0.4.17) (2025-03-06) - ### Bug Fixes -* use an exact version of @stream-io/openai-realtime-api ([#92](https://github.com/GetStream/stream-node/issues/92)) ([d6f0419](https://github.com/GetStream/stream-node/commit/d6f0419f924bfdadbb44d2b12b44a664bb4b39a6)) +- use an exact version of @stream-io/openai-realtime-api ([#92](https://github.com/GetStream/stream-node/issues/92)) ([d6f0419](https://github.com/GetStream/stream-node/commit/d6f0419f924bfdadbb44d2b12b44a664bb4b39a6)) ## [0.4.16](https://github.com/GetStream/stream-node/compare/v0.4.15...v0.4.16) (2025-02-25) - ### Bug Fixes -* update changelog ([#89](https://github.com/GetStream/stream-node/issues/89)) ([1b46c91](https://github.com/GetStream/stream-node/commit/1b46c919ccc5a98414ca441b833020743217e95d)) +- update changelog ([#89](https://github.com/GetStream/stream-node/issues/89)) ([1b46c91](https://github.com/GetStream/stream-node/commit/1b46c919ccc5a98414ca441b833020743217e95d)) ## [0.4.15](https://github.com/GetStream/stream-node/compare/v0.4.14...v0.4.15) (2025-02-25) diff --git a/__tests__/ring-call.test.ts b/__tests__/ring-call.test.ts new file mode 100644 index 0000000..e6235fc --- /dev/null +++ b/__tests__/ring-call.test.ts @@ -0,0 +1,67 @@ +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${uuidv4()}`; + 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 }); + } + }); +}); diff --git a/src/StreamCall.ts b/src/StreamCall.ts index d7b16f6..45a62b6 100644 --- a/src/StreamCall.ts +++ b/src/StreamCall.ts @@ -9,6 +9,15 @@ export class StreamCall extends CallApi { create = this.getOrCreate; + 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/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 002ee56..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,37 +168,6 @@ decoders.CallResponse = (input?: Record) => { return decode(typeMappings, input); }; -decoders.CallSession = (input?: Record) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - active_sf_us: { type: 'SFUIDLastSeen', isSingle: false }, - - participants: { type: 'CallParticipant', isSingle: false }, - - accepted_by: { type: 'DatetimeType', isSingle: false }, - - missed_by: { type: 'DatetimeType', isSingle: false }, - - rejected_by: { type: 'DatetimeType', isSingle: false }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - - ended_at: { type: 'DatetimeType', isSingle: true }, - - live_ended_at: { type: 'DatetimeType', isSingle: true }, - - live_started_at: { type: 'DatetimeType', isSingle: true }, - - ring_at: { type: 'DatetimeType', isSingle: true }, - - started_at: { type: 'DatetimeType', isSingle: true }, - - timer_ends_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - decoders.CallSessionResponse = (input?: Record) => { const typeMappings: TypeMapping = { participants: { type: 'CallParticipantResponse', isSingle: false }, @@ -398,6 +276,8 @@ decoders.Channel = (input?: Record) => { last_message_at: { type: 'DatetimeType', isSingle: true }, + active_live_locations: { type: 'SharedLocation', isSingle: false }, + invites: { type: 'ChannelMember', isSingle: false }, members: { type: 'ChannelMember', isSingle: false }, @@ -538,6 +418,11 @@ decoders.ChannelStateResponse = (input?: Record) => { hide_messages_before: { type: 'DatetimeType', isSingle: true }, + active_live_locations: { + type: 'SharedLocationResponseData', + isSingle: false, + }, + pending_messages: { type: 'PendingMessageResponse', isSingle: false }, read: { type: 'ReadStateResponse', isSingle: false }, @@ -567,6 +452,11 @@ decoders.ChannelStateResponseFields = (input?: Record) => { hide_messages_before: { type: 'DatetimeType', isSingle: true }, + active_live_locations: { + type: 'SharedLocationResponseData', + isSingle: false, + }, + pending_messages: { type: 'PendingMessageResponse', isSingle: false }, read: { type: 'ReadStateResponse', isSingle: false }, @@ -604,7 +494,7 @@ decoders.ChatActivityStatsResponse = (input?: Record) => { decoders.CheckResponse = (input?: Record) => { const typeMappings: TypeMapping = { - item: { type: 'ReviewQueueItem', isSingle: true }, + item: { type: 'ReviewQueueItemResponse', isSingle: true }, }; return decode(typeMappings, input); }; @@ -774,27 +664,6 @@ decoders.EgressRTMPResponse = (input?: Record) => { return decode(typeMappings, input); }; -decoders.EntityCreator = (input?: Record) => { - const typeMappings: TypeMapping = { - ban_expires: { type: 'DatetimeType', isSingle: true }, - - created_at: { type: 'DatetimeType', isSingle: true }, - - deactivated_at: { type: 'DatetimeType', isSingle: true }, - - deleted_at: { type: 'DatetimeType', isSingle: true }, - - last_active: { type: 'DatetimeType', isSingle: true }, - - last_engaged_at: { type: 'DatetimeType', isSingle: true }, - - revoke_tokens_issued_before: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - }; - return decode(typeMappings, input); -}; - decoders.EntityCreatorResponse = (input?: Record) => { const typeMappings: TypeMapping = { created_at: { type: 'DatetimeType', isSingle: true }, @@ -848,19 +717,6 @@ decoders.ExportUserResponse = (input?: Record) => { return decode(typeMappings, input); }; -decoders.Flag = (input?: Record) => { - const typeMappings: TypeMapping = { - created_at: { type: 'DatetimeType', isSingle: true }, - - updated_at: { type: 'DatetimeType', isSingle: true }, - - review_queue_item: { type: 'ReviewQueueItem', isSingle: true }, - - user: { type: 'User', isSingle: true }, - }; - return decode(typeMappings, input); -}; - decoders.FlagDetails = (input?: Record) => { const typeMappings: TypeMapping = { automod: { type: 'AutomodDetails', isSingle: true }, @@ -1217,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); @@ -1330,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); }; @@ -1378,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 }, }; @@ -1846,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 }, @@ -1911,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 }, @@ -1962,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); }; @@ -2011,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 }, @@ -2020,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 b746d0e..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; @@ -2010,6 +2004,8 @@ export interface Channel { team?: string; + active_live_locations?: SharedLocation[]; + invites?: ChannelMember[]; members?: ChannelMember[]; @@ -2058,6 +2054,8 @@ export interface ChannelConfig { search: boolean; + shared_locations: boolean; + skip_last_msg_update_for_system_msgs: boolean; typing_events: boolean; @@ -2122,6 +2120,8 @@ export interface ChannelConfigWithInfo { search: boolean; + shared_locations: boolean; + skip_last_msg_update_for_system_msgs: boolean; typing_events: boolean; @@ -2394,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', @@ -2486,6 +2487,8 @@ export interface ChannelStateResponse { watcher_count?: number; + active_live_locations?: SharedLocationResponseData[]; + pending_messages?: PendingMessageResponse[]; read?: ReadStateResponse[]; @@ -2516,6 +2519,8 @@ export interface ChannelStateResponseFields { watcher_count?: number; + active_live_locations?: SharedLocationResponseData[]; + pending_messages?: PendingMessageResponse[]; read?: ReadStateResponse[]; @@ -2582,6 +2587,8 @@ export interface ChannelTypeConfig { search: boolean; + shared_locations: boolean; + skip_last_msg_update_for_system_msgs: boolean; typing_events: boolean; @@ -2755,7 +2762,7 @@ export interface CheckResponse { task_id?: string; - item?: ReviewQueueItem; + item?: ReviewQueueItemResponse; } export interface CheckSNSRequest { @@ -2869,6 +2876,8 @@ export interface ConfigOverrides { replies?: boolean; + shared_locations?: boolean; + typing_events?: boolean; uploads?: boolean; @@ -2999,6 +3008,8 @@ export interface CreateChannelTypeRequest { search?: boolean; + shared_locations?: boolean; + skip_last_msg_update_for_system_msgs?: boolean; typing_events?: boolean; @@ -3055,6 +3066,8 @@ export interface CreateChannelTypeResponse { search: boolean; + shared_locations: boolean; + skip_last_msg_update_for_system_msgs: boolean; typing_events: boolean; @@ -4359,6 +4372,8 @@ export interface GetChannelTypeResponse { search: boolean; + shared_locations: boolean; + skip_last_msg_update_for_system_msgs: boolean; typing_events: boolean; @@ -4475,10 +4490,6 @@ export interface GetOGResponse { image_url?: string; - latitude?: number; - - longitude?: number; - og_scrape_url?: string; original_height?: number; @@ -4487,8 +4498,6 @@ export interface GetOGResponse { pretext?: string; - stopped_sharing?: boolean; - text?: string; thumb_url?: string; @@ -4839,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 { @@ -5135,6 +5156,8 @@ export interface Message { reminder?: MessageReminder; + shared_location?: SharedLocation; + user?: User; } @@ -5383,6 +5406,8 @@ export interface MessageRequest { custom?: Record; + shared_location?: SharedLocation; + user?: UserRequest; } @@ -5468,6 +5493,8 @@ export interface MessageResponse { reaction_groups?: Record; reminder?: ReminderResponseData; + + shared_location?: SharedLocationResponseData; } export interface MessageStatsResponse { @@ -5618,6 +5645,8 @@ export interface MessageWithChannelResponse { reaction_groups?: Record; reminder?: ReminderResponseData; + + shared_location?: SharedLocationResponseData; } export interface ModerationActionConfig { @@ -5695,7 +5724,7 @@ export interface ModerationFlagResponse { moderation_payload?: ModerationPayload; - review_queue_item?: ReviewQueueItem; + review_queue_item?: ReviewQueueItemResponse; user?: UserResponse; } @@ -5973,6 +6002,8 @@ export interface OwnUser { custom: Record; + total_unread_count_by_team: Record; + deactivated_at?: Date; deleted_at?: Date; @@ -6052,6 +6083,8 @@ export interface OwnUserResponse { push_preferences?: PushPreferences; teams_role?: Record; + + total_unread_count_by_team?: Record; } export interface PagerResponse { @@ -7625,6 +7658,8 @@ export interface ReviewQueueItem { teams: string[]; + completed_at: NullTime; + reviewed_at: NullTime; activity?: EnrichedActivity; @@ -8002,6 +8037,8 @@ export interface SearchResultMessage { reaction_groups?: Record; reminder?: ReminderResponseData; + + shared_location?: SharedLocationResponseData; } export interface SearchWarning { @@ -8148,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; @@ -8422,7 +8539,7 @@ export interface SubmitActionRequest { export interface SubmitActionResponse { duration: string; - item?: ReviewQueueItem; + item?: ReviewQueueItemResponse; } export interface SubscriberStatsResponse { @@ -8927,6 +9044,8 @@ export interface UnreadCountsResponse { channels: UnreadCountsChannel[]; threads: UnreadCountsThread[]; + + total_unread_count_by_team: Record; } export interface UnreadCountsThread { @@ -9200,6 +9319,8 @@ export interface UpdateChannelTypeRequest { search?: boolean; + shared_locations?: boolean; + skip_last_msg_update_for_system_msgs?: boolean; typing_events?: boolean; @@ -9260,6 +9381,8 @@ export interface UpdateChannelTypeResponse { search: boolean; + shared_locations: boolean; + skip_last_msg_update_for_system_msgs: boolean; typing_events: boolean; @@ -9333,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[]; @@ -10184,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 0a7960e..d8bfb30 100644 --- a/src/gen/video/CallApi.ts +++ b/src/gen/video/CallApi.ts @@ -31,10 +31,10 @@ import { StartFrameRecordingRequest, StartFrameRecordingResponse, StartHLSBroadcastingResponse, - StartRTMPBroadcastsRequest, - StartRTMPBroadcastsResponse, StartRecordingRequest, StartRecordingResponse, + StartRTMPBroadcastsRequest, + StartRTMPBroadcastsResponse, StartTranscriptionRequest, StartTranscriptionResponse, StopAllRTMPBroadcastsResponse, @@ -44,9 +44,9 @@ import { StopHLSBroadcastingResponse, StopLiveRequest, StopLiveResponse, + StopRecordingResponse, StopRTMPBroadcastsRequest, StopRTMPBroadcastsResponse, - StopRecordingResponse, StopTranscriptionRequest, StopTranscriptionResponse, UnblockUserRequest, @@ -73,6 +73,8 @@ 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 }); }; diff --git a/src/gen/video/VideoApi.ts b/src/gen/video/VideoApi.ts index 1beca82..173def0 100644 --- a/src/gen/video/VideoApi.ts +++ b/src/gen/video/VideoApi.ts @@ -33,10 +33,10 @@ import { QueryCallMembersResponse, QueryCallParticipantsRequest, QueryCallParticipantsResponse, - QueryCallStatsRequest, - QueryCallStatsResponse, QueryCallsRequest, QueryCallsResponse, + QueryCallStatsRequest, + QueryCallStatsResponse, QueryUserFeedbackRequest, QueryUserFeedbackResponse, Response, @@ -47,10 +47,10 @@ import { StartFrameRecordingRequest, StartFrameRecordingResponse, StartHLSBroadcastingResponse, - StartRTMPBroadcastsRequest, - StartRTMPBroadcastsResponse, StartRecordingRequest, StartRecordingResponse, + StartRTMPBroadcastsRequest, + StartRTMPBroadcastsResponse, StartTranscriptionRequest, StartTranscriptionResponse, StopAllRTMPBroadcastsResponse, @@ -60,9 +60,9 @@ import { StopHLSBroadcastingResponse, StopLiveRequest, StopLiveResponse, + StopRecordingResponse, StopRTMPBroadcastsRequest, StopRTMPBroadcastsResponse, - StopRecordingResponse, StopTranscriptionRequest, StopTranscriptionResponse, UnblockUserRequest, @@ -153,12 +153,16 @@ export class VideoApi extends BaseApi { 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,