@midwayjs/decorator 3.4.4 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/index.d.ts +3 -7
  2. package/dist/index.js +14 -12
  3. package/package.json +3 -3
  4. package/dist/constant.d.ts +0 -54
  5. package/dist/constant.js +0 -85
  6. package/dist/decorator/common/aspect.d.ts +0 -20
  7. package/dist/decorator/common/aspect.js +0 -22
  8. package/dist/decorator/common/autoload.d.ts +0 -2
  9. package/dist/decorator/common/autoload.js +0 -13
  10. package/dist/decorator/common/configuration.d.ts +0 -24
  11. package/dist/decorator/common/configuration.js +0 -11
  12. package/dist/decorator/common/filter.d.ts +0 -6
  13. package/dist/decorator/common/filter.js +0 -31
  14. package/dist/decorator/common/framework.d.ts +0 -2
  15. package/dist/decorator/common/framework.js +0 -13
  16. package/dist/decorator/common/index.d.ts +0 -11
  17. package/dist/decorator/common/index.js +0 -27
  18. package/dist/decorator/common/inject.d.ts +0 -3
  19. package/dist/decorator/common/inject.js +0 -11
  20. package/dist/decorator/common/middleware.d.ts +0 -2
  21. package/dist/decorator/common/middleware.js +0 -12
  22. package/dist/decorator/common/objectDef.d.ts +0 -7
  23. package/dist/decorator/common/objectDef.js +0 -25
  24. package/dist/decorator/common/pipeline.d.ts +0 -3
  25. package/dist/decorator/common/pipeline.js +0 -11
  26. package/dist/decorator/common/provide.d.ts +0 -3
  27. package/dist/decorator/common/provide.js +0 -11
  28. package/dist/decorator/faas/serverlessTrigger.d.ts +0 -13
  29. package/dist/decorator/faas/serverlessTrigger.js +0 -29
  30. package/dist/decorator/framework/index.d.ts +0 -7
  31. package/dist/decorator/framework/index.js +0 -33
  32. package/dist/decorator/framework/schedule.d.ts +0 -21
  33. package/dist/decorator/framework/schedule.js +0 -15
  34. package/dist/decorator/index.d.ts +0 -19
  35. package/dist/decorator/index.js +0 -43
  36. package/dist/decorator/microservice/consumer.d.ts +0 -5
  37. package/dist/decorator/microservice/consumer.js +0 -18
  38. package/dist/decorator/microservice/kafkaListener.d.ts +0 -6
  39. package/dist/decorator/microservice/kafkaListener.js +0 -13
  40. package/dist/decorator/microservice/provider.d.ts +0 -16
  41. package/dist/decorator/microservice/provider.js +0 -48
  42. package/dist/decorator/microservice/rabbitmqListener.d.ts +0 -50
  43. package/dist/decorator/microservice/rabbitmqListener.js +0 -13
  44. package/dist/decorator/rpc/hsf.d.ts +0 -12
  45. package/dist/decorator/rpc/hsf.js +0 -19
  46. package/dist/decorator/task/queue.d.ts +0 -2
  47. package/dist/decorator/task/queue.js +0 -17
  48. package/dist/decorator/task/task.d.ts +0 -2
  49. package/dist/decorator/task/task.js +0 -18
  50. package/dist/decorator/task/taskLocal.d.ts +0 -2
  51. package/dist/decorator/task/taskLocal.js +0 -17
  52. package/dist/decorator/web/controller.d.ts +0 -20
  53. package/dist/decorator/web/controller.js +0 -19
  54. package/dist/decorator/web/paramMapping.d.ts +0 -31
  55. package/dist/decorator/web/paramMapping.js +0 -50
  56. package/dist/decorator/web/requestMapping.d.ts +0 -129
  57. package/dist/decorator/web/requestMapping.js +0 -83
  58. package/dist/decorator/web/response.d.ts +0 -9
  59. package/dist/decorator/web/response.js +0 -65
  60. package/dist/decorator/ws/webSocketController.d.ts +0 -10
  61. package/dist/decorator/ws/webSocketController.js +0 -21
  62. package/dist/decorator/ws/webSocketEvent.d.ts +0 -60
  63. package/dist/decorator/ws/webSocketEvent.js +0 -87
  64. package/dist/decoratorManager.d.ts +0 -301
  65. package/dist/decoratorManager.js +0 -708
  66. package/dist/interface.d.ts +0 -238
  67. package/dist/interface.js +0 -67
  68. package/dist/util/camelCase.d.ts +0 -3
  69. package/dist/util/camelCase.js +0 -88
  70. package/dist/util/flatted.d.ts +0 -7
  71. package/dist/util/flatted.js +0 -91
  72. package/dist/util/format.d.ts +0 -25
  73. package/dist/util/format.js +0 -38
  74. package/dist/util/fs.d.ts +0 -5
  75. package/dist/util/fs.js +0 -15
  76. package/dist/util/index.d.ts +0 -62
  77. package/dist/util/index.js +0 -200
  78. package/dist/util/uuid.d.ts +0 -5
  79. package/dist/util/uuid.js +0 -64
