@nestia/core 3.0.0-dev.20231209 → 3.0.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.
Files changed (132) hide show
  1. package/README.md +12 -9
  2. package/lib/decorators/DynamicModule.js +3 -3
  3. package/lib/decorators/DynamicModule.js.map +1 -1
  4. package/lib/decorators/EncryptedBody.js +14 -13
  5. package/lib/decorators/EncryptedBody.js.map +1 -1
  6. package/lib/decorators/EncryptedModule.d.ts +1 -1
  7. package/lib/decorators/EncryptedModule.js +45 -21
  8. package/lib/decorators/EncryptedModule.js.map +1 -1
  9. package/lib/decorators/EncryptedRoute.d.ts +5 -5
  10. package/lib/decorators/EncryptedRoute.js +12 -29
  11. package/lib/decorators/EncryptedRoute.js.map +1 -1
  12. package/lib/decorators/PlainBody.js +3 -0
  13. package/lib/decorators/PlainBody.js.map +1 -1
  14. package/lib/decorators/SwaggerCustomizer.d.ts +79 -0
  15. package/lib/decorators/SwaggerCustomizer.js +32 -0
  16. package/lib/decorators/SwaggerCustomizer.js.map +1 -0
  17. package/lib/decorators/TypedBody.js +3 -0
  18. package/lib/decorators/TypedBody.js.map +1 -1
  19. package/lib/decorators/TypedException.d.ts +0 -1
  20. package/lib/decorators/TypedException.js +0 -1
  21. package/lib/decorators/TypedException.js.map +1 -1
  22. package/lib/decorators/TypedFormData.d.ts +60 -0
  23. package/lib/decorators/TypedFormData.js +403 -0
  24. package/lib/decorators/TypedFormData.js.map +1 -0
  25. package/lib/decorators/TypedQuery.d.ts +11 -6
  26. package/lib/decorators/TypedQuery.js +6 -1
  27. package/lib/decorators/TypedQuery.js.map +1 -1
  28. package/lib/decorators/TypedRoute.d.ts +5 -5
  29. package/lib/decorators/internal/get_path_and_querify.js +3 -0
  30. package/lib/decorators/internal/get_path_and_querify.js.map +1 -1
  31. package/lib/decorators/internal/load_controller.js.map +1 -1
  32. package/lib/decorators/internal/validate_request_body.d.ts +1 -3
  33. package/lib/decorators/internal/validate_request_body.js +15 -0
  34. package/lib/decorators/internal/validate_request_body.js.map +1 -1
  35. package/lib/decorators/internal/validate_request_form_data.js +79 -0
  36. package/lib/decorators/internal/validate_request_form_data.js.map +1 -0
  37. package/lib/decorators/internal/validate_request_headers.d.ts +1 -3
  38. package/lib/decorators/internal/validate_request_headers.js +15 -0
  39. package/lib/decorators/internal/validate_request_headers.js.map +1 -1
  40. package/lib/decorators/internal/validate_request_query.d.ts +1 -3
  41. package/lib/decorators/internal/validate_request_query.js +15 -0
  42. package/lib/decorators/internal/validate_request_query.js.map +1 -1
  43. package/lib/module.d.ts +2 -0
  44. package/lib/module.js +2 -0
  45. package/lib/module.js.map +1 -1
  46. package/lib/options/IRequestFormDataProps.d.ts +23 -0
  47. package/lib/options/IRequestFormDataProps.js +3 -0
  48. package/lib/options/IRequestFormDataProps.js.map +1 -0
  49. package/lib/programmers/PlainBodyProgrammer.js +1 -1
  50. package/lib/programmers/PlainBodyProgrammer.js.map +1 -1
  51. package/lib/programmers/TypedExceptionProgrammer.js +5 -5
  52. package/lib/programmers/TypedExceptionProgrammer.js.map +1 -1
  53. package/lib/programmers/TypedFormDataBodyProgrammer.d.ts +6 -0
  54. package/lib/programmers/TypedFormDataBodyProgrammer.js +84 -0
  55. package/lib/programmers/TypedFormDataBodyProgrammer.js.map +1 -0
  56. package/lib/programmers/http/HttpQuerifyProgrammer.js +2 -2
  57. package/lib/programmers/http/HttpQuerifyProgrammer.js.map +1 -1
  58. package/lib/transformers/NodeTransformer.js.map +1 -1
  59. package/lib/transformers/ParameterDecoratorTransformer.js +7 -1
  60. package/lib/transformers/ParameterDecoratorTransformer.js.map +1 -1
  61. package/lib/transformers/TypedExceptionTransformer.js +1 -1
  62. package/lib/transformers/TypedExceptionTransformer.js.map +1 -1
  63. package/lib/transformers/TypedRouteTransformer.js +1 -1
  64. package/lib/transformers/TypedRouteTransformer.js.map +1 -1
  65. package/package.json +15 -16
  66. package/src/decorators/DynamicModule.ts +39 -39
  67. package/src/decorators/EncryptedBody.ts +105 -107
  68. package/src/decorators/EncryptedController.ts +38 -38
  69. package/src/decorators/EncryptedModule.ts +96 -79
  70. package/src/decorators/EncryptedRoute.ts +182 -206
  71. package/src/decorators/PlainBody.ts +75 -72
  72. package/src/decorators/SwaggerCustomizer.ts +115 -0
  73. package/src/decorators/TypedBody.ts +62 -59
  74. package/src/decorators/TypedException.ts +90 -89
  75. package/src/decorators/TypedFormData.ts +219 -0
  76. package/src/decorators/TypedHeaders.ts +69 -69
  77. package/src/decorators/TypedParam.ts +65 -65
  78. package/src/decorators/TypedQuery.ts +251 -246
  79. package/src/decorators/TypedRoute.ts +144 -144
  80. package/src/decorators/internal/EncryptedConstant.ts +4 -4
  81. package/src/decorators/internal/NoTransformConfigureError.ts +8 -8
  82. package/src/decorators/internal/get_path_and_querify.ts +106 -103
  83. package/src/decorators/internal/get_path_and_stringify.ts +91 -91
  84. package/src/decorators/internal/get_text_body.ts +20 -20
  85. package/src/decorators/internal/headers_to_object.ts +13 -13
  86. package/src/decorators/internal/load_controller.ts +51 -51
  87. package/src/decorators/internal/route_error.ts +45 -45
  88. package/src/decorators/internal/validate_request_body.ts +72 -57
  89. package/src/decorators/internal/validate_request_form_data.ts +75 -0
  90. package/src/decorators/internal/validate_request_headers.ts +83 -68
  91. package/src/decorators/internal/validate_request_query.ts +71 -56
  92. package/src/index.ts +5 -5
  93. package/src/module.ts +16 -14
  94. package/src/options/INestiaTransformOptions.ts +17 -17
  95. package/src/options/INestiaTransformProject.ts +7 -7
  96. package/src/options/IRequestBodyValidator.ts +20 -20
  97. package/src/options/IRequestFormDataProps.ts +27 -0
  98. package/src/options/IRequestHeadersValidator.ts +22 -22
  99. package/src/options/IRequestQueryValidator.ts +20 -20
  100. package/src/options/IResponseBodyQuerifier.ts +25 -25
  101. package/src/options/IResponseBodyStringifier.ts +25 -25
  102. package/src/programmers/PlainBodyProgrammer.ts +52 -52
  103. package/src/programmers/TypedBodyProgrammer.ts +108 -108
  104. package/src/programmers/TypedExceptionProgrammer.ts +71 -72
  105. package/src/programmers/TypedFormDataBodyProgrammer.ts +108 -0
  106. package/src/programmers/TypedHeadersProgrammer.ts +56 -56
  107. package/src/programmers/TypedParamProgrammer.ts +24 -24
  108. package/src/programmers/TypedQueryBodyProgrammer.ts +56 -56
  109. package/src/programmers/TypedQueryProgrammer.ts +56 -56
  110. package/src/programmers/TypedQueryRouteProgrammer.ts +51 -51
  111. package/src/programmers/TypedRouteProgrammer.ts +51 -51
  112. package/src/programmers/http/HttpAssertQuerifyProgrammer.ts +58 -58
  113. package/src/programmers/http/HttpIsQuerifyProgrammer.ts +62 -62
  114. package/src/programmers/http/HttpQuerifyProgrammer.ts +96 -96
  115. package/src/programmers/http/HttpValidateQuerifyProgrammer.ts +63 -63
  116. package/src/programmers/internal/CoreMetadataUtil.ts +21 -21
  117. package/src/transform.ts +35 -35
  118. package/src/transformers/FileTransformer.ts +66 -66
  119. package/src/transformers/MethodTransformer.ts +94 -94
  120. package/src/transformers/NodeTransformer.ts +16 -16
  121. package/src/transformers/ParameterDecoratorTransformer.ts +120 -121
  122. package/src/transformers/ParameterTransformer.ts +48 -48
  123. package/src/transformers/TypedExceptionTransformer.ts +48 -49
  124. package/src/transformers/TypedRouteTransformer.ts +88 -95
  125. package/src/typings/Creator.ts +3 -3
  126. package/src/utils/ExceptionManager.ts +112 -112
  127. package/src/utils/Singleton.ts +20 -20
  128. package/src/utils/SourceFinder.ts +57 -57
  129. package/lib/decorators/internal/get_binary_body.js +0 -66
  130. package/lib/decorators/internal/get_binary_body.js.map +0 -1
  131. package/src/decorators/internal/get_binary_body.ts +0 -18
  132. /package/lib/decorators/internal/{get_binary_body.d.ts → validate_request_form_data.d.ts} +0 -0
