@midwayjs/decorator 3.0.0-alpha.42 → 3.0.0-beta.10

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 (107) hide show
  1. package/CHANGELOG.md +107 -0
  2. package/README.md +1 -1
  3. package/dist/constant.d.ts +7 -5
  4. package/dist/constant.js +18 -9
  5. package/dist/{annotation → decorator/common}/aspect.d.ts +0 -0
  6. package/dist/{annotation → decorator/common}/aspect.js +5 -4
  7. package/dist/{annotation → decorator/common}/autoload.d.ts +0 -0
  8. package/dist/{annotation → decorator/common}/autoload.js +3 -1
  9. package/dist/{annotation → decorator/common}/configuration.d.ts +3 -1
  10. package/dist/{annotation → decorator/common}/configuration.js +2 -2
  11. package/dist/{annotation → decorator/common}/decide.d.ts +0 -0
  12. package/dist/{annotation → decorator/common}/decide.js +0 -0
  13. package/dist/decorator/common/filter.d.ts +4 -0
  14. package/dist/decorator/common/filter.js +30 -0
  15. package/dist/decorator/common/framework.d.ts +2 -0
  16. package/dist/decorator/common/framework.js +13 -0
  17. package/dist/{annotation → decorator/common}/index.d.ts +6 -8
  18. package/dist/{annotation → decorator/common}/index.js +6 -10
  19. package/dist/decorator/common/inject.d.ts +3 -0
  20. package/dist/decorator/common/inject.js +11 -0
  21. package/dist/decorator/common/middleware.d.ts +2 -0
  22. package/dist/decorator/common/middleware.js +12 -0
  23. package/dist/decorator/common/objectDef.d.ts +5 -0
  24. package/dist/decorator/common/objectDef.js +25 -0
  25. package/dist/decorator/common/pipeline.d.ts +3 -0
  26. package/dist/decorator/common/pipeline.js +11 -0
  27. package/dist/decorator/common/provide.d.ts +3 -0
  28. package/dist/{annotation → decorator/common}/provide.js +2 -2
  29. package/dist/{faas/fun.d.ts → decorator/faas/serverlessTrigger.d.ts} +2 -14
  30. package/dist/decorator/faas/serverlessTrigger.js +29 -0
  31. package/dist/decorator/framework/index.d.ts +7 -0
  32. package/dist/decorator/framework/index.js +33 -0
  33. package/dist/{annotation → decorator/framework}/schedule.d.ts +0 -0
  34. package/dist/{annotation → decorator/framework}/schedule.js +4 -3
  35. package/dist/decorator/index.d.ts +18 -0
  36. package/dist/decorator/index.js +38 -0
  37. package/dist/{microservice → decorator/microservice}/consumer.d.ts +1 -1
  38. package/dist/{microservice → decorator/microservice}/consumer.js +4 -3
  39. package/dist/{microservice → decorator/microservice}/provider.d.ts +1 -1
  40. package/dist/{microservice → decorator/microservice}/provider.js +4 -3
  41. package/dist/{microservice → decorator/microservice}/rabbitmqListener.d.ts +0 -0
  42. package/dist/{microservice → decorator/microservice}/rabbitmqListener.js +1 -1
  43. package/dist/{rpc → decorator/rpc}/hsf.d.ts +0 -0
  44. package/dist/{rpc → decorator/rpc}/hsf.js +4 -3
  45. package/dist/decorator/task/queue.d.ts +2 -0
  46. package/dist/{annotation → decorator/task}/queue.js +3 -2
  47. package/dist/{annotation → decorator/task}/task.d.ts +0 -0
  48. package/dist/{annotation → decorator/task}/task.js +2 -2
  49. package/dist/{annotation → decorator/task}/taskLocal.d.ts +0 -0
  50. package/dist/{annotation → decorator/task}/taskLocal.js +2 -2
  51. package/dist/{web → decorator/web}/controller.d.ts +3 -1
  52. package/dist/{web → decorator/web}/controller.js +4 -3
  53. package/dist/{web → decorator/web}/paramMapping.d.ts +10 -10
  54. package/dist/{web → decorator/web}/paramMapping.js +4 -8
  55. package/dist/{web → decorator/web}/requestMapping.d.ts +34 -1
  56. package/dist/{web → decorator/web}/requestMapping.js +3 -1
  57. package/dist/{web → decorator/web}/response.d.ts +0 -0
  58. package/dist/{web → decorator/web}/response.js +1 -1
  59. package/dist/{ws → decorator/ws}/webSocketController.d.ts +1 -1
  60. package/dist/{ws → decorator/ws}/webSocketController.js +4 -3
  61. package/dist/{ws → decorator/ws}/webSocketEvent.d.ts +0 -0
  62. package/dist/{ws → decorator/ws}/webSocketEvent.js +1 -1
  63. package/dist/decoratorManager.d.ts +288 -0
  64. package/dist/{common/decoratorManager.js → decoratorManager.js} +241 -317
  65. package/dist/index.d.ts +3 -22
  66. package/dist/index.js +3 -22
  67. package/dist/interface.d.ts +40 -23
  68. package/dist/interface.js +31 -17
  69. package/dist/util/format.d.ts +25 -0
  70. package/dist/util/format.js +38 -0
  71. package/dist/util/index.d.ts +5 -0
  72. package/dist/util/index.js +27 -1
  73. package/package.json +3 -6
  74. package/dist/annotation/inject.d.ts +0 -3
  75. package/dist/annotation/inject.js +0 -16
  76. package/dist/annotation/objectDef.d.ts +0 -7
  77. package/dist/annotation/objectDef.js +0 -43
  78. package/dist/annotation/pipeline.d.ts +0 -3
  79. package/dist/annotation/pipeline.js +0 -27
  80. package/dist/annotation/priority.d.ts +0 -2
  81. package/dist/annotation/priority.js +0 -11
  82. package/dist/annotation/provide.d.ts +0 -3
  83. package/dist/annotation/queue.d.ts +0 -2
  84. package/dist/annotation/rule.d.ts +0 -1
  85. package/dist/annotation/rule.js +0 -58
  86. package/dist/annotation/validate.d.ts +0 -1
  87. package/dist/annotation/validate.js +0 -36
  88. package/dist/common/decoratorManager.d.ts +0 -324
  89. package/dist/common/errMsg.d.ts +0 -4
  90. package/dist/common/errMsg.js +0 -8
  91. package/dist/common/metadata.d.ts +0 -9
  92. package/dist/common/metadata.js +0 -20
  93. package/dist/common/scopeEnum.d.ts +0 -6
  94. package/dist/common/scopeEnum.js +0 -10
  95. package/dist/faas/fun.js +0 -62
  96. package/dist/faas/handler.d.ts +0 -3
  97. package/dist/faas/handler.js +0 -21
  98. package/dist/framework/app.d.ts +0 -3
  99. package/dist/framework/app.js +0 -22
  100. package/dist/framework/config.d.ts +0 -2
  101. package/dist/framework/config.js +0 -25
  102. package/dist/framework/logger.d.ts +0 -2
  103. package/dist/framework/logger.js +0 -22
  104. package/dist/framework/plugin.d.ts +0 -2
  105. package/dist/framework/plugin.js +0 -22
  106. package/dist/util/dtoHelper.d.ts +0 -6
  107. package/dist/util/dtoHelper.js +0 -32
