polfan-server-js-client 0.2.56 → 0.2.58

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.
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="AgentMigrationStateService">
4
+ <option name="migrationStatus" value="COMPLETED" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="AskMigrationStateService">
4
+ <option name="migrationStatus" value="COMPLETED" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="Ask2AgentMigrationStateService">
4
+ <option name="migrationStatus" value="COMPLETED" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="EditMigrationStateService">
4
+ <option name="migrationStatus" value="COMPLETED" />
5
+ </component>
6
+ </project>
@@ -5,6 +5,15 @@
5
5
  </component>
6
6
  <component name="ChangeListManager">
7
7
  <list default="true" id="831dae43-0da1-47fd-a5f7-33dd5eec2992" name="Changes" comment="Collection integration with React JS rework">
8
+ <change beforePath="$PROJECT_DIR$/babel.config.js" beforeDir="false" afterPath="$PROJECT_DIR$/babel.config.js" afterDir="false" />
9
+ <change beforePath="$PROJECT_DIR$/build/index.cjs.js" beforeDir="false" afterPath="$PROJECT_DIR$/build/index.cjs.js" afterDir="false" />
10
+ <change beforePath="$PROJECT_DIR$/build/index.cjs.js.map" beforeDir="false" afterPath="$PROJECT_DIR$/build/index.cjs.js.map" afterDir="false" />
11
+ <change beforePath="$PROJECT_DIR$/build/index.umd.js" beforeDir="false" afterPath="$PROJECT_DIR$/build/index.umd.js" afterDir="false" />
12
+ <change beforePath="$PROJECT_DIR$/build/index.umd.js.map" beforeDir="false" afterPath="$PROJECT_DIR$/build/index.umd.js.map" afterDir="false" />
13
+ <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" />
14
+ <change beforePath="$PROJECT_DIR$/package-lock.json" beforeDir="false" afterPath="$PROJECT_DIR$/package-lock.json" afterDir="false" />
15
+ <change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
16
+ <change beforePath="$PROJECT_DIR$/src/IndexedObjectCollection.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/IndexedObjectCollection.ts" afterDir="false" />
8
17
  <change beforePath="$PROJECT_DIR$/src/state-tracker/TopicHistoryWindow.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/state-tracker/TopicHistoryWindow.ts" afterDir="false" />
9
18
  <change beforePath="$PROJECT_DIR$/tests/history-window.test.ts" beforeDir="false" afterPath="$PROJECT_DIR$/tests/history-window.test.ts" afterDir="false" />
10
19
  </list>
@@ -53,7 +62,9 @@
53
62
  &quot;keyToString&quot;: {
54
63
  &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
55
64
  &quot;RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager&quot;: &quot;true&quot;,
65
+ &quot;RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252&quot;: &quot;true&quot;,
56
66
  &quot;RunOnceActivity.git.unshallow&quot;: &quot;true&quot;,
67
+ &quot;com.intellij.ml.llm.matterhorn.ej.ui.settings.DefaultModelSelectionForGA.v1&quot;: &quot;true&quot;,
57
68
  &quot;git-widget-placeholder&quot;: &quot;master&quot;,
58
69
  &quot;ignore.virus.scanning.warn.message&quot;: &quot;true&quot;,
59
70
  &quot;junie.onboarding.icon.badge.shown&quot;: &quot;true&quot;,
@@ -63,6 +74,7 @@
63
74
  &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
64
75
  &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
65
76
  &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
77
+ &quot;to.speed.mode.migration.done&quot;: &quot;true&quot;,
66
78
  &quot;ts.external.directory.path&quot;: &quot;\\\\wsl.localhost\\Debian\\home\\jarek\\polfan-js-client-library\\node_modules\\typescript\\lib&quot;,
67
79
  &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
68
80
  }
@@ -70,8 +82,8 @@
70
82
  <component name="SharedIndexes">
71
83
  <attachedChunks>
72
84
  <set>
