@signe/room 2.8.3 → 2.9.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/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+ # @signe/room
2
+
3
+ ## 2.9.2
4
+
5
+ ### Patch Changes
6
+
7
+ - e9907e0: Harden public package usage with clearer package metadata, reliable typechecking, safer sync client listener removal, stronger room request routing, and aligned load behavior for typed collections.
8
+ - Updated dependencies [e9907e0]
9
+ - @signe/sync@2.9.2
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Samuel Ronce
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.d.ts CHANGED
@@ -175,6 +175,11 @@ type ServerOptions = {
175
175
  type GuardFn = (sender: Connection, value: any | Request$1, room: Room$1) => boolean | Promise<boolean | Response>;
176
176
  type RoomGuardFn = (conn: Connection, ctx: ConnectionContext, room: Room$1) => boolean | Promise<boolean | Response>;
177
177
  declare function Action(name: string, bodyValidation?: z.ZodSchema): (target: any, propertyKey: string) => void;
178
+ /**
179
+ * Fallback decorator for handling websocket messages whose action
180
+ * does not match any registered @Action decorator.
181
+ */
182
+ declare function UnhandledAction(): (target: any, propertyKey: string) => void;
178
183
  /**
179
184
  * Request decorator for handling HTTP requests with path and method routing
180
185
  * @param options Configuration for the HTTP request handler
@@ -523,6 +528,8 @@ declare class Server implements Server$1 {
523
528
  * @returns {Object} An object containing the path parameters
524
529
  */
525
530
  private extractPathParams;
531
+ private normalizeRequestPath;
532
+ private pathPatternToRegex;
526
533
  /**
527
534
  * @method handleShardRequest
528
535
  * @private
@@ -861,7 +868,7 @@ declare class WorldRoom implements RoomInterceptorPacket, RoomOnJoin {
861
868
  onJoin(user: any, conn: Connection, ctx: ConnectionContext): Promise<void>;
862
869
  interceptorPacket(_: any, obj: any, conn: Connection): any;
863
870
  private cleanupInactiveShards;
864
- registerRoom(req: Request$1): Promise<void>;
871
+ registerRoom(req: Request$1, res?: ServerResponse): Promise<Response>;
865
872
  updateShardStats(req: Request$1, res: ServerResponse): Promise<Response>;
866
873
  scaleRoom(req: Request$1, res: ServerResponse): Promise<Response>;
867
874
  connect(req: Request$1, res: ServerResponse): Promise<Response>;
@@ -922,4 +929,4 @@ declare function createRequireSessionGuard(storage: Storage$1): (sender: Connect
922
929
  */
923
930
  declare const requireSession: (sender: Connection, value: any, room: Room$1) => Promise<boolean>;
924
931
 
925
- export { Action, ClientIo, Guard, MockConnection, Request, type RequestOptions, Room, RoomGuard, type RoomInterceptorPacket, type RoomMethods, type RoomOnJoin, type RoomOnLeave, type RoomOptions, Server, ServerIo, ServerResponse, Shard, type ShardOptions, WorldRoom, createRequireSessionGuard, request, requireSession, testRoom, tick };
932
+ export { Action, ClientIo, Guard, MockConnection, Request, type RequestOptions, Room, RoomGuard, type RoomInterceptorPacket, type RoomMethods, type RoomOnJoin, type RoomOnLeave, type RoomOptions, Server, ServerIo, ServerResponse, Shard, type ShardOptions, UnhandledAction, WorldRoom, createRequireSessionGuard, request, requireSession, testRoom, tick };