@decaf-ts/for-nest 0.1.4 → 0.1.6

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.
Files changed (44) hide show
  1. package/README.md +1 -1
  2. package/dist/for-nest.cjs +1 -1
  3. package/dist/for-nest.cjs.map +1 -1
  4. package/dist/for-nest.js +1 -1
  5. package/dist/for-nest.js.map +1 -1
  6. package/lib/decaf-model/DecafModelModule.cjs +8 -0
  7. package/lib/decaf-model/DecafModelModule.d.ts +1 -0
  8. package/lib/decaf-model/DecafModelModule.js.map +1 -1
  9. package/lib/decaf-model/FromModelController.cjs +42 -25
  10. package/lib/decaf-model/FromModelController.d.ts +2 -10
  11. package/lib/decaf-model/FromModelController.js.map +1 -1
  12. package/lib/decaf-model/decorators/ApiParamsFromModel.d.ts +2 -2
  13. package/lib/decaf-model/decorators/ApiParamsFromModel.js.map +1 -1
  14. package/lib/decaf-model/decorators/DecafParams.d.ts +2 -2
  15. package/lib/decaf-model/decorators/DecafParams.js.map +1 -1
  16. package/lib/decaf-model/decorators/types.d.ts +7 -1
  17. package/lib/esm/decaf-model/DecafModelModule.d.ts +1 -0
  18. package/lib/esm/decaf-model/DecafModelModule.js +9 -1
  19. package/lib/esm/decaf-model/DecafModelModule.js.map +1 -1
  20. package/lib/esm/decaf-model/FromModelController.d.ts +2 -10
  21. package/lib/esm/decaf-model/FromModelController.js +44 -27
  22. package/lib/esm/decaf-model/FromModelController.js.map +1 -1
  23. package/lib/esm/decaf-model/decorators/ApiParamsFromModel.d.ts +2 -2
  24. package/lib/esm/decaf-model/decorators/ApiParamsFromModel.js.map +1 -1
  25. package/lib/esm/decaf-model/decorators/DecafParams.d.ts +2 -2
  26. package/lib/esm/decaf-model/decorators/DecafParams.js.map +1 -1
  27. package/lib/esm/decaf-model/decorators/types.d.ts +7 -1
  28. package/lib/esm/index.d.ts +1 -1
  29. package/lib/esm/index.js +1 -1
  30. package/lib/esm/interceptors/DecafRequestHandlerInterceptor.js +2 -1
  31. package/lib/esm/interceptors/DecafRequestHandlerInterceptor.js.map +1 -1
  32. package/lib/esm/request/DecafHandlerExecutor.d.ts +1 -1
  33. package/lib/esm/request/DecafHandlerExecutor.js +2 -2
  34. package/lib/esm/request/DecafHandlerExecutor.js.map +1 -1
  35. package/lib/esm/types.d.ts +1 -1
  36. package/lib/index.cjs +1 -1
  37. package/lib/index.d.ts +1 -1
  38. package/lib/interceptors/DecafRequestHandlerInterceptor.cjs +2 -1
  39. package/lib/interceptors/DecafRequestHandlerInterceptor.js.map +1 -1
  40. package/lib/request/DecafHandlerExecutor.cjs +2 -2
  41. package/lib/request/DecafHandlerExecutor.d.ts +1 -1
  42. package/lib/request/DecafHandlerExecutor.js.map +1 -1
  43. package/lib/types.d.ts +1 -1
  44. package/package.json +5 -2
package/lib/esm/index.js CHANGED
@@ -36,7 +36,7 @@ export * from "./request/index.js";
36
36
  * @constant
37
37
  * @type {string}
38
38
  */
39
- export const VERSION = "0.1.3";
39
+ export const VERSION = "0.1.6";
40
40
  export const PACKAGE_NAME = "@decaf-ts/for-nest";
41
41
  Metadata.registerLibrary(PACKAGE_NAME, VERSION);
42
42
  //# sourceMappingURL=index.js.map
@@ -61,7 +61,8 @@ let DecafRequestHandlerInterceptor = class DecafRequestHandlerInterceptor {
61
61
  }
62
62
  async intercept(ctx, next) {
63
63
  const req = ctx.switchToHttp().getRequest();
64
- await this.executor.exec(req);
64
+ const res = ctx.switchToHttp().getResponse();
65
+ await this.executor.exec(req, res);
65
66
  return next.handle();
66
67
  }
67
68
  };
