@devanachat/sdk 0.8.1 → 0.10.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.
Files changed (31) hide show
  1. package/CHANGELOG.md +68 -4
  2. package/build/index.cjs.js +194 -95
  3. package/build/index.cjs.js.map +1 -1
  4. package/build/index.mjs +191 -95
  5. package/build/index.mjs.map +1 -1
  6. package/build/index.umd.js +1 -1
  7. package/build/index.umd.js.map +1 -1
  8. package/build/types/AbstractChatClient.d.ts +4 -2
  9. package/build/types/Permissions.d.ts +4 -0
  10. package/build/types/index.d.ts +3 -3
  11. package/build/types/protocol/index.d.ts +6 -3
  12. package/build/types/protocol/schemes/Emoticon.d.ts +2 -3
  13. package/build/types/protocol/schemes/Entitlements.d.ts +2 -1
  14. package/build/types/protocol/schemes/Message.d.ts +1 -1
  15. package/build/types/protocol/schemes/PmParticipant.d.ts +8 -0
  16. package/build/types/protocol/schemes/Reaction.d.ts +2 -0
  17. package/build/types/protocol/schemes/Room.d.ts +3 -0
  18. package/build/types/protocol/schemes/commands/CreateEmoticon.d.ts +1 -1
  19. package/build/types/protocol/schemes/commands/GetEmoticons.d.ts +1 -0
  20. package/build/types/protocol/schemes/commands/GetIgnoredRooms.d.ts +2 -0
  21. package/build/types/protocol/schemes/commands/LeaveRoom.d.ts +1 -0
  22. package/build/types/protocol/schemes/events/EmoticonDeleted.d.ts +1 -1
  23. package/build/types/protocol/schemes/events/Emoticons.d.ts +1 -1
  24. package/build/types/protocol/schemes/events/Error.d.ts +5 -0
  25. package/build/types/protocol/schemes/events/IgnoredRooms.d.ts +4 -0
  26. package/build/types/state-tracker/EmoticonsManager.d.ts +1 -1
  27. package/build/types/state-tracker/RoomsManager.d.ts +2 -1
  28. package/build/types/state-tracker/StateSnapshot.d.ts +2 -5
  29. package/build/types/state-tracker/UsersManager.d.ts +7 -1
  30. package/build/types/state-tracker/functions.d.ts +12 -1
  31. 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, 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, ReportAbuse, UpdateRoomMember, GetRelationships, GetUserInfo, UserInfo, SetSessionData, SessionData, GetSessionData, SetUserData, UserData, GetUserData, UnfollowTopic, TopicUnfollowed, Invite, Uninvite, GetInvited, Invited, React, Unreact, GetReactionDetails, ReactionUpdated, Reacted, ReactionDetails, 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, ReportAbuse, UpdateRoomMember, GetRelationships, GetUserInfo, UserInfo, SetSessionData, SessionData, GetSessionData, SetUserData, UserData, GetUserData, UnfollowTopic, TopicUnfollowed, Invite, Uninvite, GetInvited, Invited, React, Unreact, GetReactionDetails, ReactionUpdated, Reacted, ReactionDetails, GetEntitlements, Entitlements, EntitlementUsage, CreateAccessTicket, AccessTicket } 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>;
