polfan-server-js-client 0.1.99928 → 0.1.99930
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 +35 -4
- package/build/index.js +30 -19
- package/build/index.js.map +1 -1
- package/build/types/AbstractChatClient.d.ts +7 -2
- package/build/types/Permissions.d.ts +8 -0
- package/build/types/WebApiChatClient.d.ts +2 -2
- package/build/types/WebSocketChatClient.d.ts +2 -2
- package/build/types/types/src/index.d.ts +8 -1
- package/build/types/types/src/schemes/BanObject.d.ts +11 -0
- package/build/types/types/src/schemes/LeaveReason.d.ts +9 -0
- package/build/types/types/src/schemes/commands/Ban.d.ts +8 -0
- package/build/types/types/src/schemes/commands/GetBans.d.ts +4 -0
- package/build/types/types/src/schemes/commands/Kick.d.ts +6 -0
- package/build/types/types/src/schemes/commands/Unban.d.ts +5 -0
- package/build/types/types/src/schemes/events/Bans.d.ts +6 -0
- package/build/types/types/src/schemes/events/Bye.d.ts +2 -1
- package/build/types/types/src/schemes/events/RoomLeft.d.ts +2 -0
- package/build/types/types/src/schemes/events/SpaceLeft.d.ts +2 -0
- package/package.json +1 -1
- package/src/AbstractChatClient.ts +8 -2
- package/src/Permissions.ts +2 -0
- package/src/WebApiChatClient.ts +7 -11
- package/src/WebSocketChatClient.ts +7 -7
- package/src/state-tracker/TopicHistoryWindow.ts +7 -1
- package/src/types/src/index.ts +14 -0
- package/src/types/src/schemes/BanObject.ts +12 -0
- package/src/types/src/schemes/LeaveReason.ts +10 -0
- package/src/types/src/schemes/commands/Ban.ts +9 -0
- package/src/types/src/schemes/commands/GetBans.ts +5 -0
- package/src/types/src/schemes/commands/Kick.ts +7 -0
- package/src/types/src/schemes/commands/Unban.ts +6 -0
- package/src/types/src/schemes/events/Bans.ts +7 -0
- package/src/types/src/schemes/events/Bye.ts +3 -1
- package/src/types/src/schemes/events/RoomLeft.ts +3 -0
- package/src/types/src/schemes/events/SpaceLeft.ts +3 -0
package/.idea/workspace.xml
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
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="
|
|
7
|
+
<list default="true" id="831dae43-0da1-47fd-a5f7-33dd5eec2992" name="Changes" comment="Bans support" />
|
|
8
8
|
<option name="SHOW_DIALOG" value="false" />
|
|
9
9
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
10
10
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
|
@@ -67,7 +67,9 @@
|
|
|
67
67
|
<updated>1737999300590</updated>
|
|
68
68
|
<workItem from="1737999301306" duration="16008000" />
|
|
69
69
|
<workItem from="1738661852731" duration="2057000" />
|
|
70
|
-
<workItem from="1738919042657" duration="
|
|
70
|
+
<workItem from="1738919042657" duration="6387000" />
|
|
71
|
+
<workItem from="1739804640466" duration="629000" />
|
|
72
|
+
<workItem from="1740063527512" duration="10170000" />
|
|
71
73
|
</task>
|
|
72
74
|
<task id="LOCAL-00001" summary="Emoticons objects">
|
|
73
75
|
<option name="closed" value="true" />
|
|
@@ -181,18 +183,47 @@
|
|
|
181
183
|
<option name="project" value="LOCAL" />
|
|
182
184
|
<updated>1739184754443</updated>
|
|
183
185
|
</task>
|
|
184
|
-
<
|
|
186
|
+
<task id="LOCAL-00015" summary="Restore support for nullable parameter in permission overwrites id function">
|
|
187
|
+
<option name="closed" value="true" />
|
|
188
|
+
<created>1739444617033</created>
|
|
189
|
+
<option name="number" value="00015" />
|
|
190
|
+
<option name="presentableId" value="LOCAL-00015" />
|
|
191
|
+
<option name="project" value="LOCAL" />
|
|
192
|
+
<updated>1739444617033</updated>
|
|
193
|
+
</task>
|
|
194
|
+
<task id="LOCAL-00016" summary="Bans support">
|
|
195
|
+
<option name="closed" value="true" />
|
|
196
|
+
<created>1740177682341</created>
|
|
197
|
+
<option name="number" value="00016" />
|
|
198
|
+
<option name="presentableId" value="LOCAL-00016" />
|
|
199
|
+
<option name="project" value="LOCAL" />
|
|
200
|
+
<updated>1740177682341</updated>
|
|
201
|
+
</task>
|
|
202
|
+
<option name="localTasksCounter" value="17" />
|
|
185
203
|
<servers />
|
|
186
204
|
</component>
|
|
187
205
|
<component name="TypeScriptGeneratedFilesManager">
|
|
188
206
|
<option name="version" value="3" />
|
|
189
207
|
</component>
|
|
208
|
+
<component name="Vcs.Log.Tabs.Properties">
|
|
209
|
+
<option name="TAB_STATES">
|
|
210
|
+
<map>
|
|
211
|
+
<entry key="MAIN">
|
|
212
|
+
<value>
|
|
213
|
+
<State />
|
|
214
|
+
</value>
|
|
215
|
+
</entry>
|
|
216
|
+
</map>
|
|
217
|
+
</option>
|
|
218
|
+
</component>
|
|
190
219
|
<component name="VcsManagerConfiguration">
|
|
191
220
|
<MESSAGE value="Emoticons objects" />
|
|
192
221
|
<MESSAGE value="Emoticons support" />
|
|
193
222
|
<MESSAGE value="Emoticon permissions support" />
|
|
194
223
|
<MESSAGE value="Permission related changes in protocol types" />
|
|
195
224
|
<MESSAGE value="ClassicText room type" />
|
|
196
|
-
<
|
|
225
|
+
<MESSAGE value="Restore support for nullable parameter in permission overwrites id function" />
|
|
226
|
+
<MESSAGE value="Bans support" />
|
|
227
|
+
<option name="LAST_COMMIT_MESSAGE" value="Bans support" />
|
|
197
228
|
</component>
|
|
198
229
|
</project>
|
package/build/index.js
CHANGED
|
@@ -1010,7 +1010,15 @@ var TopicHistoryWindow = /*#__PURE__*/function (_TraversableRemoteCol) {
|
|
|
1010
1010
|
}, {
|
|
1011
1011
|
key: "handleSession",
|
|
1012
1012
|
value: function handleSession(ev) {
|
|
1013
|
-
this
|
|
1013
|
+
var _this3 = this;
|
|
1014
|
+
var rooms = ev.state.rooms;
|
|
1015
|
+
if (rooms.find(function (room) {
|
|
1016
|
+
return room.id === _this3.roomId;
|
|
1017
|
+
})) {
|
|
1018
|
+
this.resetToLatest();
|
|
1019
|
+
} else {
|
|
1020
|
+
this.deleteAll();
|
|
1021
|
+
}
|
|
1014
1022
|
}
|
|
1015
1023
|
}, {
|
|
1016
1024
|
key: "fetchItemsAfter",
|
|
@@ -3038,6 +3046,14 @@ Permissions_defineProperty(Permissions, "list", {
|
|
|
3038
3046
|
ManageEmoticon: {
|
|
3039
3047
|
value: 1 << 14,
|
|
3040
3048
|
maxLayer: Layer.Space
|
|
3049
|
+
},
|
|
3050
|
+
ManageBan: {
|
|
3051
|
+
value: 1 << 15,
|
|
3052
|
+
maxLayer: Layer.Room
|
|
3053
|
+
},
|
|
3054
|
+
Kick: {
|
|
3055
|
+
value: 1 << 16,
|
|
3056
|
+
maxLayer: Layer.Room
|
|
3041
3057
|
}
|
|
3042
3058
|
});
|
|
3043
3059
|
;// CONCATENATED MODULE: ./src/state-tracker/PermissionsManager.ts
|
|
@@ -3943,9 +3959,6 @@ var WebSocketChatClient = /*#__PURE__*/function (_AbstractChatClient) {
|
|
|
3943
3959
|
WebSocketChatClient_defineProperty(WebSocketChatClient_assertThisInitialized(_this), "connectingTimeoutId", void 0);
|
|
3944
3960
|
WebSocketChatClient_defineProperty(WebSocketChatClient_assertThisInitialized(_this), "authenticated", void 0);
|
|
3945
3961
|
WebSocketChatClient_defineProperty(WebSocketChatClient_assertThisInitialized(_this), "authenticatedResolvers", void 0);
|
|
3946
|
-
if (!_this.options.token && !_this.options.temporaryNick) {
|
|
3947
|
-
throw new Error('Token or temporary nick is required');
|
|
3948
|
-
}
|
|
3949
3962
|
if ((_this$options$stateTr = _this.options.stateTracking) !== null && _this$options$stateTr !== void 0 ? _this$options$stateTr : true) {
|
|
3950
3963
|
_this.state = new ChatStateTracker(WebSocketChatClient_assertThisInitialized(_this));
|
|
3951
3964
|
}
|
|
@@ -3955,15 +3968,17 @@ var WebSocketChatClient = /*#__PURE__*/function (_AbstractChatClient) {
|
|
|
3955
3968
|
key: "connect",
|
|
3956
3969
|
value: function () {
|
|
3957
3970
|
var _connect = WebSocketChatClient_asyncToGenerator( /*#__PURE__*/WebSocketChatClient_regeneratorRuntime().mark(function _callee() {
|
|
3958
|
-
var
|
|
3971
|
+
var _this$options$queryPa,
|
|
3972
|
+
_this2 = this,
|
|
3959
3973
|
_this$options$connect;
|
|
3960
|
-
var
|
|
3974
|
+
var params;
|
|
3961
3975
|
return WebSocketChatClient_regeneratorRuntime().wrap(function _callee$(_context) {
|
|
3962
3976
|
while (1) {
|
|
3963
3977
|
switch (_context.prev = _context.next) {
|
|
3964
3978
|
case 0:
|
|
3965
|
-
|
|
3966
|
-
|
|
3979
|
+
params = new URLSearchParams((_this$options$queryPa = this.options.queryParams) !== null && _this$options$queryPa !== void 0 ? _this$options$queryPa : {});
|
|
3980
|
+
params.set('token', this.options.token);
|
|
3981
|
+
this.ws = new WebSocket("".concat(this.options.url, "?").concat(params));
|
|
3967
3982
|
this.ws.onclose = function (ev) {
|
|
3968
3983
|
return _this2.onClose(ev);
|
|
3969
3984
|
};
|
|
@@ -3980,7 +3995,7 @@ var WebSocketChatClient = /*#__PURE__*/function (_AbstractChatClient) {
|
|
|
3980
3995
|
}
|
|
3981
3996
|
return _this2.authenticatedResolvers = args;
|
|
3982
3997
|
}));
|
|
3983
|
-
case
|
|
3998
|
+
case 8:
|
|
3984
3999
|
case "end":
|
|
3985
4000
|
return _context.stop();
|
|
3986
4001
|
}
|
|
@@ -4144,9 +4159,6 @@ var WebApiChatClient = /*#__PURE__*/function (_AbstractChatClient) {
|
|
|
4144
4159
|
_this.options = options;
|
|
4145
4160
|
WebApiChatClient_defineProperty(WebApiChatClient_assertThisInitialized(_this), "Event", WebApiChatClientEvent);
|
|
4146
4161
|
WebApiChatClient_defineProperty(WebApiChatClient_assertThisInitialized(_this), "sendStack", void 0);
|
|
4147
|
-
if (!_this.options.token && !_this.options.temporaryNick) {
|
|
4148
|
-
throw new Error('Token or temporary nick is required');
|
|
4149
|
-
}
|
|
4150
4162
|
return _this;
|
|
4151
4163
|
}
|
|
4152
4164
|
WebApiChatClient_createClass(WebApiChatClient, [{
|
|
@@ -4239,19 +4251,18 @@ var WebApiChatClient = /*#__PURE__*/function (_AbstractChatClient) {
|
|
|
4239
4251
|
}, {
|
|
4240
4252
|
key: "makeApiCall",
|
|
4241
4253
|
value: function makeApiCall(reqId) {
|
|
4242
|
-
var
|
|
4254
|
+
var _this$options$queryPa,
|
|
4255
|
+
_this4 = this;
|
|
4243
4256
|
this.sendStack[reqId].attempts++;
|
|
4244
4257
|
var bodyJson = JSON.stringify(this.sendStack[reqId].data);
|
|
4245
4258
|
var headers = {
|
|
4246
4259
|
'Content-Type': 'application/json',
|
|
4247
4260
|
Accept: 'application/json'
|
|
4248
4261
|
};
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
}
|
|
4254
|
-
fetch(this.options.url, {
|
|
4262
|
+
headers.Authorization = "Bearer ".concat(this.options.token);
|
|
4263
|
+
var params = new URLSearchParams((_this$options$queryPa = this.options.queryParams) !== null && _this$options$queryPa !== void 0 ? _this$options$queryPa : {});
|
|
4264
|
+
var url = "".concat(this.options.url).concat(params ? '?' + params : '');
|
|
4265
|
+
fetch(url, {
|
|
4255
4266
|
headers: headers,
|
|
4256
4267
|
body: bodyJson,
|
|
4257
4268
|
method: 'POST'
|