@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
|
@@ -1460,82 +1460,6 @@ interface DeleteChatMessageResponse {
|
|
|
1460
1460
|
* @generated MessageType for protobuf message socket.chat.DeleteChatMessageResponse
|
|
1461
1461
|
*/
|
|
1462
1462
|
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
1463
|
declare class EnablePluginResponse$Type extends MessageType$1<EnablePluginResponse> {
|
|
1540
1464
|
constructor();
|
|
1541
1465
|
}
|
|
@@ -2929,46 +2853,6 @@ declare class TypedEventEmitter$1<Events extends EventMap$1 & WildCardEvent<Even
|
|
|
2929
2853
|
listeners<T extends StringKeyOf<Events>>(event: T): Function[];
|
|
2930
2854
|
listenerCount<T extends StringKeyOf<Events>>(event: T): number;
|
|
2931
2855
|
}
|
|
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
2856
|
declare enum ChatMessageType {
|
|
2973
2857
|
TEXT = 0,
|
|
2974
2858
|
IMAGE = 1,
|
|
@@ -2977,7 +2861,6 @@ declare enum ChatMessageType {
|
|
|
2977
2861
|
}
|
|
2978
2862
|
type ChatSocketMessage = SendChatMessageToRoomResponse | SendChatMessageToPeersResponse | EditChatMessageResponse | DeleteChatMessageResponse;
|
|
2979
2863
|
interface SearchFilters {
|
|
2980
|
-
channelId?: string;
|
|
2981
2864
|
timestamp?: number;
|
|
2982
2865
|
limit?: number;
|
|
2983
2866
|
reversed?: boolean;
|
|
@@ -2991,19 +2874,15 @@ declare class ChatSocketHandler {
|
|
|
2991
2874
|
id: string;
|
|
2992
2875
|
payload: Uint8Array;
|
|
2993
2876
|
}>;
|
|
2994
|
-
getChatMessagesPaginated(timeStamp: number, size: number, reversed: boolean, offset?: number
|
|
2877
|
+
getChatMessagesPaginated(timeStamp: number, size: number, reversed: boolean, offset?: number): Promise<GetPaginatedChatMessageRoomResponse>;
|
|
2995
2878
|
sendMessageToRoom(message: string, messageType: ChatMessageType): void;
|
|
2996
2879
|
sendMessageToPeers(message: string, messageType: ChatMessageType, peerIds: string[]): void;
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
deleteMessage(chatId: string, channelId?: string): Promise<{
|
|
3001
|
-
channelId?: string;
|
|
2880
|
+
sendMessage(message: string, messageType: ChatMessageType, peerIds?: string[]): void;
|
|
2881
|
+
editMessage(chatId: string, message: string, payloadType: ChatMessageType, pinned?: boolean): Promise<ChatMessage>;
|
|
2882
|
+
deleteMessage(chatId: string): Promise<{
|
|
3002
2883
|
id: string;
|
|
3003
2884
|
}>;
|
|
3004
2885
|
searchMessages(query: string, filters: SearchFilters): Promise<ChatMessage[]>;
|
|
3005
|
-
getAllChannels(): Promise<ChatChannel[]>;
|
|
3006
|
-
markLastReadMessage(channelId: string, message: Message): Promise<string>;
|
|
3007
2886
|
setPinState(message: Message, pin: boolean): Promise<PinChatMessageResponse>;
|
|
3008
2887
|
on(event: number, handler: (socketMessage: ChatSocketMessage) => void): void;
|
|
3009
2888
|
}
|
|
@@ -3089,6 +2968,19 @@ type MediaConnectionState = {
|
|
|
3089
2968
|
state: string;
|
|
3090
2969
|
};
|
|
3091
2970
|
};
|
|
2971
|
+
interface BasicParticipant {
|
|
2972
|
+
userId: string;
|
|
2973
|
+
name?: string;
|
|
2974
|
+
picture?: string;
|
|
2975
|
+
customParticipantId: string;
|
|
2976
|
+
}
|
|
2977
|
+
declare class BasicParticipantsMap extends CustomEventEmitter<'participantsUpdate'> {
|
|
2978
|
+
constructor(logger: Logger);
|
|
2979
|
+
__set(objId: string, obj: BasicParticipant): Map<string, BasicParticipant>;
|
|
2980
|
+
__clear(): void;
|
|
2981
|
+
get(objId: string): BasicParticipant;
|
|
2982
|
+
toArray(): BasicParticipant[];
|
|
2983
|
+
}
|
|
3092
2984
|
type EventHandlerTypes = PeerInfoResponse | GetWaitingRoomRequests | RecordingEvent | UpdatePeersPresetResponse | PeerJoinBroadcastResponse | PeerJoinCompleteResponse | GlobalPeerPinningBroadcastResponse | PeerLeaveResponse | SelectedPeersResponse | SelectedPeersDiffResponse;
|
|
3093
2985
|
declare class RoomSocketHandler {
|
|
3094
2986
|
socket: SocketService;
|
|
@@ -3966,18 +3858,6 @@ type PresetV2CamelCased = {
|
|
|
3966
3858
|
text: boolean;
|
|
3967
3859
|
files: boolean;
|
|
3968
3860
|
};
|
|
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
3861
|
};
|
|
3982
3862
|
isRecorder?: boolean;
|
|
3983
3863
|
recorderType: RecorderType$1;
|
|
@@ -4123,8 +4003,6 @@ declare class PermissionPreset extends TypedEventEmitter$1<PermissionEvents> {
|
|
|
4123
4003
|
readonly canProduceAudio: Readonly<MediaProductionPermissionType>;
|
|
4124
4004
|
readonly chatPublic: Readonly<PresetPermissions['chat']['public']>;
|
|
4125
4005
|
readonly chatPrivate: Readonly<PresetPermissions['chat']['private']>;
|
|
4126
|
-
readonly chatChannel: Readonly<PresetPermissions['chat']['channel']>;
|
|
4127
|
-
readonly chatMessage: Readonly<PresetPermissions['chat']['message']>;
|
|
4128
4006
|
readonly connectedMeetings: Readonly<PresetPermissions['connectedMeetings']>;
|
|
4129
4007
|
readonly hiddenParticipant: Readonly<boolean>;
|
|
4130
4008
|
readonly showParticipantList: Readonly<boolean>;
|
|
@@ -4367,7 +4245,7 @@ declare class APIClient extends API {
|
|
|
4367
4245
|
getPluginDetails(pluginId: string): Promise<PluginResponse>;
|
|
4368
4246
|
getPluginConfig(pluginBaseUrl: string): Promise<PluginConfig>;
|
|
4369
4247
|
authorizePlugin(pluginId: string): Promise<string>;
|
|
4370
|
-
getPresignedUrls(filename: string
|
|
4248
|
+
getPresignedUrls(filename: string): Promise<{
|
|
4371
4249
|
getLocation: any;
|
|
4372
4250
|
putLocation: any;
|
|
4373
4251
|
}>;
|
|
@@ -4406,8 +4284,6 @@ interface BaseMessage<T extends MessageType> {
|
|
|
4406
4284
|
pluginId?: string;
|
|
4407
4285
|
pinned?: boolean;
|
|
4408
4286
|
targetUserIds?: string[];
|
|
4409
|
-
channelId?: string;
|
|
4410
|
-
channelIndex?: string;
|
|
4411
4287
|
}
|
|
4412
4288
|
interface TextMessage extends BaseMessage<MessageType.text> {
|
|
4413
4289
|
message: string;
|
|
@@ -4468,28 +4344,21 @@ interface FileMessagePayload {
|
|
|
4468
4344
|
type MessagePayload = TextMessagePayload | ImageMessagePayload | FileMessagePayload | CustomMessagePayload;
|
|
4469
4345
|
interface ChatUpdateParams {
|
|
4470
4346
|
action: 'add' | 'edit' | 'delete';
|
|
4471
|
-
message: Message
|
|
4472
|
-
id: string;
|
|
4473
|
-
channelId: string;
|
|
4474
|
-
};
|
|
4347
|
+
message: Message;
|
|
4475
4348
|
messages: Message[];
|
|
4476
4349
|
}
|
|
4477
4350
|
type ChatEvents = {
|
|
4478
4351
|
['chatUpdate']: (payload: ChatUpdateParams) => void;
|
|
4479
4352
|
['pinMessage']: (payload: Pick<ChatUpdateParams, Exclude<keyof ChatUpdateParams, 'action'>>) => void;
|
|
4480
4353
|
['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
4354
|
['*']: (event: string, ...args: any[]) => void;
|
|
4485
4355
|
};
|
|
4486
4356
|
declare class Chat extends TypedEventEmitter$1<ChatEvents> {
|
|
4487
4357
|
messages: Message[];
|
|
4488
|
-
channels: ChatChannel[];
|
|
4489
4358
|
maxTextLimit: number;
|
|
4490
4359
|
readonly telemetry: Telemetry;
|
|
4491
4360
|
setMaxTextLimit(limit: number): void;
|
|
4492
|
-
constructor(context: Context<ContextState>, chatSocketHandler: ChatSocketHandler,
|
|
4361
|
+
constructor(context: Context<ContextState>, chatSocketHandler: ChatSocketHandler, self: Self, participants: Participants);
|
|
4493
4362
|
private sendMessageInternal;
|
|
4494
4363
|
private sendTextMessageInternal;
|
|
4495
4364
|
private sendImageMessageInternal;
|
|
@@ -4504,11 +4373,11 @@ declare class Chat extends TypedEventEmitter$1<ChatEvents> {
|
|
|
4504
4373
|
sendImageMessage(image: File | ReactNativeFile, peerIds?: string[]): Promise<void>;
|
|
4505
4374
|
sendFileMessage(file: File | ReactNativeFile, peerIds?: string[]): Promise<void>;
|
|
4506
4375
|
sendMessage(message: MessagePayload, participantIds?: string[]): Promise<void>;
|
|
4507
|
-
editTextMessage(messageId: string, message: string
|
|
4508
|
-
editImageMessage(messageId: string, image: File | ReactNativeFile
|
|
4509
|
-
editFileMessage(messageId: string, file: File | ReactNativeFile
|
|
4510
|
-
editMessage(messageId: string, message: MessagePayload
|
|
4511
|
-
deleteMessage(messageId: string
|
|
4376
|
+
editTextMessage(messageId: string, message: string): Promise<void>;
|
|
4377
|
+
editImageMessage(messageId: string, image: File | ReactNativeFile): Promise<void>;
|
|
4378
|
+
editFileMessage(messageId: string, file: File | ReactNativeFile): Promise<void>;
|
|
4379
|
+
editMessage(messageId: string, message: MessagePayload): Promise<void>;
|
|
4380
|
+
deleteMessage(messageId: string): Promise<void>;
|
|
4512
4381
|
getMessagesByUser(userId: string): Message[];
|
|
4513
4382
|
getMessagesByType(type: keyof typeof MessageType): Message[];
|
|
4514
4383
|
pin(id: string): Promise<void>;
|
|
@@ -4522,22 +4391,11 @@ declare class Chat extends TypedEventEmitter$1<ChatEvents> {
|
|
|
4522
4391
|
type?: keyof typeof MessageType;
|
|
4523
4392
|
userId?: string;
|
|
4524
4393
|
}): Promise<Message[]>;
|
|
4525
|
-
getMessages(timeStamp: number, size: number, reversed: boolean, offset?: number
|
|
4394
|
+
getMessages(timeStamp: number, size: number, reversed: boolean, offset?: number): Promise<{
|
|
4526
4395
|
messages: Message[];
|
|
4527
4396
|
next: boolean;
|
|
4528
4397
|
}>;
|
|
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
4398
|
searchMessages(query: string, filters: unknown): Promise<unknown[]>;
|
|
4540
|
-
markLastReadMessage(channelId: string, message: Message): Promise<void>;
|
|
4541
4399
|
readonly pinned: Message[];
|
|
4542
4400
|
}
|
|
4543
4401
|
declare class PollSocketHandler {
|
|
@@ -5113,7 +4971,6 @@ declare const ERROR_CODES: {
|
|
|
5113
4971
|
'0504': string;
|
|
5114
4972
|
'0505': string;
|
|
5115
4973
|
'0506': string;
|
|
5116
|
-
'0510': string;
|
|
5117
4974
|
'0600': string;
|
|
5118
4975
|
'0601': string;
|
|
5119
4976
|
'0602': string;
|
|
@@ -5992,4 +5849,4 @@ declare global {
|
|
|
5992
5849
|
TransformStream?: any;
|
|
5993
5850
|
}
|
|
5994
5851
|
}
|
|
5995
|
-
export { ActiveTab, ActiveTabType, AudioConsumerScoreStats, AudioMiddleware, AudioProducerScoreStats, BroadcastMessagePayload, CachedUserDetails,
|
|
5852
|
+
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.
|
|
3
|
+
"version": "1.2.4-staging.7",
|
|
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",
|