@proteinjs/server 1.6.1 → 1.7.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 +11 -0
- package/LICENSE +21 -0
- package/dist/generated/index.d.ts +1 -1
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/generated/index.js +2 -2
- 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/Request.d.ts +13 -0
- package/dist/src/Request.d.ts.map +1 -0
- package/dist/src/Request.js +47 -0
- package/dist/src/Request.js.map +1 -0
- package/dist/src/loadRoutes.d.ts.map +1 -1
- package/dist/src/loadRoutes.js +145 -103
- package/dist/src/loadRoutes.js.map +1 -1
- package/dist/src/startServer.js +52 -44
- package/dist/src/startServer.js.map +1 -1
- package/generated/index.ts +8 -11
- package/index.ts +1 -0
- package/package.json +6 -5
- package/src/Request.ts +50 -0
- package/src/loadRoutes.ts +80 -49
- package/src/startServer.ts +39 -45
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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
|
+
# [1.7.0](https://github.com/proteinjs/server/compare/@proteinjs/server@1.6.1...@proteinjs/server@1.7.0) (2024-08-16)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* added `Request` to track request metadata in an async_hook ([c87cb0a](https://github.com/proteinjs/server/commit/c87cb0aaf1da85f36ca560e8e2c5e062bb98bf1c))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [1.6.0](https://github.com/proteinjs/server/compare/@proteinjs/server@1.5.3...@proteinjs/server@1.6.0) (2024-08-02)
|
|
7
18
|
|
|
8
19
|
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Brent Bahry
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** Load Dependency Source Graphs */
|
|
2
2
|
import '@pmmmwh/react-refresh-webpack-plugin';
|
|
3
|
+
import '@proteinjs/logger';
|
|
3
4
|
import '@proteinjs/reflection';
|
|
4
5
|
import '@proteinjs/server-api';
|
|
5
|
-
import '@proteinjs/util';
|
|
6
6
|
import '@proteinjs/util-node';
|
|
7
7
|
import 'body-parser';
|
|
8
8
|
import 'buffer';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../generated/index.ts"],"names":[],"mappings":"AAAA,oCAAoC;AAEpC,OAAO,sCAAsC,CAAC;AAC9C,OAAO,
|
|
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"}
|
package/dist/generated/index.js
CHANGED
|
@@ -16,9 +16,9 @@ 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/logger");
|
|
19
20
|
require("@proteinjs/reflection");
|
|
20
21
|
require("@proteinjs/server-api");
|
|
21
|
-
require("@proteinjs/util");
|
|
22
22
|
require("@proteinjs/util-node");
|
|
23
23
|
require("body-parser");
|
|
24
24
|
require("buffer");
|
|
@@ -48,7 +48,7 @@ require("webpack");
|
|
|
48
48
|
require("webpack-dev-middleware");
|
|
49
49
|
require("webpack-hot-middleware");
|
|
50
50
|
/** 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\":\"/
|
|
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
52
|
/** Generate Source Links */
|
|
53
53
|
var NodeGlobalDataStorage_1 = require("../src/NodeGlobalDataStorage");
|
|
54
54
|
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,iCAA+B;AAC/B,iCAA+B;AAC/B,
|
|
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,g/MAAg/M,CAAC;AAGrgN,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"}
|
|
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"}
|
package/dist/index.js
CHANGED
|
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./src/startServer"), exports);
|
|
18
18
|
__exportStar(require("./src/envCache"), exports);
|
|
19
|
+
__exportStar(require("./src/Request"), exports);
|
|
19
20
|
//# 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"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,iDAA+B;AAC/B,gDAA8B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type RequestMetadata = {
|
|
2
|
+
number: number;
|
|
3
|
+
id: string;
|
|
4
|
+
url: string;
|
|
5
|
+
};
|
|
6
|
+
export declare class Request {
|
|
7
|
+
private static HOOK_INITIALIZED;
|
|
8
|
+
private static readonly REQUEST_METADATA;
|
|
9
|
+
setMetadata(data: RequestMetadata): void;
|
|
10
|
+
getMetadata(): RequestMetadata;
|
|
11
|
+
private initHook;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=Request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Request.d.ts","sourceRoot":"","sources":["../../src/Request.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,qBAAa,OAAO;IAClB,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAS;IACxC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAyC;IAEjF,WAAW,CAAC,IAAI,EAAE,eAAe;IAYjC,WAAW,IAAI,eAAe;IAQ9B,OAAO,CAAC,QAAQ;CAiBjB"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Request = void 0;
|
|
7
|
+
var async_hooks_1 = __importDefault(require("async_hooks"));
|
|
8
|
+
var Request = /** @class */ (function () {
|
|
9
|
+
function Request() {
|
|
10
|
+
}
|
|
11
|
+
Request.prototype.setMetadata = function (data) {
|
|
12
|
+
if (!Request.HOOK_INITIALIZED) {
|
|
13
|
+
this.initHook();
|
|
14
|
+
}
|
|
15
|
+
if (Request.REQUEST_METADATA[async_hooks_1.default.executionAsyncId()]) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
Request.REQUEST_METADATA[async_hooks_1.default.executionAsyncId()] = data;
|
|
19
|
+
};
|
|
20
|
+
Request.prototype.getMetadata = function () {
|
|
21
|
+
if (!Request.HOOK_INITIALIZED) {
|
|
22
|
+
this.initHook();
|
|
23
|
+
}
|
|
24
|
+
return Request.REQUEST_METADATA[async_hooks_1.default.executionAsyncId()];
|
|
25
|
+
};
|
|
26
|
+
Request.prototype.initHook = function () {
|
|
27
|
+
async_hooks_1.default
|
|
28
|
+
.createHook({
|
|
29
|
+
init: function (asyncId, type, triggerAsyncId, resource) {
|
|
30
|
+
if (!Request.REQUEST_METADATA[triggerAsyncId]) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
Request.REQUEST_METADATA[asyncId] = Request.REQUEST_METADATA[triggerAsyncId];
|
|
34
|
+
},
|
|
35
|
+
destroy: function (asyncId) {
|
|
36
|
+
delete Request.REQUEST_METADATA[asyncId];
|
|
37
|
+
},
|
|
38
|
+
})
|
|
39
|
+
.enable();
|
|
40
|
+
Request.HOOK_INITIALIZED = true;
|
|
41
|
+
};
|
|
42
|
+
Request.HOOK_INITIALIZED = false;
|
|
43
|
+
Request.REQUEST_METADATA = {};
|
|
44
|
+
return Request;
|
|
45
|
+
}());
|
|
46
|
+
exports.Request = Request;
|
|
47
|
+
//# sourceMappingURL=Request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Request.js","sourceRoot":"","sources":["../../src/Request.ts"],"names":[],"mappings":";;;;;;AAAA,4DAAqC;AAQrC;IAAA;IAyCA,CAAC;IArCC,6BAAW,GAAX,UAAY,IAAqB;QAC/B,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE;YAC7B,IAAI,CAAC,QAAQ,EAAE,CAAC;SACjB;QAED,IAAI,OAAO,CAAC,gBAAgB,CAAC,qBAAU,CAAC,gBAAgB,EAAE,CAAC,EAAE;YAC3D,OAAO;SACR;QAED,OAAO,CAAC,gBAAgB,CAAC,qBAAU,CAAC,gBAAgB,EAAE,CAAC,GAAG,IAAI,CAAC;IACjE,CAAC;IAED,6BAAW,GAAX;QACE,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE;YAC7B,IAAI,CAAC,QAAQ,EAAE,CAAC;SACjB;QAED,OAAO,OAAO,CAAC,gBAAgB,CAAC,qBAAU,CAAC,gBAAgB,EAAE,CAAC,CAAC;IACjE,CAAC;IAEO,0BAAQ,GAAhB;QACE,qBAAU;aACP,UAAU,CAAC;YACV,IAAI,EAAE,UAAC,OAAe,EAAE,IAAY,EAAE,cAAsB,EAAE,QAAgB;gBAC5E,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,cAAc,CAAC,EAAE;oBAC7C,OAAO;iBACR;gBAED,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;YAC/E,CAAC;YACD,OAAO,EAAE,UAAC,OAAe;gBACvB,OAAO,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;YAC3C,CAAC;SACF,CAAC;aACD,MAAM,EAAE,CAAC;QACZ,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAClC,CAAC;IAvCc,wBAAgB,GAAG,KAAK,CAAC;IAChB,wBAAgB,GAAsC,EAAE,CAAC;IAuCnF,cAAC;CAAA,AAzCD,IAyCC;AAzCY,0BAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadRoutes.d.ts","sourceRoot":"","sources":["../../src/loadRoutes.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EACL,YAAY,EACZ,KAAK,EAKN,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"loadRoutes.d.ts","sourceRoot":"","sources":["../../src/loadRoutes.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EACL,YAAY,EACZ,KAAK,EAKN,MAAM,uBAAuB,CAAC;AAQ/B,wBAAgB,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,QA4BxF;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,QAalG"}
|
package/dist/src/loadRoutes.js
CHANGED
|
@@ -40,17 +40,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
40
40
|
};
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
42
|
exports.loadDefaultStarRoute = exports.loadRoutes = void 0;
|
|
43
|
-
var
|
|
43
|
+
var crypto_1 = __importDefault(require("crypto"));
|
|
44
44
|
var server_api_1 = require("@proteinjs/server-api");
|
|
45
45
|
var reactApp_1 = require("./routes/reactApp");
|
|
46
|
-
var
|
|
47
|
-
var
|
|
46
|
+
var logger_1 = require("@proteinjs/logger");
|
|
47
|
+
var Request_1 = require("./Request");
|
|
48
|
+
var logger = new logger_1.Logger({ name: 'Server' });
|
|
49
|
+
var requestCounter = 0;
|
|
48
50
|
function loadRoutes(routes, server, config) {
|
|
49
51
|
var starRoute = null;
|
|
50
52
|
var wildcardRoutes = [];
|
|
51
53
|
for (var _i = 0, routes_1 = routes; _i < routes_1.length; _i++) {
|
|
52
54
|
var route = routes_1[_i];
|
|
53
|
-
logger.info("Loading route: ".concat(route.path));
|
|
55
|
+
logger.info({ message: "Loading route: ".concat(route.path) });
|
|
54
56
|
if (route.path == '*') {
|
|
55
57
|
starRoute = route;
|
|
56
58
|
continue;
|
|
@@ -82,7 +84,7 @@ function loadDefaultStarRoute(routes, server, config) {
|
|
|
82
84
|
}
|
|
83
85
|
if (!starRouteSpecified && (((_a = config.staticContent) === null || _a === void 0 ? void 0 : _a.bundlePaths) || ((_b = config.staticContent) === null || _b === void 0 ? void 0 : _b.bundlesDir))) {
|
|
84
86
|
var reactApp = (0, reactApp_1.createReactApp)(config);
|
|
85
|
-
server[reactApp.method](reactApp.path, wrapRoute(reactApp.onRequest, config));
|
|
87
|
+
server[reactApp.method](reactApp.path, wrapRoute(reactApp.onRequest.bind(reactApp), config));
|
|
86
88
|
}
|
|
87
89
|
}
|
|
88
90
|
exports.loadDefaultStarRoute = loadDefaultStarRoute;
|
|
@@ -91,116 +93,74 @@ function getPath(path) {
|
|
|
91
93
|
}
|
|
92
94
|
function wrapRoute(route, config) {
|
|
93
95
|
return function (request, response, next) {
|
|
94
|
-
var _a;
|
|
95
96
|
return __awaiter(this, void 0, void 0, function () {
|
|
96
|
-
var
|
|
97
|
-
return __generator(this, function (
|
|
98
|
-
switch (
|
|
97
|
+
var requestNumber, requestId, sessionData, _i, _a, sessionDataCache, _b, _c, message, error_1, message;
|
|
98
|
+
return __generator(this, function (_d) {
|
|
99
|
+
switch (_d.label) {
|
|
99
100
|
case 0:
|
|
100
101
|
if (response.locals['responseHandled']) {
|
|
101
102
|
next();
|
|
102
103
|
return [2 /*return*/];
|
|
103
104
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
105
|
+
requestNumber = ++requestCounter;
|
|
106
|
+
requestId = crypto_1.default.randomBytes(8).toString('hex');
|
|
107
|
+
// Set metadata into request async-hook storage
|
|
108
|
+
new Request_1.Request().setMetadata({
|
|
109
|
+
number: requestNumber,
|
|
110
|
+
id: requestId,
|
|
111
|
+
url: request.originalUrl,
|
|
112
|
+
});
|
|
113
|
+
sessionData = { sessionId: request.sessionID, user: request.user, data: {} };
|
|
114
|
+
_i = 0, _a = (0, server_api_1.getSessionDataCaches)();
|
|
115
|
+
_d.label = 1;
|
|
113
116
|
case 1:
|
|
114
|
-
|
|
115
|
-
|
|
117
|
+
if (!(_i < _a.length)) return [3 /*break*/, 4];
|
|
118
|
+
sessionDataCache = _a[_i];
|
|
119
|
+
_b = sessionData.data;
|
|
120
|
+
_c = sessionDataCache.key;
|
|
121
|
+
return [4 /*yield*/, sessionDataCache.create(sessionData.sessionId, sessionData.user)];
|
|
116
122
|
case 2:
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
_g.label = 3;
|
|
123
|
+
_b[_c] = _d.sent();
|
|
124
|
+
_d.label = 3;
|
|
120
125
|
case 3:
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
_c = sessionData.data;
|
|
124
|
-
_d = sessionDataCache.key;
|
|
125
|
-
return [4 /*yield*/, sessionDataCache.create(sessionData.sessionId, sessionData.user)];
|
|
126
|
+
_i++;
|
|
127
|
+
return [3 /*break*/, 1];
|
|
126
128
|
case 4:
|
|
127
|
-
|
|
128
|
-
|
|
129
|
+
server_api_1.Session.setData(sessionData);
|
|
130
|
+
if (shouldLogRequest(request, config)) {
|
|
131
|
+
message = "Started ".concat(request.originalUrl);
|
|
132
|
+
if (process.env.DEVELOPMENT) {
|
|
133
|
+
message = "[#".concat(requestNumber, "] ").concat(message);
|
|
134
|
+
}
|
|
135
|
+
logger.info({ message: message });
|
|
136
|
+
}
|
|
137
|
+
return [4 /*yield*/, runBeforeRequestListeners(request, response)];
|
|
129
138
|
case 5:
|
|
130
|
-
|
|
131
|
-
|
|
139
|
+
_d.sent();
|
|
140
|
+
setRequestTimeout(request, config, requestNumber);
|
|
141
|
+
_d.label = 6;
|
|
132
142
|
case 6:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
_e = 0, requestListeners_1 = requestListeners;
|
|
136
|
-
_g.label = 7;
|
|
143
|
+
_d.trys.push([6, 8, , 9]);
|
|
144
|
+
return [4 /*yield*/, route(request, response)];
|
|
137
145
|
case 7:
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
if (!listener.beforeRequest) {
|
|
141
|
-
return [3 /*break*/, 11];
|
|
142
|
-
}
|
|
143
|
-
_g.label = 8;
|
|
146
|
+
_d.sent();
|
|
147
|
+
return [3 /*break*/, 9];
|
|
144
148
|
case 8:
|
|
145
|
-
|
|
146
|
-
|
|
149
|
+
error_1 = _d.sent();
|
|
150
|
+
console.error(error_1);
|
|
151
|
+
return [3 /*break*/, 9];
|
|
147
152
|
case 9:
|
|
148
|
-
|
|
149
|
-
return [
|
|
153
|
+
response.locals['responseHandled'] = true;
|
|
154
|
+
return [4 /*yield*/, runAfterRequestListeners(request, response)];
|
|
150
155
|
case 10:
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
return [3 /*break*/, 7];
|
|
157
|
-
case 12:
|
|
158
|
-
sixtyMinutes = 1000 * 60 * 60;
|
|
159
|
-
timeout = typeof ((_a = config.request) === null || _a === void 0 ? void 0 : _a.timeoutMs) !== 'undefined' ? config.request.timeoutMs : sixtyMinutes;
|
|
160
|
-
request.setTimeout(timeout, function () {
|
|
161
|
-
if (response.locals.requestNumber) {
|
|
162
|
-
logger.warn("[#".concat(response.locals.requestNumber, "] Timed out ").concat(request.originalUrl));
|
|
163
|
-
}
|
|
164
|
-
else {
|
|
165
|
-
logger.warn("Timed out ".concat(request.originalUrl));
|
|
156
|
+
_d.sent();
|
|
157
|
+
if (shouldLogRequest(request, config)) {
|
|
158
|
+
message = "Finished ".concat(request.originalUrl);
|
|
159
|
+
if (process.env.DEVELOPMENT) {
|
|
160
|
+
message = "[#".concat(requestNumber, "] ").concat(message);
|
|
166
161
|
}
|
|
167
|
-
|
|
168
|
-
_g.label = 13;
|
|
169
|
-
case 13:
|
|
170
|
-
_g.trys.push([13, 15, , 16]);
|
|
171
|
-
return [4 /*yield*/, route(request, response)];
|
|
172
|
-
case 14:
|
|
173
|
-
_g.sent();
|
|
174
|
-
return [3 /*break*/, 16];
|
|
175
|
-
case 15:
|
|
176
|
-
error_2 = _g.sent();
|
|
177
|
-
console.error(error_2);
|
|
178
|
-
return [3 /*break*/, 16];
|
|
179
|
-
case 16:
|
|
180
|
-
response.locals['responseHandled'] = true;
|
|
181
|
-
_f = 0, requestListeners_2 = requestListeners;
|
|
182
|
-
_g.label = 17;
|
|
183
|
-
case 17:
|
|
184
|
-
if (!(_f < requestListeners_2.length)) return [3 /*break*/, 22];
|
|
185
|
-
listener = requestListeners_2[_f];
|
|
186
|
-
if (!listener.afterRequest) {
|
|
187
|
-
return [3 /*break*/, 21];
|
|
162
|
+
logger.info({ message: message });
|
|
188
163
|
}
|
|
189
|
-
_g.label = 18;
|
|
190
|
-
case 18:
|
|
191
|
-
_g.trys.push([18, 20, , 21]);
|
|
192
|
-
return [4 /*yield*/, listener.afterRequest(request, response)];
|
|
193
|
-
case 19:
|
|
194
|
-
_g.sent();
|
|
195
|
-
return [3 /*break*/, 21];
|
|
196
|
-
case 20:
|
|
197
|
-
error_3 = _g.sent();
|
|
198
|
-
logger.error("Caught error when running listener after request", error_3);
|
|
199
|
-
return [3 /*break*/, 21];
|
|
200
|
-
case 21:
|
|
201
|
-
_f++;
|
|
202
|
-
return [3 /*break*/, 17];
|
|
203
|
-
case 22:
|
|
204
164
|
next();
|
|
205
165
|
return [2 /*return*/];
|
|
206
166
|
}
|
|
@@ -208,12 +168,94 @@ function wrapRoute(route, config) {
|
|
|
208
168
|
});
|
|
209
169
|
};
|
|
210
170
|
}
|
|
211
|
-
function
|
|
212
|
-
var
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
171
|
+
function shouldLogRequest(request, config) {
|
|
172
|
+
var _a;
|
|
173
|
+
if ((_a = config.request) === null || _a === void 0 ? void 0 : _a.disableRequestLogging) {
|
|
174
|
+
return false;
|
|
175
|
+
}
|
|
176
|
+
if (request.path.startsWith('/static') || request.path.startsWith('/favicon.ico')) {
|
|
177
|
+
return false;
|
|
216
178
|
}
|
|
217
|
-
return
|
|
179
|
+
return true;
|
|
180
|
+
}
|
|
181
|
+
function setRequestTimeout(request, config, requestNumber) {
|
|
182
|
+
var _a;
|
|
183
|
+
var sixtyMinutes = 1000 * 60 * 60;
|
|
184
|
+
var timeout = typeof ((_a = config.request) === null || _a === void 0 ? void 0 : _a.timeoutMs) !== 'undefined' ? config.request.timeoutMs : sixtyMinutes;
|
|
185
|
+
request.setTimeout(timeout, function () {
|
|
186
|
+
var message = "Timed out ".concat(request.originalUrl);
|
|
187
|
+
if (process.env.DEVELOPMENT) {
|
|
188
|
+
message = "[#".concat(requestNumber, "] ").concat(message);
|
|
189
|
+
}
|
|
190
|
+
logger.warn({ message: message });
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
function runBeforeRequestListeners(request, response) {
|
|
194
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
195
|
+
var requestListeners, _i, requestListeners_1, listener, error_2;
|
|
196
|
+
return __generator(this, function (_a) {
|
|
197
|
+
switch (_a.label) {
|
|
198
|
+
case 0:
|
|
199
|
+
requestListeners = (0, server_api_1.getRequestListeners)();
|
|
200
|
+
_i = 0, requestListeners_1 = requestListeners;
|
|
201
|
+
_a.label = 1;
|
|
202
|
+
case 1:
|
|
203
|
+
if (!(_i < requestListeners_1.length)) return [3 /*break*/, 6];
|
|
204
|
+
listener = requestListeners_1[_i];
|
|
205
|
+
if (!listener.beforeRequest) {
|
|
206
|
+
return [3 /*break*/, 5];
|
|
207
|
+
}
|
|
208
|
+
_a.label = 2;
|
|
209
|
+
case 2:
|
|
210
|
+
_a.trys.push([2, 4, , 5]);
|
|
211
|
+
return [4 /*yield*/, listener.beforeRequest(request, response)];
|
|
212
|
+
case 3:
|
|
213
|
+
_a.sent();
|
|
214
|
+
return [3 /*break*/, 5];
|
|
215
|
+
case 4:
|
|
216
|
+
error_2 = _a.sent();
|
|
217
|
+
logger.error({ message: "Caught error when running listener before request", error: error_2 });
|
|
218
|
+
return [3 /*break*/, 5];
|
|
219
|
+
case 5:
|
|
220
|
+
_i++;
|
|
221
|
+
return [3 /*break*/, 1];
|
|
222
|
+
case 6: return [2 /*return*/];
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
function runAfterRequestListeners(request, response) {
|
|
228
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
229
|
+
var requestListeners, _i, requestListeners_2, listener, error_3;
|
|
230
|
+
return __generator(this, function (_a) {
|
|
231
|
+
switch (_a.label) {
|
|
232
|
+
case 0:
|
|
233
|
+
requestListeners = (0, server_api_1.getRequestListeners)();
|
|
234
|
+
_i = 0, requestListeners_2 = requestListeners;
|
|
235
|
+
_a.label = 1;
|
|
236
|
+
case 1:
|
|
237
|
+
if (!(_i < requestListeners_2.length)) return [3 /*break*/, 6];
|
|
238
|
+
listener = requestListeners_2[_i];
|
|
239
|
+
if (!listener.afterRequest) {
|
|
240
|
+
return [3 /*break*/, 5];
|
|
241
|
+
}
|
|
242
|
+
_a.label = 2;
|
|
243
|
+
case 2:
|
|
244
|
+
_a.trys.push([2, 4, , 5]);
|
|
245
|
+
return [4 /*yield*/, listener.afterRequest(request, response)];
|
|
246
|
+
case 3:
|
|
247
|
+
_a.sent();
|
|
248
|
+
return [3 /*break*/, 5];
|
|
249
|
+
case 4:
|
|
250
|
+
error_3 = _a.sent();
|
|
251
|
+
logger.error({ message: "Caught error when running listener after request", error: error_3 });
|
|
252
|
+
return [3 /*break*/, 5];
|
|
253
|
+
case 5:
|
|
254
|
+
_i++;
|
|
255
|
+
return [3 /*break*/, 1];
|
|
256
|
+
case 6: return [2 /*return*/];
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
});
|
|
218
260
|
}
|
|
219
261
|
//# sourceMappingURL=loadRoutes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadRoutes.js","sourceRoot":"","sources":["../../src/loadRoutes.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,
|
|
1
|
+
{"version":3,"file":"loadRoutes.js","sourceRoot":"","sources":["../../src/loadRoutes.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAA4B;AAC5B,oDAO+B;AAC/B,8CAAmD;AACnD,4CAA2C;AAC3C,qCAAoC;AAEpC,IAAM,MAAM,GAAG,IAAI,eAAM,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC9C,IAAI,cAAc,GAAW,CAAC,CAAC;AAE/B,SAAgB,UAAU,CAAC,MAAe,EAAE,MAAuB,EAAE,MAAoB;IACvF,IAAI,SAAS,GAAiB,IAAI,CAAC;IACnC,IAAM,cAAc,GAAY,EAAE,CAAC;IACnC,KAAoB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,EAAE;QAAvB,IAAM,KAAK,eAAA;QACd,MAAM,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,yBAAkB,KAAK,C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