polfan-server-js-client 0.1.99935 → 0.1.99936

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.
@@ -4,14 +4,11 @@
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="UsersManager">
8
- <change afterPath="$PROJECT_DIR$/src/types/src/schemes/commands/GetClientData.ts" afterDir="false" />
9
- <change afterPath="$PROJECT_DIR$/src/types/src/schemes/commands/SetClientData.ts" afterDir="false" />
10
- <change afterPath="$PROJECT_DIR$/src/types/src/schemes/events/ClientData.ts" afterDir="false" />
7
+ <list default="true" id="831dae43-0da1-47fd-a5f7-33dd5eec2992" name="Changes" comment="Client data and room stream support">
11
8
  <change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
12
- <change beforePath="$PROJECT_DIR$/src/AbstractChatClient.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/AbstractChatClient.ts" afterDir="false" />
13
- <change beforePath="$PROJECT_DIR$/src/types" beforeDir="false" afterPath="$PROJECT_DIR$/src/types" afterDir="false" />
14
- <change beforePath="$PROJECT_DIR$/src/types/src/index.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/types/src/index.ts" afterDir="false" />
9
+ <change beforePath="$PROJECT_DIR$/src/IndexedObjectCollection.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/IndexedObjectCollection.ts" afterDir="false" />
10
+ <change beforePath="$PROJECT_DIR$/src/state-tracker/RoomsManager.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/state-tracker/RoomsManager.ts" afterDir="false" />
11
+ <change beforePath="$PROJECT_DIR$/src/state-tracker/SpacesManager.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/state-tracker/SpacesManager.ts" afterDir="false" />
15
12
  </list>
16
13
  <option name="SHOW_DIALOG" value="false" />
17
14
  <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -41,22 +38,22 @@
41
38
  <option name="hideEmptyMiddlePackages" value="true" />
42
39
  <option name="showLibraryContents" value="true" />
43
40
  </component>
