@midwayjs/decorator 3.4.11 → 3.7.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.
- package/dist/index.d.ts +3 -7
- package/dist/index.js +14 -12
- package/package.json +3 -3
- package/dist/constant.d.ts +0 -54
- package/dist/constant.js +0 -85
- package/dist/decorator/common/aspect.d.ts +0 -20
- package/dist/decorator/common/aspect.js +0 -22
- package/dist/decorator/common/autoload.d.ts +0 -2
- package/dist/decorator/common/autoload.js +0 -13
- package/dist/decorator/common/configuration.d.ts +0 -24
- package/dist/decorator/common/configuration.js +0 -11
- package/dist/decorator/common/filter.d.ts +0 -6
- package/dist/decorator/common/filter.js +0 -31
- package/dist/decorator/common/framework.d.ts +0 -2
- package/dist/decorator/common/framework.js +0 -13
- package/dist/decorator/common/index.d.ts +0 -11
- package/dist/decorator/common/index.js +0 -27
- package/dist/decorator/common/inject.d.ts +0 -3
- package/dist/decorator/common/inject.js +0 -11
- package/dist/decorator/common/middleware.d.ts +0 -2
- package/dist/decorator/common/middleware.js +0 -12
- package/dist/decorator/common/objectDef.d.ts +0 -7
- package/dist/decorator/common/objectDef.js +0 -25
- package/dist/decorator/common/pipeline.d.ts +0 -3
- package/dist/decorator/common/pipeline.js +0 -11
- package/dist/decorator/common/provide.d.ts +0 -3
- package/dist/decorator/common/provide.js +0 -11
- package/dist/decorator/faas/serverlessTrigger.d.ts +0 -13
- package/dist/decorator/faas/serverlessTrigger.js +0 -29
- package/dist/decorator/framework/index.d.ts +0 -7
- package/dist/decorator/framework/index.js +0 -33
- package/dist/decorator/framework/schedule.d.ts +0 -21
- package/dist/decorator/framework/schedule.js +0 -15
- package/dist/decorator/index.d.ts +0 -19
- package/dist/decorator/index.js +0 -43
- package/dist/decorator/microservice/consumer.d.ts +0 -5
- package/dist/decorator/microservice/consumer.js +0 -18
- package/dist/decorator/microservice/kafkaListener.d.ts +0 -24
- package/dist/decorator/microservice/kafkaListener.js +0 -13
- package/dist/decorator/microservice/provider.d.ts +0 -16
- package/dist/decorator/microservice/provider.js +0 -48
- package/dist/decorator/microservice/rabbitmqListener.d.ts +0 -50
- package/dist/decorator/microservice/rabbitmqListener.js +0 -13
- package/dist/decorator/rpc/hsf.d.ts +0 -12
- package/dist/decorator/rpc/hsf.js +0 -19
- package/dist/decorator/task/queue.d.ts +0 -2
- package/dist/decorator/task/queue.js +0 -17
- package/dist/decorator/task/task.d.ts +0 -2
- package/dist/decorator/task/task.js +0 -18
- package/dist/decorator/task/taskLocal.d.ts +0 -2
- package/dist/decorator/task/taskLocal.js +0 -17
- package/dist/decorator/web/controller.d.ts +0 -20
- package/dist/decorator/web/controller.js +0 -19
- package/dist/decorator/web/paramMapping.d.ts +0 -31
- package/dist/decorator/web/paramMapping.js +0 -50
- package/dist/decorator/web/requestMapping.d.ts +0 -129
- package/dist/decorator/web/requestMapping.js +0 -83
- package/dist/decorator/web/response.d.ts +0 -9
- package/dist/decorator/web/response.js +0 -65
- package/dist/decorator/ws/webSocketController.d.ts +0 -10
- package/dist/decorator/ws/webSocketController.js +0 -21
- package/dist/decorator/ws/webSocketEvent.d.ts +0 -60
- package/dist/decorator/ws/webSocketEvent.js +0 -87
- package/dist/decoratorManager.d.ts +0 -301
- package/dist/decoratorManager.js +0 -708
- package/dist/interface.d.ts +0 -238
- package/dist/interface.js +0 -67
- package/dist/util/camelCase.d.ts +0 -3
- package/dist/util/camelCase.js +0 -88
- package/dist/util/flatted.d.ts +0 -7
- package/dist/util/flatted.js +0 -91
- package/dist/util/format.d.ts +0 -25
- package/dist/util/format.js +0 -38
- package/dist/util/fs.d.ts +0 -5
- package/dist/util/fs.js +0 -15
- package/dist/util/index.d.ts +0 -62
- package/dist/util/index.js +0 -200
- package/dist/util/uuid.d.ts +0 -5
- package/dist/util/uuid.js +0 -64
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.All = exports.Head = exports.Options = exports.Patch = exports.Put = exports.Del = exports.Get = exports.Post = exports.RequestMapping = exports.RequestMethod = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* 'HEAD', 'OPTIONS', 'GET', 'PUT', 'PATCH', 'POST', 'DELETE' 封装
|
|
6
|
-
*/
|
|
7
|
-
const __1 = require("../../");
|
|
8
|
-
exports.RequestMethod = {
|
|
9
|
-
GET: 'get',
|
|
10
|
-
POST: 'post',
|
|
11
|
-
PUT: 'put',
|
|
12
|
-
DELETE: 'delete',
|
|
13
|
-
PATCH: 'patch',
|
|
14
|
-
ALL: 'all',
|
|
15
|
-
OPTIONS: 'options',
|
|
16
|
-
HEAD: 'head',
|
|
17
|
-
};
|
|
18
|
-
const defaultMetadata = {
|
|
19
|
-
path: '/',
|
|
20
|
-
requestMethod: exports.RequestMethod.GET,
|
|
21
|
-
routerName: null,
|
|
22
|
-
middleware: [],
|
|
23
|
-
};
|
|
24
|
-
const RequestMapping = (metadata = defaultMetadata) => {
|
|
25
|
-
const path = metadata.path || '/';
|
|
26
|
-
const requestMethod = metadata.requestMethod || exports.RequestMethod.GET;
|
|
27
|
-
const routerName = metadata.routerName;
|
|
28
|
-
const middleware = metadata.middleware;
|
|
29
|
-
return (target, key, descriptor) => {
|
|
30
|
-
var _a;
|
|
31
|
-
(0, __1.attachClassMetadata)(__1.WEB_ROUTER_KEY, {
|
|
32
|
-
path,
|
|
33
|
-
requestMethod,
|
|
34
|
-
routerName,
|
|
35
|
-
method: key,
|
|
36
|
-
middleware,
|
|
37
|
-
summary: (metadata === null || metadata === void 0 ? void 0 : metadata.summary) || '',
|
|
38
|
-
description: (metadata === null || metadata === void 0 ? void 0 : metadata.description) || '',
|
|
39
|
-
ignoreGlobalPrefix: (_a = metadata === null || metadata === void 0 ? void 0 : metadata.ignoreGlobalPrefix) !== null && _a !== void 0 ? _a : false,
|
|
40
|
-
}, target);
|
|
41
|
-
return descriptor;
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
exports.RequestMapping = RequestMapping;
|
|
45
|
-
const createMappingDecorator = (method) => (path, routerOptions = { middleware: [] }) => {
|
|
46
|
-
return (0, exports.RequestMapping)(Object.assign(routerOptions, {
|
|
47
|
-
requestMethod: method,
|
|
48
|
-
path,
|
|
49
|
-
}));
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* Routes HTTP POST requests to the specified path.
|
|
53
|
-
*/
|
|
54
|
-
exports.Post = createMappingDecorator(exports.RequestMethod.POST);
|
|
55
|
-
/**
|
|
56
|
-
* Routes HTTP GET requests to the specified path.
|
|
57
|
-
*/
|
|
58
|
-
exports.Get = createMappingDecorator(exports.RequestMethod.GET);
|
|
59
|
-
/**
|
|
60
|
-
* Routes HTTP DELETE requests to the specified path.
|
|
61
|
-
*/
|
|
62
|
-
exports.Del = createMappingDecorator(exports.RequestMethod.DELETE);
|
|
63
|
-
/**
|
|
64
|
-
* Routes HTTP PUT requests to the specified path.
|
|
65
|
-
*/
|
|
66
|
-
exports.Put = createMappingDecorator(exports.RequestMethod.PUT);
|
|
67
|
-
/**
|
|
68
|
-
* Routes HTTP PATCH requests to the specified path.
|
|
69
|
-
*/
|
|
70
|
-
exports.Patch = createMappingDecorator(exports.RequestMethod.PATCH);
|
|
71
|
-
/**
|
|
72
|
-
* Routes HTTP OPTIONS requests to the specified path.
|
|
73
|
-
*/
|
|
74
|
-
exports.Options = createMappingDecorator(exports.RequestMethod.OPTIONS);
|
|
75
|
-
/**
|
|
76
|
-
* Routes HTTP HEAD requests to the specified path.
|
|
77
|
-
*/
|
|
78
|
-
exports.Head = createMappingDecorator(exports.RequestMethod.HEAD);
|
|
79
|
-
/**
|
|
80
|
-
* Routes all HTTP requests to the specified path.
|
|
81
|
-
*/
|
|
82
|
-
exports.All = createMappingDecorator(exports.RequestMethod.ALL);
|
|
83
|
-
//# sourceMappingURL=requestMapping.js.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare function Redirect(url: string, code?: number): (target: any, key: any, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
2
|
-
export declare function HttpCode(code: number): (target: any, key: any, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
3
|
-
export declare function SetHeader(headerKey: string | Record<string, any>, value?: string): (target: any, key: any, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
4
|
-
export declare function ContentType(contentType: string): (target: any, key: any, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
5
|
-
export declare function createRender(RenderEngine: {
|
|
6
|
-
render: () => string;
|
|
7
|
-
renderString: () => string;
|
|
8
|
-
}): (templateName: string) => (target: any, key: any, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
9
|
-
//# sourceMappingURL=response.d.ts.map
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createRender = exports.ContentType = exports.SetHeader = exports.HttpCode = exports.Redirect = void 0;
|
|
4
|
-
const __1 = require("../../");
|
|
5
|
-
function Redirect(url, code = 302) {
|
|
6
|
-
return (target, key, descriptor) => {
|
|
7
|
-
(0, __1.attachPropertyMetadata)(__1.WEB_RESPONSE_KEY, {
|
|
8
|
-
type: __1.WEB_RESPONSE_REDIRECT,
|
|
9
|
-
url,
|
|
10
|
-
code,
|
|
11
|
-
}, target, key);
|
|
12
|
-
return descriptor;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
exports.Redirect = Redirect;
|
|
16
|
-
function HttpCode(code) {
|
|
17
|
-
return (target, key, descriptor) => {
|
|
18
|
-
(0, __1.attachPropertyMetadata)(__1.WEB_RESPONSE_KEY, {
|
|
19
|
-
type: __1.WEB_RESPONSE_HTTP_CODE,
|
|
20
|
-
code,
|
|
21
|
-
}, target, key);
|
|
22
|
-
return descriptor;
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
exports.HttpCode = HttpCode;
|
|
26
|
-
function SetHeader(headerKey, value) {
|
|
27
|
-
return (target, key, descriptor) => {
|
|
28
|
-
let headerObject = {};
|
|
29
|
-
if (value) {
|
|
30
|
-
headerObject[headerKey] = value;
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
headerObject = headerKey;
|
|
34
|
-
}
|
|
35
|
-
(0, __1.attachPropertyMetadata)(__1.WEB_RESPONSE_KEY, {
|
|
36
|
-
type: __1.WEB_RESPONSE_HEADER,
|
|
37
|
-
setHeaders: headerObject,
|
|
38
|
-
}, target, key);
|
|
39
|
-
return descriptor;
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
exports.SetHeader = SetHeader;
|
|
43
|
-
function ContentType(contentType) {
|
|
44
|
-
return (target, key, descriptor) => {
|
|
45
|
-
(0, __1.attachPropertyMetadata)(__1.WEB_RESPONSE_KEY, {
|
|
46
|
-
type: __1.WEB_RESPONSE_CONTENT_TYPE,
|
|
47
|
-
contentType,
|
|
48
|
-
}, target, key);
|
|
49
|
-
return descriptor;
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
exports.ContentType = ContentType;
|
|
53
|
-
function createRender(RenderEngine) {
|
|
54
|
-
return (templateName) => {
|
|
55
|
-
return (target, key, descriptor) => {
|
|
56
|
-
(0, __1.attachPropertyMetadata)(__1.WEB_RESPONSE_KEY, {
|
|
57
|
-
type: __1.WEB_RESPONSE_RENDER,
|
|
58
|
-
templateName,
|
|
59
|
-
}, target, key);
|
|
60
|
-
return descriptor;
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
exports.createRender = createRender;
|
|
65
|
-
//# sourceMappingURL=response.js.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { MiddlewareParamArray } from '../../interface';
|
|
2
|
-
export interface WSControllerOption {
|
|
3
|
-
namespace: string;
|
|
4
|
-
routerOptions: {
|
|
5
|
-
connectionMiddleware?: MiddlewareParamArray;
|
|
6
|
-
middleware?: MiddlewareParamArray;
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
export declare function WSController(namespace?: string | RegExp, routerOptions?: WSControllerOption['routerOptions']): ClassDecorator;
|
|
10
|
-
//# sourceMappingURL=webSocketController.d.ts.map
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WSController = void 0;
|
|
4
|
-
const common_1 = require("../common");
|
|
5
|
-
const __1 = require("../../");
|
|
6
|
-
function WSController(namespace = '/', routerOptions = {
|
|
7
|
-
middleware: [],
|
|
8
|
-
connectionMiddleware: [],
|
|
9
|
-
}) {
|
|
10
|
-
return (target) => {
|
|
11
|
-
(0, __1.saveModule)(__1.WS_CONTROLLER_KEY, target);
|
|
12
|
-
(0, __1.saveClassMetadata)(__1.WS_CONTROLLER_KEY, {
|
|
13
|
-
namespace,
|
|
14
|
-
routerOptions,
|
|
15
|
-
}, target);
|
|
16
|
-
(0, common_1.Scope)(__1.ScopeEnum.Request)(target);
|
|
17
|
-
(0, __1.Provide)()(target);
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
exports.WSController = WSController;
|
|
21
|
-
//# sourceMappingURL=webSocketController.js.map
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { MiddlewareParamArray } from '../../';
|
|
2
|
-
export declare enum WSEventTypeEnum {
|
|
3
|
-
ON_CONNECTION = "ws:onConnection",
|
|
4
|
-
ON_DISCONNECTION = "ws:onDisconnection",
|
|
5
|
-
ON_MESSAGE = "ws:onMessage",
|
|
6
|
-
ON_SOCKET_ERROR = "ws:onSocketError",
|
|
7
|
-
EMIT = "ws:Emit",
|
|
8
|
-
BROADCAST = "ws:broadcast"
|
|
9
|
-
}
|
|
10
|
-
export interface WSEventInfo {
|
|
11
|
-
/**
|
|
12
|
-
* web socket event name in enum
|
|
13
|
-
*/
|
|
14
|
-
eventType: WSEventTypeEnum;
|
|
15
|
-
/**
|
|
16
|
-
* decorator method name
|
|
17
|
-
*/
|
|
18
|
-
propertyName: string;
|
|
19
|
-
descriptor: PropertyDescriptor;
|
|
20
|
-
/**
|
|
21
|
-
* the event name by user definition
|
|
22
|
-
*/
|
|
23
|
-
messageEventName?: string;
|
|
24
|
-
/**
|
|
25
|
-
* the room name to emit
|
|
26
|
-
*/
|
|
27
|
-
roomName?: string[];
|
|
28
|
-
/**
|
|
29
|
-
* event options, like middleware
|
|
30
|
-
*/
|
|
31
|
-
eventOptions?: {
|
|
32
|
-
middleware?: MiddlewareParamArray;
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
export declare function OnWSConnection(eventOptions?: {
|
|
36
|
-
middleware?: MiddlewareParamArray;
|
|
37
|
-
}): MethodDecorator;
|
|
38
|
-
export declare function OnWSDisConnection(): MethodDecorator;
|
|
39
|
-
export declare function OnWSMessage(eventName: string, eventOptions?: {
|
|
40
|
-
middleware?: MiddlewareParamArray;
|
|
41
|
-
}): MethodDecorator;
|
|
42
|
-
export declare function WSEmit(messageName: string, roomName?: string | string[]): MethodDecorator;
|
|
43
|
-
export declare function WSBroadCast(messageName?: string, roomName?: string | string[]): MethodDecorator;
|
|
44
|
-
/**
|
|
45
|
-
* @deprecated please use @OnWSMessage
|
|
46
|
-
*/
|
|
47
|
-
export declare const OnMessage: typeof OnWSMessage;
|
|
48
|
-
/**
|
|
49
|
-
* @deprecated please use @WSEmit
|
|
50
|
-
*/
|
|
51
|
-
export declare const Emit: typeof WSEmit;
|
|
52
|
-
/**
|
|
53
|
-
* @deprecated please use @OnWSDisConnection
|
|
54
|
-
*/
|
|
55
|
-
export declare const OnDisConnection: typeof OnWSDisConnection;
|
|
56
|
-
/**
|
|
57
|
-
* @deprecated please use @OnWSConnection
|
|
58
|
-
*/
|
|
59
|
-
export declare const OnConnection: typeof OnWSConnection;
|
|
60
|
-
//# sourceMappingURL=webSocketEvent.d.ts.map
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OnConnection = exports.OnDisConnection = exports.Emit = exports.OnMessage = exports.WSBroadCast = exports.WSEmit = exports.OnWSMessage = exports.OnWSDisConnection = exports.OnWSConnection = exports.WSEventTypeEnum = void 0;
|
|
4
|
-
const __1 = require("../../");
|
|
5
|
-
var WSEventTypeEnum;
|
|
6
|
-
(function (WSEventTypeEnum) {
|
|
7
|
-
WSEventTypeEnum["ON_CONNECTION"] = "ws:onConnection";
|
|
8
|
-
WSEventTypeEnum["ON_DISCONNECTION"] = "ws:onDisconnection";
|
|
9
|
-
WSEventTypeEnum["ON_MESSAGE"] = "ws:onMessage";
|
|
10
|
-
WSEventTypeEnum["ON_SOCKET_ERROR"] = "ws:onSocketError";
|
|
11
|
-
WSEventTypeEnum["EMIT"] = "ws:Emit";
|
|
12
|
-
WSEventTypeEnum["BROADCAST"] = "ws:broadcast";
|
|
13
|
-
})(WSEventTypeEnum = exports.WSEventTypeEnum || (exports.WSEventTypeEnum = {}));
|
|
14
|
-
function OnWSConnection(eventOptions = {}) {
|
|
15
|
-
return (target, propertyKey, descriptor) => {
|
|
16
|
-
(0, __1.attachClassMetadata)(__1.WS_EVENT_KEY, {
|
|
17
|
-
eventType: WSEventTypeEnum.ON_CONNECTION,
|
|
18
|
-
propertyName: propertyKey,
|
|
19
|
-
eventOptions,
|
|
20
|
-
descriptor,
|
|
21
|
-
}, target.constructor);
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
exports.OnWSConnection = OnWSConnection;
|
|
25
|
-
function OnWSDisConnection() {
|
|
26
|
-
return (target, propertyKey, descriptor) => {
|
|
27
|
-
(0, __1.attachClassMetadata)(__1.WS_EVENT_KEY, {
|
|
28
|
-
eventType: WSEventTypeEnum.ON_DISCONNECTION,
|
|
29
|
-
propertyName: propertyKey,
|
|
30
|
-
descriptor,
|
|
31
|
-
}, target.constructor);
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
exports.OnWSDisConnection = OnWSDisConnection;
|
|
35
|
-
function OnWSMessage(eventName, eventOptions = {}) {
|
|
36
|
-
return (target, propertyKey, descriptor) => {
|
|
37
|
-
(0, __1.attachClassMetadata)(__1.WS_EVENT_KEY, {
|
|
38
|
-
eventType: WSEventTypeEnum.ON_MESSAGE,
|
|
39
|
-
messageEventName: eventName,
|
|
40
|
-
propertyName: propertyKey,
|
|
41
|
-
eventOptions,
|
|
42
|
-
descriptor,
|
|
43
|
-
}, target.constructor);
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
exports.OnWSMessage = OnWSMessage;
|
|
47
|
-
function WSEmit(messageName, roomName = []) {
|
|
48
|
-
return (target, propertyKey, descriptor) => {
|
|
49
|
-
(0, __1.attachClassMetadata)(__1.WS_EVENT_KEY, {
|
|
50
|
-
eventType: WSEventTypeEnum.EMIT,
|
|
51
|
-
propertyName: propertyKey,
|
|
52
|
-
messageEventName: messageName,
|
|
53
|
-
roomName: [].concat(roomName),
|
|
54
|
-
descriptor,
|
|
55
|
-
}, target.constructor);
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
exports.WSEmit = WSEmit;
|
|
59
|
-
function WSBroadCast(messageName = '', roomName = []) {
|
|
60
|
-
return (target, propertyKey, descriptor) => {
|
|
61
|
-
(0, __1.attachClassMetadata)(__1.WS_EVENT_KEY, {
|
|
62
|
-
eventType: WSEventTypeEnum.BROADCAST,
|
|
63
|
-
propertyName: propertyKey,
|
|
64
|
-
messageEventName: messageName,
|
|
65
|
-
roomName: [].concat(roomName),
|
|
66
|
-
descriptor,
|
|
67
|
-
}, target.constructor);
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
exports.WSBroadCast = WSBroadCast;
|
|
71
|
-
/**
|
|
72
|
-
* @deprecated please use @OnWSMessage
|
|
73
|
-
*/
|
|
74
|
-
exports.OnMessage = OnWSMessage;
|
|
75
|
-
/**
|
|
76
|
-
* @deprecated please use @WSEmit
|
|
77
|
-
*/
|
|
78
|
-
exports.Emit = WSEmit;
|
|
79
|
-
/**
|
|
80
|
-
* @deprecated please use @OnWSDisConnection
|
|
81
|
-
*/
|
|
82
|
-
exports.OnDisConnection = OnWSDisConnection;
|
|
83
|
-
/**
|
|
84
|
-
* @deprecated please use @OnWSConnection
|
|
85
|
-
*/
|
|
86
|
-
exports.OnConnection = OnWSConnection;
|
|
87
|
-
//# sourceMappingURL=webSocketEvent.js.map
|
|
@@ -1,301 +0,0 @@
|
|
|
1
|
-
import 'reflect-metadata';
|
|
2
|
-
import { GroupModeType, IModuleStore, ObjectDefinitionOptions, ObjectIdentifier, TagPropsMetadata } from './interface';
|
|
3
|
-
export declare const PRELOAD_MODULE_KEY = "INJECTION_PRELOAD_MODULE_KEY";
|
|
4
|
-
export declare const INJECT_CLASS_KEY_PREFIX = "INJECTION_CLASS_META_DATA";
|
|
5
|
-
export declare class DecoratorManager extends Map implements IModuleStore {
|
|
6
|
-
/**
|
|
7
|
-
* the key for meta data store in class
|
|
8
|
-
*/
|
|
9
|
-
injectClassKeyPrefix: string;
|
|
10
|
-
/**
|
|
11
|
-
* the key for method meta data store in class
|
|
12
|
-
*/
|
|
13
|
-
injectClassMethodKeyPrefix: string;
|
|
14
|
-
/**
|
|
15
|
-
* the key for method meta data store in method
|
|
16
|
-
*/
|
|
17
|
-
injectMethodKeyPrefix: string;
|
|
18
|
-
container: IModuleStore;
|
|
19
|
-
saveModule(key: any, module: any): any;
|
|
20
|
-
listModule(key: any): any;
|
|
21
|
-
resetModule(key: any): void;
|
|
22
|
-
bindContainer(container: IModuleStore): void;
|
|
23
|
-
static getDecoratorClassKey(decoratorNameKey: ObjectIdentifier): string;
|
|
24
|
-
static removeDecoratorClassKeySuffix(decoratorNameKey: ObjectIdentifier): string;
|
|
25
|
-
static getDecoratorMethodKey(decoratorNameKey: ObjectIdentifier): string;
|
|
26
|
-
static getDecoratorClsExtendedKey(decoratorNameKey: ObjectIdentifier): string;
|
|
27
|
-
static getDecoratorClsMethodPrefix(decoratorNameKey: ObjectIdentifier): string;
|
|
28
|
-
static getDecoratorClsMethodKey(decoratorNameKey: ObjectIdentifier, methodKey: ObjectIdentifier): string;
|
|
29
|
-
static getDecoratorMethod(decoratorNameKey: ObjectIdentifier, methodKey: ObjectIdentifier): string;
|
|
30
|
-
static saveMetadata(metaKey: string, target: any, dataKey: string, data: any): void;
|
|
31
|
-
static attachMetadata(metaKey: string, target: any, dataKey: string, data: any, groupBy?: string, groupMode?: GroupModeType): void;
|
|
32
|
-
static getMetadata(metaKey: string, target: any, dataKey?: string): any;
|
|
33
|
-
/**
|
|
34
|
-
* save meta data to class or property
|
|
35
|
-
* @param decoratorNameKey the alias name for decorator
|
|
36
|
-
* @param data the data you want to store
|
|
37
|
-
* @param target target class
|
|
38
|
-
* @param propertyName
|
|
39
|
-
*/
|
|
40
|
-
saveMetadata(decoratorNameKey: ObjectIdentifier, data: any, target: any, propertyName?: any): void;
|
|
41
|
-
/**
|
|
42
|
-
* attach data to class or property
|
|
43
|
-
* @param decoratorNameKey
|
|
44
|
-
* @param data
|
|
45
|
-
* @param target
|
|
46
|
-
* @param propertyName
|
|
47
|
-
* @param groupBy
|
|
48
|
-
*/
|
|
49
|
-
attachMetadata(decoratorNameKey: ObjectIdentifier, data: any, target: any, propertyName?: string, groupBy?: string, groupMode?: GroupModeType): void;
|
|
50
|
-
/**
|
|
51
|
-
* get single data from class or property
|
|
52
|
-
* @param decoratorNameKey
|
|
53
|
-
* @param target
|
|
54
|
-
* @param propertyName
|
|
55
|
-
*/
|
|
56
|
-
getMetadata(decoratorNameKey: ObjectIdentifier, target: any, propertyName?: any): any;
|
|
57
|
-
/**
|
|
58
|
-
* save property data to class
|
|
59
|
-
* @param decoratorNameKey
|
|
60
|
-
* @param data
|
|
61
|
-
* @param target
|
|
62
|
-
* @param propertyName
|
|
63
|
-
*/
|
|
64
|
-
savePropertyDataToClass(decoratorNameKey: ObjectIdentifier, data: any, target: any, propertyName: any): void;
|
|
65
|
-
/**
|
|
66
|
-
* attach property data to class
|
|
67
|
-
* @param decoratorNameKey
|
|
68
|
-
* @param data
|
|
69
|
-
* @param target
|
|
70
|
-
* @param propertyName
|
|
71
|
-
* @param groupBy
|
|
72
|
-
*/
|
|
73
|
-
attachPropertyDataToClass(decoratorNameKey: ObjectIdentifier, data: any, target: any, propertyName: any, groupBy?: string): void;
|
|
74
|
-
/**
|
|
75
|
-
* get property data from class
|
|
76
|
-
* @param decoratorNameKey
|
|
77
|
-
* @param target
|
|
78
|
-
* @param propertyName
|
|
79
|
-
*/
|
|
80
|
-
getPropertyDataFromClass(decoratorNameKey: ObjectIdentifier, target: any, propertyName: any): any;
|
|
81
|
-
/**
|
|
82
|
-
* list property data from class
|
|
83
|
-
* @param decoratorNameKey
|
|
84
|
-
* @param target
|
|
85
|
-
*/
|
|
86
|
-
listPropertyDataFromClass(decoratorNameKey: ObjectIdentifier, target: any): any[];
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* save data to class
|
|
90
|
-
* @param decoratorNameKey
|
|
91
|
-
* @param data
|
|
92
|
-
* @param target
|
|
93
|
-
* @param mergeIfExist
|
|
94
|
-
*/
|
|
95
|
-
export declare function saveClassMetadata(decoratorNameKey: ObjectIdentifier, data: any, target: any, mergeIfExist?: boolean): void;
|
|
96
|
-
/**
|
|
97
|
-
* attach data to class
|
|
98
|
-
* @param decoratorNameKey
|
|
99
|
-
* @param data
|
|
100
|
-
* @param target
|
|
101
|
-
* @param groupBy
|
|
102
|
-
*/
|
|
103
|
-
export declare function attachClassMetadata(decoratorNameKey: ObjectIdentifier, data: any, target: any, groupBy?: string, groupMode?: GroupModeType): void;
|
|
104
|
-
/**
|
|
105
|
-
* get data from class and proto
|
|
106
|
-
* @param decoratorNameKey
|
|
107
|
-
* @param target
|
|
108
|
-
* @param propertyName
|
|
109
|
-
* @param useCache
|
|
110
|
-
*/
|
|
111
|
-
export declare function getClassExtendedMetadata(decoratorNameKey: ObjectIdentifier, target: any, propertyName?: string, useCache?: boolean): any;
|
|
112
|
-
/**
|
|
113
|
-
* get data from class
|
|
114
|
-
* @param decoratorNameKey
|
|
115
|
-
* @param target
|
|
116
|
-
*/
|
|
117
|
-
export declare function getClassMetadata(decoratorNameKey: ObjectIdentifier, target: any): any;
|
|
118
|
-
/**
|
|
119
|
-
* save property data to class
|
|
120
|
-
* @param decoratorNameKey
|
|
121
|
-
* @param data
|
|
122
|
-
* @param target
|
|
123
|
-
* @param propertyName
|
|
124
|
-
*/
|
|
125
|
-
export declare function savePropertyDataToClass(decoratorNameKey: ObjectIdentifier, data: any, target: any, propertyName: any): void;
|
|
126
|
-
/**
|
|
127
|
-
* attach property data to class
|
|
128
|
-
* @param decoratorNameKey
|
|
129
|
-
* @param data
|
|
130
|
-
* @param target
|
|
131
|
-
* @param propertyName
|
|
132
|
-
* @param groupBy
|
|
133
|
-
*/
|
|
134
|
-
export declare function attachPropertyDataToClass(decoratorNameKey: ObjectIdentifier, data: any, target: any, propertyName: any, groupBy?: string): void;
|
|
135
|
-
/**
|
|
136
|
-
* get property data from class
|
|
137
|
-
* @param decoratorNameKey
|
|
138
|
-
* @param target
|
|
139
|
-
* @param propertyName
|
|
140
|
-
*/
|
|
141
|
-
export declare function getPropertyDataFromClass(decoratorNameKey: ObjectIdentifier, target: any, propertyName: any): any;
|
|
142
|
-
/**
|
|
143
|
-
* list property data from class
|
|
144
|
-
* @param decoratorNameKey
|
|
145
|
-
* @param target
|
|
146
|
-
*/
|
|
147
|
-
export declare function listPropertyDataFromClass(decoratorNameKey: ObjectIdentifier, target: any): any[];
|
|
148
|
-
/**
|
|
149
|
-
* save property data
|
|
150
|
-
* @param decoratorNameKey
|
|
151
|
-
* @param data
|
|
152
|
-
* @param target
|
|
153
|
-
* @param propertyName
|
|
154
|
-
*/
|
|
155
|
-
export declare function savePropertyMetadata(decoratorNameKey: ObjectIdentifier, data: any, target: any, propertyName: any): void;
|
|
156
|
-
/**
|
|
157
|
-
* attach property data
|
|
158
|
-
* @param decoratorNameKey
|
|
159
|
-
* @param data
|
|
160
|
-
* @param target
|
|
161
|
-
* @param propertyName
|
|
162
|
-
*/
|
|
163
|
-
export declare function attachPropertyMetadata(decoratorNameKey: ObjectIdentifier, data: any, target: any, propertyName: any): void;
|
|
164
|
-
/**
|
|
165
|
-
* get property data
|
|
166
|
-
* @param decoratorNameKey
|
|
167
|
-
* @param target
|
|
168
|
-
* @param propertyName
|
|
169
|
-
*/
|
|
170
|
-
export declare function getPropertyMetadata(decoratorNameKey: ObjectIdentifier, target: any, propertyName: any): any;
|
|
171
|
-
/**
|
|
172
|
-
* save preload module by target
|
|
173
|
-
* @param target
|
|
174
|
-
*/
|
|
175
|
-
export declare function savePreloadModule(target: any): any;
|
|
176
|
-
/**
|
|
177
|
-
* list preload module
|
|
178
|
-
*/
|
|
179
|
-
export declare function listPreloadModule(): any[];
|
|
180
|
-
/**
|
|
181
|
-
* save module to inner map
|
|
182
|
-
* @param decoratorNameKey
|
|
183
|
-
* @param target
|
|
184
|
-
*/
|
|
185
|
-
export declare function saveModule(decoratorNameKey: ObjectIdentifier, target: any): any;
|
|
186
|
-
export declare function bindContainer(container: any): void;
|
|
187
|
-
export declare function clearBindContainer(): any;
|
|
188
|
-
/**
|
|
189
|
-
* list module from decorator key
|
|
190
|
-
* @param decoratorNameKey
|
|
191
|
-
* @param filter
|
|
192
|
-
*/
|
|
193
|
-
export declare function listModule(decoratorNameKey: ObjectIdentifier, filter?: (module: any) => boolean): any[];
|
|
194
|
-
/**
|
|
195
|
-
* reset module
|
|
196
|
-
* @param decoratorNameKey
|
|
197
|
-
*/
|
|
198
|
-
export declare function resetModule(decoratorNameKey: ObjectIdentifier): void;
|
|
199
|
-
/**
|
|
200
|
-
* clear all module
|
|
201
|
-
*/
|
|
202
|
-
export declare function clearAllModule(): void;
|
|
203
|
-
export interface TSDesignType {
|
|
204
|
-
name: string;
|
|
205
|
-
originDesign: any;
|
|
206
|
-
isBaseType: boolean;
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* save property inject args
|
|
210
|
-
* @param opts 参数
|
|
211
|
-
*/
|
|
212
|
-
export declare function savePropertyInject(opts: {
|
|
213
|
-
identifier: ObjectIdentifier;
|
|
214
|
-
target: any;
|
|
215
|
-
targetKey: string;
|
|
216
|
-
args?: any;
|
|
217
|
-
}): void;
|
|
218
|
-
/**
|
|
219
|
-
* get property inject args
|
|
220
|
-
* @param target
|
|
221
|
-
* @param useCache
|
|
222
|
-
*/
|
|
223
|
-
export declare function getPropertyInject(target: any, useCache?: boolean): {
|
|
224
|
-
[methodName: string]: TagPropsMetadata;
|
|
225
|
-
};
|
|
226
|
-
/**
|
|
227
|
-
* save class object definition
|
|
228
|
-
* @param target class
|
|
229
|
-
* @param props property data
|
|
230
|
-
*/
|
|
231
|
-
export declare function saveObjectDefinition(target: any, props?: {}): any;
|
|
232
|
-
/**
|
|
233
|
-
* get class object definition from metadata
|
|
234
|
-
* @param target
|
|
235
|
-
*/
|
|
236
|
-
export declare function getObjectDefinition(target: any): ObjectDefinitionOptions;
|
|
237
|
-
/**
|
|
238
|
-
* class provider id
|
|
239
|
-
* @param identifier id
|
|
240
|
-
* @param target class
|
|
241
|
-
*/
|
|
242
|
-
export declare function saveProviderId(identifier: ObjectIdentifier, target: any): any;
|
|
243
|
-
/**
|
|
244
|
-
* get provider id from module
|
|
245
|
-
* @param module
|
|
246
|
-
*/
|
|
247
|
-
export declare function getProviderId(module: any): string;
|
|
248
|
-
export declare function getProviderName(module: any): string;
|
|
249
|
-
/**
|
|
250
|
-
* get provider uuid from module
|
|
251
|
-
* @param module
|
|
252
|
-
*/
|
|
253
|
-
export declare function getProviderUUId(module: any): string;
|
|
254
|
-
/**
|
|
255
|
-
* use @Provide decorator or not
|
|
256
|
-
* @param target class
|
|
257
|
-
*/
|
|
258
|
-
export declare function isProvide(target: any): boolean;
|
|
259
|
-
export declare enum BaseType {
|
|
260
|
-
Boolean = "boolean",
|
|
261
|
-
Number = "number",
|
|
262
|
-
String = "string"
|
|
263
|
-
}
|
|
264
|
-
/**
|
|
265
|
-
* get parameters type by reflect-metadata
|
|
266
|
-
*/
|
|
267
|
-
export declare function getMethodParamTypes(target: any, methodName: string | symbol): any;
|
|
268
|
-
/**
|
|
269
|
-
* get property(method) type from metadata
|
|
270
|
-
* @param target
|
|
271
|
-
* @param methodName
|
|
272
|
-
*/
|
|
273
|
-
export declare function getPropertyType(target: any, methodName: string | symbol): TSDesignType;
|
|
274
|
-
/**
|
|
275
|
-
* get method return type from metadata
|
|
276
|
-
* @param target
|
|
277
|
-
* @param methodName
|
|
278
|
-
*/
|
|
279
|
-
export declare function getMethodReturnTypes(target: any, methodName: string | symbol): any;
|
|
280
|
-
/**
|
|
281
|
-
* create a custom property inject
|
|
282
|
-
* @param decoratorKey
|
|
283
|
-
* @param metadata
|
|
284
|
-
* @param impl default true, configuration need decoratorService.registerMethodHandler
|
|
285
|
-
*/
|
|
286
|
-
export declare function createCustomPropertyDecorator(decoratorKey: string, metadata: any, impl?: boolean): PropertyDecorator;
|
|
287
|
-
/**
|
|
288
|
-
*
|
|
289
|
-
* @param decoratorKey
|
|
290
|
-
* @param metadata
|
|
291
|
-
* @param impl default true, configuration need decoratorService.registerMethodHandler
|
|
292
|
-
*/
|
|
293
|
-
export declare function createCustomMethodDecorator(decoratorKey: string, metadata: any, impl?: boolean): MethodDecorator;
|
|
294
|
-
/**
|
|
295
|
-
*
|
|
296
|
-
* @param decoratorKey
|
|
297
|
-
* @param metadata
|
|
298
|
-
* @param impl default true, configuration need decoratorService.registerMethodHandler
|
|
299
|
-
*/
|
|
300
|
-
export declare function createCustomParamDecorator(decoratorKey: string, metadata: any, impl?: boolean): ParameterDecorator;
|
|
301
|
-
//# sourceMappingURL=decoratorManager.d.ts.map
|