@devanachat/sdk 0.9.0 → 0.11.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 (35) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/build/index.cjs.js +322 -105
  3. package/build/index.cjs.js.map +1 -1
  4. package/build/index.mjs +317 -105
  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 +5 -1
  9. package/build/types/Permissions.d.ts +8 -0
  10. package/build/types/index.d.ts +5 -4
  11. package/build/types/protocol/index.d.ts +9 -4
  12. package/build/types/protocol/schemes/Message.d.ts +1 -1
  13. package/build/types/protocol/schemes/PmParticipant.d.ts +8 -0
  14. package/build/types/protocol/schemes/Role.d.ts +6 -0
  15. package/build/types/protocol/schemes/Room.d.ts +3 -0
  16. package/build/types/protocol/schemes/Space.d.ts +1 -0
  17. package/build/types/protocol/schemes/Topic.d.ts +1 -0
  18. package/build/types/protocol/schemes/commands/CreateMessage.d.ts +1 -0
  19. package/build/types/protocol/schemes/commands/GetIgnoredRooms.d.ts +2 -0
  20. package/build/types/protocol/schemes/commands/LeaveRoom.d.ts +1 -0
  21. package/build/types/protocol/schemes/commands/Type.d.ts +4 -0
  22. package/build/types/protocol/schemes/commands/UpdateRole.d.ts +2 -0
  23. package/build/types/protocol/schemes/commands/UpdateSpace.d.ts +1 -0
  24. package/build/types/protocol/schemes/commands/UpdateTopic.d.ts +1 -0
  25. package/build/types/protocol/schemes/events/Error.d.ts +7 -0
  26. package/build/types/protocol/schemes/events/IgnoredRooms.d.ts +4 -0
  27. package/build/types/protocol/schemes/events/NewMessage.d.ts +1 -0
  28. package/build/types/protocol/schemes/events/Typing.d.ts +5 -0
  29. package/build/types/state-tracker/PermissionsManager.d.ts +1 -1
  30. package/build/types/state-tracker/RoomsManager.d.ts +4 -1
  31. package/build/types/state-tracker/StateSnapshot.d.ts +1 -1
  32. package/build/types/state-tracker/TypingManager.d.ts +35 -0
  33. package/build/types/state-tracker/UsersManager.d.ts +7 -1
  34. package/build/types/state-tracker/functions.d.ts +12 -1
  35. 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, Type, Typing, 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;
@@ -104,6 +105,7 @@ export type EventsMap = {
104
105
  ReactionUpdated: ReactionUpdated;
105
106
  Reacted: Reacted;
106
107
  ReactionDetails: ReactionDetails;
108
+ Typing: Typing;
107
109
  };
