@eggjs/controller-decorator 4.0.0-beta.7 → 4.0.0-beta.8

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 (55) hide show
  1. package/dist/index.d.ts +247 -23
  2. package/dist/index.js +749 -28
  3. package/package.json +6 -6
  4. package/dist/builder/ControllerMetaBuilderFactory.d.ts +0 -11
  5. package/dist/builder/ControllerMetaBuilderFactory.js +0 -37
  6. package/dist/builder/index.js +0 -3
  7. package/dist/decorator/Acl.d.ts +0 -4
  8. package/dist/decorator/Acl.js +0 -24
  9. package/dist/decorator/Context.d.ts +0 -4
  10. package/dist/decorator/Context.js +0 -16
  11. package/dist/decorator/Middleware.d.ts +0 -6
  12. package/dist/decorator/Middleware.js +0 -57
  13. package/dist/decorator/http/HTTPController.d.ts +0 -6
  14. package/dist/decorator/http/HTTPController.js +0 -23
  15. package/dist/decorator/http/HTTPMethod.d.ts +0 -6
  16. package/dist/decorator/http/HTTPMethod.js +0 -21
  17. package/dist/decorator/http/HTTPParam.d.ts +0 -12
  18. package/dist/decorator/http/HTTPParam.js +0 -77
  19. package/dist/decorator/http/Host.d.ts +0 -6
  20. package/dist/decorator/http/Host.js +0 -27
  21. package/dist/decorator/http/index.js +0 -6
  22. package/dist/decorator/index.js +0 -10
  23. package/dist/impl/http/HTTPControllerMetaBuilder.d.ts +0 -13
  24. package/dist/impl/http/HTTPControllerMetaBuilder.js +0 -63
  25. package/dist/impl/http/HTTPControllerMethodMetaBuilder.d.ts +0 -15
  26. package/dist/impl/http/HTTPControllerMethodMetaBuilder.js +0 -80
  27. package/dist/impl/http/index.js +0 -4
  28. package/dist/impl/index.js +0 -5
  29. package/dist/model/HTTPControllerMeta.d.ts +0 -25
  30. package/dist/model/HTTPControllerMeta.js +0 -53
  31. package/dist/model/HTTPCookies.d.ts +0 -6
  32. package/dist/model/HTTPCookies.js +0 -7
  33. package/dist/model/HTTPMethodMeta.d.ts +0 -59
  34. package/dist/model/HTTPMethodMeta.js +0 -102
  35. package/dist/model/HTTPRequest.d.ts +0 -8
  36. package/dist/model/HTTPRequest.js +0 -5
  37. package/dist/model/HTTPResponse.d.ts +0 -11
  38. package/dist/model/HTTPResponse.js +0 -5
  39. package/dist/model/index.js +0 -7
  40. package/dist/util/ControllerInfoUtil.d.ts +0 -20
  41. package/dist/util/ControllerInfoUtil.js +0 -48
  42. package/dist/util/ControllerMetadataUtil.d.ts +0 -9
  43. package/dist/util/ControllerMetadataUtil.js +0 -21
  44. package/dist/util/HTTPInfoUtil.d.ts +0 -20
  45. package/dist/util/HTTPInfoUtil.js +0 -53
  46. package/dist/util/HTTPPriorityUtil.d.ts +0 -22
  47. package/dist/util/HTTPPriorityUtil.js +0 -38
  48. package/dist/util/MethodInfoUtil.d.ts +0 -23
  49. package/dist/util/MethodInfoUtil.js +0 -62
  50. package/dist/util/index.js +0 -10
  51. package/dist/util/validator/ControllerValidator.d.ts +0 -8
  52. package/dist/util/validator/ControllerValidator.js +0 -16
  53. package/dist/util/validator/MethodValidator.d.ts +0 -8
  54. package/dist/util/validator/MethodValidator.js +0 -31
  55. package/dist/util/validator/index.js +0 -4
@@ -1,31 +0,0 @@
1
- import { ControllerInfoUtil } from "../ControllerInfoUtil.js";
2
- import { MethodInfoUtil } from "../MethodInfoUtil.js";
3
- import { ClassUtil } from "@eggjs/tegg-metadata";
4
-
5
- //#region src/util/validator/MethodValidator.ts
6
- var MethodValidator = class {
7
- static validate(clazz, methodName) {
8
- const methodControllerType = MethodInfoUtil.getMethodControllerType(clazz, methodName);
9
- const methodMiddlewares = MethodInfoUtil.getMethodMiddlewares(clazz, methodName);
10
- const contextIndex = MethodInfoUtil.getMethodContextIndex(clazz, methodName);
11
- if (!methodControllerType) {
12
- if (methodMiddlewares.length) {
13
- const desc = ClassUtil.classDescription(clazz);
14
- throw new Error(`${desc}:${methodName} @Middleware should use with method decorator`);
15
- }
16
- if (contextIndex !== void 0) {
17
- const desc = ClassUtil.classDescription(clazz);
18
- throw new Error(`${desc}:${methodName} @Context should use with method decorator`);
19
- }
20
- return;
21
- }
22
- const controllerType = ControllerInfoUtil.getControllerType(clazz);
23
- if (methodControllerType !== controllerType) {
24
- const desc = ClassUtil.classDescription(clazz);
25
- throw new Error(`${desc}:${methodName} method decorator ${methodControllerType} can not be used with ${controllerType}`);
26
- }
27
- }
28
- };
29
-
30
- //#endregion
31
- export { MethodValidator };
@@ -1,4 +0,0 @@
1
- import { ControllerValidator } from "./ControllerValidator.js";
2
- import { MethodValidator } from "./MethodValidator.js";
3
-
4
- export { };