@devanachat/sdk 0.13.0 → 0.14.0
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/CHANGELOG.md +50 -0
- package/build/index.cjs.js +271 -14
- package/build/index.cjs.js.map +1 -1
- package/build/index.mjs +271 -15
- package/build/index.mjs.map +1 -1
- package/build/index.umd.js +1 -1
- package/build/index.umd.js.map +1 -1
- package/build/types/AbstractChatClient.d.ts +16 -1
- package/build/types/Permissions.d.ts +34 -0
- package/build/types/index.d.ts +4 -3
- package/build/types/protocol/index.d.ts +21 -2
- package/build/types/protocol/schemes/Call.d.ts +35 -0
- package/build/types/protocol/schemes/IncomingCall.d.ts +6 -0
- package/build/types/protocol/schemes/Message.d.ts +3 -1
- package/build/types/protocol/schemes/MessageCall.d.ts +9 -0
- package/build/types/protocol/schemes/Room.d.ts +2 -0
- package/build/types/protocol/schemes/RoomCall.d.ts +6 -0
- package/build/types/protocol/schemes/UserData.d.ts +1 -0
- package/build/types/protocol/schemes/UserState.d.ts +4 -0
- package/build/types/protocol/schemes/commands/DeclineCall.d.ts +3 -0
- package/build/types/protocol/schemes/commands/GetCallMembers.d.ts +5 -0
- package/build/types/protocol/schemes/commands/InviteToCall.d.ts +5 -0
- package/build/types/protocol/schemes/commands/JoinCall.d.ts +4 -0
- package/build/types/protocol/schemes/commands/KickCallMember.d.ts +4 -0
- package/build/types/protocol/schemes/commands/MuteCallMember.d.ts +4 -0
- package/build/types/protocol/schemes/commands/SetPermissionOverwrites.d.ts +1 -0
- package/build/types/protocol/schemes/commands/SetSessionData.d.ts +1 -0
- package/build/types/protocol/schemes/commands/SetUserData.d.ts +1 -0
- package/build/types/protocol/schemes/commands/UpdateCallMember.d.ts +7 -0
- package/build/types/protocol/schemes/commands/UpdateRoom.d.ts +2 -0
- package/build/types/protocol/schemes/events/CallJoined.d.ts +7 -0
- package/build/types/protocol/schemes/events/CallMemberJoined.d.ts +5 -0
- package/build/types/protocol/schemes/events/CallMemberLeft.d.ts +4 -0
- package/build/types/protocol/schemes/events/CallMemberUpdated.d.ts +6 -0
- package/build/types/protocol/schemes/events/CallMembers.d.ts +5 -0
- package/build/types/protocol/schemes/events/CallUpdated.d.ts +5 -0
- package/build/types/protocol/schemes/events/CallVideoLimitReached.d.ts +4 -0
- package/build/types/protocol/schemes/events/Error.d.ts +6 -0
- package/build/types/protocol/schemes/events/IncomingCallUpdated.d.ts +5 -0
- package/build/types/state-tracker/CallsManager.d.ts +74 -0
- package/build/types/state-tracker/ChatStateTracker.d.ts +5 -0
- package/build/types/state-tracker/StateSnapshot.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Bye, GetSession, JoinSpace, Session, SpaceJoined, Error as ErrorType, SpaceLeft, SpaceMemberJoined, SpaceMemberLeft, SpaceMemberUpdated, SpaceDeleted, SpaceMembers, SpaceRooms, NewRole, RoomDeleted, RoomJoined, RoomLeft, RoomMemberLeft, RoomMembersJoined, RoomMembers, NewRoom, NewTopic, TopicDeleted, NewMessage, GetPermissionOverwrites, GetComputedPermissions, ComputedPermissions, LeaveSpace, CreateSpace, DeleteSpace, GetSpaceMembers, GetSpaceRooms, CreateRole, DeleteRole, AssignRole, DeassignRole, SetPermissionOverwrites, JoinRoom, LeaveRoom, GetIgnoredRooms, IgnoredRooms, CreateRoom, DeleteRoom, GetRoomMembers, CreateTopic, DeleteTopic, CreateMessage, Envelope, PermissionOverwrites, PermissionOverwritesUpdated, RoomMemberUpdated, UpdateRole, RoleUpdated, Ack, UserUpdated, UpdateRoom, RoomUpdated, UpdateSpace, SpaceUpdated, PermissionOverwriteTargets, GetPermissionOverwriteTargets, Owners, Ok, GetOwners, CreateOwner, RoleDeleted, FollowedTopicUpdated, TopicFollowed, FollowedTopics, FollowTopic, UpdateFollowedTopic, GetFollowedTopics, Messages, GetMessages, SearchMessages, FoundMessages, Topics, GetTopics, TopicUpdated, UpdateTopic, GetDiscoverableSpaces, DiscoverableSpaces, CreateEmoticon, DeleteEmoticon, GetEmoticons, Emoticons, EmoticonDeleted, NewEmoticon, Bans, GetBans, Ban, Unban, Kick, ClientData, GetClientData, SetClientData, GetRoomSummary, GetSpaceSummary, RoomSummaryEvent, SpaceSummaryEvent, UpdateSpaceMember, Relationships, RelationshipDeleted, NewRelationship, DeleteRelationship, CreateRelationship, RoomSummaryUpdated, Pong, Ping, RedactMessages, MessagesRedacted, UpdateMessage, MessageUpdated, SearchGifs, GetGifCategories, FoundGifs, GifCategories, ReportAbuse, UpdateRoomMember, GetRelationships, GetUserInfo, UserInfo, SetSessionData, SessionData, GetSessionData, SetUserData, UserData, GetUserData, UnfollowTopic, TopicUnfollowed, Invite, Uninvite, GetInvited, Invited, React, Interact, AckInteraction, Unreact, GetReactionDetails, ReactionUpdated, Reacted, NewInteraction, Interacted, InteractionResolved, ReactionDetails, Type, Typing, GetEntitlements, Entitlements, EntitlementUsage, CreateAccessTicket, AccessTicket } from "./protocol";
|
|
1
|
+
import { Bye, GetSession, JoinSpace, Session, SpaceJoined, Error as ErrorType, SpaceLeft, SpaceMemberJoined, SpaceMemberLeft, SpaceMemberUpdated, SpaceDeleted, SpaceMembers, SpaceRooms, NewRole, RoomDeleted, RoomJoined, RoomLeft, RoomMemberLeft, RoomMembersJoined, RoomMembers, NewRoom, NewTopic, TopicDeleted, NewMessage, GetPermissionOverwrites, GetComputedPermissions, ComputedPermissions, LeaveSpace, CreateSpace, DeleteSpace, GetSpaceMembers, GetSpaceRooms, CreateRole, DeleteRole, AssignRole, DeassignRole, SetPermissionOverwrites, JoinRoom, LeaveRoom, GetIgnoredRooms, IgnoredRooms, CreateRoom, DeleteRoom, GetRoomMembers, CreateTopic, DeleteTopic, CreateMessage, Envelope, PermissionOverwrites, PermissionOverwritesUpdated, RoomMemberUpdated, UpdateRole, RoleUpdated, Ack, UserUpdated, UpdateRoom, RoomUpdated, UpdateSpace, SpaceUpdated, PermissionOverwriteTargets, GetPermissionOverwriteTargets, Owners, Ok, GetOwners, CreateOwner, RoleDeleted, FollowedTopicUpdated, TopicFollowed, FollowedTopics, FollowTopic, UpdateFollowedTopic, GetFollowedTopics, Messages, GetMessages, SearchMessages, FoundMessages, Topics, GetTopics, TopicUpdated, UpdateTopic, GetDiscoverableSpaces, DiscoverableSpaces, CreateEmoticon, DeleteEmoticon, GetEmoticons, Emoticons, EmoticonDeleted, NewEmoticon, Bans, GetBans, Ban, Unban, Kick, ClientData, GetClientData, SetClientData, GetRoomSummary, GetSpaceSummary, RoomSummaryEvent, SpaceSummaryEvent, UpdateSpaceMember, Relationships, RelationshipDeleted, NewRelationship, DeleteRelationship, CreateRelationship, RoomSummaryUpdated, Pong, Ping, RedactMessages, MessagesRedacted, UpdateMessage, MessageUpdated, SearchGifs, GetGifCategories, FoundGifs, GifCategories, ReportAbuse, UpdateRoomMember, GetRelationships, GetUserInfo, UserInfo, SetSessionData, SessionData, GetSessionData, SetUserData, UserData, GetUserData, UnfollowTopic, TopicUnfollowed, Invite, Uninvite, GetInvited, Invited, React, Interact, AckInteraction, Unreact, GetReactionDetails, ReactionUpdated, Reacted, NewInteraction, Interacted, InteractionResolved, ReactionDetails, Type, Typing, GetEntitlements, Entitlements, EntitlementUsage, CreateAccessTicket, AccessTicket, JoinCall, DeclineCall, InviteToCall, MuteCallMember, KickCallMember, UpdateCallMember, GetCallMembers, CallJoined, CallUpdated, IncomingCallUpdated, CallVideoLimitReached, CallMembers, CallMemberJoined, CallMemberUpdated, CallMemberLeft } from "./protocol";
|
|
2
2
|
import { EventTarget } from "./EventTarget";
|
|
3
3
|
type ArrayOfPromiseResolvers = [(value: any) => void, (reason?: any) => void];
|
|
4
4
|
type ExtraEventMap = Record<string, any>;
|
|
@@ -112,6 +112,14 @@ export type EventsMap = {
|
|
|
112
112
|
InteractionResolved: InteractionResolved;
|
|
113
113
|
ReactionDetails: ReactionDetails;
|
|
114
114
|
Typing: Typing;
|
|
115
|
+
CallJoined: CallJoined;
|
|
116
|
+
CallUpdated: CallUpdated;
|
|
117
|
+
IncomingCallUpdated: IncomingCallUpdated;
|
|
118
|
+
CallVideoLimitReached: CallVideoLimitReached;
|
|
119
|
+
CallMembers: CallMembers;
|
|
120
|
+
CallMemberJoined: CallMemberJoined;
|
|
121
|
+
CallMemberUpdated: CallMemberUpdated;
|
|
122
|
+
CallMemberLeft: CallMemberLeft;
|
|
115
123
|
};
|
|
116
124
|
/**
|
|
117
125
|
* Map of commands and their corresponding events.
|
|
@@ -199,5 +207,12 @@ export type CommandsMap = {
|
|
|
199
207
|
Unreact: CommandDefinition<Unreact, EventsMap['Reacted'] | EventsMap['Ok']>;
|
|
200
208
|
GetReactionDetails: CommandDefinition<GetReactionDetails, EventsMap['ReactionDetails']>;
|
|
201
209
|
Type: CommandDefinition<Type, EventsMap['Ok']>;
|
|
210
|
+
JoinCall: CommandDefinition<JoinCall, EventsMap['CallJoined']>;
|
|
211
|
+
DeclineCall: CommandDefinition<DeclineCall, EventsMap['Ok']>;
|
|
212
|
+
InviteToCall: CommandDefinition<InviteToCall, EventsMap['Ok']>;
|
|
213
|
+
MuteCallMember: CommandDefinition<MuteCallMember, EventsMap['Ok']>;
|
|
214
|
+
KickCallMember: CommandDefinition<KickCallMember, EventsMap['Ok']>;
|
|
215
|
+
UpdateCallMember: CommandDefinition<UpdateCallMember, EventsMap['Ok']>;
|
|
216
|
+
GetCallMembers: CommandDefinition<GetCallMembers, EventsMap['CallMembers']>;
|
|
202
217
|
};
|
|
203
218
|
export {};
|
|
@@ -126,7 +126,41 @@ export declare class Permissions {
|
|
|
126
126
|
value: number;
|
|
127
127
|
maxLayer: Layer;
|
|
128
128
|
};
|
|
129
|
+
JoinCalls: {
|
|
130
|
+
value: number;
|
|
131
|
+
maxLayer: Layer;
|
|
132
|
+
};
|
|
133
|
+
ShareVideo: {
|
|
134
|
+
value: number;
|
|
135
|
+
maxLayer: Layer;
|
|
136
|
+
};
|
|
137
|
+
InviteToCall: {
|
|
138
|
+
value: number;
|
|
139
|
+
maxLayer: Layer;
|
|
140
|
+
};
|
|
141
|
+
ManageCalls: {
|
|
142
|
+
value: number;
|
|
143
|
+
maxLayer: Layer;
|
|
144
|
+
};
|
|
129
145
|
};
|
|
146
|
+
/**
|
|
147
|
+
* Whether the permission mask (e.g. from {@link PermissionsManager.calculatePermissions}) grants the permission.
|
|
148
|
+
* Use it and {@link union} / {@link subtract} instead of `&` and `|`: JavaScript bitwise operators keep only
|
|
149
|
+
* 32 bits, and permissions go beyond them.
|
|
150
|
+
*/
|
|
151
|
+
static has(mask: number, name: keyof typeof this.list): boolean;
|
|
152
|
+
/**
|
|
153
|
+
* The permission masks combined (`a | b`), safe for permissions beyond 32 bits.
|
|
154
|
+
*/
|
|
155
|
+
static union(...masks: number[]): number;
|
|
156
|
+
/**
|
|
157
|
+
* The mask without the permissions of `removed` (`mask & ~removed`), safe for permissions beyond 32 bits.
|
|
158
|
+
*/
|
|
159
|
+
static subtract(mask: number, removed: number): number;
|
|
160
|
+
/**
|
|
161
|
+
* Mask of all the permissions this version of the SDK knows - for `SetPermissionOverwrites.knownPermissions`.
|
|
162
|
+
*/
|
|
163
|
+
static getKnownMask(): number;
|
|
130
164
|
static getNames(): (keyof typeof this.list)[];
|
|
131
165
|
static getByName(name: keyof typeof this.list): PermissionDefinition | undefined;
|
|
132
166
|
static canBeDefinedOnLayer(permissionName: keyof typeof this.list, layer: Layer): boolean;
|
package/build/types/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { IndexedCollection, IndexedObjectCollection, ObservableIndexedCollection
|
|
|
4
4
|
import { FilesClient, File } from "./FilesClient";
|
|
5
5
|
import { Permissions, PermissionDefinition, Layer } from "./Permissions";
|
|
6
6
|
import * as ChatTypes from './protocol';
|
|
7
|
-
import { ErrorCode, HistoryRotation, MessageEmbedFlag, NO_LIMIT, PmParticipantFlag, RoleFlag, SearchRange, UiPurpose, SpaceFeature, SpaceIntent, STORAGE_UNIT_BYTES, UserFeature, UserStatus } from './protocol';
|
|
7
|
+
import { CallMemberFlag, ErrorCode, HistoryRotation, MessageEmbedFlag, NO_LIMIT, PmParticipantFlag, RoleFlag, SearchRange, UiPurpose, SpaceFeature, SpaceIntent, STORAGE_UNIT_BYTES, UserFeature, UserStatus } from './protocol';
|
|
8
8
|
import { extractUserFromMember, getPmPeers, isGroupPm } from "./state-tracker/functions";
|
|
9
9
|
import { AbstractRestClient } from "./AbstractRestClient";
|
|
10
10
|
import { UnreadSummary } from "./state-tracker/FollowedTopicsManager";
|
|
@@ -12,11 +12,12 @@ import { TopicHistoryWindow } from "./state-tracker/TopicHistoryWindow";
|
|
|
12
12
|
import { PermissionsManager } from "./state-tracker/PermissionsManager";
|
|
13
13
|
import { STATE_SNAPSHOT_VERSION } from "./state-tracker/StateSnapshot";
|
|
14
14
|
import { TYPING_INTERVAL_MS, TYPING_TIMEOUT_MS, TypingManager, TypingUsers } from "./state-tracker/TypingManager";
|
|
15
|
-
|
|
15
|
+
import { CallsManager } from "./state-tracker/CallsManager";
|
|
16
|
+
export { IndexedCollection, ObservableIndexedCollection, IndexedObjectCollection, ObservableIndexedObjectCollection, Permissions, PermissionDefinition, Layer, WebSocketChatClient, WebApiChatClient, FilesClient, AbstractRestClient, extractUserFromMember, isGroupPm, getPmPeers, CallMemberFlag, ErrorCode, MessageEmbedFlag, PmParticipantFlag, UserStatus, RoleFlag, SpaceFeature, UserFeature, HistoryRotation, SearchRange, UiPurpose, SpaceIntent, NO_LIMIT, STORAGE_UNIT_BYTES, STATE_SNAPSHOT_VERSION, TYPING_INTERVAL_MS, TYPING_TIMEOUT_MS, };
|
|
16
17
|
export type { CommandResult, CommandRequest, CommandResponse, CommandsMap, EventsMap, } from "./AbstractChatClient";
|
|
17
18
|
export type { WebSocketClientOptions } from "./WebSocketChatClient";
|
|
18
19
|
export type { WebApiChatClientOptions } from "./WebApiChatClient";
|
|
19
20
|
export type { RestClientOptions, RestClientResponse } from "./AbstractRestClient";
|
|
20
21
|
export type { EventHandler, ObservableInterface } from "./EventTarget";
|
|
21
22
|
export type { StateSnapshot, SpaceRoomsSnapshot, RoomFollowedTopicsSnapshot, EmoticonsSnapshot, StateSnapshotIntent, TopicHistorySnapshot, RoomMembersSnapshot, } from "./state-tracker/StateSnapshot";
|
|
22
|
-
export type { ChatTypes, File, UnreadSummary, TopicHistoryWindow, PermissionsManager, TypingManager, TypingUsers, };
|
|
23
|
+
export type { ChatTypes, File, UnreadSummary, TopicHistoryWindow, PermissionsManager, TypingManager, TypingUsers, CallsManager, };
|
|
@@ -117,6 +117,7 @@ import { SetClientData } from "./schemes/commands/SetClientData";
|
|
|
117
117
|
import { ClientData } from "./schemes/events/ClientData";
|
|
118
118
|
import { RoomStream, RoomStreamType } from "./schemes/RoomStream";
|
|
119
119
|
import { RoomHistory, RoomHistoryMode } from "./schemes/RoomHistory";
|
|
120
|
+
import { RoomCall } from "./schemes/RoomCall";
|
|
120
121
|
import { GetRoomSummary } from "./schemes/commands/GetRoomSummary";
|
|
121
122
|
import { GetSpaceSummary } from "./schemes/commands/GetSpaceSummary";
|
|
122
123
|
import { SpaceSummary as SpaceSummaryEvent } from "./schemes/events/SpaceSummary";
|
|
@@ -178,5 +179,23 @@ import { Entitlements } from "./schemes/events/Entitlements";
|
|
|
178
179
|
import { EntitlementUsage } from "./schemes/events/EntitlementUsage";
|
|
179
180
|
import { CreateAccessTicket, TicketAudience } from "./schemes/commands/CreateAccessTicket";
|
|
180
181
|
import { AccessTicket } from "./schemes/events/AccessTicket";
|
|
181
|
-
|
|
182
|
-
|
|
182
|
+
import { Call, CallMember, CallMemberFlag, CallMode, CallQuality, CallTurn } from "./schemes/Call";
|
|
183
|
+
import { MessageCall, MessageCallStatus } from "./schemes/MessageCall";
|
|
184
|
+
import { JoinCall } from "./schemes/commands/JoinCall";
|
|
185
|
+
import { DeclineCall } from "./schemes/commands/DeclineCall";
|
|
186
|
+
import { InviteToCall } from "./schemes/commands/InviteToCall";
|
|
187
|
+
import { MuteCallMember } from "./schemes/commands/MuteCallMember";
|
|
188
|
+
import { KickCallMember } from "./schemes/commands/KickCallMember";
|
|
189
|
+
import { UpdateCallMember } from "./schemes/commands/UpdateCallMember";
|
|
190
|
+
import { CallJoined } from "./schemes/events/CallJoined";
|
|
191
|
+
import { CallUpdated } from "./schemes/events/CallUpdated";
|
|
192
|
+
import { IncomingCall } from "./schemes/IncomingCall";
|
|
193
|
+
import { IncomingCallUpdated } from "./schemes/events/IncomingCallUpdated";
|
|
194
|
+
import { CallVideoLimitReached } from "./schemes/events/CallVideoLimitReached";
|
|
195
|
+
import { GetCallMembers } from "./schemes/commands/GetCallMembers";
|
|
196
|
+
import { CallMembers } from "./schemes/events/CallMembers";
|
|
197
|
+
import { CallMemberJoined } from "./schemes/events/CallMemberJoined";
|
|
198
|
+
import { CallMemberUpdated } from "./schemes/events/CallMemberUpdated";
|
|
199
|
+
import { CallMemberLeft } from "./schemes/events/CallMemberLeft";
|
|
200
|
+
export type { Envelope, Message, MessageType, MessageAuthor, MessageMentions, Role, RoleIcon, Room, RoomType, PmParticipant, RoomStream, RoomStreamType, RoomHistory, RoomHistoryMode, RoomCall, RoomMember, RoomSummary, RoomSummaryExtras, Space, SpaceMember, Topic, FollowedTopic, NotificationLevel, User, UserState, PermissionOverwritesValue, ChatLocation, SpaceSummary, SpaceDiscoverable, Emoticon, PermissionOverwritesTarget, BanObject, LeaveReason, UserRelationship, UserRelationshipType, CreateTopicInitialMessage, UserInformation, SessionPush, SessionData, SessionPlatform, UserData, PrivateMessagePolicy, ReactionType, MessageReaction, UserReaction, ToggledReaction, MessagePoll, MessagePollOption, MessageEmbed, MessageEmbedType, SendableEmbed, EmbedTone, EmbedComponent, EmbedContainer, EmbedColumns, EmbedColumn, EmbedSeparator, EmbedText, EmbedMedia, EmbedMediaItem, EmbedPlayer, EmbedButton, EmbedSelect, EmbedSelectOption, EntitlementTarget, EntitlementsSubject, EntitlementValue, EntitlementsMap, EntitlementsExtras, TicketAudience, Call, CallMember, CallQuality, CallMode, CallTurn, IncomingCall, MessageCall, MessageCallStatus, Bye, Error, ErrorDetails, IgnoredRooms, Messages, MessageUserReactions, NewInteraction, Interacted, InteractionResolved, InteractionStatus, FoundMessages, FoundMessage, TextRange, NewMessage, NewRole, NewRoom, NewTopic, TopicFollowed, TopicUnfollowed, FollowedTopics, FollowedTopicUpdated, ComputedPermissions, PermissionOverwrites, PermissionOverwritesUpdated, RoleDeleted, RoleUpdated, RoomDeleted, RoomUpdated, RoomJoined, RoomLeft, RoomMembersJoined, RoomMemberLeft, RoomMembers, RoomMemberUpdated, UserUpdated, Session, SpaceDeleted, SpaceUpdated, SpaceJoined, SpaceLeft, SpaceMemberJoined, SpaceMemberLeft, SpaceMembers, SpaceMemberUpdated, SpaceRooms, TopicDeleted, TopicUpdated, PermissionOverwriteTargets, Owners, Ok, DiscoverableSpaces, Emoticons, EmoticonDeleted, NewEmoticon, Bans, ClientData, SpaceSummaryEvent, RoomSummaryEvent, NewRelationship, RelationshipDeleted, Relationships, RoomSummaryUpdated, Pong, MessagesRedacted, MessageUpdated, FoundGif, FoundGifs, GifCategory, GifCategories, UserInfo, Invited, ReactionUpdated, Reacted, ReactionDetails, Typing, Entitlements, EntitlementUsage, AccessTicket, CallJoined, CallUpdated, IncomingCallUpdated, CallVideoLimitReached, CallMembers, CallMemberJoined, CallMemberUpdated, CallMemberLeft, AssignRole, GetMessages, SearchMessages, SearchDate, CreateMessage, Ack, CreateRole, CreateRoom, CreateSpace, CreateTopic, FollowTopic, UnfollowTopic, UpdateFollowedTopic, GetFollowedTopics, DeassignRole, DeleteRole, DeleteRoom, DeleteSpace, DeleteTopic, SetPermissionOverwrites, GetPermissionOverwrites, GetComputedPermissions, GetRoomMembers, GetSession, GetSpaceMembers, GetSpaceRooms, JoinRoom, JoinSpace, LeaveRoom, GetIgnoredRooms, LeaveSpace, UpdateRole, UpdateSpace, UpdateRoom, UpdateTopic, GetPermissionOverwriteTargets, CreateOwner, DeleteOwner, GetOwners, Topics, GetTopics, GetDiscoverableSpaces, GetEmoticons, CreateEmoticon, DeleteEmoticon, Ban, Unban, GetBans, Kick, GetClientData, SetClientData, GetSpaceSummary, GetRoomSummary, UpdateSpaceMember, CreateRelationship, DeleteRelationship, GetRelationships, UpdateRoomMember, Ping, ReportAbuse, RedactMessages, UpdateMessage, Interact, AckInteraction, SearchGifs, GetGifCategories, GetUserInfo, SetSessionData, GetSessionData, SetUserData, GetUserData, Invite, Uninvite, GetInvited, React, Unreact, GetReactionDetails, Type, GetEntitlements, CreateAccessTicket, JoinCall, DeclineCall, InviteToCall, MuteCallMember, KickCallMember, UpdateCallMember, GetCallMembers, };
|
|
201
|
+
export { CallMemberFlag, ErrorCode, MessageEmbedFlag, NO_LIMIT, STORAGE_UNIT_BYTES, HistoryRotation, PmParticipantFlag, RoleFlag, SearchRange, SpaceFeature, SpaceIntent, UiPurpose, UserFeature, UserStatus, };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { User } from "./User";
|
|
2
|
+
import { ChatLocation } from "./ChatLocation";
|
|
3
|
+
export type CallMode = 'Conversation' | 'Stage' | 'Queue';
|
|
4
|
+
export declare enum CallMemberFlag {
|
|
5
|
+
Camera = 1,
|
|
6
|
+
ScreenShare = 2,
|
|
7
|
+
Speaker = 4,
|
|
8
|
+
RaiseBlocked = 16
|
|
9
|
+
}
|
|
10
|
+
export interface CallMember {
|
|
11
|
+
user: User;
|
|
12
|
+
joinedAt: string;
|
|
13
|
+
flags: number;
|
|
14
|
+
handRaisedAt: string | null;
|
|
15
|
+
}
|
|
16
|
+
export interface CallTurn {
|
|
17
|
+
userId: string;
|
|
18
|
+
endsAt: string;
|
|
19
|
+
claimBy: string | null;
|
|
20
|
+
}
|
|
21
|
+
export interface CallQuality {
|
|
22
|
+
audioBitrate: number;
|
|
23
|
+
cameraMaxHeight: number;
|
|
24
|
+
screenMaxHeight: number;
|
|
25
|
+
screenMaxFps: number;
|
|
26
|
+
}
|
|
27
|
+
export interface Call {
|
|
28
|
+
location: ChatLocation;
|
|
29
|
+
messageId: string;
|
|
30
|
+
startedAt: string;
|
|
31
|
+
mode: CallMode;
|
|
32
|
+
turn: CallTurn | null;
|
|
33
|
+
autoEndAt: string | null;
|
|
34
|
+
members: CallMember[];
|
|
35
|
+
}
|
|
@@ -3,7 +3,8 @@ import { ChatLocation } from "./ChatLocation";
|
|
|
3
3
|
import { MessageReaction } from "./Reaction";
|
|
4
4
|
import { MessagePoll } from "./MessagePoll";
|
|
5
5
|
import { MessageEmbed } from "./MessageEmbed";
|
|
6
|
-
|
|
6
|
+
import { MessageCall } from "./MessageCall";
|
|
7
|
+
export type MessageType = 'Text' | 'RoomJoin' | 'RoomMemberAdd' | 'RoomLeave' | 'SpaceJoin' | 'SpaceLeave' | 'TopicChange' | 'CustomNickChange' | 'Ephemeral' | 'Poll' | 'RoomRename' | 'Call' | 'CallJoin' | 'CallLeave';
|
|
7
8
|
/**
|
|
8
9
|
* Mention targets a message actually reached, as resolved by the server: role
|
|
9
10
|
* mentions the author was not allowed to fire are absent, even though they stay
|
|
@@ -29,6 +30,7 @@ export interface Message {
|
|
|
29
30
|
attachments: string[] | null;
|
|
30
31
|
reactions: MessageReaction[];
|
|
31
32
|
poll?: MessagePoll;
|
|
33
|
+
call?: MessageCall | null;
|
|
32
34
|
mentions: MessageMentions | null;
|
|
33
35
|
editedAt?: string | null;
|
|
34
36
|
replyTo?: string | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CallMember, CallMode } from "./Call";
|
|
2
|
+
export type MessageCallStatus = 'Ongoing' | 'Ended' | 'Missed' | 'Declined';
|
|
3
|
+
export interface MessageCall {
|
|
4
|
+
status: MessageCallStatus;
|
|
5
|
+
mode: CallMode;
|
|
6
|
+
duration: number | null;
|
|
7
|
+
partialMembers: CallMember[];
|
|
8
|
+
memberCount: number;
|
|
9
|
+
}
|
|
@@ -3,6 +3,7 @@ import { User } from "./User";
|
|
|
3
3
|
import { RoomStream } from "./RoomStream";
|
|
4
4
|
import { RoomHistory } from "./RoomHistory";
|
|
5
5
|
import { PmParticipant } from "./PmParticipant";
|
|
6
|
+
import { RoomCall } from "./RoomCall";
|
|
6
7
|
export type RoomType = 'Text' | 'ClassicText' | 'Pm';
|
|
7
8
|
export interface Room {
|
|
8
9
|
id: string;
|
|
@@ -17,4 +18,5 @@ export interface Room {
|
|
|
17
18
|
flags: number;
|
|
18
19
|
stream: RoomStream | null;
|
|
19
20
|
history: RoomHistory | null;
|
|
21
|
+
call: RoomCall;
|
|
20
22
|
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { Space } from "./Space";
|
|
2
2
|
import { Room } from "./Room";
|
|
3
|
+
import { Call } from "./Call";
|
|
4
|
+
import { IncomingCall } from "./IncomingCall";
|
|
3
5
|
export interface UserState {
|
|
4
6
|
spaces: Space[];
|
|
5
7
|
rooms: Room[];
|
|
8
|
+
calls: Call[];
|
|
9
|
+
incomingCalls: IncomingCall[];
|
|
6
10
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { RoomStream } from "../RoomStream";
|
|
2
2
|
import { RoomHistory } from "../RoomHistory";
|
|
3
|
+
import { RoomCall } from "../RoomCall";
|
|
3
4
|
export interface UpdateRoom {
|
|
4
5
|
id: string;
|
|
5
6
|
name?: string;
|
|
@@ -7,4 +8,5 @@ export interface UpdateRoom {
|
|
|
7
8
|
flags?: number;
|
|
8
9
|
stream?: RoomStream | null;
|
|
9
10
|
history?: RoomHistory;
|
|
11
|
+
call?: RoomCall;
|
|
10
12
|
}
|
|
@@ -9,6 +9,11 @@ export interface Error {
|
|
|
9
9
|
}
|
|
10
10
|
export declare enum ErrorCode {
|
|
11
11
|
Authentication = "AuthenticationException",
|
|
12
|
+
CallFull = "CallFullException",
|
|
13
|
+
CallMode = "CallModeException",
|
|
14
|
+
CallNotFound = "CallNotFoundException",
|
|
15
|
+
CallsNotAccepted = "CallsNotAcceptedException",
|
|
16
|
+
CallsUnavailable = "CallsUnavailableException",
|
|
12
17
|
CommandRateLimitExceeded = "CommandRateLimitExceededException",
|
|
13
18
|
InvalidSearchQuery = "InvalidSearchQueryException",
|
|
14
19
|
MessageSearchUnavailable = "MessageSearchUnavailableException",
|
|
@@ -17,6 +22,7 @@ export declare enum ErrorCode {
|
|
|
17
22
|
RoomIgnored = "RoomIgnoredException",
|
|
18
23
|
RoomNotFound = "RoomNotFoundException",
|
|
19
24
|
SpaceJoinRestricted = "SpaceJoinRestrictedException",
|
|
25
|
+
TooManyCallInvitees = "TooManyCallInviteesException",
|
|
20
26
|
TopicNotFound = "TopicNotFoundException",
|
|
21
27
|
UserNotFound = "UserNotFoundException"
|
|
22
28
|
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { ChatStateTracker } from "./ChatStateTracker";
|
|
2
|
+
import { ObservableIndexedObjectCollection } from "../IndexedObjectCollection";
|
|
3
|
+
import { Call, CallJoined, CallMember, IncomingCall } from "../protocol";
|
|
4
|
+
export declare class CallsManager {
|
|
5
|
+
private tracker;
|
|
6
|
+
private readonly list;
|
|
7
|
+
private readonly ringing;
|
|
8
|
+
constructor(tracker: ChatStateTracker);
|
|
9
|
+
/**
|
|
10
|
+
* Ongoing calls in the rooms you are a member of, keyed by room id - at most one per room. Filled with the
|
|
11
|
+
* session and kept current by the server; a call leaves the collection when its last member leaves.
|
|
12
|
+
* Not part of the state snapshot, so it stays empty until the first session.
|
|
13
|
+
*/
|
|
14
|
+
get(): Promise<ObservableIndexedObjectCollection<Call>>;
|
|
15
|
+
/**
|
|
16
|
+
* Calls ringing at you, keyed by room id. A call leaves the collection when it is answered or declined on any of
|
|
17
|
+
* your devices, or when it ends. Filled with the session, like the ongoing calls.
|
|
18
|
+
*/
|
|
19
|
+
getRinging(): Promise<ObservableIndexedObjectCollection<IncomingCall>>;
|
|
20
|
+
/**
|
|
21
|
+
* Members of the call with a raised hand, in the order they raised it - the queue in the `Queue` mode.
|
|
22
|
+
*/
|
|
23
|
+
getQueue(call: Call): CallMember[];
|
|
24
|
+
/**
|
|
25
|
+
* A page of the members of the call the call message stands for, in the order they joined. The message itself
|
|
26
|
+
* carries only some of them (`MessageCall.partialMembers`) and their count.
|
|
27
|
+
*/
|
|
28
|
+
getMembers(messageId: string, page?: {
|
|
29
|
+
limit?: number;
|
|
30
|
+
offset?: number;
|
|
31
|
+
}): Promise<CallMember[]>;
|
|
32
|
+
/**
|
|
33
|
+
* Join the call in the room, starting it if there is none. Connect to the media server with the returned access
|
|
34
|
+
* yourself; leaving the call is disconnecting from it. Joining another call makes the server end your
|
|
35
|
+
* participation in the previous one. In the `Stage` and `Queue` modes you join as a listener (a moderator as a
|
|
36
|
+
* speaker), and the title given when starting the call names its topic.
|
|
37
|
+
*/
|
|
38
|
+
join(roomId: string, title?: string): Promise<CallJoined>;
|
|
39
|
+
/**
|
|
40
|
+
* Stop the call ringing at you, on all of your devices. In a one-to-one private room it also ends the call.
|
|
41
|
+
*/
|
|
42
|
+
decline(roomId: string): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Invite the given members of the room, or the room members having one of the roles, to the call - it rings at
|
|
45
|
+
* them. Members already in the call and you are skipped.
|
|
46
|
+
*/
|
|
47
|
+
invite(roomId: string, target: {
|
|
48
|
+
userIds?: string[];
|
|
49
|
+
roleIds?: string[];
|
|
50
|
+
}): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Turn off the microphone of a call member. Only they can turn it on again.
|
|
53
|
+
*/
|
|
54
|
+
muteMember(roomId: string, userId: string): Promise<void>;
|
|
55
|
+
kickMember(roomId: string, userId: string): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Raise or lower your hand (in the `Queue` mode: enter or leave the queue) and leave the stage, which in the
|
|
58
|
+
* `Queue` mode ends your turn. A moderator also moves a member to the stage and off it (skipping their turn),
|
|
59
|
+
* lowers their hand and blocks them from raising it until the call ends.
|
|
60
|
+
*/
|
|
61
|
+
updateMember(roomId: string, userId: string, change: {
|
|
62
|
+
speaker?: boolean;
|
|
63
|
+
handRaised?: boolean;
|
|
64
|
+
raiseBlocked?: boolean;
|
|
65
|
+
}): Promise<void>;
|
|
66
|
+
private send;
|
|
67
|
+
private handleSession;
|
|
68
|
+
private handleCallUpdated;
|
|
69
|
+
private handleIncomingCallUpdated;
|
|
70
|
+
private handleMemberChanged;
|
|
71
|
+
private setCall;
|
|
72
|
+
private handleRoomGone;
|
|
73
|
+
private handleSpaceGone;
|
|
74
|
+
}
|
|
@@ -6,6 +6,7 @@ import { PermissionsManager } from "./PermissionsManager";
|
|
|
6
6
|
import { EmoticonsManager } from "./EmoticonsManager";
|
|
7
7
|
import { UsersManager } from "./UsersManager";
|
|
8
8
|
import { RelationshipsManager } from "./RelationshipsManager";
|
|
9
|
+
import { CallsManager } from "./CallsManager";
|
|
9
10
|
import { StateSnapshot, StateSnapshotIntent } from "./StateSnapshot";
|
|
10
11
|
export declare class ChatStateTracker {
|
|
11
12
|
readonly client: WebSocketChatClient;
|
|
@@ -33,6 +34,10 @@ export declare class ChatStateTracker {
|
|
|
33
34
|
* State of relationships with other users.
|
|
34
35
|
*/
|
|
35
36
|
readonly relationships: RelationshipsManager;
|
|
37
|
+
/**
|
|
38
|
+
* State of the calls in your rooms and of the calls ringing at you.
|
|
39
|
+
*/
|
|
40
|
+
readonly calls: CallsManager;
|
|
36
41
|
private _me;
|
|
37
42
|
private readonly deferredSession;
|
|
38
43
|
private sessionReceived;
|
|
@@ -2,7 +2,7 @@ import { Emoticon, FollowedTopic, Message, Room, RoomMember, RoomSummary, Space,
|
|
|
2
2
|
/**
|
|
3
3
|
* Version of the {@link StateSnapshot} format. A snapshot of any other version is rejected on import.
|
|
4
4
|
*/
|
|
5
|
-
export declare const STATE_SNAPSHOT_VERSION =
|
|
5
|
+
export declare const STATE_SNAPSHOT_VERSION = 4;
|
|
6
6
|
/**
|
|
7
7
|
* Plain, JSON-serializable copy of the state tracked by {@link ChatStateTracker}, made to restore the state at the
|
|
8
8
|
* application start (before the connection is established) - see {@link ChatStateTracker.exportSnapshot}.
|
package/package.json
CHANGED