@proteinjs/server 1.8.2 → 2.0.0
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/CHANGELOG.md +16 -0
- package/dist/generated/index.d.ts +1 -0
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/generated/index.js +2 -1
- package/dist/generated/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/src/SocketIOServerRepo.d.ts +15 -0
- package/dist/src/SocketIOServerRepo.d.ts.map +1 -0
- package/dist/src/SocketIOServerRepo.js +35 -0
- package/dist/src/SocketIOServerRepo.js.map +1 -0
- package/dist/src/startServer.d.ts +0 -2
- package/dist/src/startServer.d.ts.map +1 -1
- package/dist/src/startServer.js +6 -26
- package/dist/src/startServer.js.map +1 -1
- package/generated/index.ts +2 -1
- package/index.ts +1 -0
- package/package.json +3 -2
- package/src/SocketIOServerRepo.ts +46 -0
- package/src/startServer.ts +6 -40
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [2.0.0](https://github.com/proteinjs/server/compare/@proteinjs/server@1.8.2...@proteinjs/server@2.0.0) (2024-08-30)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* added `SocketIOServerRepo` to get access to the socket.io server. It enables the socket.io server to be provided by the app's server via `@proteinjs/event/DefaultSocketIOServerFactory`. ([88613af](https://github.com/proteinjs/server/commit/88613af3b8f149675f4b1547f5bbbd9e262e0c0b))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### BREAKING CHANGES
|
|
15
|
+
|
|
16
|
+
* we used to initialize the socket.io server in `startServer` and export as a const.
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [1.8.2](https://github.com/proteinjs/server/compare/@proteinjs/server@1.8.1...@proteinjs/server@1.8.2) (2024-08-28)
|
|
7
23
|
|
|
8
24
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../generated/index.ts"],"names":[],"mappings":"AAAA,oCAAoC;AAEpC,OAAO,sCAAsC,CAAC;AAC9C,OAAO,mBAAmB,CAAC;AAC3B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,sBAAsB,CAAC;AAC9B,OAAO,aAAa,CAAC;AACrB,OAAO,QAAQ,CAAC;AAChB,OAAO,eAAe,CAAC;AACvB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,YAAY,CAAC;AACpB,OAAO,QAAQ,CAAC;AAChB,OAAO,SAAS,CAAC;AACjB,OAAO,iBAAiB,CAAC;AACzB,OAAO,aAAa,CAAC;AACrB,OAAO,UAAU,CAAC;AAClB,OAAO,gBAAgB,CAAC;AACxB,OAAO,iBAAiB,CAAC;AACzB,OAAO,SAAS,CAAC;AACjB,OAAO,OAAO,CAAC;AACf,OAAO,cAAc,CAAC;AACtB,OAAO,eAAe,CAAC;AACvB,OAAO,0BAA0B,CAAC;AAClC,OAAO,WAAW,CAAC;AACnB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,cAAc,CAAC;AACtB,OAAO,WAAW,CAAC;AACnB,OAAO,YAAY,CAAC;AACpB,OAAO,KAAK,CAAC;AACb,OAAO,MAAM,CAAC;AACd,OAAO,SAAS,CAAC;AACjB,OAAO,wBAAwB,CAAC;AAChC,OAAO,wBAAwB,CAAC;AA6BhC,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../generated/index.ts"],"names":[],"mappings":"AAAA,oCAAoC;AAEpC,OAAO,sCAAsC,CAAC;AAC9C,OAAO,kBAAkB,CAAC;AAC1B,OAAO,mBAAmB,CAAC;AAC3B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,sBAAsB,CAAC;AAC9B,OAAO,aAAa,CAAC;AACrB,OAAO,QAAQ,CAAC;AAChB,OAAO,eAAe,CAAC;AACvB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,YAAY,CAAC;AACpB,OAAO,QAAQ,CAAC;AAChB,OAAO,SAAS,CAAC;AACjB,OAAO,iBAAiB,CAAC;AACzB,OAAO,aAAa,CAAC;AACrB,OAAO,UAAU,CAAC;AAClB,OAAO,gBAAgB,CAAC;AACxB,OAAO,iBAAiB,CAAC;AACzB,OAAO,SAAS,CAAC;AACjB,OAAO,OAAO,CAAC;AACf,OAAO,cAAc,CAAC;AACtB,OAAO,eAAe,CAAC;AACvB,OAAO,0BAA0B,CAAC;AAClC,OAAO,WAAW,CAAC;AACnB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,cAAc,CAAC;AACtB,OAAO,WAAW,CAAC;AACnB,OAAO,YAAY,CAAC;AACpB,OAAO,KAAK,CAAC;AACb,OAAO,MAAM,CAAC;AACd,OAAO,SAAS,CAAC;AACjB,OAAO,wBAAwB,CAAC;AAChC,OAAO,wBAAwB,CAAC;AA6BhC,cAAc,UAAU,CAAC"}
|
package/dist/generated/index.js
CHANGED
|
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
};
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
require("@pmmmwh/react-refresh-webpack-plugin");
|
|
19
|
+
require("@proteinjs/event");
|
|
19
20
|
require("@proteinjs/logger");
|
|
20
21
|
require("@proteinjs/reflection");
|
|
21
22
|
require("@proteinjs/server-api");
|
|
@@ -48,7 +49,7 @@ require("webpack");
|
|
|
48
49
|
require("webpack-dev-middleware");
|
|
49
50
|
require("webpack-hot-middleware");
|
|
50
51
|
/** Generate Source Graph */
|
|
51
|
-
var sourceGraph = "{\"options\":{\"directed\":true,\"multigraph\":false,\"compound\":false},\"nodes\":[{\"v\":\"@proteinjs/server/NodeGlobalDataStorage\",\"value\":{\"packageName\":\"@proteinjs/server\",\"name\":\"NodeGlobalDataStorage\",\"filePath\":\"/home/runner/work/server/server/packages/server/src/NodeGlobalDataStorage.ts\",\"qualifiedName\":\"@proteinjs/server/NodeGlobalDataStorage\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[{\"name\":\"HOOK_INITIALIZED\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":true,\"visibility\":\"private\"},{\"name\":\"GLOBAL_DATA\",\"type\":{\"packageName\":\"@proteinjs/server\",\"name\":\"{ [id: string]: GlobalData }\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/server/{ [id: string]: GlobalData }\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":false,\"isAbstract\":false,\"isStatic\":true,\"visibility\":\"private\"},{\"name\":\"environment\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[{\"name\":\"setData\",\"returnType\":null,\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"data\",\"type\":{\"packageName\":\"@proteinjs/server-api\",\"name\":\"GlobalData\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/server-api/GlobalData\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"getData\",\"returnType\":{\"packageName\":\"@proteinjs/server-api\",\"name\":\"GlobalData\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/server-api/GlobalData\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[]},{\"name\":\"initHook\",\"returnType\":null,\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"private\",\"parameters\":[]}],\"typeParameters\":[],\"directParentInterfaces\":[{\"packageName\":\"@proteinjs/server-api\",\"name\":\"GlobalDataStorage\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/server-api/GlobalDataStorage\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"directParentClasses\":[],\"sourceType\":2}},{\"v\":\"@proteinjs/server-api/GlobalDataStorage\"},{\"v\":\"@proteinjs/server/NodeSessionDataStorage\",\"value\":{\"packageName\":\"@proteinjs/server\",\"name\":\"NodeSessionDataStorage\",\"filePath\":\"/home/runner/work/server/server/packages/server/src/NodeSessionDataStorage.ts\",\"qualifiedName\":\"@proteinjs/server/NodeSessionDataStorage\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[{\"name\":\"HOOK_INITIALIZED\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":true,\"visibility\":\"private\"},{\"name\":\"SESSION_DATA\",\"type\":{\"packageName\":\"@proteinjs/server\",\"name\":\"{ [id: string]: SessionData }\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/server/{ [id: string]: SessionData }\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":false,\"isAbstract\":false,\"isStatic\":true,\"visibility\":\"private\"},{\"name\":\"environment\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[{\"name\":\"setData\",\"returnType\":null,\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"data\",\"type\":{\"packageName\":\"@proteinjs/server-api\",\"name\":\"SessionData\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/server-api/SessionData\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"getData\",\"returnType\":{\"packageName\":\"@proteinjs/server-api\",\"name\":\"SessionData\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/server-api/SessionData\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[]},{\"name\":\"initHook\",\"returnType\":null,\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"private\",\"parameters\":[]}],\"typeParameters\":[],\"directParentInterfaces\":[{\"packageName\":\"@proteinjs/server-api\",\"name\":\"SessionDataStorage\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/server-api/SessionDataStorage\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"directParentClasses\":[],\"sourceType\":2}},{\"v\":\"@proteinjs/server-api/SessionDataStorage\"},{\"v\":\"@proteinjs/server/environmentCache\",\"value\":{\"packageName\":\"@proteinjs/server\",\"name\":\"environmentCache\",\"filePath\":\"/home/runner/work/server/server/packages/server/src/envCache.ts\",\"qualifiedName\":\"@proteinjs/server/environmentCache\",\"type\":{\"packageName\":\"\",\"name\":\"GlobalDataCache<Env>\",\"filePath\":null,\"qualifiedName\":\"/GlobalDataCache<Env>\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/server-api\",\"name\":\"GlobalDataCache\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/server-api/GlobalDataCache\",\"typeParameters\":[\"@proteinjs/server-api/Env\"],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}},{\"v\":\"@proteinjs/server-api/GlobalDataCache\"},{\"v\":\"/string\"},{\"v\":\"@proteinjs/server/healthCheck\",\"value\":{\"packageName\":\"@proteinjs/server\",\"name\":\"healthCheck\",\"filePath\":\"/home/runner/work/server/server/packages/server/src/routes/healthCheck.ts\",\"qualifiedName\":\"@proteinjs/server/healthCheck\",\"type\":{\"packageName\":\"@proteinjs/server-api\",\"name\":\"Route\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/server-api/Route\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/server-api\",\"name\":\"Route\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/server-api/Route\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}},{\"v\":\"@proteinjs/server-api/Route\"}],\"edges\":[{\"v\":\"@proteinjs/server/NodeGlobalDataStorage\",\"w\":\"@proteinjs/server-api/GlobalDataStorage\",\"value\":\"implements interface\"},{\"v\":\"@proteinjs/server/NodeSessionDataStorage\",\"w\":\"@proteinjs/server-api/SessionDataStorage\",\"value\":\"implements interface\"},{\"v\":\"@proteinjs/server/environmentCache\",\"w\":\"@proteinjs/server-api/GlobalDataCache\",\"value\":\"has type\"},{\"v\":\"@proteinjs/server/healthCheck\",\"w\":\"@proteinjs/server-api/Route\",\"value\":\"has type\"}]}";
|
|
52
|
+
var sourceGraph = "{\"options\":{\"directed\":true,\"multigraph\":false,\"compound\":false},\"nodes\":[{\"v\":\"@proteinjs/server/NodeGlobalDataStorage\",\"value\":{\"packageName\":\"@proteinjs/server\",\"name\":\"NodeGlobalDataStorage\",\"filePath\":\"/home/runner/work/server/server/packages/server/src/NodeGlobalDataStorage.ts\",\"qualifiedName\":\"@proteinjs/server/NodeGlobalDataStorage\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[{\"name\":\"HOOK_INITIALIZED\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":true,\"visibility\":\"private\"},{\"name\":\"GLOBAL_DATA\",\"type\":{\"packageName\":\"@proteinjs/server\",\"name\":\"{ [id: string]: GlobalData }\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/server/{ [id: string]: GlobalData }\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":false,\"isAbstract\":false,\"isStatic\":true,\"visibility\":\"private\"},{\"name\":\"environment\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[{\"name\":\"setData\",\"returnType\":null,\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"data\",\"type\":{\"packageName\":\"@proteinjs/server-api\",\"name\":\"GlobalData\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/server-api/GlobalData\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"getData\",\"returnType\":{\"packageName\":\"@proteinjs/server-api\",\"name\":\"GlobalData\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/server-api/GlobalData\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[]},{\"name\":\"initHook\",\"returnType\":null,\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"private\",\"parameters\":[]}],\"typeParameters\":[],\"directParentInterfaces\":[{\"packageName\":\"@proteinjs/server-api\",\"name\":\"GlobalDataStorage\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/server-api/GlobalDataStorage\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"directParentClasses\":[],\"sourceType\":2}},{\"v\":\"@proteinjs/server-api/GlobalDataStorage\"},{\"v\":\"@proteinjs/server/NodeSessionDataStorage\",\"value\":{\"packageName\":\"@proteinjs/server\",\"name\":\"NodeSessionDataStorage\",\"filePath\":\"/home/runner/work/server/server/packages/server/src/NodeSessionDataStorage.ts\",\"qualifiedName\":\"@proteinjs/server/NodeSessionDataStorage\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[{\"name\":\"HOOK_INITIALIZED\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":true,\"visibility\":\"private\"},{\"name\":\"SESSION_DATA\",\"type\":{\"packageName\":\"@proteinjs/server\",\"name\":\"{ [id: string]: SessionData }\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/server/{ [id: string]: SessionData }\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":false,\"isAbstract\":false,\"isStatic\":true,\"visibility\":\"private\"},{\"name\":\"environment\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[{\"name\":\"setData\",\"returnType\":null,\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"data\",\"type\":{\"packageName\":\"@proteinjs/server-api\",\"name\":\"SessionData\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/server-api/SessionData\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"getData\",\"returnType\":{\"packageName\":\"@proteinjs/server-api\",\"name\":\"SessionData\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/server-api/SessionData\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[]},{\"name\":\"initHook\",\"returnType\":null,\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"private\",\"parameters\":[]}],\"typeParameters\":[],\"directParentInterfaces\":[{\"packageName\":\"@proteinjs/server-api\",\"name\":\"SessionDataStorage\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/server-api/SessionDataStorage\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"directParentClasses\":[],\"sourceType\":2}},{\"v\":\"@proteinjs/server-api/SessionDataStorage\"},{\"v\":\"@proteinjs/server/ExtendedIncomingMessage\",\"value\":{\"packageName\":\"@proteinjs/server\",\"name\":\"ExtendedIncomingMessage\",\"filePath\":\"/home/runner/work/server/server/packages/server/src/SocketIOServerRepo.ts\",\"qualifiedName\":\"@proteinjs/server/ExtendedIncomingMessage\",\"properties\":[{\"name\":\"sessionID\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":true,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"user\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":true,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"http\",\"name\":\"IncomingMessage\",\"filePath\":null,\"qualifiedName\":\"http/IncomingMessage\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"http/IncomingMessage\"},{\"v\":\"@proteinjs/server/ExtendedSocket\",\"value\":{\"packageName\":\"@proteinjs/server\",\"name\":\"ExtendedSocket\",\"filePath\":\"/home/runner/work/server/server/packages/server/src/SocketIOServerRepo.ts\",\"qualifiedName\":\"@proteinjs/server/ExtendedSocket\",\"properties\":[{\"name\":\"request\",\"type\":{\"packageName\":\"@proteinjs/server\",\"name\":\"ExtendedIncomingMessage\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/server/ExtendedIncomingMessage\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"socket.io\",\"name\":\"Socket\",\"filePath\":null,\"qualifiedName\":\"socket.io/Socket\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"socket.io/Socket\"},{\"v\":\"@proteinjs/server/environmentCache\",\"value\":{\"packageName\":\"@proteinjs/server\",\"name\":\"environmentCache\",\"filePath\":\"/home/runner/work/server/server/packages/server/src/envCache.ts\",\"qualifiedName\":\"@proteinjs/server/environmentCache\",\"type\":{\"packageName\":\"\",\"name\":\"GlobalDataCache<Env>\",\"filePath\":null,\"qualifiedName\":\"/GlobalDataCache<Env>\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/server-api\",\"name\":\"GlobalDataCache\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/server-api/GlobalDataCache\",\"typeParameters\":[\"@proteinjs/server-api/Env\"],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}},{\"v\":\"@proteinjs/server-api/GlobalDataCache\"},{\"v\":\"/string\"},{\"v\":\"@proteinjs/server/healthCheck\",\"value\":{\"packageName\":\"@proteinjs/server\",\"name\":\"healthCheck\",\"filePath\":\"/home/runner/work/server/server/packages/server/src/routes/healthCheck.ts\",\"qualifiedName\":\"@proteinjs/server/healthCheck\",\"type\":{\"packageName\":\"@proteinjs/server-api\",\"name\":\"Route\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/server-api/Route\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/server-api\",\"name\":\"Route\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/server-api/Route\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}},{\"v\":\"@proteinjs/server-api/Route\"}],\"edges\":[{\"v\":\"@proteinjs/server/NodeGlobalDataStorage\",\"w\":\"@proteinjs/server-api/GlobalDataStorage\",\"value\":\"implements interface\"},{\"v\":\"@proteinjs/server/NodeSessionDataStorage\",\"w\":\"@proteinjs/server-api/SessionDataStorage\",\"value\":\"implements interface\"},{\"v\":\"@proteinjs/server/ExtendedIncomingMessage\",\"w\":\"http/IncomingMessage\",\"value\":\"extends interface\"},{\"v\":\"@proteinjs/server/ExtendedSocket\",\"w\":\"socket.io/Socket\",\"value\":\"extends interface\"},{\"v\":\"@proteinjs/server/environmentCache\",\"w\":\"@proteinjs/server-api/GlobalDataCache\",\"value\":\"has type\"},{\"v\":\"@proteinjs/server/healthCheck\",\"w\":\"@proteinjs/server-api/Route\",\"value\":\"has type\"}]}";
|
|
52
53
|
/** Generate Source Links */
|
|
53
54
|
var NodeGlobalDataStorage_1 = require("../src/NodeGlobalDataStorage");
|
|
54
55
|
var NodeSessionDataStorage_1 = require("../src/NodeSessionDataStorage");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../generated/index.ts"],"names":[],"mappings":";AAAA,oCAAoC;;;;;;;;;;;;;;;;AAEpC,gDAA8C;AAC9C,6BAA2B;AAC3B,iCAA+B;AAC/B,iCAA+B;AAC/B,gCAA8B;AAC9B,uBAAqB;AACrB,kBAAgB;AAChB,yBAAuB;AACvB,6BAA2B;AAC3B,sBAAoB;AACpB,kBAAgB;AAChB,mBAAiB;AACjB,2BAAyB;AACzB,uBAAqB;AACrB,oBAAkB;AAClB,0BAAwB;AACxB,2BAAyB;AACzB,mBAAiB;AACjB,iBAAe;AACf,wBAAsB;AACtB,yBAAuB;AACvB,oCAAkC;AAClC,qBAAmB;AACnB,6BAA2B;AAC3B,wBAAsB;AACtB,qBAAmB;AACnB,sBAAoB;AACpB,eAAa;AACb,gBAAc;AACd,mBAAiB;AACjB,kCAAgC;AAChC,kCAAgC;AAGhC,4BAA4B;AAE5B,IAAM,WAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../generated/index.ts"],"names":[],"mappings":";AAAA,oCAAoC;;;;;;;;;;;;;;;;AAEpC,gDAA8C;AAC9C,4BAA0B;AAC1B,6BAA2B;AAC3B,iCAA+B;AAC/B,iCAA+B;AAC/B,gCAA8B;AAC9B,uBAAqB;AACrB,kBAAgB;AAChB,yBAAuB;AACvB,6BAA2B;AAC3B,sBAAoB;AACpB,kBAAgB;AAChB,mBAAiB;AACjB,2BAAyB;AACzB,uBAAqB;AACrB,oBAAkB;AAClB,0BAAwB;AACxB,2BAAyB;AACzB,mBAAiB;AACjB,iBAAe;AACf,wBAAsB;AACtB,yBAAuB;AACvB,oCAAkC;AAClC,qBAAmB;AACnB,6BAA2B;AAC3B,wBAAsB;AACtB,qBAAmB;AACnB,sBAAoB;AACpB,eAAa;AACb,gBAAc;AACd,mBAAiB;AACjB,kCAAgC;AAChC,kCAAgC;AAGhC,4BAA4B;AAE5B,IAAM,WAAW,GAAG,orRAAorR,CAAC;AAGzsR,4BAA4B;AAE5B,sEAAqE;AACrE,wEAAuE;AACvE,4CAAmD;AACnD,yDAAwD;AAExD,IAAM,WAAW,GAAG;IACnB,yCAAyC,EAAE,6CAAqB;IAChE,0CAA0C,EAAE,+CAAsB;IAClE,oCAAoC,EAAE,2BAAgB;IACtD,+BAA+B,EAAE,yBAAW;CAC5C,CAAC;AAGF,kCAAkC;AAElC,oDAAyD;AACzD,6BAAgB,CAAC,KAAK,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAGjD,2CAAyB"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./src/startServer"), exports);
|
|
18
18
|
__exportStar(require("./src/envCache"), exports);
|
|
19
19
|
__exportStar(require("./src/Request"), exports);
|
|
20
|
+
__exportStar(require("./src/SocketIOServerRepo"), exports);
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,iDAA+B;AAC/B,gDAA8B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,iDAA+B;AAC/B,gDAA8B;AAC9B,2DAAyC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Server as HttpServer, IncomingMessage } from 'http';
|
|
3
|
+
import { Socket, Server as SocketIOServer } from 'socket.io';
|
|
4
|
+
export interface ExtendedIncomingMessage extends IncomingMessage {
|
|
5
|
+
sessionID?: string;
|
|
6
|
+
user?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ExtendedSocket extends Socket {
|
|
9
|
+
request: ExtendedIncomingMessage;
|
|
10
|
+
}
|
|
11
|
+
export declare class SocketIOServerRepo {
|
|
12
|
+
static createSocketIOServer(httpServer: HttpServer): SocketIOServer;
|
|
13
|
+
static getSocketIOServer(): SocketIOServer;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=SocketIOServerRepo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SocketIOServerRepo.d.ts","sourceRoot":"","sources":["../../src/SocketIOServerRepo.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,WAAW,CAAC;AAW7D,MAAM,WAAW,uBAAwB,SAAQ,eAAe;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAe,SAAQ,MAAM;IAC5C,OAAO,EAAE,uBAAuB,CAAC;CAClC;AAED,qBAAa,kBAAkB;IAC7B,MAAM,CAAC,oBAAoB,CAAC,UAAU,EAAE,UAAU,GAAG,cAAc;IAcnE,MAAM,CAAC,iBAAiB,IAAI,cAAc;CAS3C"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SocketIOServerRepo = void 0;
|
|
4
|
+
var socket_io_1 = require("socket.io");
|
|
5
|
+
var event_1 = require("@proteinjs/event");
|
|
6
|
+
var getGlobal = function () {
|
|
7
|
+
if (typeof window !== 'undefined') {
|
|
8
|
+
return window;
|
|
9
|
+
}
|
|
10
|
+
return globalThis;
|
|
11
|
+
};
|
|
12
|
+
var SocketIOServerRepo = /** @class */ (function () {
|
|
13
|
+
function SocketIOServerRepo() {
|
|
14
|
+
}
|
|
15
|
+
SocketIOServerRepo.createSocketIOServer = function (httpServer) {
|
|
16
|
+
if (getGlobal().__proteinjs_server_SocketIOServer) {
|
|
17
|
+
throw new Error('Socket IO Server already initialized');
|
|
18
|
+
}
|
|
19
|
+
var socketIOServerFactory = (0, event_1.getDefaultSocketIOServerFactory)();
|
|
20
|
+
var socketIOServer = socketIOServerFactory
|
|
21
|
+
? socketIOServerFactory.createSocketIOServer(httpServer)
|
|
22
|
+
: new socket_io_1.Server(httpServer);
|
|
23
|
+
getGlobal().__proteinjs_server_SocketIOServer = socketIOServer;
|
|
24
|
+
return getGlobal().__proteinjs_server_SocketIOServer;
|
|
25
|
+
};
|
|
26
|
+
SocketIOServerRepo.getSocketIOServer = function () {
|
|
27
|
+
if (!getGlobal().__proteinjs_server_SocketIOServer) {
|
|
28
|
+
throw new Error("Socket IO Server doesn'nt exist yet. You're likely calling this before @proteinjs/server has initialized it.");
|
|
29
|
+
}
|
|
30
|
+
return getGlobal().__proteinjs_server_SocketIOServer;
|
|
31
|
+
};
|
|
32
|
+
return SocketIOServerRepo;
|
|
33
|
+
}());
|
|
34
|
+
exports.SocketIOServerRepo = SocketIOServerRepo;
|
|
35
|
+
//# sourceMappingURL=SocketIOServerRepo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SocketIOServerRepo.js","sourceRoot":"","sources":["../../src/SocketIOServerRepo.ts"],"names":[],"mappings":";;;AACA,uCAA6D;AAC7D,0CAAmE;AAEnE,IAAM,SAAS,GAAG;IAChB,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACjC,OAAO,MAAM,CAAC;KACf;IAED,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAWF;IAAA;IAwBA,CAAC;IAvBQ,uCAAoB,GAA3B,UAA4B,UAAsB;QAChD,IAAI,SAAS,EAAE,CAAC,iCAAiC,EAAE;YACjD,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;SACzD;QAED,IAAM,qBAAqB,GAAG,IAAA,uCAA+B,GAAE,CAAC;QAChE,IAAM,cAAc,GAAG,qBAAqB;YAC1C,CAAC,CAAC,qBAAqB,CAAC,oBAAoB,CAAC,UAAU,CAAC;YACxD,CAAC,CAAC,IAAI,kBAAc,CAAC,UAAU,CAAC,CAAC;QACnC,SAAS,EAAE,CAAC,iCAAiC,GAAG,cAAc,CAAC;QAE/D,OAAO,SAAS,EAAE,CAAC,iCAAiC,CAAC;IACvD,CAAC;IAEM,oCAAiB,GAAxB;QACE,IAAI,CAAC,SAAS,EAAE,CAAC,iCAAiC,EAAE;YAClD,MAAM,IAAI,KAAK,CACb,8GAA8G,CAC/G,CAAC;SACH;QAED,OAAO,SAAS,EAAE,CAAC,iCAAiC,CAAC;IACvD,CAAC;IACH,yBAAC;AAAD,CAAC,AAxBD,IAwBC;AAxBY,gDAAkB"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { Server as SocketIOServer } from 'socket.io';
|
|
2
1
|
import { ServerConfig } from '@proteinjs/server-api';
|
|
3
|
-
export declare const io: SocketIOServer<import("socket.io/dist/typed-events").DefaultEventsMap, import("socket.io/dist/typed-events").DefaultEventsMap, import("socket.io/dist/typed-events").DefaultEventsMap, any>;
|
|
4
2
|
export declare function startServer(config: ServerConfig): Promise<void>;
|
|
5
3
|
//# sourceMappingURL=startServer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startServer.d.ts","sourceRoot":"","sources":["../../src/startServer.ts"],"names":[],"mappings":"AAUA,OAAO,
|
|
1
|
+
{"version":3,"file":"startServer.d.ts","sourceRoot":"","sources":["../../src/startServer.ts"],"names":[],"mappings":"AAUA,OAAO,EAGL,YAAY,EAKb,MAAM,uBAAuB,CAAC;AAW/B,wBAAsB,WAAW,CAAC,MAAM,EAAE,YAAY,iBAwCrD"}
|
package/dist/src/startServer.js
CHANGED
|
@@ -39,7 +39,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
40
|
};
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.startServer =
|
|
42
|
+
exports.startServer = void 0;
|
|
43
43
|
var express_1 = __importDefault(require("express"));
|
|
44
44
|
var express_session_1 = __importDefault(require("express-session"));
|
|
45
45
|
var cookie_parser_1 = __importDefault(require("cookie-parser"));
|
|
@@ -50,16 +50,15 @@ var webpack_1 = __importDefault(require("webpack"));
|
|
|
50
50
|
var webpack_dev_middleware_1 = __importDefault(require("webpack-dev-middleware"));
|
|
51
51
|
var webpack_hot_middleware_1 = __importDefault(require("webpack-hot-middleware"));
|
|
52
52
|
var http_1 = require("http");
|
|
53
|
-
var socket_io_1 = require("socket.io");
|
|
54
53
|
var server_api_1 = require("@proteinjs/server-api");
|
|
55
54
|
var loadRoutes_1 = require("./loadRoutes");
|
|
56
55
|
var logger_1 = require("@proteinjs/logger");
|
|
57
56
|
var nodeModulesPath_1 = require("./nodeModulesPath");
|
|
57
|
+
var SocketIOServerRepo_1 = require("./SocketIOServerRepo");
|
|
58
58
|
var staticContentPath = '/static/';
|
|
59
59
|
var logger = new logger_1.Logger({ name: 'Server' });
|
|
60
60
|
var app = (0, express_1.default)();
|
|
61
61
|
var server = new http_1.Server(app);
|
|
62
|
-
exports.io = new socket_io_1.Server(server);
|
|
63
62
|
function startServer(config) {
|
|
64
63
|
return __awaiter(this, void 0, void 0, function () {
|
|
65
64
|
var routes, globalData, _i, _a, globalDataCache, _b, _c;
|
|
@@ -96,7 +95,7 @@ function startServer(config) {
|
|
|
96
95
|
server_api_1.Global.setData(globalData);
|
|
97
96
|
(0, loadRoutes_1.loadDefaultStarRoute)(routes, app, config);
|
|
98
97
|
afterRequest(app, config);
|
|
99
|
-
initializeSocketIO(
|
|
98
|
+
initializeSocketIO(app, server);
|
|
100
99
|
return [4 /*yield*/, runStartupTasks('after server config')];
|
|
101
100
|
case 6:
|
|
102
101
|
_d.sent();
|
|
@@ -303,8 +302,8 @@ function afterRequest(app, config) {
|
|
|
303
302
|
app.use(config.request.afterRequest);
|
|
304
303
|
}
|
|
305
304
|
}
|
|
306
|
-
function initializeSocketIO(
|
|
307
|
-
var
|
|
305
|
+
function initializeSocketIO(app, server) {
|
|
306
|
+
var io = SocketIOServerRepo_1.SocketIOServerRepo.createSocketIOServer(server);
|
|
308
307
|
// Share session and passport middleware with Socket.IO
|
|
309
308
|
var wrapMiddleware = function (middleware) { return function (socket, next) { return middleware(socket.request, {}, next); }; };
|
|
310
309
|
var sessionMiddleware = app.get('sessionMiddleware');
|
|
@@ -320,31 +319,12 @@ function initializeSocketIO(io, app) {
|
|
|
320
319
|
next(new Error('Unauthorized'));
|
|
321
320
|
}
|
|
322
321
|
});
|
|
323
|
-
//
|
|
322
|
+
// Map this socket to the session id so it can be closed when the session is destroyed
|
|
324
323
|
io.on('connection', function (socket) {
|
|
325
|
-
var userInfo = "".concat(socket.request.user, " (").concat(socket.id, ")");
|
|
326
|
-
socketLogger.info({ message: "User connected: ".concat(userInfo) });
|
|
327
|
-
// Map this socket to the session id so it can be closed when the session is destroyed
|
|
328
324
|
var sessionId = socket.request.sessionID;
|
|
329
325
|
if (sessionId) {
|
|
330
326
|
socket.join(sessionId);
|
|
331
327
|
}
|
|
332
|
-
socket.on('disconnect', function (reason) {
|
|
333
|
-
socketLogger.info({ message: "User disconnected: ".concat(userInfo, ". Reason: ").concat(reason) });
|
|
334
|
-
});
|
|
335
|
-
socket.on('error', function (error) {
|
|
336
|
-
socketLogger.error({ message: "Socket error for user: ".concat(userInfo), error: error });
|
|
337
|
-
});
|
|
338
|
-
socket.conn.on('error', function (error) {
|
|
339
|
-
socketLogger.error({ message: "Socket connection error for user: ".concat(userInfo), error: error });
|
|
340
|
-
});
|
|
341
|
-
});
|
|
342
|
-
// Handle server-level errors
|
|
343
|
-
io.engine.on('connection_error', function (error) {
|
|
344
|
-
socketLogger.error({
|
|
345
|
-
message: 'Connection error',
|
|
346
|
-
error: { message: error.message, code: error.code, context: error.context },
|
|
347
|
-
});
|
|
348
328
|
});
|
|
349
329
|
}
|
|
350
330
|
function start(server, config) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startServer.js","sourceRoot":"","sources":["../../src/startServer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAA8B;AAC9B,oEAA6C;AAC7C,gEAAyC;AACzC,4DAAqC;AACrC,sDAAgC;AAChC,kEAA2C;AAC3C,oDAA8B;AAC9B,kFAA0D;AAC1D,kFAA0D;AAC1D,
|
|
1
|
+
{"version":3,"file":"startServer.js","sourceRoot":"","sources":["../../src/startServer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAA8B;AAC9B,oEAA6C;AAC7C,gEAAyC;AACzC,4DAAqC;AACrC,sDAAgC;AAChC,kEAA2C;AAC3C,oDAA8B;AAC9B,kFAA0D;AAC1D,kFAA0D;AAC1D,6BAA4C;AAC5C,oDAQ+B;AAC/B,2CAAgE;AAChE,4CAA2C;AAC3C,qDAAuD;AACvD,2DAA0E;AAE1E,IAAM,iBAAiB,GAAG,UAAU,CAAC;AACrC,IAAM,MAAM,GAAG,IAAI,eAAM,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC9C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AO,EAAE,8BAA8B,EAAE,CAAC,CAAC;SAC1D;QAED,MAAM,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,oCAA6B,IAAI,CAAE,EAAE,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/generated/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** Load Dependency Source Graphs */
|
|
2
2
|
|
|
3
3
|
import '@pmmmwh/react-refresh-webpack-plugin';
|
|
4
|
+
import '@proteinjs/event';
|
|
4
5
|
import '@proteinjs/logger';
|
|
5
6
|
import '@proteinjs/reflection';
|
|
6
7
|
import '@proteinjs/server-api';
|
|
@@ -36,7 +37,7 @@ import 'webpack-hot-middleware';
|
|
|
36
37
|
/** Generate Source Graph */
|
|
37
38
|
|
|
38
39
|
const sourceGraph =
|
|
39
|
-
'{"options":{"directed":true,"multigraph":false,"compound":false},"nodes":[{"v":"@proteinjs/server/NodeGlobalDataStorage","value":{"packageName":"@proteinjs/server","name":"NodeGlobalDataStorage","filePath":"/home/runner/work/server/server/packages/server/src/NodeGlobalDataStorage.ts","qualifiedName":"@proteinjs/server/NodeGlobalDataStorage","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"HOOK_INITIALIZED","type":null,"isOptional":false,"isAbstract":false,"isStatic":true,"visibility":"private"},{"name":"GLOBAL_DATA","type":{"packageName":"@proteinjs/server","name":"{ [id: string]: GlobalData }","filePath":null,"qualifiedName":"@proteinjs/server/{ [id: string]: GlobalData }","typeParameters":null,"directParents":null},"isOptional":false,"isAbstract":false,"isStatic":true,"visibility":"private"},{"name":"environment","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[{"name":"setData","returnType":null,"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"data","type":{"packageName":"@proteinjs/server-api","name":"GlobalData","filePath":null,"qualifiedName":"@proteinjs/server-api/GlobalData","typeParameters":null,"directParents":null}}]},{"name":"getData","returnType":{"packageName":"@proteinjs/server-api","name":"GlobalData","filePath":null,"qualifiedName":"@proteinjs/server-api/GlobalData","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[]},{"name":"initHook","returnType":null,"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private","parameters":[]}],"typeParameters":[],"directParentInterfaces":[{"packageName":"@proteinjs/server-api","name":"GlobalDataStorage","filePath":null,"qualifiedName":"@proteinjs/server-api/GlobalDataStorage","properties":[],"methods":[],"typeParameters":[],"directParents":[]}],"directParentClasses":[],"sourceType":2}},{"v":"@proteinjs/server-api/GlobalDataStorage"},{"v":"@proteinjs/server/NodeSessionDataStorage","value":{"packageName":"@proteinjs/server","name":"NodeSessionDataStorage","filePath":"/home/runner/work/server/server/packages/server/src/NodeSessionDataStorage.ts","qualifiedName":"@proteinjs/server/NodeSessionDataStorage","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"HOOK_INITIALIZED","type":null,"isOptional":false,"isAbstract":false,"isStatic":true,"visibility":"private"},{"name":"SESSION_DATA","type":{"packageName":"@proteinjs/server","name":"{ [id: string]: SessionData }","filePath":null,"qualifiedName":"@proteinjs/server/{ [id: string]: SessionData }","typeParameters":null,"directParents":null},"isOptional":false,"isAbstract":false,"isStatic":true,"visibility":"private"},{"name":"environment","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[{"name":"setData","returnType":null,"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"data","type":{"packageName":"@proteinjs/server-api","name":"SessionData","filePath":null,"qualifiedName":"@proteinjs/server-api/SessionData","typeParameters":null,"directParents":null}}]},{"name":"getData","returnType":{"packageName":"@proteinjs/server-api","name":"SessionData","filePath":null,"qualifiedName":"@proteinjs/server-api/SessionData","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[]},{"name":"initHook","returnType":null,"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private","parameters":[]}],"typeParameters":[],"directParentInterfaces":[{"packageName":"@proteinjs/server-api","name":"SessionDataStorage","filePath":null,"qualifiedName":"@proteinjs/server-api/SessionDataStorage","properties":[],"methods":[],"typeParameters":[],"directParents":[]}],"directParentClasses":[],"sourceType":2}},{"v":"@proteinjs/server-api/SessionDataStorage"},{"v":"@proteinjs/server/environmentCache","value":{"packageName":"@proteinjs/server","name":"environmentCache","filePath":"/home/runner/work/server/server/packages/server/src/envCache.ts","qualifiedName":"@proteinjs/server/environmentCache","type":{"packageName":"","name":"GlobalDataCache<Env>","filePath":null,"qualifiedName":"/GlobalDataCache<Env>","typeParameters":[],"directParents":[{"packageName":"@proteinjs/server-api","name":"GlobalDataCache","filePath":null,"qualifiedName":"@proteinjs/server-api/GlobalDataCache","typeParameters":["@proteinjs/server-api/Env"],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/server-api/GlobalDataCache"},{"v":"/string"},{"v":"@proteinjs/server/healthCheck","value":{"packageName":"@proteinjs/server","name":"healthCheck","filePath":"/home/runner/work/server/server/packages/server/src/routes/healthCheck.ts","qualifiedName":"@proteinjs/server/healthCheck","type":{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":[{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/server-api/Route"}],"edges":[{"v":"@proteinjs/server/NodeGlobalDataStorage","w":"@proteinjs/server-api/GlobalDataStorage","value":"implements interface"},{"v":"@proteinjs/server/NodeSessionDataStorage","w":"@proteinjs/server-api/SessionDataStorage","value":"implements interface"},{"v":"@proteinjs/server/environmentCache","w":"@proteinjs/server-api/GlobalDataCache","value":"has type"},{"v":"@proteinjs/server/healthCheck","w":"@proteinjs/server-api/Route","value":"has type"}]}';
|
|
40
|
+
'{"options":{"directed":true,"multigraph":false,"compound":false},"nodes":[{"v":"@proteinjs/server/NodeGlobalDataStorage","value":{"packageName":"@proteinjs/server","name":"NodeGlobalDataStorage","filePath":"/home/runner/work/server/server/packages/server/src/NodeGlobalDataStorage.ts","qualifiedName":"@proteinjs/server/NodeGlobalDataStorage","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"HOOK_INITIALIZED","type":null,"isOptional":false,"isAbstract":false,"isStatic":true,"visibility":"private"},{"name":"GLOBAL_DATA","type":{"packageName":"@proteinjs/server","name":"{ [id: string]: GlobalData }","filePath":null,"qualifiedName":"@proteinjs/server/{ [id: string]: GlobalData }","typeParameters":null,"directParents":null},"isOptional":false,"isAbstract":false,"isStatic":true,"visibility":"private"},{"name":"environment","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[{"name":"setData","returnType":null,"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"data","type":{"packageName":"@proteinjs/server-api","name":"GlobalData","filePath":null,"qualifiedName":"@proteinjs/server-api/GlobalData","typeParameters":null,"directParents":null}}]},{"name":"getData","returnType":{"packageName":"@proteinjs/server-api","name":"GlobalData","filePath":null,"qualifiedName":"@proteinjs/server-api/GlobalData","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[]},{"name":"initHook","returnType":null,"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private","parameters":[]}],"typeParameters":[],"directParentInterfaces":[{"packageName":"@proteinjs/server-api","name":"GlobalDataStorage","filePath":null,"qualifiedName":"@proteinjs/server-api/GlobalDataStorage","properties":[],"methods":[],"typeParameters":[],"directParents":[]}],"directParentClasses":[],"sourceType":2}},{"v":"@proteinjs/server-api/GlobalDataStorage"},{"v":"@proteinjs/server/NodeSessionDataStorage","value":{"packageName":"@proteinjs/server","name":"NodeSessionDataStorage","filePath":"/home/runner/work/server/server/packages/server/src/NodeSessionDataStorage.ts","qualifiedName":"@proteinjs/server/NodeSessionDataStorage","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"HOOK_INITIALIZED","type":null,"isOptional":false,"isAbstract":false,"isStatic":true,"visibility":"private"},{"name":"SESSION_DATA","type":{"packageName":"@proteinjs/server","name":"{ [id: string]: SessionData }","filePath":null,"qualifiedName":"@proteinjs/server/{ [id: string]: SessionData }","typeParameters":null,"directParents":null},"isOptional":false,"isAbstract":false,"isStatic":true,"visibility":"private"},{"name":"environment","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[{"name":"setData","returnType":null,"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"data","type":{"packageName":"@proteinjs/server-api","name":"SessionData","filePath":null,"qualifiedName":"@proteinjs/server-api/SessionData","typeParameters":null,"directParents":null}}]},{"name":"getData","returnType":{"packageName":"@proteinjs/server-api","name":"SessionData","filePath":null,"qualifiedName":"@proteinjs/server-api/SessionData","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[]},{"name":"initHook","returnType":null,"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private","parameters":[]}],"typeParameters":[],"directParentInterfaces":[{"packageName":"@proteinjs/server-api","name":"SessionDataStorage","filePath":null,"qualifiedName":"@proteinjs/server-api/SessionDataStorage","properties":[],"methods":[],"typeParameters":[],"directParents":[]}],"directParentClasses":[],"sourceType":2}},{"v":"@proteinjs/server-api/SessionDataStorage"},{"v":"@proteinjs/server/ExtendedIncomingMessage","value":{"packageName":"@proteinjs/server","name":"ExtendedIncomingMessage","filePath":"/home/runner/work/server/server/packages/server/src/SocketIOServerRepo.ts","qualifiedName":"@proteinjs/server/ExtendedIncomingMessage","properties":[{"name":"sessionID","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null},"isOptional":true,"isAbstract":false,"isStatic":false,"visibility":"public"},{"name":"user","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null},"isOptional":true,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[],"typeParameters":[],"directParents":[{"packageName":"http","name":"IncomingMessage","filePath":null,"qualifiedName":"http/IncomingMessage","properties":[],"methods":[],"typeParameters":[],"directParents":[]}],"sourceType":3}},{"v":"http/IncomingMessage"},{"v":"@proteinjs/server/ExtendedSocket","value":{"packageName":"@proteinjs/server","name":"ExtendedSocket","filePath":"/home/runner/work/server/server/packages/server/src/SocketIOServerRepo.ts","qualifiedName":"@proteinjs/server/ExtendedSocket","properties":[{"name":"request","type":{"packageName":"@proteinjs/server","name":"ExtendedIncomingMessage","filePath":null,"qualifiedName":"@proteinjs/server/ExtendedIncomingMessage","typeParameters":null,"directParents":null},"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[],"typeParameters":[],"directParents":[{"packageName":"socket.io","name":"Socket","filePath":null,"qualifiedName":"socket.io/Socket","properties":[],"methods":[],"typeParameters":[],"directParents":[]}],"sourceType":3}},{"v":"socket.io/Socket"},{"v":"@proteinjs/server/environmentCache","value":{"packageName":"@proteinjs/server","name":"environmentCache","filePath":"/home/runner/work/server/server/packages/server/src/envCache.ts","qualifiedName":"@proteinjs/server/environmentCache","type":{"packageName":"","name":"GlobalDataCache<Env>","filePath":null,"qualifiedName":"/GlobalDataCache<Env>","typeParameters":[],"directParents":[{"packageName":"@proteinjs/server-api","name":"GlobalDataCache","filePath":null,"qualifiedName":"@proteinjs/server-api/GlobalDataCache","typeParameters":["@proteinjs/server-api/Env"],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/server-api/GlobalDataCache"},{"v":"/string"},{"v":"@proteinjs/server/healthCheck","value":{"packageName":"@proteinjs/server","name":"healthCheck","filePath":"/home/runner/work/server/server/packages/server/src/routes/healthCheck.ts","qualifiedName":"@proteinjs/server/healthCheck","type":{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":[{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/server-api/Route"}],"edges":[{"v":"@proteinjs/server/NodeGlobalDataStorage","w":"@proteinjs/server-api/GlobalDataStorage","value":"implements interface"},{"v":"@proteinjs/server/NodeSessionDataStorage","w":"@proteinjs/server-api/SessionDataStorage","value":"implements interface"},{"v":"@proteinjs/server/ExtendedIncomingMessage","w":"http/IncomingMessage","value":"extends interface"},{"v":"@proteinjs/server/ExtendedSocket","w":"socket.io/Socket","value":"extends interface"},{"v":"@proteinjs/server/environmentCache","w":"@proteinjs/server-api/GlobalDataCache","value":"has type"},{"v":"@proteinjs/server/healthCheck","w":"@proteinjs/server-api/Route","value":"has type"}]}';
|
|
40
41
|
|
|
41
42
|
/** Generate Source Links */
|
|
42
43
|
|
package/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proteinjs/server",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "A server impl",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@pmmmwh/react-refresh-webpack-plugin": "0.5.11",
|
|
25
|
+
"@proteinjs/event": "1.0.1",
|
|
25
26
|
"@proteinjs/logger": "1.0.6",
|
|
26
27
|
"@proteinjs/reflection": "1.1.9",
|
|
27
28
|
"@proteinjs/server-api": "^1.5.0",
|
|
@@ -74,5 +75,5 @@
|
|
|
74
75
|
},
|
|
75
76
|
"main": "./dist/generated/index.js",
|
|
76
77
|
"types": "./dist/generated/index.d.ts",
|
|
77
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "769e8318405f2481f3fd3bec752ba6540ac3324c"
|
|
78
79
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Server as HttpServer, IncomingMessage } from 'http';
|
|
2
|
+
import { Socket, Server as SocketIOServer } from 'socket.io';
|
|
3
|
+
import { getDefaultSocketIOServerFactory } from '@proteinjs/event';
|
|
4
|
+
|
|
5
|
+
const getGlobal = (): any => {
|
|
6
|
+
if (typeof window !== 'undefined') {
|
|
7
|
+
return window;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
return globalThis;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export interface ExtendedIncomingMessage extends IncomingMessage {
|
|
14
|
+
sessionID?: string;
|
|
15
|
+
user?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ExtendedSocket extends Socket {
|
|
19
|
+
request: ExtendedIncomingMessage;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export class SocketIOServerRepo {
|
|
23
|
+
static createSocketIOServer(httpServer: HttpServer): SocketIOServer {
|
|
24
|
+
if (getGlobal().__proteinjs_server_SocketIOServer) {
|
|
25
|
+
throw new Error('Socket IO Server already initialized');
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const socketIOServerFactory = getDefaultSocketIOServerFactory();
|
|
29
|
+
const socketIOServer = socketIOServerFactory
|
|
30
|
+
? socketIOServerFactory.createSocketIOServer(httpServer)
|
|
31
|
+
: new SocketIOServer(httpServer);
|
|
32
|
+
getGlobal().__proteinjs_server_SocketIOServer = socketIOServer;
|
|
33
|
+
|
|
34
|
+
return getGlobal().__proteinjs_server_SocketIOServer;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
static getSocketIOServer(): SocketIOServer {
|
|
38
|
+
if (!getGlobal().__proteinjs_server_SocketIOServer) {
|
|
39
|
+
throw new Error(
|
|
40
|
+
"Socket IO Server doesn'nt exist yet. You're likely calling this before @proteinjs/server has initialized it."
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return getGlobal().__proteinjs_server_SocketIOServer;
|
|
45
|
+
}
|
|
46
|
+
}
|
package/src/startServer.ts
CHANGED
|
@@ -7,8 +7,7 @@ import passportLocal from 'passport-local';
|
|
|
7
7
|
import webpack from 'webpack';
|
|
8
8
|
import webpackDevMiddleware from 'webpack-dev-middleware';
|
|
9
9
|
import webpackHotMiddleware from 'webpack-hot-middleware';
|
|
10
|
-
import { Server as HttpServer
|
|
11
|
-
import { Socket, Server as SocketIOServer } from 'socket.io';
|
|
10
|
+
import { Server as HttpServer } from 'http';
|
|
12
11
|
import {
|
|
13
12
|
Global,
|
|
14
13
|
GlobalData,
|
|
@@ -21,21 +20,12 @@ import {
|
|
|
21
20
|
import { loadRoutes, loadDefaultStarRoute } from './loadRoutes';
|
|
22
21
|
import { Logger } from '@proteinjs/logger';
|
|
23
22
|
import { setNodeModulesPath } from './nodeModulesPath';
|
|
24
|
-
|
|
25
|
-
interface ExtendedIncomingMessage extends IncomingMessage {
|
|
26
|
-
sessionID?: string;
|
|
27
|
-
user?: string;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
interface ExtendedSocket extends Socket {
|
|
31
|
-
request: ExtendedIncomingMessage;
|
|
32
|
-
}
|
|
23
|
+
import { SocketIOServerRepo, ExtendedSocket } from './SocketIOServerRepo';
|
|
33
24
|
|
|
34
25
|
const staticContentPath = '/static/';
|
|
35
26
|
const logger = new Logger({ name: 'Server' });
|
|
36
27
|
const app = express();
|
|
37
28
|
const server = new HttpServer(app);
|
|
38
|
-
export const io = new SocketIOServer(server);
|
|
39
29
|
|
|
40
30
|
export async function startServer(config: ServerConfig) {
|
|
41
31
|
await runStartupTasks('before server config');
|
|
@@ -65,7 +55,7 @@ export async function startServer(config: ServerConfig) {
|
|
|
65
55
|
|
|
66
56
|
loadDefaultStarRoute(routes, app, config);
|
|
67
57
|
afterRequest(app, config);
|
|
68
|
-
initializeSocketIO(
|
|
58
|
+
initializeSocketIO(app, server);
|
|
69
59
|
|
|
70
60
|
await runStartupTasks('after server config');
|
|
71
61
|
if (config.onStartup) {
|
|
@@ -252,8 +242,8 @@ function afterRequest(app: express.Express, config: ServerConfig) {
|
|
|
252
242
|
}
|
|
253
243
|
}
|
|
254
244
|
|
|
255
|
-
function initializeSocketIO(
|
|
256
|
-
const
|
|
245
|
+
function initializeSocketIO(app: express.Express, server: HttpServer) {
|
|
246
|
+
const io = SocketIOServerRepo.createSocketIOServer(server);
|
|
257
247
|
|
|
258
248
|
// Share session and passport middleware with Socket.IO
|
|
259
249
|
const wrapMiddleware = (middleware: any) => (socket: any, next: any) => middleware(socket.request, {}, next);
|
|
@@ -271,36 +261,12 @@ function initializeSocketIO(io: SocketIOServer, app: express.Express) {
|
|
|
271
261
|
}
|
|
272
262
|
});
|
|
273
263
|
|
|
274
|
-
//
|
|
264
|
+
// Map this socket to the session id so it can be closed when the session is destroyed
|
|
275
265
|
io.on('connection', (socket: ExtendedSocket) => {
|
|
276
|
-
const userInfo = `${socket.request.user} (${socket.id})`;
|
|
277
|
-
socketLogger.info({ message: `User connected: ${userInfo}` });
|
|
278
|
-
|
|
279
|
-
// Map this socket to the session id so it can be closed when the session is destroyed
|
|
280
266
|
const sessionId = socket.request.sessionID;
|
|
281
267
|
if (sessionId) {
|
|
282
268
|
socket.join(sessionId);
|
|
283
269
|
}
|
|
284
|
-
|
|
285
|
-
socket.on('disconnect', (reason) => {
|
|
286
|
-
socketLogger.info({ message: `User disconnected: ${userInfo}. Reason: ${reason}` });
|
|
287
|
-
});
|
|
288
|
-
|
|
289
|
-
socket.on('error', (error) => {
|
|
290
|
-
socketLogger.error({ message: `Socket error for user: ${userInfo}`, error });
|
|
291
|
-
});
|
|
292
|
-
|
|
293
|
-
socket.conn.on('error', (error) => {
|
|
294
|
-
socketLogger.error({ message: `Socket connection error for user: ${userInfo}`, error });
|
|
295
|
-
});
|
|
296
|
-
});
|
|
297
|
-
|
|
298
|
-
// Handle server-level errors
|
|
299
|
-
io.engine.on('connection_error', (error) => {
|
|
300
|
-
socketLogger.error({
|
|
301
|
-
message: 'Connection error',
|
|
302
|
-
error: { message: error.message, code: error.code, context: error.context },
|
|
303
|
-
});
|
|
304
270
|
});
|
|
305
271
|
}
|
|
306
272
|
|