@xwiki/cristal-realtime 1.4.0-1 → 1.5.0
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/dist/index.cjs +85 -27
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -258,9 +258,9 @@ var require_async_lock = __commonJS({
|
|
|
258
258
|
}
|
|
259
259
|
});
|
|
260
260
|
|
|
261
|
-
// ../node_modules/.pnpm/ws@8.
|
|
261
|
+
// ../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/constants.js
|
|
262
262
|
var require_constants = __commonJS({
|
|
263
|
-
"../node_modules/.pnpm/ws@8.
|
|
263
|
+
"../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/constants.js"(exports3, module3) {
|
|
264
264
|
"use strict";
|
|
265
265
|
var BINARY_TYPES = ["nodebuffer", "arraybuffer", "fragments"];
|
|
266
266
|
var hasBlob = typeof Blob !== "undefined";
|
|
@@ -281,9 +281,9 @@ var require_constants = __commonJS({
|
|
|
281
281
|
}
|
|
282
282
|
});
|
|
283
283
|
|
|
284
|
-
// ../node_modules/.pnpm/ws@8.
|
|
284
|
+
// ../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/buffer-util.js
|
|
285
285
|
var require_buffer_util = __commonJS({
|
|
286
|
-
"../node_modules/.pnpm/ws@8.
|
|
286
|
+
"../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/buffer-util.js"(exports3, module3) {
|
|
287
287
|
"use strict";
|
|
288
288
|
var { EMPTY_BUFFER } = require_constants();
|
|
289
289
|
var FastBuffer = Buffer[Symbol.species];
|
|
@@ -356,9 +356,9 @@ var require_buffer_util = __commonJS({
|
|
|
356
356
|
}
|
|
357
357
|
});
|
|
358
358
|
|
|
359
|
-
// ../node_modules/.pnpm/ws@8.
|
|
359
|
+
// ../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/limiter.js
|
|
360
360
|
var require_limiter = __commonJS({
|
|
361
|
-
"../node_modules/.pnpm/ws@8.
|
|
361
|
+
"../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/limiter.js"(exports3, module3) {
|
|
362
362
|
"use strict";
|
|
363
363
|
var kDone = /* @__PURE__ */ Symbol("kDone");
|
|
364
364
|
var kRun = /* @__PURE__ */ Symbol("kRun");
|
|
@@ -406,9 +406,9 @@ var require_limiter = __commonJS({
|
|
|
406
406
|
}
|
|
407
407
|
});
|
|
408
408
|
|
|
409
|
-
// ../node_modules/.pnpm/ws@8.
|
|
409
|
+
// ../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/permessage-deflate.js
|
|
410
410
|
var require_permessage_deflate = __commonJS({
|
|
411
|
-
"../node_modules/.pnpm/ws@8.
|
|
411
|
+
"../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/permessage-deflate.js"(exports3, module3) {
|
|
412
412
|
"use strict";
|
|
413
413
|
var zlib = require("zlib");
|
|
414
414
|
var bufferUtil = require_buffer_util();
|
|
@@ -789,9 +789,9 @@ var require_permessage_deflate = __commonJS({
|
|
|
789
789
|
}
|
|
790
790
|
});
|
|
791
791
|
|
|
792
|
-
// ../node_modules/.pnpm/ws@8.
|
|
792
|
+
// ../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/validation.js
|
|
793
793
|
var require_validation = __commonJS({
|
|
794
|
-
"../node_modules/.pnpm/ws@8.
|
|
794
|
+
"../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/validation.js"(exports3, module3) {
|
|
795
795
|
"use strict";
|
|
796
796
|
var { isUtf8 } = require("buffer");
|
|
797
797
|
var { hasBlob } = require_constants();
|
|
@@ -990,9 +990,9 @@ var require_validation = __commonJS({
|
|
|
990
990
|
}
|
|
991
991
|
});
|
|
992
992
|
|
|
993
|
-
// ../node_modules/.pnpm/ws@8.
|
|
993
|
+
// ../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/receiver.js
|
|
994
994
|
var require_receiver = __commonJS({
|
|
995
|
-
"../node_modules/.pnpm/ws@8.
|
|
995
|
+
"../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/receiver.js"(exports3, module3) {
|
|
996
996
|
"use strict";
|
|
997
997
|
var { Writable } = require("stream");
|
|
998
998
|
var PerMessageDeflate2 = require_permessage_deflate();
|
|
@@ -1025,6 +1025,10 @@ var require_receiver = __commonJS({
|
|
|
1025
1025
|
* extensions
|
|
1026
1026
|
* @param {Boolean} [options.isServer=false] Specifies whether to operate in
|
|
1027
1027
|
* client or server mode
|
|
1028
|
+
* @param {Number} [options.maxBufferedChunks=0] The maximum number of
|
|
1029
|
+
* buffered data chunks
|
|
1030
|
+
* @param {Number} [options.maxFragments=0] The maximum number of message
|
|
1031
|
+
* fragments
|
|
1028
1032
|
* @param {Number} [options.maxPayload=0] The maximum allowed message length
|
|
1029
1033
|
* @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
|
|
1030
1034
|
* not to skip UTF-8 validation for text and close messages
|
|
@@ -1035,6 +1039,8 @@ var require_receiver = __commonJS({
|
|
|
1035
1039
|
this._binaryType = options.binaryType || BINARY_TYPES[0];
|
|
1036
1040
|
this._extensions = options.extensions || {};
|
|
1037
1041
|
this._isServer = !!options.isServer;
|
|
1042
|
+
this._maxBufferedChunks = options.maxBufferedChunks | 0;
|
|
1043
|
+
this._maxFragments = options.maxFragments | 0;
|
|
1038
1044
|
this._maxPayload = options.maxPayload | 0;
|
|
1039
1045
|
this._skipUTF8Validation = !!options.skipUTF8Validation;
|
|
1040
1046
|
this[kWebSocket] = void 0;
|
|
@@ -1064,6 +1070,18 @@ var require_receiver = __commonJS({
|
|
|
1064
1070
|
*/
|
|
1065
1071
|
_write(chunk, encoding, cb) {
|
|
1066
1072
|
if (this._opcode === 8 && this._state == GET_INFO) return cb();
|
|
1073
|
+
if (this._maxBufferedChunks > 0 && this._buffers.length >= this._maxBufferedChunks) {
|
|
1074
|
+
cb(
|
|
1075
|
+
this.createError(
|
|
1076
|
+
RangeError,
|
|
1077
|
+
"Too many buffered chunks",
|
|
1078
|
+
false,
|
|
1079
|
+
1008,
|
|
1080
|
+
"WS_ERR_TOO_MANY_BUFFERED_PARTS"
|
|
1081
|
+
)
|
|
1082
|
+
);
|
|
1083
|
+
return;
|
|
1084
|
+
}
|
|
1067
1085
|
this._bufferedBytes += chunk.length;
|
|
1068
1086
|
this._buffers.push(chunk);
|
|
1069
1087
|
this.startLoop(cb);
|
|
@@ -1393,6 +1411,17 @@ var require_receiver = __commonJS({
|
|
|
1393
1411
|
return;
|
|
1394
1412
|
}
|
|
1395
1413
|
if (data.length) {
|
|
1414
|
+
if (this._maxFragments > 0 && this._fragments.length >= this._maxFragments) {
|
|
1415
|
+
const error = this.createError(
|
|
1416
|
+
RangeError,
|
|
1417
|
+
"Too many message fragments",
|
|
1418
|
+
false,
|
|
1419
|
+
1008,
|
|
1420
|
+
"WS_ERR_TOO_MANY_BUFFERED_PARTS"
|
|
1421
|
+
);
|
|
1422
|
+
cb(error);
|
|
1423
|
+
return;
|
|
1424
|
+
}
|
|
1396
1425
|
this._messageLength = this._totalPayloadLength;
|
|
1397
1426
|
this._fragments.push(data);
|
|
1398
1427
|
}
|
|
@@ -1422,6 +1451,17 @@ var require_receiver = __commonJS({
|
|
|
1422
1451
|
cb(error);
|
|
1423
1452
|
return;
|
|
1424
1453
|
}
|
|
1454
|
+
if (this._maxFragments > 0 && this._fragments.length >= this._maxFragments) {
|
|
1455
|
+
const error = this.createError(
|
|
1456
|
+
RangeError,
|
|
1457
|
+
"Too many message fragments",
|
|
1458
|
+
false,
|
|
1459
|
+
1008,
|
|
1460
|
+
"WS_ERR_TOO_MANY_BUFFERED_PARTS"
|
|
1461
|
+
);
|
|
1462
|
+
cb(error);
|
|
1463
|
+
return;
|
|
1464
|
+
}
|
|
1425
1465
|
this._fragments.push(buf);
|
|
1426
1466
|
}
|
|
1427
1467
|
this.dataMessage(cb);
|
|
@@ -1582,9 +1622,9 @@ var require_receiver = __commonJS({
|
|
|
1582
1622
|
}
|
|
1583
1623
|
});
|
|
1584
1624
|
|
|
1585
|
-
// ../node_modules/.pnpm/ws@8.
|
|
1625
|
+
// ../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/sender.js
|
|
1586
1626
|
var require_sender = __commonJS({
|
|
1587
|
-
"../node_modules/.pnpm/ws@8.
|
|
1627
|
+
"../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/sender.js"(exports3, module3) {
|
|
1588
1628
|
"use strict";
|
|
1589
1629
|
var { Duplex } = require("stream");
|
|
1590
1630
|
var { randomFillSync: randomFillSync2 } = require("crypto");
|
|
@@ -2075,9 +2115,9 @@ var require_sender = __commonJS({
|
|
|
2075
2115
|
}
|
|
2076
2116
|
});
|
|
2077
2117
|
|
|
2078
|
-
// ../node_modules/.pnpm/ws@8.
|
|
2118
|
+
// ../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/event-target.js
|
|
2079
2119
|
var require_event_target = __commonJS({
|
|
2080
|
-
"../node_modules/.pnpm/ws@8.
|
|
2120
|
+
"../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/event-target.js"(exports3, module3) {
|
|
2081
2121
|
"use strict";
|
|
2082
2122
|
var { kForOnEventAttribute, kListener } = require_constants();
|
|
2083
2123
|
var kCode = /* @__PURE__ */ Symbol("kCode");
|
|
@@ -2304,9 +2344,9 @@ var require_event_target = __commonJS({
|
|
|
2304
2344
|
}
|
|
2305
2345
|
});
|
|
2306
2346
|
|
|
2307
|
-
// ../node_modules/.pnpm/ws@8.
|
|
2347
|
+
// ../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/extension.js
|
|
2308
2348
|
var require_extension = __commonJS({
|
|
2309
|
-
"../node_modules/.pnpm/ws@8.
|
|
2349
|
+
"../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/extension.js"(exports3, module3) {
|
|
2310
2350
|
"use strict";
|
|
2311
2351
|
var { tokenChars } = require_validation();
|
|
2312
2352
|
function push(dest, name2, elem) {
|
|
@@ -2457,9 +2497,9 @@ var require_extension = __commonJS({
|
|
|
2457
2497
|
}
|
|
2458
2498
|
});
|
|
2459
2499
|
|
|
2460
|
-
// ../node_modules/.pnpm/ws@8.
|
|
2500
|
+
// ../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/websocket.js
|
|
2461
2501
|
var require_websocket = __commonJS({
|
|
2462
|
-
"../node_modules/.pnpm/ws@8.
|
|
2502
|
+
"../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/websocket.js"(exports3, module3) {
|
|
2463
2503
|
"use strict";
|
|
2464
2504
|
var EventEmitter = require("events");
|
|
2465
2505
|
var https = require("https");
|
|
@@ -2628,6 +2668,10 @@ var require_websocket = __commonJS({
|
|
|
2628
2668
|
* multiple times in the same tick
|
|
2629
2669
|
* @param {Function} [options.generateMask] The function used to generate the
|
|
2630
2670
|
* masking key
|
|
2671
|
+
* @param {Number} [options.maxBufferedChunks=0] The maximum number of
|
|
2672
|
+
* buffered data chunks
|
|
2673
|
+
* @param {Number} [options.maxFragments=0] The maximum number of message
|
|
2674
|
+
* fragments
|
|
2631
2675
|
* @param {Number} [options.maxPayload=0] The maximum allowed message size
|
|
2632
2676
|
* @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
|
|
2633
2677
|
* not to skip UTF-8 validation for text and close messages
|
|
@@ -2639,6 +2683,8 @@ var require_websocket = __commonJS({
|
|
|
2639
2683
|
binaryType: this.binaryType,
|
|
2640
2684
|
extensions: this._extensions,
|
|
2641
2685
|
isServer: this._isServer,
|
|
2686
|
+
maxBufferedChunks: options.maxBufferedChunks,
|
|
2687
|
+
maxFragments: options.maxFragments,
|
|
2642
2688
|
maxPayload: options.maxPayload,
|
|
2643
2689
|
skipUTF8Validation: options.skipUTF8Validation
|
|
2644
2690
|
});
|
|
@@ -2938,6 +2984,8 @@ var require_websocket = __commonJS({
|
|
|
2938
2984
|
autoPong: true,
|
|
2939
2985
|
closeTimeout: CLOSE_TIMEOUT,
|
|
2940
2986
|
protocolVersion: protocolVersions[1],
|
|
2987
|
+
maxBufferedChunks: 1024 * 1024,
|
|
2988
|
+
maxFragments: 128 * 1024,
|
|
2941
2989
|
maxPayload: 100 * 1024 * 1024,
|
|
2942
2990
|
skipUTF8Validation: false,
|
|
2943
2991
|
perMessageDeflate: true,
|
|
@@ -3180,6 +3228,8 @@ var require_websocket = __commonJS({
|
|
|
3180
3228
|
websocket.setSocket(socket, head, {
|
|
3181
3229
|
allowSynchronousEvents: opts.allowSynchronousEvents,
|
|
3182
3230
|
generateMask: opts.generateMask,
|
|
3231
|
+
maxBufferedChunks: opts.maxBufferedChunks,
|
|
3232
|
+
maxFragments: opts.maxFragments,
|
|
3183
3233
|
maxPayload: opts.maxPayload,
|
|
3184
3234
|
skipUTF8Validation: opts.skipUTF8Validation
|
|
3185
3235
|
});
|
|
@@ -3343,9 +3393,9 @@ var require_websocket = __commonJS({
|
|
|
3343
3393
|
}
|
|
3344
3394
|
});
|
|
3345
3395
|
|
|
3346
|
-
// ../node_modules/.pnpm/ws@8.
|
|
3396
|
+
// ../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/stream.js
|
|
3347
3397
|
var require_stream = __commonJS({
|
|
3348
|
-
"../node_modules/.pnpm/ws@8.
|
|
3398
|
+
"../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/stream.js"(exports3, module3) {
|
|
3349
3399
|
"use strict";
|
|
3350
3400
|
var WebSocket2 = require_websocket();
|
|
3351
3401
|
var { Duplex } = require("stream");
|
|
@@ -3441,9 +3491,9 @@ var require_stream = __commonJS({
|
|
|
3441
3491
|
}
|
|
3442
3492
|
});
|
|
3443
3493
|
|
|
3444
|
-
// ../node_modules/.pnpm/ws@8.
|
|
3494
|
+
// ../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/subprotocol.js
|
|
3445
3495
|
var require_subprotocol = __commonJS({
|
|
3446
|
-
"../node_modules/.pnpm/ws@8.
|
|
3496
|
+
"../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/subprotocol.js"(exports3, module3) {
|
|
3447
3497
|
"use strict";
|
|
3448
3498
|
var { tokenChars } = require_validation();
|
|
3449
3499
|
function parse(header) {
|
|
@@ -3486,9 +3536,9 @@ var require_subprotocol = __commonJS({
|
|
|
3486
3536
|
}
|
|
3487
3537
|
});
|
|
3488
3538
|
|
|
3489
|
-
// ../node_modules/.pnpm/ws@8.
|
|
3539
|
+
// ../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/websocket-server.js
|
|
3490
3540
|
var require_websocket_server = __commonJS({
|
|
3491
|
-
"../node_modules/.pnpm/ws@8.
|
|
3541
|
+
"../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/websocket-server.js"(exports3, module3) {
|
|
3492
3542
|
"use strict";
|
|
3493
3543
|
var EventEmitter = require("events");
|
|
3494
3544
|
var http = require("http");
|
|
@@ -3522,6 +3572,10 @@ var require_websocket_server = __commonJS({
|
|
|
3522
3572
|
* called
|
|
3523
3573
|
* @param {Function} [options.handleProtocols] A hook to handle protocols
|
|
3524
3574
|
* @param {String} [options.host] The hostname where to bind the server
|
|
3575
|
+
* @param {Number} [options.maxBufferedChunks=1048576] The maximum number of
|
|
3576
|
+
* buffered data chunks
|
|
3577
|
+
* @param {Number} [options.maxFragments=131072] The maximum number of message
|
|
3578
|
+
* fragments
|
|
3525
3579
|
* @param {Number} [options.maxPayload=104857600] The maximum allowed message
|
|
3526
3580
|
* size
|
|
3527
3581
|
* @param {Boolean} [options.noServer=false] Enable no server mode
|
|
@@ -3543,6 +3597,8 @@ var require_websocket_server = __commonJS({
|
|
|
3543
3597
|
options = {
|
|
3544
3598
|
allowSynchronousEvents: true,
|
|
3545
3599
|
autoPong: true,
|
|
3600
|
+
maxBufferedChunks: 1024 * 1024,
|
|
3601
|
+
maxFragments: 128 * 1024,
|
|
3546
3602
|
maxPayload: 100 * 1024 * 1024,
|
|
3547
3603
|
skipUTF8Validation: false,
|
|
3548
3604
|
perMessageDeflate: false,
|
|
@@ -3822,6 +3878,8 @@ var require_websocket_server = __commonJS({
|
|
|
3822
3878
|
socket.removeListener("error", socketOnError);
|
|
3823
3879
|
ws.setSocket(socket, head, {
|
|
3824
3880
|
allowSynchronousEvents: this.options.allowSynchronousEvents,
|
|
3881
|
+
maxBufferedChunks: this.options.maxBufferedChunks,
|
|
3882
|
+
maxFragments: this.options.maxFragments,
|
|
3825
3883
|
maxPayload: this.options.maxPayload,
|
|
3826
3884
|
skipUTF8Validation: this.options.skipUTF8Validation
|
|
3827
3885
|
});
|
|
@@ -38576,7 +38634,7 @@ var v4_default = v4;
|
|
|
38576
38634
|
// ../node_modules/.pnpm/@hocuspocus+server@2.15.3_y-protocols@1.0.7_yjs@13.6.30__yjs@13.6.30/node_modules/@hocuspocus/server/dist/hocuspocus-server.esm.js
|
|
38577
38635
|
var import_http = require("http");
|
|
38578
38636
|
|
|
38579
|
-
// ../node_modules/.pnpm/ws@8.
|
|
38637
|
+
// ../node_modules/.pnpm/ws@8.21.0/node_modules/ws/wrapper.mjs
|
|
38580
38638
|
var import_stream = __toESM(require_stream(), 1);
|
|
38581
38639
|
var import_extension = __toESM(require_extension(), 1);
|
|
38582
38640
|
var import_permessage_deflate = __toESM(require_permessage_deflate(), 1);
|