@@ -32,7 +32,7 @@ var TypedExceptionTransformer;
32
32
  return typescript_1.default.factory.createDecorator(TypedExceptionProgrammer_1.TypedExceptionProgrammer.generate(project)(decorator.expression));
33
33
  };
34
34
  };
35
- var LIB_PATH = path_1.default.join("node_modules", "@nestia", "core", "lib", "decorators", "TypedException.d.ts");
35
+ var LIB_PATH = path_1.default.join("@nestia", "core", "lib", "decorators", "TypedException.d.ts");
36
36
  var SRC_PATH = path_1.default.resolve(path_1.default.join(__dirname, "..", "decorators", "TypedException.ts"));
37
37
  })(TypedExceptionTransformer || (exports.TypedExceptionTransformer = TypedExceptionTransformer = {}));
38
38
  //# sourceMappingURL=TypedExceptionTransformer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TypedExceptionTransformer.js","sourceRoot":"","sources":["../../src/transformers/TypedExceptionTransformer.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAwB;AACxB,0DAA4B;AAG5B,oFAAmF;AAEnF,IAAiB,yBAAyB,CA0CzC;AA1CD,WAAiB,yBAAyB;IAC3B,mCAAS,GACpB,UAAC,OAAgC;QACjC,OAAA,UAAC,SAAuB;YACtB,IAAI,CAAC,oBAAE,CAAC,gBAAgB,CAAC,SAAS,CAAC,UAAU,CAAC;gBAAE,OAAO,SAAS,CAAC;YAEjE,kBAAkB;YAClB,IAAM,SAAS,GACb,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;YAC7D,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,WAAW;gBAAE,OAAO,SAAS,CAAC;YAE3D,0BAA0B;YAC1B,IAAM,IAAI,GAAY,CAAC;gBACrB,iBAAiB;gBACjB,IAAM,QAAQ,GAAW,cAAI,CAAC,OAAO,CACnC,SAAS,CAAC,WAAW,CAAC,aAAa,EAAE,CAAC,QAAQ,CAC/C,CAAC;gBACF,IAAI,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,QAAQ,KAAK,QAAQ;oBAC5D,OAAO,KAAK,CAAC;gBAEf,mBAAmB;gBACnB,OAAO,SAAS,CAAC,UAAU,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,CAAC;YACrD,CAAC,CAAC,EAAE,CAAC;YACL,IAAI,IAAI,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,CAC/C,CAAC;gBACF,IAAI,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,QAAQ,KAAK,QAAQ;oBAC5D,OAAO,KAAK,CAAC;gBAEf,mBAAmB;gBACnB,OAAO,SAAS,CAAC,UAAU,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,CAAC;YACrD,CAAC,CAAC,EAAE,CAAC;YACL,IAAI,IAAI,KAAK,KAAK;gBAAE,OAAO,SAAS,CAAC;YAErC,eAAe;YACf,OAAO,oBAAE,CAAC,OAAO,CAAC,eAAe,CAC/B,mDAAwB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,CACjE,CAAC;QACJ,CAAC;IA1BD,CA0BC,CAAC;IAEJ,IAAM,QAAQ,GAAG,cAAI,CAAC,IAAI,CACxB,SAAS,EACT,MAAM,EACN,KAAK,EACL,YAAY,EACZ,qBAAqB,CACtB,CAAC;IACF,IAAM,QAAQ,GAAG,cAAI,CAAC,OAAO,CAC3B,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,mBAAmB,CAAC,CAC9D,CAAC;AACJ,CAAC,EAzCgB,yBAAyB,yCAAzB,yBAAyB,QAyCzC"}