44
- <component name="PropertiesComponent">{
45
- &quot;keyToString&quot;: {
46
- &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
47
- &quot;RunOnceActivity.git.unshallow&quot;: &quot;true&quot;,
48
- &quot;git-widget-placeholder&quot;: &quot;master&quot;,
49
- &quot;ignore.virus.scanning.warn.message&quot;: &quot;true&quot;,
50
- &quot;last_opened_file_path&quot;: &quot;//wsl.localhost/Debian/home/jarek/polfan-js-client-library&quot;,
51
- &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
52
- &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
53
- &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
54
- &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
55
- &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
56
- &quot;ts.external.directory.path&quot;: &quot;\\\\wsl.localhost\\Debian\\home\\jarek\\polfan-js-client-library\\node_modules\\typescript\\lib&quot;,
57
- &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
41
+ <component name="PropertiesComponent"><![CDATA[{
42
+ "keyToString": {
43
+ "RunOnceActivity.ShowReadmeOnStart": "true",
44
+ "RunOnceActivity.git.unshallow": "true",
45
+ "git-widget-placeholder": "master",
46
+ "ignore.virus.scanning.warn.message": "true",
47
+ "last_opened_file_path": "//wsl.localhost/Debian/home/jarek/polfan-js-client-library",
48
+ "node.js.detected.package.eslint": "true",
49
+ "node.js.detected.package.tslint": "true",
50
+ "node.js.selected.package.eslint": "(autodetect)",
51
+ "node.js.selected.package.tslint": "(autodetect)",
52
+ "nodejs_package_manager_path": "npm",
53
+ "ts.external.directory.path": "\\\\wsl.localhost\\Debian\\home\\jarek\\polfan-js-client-library\\node_modules\\typescript\\lib",
54
+ "vue.rearranger.settings.migration": "true"
58
55
  }
59
- }</component>
56
+ }]]></component>
60
57
  <component name="SharedIndexes">
61
58
  <attachedChunks>
62
59
  <set>
@@ -86,7 +83,7 @@
86
83
  <workItem from="1741207438028" duration="38000" />
87
84
  <workItem from="1741543251744" duration="1234000" />
88
85
  <workItem from="1741554932034" duration="1521000" />
89
- <workItem from="1741900021179" duration="1541000" />
86
+ <workItem from="1741900021179" duration="4250000" />
90
87
  </task>
91
88
  <task id="LOCAL-00001" summary="Emoticons objects">
92
89
  <option name="closed" value="true" />
@@ -248,7 +245,23 @@
248
245
  <option name="project" value="LOCAL" />
249
246
  <updated>1741170174335</updated>
250
247
  </task>
251
- <option name="localTasksCounter" value="21" />
248
+ <task id="LOCAL-00021" summary="Client data and room stream support">
249
+ <option name="closed" value="true" />
250
+ <created>1741970680171</created>
251
+ <option name="number" value="00021" />
252
+ <option name="presentableId" value="LOCAL-00021" />
253
+ <option name="project" value="LOCAL" />
254
+ <updated>1741970680171</updated>
255
+ </task>
256
+ <task id="LOCAL-00022" summary="Client data and room stream support">
257
+ <option name="closed" value="true" />
258
+ <created>1741971884190</created>
259
+ <option name="number" value="00022" />
260
+ <option name="presentableId" value="LOCAL-00022" />
261
+ <option name="project" value="LOCAL" />
262
+ <updated>1741971884190</updated>
263
+ </task>
264
+ <option name="localTasksCounter" value="23" />
252
265
  <servers />
253
266
  </component>
254
267
  <component name="TypeScriptGeneratedFilesManager">
@@ -277,6 +290,7 @@
277
290
  <MESSAGE value="Fix authentication" />
278
291
  <MESSAGE value="Add notify option to Kick command" />
279
292
  <MESSAGE value="UsersManager" />
280
- <option name="LAST_COMMIT_MESSAGE" value="UsersManager" />
293
+ <MESSAGE value="Client data and room stream support" />
294
+ <option name="LAST_COMMIT_MESSAGE" value="Client data and room stream support" />
281
295
  </component>
282
296
  </project>
package/build/index.js CHANGED
@@ -261,9 +261,15 @@ var IndexedCollection = /*#__PURE__*/function () {
261
261
  var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
262
262
  IndexedObjectCollection_classCallCheck(this, IndexedCollection);
263
263
  IndexedObjectCollection_defineProperty(this, "_items", new Map());
264
+ IndexedObjectCollection_defineProperty(this, "_mutationCounter", 0);
264
265
  this.set.apply(this, _toConsumableArray(items));
265
266
  }
266
267
  IndexedObjectCollection_createClass(IndexedCollection, [{
268
+ key: "mutationCounter",
269
+ get: function get() {
270
+ return this._mutationCounter;
271
+ }
272
+ }, {
267
273
  key: "items",
268
274
  get: function get() {
269
275
  return this._items;
@@ -276,6 +282,7 @@ var IndexedCollection = /*#__PURE__*/function () {
276
282
  }, {
277
283
  key: "set",
278
284
  value: function set() {
285
+ this._mutationCounter++;
279
286
  for (var _len = arguments.length, items = new Array(_len), _key = 0; _key < _len; _key++) {
280
287
  items[_key] = arguments[_key];
281
288
  }
@@ -326,13 +333,6 @@ var IndexedCollection = /*#__PURE__*/function () {
326
333
  }
327
334
  return result;
328
335
  }
329
- }, {
330
- key: "map",
331
- value: function map(callback) {
332
- return Array.from(this.items.entries()).map(function (entry) {
333
- return callback(entry[1], entry[0]);
334
- });
335
- }
336
336
  }]);
337
337
  return IndexedCollection;
338
338
  }();
@@ -355,6 +355,11 @@ var IndexedObjectCollection = /*#__PURE__*/function () {
355
355
  get: function get() {
356
356
  return this._items.length;
357
357
  }
358
+ }, {
359
+ key: "mutationCounter",
360
+ get: function get() {
361
+ return this._items.mutationCounter;
362
+ }
358
363
  }, {
359
364
  key: "set",
360
365
  value: function set() {
@@ -417,11 +422,6 @@ var IndexedObjectCollection = /*#__PURE__*/function () {
417
422
  }
418
423
  return result;
419
424
  }
420
- }, {
421
- key: "map",
422
- value: function map(callback) {
423
- return this.items.map(callback);
424
- }
425
425
  }, {
426
426
  key: "getId",
427
427
  value: function getId(item) {
@@ -2179,11 +2179,11 @@ var RoomsManager = /*#__PURE__*/function () {
2179
2179
  (_this$members = this.members)["delete"].apply(_this$members, roomIds);
2180
2180
  (_this$membersPromises = this.membersPromises).forget.apply(_this$membersPromises, roomIds);
2181
2181
  for (var _i = 0, _roomIds = roomIds; _i < _roomIds.length; _i++) {
2182
- var _this$topics$get$map, _this$topics$get, _this$messages;
2182
+ var _this$topics$get$item, _this$topics$get, _this$messages;
2183
2183
  var roomId = _roomIds[_i];
2184
- var topicIds = (_this$topics$get$map = (_this$topics$get = this.topics.get(roomId)) === null || _this$topics$get === void 0 ? void 0 : _this$topics$get.map(function (topic) {
2184
+ var topicIds = (_this$topics$get$item = (_this$topics$get = this.topics.get(roomId)) === null || _this$topics$get === void 0 ? void 0 : _this$topics$get.items.map(function (topic) {
2185
2185
  return topic.id;
2186
- })) !== null && _this$topics$get$map !== void 0 ? _this$topics$get$map : [];
2186
+ })) !== null && _this$topics$get$item !== void 0 ? _this$topics$get$item : [];
2187
2187
  (_this$messages = this.messages)._deleteByTopicIds.apply(_this$messages, [roomId].concat(RoomsManager_toConsumableArray(topicIds)));
2188
2188
  }
2189
2189
  (_this$topics = this.topics)["delete"].apply(_this$topics, roomIds);
@@ -2191,7 +2191,7 @@ var RoomsManager = /*#__PURE__*/function () {
2191
2191
  }, {
2192
2192
  key: "deleteRoomsBySpaceId",
2193
2193
  value: function deleteRoomsBySpaceId(spaceId) {
2194
- this.deleteRoom.apply(this, RoomsManager_toConsumableArray(this.list.findBy('spaceId', spaceId).map(function (room) {
2194
+ this.deleteRoom.apply(this, RoomsManager_toConsumableArray(this.list.findBy('spaceId', spaceId).items.map(function (room) {
2195
2195
  return room.id;
2196
2196
  })));
2197
2197
  }
@@ -2828,10 +2828,10 @@ var SpacesManager = /*#__PURE__*/function () {
2828
2828
  }, {
2829
2829
  key: "handleSpaceDeleted",
2830
2830
  value: function handleSpaceDeleted(ev) {
2831
- var _this$rooms$get$map, _this$rooms$get3, _this$roomIdToSpaceId;
2832
- var roomIds = (_this$rooms$get$map = (_this$rooms$get3 = this.rooms.get(ev.id)) === null || _this$rooms$get3 === void 0 ? void 0 : _this$rooms$get3.map(function (item) {
2831
+ var _this$rooms$get$items, _this$rooms$get3, _this$roomIdToSpaceId;
2832
+ var roomIds = (_this$rooms$get$items = (_this$rooms$get3 = this.rooms.get(ev.id)) === null || _this$rooms$get3 === void 0 ? void 0 : _this$rooms$get3.items.map(function (item) {
2833
2833
  return item.id;
2834
- })) !== null && _this$rooms$get$map !== void 0 ? _this$rooms$get$map : [];
2834
+ })) !== null && _this$rooms$get$items !== void 0 ? _this$rooms$get$items : [];
2835
2835
  (_this$roomIdToSpaceId = this.roomIdToSpaceId)["delete"].apply(_this$roomIdToSpaceId, SpacesManager_toConsumableArray(roomIds));
2836
2836
  this.roles["delete"](ev.id);
2837
2837
  this.members["delete"](ev.id);