@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.js
CHANGED
|
@@ -17078,7 +17078,6 @@ async function executeGuard(guardFn, ctx) {
|
|
|
17078
17078
|
const guardCtx = {
|
|
17079
17079
|
user: ctx.user,
|
|
17080
17080
|
req: ctx.req,
|
|
17081
|
-
socket: ctx.socket,
|
|
17082
17081
|
namespace: ctx.pathname
|
|
17083
17082
|
};
|
|
17084
17083
|
const result = await guardFn(guardCtx);
|
|
@@ -17185,9 +17184,6 @@ var generateActions = (socket, namespace, presence) => {
|
|
|
17185
17184
|
return {
|
|
17186
17185
|
emit: async (event, payload) => {
|
|
17187
17186
|
if (!presence) {
|
|
17188
|
-
console.warn(
|
|
17189
|
-
"[loly:realtime] toUser() requires presence manager. Make sure realtime is properly configured."
|
|
17190
|
-
);
|
|
17191
17187
|
return;
|
|
17192
17188
|
}
|
|
17193
17189
|
const socketIds = await presence.getSocketsForUser(userId);
|
|
@@ -17290,19 +17286,12 @@ async function setupWssEvents(options) {
|
|
|
17290
17286
|
const subClient = pubClient.duplicate();
|
|
17291
17287
|
io.adapter(createAdapter(pubClient, subClient));
|
|
17292
17288
|
} catch (error) {
|
|
17293
|
-
console.error(
|
|
17294
|
-
"[loly:realtime] Failed to setup Redis adapter:",
|
|
17295
|
-
error instanceof Error ? error.message : String(error)
|
|
17296
|
-
);
|
|
17297
17289
|
throw error;
|
|
17298
17290
|
}
|
|
17299
17291
|
}
|
|
17300
17292
|
for (const wssRoute of wssRoutes) {
|
|
17301
17293
|
const normalized = wssRoute.normalized;
|
|
17302
17294
|
if (!normalized) {
|
|
17303
|
-
console.warn(
|
|
17304
|
-
`[loly:realtime] Skipping route ${wssRoute.pattern}: No normalized route definition`
|
|
17305
|
-
);
|
|
17306
17295
|
continue;
|
|
17307
17296
|
}
|
|
17308
17297
|
let namespacePath = normalized.namespace || wssRoute.pattern.replace(/^\/wss/, "");
|
|
@@ -17313,9 +17302,7 @@ async function setupWssEvents(options) {
|
|
|
17313
17302
|
namespacePath = "/";
|
|
17314
17303
|
}
|
|
17315
17304
|
const namespace = io.of(namespacePath);
|
|
17316
|
-
console.log(`[loly:realtime] Registered namespace: ${namespacePath} (from pattern: ${wssRoute.pattern})`);
|
|
17317
17305
|
namespace.on("connection", async (socket) => {
|
|
17318
|
-
console.log(`[loly:realtime] Client connected to namespace ${namespacePath}, socket: ${socket.id}`);
|
|
17319
17306
|
const requestId = generateRequestId();
|
|
17320
17307
|
socket.requestId = requestId;
|
|
17321
17308
|
const log = createWssLogger(namespacePath, socket);
|
|
@@ -17327,8 +17314,6 @@ async function setupWssEvents(options) {
|
|
|
17327
17314
|
await presence.addSocketForUser(String(user.id), socket.id);
|
|
17328
17315
|
}
|
|
17329
17316
|
const baseCtx = {
|
|
17330
|
-
socket,
|
|
17331
|
-
io: namespace.server,
|
|
17332
17317
|
req: {
|
|
17333
17318
|
headers: socket.handshake.headers,
|
|
17334
17319
|
ip: socket.handshake.address,
|