@@ -82,6 +82,7 @@ export type EventsMap = {
82
82
  RoomMemberLeft: RoomMemberLeft;
83
83
  RoomMemberUpdated: RoomMemberUpdated;
84
84
  RoomMembers: RoomMembers;
85
+ IgnoredRooms: IgnoredRooms;
85
86
  NewRoom: NewRoom;
86
87
  RoomDeleted: RoomDeleted;
87
88
  RoomUpdated: RoomUpdated;
@@ -154,7 +155,8 @@ export type CommandsMap = {
154
155
  GetSpaceSummary: CommandDefinition<GetSpaceSummary, EventsMap['SpaceSummaryEvent']>;
155
156
  UpdateSpaceMember: CommandDefinition<UpdateSpaceMember, EventsMap['SpaceMemberUpdated']>;
156
157
  JoinRoom: CommandDefinition<JoinRoom, EventsMap['RoomJoined']>;
157
- LeaveRoom: CommandDefinition<LeaveRoom, EventsMap['RoomLeft']>;
158
+ LeaveRoom: CommandDefinition<LeaveRoom, EventsMap['RoomLeft'] | EventsMap['Ok']>;
159
+ GetIgnoredRooms: CommandDefinition<GetIgnoredRooms, EventsMap['IgnoredRooms']>;
158
160
  CreateRoom: CommandDefinition<CreateRoom, EventsMap['RoomJoined']>;
159
161
  DeleteRoom: CommandDefinition<DeleteRoom, EventsMap['RoomDeleted']>;
160
162
  UpdateRoom: CommandDefinition<UpdateRoom, EventsMap['RoomUpdated']>;
@@ -110,6 +110,10 @@ export declare class Permissions {
110
110
  value: number;
111
111
  maxLayer: Layer;
112
112
  };
113
+ UseExternalEmoticons: {
114
+ value: number;
115
+ maxLayer: Layer;
116
+ };
113
117
  };
114
118
  static getNames(): (keyof typeof this.list)[];
115
119
  static getByName(name: keyof typeof this.list): PermissionDefinition | undefined;
@@ -4,14 +4,14 @@ 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, NO_LIMIT, RoleFlag, SearchRange, UiPurpose, SpaceFeature, SpaceIntent, STORAGE_UNIT_BYTES, UserFeature, UserStatus } from './protocol';
8
- import { extractUserFromMember } from "./state-tracker/functions";
7
+ import { ErrorCode, HistoryRotation, NO_LIMIT, PmParticipantFlag, RoleFlag, SearchRange, UiPurpose, SpaceFeature, SpaceIntent, STORAGE_UNIT_BYTES, UserFeature, UserStatus } from './protocol';
8
+ import { extractUserFromMember, getPmPeers, isGroupPm } from "./state-tracker/functions";
9
9
  import { AbstractRestClient } from "./AbstractRestClient";
10
10
  import { UnreadSummary } from "./state-tracker/FollowedTopicsManager";
11
11
  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
- export { IndexedCollection, ObservableIndexedCollection, IndexedObjectCollection, ObservableIndexedObjectCollection, Permissions, PermissionDefinition, Layer, WebSocketChatClient, WebApiChatClient, FilesClient, AbstractRestClient, extractUserFromMember, ErrorCode, UserStatus, RoleFlag, SpaceFeature, UserFeature, HistoryRotation, SearchRange, UiPurpose, SpaceIntent, NO_LIMIT, STORAGE_UNIT_BYTES, STATE_SNAPSHOT_VERSION, };
14
+ export { IndexedCollection, ObservableIndexedCollection, IndexedObjectCollection, ObservableIndexedObjectCollection, Permissions, PermissionDefinition, Layer, WebSocketChatClient, WebApiChatClient, FilesClient, AbstractRestClient, extractUserFromMember, isGroupPm, getPmPeers, ErrorCode, PmParticipantFlag, UserStatus, RoleFlag, SpaceFeature, UserFeature, HistoryRotation, SearchRange, UiPurpose, SpaceIntent, NO_LIMIT, STORAGE_UNIT_BYTES, STATE_SNAPSHOT_VERSION, };
15
15
  export type { CommandResult, CommandRequest, CommandResponse, CommandsMap, EventsMap, } from "./AbstractChatClient";
16
16
  export type { WebSocketClientOptions } from "./WebSocketChatClient";
17
17
  export type { WebApiChatClientOptions } from "./WebApiChatClient";
@@ -3,6 +3,7 @@ import { Message, MessageType, MessageAuthor, MessageMentions } from "./schemes/
3
3
  import { PermissionOverwritesValue } from "./schemes/PermissionOverwritesValue";
4
4
  import { Role, RoleFlag } from "./schemes/Role";
5
5
  import { Room, RoomType } from "./schemes/Room";
6
+ import { PmParticipant, PmParticipantFlag } from "./schemes/PmParticipant";
6
7
  import { RoomMember } from "./schemes/RoomMember";
7
8
  import { RoomSummary, RoomSummaryExtras } from "./schemes/RoomSummary";
8
9
  import { Space, SpaceDiscoverable, SpaceIntent } from "./schemes/Space";
@@ -11,7 +12,7 @@ import { Topic } from "./schemes/Topic";
11
12
  import { User, UserStatus } from "./schemes/User";
12
13
  import { UserState } from "./schemes/UserState";
13
14
  import { Bye } from "./schemes/events/Bye";
14
- import { Error, ErrorCode } from "./schemes/events/Error";
15
+ import { Error, ErrorCode, ErrorDetails } from "./schemes/events/Error";
15
16
  import { Session } from "./schemes/events/Session";
16
17
  import { ComputedPermissions } from "./schemes/events/ComputedPermissions";
