@devanachat/sdk 0.14.0 → 0.15.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 (30) hide show
  1. package/CHANGELOG.md +49 -1
  2. package/build/index.cjs.js +415 -1
  3. package/build/index.cjs.js.map +1 -1
  4. package/build/index.mjs +414 -1
  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 +13 -1
  9. package/build/types/Permissions.d.ts +4 -0
  10. package/build/types/index.d.ts +4 -2
  11. package/build/types/protocol/index.d.ts +15 -1
  12. package/build/types/protocol/schemes/Activity.d.ts +16 -0
  13. package/build/types/protocol/schemes/SavedItem.d.ts +7 -0
  14. package/build/types/protocol/schemes/commands/GetActivities.d.ts +3 -0
  15. package/build/types/protocol/schemes/commands/GetSavedItems.d.ts +3 -0
  16. package/build/types/protocol/schemes/commands/SaveItem.d.ts +5 -0
  17. package/build/types/protocol/schemes/commands/UnsaveItem.d.ts +5 -0
  18. package/build/types/protocol/schemes/commands/UpdateActivities.d.ts +4 -0
  19. package/build/types/protocol/schemes/events/Activities.d.ts +9 -0
  20. package/build/types/protocol/schemes/events/ActivityDeleted.d.ts +3 -0
  21. package/build/types/protocol/schemes/events/ActivityUpdated.d.ts +4 -0
  22. package/build/types/protocol/schemes/events/Error.d.ts +3 -1
  23. package/build/types/protocol/schemes/events/ItemSaved.d.ts +6 -0
  24. package/build/types/protocol/schemes/events/ItemUnsaved.d.ts +5 -0
  25. package/build/types/protocol/schemes/events/NewActivity.d.ts +8 -0
  26. package/build/types/protocol/schemes/events/SavedItems.d.ts +6 -0
  27. package/build/types/state-tracker/ActivitiesManager.d.ts +63 -0
  28. package/build/types/state-tracker/ChatStateTracker.d.ts +13 -0
  29. package/build/types/state-tracker/SavedItemsManager.d.ts +46 -0
  30. 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, JoinCall, DeclineCall, InviteToCall, MuteCallMember, KickCallMember, UpdateCallMember, GetCallMembers, CallJoined, CallUpdated, IncomingCallUpdated, CallVideoLimitReached, CallMembers, CallMemberJoined, CallMemberUpdated, CallMemberLeft } 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, GetActivities, UpdateActivities, Activities, NewActivity, ActivityUpdated, ActivityDeleted, SaveItem, UnsaveItem, GetSavedItems, SavedItems, ItemSaved, ItemUnsaved } 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>;
@@ -120,6 +120,13 @@ export type EventsMap = {
120
120
  CallMemberJoined: CallMemberJoined;
121
121
  CallMemberUpdated: CallMemberUpdated;
122
122
  CallMemberLeft: CallMemberLeft;
123
+ Activities: Activities;
124
+ NewActivity: NewActivity;
125
+ ActivityUpdated: ActivityUpdated;
126
+ ActivityDeleted: ActivityDeleted;
127
+ SavedItems: SavedItems;
128
+ ItemSaved: ItemSaved;
129
+ ItemUnsaved: ItemUnsaved;
123
130
  };