108
110
  /**
109
111
  * Map of commands and their corresponding events.
@@ -155,6 +157,7 @@ export type CommandsMap = {
155
157
  UpdateSpaceMember: CommandDefinition<UpdateSpaceMember, EventsMap['SpaceMemberUpdated']>;
156
158
  JoinRoom: CommandDefinition<JoinRoom, EventsMap['RoomJoined']>;
157
159
  LeaveRoom: CommandDefinition<LeaveRoom, EventsMap['RoomLeft']>;
160
+ GetIgnoredRooms: CommandDefinition<GetIgnoredRooms, EventsMap['IgnoredRooms']>;
158
161
  CreateRoom: CommandDefinition<CreateRoom, EventsMap['RoomJoined']>;
159
162
  DeleteRoom: CommandDefinition<DeleteRoom, EventsMap['RoomDeleted']>;
160
163
  UpdateRoom: CommandDefinition<UpdateRoom, EventsMap['RoomUpdated']>;
@@ -180,5 +183,6 @@ export type CommandsMap = {
180
183
  React: CommandDefinition<React, EventsMap['Reacted']>;
181
184
  Unreact: CommandDefinition<Unreact, EventsMap['Reacted']>;
182
185
  GetReactionDetails: CommandDefinition<GetReactionDetails, EventsMap['ReactionDetails']>;
186
+ Type: CommandDefinition<Type, EventsMap['Ok']>;
183
187
  };
184
188
  export {};
@@ -114,6 +114,14 @@ export declare class Permissions {
114
114
  value: number;
115
115
  maxLayer: Layer;
116
116
  };
117
+ ManagePins: {
118
+ value: number;
119
+ maxLayer: Layer;
120
+ };
121
+ SendAttachments: {
122
+ value: number;
123
+ maxLayer: Layer;
124
+ };
117
125
  };
118
126
  static getNames(): (keyof typeof this.list)[];
119
127
  static getByName(name: keyof typeof this.list): PermissionDefinition | undefined;
@@ -4,18 +4,19 @@ 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
+ import { TYPING_INTERVAL_MS, TYPING_TIMEOUT_MS, TypingManager, TypingUsers } from "./state-tracker/TypingManager";
15
+ 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, TYPING_INTERVAL_MS, TYPING_TIMEOUT_MS, };
15
16
  export type { CommandResult, CommandRequest, CommandResponse, CommandsMap, EventsMap, } from "./AbstractChatClient";
16
17
  export type { WebSocketClientOptions } from "./WebSocketChatClient";
17
18
  export type { WebApiChatClientOptions } from "./WebApiChatClient";
18
19
  export type { RestClientOptions, RestClientResponse } from "./AbstractRestClient";
19
20
  export type { EventHandler, ObservableInterface } from "./EventTarget";
20
21
  export type { StateSnapshot, SpaceRoomsSnapshot, RoomFollowedTopicsSnapshot, EmoticonsSnapshot, StateSnapshotIntent, TopicHistorySnapshot, RoomMembersSnapshot, } from "./state-tracker/StateSnapshot";
21
- export type { ChatTypes, File, UnreadSummary, TopicHistoryWindow, PermissionsManager, };
22
+ export type { ChatTypes, File, UnreadSummary, TopicHistoryWindow, PermissionsManager, TypingManager, TypingUsers, };
@@ -1,8 +1,9 @@
1
1
  import { Envelope } from "./schemes/Envelope";
2
2
  import { Message, MessageType, MessageAuthor, MessageMentions } from "./schemes/Message";
3
3
  import { PermissionOverwritesValue } from "./schemes/PermissionOverwritesValue";
4
- import { Role, RoleFlag } from "./schemes/Role";
4
+ import { Role, RoleFlag, RoleIcon } 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";
@@ -155,11 +158,13 @@ import { GetReactionDetails } from "./schemes/commands/GetReactionDetails";
155
158
  import { ReactionUpdated } from "./schemes/events/ReactionUpdated";
156
159
  import { Reacted } from "./schemes/events/Reacted";
157
160
  import { ReactionDetails } from "./schemes/events/ReactionDetails";
161
+ import { Type } from "./schemes/commands/Type";
162
+ import { Typing } from "./schemes/events/Typing";
158
163
  import { EntitlementsExtras, EntitlementsMap, EntitlementsSubject, EntitlementTarget, EntitlementValue, HistoryRotation, NO_LIMIT, SearchRange, SpaceFeature, STORAGE_UNIT_BYTES, UiPurpose, UserFeature } from "./schemes/Entitlements";
159
164
  import { GetEntitlements } from "./schemes/commands/GetEntitlements";
160
165
  import { Entitlements } from "./schemes/events/Entitlements";
161
166
  import { EntitlementUsage } from "./schemes/events/EntitlementUsage";
162
167
  import { CreateAccessTicket, TicketAudience } from "./schemes/commands/CreateAccessTicket";
163
168
  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, };
169
+ export type { Envelope, Message, MessageType, MessageAuthor, MessageMentions, Role, RoleIcon, 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, Typing, 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, Type, GetEntitlements, CreateAccessTicket, };
170
+ export { ErrorCode, NO_LIMIT, STORAGE_UNIT_BYTES, HistoryRotation, PmParticipantFlag, RoleFlag, SearchRange, SpaceFeature, SpaceIntent, UiPurpose, UserFeature, UserStatus, };
@@ -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
+ }
@@ -1,3 +1,4 @@
1
+ import { ReactionType } from "./Reaction";
1
2
  /**
2
3
  * Bit flags of a role, stored in {@link Role.flags}.
3
4
  *
@@ -11,10 +12,15 @@ export declare enum RoleFlag {
11
12
  SeparateOnMembersList = 1,
12
13
  MentionableByEveryone = 2
13
14
  }
15
+ export interface RoleIcon {
16
+ type: ReactionType;
17
+ value: string;
18
+ }
14
19
  export interface Role {
15
20
  id: string;
16
21
  priority: number;
17
22
  name: string;
18
23
  color?: string;
19
24
  flags: number;
25
+ icon?: RoleIcon | null;
20
26
  }
@@ -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;
@@ -16,4 +16,5 @@ export interface Space {
16
16
  banner: string | null;
17
17
  discoverable: SpaceDiscoverable;
18
18
  flags: number;
19
+ guestRole: string | null;
19
20
  }
@@ -5,4 +5,5 @@ export interface Topic {
5
5
  messageCount: number;
6
6
  refMessage?: Message;
7
7
  lastMessage?: Message;
8
+ stickyMessage?: Message | null;
8
9
  }
@@ -8,4 +8,5 @@ export interface CreateMessage {
8
8
  customColor?: string;
9
9
  /** Turns the message into a poll; its content becomes the question. */
