@decaf-ts/for-nest 0.2.39 → 0.2.40
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/README.md +1 -1
- package/dist/for-nest.cjs +1 -1
- package/dist/for-nest.cjs.map +1 -1
- package/dist/for-nest.js +1 -1
- package/dist/for-nest.js.map +1 -1
- package/lib/decaf-model/decorators/decorators.d.ts +1 -1
- package/lib/decaf-model/decorators/decorators.js.map +1 -1
- package/lib/esm/decaf-model/decorators/decorators.d.ts +1 -1
- package/lib/esm/decaf-model/decorators/decorators.js.map +1 -1
- package/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/interceptors/DecafRequestHandlerInterceptor.js +8 -2
- package/lib/esm/interceptors/DecafRequestHandlerInterceptor.js.map +1 -1
- package/lib/esm/request/DecafHandlerExecutor.js +6 -2
- package/lib/esm/request/DecafHandlerExecutor.js.map +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/interceptors/DecafRequestHandlerInterceptor.cjs +8 -2
- package/lib/interceptors/DecafRequestHandlerInterceptor.js.map +1 -1
- package/lib/request/DecafHandlerExecutor.cjs +6 -2
- package/lib/request/DecafHandlerExecutor.js.map +1 -1
- package/package.json +1 -1
|
@@ -10,9 +10,11 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
11
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
12
|
};
|
|
13
|
+
var DecafHandlerExecutor_1;
|
|
13
14
|
import { Inject, Injectable, Scope } from "@nestjs/common";
|
|
14
15
|
import { DecafRequestContext } from "./DecafRequestContext.js";
|
|
15
16
|
import { DECAF_HANDLERS } from "./../constants.js";
|
|
17
|
+
import { Logging } from "@decaf-ts/logging";
|
|
16
18
|
/**
|
|
17
19
|
* @description
|
|
18
20
|
* Executes all registered {@link DecafRequestHandler} instances for the current request,
|
|
@@ -57,18 +59,20 @@ import { DECAF_HANDLERS } from "./../constants.js";
|
|
|
57
59
|
* HandlerB-->>Executor: completed
|
|
58
60
|
* Executor-->>Client: processing finished
|
|
59
61
|
*/
|
|
60
|
-
let DecafHandlerExecutor = class DecafHandlerExecutor {
|
|
62
|
+
let DecafHandlerExecutor = DecafHandlerExecutor_1 = class DecafHandlerExecutor {
|
|
61
63
|
constructor(handlers, context) {
|
|
62
64
|
this.handlers = handlers;
|
|
63
65
|
this.context = context;
|
|
64
66
|
}
|
|
65
67
|
async exec(req, res) {
|
|
68
|
+
const log = Logging.for(DecafHandlerExecutor_1.name).for(this.exec);
|
|
69
|
+
log.debug(`CONTEXT ${this.context.uuid} running ${this.handlers.length} handlers for request ${req.method} ${req.url}`);
|
|
66
70
|
for (const handler of this.handlers) {
|
|
67
71
|
await handler.handle(this.context, req, res);
|
|
68
72
|
}
|
|
69
73
|
}
|
|
70
74
|
};
|
|
71
|
-
DecafHandlerExecutor = __decorate([
|
|
75
|
+
DecafHandlerExecutor = DecafHandlerExecutor_1 = __decorate([
|
|
72
76
|
Injectable({ scope: Scope.REQUEST }),
|
|
73
77
|
__param(0, Inject(DECAF_HANDLERS)),
|
|
74
78
|
__metadata("design:paramtypes", [Array, DecafRequestContext])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecafHandlerExecutor.js","sourceRoot":"","sources":["../../../src/request/DecafHandlerExecutor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DecafHandlerExecutor.js","sourceRoot":"","sources":["../../../src/request/DecafHandlerExecutor.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,iCAA8B;AAE5D,OAAO,EAAE,cAAc,EAAE,0BAAqB;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEI,IAAM,oBAAoB,4BAA1B,MAAM,oBAAoB;IAC/B,YAC2C,QAA+B,EACvD,OAA4B;QADJ,aAAQ,GAAR,QAAQ,CAAuB;QACvD,YAAO,GAAP,OAAO,CAAqB;IAC5C,CAAC;IAEJ,KAAK,CAAC,IAAI,CAAC,GAAY,EAAE,GAAa;QACpC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,sBAAoB,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClE,GAAG,CAAC,KAAK,CACP,WAAW,IAAI,CAAC,OAAO,CAAC,IAAI,YAAY,IAAI,CAAC,QAAQ,CAAC,MAAM,yBAAyB,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,GAAG,EAAE,CAC7G,CAAC;QACF,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACpC,MAAM,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;CACF,CAAA;AAfY,oBAAoB;IADhC,UAAU,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;IAGhC,WAAA,MAAM,CAAC,cAAc,CAAC,CAAA;4CACG,mBAAmB;GAHpC,oBAAoB,CAehC"}
|
package/lib/index.cjs
CHANGED
|
@@ -56,7 +56,7 @@ __exportStar(require("./events-module/index.cjs"), exports);
|
|
|
56
56
|
* @constant
|
|
57
57
|
* @type {string}
|
|
58
58
|
*/
|
|
59
|
-
exports.VERSION = "0.2.
|
|
59
|
+
exports.VERSION = "0.2.39";
|
|
60
60
|
exports.PACKAGE_NAME = "@decaf-ts/for-nest";
|
|
61
61
|
decoration_1.Metadata.registerLibrary(exports.PACKAGE_NAME, exports.VERSION);
|
|
62
62
|
//# sourceMappingURL=index.js.map
|
package/lib/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
+
var DecafRequestHandlerInterceptor_1;
|
|
11
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
13
|
exports.DecafRequestHandlerInterceptor = void 0;
|
|
13
14
|
const common_1 = require("@nestjs/common");
|
|
@@ -62,7 +63,7 @@ const db_decorators_1 = require("@decaf-ts/db-decorators");
|
|
|
62
63
|
* Interceptor->>Controller: next.handle()
|
|
63
64
|
* Controller-->>Client: Response
|
|
64
65
|
*/
|
|
65
|
-
let DecafRequestHandlerInterceptor = class DecafRequestHandlerInterceptor {
|
|
66
|
+
let DecafRequestHandlerInterceptor = DecafRequestHandlerInterceptor_1 = class DecafRequestHandlerInterceptor {
|
|
66
67
|
constructor(requestContext, executor) {
|
|
67
68
|
this.requestContext = requestContext;
|
|
68
69
|
this.executor = executor;
|
|
@@ -94,14 +95,19 @@ let DecafRequestHandlerInterceptor = class DecafRequestHandlerInterceptor {
|
|
|
94
95
|
async intercept(context, next) {
|
|
95
96
|
const req = context.switchToHttp().getRequest();
|
|
96
97
|
const res = context.switchToHttp().getResponse();
|
|
98
|
+
const log = logging_1.Logging.for(DecafRequestHandlerInterceptor_1).for(this.intercept);
|
|
99
|
+
log.debug(`CONTEXT ${this.requestContext.uuid} - request: ${req.method} ${req.url}`);
|
|
97
100
|
const ctx = await this.contextualize(req);
|
|
101
|
+
log.debug(`CONTEXT ${this.requestContext.uuid} contextualized - request: ${req.method} ${req.url}`);
|
|
98
102
|
this.requestContext.applyCtx(ctx);
|
|
103
|
+
log.debug(`CONTEXT ${this.requestContext.uuid} applied - request: ${req.method} ${req.url}`);
|
|
99
104
|
await this.executor.exec(req, res);
|
|
105
|
+
log.debug(`CONTEXT ${this.requestContext.uuid} executors finished - request: ${req.method} ${req.url}`);
|
|
100
106
|
return next.handle();
|
|
101
107
|
}
|
|
102
108
|
};
|
|
103
109
|
exports.DecafRequestHandlerInterceptor = DecafRequestHandlerInterceptor;
|
|
104
|
-
exports.DecafRequestHandlerInterceptor = DecafRequestHandlerInterceptor = __decorate([
|
|
110
|
+
exports.DecafRequestHandlerInterceptor = DecafRequestHandlerInterceptor = DecafRequestHandlerInterceptor_1 = __decorate([
|
|
105
111
|
(0, common_1.Injectable)({ scope: common_1.Scope.REQUEST }),
|
|
106
112
|
__metadata("design:paramtypes", [request_1.DecafRequestContext,
|
|
107
113
|
request_1.DecafHandlerExecutor])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecafRequestHandlerInterceptor.js","sourceRoot":"","sources":["../../src/interceptors/DecafRequestHandlerInterceptor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DecafRequestHandlerInterceptor.js","sourceRoot":"","sources":["../../src/interceptors/DecafRequestHandlerInterceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAMwB;AACxB,oDAAuE;AACvE,yCAAuE;AAEvE,oCAAsB;AACtB,+CAA4C;AAC5C,2DAAwD;AAGxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEI,IAAM,8BAA8B,sCAApC,MAAM,8BAA8B;IACzC,YACqB,cAAmC,EACnC,QAA8B;QAD9B,mBAAc,GAAd,cAAc,CAAqB;QACnC,aAAQ,GAAR,QAAQ,CAAsB;IAChD,CAAC;IAEM,KAAK,CAAC,aAAa,CAAC,GAAQ;QACpC,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;QAC5B,MAAM,KAAK,GAAqB;YAC9B,OAAO,EAAE,OAAO;YAChB,SAAS,EAAE,EAAE;SACP,CAAC;QAET,MAAM,QAAQ,GAAG,cAAO,CAAC,mBAAmB,EAAE,CAAC;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AAW,IAAI,CAAC,cAAc,CAAC,IAAI,8BAA8B,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,GAAG,EAAE,CACzF,CAAC;QAEF,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QAClC,GAAG,CAAC,KAAK,CACP,WAAW,IAAI,CAAC,cAAc,CAAC,IAAI,uBAAuB,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,GAAG,EAAE,CAClF,CAAC;QAEF,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACnC,GAAG,CAAC,KAAK,CACP,WAAW,IAAI,CAAC,cAAc,CAAC,IAAI,kCAAkC,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,GAAG,EAAE,CAC7F,CAAC;QACF,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC;CACF,CAAA;AA/DY,wEAA8B;yCAA9B,8BAA8B;IAD1C,IAAA,mBAAU,EAAC,EAAE,KAAK,EAAE,cAAK,CAAC,OAAO,EAAE,CAAC;qCAGE,6BAAmB;QACzB,8BAAoB;GAHxC,8BAA8B,CA+D1C"}
|
|
@@ -11,11 +11,13 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
13
|
};
|
|
14
|
+
var DecafHandlerExecutor_1;
|
|
14
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
16
|
exports.DecafHandlerExecutor = void 0;
|
|
16
17
|
const common_1 = require("@nestjs/common");
|
|
17
18
|
const DecafRequestContext_1 = require("./DecafRequestContext.cjs");
|
|
18
19
|
const constants_1 = require("./../constants.cjs");
|
|
20
|
+
const logging_1 = require("@decaf-ts/logging");
|
|
19
21
|
/**
|
|
20
22
|
* @description
|
|
21
23
|
* Executes all registered {@link DecafRequestHandler} instances for the current request,
|
|
@@ -60,19 +62,21 @@ const constants_1 = require("./../constants.cjs");
|
|
|
60
62
|
* HandlerB-->>Executor: completed
|
|
61
63
|
* Executor-->>Client: processing finished
|
|
62
64
|
*/
|
|
63
|
-
let DecafHandlerExecutor = class DecafHandlerExecutor {
|
|
65
|
+
let DecafHandlerExecutor = DecafHandlerExecutor_1 = class DecafHandlerExecutor {
|
|
64
66
|
constructor(handlers, context) {
|
|
65
67
|
this.handlers = handlers;
|
|
66
68
|
this.context = context;
|
|
67
69
|
}
|
|
68
70
|
async exec(req, res) {
|
|
71
|
+
const log = logging_1.Logging.for(DecafHandlerExecutor_1.name).for(this.exec);
|
|
72
|
+
log.debug(`CONTEXT ${this.context.uuid} running ${this.handlers.length} handlers for request ${req.method} ${req.url}`);
|
|
69
73
|
for (const handler of this.handlers) {
|
|
70
74
|
await handler.handle(this.context, req, res);
|
|
71
75
|
}
|
|
72
76
|
}
|
|
73
77
|
};
|
|
74
78
|
exports.DecafHandlerExecutor = DecafHandlerExecutor;
|
|
75
|
-
exports.DecafHandlerExecutor = DecafHandlerExecutor = __decorate([
|
|
79
|
+
exports.DecafHandlerExecutor = DecafHandlerExecutor = DecafHandlerExecutor_1 = __decorate([
|
|
76
80
|
(0, common_1.Injectable)({ scope: common_1.Scope.REQUEST }),
|
|
77
81
|
__param(0, (0, common_1.Inject)(constants_1.DECAF_HANDLERS)),
|
|
78
82
|
__metadata("design:paramtypes", [Array, DecafRequestContext_1.DecafRequestContext])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecafHandlerExecutor.js","sourceRoot":"","sources":["../../src/request/DecafHandlerExecutor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DecafHandlerExecutor.js","sourceRoot":"","sources":["../../src/request/DecafHandlerExecutor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAA2D;AAC3D,mEAA4D;AAE5D,kDAA8C;AAC9C,+CAA4C;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEI,IAAM,oBAAoB,4BAA1B,MAAM,oBAAoB;IAC/B,YAC2C,QAA+B,EACvD,OAA4B;QADJ,aAAQ,GAAR,QAAQ,CAAuB;QACvD,YAAO,GAAP,OAAO,CAAqB;IAC5C,CAAC;IAEJ,KAAK,CAAC,IAAI,CAAC,GAAY,EAAE,GAAa;QACpC,MAAM,GAAG,GAAG,iBAAO,CAAC,GAAG,CAAC,sBAAoB,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClE,GAAG,CAAC,KAAK,CACP,WAAW,IAAI,CAAC,OAAO,CAAC,IAAI,YAAY,IAAI,CAAC,QAAQ,CAAC,MAAM,yBAAyB,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,GAAG,EAAE,CAC7G,CAAC;QACF,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACpC,MAAM,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;CACF,CAAA;AAfY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,EAAC,EAAE,KAAK,EAAE,cAAK,CAAC,OAAO,EAAE,CAAC;IAGhC,WAAA,IAAA,eAAM,EAAC,0BAAc,CAAC,CAAA;4CACG,yCAAmB;GAHpC,oBAAoB,CAehC"}
|