polfan-server-js-client 0.2.85 → 0.2.87

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/.idea/workspace.xml +46 -24
  2. package/build/index.cjs.js +29 -9
  3. package/build/index.cjs.js.map +1 -1
  4. package/build/index.umd.js +1 -1
  5. package/build/index.umd.js.map +1 -1
  6. package/build/types/AbstractChatClient.d.ts +3 -1
  7. package/build/types/state-tracker/TopicHistoryWindow.d.ts +12 -3
  8. package/build/types/types/src/index.d.ts +4 -1
  9. package/build/types/types/src/schemes/BanObject.d.ts +4 -1
  10. package/build/types/types/src/schemes/RoomSummary.d.ts +1 -0
  11. package/build/types/types/src/schemes/UserInformation.d.ts +11 -0
  12. package/build/types/types/src/schemes/commands/Ban.d.ts +2 -0
  13. package/build/types/types/src/schemes/commands/GetBans.d.ts +2 -0
  14. package/build/types/types/src/schemes/commands/GetUserInfo.d.ts +3 -0
  15. package/build/types/types/src/schemes/commands/Unban.d.ts +1 -3
  16. package/build/types/types/src/schemes/events/Session.d.ts +1 -0
  17. package/build/types/types/src/schemes/events/UserInfo.d.ts +4 -0
  18. package/package.json +1 -1
  19. package/src/AbstractChatClient.ts +4 -0
  20. package/src/state-tracker/TopicHistoryWindow.ts +32 -10
  21. package/src/types/src/index.ts +7 -1
  22. package/src/types/src/schemes/BanObject.ts +5 -1
  23. package/src/types/src/schemes/RoomSummary.ts +1 -0
  24. package/src/types/src/schemes/UserInformation.ts +12 -0
  25. package/src/types/src/schemes/commands/Ban.ts +2 -0
  26. package/src/types/src/schemes/commands/GetBans.ts +2 -0
  27. package/src/types/src/schemes/commands/GetUserInfo.ts +3 -0
  28. package/src/types/src/schemes/commands/Unban.ts +1 -4
  29. package/src/types/src/schemes/events/Session.ts +1 -0
  30. package/src/types/src/schemes/events/UserInfo.ts +5 -0
  31. package/tests/history-window.test.ts +35 -1
@@ -4,9 +4,15 @@
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="Delete redacted messages, improve collections, add tests">
7
+ <list default="true" id="831dae43-0da1-47fd-a5f7-33dd5eec2992" name="Changes" comment="Adjust to ban changes">
8
+ <change beforePath="$PROJECT_DIR$/build/index.cjs.js" beforeDir="false" afterPath="$PROJECT_DIR$/build/index.cjs.js" afterDir="false" />
9
+ <change beforePath="$PROJECT_DIR$/build/index.cjs.js.map" beforeDir="false" afterPath="$PROJECT_DIR$/build/index.cjs.js.map" afterDir="false" />
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" />
8
13
  <change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
9
14
  <change beforePath="$PROJECT_DIR$/src/state-tracker/TopicHistoryWindow.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/state-tracker/TopicHistoryWindow.ts" afterDir="false" />
15
+ <change beforePath="$PROJECT_DIR$/tests/history-window.test.ts" beforeDir="false" afterPath="$PROJECT_DIR$/tests/history-window.test.ts" afterDir="false" />
10
16
  </list>
11
17
  <option name="SHOW_DIALOG" value="false" />
12
18
  <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -40,6 +46,10 @@
40
46
  &quot;accountId&quot;: &quot;3584fcfe-fe67-4c7c-94f9-c35acfe7b7c6&quot;
41
47
  }
42
48
  }</component>
49
+ <component name="McpProjectServerCommands">
50
+ <commands />
51
+ <urls />
52
+ </component>
43
53
  <component name="PhpWorkspaceProjectConfiguration" interpreter_name="C:\php\php.exe" />
44
54
  <component name="ProblemsViewState">
45
55
  <option name="selectedTabId" value="DEPENDENCY_CHECKER_PROBLEMS_TAB" />
@@ -54,11 +64,13 @@
54
64
  </component>