17
18
  import { SpaceJoined } from "./schemes/events/SpaceJoined";
@@ -54,6 +55,8 @@ import { SetPermissionOverwrites } from "./schemes/commands/SetPermissionOverwri
54
55
  import { GetPermissionOverwrites } from "./schemes/commands/GetPermissionOverwrites";
55
56
  import { JoinRoom } from "./schemes/commands/JoinRoom";
56
57
  import { LeaveRoom } from "./schemes/commands/LeaveRoom";
58
+ import { GetIgnoredRooms } from "./schemes/commands/GetIgnoredRooms";
59
+ import { IgnoredRooms } from "./schemes/events/IgnoredRooms";
57
60
  import { CreateRoom } from "./schemes/commands/CreateRoom";
58
61
  import { DeleteRoom } from "./schemes/commands/DeleteRoom";
59
62
  import { GetRoomMembers } from "./schemes/commands/GetRoomMembers";
@@ -161,5 +164,5 @@ import { Entitlements } from "./schemes/events/Entitlements";
161
164
  import { EntitlementUsage } from "./schemes/events/EntitlementUsage";
162
165
  import { CreateAccessTicket, TicketAudience } from "./schemes/commands/CreateAccessTicket";
163
166
  import { AccessTicket } from "./schemes/events/AccessTicket";
164
- export type { Envelope, Message, MessageType, MessageAuthor, MessageMentions, Role, Room, RoomType, RoomStream, RoomStreamType, RoomHistory, RoomHistoryMode, 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, EntitlementTarget, EntitlementsSubject, EntitlementValue, EntitlementsMap, EntitlementsExtras, TicketAudience, Bye, Error, Messages, 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, UserInfo, Invited, ReactionUpdated, Reacted, ReactionDetails, Entitlements, EntitlementUsage, AccessTicket, 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, 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, GetUserInfo, SetSessionData, GetSessionData, SetUserData, GetUserData, Invite, Uninvite, GetInvited, React, Unreact, GetReactionDetails, GetEntitlements, CreateAccessTicket, };
165
- export { ErrorCode, NO_LIMIT, STORAGE_UNIT_BYTES, HistoryRotation, RoleFlag, SearchRange, SpaceFeature, SpaceIntent, UiPurpose, UserFeature, UserStatus, };
167
+ export type { Envelope, Message, MessageType, MessageAuthor, MessageMentions, Role, Room, RoomType, PmParticipant, RoomStream, RoomStreamType, RoomHistory, RoomHistoryMode, 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, EntitlementTarget, EntitlementsSubject, EntitlementValue, EntitlementsMap, EntitlementsExtras, TicketAudience, Bye, Error, ErrorDetails, IgnoredRooms, Messages, 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, UserInfo, Invited, ReactionUpdated, Reacted, ReactionDetails, Entitlements, EntitlementUsage, AccessTicket, 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, GetUserInfo, SetSessionData, GetSessionData, SetUserData, GetUserData, Invite, Uninvite, GetInvited, React, Unreact, GetReactionDetails, GetEntitlements, CreateAccessTicket, };
168
+ export { ErrorCode, NO_LIMIT, STORAGE_UNIT_BYTES, HistoryRotation, PmParticipantFlag, RoleFlag, SearchRange, SpaceFeature, SpaceIntent, UiPurpose, UserFeature, UserStatus, };
@@ -1,9 +1,8 @@
1
1
  import { User } from "./User";
2
2
  export interface Emoticon {
3
3
  id: string;
4
- spaceId?: string;
4
+ spaceId?: string | null;
5
5
  name: string;
6
6
  fileId: string;
7
- user: User;
8
- tag?: string;
7
+ user: User | null;
9
8
  }