package/dist/index.d.ts CHANGED
@@ -1,8 +1,4 @@
1
- export * from './decorator';
2
- export * from './interface';
3
- export * from './constant';
4
- export * from './decoratorManager';
5
- export { Types, Utils, sleep } from './util/index';
6
- export { FileUtils } from './util/fs';
7
- export * from './util/format';
1
+ export * from '@midwayjs/core/dist/decorator';
2
+ export { Types, Utils, sleep, FileUtils, FORMAT } from '@midwayjs/core';
3
+ export { MiddlewareParamArray, ObjectIdentifier, GroupModeType, ScopeEnum, InjectModeEnum, IManagedInstance, ObjectDefinitionOptions, TagPropsMetadata, TagClsMetadata, ReflectResult, FaaSMetadata, FrameworkType, MidwayFrameworkType, ServerlessTriggerType, IModuleStore, } from '@midwayjs/core';
8
4
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -14,16 +14,18 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.FileUtils = exports.sleep = exports.Utils = exports.Types = void 0;
18
- __exportStar(require("./decorator"), exports);
19
- __exportStar(require("./interface"), exports);
20
- __exportStar(require("./constant"), exports);
21
- __exportStar(require("./decoratorManager"), exports);
22
- var index_1 = require("./util/index");
23
- Object.defineProperty(exports, "Types", { enumerable: true, get: function () { return index_1.Types; } });
24
- Object.defineProperty(exports, "Utils", { enumerable: true, get: function () { return index_1.Utils; } });
25
- Object.defineProperty(exports, "sleep", { enumerable: true, get: function () { return index_1.sleep; } });
26
- var fs_1 = require("./util/fs");
27
- Object.defineProperty(exports, "FileUtils", { enumerable: true, get: function () { return fs_1.FileUtils; } });
28
- __exportStar(require("./util/format"), exports);
17
+ exports.ServerlessTriggerType = exports.MidwayFrameworkType = exports.FrameworkType = exports.InjectModeEnum = exports.ScopeEnum = exports.FORMAT = exports.FileUtils = exports.sleep = exports.Utils = exports.Types = void 0;
18
+ __exportStar(require("@midwayjs/core/dist/decorator"), exports);
19
+ var core_1 = require("@midwayjs/core");
20
+ Object.defineProperty(exports, "Types", { enumerable: true, get: function () { return core_1.Types; } });
21
+ Object.defineProperty(exports, "Utils", { enumerable: true, get: function () { return core_1.Utils; } });
22
+ Object.defineProperty(exports, "sleep", { enumerable: true, get: function () { return core_1.sleep; } });
23
+ Object.defineProperty(exports, "FileUtils", { enumerable: true, get: function () { return core_1.FileUtils; } });
24
+ Object.defineProperty(exports, "FORMAT", { enumerable: true, get: function () { return core_1.FORMAT; } });
25
+ var core_2 = require("@midwayjs/core");
26
+ Object.defineProperty(exports, "ScopeEnum", { enumerable: true, get: function () { return core_2.ScopeEnum; } });
27
+ Object.defineProperty(exports, "InjectModeEnum", { enumerable: true, get: function () { return core_2.InjectModeEnum; } });
28
+ Object.defineProperty(exports, "FrameworkType", { enumerable: true, get: function () { return core_2.FrameworkType; } });
29
+ Object.defineProperty(exports, "MidwayFrameworkType", { enumerable: true, get: function () { return core_2.MidwayFrameworkType; } });
30
+ Object.defineProperty(exports, "ServerlessTriggerType", { enumerable: true, get: function () { return core_2.ServerlessTriggerType; } });
29
31
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/decorator",
3
- "version": "3.4.4",
3
+ "version": "3.6.0",
4
4
  "description": "definition decorator for midway project",
