playsocketjs 2.5.1 → 2.5.2

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/README.md CHANGED
@@ -143,7 +143,7 @@ Here are usage examples for a standalone server and an Express.js application.
143
143
  ```javascript
144
144
  import PlaySocketServer from 'playsocketjs/server'; // Both ES Module & CommonJS Module syntax is supported
145
145
 
146
- const server = new PlaySocketServer(); // Create and start the server (default path is /socket)
146
+ const server = new PlaySocketServer(); // Create and start the server (default path is /)
147
147
 
148
148
  // Gracefully disconnect all clients and close the server (optional)
149
149
  function shutdown() {
@@ -2110,6 +2110,7 @@ class PlaySocket {
2110
2110
  * @param {object} options - Connection options
2111
2111
  * @param {string} options.endpoint - WebSocket endpoint path
2112
2112
  * @param {object} [options.customData] - Custom registration data
2113
+ * @param {boolean} [options.debug=false] - Enable debug logging
2113
2114
  */
2114
2115
  constructor(id, options = {}) {
2115
2116
  this.#id = id;
@@ -2488,7 +2489,7 @@ class PlaySocket {
2488
2489
  /**
2489
2490
  * Update a value in the shared storage
2490
2491
  * @param {string} key - Storage key
2491
- * @param {string} type - Operation type: add, add-unique, remove-matching, update-matching
2492
+ * @param {'set' | 'array-add' | 'array-add-unique' | 'array-remove-matching' | 'array-update-matching'} type - Operation type
2492
2493
  * @param {*} value - New value or value to operate on
2493
2494
  * @param {*} updateValue - New value for update-matching
2494
2495
  */
@@ -2110,7 +2110,9 @@ class PlaySocketServer {
2110
2110
  * @param {Object} options - Server configuration options
2111
2111
  * @param {HttpServer} [options.server] - Existing http server
2112
2112
  * @param {number} [options.port=3000] - Port to listen on (if no server provided)
2113
- * @param {string} [options.path='/socket'] - WebSocket endpoint path
2113
+ * @param {string} [options.path='/'] - WebSocket endpoint path
2114
+ * @param {boolean} [options.debug=false] - Enable debug logging
2115
+ * @param {number} [options.rateLimit=20] - Maximum number of operations per second per client
2114
2116
  */
2115
2117
  constructor(options = {}) {
2116
2118
  const { server, port = 3000, path = '/', debug = false, rateLimit = 20 } = options;
@@ -2617,7 +2619,7 @@ class PlaySocketServer {
2617
2619
  * Update a value in a room's storage
2618
2620
  * @param {string} roomId - Room ID
2619
2621
  * @param {string} key - Storage key
2620
- * @param {string} type - Operation type
2622
+ * @param {'set' | 'array-add' | 'array-add-unique' | 'array-remove-matching' | 'array-update-matching'} type - Operation type
2621
2623
  * @param {*} value - New value or value to operate on
2622
2624
  * @param {*} updateValue - New value for update-matching
2623
2625
  */
@@ -2089,7 +2089,9 @@ class PlaySocketServer {
2089
2089
  * @param {Object} options - Server configuration options
2090
2090
  * @param {HttpServer} [options.server] - Existing http server
2091
2091
  * @param {number} [options.port=3000] - Port to listen on (if no server provided)
2092
- * @param {string} [options.path='/socket'] - WebSocket endpoint path
2092
+ * @param {string} [options.path='/'] - WebSocket endpoint path
2093
+ * @param {boolean} [options.debug=false] - Enable debug logging
2094
+ * @param {number} [options.rateLimit=20] - Maximum number of operations per second per client
2093
2095
  */
2094
2096
  constructor(options = {}) {
2095
2097
  const { server, port = 3000, path = '/', debug = false, rateLimit = 20 } = options;
@@ -2596,7 +2598,7 @@ class PlaySocketServer {
2596
2598
  * Update a value in a room's storage
2597
2599
  * @param {string} roomId - Room ID
2598
2600
  * @param {string} key - Storage key
2599
- * @param {string} type - Operation type
2601
+ * @param {'set' | 'array-add' | 'array-add-unique' | 'array-remove-matching' | 'array-update-matching'} type - Operation type
2600
2602
  * @param {*} value - New value or value to operate on
2601
2603
  * @param {*} updateValue - New value for update-matching
2602
2604
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playsocketjs",
3
- "version": "2.5.1",
3
+ "version": "2.5.2",
4
4
  "description": "WebSocket wrapper for creating simple multiplayer systems with ease.",
5
5
  "type": "module",
6
6
  "module": "dist/playsocket-client.js",