@@ -63,7 +63,8 @@ export declare enum SpaceFeature {
63
63
  export declare enum UserFeature {
64
64
  MessageLength = "user.message.length",
65
65
  StorageLimit = "user.storage.limit",
66
- StorageSingleFileLimit = "user.storage.single_file_limit"
66
+ StorageSingleFileLimit = "user.storage.single_file_limit",
67
+ ExternalEmoticons = "user.external_emoticons"
67
68
  }
68
69
  /**
69
70
  * How far back a room of the space may be told to keep its history.
@@ -2,7 +2,7 @@ import { User } from "./User";
2
2
  import { ChatLocation } from "./ChatLocation";
3
3
  import { MessageReaction } from "./Reaction";
4
4
  import { MessagePoll } from "./MessagePoll";
5
- export type MessageType = 'Text' | 'RoomJoin' | 'RoomMemberAdd' | 'RoomLeave' | 'SpaceJoin' | 'SpaceLeave' | 'TopicChange' | 'CustomNickChange' | 'Ephemeral' | 'Poll';
5
+ export type MessageType = 'Text' | 'RoomJoin' | 'RoomMemberAdd' | 'RoomLeave' | 'SpaceJoin' | 'SpaceLeave' | 'TopicChange' | 'CustomNickChange' | 'Ephemeral' | 'Poll' | 'RoomRename';
6
6
  /**
7
7
  * Mention targets a message actually reached, as resolved by the server: role
8
8
  * mentions the author was not allowed to fire are absent, even though they stay
@@ -0,0 +1,8 @@
1
+ import { User } from "./User";
2
+ export declare enum PmParticipantFlag {
3
+ IgnoresRoom = 1
4
+ }
5
+ export interface PmParticipant {
6
+ user: User;
7
+ flags: number;
8
+ }
@@ -2,6 +2,7 @@ export type ReactionType = 'Emoji' | 'Emoticon';
2
2
  export interface MessageReaction {
3
3
  type: ReactionType;
4
4
  value: string;
5
+ name?: string | null;
5
6
  count: number;
6
7
  }
7
8
  export interface UserReaction {
@@ -9,5 +10,6 @@ export interface UserReaction {
9
10
  value: string;
10
11
  }
11
12
  export interface ToggledReaction extends UserReaction {
13
+ name?: string | null;
12
14
  isAdded: boolean;
13
15
  }
@@ -2,6 +2,7 @@ import { Topic } from "./Topic";
2
2
  import { User } from "./User";
3
3
  import { RoomStream } from "./RoomStream";
4
4
  import { RoomHistory } from "./RoomHistory";
5
+ import { PmParticipant } from "./PmParticipant";
5
6
  export type RoomType = 'Text' | 'ClassicText' | 'Pm';
6
7
  export interface Room {
7
8
  id: string;
@@ -10,6 +11,8 @@ export interface Room {
10
11
  description: string;
11
12
  type: RoomType;
12
13
  defaultTopic: Topic | null;
14
+ participants: PmParticipant[] | null;
15
+ /** @deprecated */
13
16
  recipients: User[] | null;
14
17
  flags: number;
15
18
  stream: RoomStream | null;
@@ -1,5 +1,5 @@
1
1
  export interface CreateEmoticon {
2
2
  name: string;
3
3
  fileId: string;
4
- spaceId?: string;
4
+ spaceId: string;
5
5
  }
@@ -1,3 +1,4 @@
1
1
  export interface GetEmoticons {
2
2
  spaceId?: string;
3
+ ids?: string[];
3
4
  }
@@ -0,0 +1,2 @@
1
+ export interface GetIgnoredRooms {
2
+ }
@@ -1,3 +1,4 @@
1
1
  export interface LeaveRoom {
2
2
  id: string;
3
+ ignore?: boolean;
3
4
  }
@@ -1,4 +1,4 @@
1
1
  export interface EmoticonDeleted {
2
2
  emoticonId: string;
3
- spaceId?: string;
3
+ spaceId: string;
4
4
  }
@@ -2,5 +2,5 @@ import { Emoticon } from "../Emoticon";
2
2
  import { ChatLocation } from "../ChatLocation";
3
3
  export interface Emoticons {
4
4
  emoticons: Emoticon[];
5
- location: ChatLocation;
5
+ location: ChatLocation | null;
6
6
  }
@@ -1,6 +1,10 @@
1
+ export interface ErrorDetails {
2
+ roomId?: string;
3
+ }
1
4
  export interface Error {
2
5
  code: string;
3
6
  message: string;
7
+ details?: ErrorDetails | null;
4
8
  }
5
9
  export declare enum ErrorCode {
6
10
  Authentication = "AuthenticationException",
@@ -8,6 +12,7 @@ export declare enum ErrorCode {
8
12
  InvalidSearchQuery = "InvalidSearchQueryException",
9
13
  MessageSearchUnavailable = "MessageSearchUnavailableException",
10
14
  MessageNotFound = "MessageNotFoundException",
15
+ RoomIgnored = "RoomIgnoredException",
11
16
  RoomNotFound = "RoomNotFoundException",
12
17
  TopicNotFound = "TopicNotFoundException",
13
18
  UserNotFound = "UserNotFoundException"
@@ -0,0 +1,4 @@
1
+ import { Room } from "../Room";
2
+ export interface IgnoredRooms {
3
+ rooms: Room[];
4
+ }
@@ -7,7 +7,7 @@ export declare class EmoticonsManager {
7
7
  private list;
8
8
  private emoticonsPromises;
9
9
  constructor(tracker: ChatStateTracker);
10
- get(spaceId?: string): Promise<ObservableIndexedObjectCollection<Emoticon>>;
10
+ get(spaceId: string): Promise<ObservableIndexedObjectCollection<Emoticon>>;
11
11
  /**
12
12
  * For internal use.
13
13
  * @internal
@@ -59,7 +59,7 @@ export declare class RoomsManager {
59
59
  */
60
60
  _exportHistories(intent: StateSnapshotIntent): TopicHistorySnapshot[];
61
61
  /**
62
- * Members of private conversations are not exported - they are made of the recipients of the room.
62
+ * Members of private conversations are not exported - they are made of the participants of the room.
63
63
  * @internal
64
64
  */
65
65
  _exportMembers(roomIds: string[], limit: number): RoomMembersSnapshot[];
@@ -87,6 +87,7 @@ export declare class RoomsManager {
87
87
  private handleRoomDeleted;
88
88
  private handleTopicUpdated;
89
89
  private addJoinedRooms;
90
+ private setPmMembers;
90
91
  private handleRoomLeft;
91
92
  private handleRoomMembersJoined;
92
93
  private handleRoomMemberLeft;
@@ -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 = 1;
5
+ export declare const STATE_SNAPSHOT_VERSION = 2;
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}.
@@ -86,10 +86,7 @@ export interface RoomFollowedTopicsSnapshot {
86
86
  followedTopics: FollowedTopic[];
87
87
  }
88
88
  export interface EmoticonsSnapshot {
89
- /**
90
- * Null for the global emoticons.
91
- */
92
- spaceId: string | null;
89
+ spaceId: string;
93
90
  emoticons: Emoticon[];
94
91
  }
95
92
  export declare function withoutPresence(user: User): User;
@@ -1,6 +1,6 @@
1
1
  import { ChatStateTracker } from "./ChatStateTracker";
2
2
  import { ObservableIndexedObjectCollection } from "../IndexedObjectCollection";
3
- import { User } from "../protocol";
3
+ import { Room, User } from "../protocol";
4
4
  import { EventTarget } from "../EventTarget";
5
5
  export declare class UsersManager {
6
6
  private tracker;
@@ -18,7 +18,13 @@ export declare class UsersManager {
18
18
  * @internal
19
19
  */
20
20
  _importUser(user: User): void;
21
+ /**
22
+ * For internal use.
23
+ * @internal
24
+ */
25
+ _importRooms(rooms: Room[]): void;
21
26
  private handleMembers;
27
+ private handleRooms;
22
28
  private handleSession;
23
29
  /**
24
30
  * Every message carries its author, so most of what arrives here is already known - only the users that actually
@@ -1,6 +1,17 @@
1
- import { Role, RoomMember, SpaceMember, User } from "../protocol";
1
+ import { PmParticipant, Role, Room, RoomMember, SpaceMember, User } from "../protocol";
2
2
  /**
3
3
  * @return New objects of the other roles whose priority has to move; the given roles are left intact.
4
4
  */
5
5
  export declare function reorderRolesOnPriorityUpdate(allRoles: Role[], oldRole: Role, updatedRole: Role): Role[];
6
6
  export declare function extractUserFromMember(member: RoomMember | SpaceMember): User | null;
7
+ /**
8
+ * Whether the room is a private group conversation - 3 or more participants, including the ones ignoring it.
9
+ */
10
+ export declare function isGroupPm(room: Room): boolean;
11
+ /**
12
+ * Participants of a private conversation taking part in it: without the ones ignoring it and without the user
13
+ * `meId`. Empty for notes and for rooms of spaces.
14
+ */
15
+ export declare function getPmPeers(room: Room, meId: string): PmParticipant[];
16
+ export declare function getActivePmParticipants(room: Room): PmParticipant[];
17
+ export declare function isSameUser(a: User, b: User): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devanachat/sdk",
3
- "version": "0.8.1",
3
+ "version": "0.10.0",
4
4
  "description": "TypeScript/JavaScript SDK for the Devana chat platform: WebSocket and Web API clients, state tracking, permissions and files.",
5
5
  "keywords": [
6
6
  "devana",