5
5
  "main": "dist/index",
6
6
  "typings": "dist/index.d.ts",
@@ -12,7 +12,7 @@
12
12
  "link": "npm link"
13
13
  },
14
14
  "dependencies": {
15
- "reflect-metadata": "^0.1.13"
15
+ "@midwayjs/core": "^3.6.0"
16
16
  },
17
17
  "devDependencies": {
18
18
  "mm": "3.2.0"
@@ -36,5 +36,5 @@
36
36
  "publishConfig": {
37
37
  "access": "public"
38
38
  },
39
- "gitHead": "f6b5a3ff3d19ae2a0d33a5a14357bee2a8463767"
39
+ "gitHead": "22643b0e8519766bb7c68b975930199fc136336e"
40
40
  }
@@ -1,54 +0,0 @@
1
- export declare const ALL = "common:all_value_key";
2
- export declare const SCHEDULE_KEY = "common:schedule";
3
- export declare const CONFIGURATION_KEY = "common:configuration";
4
- export declare const FRAMEWORK_KEY = "common:framework";
5
- export declare const ASPECT_KEY = "common:aspect";
6
- export declare const CATCH_KEY = "common:catch";
7
- export declare const MATCH_KEY = "common:match";
8
- export declare const FUNC_KEY = "faas:func";
9
- export declare const SERVERLESS_FUNC_KEY = "faas:serverless:function";
10
- export declare const CONTROLLER_KEY = "web:controller";
11
- export declare const WEB_ROUTER_KEY = "web:router";
12
- export declare const WEB_ROUTER_PARAM_KEY = "web:router_param";
13
- export declare const WEB_RESPONSE_KEY = "web:response";
14
- export declare const WEB_RESPONSE_HTTP_CODE = "web:response_http_code";
15
- export declare const WEB_RESPONSE_REDIRECT = "web:response_redirect";
16
- export declare const WEB_RESPONSE_HEADER = "web:response_header";
17
- export declare const WEB_RESPONSE_CONTENT_TYPE = "web:response_content_type";
18
- export declare const WEB_RESPONSE_RENDER = "web:response_render";
19
- export declare const MODULE_TASK_KEY = "task:task";
20
- export declare const MODULE_TASK_METADATA = "task:task:options";
21
- export declare const MODULE_TASK_TASK_LOCAL_KEY = "task:task:task_local";
22
- export declare const MODULE_TASK_TASK_LOCAL_OPTIONS = "task:task:task_local:options";
23
- export declare const MODULE_TASK_QUEUE_KEY = "task:task:queue";
24
- export declare const MODULE_TASK_QUEUE_OPTIONS = "task:task:queue:options";
25
- export declare const WS_CONTROLLER_KEY = "ws:controller";
26
- export declare const WS_EVENT_KEY = "ws:event";
27
- export declare const HSF_KEY = "rpc:hsf";
28
- export declare const RPC_GRPC_KEY = "rpc:grpc";
29
- export declare const RPC_DUBBO_KEY = "rpc:dubbo";
30
- export declare const MS_CONSUMER_KEY = "ms:consumer";
31
- export declare const MS_PRODUCER_KEY = "ms:producer";
32
- export declare const MS_PROVIDER_KEY = "ms:provider";
33
- export declare const MS_GRPC_METHOD_KEY = "ms:grpc:method";
34
- export declare const MS_DUBBO_METHOD_KEY = "ms:dubbo:method";
35
- export declare const MS_HSF_METHOD_KEY = "ms:hsf:method";
36
- export declare const CONFIG_KEY = "config";
37
- export declare const PLUGIN_KEY = "plugin";
38
- export declare const LOGGER_KEY = "logger";
39
- export declare const APPLICATION_KEY = "__midway_framework_app__";
40
- export declare const APPLICATION_CONTEXT_KEY = "__midway_application_context__";
41
- export declare const CLASS_KEY_CONSTRUCTOR = "midway:class_key_constructor";
42
- export declare const NAMED_TAG = "named";
43
- export declare const INJECT_TAG = "inject";
44
- export declare const INJECT_CUSTOM_PROPERTY = "inject_custom_property";
45
- export declare const INJECT_CUSTOM_METHOD = "inject_custom_method";
46
- export declare const INJECT_CUSTOM_PARAM = "inject_custom_param";
47
- export declare const TAGGED_CLS = "injection:tagged_class";
48
- export declare const TAGGED_FUN = "injection:tagged_function";
49
- export declare const OBJ_DEF_CLS = "injection:object_definition_class";
50
- export declare const PIPELINE_IDENTIFIER = "__pipeline_identifier__";
51
- export declare const LIFECYCLE_IDENTIFIER_PREFIX = "__lifecycle__";
52
- export declare const MAIN_MODULE_KEY = "__main__";
53
- export declare const PRIVATE_META_DATA_KEY = "__midway_private_meta_data__";
54
- //# sourceMappingURL=constant.d.ts.map
package/dist/constant.js DELETED
@@ -1,85 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PIPELINE_IDENTIFIER = exports.OBJ_DEF_CLS = exports.TAGGED_FUN = exports.TAGGED_CLS = exports.INJECT_CUSTOM_PARAM = exports.INJECT_CUSTOM_METHOD = exports.INJECT_CUSTOM_PROPERTY = exports.INJECT_TAG = exports.NAMED_TAG = exports.CLASS_KEY_CONSTRUCTOR = exports.APPLICATION_CONTEXT_KEY = exports.APPLICATION_KEY = exports.LOGGER_KEY = exports.PLUGIN_KEY = exports.CONFIG_KEY = exports.MS_HSF_METHOD_KEY = exports.MS_DUBBO_METHOD_KEY = exports.MS_GRPC_METHOD_KEY = exports.MS_PROVIDER_KEY = exports.MS_PRODUCER_KEY = exports.MS_CONSUMER_KEY = exports.RPC_DUBBO_KEY = exports.RPC_GRPC_KEY = exports.HSF_KEY = exports.WS_EVENT_KEY = exports.WS_CONTROLLER_KEY = exports.MODULE_TASK_QUEUE_OPTIONS = exports.MODULE_TASK_QUEUE_KEY = exports.MODULE_TASK_TASK_LOCAL_OPTIONS = exports.MODULE_TASK_TASK_LOCAL_KEY = exports.MODULE_TASK_METADATA = exports.MODULE_TASK_KEY = exports.WEB_RESPONSE_RENDER = exports.WEB_RESPONSE_CONTENT_TYPE = exports.WEB_RESPONSE_HEADER = exports.WEB_RESPONSE_REDIRECT = exports.WEB_RESPONSE_HTTP_CODE = exports.WEB_RESPONSE_KEY = exports.WEB_ROUTER_PARAM_KEY = exports.WEB_ROUTER_KEY = exports.CONTROLLER_KEY = exports.SERVERLESS_FUNC_KEY = exports.FUNC_KEY = exports.MATCH_KEY = exports.CATCH_KEY = exports.ASPECT_KEY = exports.FRAMEWORK_KEY = exports.CONFIGURATION_KEY = exports.SCHEDULE_KEY = exports.ALL = void 0;
4
- exports.PRIVATE_META_DATA_KEY = exports.MAIN_MODULE_KEY = exports.LIFECYCLE_IDENTIFIER_PREFIX = void 0;
5
- // got all value with no property name
6
- exports.ALL = 'common:all_value_key';
7
- // common
8
- exports.SCHEDULE_KEY = 'common:schedule';
9
- exports.CONFIGURATION_KEY = 'common:configuration';
10
- exports.FRAMEWORK_KEY = 'common:framework';
11
- exports.ASPECT_KEY = 'common:aspect';
12
- exports.CATCH_KEY = 'common:catch';
13
- exports.MATCH_KEY = 'common:match';
14
- // faas
15
- exports.FUNC_KEY = 'faas:func';
16
- exports.SERVERLESS_FUNC_KEY = 'faas:serverless:function';
17
- // web
18
- exports.CONTROLLER_KEY = 'web:controller';
19
- exports.WEB_ROUTER_KEY = 'web:router';
20
- exports.WEB_ROUTER_PARAM_KEY = 'web:router_param';
21
- exports.WEB_RESPONSE_KEY = 'web:response';
22
- exports.WEB_RESPONSE_HTTP_CODE = 'web:response_http_code';
23
- exports.WEB_RESPONSE_REDIRECT = 'web:response_redirect';
24
- exports.WEB_RESPONSE_HEADER = 'web:response_header';
25
- exports.WEB_RESPONSE_CONTENT_TYPE = 'web:response_content_type';
26
- exports.WEB_RESPONSE_RENDER = 'web:response_render';
27
- // task
28
- exports.MODULE_TASK_KEY = 'task:task';
29
- exports.MODULE_TASK_METADATA = 'task:task:options';
30
- exports.MODULE_TASK_TASK_LOCAL_KEY = 'task:task:task_local';
31
- exports.MODULE_TASK_TASK_LOCAL_OPTIONS = 'task:task:task_local:options';
32
- exports.MODULE_TASK_QUEUE_KEY = 'task:task:queue';
33
- exports.MODULE_TASK_QUEUE_OPTIONS = 'task:task:queue:options';
34
- // ws
35
- exports.WS_CONTROLLER_KEY = 'ws:controller';
36
- exports.WS_EVENT_KEY = 'ws:event';
37
- // RPC
38
- exports.HSF_KEY = 'rpc:hsf';
39
- exports.RPC_GRPC_KEY = 'rpc:grpc';
40
- exports.RPC_DUBBO_KEY = 'rpc:dubbo';
41
- // microservice
42
- exports.MS_CONSUMER_KEY = 'ms:consumer';
43
- exports.MS_PRODUCER_KEY = 'ms:producer';
44
- exports.MS_PROVIDER_KEY = 'ms:provider';
45
- // rpc method
46
- exports.MS_GRPC_METHOD_KEY = 'ms:grpc:method';
47
- exports.MS_DUBBO_METHOD_KEY = 'ms:dubbo:method';
48
- exports.MS_HSF_METHOD_KEY = 'ms:hsf:method';
49
- // framework
50
- exports.CONFIG_KEY = 'config';
51
- exports.PLUGIN_KEY = 'plugin';
52
- exports.LOGGER_KEY = 'logger';
53
- exports.APPLICATION_KEY = '__midway_framework_app__';
54
- exports.APPLICATION_CONTEXT_KEY = '__midway_application_context__';
55
- ////////////////////////////////////////// inject keys
56
- // constructor key
57
- exports.CLASS_KEY_CONSTRUCTOR = 'midway:class_key_constructor';
58
- // Used for named bindings
59
- exports.NAMED_TAG = 'named';
60
- // The name of the target at design time
61
- exports.INJECT_TAG = 'inject';
62
- // The name inject custom property decorator with resolver
63
- exports.INJECT_CUSTOM_PROPERTY = 'inject_custom_property';
64
- // The name inject custom param decorator with resolver
65
- exports.INJECT_CUSTOM_METHOD = 'inject_custom_method';
66
- // The name inject custom param decorator with resolver
67
- exports.INJECT_CUSTOM_PARAM = 'inject_custom_param';
68
- //
69
- // // used to store constructor arguments tags
70
- // export const TAGGED = 'injection:tagged';
71
- //
72
- // // used to store class properties tags
73
- // export const TAGGED_PROP = 'injection:tagged_props';
74
- // used to store class to be injected
75
- exports.TAGGED_CLS = 'injection:tagged_class';
76
- // used to store function to be injected
77
- exports.TAGGED_FUN = 'injection:tagged_function';
78
- exports.OBJ_DEF_CLS = 'injection:object_definition_class';
79
- // pipeline
80
- exports.PIPELINE_IDENTIFIER = '__pipeline_identifier__';
81
- // lifecycle interface
82
- exports.LIFECYCLE_IDENTIFIER_PREFIX = '__lifecycle__';
83
- exports.MAIN_MODULE_KEY = '__main__';
84
- exports.PRIVATE_META_DATA_KEY = '__midway_private_meta_data__';
85
- //# sourceMappingURL=constant.js.map
@@ -1,20 +0,0 @@
1
- export interface JoinPoint {
2
- methodName: string;
3
- target: any;
4
- args: any[];
5
- proceed?(...args: any[]): any;
6
- }
7
- export interface AspectMetadata {
8
- aspectTarget: any;
9
- match?: string | (() => boolean);
10
- priority?: number;
11
- }
12
- export interface IMethodAspect {
13
- after?(joinPoint: JoinPoint, result: any, error: Error): any;
14
- afterReturn?(joinPoint: JoinPoint, result: any): any;
15
- afterThrow?(joinPoint: JoinPoint, error: Error): void;
16
- before?(joinPoint: JoinPoint): void;
17
- around?(joinPoint: JoinPoint): any;
18
- }
19
- export declare function Aspect(aspectTarget: any | any[], match?: string | (() => boolean), priority?: number): (target: any) => void;
20
- //# sourceMappingURL=aspect.d.ts.map
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Aspect = void 0;
4
- const index_1 = require("../../index");
5
- const objectDef_1 = require("./objectDef");
6
- function Aspect(aspectTarget, match, priority) {
7
- return function (target) {
8
- (0, index_1.saveModule)(index_1.ASPECT_KEY, target);
9
- const aspectTargets = [].concat(aspectTarget);
10
- for (const aspectTarget of aspectTargets) {
11
- (0, index_1.attachClassMetadata)(index_1.ASPECT_KEY, {
12
- aspectTarget,
13
- match,
14
- priority,
15
- }, target);
16
- }
17
- (0, objectDef_1.Scope)(index_1.ScopeEnum.Singleton)(target);
18
- (0, index_1.Provide)()(target);
19
- };
20
- }
21
- exports.Aspect = Aspect;
22
- //# sourceMappingURL=aspect.js.map
@@ -1,2 +0,0 @@
1
- export declare function Autoload(): (target: any) => void;
2
- //# sourceMappingURL=autoload.d.ts.map
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Autoload = void 0;
4
- const decoratorManager_1 = require("../../decoratorManager");
5
- const provide_1 = require("./provide");
6
- function Autoload() {
7
- return function (target) {
8
- (0, decoratorManager_1.savePreloadModule)(target);
9
- (0, provide_1.Provide)()(target);
10
- };
11
- }
12
- exports.Autoload = Autoload;
13
- //# sourceMappingURL=autoload.js.map
@@ -1,24 +0,0 @@
1
- export interface IComponentInfo {
2
- component: any;
3
- enabledEnvironment?: string[];
4
- }
5
- export interface ResolveFilter {
6
- pattern: string | RegExp;
7
- filter: (module: any, filter: any, bindModule: any) => any;
8
- ignoreRequire?: boolean;
9
- }
10
- export interface InjectionConfigurationOptions {
11
- imports?: Array<string | IComponentInfo | {
12
- Configuration: any;
13
- }>;
14
- importObjects?: Record<string, unknown>;
15
- importConfigs?: Array<{
16
- [environmentName: string]: Record<string, any>;
17
- }> | Record<string, any>;
18
- importConfigFilter?: (config: Record<string, any>) => Record<string, any>;
19
- namespace?: string;
20
- detectorOptions?: Record<string, any>;
21
- conflictCheck?: boolean;
22
- }
23
- export declare function Configuration(options?: InjectionConfigurationOptions): ClassDecorator;
24
- //# sourceMappingURL=configuration.d.ts.map
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Configuration = void 0;
4
- const index_1 = require("../../index");
5
- function Configuration(options = {}) {
6
- return (target) => {
7
- (0, index_1.saveClassMetadata)(index_1.CONFIGURATION_KEY, options, target);
8
- };
9
- }
10
- exports.Configuration = Configuration;
11
- //# sourceMappingURL=configuration.js.map
@@ -1,6 +0,0 @@
1
- export declare function Catch(catchTarget?: any | any[], options?: {
2
- matchPrototype?: boolean;
3
- }): (target: any) => void;
4
- export declare type MatchPattern<CtxOrReq = any, Res = any> = ((ctxOrReq: CtxOrReq, res: Res) => boolean) | string | string[] | boolean;
5
- export declare function Match(matchPattern?: MatchPattern): (target: any) => void;
6
- //# sourceMappingURL=filter.d.ts.map
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Match = exports.Catch = void 0;
4
- const decoratorManager_1 = require("../../decoratorManager");
5
- const constant_1 = require("../../constant");
6
- const objectDef_1 = require("./objectDef");
7
- const interface_1 = require("../../interface");
8
- const provide_1 = require("./provide");
9
- function Catch(catchTarget, options = {}) {
10
- return function (target) {
11
- const catchTargets = catchTarget ? [].concat(catchTarget) : undefined;
12
- (0, decoratorManager_1.saveClassMetadata)(constant_1.CATCH_KEY, {
13
- catchTargets,
14
- catchOptions: options,
15
- }, target);
16
- (0, objectDef_1.Scope)(interface_1.ScopeEnum.Singleton)(target);
17
- (0, provide_1.Provide)()(target);
18
- };
19
- }
20
- exports.Catch = Catch;
21
- function Match(matchPattern = true) {
22
- return function (target) {
23
- (0, decoratorManager_1.saveClassMetadata)(constant_1.MATCH_KEY, {
24
- matchPattern,
25
- }, target);
26
- (0, objectDef_1.Scope)(interface_1.ScopeEnum.Singleton)(target);
27
- (0, provide_1.Provide)()(target);
28
- };
29
- }
30
- exports.Match = Match;
31
- //# sourceMappingURL=filter.js.map
@@ -1,2 +0,0 @@
1
- export declare function Framework(): ClassDecorator;
2
- //# sourceMappingURL=framework.d.ts.map
@@ -1,13 +0,0 @@
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,11 +0,0 @@
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 './filter';
10
- export * from './middleware';
11
- //# sourceMappingURL=index.d.ts.map
@@ -1,27 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./provide"), exports);
18
- __exportStar(require("./inject"), exports);
19
- __exportStar(require("./pipeline"), exports);
20
- __exportStar(require("./aspect"), exports);
21
- __exportStar(require("./autoload"), exports);
22
- __exportStar(require("./configuration"), exports);
23
- __exportStar(require("./objectDef"), exports);
24
- __exportStar(require("./framework"), exports);
25
- __exportStar(require("./filter"), exports);
26
- __exportStar(require("./middleware"), exports);
27
- //# sourceMappingURL=index.js.map
@@ -1,3 +0,0 @@
1
- import { ObjectIdentifier } from '../../interface';
2
- export declare function Inject(identifier?: ObjectIdentifier): (target: any, targetKey: string) => void;
3
- //# sourceMappingURL=inject.d.ts.map
@@ -1,11 +0,0 @@
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
@@ -1,2 +0,0 @@
1
- export declare function Middleware(): ClassDecorator;
2
- //# sourceMappingURL=middleware.d.ts.map
@@ -1,12 +0,0 @@
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,7 +0,0 @@
1
- import { ScopeEnum } from '../../index';
2
- export declare function Init(): MethodDecorator;
3
- export declare function Destroy(): MethodDecorator;
4
- export declare function Scope(scope: ScopeEnum, scopeOptions?: {
5
- allowDowngrade?: boolean;
6
- }): ClassDecorator;
7
- //# sourceMappingURL=objectDef.d.ts.map
@@ -1,25 +0,0 @@
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, scopeOptions) {
20
- return function (target) {
21
- (0, index_1.saveObjectDefinition)(target, { scope, ...scopeOptions });
22
- };
23
- }
24
- exports.Scope = Scope;
25
- //# sourceMappingURL=objectDef.js.map
@@ -1,3 +0,0 @@
1
- import { ObjectIdentifier } from '../../interface';
2
- export declare function Pipeline(valves?: Array<ObjectIdentifier | (new (...args: any[]) => any)>): PropertyDecorator;
3
- //# sourceMappingURL=pipeline.d.ts.map
@@ -1,11 +0,0 @@
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,3 +0,0 @@
1
- import { ObjectIdentifier } from '../../interface';
2
- export declare function Provide(identifier?: ObjectIdentifier): (target: any) => any;
3
- //# sourceMappingURL=provide.d.ts.map
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Provide = void 0;
4
- const index_1 = require("../../index");
5
- function Provide(identifier) {
6
- return function (target) {
7
- return (0, index_1.saveProviderId)(identifier, target);
8
- };
9
- }
10
- exports.Provide = Provide;
11
- //# sourceMappingURL=provide.js.map
@@ -1,13 +0,0 @@
1
- import { FaaSMetadata, ServerlessTriggerType } from '../../';
2
- export declare function ServerlessFunction(options: FaaSMetadata.ServerlessFunctionOptions): MethodDecorator;
3
- export declare function ServerlessTrigger(type: ServerlessTriggerType.HTTP, metadata: FaaSMetadata.HTTPTriggerOptions): MethodDecorator;
4
- export declare function ServerlessTrigger(type: ServerlessTriggerType.OS, metadata: FaaSMetadata.OSTriggerOptions): MethodDecorator;
5
- export declare function ServerlessTrigger(type: ServerlessTriggerType.LOG, metadata: FaaSMetadata.LogTriggerOptions): MethodDecorator;
6
- export declare function ServerlessTrigger(type: ServerlessTriggerType.TIMER, metadata: FaaSMetadata.TimerTriggerOptions): MethodDecorator;
7
- export declare function ServerlessTrigger(type: ServerlessTriggerType.MQ, metadata: FaaSMetadata.MQTriggerOptions): MethodDecorator;
8
- export declare function ServerlessTrigger(type: ServerlessTriggerType.CDN, metadata?: FaaSMetadata.CDNTriggerOptions): MethodDecorator;
9
- export declare function ServerlessTrigger(type: ServerlessTriggerType.API_GATEWAY, metadata?: FaaSMetadata.APIGatewayTriggerOptions): MethodDecorator;
10
- export declare function ServerlessTrigger(type: ServerlessTriggerType.HSF, metadata?: FaaSMetadata.HSFTriggerOptions): MethodDecorator;
11
- export declare function ServerlessTrigger(type: ServerlessTriggerType.MTOP, metadata?: FaaSMetadata.MTopTriggerOptions): MethodDecorator;
12
- export declare function ServerlessTrigger(type: ServerlessTriggerType.EVENT, metadata?: FaaSMetadata.EventTriggerOptions): MethodDecorator;
13
- //# sourceMappingURL=serverlessTrigger.d.ts.map
@@ -1,29 +0,0 @@
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
@@ -1,7 +0,0 @@
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(typeOrNamespace?: FrameworkType | string): PropertyDecorator;
5
- export declare function Logger(identifier?: string): PropertyDecorator;
6
- export declare function ApplicationContext(): PropertyDecorator;
7
- //# sourceMappingURL=index.d.ts.map
@@ -1,33 +0,0 @@
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(typeOrNamespace) {
18
- return (0, __1.createCustomPropertyDecorator)(__1.APPLICATION_KEY, {
19
- type: typeOrNamespace,
20
- });
21
- }
22
- exports.App = App;
23
- function Logger(identifier) {
24
- return (0, __1.createCustomPropertyDecorator)(__1.LOGGER_KEY, {
25
- identifier,
26
- });
27
- }
28
- exports.Logger = Logger;
29
- function ApplicationContext() {
30
- return (0, __1.createCustomPropertyDecorator)(__1.APPLICATION_CONTEXT_KEY, {});
31
- }
32
- exports.ApplicationContext = ApplicationContext;
33
- //# sourceMappingURL=index.js.map
@@ -1,21 +0,0 @@
1
- export interface CommonSchedule {
2
- exec(ctx?: any): any;
3
- }
4
- export interface ScheduleOpts {
5
- type: string;
6
- cron?: string;
7
- interval?: number | string;
8
- immediate?: boolean;
9
- disable?: boolean;
10
- env?: string[];
11
- cronOptions?: {
12
- currentDate?: string | number | Date;
13
- startDate?: string | number | Date;
14
- endDate?: string | number | Date;
15
- iterator?: boolean;
16
- utc?: boolean;
17
- tz?: string;
18
- };
19
- }
20
- export declare function Schedule(scheduleOpts: ScheduleOpts | string): (target: any) => void;
21
- //# sourceMappingURL=schedule.d.ts.map