@@ -90,7 +90,7 @@ var TypedRouteTransformer;
90
90
  };
91
91
  var CLASSES = ["EncryptedRoute", "TypedRoute", "TypedQuery"];
92
92
  var LIB_PATHS = CLASSES.map(function (cla) {
93
- return path_1.default.join("node_modules", "@nestia", "core", "lib", "decorators", "".concat(cla, ".d.ts"));
93
+ return path_1.default.join("@nestia", "core", "lib", "decorators", "".concat(cla, ".d.ts"));
94
94
  });
95
95
  var SRC_PATHS = CLASSES.map(function (cla) {
96
96
  return path_1.default.resolve(path_1.default.join(__dirname, "..", "decorators", "".concat(cla, ".ts")));
@@ -1 +1 @@
1
- {"version":3,"file":"TypedRouteTransformer.js","sourceRoot":"","sources":["../../src/transformers/TypedRouteTransformer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,CAAC;QAHvC,CAGuC;IAJzC,CAIyC,CAAC;IAE5C,IAAM,OAAO,GAAG,CAAC,gBAAgB,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;IAC/D,IAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,UAAC,GAAG;QAChC,OAAA,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,UAAG,GAAG,UAAO,CAAC;IAAhE,CAAgE,CACjE,CAAC;IACF,IAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,UAAC,GAAG;QAChC,OAAA,cAAI,CAAC,OAAO,CAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,UAAG,GAAG,QAAK,CAAC,CAAC;IAAnE,CAAmE,CACpE,CAAC;AACJ,CAAC,EAhFgB,qBAAqB,qCAArB,qBAAqB,QAgFrC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestia/core",
3
- "version": "3.0.0-dev.20231209",
3
+ "version": "3.0.0",
4
4
  "description": "Super-fast validation decorators of NestJS",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
@@ -14,8 +14,6 @@
14
14
  "dev": "npm run build -- --watch",
15
15
  "eslint": "eslint ./**/*.ts",
16
16
  "eslint:fix": "eslint ./**/*.ts --fix",
17
- "package:latest": "npm run build && npm publish --access public",
18
- "package:next": "npm run package:latest -- --tag next",
19
17
  "prepare": "ts-patch install && typia patch"
20
18
  },
21
19
  "repository": {
@@ -38,47 +36,48 @@
38
36
  },
39
37
  "homepage": "https://nestia.io",
40
38
  "dependencies": {
41
- "@nestia/fetcher": "^3.0.0-dev.20231209",
39
+ "@nestia/fetcher": "^3.0.0",
42
40
  "@nestjs/common": ">=7.0.1",
43
41
  "@nestjs/core": ">=7.0.1",
44
- "@nestjs/platform-express": ">=7.0.1",
45
- "@nestjs/platform-fastify": ">=7.0.1",
42
+ "@samchon/openapi": "^0.1.2",
46
43
  "detect-ts-node": "^1.0.5",
47
44
  "glob": "^7.2.0",
48
- "raw-body": ">=2.0.0",
45
+ "multer": "1.4.5-lts.1",
46
+ "raw-body": "^2.0.0",
49
47
  "reflect-metadata": ">=0.1.12",
50
48
  "rxjs": ">=6.0.0",
51
- "typia": "^5.3.4"
49
+ "typia": "^6.0.0"
52
50
  },
53
51
  "peerDependencies": {
54
- "@nestia/fetcher": ">=3.0.0-dev.20231209",
52
+ "@nestia/fetcher": ">=3.0.0",
55
53
  "@nestjs/common": ">=7.0.1",
56
54
  "@nestjs/core": ">=7.0.1",
57
- "@nestjs/platform-express": ">=7.0.1",
58
- "@nestjs/platform-fastify": ">=7.0.1",
59
- "raw-body": ">=2.0.0",
60
55
  "reflect-metadata": ">=0.1.12",
61
56
  "rxjs": ">=6.0.0",
62
- "typescript": ">=4.8.0 <5.4.0",
63
- "typia": ">=5.3.4 <6.0.0"
57
+ "typia": ">=6.0.0 <7.0.0"
64
58
  },
65
59
  "devDependencies": {
60
+ "@fastify/multipart": "^8.1.0",
61
+ "@nestjs/common": "^10.3.3",
62
+ "@nestjs/core": "^10.3.3",
66
63
  "@types/express": "^4.17.15",
67
64
  "@types/glob": "^7.2.0",
68
65
  "@types/inquirer": "^9.0.3",
66
+ "@types/multer": "^1.4.11",
69
67
  "@types/ts-expose-internals": "npm:ts-expose-internals@5.2.2",
70
68
  "@typescript-eslint/eslint-plugin": "^5.46.1",
71
69
  "@typescript-eslint/parser": "^5.46.1",
72
70
  "commander": "^10.0.0",
73
71
  "comment-json": "^4.2.3",
74
72
  "eslint-plugin-deprecation": "^1.4.1",
73
+ "fastify": "^4.25.2",
75
74
  "git-last-commit": "^1.0.1",
76
75
  "inquirer": "^8.2.5",
77
76
  "rimraf": "^3.0.2",
78
77
  "ts-node": "^10.9.1",
79
78
  "ts-patch": "^3.1.0",
80
- "tstl": "^2.5.13",
81
- "typescript": "^5.3.2",
79
+ "tstl": "^3.0.0",
80
+ "typescript": "^5.4.2",
82
81
  "typescript-transform-paths": "^3.4.6"
83
82
  },
84
83
  "files": [
@@ -1,39 +1,39 @@
1
- import { Module } from "@nestjs/common";
2
- import { ModuleMetadata } from "@nestjs/common/interfaces";
3
-
4
- import { Creator } from "../typings/Creator";
5
- import { load_controllers } from "./internal/load_controller";
6
-
7
- /**
8
- * Dynamic module.
9
- *
10
- * `DynamicModule` is a namespace wrapping a convenient function, which can load
11
- * controller classes dynamically just by specifying their directory path.
12
- *
13
- * @author Jeongho Nam - https://github.com/samchon
14
- */
15
- export namespace DynamicModule {
16
- /**
17
- * Mount dynamic module.
18
- *
19
- * Constructs a module instance with directory path of controller classes.
20
- *
21
- * Every controller classes in the target directory would be dynamically mounted.
22
- *
23
- * @param path Path of controllers
24
- * @param metadata Addtional metadata except controllers
25
- * @returns module instance
26
- */
27
- export async function mount(
28
- path: string | string[] | { include: string[]; exclude?: string[] },
29
- metadata: Omit<ModuleMetadata, "controllers"> = {},
30
- ): Promise<object> {
31
- // LOAD CONTROLLERS
32
- const controllers: Creator<object>[] = await load_controllers(path);
33
-
34
- // RETURN WITH DECORATING
35
- @Module({ ...metadata, controllers })
36
- class NestiaModule {}
37
- return NestiaModule;
38
- }
39
- }
1
+ import { Module } from "@nestjs/common";
2
+ import { ModuleMetadata } from "@nestjs/common/interfaces";
3
+
4
+ import { Creator } from "../typings/Creator";
5
+ import { load_controllers } from "./internal/load_controller";
6
+
7
+ /**
8
+ * Dynamic module.
9
+ *
10
+ * `DynamicModule` is a namespace wrapping a convenient function, which can load
11
+ * controller classes dynamically just by specifying their directory path.
12
+ *
13
+ * @author Jeongho Nam - https://github.com/samchon
14
+ */
15
+ export namespace DynamicModule {
16
+ /**
17
+ * Mount dynamic module.
18
+ *
19
+ * Constructs a module instance with directory path of controller classes.
20
+ *
21
+ * Every controller classes in the target directory would be dynamically mounted.
22
+ *
23
+ * @param path Path of controllers
24
+ * @param metadata Addtional metadata except controllers
25
+ * @returns module instance
26
+ */
27
+ export async function mount(
28
+ path: string | string[] | { include: string[]; exclude?: string[] },
29
+ metadata: Omit<ModuleMetadata, "controllers"> = {},
30
+ ): Promise<object> {
31
+ // LOAD CONTROLLERS
32
+ const controllers: Creator<object>[] = await load_controllers(path);
33
+
34
+ // RETURN WITH DECORATING
35
+ @Module({ ...metadata, controllers })
36
+ class NestiaModule {}
37
+ return NestiaModule;
38
+ }
39
+ }
@@ -1,107 +1,105 @@
1
- import { IEncryptionPassword } from "@nestia/fetcher/lib/IEncryptionPassword";
2
- import { AesPkcs5 } from "@nestia/fetcher/lib/internal/AesPkcs5";
3
- import {
4
- BadRequestException,
5
- ExecutionContext,
6
- createParamDecorator,
7
- } from "@nestjs/common";
8
- import type express from "express";
9
- import type { FastifyRequest } from "fastify";
10
- import { assert, is, validate } from "typia";
11
-
12
- import { IRequestBodyValidator } from "../options/IRequestBodyValidator";
13
- import { Singleton } from "../utils/Singleton";
14
- import { ENCRYPTION_METADATA_KEY } from "./internal/EncryptedConstant";
15
- import { get_binary_body } from "./internal/get_binary_body";
16
- import { headers_to_object } from "./internal/headers_to_object";
17
- import { validate_request_body } from "./internal/validate_request_body";
18
-
19
- /**
20
- * Encrypted body decorator.
21
- *
22
- * `EncryptedBody` is a decorator function getting `application/json` typed data from
23
- * requeset body which has been encrypted by AES-128/256 algorithm. Also,
24
- * `EncyrptedBody` validates the request body data type through
25
- * [typia](https://github.com/samchon/typia) ad the validation speed is
26
- * maximum 15,000x times faster than `class-validator`.
27
- *
28
- * For reference, when the request body data is not following the promised type `T`,
29
- * `BadRequestException` error (status code: 400) would be thrown. Also,
30
- * `EncryptedRoute` decrypts request body using those options.
31
- *
32
- * - AES-128/256
33
- * - CBC mode
34
- * - PKCS #5 Padding
35
- * - Base64 Encoding
36
- *
37
- * @return Parameter decorator
38
- * @author Jeongho Nam - https://github.com/samchon
39
- */
40
- export function EncryptedBody<T>(
41
- validator?: IRequestBodyValidator<T>,
42
- ): ParameterDecorator {
43
- const checker = validate_request_body("EncryptedBody")(validator);
44
- return createParamDecorator(async function EncryptedBody(
45
- _unknown: any,
46
- context: ExecutionContext,
47
- ) {
48
- const request: express.Request | FastifyRequest = context
49
- .switchToHttp()
50
- .getRequest();
51
- if (isApplicationOctetStream(request.headers["content-type"]) === false)
52
- throw new BadRequestException(
53
- `Request body type is not "application/octet-stream".`,
54
- );
55
-
56
- const param: IEncryptionPassword | IEncryptionPassword.Closure | undefined =
57
- Reflect.getMetadata(ENCRYPTION_METADATA_KEY, context.getClass());
58
- if (!param)
59
- throw new Error(
60
- "Error on nestia.core.EncryptedBody(): no encryption password is given.",
61
- );
62
-
63
- // GET BODY DATA
64
- const headers: Singleton<Record<string, string>> = new Singleton(() =>
65
- headers_to_object(request.headers),
66
- );
67
- const raw: Uint8Array = await get_binary_body(request);
68
- if (raw.length === 0) return;
69
-
70
- // PARSE AND VALIDATE DATA
71
- const password: IEncryptionPassword =
72
- typeof param === "function"
73
- ? param({ headers: headers.get(), body: raw, direction: "decode" })
74
- : param;
75
- const data: any = JSON.parse(
76
- new TextDecoder().decode(decrypt(raw, password.key, password.iv)),
77
- );
78
- const error: Error | null = checker(data);
79
- if (error !== null) throw error;
80
- return data;
81
- })();
82
- }
83
- Object.assign(EncryptedBody, is);
84
- Object.assign(EncryptedBody, assert);
85
- Object.assign(EncryptedBody, validate);
86
-
87
- /**
88
- * @internal
89
- */
90
- const decrypt = (body: Uint8Array, key: string, iv: string): Uint8Array => {
91
- try {
92
- return AesPkcs5.decrypt(body, key, iv);
93
- } catch (exp) {
94
- if (exp instanceof Error)
95
- throw new BadRequestException(
96
- "Failed to decrypt the request body. Check your body content or encryption password.",
97
- );
98
- else throw exp;
99
- }
100
- };
101
-
102
- const isApplicationOctetStream = (text?: string): boolean =>
103
- text !== undefined &&
104
- text
105
- .split(";")
106
- .map((str) => str.trim())
107
- .some((str) => str === "application/octet-stream");
1
+ import { AesPkcs5 } from "@nestia/fetcher/lib/AesPkcs5";
2
+ import { IEncryptionPassword } from "@nestia/fetcher/lib/IEncryptionPassword";
3
+ import {
4
+ BadRequestException,
5
+ ExecutionContext,
6
+ createParamDecorator,
7
+ } from "@nestjs/common";
8
+ import type express from "express";
9
+ import type { FastifyRequest } from "fastify";
10
+ import { assert, is, validate } from "typia";
11
+
12
+ import { IRequestBodyValidator } from "../options/IRequestBodyValidator";
13
+ import { Singleton } from "../utils/Singleton";
14
+ import { ENCRYPTION_METADATA_KEY } from "./internal/EncryptedConstant";
15
+ import { get_text_body } from "./internal/get_text_body";
16
+ import { headers_to_object } from "./internal/headers_to_object";
17
+ import { validate_request_body } from "./internal/validate_request_body";
18
+
19
+ /**
20
+ * Encrypted body decorator.
21
+ *
22
+ * `EncryptedBody` is a decorator function getting `application/json` typed data from
23
+ * requeset body which has been encrypted by AES-128/256 algorithm. Also,
24
+ * `EncyrptedBody` validates the request body data type through
25
+ * [typia](https://github.com/samchon/typia) ad the validation speed is
26
+ * maximum 15,000x times faster than `class-validator`.
27
+ *
28
+ * For reference, when the request body data is not following the promised type `T`,
29
+ * `BadRequestException` error (status code: 400) would be thrown. Also,
30
+ * `EncryptedRoute` decrypts request body using those options.
31
+ *
32
+ * - AES-128/256
33
+ * - CBC mode
34
+ * - PKCS #5 Padding
35
+ * - Base64 Encoding
36
+ *
37
+ * @return Parameter decorator
38
+ * @author Jeongho Nam - https://github.com/samchon
39
+ */
40
+ export function EncryptedBody<T>(
41
+ validator?: IRequestBodyValidator<T>,
42
+ ): ParameterDecorator {
43
+ const checker = validate_request_body("EncryptedBody")(validator);
44
+ return createParamDecorator(async function EncryptedBody(
45
+ _unknown: any,
46
+ context: ExecutionContext,
47
+ ) {
48
+ const request: express.Request | FastifyRequest = context
49
+ .switchToHttp()
50
+ .getRequest();
51
+ if (isTextPlain(request.headers["content-type"]) === false)
52
+ throw new BadRequestException(`Request body type is not "text/plain".`);
53
+
54
+ const param: IEncryptionPassword | IEncryptionPassword.Closure | undefined =
55
+ Reflect.getMetadata(ENCRYPTION_METADATA_KEY, context.getClass());
56
+ if (!param)
57
+ throw new Error(
58
+ "Error on nestia.core.EncryptedBody(): no encryption password is given.",
59
+ );
60
+
61
+ // GET BODY DATA
62
+ const headers: Singleton<Record<string, string>> = new Singleton(() =>
63
+ headers_to_object(request.headers),
64
+ );
65
+ const body: string = await get_text_body(request);
66
+ const password: IEncryptionPassword =
67
+ typeof param === "function"
68
+ ? param({ headers: headers.get(), body, direction: "decode" })
69
+ : param;
70
+
71
+ // PARSE AND VALIDATE DATA
72
+ const data: any = JSON.parse(decrypt(body, password.key, password.iv));
73
+ const error: Error | null = checker(data);
74
+ if (error !== null) throw error;
75
+ return data;
76
+ })();
77
+ }
78
+ Object.assign(EncryptedBody, is);
79
+ Object.assign(EncryptedBody, assert);
80
+ Object.assign(EncryptedBody, validate);
81
+
82
+ /**
83
+ * @internal
84
+ */
85
+ const decrypt = (body: string, key: string, iv: string): string => {
86
+ try {
87
+ return AesPkcs5.decrypt(body, key, iv);
88
+ } catch (exp) {
89
+ if (exp instanceof Error)
90
+ throw new BadRequestException(
91
+ "Failed to decrypt the request body. Check your body content or encryption password.",
92
+ );
93
+ else throw exp;
94
+ }
95
+ };
96
+
97
+ /**
98
+ * @internal
99
+ */
100
+ const isTextPlain = (text?: string): boolean =>
101
+ text !== undefined &&
102
+ text
103
+ .split(";")
104
+ .map((str) => str.trim())
105
+ .some((str) => str === "text/plain");
@@ -1,38 +1,38 @@
1
- import { IEncryptionPassword } from "@nestia/fetcher/lib/IEncryptionPassword";
2
- import { Controller } from "@nestjs/common";
3
-
4
- import { ENCRYPTION_METADATA_KEY } from "./internal/EncryptedConstant";
5
-
6
- /**
7
- * Encrypted controller.
8
- *
9
- * `EncryptedController` is an extension of the {@link nest.Controller} class decorator
10
- * function who configures encryption password of the AES-128/256 algorithm. The
11
- * encryption algorithm and password would be used by {@link EncryptedRoute} and
12
- * {@link EncryptedBody} to encrypt the request and response body of the HTTP protocol.
13
- *
14
- * By the way, you can configure the encryption password in the global level by using
15
- * {@link EncryptedModule} instead of the {@link nest.Module} in the module level. In
16
- * that case, you don't need to use this `EncryptedController` more. Just use the
17
- * {@link nest.Controller} without duplicated encryption password definitions.
18
- *
19
- * Of course, if you want to use different encryption password from the
20
- * {@link EncryptedModule}, this `EncryptedController` would be useful again. Therefore,
21
- * I recommend to use this `EncryptedController` decorator function only when you must
22
- * configure different encryption password from the {@link EncryptedModule}.
23
- *
24
- * @param path Path of the HTTP request
25
- * @param password Encryption password or its getter function
26
- * @returns Class decorator
27
- *
28
- * @author Jeongho Nam - https://github.com/samchon
29
- */
30
- export function EncryptedController(
31
- path: string,
32
- password: IEncryptionPassword | IEncryptionPassword.Closure,
33
- ): ClassDecorator {
34
- return function (target: any) {
35
- Reflect.defineMetadata(ENCRYPTION_METADATA_KEY, password, target);
36
- Controller(path)(target);
37
- };
38
- }
1
+ import { IEncryptionPassword } from "@nestia/fetcher/lib/IEncryptionPassword";
2
+ import { Controller } from "@nestjs/common";
3
+
4
+ import { ENCRYPTION_METADATA_KEY } from "./internal/EncryptedConstant";
5
+
6
+ /**
7
+ * Encrypted controller.
8
+ *
9
+ * `EncryptedController` is an extension of the {@link nest.Controller} class decorator
10
+ * function who configures encryption password of the AES-128/256 algorithm. The
11
+ * encryption algorithm and password would be used by {@link EncryptedRoute} and
12
+ * {@link EncryptedBody} to encrypt the request and response body of the HTTP protocol.
13
+ *
14
+ * By the way, you can configure the encryption password in the global level by using
15
+ * {@link EncryptedModule} instead of the {@link nest.Module} in the module level. In
16
+ * that case, you don't need to use this `EncryptedController` more. Just use the
17
+ * {@link nest.Controller} without duplicated encryption password definitions.
18
+ *
19
+ * Of course, if you want to use different encryption password from the
20
+ * {@link EncryptedModule}, this `EncryptedController` would be useful again. Therefore,
21
+ * I recommend to use this `EncryptedController` decorator function only when you must
22
+ * configure different encryption password from the {@link EncryptedModule}.
23
+ *
24
+ * @param path Path of the HTTP request
25
+ * @param password Encryption password or its getter function
26
+ * @returns Class decorator
27
+ *
28
+ * @author Jeongho Nam - https://github.com/samchon
29
+ */
30
+ export function EncryptedController(
31
+ path: string,
32
+ password: IEncryptionPassword | IEncryptionPassword.Closure,
33
+ ): ClassDecorator {
34
+ return function (target: any) {
35
+ Reflect.defineMetadata(ENCRYPTION_METADATA_KEY, password, target);
36
+ Controller(path)(target);
37
+ };
38
+ }