@decaf-ts/for-nest 0.1.2 → 0.1.3

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 (76) hide show
  1. package/README.md +6 -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/RepoFactory.cjs +27 -0
  7. package/lib/RepoFactory.d.ts +6 -0
  8. package/lib/RepoFactory.js.map +1 -0
  9. package/lib/constants.cjs +1 -3
  10. package/lib/constants.d.ts +0 -2
  11. package/lib/constants.js.map +1 -1
  12. package/lib/decaf-model/DecafModelModule.cjs +3 -22
  13. package/lib/decaf-model/DecafModelModule.d.ts +2 -3
  14. package/lib/decaf-model/DecafModelModule.js.map +1 -1
  15. package/lib/decaf-model/FromModelController.cjs +16 -69
  16. package/lib/decaf-model/FromModelController.d.ts +0 -49
  17. package/lib/decaf-model/FromModelController.js.map +1 -1
  18. package/lib/decoration.cjs +5 -0
  19. package/lib/decoration.js.map +1 -1
  20. package/lib/esm/RepoFactory.d.ts +6 -0
  21. package/lib/esm/RepoFactory.js +24 -0
  22. package/lib/esm/RepoFactory.js.map +1 -0
  23. package/lib/esm/constants.d.ts +0 -2
  24. package/lib/esm/constants.js +0 -2
  25. package/lib/esm/constants.js.map +1 -1
  26. package/lib/esm/decaf-model/DecafModelModule.d.ts +2 -3
  27. package/lib/esm/decaf-model/DecafModelModule.js +3 -22
  28. package/lib/esm/decaf-model/DecafModelModule.js.map +1 -1
  29. package/lib/esm/decaf-model/FromModelController.d.ts +0 -49
  30. package/lib/esm/decaf-model/FromModelController.js +16 -69
  31. package/lib/esm/decaf-model/FromModelController.js.map +1 -1
  32. package/lib/esm/decoration.js +6 -1
  33. package/lib/esm/decoration.js.map +1 -1
  34. package/lib/esm/index.d.ts +2 -3
  35. package/lib/esm/index.js +2 -3
  36. package/lib/esm/index.js.map +1 -1
  37. package/lib/esm/module.js +1 -1
  38. package/lib/esm/module.js.map +1 -1
  39. package/lib/esm/types.d.ts +0 -9
  40. package/lib/index.cjs +2 -3
  41. package/lib/index.d.ts +2 -3
  42. package/lib/index.js.map +1 -1
  43. package/lib/module.cjs +1 -1
  44. package/lib/module.js.map +1 -1
  45. package/lib/types.d.ts +0 -9
  46. package/package.json +1 -1
  47. package/lib/esm/interceptors/DecafRequestHandlerInterceptor.d.ts +0 -53
  48. package/lib/esm/interceptors/DecafRequestHandlerInterceptor.js +0 -73
  49. package/lib/esm/interceptors/DecafRequestHandlerInterceptor.js.map +0 -1
  50. package/lib/esm/interceptors/index.d.ts +0 -1
  51. package/lib/esm/interceptors/index.js +0 -2
  52. package/lib/esm/interceptors/index.js.map +0 -1
  53. package/lib/esm/request/DecafHandlerExecutor.d.ts +0 -52
  54. package/lib/esm/request/DecafHandlerExecutor.js +0 -77
  55. package/lib/esm/request/DecafHandlerExecutor.js.map +0 -1
  56. package/lib/esm/request/DecafRequestContext.d.ts +0 -26
  57. package/lib/esm/request/DecafRequestContext.js +0 -44
  58. package/lib/esm/request/DecafRequestContext.js.map +0 -1
  59. package/lib/esm/request/index.d.ts +0 -2
  60. package/lib/esm/request/index.js +0 -3
  61. package/lib/esm/request/index.js.map +0 -1
  62. package/lib/interceptors/DecafRequestHandlerInterceptor.cjs +0 -76
  63. package/lib/interceptors/DecafRequestHandlerInterceptor.d.ts +0 -53
  64. package/lib/interceptors/DecafRequestHandlerInterceptor.js.map +0 -1
  65. package/lib/interceptors/index.cjs +0 -18
  66. package/lib/interceptors/index.d.ts +0 -1
  67. package/lib/interceptors/index.js.map +0 -1
  68. package/lib/request/DecafHandlerExecutor.cjs +0 -80
  69. package/lib/request/DecafHandlerExecutor.d.ts +0 -52
  70. package/lib/request/DecafHandlerExecutor.js.map +0 -1
  71. package/lib/request/DecafRequestContext.cjs +0 -47
  72. package/lib/request/DecafRequestContext.d.ts +0 -26
  73. package/lib/request/DecafRequestContext.js.map +0 -1
  74. package/lib/request/index.cjs +0 -19
  75. package/lib/request/index.d.ts +0 -2
  76. package/lib/request/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"decoration.js","sourceRoot":"","sources":["../../src/decoration.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,GAEhB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAe,UAAU,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,UAAU,CAAC,GAAG,CAAC,eAAe,CAAC,UAAU,CAAC;KACvC,MAAM,CAAC;IACN,SAAS,EAAE,SAAS,cAAc,CAChC,QAA8B,EAC9B,GAAqB;QAErB,OAAO,UAAU,CAAC;YAChB,KAAK,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO;YACpD,OAAO,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI;SAC1C,CAAC,CAAC;IACL,CAAC;CACF,CAAC;KACD,KAAK,EAAE,CAAC;AAEX,UAAU,CAAC,GAAG,CAAC,eAAe,CAAC,MAAM,CAAC;KACnC,MAAM,CAAC;IACN,SAAS,EAAE,SAAS,UAAU,CAC5B,QAAuC;IACvC,6DAA6D;IAC7D,GAAkB;QAElB,OAAO,SAAS,eAAe,CAC7B,MAAc,EACd,WAAiB,EACjB,UAAgB;YAEhB,OAAO,MAAM,CAAC,QAAQ,IAAK,MAAsB,CAAC,CAChD,MAAM,EACN,WAAW,EACX,UAAU,CACX,CAAC;QACJ,CAAC,CAA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,EAAE,CAAC;AAEX,UAAU,CAAC,GAAG,CAAC,cAAc,CAAC,WAAW,CAAC;KACvC,MAAM,CAAC;IACN,SAAS,EAAE,SAAS,cAAc,CAAC,WAAmB;QACpD,OAAO,WAAW,CAAC;YACjB,WAAW,EAAE,WAAW;SACzB,CAAC,CAAC;IACL,CAAC;CACF,CAAC;KACD,KAAK,EAAE,CAAC"}
