polfan-server-js-client 0.2.93 → 0.2.94
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/.idea/workspace.xml +51 -46
- package/build/index.cjs.js +25 -25
- package/build/types/AbstractChatClient.d.ts +2 -3
- package/build/types/state-tracker/MessagesManager.d.ts +13 -5
- package/build/types/types/src/index.d.ts +3 -4
- package/build/types/types/src/schemes/FollowedTopic.d.ts +4 -0
- package/build/types/types/src/schemes/commands/UpdateFollowedTopic.d.ts +6 -0
- package/package.json +1 -1
- package/src/AbstractChatClient.ts +2 -4
- package/src/state-tracker/MessagesManager.ts +141 -22
- package/src/types/src/index.ts +4 -5
- package/src/types/src/schemes/FollowedTopic.ts +5 -0
- package/src/types/src/schemes/commands/UpdateFollowedTopic.ts +7 -0
- package/tsconfig.json +16 -16
- package/src/types/src/schemes/commands/UnfollowTopic.ts +0 -5
package/.idea/workspace.xml
CHANGED
|
@@ -4,17 +4,13 @@
|
|
|
4
4
|
<option name="autoReloadType" value="SELECTIVE" />
|
|
5
5
|
</component>
|
|
6
6
|
<component name="ChangeListManager">
|
|
7
|
-
<list default="true" id="831dae43-0da1-47fd-a5f7-33dd5eec2992" name="Changes" comment="
|
|
8
|
-
<change beforePath="$PROJECT_DIR$/
|
|
9
|
-
<change beforePath="$PROJECT_DIR$/
|
|
10
|
-
<change beforePath="$PROJECT_DIR$/build/index.umd.js" beforeDir="false" afterPath="$PROJECT_DIR$/build/index.umd.js" afterDir="false" />
|
|
11
|
-
<change beforePath="$PROJECT_DIR$/build/index.umd.js.map" beforeDir="false" afterPath="$PROJECT_DIR$/build/index.umd.js.map" afterDir="false" />
|
|
12
|
-
<change beforePath="$PROJECT_DIR$/build/types/state-tracker/TopicHistoryWindow.d.ts" beforeDir="false" afterPath="$PROJECT_DIR$/build/types/state-tracker/TopicHistoryWindow.d.ts" afterDir="false" />
|
|
13
|
-
<change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
|
|
14
|
-
<change beforePath="$PROJECT_DIR$/src/state-tracker/TopicHistoryWindow.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/state-tracker/TopicHistoryWindow.ts" afterDir="false" />
|
|
7
|
+
<list default="true" id="831dae43-0da1-47fd-a5f7-33dd5eec2992" name="Changes" comment="Add jumpTo message support">
|
|
8
|
+
<change beforePath="$PROJECT_DIR$/src/AbstractChatClient.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/AbstractChatClient.ts" afterDir="false" />
|
|
9
|
+
<change beforePath="$PROJECT_DIR$/src/state-tracker/MessagesManager.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/state-tracker/MessagesManager.ts" afterDir="false" />
|
|
15
10
|
<change beforePath="$PROJECT_DIR$/src/types" beforeDir="false" afterPath="$PROJECT_DIR$/src/types" afterDir="false" />
|
|
16
|
-
<change beforePath="$PROJECT_DIR$/src/types/src/
|
|
17
|
-
<change beforePath="$PROJECT_DIR$/
|
|
11
|
+
<change beforePath="$PROJECT_DIR$/src/types/src/index.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/types/src/index.ts" afterDir="false" />
|
|
12
|
+
<change beforePath="$PROJECT_DIR$/src/types/src/schemes/FollowedTopic.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/types/src/schemes/FollowedTopic.ts" afterDir="false" />
|
|
13
|
+
<change beforePath="$PROJECT_DIR$/src/types/src/schemes/commands/UnfollowTopic.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/types/src/schemes/commands/UpdateFollowedTopic.ts" afterDir="false" />
|
|
18
14
|
</list>
|
|
19
15
|
<option name="SHOW_DIALOG" value="false" />
|
|
20
16
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
@@ -33,6 +29,7 @@
|
|
|
33
29
|
<component name="Git.Settings">
|
|
34
30
|
<option name="RECENT_BRANCH_BY_REPOSITORY">
|
|
35
31
|
<map>
|
|
32
|
+
<entry key="$PROJECT_DIR$" value="devana-python-client-2308180900199066013" />
|
|
36
33
|
<entry key="$PROJECT_DIR$/src/types" value="562c7beff95ea1eaf5c236df978f50a614a146af" />
|
|
37
34
|
</map>
|
|
38
35
|
</option>
|
|
@@ -67,31 +64,32 @@
|
|
|
67
64
|
<option name="hideEmptyMiddlePackages" value="true" />
|
|
68
65
|
<option name="showLibraryContents" value="true" />
|
|
69
66
|
</component>
|
|
70
|
-
<component name="PropertiesComponent"
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
67
|
+
<component name="PropertiesComponent"><![CDATA[{
|
|
68
|
+
"keyToString": {
|
|
69
|
+
"RunOnceActivity.MCP Project settings loaded": "true",
|
|
70
|
+
"RunOnceActivity.ShowReadmeOnStart": "true",
|
|
71
|
+
"RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager": "true",
|
|
72
|
+
"RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true",
|
|
73
|
+
"RunOnceActivity.git.unshallow": "true",
|
|
74
|
+
"RunOnceActivity.typescript.service.memoryLimit.init": "true",
|
|
75
|
+
"codeWithMe.voiceChat.enabledByDefault": "false",
|
|
76
|
+
"com.intellij.ml.llm.matterhorn.ej.ui.settings.DefaultModelSelectionForGA.v1": "true",
|
|
77
|
+
"git-widget-placeholder": "master",
|
|
78
|
+
"git.auto.fetch.suggestion.counter": "1",
|
|
79
|
+
"ignore.virus.scanning.warn.message": "true",
|
|
80
|
+
"junie.onboarding.icon.badge.shown": "true",
|
|
81
|
+
"last_opened_file_path": "//wsl.localhost/Debian/home/jarek/polfan-js-client-library",
|
|
82
|
+
"node.js.detected.package.eslint": "true",
|
|
83
|
+
"node.js.detected.package.tslint": "true",
|
|
84
|
+
"node.js.selected.package.eslint": "(autodetect)",
|
|
85
|
+
"node.js.selected.package.tslint": "(autodetect)",
|
|
86
|
+
"nodejs_package_manager_path": "npm",
|
|
87
|
+
"settings.editor.selected.configurable": "com.github.copilot.settings.chat.ChatConfigurable",
|
|
88
|
+
"to.speed.mode.migration.done": "true",
|
|
89
|
+
"ts.external.directory.path": "\\\\wsl.localhost\\Debian\\home\\jarek\\polfan-js-client-library\\node_modules\\typescript\\lib",
|
|
90
|
+
"vue.rearranger.settings.migration": "true"
|
|
93
91
|
}
|
|
94
|
-
}
|
|
92
|
+
}]]></component>
|
|
95
93
|
<component name="SharedIndexes">
|
|
96
94
|
<attachedChunks>
|
|
97
95
|
<set>
|
|
@@ -207,15 +205,14 @@
|
|
|
207
205
|
<workItem from="1781017734453" duration="2603000" />
|
|
208
206
|
<workItem from="1781251927873" duration="586000" />
|
|
209
207
|
<workItem from="1781374850619" duration="61000" />
|
|
210
|
-
<workItem from="1781543017114" duration="
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
<
|
|
214
|
-
<
|
|
215
|
-
<
|
|
216
|
-
<
|
|
217
|
-
<
|
|
218
|
-
<updated>1753062311409</updated>
|
|
208
|
+
<workItem from="1781543017114" duration="3116000" />
|
|
209
|
+
<workItem from="1781647547595" duration="221000" />
|
|
210
|
+
<workItem from="1782321981607" duration="4250000" />
|
|
211
|
+
<workItem from="1782460278873" duration="1374000" />
|
|
212
|
+
<workItem from="1782579738743" duration="1279000" />
|
|
213
|
+
<workItem from="1782664203095" duration="5539000" />
|
|
214
|
+
<workItem from="1782909199211" duration="2404000" />
|
|
215
|
+
<workItem from="1783939298935" duration="5715000" />
|
|
219
216
|
</task>
|
|
220
217
|
<task id="LOCAL-00044" summary="Update schemes">
|
|
221
218
|
<option name="closed" value="true" />
|
|
@@ -601,7 +598,15 @@
|
|
|
601
598
|
<option name="project" value="LOCAL" />
|
|
602
599
|
<updated>1778088996747</updated>
|
|
603
600
|
</task>
|
|
604
|
-
<
|
|
601
|
+
<task id="LOCAL-00092" summary="Add jumpTo message support">
|
|
602
|
+
<option name="closed" value="true" />
|
|
603
|
+
<created>1781545613528</created>
|
|
604
|
+
<option name="number" value="00092" />
|
|
605
|
+
<option name="presentableId" value="LOCAL-00092" />
|
|
606
|
+
<option name="project" value="LOCAL" />
|
|
607
|
+
<updated>1781545613528</updated>
|
|
608
|
+
</task>
|
|
609
|
+
<option name="localTasksCounter" value="93" />
|
|
605
610
|
<servers />
|
|
606
611
|
</component>
|
|
607
612
|
<component name="TypeScriptGeneratedFilesManager">
|
|
@@ -619,7 +624,6 @@
|
|
|
619
624
|
</option>
|
|
620
625
|
</component>
|
|
621
626
|
<component name="VcsManagerConfiguration">
|
|
622
|
-
<MESSAGE value="Align to custom colors and nicks protocol changes" />
|
|
623
627
|
<MESSAGE value="Connection handling optimizations" />
|
|
624
628
|
<MESSAGE value="Ping-pong connection monitoring" />
|
|
625
629
|
<MESSAGE value="Improve reconnect on timeout" />
|
|
@@ -644,7 +648,8 @@
|
|
|
644
648
|
<MESSAGE value="Update Topic on redacted message" />
|
|
645
649
|
<MESSAGE value="Fix room member update event handle" />
|
|
646
650
|
<MESSAGE value="Fix room member update event handle" />
|
|
647
|
-
<
|
|
651
|
+
<MESSAGE value="Add jumpTo message support" />
|
|
652
|
+
<option name="LAST_COMMIT_MESSAGE" value="Add jumpTo message support" />
|
|
648
653
|
</component>
|
|
649
654
|
<component name="XSLT-Support.FileAssociations.UIState">
|
|
650
655
|
<expand />
|
package/build/index.cjs.js
CHANGED
|
@@ -2979,8 +2979,8 @@ var SpacesManager = /*#__PURE__*/function () {
|
|
|
2979
2979
|
});
|
|
2980
2980
|
}
|
|
2981
2981
|
|
|
2982
|
-
/**
|
|
2983
|
-
* Get collection of all the spaces you are in.
|
|
2982
|
+
/**
|
|
2983
|
+
* Get collection of all the spaces you are in.
|
|
2984
2984
|
*/
|
|
2985
2985
|
return SpacesManager_createClass(SpacesManager, [{
|
|
2986
2986
|
key: "get",
|
|
@@ -3001,8 +3001,8 @@ var SpacesManager = /*#__PURE__*/function () {
|
|
|
3001
3001
|
}
|
|
3002
3002
|
return get;
|
|
3003
3003
|
}()
|
|
3004
|
-
/**
|
|
3005
|
-
* Get collection of space roles.
|
|
3004
|
+
/**
|
|
3005
|
+
* Get collection of space roles.
|
|
3006
3006
|
*/
|
|
3007
3007
|
)
|
|
3008
3008
|
}, {
|
|
@@ -3024,8 +3024,8 @@ var SpacesManager = /*#__PURE__*/function () {
|
|
|
3024
3024
|
}
|
|
3025
3025
|
return getRoles;
|
|
3026
3026
|
}()
|
|
3027
|
-
/**
|
|
3028
|
-
* Get collection of the all available rooms inside given space.
|
|
3027
|
+
/**
|
|
3028
|
+
* Get collection of the all available rooms inside given space.
|
|
3029
3029
|
*/
|
|
3030
3030
|
)
|
|
3031
3031
|
}, {
|
|
@@ -3073,8 +3073,8 @@ var SpacesManager = /*#__PURE__*/function () {
|
|
|
3073
3073
|
}
|
|
3074
3074
|
return getRooms;
|
|
3075
3075
|
}()
|
|
3076
|
-
/**
|
|
3077
|
-
* Get collection of space members.
|
|
3076
|
+
/**
|
|
3077
|
+
* Get collection of space members.
|
|
3078
3078
|
*/
|
|
3079
3079
|
)
|
|
3080
3080
|
}, {
|
|
@@ -3122,8 +3122,8 @@ var SpacesManager = /*#__PURE__*/function () {
|
|
|
3122
3122
|
}
|
|
3123
3123
|
return getMembers;
|
|
3124
3124
|
}()
|
|
3125
|
-
/**
|
|
3126
|
-
* Get a space member representing the current user.
|
|
3125
|
+
/**
|
|
3126
|
+
* Get a space member representing the current user.
|
|
3127
3127
|
*/
|
|
3128
3128
|
)
|
|
3129
3129
|
}, {
|
|
@@ -3315,9 +3315,9 @@ var SpacesManager = /*#__PURE__*/function () {
|
|
|
3315
3315
|
case 0:
|
|
3316
3316
|
spaceId = this.roomIdToSpaceId.get(ev.summary.id);
|
|
3317
3317
|
summariesPromise = this.roomsPromises.get(spaceId);
|
|
3318
|
-
/**
|
|
3319
|
-
* Update summary only if the list was already loaded.
|
|
3320
|
-
* RoomSummaryUpdated event has a partial summary, so we need to update the existing summary by merging it.
|
|
3318
|
+
/**
|
|
3319
|
+
* Update summary only if the list was already loaded.
|
|
3320
|
+
* RoomSummaryUpdated event has a partial summary, so we need to update the existing summary by merging it.
|
|
3321
3321
|
*/
|
|
3322
3322
|
if (!(spaceId && summariesPromise)) {
|
|
3323
3323
|
_context9.n = 2;
|
|
@@ -4493,28 +4493,28 @@ var ChatStateTracker = /*#__PURE__*/function () {
|
|
|
4493
4493
|
var _this = this;
|
|
4494
4494
|
ChatStateTracker_classCallCheck(this, ChatStateTracker);
|
|
4495
4495
|
ChatStateTracker_defineProperty(this, "client", void 0);
|
|
4496
|
-
/**
|
|
4497
|
-
* State of your permissions.
|
|
4496
|
+
/**
|
|
4497
|
+
* State of your permissions.
|
|
4498
4498
|
*/
|
|
4499
4499
|
ChatStateTracker_defineProperty(this, "permissions", void 0);
|
|
4500
|
-
/**
|
|
4501
|
-
* State of the rooms you are in.
|
|
4500
|
+
/**
|
|
4501
|
+
* State of the rooms you are in.
|
|
4502
4502
|
*/
|
|
4503
4503
|
ChatStateTracker_defineProperty(this, "rooms", void 0);
|
|
4504
|
-
/**
|
|
4505
|
-
* State of the spaces you are in.
|
|
4504
|
+
/**
|
|
4505
|
+
* State of the spaces you are in.
|
|
4506
4506
|
*/
|
|
4507
4507
|
ChatStateTracker_defineProperty(this, "spaces", void 0);
|
|
4508
|
-
/**
|
|
4509
|
-
* State of the emoticons (global and space-related).
|
|
4508
|
+
/**
|
|
4509
|
+
* State of the emoticons (global and space-related).
|
|
4510
4510
|
*/
|
|
4511
4511
|
ChatStateTracker_defineProperty(this, "emoticons", void 0);
|
|
4512
|
-
/**
|
|
4513
|
-
* Users related state.
|
|
4512
|
+
/**
|
|
4513
|
+
* Users related state.
|
|
4514
4514
|
*/
|
|
4515
4515
|
ChatStateTracker_defineProperty(this, "users", void 0);
|
|
4516
|
-
/**
|
|
4517
|
-
* State of relationships with other users.
|
|
4516
|
+
/**
|
|
4517
|
+
* State of relationships with other users.
|
|
4518
4518
|
*/
|
|
4519
4519
|
ChatStateTracker_defineProperty(this, "relationships", void 0);
|
|
4520
4520
|
ChatStateTracker_defineProperty(this, "_me", null);
|
|
@@ -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, RoomMemberJoined, RoomMembers, NewRoom, NewTopic, TopicDeleted, NewMessage, GetPermissionOverwrites, GetComputedPermissions, 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,
|
|
1
|
+
import { Bye, GetSession, JoinSpace, Session, SpaceJoined, Error as ErrorType, SpaceLeft, SpaceMemberJoined, SpaceMemberLeft, SpaceMemberUpdated, SpaceDeleted, SpaceMembers, SpaceRooms, NewRole, RoomDeleted, RoomJoined, RoomLeft, RoomMemberLeft, RoomMemberJoined, RoomMembers, NewRoom, NewTopic, TopicDeleted, NewMessage, GetPermissionOverwrites, GetComputedPermissions, 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, 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 } from "./types/src";
|
|
2
2
|
import { EventTarget } from "./EventTarget";
|
|
3
3
|
type ArrayOfPromiseResolvers = [(value: any) => void, (reason?: any) => void];
|
|
4
4
|
type ExtraEventMap = Record<string, any>;
|
|
@@ -74,7 +74,6 @@ export type EventsMap = {
|
|
|
74
74
|
NewMessage: NewMessage;
|
|
75
75
|
UserUpdated: UserUpdated;
|
|
76
76
|
TopicFollowed: TopicFollowed;
|
|
77
|
-
TopicUnfollowed: TopicUnfollowed;
|
|
78
77
|
FollowedTopics: FollowedTopics;
|
|
79
78
|
FollowedTopicUpdated: FollowedTopicUpdated;
|
|
80
79
|
Messages: Messages;
|
|
@@ -137,7 +136,7 @@ export type CommandsMap = {
|
|
|
137
136
|
CreateMessage: CommandDefinition<CreateMessage, EventsMap['NewMessage']>;
|
|
138
137
|
Ack: CommandDefinition<Ack, EventsMap['FollowedTopicUpdated'] | EventsMap['Ok']>;
|
|
139
138
|
FollowTopic: CommandDefinition<FollowTopic, EventsMap['TopicFollowed']>;
|
|
140
|
-
|
|
139
|
+
UpdateFollowedTopic: CommandDefinition<UpdateFollowedTopic, EventsMap['FollowedTopicUpdated']>;
|
|
141
140
|
GetFollowedTopics: CommandDefinition<GetFollowedTopics, EventsMap['FollowedTopics']>;
|
|
142
141
|
GetMessages: CommandDefinition<GetMessages, EventsMap['Messages']>;
|
|
143
142
|
GetTopics: CommandDefinition<GetTopics, EventsMap['Topics']>;
|
|
@@ -8,6 +8,7 @@ export declare class MessagesManager {
|
|
|
8
8
|
private readonly followedTopics;
|
|
9
9
|
private readonly followedTopicsPromises;
|
|
10
10
|
private readonly deferredSession;
|
|
11
|
+
private readonly unreadSummariesCache;
|
|
11
12
|
constructor(tracker: ChatStateTracker);
|
|
12
13
|
/**
|
|
13
14
|
* Get history manager for given room ID.
|
|
@@ -25,14 +26,17 @@ export declare class MessagesManager {
|
|
|
25
26
|
*/
|
|
26
27
|
getRoomFollowedTopics(roomId: string): Promise<ObservableIndexedObjectCollection<FollowedTopic> | undefined>;
|
|
27
28
|
/**
|
|
28
|
-
* Batch acknowledge all
|
|
29
|
+
* Batch acknowledge all messages for given room.
|
|
29
30
|
*/
|
|
30
|
-
|
|
31
|
+
ackRoom(roomId: string): Promise<void>;
|
|
31
32
|
/**
|
|
32
|
-
* Calculate missed messages from any topic in given room.
|
|
33
|
+
* Calculate missed messages with mentions from any topic in given room.
|
|
33
34
|
* @return Undefined if you are not in room.
|
|
34
35
|
*/
|
|
35
|
-
|
|
36
|
+
summarizeUnreadMessages(location: ChatLocation): Promise<{
|
|
37
|
+
mentionCount: number;
|
|
38
|
+
isUnread: boolean;
|
|
39
|
+
}>;
|
|
36
40
|
/**
|
|
37
41
|
* For internal use. If you want to delete the message, execute a proper command on client object.
|
|
38
42
|
* @internal
|
|
@@ -43,11 +47,15 @@ export declare class MessagesManager {
|
|
|
43
47
|
* @internal
|
|
44
48
|
*/
|
|
45
49
|
_resolveLastMessage(location: ChatLocation): Promise<Message | null>;
|
|
50
|
+
/**
|
|
51
|
+
* Wyczyść cache celowo, tylko dla lokalizacji których dotyczy zmiana.
|
|
52
|
+
*/
|
|
53
|
+
private invalidateUnreadSummaries;
|
|
54
|
+
private invalidateUnreadSummariesForRooms;
|
|
46
55
|
private createHistoryForNewRoom;
|
|
47
56
|
private handleNewMessage;
|
|
48
57
|
private handleFollowedTopicUpdated;
|
|
49
58
|
private handleTopicFollowed;
|
|
50
|
-
private handleTopicUnfollowed;
|
|
51
59
|
private handleRoomDeleted;
|
|
52
60
|
private handleRoomJoin;
|
|
53
61
|
private handleRoomLeft;
|
|
@@ -77,9 +77,8 @@ import { Owners } from "./schemes/events/Owners";
|
|
|
77
77
|
import { Ok } from "./schemes/events/Ok";
|
|
78
78
|
import { FollowTopic } from "./schemes/commands/FollowTopic";
|
|
79
79
|
import { FollowedTopics } from "./schemes/events/FollowedTopics";
|
|
80
|
-
import { FollowedTopic } from "./schemes/FollowedTopic";
|
|
81
|
-
import {
|
|
82
|
-
import { TopicUnfollowed } from "./schemes/events/TopicUnfollowed";
|
|
80
|
+
import { FollowedTopic, NotificationLevel } from "./schemes/FollowedTopic";
|
|
81
|
+
import { UpdateFollowedTopic } from "./schemes/commands/UpdateFollowedTopic";
|
|
83
82
|
import { TopicFollowed } from "./schemes/events/TopicFollowed";
|
|
84
83
|
import { GetFollowedTopics } from "./schemes/commands/GetFollowedTopics";
|
|
85
84
|
import { FollowedTopicUpdated } from "./schemes/events/FollowedTopicUpdated";
|
|
@@ -134,4 +133,4 @@ import { GetRelationships } from "./schemes/commands/GetRelationships";
|
|
|
134
133
|
import { GetUserInfo } from "./schemes/commands/GetUserInfo";
|
|
135
134
|
import { UserInfo } from "./schemes/events/UserInfo";
|
|
136
135
|
import { UserInformation } from "./schemes/UserInformation";
|
|
137
|
-
export { Envelope, Message, MessageType, MessageAuthor, Role, Room, RoomType, RoomStream, RoomStreamType, RoomHistory, RoomHistoryMode, RoomMember, RoomSummary, RoomSummaryExtras, Space, SpaceMember, Topic, FollowedTopic, User, UserState, PermissionOverwritesValue, ChatLocation, SpaceSummary, SpaceDiscoverable, Emoticon, PermissionOverwritesTarget, BanObject, LeaveReason, UserRelationship, UserRelationshipType, CreateTopicInitialMessage, UserInformation, Bye, Error, Messages, NewMessage, NewRole, NewRoom, NewTopic, TopicFollowed,
|
|
136
|
+
export { Envelope, Message, MessageType, MessageAuthor, 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, Bye, Error, Messages, NewMessage, NewRole, NewRoom, NewTopic, TopicFollowed, FollowedTopics, FollowedTopicUpdated, ComputedPermissions, PermissionOverwrites, PermissionOverwritesUpdated, RoleDeleted, RoleUpdated, RoomDeleted, RoomUpdated, RoomJoined, RoomLeft, RoomMemberJoined, 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, AssignRole, GetMessages, CreateMessage, Ack, CreateRole, CreateRoom, CreateSpace, CreateTopic, FollowTopic, 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, };
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { ChatLocation } from "./ChatLocation";
|
|
2
|
+
export type NotificationLevel = 'All' | 'Mentions' | 'None';
|
|
2
3
|
export interface FollowedTopic {
|
|
3
4
|
location: ChatLocation;
|
|
4
5
|
lastAckMessageId: string | null;
|
|
6
|
+
notificationLevel: NotificationLevel;
|
|
5
7
|
missed: number | null;
|
|
8
|
+
isUnread: boolean;
|
|
9
|
+
mentionCount: number;
|
|
6
10
|
}
|
package/package.json
CHANGED
|
@@ -64,10 +64,9 @@ import {
|
|
|
64
64
|
RoleDeleted,
|
|
65
65
|
FollowedTopicUpdated,
|
|
66
66
|
TopicFollowed,
|
|
67
|
-
TopicUnfollowed,
|
|
68
67
|
FollowedTopics,
|
|
69
68
|
FollowTopic,
|
|
70
|
-
|
|
69
|
+
UpdateFollowedTopic,
|
|
71
70
|
GetFollowedTopics,
|
|
72
71
|
Messages,
|
|
73
72
|
GetMessages,
|
|
@@ -224,7 +223,6 @@ export type CommandResponse<CommandType extends keyof CommandsMap> = CommandsMap
|
|
|
224
223
|
NewMessage: NewMessage,
|
|
225
224
|
UserUpdated: UserUpdated,
|
|
226
225
|
TopicFollowed: TopicFollowed,
|
|
227
|
-
TopicUnfollowed: TopicUnfollowed,
|
|
228
226
|
FollowedTopics: FollowedTopics,
|
|
229
227
|
FollowedTopicUpdated: FollowedTopicUpdated,
|
|
230
228
|
Messages: Messages,
|
|
@@ -292,7 +290,7 @@ export type CommandsMap = {
|
|
|
292
290
|
CreateMessage: CommandDefinition<CreateMessage, EventsMap['NewMessage']>,
|
|
293
291
|
Ack: CommandDefinition<Ack, EventsMap['FollowedTopicUpdated'] | EventsMap['Ok']>,
|
|
294
292
|
FollowTopic: CommandDefinition<FollowTopic, EventsMap['TopicFollowed']>,
|
|
295
|
-
|
|
293
|
+
UpdateFollowedTopic: CommandDefinition<UpdateFollowedTopic, EventsMap['FollowedTopicUpdated']>,
|
|
296
294
|
GetFollowedTopics: CommandDefinition<GetFollowedTopics, EventsMap['FollowedTopics']>,
|
|
297
295
|
GetMessages: CommandDefinition<GetMessages, EventsMap['Messages']>,
|
|
298
296
|
GetTopics: CommandDefinition<GetTopics, EventsMap['Topics']>,
|
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
NewMessage,
|
|
4
4
|
FollowedTopic,
|
|
5
5
|
TopicFollowed,
|
|
6
|
-
TopicUnfollowed,
|
|
7
6
|
RoomDeleted,
|
|
8
7
|
RoomLeft,
|
|
9
8
|
TopicDeleted,
|
|
@@ -26,6 +25,7 @@ export class MessagesManager {
|
|
|
26
25
|
private readonly followedTopics = new IndexedCollection<string, ObservableIndexedObjectCollection<FollowedTopic>>();
|
|
27
26
|
private readonly followedTopicsPromises = new PromiseRegistry();
|
|
28
27
|
private readonly deferredSession = new DeferredTask();
|
|
28
|
+
private readonly unreadSummariesCache = new Map<string, { mentionCount: number, isUnread: boolean }>();
|
|
29
29
|
|
|
30
30
|
public constructor(private tracker: ChatStateTracker) {
|
|
31
31
|
this.tracker.client.on('Session', ev => this.handleSession(ev));
|
|
@@ -33,7 +33,6 @@ export class MessagesManager {
|
|
|
33
33
|
this.tracker.client.on('NewTopic', ev => this.handleNewTopic(ev));
|
|
34
34
|
this.tracker.client.on('FollowedTopicUpdated', ev => this.handleFollowedTopicUpdated(ev));
|
|
35
35
|
this.tracker.client.on('TopicFollowed', ev => this.handleTopicFollowed(ev));
|
|
36
|
-
this.tracker.client.on('TopicUnfollowed', ev => this.handleTopicUnfollowed(ev));
|
|
37
36
|
this.tracker.client.on('NewMessage', ev => this.handleNewMessage(ev));
|
|
38
37
|
this.tracker.client.on('RoomDeleted', ev => this.handleRoomDeleted(ev));
|
|
39
38
|
this.tracker.client.on('RoomLeft', ev => this.handleRoomLeft(ev));
|
|
@@ -107,9 +106,9 @@ export class MessagesManager {
|
|
|
107
106
|
}
|
|
108
107
|
|
|
109
108
|
/**
|
|
110
|
-
* Batch acknowledge all
|
|
109
|
+
* Batch acknowledge all messages for given room.
|
|
111
110
|
*/
|
|
112
|
-
public async
|
|
111
|
+
public async ackRoom(roomId: string): Promise<void> {
|
|
113
112
|
const collection = await this.getRoomFollowedTopics(roomId);
|
|
114
113
|
|
|
115
114
|
if (! collection) {
|
|
@@ -117,27 +116,75 @@ export class MessagesManager {
|
|
|
117
116
|
}
|
|
118
117
|
|
|
119
118
|
for (const followedTopic of collection.items) {
|
|
120
|
-
if (followedTopic.
|
|
119
|
+
if (followedTopic.isUnread) {
|
|
121
120
|
await this.tracker.client.send('Ack', {location: followedTopic.location});
|
|
122
121
|
}
|
|
123
122
|
}
|
|
124
123
|
}
|
|
125
124
|
|
|
126
125
|
/**
|
|
127
|
-
* Calculate missed messages from any topic in given room.
|
|
126
|
+
* Calculate missed messages with mentions from any topic in given room.
|
|
128
127
|
* @return Undefined if you are not in room.
|
|
129
128
|
*/
|
|
130
|
-
public async
|
|
131
|
-
const
|
|
129
|
+
public async summarizeUnreadMessages(location: ChatLocation): Promise<{ mentionCount: number, isUnread: boolean }> {
|
|
130
|
+
const cacheKey = location.topicId
|
|
131
|
+
? `topic:${location.roomId}:${location.topicId}`
|
|
132
|
+
: location.roomId
|
|
133
|
+
? `room:${location.roomId}`
|
|
134
|
+
: location.spaceId
|
|
135
|
+
? `space:${location.spaceId}`
|
|
136
|
+
: 'spaceless';
|
|
137
|
+
|
|
138
|
+
if (this.unreadSummariesCache.has(cacheKey)) {
|
|
139
|
+
return this.unreadSummariesCache.get(cacheKey)!;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
let roomIds: string[] = [];
|
|
143
|
+
let targetTopicId: string | undefined;
|
|
144
|
+
const rooms = await this.tracker.rooms.get();
|
|
132
145
|
|
|
133
|
-
if (
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
146
|
+
if (location.topicId) {
|
|
147
|
+
if (!location.roomId) {
|
|
148
|
+
throw new Error("roomId is required when querying by topicId");
|
|
149
|
+
}
|
|
150
|
+
roomIds = [location.roomId];
|
|
151
|
+
targetTopicId = location.topicId;
|
|
152
|
+
} else if (location.roomId) {
|
|
153
|
+
roomIds = [location.roomId];
|
|
154
|
+
} else if (location.spaceId) {
|
|
155
|
+
await this.cacheSpaceFollowedTopics(location.spaceId);
|
|
156
|
+
roomIds = rooms.findBy('spaceId', location.spaceId).items.map(r => r.id);
|
|
157
|
+
} else {
|
|
158
|
+
roomIds = rooms.items.filter(r => !r.spaceId).map(r => r.id);
|
|
138
159
|
}
|
|
139
160
|
|
|
140
|
-
|
|
161
|
+
let mentionCount = 0;
|
|
162
|
+
let isUnread = false;
|
|
163
|
+
|
|
164
|
+
for (const roomId of roomIds) {
|
|
165
|
+
const collection = await this.getRoomFollowedTopics(roomId);
|
|
166
|
+
|
|
167
|
+
if (!collection) {
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
for (const topic of collection.items) {
|
|
172
|
+
if (targetTopicId && topic.location.topicId !== targetTopicId) {
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
if (topic.isUnread) {
|
|
177
|
+
isUnread = true;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
mentionCount += (topic.mentionCount ?? 0);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
const result = { mentionCount, isUnread };
|
|
185
|
+
this.unreadSummariesCache.set(cacheKey, result);
|
|
186
|
+
|
|
187
|
+
return result;
|
|
141
188
|
}
|
|
142
189
|
|
|
143
190
|
/**
|
|
@@ -146,6 +193,7 @@ export class MessagesManager {
|
|
|
146
193
|
*/
|
|
147
194
|
public _deleteByTopicIds(roomId: string, ...topicIds: string[]): void {
|
|
148
195
|
this.followedTopics.get(roomId)?.delete(...topicIds);
|
|
196
|
+
topicIds.forEach(topicId => this.invalidateUnreadSummaries(roomId, topicId));
|
|
149
197
|
}
|
|
150
198
|
|
|
151
199
|
/**
|
|
@@ -172,24 +220,70 @@ export class MessagesManager {
|
|
|
172
220
|
return message || null;
|
|
173
221
|
}
|
|
174
222
|
|
|
223
|
+
/**
|
|
224
|
+
* Wyczyść cache celowo, tylko dla lokalizacji których dotyczy zmiana.
|
|
225
|
+
*/
|
|
226
|
+
private invalidateUnreadSummaries(roomId?: string, topicId?: string): void {
|
|
227
|
+
if (!roomId) {
|
|
228
|
+
this.unreadSummariesCache.clear();
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
this.unreadSummariesCache.delete(`room:${roomId}`);
|
|
233
|
+
|
|
234
|
+
if (topicId) {
|
|
235
|
+
this.unreadSummariesCache.delete(`topic:${roomId}:${topicId}`);
|
|
236
|
+
} else {
|
|
237
|
+
for (const key of this.unreadSummariesCache.keys()) {
|
|
238
|
+
if (key.startsWith(`topic:${roomId}:`)) {
|
|
239
|
+
this.unreadSummariesCache.delete(key);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
for (const key of this.unreadSummariesCache.keys()) {
|
|
245
|
+
if (key.startsWith('space:') || key === 'spaceless') {
|
|
246
|
+
this.unreadSummariesCache.delete(key);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
private invalidateUnreadSummariesForRooms(roomIds: string[]): void {
|
|
252
|
+
const roomIdsSet = new Set(roomIds);
|
|
253
|
+
roomIds.forEach(roomId => {
|
|
254
|
+
this.unreadSummariesCache.delete(`room:${roomId}`);
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
for (const key of this.unreadSummariesCache.keys()) {
|
|
258
|
+
if (key.startsWith('space:') || key === 'spaceless') {
|
|
259
|
+
this.unreadSummariesCache.delete(key);
|
|
260
|
+
continue;
|
|
261
|
+
}
|
|
262
|
+
if (key.startsWith('topic:')) {
|
|
263
|
+
const parts = key.split(':');
|
|
264
|
+
if (parts.length >= 2 && roomIdsSet.has(parts[1])) {
|
|
265
|
+
this.unreadSummariesCache.delete(key);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
175
271
|
private createHistoryForNewRoom(room: Room): void {
|
|
176
272
|
this.roomHistories.set([room.id, new RoomMessagesHistory(room, this.tracker)]);
|
|
177
273
|
}
|
|
178
274
|
|
|
179
275
|
private handleNewMessage(ev: NewMessage): void {
|
|
180
|
-
this.updateLocallyFollowedTopicOnNewMessage(ev);
|
|
276
|
+
void this.updateLocallyFollowedTopicOnNewMessage(ev);
|
|
181
277
|
}
|
|
182
278
|
|
|
183
279
|
private handleFollowedTopicUpdated(ev: FollowedTopicUpdated): void {
|
|
184
280
|
this.followedTopics.get(ev.followedTopic.location.roomId)?.set(ev.followedTopic);
|
|
281
|
+
this.invalidateUnreadSummaries(ev.followedTopic.location.roomId, ev.followedTopic.location.topicId);
|
|
185
282
|
}
|
|
186
283
|
|
|
187
284
|
private handleTopicFollowed(ev: TopicFollowed): void {
|
|
188
285
|
this.setFollowedTopicsArray([ev.followedTopic.location.roomId], [ev.followedTopic]);
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
private handleTopicUnfollowed(ev: TopicUnfollowed): void {
|
|
192
|
-
this.followedTopics.get(ev.location.roomId)?.delete(ev.location.topicId);
|
|
286
|
+
this.invalidateUnreadSummaries(ev.followedTopic.location.roomId, ev.followedTopic.location.topicId);
|
|
193
287
|
}
|
|
194
288
|
|
|
195
289
|
private handleRoomDeleted(ev: RoomDeleted): void {
|
|
@@ -218,23 +312,26 @@ export class MessagesManager {
|
|
|
218
312
|
const followedTopic = result.data.followedTopics[0];
|
|
219
313
|
if (followedTopic) {
|
|
220
314
|
this.followedTopics.get(ev.roomId).set(followedTopic);
|
|
315
|
+
this.invalidateUnreadSummaries(ev.roomId, ev.topic.id);
|
|
221
316
|
}
|
|
222
317
|
}
|
|
223
318
|
}
|
|
224
319
|
|
|
225
320
|
private handleTopicDeleted(ev: TopicDeleted): void {
|
|
226
321
|
this.followedTopics.get(ev.location.roomId)?.delete(ev.location.topicId);
|
|
322
|
+
this.invalidateUnreadSummaries(ev.location.roomId, ev.location.topicId);
|
|
227
323
|
}
|
|
228
324
|
|
|
229
325
|
private handleSession(ev: Session): void {
|
|
230
326
|
this.followedTopics.deleteAll();
|
|
231
327
|
this.followedTopicsPromises.forgetAll();
|
|
328
|
+
this.invalidateUnreadSummaries();
|
|
232
329
|
this.roomHistories.deleteAll();
|
|
233
330
|
ev.state.rooms.forEach(room => this.createHistoryForNewRoom(room));
|
|
234
331
|
this.deferredSession.resolve();
|
|
235
332
|
}
|
|
236
333
|
|
|
237
|
-
private updateLocallyFollowedTopicOnNewMessage(ev: NewMessage): void {
|
|
334
|
+
private async updateLocallyFollowedTopicOnNewMessage(ev: NewMessage): Promise<void> {
|
|
238
335
|
const roomFollowedTopics = this.followedTopics.get(ev.message.location.roomId);
|
|
239
336
|
const followedTopic = roomFollowedTopics?.get(ev.message.location.topicId);
|
|
240
337
|
|
|
@@ -250,12 +347,31 @@ export class MessagesManager {
|
|
|
250
347
|
if (isMe) {
|
|
251
348
|
// Reset missed messages count if new message is authored by me
|
|
252
349
|
update = {missed: 0, lastAckMessageId: ev.message.id};
|
|
350
|
+
} else if (ev.message.type === 'Text') {
|
|
351
|
+
// ...check for mentions if it's text message...
|
|
352
|
+
const member = await this.tracker.rooms.getMe(ev.message.location.roomId);
|
|
353
|
+
const roleIds = [...(member.spaceMember?.roles ?? []), ...member.roles];
|
|
354
|
+
const mentionHandlers = [
|
|
355
|
+
...roleIds.map(id => `<@&${id}>`),
|
|
356
|
+
`<@${ev.message.author.user.id}>`,
|
|
357
|
+
];
|
|
358
|
+
const mentionExists = mentionHandlers.some(handler => ev.message.content.includes(handler));
|
|
359
|
+
|
|
360
|
+
update = {
|
|
361
|
+
missed: followedTopic.missed === null ? null : followedTopic.missed + 1,
|
|
362
|
+
isUnread: true,
|
|
363
|
+
mentionCount: followedTopic.mentionCount + (mentionExists ? 1 : 0),
|
|
364
|
+
};
|
|
253
365
|
} else {
|
|
254
|
-
// ...
|
|
255
|
-
update = {
|
|
366
|
+
// ...or just mark as unread.
|
|
367
|
+
update = {
|
|
368
|
+
missed: followedTopic.missed === null ? null : followedTopic.missed + 1,
|
|
369
|
+
isUnread: true,
|
|
370
|
+
};
|
|
256
371
|
}
|
|
257
372
|
|
|
258
373
|
roomFollowedTopics.set({...followedTopic, ...update});
|
|
374
|
+
this.invalidateUnreadSummaries(ev.message.location.roomId, ev.message.location.topicId);
|
|
259
375
|
}
|
|
260
376
|
|
|
261
377
|
private setFollowedTopicsArray(roomIds: string[], followedTopics: FollowedTopic[]): void {
|
|
@@ -278,10 +394,13 @@ export class MessagesManager {
|
|
|
278
394
|
this.followedTopics.get(roomId).set(...roomToTopics[roomId]);
|
|
279
395
|
}
|
|
280
396
|
});
|
|
397
|
+
|
|
398
|
+
this.invalidateUnreadSummariesForRooms(roomIds);
|
|
281
399
|
}
|
|
282
400
|
|
|
283
401
|
private clearRoomFollowedTopicsStructures(roomId: string): void {
|
|
284
402
|
this.followedTopics.delete(roomId);
|
|
285
403
|
this.followedTopicsPromises.forget(roomId);
|
|
404
|
+
this.invalidateUnreadSummaries(roomId);
|
|
286
405
|
}
|
|
287
406
|
}
|
package/src/types/src/index.ts
CHANGED
|
@@ -77,9 +77,8 @@ import { Owners } from "./schemes/events/Owners";
|
|
|
77
77
|
import { Ok } from "./schemes/events/Ok";
|
|
78
78
|
import {FollowTopic} from "./schemes/commands/FollowTopic";
|
|
79
79
|
import {FollowedTopics} from "./schemes/events/FollowedTopics";
|
|
80
|
-
import {FollowedTopic} from "./schemes/FollowedTopic";
|
|
81
|
-
import {
|
|
82
|
-
import {TopicUnfollowed} from "./schemes/events/TopicUnfollowed";
|
|
80
|
+
import {FollowedTopic, NotificationLevel} from "./schemes/FollowedTopic";
|
|
81
|
+
import {UpdateFollowedTopic} from "./schemes/commands/UpdateFollowedTopic";
|
|
83
82
|
import {TopicFollowed} from "./schemes/events/TopicFollowed";
|
|
84
83
|
import {GetFollowedTopics} from "./schemes/commands/GetFollowedTopics";
|
|
85
84
|
import {FollowedTopicUpdated} from "./schemes/events/FollowedTopicUpdated";
|
|
@@ -155,6 +154,7 @@ export {
|
|
|
155
154
|
SpaceMember,
|
|
156
155
|
Topic,
|
|
157
156
|
FollowedTopic,
|
|
157
|
+
NotificationLevel,
|
|
158
158
|
User,
|
|
159
159
|
UserState,
|
|
160
160
|
PermissionOverwritesValue,
|
|
@@ -178,7 +178,6 @@ export {
|
|
|
178
178
|
NewRoom,
|
|
179
179
|
NewTopic,
|
|
180
180
|
TopicFollowed,
|
|
181
|
-
TopicUnfollowed,
|
|
182
181
|
FollowedTopics,
|
|
183
182
|
FollowedTopicUpdated,
|
|
184
183
|
ComputedPermissions,
|
|
@@ -235,7 +234,7 @@ export {
|
|
|
235
234
|
CreateSpace,
|
|
236
235
|
CreateTopic,
|
|
237
236
|
FollowTopic,
|
|
238
|
-
|
|
237
|
+
UpdateFollowedTopic,
|
|
239
238
|
GetFollowedTopics,
|
|
240
239
|
DeassignRole,
|
|
241
240
|
DeleteRole,
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import {ChatLocation} from "./ChatLocation";
|
|
2
2
|
|
|
3
|
+
export type NotificationLevel = 'All' | 'Mentions' | 'None';
|
|
4
|
+
|
|
3
5
|
export interface FollowedTopic {
|
|
4
6
|
location: ChatLocation;
|
|
5
7
|
lastAckMessageId: string | null;
|
|
8
|
+
notificationLevel: NotificationLevel;
|
|
6
9
|
missed: number | null;
|
|
10
|
+
isUnread: boolean;
|
|
11
|
+
mentionCount: number;
|
|
7
12
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"noImplicitAny": true,
|
|
4
|
-
"outDir": "build/types",
|
|
5
|
-
"module": "esnext",
|
|
6
|
-
"target": "
|
|
7
|
-
"allowJs": true,
|
|
8
|
-
"sourceMap": true,
|
|
9
|
-
"declaration": true,
|
|
10
|
-
"emitDeclarationOnly": true,
|
|
11
|
-
"suppressImplicitAnyIndexErrors": true,
|
|
12
|
-
"lib": ["es2018", "dom"],
|
|
13
|
-
"moduleResolution": "node",
|
|
14
|
-
},
|
|
15
|
-
"include": ["src"],
|
|
16
|
-
"exclude": ["src/**/tests"],
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"noImplicitAny": true,
|
|
4
|
+
"outDir": "build/types",
|
|
5
|
+
"module": "esnext",
|
|
6
|
+
"target": "es2015",
|
|
7
|
+
"allowJs": true,
|
|
8
|
+
"sourceMap": true,
|
|
9
|
+
"declaration": true,
|
|
10
|
+
"emitDeclarationOnly": true,
|
|
11
|
+
"suppressImplicitAnyIndexErrors": true,
|
|
12
|
+
"lib": ["es2018", "dom"],
|
|
13
|
+
"moduleResolution": "node",
|
|
14
|
+
},
|
|
15
|
+
"include": ["src"],
|
|
16
|
+
"exclude": ["src/**/tests"],
|
|
17
17
|
}
|