55
65
  <component name="PropertiesComponent"><![CDATA[{
56
66
  "keyToString": {
67
+ "RunOnceActivity.MCP Project settings loaded": "true",
57
68
  "RunOnceActivity.ShowReadmeOnStart": "true",
58
69
  "RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager": "true",
59
70
  "RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true",
60
71
  "RunOnceActivity.git.unshallow": "true",
61
72
  "RunOnceActivity.typescript.service.memoryLimit.init": "true",
73
+ "codeWithMe.voiceChat.enabledByDefault": "false",
62
74
  "com.intellij.ml.llm.matterhorn.ej.ui.settings.DefaultModelSelectionForGA.v1": "true",
63
75
  "git-widget-placeholder": "master",
64
76
  "ignore.virus.scanning.warn.message": "true",
@@ -78,8 +90,8 @@
78
90
  <component name="SharedIndexes">
79
91
  <attachedChunks>
80
92
  <set>
81
- <option value="bundled-js-predefined-d6986cc7102b-9b0f141eb926-JavaScript-PS-253.29346.257" />
82
- <option value="bundled-php-predefined-a98d8de5180a-0e0d91225499-com.jetbrains.php.sharedIndexes-PS-253.29346.257" />
93
+ <option value="bundled-js-predefined-d6986cc7102b-31caf2ab9e3c-JavaScript-PS-261.23567.149" />
94
+ <option value="bundled-php-predefined-a98d8de5180a-022fa7b8ab75-com.jetbrains.php.sharedIndexes-PS-261.23567.149" />
83
95
  </set>
84
96
  </attachedChunks>
85
97
  </component>
@@ -174,23 +186,17 @@
174
186
  <workItem from="1769218166609" duration="940000" />
175
187
  <workItem from="1769411030191" duration="14000" />
176
188
  <workItem from="1769767524856" duration="3188000" />
177
- <workItem from="1769858204333" duration="24204000" />
178
- </task>
179
- <task id="LOCAL-00035" summary="New message type">
180
- <option name="closed" value="true" />
181
- <created>1751159850812</created>
182
- <option name="number" value="00035" />
183
- <option name="presentableId" value="LOCAL-00035" />
184
- <option name="project" value="LOCAL" />
185
- <updated>1751159850812</updated>
186
- </task>
187
- <task id="LOCAL-00036" summary="New message type">
188
- <option name="closed" value="true" />
189
- <created>1751160521070</created>
190
- <option name="number" value="00036" />
191
- <option name="presentableId" value="LOCAL-00036" />
192
- <option name="project" value="LOCAL" />
193
- <updated>1751160521070</updated>
189
+ <workItem from="1769858204333" duration="26079000" />
190
+ <workItem from="1770281689400" duration="1213000" />
191
+ <workItem from="1770574887318" duration="737000" />
192
+ <workItem from="1770576059797" duration="1842000" />
193
+ <workItem from="1771241038327" duration="594000" />
194
+ <workItem from="1774871561103" duration="4164000" />
195
+ <workItem from="1775031025390" duration="593000" />
196
+ <workItem from="1775641624063" duration="1179000" />
197
+ <workItem from="1776327180094" duration="5055000" />
198
+ <workItem from="1777136687009" duration="3369000" />
199
+ <workItem from="1777301595900" duration="1616000" />
194
200
  </task>
195
201
  <task id="LOCAL-00037" summary="Dedicated event for user status change">
196
202
  <option name="closed" value="true" />
@@ -568,7 +574,23 @@
568
574
  <option name="project" value="LOCAL" />
569
575
  <updated>1769890333390</updated>
570
576
  </task>
571
- <option name="localTasksCounter" value="84" />
577
+ <task id="LOCAL-00084" summary="Fix emitting event with deleted topics">
578
+ <option name="closed" value="true" />
579
+ <created>1769894114638</created>
580
+ <option name="number" value="00084" />
581
+ <option name="presentableId" value="LOCAL-00084" />
582
+ <option name="project" value="LOCAL" />
583
+ <updated>1769894114639</updated>
584
+ </task>
585
+ <task id="LOCAL-00085" summary="Adjust to ban changes">
586
+ <option name="closed" value="true" />
587
+ <created>1776807618896</created>
588
+ <option name="number" value="00085" />
589
+ <option name="presentableId" value="LOCAL-00085" />
590
+ <option name="project" value="LOCAL" />
591
+ <updated>1776807618896</updated>
592
+ </task>
593
+ <option name="localTasksCounter" value="86" />
572
594
  <servers />
573
595
  </component>
574
596
  <component name="TypeScriptGeneratedFilesManager">
@@ -586,8 +608,6 @@
586
608
  </option>
587
609
  </component>
588
610
  <component name="VcsManagerConfiguration">
589
- <MESSAGE value="Ephemeral room history support" />
590
- <MESSAGE value="Protocol version support" />
591
611
  <MESSAGE value="Update room on recipient user change" />
592
612
  <MESSAGE value="Fix websocket state error handling" />
593
613
  <MESSAGE value="Collection integration with React JS rework" />
@@ -611,7 +631,9 @@
611
631
  <MESSAGE value="WIP: delete redacted messages" />
612
632
  <MESSAGE value="Improve EventTarget typings" />
613
633
  <MESSAGE value="Delete redacted messages, improve collections, add tests" />
614
- <option name="LAST_COMMIT_MESSAGE" value="Delete redacted messages, improve collections, add tests" />
634
+ <MESSAGE value="Fix emitting event with deleted topics" />
635
+ <MESSAGE value="Adjust to ban changes" />
636
+ <option name="LAST_COMMIT_MESSAGE" value="Adjust to ban changes" />
615
637
  </component>
616
638
  <component name="XSLT-Support.FileAssociations.UIState">
617
639
  <expand />
@@ -685,7 +685,8 @@ var TraversableRemoteCollection = /*#__PURE__*/function (_ObservableIndexedObj)
685
685
  TopicHistoryWindow_defineProperty(_this, "internalState", {
686
686
  current: WindowState.LIVE,
687
687
  ongoing: undefined,
688
- limit: 50,
688
+ limit: 1000,
689
+ retainRatio: 1,
689
690
  fetchLimit: 50,
690
691
  lastFetchCount: 0,
691
692
  oldestId: null
@@ -720,7 +721,7 @@ var TraversableRemoteCollection = /*#__PURE__*/function (_ObservableIndexedObj)
720
721
  }
721
722
 
722
723
  /**
723
- * Maximum numer of items stored in window.
724
+ * Maximum number of items stored in window (High Watermark).
724
725
  * Null for unlimited.
725
726
  */
726
727
  }, {
@@ -730,12 +731,28 @@ var TraversableRemoteCollection = /*#__PURE__*/function (_ObservableIndexedObj)
730
731
  }
731
732
 
732
733
  /**
733
- * Maximum numer of items stored in window.
734
+ * Maximum number of items stored in window (High Watermark).
734
735
  * Null for unlimited.
735
736
  */,
736
737
  set: function set(value) {
737
738
  this.internalState.limit = value;
738
739
  }
740
+
741
+ /**
742
+ * Percentage of limit to keep when trimming.
743
+ */
744
+ }, {
745
+ key: "retainRatio",
746
+ get: function get() {
747
+ return this.internalState.retainRatio;
748
+ }
749
+
750
+ /**
751
+ * Percentage of limit to keep when trimming.
752
+ */,
753
+ set: function set(value) {
754
+ this.internalState.retainRatio = value;
755
+ }
739
756
  }, {
740
757
  key: "hasLatest",
741
758
  get: function get() {
@@ -772,7 +789,7 @@ var TraversableRemoteCollection = /*#__PURE__*/function (_ObservableIndexedObj)
772
789
  this.internalState.ongoing = undefined;
773
790
  return _context.f(4);
774
791
  case 5:
775
- this.deleteAll();
792
+ this._items.deleteAll(); // Directly call deleteAll to prevent event emit.
776
793
  this.addItems(result, 'tail');
777
794
  this.internalState.current = WindowState.LATEST;
778
795
  case 6:
@@ -941,25 +958,28 @@ var TraversableRemoteCollection = /*#__PURE__*/function (_ObservableIndexedObj)
941
958
  if (to === 'tail') {
942
959
  result = this.trimItemsArrayToLimit([].concat(TopicHistoryWindow_toConsumableArray(this.items), TopicHistoryWindow_toConsumableArray(newItems)), 'head');
943
960
  }
944
- this.deleteAll();
961
+ this._items.deleteAll(); // Directly call deleteAll to prevent event emit.
945
962
  this.set.apply(this, TopicHistoryWindow_toConsumableArray(result));
946
963
  }
947
964
 
948
965
  /**
949
- * Return array with messages of count that matching limit.
966
+ * Return array with messages trimmed using High/Low Watermark strategy.
950
967
  */
951
968
  }, {
952
969
  key: "trimItemsArrayToLimit",
953
970
  value: function trimItemsArrayToLimit(items, from) {
954
- if (this.limit === null) {
971
+ var highWatermark = this.limit;
972
+ if (highWatermark === null || items.length <= highWatermark) {
955
973
  return items;
956
974
  }
975
+ var lowWatermark = Math.floor(highWatermark * this.internalState.retainRatio);
957
976
  if (from === 'head') {
958
- return items.slice(-this.limit);
977
+ return items.slice(-lowWatermark);
959
978
  }
960
979
  if (from === 'tail') {
961
- return items.slice(0, this.limit);
980
+ return items.slice(0, lowWatermark);
962
981
  }
982
+ return items;
963
983
  }
964
984
  }]);
965
985
  }(ObservableIndexedObjectCollection);