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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/constant.d.ts +6 -5
  3. package/dist/constant.js +17 -9
  4. package/dist/{annotation → decorator/common}/aspect.d.ts +0 -0
  5. package/dist/{annotation → decorator/common}/aspect.js +5 -4
  6. package/dist/{annotation → decorator/common}/autoload.d.ts +0 -0
  7. package/dist/{annotation → decorator/common}/autoload.js +3 -1
  8. package/dist/decorator/common/catch.d.ts +2 -0
  9. package/dist/decorator/common/catch.js +20 -0
  10. package/dist/{annotation → decorator/common}/configuration.d.ts +0 -0
  11. package/dist/{annotation → decorator/common}/configuration.js +2 -2
  12. package/dist/{annotation → decorator/common}/decide.d.ts +0 -0
  13. package/dist/{annotation → decorator/common}/decide.js +0 -0
  14. package/dist/decorator/common/framework.d.ts +2 -0
  15. package/dist/decorator/common/framework.js +13 -0
  16. package/dist/{annotation → decorator/common}/index.d.ts +6 -8
  17. package/dist/{annotation → decorator/common}/index.js +6 -10
  18. package/dist/decorator/common/inject.d.ts +3 -0
  19. package/dist/decorator/common/inject.js +11 -0
  20. package/dist/decorator/common/middleware.d.ts +2 -0
  21. package/dist/decorator/common/middleware.js +12 -0
  22. package/dist/decorator/common/objectDef.d.ts +5 -0
  23. package/dist/decorator/common/objectDef.js +25 -0
  24. package/dist/decorator/common/pipeline.d.ts +3 -0
  25. package/dist/decorator/common/pipeline.js +11 -0
  26. package/dist/decorator/common/provide.d.ts +3 -0
  27. package/dist/{annotation → decorator/common}/provide.js +2 -2
  28. package/dist/{faas/fun.d.ts → decorator/faas/serverlessTrigger.d.ts} +2 -14
  29. package/dist/decorator/faas/serverlessTrigger.js +29 -0
  30. package/dist/decorator/framework/index.d.ts +7 -0
  31. package/dist/decorator/framework/index.js +33 -0
  32. package/dist/{annotation → decorator/framework}/schedule.d.ts +0 -0
  33. package/dist/{annotation → decorator/framework}/schedule.js +3 -2
  34. package/dist/decorator/index.d.ts +18 -0
  35. package/dist/decorator/index.js +38 -0
  36. package/dist/{microservice → decorator/microservice}/consumer.d.ts +1 -1
  37. package/dist/{microservice → decorator/microservice}/consumer.js +3 -3
  38. package/dist/{microservice → decorator/microservice}/provider.d.ts +1 -1
  39. package/dist/{microservice → decorator/microservice}/provider.js +4 -3
  40. package/dist/{microservice → decorator/microservice}/rabbitmqListener.d.ts +0 -0
  41. package/dist/{microservice → decorator/microservice}/rabbitmqListener.js +1 -1
  42. package/dist/{rpc → decorator/rpc}/hsf.d.ts +0 -0
  43. package/dist/{rpc → decorator/rpc}/hsf.js +4 -3
  44. package/dist/decorator/task/queue.d.ts +2 -0
  45. package/dist/{annotation → decorator/task}/queue.js +3 -2
  46. package/dist/{annotation → decorator/task}/task.d.ts +0 -0
  47. package/dist/{annotation → decorator/task}/task.js +2 -2
  48. package/dist/{annotation → decorator/task}/taskLocal.d.ts +0 -0
  49. package/dist/{annotation → decorator/task}/taskLocal.js +2 -2
  50. package/dist/{web → decorator/web}/controller.d.ts +1 -1
  51. package/dist/{web → decorator/web}/controller.js +4 -3
  52. package/dist/{web → decorator/web}/paramMapping.d.ts +10 -10
  53. package/dist/{web → decorator/web}/paramMapping.js +4 -8
  54. package/dist/{web → decorator/web}/requestMapping.d.ts +1 -1
  55. package/dist/{web → decorator/web}/requestMapping.js +1 -1
  56. package/dist/{web → decorator/web}/response.d.ts +0 -0
  57. package/dist/{web → decorator/web}/response.js +1 -1
  58. package/dist/{ws → decorator/ws}/webSocketController.d.ts +1 -1
  59. package/dist/{ws → decorator/ws}/webSocketController.js +4 -3
  60. package/dist/{ws → decorator/ws}/webSocketEvent.d.ts +0 -0
  61. package/dist/{ws → decorator/ws}/webSocketEvent.js +1 -1
  62. package/dist/decoratorManager.d.ts +283 -0
  63. package/dist/{common/decoratorManager.js → decoratorManager.js} +227 -311
  64. package/dist/index.d.ts +2 -22
  65. package/dist/index.js +2 -22
  66. package/dist/interface.d.ts +40 -23
  67. package/dist/interface.js +31 -17
  68. package/dist/util/index.d.ts +5 -0
  69. package/dist/util/index.js +27 -1
  70. package/package.json +3 -6
  71. package/dist/annotation/inject.d.ts +0 -3
  72. package/dist/annotation/inject.js +0 -16
  73. package/dist/annotation/objectDef.d.ts +0 -7
  74. package/dist/annotation/objectDef.js +0 -43
  75. package/dist/annotation/pipeline.d.ts +0 -3
  76. package/dist/annotation/pipeline.js +0 -27
  77. package/dist/annotation/priority.d.ts +0 -2
  78. package/dist/annotation/priority.js +0 -11
  79. package/dist/annotation/provide.d.ts +0 -3
  80. package/dist/annotation/queue.d.ts +0 -2
  81. package/dist/annotation/rule.d.ts +0 -1
  82. package/dist/annotation/rule.js +0 -58
  83. package/dist/annotation/validate.d.ts +0 -1
  84. package/dist/annotation/validate.js +0 -36
  85. package/dist/common/decoratorManager.d.ts +0 -324
  86. package/dist/common/errMsg.d.ts +0 -4
  87. package/dist/common/errMsg.js +0 -8
  88. package/dist/common/metadata.d.ts +0 -9
  89. package/dist/common/metadata.js +0 -20
  90. package/dist/common/scopeEnum.d.ts +0 -6
  91. package/dist/common/scopeEnum.js +0 -10
  92. package/dist/faas/fun.js +0 -62
  93. package/dist/faas/handler.d.ts +0 -3
  94. package/dist/faas/handler.js +0 -21
  95. package/dist/framework/app.d.ts +0 -3
  96. package/dist/framework/app.js +0 -22
  97. package/dist/framework/config.d.ts +0 -2
  98. package/dist/framework/config.js +0 -25
  99. package/dist/framework/logger.d.ts +0 -2
  100. package/dist/framework/logger.js +0 -22
  101. package/dist/framework/plugin.d.ts +0 -2
  102. package/dist/framework/plugin.js +0 -22
  103. package/dist/util/dtoHelper.d.ts +0 -6
  104. package/dist/util/dtoHelper.js +0 -32
