@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/index.cjs
CHANGED
|
@@ -16662,7 +16662,6 @@ async function executeGuard(guardFn, ctx) {
|
|
|
16662
16662
|
const guardCtx = {
|
|
16663
16663
|
user: ctx.user,
|
|
16664
16664
|
req: ctx.req,
|
|
16665
|
-
socket: ctx.socket,
|
|
16666
16665
|
namespace: ctx.pathname
|
|
16667
16666
|
};
|
|
16668
16667
|
const result = await guardFn(guardCtx);
|
|
@@ -16769,9 +16768,6 @@ var generateActions = (socket, namespace, presence) => {
|
|
|
16769
16768
|
return {
|
|
16770
16769
|
emit: async (event, payload) => {
|
|
16771
16770
|
if (!presence) {
|
|
16772
|
-
console.warn(
|
|
16773
|
-
"[loly:realtime] toUser() requires presence manager. Make sure realtime is properly configured."
|
|
16774
|
-
);
|
|
16775
16771
|
return;
|
|
16776
16772
|
}
|
|
16777
16773
|
const socketIds = await presence.getSocketsForUser(userId);
|
|
@@ -16874,19 +16870,12 @@ async function setupWssEvents(options) {
|
|
|
16874
16870
|
const subClient = pubClient.duplicate();
|
|
16875
16871
|
io.adapter(createAdapter(pubClient, subClient));
|
|
16876
16872
|
} catch (error) {
|
|
16877
|
-
console.error(
|
|
16878
|
-
"[loly:realtime] Failed to setup Redis adapter:",
|
|
16879
|
-
error instanceof Error ? error.message : String(error)
|
|
16880
|
-
);
|
|
16881
16873
|
throw error;
|
|
16882
16874
|
}
|
|
16883
16875
|
}
|
|
16884
16876
|
for (const wssRoute of wssRoutes) {
|
|
16885
16877
|
const normalized = wssRoute.normalized;
|
|
16886
16878
|
if (!normalized) {
|
|
16887
|
-
console.warn(
|
|
16888
|
-
`[loly:realtime] Skipping route ${wssRoute.pattern}: No normalized route definition`
|
|
16889
|
-
);
|
|
16890
16879
|
continue;
|
|
16891
16880
|
}
|
|
16892
16881
|
let namespacePath = normalized.namespace || wssRoute.pattern.replace(/^\/wss/, "");
|
|
@@ -16897,9 +16886,7 @@ async function setupWssEvents(options) {
|
|
|
16897
16886
|
namespacePath = "/";
|
|
16898
16887
|
}
|
|
16899
16888
|
const namespace = io.of(namespacePath);
|
|
16900
|
-
console.log(`[loly:realtime] Registered namespace: ${namespacePath} (from pattern: ${wssRoute.pattern})`);
|
|
16901
16889
|
namespace.on("connection", async (socket) => {
|
|
16902
|
-
console.log(`[loly:realtime] Client connected to namespace ${namespacePath}, socket: ${socket.id}`);
|
|
16903
16890
|
const requestId = generateRequestId();
|
|
16904
16891
|
socket.requestId = requestId;
|
|
16905
16892
|
const log = createWssLogger(namespacePath, socket);
|
|
@@ -16911,8 +16898,6 @@ async function setupWssEvents(options) {
|
|
|
16911
16898
|
await presence.addSocketForUser(String(user.id), socket.id);
|
|
16912
16899
|
}
|
|
16913
16900
|
const baseCtx = {
|
|
16914
|
-
socket,
|
|
16915
|
-
io: namespace.server,
|
|
16916
16901
|
req: {
|
|
16917
16902
|
headers: socket.handshake.headers,
|
|
16918
16903
|
ip: socket.handshake.address,
|