ctx-router 1.0.0 → 1.0.1
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/ctx/ctx.router.d.ts +6 -1
- package/dist/ctx/ctx.router.d.ts.map +1 -1
- package/dist/ctx/ctx.router.js +21 -17
- package/dist/ctx/ctx.router.js.map +1 -1
- package/dist/defaultHandler/handle.beforeExec.d.ts +3 -0
- package/dist/defaultHandler/handle.beforeExec.d.ts.map +1 -0
- package/dist/defaultHandler/handle.beforeExec.js +11 -0
- package/dist/defaultHandler/handle.beforeExec.js.map +1 -0
- package/dist/defaultHandler/handle.onError.d.ts +4 -0
- package/dist/defaultHandler/handle.onError.d.ts.map +1 -0
- package/dist/defaultHandler/handle.onError.js +35 -0
- package/dist/defaultHandler/handle.onError.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/transform/fromExpress.d.ts +4 -0
- package/dist/transform/fromExpress.d.ts.map +1 -0
- package/dist/transform/fromExpress.js +22 -0
- package/dist/transform/fromExpress.js.map +1 -0
- package/dist/transform/index.d.ts +91 -0
- package/dist/transform/index.d.ts.map +1 -0
- package/dist/transform/index.js +121 -0
- package/dist/transform/index.js.map +1 -0
- package/package.json +1 -1
package/dist/ctx/ctx.router.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { CtxError } from "./ctx.err";
|
|
2
|
-
|
|
2
|
+
import { TCtx } from "./ctx.types";
|
|
3
|
+
export declare class CtxRouter<TContext extends TCtx> {
|
|
3
4
|
private routeObj;
|
|
4
5
|
private onErrorHandler;
|
|
6
|
+
private beforeExecHandler;
|
|
7
|
+
private onFinallyHandler;
|
|
8
|
+
beforeExec(handler: (ctx: TContext) => Promise<TContext>): void;
|
|
5
9
|
exec(method: string, path: string, ctx: TContext): Promise<TContext>;
|
|
6
10
|
handle(method: string, path: string, handler: (ctx: TContext) => Promise<TContext>): void;
|
|
7
11
|
onError(handler: (ctx: TContext, error: CtxError | Error | unknown) => Promise<TContext>): void;
|
|
12
|
+
onFinally(handler: (ctx: TContext) => Promise<TContext>): void;
|
|
8
13
|
}
|
|
9
14
|
//# sourceMappingURL=ctx.router.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ctx.router.d.ts","sourceRoot":"","sources":["../../src/ctx/ctx.router.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ctx.router.d.ts","sourceRoot":"","sources":["../../src/ctx/ctx.router.ts"],"names":[],"mappings":"AAEA,OAAO,EAAU,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAOnC,qBAAa,SAAS,CAAC,QAAQ,SAAS,IAAI;IAC1C,OAAO,CAAC,QAAQ,CAA2B;IAC3C,OAAO,CAAC,cAAc,CAG2B;IACjD,OAAO,CAAC,iBAAiB,CACI;IAC7B,OAAO,CAAC,gBAAgB,CAItB;IAEF,UAAU,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,QAAQ,KAAK,OAAO,CAAC,QAAQ,CAAC;IAIlD,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IAiB1E,MAAM,CACJ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,CAAC,GAAG,EAAE,QAAQ,KAAK,OAAO,CAAC,QAAQ,CAAC;IAM/C,OAAO,CACL,OAAO,EAAE,CACP,GAAG,EAAE,QAAQ,EACb,KAAK,EAAE,QAAQ,GAAG,KAAK,GAAG,OAAO,KAC9B,OAAO,CAAC,QAAQ,CAAC;IAIxB,SAAS,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,QAAQ,KAAK,OAAO,CAAC,QAAQ,CAAC;CAGxD"}
|
package/dist/ctx/ctx.router.js
CHANGED
|
@@ -1,28 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CtxRouter = void 0;
|
|
4
|
+
const handle_beforeExec_1 = require("../defaultHandler/handle.beforeExec");
|
|
5
|
+
const handle_onError_1 = require("../defaultHandler/handle.onError");
|
|
4
6
|
const ctx_err_1 = require("./ctx.err");
|
|
5
7
|
class CtxRouter {
|
|
6
8
|
constructor() {
|
|
7
9
|
this.routeObj = {};
|
|
8
|
-
this.onErrorHandler =
|
|
9
|
-
|
|
10
|
+
this.onErrorHandler = (handle_onError_1.handleOnError);
|
|
11
|
+
this.beforeExecHandler = (handle_beforeExec_1.handleBeforeExec);
|
|
12
|
+
this.onFinallyHandler = async (ctx) => {
|
|
10
13
|
return ctx;
|
|
11
14
|
};
|
|
12
15
|
}
|
|
16
|
+
beforeExec(handler) {
|
|
17
|
+
this.beforeExecHandler = handler;
|
|
18
|
+
}
|
|
13
19
|
async exec(method, path, ctx) {
|
|
14
|
-
const handler = this.routeObj[method]?.[path];
|
|
15
|
-
if (!handler) {
|
|
16
|
-
throw ctx_err_1.ctxErr.general.handlerNotFound({
|
|
17
|
-
data: { method, path },
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
20
|
try {
|
|
21
|
+
await this.beforeExecHandler(ctx);
|
|
22
|
+
const handler = this.routeObj[method]?.[path];
|
|
23
|
+
if (!handler) {
|
|
24
|
+
throw ctx_err_1.ctxErr.general.handlerNotFound({
|
|
25
|
+
data: { method, path },
|
|
26
|
+
});
|
|
27
|
+
}
|
|
21
28
|
return await handler(ctx);
|
|
22
29
|
}
|
|
23
30
|
catch (error) {
|
|
24
31
|
return await this.onErrorHandler(ctx, error);
|
|
25
32
|
}
|
|
33
|
+
finally {
|
|
34
|
+
await this.onFinallyHandler(ctx);
|
|
35
|
+
}
|
|
26
36
|
}
|
|
27
37
|
handle(method, path, handler) {
|
|
28
38
|
const methodRoute = this.routeObj[method] || (this.routeObj[method] = {});
|
|
@@ -31,15 +41,9 @@ class CtxRouter {
|
|
|
31
41
|
onError(handler) {
|
|
32
42
|
this.onErrorHandler = handler;
|
|
33
43
|
}
|
|
44
|
+
onFinally(handler) {
|
|
45
|
+
this.onFinallyHandler = handler;
|
|
46
|
+
}
|
|
34
47
|
}
|
|
35
48
|
exports.CtxRouter = CtxRouter;
|
|
36
|
-
const ctxRouter = new CtxRouter();
|
|
37
|
-
async function handler(ctx) {
|
|
38
|
-
console.log(ctx);
|
|
39
|
-
return ctx;
|
|
40
|
-
}
|
|
41
|
-
ctxRouter.handle("GET", "/", handler);
|
|
42
|
-
ctxRouter.handle("GET", "/instance/ping", handler);
|
|
43
|
-
ctxRouter.handle("GET", "/instance/health", handler);
|
|
44
|
-
ctxRouter.handle("POST", "/route/test", handler);
|
|
45
49
|
//# sourceMappingURL=ctx.router.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ctx.router.js","sourceRoot":"","sources":["../../src/ctx/ctx.router.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ctx.router.js","sourceRoot":"","sources":["../../src/ctx/ctx.router.ts"],"names":[],"mappings":";;;AAAA,2EAAuE;AACvE,qEAAiE;AACjE,uCAA6C;AAQ7C,MAAa,SAAS;IAAtB;QACU,aAAQ,GAAwB,EAAE,CAAC;QACnC,mBAAc,GAGG,CAAA,8BAAuB,CAAA,CAAC;QACzC,sBAAiB,GACvB,CAAA,oCAA0B,CAAA,CAAC;QACrB,qBAAgB,GAAyC,KAAK,EACpE,GAAG,EACH,EAAE;YACF,OAAO,GAAG,CAAC;QACb,CAAC,CAAC;IA2CJ,CAAC;IAzCC,UAAU,CAAC,OAA6C;QACtD,IAAI,CAAC,iBAAiB,GAAG,OAAO,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,MAAc,EAAE,IAAY,EAAE,GAAa;QACpD,IAAI,CAAC;YACH,M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G,EAAE,QAAQ,GACZ,OAAO,CAAC,QAAQ,CAAC,CAYnB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleBeforeExec = handleBeforeExec;
|
|
4
|
+
async function handleBeforeExec(ctx) {
|
|
5
|
+
const reqPath = `${ctx.req.method} ${ctx.req.path}`;
|
|
6
|
+
console.log(`CtxReq: [${reqPath}] | [IP: ${ctx.req.ips || ctx.req.ip}] | [TraceId: ${ctx.meta.monitor.traceId}] | [SpanId: ${ctx.meta.monitor.spanId}]`);
|
|
7
|
+
console.log(`CtxUser: [Session: ${ctx.user.sessionId}] | [Seq: ${ctx.user.seq}]`);
|
|
8
|
+
console.log(`CtxMeta: [Seq: ${ctx.meta.instance.seq}] | [Inflight: ${ctx.meta.instance.inflight}]`);
|
|
9
|
+
return ctx;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=handle.beforeExec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handle.beforeExec.js","sourceRoot":"","sources":["../../src/defaultHandler/handle.beforeExec.ts"],"names":[],"mappings":";;AAEA,4CAcC;AAdM,KAAK,UAAU,gBAAgB,CACpC,GAAa;IAEb,MAAM,OAAO,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;IACpD,OAAO,CAAC,GAAG,CACT,YAAY,OAAO,YAAY,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,EAAE,iBAAiB,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,gBAAgB,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAC5I,CAAC;IACF,OAAO,CAAC,GAAG,CACT,sBAAsB,GAAG,CAAC,IAAI,CAAC,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CACrE,CAAC;IACF,OAAO,CAAC,GAAG,CACT,kBAAkB,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,kBAAkB,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,GAAG,CACvF,CAAC;IACF,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handle.onError.d.ts","sourceRoot":"","sources":["../../src/defaultHandler/handle.onError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAU,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,wBAAsB,aAAa,CAAC,QAAQ,SAAS,IAAI,EACvD,GAAG,EAAE,QAAQ,EACb,CAAC,EAAE,QAAQ,GAAG,KAAK,GAAG,OAAO,GAC5B,OAAO,CAAC,QAAQ,CAAC,CA6BnB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleOnError = handleOnError;
|
|
4
|
+
const ctx_err_1 = require("../ctx/ctx.err");
|
|
5
|
+
async function handleOnError(ctx, e) {
|
|
6
|
+
if (e instanceof ctx_err_1.CtxError) {
|
|
7
|
+
console.log("CtxError:name:", e.name);
|
|
8
|
+
console.log("CtxError:message:", e.message);
|
|
9
|
+
console.log("CtxError:data:", e.data);
|
|
10
|
+
if (e.info) {
|
|
11
|
+
ctx.meta.monitor.stdout.push(JSON.stringify(e.info));
|
|
12
|
+
}
|
|
13
|
+
if (typeof e.info === "object") {
|
|
14
|
+
console.log("CtxError:info:object:", JSON.stringify(e.info));
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
console.log("CtxError:info:", e.info);
|
|
18
|
+
}
|
|
19
|
+
if (e.stack) {
|
|
20
|
+
console.log("CtxError:stack:", e.stack);
|
|
21
|
+
}
|
|
22
|
+
ctx.res = { code: e.name, msg: e.message, data: e.data };
|
|
23
|
+
return ctx;
|
|
24
|
+
}
|
|
25
|
+
// ideally should never come here, god forbid it did
|
|
26
|
+
console.log("CtxError:unknown:fatal", e);
|
|
27
|
+
const error = ctx_err_1.ctxErr.general.unknown();
|
|
28
|
+
ctx.res = {
|
|
29
|
+
code: error.name,
|
|
30
|
+
msg: error.message,
|
|
31
|
+
data: {},
|
|
32
|
+
};
|
|
33
|
+
return ctx;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=handle.onError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handle.onError.js","sourceRoot":"","sources":["../../src/defaultHandler/handle.onError.ts"],"names":[],"mappings":";;AAGA,sCAgCC;AAnCD,4CAAkD;AAG3C,KAAK,UAAU,aAAa,CACjC,GAAa,EACb,CAA6B;IAE7B,IAAI,CAAC,YAAY,kBAAQ,EAAE,CAAC;QAC1B,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;QACtC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;QAC5C,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;QACtC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;YACX,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QACvD,CAAC;QACD,IAAI,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC/B,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QAC/D,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;QACxC,CAAC;QACD,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC;YACZ,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;QAC1C,CAAC;QACD,GAAG,CAAC,GAAG,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QACzD,OAAO,GAAG,CAAC;IACb,CAAC;IAED,oDAAoD;IACpD,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE,CAAC,CAAC,CAAC;IACzC,MAAM,KAAK,GAAG,gBAAM,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;IACvC,GAAG,CAAC,GAAG,GAAG;QACR,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,GAAG,EAAE,KAAK,CAAC,OAAO;QAClB,IAAI,EAAE,EAAE;KACT,CAAC;IACF,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { TCtx, USER_ROLE, IBaseApi } from "./ctx/ctx.types";
|
|
2
|
-
import {
|
|
2
|
+
import { transformFromExpress } from "./transform/fromExpress";
|
|
3
3
|
import { CtxRouter } from "./ctx/ctx.router";
|
|
4
4
|
export type { TCtx, IBaseApi };
|
|
5
5
|
export { USER_ROLE, CtxRouter };
|
|
6
6
|
export declare namespace toCtx {
|
|
7
|
-
const fromExpress: typeof
|
|
7
|
+
const fromExpress: typeof transformFromExpress;
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;AAEhC,yBAAiB,KAAK,CAAC;IACd,MAAM,WAAW,6BAAuB,CAAC;CACjD"}
|
package/dist/index.js
CHANGED
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.toCtx = exports.CtxRouter = exports.USER_ROLE = void 0;
|
|
4
4
|
const ctx_types_1 = require("./ctx/ctx.types");
|
|
5
5
|
Object.defineProperty(exports, "USER_ROLE", { enumerable: true, get: function () { return ctx_types_1.USER_ROLE; } });
|
|
6
|
-
const
|
|
6
|
+
const fromExpress_1 = require("./transform/fromExpress");
|
|
7
7
|
const ctx_router_1 = require("./ctx/ctx.router");
|
|
8
8
|
Object.defineProperty(exports, "CtxRouter", { enumerable: true, get: function () { return ctx_router_1.CtxRouter; } });
|
|
9
9
|
var toCtx;
|
|
10
10
|
(function (toCtx) {
|
|
11
|
-
toCtx.fromExpress =
|
|
11
|
+
toCtx.fromExpress = fromExpress_1.transformFromExpress;
|
|
12
12
|
})(toCtx || (exports.toCtx = toCtx = {}));
|
|
13
13
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,+CAA4D;AAKnD,0FALM,qBAAS,OAKN;AAJlB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,+CAA4D;AAKnD,0FALM,qBAAS,OAKN;AAJlB,yDAA+D;AAC/D,iDAA6C;AAGzB,0FAHX,sBAAS,OAGW;AAE7B,IAAiB,KAAK,CAErB;AAFD,WAAiB,KAAK;IACP,iBAAW,GAAG,kCAAoB,CAAC;AAClD,CAAC,EAFgB,KAAK,qBAAL,KAAK,QAErB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fromExpress.d.ts","sourceRoot":"","sources":["../../src/transform/fromExpress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AASxC,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAUvD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.transformFromExpress = transformFromExpress;
|
|
4
|
+
const _1 = require(".");
|
|
5
|
+
function getPath(url) {
|
|
6
|
+
const queryParamPos = url.indexOf("?");
|
|
7
|
+
if (queryParamPos === -1)
|
|
8
|
+
return url;
|
|
9
|
+
return url.substring(0, queryParamPos);
|
|
10
|
+
}
|
|
11
|
+
function transformFromExpress(req) {
|
|
12
|
+
const ctx = (0, _1.buildCtx)({
|
|
13
|
+
method: req.method,
|
|
14
|
+
path: getPath(req.url),
|
|
15
|
+
header: req.headers,
|
|
16
|
+
data: req.method === "POST" ? req.body || {} : req.query || {},
|
|
17
|
+
ip: req.ip || "",
|
|
18
|
+
ips: req.ips || [],
|
|
19
|
+
});
|
|
20
|
+
return ctx;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=fromExpress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fromExpress.js","sourceRoot":"","sources":["../../src/transform/fromExpress.ts"],"names":[],"mappings":";;AAUA,oDAUC;AAlBD,wBAA6B;AAE7B,SAAS,OAAO,CAAC,GAAW;IAC1B,MAAM,aAAa,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACvC,IAAI,aAAa,KAAK,CAAC,CAAC;QAAE,OAAO,GAAG,CAAC;IACrC,OAAO,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;AACzC,CAAC;AAED,SAAgB,oBAAoB,CAAC,GAAY;IAC/C,MAAM,GAAG,GAAG,IAAA,WAAQ,EAAC;QACnB,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;QACtB,MAAM,EAAE,GAAG,CAAC,OAAO;QACnB,IAAI,EAAE,GAAG,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE;QAC9D,EAAE,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE;QAChB,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI,EAAE;KACnB,CAAC,CAAC;IACH,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { TCtx, USER_ROLE } from "../ctx/ctx.types";
|
|
2
|
+
type TCtxBuild = {
|
|
3
|
+
method: string;
|
|
4
|
+
path: string;
|
|
5
|
+
header: Record<string, string | string[] | undefined>;
|
|
6
|
+
data: Record<string, unknown>;
|
|
7
|
+
ip: string;
|
|
8
|
+
ips: string[];
|
|
9
|
+
};
|
|
10
|
+
export declare function buildCtx(ctxRaw: TCtxBuild): {
|
|
11
|
+
id: string;
|
|
12
|
+
meta: {
|
|
13
|
+
serviceName: string;
|
|
14
|
+
instance: {
|
|
15
|
+
id: string;
|
|
16
|
+
createdAt: Date;
|
|
17
|
+
seq: number;
|
|
18
|
+
inflight: number;
|
|
19
|
+
};
|
|
20
|
+
ts: {
|
|
21
|
+
in: Date;
|
|
22
|
+
clientIn: Date;
|
|
23
|
+
owd: number;
|
|
24
|
+
out?: Date;
|
|
25
|
+
execTime?: number;
|
|
26
|
+
};
|
|
27
|
+
monitor: {
|
|
28
|
+
traceId: string;
|
|
29
|
+
spanId: string;
|
|
30
|
+
stdout: string[];
|
|
31
|
+
dbLog: string[];
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
req: {
|
|
35
|
+
header: {
|
|
36
|
+
authorization?: string;
|
|
37
|
+
"x-ctx-device-name"?: string;
|
|
38
|
+
"x-ctx-device-id"?: string;
|
|
39
|
+
"x-ctx-os"?: string;
|
|
40
|
+
"x-ctx-app-version"?: string;
|
|
41
|
+
"x-ctx-api-version"?: string;
|
|
42
|
+
"x-ctx-session-id"?: string;
|
|
43
|
+
"x-ctx-seq"?: string;
|
|
44
|
+
"x-ctx-refresh-token"?: string;
|
|
45
|
+
[key: string]: string | string[] | undefined;
|
|
46
|
+
};
|
|
47
|
+
method: string;
|
|
48
|
+
path: string;
|
|
49
|
+
data: {
|
|
50
|
+
userId?: string;
|
|
51
|
+
[key: string]: unknown;
|
|
52
|
+
};
|
|
53
|
+
ip: string;
|
|
54
|
+
ips: string[];
|
|
55
|
+
};
|
|
56
|
+
user: {
|
|
57
|
+
id: string;
|
|
58
|
+
role: keyof typeof USER_ROLE;
|
|
59
|
+
deviceName: string;
|
|
60
|
+
deviceId: string;
|
|
61
|
+
os: string;
|
|
62
|
+
appVersion: string;
|
|
63
|
+
sessionId: string;
|
|
64
|
+
seq: number;
|
|
65
|
+
apiVersion: string;
|
|
66
|
+
auth: {
|
|
67
|
+
token: string;
|
|
68
|
+
refresh: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
res: {
|
|
72
|
+
code: string;
|
|
73
|
+
msg: string;
|
|
74
|
+
data: {
|
|
75
|
+
[key: string]: unknown;
|
|
76
|
+
};
|
|
77
|
+
meta?: {
|
|
78
|
+
ctxId: string;
|
|
79
|
+
seq: number;
|
|
80
|
+
traceId: string;
|
|
81
|
+
spanId: string;
|
|
82
|
+
inTime: Date;
|
|
83
|
+
outTime: Date;
|
|
84
|
+
execTime: number;
|
|
85
|
+
owd: number;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
export declare function doneCtx(ctx: TCtx): Promise<void>;
|
|
90
|
+
export {};
|
|
91
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/transform/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAanD,KAAK,SAAS,GAAG;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC;IACtD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,EAAE,CAAC;CACf,CAAC;AAEF,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS;;;;;;;;;;;;;;eAgBR,CAAC;oBAAoB,CAAC;;;;;;;;;;;yBAlC/C,CAAC;+BAAiC,CAAC;6BACpB,CAAC;sBACF,CAAC;+BAAiC,CAAC;+BAGvD,CAAC;8BACE,CAAC;uBAAyB,CAAC;iCAG3B,CAAC;;;;;;kBAIK,CAAC;;;;;;;;oBA4BH,gBAEP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAlBF;AAED,wBAAsB,OAAO,CAAC,GAAG,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAStD"}
|
|
@@ -0,0 +1,121 @@
|
|
|
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.buildCtx = buildCtx;
|
|
7
|
+
exports.doneCtx = doneCtx;
|
|
8
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
9
|
+
const ctx_types_1 = require("../ctx/ctx.types");
|
|
10
|
+
const INSTANCE = {
|
|
11
|
+
ID: crypto_1.default.randomBytes(5).toString("hex"),
|
|
12
|
+
TRACE_ID: crypto_1.default.randomBytes(5).toString("hex"),
|
|
13
|
+
CREATED_AT: new Date(),
|
|
14
|
+
SERVICE_NAME: process.env.SERVICE_NAME || "fantasy-service",
|
|
15
|
+
SEQ: 0,
|
|
16
|
+
INFLIGHT: 0,
|
|
17
|
+
LAST_HEARTBEAT: new Date(),
|
|
18
|
+
PORT: parseInt(process.env.SERVICE_PORT || "3000", 10),
|
|
19
|
+
};
|
|
20
|
+
function buildCtx(ctxRaw) {
|
|
21
|
+
const meta = buildMeta(ctxRaw);
|
|
22
|
+
const req = buildReq(ctxRaw);
|
|
23
|
+
const user = buildUser(ctxRaw);
|
|
24
|
+
const res = buildRes();
|
|
25
|
+
const id = meta.monitor.traceId;
|
|
26
|
+
return { id, meta, req, user, res };
|
|
27
|
+
}
|
|
28
|
+
async function doneCtx(ctx) {
|
|
29
|
+
ctx.meta.ts.out = new Date();
|
|
30
|
+
ctx.meta.ts.execTime = ctx.meta.ts.out.getTime() - ctx.meta.ts.in.getTime();
|
|
31
|
+
// Log context using ctxLogger
|
|
32
|
+
// await logCtx(ctx);
|
|
33
|
+
setResMeta(ctx);
|
|
34
|
+
// decrease the number of request inflight when response of this request goes out
|
|
35
|
+
INSTANCE.INFLIGHT--;
|
|
36
|
+
}
|
|
37
|
+
function buildMeta(ctxRaw) {
|
|
38
|
+
const inTime = new Date();
|
|
39
|
+
++INSTANCE.SEQ;
|
|
40
|
+
++INSTANCE.INFLIGHT;
|
|
41
|
+
// Extract clientIn from header and validate if it's a valid date using IIFE
|
|
42
|
+
const clientIn = (() => {
|
|
43
|
+
const dtStr = ctxRaw.header["x-ctx-ts"];
|
|
44
|
+
if (typeof dtStr !== "string")
|
|
45
|
+
return inTime;
|
|
46
|
+
const dt = new Date(dtStr);
|
|
47
|
+
if (isNaN(dt.getTime()))
|
|
48
|
+
return inTime;
|
|
49
|
+
return dt;
|
|
50
|
+
})();
|
|
51
|
+
return {
|
|
52
|
+
serviceName: INSTANCE.SERVICE_NAME,
|
|
53
|
+
instance: {
|
|
54
|
+
id: INSTANCE.ID,
|
|
55
|
+
createdAt: INSTANCE.CREATED_AT,
|
|
56
|
+
seq: INSTANCE.SEQ,
|
|
57
|
+
inflight: INSTANCE.INFLIGHT,
|
|
58
|
+
},
|
|
59
|
+
ts: {
|
|
60
|
+
in: inTime,
|
|
61
|
+
clientIn: clientIn,
|
|
62
|
+
owd: inTime.getTime() - clientIn.getTime(),
|
|
63
|
+
},
|
|
64
|
+
monitor: {
|
|
65
|
+
traceId: `${INSTANCE.ID}-${INSTANCE.SEQ}`,
|
|
66
|
+
spanId: `${INSTANCE.ID}-${INSTANCE.SEQ}`,
|
|
67
|
+
stdout: [],
|
|
68
|
+
dbLog: [],
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function buildReq(data) {
|
|
73
|
+
return {
|
|
74
|
+
method: data.method,
|
|
75
|
+
path: data.path,
|
|
76
|
+
header: data.header,
|
|
77
|
+
data: data.data,
|
|
78
|
+
ip: data.ip,
|
|
79
|
+
ips: data.ips,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function buildUser(ctxRaw) {
|
|
83
|
+
const header = ctxRaw.header;
|
|
84
|
+
const clientSeq = Number(header["x-ctx-seq"]);
|
|
85
|
+
return {
|
|
86
|
+
id: "none",
|
|
87
|
+
role: ctx_types_1.USER_ROLE.none,
|
|
88
|
+
seq: isNaN(clientSeq) ? 0 : clientSeq,
|
|
89
|
+
sessionId: String(header["x-ctx-session-id"] || "none"),
|
|
90
|
+
deviceId: String(header["x-ctx-device-id"] || "none"),
|
|
91
|
+
deviceName: String(header["x-ctx-device-name"] || "none"),
|
|
92
|
+
appVersion: String(header["x-ctx-app-version"] || "none"),
|
|
93
|
+
os: String(header["x-ctx-os"] || "none"),
|
|
94
|
+
apiVersion: String(header["x-ctx-api-version"] || "none"),
|
|
95
|
+
auth: {
|
|
96
|
+
token: String(header["authorization"] || header["Authorization"] || "none"),
|
|
97
|
+
refresh: String(header["x-ctx-refresh-token"] || "none"),
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
function buildRes() {
|
|
102
|
+
return {
|
|
103
|
+
code: "OK",
|
|
104
|
+
msg: "OK",
|
|
105
|
+
data: {},
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
function setResMeta(ctx) {
|
|
109
|
+
const meta = ctx.meta;
|
|
110
|
+
ctx.res.meta = {
|
|
111
|
+
ctxId: ctx.id,
|
|
112
|
+
seq: ctx.user.seq,
|
|
113
|
+
traceId: meta.monitor.traceId,
|
|
114
|
+
spanId: meta.monitor.spanId,
|
|
115
|
+
inTime: meta.ts.in,
|
|
116
|
+
outTime: meta.ts.out,
|
|
117
|
+
execTime: meta.ts.execTime,
|
|
118
|
+
owd: meta.ts.owd,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/transform/index.ts"],"names":[],"mappings":";;;;;AAuBA,4BAOC;AAED,0BASC;AAzCD,oDAA4B;AAC5B,gDAAmD;AAEnD,MAAM,QAAQ,GAAG;IACf,EAAE,EAAE,gBAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;IACzC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