@@ -1,324 +0,0 @@
1
- import 'reflect-metadata';
2
- import { ObjectDefinitionOptions, ObjectIdentifier, TagPropsMetadata } from '../interface';
3
- export declare type DecoratorKey = string | symbol;
4
- export declare const PRELOAD_MODULE_KEY = "INJECTION_PRELOAD_MODULE_KEY";
5
- export declare const INJECT_CLASS_KEY_PREFIX = "INJECTION_CLASS_META_DATA";
6
- export declare class DecoratorManager extends Map {
7
- /**
8
- * the key for meta data store in class
9
- */
10
- injectClassKeyPrefix: string;
11
- /**
12
- * the key for method meta data store in class
13
- */
14
- injectClassMethodKeyPrefix: string;
15
- /**
16
- * the key for method meta data store in method
17
- */
18
- injectMethodKeyPrefix: string;
19
- saveModule(key: any, module: any): void;
20
- resetModule(key: any): void;
21
- static getDecoratorClassKey(decoratorNameKey: DecoratorKey): string;
22
- static removeDecoratorClassKeySuffix(decoratorNameKey: DecoratorKey): string;
23
- static getDecoratorMethodKey(decoratorNameKey: DecoratorKey): string;
24
- static getDecoratorClsExtendedKey(decoratorNameKey: DecoratorKey): string;
25
- static getDecoratorClsMethodPrefix(decoratorNameKey: DecoratorKey): string;
26
- static getDecoratorClsMethodKey(decoratorNameKey: DecoratorKey, methodKey: DecoratorKey): string;
27
- static getDecoratorMethod(decoratorNameKey: DecoratorKey, methodKey: DecoratorKey): string;
28
- listModule(key: any): unknown[];
29
- static saveMetadata(metaKey: string, target: any, dataKey: string, data: any): void;
30
- static attachMetadata(metaKey: string, target: any, dataKey: string, data: any, groupBy?: string): void;
31
- static getMetadata(metaKey: string, target: any, dataKey?: string): any;
32
- /**
33
- * save meta data to class or property
34
- * @param decoratorNameKey the alias name for decorator
35
- * @param data the data you want to store
36
- * @param target target class
37
- * @param propertyName
38
- */
39
- saveMetadata(decoratorNameKey: DecoratorKey, data: any, target: any, propertyName?: any): void;
40
- /**
41
- * attach data to class or property
42
- * @param decoratorNameKey
43
- * @param data
44
- * @param target
45
- * @param propertyName
46
- */
47
- attachMetadata(decoratorNameKey: DecoratorKey, data: any, target: any, propertyName?: string, groupBy?: string): void;
48
- /**
49
- * get single data from class or property
50
- * @param decoratorNameKey
51
- * @param target
52
- * @param propertyName
53
- */
54
- getMetadata(decoratorNameKey: DecoratorKey, target: any, propertyName?: any): any;
55
- /**
56
- * save property data to class
57
- * @param decoratorNameKey
58
- * @param data
59
- * @param target
60
- * @param propertyName
61
- */
62
- savePropertyDataToClass(decoratorNameKey: DecoratorKey, data: any, target: any, propertyName: any): void;
63
- /**
64
- * attach property data to class
65
- * @param decoratorNameKey
66
- * @param data
67
- * @param target
68
- * @param propertyName
69
- * @param groupBy
70
- */
71
- attachPropertyDataToClass(decoratorNameKey: DecoratorKey, data: any, target: any, propertyName: any, groupBy?: string): void;
72
- /**
73
- * get property data from class
74
- * @param decoratorNameKey
75
- * @param target
76
- * @param propertyName
77
- */
78
- getPropertyDataFromClass(decoratorNameKey: DecoratorKey, target: any, propertyName: any): any;
79
- /**
80
- * list property data from class
81
- * @param decoratorNameKey
82
- * @param target
83
- */
84
- listPropertyDataFromClass(decoratorNameKey: DecoratorKey, target: any): any[];
85
- }
86
- /**
87
- * save data to class
88
- * @param decoratorNameKey
89
- * @param data
90
- * @param target
91
- */
92
- export declare function saveClassMetadata(decoratorNameKey: DecoratorKey, data: any, target: any): void;
93
- /**
94
- * attach data to class
95
- * @param decoratorNameKey
96
- * @param data
97
- * @param target
98
- * @param groupBy
99
- */
100
- export declare function attachClassMetadata(decoratorNameKey: DecoratorKey, data: any, target: any, groupBy?: string): void;
101
- /**
102
- * get data from class assign
103
- * @param decoratorNameKey
104
- * @param target
105
- */
106
- export declare function getClassExtendedMetadata(decoratorNameKey: DecoratorKey, target: any): any;
107
- /**
108
- * get data from class
109
- * @param decoratorNameKey
110
- * @param target
111
- */
112
- export declare function getClassMetadata(decoratorNameKey: DecoratorKey, target: any): any;
113
- /**
114
- * this method has deprecated and use savePropertyDataToClass instead
115
- *
116
- * @deprecated
117
- * @param decoratorNameKey
118
- * @param data
119
- * @param target
120
- * @param method
121
- */
122
- export declare function saveMethodDataToClass(decoratorNameKey: DecoratorKey, data: any, target: any, method: any): void;
123
- /**
124
- * this method has deprecated and use attachPropertyDataToClass instead
125
- *
126
- * @deprecated
127
- * @param decoratorNameKey
128
- * @param data
129
- * @param target
130
- * @param method
131
- */
132
- export declare function attachMethodDataToClass(decoratorNameKey: DecoratorKey, data: any, target: any, method: any): void;
133
- /**
134
- * this method has deprecated and use getPropertyDataFromClass instead
135
- *
136
- * @deprecated
137
- * @param decoratorNameKey
138
- * @param target
139
- * @param method
140
- */
141
- export declare function getMethodDataFromClass(decoratorNameKey: DecoratorKey, target: any, method: any): any;
142
- /**
143
- * list method data from class
144
- * @deprecated
145
- * @param decoratorNameKey
146
- * @param target
147
- */
148
- export declare function listMethodDataFromClass(decoratorNameKey: DecoratorKey, target: any): any[];
149
- /**
150
- * save method data
151
- * @deprecated
152
- * @param decoratorNameKey
153
- * @param data
154
- * @param target
155
- * @param method
156
- */
157
- export declare function saveMethodMetadata(decoratorNameKey: DecoratorKey, data: any, target: any, method: any): void;
158
- /**
159
- * attach method data
160
- * @deprecated
161
- * @param decoratorNameKey
162
- * @param data
163
- * @param target
164
- * @param method
165
- */
166
- export declare function attachMethodMetadata(decoratorNameKey: DecoratorKey, data: any, target: any, method: any): void;
167
- /**
168
- * get method data
169
- * @deprecated
170
- * @param decoratorNameKey
171
- * @param target
172
- * @param method
173
- */
174
- export declare function getMethodMetadata(decoratorNameKey: DecoratorKey, target: any, method: any): any;
175
- /**
176
- * save property data to class
177
- * @param decoratorNameKey
178
- * @param data
179
- * @param target
180
- * @param propertyName
181
- */
182
- export declare function savePropertyDataToClass(decoratorNameKey: DecoratorKey, data: any, target: any, propertyName: any): void;
183
- /**
184
- * attach property data to class
185
- * @param decoratorNameKey
186
- * @param data
187
- * @param target
188
- * @param propertyName
189
- * @param groupBy
190
- */
191
- export declare function attachPropertyDataToClass(decoratorNameKey: DecoratorKey, data: any, target: any, propertyName: any, groupBy?: string): void;
192
- /**
193
- * get property data from class
194
- * @param decoratorNameKey
195
- * @param target
196
- * @param propertyName
197
- */
198
- export declare function getPropertyDataFromClass(decoratorNameKey: DecoratorKey, target: any, propertyName: any): any;
199
- /**
200
- * list property data from class
201
- * @param decoratorNameKey
202
- * @param target
203
- */
204
- export declare function listPropertyDataFromClass(decoratorNameKey: DecoratorKey, target: any): any[];
205
- /**
206
- * save property data
207
- * @param decoratorNameKey
208
- * @param data
209
- * @param target
210
- * @param propertyName
211
- */
212
- export declare function savePropertyMetadata(decoratorNameKey: DecoratorKey, data: any, target: any, propertyName: any): void;
213
- /**
214
- * attach property data
215
- * @param decoratorNameKey
216
- * @param data
217
- * @param target
218
- * @param propertyName
219
- */
220
- export declare function attachPropertyMetadata(decoratorNameKey: DecoratorKey, data: any, target: any, propertyName: any): void;
221
- /**
222
- * get property data
223
- * @param decoratorNameKey
224
- * @param target
225
- * @param propertyName
226
- */
227
- export declare function getPropertyMetadata(decoratorNameKey: DecoratorKey, target: any, propertyName: any): any;
228
- /**
229
- * save preload module by target
230
- * @param target
231
- */
232
- export declare function savePreloadModule(target: any): void;
233
- /**
234
- * list preload module
235
- */
236
- export declare function listPreloadModule(): any[];
237
- /**
238
- * save module to inner map
239
- * @param decoratorNameKey
240
- * @param target
241
- */
242
- export declare function saveModule(decoratorNameKey: DecoratorKey, target: any): void;
243
- /**
244
- * list module from decorator key
245
- * @param decoratorNameKey
246
- */
247
- export declare function listModule(decoratorNameKey: DecoratorKey, filter?: (module: any) => boolean): any[];
248
- /**
249
- * reset module
250
- * @param decoratorNameKey
251
- */
252
- export declare function resetModule(decoratorNameKey: DecoratorKey): void;
253
- /**
254
- * clear all module
255
- */
256
- export declare function clearAllModule(): void;
257
- /**
258
- * get provider id from module
259
- * @param module
260
- */
261
- export declare function getProviderId(module: any): string;
262
- /**
263
- * 生成带 namespace 的 provideId
264
- * @param provideId provideId
265
- * @param namespace namespace
266
- */
267
- export declare function generateProvideId(provideId: string, namespace?: string): string;
268
- /**
269
- * get object definition metadata
270
- * @param module
271
- */
272
- export declare function getObjectDefinition(module: any): ObjectDefinitionOptions;
273
- export interface TSDesignType {
274
- name: string;
275
- originDesign: any;
276
- isBaseType: boolean;
277
- }
278
- /**
279
- * get parameters type by reflect-metadata
280
- */
281
- export declare function getMethodParamTypes(target: any, propertyKey: string | symbol): any;
282
- export declare function getPropertyType(target: any, propertyKey: string | symbol): TSDesignType;
283
- export declare function getMethodReturnTypes(target: any, propertyKey: string | symbol): any;
284
- export declare function attachConstructorDataOnClass(identifier: any, clz: any, type: any, index: any): void;
285
- interface InjectOptions {
286
- identifier: ObjectIdentifier;
287
- target: any;
288
- targetKey: string;
289
- index?: number;
290
- args?: any;
291
- }
292
- /**
293
- * 构造器注入
294
- * @param opts 参数
295
- */
296
- export declare function saveConstructorInject(opts: InjectOptions): void;
297
- export declare function getConstructorInject(target: any): TagPropsMetadata[];
298
- /**
299
- * 属性注入
300
- * @param opts 参数
301
- */
302
- export declare function savePropertyInject(opts: InjectOptions): void;
303
- export declare function getPropertyInject(target: any): TagPropsMetadata[];
304
- /**
305
- * class 元数据定义
306
- * @param target class
307
- * @param props 属性
308
- */
309
- export declare function saveObjectDefProps(target: any, props?: {}): any;
310
- export declare function getObjectDefProps(target: any): ObjectDefinitionOptions;
311
- /**
312
- * class provider id
313
- * @param identifier id
314
- * @param target class
315
- * @param override 是否覆盖
316
- */
317
- export declare function saveProviderId(identifier: ObjectIdentifier, target: any, override?: boolean): any;
318
- /**
319
- * 是否使用了 saveProviderId
320
- * @param target class
321
- */
322
- export declare function isProvide(target: any): boolean;
323
- export {};
324
- //# sourceMappingURL=decoratorManager.d.ts.map
@@ -1,4 +0,0 @@
1
- export declare const DUPLICATED_INJECTABLE_DECORATOR = "Cannot apply @injectable decorator multiple times.";
2
- export declare const DUPLICATED_METADATA = "Metadata key was used more than once in a parameter:";
3
- export declare const INVALID_DECORATOR_OPERATION: string;
4
- //# sourceMappingURL=errMsg.d.ts.map
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.INVALID_DECORATOR_OPERATION = exports.DUPLICATED_METADATA = exports.DUPLICATED_INJECTABLE_DECORATOR = void 0;
4
- exports.DUPLICATED_INJECTABLE_DECORATOR = 'Cannot apply @injectable decorator multiple times.';
5
- exports.DUPLICATED_METADATA = 'Metadata key was used more than once in a parameter:';
6
- exports.INVALID_DECORATOR_OPERATION = 'The @inject @multiInject @tagged and @named decorators ' +
7
- 'must be applied to the parameters of a class constructor or a class property.';
8
- //# sourceMappingURL=errMsg.js.map
@@ -1,9 +0,0 @@
1
- import { TagPropsMetadata } from '../interface';
2
- export declare class Metadata implements TagPropsMetadata {
3
- key: string | number | symbol;
4
- value: any;
5
- args?: any;
6
- constructor(key: string | number | symbol, value: any);
7
- toString(): string;
8
- }
9
- //# sourceMappingURL=metadata.d.ts.map
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Metadata = void 0;
4
- const constant_1 = require("../constant");
5
- class Metadata {
6
- constructor(key, value) {
7
- this.key = key;
8
- this.value = value;
9
- }
10
- toString() {
11
- if (this.key === constant_1.NAMED_TAG) {
12
- return `named: ${this.value.toString()} `;
13
- }
14
- else {
15
- return `tagged: { key:${this.key.toString()}, value: ${this.value} }`;
16
- }
17
- }
18
- }
19
- exports.Metadata = Metadata;
20
- //# sourceMappingURL=metadata.js.map
@@ -1,6 +0,0 @@
1
- export declare enum ScopeEnum {
2
- Singleton = "Singleton",
3
- Request = "Request",
4
- Prototype = "Prototype"
5
- }
6
- //# sourceMappingURL=scopeEnum.d.ts.map
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ScopeEnum = void 0;
4
- var ScopeEnum;
5
- (function (ScopeEnum) {
6
- ScopeEnum["Singleton"] = "Singleton";
7
- ScopeEnum["Request"] = "Request";
8
- ScopeEnum["Prototype"] = "Prototype";
9
- })(ScopeEnum = exports.ScopeEnum || (exports.ScopeEnum = {}));
10
- //# sourceMappingURL=scopeEnum.js.map
package/dist/faas/fun.js DELETED
@@ -1,62 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ServerlessTrigger = exports.ServerlessFunction = exports.Func = void 0;
4
- const annotation_1 = require("../annotation");
5
- const __1 = require("..");
6
- function Func(funHandler, functionOptions) {
7
- if (typeof funHandler !== 'string' && functionOptions === undefined) {
8
- functionOptions = funHandler;
9
- funHandler = functionOptions.funHandler || '';
10
- }
11
- return (...args) => {
12
- const [target, key, descriptor] = args;
13
- // If target is function, @Func annotate class
14
- if (typeof target === 'function') {
15
- // save target
16
- (0, __1.saveModule)(__1.FUNC_KEY, target);
17
- (0, __1.attachClassMetadata)(__1.FUNC_KEY, Object.assign({ funHandler }, functionOptions), target);
18
- // register data
19
- (0, annotation_1.Scope)(__1.ScopeEnum.Request)(target);
20
- }
21
- else {
22
- // If target is instance, @Func annotate class member method
23
- (0, __1.saveModule)(__1.FUNC_KEY, target.constructor);
24
- (0, __1.attachClassMetadata)(__1.FUNC_KEY, Object.assign({
25
- funHandler,
26
- key,
27
- descriptor,
28
- }, functionOptions), target.constructor);
29
- }
30
- };
31
- }
32
- exports.Func = Func;
33
- function ServerlessFunction(options) {
34
- return (target, key, descriptor) => {
35
- (0, __1.savePropertyMetadata)(__1.SERVERLESS_FUNC_KEY, options, target, key);
36
- };
37
- }
38
- exports.ServerlessFunction = ServerlessFunction;
39
- function ServerlessTrigger(type, metadata = {}) {
40
- return (target, functionName, descriptor) => {
41
- var _a, _b;
42
- if (type === __1.ServerlessTriggerType.HTTP ||
43
- type === __1.ServerlessTriggerType.API_GATEWAY) {
44
- metadata['method'] = (_a = metadata['method']) !== null && _a !== void 0 ? _a : 'get';
45
- }
46
- metadata['functionName'] =
47
- (_b = metadata['functionName']) !== null && _b !== void 0 ? _b : (0, __1.getProviderId)(target.constructor).replace(/[:#]/g, '-') +
48
- '-' +
49
- functionName;
50
- (0, __1.saveModule)(__1.FUNC_KEY, target.constructor);
51
- // new method decorator
52
- metadata = metadata || {};
53
- (0, __1.attachClassMetadata)(__1.FUNC_KEY, {
54
- type,
55
- methodName: functionName,
56
- functionName: metadata.functionName,
57
- metadata,
58
- }, target.constructor);
59
- };
60
- }
61
- exports.ServerlessTrigger = ServerlessTrigger;
62
- //# sourceMappingURL=fun.js.map
@@ -1,3 +0,0 @@
1
- import { FuncParams } from './fun';
2
- export declare function Handler(funHandler: string | FuncParams, functionOptions?: FuncParams): MethodDecorator;
3
- //# sourceMappingURL=handler.d.ts.map
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Handler = void 0;
4
- const __1 = require("../");
5
- function Handler(funHandler, functionOptions) {
6
- if (typeof funHandler !== 'string' && functionOptions === undefined) {
7
- functionOptions = funHandler;
8
- funHandler = functionOptions.funHandler;
9
- }
10
- return (target, propertyKey, descriptor) => {
11
- // If target is instance, @Func annotate class member method
12
- (0, __1.saveModule)(__1.FUNC_KEY, target.constructor);
13
- (0, __1.attachClassMetadata)(__1.FUNC_KEY, Object.assign({
14
- funHandler,
15
- key: propertyKey,
16
- descriptor,
17
- }, functionOptions), target.constructor);
18
- };
19
- }
20
- exports.Handler = Handler;
21
- //# sourceMappingURL=handler.js.map
@@ -1,3 +0,0 @@
1
- import { MidwayFrameworkType } from '../';
2
- export declare function App(type?: MidwayFrameworkType): (target: any, targetKey: string, index?: number) => void;
3
- //# sourceMappingURL=app.d.ts.map
@@ -1,22 +0,0 @@
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, index) {
7
- if (typeof index === 'number') {
8
- (0, __1.attachConstructorDataOnClass)(targetKey, target, __1.APPLICATION_KEY, index);
9
- }
10
- else {
11
- (0, __1.attachClassMetadata)(__1.APPLICATION_KEY, {
12
- key: __1.APPLICATION_KEY,
13
- propertyName: targetKey,
14
- meta: {
15
- type,
16
- },
17
- }, target);
18
- }
19
- };
20
- }
21
- exports.App = App;
22
- //# sourceMappingURL=app.js.map
@@ -1,2 +0,0 @@
1
- export declare function Config(identifier?: string): (target: any, targetKey: string, index?: number) => void;
2
- //# sourceMappingURL=config.d.ts.map
@@ -1,25 +0,0 @@
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, index) {
7
- if (typeof index === 'number') {
8
- (0, __1.attachConstructorDataOnClass)(identifier, target, __1.CONFIG_KEY, index);
9
- }
10
- else {
11
- if (!identifier) {
12
- identifier = targetKey;
13
- }
14
- if (identifier === __1.ALL) {
15
- identifier = '';
16
- }
17
- (0, __1.attachClassMetadata)(__1.CONFIG_KEY, {
18
- key: identifier,
19
- propertyName: targetKey,
20
- }, target);
21
- }
22
- };
23
- }
24
- exports.Config = Config;
25
- //# sourceMappingURL=config.js.map
@@ -1,2 +0,0 @@
1
- export declare function Logger(identifier?: string): (target: any, targetKey: string, index?: number) => void;
2
- //# sourceMappingURL=logger.d.ts.map
@@ -1,22 +0,0 @@
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, index) {
7
- if (typeof index === 'number') {
8
- (0, __1.attachConstructorDataOnClass)(identifier, target, __1.LOGGER_KEY, index);
9
- }
10
- else {
11
- if (!identifier) {
12
- identifier = targetKey;
13
- }
14
- (0, __1.attachClassMetadata)(__1.LOGGER_KEY, {
15
- key: identifier,
16
- propertyName: targetKey,
17
- }, target);
18
- }
19
- };
20
- }
21
- exports.Logger = Logger;
22
- //# sourceMappingURL=logger.js.map
@@ -1,2 +0,0 @@
1
- export declare function Plugin(identifier?: string): (target: any, targetKey: string, index?: number) => void;
2
- //# sourceMappingURL=plugin.d.ts.map
@@ -1,22 +0,0 @@
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, index) {
7
- if (typeof index === 'number') {
8
- (0, __1.attachConstructorDataOnClass)(identifier, target, __1.PLUGIN_KEY, index);
9
- }
10
- else {
11
- if (!identifier) {
12
- identifier = targetKey;
13
- }
14
- (0, __1.attachClassMetadata)(__1.PLUGIN_KEY, {
15
- key: identifier,
16
- propertyName: targetKey,
17
- }, target);
18
- }
19
- };
20
- }
21
- exports.Plugin = Plugin;
22
- //# sourceMappingURL=plugin.js.map
@@ -1,6 +0,0 @@
1
- export interface Dto<T> extends Function {
2
- new (): T;
3
- }
4
- export declare function PickDto<T, K extends keyof T>(dto: Dto<T>, keys: K[]): Dto<Pick<T, typeof keys[number]>>;
5
- export declare function OmitDto<T, K extends keyof T>(dto: Dto<T>, keys: K[]): Dto<Omit<T, typeof keys[number]>>;
6
- //# sourceMappingURL=dtoHelper.d.ts.map
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OmitDto = exports.PickDto = void 0;
4
- const decoratorManager_1 = require("../common/decoratorManager");
5
- const constant_1 = require("../constant");
6
- function PickDto(dto, keys) {
7
- const pickedDto = function () { };
8
- pickedDto.prototype = dto.prototype;
9
- const fatherRule = (0, decoratorManager_1.getClassExtendedMetadata)(constant_1.RULES_KEY, dto);
10
- const pickedRule = {};
11
- for (const key of keys) {
12
- if (fatherRule[key]) {
13
- pickedRule[key] = fatherRule[key];
14
- }
15
- }
16
- (0, decoratorManager_1.saveClassMetadata)(constant_1.RULES_KEY, pickedRule, pickedDto);
17
- return pickedDto;
18
- }
19
- exports.PickDto = PickDto;
20
- function OmitDto(dto, keys) {
21
- const pickedDto = function () { };
22
- pickedDto.prototype = dto.prototype;
23
- const fatherRule = (0, decoratorManager_1.getClassExtendedMetadata)(constant_1.RULES_KEY, dto);
24
- const pickedRule = Object.assign({}, fatherRule);
25
- for (const key of keys) {
26
- delete pickedRule[key];
27
- }
28
- (0, decoratorManager_1.saveClassMetadata)(constant_1.RULES_KEY, pickedRule, pickedDto);
29
- return pickedDto;
30
- }
31
- exports.OmitDto = OmitDto;
32
- //# sourceMappingURL=dtoHelper.js.map