From 35cb1bbad56b4998956a3d495f9da5dee9293e51 Mon Sep 17 00:00:00 2001 From: prostgles Date: Sat, 21 Dec 2024 20:03:31 +0200 Subject: [PATCH] fix getClientRequestIPsInfo types --- lib/Auth/AuthHandler.ts | 1 - lib/Auth/utils/getClientRequestIPsInfo.ts | 10 ++++++---- package-lock.json | 4 ++-- package.json | 2 +- tests/server/package-lock.json | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/Auth/AuthHandler.ts b/lib/Auth/AuthHandler.ts index 4d8bd3b7..8fb717cd 100644 --- a/lib/Auth/AuthHandler.ts +++ b/lib/Auth/AuthHandler.ts @@ -13,7 +13,6 @@ import { DB, DBHandlerServer, Prostgles } from "../Prostgles"; import { Auth, AuthClientRequest, - AuthResult, AuthResultOrError, AuthResultWithSID, BasicSession, diff --git a/lib/Auth/utils/getClientRequestIPsInfo.ts b/lib/Auth/utils/getClientRequestIPsInfo.ts index 7b6ae655..97a837fa 100644 --- a/lib/Auth/utils/getClientRequestIPsInfo.ts +++ b/lib/Auth/utils/getClientRequestIPsInfo.ts @@ -1,7 +1,9 @@ -import { AuthClientRequest, LoginClientInfo } from "../AuthTypes"; -export const getClientRequestIPsInfo = ( - req: T -): T & LoginClientInfo => { +import { PRGLIOSocket } from "../../DboBuilder/DboBuilderTypes"; +import { ExpressReq, LoginClientInfo } from "../AuthTypes"; +type ClientReq = + | { socket: PRGLIOSocket; httpReq?: undefined } + | { httpReq: ExpressReq; socket?: undefined }; +export const getClientRequestIPsInfo = (req: T): T & LoginClientInfo => { if (req.httpReq) { const ip_address = req.httpReq.ip; if (!ip_address) throw new Error("ip_address missing from req.httpReq"); diff --git a/package-lock.json b/package-lock.json index 2a246a86..7ee46166 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "prostgles-server", - "version": "4.2.193", + "version": "4.2.194", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "prostgles-server", - "version": "4.2.193", + "version": "4.2.194", "license": "MIT", "dependencies": { "@aws-sdk/client-ses": "^3.699.0", diff --git a/package.json b/package.json index 1c3ee33e..1fa4d89f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prostgles-server", - "version": "4.2.193", + "version": "4.2.194", "description": "", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/tests/server/package-lock.json b/tests/server/package-lock.json index 117fe429..2c7ea30a 100644 --- a/tests/server/package-lock.json +++ b/tests/server/package-lock.json @@ -21,7 +21,7 @@ }, "../..": { "name": "prostgles-server", - "version": "4.2.193", + "version": "4.2.194", "license": "MIT", "dependencies": { "@aws-sdk/client-ses": "^3.699.0",