73
- <option value="bundled-js-predefined-d6986cc7102b-b26f3e71634d-JavaScript-PS-251.26094.133" />
74
- <option value="bundled-php-predefined-a98d8de5180a-c5828cf854d9-com.jetbrains.php.sharedIndexes-PS-251.26094.133" />
85
+ <option value="bundled-js-predefined-d6986cc7102b-c7e53b3be11b-JavaScript-PS-253.28086.57" />
86
+ <option value="bundled-php-predefined-a98d8de5180a-09080813851e-com.jetbrains.php.sharedIndexes-PS-253.28086.57" />
75
87
  </set>
76
88
  </attachedChunks>
77
89
  </component>
@@ -139,6 +151,11 @@
139
151
  <workItem from="1761857165939" duration="4293000" />
140
152
  <workItem from="1762715993044" duration="642000" />
141
153
  <workItem from="1762724230487" duration="7498000" />
154
+ <workItem from="1762800240528" duration="49000" />
155
+ <workItem from="1762800459831" duration="10000" />
156
+ <workItem from="1763319451927" duration="2136000" />
157
+ <workItem from="1763410036992" duration="181000" />
158
+ <workItem from="1763457144937" duration="7689000" />
142
159
  </task>
143
160
  <task id="LOCAL-00013" summary="Permission related changes in protocol types">
144
161
  <option name="closed" value="true" />
package/babel.config.js CHANGED
@@ -1,7 +1,7 @@
1
1
  module.exports = {
2
2
  presets: [["@babel/env"]],
3
3
  plugins: [
4
+ ["@babel/plugin-transform-typescript" , { allowDeclareFields: true }],
4
5
  ["@babel/plugin-proposal-class-properties"],
5
- ["@babel/plugin-transform-typescript"],
6
6
  ],
7
7
  };
@@ -195,7 +195,7 @@ class IndexedCollection {
195
195
  }
196
196
  return result;
197
197
  }