124
131
  /**
125
132
  * Map of commands and their corresponding events.
@@ -214,5 +221,10 @@ export type CommandsMap = {
214
221
  KickCallMember: CommandDefinition<KickCallMember, EventsMap['Ok']>;
215
222
  UpdateCallMember: CommandDefinition<UpdateCallMember, EventsMap['Ok']>;
216
223
  GetCallMembers: CommandDefinition<GetCallMembers, EventsMap['CallMembers']>;
224
+ GetActivities: CommandDefinition<GetActivities, EventsMap['Activities']>;
225
+ UpdateActivities: CommandDefinition<UpdateActivities, EventsMap['ActivityUpdated']>;
226
+ SaveItem: CommandDefinition<SaveItem, EventsMap['ItemSaved']>;
227
+ UnsaveItem: CommandDefinition<UnsaveItem, EventsMap['ItemUnsaved']>;
228
+ GetSavedItems: CommandDefinition<GetSavedItems, EventsMap['SavedItems']>;
217
229
  };
218
230
  export {};
@@ -142,6 +142,10 @@ export declare class Permissions {
142
142
  value: number;
143
143
  maxLayer: Layer;
144
144
  };
145
+ StartCalls: {
146
+ value: number;
147
+ maxLayer: Layer;
148
+ };
145
149
  };
146
150
  /**
147
151
  * Whether the permission mask (e.g. from {@link PermissionsManager.calculatePermissions}) grants the permission.
@@ -13,11 +13,13 @@ 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
+ import { ActivitiesManager } from "./state-tracker/ActivitiesManager";
17
+ import { SavedItemsManager, savedItemKey } from "./state-tracker/SavedItemsManager";
18
+ export { IndexedCollection, ObservableIndexedCollection, IndexedObjectCollection, ObservableIndexedObjectCollection, savedItemKey, 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, };
17
19
  export type { CommandResult, CommandRequest, CommandResponse, CommandsMap, EventsMap, } from "./AbstractChatClient";
18
20
  export type { WebSocketClientOptions } from "./WebSocketChatClient";
19
21
  export type { WebApiChatClientOptions } from "./WebApiChatClient";
20
22
  export type { RestClientOptions, RestClientResponse } from "./AbstractRestClient";
21
23
  export type { EventHandler, ObservableInterface } from "./EventTarget";
22
24
  export type { StateSnapshot, SpaceRoomsSnapshot, RoomFollowedTopicsSnapshot, EmoticonsSnapshot, StateSnapshotIntent, TopicHistorySnapshot, RoomMembersSnapshot, } from "./state-tracker/StateSnapshot";
23
- export type { ChatTypes, File, UnreadSummary, TopicHistoryWindow, PermissionsManager, TypingManager, TypingUsers, CallsManager, };
25
+ export type { ChatTypes, File, UnreadSummary, TopicHistoryWindow, PermissionsManager, TypingManager, TypingUsers, CallsManager, ActivitiesManager, SavedItemsManager, };
@@ -197,5 +197,19 @@ import { CallMembers } from "./schemes/events/CallMembers";
197
197
  import { CallMemberJoined } from "./schemes/events/CallMemberJoined";
198
198
  import { CallMemberUpdated } from "./schemes/events/CallMemberUpdated";
199
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, };
200
+ import { Activity, ActivityType } from "./schemes/Activity";
201
+ import { GetActivities } from "./schemes/commands/GetActivities";
202
+ import { UpdateActivities } from "./schemes/commands/UpdateActivities";
203
+ import { Activities } from "./schemes/events/Activities";
204
+ import { NewActivity } from "./schemes/events/NewActivity";
205
+ import { ActivityUpdated } from "./schemes/events/ActivityUpdated";
206
+ import { ActivityDeleted } from "./schemes/events/ActivityDeleted";
207
+ import { SavedItem, SavedItemType } from "./schemes/SavedItem";
208
+ import { SaveItem } from "./schemes/commands/SaveItem";
209
+ import { UnsaveItem } from "./schemes/commands/UnsaveItem";
210
+ import { GetSavedItems } from "./schemes/commands/GetSavedItems";
211
+ import { SavedItems } from "./schemes/events/SavedItems";
212
+ import { ItemSaved } from "./schemes/events/ItemSaved";
213
+ import { ItemUnsaved } from "./schemes/events/ItemUnsaved";
214
+ 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, Activity, ActivityType, SavedItem, SavedItemType, 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, Activities, NewActivity, ActivityUpdated, ActivityDeleted, SavedItems, ItemSaved, ItemUnsaved, 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, GetActivities, UpdateActivities, SaveItem, UnsaveItem, GetSavedItems, };
201
215
  export { CallMemberFlag, ErrorCode, MessageEmbedFlag, NO_LIMIT, STORAGE_UNIT_BYTES, HistoryRotation, PmParticipantFlag, RoleFlag, SearchRange, SpaceFeature, SpaceIntent, UiPurpose, UserFeature, UserStatus, };
@@ -0,0 +1,16 @@
1
+ import { ChatLocation } from "./ChatLocation";
2
+ export type ActivityType = 'Mention' | 'Reply' | 'Reaction' | 'Thread' | 'MissedCall' | 'Custom';
3
+ export interface Activity {
4
+ id: string;
5
+ type: ActivityType;
6
+ groupKey: string | null;
7
+ location: ChatLocation | null;
8
+ messageId: string | null;
9
+ actorIds: string[];
10
+ count: number;
11
+ createdAt: string;
12
+ title: string | null;
13
+ description: string | null;
14
+ link: string | null;
15
+ isRead: boolean;
16
+ }
@@ -0,0 +1,7 @@
1
+ export type SavedItemType = 'Room' | 'Message';
2
+ export interface SavedItem {
3
+ type: SavedItemType;
4
+ id: string;
5
+ roomId: string;
6
+ savedAt: string;
7
+ }
@@ -0,0 +1,3 @@
1
+ export interface GetActivities {
2
+ withMessages?: boolean;
3
+ }
@@ -0,0 +1,3 @@
1
+ export interface GetSavedItems {
2
+ withMessages?: boolean;
3
+ }
@@ -0,0 +1,5 @@
1
+ import { SavedItemType } from "../SavedItem";
2
+ export interface SaveItem {
3
+ type: SavedItemType;
4
+ id: string;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { SavedItemType } from "../SavedItem";
2
+ export interface UnsaveItem {
3
+ type: SavedItemType;
4
+ id: string;
5
+ }
@@ -0,0 +1,4 @@
1
+ export interface UpdateActivities {
2
+ seenAt?: string;
3
+ clear?: boolean;
4
+ }
@@ -0,0 +1,9 @@
1
+ import { Activity } from "../Activity";
2
+ import { Message } from "../Message";
3
+ import { User } from "../User";
4
+ export interface Activities {
5
+ seenAt: string | null;
6
+ activities: Activity[];
7
+ messages: Message[];
8
+ users: User[];
9
+ }
@@ -0,0 +1,3 @@
1
+ export interface ActivityDeleted {
2
+ id: string;
3
+ }
@@ -0,0 +1,4 @@
1
+ export interface ActivityUpdated {
2
+ seenAt: string | null;
3
+ cleared: boolean;
4
+ }
@@ -21,8 +21,10 @@ export declare enum ErrorCode {
21
21
  ReactionExistsAlready = "ReactionExistsAlreadyException",
22
22
  RoomIgnored = "RoomIgnoredException",
23
23
  RoomNotFound = "RoomNotFoundException",
24
+ SavedItemsLimitReached = "SavedItemsLimitReachedException",
24
25
  SpaceJoinRestricted = "SpaceJoinRestrictedException",
25
26
  TooManyCallInvitees = "TooManyCallInviteesException",
26
27
  TopicNotFound = "TopicNotFoundException",
27
- UserNotFound = "UserNotFoundException"
28
+ UserNotFound = "UserNotFoundException",
29
+ UserType = "UserTypeException"
28
30
  }
@@ -0,0 +1,6 @@
1
+ import { SavedItem } from "../SavedItem";
2
+ import { Message } from "../Message";
3
+ export interface ItemSaved {
4
+ item: SavedItem;
5
+ message: Message | null;
6
+ }
@@ -0,0 +1,5 @@
1
+ import { SavedItemType } from "../SavedItem";
2
+ export interface ItemUnsaved {
3
+ type: SavedItemType;
4
+ id: string;
5
+ }
@@ -0,0 +1,8 @@
1
+ import { Activity } from "../Activity";
2
+ import { Message } from "../Message";
3
+ import { User } from "../User";
4
+ export interface NewActivity {
5
+ activity: Activity;
6
+ message: Message | null;
7
+ users: User[];
8
+ }
@@ -0,0 +1,6 @@
1
+ import { SavedItem } from "../SavedItem";
2
+ import { Message } from "../Message";
3
+ export interface SavedItems {
4
+ items: SavedItem[];
5
+ messages: Message[];
6
+ }
@@ -0,0 +1,63 @@
1
+ import { EventTarget } from "../EventTarget";
2
+ import { ObservableIndexedObjectCollection } from "../IndexedObjectCollection";
3
+ import { Activity, Message, User } from "../protocol";
4
+ import { ChatStateTracker } from "./ChatStateTracker";
5
+ interface EventMap {
6
+ seenAtChange: {};
7
+ }
8
+ export declare class ActivitiesManager extends EventTarget<EventMap> {
9
+ private tracker;
10
+ private readonly activities;
11
+ private readonly messages;
12
+ private readonly users;
13
+ private readonly promises;
14
+ private readonly acks;
15
+ private readonly hiddenRoomIds;
16
+ private activitiesWanted;
17
+ private messagesWanted;
18
+ private refreshScheduled;
19
+ private seen;
20
+ constructor(tracker: ChatStateTracker);
21
+ /**
22
+ * Your latest activities, keyed by id; always the same collection. The first call fetches them, later ones resolve
23
+ * with them. Once fetched, they are fetched again after every reconnect, also when the first fetch failed because
24
+ * the connection was not ready yet. The collection keeps no meaningful order - sort by `createdAt`. Marking the list
25
+ * as seen and clearing it is done with the `UpdateActivities` command.
26
+ * @param fetchWithMessages Fetch the messages and the actors of the activities along, so {@link getMessages} and
27
+ * {@link getUsers} need no request.
28
+ */
29
+ get(fetchWithMessages?: boolean): Promise<ObservableIndexedObjectCollection<Activity>>;
30
+ /**
31
+ * The messages the activities point at, keyed by message id; always the same collection. The first call fetches
32
+ * them together with the list of {@link get}, unless they were fetched already; afterwards they come with new
33
+ * activities, follow the edits and are fetched again after every reconnect.
34
+ */
35
+ getMessages(): Promise<ObservableIndexedObjectCollection<Message>>;
36
+ /**
37
+ * The actors of the activities, keyed by user id; always the same collection, fetched and kept together with
38
+ * {@link getMessages}.
39
+ */
40
+ getUsers(): Promise<ObservableIndexedObjectCollection<User>>;
41
+ /**
42
+ * When the list was last seen, on any device; null until it is fetched or while it was never seen. A change emits
43
+ * `seenAtChange`. Activities created later that are not {@link Activity.isRead} are the unread ones.
44
+ */
45
+ get seenAt(): string | null;
46
+ private registerFetch;
47
+ private fetch;
48
+ private apply;
49
+ private refresh;
50
+ private setSeen;
51
+ private handleNewActivity;
52
+ private handleActivityUpdated;
53
+ private handleActivityDeleted;
54
+ private handleFollowedTopicUpdated;
55
+ private handleMessageUpdated;
56
+ private handleMessagesRedacted;
57
+ private handleRoomDeleted;
58
+ private handleRoomLeft;
59
+ private handleRoomJoined;
60
+ private deleteActivities;
61
+ private handleSession;
62
+ }
63
+ export {};
@@ -7,6 +7,8 @@ import { EmoticonsManager } from "./EmoticonsManager";
7
7
  import { UsersManager } from "./UsersManager";