package/CHANGELOG.md CHANGED
@@ -3,6 +3,113 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.0.0-beta.10](https://github.com/midwayjs/midway/compare/v3.0.0-beta.9...v3.0.0-beta.10) (2021-12-20)
7
+
8
+
9
+ ### Features
10
+
11
+ * implement i18n for validate ([#1426](https://github.com/midwayjs/midway/issues/1426)) ([4c7ed2f](https://github.com/midwayjs/midway/commit/4c7ed2ff2e7ccf10f88f62abad230f92f5e76b97))
12
+
13
+
14
+
15
+
16
+
17
+ # [3.0.0-beta.9](https://github.com/midwayjs/midway/compare/v3.0.0-beta.8...v3.0.0-beta.9) (2021-12-09)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * faas missing config in framework ([#1413](https://github.com/midwayjs/midway/issues/1413)) ([7ab16a2](https://github.com/midwayjs/midway/commit/7ab16a24b29d5254a762bfffcdf18385effdf639))
23
+
24
+
25
+
26
+
27
+
28
+ # [3.0.0-beta.8](https://github.com/midwayjs/midway/compare/v3.0.0-beta.7...v3.0.0-beta.8) (2021-12-08)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * express routing middleware takes effect at the controller level ([#1364](https://github.com/midwayjs/midway/issues/1364)) ([b9272e0](https://github.com/midwayjs/midway/commit/b9272e0971003443304b0c53815be31a0061b4bd))
34
+ * typeorm EntityView missing connectionName ([#1403](https://github.com/midwayjs/midway/issues/1403)) ([30b2b37](https://github.com/midwayjs/midway/commit/30b2b3711db485cb85d825d56aeabf53b1374cae))
35
+
36
+
37
+
38
+
39
+
40
+ # [3.0.0-beta.7](https://github.com/midwayjs/midway/compare/v3.0.0-beta.6...v3.0.0-beta.7) (2021-12-03)
41
+
42
+ **Note:** Version bump only for package @midwayjs/decorator
43
+
44
+
45
+
46
+
47
+
48
+ # [3.0.0-beta.6](https://github.com/midwayjs/midway/compare/v3.0.0-beta.5...v3.0.0-beta.6) (2021-11-26)
49
+
50
+
51
+ ### Bug Fixes
52
+
53
+ * class transformer method missing ([#1387](https://github.com/midwayjs/midway/issues/1387)) ([074e839](https://github.com/midwayjs/midway/commit/074e8393598dc95e2742f735df75a2191c5fe25d))
54
+
55
+
56
+
57
+
58
+
59
+ # [3.0.0-beta.5](https://github.com/midwayjs/midway/compare/v3.0.0-beta.4...v3.0.0-beta.5) (2021-11-25)
60
+
61
+
62
+ ### Bug Fixes
63
+
64
+ * [@match](https://github.com/match) empty args ([#1384](https://github.com/midwayjs/midway/issues/1384)) ([6f90fc9](https://github.com/midwayjs/midway/commit/6f90fc993ff01e078288ff664833c61c02dede51))
65
+
66
+
67
+
68
+
69
+
70
+ # [3.0.0-beta.4](https://github.com/midwayjs/midway/compare/v3.0.0-beta.3...v3.0.0-beta.4) (2021-11-24)
71
+
72
+
73
+ ### Features
74
+
75
+ * add i18n ([#1375](https://github.com/midwayjs/midway/issues/1375)) ([bffefe0](https://github.com/midwayjs/midway/commit/bffefe07afe45777d49b5a76b9ab17fc2b9d9a55))
76
+ * auto transform args to type ([#1372](https://github.com/midwayjs/midway/issues/1372)) ([bb3f7d2](https://github.com/midwayjs/midway/commit/bb3f7d2028a034e1926d9df554849332354c3762))
77
+ * support global prefix url ([#1371](https://github.com/midwayjs/midway/issues/1371)) ([cc5fe44](https://github.com/midwayjs/midway/commit/cc5fe44e1d221590562dc71e1f33ae96093e0da7))
78
+
79
+
80
+
81
+
82
+
83
+ # [3.0.0-beta.3](https://github.com/midwayjs/midway/compare/v3.0.0-beta.2...v3.0.0-beta.3) (2021-11-18)
84
+
85
+ **Note:** Version bump only for package @midwayjs/decorator
86
+
87
+
88
+
89
+
90
+
91
+ # [3.0.0-beta.2](https://github.com/midwayjs/midway/compare/v3.0.0-beta.1...v3.0.0-beta.2) (2021-11-16)
92
+
93
+
94
+ ### Bug Fixes
95
+
96
+ * middleware decorator missing ([#1366](https://github.com/midwayjs/midway/issues/1366)) ([5f9a8c1](https://github.com/midwayjs/midway/commit/5f9a8c1f7cdd940f785f6c9871fb67b9738de940))
97
+
98
+
99
+
100
+
101
+
102
+ # [3.0.0-beta.1](https://github.com/midwayjs/midway/compare/v2.12.4...v3.0.0-beta.1) (2021-11-14)
103
+
104
+
105
+ ### Features
106
+
107
+ * merge DTO Helper for [#1250](https://github.com/midwayjs/midway/issues/1250) ([#1288](https://github.com/midwayjs/midway/issues/1288)) ([3f8f937](https://github.com/midwayjs/midway/commit/3f8f93765a66f49940565231d50405a7dbd593c7))
108
+
109
+
110
+
111
+
112
+
6
113
  ## [2.12.3](https://github.com/midwayjs/midway/compare/v2.12.2...v2.12.3) (2021-08-09)
7
114
 
8
115
 
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  this is a sub package for midway.
7
7
 
8
- Document: [https://midwayjs.org/midway](https://midwayjs.org/midway)
8
+ Document: [https://midwayjs.org](https://midwayjs.org)
9
9
 
10
10
  ## License
11
11
 
@@ -1,11 +1,11 @@
1
1
  export declare const ALL = "common:all_value_key";
2
- export declare const PRIORITY_KEY = "common:priority";
3
2
  export declare const SCHEDULE_KEY = "common:schedule";
4
3
  export declare const CONFIGURATION_KEY = "common:configuration";
5
- export declare const RULES_KEY = "common:rules";
4
+ export declare const FRAMEWORK_KEY = "common:framework";
6
5
  export declare const ASPECT_KEY = "common:aspect";
6
+ export declare const CATCH_KEY = "common:catch";
7
+ export declare const MATCH_KEY = "common:match";
7
8
  export declare const FUNC_KEY = "faas:func";
8
- export declare const HANDLER_KEY = "faas:handler";
9
9
  export declare const SERVERLESS_FUNC_KEY = "faas:serverless:function";
10
10
  export declare const CONTROLLER_KEY = "web:controller";
11
11
  export declare const WEB_ROUTER_KEY = "web:router";
@@ -37,11 +37,13 @@ export declare const CONFIG_KEY = "config";
37
37
  export declare const PLUGIN_KEY = "plugin";
38
38
  export declare const LOGGER_KEY = "logger";
39
39
  export declare const APPLICATION_KEY = "__midway_framework_app__";
40
+ export declare const APPLICATION_CONTEXT_KEY = "__midway_application_context__";
40
41
  export declare const CLASS_KEY_CONSTRUCTOR = "midway:class_key_constructor";
41
42
  export declare const NAMED_TAG = "named";
42
43
  export declare const INJECT_TAG = "inject";
43
- export declare const TAGGED = "injection:tagged";
44
- export declare const TAGGED_PROP = "injection:tagged_props";
44
+ export declare const INJECT_CUSTOM_PROPERTY = "inject_custom_property";
45
+ export declare const INJECT_CUSTOM_METHOD = "inject_custom_method";
46
+ export declare const INJECT_CUSTOM_PARAM = "inject_custom_param";
45
47
  export declare const TAGGED_CLS = "injection:tagged_class";
46
48
  export declare const TAGGED_FUN = "injection:tagged_function";
47
49
  export declare const OBJ_DEF_CLS = "injection:object_definition_class";
package/dist/constant.js CHANGED
@@ -1,18 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MAIN_MODULE_KEY = exports.LIFECYCLE_IDENTIFIER_PREFIX = exports.PIPELINE_IDENTIFIER = exports.OBJ_DEF_CLS = exports.TAGGED_FUN = exports.TAGGED_CLS = exports.TAGGED_PROP = exports.TAGGED = exports.INJECT_TAG = exports.NAMED_TAG = exports.CLASS_KEY_CONSTRUCTOR = exports.APPLICATION_KEY = exports.LOGGER_KEY = exports.PLUGIN_KEY = exports.CONFIG_KEY = exports.MS_HSF_METHOD_KEY = exports.MS_DUBBO_METHOD_KEY = exports.MS_GRPC_METHOD_KEY = exports.MS_PROVIDER_KEY = exports.MS_PRODUCER_KEY = exports.MS_CONSUMER_KEY = exports.RPC_DUBBO_KEY = exports.RPC_GRPC_KEY = exports.HSF_KEY = exports.WS_EVENT_KEY = exports.WS_CONTROLLER_KEY = exports.MODULE_TASK_QUEUE_OPTIONS = exports.MODULE_TASK_QUEUE_KEY = exports.MODULE_TASK_TASK_LOCAL_OPTIONS = exports.MODULE_TASK_TASK_LOCAL_KEY = exports.MODULE_TASK_METADATA = exports.MODULE_TASK_KEY = exports.WEB_RESPONSE_RENDER = exports.WEB_RESPONSE_CONTENT_TYPE = exports.WEB_RESPONSE_HEADER = exports.WEB_RESPONSE_REDIRECT = exports.WEB_RESPONSE_HTTP_CODE = exports.WEB_RESPONSE_KEY = exports.WEB_ROUTER_PARAM_KEY = exports.WEB_ROUTER_KEY = exports.CONTROLLER_KEY = exports.SERVERLESS_FUNC_KEY = exports.HANDLER_KEY = exports.FUNC_KEY = exports.ASPECT_KEY = exports.RULES_KEY = exports.CONFIGURATION_KEY = exports.SCHEDULE_KEY = exports.PRIORITY_KEY = exports.ALL = void 0;
4
- exports.PRIVATE_META_DATA_KEY = void 0;
3
+ exports.PIPELINE_IDENTIFIER = exports.OBJ_DEF_CLS = exports.TAGGED_FUN = exports.TAGGED_CLS = exports.INJECT_CUSTOM_PARAM = exports.INJECT_CUSTOM_METHOD = exports.INJECT_CUSTOM_PROPERTY = exports.INJECT_TAG = exports.NAMED_TAG = exports.CLASS_KEY_CONSTRUCTOR = exports.APPLICATION_CONTEXT_KEY = exports.APPLICATION_KEY = exports.LOGGER_KEY = exports.PLUGIN_KEY = exports.CONFIG_KEY = exports.MS_HSF_METHOD_KEY = exports.MS_DUBBO_METHOD_KEY = exports.MS_GRPC_METHOD_KEY = exports.MS_PROVIDER_KEY = exports.MS_PRODUCER_KEY = exports.MS_CONSUMER_KEY = exports.RPC_DUBBO_KEY = exports.RPC_GRPC_KEY = exports.HSF_KEY = exports.WS_EVENT_KEY = exports.WS_CONTROLLER_KEY = exports.MODULE_TASK_QUEUE_OPTIONS = exports.MODULE_TASK_QUEUE_KEY = exports.MODULE_TASK_TASK_LOCAL_OPTIONS = exports.MODULE_TASK_TASK_LOCAL_KEY = exports.MODULE_TASK_METADATA = exports.MODULE_TASK_KEY = exports.WEB_RESPONSE_RENDER = exports.WEB_RESPONSE_CONTENT_TYPE = exports.WEB_RESPONSE_HEADER = exports.WEB_RESPONSE_REDIRECT = exports.WEB_RESPONSE_HTTP_CODE = exports.WEB_RESPONSE_KEY = exports.WEB_ROUTER_PARAM_KEY = exports.WEB_ROUTER_KEY = exports.CONTROLLER_KEY = exports.SERVERLESS_FUNC_KEY = exports.FUNC_KEY = exports.MATCH_KEY = exports.CATCH_KEY = exports.ASPECT_KEY = exports.FRAMEWORK_KEY = exports.CONFIGURATION_KEY = exports.SCHEDULE_KEY = exports.ALL = void 0;
4
+ exports.PRIVATE_META_DATA_KEY = exports.MAIN_MODULE_KEY = exports.LIFECYCLE_IDENTIFIER_PREFIX = void 0;
5
5
  // got all value with no property name
6
6
  exports.ALL = 'common:all_value_key';
7
7
  // common
8
- exports.PRIORITY_KEY = 'common:priority';
9
8
  exports.SCHEDULE_KEY = 'common:schedule';
10
9
  exports.CONFIGURATION_KEY = 'common:configuration';
11
- exports.RULES_KEY = 'common:rules';
10
+ exports.FRAMEWORK_KEY = 'common:framework';
12
11
  exports.ASPECT_KEY = 'common:aspect';
12
+ exports.CATCH_KEY = 'common:catch';
13
+ exports.MATCH_KEY = 'common:match';
13
14
  // faas
14
15
  exports.FUNC_KEY = 'faas:func';
15
- exports.HANDLER_KEY = 'faas:handler';
16
16
  exports.SERVERLESS_FUNC_KEY = 'faas:serverless:function';
17
17
  // web
18
18
  exports.CONTROLLER_KEY = 'web:controller';
@@ -51,6 +51,7 @@ exports.CONFIG_KEY = 'config';
51
51
  exports.PLUGIN_KEY = 'plugin';
52
52
  exports.LOGGER_KEY = 'logger';
53
53
  exports.APPLICATION_KEY = '__midway_framework_app__';
54
+ exports.APPLICATION_CONTEXT_KEY = '__midway_application_context__';
54
55
  ////////////////////////////////////////// inject keys
55
56
  // constructor key
56
57
  exports.CLASS_KEY_CONSTRUCTOR = 'midway:class_key_constructor';
@@ -58,10 +59,18 @@ exports.CLASS_KEY_CONSTRUCTOR = 'midway:class_key_constructor';
58
59
  exports.NAMED_TAG = 'named';
59
60
  // The name of the target at design time
60
61
  exports.INJECT_TAG = 'inject';
61
- // used to store constructor arguments tags
62
- exports.TAGGED = 'injection:tagged';
63
- // used to store class properties tags
64
- exports.TAGGED_PROP = 'injection:tagged_props';
62
+ // The name inject custom property decorator with resolver
63
+ exports.INJECT_CUSTOM_PROPERTY = 'inject_custom_property';
64
+ // The name inject custom param decorator with resolver
65
+ exports.INJECT_CUSTOM_METHOD = 'inject_custom_method';
66
+ // The name inject custom param decorator with resolver
67
+ exports.INJECT_CUSTOM_PARAM = 'inject_custom_param';
68
+ //
69
+ // // used to store constructor arguments tags
70
+ // export const TAGGED = 'injection:tagged';
71
+ //
72
+ // // used to store class properties tags
73
+ // export const TAGGED_PROP = 'injection:tagged_props';
65
74
  // used to store class to be injected
66
75
  exports.TAGGED_CLS = 'injection:tagged_class';
67
76
  // used to store function to be injected
@@ -1,20 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Aspect = void 0;
4
- const __1 = require("..");
4
+ const index_1 = require("../../index");
5
5
  const objectDef_1 = require("./objectDef");
6
6
  function Aspect(aspectTarget, match, priority) {
7
7
  return function (target) {
8
- (0, __1.saveModule)(__1.ASPECT_KEY, target);
8
+ (0, index_1.saveModule)(index_1.ASPECT_KEY, target);
9
9
  const aspectTargets = [].concat(aspectTarget);
10
10
  for (const aspectTarget of aspectTargets) {
11
- (0, __1.attachClassMetadata)(__1.ASPECT_KEY, {
11
+ (0, index_1.attachClassMetadata)(index_1.ASPECT_KEY, {
12
12
  aspectTarget,
13
13
  match,
14
14
  priority,
15
15
  }, target);
16
16
  }
17
- (0, objectDef_1.Scope)(__1.ScopeEnum.Singleton);
17
+ (0, objectDef_1.Scope)(index_1.ScopeEnum.Singleton)(target);
18
+ (0, index_1.Provide)()(target);
18
19
  };
19
20
  }
20
21
  exports.Aspect = Aspect;
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Autoload = void 0;
4
- const decoratorManager_1 = require("../common/decoratorManager");
4
+ const decoratorManager_1 = require("../../decoratorManager");
5
+ const provide_1 = require("./provide");
5
6
  function Autoload() {
6
7
  return function (target) {
7
8
  (0, decoratorManager_1.savePreloadModule)(target);
9
+ (0, provide_1.Provide)()(target);
8
10
  };
9
11
  }
10
12
  exports.Autoload = Autoload;
@@ -12,7 +12,9 @@ export interface InjectionConfigurationOptions {
12
12
  Configuration: any;
13
13
  }>;
14
14
  importObjects?: Record<string, unknown>;
15
- importConfigs?: any[];
15
+ importConfigs?: Array<{
16
+ [environmentName: string]: Record<string, any>;
17
+ }> | Record<string, any>;
16
18
  namespace?: string;
17
19
  directoryResolveFilter?: ResolveFilter[];
18
20
  conflictCheck?: boolean;
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Configuration = void 0;
4
- const __1 = require("../");
4
+ const index_1 = require("../../index");
5
5
  function Configuration(options = {}) {
6
6
  return (target) => {
7
- (0, __1.saveClassMetadata)(__1.CONFIGURATION_KEY, options, target);
7
+ (0, index_1.saveClassMetadata)(index_1.CONFIGURATION_KEY, options, target);
8
8
  };
9
9
  }
10
10
  exports.Configuration = Configuration;
File without changes
@@ -0,0 +1,4 @@
1
+ export declare function Catch(catchTarget?: any | any[]): (target: any) => void;
2
+ export declare type MatchPattern<CtxOrReq = any, Res = any> = ((ctxOrReq: CtxOrReq, res: Res) => boolean) | string | string[] | boolean;
3
+ export declare function Match(matchPattern?: MatchPattern): (target: any) => void;
4
+ //# sourceMappingURL=filter.d.ts.map
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Match = exports.Catch = void 0;
4
+ const decoratorManager_1 = require("../../decoratorManager");
5
+ const constant_1 = require("../../constant");
6
+ const objectDef_1 = require("./objectDef");
7
+ const interface_1 = require("../../interface");
8
+ const provide_1 = require("./provide");
9
+ function Catch(catchTarget) {
10
+ return function (target) {
11
+ const catchTargets = catchTarget ? [].concat(catchTarget) : undefined;
12
+ (0, decoratorManager_1.saveClassMetadata)(constant_1.CATCH_KEY, {
13
+ catchTargets,
14
+ }, target);
15
+ (0, objectDef_1.Scope)(interface_1.ScopeEnum.Singleton)(target);
16
+ (0, provide_1.Provide)()(target);
17
+ };
18
+ }
19
+ exports.Catch = Catch;
20
+ function Match(matchPattern = true) {
21
+ return function (target) {
22
+ (0, decoratorManager_1.saveClassMetadata)(constant_1.MATCH_KEY, {
23
+ matchPattern,
24
+ }, target);
25
+ (0, objectDef_1.Scope)(interface_1.ScopeEnum.Singleton)(target);
26
+ (0, provide_1.Provide)()(target);
27
+ };
28
+ }
29
+ exports.Match = Match;
30
+ //# sourceMappingURL=filter.js.map
@@ -0,0 +1,2 @@
1
+ export declare function Framework(): ClassDecorator;
2
+ //# sourceMappingURL=framework.d.ts.map
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Framework = void 0;
4
+ const index_1 = require("../../index");
5
+ function Framework() {
6
+ return (target) => {
7
+ (0, index_1.saveModule)(index_1.FRAMEWORK_KEY, target);
8
+ (0, index_1.Scope)(index_1.ScopeEnum.Singleton)(target);
9
+ (0, index_1.Provide)()(target);
10
+ };
11
+ }
12
+ exports.Framework = Framework;
13
+ //# sourceMappingURL=framework.js.map
@@ -1,13 +1,11 @@
1
- export * from './configuration';
2
- export * from './inject';
3
- export * from './objectDef';
4
- export * from './priority';
5
1
  export * from './provide';
6
- export * from './schedule';
2
+ export * from './inject';
7
3
  export * from './pipeline';
8
4
  export * from './aspect';
9
5
  export * from './autoload';
10
- export * from './queue';
11
- export * from './task';
12
- export * from './taskLocal';
6
+ export * from './configuration';
7
+ export * from './objectDef';
8
+ export * from './framework';
9
+ export * from './filter';
10
+ export * from './middleware';
13
11
  //# sourceMappingURL=index.d.ts.map
@@ -10,18 +10,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
10
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./configuration"), exports);
14
- __exportStar(require("./inject"), exports);
15
- __exportStar(require("./objectDef"), exports);
16
- __exportStar(require("./priority"), exports);
17
13
  __exportStar(require("./provide"), exports);
18
- __exportStar(require("./schedule"), exports);
14
+ __exportStar(require("./inject"), exports);
19
15
  __exportStar(require("./pipeline"), exports);
20
- // export * from './validate';
21
- // export * from './rule';
22
16
  __exportStar(require("./aspect"), exports);
23
17
  __exportStar(require("./autoload"), exports);
24
- __exportStar(require("./queue"), exports);
25
- __exportStar(require("./task"), exports);
26
- __exportStar(require("./taskLocal"), exports);
18
+ __exportStar(require("./configuration"), exports);
19
+ __exportStar(require("./objectDef"), exports);
20
+ __exportStar(require("./framework"), exports);
21
+ __exportStar(require("./filter"), exports);
22
+ __exportStar(require("./middleware"), exports);
27
23
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,3 @@
1
+ import { ObjectIdentifier } from '../../interface';
2
+ export declare function Inject(identifier?: ObjectIdentifier): (target: any, targetKey: string) => void;
3
+ //# sourceMappingURL=inject.d.ts.map
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Inject = void 0;
4
+ const index_1 = require("../../index");
5
+ function Inject(identifier) {
6
+ return function (target, targetKey) {
7
+ (0, index_1.savePropertyInject)({ target, targetKey, identifier });
8
+ };
9
+ }
10
+ exports.Inject = Inject;
11
+ //# sourceMappingURL=inject.js.map
@@ -0,0 +1,2 @@
1
+ export declare function Middleware(): ClassDecorator;
2
+ //# sourceMappingURL=middleware.d.ts.map
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Middleware = void 0;
4
+ const index_1 = require("../../index");
5
+ function Middleware() {
6
+ return (target) => {
7
+ (0, index_1.Scope)(index_1.ScopeEnum.Singleton)(target);
8
+ (0, index_1.Provide)()(target);
9
+ };
10
+ }
11
+ exports.Middleware = Middleware;
12
+ //# sourceMappingURL=middleware.js.map
@@ -0,0 +1,5 @@
1
+ import { ScopeEnum } from '../../index';
2
+ export declare function Init(): MethodDecorator;
3
+ export declare function Destroy(): MethodDecorator;
4
+ export declare function Scope(scope: ScopeEnum): ClassDecorator;
5
+ //# sourceMappingURL=objectDef.d.ts.map
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Scope = exports.Destroy = exports.Init = void 0;
4
+ const index_1 = require("../../index");
5
+ function Init() {
6
+ return function (target, propertyKey) {
7
+ (0, index_1.saveObjectDefinition)(target, { initMethod: propertyKey });
8
+ };
9
+ }
10
+ exports.Init = Init;
11
+ function Destroy() {
12
+ return function (target, propertyKey) {
13
+ (0, index_1.saveObjectDefinition)(target, {
14
+ destroyMethod: propertyKey,
15
+ });
16
+ };
17
+ }
18
+ exports.Destroy = Destroy;
19
+ function Scope(scope) {
20
+ return function (target) {
21
+ (0, index_1.saveObjectDefinition)(target, { scope });
22
+ };
23
+ }
24
+ exports.Scope = Scope;
25
+ //# sourceMappingURL=objectDef.js.map
@@ -0,0 +1,3 @@
1
+ import { ObjectIdentifier } from '../../interface';
2
+ export declare function Pipeline(valves?: Array<ObjectIdentifier | (new (...args: any[]) => any)>): PropertyDecorator;
3
+ //# sourceMappingURL=pipeline.d.ts.map
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Pipeline = void 0;
4
+ const index_1 = require("../../index");
5
+ function Pipeline(valves) {
6
+ return (0, index_1.createCustomPropertyDecorator)(index_1.PIPELINE_IDENTIFIER, {
7
+ valves,
8
+ });
9
+ }
10
+ exports.Pipeline = Pipeline;
11
+ //# sourceMappingURL=pipeline.js.map
@@ -0,0 +1,3 @@
1
+ import { ObjectIdentifier } from '../../interface';
2
+ export declare function Provide(identifier?: ObjectIdentifier): (target: any) => any;
3
+ //# sourceMappingURL=provide.d.ts.map
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Provide = void 0;
4
- const __1 = require("../");
4
+ const index_1 = require("../../index");
5
5
  function Provide(identifier) {
6
6
  return function (target) {
7
- return (0, __1.saveProviderId)(identifier, target);
7
+ return (0, index_1.saveProviderId)(identifier, target);
8
8
  };
9
9
  }
10
10
  exports.Provide = Provide;
@@ -1,16 +1,4 @@
1
- import { FaaSMetadata, MiddlewareParamArray, ServerlessTriggerType } from '..';
2
- export interface FuncParams {
3
- funHandler?: string;
4
- event?: string;
5
- method?: string;
6
- path?: string;
7
- middleware?: MiddlewareParamArray;
8
- }
9
- /**
10
- * @deprecated Please upgrade to midway serverless v2.0 and use ServerlessTriggerType
11
- * @example '@Func('index.handler')'
12
- */
13
- export declare function Func(funHandler: string | FuncParams, functionOptions?: FuncParams): any;
1
+ import { FaaSMetadata, ServerlessTriggerType } from '../../';
14
2
  export declare function ServerlessFunction(options: FaaSMetadata.ServerlessFunctionOptions): MethodDecorator;
15
3
  export declare function ServerlessTrigger(type: ServerlessTriggerType.HTTP, metadata: FaaSMetadata.HTTPTriggerOptions): MethodDecorator;
16
4
  export declare function ServerlessTrigger(type: ServerlessTriggerType.OS, metadata: FaaSMetadata.OSTriggerOptions): MethodDecorator;
@@ -22,4 +10,4 @@ export declare function ServerlessTrigger(type: ServerlessTriggerType.API_GATEWA
22
10
  export declare function ServerlessTrigger(type: ServerlessTriggerType.HSF, metadata?: FaaSMetadata.HSFTriggerOptions): MethodDecorator;
23
11
  export declare function ServerlessTrigger(type: ServerlessTriggerType.MTOP, metadata?: FaaSMetadata.MTopTriggerOptions): MethodDecorator;
24
12
  export declare function ServerlessTrigger(type: ServerlessTriggerType.EVENT, metadata?: FaaSMetadata.EventTriggerOptions): MethodDecorator;
25
- //# sourceMappingURL=fun.d.ts.map
13
+ //# sourceMappingURL=serverlessTrigger.d.ts.map
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ServerlessTrigger = exports.ServerlessFunction = void 0;
4
+ const __1 = require("../../");
5
+ function ServerlessFunction(options) {
6
+ return (target, key, descriptor) => {
7
+ (0, __1.savePropertyMetadata)(__1.SERVERLESS_FUNC_KEY, options, target, key);
8
+ };
9
+ }
10
+ exports.ServerlessFunction = ServerlessFunction;
11
+ function ServerlessTrigger(type, metadata = {}) {
12
+ return (target, functionName, descriptor) => {
13
+ var _a;
14
+ if (type === __1.ServerlessTriggerType.HTTP ||
15
+ type === __1.ServerlessTriggerType.API_GATEWAY) {
16
+ metadata['method'] = (_a = metadata['method']) !== null && _a !== void 0 ? _a : 'get';
17
+ }
18
+ (0, __1.saveModule)(__1.FUNC_KEY, target.constructor);
19
+ // new method decorator
20
+ metadata = metadata || {};
21
+ (0, __1.attachClassMetadata)(__1.FUNC_KEY, {
22
+ type,
23
+ methodName: functionName,
24
+ metadata,
25
+ }, target.constructor);
26
+ };
27
+ }
28
+ exports.ServerlessTrigger = ServerlessTrigger;
29
+ //# sourceMappingURL=serverlessTrigger.js.map
@@ -0,0 +1,7 @@
1
+ import { FrameworkType } from '../../';
2
+ export declare function Plugin(identifier?: string): PropertyDecorator;
3
+ export declare function Config(identifier?: string): PropertyDecorator;
4
+ export declare function App(type?: FrameworkType): PropertyDecorator;
5
+ export declare function Logger(identifier?: string): PropertyDecorator;
6
+ export declare function ApplicationContext(): PropertyDecorator;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ApplicationContext = exports.Logger = exports.App = exports.Config = exports.Plugin = void 0;
4
+ const __1 = require("../../");
5
+ function Plugin(identifier) {
6
+ return (0, __1.createCustomPropertyDecorator)(__1.PLUGIN_KEY, {
7
+ identifier,
8
+ });
9
+ }
10
+ exports.Plugin = Plugin;
11
+ function Config(identifier) {
12
+ return (0, __1.createCustomPropertyDecorator)(__1.CONFIG_KEY, {
13
+ identifier,
14
+ });
15
+ }
16
+ exports.Config = Config;
17
+ function App(type) {
18
+ return (0, __1.createCustomPropertyDecorator)(__1.APPLICATION_KEY, {
19
+ type,
20
+ });
21
+ }
22
+ exports.App = App;
23
+ function Logger(identifier) {
24
+ return (0, __1.createCustomPropertyDecorator)(__1.LOGGER_KEY, {
25
+ identifier,
26
+ });
27
+ }
28
+ exports.Logger = Logger;
29
+ function ApplicationContext() {
30
+ return (0, __1.createCustomPropertyDecorator)(__1.APPLICATION_CONTEXT_KEY, {});
31
+ }
32
+ exports.ApplicationContext = ApplicationContext;
33
+ //# sourceMappingURL=index.js.map
@@ -1,13 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Schedule = void 0;
4
- const __1 = require("../");
5
- const objectDef_1 = require("./objectDef");
4
+ const __1 = require("../../");
5
+ const common_1 = require("../common");
6
6
  function Schedule(scheduleOpts) {
7
7
  return function (target) {
8
8
  (0, __1.saveModule)(__1.SCHEDULE_KEY, target);
9
9
  (0, __1.saveClassMetadata)(__1.SCHEDULE_KEY, scheduleOpts, target);
10
- (0, objectDef_1.Scope)(__1.ScopeEnum.Request)(target);
10
+ (0, common_1.Scope)(__1.ScopeEnum.Request)(target);
11
+ (0, __1.Provide)()(target);
11
12
  };
12
13
  }
13
14
  exports.Schedule = Schedule;
@@ -0,0 +1,18 @@
1
+ export * from './common/index';
2
+ export * from './faas/serverlessTrigger';
3
+ export * from './framework/index';
4
+ export * from './framework/schedule';
5
+ export * from './microservice/consumer';
6
+ export * from './microservice/provider';
7
+ export * from './microservice/rabbitmqListener';
8
+ export * from './rpc/hsf';
9
+ export * from './task/queue';
10
+ export * from './task/task';
11
+ export * from './task/taskLocal';
12
+ export * from './web/controller';
13
+ export * from './web/paramMapping';
14
+ export * from './web/requestMapping';
15
+ export * from './web/response';
16
+ export * from './ws/webSocketController';
17
+ export * from './ws/webSocketEvent';
18
+ //# sourceMappingURL=index.d.ts.map