10
10
  poll?: MessagePoll;
11
+ sticky?: boolean;
11
12
  }
@@ -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
  }
@@ -0,0 +1,4 @@
1
+ import { ChatLocation } from "../ChatLocation";
2
+ export interface Type {
3
+ location: ChatLocation;
4
+ }
@@ -1,3 +1,4 @@
1
+ import { RoleIcon } from "../Role";
1
2
  export interface UpdateRole {
2
3
  spaceId: string;
3
4
  id: string;
@@ -5,4 +6,5 @@ export interface UpdateRole {
5
6
  name?: string;
6
7
  color?: string;
7
8
  flags?: number;
9
+ icon?: RoleIcon | null;
8
10
  }
@@ -9,4 +9,5 @@ export interface UpdateSpace {
9
9
  banner?: string | null;
10
10
  discoverable?: SpaceDiscoverable;
11
11
  flags?: number;
12
+ guestRole?: string | null;
12
13
  }
@@ -2,4 +2,5 @@ import { ChatLocation } from "../ChatLocation";
2
2
  export interface UpdateTopic {
3
3
  location: ChatLocation;
4
4
  name?: string;
5
+ stickyMessageId?: string | null;
5
6
  }
@@ -1,6 +1,11 @@
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;
8
+ subcode?: string | null;
4
9
  }
