chore: Upgrade socket.io (#3697)

* Upgrade wip

* tsc

* tsc

* fix: Missing authenticated message
This commit is contained in:
Tom Moor
2022-07-16 14:02:03 +01:00
committed by GitHub
parent 96d1c4997b
commit de18196fd8
7 changed files with 164 additions and 321 deletions

View File

@@ -6,8 +6,6 @@ declare module "styled-components-breakpoint";
declare module "formidable/lib/file";
declare module "socket.io-client";
declare module "oy-vey";
declare module "fetch-test-server";

View File

@@ -1,28 +0,0 @@
declare module "socketio-auth" {
import IO from "socket.io";
type AuthenticatedSocket = IO.Socket & {
client: IO.Client & {
user: any;
};
};
type AuthenticateCallback = (
socket: AuthenticatedSocket,
data: { token: string },
callback: (err: Error | null, allow: boolean) => void
) => Promise<void>;
type PostAuthenticateCallback = (
socket: AuthenticatedSocket
) => Promise<void>;
type AuthenticationConfig = {
authenticate: AuthenticateCallback;
postAuthenticate: PostAuthenticateCallback;
};
const SocketAuth: (io: IO.Server, config: AuthenticationConfig) => void;
export = SocketAuth;
}

View File

@@ -1,12 +0,0 @@
declare module "socket.io-redis" {
import { Redis } from "ioredis";
type Config = {
pubClient: Redis;
subClient: Redis;
};
const socketRedisAdapter: (config: Config) => void;
export = socketRedisAdapter;
}