@@ -1 +1 @@
1
- {"version":3,"file":"DecafRequestHandlerInterceptor.js","sourceRoot":"","sources":["../../../src/interceptors/DecafRequestHandlerInterceptor.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAGL,UAAU,EAEV,KAAK,GACN,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,8BAAmB;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AC;CACF,CAAA;AATY,8BAA8B;IAD1C,UAAU,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;qCAEI,oBAAoB;GADhD,8BAA8B,CAS1C"}
@@ -48,5 +48,5 @@ export declare class DecafHandlerExecutor {
48
48
  private readonly handlers;
49
49
  private readonly context;
50
50
  constructor(handlers: DecafRequestHandler[], context: DecafRequestContext);
51
- exec(req: Request): Promise<void>;
51
+ exec(req: Request, res: Response): Promise<void>;
52
52
  }
@@ -62,9 +62,9 @@ let DecafHandlerExecutor = class DecafHandlerExecutor {
62
62
  this.handlers = handlers;
63
63
  this.context = context;
64
64
  }
65
- async exec(req) {
65
+ async exec(req, res) {
66
66
  for (const handler of this.handlers) {
67
- await handler.handle(this.context, req);
67
+ await handler.handle(this.context, req, res);
68
68
  }
69
69
  }
70
70
  };
@@ -1 +1 @@
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;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEI,IAAM,oBAAoB,GAA1B,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;QACrB,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACpC,MAAM,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAC1C,CAAC;IACH,CAAC;CACF,CAAA;AAXY,oBAAoB;IADhC,UAAU,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;IAGhC,WAAA,MAAM,CAAC,cAAc,CAAC,CAAA;4CACG,mBAAmB;GAHpC,oBAAoB,CAWhC"}
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;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEI,IAAM,oBAAoB,GAA1B,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,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;AAXY,oBAAoB;IADhC,UAAU,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;IAGhC,WAAA,MAAM,CAAC,cAAc,CAAC,CAAA;4CACG,mBAAmB;GAHpC,oBAAoB,CAWhC"}
@@ -6,7 +6,7 @@ export interface RequestContextAccessor {
6
6
  get<T = any>(key: string | symbol): T | undefined;
7
7
  }
8
8
  export interface DecafRequestHandler {
9
- handle(context: RequestContextAccessor, req: Request): Promise<void>;
9
+ handle(context: RequestContextAccessor, req: Request, res: Response): Promise<void>;
10
10
  }
11
11
  /**
12
12
  * @publicApi
package/lib/index.cjs CHANGED
@@ -53,7 +53,7 @@ __exportStar(require("./request/index.cjs"), exports);
53
53
  * @constant
54
54
  * @type {string}
55
55
  */
56
- exports.VERSION = "0.1.3";
56
+ exports.VERSION = "0.1.6";
57
57
  exports.PACKAGE_NAME = "@decaf-ts/for-nest";
58
58
  decoration_1.Metadata.registerLibrary(exports.PACKAGE_NAME, exports.VERSION);
59
59
  //# sourceMappingURL=index.js.map
package/lib/index.d.ts CHANGED
@@ -35,5 +35,5 @@ export * from "./request";
35
35
  * @constant
36
36
  * @type {string}
37
37
  */
38
- export declare const VERSION = "0.1.3";
38
+ export declare const VERSION = "0.1.6";
39
39
  export declare const PACKAGE_NAME = "@decaf-ts/for-nest";
@@ -64,7 +64,8 @@ let DecafRequestHandlerInterceptor = class DecafRequestHandlerInterceptor {
64
64
  }
65
65
  async intercept(ctx, next) {
66
66
  const req = ctx.switchToHttp().getRequest();
67
- await this.executor.exec(req);
67
+ const res = ctx.switchToHttp().getResponse();
68
+ await this.executor.exec(req, res);
68
69
  return next.handle();
69
70
  }
70
71
  };
