@cloudflare/realtimekit 1.2.4-staging.6 → 1.2.4-staging.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1348,6 +1348,36 @@ interface ChatMessage {
1348
1348
  * @generated MessageType for protobuf message socket.chat.ChatMessage
1349
1349
  */
1350
1350
  declare const ChatMessage: ChatMessage$Type;
1351
+ declare class GetPaginatedChatMessageFilters$Type extends MessageType$1<GetPaginatedChatMessageFilters> {
1352
+ constructor();
1353
+ }
1354
+ /**
1355
+ * @generated from protobuf message socket.chat.GetPaginatedChatMessageFilters
1356
+ */
1357
+ interface GetPaginatedChatMessageFilters {
1358
+ /**
1359
+ * @generated from protobuf oneof: filters
1360
+ */
1361
+ filters: {
1362
+ oneofKind: "pinned";
1363
+ /**
1364
+ * @generated from protobuf field: bool pinned = 1;
1365
+ */
1366
+ pinned: boolean;
1367
+ } | {
1368
+ oneofKind: "userId";
1369
+ /**
1370
+ * @generated from protobuf field: string user_id = 2;
1371
+ */
1372
+ userId: string;
1373
+ } | {
1374
+ oneofKind: undefined;
1375
+ };
1376
+ }
1377
+ /**
1378
+ * @generated MessageType for protobuf message socket.chat.GetPaginatedChatMessageFilters
1379
+ */
1380
+ declare const GetPaginatedChatMessageFilters: GetPaginatedChatMessageFilters$Type;
1351
1381
  declare class GetPaginatedChatMessageRoomResponse$Type extends MessageType$1<GetPaginatedChatMessageRoomResponse> {
1352
1382
  constructor();
1353
1383
  }
@@ -1460,82 +1490,6 @@ interface DeleteChatMessageResponse {
1460
1490
  * @generated MessageType for protobuf message socket.chat.DeleteChatMessageResponse
1461
1491
  */
1462
1492
  declare const DeleteChatMessageResponse: DeleteChatMessageResponse$Type;
1463
- declare class LatestMessageAndUnreadCount$Type extends MessageType$1<LatestMessageAndUnreadCount> {
1464
- constructor();
1465
- }
1466
- /**
1467
- * @generated from protobuf message socket.chat.LatestMessageAndUnreadCount
1468
- */
1469
- interface LatestMessageAndUnreadCount {
1470
- /**
1471
- * @generated from protobuf field: optional socket.chat.ChatMessage message = 1;
1472
- */
1473
- message?: ChatMessage;
1474
- /**
1475
- * @generated from protobuf field: uint64 unread_count = 2 [jstype = JS_NUMBER];
1476
- */
1477
- unreadCount: number;
1478
- }
1479
- /**
1480
- * @generated MessageType for protobuf message socket.chat.LatestMessageAndUnreadCount
1481
- */
1482
- declare const LatestMessageAndUnreadCount: LatestMessageAndUnreadCount$Type;
1483
- declare class ChatChannel$Type extends MessageType$1<ChatChannel$1> {
1484
- constructor();
1485
- }
1486
- /**
1487
- * @generated from protobuf message socket.chat.ChatChannel
1488
- */
1489
- interface ChatChannel$1 {
1490
- /**
1491
- * @generated from protobuf field: string chat_channel_id = 1;
1492
- */
1493
- chatChannelId: string;
1494
- /**
1495
- * @generated from protobuf field: string display_name = 2;
1496
- */
1497
- displayName: string;
1498
- /**
1499
- * @generated from protobuf field: optional string display_picture_url = 3;
1500
- */
1501
- displayPictureUrl?: string;
1502
- /**
1503
- * @generated from protobuf field: string visibility = 4;
1504
- */
1505
- visibility: string;
1506
- /**
1507
- * @generated from protobuf field: bool is_direct_message = 5;
1508
- */
1509
- isDirectMessage: boolean;
1510
- /**
1511
- * @generated from protobuf field: socket.chat.LatestMessageAndUnreadCount latest_message_and_unread_count = 6;
1512
- */
1513
- latestMessageAndUnreadCount?: LatestMessageAndUnreadCount;
1514
- /**
1515
- * @generated from protobuf field: repeated string target_user_ids = 7;
1516
- */
1517
- targetUserIds: string[];
1518
- }
1519
- /**
1520
- * @generated MessageType for protobuf message socket.chat.ChatChannel
1521
- */
1522
- declare const ChatChannel$1: ChatChannel$Type;
1523
- declare class GetChatChannelResponse$Type extends MessageType$1<GetChatChannelResponse> {
1524
- constructor();
1525
- }
1526
- /**
1527
- * @generated from protobuf message socket.chat.GetChatChannelResponse
1528
- */
1529
- interface GetChatChannelResponse {
1530
- /**
1531
- * @generated from protobuf field: repeated socket.chat.ChatChannel chat_channels = 1;
1532
- */
1533
- chatChannels: ChatChannel$1[];
1534
- }
1535
- /**
1536
- * @generated MessageType for protobuf message socket.chat.GetChatChannelResponse
1537
- */
1538
- declare const GetChatChannelResponse: GetChatChannelResponse$Type;
1539
1493
  declare class EnablePluginResponse$Type extends MessageType$1<EnablePluginResponse> {
1540
1494
  constructor();
1541
1495
  }
@@ -2929,46 +2883,6 @@ declare class TypedEventEmitter$1<Events extends EventMap$1 & WildCardEvent<Even
2929
2883
  listeners<T extends StringKeyOf<Events>>(event: T): Function[];
2930
2884
  listenerCount<T extends StringKeyOf<Events>>(event: T): number;
2931
2885
  }
2932
- interface BasicParticipant {
2933
- userId: string;
2934
- name?: string;
2935
- picture?: string;
2936
- customParticipantId: string;
2937
- }
2938
- declare class BasicParticipantsMap extends CustomEventEmitter<'participantsUpdate'> {
2939
- constructor(logger: Logger);
2940
- __set(objId: string, obj: BasicParticipant): Map<string, BasicParticipant>;
2941
- __clear(): void;
2942
- get(objId: string): BasicParticipant;
2943
- toArray(): BasicParticipant[];
2944
- }
2945
- type ChatChannelSocketMessage = GetChatChannelResponse;
2946
- interface ChatChannel {
2947
- id: string;
2948
- displayName: string;
2949
- memberIds: string[];
2950
- displayPictureUrl?: string;
2951
- visibility?: string;
2952
- isDirectMessage?: boolean;
2953
- latestMessage?: Message;
2954
- unreadCount: number;
2955
- }
2956
- interface UpdateChannelRequestPayload {
2957
- memberIds?: string[];
2958
- displayName?: string;
2959
- displayPictureUrl?: string;
2960
- visibility?: string;
2961
- }
2962
- declare class ChatChannelSocketHandler {
2963
- readonly telemetry: Telemetry;
2964
- readonly logger: Logger;
2965
- constructor(context: Context<ContextState>, socketService: SocketService);
2966
- createChannel(displayName: string, memberIds: string[], displayPictureUrl?: string, visibility?: string, isDirectMessage?: boolean): Promise<ChatChannel>;
2967
- updateChannel(channelId: string, payload: UpdateChannelRequestPayload): Promise<ChatChannel>;
2968
- static formatChannel(socketChannel: ChatChannel$1): ChatChannel;
2969
- getChannelMembers(channelId: string): Promise<BasicParticipant[]>;
2970
- on(event: number, handler: (socketMessage: ChatChannelSocketMessage) => void): void;
2971
- }
2972
2886
  declare enum ChatMessageType {
2973
2887
  TEXT = 0,
2974
2888
  IMAGE = 1,
@@ -2977,7 +2891,6 @@ declare enum ChatMessageType {
2977
2891
  }
2978
2892
  type ChatSocketMessage = SendChatMessageToRoomResponse | SendChatMessageToPeersResponse | EditChatMessageResponse | DeleteChatMessageResponse;
2979
2893
  interface SearchFilters {
2980
- channelId?: string;
2981
2894
  timestamp?: number;
2982
2895
  limit?: number;
2983
2896
  reversed?: boolean;
@@ -2991,19 +2904,15 @@ declare class ChatSocketHandler {
2991
2904
  id: string;
2992
2905
  payload: Uint8Array;
2993
2906
  }>;
2994
- getChatMessagesPaginated(timeStamp: number, size: number, reversed: boolean, offset?: number, channelId?: string): Promise<GetPaginatedChatMessageRoomResponse>;
2907
+ getChatMessagesPaginated(timeStamp: number, size: number, reversed: boolean, filters?: GetPaginatedChatMessageFilters['filters']): Promise<GetPaginatedChatMessageRoomResponse>;
2995
2908
  sendMessageToRoom(message: string, messageType: ChatMessageType): void;
2996
2909
  sendMessageToPeers(message: string, messageType: ChatMessageType, peerIds: string[]): void;
2997
- sendMessageToChannel(message: string, messageType: ChatMessageType, channelId: string): void;
2998
- sendMessage(message: string, messageType: ChatMessageType, peerIds?: string[], channelId?: string): void;
2999
- editMessage(chatId: string, message: string, payloadType: ChatMessageType, channelId?: string, pinned?: boolean): Promise<ChatMessage>;
3000
- deleteMessage(chatId: string, channelId?: string): Promise<{
3001
- channelId?: string;
2910
+ sendMessage(message: string, messageType: ChatMessageType, peerIds?: string[]): void;
2911
+ editMessage(chatId: string, message: string, payloadType: ChatMessageType, pinned?: boolean): Promise<ChatMessage>;
2912
+ deleteMessage(chatId: string): Promise<{
3002
2913
  id: string;
3003
2914
  }>;
3004
2915
  searchMessages(query: string, filters: SearchFilters): Promise<ChatMessage[]>;
3005
- getAllChannels(): Promise<ChatChannel[]>;
3006
- markLastReadMessage(channelId: string, message: Message): Promise<string>;
3007
2916
  setPinState(message: Message, pin: boolean): Promise<PinChatMessageResponse>;
3008
2917
  on(event: number, handler: (socketMessage: ChatSocketMessage) => void): void;
3009
2918
  }
@@ -3089,6 +2998,19 @@ type MediaConnectionState = {
3089
2998
  state: string;
3090
2999
  };
3091
3000
  };
3001
+ interface BasicParticipant {
3002
+ userId: string;
3003
+ name?: string;
3004
+ picture?: string;
3005
+ customParticipantId: string;
3006
+ }
3007
+ declare class BasicParticipantsMap extends CustomEventEmitter<'participantsUpdate'> {
3008
+ constructor(logger: Logger);
3009
+ __set(objId: string, obj: BasicParticipant): Map<string, BasicParticipant>;
3010
+ __clear(): void;
3011
+ get(objId: string): BasicParticipant;
3012
+ toArray(): BasicParticipant[];
3013
+ }
3092
3014
  type EventHandlerTypes = PeerInfoResponse | GetWaitingRoomRequests | RecordingEvent | UpdatePeersPresetResponse | PeerJoinBroadcastResponse | PeerJoinCompleteResponse | GlobalPeerPinningBroadcastResponse | PeerLeaveResponse | SelectedPeersResponse | SelectedPeersDiffResponse;
3093
3015
  declare class RoomSocketHandler {
3094
3016
  socket: SocketService;
@@ -3966,18 +3888,6 @@ type PresetV2CamelCased = {
3966
3888
  text: boolean;
3967
3889
  files: boolean;
3968
3890
  };
3969
- channel?: {
3970
- canCreate: 'NONE' | 'PRIVATE' | 'PUBLIC' | 'ALL';
3971
- canDelete: 'NONE' | 'PRIVATE' | 'PUBLIC' | 'ALL';
3972
- canUpdate: 'NONE' | 'PRIVATE' | 'PUBLIC' | 'ALL';
3973
- canReadAll: boolean;
3974
- };
3975
- message?: {
3976
- canDelete: 'NONE' | 'SELF' | 'ALL';
3977
- canEdit: 'NONE' | 'SELF' | 'ALL';
3978
- deleteCutoffTimeSeconds: number;
3979
- editCutoffTimeSeconds: number;
3980
- };
3981
3891
  };
3982
3892
  isRecorder?: boolean;
3983
3893
  recorderType: RecorderType$1;
@@ -4123,8 +4033,6 @@ declare class PermissionPreset extends TypedEventEmitter$1<PermissionEvents> {
4123
4033
  readonly canProduceAudio: Readonly<MediaProductionPermissionType>;
4124
4034
  readonly chatPublic: Readonly<PresetPermissions['chat']['public']>;
4125
4035
  readonly chatPrivate: Readonly<PresetPermissions['chat']['private']>;
4126
- readonly chatChannel: Readonly<PresetPermissions['chat']['channel']>;
4127
- readonly chatMessage: Readonly<PresetPermissions['chat']['message']>;
4128
4036
  readonly connectedMeetings: Readonly<PresetPermissions['connectedMeetings']>;
4129
4037
  readonly hiddenParticipant: Readonly<boolean>;
4130
4038
  readonly showParticipantList: Readonly<boolean>;
@@ -4367,7 +4275,7 @@ declare class APIClient extends API {
4367
4275
  getPluginDetails(pluginId: string): Promise<PluginResponse>;
4368
4276
  getPluginConfig(pluginBaseUrl: string): Promise<PluginConfig>;
4369
4277
  authorizePlugin(pluginId: string): Promise<string>;
4370
- getPresignedUrls(filename: string, viewType: string): Promise<{
4278
+ getPresignedUrls(filename: string): Promise<{
4371
4279
  getLocation: any;
4372
4280
  putLocation: any;
4373
4281
  }>;
@@ -4406,8 +4314,6 @@ interface BaseMessage<T extends MessageType> {
4406
4314
  pluginId?: string;
4407
4315
  pinned?: boolean;
4408
4316
  targetUserIds?: string[];
4409
- channelId?: string;
4410
- channelIndex?: string;
4411
4317
  }
4412
4318
  interface TextMessage extends BaseMessage<MessageType.text> {
4413
4319
  message: string;
@@ -4468,28 +4374,30 @@ interface FileMessagePayload {
4468
4374
  type MessagePayload = TextMessagePayload | ImageMessagePayload | FileMessagePayload | CustomMessagePayload;
4469
4375
  interface ChatUpdateParams {
4470
4376
  action: 'add' | 'edit' | 'delete';
4471
- message: Message | {
4472
- id: string;
4473
- channelId: string;
4474
- };
4377
+ message: Message;
4475
4378
  messages: Message[];
4476
4379
  }
4477
4380
  type ChatEvents = {
4478
4381
  ['chatUpdate']: (payload: ChatUpdateParams) => void;
4479
4382
  ['pinMessage']: (payload: Pick<ChatUpdateParams, Exclude<keyof ChatUpdateParams, 'action'>>) => void;
4480
4383
  ['unpinMessage']: (payload: Pick<ChatUpdateParams, Exclude<keyof ChatUpdateParams, 'action'>>) => void;
4481
- ['channelCreate']: (channel: ChatChannel) => void;
4482
- ['channelMessageUpdate']: (channel: ChatChannel) => void;
4483
- ['channelUpdate']: (channel?: ChatChannel) => void;
4484
4384
  ['*']: (event: string, ...args: any[]) => void;
4485
4385
  };
4386
+ interface FetchMessageOptions {
4387
+ timestamp?: number;
4388
+ offset: number;
4389
+ limit: number;
4390
+ direction: 'before' | 'after';
4391
+ }
4392
+ interface FetchPrivateMessagesOptions extends FetchMessageOptions {
4393
+ userId: string;
4394
+ }
4486
4395
  declare class Chat extends TypedEventEmitter$1<ChatEvents> {
4487
4396
  messages: Message[];
4488
- channels: ChatChannel[];
4489
4397
  maxTextLimit: number;
4490
4398
  readonly telemetry: Telemetry;
4491
4399
  setMaxTextLimit(limit: number): void;
4492
- constructor(context: Context<ContextState>, chatSocketHandler: ChatSocketHandler, chatChannelSocketHandler: ChatChannelSocketHandler, self: Self, participants: Participants);
4400
+ constructor(context: Context<ContextState>, chatSocketHandler: ChatSocketHandler, self: Self, participants: Participants);
4493
4401
  private sendMessageInternal;
4494
4402
  private sendTextMessageInternal;
4495
4403
  private sendImageMessageInternal;
@@ -4504,40 +4412,23 @@ declare class Chat extends TypedEventEmitter$1<ChatEvents> {
4504
4412
  sendImageMessage(image: File | ReactNativeFile, peerIds?: string[]): Promise<void>;
4505
4413
  sendFileMessage(file: File | ReactNativeFile, peerIds?: string[]): Promise<void>;
4506
4414
  sendMessage(message: MessagePayload, participantIds?: string[]): Promise<void>;
4507
- editTextMessage(messageId: string, message: string, channelId?: string): Promise<void>;
4508
- editImageMessage(messageId: string, image: File | ReactNativeFile, channelId?: string): Promise<void>;
4509
- editFileMessage(messageId: string, file: File | ReactNativeFile, channelId?: string): Promise<void>;
4510
- editMessage(messageId: string, message: MessagePayload, channelId?: string): Promise<void>;
4511
- deleteMessage(messageId: string, channelId?: string): Promise<void>;
4415
+ editTextMessage(messageId: string, message: string): Promise<void>;
4416
+ editImageMessage(messageId: string, image: File | ReactNativeFile): Promise<void>;
4417
+ editFileMessage(messageId: string, file: File | ReactNativeFile): Promise<void>;
4418
+ editMessage(messageId: string, message: MessagePayload): Promise<void>;
4419
+ deleteMessage(messageId: string): Promise<void>;
4512
4420
  getMessagesByUser(userId: string): Message[];
4513
4421
  getMessagesByType(type: keyof typeof MessageType): Message[];
4514
4422
  pin(id: string): Promise<void>;
4515
4423
  unpin(id: string): Promise<void>;
4516
- fetchMessages({ timestamp, offset, limit, direction, searchQuery, type, userId, }: {
4517
- timestamp?: number;
4518
- offset: number;
4519
- limit: number;
4520
- direction: 'before' | 'after';
4521
- searchQuery?: string;
4522
- type?: keyof typeof MessageType;
4523
- userId?: string;
4524
- }): Promise<Message[]>;
4525
- getMessages(timeStamp: number, size: number, reversed: boolean, offset?: number, channelId?: string): Promise<{
4424
+ fetchMessages({ timestamp, limit, direction, }: FetchMessageOptions): Promise<Message[]>;
4425
+ fetchPrivateMessages({ timestamp, limit, direction, userId, }: FetchPrivateMessagesOptions): Promise<Message[]>;
4426
+ fetchPinnedMessages({ timestamp, limit, direction, }: FetchMessageOptions): Promise<Message[]>;
4427
+ getMessages(timeStamp: number, size: number, reversed: boolean, offset?: number): Promise<{
4526
4428
  messages: Message[];
4527
4429
  next: boolean;
4528
4430
  }>;
4529
- createChannel(channelName: string, memberIds: string[], options?: {
4530
- displayPictureUrl?: string;
4531
- visibility?: string;
4532
- isDirectMessage?: boolean;
4533
- }): Promise<ChatChannel>;
4534
- updateChannel(channelId: string, payload: UpdateChannelRequestPayload): Promise<ChatChannel>;
4535
- sendMessageToChannel(message: MessagePayload, channelId: string, options?: {
4536
- replyTo?: Message;
4537
- }): Promise<void>;
4538
- getChannelMembers(channelId: string): Promise<BasicParticipant[]>;
4539
4431
  searchMessages(query: string, filters: unknown): Promise<unknown[]>;
4540
- markLastReadMessage(channelId: string, message: Message): Promise<void>;
4541
4432
  readonly pinned: Message[];
4542
4433
  }
4543
4434
  declare class PollSocketHandler {
@@ -5113,7 +5004,6 @@ declare const ERROR_CODES: {
5113
5004
  '0504': string;
5114
5005
  '0505': string;
5115
5006
  '0506': string;
5116
- '0510': string;
5117
5007
  '0600': string;
5118
5008
  '0601': string;
5119
5009
  '0602': string;
@@ -5992,4 +5882,4 @@ declare global {
5992
5882
  TransformStream?: any;
5993
5883
  }
5994
5884
  }
5995
- export { ActiveTab, ActiveTabType, AudioConsumerScoreStats, AudioMiddleware, AudioProducerScoreStats, BroadcastMessagePayload, CachedUserDetails, ChatChannel, ChatUpdateParams, ClientError, ConsumerScoreStats, CustomMessage, DeviceConfig, FileMessage, ImageMessage, JoinedPeer, LeaveRoomState, LivestreamIngestionCredentials, LivestreamState, LogData, MediaConnectionState, MediaConnectionUpdate, MediaConstraints, MediaKind, MediaPermission, Message, ProducerScoreStats, BasicParticipant as RTKBasicParticipant, BasicParticipantsMap as RTKBasicParticipantsMap, RTKChat, ClientOptions as RTKClientOptions, RTKConfigOptions, RTKConnectedMeetings, RTKLivestream, RTKLogger, RTKMeta, RTKParticipant, RTKParticipantMap, RTKParticipants, RTKPermissionsPreset, RTKPlugin, RTKPluginMap, RTKPlugins, RTKPolls, RTKRecording, RTKSelf, RTKSelfMedia, RTKStore, StoreData as RTKStoreData, RateLimitConfig as RTKStoreRateLimitConfig, RTKThemePreset, RecordingState, RequestToJoinType, SocketConnectionState, StageStatus, StartLivestreamConfig, TextMessage, UserDetailsResponseV2, VideoConsumerScoreStats, VideoMiddleware, VideoProducerScoreStats, VideoQualityConstraints, Client as default, LeaveRoomState as leaveRoomState };
5885
+ export { ActiveTab, ActiveTabType, AudioConsumerScoreStats, AudioMiddleware, AudioProducerScoreStats, BroadcastMessagePayload, CachedUserDetails, ChatUpdateParams, ClientError, ConsumerScoreStats, CustomMessage, DeviceConfig, FileMessage, ImageMessage, JoinedPeer, LeaveRoomState, LivestreamIngestionCredentials, LivestreamState, LogData, MediaConnectionState, MediaConnectionUpdate, MediaConstraints, MediaKind, MediaPermission, Message, ProducerScoreStats, BasicParticipant as RTKBasicParticipant, BasicParticipantsMap as RTKBasicParticipantsMap, RTKChat, ClientOptions as RTKClientOptions, RTKConfigOptions, RTKConnectedMeetings, RTKLivestream, RTKLogger, RTKMeta, RTKParticipant, RTKParticipantMap, RTKParticipants, RTKPermissionsPreset, RTKPlugin, RTKPluginMap, RTKPlugins, RTKPolls, RTKRecording, RTKSelf, RTKSelfMedia, RTKStore, StoreData as RTKStoreData, RateLimitConfig as RTKStoreRateLimitConfig, RTKThemePreset, RecordingState, RequestToJoinType, SocketConnectionState, StageStatus, StartLivestreamConfig, TextMessage, UserDetailsResponseV2, VideoConsumerScoreStats, VideoMiddleware, VideoProducerScoreStats, VideoQualityConstraints, Client as default, LeaveRoomState as leaveRoomState };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudflare/realtimekit",
3
- "version": "1.2.4-staging.6",
3
+ "version": "1.2.4-staging.8",
4
4
  "description": "A real-time video and audio SDK for building custom, collaborative communication experiences.",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.es.js",
@@ -97,7 +97,7 @@
97
97
  "@types/uuid": "^8.3.4",
98
98
  "type-fest": "^2.12.1",
99
99
  "@dyteinternals/callstats": "7.2.7",
100
- "@dyteinternals/proto-entities": "2.110.5",
100
+ "@dyteinternals/proto-entities": "2.111.0",
101
101
  "@dyteinternals/sockrates-client": "1.8.5",
102
102
  "@dyteinternals/utils": "3.4.0"
103
103
  },