@lolyjs/core 0.2.0-alpha.24 → 0.2.0-alpha.25
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/cli.cjs +0 -15
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +0 -15
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +0 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +1 -6
- package/dist/index.d.ts +1 -6
- package/dist/index.js +0 -15
- package/dist/index.js.map +1 -1
- package/dist/react/sockets.cjs +0 -8
- package/dist/react/sockets.cjs.map +1 -1
- package/dist/react/sockets.js +0 -8
- package/dist/react/sockets.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -17073,7 +17073,6 @@ async function executeGuard(guardFn, ctx) {
|
|
|
17073
17073
|
const guardCtx = {
|
|
17074
17074
|
user: ctx.user,
|
|
17075
17075
|
req: ctx.req,
|
|
17076
|
-
socket: ctx.socket,
|
|
17077
17076
|
namespace: ctx.pathname
|
|
17078
17077
|
};
|
|
17079
17078
|
const result = await guardFn(guardCtx);
|
|
@@ -17180,9 +17179,6 @@ var generateActions = (socket, namespace, presence) => {
|
|
|
17180
17179
|
return {
|
|
17181
17180
|
emit: async (event, payload) => {
|
|
17182
17181
|
if (!presence) {
|
|
17183
|
-
console.warn(
|
|
17184
|
-
"[loly:realtime] toUser() requires presence manager. Make sure realtime is properly configured."
|
|
17185
|
-
);
|
|
17186
17182
|
return;
|
|
17187
17183
|
}
|
|
17188
17184
|
const socketIds = await presence.getSocketsForUser(userId);
|
|
@@ -17285,19 +17281,12 @@ async function setupWssEvents(options) {
|
|
|
17285
17281
|
const subClient = pubClient.duplicate();
|
|
17286
17282
|
io.adapter(createAdapter(pubClient, subClient));
|
|
17287
17283
|
} catch (error) {
|
|
17288
|
-
console.error(
|
|
17289
|
-
"[loly:realtime] Failed to setup Redis adapter:",
|
|
17290
|
-
error instanceof Error ? error.message : String(error)
|
|
17291
|
-
);
|
|
17292
17284
|
throw error;
|
|
17293
17285
|
}
|
|
17294
17286
|
}
|
|
17295
17287
|
for (const wssRoute of wssRoutes) {
|
|
17296
17288
|
const normalized = wssRoute.normalized;
|
|
17297
17289
|
if (!normalized) {
|
|
17298
|
-
console.warn(
|
|
17299
|
-
`[loly:realtime] Skipping route ${wssRoute.pattern}: No normalized route definition`
|
|
17300
|
-
);
|
|
17301
17290
|
continue;
|
|
17302
17291
|
}
|
|
17303
17292
|
let namespacePath = normalized.namespace || wssRoute.pattern.replace(/^\/wss/, "");
|
|
@@ -17308,9 +17297,7 @@ async function setupWssEvents(options) {
|
|
|
17308
17297
|
namespacePath = "/";
|
|
17309
17298
|
}
|
|
17310
17299
|
const namespace = io.of(namespacePath);
|
|
17311
|
-
console.log(`[loly:realtime] Registered namespace: ${namespacePath} (from pattern: ${wssRoute.pattern})`);
|
|
17312
17300
|
namespace.on("connection", async (socket) => {
|
|
17313
|
-
console.log(`[loly:realtime] Client connected to namespace ${namespacePath}, socket: ${socket.id}`);
|
|
17314
17301
|
const requestId = generateRequestId();
|
|
17315
17302
|
socket.requestId = requestId;
|
|
17316
17303
|
const log = createWssLogger(namespacePath, socket);
|
|
@@ -17322,8 +17309,6 @@ async function setupWssEvents(options) {
|
|
|
17322
17309
|
await presence.addSocketForUser(String(user.id), socket.id);
|
|
17323
17310
|
}
|
|
17324
17311
|
const baseCtx = {
|
|
17325
|
-
socket,
|
|
17326
|
-
io: namespace.server,
|
|
17327
17312
|
req: {
|
|
17328
17313
|
headers: socket.handshake.headers,
|
|
17329
17314
|
ip: socket.handshake.address,
|