@cloudflare/realtimekit 1.2.4-staging.6 → 1.2.4-staging.7
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.
- package/dist/ClientMock.cjs.js +2 -2
- package/dist/ClientMock.es.js +63 -76
- package/dist/EncryptionManager.cjs.js +1 -1
- package/dist/EncryptionManager.d.ts +520 -665
- package/dist/EncryptionManager.es.js +169 -169
- package/dist/browser.js +14 -16
- package/dist/dependencies.txt +1 -1
- package/dist/index.cjs.js +11 -13
- package/dist/index.d.ts +28 -173
- package/dist/index.es.js +6534 -6922
- package/dist/index.es5.js +7852 -8207
- package/dist/index.rn.js +11 -13
- package/dist/ts3.4/dist/EncryptionManager.d.ts +533 -676
- package/dist/ts3.4/dist/index.d.ts +27 -170
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1467,83 +1467,6 @@ interface DeleteChatMessageResponse {
|
|
|
1467
1467
|
*/
|
|
1468
1468
|
declare const DeleteChatMessageResponse: DeleteChatMessageResponse$Type;
|
|
1469
1469
|
|
|
1470
|
-
declare class LatestMessageAndUnreadCount$Type extends MessageType$1<LatestMessageAndUnreadCount> {
|
|
1471
|
-
constructor();
|
|
1472
|
-
}
|
|
1473
|
-
/**
|
|
1474
|
-
* @generated from protobuf message socket.chat.LatestMessageAndUnreadCount
|
|
1475
|
-
*/
|
|
1476
|
-
interface LatestMessageAndUnreadCount {
|
|
1477
|
-
/**
|
|
1478
|
-
* @generated from protobuf field: optional socket.chat.ChatMessage message = 1;
|
|
1479
|
-
*/
|
|
1480
|
-
message?: ChatMessage;
|
|
1481
|
-
/**
|
|
1482
|
-
* @generated from protobuf field: uint64 unread_count = 2 [jstype = JS_NUMBER];
|
|
1483
|
-
*/
|
|
1484
|
-
unreadCount: number;
|
|
1485
|
-
}
|
|
1486
|
-
/**
|
|
1487
|
-
* @generated MessageType for protobuf message socket.chat.LatestMessageAndUnreadCount
|
|
1488
|
-
*/
|
|
1489
|
-
declare const LatestMessageAndUnreadCount: LatestMessageAndUnreadCount$Type;
|
|
1490
|
-
declare class ChatChannel$Type extends MessageType$1<ChatChannel$1> {
|
|
1491
|
-
constructor();
|
|
1492
|
-
}
|
|
1493
|
-
/**
|
|
1494
|
-
* @generated from protobuf message socket.chat.ChatChannel
|
|
1495
|
-
*/
|
|
1496
|
-
interface ChatChannel$1 {
|
|
1497
|
-
/**
|
|
1498
|
-
* @generated from protobuf field: string chat_channel_id = 1;
|
|
1499
|
-
*/
|
|
1500
|
-
chatChannelId: string;
|
|
1501
|
-
/**
|
|
1502
|
-
* @generated from protobuf field: string display_name = 2;
|
|
1503
|
-
*/
|
|
1504
|
-
displayName: string;
|
|
1505
|
-
/**
|
|
1506
|
-
* @generated from protobuf field: optional string display_picture_url = 3;
|
|
1507
|
-
*/
|
|
1508
|
-
displayPictureUrl?: string;
|
|
1509
|
-
/**
|
|
1510
|
-
* @generated from protobuf field: string visibility = 4;
|
|
1511
|
-
*/
|
|
1512
|
-
visibility: string;
|
|
1513
|
-
/**
|
|
1514
|
-
* @generated from protobuf field: bool is_direct_message = 5;
|
|
1515
|
-
*/
|
|
1516
|
-
isDirectMessage: boolean;
|
|
1517
|
-
/**
|
|
1518
|
-
* @generated from protobuf field: socket.chat.LatestMessageAndUnreadCount latest_message_and_unread_count = 6;
|
|
1519
|
-
*/
|
|
1520
|
-
latestMessageAndUnreadCount?: LatestMessageAndUnreadCount;
|
|
1521
|
-
/**
|
|
1522
|
-
* @generated from protobuf field: repeated string target_user_ids = 7;
|
|
1523
|
-
*/
|
|
1524
|
-
targetUserIds: string[];
|
|
1525
|
-
}
|
|
1526
|
-
/**
|
|
1527
|
-
* @generated MessageType for protobuf message socket.chat.ChatChannel
|
|
1528
|
-
*/
|
|
1529
|
-
declare const ChatChannel$1: ChatChannel$Type;
|
|
1530
|
-
declare class GetChatChannelResponse$Type extends MessageType$1<GetChatChannelResponse> {
|
|
1531
|
-
constructor();
|
|
1532
|
-
}
|
|
1533
|
-
/**
|
|
1534
|
-
* @generated from protobuf message socket.chat.GetChatChannelResponse
|
|
1535
|
-
*/
|
|
1536
|
-
interface GetChatChannelResponse {
|
|
1537
|
-
/**
|
|
1538
|
-
* @generated from protobuf field: repeated socket.chat.ChatChannel chat_channels = 1;
|
|
1539
|
-
*/
|
|
1540
|
-
chatChannels: ChatChannel$1[];
|
|
1541
|
-
}
|
|
1542
|
-
/**
|
|
1543
|
-
* @generated MessageType for protobuf message socket.chat.GetChatChannelResponse
|
|
1544
|
-
*/
|
|
1545
|
-
declare const GetChatChannelResponse: GetChatChannelResponse$Type;
|
|
1546
|
-
|
|
1547
1470
|
declare class EnablePluginResponse$Type extends MessageType$1<EnablePluginResponse> {
|
|
1548
1471
|
constructor();
|
|
1549
1472
|
}
|
|
@@ -2953,48 +2876,6 @@ declare class TypedEventEmitter$1<Events extends EventMap$1 & WildCardEvent<Even
|
|
|
2953
2876
|
listenerCount<T extends StringKeyOf<Events>>(event: T): number;
|
|
2954
2877
|
}
|
|
2955
2878
|
|
|
2956
|
-
interface BasicParticipant {
|
|
2957
|
-
userId: string;
|
|
2958
|
-
name?: string;
|
|
2959
|
-
picture?: string;
|
|
2960
|
-
customParticipantId: string;
|
|
2961
|
-
}
|
|
2962
|
-
declare class BasicParticipantsMap extends CustomEventEmitter<'participantsUpdate'> {
|
|
2963
|
-
constructor(logger: Logger);
|
|
2964
|
-
__set(objId: string, obj: BasicParticipant): Map<string, BasicParticipant>;
|
|
2965
|
-
__clear(): void;
|
|
2966
|
-
get(objId: string): BasicParticipant;
|
|
2967
|
-
toArray(): BasicParticipant[];
|
|
2968
|
-
}
|
|
2969
|
-
|
|
2970
|
-
type ChatChannelSocketMessage = GetChatChannelResponse;
|
|
2971
|
-
interface ChatChannel {
|
|
2972
|
-
id: string;
|
|
2973
|
-
displayName: string;
|
|
2974
|
-
memberIds: string[];
|
|
2975
|
-
displayPictureUrl?: string;
|
|
2976
|
-
visibility?: string;
|
|
2977
|
-
isDirectMessage?: boolean;
|
|
2978
|
-
latestMessage?: Message;
|
|
2979
|
-
unreadCount: number;
|
|
2980
|
-
}
|
|
2981
|
-
interface UpdateChannelRequestPayload {
|
|
2982
|
-
memberIds?: string[];
|
|
2983
|
-
displayName?: string;
|
|
2984
|
-
displayPictureUrl?: string;
|
|
2985
|
-
visibility?: string;
|
|
2986
|
-
}
|
|
2987
|
-
declare class ChatChannelSocketHandler {
|
|
2988
|
-
get telemetry(): Telemetry;
|
|
2989
|
-
get logger(): Logger;
|
|
2990
|
-
constructor(context: Context<ContextState>, socketService: SocketService);
|
|
2991
|
-
createChannel(displayName: string, memberIds: string[], displayPictureUrl?: string, visibility?: string, isDirectMessage?: boolean): Promise<ChatChannel>;
|
|
2992
|
-
updateChannel(channelId: string, payload: UpdateChannelRequestPayload): Promise<ChatChannel>;
|
|
2993
|
-
static formatChannel(socketChannel: ChatChannel$1): ChatChannel;
|
|
2994
|
-
getChannelMembers(channelId: string): Promise<BasicParticipant[]>;
|
|
2995
|
-
on(event: number, handler: (socketMessage: ChatChannelSocketMessage) => void): void;
|
|
2996
|
-
}
|
|
2997
|
-
|
|
2998
2879
|
declare enum ChatMessageType {
|
|
2999
2880
|
TEXT = 0,
|
|
3000
2881
|
IMAGE = 1,
|
|
@@ -3003,7 +2884,6 @@ declare enum ChatMessageType {
|
|
|
3003
2884
|
}
|
|
3004
2885
|
type ChatSocketMessage = SendChatMessageToRoomResponse | SendChatMessageToPeersResponse | EditChatMessageResponse | DeleteChatMessageResponse;
|
|
3005
2886
|
interface SearchFilters {
|
|
3006
|
-
channelId?: string;
|
|
3007
2887
|
timestamp?: number;
|
|
3008
2888
|
limit?: number;
|
|
3009
2889
|
reversed?: boolean;
|
|
@@ -3017,19 +2897,15 @@ declare class ChatSocketHandler {
|
|
|
3017
2897
|
id: string;
|
|
3018
2898
|
payload: Uint8Array;
|
|
3019
2899
|
}>;
|
|
3020
|
-
getChatMessagesPaginated(timeStamp: number, size: number, reversed: boolean, offset?: number
|
|
2900
|
+
getChatMessagesPaginated(timeStamp: number, size: number, reversed: boolean, offset?: number): Promise<GetPaginatedChatMessageRoomResponse>;
|
|
3021
2901
|
sendMessageToRoom(message: string, messageType: ChatMessageType): void;
|
|
3022
2902
|
sendMessageToPeers(message: string, messageType: ChatMessageType, peerIds: string[]): void;
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
deleteMessage(chatId: string, channelId?: string): Promise<{
|
|
3027
|
-
channelId?: string;
|
|
2903
|
+
sendMessage(message: string, messageType: ChatMessageType, peerIds?: string[]): void;
|
|
2904
|
+
editMessage(chatId: string, message: string, payloadType: ChatMessageType, pinned?: boolean): Promise<ChatMessage>;
|
|
2905
|
+
deleteMessage(chatId: string): Promise<{
|
|
3028
2906
|
id: string;
|
|
3029
2907
|
}>;
|
|
3030
2908
|
searchMessages(query: string, filters: SearchFilters): Promise<ChatMessage[]>;
|
|
3031
|
-
getAllChannels(): Promise<ChatChannel[]>;
|
|
3032
|
-
markLastReadMessage(channelId: string, message: Message): Promise<string>;
|
|
3033
2909
|
setPinState(message: Message, pin: boolean): Promise<PinChatMessageResponse>;
|
|
3034
2910
|
on(event: number, handler: (socketMessage: ChatSocketMessage) => void): void;
|
|
3035
2911
|
}
|
|
@@ -3119,6 +2995,20 @@ type MediaConnectionState = {
|
|
|
3119
2995
|
};
|
|
3120
2996
|
};
|
|
3121
2997
|
|
|
2998
|
+
interface BasicParticipant {
|
|
2999
|
+
userId: string;
|
|
3000
|
+
name?: string;
|
|
3001
|
+
picture?: string;
|
|
3002
|
+
customParticipantId: string;
|
|
3003
|
+
}
|
|
3004
|
+
declare class BasicParticipantsMap extends CustomEventEmitter<'participantsUpdate'> {
|
|
3005
|
+
constructor(logger: Logger);
|
|
3006
|
+
__set(objId: string, obj: BasicParticipant): Map<string, BasicParticipant>;
|
|
3007
|
+
__clear(): void;
|
|
3008
|
+
get(objId: string): BasicParticipant;
|
|
3009
|
+
toArray(): BasicParticipant[];
|
|
3010
|
+
}
|
|
3011
|
+
|
|
3122
3012
|
type EventHandlerTypes = PeerInfoResponse | GetWaitingRoomRequests | RecordingEvent | UpdatePeersPresetResponse | PeerJoinBroadcastResponse | PeerJoinCompleteResponse | GlobalPeerPinningBroadcastResponse | PeerLeaveResponse | SelectedPeersResponse | SelectedPeersDiffResponse;
|
|
3123
3013
|
declare class RoomSocketHandler {
|
|
3124
3014
|
socket: SocketService;
|
|
@@ -3985,18 +3875,6 @@ type PresetV2CamelCased = {
|
|
|
3985
3875
|
text: boolean;
|
|
3986
3876
|
files: boolean;
|
|
3987
3877
|
};
|
|
3988
|
-
channel?: {
|
|
3989
|
-
canCreate: 'NONE' | 'PRIVATE' | 'PUBLIC' | 'ALL';
|
|
3990
|
-
canDelete: 'NONE' | 'PRIVATE' | 'PUBLIC' | 'ALL';
|
|
3991
|
-
canUpdate: 'NONE' | 'PRIVATE' | 'PUBLIC' | 'ALL';
|
|
3992
|
-
canReadAll: boolean;
|
|
3993
|
-
};
|
|
3994
|
-
message?: {
|
|
3995
|
-
canDelete: 'NONE' | 'SELF' | 'ALL';
|
|
3996
|
-
canEdit: 'NONE' | 'SELF' | 'ALL';
|
|
3997
|
-
deleteCutoffTimeSeconds: number;
|
|
3998
|
-
editCutoffTimeSeconds: number;
|
|
3999
|
-
};
|
|
4000
3878
|
};
|
|
4001
3879
|
isRecorder?: boolean;
|
|
4002
3880
|
recorderType: RecorderType$1;
|
|
@@ -4143,8 +4021,6 @@ declare class PermissionPreset extends TypedEventEmitter$1<PermissionEvents> {
|
|
|
4143
4021
|
get canProduceAudio(): Readonly<MediaProductionPermissionType>;
|
|
4144
4022
|
get chatPublic(): Readonly<PresetPermissions['chat']['public']>;
|
|
4145
4023
|
get chatPrivate(): Readonly<PresetPermissions['chat']['private']>;
|
|
4146
|
-
get chatChannel(): Readonly<PresetPermissions['chat']['channel']>;
|
|
4147
|
-
get chatMessage(): Readonly<PresetPermissions['chat']['message']>;
|
|
4148
4024
|
get connectedMeetings(): Readonly<PresetPermissions['connectedMeetings']>;
|
|
4149
4025
|
get hiddenParticipant(): Readonly<boolean>;
|
|
4150
4026
|
get showParticipantList(): Readonly<boolean>;
|
|
@@ -4392,7 +4268,7 @@ declare class APIClient extends API {
|
|
|
4392
4268
|
getPluginDetails(pluginId: string): Promise<PluginResponse>;
|
|
4393
4269
|
getPluginConfig(pluginBaseUrl: string): Promise<PluginConfig>;
|
|
4394
4270
|
authorizePlugin(pluginId: string): Promise<string>;
|
|
4395
|
-
getPresignedUrls(filename: string
|
|
4271
|
+
getPresignedUrls(filename: string): Promise<{
|
|
4396
4272
|
getLocation: any;
|
|
4397
4273
|
putLocation: any;
|
|
4398
4274
|
}>;
|
|
@@ -4432,8 +4308,6 @@ interface BaseMessage<T extends MessageType> {
|
|
|
4432
4308
|
pluginId?: string;
|
|
4433
4309
|
pinned?: boolean;
|
|
4434
4310
|
targetUserIds?: string[];
|
|
4435
|
-
channelId?: string;
|
|
4436
|
-
channelIndex?: string;
|
|
4437
4311
|
}
|
|
4438
4312
|
interface TextMessage extends BaseMessage<MessageType.text> {
|
|
4439
4313
|
message: string;
|
|
@@ -4494,28 +4368,21 @@ interface FileMessagePayload {
|
|
|
4494
4368
|
type MessagePayload = TextMessagePayload | ImageMessagePayload | FileMessagePayload | CustomMessagePayload;
|
|
4495
4369
|
interface ChatUpdateParams {
|
|
4496
4370
|
action: 'add' | 'edit' | 'delete';
|
|
4497
|
-
message: Message
|
|
4498
|
-
id: string;
|
|
4499
|
-
channelId: string;
|
|
4500
|
-
};
|
|
4371
|
+
message: Message;
|
|
4501
4372
|
messages: Message[];
|
|
4502
4373
|
}
|
|
4503
4374
|
type ChatEvents = {
|
|
4504
4375
|
['chatUpdate']: (payload: ChatUpdateParams) => void;
|
|
4505
4376
|
['pinMessage']: (payload: Omit<ChatUpdateParams, 'action'>) => void;
|
|
4506
4377
|
['unpinMessage']: (payload: Omit<ChatUpdateParams, 'action'>) => void;
|
|
4507
|
-
['channelCreate']: (channel: ChatChannel) => void;
|
|
4508
|
-
['channelMessageUpdate']: (channel: ChatChannel) => void;
|
|
4509
|
-
['channelUpdate']: (channel?: ChatChannel) => void;
|
|
4510
4378
|
['*']: (event: string, ...args: any[]) => void;
|
|
4511
4379
|
};
|
|
4512
4380
|
declare class Chat extends TypedEventEmitter$1<ChatEvents> {
|
|
4513
4381
|
messages: Message[];
|
|
4514
|
-
channels: ChatChannel[];
|
|
4515
4382
|
maxTextLimit: number;
|
|
4516
4383
|
get telemetry(): Telemetry;
|
|
4517
4384
|
setMaxTextLimit(limit: number): void;
|
|
4518
|
-
constructor(context: Context<ContextState>, chatSocketHandler: ChatSocketHandler,
|
|
4385
|
+
constructor(context: Context<ContextState>, chatSocketHandler: ChatSocketHandler, self: Self, participants: Participants);
|
|
4519
4386
|
private sendMessageInternal;
|
|
4520
4387
|
private sendTextMessageInternal;
|
|
4521
4388
|
private sendImageMessageInternal;
|
|
@@ -4530,11 +4397,11 @@ declare class Chat extends TypedEventEmitter$1<ChatEvents> {
|
|
|
4530
4397
|
sendImageMessage(image: File | ReactNativeFile, peerIds?: string[]): Promise<void>;
|
|
4531
4398
|
sendFileMessage(file: File | ReactNativeFile, peerIds?: string[]): Promise<void>;
|
|
4532
4399
|
sendMessage(message: MessagePayload, participantIds?: string[]): Promise<void>;
|
|
4533
|
-
editTextMessage(messageId: string, message: string
|
|
4534
|
-
editImageMessage(messageId: string, image: File | ReactNativeFile
|
|
4535
|
-
editFileMessage(messageId: string, file: File | ReactNativeFile
|
|
4536
|
-
editMessage(messageId: string, message: MessagePayload
|
|
4537
|
-
deleteMessage(messageId: string
|
|
4400
|
+
editTextMessage(messageId: string, message: string): Promise<void>;
|
|
4401
|
+
editImageMessage(messageId: string, image: File | ReactNativeFile): Promise<void>;
|
|
4402
|
+
editFileMessage(messageId: string, file: File | ReactNativeFile): Promise<void>;
|
|
4403
|
+
editMessage(messageId: string, message: MessagePayload): Promise<void>;
|
|
4404
|
+
deleteMessage(messageId: string): Promise<void>;
|
|
4538
4405
|
getMessagesByUser(userId: string): Message[];
|
|
4539
4406
|
getMessagesByType(type: keyof typeof MessageType): Message[];
|
|
4540
4407
|
pin(id: string): Promise<void>;
|
|
@@ -4548,22 +4415,11 @@ declare class Chat extends TypedEventEmitter$1<ChatEvents> {
|
|
|
4548
4415
|
type?: keyof typeof MessageType;
|
|
4549
4416
|
userId?: string;
|
|
4550
4417
|
}): Promise<Message[]>;
|
|
4551
|
-
getMessages(timeStamp: number, size: number, reversed: boolean, offset?: number
|
|
4418
|
+
getMessages(timeStamp: number, size: number, reversed: boolean, offset?: number): Promise<{
|
|
4552
4419
|
messages: Message[];
|
|
4553
4420
|
next: boolean;
|
|
4554
4421
|
}>;
|
|
4555
|
-
createChannel(channelName: string, memberIds: string[], options?: {
|
|
4556
|
-
displayPictureUrl?: string;
|
|
4557
|
-
visibility?: string;
|
|
4558
|
-
isDirectMessage?: boolean;
|
|
4559
|
-
}): Promise<ChatChannel>;
|
|
4560
|
-
updateChannel(channelId: string, payload: UpdateChannelRequestPayload): Promise<ChatChannel>;
|
|
4561
|
-
sendMessageToChannel(message: MessagePayload, channelId: string, options?: {
|
|
4562
|
-
replyTo?: Message;
|
|
4563
|
-
}): Promise<void>;
|
|
4564
|
-
getChannelMembers(channelId: string): Promise<BasicParticipant[]>;
|
|
4565
4422
|
searchMessages(query: string, filters: unknown): Promise<unknown[]>;
|
|
4566
|
-
markLastReadMessage(channelId: string, message: Message): Promise<void>;
|
|
4567
4423
|
get pinned(): Message[];
|
|
4568
4424
|
}
|
|
4569
4425
|
|
|
@@ -5156,7 +5012,6 @@ declare const ERROR_CODES: {
|
|
|
5156
5012
|
'0504': string;
|
|
5157
5013
|
'0505': string;
|
|
5158
5014
|
'0506': string;
|
|
5159
|
-
'0510': string;
|
|
5160
5015
|
'0600': string;
|
|
5161
5016
|
'0601': string;
|
|
5162
5017
|
'0602': string;
|
|
@@ -6062,4 +5917,4 @@ declare global {
|
|
|
6062
5917
|
}
|
|
6063
5918
|
}
|
|
6064
5919
|
|
|
6065
|
-
export { ActiveTab, ActiveTabType, AudioConsumerScoreStats, AudioMiddleware, AudioProducerScoreStats, BroadcastMessagePayload, CachedUserDetails,
|
|
5920
|
+
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 };
|