@@ -1 +1 @@
1
- {"version":3,"file":"DecafRequestHandlerInterceptor.js","sourceRoot":"","sources":["../../src/interceptors/DecafRequestHandlerInterceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAMwB;AACxB,oDAAkD;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEI,IAAM,8BAA8B,GAApC,MAAM,8BAA8B;IACzC,YAA6B,QAA8B;QAA9B,aAAQ,GAAR,QAAQ,CAAsB;IAAG,CAAC;IAE/D,KAAK,CAAC,SAAS,CAAC,GAAqB,EAAE,IAAiB;QACtD,MAAM,GAAG,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;QAC5C,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC9B,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC;CACF,CAAA;AARY,wEAA8B;yCAA9B,8BAA8B;IAD1C,IAAA,mBAAU,EAAC,EAAE,KAAK,EAAE,cAAK,CAAC,OAAO,EAAE,CAAC;qCAEI,8BAAoB;GADhD,8BAA8B,CAQ1C"}
1
+ {"version":3,"file":"DecafRequestHandlerInterceptor.js","sourceRoot":"","sources":["../../src/interceptors/DecafRequestHandlerInterceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAMwB;AACxB,oDAAkD;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEI,IAAM,8BAA8B,GAApC,MAAM,8BAA8B;IACzC,YAA6B,QAA8B;QAA9B,aAAQ,GAAR,QAAQ,CAAsB;IAAG,CAAC;IAE/D,KAAK,CAAC,SAAS,CAAC,GAAqB,EAAE,IAAiB;QACtD,MAAM,GAAG,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;QAC5C,MAAM,GAAG,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC,WAAW,EAAE,CAAC;QAC7C,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACnC,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC;CACF,CAAA;AATY,wEAA8B;yCAA9B,8BAA8B;IAD1C,IAAA,mBAAU,EAAC,EAAE,KAAK,EAAE,cAAK,CAAC,OAAO,EAAE,CAAC;qCAEI,8BAAoB;GADhD,8BAA8B,CAS1C"}
@@ -65,9 +65,9 @@ let DecafHandlerExecutor = class DecafHandlerExecutor {
65
65
  this.handlers = handlers;
66
66
  this.context = context;
67
67
  }
68
- async exec(req) {
68
+ async exec(req, res) {
69
69
  for (const handler of this.handlers) {
70
- await handler.handle(this.context, req);
70
+ await handler.handle(this.context, req, res);
71
71
  }
72
72
  }
73
73
  };
@@ -48,5 +48,5 @@ export declare class DecafHandlerExecutor {
48
48
  private readonly handlers;
49
49
  private readonly context;
50
50
  constructor(handlers: DecafRequestHandler[], context: DecafRequestContext);
51
- exec(req: Request): Promise<void>;
51
+ exec(req: Request, res: Response): Promise<void>;
52
52
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DecafHandlerExecutor.js","sourceRoot":"","sources":["../../src/request/DecafHandlerExecutor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA2D;AAC3D,mEAA4D;AAE5D,kDAA8C;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEI,IAAM,oBAAoB,GAA1B,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;QACrB,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACpC,MAAM,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAC1C,CAAC;IACH,CAAC;CACF,CAAA;AAXY,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,CAWhC"}
1
+ {"version":3,"file":"DecafHandlerExecutor.js","sourceRoot":"","sources":["../../src/request/DecafHandlerExecutor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA2D;AAC3D,mEAA4D;AAE5D,kDAA8C;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEI,IAAM,oBAAoB,GAA1B,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,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;AAXY,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,CAWhC"}
package/lib/types.d.ts CHANGED
@@ -6,7 +6,7 @@ export interface RequestContextAccessor {
6
6
  get<T = any>(key: string | symbol): T | undefined;
7
7
  }
8
8
  export interface DecafRequestHandler {
9
- handle(context: RequestContextAccessor, req: Request): Promise<void>;
9
+ handle(context: RequestContextAccessor, req: Request, res: Response): Promise<void>;
10
10
  }
11
11
  /**
12
12
  * @publicApi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decaf-ts/for-nest",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "NestJS decaf integration",
5
5
  "type": "module",
6
6
  "exports": {
@@ -75,13 +75,16 @@
75
75
  },
76
76
  "homepage": "https://github.com/decaf-ts/for-nest#readme",
77
77
  "devDependencies": {
78
+ "@decaf-ts/for-fabric": "^0.1.16",
78
79
  "@decaf-ts/utils": "latest",
79
80
  "@eslint/js": "^9.25.1",
80
81
  "@nestjs/cli": "^11.0.0",
82
+ "@nestjs/platform-express": "^11.1.9",
81
83
  "@nestjs/schematics": "^11.0.9",
82
84
  "@nestjs/swagger": "^11.2.0",
83
85
  "@nestjs/testing": "^11.0.1",
84
- "@types/lodash": "^4.17.20"
86
+ "@types/lodash": "^4.17.20",
87
+ "supertest": "^7.1.4"
85
88
  },
86
89
  "dependencies": {
87
90
  "@decaf-ts/core": "latest",