@@ -23,17 +23,16 @@ import "./decoration";
23
23
  export * from "./constants";
24
24
  export * from "./decoration";
25
25
  export * from "./module";
26
+ export * from "./RepoFactory";
26
27
  export * from "./types";
27
28
  export * from "./utils";
28
29
  export * from "./factory";
29
30
  export * from "./decaf-model";
30
- export * from "./interceptors";
31
- export * from "./request";
32
31
  /**
33
32
  * Represents the current version of the ts-workspace module.
34
33
  * The actual version number is replaced during the build process.
35
34
  * @constant
36
35
  * @type {string}
37
36
  */
38
- export declare const VERSION = "0.1.2";
37
+ export declare const VERSION = "0.1.3";
39
38
  export declare const PACKAGE_NAME = "@decaf-ts/for-nest";
package/lib/esm/index.js CHANGED
@@ -24,19 +24,18 @@ import "./decoration.js";
24
24
  export * from "./constants.js";
25
25
  export * from "./decoration.js";
26
26
  export * from "./module.js";
27
+ export * from "./RepoFactory.js";
27
28
  export * from "./types.js";
28
29
  export * from "./utils.js";
29
30
  export * from "./factory/index.js";
30
31
  export * from "./decaf-model/index.js";
31
- export * from "./interceptors/index.js";
32
- export * from "./request/index.js";
33
32
  /**
34
33
  * Represents the current version of the ts-workspace module.
35
34
  * The actual version number is replaced during the build process.
36
35
  * @constant
37
36
  * @type {string}
38
37
  */
39
- export const VERSION = "0.1.2";
38
+ export const VERSION = "0.1.3";
40
39
  export const PACKAGE_NAME = "@decaf-ts/for-nest";
41
40
  Metadata.registerLibrary(PACKAGE_NAME, VERSION);
