@meridianjs/framework 1.31.0 → 2.0.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.d.ts CHANGED
@@ -219,6 +219,15 @@ declare class SseManager {
219
219
  * Sends an SSE event to all connected clients in the given workspace.
220
220
  */
221
221
  broadcast(workspaceId: string, event: string, data: unknown): void;
222
+ /**
223
+ * Registers a response as an SSE client for a specific user (no workspace required).
224
+ * Uses a `user:` prefix to avoid key collisions with workspace IDs.
225
+ */
226
+ subscribeUser(userId: string, res: Response): () => void;
227
+ /**
228
+ * Sends an SSE event to all connections for a specific user.
229
+ */
230
+ broadcastToUser(userId: string, event: string, data: unknown): void;
222
231
  }
223
232
  /** Singleton shared across all routes and subscribers. */
224
233
  declare const sseManager: SseManager;
package/dist/index.js CHANGED
@@ -916,6 +916,19 @@ data: ${JSON.stringify(data)}
916
916
  }
917
917
  if (set.size === 0) this.clients.delete(workspaceId);
918
918
  }
919
+ /**
920
+ * Registers a response as an SSE client for a specific user (no workspace required).
921
+ * Uses a `user:` prefix to avoid key collisions with workspace IDs.
922
+ */
923
+ subscribeUser(userId, res) {
924
+ return this.subscribe(`user:${userId}`, res);
925
+ }
926
+ /**
927
+ * Sends an SSE event to all connections for a specific user.
928
+ */
929
+ broadcastToUser(userId, event, data) {
930
+ this.broadcast(`user:${userId}`, event, data);
931
+ }
919
932
  };
920
933
  var sseManager = new SseManager();
921
934
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meridianjs/framework",
3
- "version": "1.31.0",
3
+ "version": "2.0.0",
4
4
  "description": "Core Meridian framework: bootstrap, DI container, module/route/subscriber/job loaders",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -23,8 +23,8 @@
23
23
  "prepublishOnly": "npm run build"
24
24
  },
25
25
  "dependencies": {
26
- "@meridianjs/framework-utils": "^1.31.0",
27
- "@meridianjs/types": "^1.31.0",
26
+ "@meridianjs/framework-utils": "^2.0.0",
27
+ "@meridianjs/types": "^2.0.0",
28
28
  "awilix": "^12.0.5",
29
29
  "cookie-parser": "^1.4.7",
30
30
  "cors": "^2.8.5",