@midwayjs/decorator 3.0.0-alpha.43 → 3.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/dist/constant.d.ts +6 -2
- package/dist/constant.js +11 -4
- package/dist/decorator/{aspect.d.ts → common/aspect.d.ts} +0 -0
- package/dist/decorator/{aspect.js → common/aspect.js} +5 -4
- package/dist/decorator/{autoload.d.ts → common/autoload.d.ts} +0 -0
- package/dist/decorator/{autoload.js → common/autoload.js} +3 -1
- package/dist/decorator/common/catch.d.ts +2 -0
- package/dist/decorator/common/catch.js +20 -0
- package/dist/decorator/{configuration.d.ts → common/configuration.d.ts} +0 -0
- package/dist/decorator/{configuration.js → common/configuration.js} +2 -2
- package/dist/decorator/{decide.d.ts → common/decide.d.ts} +0 -0
- package/dist/decorator/{decide.js → common/decide.js} +0 -0
- package/dist/decorator/common/framework.d.ts +2 -0
- package/dist/decorator/common/framework.js +13 -0
- package/dist/decorator/common/index.d.ts +11 -0
- package/dist/decorator/common/index.js +23 -0
- package/dist/decorator/{inject.d.ts → common/inject.d.ts} +1 -1
- package/dist/decorator/{inject.js → common/inject.js} +2 -2
- 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/{objectDef.js → common/objectDef.js} +5 -5
- 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/decorator/{provide.js → common/provide.js} +2 -2
- package/dist/decorator/framework/index.d.ts +7 -0
- package/dist/decorator/framework/index.js +33 -0
- package/dist/decorator/framework/schedule.js +2 -1
- package/dist/decorator/index.d.ts +2 -11
- package/dist/decorator/index.js +2 -13
- package/dist/decorator/microservice/consumer.js +1 -1
- package/dist/decorator/microservice/provider.js +3 -2
- package/dist/decorator/rpc/hsf.js +1 -0
- package/dist/decorator/task/queue.d.ts +1 -1
- package/dist/decorator/task/queue.js +1 -0
- package/dist/decorator/web/controller.js +3 -2
- package/dist/decorator/web/paramMapping.d.ts +10 -10
- package/dist/decorator/web/paramMapping.js +3 -7
- package/dist/decorator/ws/webSocketController.js +3 -2
- package/dist/decoratorManager.d.ts +19 -12
- package/dist/decoratorManager.js +108 -35
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/interface.d.ts +31 -19
- package/dist/interface.js +25 -17
- package/package.json +3 -6
- package/dist/decorator/framework/app.d.ts +0 -3
- package/dist/decorator/framework/app.js +0 -17
- package/dist/decorator/framework/config.d.ts +0 -2
- package/dist/decorator/framework/config.js +0 -21
- package/dist/decorator/framework/logger.d.ts +0 -2
- package/dist/decorator/framework/logger.js +0 -18
- package/dist/decorator/framework/plugin.d.ts +0 -2
- package/dist/decorator/framework/plugin.js +0 -18
- package/dist/decorator/objectDef.d.ts +0 -5
- package/dist/decorator/pipeline.d.ts +0 -3
- package/dist/decorator/pipeline.js +0 -16
- package/dist/decorator/provide.d.ts +0 -3
- package/dist/decorator/rule.d.ts +0 -1
- package/dist/decorator/rule.js +0 -58
- package/dist/decorator/validate.d.ts +0 -1
- package/dist/decorator/validate.js +0 -36
- package/dist/util/dtoHelper.d.ts +0 -6
- package/dist/util/dtoHelper.js +0 -32
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,36 @@
|
|
|
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.3](https://github.com/midwayjs/midway/compare/v3.0.0-beta.2...v3.0.0-beta.3) (2021-11-18)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @midwayjs/decorator
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [3.0.0-beta.2](https://github.com/midwayjs/midway/compare/v3.0.0-beta.1...v3.0.0-beta.2) (2021-11-16)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* middleware decorator missing ([#1366](https://github.com/midwayjs/midway/issues/1366)) ([5f9a8c1](https://github.com/midwayjs/midway/commit/5f9a8c1f7cdd940f785f6c9871fb67b9738de940))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# [3.0.0-beta.1](https://github.com/midwayjs/midway/compare/v2.12.4...v3.0.0-beta.1) (2021-11-14)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Features
|
|
29
|
+
|
|
30
|
+
* 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))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
6
36
|
## [2.12.3](https://github.com/midwayjs/midway/compare/v2.12.2...v2.12.3) (2021-08-09)
|
|
7
37
|
|
|
8
38
|
|
package/dist/constant.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export declare const ALL = "common:all_value_key";
|
|
2
2
|
export declare const SCHEDULE_KEY = "common:schedule";
|
|
3
3
|
export declare const CONFIGURATION_KEY = "common:configuration";
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const FRAMEWORK_KEY = "common:framework";
|
|
5
5
|
export declare const ASPECT_KEY = "common:aspect";
|
|
6
|
+
export declare const CATCH_KEY = "common:catch";
|
|
6
7
|
export declare const FUNC_KEY = "faas:func";
|
|
7
8
|
export declare const SERVERLESS_FUNC_KEY = "faas:serverless:function";
|
|
8
9
|
export declare const CONTROLLER_KEY = "web:controller";
|
|
@@ -35,10 +36,13 @@ export declare const CONFIG_KEY = "config";
|
|
|
35
36
|
export declare const PLUGIN_KEY = "plugin";
|
|
36
37
|
export declare const LOGGER_KEY = "logger";
|
|
37
38
|
export declare const APPLICATION_KEY = "__midway_framework_app__";
|
|
39
|
+
export declare const APPLICATION_CONTEXT_KEY = "__midway_application_context__";
|
|
38
40
|
export declare const CLASS_KEY_CONSTRUCTOR = "midway:class_key_constructor";
|
|
39
41
|
export declare const NAMED_TAG = "named";
|
|
40
42
|
export declare const INJECT_TAG = "inject";
|
|
41
|
-
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";
|
|
42
46
|
export declare const TAGGED_CLS = "injection:tagged_class";
|
|
43
47
|
export declare const TAGGED_FUN = "injection:tagged_function";
|
|
44
48
|
export declare const OBJ_DEF_CLS = "injection:object_definition_class";
|
package/dist/constant.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
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;
|
|
4
5
|
// got all value with no property name
|
|
5
6
|
exports.ALL = 'common:all_value_key';
|
|
6
7
|
// common
|
|
7
8
|
exports.SCHEDULE_KEY = 'common:schedule';
|
|
8
9
|
exports.CONFIGURATION_KEY = 'common:configuration';
|
|
9
|
-
exports.
|
|
10
|
+
exports.FRAMEWORK_KEY = 'common:framework';
|
|
10
11
|
exports.ASPECT_KEY = 'common:aspect';
|
|
12
|
+
exports.CATCH_KEY = 'common:catch';
|
|
11
13
|
// faas
|
|
12
14
|
exports.FUNC_KEY = 'faas:func';
|
|
13
15
|
exports.SERVERLESS_FUNC_KEY = 'faas:serverless:function';
|
|
@@ -48,6 +50,7 @@ exports.CONFIG_KEY = 'config';
|
|
|
48
50
|
exports.PLUGIN_KEY = 'plugin';
|
|
49
51
|
exports.LOGGER_KEY = 'logger';
|
|
50
52
|
exports.APPLICATION_KEY = '__midway_framework_app__';
|
|
53
|
+
exports.APPLICATION_CONTEXT_KEY = '__midway_application_context__';
|
|
51
54
|
////////////////////////////////////////// inject keys
|
|
52
55
|
// constructor key
|
|
53
56
|
exports.CLASS_KEY_CONSTRUCTOR = 'midway:class_key_constructor';
|
|
@@ -55,8 +58,12 @@ exports.CLASS_KEY_CONSTRUCTOR = 'midway:class_key_constructor';
|
|
|
55
58
|
exports.NAMED_TAG = 'named';
|
|
56
59
|
// The name of the target at design time
|
|
57
60
|
exports.INJECT_TAG = 'inject';
|
|
58
|
-
// The name inject custom decorator with resolver
|
|
59
|
-
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';
|
|
60
67
|
//
|
|
61
68
|
// // used to store constructor arguments tags
|
|
62
69
|
// export const TAGGED = 'injection:tagged';
|
|
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
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './provide';
|
|
2
|
+
export * from './inject';
|
|
3
|
+
export * from './pipeline';
|
|
4
|
+
export * from './aspect';
|
|
5
|
+
export * from './autoload';
|
|
6
|
+
export * from './configuration';
|
|
7
|
+
export * from './objectDef';
|
|
8
|
+
export * from './framework';
|
|
9
|
+
export * from './catch';
|
|
10
|
+
export * from './middleware';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
__exportStar(require("./provide"), exports);
|
|
14
|
+
__exportStar(require("./inject"), exports);
|
|
15
|
+
__exportStar(require("./pipeline"), exports);
|
|
16
|
+
__exportStar(require("./aspect"), exports);
|
|
17
|
+
__exportStar(require("./autoload"), exports);
|
|
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);
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Inject = void 0;
|
|
4
|
-
const
|
|
4
|
+
const index_1 = require("../../index");
|
|
5
5
|
function Inject(identifier) {
|
|
6
6
|
return function (target, targetKey) {
|
|
7
|
-
(0,
|
|
7
|
+
(0, index_1.savePropertyInject)({ target, targetKey, identifier });
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
10
|
exports.Inject = Inject;
|
|
@@ -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
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Scope = exports.Destroy = exports.Init = void 0;
|
|
4
|
-
const
|
|
4
|
+
const index_1 = require("../../index");
|
|
5
5
|
function Init() {
|
|
6
6
|
return function (target, propertyKey) {
|
|
7
|
-
|
|
7
|
+
(0, index_1.saveObjectDefinition)(target, { initMethod: propertyKey });
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
10
|
exports.Init = Init;
|
|
11
11
|
function Destroy() {
|
|
12
12
|
return function (target, propertyKey) {
|
|
13
|
-
|
|
13
|
+
(0, index_1.saveObjectDefinition)(target, {
|
|
14
14
|
destroyMethod: propertyKey,
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
exports.Destroy = Destroy;
|
|
19
|
-
function Scope(scope
|
|
19
|
+
function Scope(scope) {
|
|
20
20
|
return function (target) {
|
|
21
|
-
|
|
21
|
+
(0, index_1.saveObjectDefinition)(target, { scope });
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
exports.Scope = Scope;
|
|
@@ -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;
|
|
@@ -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
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Schedule = void 0;
|
|
4
4
|
const __1 = require("../../");
|
|
5
|
-
const objectDef_1 = require("../objectDef");
|
|
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;
|
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './inject';
|
|
3
|
-
export * from './pipeline';
|
|
4
|
-
export * from './aspect';
|
|
5
|
-
export * from './autoload';
|
|
6
|
-
export * from './configuration';
|
|
7
|
-
export * from './objectDef';
|
|
1
|
+
export * from './common/index';
|
|
8
2
|
export * from './faas/serverlessTrigger';
|
|
9
|
-
export * from './framework/
|
|
10
|
-
export * from './framework/config';
|
|
11
|
-
export * from './framework/logger';
|
|
12
|
-
export * from './framework/plugin';
|
|
3
|
+
export * from './framework/index';
|
|
13
4
|
export * from './framework/schedule';
|
|
14
5
|
export * from './microservice/consumer';
|
|
15
6
|
export * from './microservice/provider';
|
package/dist/decorator/index.js
CHANGED
|
@@ -11,22 +11,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
// common
|
|
14
|
-
__exportStar(require("./
|
|
15
|
-
__exportStar(require("./inject"), exports);
|
|
16
|
-
__exportStar(require("./pipeline"), exports);
|
|
17
|
-
__exportStar(require("./aspect"), exports);
|
|
18
|
-
__exportStar(require("./autoload"), exports);
|
|
19
|
-
__exportStar(require("./configuration"), exports);
|
|
20
|
-
__exportStar(require("./objectDef"), exports);
|
|
21
|
-
// export * from './validate';
|
|
22
|
-
// export * from './rule';
|
|
14
|
+
__exportStar(require("./common/index"), exports);
|
|
23
15
|
// faas
|
|
24
16
|
__exportStar(require("./faas/serverlessTrigger"), exports);
|
|
25
17
|
// framework
|
|
26
|
-
__exportStar(require("./framework/
|
|
27
|
-
__exportStar(require("./framework/config"), exports);
|
|
28
|
-
__exportStar(require("./framework/logger"), exports);
|
|
29
|
-
__exportStar(require("./framework/plugin"), exports);
|
|
18
|
+
__exportStar(require("./framework/index"), exports);
|
|
30
19
|
__exportStar(require("./framework/schedule"), exports);
|
|
31
20
|
// microservice
|
|
32
21
|
__exportStar(require("./microservice/consumer"), exports);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Consumer = void 0;
|
|
4
4
|
const __1 = require("../../");
|
|
5
|
-
const objectDef_1 = require("../objectDef");
|
|
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);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.HSFMethod = exports.DubboMethod = exports.GrpcMethod = exports.GrpcStreamTypeEnum = exports.Provider = void 0;
|
|
4
4
|
const __1 = require("../../");
|
|
5
|
-
const
|
|
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;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function Queue(options?: any):
|
|
1
|
+
export declare function Queue(options?: any): ClassDecorator;
|
|
2
2
|
//# sourceMappingURL=queue.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Controller = void 0;
|
|
4
|
-
const
|
|
4
|
+
const common_1 = require("../common");
|
|
5
5
|
const __1 = require("../../");
|
|
6
6
|
function Controller(prefix = '/', routerOptions = { middleware: [], sensitive: true }) {
|
|
7
7
|
return (target) => {
|
|
@@ -11,7 +11,8 @@ function Controller(prefix = '/', routerOptions = { middleware: [], sensitive: t
|
|
|
11
11
|
prefix,
|
|
12
12
|
routerOptions,
|
|
13
13
|
}, target);
|
|
14
|
-
(0,
|
|
14
|
+
(0, common_1.Scope)(__1.ScopeEnum.Request)(target);
|
|
15
|
+
(0, __1.Provide)()(target);
|
|
15
16
|
};
|
|
16
17
|
}
|
|
17
18
|
exports.Controller = Controller;
|
|
@@ -33,14 +33,14 @@ export interface RouterParamValue {
|
|
|
33
33
|
type: RouteParamTypes;
|
|
34
34
|
propertyData?: any;
|
|
35
35
|
}
|
|
36
|
-
export declare const Session: (property?: string) =>
|
|
37
|
-
export declare const Body: (property?: string) =>
|
|
38
|
-
export declare const Query: (property?: string) =>
|
|
39
|
-
export declare const Param: (property?: string) =>
|
|
40
|
-
export declare const Headers: (property?: string) =>
|
|
41
|
-
export declare const File: (property?: GetFileStreamOptions) =>
|
|
42
|
-
export declare const Files: (property?: GetFilesStreamOptions) =>
|
|
43
|
-
export declare const RequestPath: () =>
|
|
44
|
-
export declare const RequestIP: () =>
|
|
45
|
-
export declare const Queries: (property?: string) =>
|
|
36
|
+
export declare const Session: (property?: string) => ParameterDecorator;
|
|
37
|
+
export declare const Body: (property?: string) => ParameterDecorator;
|
|
38
|
+
export declare const Query: (property?: string) => ParameterDecorator;
|
|
39
|
+
export declare const Param: (property?: string) => ParameterDecorator;
|
|
40
|
+
export declare const Headers: (property?: string) => ParameterDecorator;
|
|
41
|
+
export declare const File: (property?: GetFileStreamOptions) => ParameterDecorator;
|
|
42
|
+
export declare const Files: (property?: GetFilesStreamOptions) => ParameterDecorator;
|
|
43
|
+
export declare const RequestPath: () => ParameterDecorator;
|
|
44
|
+
export declare const RequestIP: () => ParameterDecorator;
|
|
45
|
+
export declare const Queries: (property?: string) => ParameterDecorator;
|
|
46
46
|
//# sourceMappingURL=paramMapping.d.ts.map
|
|
@@ -17,15 +17,11 @@ var RouteParamTypes;
|
|
|
17
17
|
RouteParamTypes[RouteParamTypes["QUERIES"] = 10] = "QUERIES";
|
|
18
18
|
})(RouteParamTypes = exports.RouteParamTypes || (exports.RouteParamTypes = {}));
|
|
19
19
|
const createParamMapping = function (type) {
|
|
20
|
-
return (propertyData) =>
|
|
21
|
-
|
|
22
|
-
propertyData = (0, __1.getParamNames)(target[propertyName])[index];
|
|
23
|
-
}
|
|
24
|
-
(0, __1.attachPropertyDataToClass)(__1.WEB_ROUTER_PARAM_KEY, {
|
|
25
|
-
index,
|
|
20
|
+
return (propertyData) => {
|
|
21
|
+
return (0, __1.createCustomParamDecorator)(__1.WEB_ROUTER_PARAM_KEY, {
|
|
26
22
|
type,
|
|
27
23
|
propertyData,
|
|
28
|
-
}
|
|
24
|
+
});
|
|
29
25
|
};
|
|
30
26
|
};
|
|
31
27
|
const Session = (property) => createParamMapping(RouteParamTypes.SESSION)(property);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WSController = void 0;
|
|
4
|
-
const
|
|
4
|
+
const common_1 = require("../common");
|
|
5
5
|
const __1 = require("../../");
|
|
6
6
|
function WSController(namespace = '/', routerOptions = { middleware: [] }) {
|
|
7
7
|
return (target) => {
|
|
@@ -10,7 +10,8 @@ function WSController(namespace = '/', routerOptions = { middleware: [] }) {
|
|
|
10
10
|
namespace,
|
|
11
11
|
routerOptions,
|
|
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.WSController = WSController;
|