5
10
  export declare enum ErrorCode {
6
11
  Authentication = "AuthenticationException",
@@ -8,7 +13,9 @@ export declare enum ErrorCode {
8
13
  InvalidSearchQuery = "InvalidSearchQueryException",
9
14
  MessageSearchUnavailable = "MessageSearchUnavailableException",
10
15
  MessageNotFound = "MessageNotFoundException",
16
+ RoomIgnored = "RoomIgnoredException",
11
17
  RoomNotFound = "RoomNotFoundException",
18
+ SpaceJoinRestricted = "SpaceJoinRestrictedException",
12
19
  TopicNotFound = "TopicNotFoundException",
13
20
  UserNotFound = "UserNotFoundException"
14
21
  }
@@ -0,0 +1,4 @@
1
+ import { Room } from "../Room";
2
+ export interface IgnoredRooms {
3
+ rooms: Room[];
4
+ }
@@ -1,4 +1,5 @@
1
1
  import { Message } from "../Message";
2
2
  export interface NewMessage {
3
3
  message: Message;
4
+ sticky?: boolean;
4
5
  }
@@ -0,0 +1,5 @@
1
+ import { ChatLocation } from "../ChatLocation";
2
+ export interface Typing {
3
+ location: ChatLocation;
4
+ userId: string;
5
+ }
@@ -40,7 +40,7 @@ export declare class PermissionsManager extends EventTarget<PermissionsManagerEv
40
40
  */
41
41
  private deleteOverwritesByIdPrefix;
42
42
  private collectRoleOverwrites;
43
- private resolveOverwritesFromRolesByOrder;
43
+ private mergeRolesOverwrites;
44
44
  private resolveOverwritesHierarchy;
45
45
  private getRootAccessValue;
46
46
  private fetchComputedPermissions;
@@ -3,11 +3,13 @@ import { Room, RoomMember, Topic } from "../protocol";
3
3
  import { ChatStateTracker } from "./ChatStateTracker";
4
4
  import { MessagesManager } from "./MessagesManager";
5
5
  import { FollowedTopicsManager } from "./FollowedTopicsManager";
6
+ import { TypingManager } from "./TypingManager";
6
7
  import { RoomMembersSnapshot, StateSnapshotIntent, TopicHistorySnapshot } from "./StateSnapshot";
7
8
  export declare class RoomsManager {
8
9
  private tracker;
9
10
  readonly messages: MessagesManager;
10
11
  readonly followedTopics: FollowedTopicsManager;
12
+ readonly typing: TypingManager;
11
13
  private readonly list;
12
14
  private readonly topics;
13
15
  private readonly members;
@@ -59,7 +61,7 @@ export declare class RoomsManager {
59
61
  */
60
62
  _exportHistories(intent: StateSnapshotIntent): TopicHistorySnapshot[];
61
63
  /**
62
- * Members of private conversations are not exported - they are made of the recipients of the room.
64
+ * Members of private conversations are not exported - they are made of the participants of the room.
63
65
  * @internal
64
66
  */
65
67
  _exportMembers(roomIds: string[], limit: number): RoomMembersSnapshot[];
@@ -87,6 +89,7 @@ export declare class RoomsManager {
87
89
  private handleRoomDeleted;
88
90
  private handleTopicUpdated;
89
91
  private addJoinedRooms;
92
+ private setPmMembers;
90
93
  private handleRoomLeft;
91
94
  private handleRoomMembersJoined;
92
95
  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}.
@@ -0,0 +1,35 @@
1
+ import { ChatStateTracker } from "./ChatStateTracker";
2
+ import { ObservableIndexedCollection } from "../IndexedObjectCollection";
3
+ export declare const TYPING_INTERVAL_MS = 5000;
4
+ export declare const TYPING_TIMEOUT_MS: number;
5
+ /**
6
+ * Ids of the users typing in a topic, each mapped to the time (`Date.now()`) its typing expires at.
7
+ */
8
+ export type TypingUsers = ObservableIndexedCollection<string, number>;
9
+ export declare class TypingManager {
10
+ private tracker;
11
+ private readonly topics;
12
+ private readonly lastSentAt;
13
+ constructor(tracker: ChatStateTracker);
14
+ /**
15
+ * Users typing in the topic, without you. Tracking of the topic starts with the first call, so the collection
16
+ * fills up with the next notifications, within {@link TYPING_INTERVAL_MS}. A user leaves it
17
+ * {@link TYPING_TIMEOUT_MS} after their last notification or at once with their message in the topic.
18
+ * Only ids are kept - resolve the users yourself, e.g. from {@link RoomsManager.getMembers}.
19
+ */
20
+ get(roomId: string, topicId: string): TypingUsers;
21
+ /**
22
+ * Tell the other members of the room that you are typing in the topic. Call it on every change of the text:
23
+ * the command is sent at most once per {@link TYPING_INTERVAL_MS} for a topic, and again right after your
24
+ * message in it. Classic rooms do not support typing.
25
+ */
26
+ notify(roomId: string, topicId: string): void;
27
+ private handleTyping;
28
+ private handleNewMessage;
29
+ private handleTopicDeleted;
30
+ private handleRoomGone;
31
+ private handleSession;
32
+ private clear;
33
+ private scheduleExpiry;
34
+ private expire;
35
+ }
@@ -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.9.0",
3
+ "version": "0.11.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",