8
8
  import { RelationshipsManager } from "./RelationshipsManager";
9
9
  import { CallsManager } from "./CallsManager";
10
+ import { ActivitiesManager } from "./ActivitiesManager";
11
+ import { SavedItemsManager } from "./SavedItemsManager";
10
12
  import { StateSnapshot, StateSnapshotIntent } from "./StateSnapshot";
11
13
  export declare class ChatStateTracker {
12
14
  readonly client: WebSocketChatClient;
@@ -38,6 +40,17 @@ export declare class ChatStateTracker {
38
40
  * State of the calls in your rooms and of the calls ringing at you.
39
41
  */
40
42
  readonly calls: CallsManager;
43
+ /**
44
+ * Your latest personal events from all spaces (mentions, replies, reactions, followed threads, missed calls) and the
45
+ * activities the server publishes. Private conversations keep their own unread state. Nothing is fetched until you
46
+ * ask for it. Not part of the state snapshot.
47
+ */
48
+ readonly activities: ActivitiesManager;
49
+ /**
50
+ * The rooms and messages you saved, from all spaces. Nothing is fetched until you ask for it. Not part of the state
51
+ * snapshot.
52
+ */
53
+ readonly savedItems: SavedItemsManager;
41
54
  private _me;
42
55
  private readonly deferredSession;
43
56
  private sessionReceived;
@@ -0,0 +1,46 @@
1
+ import { ObservableIndexedObjectCollection } from "../IndexedObjectCollection";
2
+ import { Message, SavedItem, SavedItemType } from "../protocol";
3
+ import { ChatStateTracker } from "./ChatStateTracker";
4
+ /**
5
+ * The key of a saved item in the collection returned by {@link SavedItemsManager.get}.
6
+ */
7
+ export declare const savedItemKey: (type: SavedItemType, id: string) => string;
8
+ export declare class SavedItemsManager {
9
+ private tracker;
10
+ private readonly items;
11
+ private readonly messages;
12
+ private readonly promises;
13
+ private readonly hiddenRoomIds;
14
+ private itemsWanted;
15
+ private messagesWanted;
16
+ private refreshScheduled;
17
+ constructor(tracker: ChatStateTracker);
18
+ /**
19
+ * The rooms and messages you saved, keyed by {@link savedItemKey}; always the same collection. The first call fetches
20
+ * the list, later ones resolve with it. Items of rooms you are not a member of are left out until you rejoin. The
21
+ * collection keeps no meaningful order - sort by `savedAt`. Once fetched, the list is fetched again after every
22
+ * reconnect. Saving and unsaving is done with the `SaveItem` and `UnsaveItem` commands.
23
+ * @param fetchWithMessages Fetch the contents of the saved messages along, so {@link getMessages} needs no request.
24
+ */
25
+ get(fetchWithMessages?: boolean): Promise<ObservableIndexedObjectCollection<SavedItem>>;
26
+ /**
27
+ * The contents of the saved messages, keyed by message id; always the same collection. The first call fetches them
28
+ * together with the list of {@link get}, unless they were fetched already; afterwards they follow the edits and are
29
+ * fetched again after every reconnect.
30
+ */
31
+ getMessages(): Promise<ObservableIndexedObjectCollection<Message>>;
32
+ isSaved(type: SavedItemType, id: string): Promise<boolean>;
33
+ private registerFetch;
34
+ private fetch;
35
+ private apply;
36
+ private refresh;
37
+ private handleItemSaved;
38
+ private handleItemUnsaved;
39
+ private handleMessageUpdated;
40
+ private handleMessagesRedacted;
41
+ private handleRoomDeleted;
42
+ private handleRoomLeft;
43
+ private handleRoomJoined;
44
+ private deleteRoomItems;
45
+ private handleSession;
46
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devanachat/sdk",
3
- "version": "0.14.0",
3
+ "version": "0.15.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",