polfan-server-js-client 0.2.54 → 0.2.55
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 +16 -20
- package/build/index.cjs.js +22 -10
- package/build/index.cjs.js.map +1 -1
- package/build/index.umd.js +1 -1
- package/build/index.umd.js.map +1 -1
- package/build/types/IndexedObjectCollection.d.ts +4 -3
- package/package.json +1 -1
- package/src/IndexedObjectCollection.ts +26 -12
package/.idea/workspace.xml
CHANGED
|
@@ -4,15 +4,9 @@
|
|
|
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$/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/types/src/schemes/events/Session.d.ts" beforeDir="false" afterPath="$PROJECT_DIR$/build/types/types/src/schemes/events/Session.d.ts" afterDir="false" />
|
|
7
|
+
<list default="true" id="831dae43-0da1-47fd-a5f7-33dd5eec2992" name="Changes" comment="Fix websocket state error handling">
|
|
13
8
|
<change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
|
|
14
|
-
<change beforePath="$PROJECT_DIR$/src/
|
|
15
|
-
<change beforePath="$PROJECT_DIR$/src/WebSocketChatClient.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/WebSocketChatClient.ts" afterDir="false" />
|
|
9
|
+
<change beforePath="$PROJECT_DIR$/src/IndexedObjectCollection.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/IndexedObjectCollection.ts" afterDir="false" />
|
|
16
10
|
</list>
|
|
17
11
|
<option name="SHOW_DIALOG" value="false" />
|
|
18
12
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
@@ -142,15 +136,9 @@
|
|
|
142
136
|
<workItem from="1757108361675" duration="5000" />
|
|
143
137
|
<workItem from="1759771277022" duration="584000" />
|
|
144
138
|
<workItem from="1759848250548" duration="413000" />
|
|
145
|
-
<workItem from="1761857165939" duration="
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
<option name="closed" value="true" />
|
|
149
|
-
<created>1738413358814</created>
|
|
150
|
-
<option name="number" value="00011" />
|
|
151
|
-
<option name="presentableId" value="LOCAL-00011" />
|
|
152
|
-
<option name="project" value="LOCAL" />
|
|
153
|
-
<updated>1738413358814</updated>
|
|
139
|
+
<workItem from="1761857165939" duration="4293000" />
|
|
140
|
+
<workItem from="1762715993044" duration="642000" />
|
|
141
|
+
<workItem from="1762724230487" duration="4909000" />
|
|
154
142
|
</task>
|
|
155
143
|
<task id="LOCAL-00012" summary="Permission related changes in protocol types">
|
|
156
144
|
<option name="closed" value="true" />
|
|
@@ -536,7 +524,15 @@
|
|
|
536
524
|
<option name="project" value="LOCAL" />
|
|
537
525
|
<updated>1756804976724</updated>
|
|
538
526
|
</task>
|
|
539
|
-
<
|
|
527
|
+
<task id="LOCAL-00060" summary="Fix websocket state error handling">
|
|
528
|
+
<option name="closed" value="true" />
|
|
529
|
+
<created>1761861305919</created>
|
|
530
|
+
<option name="number" value="00060" />
|
|
531
|
+
<option name="presentableId" value="LOCAL-00060" />
|
|
532
|
+
<option name="project" value="LOCAL" />
|
|
533
|
+
<updated>1761861305919</updated>
|
|
534
|
+
</task>
|
|
535
|
+
<option name="localTasksCounter" value="61" />
|
|
540
536
|
<servers />
|
|
541
537
|
</component>
|
|
542
538
|
<component name="TypeScriptGeneratedFilesManager">
|
|
@@ -554,7 +550,6 @@
|
|
|
554
550
|
</option>
|
|
555
551
|
</component>
|
|
556
552
|
<component name="VcsManagerConfiguration">
|
|
557
|
-
<MESSAGE value="Private rooms and space summaries" />
|
|
558
553
|
<MESSAGE value="Custom nicks support" />
|
|
559
554
|
<MESSAGE value="CustomNickChange message type" />
|
|
560
555
|
<MESSAGE value="Fix module exporting (node + browser)" />
|
|
@@ -579,6 +574,7 @@
|
|
|
579
574
|
<MESSAGE value="Ephemeral room history support" />
|
|
580
575
|
<MESSAGE value="Protocol version support" />
|
|
581
576
|
<MESSAGE value="Update room on recipient user change" />
|
|
582
|
-
<
|
|
577
|
+
<MESSAGE value="Fix websocket state error handling" />
|
|
578
|
+
<option name="LAST_COMMIT_MESSAGE" value="Fix websocket state error handling" />
|
|
583
579
|
</component>
|
|
584
580
|
</project>
|
package/build/index.cjs.js
CHANGED
|
@@ -155,12 +155,8 @@ function IndexedObjectCollection_toPrimitive(input, hint) { if (typeof input !==
|
|
|
155
155
|
class IndexedCollection {
|
|
156
156
|
constructor(items = []) {
|
|
157
157
|
IndexedObjectCollection_defineProperty(this, "_items", new Map());
|
|
158
|
-
IndexedObjectCollection_defineProperty(this, "_mutationCounter", 0);
|
|
159
158
|
this.set(...items);
|
|
160
159
|
}
|
|
161
|
-
get mutationCounter() {
|
|
162
|
-
return this._mutationCounter;
|
|
163
|
-
}
|
|
164
160
|
get items() {
|
|
165
161
|
return this._items;
|
|
166
162
|
}
|
|
@@ -168,7 +164,6 @@ class IndexedCollection {
|
|
|
168
164
|
return this._items.size;
|
|
169
165
|
}
|
|
170
166
|
set(...items) {
|
|
171
|
-
this._mutationCounter++;
|
|
172
167
|
for (const item of items) {
|
|
173
168
|
this._items.set(item[0], item[1]);
|
|
174
169
|
}
|
|
@@ -183,11 +178,9 @@ class IndexedCollection {
|
|
|
183
178
|
for (const id of ids) {
|
|
184
179
|
this.items.delete(id);
|
|
185
180
|
}
|
|
186
|
-
this._mutationCounter++;
|
|
187
181
|
}
|
|
188
182
|
deleteAll() {
|
|
189
183
|
this.items.clear();
|
|
190
|
-
this._mutationCounter++;
|
|
191
184
|
}
|
|
192
185
|
findBy(field, valueToFind, limit = null) {
|
|
193
186
|
const result = new IndexedCollection();
|
|
@@ -202,6 +195,11 @@ class IndexedCollection {
|
|
|
202
195
|
}
|
|
203
196
|
return result;
|
|
204
197
|
}
|
|
198
|
+
shallowCopy() {
|
|
199
|
+
const copy = new IndexedCollection();
|
|
200
|
+
copy._items = this._items;
|
|
201
|
+
return copy;
|
|
202
|
+
}
|
|
205
203
|
}
|
|
206
204
|
class IndexedObjectCollection {
|
|
207
205
|
constructor(id, items = []) {
|
|
@@ -216,9 +214,6 @@ class IndexedObjectCollection {
|
|
|
216
214
|
get length() {
|
|
217
215
|
return this._items.length;
|
|
218
216
|
}
|
|
219
|
-
get mutationCounter() {
|
|
220
|
-
return this._items.mutationCounter;
|
|
221
|
-
}
|
|
222
217
|
set(...items) {
|
|
223
218
|
this._items.set(...items.map(item => [this.getId(item), item]));
|
|
224
219
|
}
|
|
@@ -249,6 +244,11 @@ class IndexedObjectCollection {
|
|
|
249
244
|
}
|
|
250
245
|
return result;
|
|
251
246
|
}
|
|
247
|
+
shallowCopy() {
|
|
248
|
+
const copy = new IndexedObjectCollection(this.id);
|
|
249
|
+
copy._items = this._items;
|
|
250
|
+
return copy;
|
|
251
|
+
}
|
|
252
252
|
getId(item) {
|
|
253
253
|
return typeof this.id === 'function' ? this.id(item) : item[this.id];
|
|
254
254
|
}
|
|
@@ -285,6 +285,12 @@ class ObservableIndexedCollection extends IndexedCollection {
|
|
|
285
285
|
});
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
|
+
shallowCopy() {
|
|
289
|
+
const copy = new ObservableIndexedCollection();
|
|
290
|
+
copy.eventTarget = this.eventTarget;
|
|
291
|
+
copy._items = this._items;
|
|
292
|
+
return copy;
|
|
293
|
+
}
|
|
288
294
|
on(eventName, handler) {
|
|
289
295
|
this.eventTarget.on(eventName, handler);
|
|
290
296
|
return this;
|
|
@@ -331,6 +337,12 @@ class ObservableIndexedObjectCollection extends IndexedObjectCollection {
|
|
|
331
337
|
});
|
|
332
338
|
}
|
|
333
339
|
}
|
|
340
|
+
shallowCopy() {
|
|
341
|
+
const copy = new ObservableIndexedObjectCollection(this.id);
|
|
342
|
+
copy.eventTarget = this.eventTarget;
|
|
343
|
+
copy._items = this._items;
|
|
344
|
+
return copy;
|
|
345
|
+
}
|
|
334
346
|
on(eventName, handler) {
|
|
335
347
|
this.eventTarget.on(eventName, handler);
|
|
336
348
|
return this;
|