@midwayjs/decorator 3.0.0-alpha.42 → 3.0.0-beta.2
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.
- package/CHANGELOG.md +22 -0
- package/dist/constant.d.ts +6 -5
- package/dist/constant.js +17 -9
- package/dist/{annotation → decorator/common}/aspect.d.ts +0 -0
- package/dist/{annotation → decorator/common}/aspect.js +5 -4
- package/dist/{annotation → decorator/common}/autoload.d.ts +0 -0
- package/dist/{annotation → decorator/common}/autoload.js +3 -1
- package/dist/decorator/common/catch.d.ts +2 -0
- package/dist/decorator/common/catch.js +20 -0
- package/dist/{annotation → decorator/common}/configuration.d.ts +0 -0
- package/dist/{annotation → decorator/common}/configuration.js +2 -2
- package/dist/{annotation → decorator/common}/decide.d.ts +0 -0
- package/dist/{annotation → decorator/common}/decide.js +0 -0
- package/dist/decorator/common/framework.d.ts +2 -0
- package/dist/decorator/common/framework.js +13 -0
- package/dist/{annotation → decorator/common}/index.d.ts +6 -8
- package/dist/{annotation → decorator/common}/index.js +6 -10
- package/dist/decorator/common/inject.d.ts +3 -0
- package/dist/decorator/common/inject.js +11 -0
- package/dist/decorator/common/middleware.d.ts +2 -0
- package/dist/decorator/common/middleware.js +12 -0
- package/dist/decorator/common/objectDef.d.ts +5 -0
- package/dist/decorator/common/objectDef.js +25 -0
- package/dist/decorator/common/pipeline.d.ts +3 -0
- package/dist/decorator/common/pipeline.js +11 -0
- package/dist/decorator/common/provide.d.ts +3 -0
- package/dist/{annotation → decorator/common}/provide.js +2 -2
- package/dist/{faas/fun.d.ts → decorator/faas/serverlessTrigger.d.ts} +2 -14
- package/dist/decorator/faas/serverlessTrigger.js +29 -0
- package/dist/decorator/framework/index.d.ts +7 -0
- package/dist/decorator/framework/index.js +33 -0
- package/dist/{annotation → decorator/framework}/schedule.d.ts +0 -0
- package/dist/{annotation → decorator/framework}/schedule.js +3 -2
- package/dist/decorator/index.d.ts +18 -0
- package/dist/decorator/index.js +38 -0
- package/dist/{microservice → decorator/microservice}/consumer.d.ts +1 -1
- package/dist/{microservice → decorator/microservice}/consumer.js +3 -3
- package/dist/{microservice → decorator/microservice}/provider.d.ts +1 -1
- package/dist/{microservice → decorator/microservice}/provider.js +4 -3
- package/dist/{microservice → decorator/microservice}/rabbitmqListener.d.ts +0 -0
- package/dist/{microservice → decorator/microservice}/rabbitmqListener.js +1 -1
- package/dist/{rpc → decorator/rpc}/hsf.d.ts +0 -0
- package/dist/{rpc → decorator/rpc}/hsf.js +4 -3
- package/dist/decorator/task/queue.d.ts +2 -0
- package/dist/{annotation → decorator/task}/queue.js +3 -2
- package/dist/{annotation → decorator/task}/task.d.ts +0 -0
- package/dist/{annotation → decorator/task}/task.js +2 -2
- package/dist/{annotation → decorator/task}/taskLocal.d.ts +0 -0
- package/dist/{annotation → decorator/task}/taskLocal.js +2 -2
- package/dist/{web → decorator/web}/controller.d.ts +1 -1
- package/dist/{web → decorator/web}/controller.js +4 -3
- package/dist/{web → decorator/web}/paramMapping.d.ts +10 -10
- package/dist/{web → decorator/web}/paramMapping.js +4 -8
- package/dist/{web → decorator/web}/requestMapping.d.ts +1 -1
- package/dist/{web → decorator/web}/requestMapping.js +1 -1
- package/dist/{web → decorator/web}/response.d.ts +0 -0
- package/dist/{web → decorator/web}/response.js +1 -1
- package/dist/{ws → decorator/ws}/webSocketController.d.ts +1 -1
- package/dist/{ws → decorator/ws}/webSocketController.js +4 -3
- package/dist/{ws → decorator/ws}/webSocketEvent.d.ts +0 -0
- package/dist/{ws → decorator/ws}/webSocketEvent.js +1 -1
- package/dist/decoratorManager.d.ts +283 -0
- package/dist/{common/decoratorManager.js → decoratorManager.js} +227 -311
- package/dist/index.d.ts +2 -22
- package/dist/index.js +2 -22
- package/dist/interface.d.ts +40 -23
- package/dist/interface.js +31 -17
- package/dist/util/index.d.ts +5 -0
- package/dist/util/index.js +27 -1
- package/package.json +3 -6
- package/dist/annotation/inject.d.ts +0 -3
- package/dist/annotation/inject.js +0 -16
- package/dist/annotation/objectDef.d.ts +0 -7
- package/dist/annotation/objectDef.js +0 -43
- package/dist/annotation/pipeline.d.ts +0 -3
- package/dist/annotation/pipeline.js +0 -27
- package/dist/annotation/priority.d.ts +0 -2
- package/dist/annotation/priority.js +0 -11
- package/dist/annotation/provide.d.ts +0 -3
- package/dist/annotation/queue.d.ts +0 -2
- package/dist/annotation/rule.d.ts +0 -1
- package/dist/annotation/rule.js +0 -58
- package/dist/annotation/validate.d.ts +0 -1
- package/dist/annotation/validate.js +0 -36
- package/dist/common/decoratorManager.d.ts +0 -324
- package/dist/common/errMsg.d.ts +0 -4
- package/dist/common/errMsg.js +0 -8
- package/dist/common/metadata.d.ts +0 -9
- package/dist/common/metadata.js +0 -20
- package/dist/common/scopeEnum.d.ts +0 -6
- package/dist/common/scopeEnum.js +0 -10
- package/dist/faas/fun.js +0 -62
- package/dist/faas/handler.d.ts +0 -3
- package/dist/faas/handler.js +0 -21
- package/dist/framework/app.d.ts +0 -3
- package/dist/framework/app.js +0 -22
- package/dist/framework/config.d.ts +0 -2
- package/dist/framework/config.js +0 -25
- package/dist/framework/logger.d.ts +0 -2
- package/dist/framework/logger.js +0 -22
- package/dist/framework/plugin.d.ts +0 -2
- package/dist/framework/plugin.js +0 -22
- package/dist/util/dtoHelper.d.ts +0 -6
- package/dist/util/dtoHelper.js +0 -32
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
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.2](https://github.com/midwayjs/midway/compare/v3.0.0-beta.1...v3.0.0-beta.2) (2021-11-16)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* middleware decorator missing ([#1366](https://github.com/midwayjs/midway/issues/1366)) ([5f9a8c1](https://github.com/midwayjs/midway/commit/5f9a8c1f7cdd940f785f6c9871fb67b9738de940))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [3.0.0-beta.1](https://github.com/midwayjs/midway/compare/v2.12.4...v3.0.0-beta.1) (2021-11-14)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* 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))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
## [2.12.3](https://github.com/midwayjs/midway/compare/v2.12.2...v2.12.3) (2021-08-09)
|
|
7
29
|
|
|
8
30
|
|
package/dist/constant.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
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
|
|
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
7
|
export declare const FUNC_KEY = "faas:func";
|
|
8
|
-
export declare const HANDLER_KEY = "faas:handler";
|
|
9
8
|
export declare const SERVERLESS_FUNC_KEY = "faas:serverless:function";
|
|
10
9
|
export declare const CONTROLLER_KEY = "web:controller";
|
|
11
10
|
export declare const WEB_ROUTER_KEY = "web:router";
|
|
@@ -37,11 +36,13 @@ export declare const CONFIG_KEY = "config";
|
|
|
37
36
|
export declare const PLUGIN_KEY = "plugin";
|
|
38
37
|
export declare const LOGGER_KEY = "logger";
|
|
39
38
|
export declare const APPLICATION_KEY = "__midway_framework_app__";
|
|
39
|
+
export declare const APPLICATION_CONTEXT_KEY = "__midway_application_context__";
|
|
40
40
|
export declare const CLASS_KEY_CONSTRUCTOR = "midway:class_key_constructor";
|
|
41
41
|
export declare const NAMED_TAG = "named";
|
|
42
42
|
export declare const INJECT_TAG = "inject";
|
|
43
|
-
export declare const
|
|
44
|
-
export declare const
|
|
43
|
+
export declare const INJECT_CUSTOM_PROPERTY = "inject_custom_property";
|
|
44
|
+
export declare const INJECT_CUSTOM_METHOD = "inject_custom_method";
|
|
45
|
+
export declare const INJECT_CUSTOM_PARAM = "inject_custom_param";
|
|
45
46
|
export declare const TAGGED_CLS = "injection:tagged_class";
|
|
46
47
|
export declare const TAGGED_FUN = "injection:tagged_function";
|
|
47
48
|
export declare const OBJ_DEF_CLS = "injection:object_definition_class";
|
package/dist/constant.js
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.PRIVATE_META_DATA_KEY = void 0;
|
|
3
|
+
exports.LIFECYCLE_IDENTIFIER_PREFIX = 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.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 = 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.
|
|
10
|
+
exports.FRAMEWORK_KEY = 'common:framework';
|
|
12
11
|
exports.ASPECT_KEY = 'common:aspect';
|
|
12
|
+
exports.CATCH_KEY = 'common:catch';
|
|
13
13
|
// faas
|
|
14
14
|
exports.FUNC_KEY = 'faas:func';
|
|
15
|
-
exports.HANDLER_KEY = 'faas:handler';
|
|
16
15
|
exports.SERVERLESS_FUNC_KEY = 'faas:serverless:function';
|
|
17
16
|
// web
|
|
18
17
|
exports.CONTROLLER_KEY = 'web:controller';
|
|
@@ -51,6 +50,7 @@ exports.CONFIG_KEY = 'config';
|
|
|
51
50
|
exports.PLUGIN_KEY = 'plugin';
|
|
52
51
|
exports.LOGGER_KEY = 'logger';
|
|
53
52
|
exports.APPLICATION_KEY = '__midway_framework_app__';
|
|
53
|
+
exports.APPLICATION_CONTEXT_KEY = '__midway_application_context__';
|
|
54
54
|
////////////////////////////////////////// inject keys
|
|
55
55
|
// constructor key
|
|
56
56
|
exports.CLASS_KEY_CONSTRUCTOR = 'midway:class_key_constructor';
|
|
@@ -58,10 +58,18 @@ exports.CLASS_KEY_CONSTRUCTOR = 'midway:class_key_constructor';
|
|
|
58
58
|
exports.NAMED_TAG = 'named';
|
|
59
59
|
// The name of the target at design time
|
|
60
60
|
exports.INJECT_TAG = 'inject';
|
|
61
|
-
//
|
|
62
|
-
exports.
|
|
63
|
-
//
|
|
64
|
-
exports.
|
|
61
|
+
// The name inject custom property decorator with resolver
|
|
62
|
+
exports.INJECT_CUSTOM_PROPERTY = 'inject_custom_property';
|
|
63
|
+
// The name inject custom param decorator with resolver
|
|
64
|
+
exports.INJECT_CUSTOM_METHOD = 'inject_custom_method';
|
|
65
|
+
// The name inject custom param decorator with resolver
|
|
66
|
+
exports.INJECT_CUSTOM_PARAM = 'inject_custom_param';
|
|
67
|
+
//
|
|
68
|
+
// // used to store constructor arguments tags
|
|
69
|
+
// export const TAGGED = 'injection:tagged';
|
|
70
|
+
//
|
|
71
|
+
// // used to store class properties tags
|
|
72
|
+
// export const TAGGED_PROP = 'injection:tagged_props';
|
|
65
73
|
// used to store class to be injected
|
|
66
74
|
exports.TAGGED_CLS = 'injection:tagged_class';
|
|
67
75
|
// used to store function to be injected
|
|
File without changes
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Aspect = void 0;
|
|
4
|
-
const
|
|
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,
|
|
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,
|
|
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)(
|
|
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;
|
|
File without changes
|
|
@@ -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("
|
|
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;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
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 = [].concat(catchTarget);
|
|
12
|
+
(0, decoratorManager_1.attachClassMetadata)(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
|
+
//# sourceMappingURL=catch.js.map
|
|
File without changes
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Configuration = void 0;
|
|
4
|
-
const
|
|
4
|
+
const index_1 = require("../../index");
|
|
5
5
|
function Configuration(options = {}) {
|
|
6
6
|
return (target) => {
|
|
7
|
-
(0,
|
|
7
|
+
(0, index_1.saveClassMetadata)(index_1.CONFIGURATION_KEY, options, target);
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
10
|
exports.Configuration = Configuration;
|
|
File without changes
|
|
File without changes
|
|
@@ -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 './
|
|
2
|
+
export * from './inject';
|
|
7
3
|
export * from './pipeline';
|
|
8
4
|
export * from './aspect';
|
|
9
5
|
export * from './autoload';
|
|
10
|
-
export * from './
|
|
11
|
-
export * from './
|
|
12
|
-
export * from './
|
|
6
|
+
export * from './configuration';
|
|
7
|
+
export * from './objectDef';
|
|
8
|
+
export * from './framework';
|
|
9
|
+
export * from './catch';
|
|
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("./
|
|
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("./
|
|
25
|
-
__exportStar(require("./
|
|
26
|
-
__exportStar(require("./
|
|
18
|
+
__exportStar(require("./configuration"), exports);
|
|
19
|
+
__exportStar(require("./objectDef"), exports);
|
|
20
|
+
__exportStar(require("./framework"), exports);
|
|
21
|
+
__exportStar(require("./catch"), exports);
|
|
22
|
+
__exportStar(require("./middleware"), exports);
|
|
27
23
|
//# sourceMappingURL=index.js.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,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,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,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
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Provide = void 0;
|
|
4
|
-
const
|
|
4
|
+
const index_1 = require("../../index");
|
|
5
5
|
function Provide(identifier) {
|
|
6
6
|
return function (target) {
|
|
7
|
-
return (0,
|
|
7
|
+
return (0, index_1.saveProviderId)(identifier, target);
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
10
|
exports.Provide = Provide;
|
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
import { FaaSMetadata,
|
|
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=
|
|
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
|
|
File without changes
|
|
@@ -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("
|
|
4
|
+
const __1 = require("../../");
|
|
5
|
+
const objectDef_1 = require("../common/objectDef");
|
|
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
10
|
(0, objectDef_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
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
// common
|
|
14
|
+
__exportStar(require("./common/index"), exports);
|
|
15
|
+
// faas
|
|
16
|
+
__exportStar(require("./faas/serverlessTrigger"), exports);
|
|
17
|
+
// framework
|
|
18
|
+
__exportStar(require("./framework/index"), exports);
|
|
19
|
+
__exportStar(require("./framework/schedule"), exports);
|
|
20
|
+
// microservice
|
|
21
|
+
__exportStar(require("./microservice/consumer"), exports);
|
|
22
|
+
__exportStar(require("./microservice/provider"), exports);
|
|
23
|
+
__exportStar(require("./microservice/rabbitmqListener"), exports);
|
|
24
|
+
// rpc
|
|
25
|
+
__exportStar(require("./rpc/hsf"), exports);
|
|
26
|
+
// task
|
|
27
|
+
__exportStar(require("./task/queue"), exports);
|
|
28
|
+
__exportStar(require("./task/task"), exports);
|
|
29
|
+
__exportStar(require("./task/taskLocal"), exports);
|
|
30
|
+
// web
|
|
31
|
+
__exportStar(require("./web/controller"), exports);
|
|
32
|
+
__exportStar(require("./web/paramMapping"), exports);
|
|
33
|
+
__exportStar(require("./web/requestMapping"), exports);
|
|
34
|
+
__exportStar(require("./web/response"), exports);
|
|
35
|
+
// ws
|
|
36
|
+
__exportStar(require("./ws/webSocketController"), exports);
|
|
37
|
+
__exportStar(require("./ws/webSocketEvent"), exports);
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MSListenerType } from '
|
|
1
|
+
import { MSListenerType } from '../../';
|
|
2
2
|
export declare function Consumer(type: MSListenerType.MQTT): ClassDecorator;
|
|
3
3
|
export declare function Consumer(type: MSListenerType.RABBITMQ, options?: any): ClassDecorator;
|
|
4
4
|
//# sourceMappingURL=consumer.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Consumer = void 0;
|
|
4
|
-
const __1 = require("
|
|
5
|
-
const
|
|
4
|
+
const __1 = require("../../");
|
|
5
|
+
const objectDef_1 = require("../common/objectDef");
|
|
6
6
|
function Consumer(type, options = {}) {
|
|
7
7
|
return (target) => {
|
|
8
8
|
(0, __1.saveModule)(__1.MS_CONSUMER_KEY, target);
|
|
@@ -10,7 +10,7 @@ function Consumer(type, options = {}) {
|
|
|
10
10
|
type,
|
|
11
11
|
metadata: options,
|
|
12
12
|
}, target);
|
|
13
|
-
(0,
|
|
13
|
+
(0, objectDef_1.Scope)(__1.ScopeEnum.Request)(target);
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
exports.Consumer = Consumer;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MSProviderType, GRPCMetadata } from '
|
|
1
|
+
import { MSProviderType, GRPCMetadata } from '../../';
|
|
2
2
|
export declare function Provider(type: MSProviderType.GRPC, metadata?: GRPCMetadata.ProviderOptions): ClassDecorator;
|
|
3
3
|
export declare function Provider(type: MSProviderType.DUBBO, metadata?: any): ClassDecorator;
|
|
4
4
|
export declare enum GrpcStreamTypeEnum {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.HSFMethod = exports.DubboMethod = exports.GrpcMethod = exports.GrpcStreamTypeEnum = exports.Provider = void 0;
|
|
4
|
-
const __1 = require("
|
|
5
|
-
const
|
|
4
|
+
const __1 = require("../../");
|
|
5
|
+
const common_1 = require("../common");
|
|
6
6
|
function Provider(type, metadata = {}) {
|
|
7
7
|
return (target) => {
|
|
8
8
|
(0, __1.saveModule)(__1.MS_PROVIDER_KEY, target);
|
|
@@ -10,7 +10,8 @@ function Provider(type, metadata = {}) {
|
|
|
10
10
|
type,
|
|
11
11
|
metadata,
|
|
12
12
|
}, target);
|
|
13
|
-
(0,
|
|
13
|
+
(0, common_1.Scope)(__1.ScopeEnum.Request)(target);
|
|
14
|
+
(0, __1.Provide)()(target);
|
|
14
15
|
};
|
|
15
16
|
}
|
|
16
17
|
exports.Provider = Provider;
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RabbitMQListener = void 0;
|
|
4
|
-
const __1 = require("
|
|
4
|
+
const __1 = require("../../");
|
|
5
5
|
function RabbitMQListener(queueName, options = {}) {
|
|
6
6
|
return (target, propertyKey) => {
|
|
7
7
|
options.queueName = queueName;
|
|
File without changes
|