42
41
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,yBAAsB;AAEtB,+BAA4B;AAC5B,gCAA6B;AAC7B,4BAAyB;AACzB,2BAAwB;AACxB,2BAAwB;AACxB,mCAA0B;AAC1B,uCAA8B;AAC9B,wCAA+B;AAC/B,mCAA0B;AAE1B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC;AACrC,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAC;AAE1C,QAAQ,CAAC,eAAe,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,yBAAsB;AAEtB,+BAA4B;AAC5B,gCAA6B;AAC7B,4BAAyB;AACzB,iCAA8B;AAC9B,2BAAwB;AACxB,2BAAwB;AACxB,mCAA0B;AAC1B,uCAA8B;AAE9B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC;AACrC,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAC;AAE1C,QAAQ,CAAC,eAAe,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC"}
package/lib/esm/module.js CHANGED
@@ -18,7 +18,7 @@ let DecafModule = DecafModule_1 = class DecafModule {
18
18
  const flavour = adapter.flavour;
19
19
  const imports = [DecafCoreModule.forRoot(options)];
20
20
  if (autoControllers) {
21
- imports.push(DecafModelModule.forRoot(flavour, options.handlers));
21
+ imports.push(DecafModelModule.forRoot(flavour));
22
22
  }
23
23
  return {
24
24
  module: DecafModule_1,
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/module.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAmC,MAAM,EAAQ,MAAM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C;QAEhC,MAAM,OAAO,GAOG,CAAC,eAAe,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QAEnD,IAAI,eAAe,EAAE,CAAC;YACpB,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QAClD,CAAC;QAED,OAAO;YACL,MAAM,EAAE,aAAW;YACnB,OAAO,EAAE,OAAO;SACjB,CAAC;IACJ,CAAC;CACF,CAAA;AA3BY,WAAW;IADvB,MAAM,CAAC,EAAE,CAAC;GACE,WAAW,CA2BvB"}
@@ -1,13 +1,5 @@
1
1
  import { Adapter } from "@decaf-ts/core";
2
2
  import { Constructor } from "@decaf-ts/decoration";
3
- import { Type } from "@nestjs/common";
4
- export interface RequestContextAccessor {
5
- set(key: string | symbol, value: any): void;
6
- get<T = any>(key: string | symbol): T | undefined;
7
- }
8
- export interface DecafRequestHandler {
9
- handle(context: RequestContextAccessor, req: Request): Promise<void>;
10
- }
11
3
  /**
12
4
  * @publicApi
13
5
  */
@@ -16,5 +8,4 @@ export type DecafModuleOptions<CONF = any, A extends Adapter<CONF, any, any, any
16
8
  conf: CONF;
17
9
  alias?: string;
18
10
  autoControllers: boolean;
19
- handlers?: Type<DecafRequestHandler>[];
20
11
  };
package/lib/index.cjs CHANGED
@@ -41,19 +41,18 @@ require("./decoration.cjs");
41
41
  __exportStar(require("./constants.cjs"), exports);
42
42
  __exportStar(require("./decoration.cjs"), exports);
43
43
  __exportStar(require("./module.cjs"), exports);
44
+ __exportStar(require("./RepoFactory.cjs"), exports);
44
45
  __exportStar(require("./types.cjs"), exports);
45
46
  __exportStar(require("./utils.cjs"), exports);
46
47
  __exportStar(require("./factory/index.cjs"), exports);
47
48
  __exportStar(require("./decaf-model/index.cjs"), exports);
48
- __exportStar(require("./interceptors/index.cjs"), exports);
49
- __exportStar(require("./request/index.cjs"), exports);
50
49
  /**
51
50
  * Represents the current version of the ts-workspace module.
52
51
  * The actual version number is replaced during the build process.
53
52
  * @constant
54
53
  * @type {string}
55
54
  */
56
- exports.VERSION = "0.1.2";
55
+ exports.VERSION = "0.1.3";
57
56
  exports.PACKAGE_NAME = "@decaf-ts/for-nest";
58
57
  decoration_1.Metadata.registerLibrary(exports.PACKAGE_NAME, exports.VERSION);
59
58
  //# sourceMappingURL=index.js.map
package/lib/index.d.ts CHANGED
@@ -23,17 +23,16 @@ import "./decoration";
23
23
  export * from "./constants";
24
24
  export * from "./decoration";
25
25
  export * from "./module";
26
+ export * from "./RepoFactory";
26
27
  export * from "./types";
27
28
  export * from "./utils";
28
29
  export * from "./factory";
29
30
  export * from "./decaf-model";
30
- export * from "./interceptors";
31
- export * from "./request";
32
31
  /**
33
32
  * Represents the current version of the ts-workspace module.
34
33
  * The actual version number is replaced during the build process.
35
34
  * @constant
36
35
  * @type {string}
37
36
  */
38
- export declare const VERSION = "0.1.2";
37
+ export declare const VERSION = "0.1.3";
39
38
  export declare const PACKAGE_NAME = "@decaf-ts/for-nest";
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;AAEH,qDAAgD;AAChD,4BAAsB;AAEtB,kDAA4B;AAC5B,mDAA6B;AAC7B,+CAAyB;AACzB,8CAAwB;AACxB,8CAAwB;AACxB,sDAA0B;AAC1B,0DAA8B;AAC9B,2DAA+B;AAC/B,sDAA0B;AAE1B;;;;;GAKG;AACU,QAAA,OAAO,GAAG,aAAa,CAAC;AACxB,QAAA,YAAY,GAAG,aAAa,CAAC;AAE1C,qBAAQ,CAAC,eAAe,CAAC,oBAAY,EAAE,eAAO,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;AAEH,qDAAgD;AAChD,4BAAsB;AAEtB,kDAA4B;AAC5B,mDAA6B;AAC7B,+CAAyB;AACzB,oDAA8B;AAC9B,8CAAwB;AACxB,8CAAwB;AACxB,sDAA0B;AAC1B,0DAA8B;AAE9B;;;;;GAKG;AACU,QAAA,OAAO,GAAG,aAAa,CAAC;AACxB,QAAA,YAAY,GAAG,aAAa,CAAC;AAE1C,qBAAQ,CAAC,eAAe,CAAC,oBAAY,EAAE,eAAO,CAAC,CAAC"}
package/lib/module.cjs CHANGED
@@ -21,7 +21,7 @@ let DecafModule = DecafModule_1 = class DecafModule {
21
21
  const flavour = adapter.flavour;
22
22
  const imports = [core_module_1.DecafCoreModule.forRoot(options)];
23
23
  if (autoControllers) {
24
- imports.push(decaf_model_1.DecafModelModule.forRoot(flavour, options.handlers));
24
+ imports.push(decaf_model_1.DecafModelModule.forRoot(flavour));
25
25
  }
26
26
  return {
27
27
  module: DecafModule_1,
package/lib/module.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAA+E;AAE/E,mDAAgD;AAChD,yDAAiD;AAEjD;;GAEG;AAEI,IAAM,WAAW,mBAAjB,MAAM,WAAW;IACtB,MAAM,CAAC,KAAK,CAAC,YAAY,CACvB,OAA2B;QAE3B,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC;QAEpC,MAAM,OAAO,GAAG,MAAM,6BAAe,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAC7D,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAEhC,MAAM,OAAO,GAOG,CAAC,6BAAe,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QAEnD,IAAI,eAAe,EAAE,CAAC;YACpB,OAAO,CAAC,IAAI,CAAC,8BAAgB,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;QACpE,CAAC;QAED,OAAO;YACL,MAAM,EAAE,aAAW;YACnB,OAAO,EAAE,OAAO;SACjB,CAAC;IACJ,CAAC;CACF,CAAA;AA3BY,kCAAW;sBAAX,WAAW;IADvB,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,WAAW,CA2BvB"}
1
+ {"version":3,"file":"module.js","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAA+E;AAE/E,mDAAgD;AAChD,yDAAiD;AAEjD;;GAEG;AAEI,IAAM,WAAW,mBAAjB,MAAM,WAAW;IACtB,MAAM,CAAC,KAAK,CAAC,YAAY,CACvB,OAA2B;QAE3B,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC;QAEpC,MAAM,OAAO,GAAG,MAAM,6BAAe,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAC7D,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAEhC,MAAM,OAAO,GAOG,CAAC,6BAAe,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QAEnD,IAAI,eAAe,EAAE,CAAC;YACpB,OAAO,CAAC,IAAI,CAAC,8BAAgB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QAClD,CAAC;QAED,OAAO;YACL,MAAM,EAAE,aAAW;YACnB,OAAO,EAAE,OAAO;SACjB,CAAC;IACJ,CAAC;CACF,CAAA;AA3BY,kCAAW;sBAAX,WAAW;IADvB,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,WAAW,CA2BvB"}
package/lib/types.d.ts CHANGED
@@ -1,13 +1,5 @@
1
1
  import { Adapter } from "@decaf-ts/core";
2
2
  import { Constructor } from "@decaf-ts/decoration";
3
- import { Type } from "@nestjs/common";
4
- export interface RequestContextAccessor {
5
- set(key: string | symbol, value: any): void;
6
- get<T = any>(key: string | symbol): T | undefined;
7
- }
8
- export interface DecafRequestHandler {
9
- handle(context: RequestContextAccessor, req: Request): Promise<void>;
10
- }
11
3
  /**
12
4
  * @publicApi
13
5
  */
@@ -16,5 +8,4 @@ export type DecafModuleOptions<CONF = any, A extends Adapter<CONF, any, any, any
16
8
  conf: CONF;
17
9
  alias?: string;
18
10
  autoControllers: boolean;
19
- handlers?: Type<DecafRequestHandler>[];
20
11
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decaf-ts/for-nest",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "NestJS decaf integration",
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,53 +0,0 @@
1
- import { CallHandler, ExecutionContext, NestInterceptor } from "@nestjs/common";
2
- import { DecafHandlerExecutor } from "../request";
3
- /**
4
- * @description
5
- * Interceptor responsible for executing all registered Decaf request handlers
6
- * before the controller method is invoked.
7
- *
8
- * @summary
9
- * The {@link DecafRequestHandlerInterceptor} integrates the Decaf request-handling pipeline
10
- * into NestJS' interceptor mechanism. Before passing execution to the next handler in the
11
- * NestJS chain, it delegates request processing to the {@link DecafHandlerExecutor}, which
12
- * sequentially runs all registered {@link DecafRequestHandler} instances. This allows
13
- * behaviors such as authentication, logging, tenant resolution, or metadata enrichment
14
- * to occur prior to controller execution.
15
- *
16
- * @class DecafRequestHandlerInterceptor
17
- *
18
- * @example
19
- * ```ts
20
- * // Apply globally:
21
- * app.useGlobalInterceptors(new DecafRequestHandlerInterceptor(executor));
22
- *
23
- * // Or in a module:
24
- * @Module({
25
- * providers: [
26
- * DecafHandlerExecutor,
27
- * {
28
- * provide: APP_INTERCEPTOR,
29
- * useClass: DecafRequestHandlerInterceptor,
30
- * },
31
- * ],
32
- * })
33
- * export class AppModule {}
34
- * ```
35
- *
36
- * @mermaid
37
- * sequenceDiagram
38
- * participant Client
39
- * participant Interceptor
40
- * participant Executor
41
- * participant Controller
42
- *
43
- * Client->>Interceptor: HTTP Request
44
- * Interceptor->>Executor: exec(request)
45
- * Executor-->>Interceptor: handlers completed
46
- * Interceptor->>Controller: next.handle()
47
- * Controller-->>Client: Response
48
- */
49
- export declare class DecafRequestHandlerInterceptor implements NestInterceptor {
50
- private readonly executor;
51
- constructor(executor: DecafHandlerExecutor);
52
- intercept(ctx: ExecutionContext, next: CallHandler): Promise<import("rxjs").Observable<any>>;
53
- }
@@ -1,73 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __metadata = (this && this.__metadata) || function (k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
- };
10
- import { Injectable, Scope, } from "@nestjs/common";
11
- import { DecafHandlerExecutor } from "./../request/index.js";
12
- /**
13
- * @description
14
- * Interceptor responsible for executing all registered Decaf request handlers
15
- * before the controller method is invoked.
16
- *
17
- * @summary
18
- * The {@link DecafRequestHandlerInterceptor} integrates the Decaf request-handling pipeline
19
- * into NestJS' interceptor mechanism. Before passing execution to the next handler in the
20
- * NestJS chain, it delegates request processing to the {@link DecafHandlerExecutor}, which
21
- * sequentially runs all registered {@link DecafRequestHandler} instances. This allows
22
- * behaviors such as authentication, logging, tenant resolution, or metadata enrichment
23
- * to occur prior to controller execution.
24
- *
25
- * @class DecafRequestHandlerInterceptor
26
- *
27
- * @example
28
- * ```ts
29
- * // Apply globally:
30
- * app.useGlobalInterceptors(new DecafRequestHandlerInterceptor(executor));
31
- *
32
- * // Or in a module:
33
- * @Module({
34
- * providers: [
35
- * DecafHandlerExecutor,
36
- * {
37
- * provide: APP_INTERCEPTOR,
38
- * useClass: DecafRequestHandlerInterceptor,
39
- * },
40
- * ],
41
- * })
42
- * export class AppModule {}
43
- * ```
44
- *
45
- * @mermaid
46
- * sequenceDiagram
47
- * participant Client
48
- * participant Interceptor
49
- * participant Executor
50
- * participant Controller
51
- *
52
- * Client->>Interceptor: HTTP Request
53
- * Interceptor->>Executor: exec(request)
54
- * Executor-->>Interceptor: handlers completed
55
- * Interceptor->>Controller: next.handle()
56
- * Controller-->>Client: Response
57
- */
58
- let DecafRequestHandlerInterceptor = class DecafRequestHandlerInterceptor {
59
- constructor(executor) {
60
- this.executor = executor;
61
- }
62
- async intercept(ctx, next) {
63
- const req = ctx.switchToHttp().getRequest();
64
- await this.executor.exec(req);
65
- return next.handle();
66
- }
67
- };
68
- DecafRequestHandlerInterceptor = __decorate([
69
- Injectable({ scope: Scope.REQUEST }),
70
- __metadata("design:paramtypes", [DecafHandlerExecutor])
71
- ], DecafRequestHandlerInterceptor);
72
- export { DecafRequestHandlerInterceptor };
73
- //# sourceMappingURL=DecafRequestHandlerInterceptor.js.map
@@ -1 +0,0 @@
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,8BAA8B;IAD1C,UAAU,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;qCAEI,oBAAoB;GADhD,8BAA8B,CAQ1C"}
@@ -1 +0,0 @@
1
- export * from "./DecafRequestHandlerInterceptor";
@@ -1,2 +0,0 @@
1
- export * from "./DecafRequestHandlerInterceptor.js";
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interceptors/index.ts"],"names":[],"mappings":"AAAA,oDAAiD"}
@@ -1,52 +0,0 @@
1
- import { DecafRequestContext } from "./DecafRequestContext";
2
- import { type DecafRequestHandler } from "../types";
3
- /**
4
- * @description
5
- * Executes all registered {@link DecafRequestHandler} instances for the current request,
6
- * providing them with a shared {@link DecafRequestContext}.
7
- *
8
- * @summary
9
- * The {@link DecafHandlerExecutor} class is responsible for orchestrating and executing
10
- * a sequence of request handlers. Each handler receives the same request-scoped context,
11
- * allowing coordinated processing such as authentication, metadata extraction, auditing,
12
- * and custom pipeline behavior. Handlers are injected via the {@link DECAF_HANDLERS} token,
13
- * ensuring extensibility and loose coupling.
14
- *
15
- * @class DecafHandlerExecutor
16
- *
17
- * @example
18
- * ```ts
19
- * // Example handler:
20
- * class AuthHandler implements DecafRequestHandler {
21
- * async handle(context: DecafRequestContext, req: Request) {
22
- * const token = req.headers["authorization"];
23
- * const result = MyService.doSomething(token);
24
- * context.set("my-key", result);
25
- * }
26
- * }
27
- *
28
- * // Executor usage in a request:
29
- * await executor.exec(request);
30
- * // All handlers will run in sequence
31
- * ```
32
- *
33
- * @mermaid
34
- * sequenceDiagram
35
- * participant Client
36
- * participant Executor
37
- * participant HandlerA
38
- * participant HandlerB
39
- *
40
- * Client->>Executor: exec(req)
41
- * Executor->>HandlerA: handle(context, req)
42
- * HandlerA-->>Executor: completed
43
- * Executor->>HandlerB: handle(context, req)
44
- * HandlerB-->>Executor: completed
45
- * Executor-->>Client: processing finished
46
- */
47
- export declare class DecafHandlerExecutor {
48
- private readonly handlers;
49
- private readonly context;
50
- constructor(handlers: DecafRequestHandler[], context: DecafRequestContext);
51
- exec(req: Request): Promise<void>;
52
- }
@@ -1,77 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __metadata = (this && this.__metadata) || function (k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
- };
10
- var __param = (this && this.__param) || function (paramIndex, decorator) {
11
- return function (target, key) { decorator(target, key, paramIndex); }
12
- };
13
- import { Inject, Injectable, Scope } from "@nestjs/common";
14
- import { DecafRequestContext } from "./DecafRequestContext.js";
15
- import { DECAF_HANDLERS } from "./../constants.js";
16
- /**
17
- * @description
18
- * Executes all registered {@link DecafRequestHandler} instances for the current request,
19
- * providing them with a shared {@link DecafRequestContext}.
20
- *
21
- * @summary
22
- * The {@link DecafHandlerExecutor} class is responsible for orchestrating and executing
23
- * a sequence of request handlers. Each handler receives the same request-scoped context,
24
- * allowing coordinated processing such as authentication, metadata extraction, auditing,
25
- * and custom pipeline behavior. Handlers are injected via the {@link DECAF_HANDLERS} token,
26
- * ensuring extensibility and loose coupling.
27
- *
28
- * @class DecafHandlerExecutor
29
- *
30
- * @example
31
- * ```ts
32
- * // Example handler:
33
- * class AuthHandler implements DecafRequestHandler {
34
- * async handle(context: DecafRequestContext, req: Request) {
35
- * const token = req.headers["authorization"];
36
- * const result = MyService.doSomething(token);
37
- * context.set("my-key", result);
38
- * }
39
- * }
40
- *
41
- * // Executor usage in a request:
42
- * await executor.exec(request);
43
- * // All handlers will run in sequence
44
- * ```
45
- *
46
- * @mermaid
47
- * sequenceDiagram
48
- * participant Client
49
- * participant Executor
50
- * participant HandlerA
51
- * participant HandlerB
52
- *
53
- * Client->>Executor: exec(req)
54
- * Executor->>HandlerA: handle(context, req)
55
- * HandlerA-->>Executor: completed
56
- * Executor->>HandlerB: handle(context, req)
57
- * HandlerB-->>Executor: completed
58
- * Executor-->>Client: processing finished
59
- */
60
- let DecafHandlerExecutor = class DecafHandlerExecutor {
61
- constructor(handlers, context) {
62
- this.handlers = handlers;
63
- this.context = context;
64
- }
65
- async exec(req) {
66
- for (const handler of this.handlers) {
67
- await handler.handle(this.context, req);
68
- }
69
- }
70
- };
71
- DecafHandlerExecutor = __decorate([
72
- Injectable({ scope: Scope.REQUEST }),
73
- __param(0, Inject(DECAF_HANDLERS)),
74
- __metadata("design:paramtypes", [Array, DecafRequestContext])
75
- ], DecafHandlerExecutor);
76
- export { DecafHandlerExecutor };
77
- //# sourceMappingURL=DecafHandlerExecutor.js.map
@@ -1 +0,0 @@
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,26 +0,0 @@
1
- /**
2
- * @description
3
- * Request-scoped context used to store arbitrary values for the duration of a single request.
4
- *
5
- * @summary
6
- * The {@link DecafRequestContext} class provides an isolated per-request key-value cache,
7
- * enabling services and controllers to share state or metadata without relying on global
8
- * or static variables. Keys may be strings or symbols, and cached values may hold any
9
- * serializable or non-serializable object.
10
- *
11
- * @class DecafRequestContext
12
- *
13
- * @example
14
- * ```ts
15
- * // Saving a value in the request context:
16
- * context.set("tenantId", "abc123");
17
- *
18
- * // Retrieving it later in the request lifecycle:
19
- * const tenantId = context.get<string>("tenantId");
20
- * ```
21
- */
22
- export declare class DecafRequestContext {
23
- private cache;
24
- set(key: string | symbol, value: any): void;
25
- get<T = any>(key: string | symbol): T | undefined;
26
- }
@@ -1,44 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { Injectable, Scope } from "@nestjs/common";
8
- /**
9
- * @description
10
- * Request-scoped context used to store arbitrary values for the duration of a single request.
11
- *
12
- * @summary
13
- * The {@link DecafRequestContext} class provides an isolated per-request key-value cache,
14
- * enabling services and controllers to share state or metadata without relying on global
15
- * or static variables. Keys may be strings or symbols, and cached values may hold any
16
- * serializable or non-serializable object.
17
- *
18
- * @class DecafRequestContext
19
- *
20
- * @example
21
- * ```ts
22
- * // Saving a value in the request context:
23
- * context.set("tenantId", "abc123");
24
- *
25
- * // Retrieving it later in the request lifecycle:
26
- * const tenantId = context.get<string>("tenantId");
27
- * ```
28
- */
29
- let DecafRequestContext = class DecafRequestContext {
30
- constructor() {
31
- this.cache = new Map();
32
- }
33
- set(key, value) {
34
- this.cache.set(key, value);
35
- }
36
- get(key) {
37
- return this.cache.get(key);
38
- }
39
- };
40
- DecafRequestContext = __decorate([
41
- Injectable({ scope: Scope.REQUEST })
42
- ], DecafRequestContext);
43
- export { DecafRequestContext };
44
- //# sourceMappingURL=DecafRequestContext.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DecafRequestContext.js","sourceRoot":"","sources":["../../../src/request/DecafRequestContext.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;GAoBG;AAEI,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAAzB;QACG,UAAK,GAAG,IAAI,GAAG,EAAwB,CAAC;IASlD,CAAC;IAPC,GAAG,CAAC,GAAoB,EAAE,KAAU;QAClC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC7B,CAAC;IAED,GAAG,CAAU,GAAoB;QAC/B,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;CACF,CAAA;AAVY,mBAAmB;IAD/B,UAAU,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;GACxB,mBAAmB,CAU/B"}
@@ -1,2 +0,0 @@
1
- export * from "./DecafRequestContext";
2
- export * from "./DecafHandlerExecutor";
@@ -1,3 +0,0 @@
1
- export * from "./DecafRequestContext.js";
2
- export * from "./DecafHandlerExecutor.js";
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/request/index.ts"],"names":[],"mappings":"AAAA,yCAAsC;AACtC,0CAAuC"}
@@ -1,76 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.DecafRequestHandlerInterceptor = void 0;
13
- const common_1 = require("@nestjs/common");
14
- const request_1 = require("./../request/index.cjs");
15
- /**
16
- * @description
17
- * Interceptor responsible for executing all registered Decaf request handlers
18
- * before the controller method is invoked.
19
- *
20
- * @summary
21
- * The {@link DecafRequestHandlerInterceptor} integrates the Decaf request-handling pipeline
22
- * into NestJS' interceptor mechanism. Before passing execution to the next handler in the
23
- * NestJS chain, it delegates request processing to the {@link DecafHandlerExecutor}, which
24
- * sequentially runs all registered {@link DecafRequestHandler} instances. This allows
25
- * behaviors such as authentication, logging, tenant resolution, or metadata enrichment
26
- * to occur prior to controller execution.
27
- *
28
- * @class DecafRequestHandlerInterceptor
29
- *
30
- * @example
31
- * ```ts
32
- * // Apply globally:
33
- * app.useGlobalInterceptors(new DecafRequestHandlerInterceptor(executor));
34
- *
35
- * // Or in a module:
36
- * @Module({
37
- * providers: [
38
- * DecafHandlerExecutor,
39
- * {
40
- * provide: APP_INTERCEPTOR,
41
- * useClass: DecafRequestHandlerInterceptor,
42
- * },
43
- * ],
44
- * })
45
- * export class AppModule {}
46
- * ```
47
- *
48
- * @mermaid
49
- * sequenceDiagram
50
- * participant Client
51
- * participant Interceptor
52
- * participant Executor
53
- * participant Controller
54
- *
55
- * Client->>Interceptor: HTTP Request
56
- * Interceptor->>Executor: exec(request)
57
- * Executor-->>Interceptor: handlers completed
58
- * Interceptor->>Controller: next.handle()
59
- * Controller-->>Client: Response
60
- */
61
- let DecafRequestHandlerInterceptor = class DecafRequestHandlerInterceptor {
62
- constructor(executor) {
63
- this.executor = executor;
64
- }
65
- async intercept(ctx, next) {
66
- const req = ctx.switchToHttp().getRequest();
67
- await this.executor.exec(req);
68
- return next.handle();
69
- }
70
- };
71
- exports.DecafRequestHandlerInterceptor = DecafRequestHandlerInterceptor;
72
- exports.DecafRequestHandlerInterceptor = DecafRequestHandlerInterceptor = __decorate([
73
- (0, common_1.Injectable)({ scope: common_1.Scope.REQUEST }),
74
- __metadata("design:paramtypes", [request_1.DecafHandlerExecutor])
75
- ], DecafRequestHandlerInterceptor);
76
- //# sourceMappingURL=DecafRequestHandlerInterceptor.js.map