@midwayjs/decorator 2.13.2 → 3.0.0-alpha.37
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 +0 -36
- package/dist/constant.d.ts +1 -4
- package/dist/constant.js +9 -8
- package/dist/{annotation → decorator}/aspect.d.ts +0 -0
- package/dist/{annotation → decorator}/aspect.js +0 -0
- package/dist/{annotation → decorator}/autoload.d.ts +0 -0
- package/dist/{annotation → decorator}/autoload.js +1 -1
- package/dist/{annotation → decorator}/configuration.d.ts +0 -0
- package/dist/{annotation → decorator}/configuration.js +0 -0
- package/dist/{annotation → decorator}/decide.d.ts +0 -0
- package/dist/{annotation → decorator}/decide.js +0 -0
- 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/app.d.ts +3 -0
- package/dist/decorator/framework/app.js +17 -0
- package/dist/decorator/framework/config.d.ts +2 -0
- package/dist/decorator/framework/config.js +21 -0
- package/dist/decorator/framework/logger.d.ts +2 -0
- package/dist/decorator/framework/logger.js +18 -0
- package/dist/decorator/framework/plugin.d.ts +2 -0
- package/dist/decorator/framework/plugin.js +18 -0
- package/dist/{annotation → decorator/framework}/schedule.d.ts +0 -0
- package/dist/{annotation → decorator/framework}/schedule.js +2 -2
- package/dist/decorator/index.d.ts +27 -0
- package/dist/decorator/index.js +49 -0
- package/dist/{annotation → decorator}/inject.d.ts +1 -1
- package/dist/decorator/inject.js +11 -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 +3 -3
- package/dist/{microservice → decorator/microservice}/rabbitmqListener.d.ts +0 -0
- package/dist/{microservice → decorator/microservice}/rabbitmqListener.js +1 -1
- package/dist/{annotation → decorator}/objectDef.d.ts +0 -2
- package/dist/decorator/objectDef.js +25 -0
- package/dist/{annotation → decorator}/pipeline.d.ts +1 -1
- package/dist/decorator/pipeline.js +16 -0
- package/dist/{annotation → decorator}/provide.d.ts +0 -0
- package/dist/{annotation → decorator}/provide.js +0 -0
- package/dist/{rpc → decorator/rpc}/hsf.d.ts +0 -0
- package/dist/{rpc → decorator/rpc}/hsf.js +3 -3
- package/dist/decorator/rule.d.ts +1 -0
- package/dist/decorator/rule.js +58 -0
- package/dist/{annotation → decorator/task}/queue.d.ts +0 -0
- package/dist/{annotation → decorator/task}/queue.js +2 -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/decorator/validate.d.ts +1 -0
- package/dist/decorator/validate.js +36 -0
- package/dist/{web → decorator/web}/controller.d.ts +1 -1
- package/dist/{web → decorator/web}/controller.js +3 -3
- package/dist/{web → decorator/web}/paramMapping.d.ts +0 -0
- package/dist/{web → decorator/web}/paramMapping.js +1 -1
- 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 +3 -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 +276 -0
- package/dist/{common/decoratorManager.js → decoratorManager.js} +134 -312
- package/dist/index.d.ts +2 -21
- package/dist/index.js +2 -21
- package/dist/interface.d.ts +9 -4
- package/dist/interface.js +7 -1
- package/dist/util/dtoHelper.js +1 -1
- package/dist/util/index.d.ts +1 -0
- package/dist/util/index.js +18 -1
- package/package.json +2 -3
- package/dist/annotation/index.d.ts +0 -15
- package/dist/annotation/index.js +0 -27
- package/dist/annotation/inject.js +0 -16
- package/dist/annotation/objectDef.js +0 -43
- 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/rule.d.ts +0 -9
- package/dist/annotation/rule.js +0 -48
- package/dist/annotation/validate.d.ts +0 -2
- package/dist/annotation/validate.js +0 -35
- package/dist/common/decoratorManager.d.ts +0 -326
- 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/CHANGELOG.md
CHANGED
|
@@ -3,42 +3,6 @@
|
|
|
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
|
-
## [2.13.2](https://github.com/midwayjs/midway/compare/v2.13.1...v2.13.2) (2021-09-09)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
### Bug Fixes
|
|
10
|
-
|
|
11
|
-
* remove testKeyMap in testKeyMap ([901dad1](https://github.com/midwayjs/midway/commit/901dad177e07732748d169868a38a9c5813a82a7))
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
### Features
|
|
15
|
-
|
|
16
|
-
* dto helper ([9f64ec1](https://github.com/midwayjs/midway/commit/9f64ec110b16371dc2e9492601d04e9fdd95082b))
|
|
17
|
-
* dto helper support extend method ([5f32bd5](https://github.com/midwayjs/midway/commit/5f32bd55c23e76d5edbef6c2f07a900bd304573a))
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
# [2.13.0](https://github.com/midwayjs/midway/compare/v2.12.9...v2.13.0) (2021-09-07)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
### Bug Fixes
|
|
27
|
-
|
|
28
|
-
* can't found id in test case ([#1274](https://github.com/midwayjs/midway/issues/1274)) ([9bd1b96](https://github.com/midwayjs/midway/commit/9bd1b96d02ea08f6f1c80f5cef9f68a605cea2ca))
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
## [2.12.9](https://github.com/midwayjs/midway/compare/v2.12.8...v2.12.9) (2021-09-01)
|
|
35
|
-
|
|
36
|
-
**Note:** Version bump only for package @midwayjs/decorator
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
6
|
## [2.12.3](https://github.com/midwayjs/midway/compare/v2.12.2...v2.12.3) (2021-08-09)
|
|
43
7
|
|
|
44
8
|
|
package/dist/constant.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
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
4
|
export declare const RULES_KEY = "common:rules";
|
|
6
5
|
export declare const ASPECT_KEY = "common:aspect";
|
|
7
6
|
export declare const FUNC_KEY = "faas:func";
|
|
8
|
-
export declare const HANDLER_KEY = "faas:handler";
|
|
9
7
|
export declare const SERVERLESS_FUNC_KEY = "faas:serverless:function";
|
|
10
8
|
export declare const CONTROLLER_KEY = "web:controller";
|
|
11
9
|
export declare const WEB_ROUTER_KEY = "web:router";
|
|
@@ -40,8 +38,7 @@ export declare const APPLICATION_KEY = "__midway_framework_app__";
|
|
|
40
38
|
export declare const CLASS_KEY_CONSTRUCTOR = "midway:class_key_constructor";
|
|
41
39
|
export declare const NAMED_TAG = "named";
|
|
42
40
|
export declare const INJECT_TAG = "inject";
|
|
43
|
-
export declare const
|
|
44
|
-
export declare const TAGGED_PROP = "injection:tagged_props";
|
|
41
|
+
export declare const INJECT_CUSTOM_TAG = "inject_custom_tag";
|
|
45
42
|
export declare const TAGGED_CLS = "injection:tagged_class";
|
|
46
43
|
export declare const TAGGED_FUN = "injection:tagged_function";
|
|
47
44
|
export declare const OBJ_DEF_CLS = "injection:object_definition_class";
|
package/dist/constant.js
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
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.
|
|
4
|
-
exports.PRIVATE_META_DATA_KEY = void 0;
|
|
3
|
+
exports.PRIVATE_META_DATA_KEY = exports.MAIN_MODULE_KEY = exports.LIFECYCLE_IDENTIFIER_PREFIX = exports.PIPELINE_IDENTIFIER = exports.OBJ_DEF_CLS = exports.TAGGED_FUN = exports.TAGGED_CLS = exports.INJECT_CUSTOM_TAG = 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.FUNC_KEY = exports.ASPECT_KEY = exports.RULES_KEY = exports.CONFIGURATION_KEY = exports.SCHEDULE_KEY = exports.ALL = void 0;
|
|
5
4
|
// got all value with no property name
|
|
6
5
|
exports.ALL = 'common:all_value_key';
|
|
7
6
|
// common
|
|
8
|
-
exports.PRIORITY_KEY = 'common:priority';
|
|
9
7
|
exports.SCHEDULE_KEY = 'common:schedule';
|
|
10
8
|
exports.CONFIGURATION_KEY = 'common:configuration';
|
|
11
9
|
exports.RULES_KEY = 'common:rules';
|
|
12
10
|
exports.ASPECT_KEY = 'common:aspect';
|
|
13
11
|
// faas
|
|
14
12
|
exports.FUNC_KEY = 'faas:func';
|
|
15
|
-
exports.HANDLER_KEY = 'faas:handler';
|
|
16
13
|
exports.SERVERLESS_FUNC_KEY = 'faas:serverless:function';
|
|
17
14
|
// web
|
|
18
15
|
exports.CONTROLLER_KEY = 'web:controller';
|
|
@@ -58,10 +55,14 @@ exports.CLASS_KEY_CONSTRUCTOR = 'midway:class_key_constructor';
|
|
|
58
55
|
exports.NAMED_TAG = 'named';
|
|
59
56
|
// The name of the target at design time
|
|
60
57
|
exports.INJECT_TAG = 'inject';
|
|
61
|
-
//
|
|
62
|
-
exports.
|
|
63
|
-
//
|
|
64
|
-
|
|
58
|
+
// The name inject custom decorator with resolver
|
|
59
|
+
exports.INJECT_CUSTOM_TAG = 'inject_custom_tag';
|
|
60
|
+
//
|
|
61
|
+
// // used to store constructor arguments tags
|
|
62
|
+
// export const TAGGED = 'injection:tagged';
|
|
63
|
+
//
|
|
64
|
+
// // used to store class properties tags
|
|
65
|
+
// export const TAGGED_PROP = 'injection:tagged_props';
|
|
65
66
|
// used to store class to be injected
|
|
66
67
|
exports.TAGGED_CLS = 'injection:tagged_class';
|
|
67
68
|
// used to store function to be injected
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
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
5
|
function Autoload() {
|
|
6
6
|
return function (target) {
|
|
7
7
|
(0, decoratorManager_1.savePreloadModule)(target);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -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,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.App = void 0;
|
|
4
|
+
const __1 = require("../../");
|
|
5
|
+
function App(type) {
|
|
6
|
+
return function (target, targetKey) {
|
|
7
|
+
(0, __1.attachClassMetadata)(__1.INJECT_CUSTOM_TAG, {
|
|
8
|
+
key: __1.APPLICATION_KEY,
|
|
9
|
+
propertyName: targetKey,
|
|
10
|
+
meta: {
|
|
11
|
+
type,
|
|
12
|
+
},
|
|
13
|
+
}, target, targetKey);
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
exports.App = App;
|
|
17
|
+
//# sourceMappingURL=app.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Config = void 0;
|
|
4
|
+
const __1 = require("../../");
|
|
5
|
+
function Config(identifier) {
|
|
6
|
+
return function (target, targetKey) {
|
|
7
|
+
if (!identifier) {
|
|
8
|
+
identifier = targetKey;
|
|
9
|
+
}
|
|
10
|
+
if (identifier === __1.ALL) {
|
|
11
|
+
identifier = '';
|
|
12
|
+
}
|
|
13
|
+
(0, __1.attachClassMetadata)(__1.INJECT_CUSTOM_TAG, {
|
|
14
|
+
key: __1.CONFIG_KEY,
|
|
15
|
+
propertyName: targetKey,
|
|
16
|
+
targetKey: identifier,
|
|
17
|
+
}, target, targetKey);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
exports.Config = Config;
|
|
21
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Logger = void 0;
|
|
4
|
+
const __1 = require("../../");
|
|
5
|
+
function Logger(identifier) {
|
|
6
|
+
return function (target, targetKey) {
|
|
7
|
+
if (!identifier) {
|
|
8
|
+
identifier = targetKey;
|
|
9
|
+
}
|
|
10
|
+
(0, __1.attachClassMetadata)(__1.INJECT_CUSTOM_TAG, {
|
|
11
|
+
targetKey: identifier,
|
|
12
|
+
propertyName: targetKey,
|
|
13
|
+
key: __1.LOGGER_KEY,
|
|
14
|
+
}, target, targetKey);
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
exports.Logger = Logger;
|
|
18
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Plugin = void 0;
|
|
4
|
+
const __1 = require("../../");
|
|
5
|
+
function Plugin(identifier) {
|
|
6
|
+
return function (target, targetKey) {
|
|
7
|
+
if (!identifier) {
|
|
8
|
+
identifier = targetKey;
|
|
9
|
+
}
|
|
10
|
+
(0, __1.attachClassMetadata)(__1.INJECT_CUSTOM_TAG, {
|
|
11
|
+
targetKey: identifier,
|
|
12
|
+
propertyName: targetKey,
|
|
13
|
+
key: __1.PLUGIN_KEY,
|
|
14
|
+
}, target, targetKey);
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
exports.Plugin = Plugin;
|
|
18
|
+
//# sourceMappingURL=plugin.js.map
|
|
File without changes
|
|
@@ -1,8 +1,8 @@
|
|
|
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("../objectDef");
|
|
6
6
|
function Schedule(scheduleOpts) {
|
|
7
7
|
return function (target) {
|
|
8
8
|
(0, __1.saveModule)(__1.SCHEDULE_KEY, target);
|
|
@@ -0,0 +1,27 @@
|
|
|
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 './faas/serverlessTrigger';
|
|
9
|
+
export * from './framework/app';
|
|
10
|
+
export * from './framework/config';
|
|
11
|
+
export * from './framework/logger';
|
|
12
|
+
export * from './framework/plugin';
|
|
13
|
+
export * from './framework/schedule';
|
|
14
|
+
export * from './microservice/consumer';
|
|
15
|
+
export * from './microservice/provider';
|
|
16
|
+
export * from './microservice/rabbitmqListener';
|
|
17
|
+
export * from './rpc/hsf';
|
|
18
|
+
export * from './task/queue';
|
|
19
|
+
export * from './task/task';
|
|
20
|
+
export * from './task/taskLocal';
|
|
21
|
+
export * from './web/controller';
|
|
22
|
+
export * from './web/paramMapping';
|
|
23
|
+
export * from './web/requestMapping';
|
|
24
|
+
export * from './web/response';
|
|
25
|
+
export * from './ws/webSocketController';
|
|
26
|
+
export * from './ws/webSocketEvent';
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
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("./provide"), exports);
|
|
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';
|
|
23
|
+
// faas
|
|
24
|
+
__exportStar(require("./faas/serverlessTrigger"), exports);
|
|
25
|
+
// framework
|
|
26
|
+
__exportStar(require("./framework/app"), exports);
|
|
27
|
+
__exportStar(require("./framework/config"), exports);
|
|
28
|
+
__exportStar(require("./framework/logger"), exports);
|
|
29
|
+
__exportStar(require("./framework/plugin"), exports);
|
|
30
|
+
__exportStar(require("./framework/schedule"), exports);
|
|
31
|
+
// microservice
|
|
32
|
+
__exportStar(require("./microservice/consumer"), exports);
|
|
33
|
+
__exportStar(require("./microservice/provider"), exports);
|
|
34
|
+
__exportStar(require("./microservice/rabbitmqListener"), exports);
|
|
35
|
+
// rpc
|
|
36
|
+
__exportStar(require("./rpc/hsf"), exports);
|
|
37
|
+
// task
|
|
38
|
+
__exportStar(require("./task/queue"), exports);
|
|
39
|
+
__exportStar(require("./task/task"), exports);
|
|
40
|
+
__exportStar(require("./task/taskLocal"), exports);
|
|
41
|
+
// web
|
|
42
|
+
__exportStar(require("./web/controller"), exports);
|
|
43
|
+
__exportStar(require("./web/paramMapping"), exports);
|
|
44
|
+
__exportStar(require("./web/requestMapping"), exports);
|
|
45
|
+
__exportStar(require("./web/response"), exports);
|
|
46
|
+
// ws
|
|
47
|
+
__exportStar(require("./ws/webSocketController"), exports);
|
|
48
|
+
__exportStar(require("./ws/webSocketEvent"), exports);
|
|
49
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ObjectIdentifier } from '../interface';
|
|
2
|
-
export declare function Inject(identifier?: ObjectIdentifier): (target: any, targetKey: string
|
|
2
|
+
export declare function Inject(identifier?: ObjectIdentifier): (target: any, targetKey: string) => void;
|
|
3
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 __1 = require("../");
|
|
5
|
+
function Inject(identifier) {
|
|
6
|
+
return function (target, targetKey) {
|
|
7
|
+
(0, __1.savePropertyInject)({ target, targetKey, identifier });
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
exports.Inject = Inject;
|
|
11
|
+
//# sourceMappingURL=inject.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("../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 objectDef_1 = require("../objectDef");
|
|
6
6
|
function Provider(type, metadata = {}) {
|
|
7
7
|
return (target) => {
|
|
8
8
|
(0, __1.saveModule)(__1.MS_PROVIDER_KEY, target);
|
|
@@ -10,7 +10,7 @@ function Provider(type, metadata = {}) {
|
|
|
10
10
|
type,
|
|
11
11
|
metadata,
|
|
12
12
|
}, target);
|
|
13
|
-
(0,
|
|
13
|
+
(0, objectDef_1.Scope)(__1.ScopeEnum.Request)(target);
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
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;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { ScopeEnum } from '../';
|
|
2
|
-
export declare function Async(): (target: any) => void;
|
|
3
2
|
export declare function Init(): (target: any, propertyKey: string) => void;
|
|
4
3
|
export declare function Destroy(): (target: any, propertyKey: string) => void;
|
|
5
4
|
export declare function Scope(scope?: ScopeEnum): (target: any) => void;
|
|
6
|
-
export declare function Autowire(isAutowire?: boolean): (target: any) => void;
|
|
7
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 __1 = require("../");
|
|
5
|
+
function Init() {
|
|
6
|
+
return function (target, propertyKey) {
|
|
7
|
+
return (0, __1.saveObjectDefinition)(target, { initMethod: propertyKey });
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
exports.Init = Init;
|
|
11
|
+
function Destroy() {
|
|
12
|
+
return function (target, propertyKey) {
|
|
13
|
+
return (0, __1.saveObjectDefinition)(target, {
|
|
14
|
+
destroyMethod: propertyKey,
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
exports.Destroy = Destroy;
|
|
19
|
+
function Scope(scope = __1.ScopeEnum.Singleton) {
|
|
20
|
+
return function (target) {
|
|
21
|
+
return (0, __1.saveObjectDefinition)(target, { scope });
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
exports.Scope = Scope;
|
|
25
|
+
//# sourceMappingURL=objectDef.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ObjectIdentifier } from '../interface';
|
|
2
|
-
export declare function Pipeline(valves?: ObjectIdentifier[]): (target: any, targetKey: string
|
|
2
|
+
export declare function Pipeline(valves?: ObjectIdentifier[]): (target: any, targetKey: string) => void;
|
|
3
3
|
//# sourceMappingURL=pipeline.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Pipeline = void 0;
|
|
4
|
+
const __1 = require("../");
|
|
5
|
+
function Pipeline(valves) {
|
|
6
|
+
return function (target, targetKey) {
|
|
7
|
+
(0, __1.savePropertyInject)({
|
|
8
|
+
target,
|
|
9
|
+
targetKey,
|
|
10
|
+
identifier: __1.PIPELINE_IDENTIFIER,
|
|
11
|
+
args: valves,
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
exports.Pipeline = Pipeline;
|
|
16
|
+
//# sourceMappingURL=pipeline.js.map
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.HSF = void 0;
|
|
4
|
-
const __1 = require("
|
|
5
|
-
const
|
|
4
|
+
const __1 = require("../../");
|
|
5
|
+
const __2 = require("../");
|
|
6
6
|
/**
|
|
7
7
|
* @param hsfOption
|
|
8
8
|
* @constructor
|
|
@@ -11,7 +11,7 @@ function HSF(hsfOption = {}) {
|
|
|
11
11
|
return (target) => {
|
|
12
12
|
(0, __1.saveModule)(__1.HSF_KEY, target);
|
|
13
13
|
(0, __1.saveClassMetadata)(__1.HSF_KEY, hsfOption, target);
|
|
14
|
-
(0,
|
|
14
|
+
(0, __2.Scope)(__1.ScopeEnum.Request)(target);
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
exports.HSF = HSF;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=rule.d.ts.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// import * as joi from 'joi';
|
|
2
|
+
// import {
|
|
3
|
+
// attachClassMetadata,
|
|
4
|
+
// getClassMetadata,
|
|
5
|
+
// getPropertyType,
|
|
6
|
+
// saveClassMetadata,
|
|
7
|
+
// RULES_KEY,
|
|
8
|
+
// } from '..';
|
|
9
|
+
//
|
|
10
|
+
// export interface RuleOptions {
|
|
11
|
+
// required?: boolean;
|
|
12
|
+
// min?: number;
|
|
13
|
+
// max?: number;
|
|
14
|
+
// }
|
|
15
|
+
//
|
|
16
|
+
// export function Rule(rule, options: RuleOptions = { required: true }) {
|
|
17
|
+
// return function (...args) {
|
|
18
|
+
// if (args[1]) {
|
|
19
|
+
// // 函数装饰器
|
|
20
|
+
// const [target, propertyKey] = args;
|
|
21
|
+
// if (!joi.isSchema(rule)) {
|
|
22
|
+
// rule = joi
|
|
23
|
+
// .object(getClassMetadata(RULES_KEY, rule))
|
|
24
|
+
// .meta({ id: rule.name });
|
|
25
|
+
// if (getPropertyType(target, propertyKey).name === 'Array') {
|
|
26
|
+
// rule = joi.array().items(rule);
|
|
27
|
+
// if (options.min) {
|
|
28
|
+
// rule = rule.min(options.min);
|
|
29
|
+
// }
|
|
30
|
+
// if (options.max) {
|
|
31
|
+
// rule = rule.max(options.max);
|
|
32
|
+
// }
|
|
33
|
+
// }
|
|
34
|
+
// if (options.required) {
|
|
35
|
+
// rule = rule.required();
|
|
36
|
+
// }
|
|
37
|
+
// }
|
|
38
|
+
//
|
|
39
|
+
// attachClassMetadata(RULES_KEY, rule, target, propertyKey);
|
|
40
|
+
// } else {
|
|
41
|
+
// //类的装饰器
|
|
42
|
+
// const rules = getClassMetadata(RULES_KEY, rule);
|
|
43
|
+
// if (rules) {
|
|
44
|
+
// let currentRule = getClassMetadata(RULES_KEY, args[0]);
|
|
45
|
+
// currentRule = currentRule ?? {};
|
|
46
|
+
// Object.keys(rules).map(item => {
|
|
47
|
+
// if (!currentRule[item]) {
|
|
48
|
+
// currentRule[item] = rules[item];
|
|
49
|
+
// }
|
|
50
|
+
// });
|
|
51
|
+
// saveClassMetadata(RULES_KEY, currentRule, args[0]);
|
|
52
|
+
// }
|
|
53
|
+
// }
|
|
54
|
+
// };
|
|
55
|
+
// }
|
|
56
|
+
//
|
|
57
|
+
// export { joi as RuleType };
|
|
58
|
+
//# sourceMappingURL=rule.js.map
|
|
File without changes
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Queue = void 0;
|
|
4
|
-
const __1 = require("
|
|
5
|
-
const constant_1 = require("
|
|
4
|
+
const __1 = require("../../");
|
|
5
|
+
const constant_1 = require("../../constant");
|
|
6
6
|
function Queue(options) {
|
|
7
7
|
return function (target) {
|
|
8
8
|
(0, __1.saveModule)(constant_1.MODULE_TASK_QUEUE_KEY, target);
|
|
File without changes
|