198
- shallowCopy() {
198
+ createMirror() {
199
199
  const copy = new IndexedCollection();
200
200
  copy._items = this._items;
201
201
  return copy;
@@ -203,8 +203,8 @@ class IndexedCollection {
203
203
  }
204
204
  class IndexedObjectCollection {
205
205
  constructor(id, items = []) {
206
- this.id = id;
207
206
  IndexedObjectCollection_defineProperty(this, "_items", void 0);
207
+ this.id = id;
208
208
  this._items = new IndexedCollection();
209
209
  this.set(...items);
210
210
  }
@@ -244,7 +244,7 @@ class IndexedObjectCollection {
244
244
  }
245
245
  return result;
246
246
  }
247
- shallowCopy() {
247
+ createMirror() {
248
248
  const copy = new IndexedObjectCollection(this.id);
249
249
  copy._items = this._items;
250
250
  return copy;
@@ -285,7 +285,7 @@ class ObservableIndexedCollection extends IndexedCollection {
285
285
  });
286
286
  }
287
287
  }
288
- shallowCopy() {
288
+ createMirror() {
289
289
  const copy = new ObservableIndexedCollection();
290
290
  copy.eventTarget = this.eventTarget;
291
291
  copy._items = this._items;
@@ -307,8 +307,8 @@ class ObservableIndexedCollection extends IndexedCollection {
307
307
  class ObservableIndexedObjectCollection extends IndexedObjectCollection {
308
308
  constructor(id, items = []) {
309
309
  super(id);
310
- this.id = id;
311
310
  IndexedObjectCollection_defineProperty(this, "eventTarget", void 0);
311
+ this.id = id;
312
312
  this.eventTarget = new EventTarget();
313
313
  this.set(...items);
314
314
  }
@@ -337,7 +337,7 @@ class ObservableIndexedObjectCollection extends IndexedObjectCollection {
337
337
  });
338
338
  }
339
339
  }
340
- shallowCopy() {
340
+ createMirror() {
341
341
  const copy = new ObservableIndexedObjectCollection(this.id);
342
342
  copy.eventTarget = this.eventTarget;
343
343
  copy._items = this._items;
@@ -423,64 +423,77 @@ let WindowState = /*#__PURE__*/function (WindowState) {
423
423
  class TraversableRemoteCollection extends ObservableIndexedObjectCollection {
424
424
  constructor(...args) {
425
425
  super(...args);
426
- /**
427
- * Maximum numer of items stored in window.
428
- * Null for unlimited.
429
- */
430
- TopicHistoryWindow_defineProperty(this, "limit", 50);
431
- TopicHistoryWindow_defineProperty(this, "oldestId", null);
432
- TopicHistoryWindow_defineProperty(this, "currentState", WindowState.LIVE);
433
- TopicHistoryWindow_defineProperty(this, "fetchingState", undefined);
426
+ TopicHistoryWindow_defineProperty(this, "internalState", {
427
+ current: WindowState.LIVE,
428
+ ongoing: undefined,
429
+ limit: 50,
430
+ oldestId: null
431
+ });
434
432
  }
435
433
  /**
436
434
  * Current mode od collection window. To change mode, call one of available fetch methods.
437
435
  */
438
436
  get state() {
439
- return this.currentState;
437
+ return this.internalState.current;
438
+ }
439
+ /**
440
+ * Maximum numer of items stored in window.
441
+ * Null for unlimited.
442
+ */
443
+ get limit() {
444
+ return this.internalState.limit;
445
+ }
446
+
447
+ /**
448
+ * Maximum numer of items stored in window.
449
+ * Null for unlimited.
450
+ */
451
+ set limit(value) {
452
+ this.internalState.limit = value;
440
453
  }
441
454
  get hasLatest() {
442
455
  return [WindowState.LATEST, WindowState.LIVE].includes(this.state);
443
456
  }
444
457
  get hasOldest() {
445
- return this.state === WindowState.OLDEST || this.oldestId !== null && this.has(this.oldestId);
458
+ return this.state === WindowState.OLDEST || this.internalState.oldestId !== null && this.has(this.internalState.oldestId);
446
459
  }
447
460
  async resetToLatest() {
448
- if (this.fetchingState || this.currentState === WindowState.LATEST) {
461
+ if (this.internalState.ongoing || this.internalState.current === WindowState.LATEST) {
449
462
  return;
450
463
  }
451
- this.fetchingState = WindowState.LATEST;
464
+ this.internalState.ongoing = WindowState.LATEST;
452
465
  let result;
453
466
  try {
454
467
  result = await this.fetchLatestItems();
455
468
  } finally {
456
- this.fetchingState = undefined;
469
+ this.internalState.ongoing = undefined;
457
470
  }
458
471
  this.deleteAll();
459
472
  this.addItems(result, 'tail');
460
- this.currentState = WindowState.LATEST;
473
+ this.internalState.current = WindowState.LATEST;
461
474
  }
462
475
  async fetchPrevious() {
463
- if (this.fetchingState || this.hasOldest) {
476
+ if (this.internalState.ongoing || this.hasOldest) {
464
477
  return;
465
478
  }
466
- this.fetchingState = WindowState.PAST;
479
+ this.internalState.ongoing = WindowState.PAST;
467
480
  let result;
468
481
  try {
469
482
  result = await this.fetchItemsBefore();
470
483
  } finally {
471
- this.fetchingState = undefined;
484
+ this.internalState.ongoing = undefined;
472
485
  }
473
486
  if (!result) {
474
487
  return this.resetToLatest();
475
488
  }
476
489
  if (!result.length) {
477
490
  const firstItem = this.getAt(0);
478
- this.oldestId = firstItem ? this.getId(firstItem) : null;
491
+ this.internalState.oldestId = firstItem ? this.getId(firstItem) : null;
479
492
  await this.refreshFetchedState();
480
493
 
481
494
  // LATEST state has priority over OLDEST
482
- if (this.currentState === WindowState.PAST) {
483
- this.currentState = WindowState.OLDEST;
495
+ if (this.internalState.current === WindowState.PAST) {
496
+ this.internalState.current = WindowState.OLDEST;
484
497
  }
485
498
  return;
486
499
  }
@@ -488,15 +501,15 @@ class TraversableRemoteCollection extends ObservableIndexedObjectCollection {
488
501
  await this.refreshFetchedState();
489
502
  }
490
503
  async fetchNext() {
491
- if (this.fetchingState || this.hasLatest) {
504
+ if (this.internalState.ongoing || this.hasLatest) {
492
505
  return;
493
506
  }
494
- this.fetchingState = WindowState.PAST;
507
+ this.internalState.ongoing = WindowState.PAST;
495
508
  let result;
496
509
  try {
497
510
  result = await this.fetchItemsAfter();
498
511
  } finally {
499
- this.fetchingState = undefined;
512
+ this.internalState.ongoing = undefined;
500
513
  }
501
514
  if (!result) {
502
515
  await this.resetToLatest();
@@ -509,7 +522,7 @@ class TraversableRemoteCollection extends ObservableIndexedObjectCollection {
509
522
  }
510
523
  }
511
524
  async refreshFetchedState() {
512
- this.currentState = (await this.isLatestItemLoaded()) ? WindowState.LATEST : WindowState.PAST;
525
+ this.internalState.current = (await this.isLatestItemLoaded()) ? WindowState.LATEST : WindowState.PAST;
513
526
  }
514
527
  addItems(newItems, to) {
515
528
  let result;
@@ -539,51 +552,51 @@ class TraversableRemoteCollection extends ObservableIndexedObjectCollection {
539
552
  }
540
553
  }
541
554
  class TopicHistoryWindow extends TraversableRemoteCollection {
542
- constructor(roomId, topicId, tracker) {
555
+ constructor(roomId, topicId, tracker, bindEvents = true) {
543
556
  super('id');
544
- this.roomId = roomId;
545
- this.topicId = topicId;
546
- this.tracker = tracker;
547
557
  /**
548
558
  * Reexported available window modes enum.
549
559
  */
550
560
  TopicHistoryWindow_defineProperty(this, "WindowState", WindowState);
551
- TopicHistoryWindow_defineProperty(this, "traverseLock", false);
552
- this.tracker.client.on('Session', ev => this.handleSession(ev));
553
- this.tracker.client.on('NewMessage', ev => this.handleNewMessage(ev));
561
+ this.roomId = roomId;
562
+ this.topicId = topicId;
563
+ this.tracker = tracker;
564
+ this.internalState.traverseLock = false;
565
+ if (bindEvents) {
566
+ this.tracker.client.on('Session', ev => this.handleSession(ev));
567
+ this.tracker.client.on('NewMessage', ev => this.handleNewMessage(ev));
568
+ }
554
569
  }
555
- shallowCopy() {
556
- const copy = new TopicHistoryWindow(this.roomId, this.topicId, this.tracker);
570
+ createMirror() {
571
+ const copy = new TopicHistoryWindow(this.roomId, this.topicId, this.tracker, false);
572
+ copy.eventTarget = this.eventTarget;
557
573
  copy._items = this._items;
558
- copy.limit = this.limit;
559
- copy.currentState = this.currentState;
560
- copy.fetchingState = this.fetchingState;
561
- copy.oldestId = this.oldestId;
574
+ copy.internalState = this.internalState;
562
575
  return copy;
563
576
  }
564
577
  get isTraverseLocked() {
565
- return this.traverseLock;
578
+ return this.internalState.traverseLock;
566
579
  }
567
580
  async setTraverseLock(lock) {
568
- this.traverseLock = lock;
581
+ this.internalState.traverseLock = lock;
569
582
  if (lock && this.state !== WindowState.LIVE && this.state !== WindowState.LATEST) {
570
583
  await super.resetToLatest();
571
584
  }
572
585
  }
573
586
  async resetToLatest() {
574
- if (this.traverseLock) {
587
+ if (this.internalState.traverseLock) {
575
588
  return;
576
589
  }
577
590
  return super.resetToLatest();
578
591
  }
579
592
  async fetchNext() {
580
- if (this.traverseLock) {
593
+ if (this.internalState.traverseLock) {
581
594
  return;
582
595
  }
583
596
  return super.fetchNext();
584
597
  }
585
598
  async fetchPrevious() {
586
- if (this.traverseLock) {
599
+ if (this.internalState.traverseLock) {
587
600
  return;
588
601
  }
589
602
  return super.fetchPrevious();
@@ -611,7 +624,7 @@ class TopicHistoryWindow extends TraversableRemoteCollection {
611
624
  handleSession(ev) {
612
625
  const rooms = ev.state.rooms;
613
626
  if (rooms.find(room => room.id === this.roomId)) {
614
- this.resetToLatest();
627
+ void this.resetToLatest();
615
628
  } else {
616
629
  this.deleteAll();
617
630
  }
@@ -683,10 +696,10 @@ function RoomMessagesHistory_toPrimitive(input, hint) { if (typeof input !== "ob
683
696
 
684
697
  class RoomMessagesHistory {
685
698
  constructor(room, tracker) {
686
- this.room = room;
687
- this.tracker = tracker;
688
699
  RoomMessagesHistory_defineProperty(this, "historyWindows", new IndexedCollection());
689
700
  RoomMessagesHistory_defineProperty(this, "traverseLock", false);
701
+ this.room = room;
702
+ this.tracker = tracker;
690
703
  this.tracker.client.on('RoomUpdated', ev => this.handleRoomUpdated(ev));
691
704
  this.tracker.client.on('NewTopic', ev => this.handleNewTopic(ev));
692
705
  this.tracker.client.on('TopicDeleted', ev => this.handleTopicDeleted(ev));
@@ -758,11 +771,11 @@ function MessagesManager_toPrimitive(input, hint) { if (typeof input !== "object
758
771
 
759
772
  class MessagesManager {
760
773
  constructor(tracker) {
761
- this.tracker = tracker;
762
774
  MessagesManager_defineProperty(this, "roomHistories", new IndexedCollection());
763
775
  MessagesManager_defineProperty(this, "followedTopics", new IndexedCollection());
764
776
  MessagesManager_defineProperty(this, "followedTopicsPromises", new PromiseRegistry());
765
777
  MessagesManager_defineProperty(this, "deferredSession", new DeferredTask());
778
+ this.tracker = tracker;
766
779
  this.tracker.client.on('Session', ev => this.handleSession(ev));
767
780
  this.tracker.client.on('RoomJoined', ev => this.handleRoomJoin(ev));
768
781
  this.tracker.client.on('NewTopic', ev => this.handleNewTopic(ev));
@@ -983,7 +996,6 @@ function RoomsManager_toPrimitive(input, hint) { if (typeof input !== "object" |
983
996
 
984
997
  class RoomsManager {
985
998
  constructor(tracker) {
986
- this.tracker = tracker;
987
999
  RoomsManager_defineProperty(this, "messages", void 0);
988
1000
  RoomsManager_defineProperty(this, "list", new ObservableIndexedObjectCollection('id'));
989
1001
  RoomsManager_defineProperty(this, "topics", new IndexedCollection());
@@ -991,6 +1003,7 @@ class RoomsManager {
991
1003
  RoomsManager_defineProperty(this, "deferredSession", new DeferredTask());
992
1004
  RoomsManager_defineProperty(this, "membersPromises", new PromiseRegistry());
993
1005
  RoomsManager_defineProperty(this, "topicsPromises", new PromiseRegistry());
1006
+ this.tracker = tracker;
994
1007
  this.messages = new MessagesManager(tracker);
995
1008
  this.tracker.client.on('NewMessage', ev => this.handleNewMessage(ev));
996
1009
  this.tracker.client.on('NewTopic', ev => this.handleNewTopic(ev));
@@ -1309,7 +1322,6 @@ function SpacesManager_toPrimitive(input, hint) { if (typeof input !== "object"
1309
1322
 
1310
1323
  class SpacesManager {
1311
1324
  constructor(tracker) {
1312
- this.tracker = tracker;
1313
1325
  SpacesManager_defineProperty(this, "list", new ObservableIndexedObjectCollection('id'));
1314
1326
  SpacesManager_defineProperty(this, "roles", new IndexedCollection());
1315
1327
  SpacesManager_defineProperty(this, "rooms", new IndexedCollection());
@@ -1318,6 +1330,7 @@ class SpacesManager {
1318
1330
  SpacesManager_defineProperty(this, "deferredSession", new DeferredTask());
1319
1331
  SpacesManager_defineProperty(this, "roomsPromises", new PromiseRegistry());
1320
1332
  SpacesManager_defineProperty(this, "membersPromises", new PromiseRegistry());
1333
+ this.tracker = tracker;
1321
1334
  this.tracker.client.on('NewRoom', ev => this.handleNewRoom(ev));
1322
1335
  this.tracker.client.on('RoomDeleted', ev => this.handleRoomDeleted(ev));
1323
1336
  this.tracker.client.on('RoomUpdated', ev => this.handleRoomUpdated(ev));
@@ -1678,9 +1691,9 @@ const getOvIdByObject = overwrites => getOvId(overwrites.location, overwrites.ta
1678
1691
  class PermissionsManager extends EventTarget {
1679
1692
  constructor(tracker) {
1680
1693
  super();
1681
- this.tracker = tracker;
1682
1694
  PermissionsManager_defineProperty(this, "overwrites", new IndexedCollection());
1683
1695
  PermissionsManager_defineProperty(this, "overwritesPromises", new PromiseRegistry());
1696
+ this.tracker = tracker;
1684
1697
  this.tracker.client.on('PermissionOverwrites', ev => this.handlePermissionOverwrites(ev));
1685
1698
  this.tracker.client.on('PermissionOverwritesUpdated', ev => this.handlePermissionOverwrites(ev));
1686
1699
  this.tracker.client.on('SpaceDeleted', ev => this.handleSpaceDeleted(ev));
@@ -1918,9 +1931,9 @@ function EmoticonsManager_toPrimitive(input, hint) { if (typeof input !== "objec
1918
1931
  const GLOBAL_KEY = 'global';
1919
1932
  class EmoticonsManager {
1920
1933
  constructor(tracker) {
1921
- this.tracker = tracker;
1922
1934
  EmoticonsManager_defineProperty(this, "list", new IndexedCollection());
1923
1935
  EmoticonsManager_defineProperty(this, "emoticonsPromises", new PromiseRegistry());
1936
+ this.tracker = tracker;
1924
1937
  this.tracker.client.on('Emoticons', ev => this.handleEmoticons(ev));
1925
1938
  this.tracker.client.on('NewEmoticon', ev => this.handleNewEmoticon(ev));
1926
1939
  this.tracker.client.on('EmoticonDeleted', ev => this.handleEmoticonDeleted(ev));
@@ -1976,9 +1989,9 @@ function UsersManager_toPrimitive(input, hint) { if (typeof input !== "object" |
1976
1989
 
1977
1990
  class UsersManager {
1978
1991
  constructor(tracker) {
1979
- this.tracker = tracker;
1980
1992
  UsersManager_defineProperty(this, "onlineStatus", new EventTarget());
1981
1993
  UsersManager_defineProperty(this, "users", new ObservableIndexedObjectCollection('id'));
1994
+ this.tracker = tracker;
1982
1995
  // RoomMemberUpdated & SpaceMemberUpdated events are not contains user object
1983
1996
  tracker.client.on('UserUpdated', event => this.handleUsers([event.user]));
1984
1997
  tracker.client.on('RoomMemberJoined', event => this.handleMembers([event.member]));
@@ -2023,9 +2036,9 @@ const getId = (refUserId, type) => `${refUserId}-${type}`;
2023
2036
  const getIdFromRelationship = relationship => getId(relationship.refUser.id, relationship.type);
2024
2037
  class RelationshipsManager {
2025
2038
  constructor(tracker) {
2026
- this.tracker = tracker;
2027
2039
  RelationshipsManager_defineProperty(this, "relationships", new ObservableIndexedObjectCollection(getIdFromRelationship));
2028
2040
  RelationshipsManager_defineProperty(this, "promises", new PromiseRegistry());
2041
+ this.tracker = tracker;
2029
2042
  this.tracker.client.on('Relationships', ev => this.handleRelationships(ev));
2030
2043
  this.tracker.client.on('NewRelationship', ev => this.handleNewRelationship(ev));
2031
2044
  this.tracker.client.on('RelationshipDeleted', ev => this.handleRelationshipDeleted(ev));
@@ -2081,7 +2094,6 @@ function ChatStateTracker_toPrimitive(input, hint) { if (typeof input !== "objec
2081
2094
 
2082
2095
  class ChatStateTracker {
2083
2096
  constructor(client) {
2084
- this.client = client;
2085
2097
  /**
2086
2098
  * State of your permissions.
2087
2099
  */
@@ -2108,6 +2120,7 @@ class ChatStateTracker {
2108
2120
  ChatStateTracker_defineProperty(this, "relationships", new RelationshipsManager(this));
2109
2121
  ChatStateTracker_defineProperty(this, "_me", null);
2110
2122
  ChatStateTracker_defineProperty(this, "deferredSession", new DeferredTask());
2123
+ this.client = client;
2111
2124
  this.client.on('Session', ev => this.handleSession(ev));
2112
2125
  }
2113
2126
  get me() {
@@ -2138,7 +2151,6 @@ var WebSocketChatClientEvent = /*#__PURE__*/function (WebSocketChatClientEvent)
2138
2151
  class WebSocketChatClient extends AbstractChatClient {
2139
2152
  constructor(options) {
2140
2153
  super();
2141
- this.options = options;
2142
2154
  WebSocketChatClient_defineProperty(this, "Event", WebSocketChatClientEvent);
2143
2155
  WebSocketChatClient_defineProperty(this, "state", void 0);
2144
2156
  WebSocketChatClient_defineProperty(this, "ws", null);
@@ -2146,6 +2158,7 @@ class WebSocketChatClient extends AbstractChatClient {
2146
2158
  WebSocketChatClient_defineProperty(this, "connectingTimeoutId", void 0);
2147
2159
  WebSocketChatClient_defineProperty(this, "authenticated", void 0);
2148
2160
  WebSocketChatClient_defineProperty(this, "authenticatedResolvers", void 0);
2161
+ this.options = options;
2149
2162
  if (this.options.stateTracking ?? true) {
2150
2163
  this.state = new ChatStateTracker(this);
2151
2164
  }
@@ -2245,9 +2258,9 @@ var WebApiChatClientEvent = /*#__PURE__*/function (WebApiChatClientEvent) {
2245
2258
  class WebApiChatClient extends AbstractChatClient {
2246
2259
  constructor(options) {
2247
2260
  super();
2248
- this.options = options;
2249
2261
  WebApiChatClient_defineProperty(this, "Event", WebApiChatClientEvent);
2250
2262
  WebApiChatClient_defineProperty(this, "sendStack", void 0);
2263
+ this.options = options;
2251
2264
  }
2252
2265
  async send(commandType, commandData) {
2253
2266
  const envelope = this.createEnvelope(commandType, commandData);
@@ -2303,13 +2316,9 @@ class WebApiChatClient extends AbstractChatClient {
2303
2316
  }
2304
2317
  }
2305
2318
  ;// CONCATENATED MODULE: ./src/AbstractRestClient.ts
2306
- function AbstractRestClient_defineProperty(obj, key, value) { key = AbstractRestClient_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2307
- function AbstractRestClient_toPropertyKey(arg) { var key = AbstractRestClient_toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
2308
- function AbstractRestClient_toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
2309
2319
  class AbstractRestClient {
2310
2320
  constructor(options) {
2311
2321
  this.options = options;
2312
- AbstractRestClient_defineProperty(this, "defaultUrl", void 0);
2313
2322
  }
2314
2323
  async send(method, uri, data = undefined) {
2315
2324
  let url = this.getUrl(uri);