cgserver 6.0.0 → 6.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AI/AiObject.d.ts +5 -0
- package/dist/AI/Astar.d.ts +38 -0
- package/dist/AI/BehaviorAI.d.ts +24 -0
- package/dist/AI/Entity.d.ts +12 -0
- package/dist/AI/Point.d.ts +17 -0
- package/dist/AI/TriggerMgr.d.ts +52 -0
- package/dist/Config/Config.d.ts +7 -0
- package/dist/Config/FrameworkConfig.d.ts +229 -0
- package/dist/Config/ServerConfig.d.ts +9 -0
- package/dist/Config/_error_.d.ts +99 -0
- package/dist/Core/Core.d.ts +101 -0
- package/dist/Core/Timer.d.ts +16 -0
- package/dist/Database/BaseMongoService.d.ts +67 -0
- package/dist/Database/BaseService.d.ts +34 -0
- package/dist/Database/Decorator/AutoIncrement.d.ts +1 -0
- package/dist/Database/Decorator/DBCache.d.ts +21 -0
- package/dist/Database/Decorator/NotNull.d.ts +1 -0
- package/dist/Database/Decorator/PrimaryKey.d.ts +1 -0
- package/dist/Database/Decorator/Property.d.ts +55 -0
- package/dist/Database/Decorator/Table.d.ts +1 -0
- package/dist/Database/Decorator/Type.d.ts +1 -0
- package/dist/Database/MSSqlManager.d.ts +17 -0
- package/dist/Database/MongoManager.d.ts +135 -0
- package/dist/Database/MysqlManager.d.ts +41 -0
- package/dist/Database/RedisManager.d.ts +64 -0
- package/dist/Index.d.ts +65 -0
- package/dist/Logic/CacheTool.d.ts +25 -0
- package/dist/Logic/HttpTool.d.ts +14 -0
- package/dist/Logic/Log.d.ts +15 -0
- package/dist/Service/AccountService.d.ts +77 -0
- package/dist/Service/MongoAccountService.d.ts +78 -0
- package/dist/Service/MongoCacheService.d.ts +13 -0
- package/dist/Service/MongoUserService.d.ts +36 -0
- package/dist/Service/UserService.d.ts +36 -0
- package/dist/Service/ini.d.ts +28 -0
- package/dist/SocketServer/IClientWebSocket.d.ts +24 -0
- package/dist/SocketServer/IServerWebSocket.d.ts +13 -0
- package/dist/SocketServer/ISocketServer.d.ts +36 -0
- package/dist/SocketServer/IWebSocket.d.ts +44 -0
- package/dist/SocketServer/ProtoFilter/GoogleProtoFilter.d.ts +9 -0
- package/dist/SocketServer/ProtoFilter/IProtoFilter.d.ts +9 -0
- package/dist/SocketServer/ProtoFilter/JsonProtoFilter.d.ts +6 -0
- package/dist/SocketServer/ProtoFilter/ProtoFactory.d.ts +8 -0
- package/dist/ThirdParty/AlipayTool.d.ts +40 -0
- package/dist/ThirdParty/Alisms.d.ts +14 -0
- package/dist/ThirdParty/AppleTool.d.ts +131 -0
- package/dist/ThirdParty/EmailTool.d.ts +5 -0
- package/dist/ThirdParty/OpenSocial.d.ts +7 -0
- package/dist/ThirdParty/QQTool.d.ts +41 -0
- package/dist/ThirdParty/QiniuTool.d.ts +6 -0
- package/dist/ThirdParty/WechatOATool.d.ts +13 -0
- package/dist/ThirdParty/WechatTool.d.ts +20 -0
- package/dist/WebServer/Controller/BaseController.d.ts +33 -0
- package/dist/WebServer/Controller/BaseUserController.d.ts +26 -0
- package/dist/WebServer/Controller/MongoBaseUserController.d.ts +26 -0
- package/dist/WebServer/Decorator/AdminValidate.d.ts +1 -0
- package/dist/WebServer/Decorator/AuthorityValidate.d.ts +2 -0
- package/dist/WebServer/Decorator/CreatorValidate.d.ts +1 -0
- package/dist/WebServer/Decorator/JsonAdminValidate.d.ts +1 -0
- package/dist/WebServer/Decorator/JsonAuthorityValidate.d.ts +2 -0
- package/dist/WebServer/Decorator/JsonCreatorValidate.d.ts +1 -0
- package/dist/WebServer/Engine/ControllerManager.d.ts +21 -0
- package/dist/WebServer/Engine/Engine.d.ts +21 -0
- package/dist/WebServer/Engine/RazorJs.d.ts +21 -0
- package/dist/WebServer/Engine/Request.d.ts +35 -0
- package/dist/WebServer/Engine/Response.d.ts +28 -0
- package/dist/WebServer/IWebServer.d.ts +20 -0
- package/dist/cgserver.js +1037 -0
- package/package.json +2 -2
- package/out/AI/AiObject.js +0 -11
- package/out/AI/AiObject.js.map +0 -1
- package/out/AI/Astar.js +0 -134
- package/out/AI/Astar.js.map +0 -1
- package/out/AI/BehaviorAI.js +0 -308
- package/out/AI/BehaviorAI.js.map +0 -1
- package/out/AI/Entity.js +0 -34
- package/out/AI/Entity.js.map +0 -1
- package/out/AI/Point.js +0 -69
- package/out/AI/Point.js.map +0 -1
- package/out/AI/TriggerMgr.js +0 -202
- package/out/AI/TriggerMgr.js.map +0 -1
- package/out/Config/Config.js +0 -38
- package/out/Config/Config.js.map +0 -1
- package/out/Config/FrameworkConfig.js +0 -235
- package/out/Config/FrameworkConfig.js.map +0 -1
- package/out/Config/ServerConfig.js +0 -19
- package/out/Config/ServerConfig.js.map +0 -1
- package/out/Config/_error_.js +0 -36
- package/out/Config/_error_.js.map +0 -1
- package/out/Core/Core.js +0 -562
- package/out/Core/Core.js.map +0 -1
- package/out/Core/Timer.js +0 -117
- package/out/Core/Timer.js.map +0 -1
- package/out/Database/BaseMongoService.js +0 -80
- package/out/Database/BaseMongoService.js.map +0 -1
- package/out/Database/BaseService.js +0 -282
- package/out/Database/BaseService.js.map +0 -1
- package/out/Database/Decorator/AutoIncrement.js +0 -12
- package/out/Database/Decorator/AutoIncrement.js.map +0 -1
- package/out/Database/Decorator/DBCache.js +0 -65
- package/out/Database/Decorator/DBCache.js.map +0 -1
- package/out/Database/Decorator/NotNull.js +0 -12
- package/out/Database/Decorator/NotNull.js.map +0 -1
- package/out/Database/Decorator/PrimaryKey.js +0 -12
- package/out/Database/Decorator/PrimaryKey.js.map +0 -1
- package/out/Database/Decorator/Property.js +0 -62
- package/out/Database/Decorator/Property.js.map +0 -1
- package/out/Database/Decorator/Table.js +0 -16
- package/out/Database/Decorator/Table.js.map +0 -1
- package/out/Database/Decorator/Type.js +0 -21
- package/out/Database/Decorator/Type.js.map +0 -1
- package/out/Database/MSSqlManager.js +0 -44
- package/out/Database/MSSqlManager.js.map +0 -1
- package/out/Database/MongoManager.js +0 -402
- package/out/Database/MongoManager.js.map +0 -1
- package/out/Database/MysqlManager.js +0 -181
- package/out/Database/MysqlManager.js.map +0 -1
- package/out/Database/RedisManager.js +0 -409
- package/out/Database/RedisManager.js.map +0 -1
- package/out/Index.js +0 -134
- package/out/Index.js.map +0 -1
- package/out/Logic/CacheTool.js +0 -74
- package/out/Logic/CacheTool.js.map +0 -1
- package/out/Logic/HttpTool.js +0 -59
- package/out/Logic/HttpTool.js.map +0 -1
- package/out/Logic/Log.js +0 -78
- package/out/Logic/Log.js.map +0 -1
- package/out/Service/AccountService.js +0 -474
- package/out/Service/AccountService.js.map +0 -1
- package/out/Service/MongoAccountService.js +0 -397
- package/out/Service/MongoAccountService.js.map +0 -1
- package/out/Service/MongoCacheService.js +0 -28
- package/out/Service/MongoCacheService.js.map +0 -1
- package/out/Service/MongoUserService.js +0 -94
- package/out/Service/MongoUserService.js.map +0 -1
- package/out/Service/UserService.js +0 -185
- package/out/Service/UserService.js.map +0 -1
- package/out/Service/ini.js +0 -36
- package/out/Service/ini.js.map +0 -1
- package/out/SocketServer/IClientWebSocket.js +0 -72
- package/out/SocketServer/IClientWebSocket.js.map +0 -1
- package/out/SocketServer/IServerWebSocket.js +0 -42
- package/out/SocketServer/IServerWebSocket.js.map +0 -1
- package/out/SocketServer/ISocketServer.js +0 -191
- package/out/SocketServer/ISocketServer.js.map +0 -1
- package/out/SocketServer/IWebSocket.js +0 -224
- package/out/SocketServer/IWebSocket.js.map +0 -1
- package/out/SocketServer/ProtoFilter/GoogleProtoFilter.js +0 -58
- package/out/SocketServer/ProtoFilter/GoogleProtoFilter.js.map +0 -1
- package/out/SocketServer/ProtoFilter/IProtoFilter.js +0 -9
- package/out/SocketServer/ProtoFilter/IProtoFilter.js.map +0 -1
- package/out/SocketServer/ProtoFilter/JsonProtoFilter.js +0 -30
- package/out/SocketServer/ProtoFilter/JsonProtoFilter.js.map +0 -1
- package/out/SocketServer/ProtoFilter/ProtoFactory.js +0 -32
- package/out/SocketServer/ProtoFilter/ProtoFactory.js.map +0 -1
- package/out/ThirdParty/AlipayTool.js +0 -123
- package/out/ThirdParty/AlipayTool.js.map +0 -1
- package/out/ThirdParty/Alisms.js +0 -47
- package/out/ThirdParty/Alisms.js.map +0 -1
- package/out/ThirdParty/AppleTool.js +0 -235
- package/out/ThirdParty/AppleTool.js.map +0 -1
- package/out/ThirdParty/EmailTool.js +0 -34
- package/out/ThirdParty/EmailTool.js.map +0 -1
- package/out/ThirdParty/OpenSocial.js +0 -33
- package/out/ThirdParty/OpenSocial.js.map +0 -1
- package/out/ThirdParty/QQTool.js +0 -116
- package/out/ThirdParty/QQTool.js.map +0 -1
- package/out/ThirdParty/QiniuTool.js +0 -22
- package/out/ThirdParty/QiniuTool.js.map +0 -1
- package/out/ThirdParty/WechatOATool.js +0 -62
- package/out/ThirdParty/WechatOATool.js.map +0 -1
- package/out/ThirdParty/WechatTool.js +0 -75
- package/out/ThirdParty/WechatTool.js.map +0 -1
- package/out/WebServer/Controller/BaseController.js +0 -113
- package/out/WebServer/Controller/BaseController.js.map +0 -1
- package/out/WebServer/Controller/BaseUserController.js +0 -169
- package/out/WebServer/Controller/BaseUserController.js.map +0 -1
- package/out/WebServer/Controller/MongoBaseUserController.js +0 -169
- package/out/WebServer/Controller/MongoBaseUserController.js.map +0 -1
- package/out/WebServer/Decorator/AdminValidate.js +0 -20
- package/out/WebServer/Decorator/AdminValidate.js.map +0 -1
- package/out/WebServer/Decorator/AuthorityValidate.js +0 -23
- package/out/WebServer/Decorator/AuthorityValidate.js.map +0 -1
- package/out/WebServer/Decorator/CreatorValidate.js +0 -20
- package/out/WebServer/Decorator/CreatorValidate.js.map +0 -1
- package/out/WebServer/Decorator/JsonAdminValidate.js +0 -16
- package/out/WebServer/Decorator/JsonAdminValidate.js.map +0 -1
- package/out/WebServer/Decorator/JsonAuthorityValidate.js +0 -21
- package/out/WebServer/Decorator/JsonAuthorityValidate.js.map +0 -1
- package/out/WebServer/Decorator/JsonCreatorValidate.js +0 -20
- package/out/WebServer/Decorator/JsonCreatorValidate.js.map +0 -1
- package/out/WebServer/Engine/ControllerManager.js +0 -113
- package/out/WebServer/Engine/ControllerManager.js.map +0 -1
- package/out/WebServer/Engine/Engine.js +0 -136
- package/out/WebServer/Engine/Engine.js.map +0 -1
- package/out/WebServer/Engine/RazorJs.js +0 -545
- package/out/WebServer/Engine/RazorJs.js.map +0 -1
- package/out/WebServer/Engine/Request.js +0 -215
- package/out/WebServer/Engine/Request.js.map +0 -1
- package/out/WebServer/Engine/Response.js +0 -95
- package/out/WebServer/Engine/Response.js.map +0 -1
- package/out/WebServer/IWebServer.js +0 -50
- package/out/WebServer/IWebServer.js.map +0 -1
- package/tsconfig.json +0 -25
- package/webpack.config.js +0 -14
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { BaseService } from "../Database/BaseMongoService";
|
|
2
|
+
import { MongoBaseModel } from "../Database/MongoManager";
|
|
3
|
+
import { ERoleGroup } from "./ini";
|
|
4
|
+
export declare class UserModel extends MongoBaseModel {
|
|
5
|
+
id: number;
|
|
6
|
+
account_id: number;
|
|
7
|
+
nickname: string;
|
|
8
|
+
sex: number;
|
|
9
|
+
logo: string;
|
|
10
|
+
state: number;
|
|
11
|
+
role_group: number;
|
|
12
|
+
role: number;
|
|
13
|
+
phone: string;
|
|
14
|
+
wechat: string;
|
|
15
|
+
qq: string;
|
|
16
|
+
email: string;
|
|
17
|
+
about: string;
|
|
18
|
+
pre_user_id: number;
|
|
19
|
+
exp: number;
|
|
20
|
+
level: number;
|
|
21
|
+
vip_exp: number;
|
|
22
|
+
vip_level: number;
|
|
23
|
+
is_robot: number;
|
|
24
|
+
create_time: number;
|
|
25
|
+
}
|
|
26
|
+
export declare let GUserSer: UserService<UserModel>;
|
|
27
|
+
export declare class UserService<T extends UserModel> extends BaseService<T> {
|
|
28
|
+
constructor(type: {
|
|
29
|
+
new (): T;
|
|
30
|
+
});
|
|
31
|
+
protected _newUserModel(): T;
|
|
32
|
+
protected _createNewUser(account_id: number, nickname: string, sex: number, logo: string, group?: ERoleGroup): Promise<T>;
|
|
33
|
+
add(account_id: number, nickname: string, sex: number, logo: string, group?: ERoleGroup): Promise<T>;
|
|
34
|
+
getByAccountId(account_id: number): Promise<T>;
|
|
35
|
+
updateBaseInfoByAccount(account_id: number, nickname: string, sex: number, logo: string): Promise<string>;
|
|
36
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { BaseService, BaseModel } from "../Database/BaseService";
|
|
2
|
+
import { ERoleGroup } from "./ini";
|
|
3
|
+
export declare class UserModel extends BaseModel {
|
|
4
|
+
id: number;
|
|
5
|
+
account_id: number;
|
|
6
|
+
nickname: string;
|
|
7
|
+
sex: number;
|
|
8
|
+
logo: string;
|
|
9
|
+
state: number;
|
|
10
|
+
role_group: number;
|
|
11
|
+
role: number;
|
|
12
|
+
phone: string;
|
|
13
|
+
wechat: string;
|
|
14
|
+
qq: string;
|
|
15
|
+
email: string;
|
|
16
|
+
about: string;
|
|
17
|
+
pre_user_id: number;
|
|
18
|
+
exp: number;
|
|
19
|
+
level: number;
|
|
20
|
+
vip_exp: number;
|
|
21
|
+
vip_level: number;
|
|
22
|
+
is_robot: number;
|
|
23
|
+
create_time: number;
|
|
24
|
+
}
|
|
25
|
+
export declare let GUserSer: UserService<UserModel>;
|
|
26
|
+
export declare class UserService<T extends UserModel> extends BaseService<T> {
|
|
27
|
+
constructor(type: {
|
|
28
|
+
new (): T;
|
|
29
|
+
});
|
|
30
|
+
protected _newUserModel(): T;
|
|
31
|
+
protected _createNewUser(account_id: number, nickname: string, sex: number, logo: string, group?: ERoleGroup): Promise<T>;
|
|
32
|
+
updateBaseInfoByAccount(account_id: number, nickname: string, sex: number, logo: string): Promise<string>;
|
|
33
|
+
add(account_id: number, nickname: string, sex: number, logo: string, group?: ERoleGroup): Promise<any>;
|
|
34
|
+
updateRoleGroup(user_id: number, role_group: ERoleGroup): Promise<string>;
|
|
35
|
+
getByAccountId(account_id: number): Promise<T>;
|
|
36
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare enum ERoleGroup {
|
|
2
|
+
Creator = 1,
|
|
3
|
+
Admin = 2,
|
|
4
|
+
Proxy = 3,
|
|
5
|
+
Common = 4
|
|
6
|
+
}
|
|
7
|
+
export declare enum EUserState {
|
|
8
|
+
Ban = -1,
|
|
9
|
+
Waitting = 0,
|
|
10
|
+
Normarl = 1
|
|
11
|
+
}
|
|
12
|
+
export declare enum EAccountState {
|
|
13
|
+
Ban = -1,
|
|
14
|
+
Waitting = 0,
|
|
15
|
+
Normarl = 1
|
|
16
|
+
}
|
|
17
|
+
export declare enum EAccountFrom {
|
|
18
|
+
Guest = 0,
|
|
19
|
+
OpenSocial = 1,
|
|
20
|
+
WeChat = 2,
|
|
21
|
+
QQ = 3,
|
|
22
|
+
Phone = 4,
|
|
23
|
+
Email = 5,
|
|
24
|
+
Name = 6,
|
|
25
|
+
QuickPhone = 7,
|
|
26
|
+
Apple = 8,
|
|
27
|
+
Google = 9
|
|
28
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IWebSocket } from './IWebSocket';
|
|
2
|
+
import * as ws from 'websocket';
|
|
3
|
+
import { EProtoType } from './ProtoFilter/IProtoFilter';
|
|
4
|
+
export declare class IClientWebSocket extends IWebSocket {
|
|
5
|
+
protected _host: string;
|
|
6
|
+
/**
|
|
7
|
+
* 连接的服务器地址
|
|
8
|
+
*/
|
|
9
|
+
get host(): string;
|
|
10
|
+
protected _port: string;
|
|
11
|
+
/**
|
|
12
|
+
* 连接的服务器端口
|
|
13
|
+
*/
|
|
14
|
+
get port(): string;
|
|
15
|
+
protected _need_close: boolean;
|
|
16
|
+
constructor(protoType?: EProtoType, protoPath?: string);
|
|
17
|
+
connect(domain: any, port: any): void;
|
|
18
|
+
protected _connect(): void;
|
|
19
|
+
onOpen(e?: any): void;
|
|
20
|
+
onClose(reasonCode: number, description: string): boolean;
|
|
21
|
+
close(): void;
|
|
22
|
+
protected _onDecode(message: ws.Message, ...params: any[]): any;
|
|
23
|
+
protected _onEncode(data: any, ...params: any[]): any;
|
|
24
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ISocketServer } from './ISocketServer';
|
|
2
|
+
import { IWebSocket } from './IWebSocket';
|
|
3
|
+
import { EProtoType } from './ProtoFilter/IProtoFilter';
|
|
4
|
+
import * as ws from 'websocket';
|
|
5
|
+
export declare class IServerWebSocket extends IWebSocket {
|
|
6
|
+
protected _server: ISocketServer;
|
|
7
|
+
get server(): ISocketServer;
|
|
8
|
+
constructor(server: ISocketServer, protoType?: EProtoType, protoPath?: string);
|
|
9
|
+
onClose(reasonCode: number, description: string): void;
|
|
10
|
+
broadCast(data: any): void;
|
|
11
|
+
protected _onDecode(message: ws.Message, ...params: any[]): any;
|
|
12
|
+
protected _onEncode(data: any, ...params: any[]): any;
|
|
13
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { IServerWebSocket } from './IServerWebSocket';
|
|
2
|
+
import * as ws from 'websocket';
|
|
3
|
+
export declare class ISocketServer {
|
|
4
|
+
protected _is_closed: boolean;
|
|
5
|
+
get isClosed(): boolean;
|
|
6
|
+
private _code;
|
|
7
|
+
get code(): number;
|
|
8
|
+
set code(value: number);
|
|
9
|
+
protected _name: string;
|
|
10
|
+
get name(): string;
|
|
11
|
+
get fullServerName(): string;
|
|
12
|
+
private _web_socket;
|
|
13
|
+
get serverWebSocket(): ws.server;
|
|
14
|
+
protected _ws_clients: Map<number, IServerWebSocket>;
|
|
15
|
+
private _listen_port;
|
|
16
|
+
get listenPort(): number;
|
|
17
|
+
set listenPort(value: number);
|
|
18
|
+
/**
|
|
19
|
+
* websocket can accepted protocol
|
|
20
|
+
*/
|
|
21
|
+
protected _accepted_protocol: any;
|
|
22
|
+
protected _name_vs_class: {};
|
|
23
|
+
registerWebSocketHandleClass(name: string, cls: any): void;
|
|
24
|
+
constructor(server_name: any);
|
|
25
|
+
removeServerWebSocketBySocketId(socketId: any): void;
|
|
26
|
+
run(): Promise<void>;
|
|
27
|
+
stop(): void;
|
|
28
|
+
addClient(client_server: IServerWebSocket): void;
|
|
29
|
+
isOriginAllowed(origin: any): boolean;
|
|
30
|
+
initWebSocket(wss?: any): void;
|
|
31
|
+
onClose(connection: ws.connection, reason: number, desc: string): void;
|
|
32
|
+
onListenning(): void;
|
|
33
|
+
onRequest(req: ws.request): void;
|
|
34
|
+
createWebSocketObjectByProtocol(server_name: string, _ws: ws.connection): IServerWebSocket;
|
|
35
|
+
protected _getServerNameByCookies(cookies: any): string;
|
|
36
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { IProtoFilter, EProtoType } from "./ProtoFilter/IProtoFilter";
|
|
2
|
+
import * as ws from 'websocket';
|
|
3
|
+
export declare class IWebSocket {
|
|
4
|
+
protected _await: boolean;
|
|
5
|
+
get await(): boolean;
|
|
6
|
+
protected _debug_msg: boolean;
|
|
7
|
+
get debug_msg(): boolean;
|
|
8
|
+
set debug_msg(value: boolean);
|
|
9
|
+
protected _socket_id: number;
|
|
10
|
+
get socketId(): number;
|
|
11
|
+
protected _tipKey: string;
|
|
12
|
+
get tipKey(): string;
|
|
13
|
+
protected _ws: ws.connection;
|
|
14
|
+
protected _protoType: EProtoType;
|
|
15
|
+
protected _protoFilter: IProtoFilter;
|
|
16
|
+
protected _protoPath: string;
|
|
17
|
+
protected _ip: string;
|
|
18
|
+
get remoteHost(): string;
|
|
19
|
+
get connected(): boolean;
|
|
20
|
+
constructor(protoType?: EProtoType, protoPath?: string);
|
|
21
|
+
getNewMsg(cmd: any, errcode?: any): any;
|
|
22
|
+
receive_heartbeat(jsonData: any): void;
|
|
23
|
+
send_heartbeat(): void;
|
|
24
|
+
onConnect(_ws: ws.connection): void;
|
|
25
|
+
protected _msgs: Array<any>;
|
|
26
|
+
onMessage(message: ws.Message): void;
|
|
27
|
+
protected _onDecode(message: ws.Message, ...params: any[]): any;
|
|
28
|
+
protected _onEncode(data: any, ...params: any[]): any;
|
|
29
|
+
protected _run_await: boolean;
|
|
30
|
+
protected _awaitMessages(): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* 过滤消息,每个消息处理之前调用
|
|
33
|
+
* @param jsonData
|
|
34
|
+
* @returns
|
|
35
|
+
*/
|
|
36
|
+
filterMsg(jsonData: any): boolean;
|
|
37
|
+
protected _onMessage(data: any): Promise<void>;
|
|
38
|
+
onOpen(e?: any): void;
|
|
39
|
+
onError(e: Error): void;
|
|
40
|
+
onClose(reasonCode: number, description: string): void;
|
|
41
|
+
send(data: any): void;
|
|
42
|
+
close(): void;
|
|
43
|
+
getServerNameFromCmd(cmd: any): any;
|
|
44
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IProtoFilter } from './IProtoFilter';
|
|
2
|
+
import * as protobufjs from 'protobufjs';
|
|
3
|
+
export declare class GoogleProtoFilter implements IProtoFilter {
|
|
4
|
+
protected _root: protobufjs.Root;
|
|
5
|
+
protected _inited: boolean;
|
|
6
|
+
init(path?: string): boolean;
|
|
7
|
+
encode(data: any, root: string): Uint8Array;
|
|
8
|
+
decode(data: any, root: string): any;
|
|
9
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IProtoFilter } from './IProtoFilter';
|
|
2
|
+
import { EProtoType } from "./IProtoFilter";
|
|
3
|
+
export declare let GProtoFactory: ProtoFactory;
|
|
4
|
+
declare class ProtoFactory {
|
|
5
|
+
protected _filters: Map<EProtoType, IProtoFilter>;
|
|
6
|
+
createFilter(type: EProtoType): IProtoFilter;
|
|
7
|
+
}
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import AlipaySdk from 'alipay-sdk';
|
|
2
|
+
import { AliPayUtil } from "alipay_sdk2/AliPayUtil";
|
|
3
|
+
export declare let GAlipayTool: AlipayTool;
|
|
4
|
+
declare class AlipayTool {
|
|
5
|
+
protected _alipaySdk: AlipaySdk;
|
|
6
|
+
protected _aliPay: AliPayUtil;
|
|
7
|
+
protected _cfg: {
|
|
8
|
+
app_id: string;
|
|
9
|
+
app_key: string;
|
|
10
|
+
gateway: string;
|
|
11
|
+
signType: "RSA2" | "RSA";
|
|
12
|
+
/** 指定private key类型, 默认: PKCS1, PKCS8: PRIVATE KEY, PKCS1: RSA PRIVATE KEY */
|
|
13
|
+
keyType: "PKCS1" | "PKCS8";
|
|
14
|
+
alipay_root_cert_sn: string;
|
|
15
|
+
alipay_cert_sn: string;
|
|
16
|
+
app_cert_sn: string;
|
|
17
|
+
notify_url: string;
|
|
18
|
+
};
|
|
19
|
+
init(): boolean;
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* @param title
|
|
23
|
+
* @param order_id
|
|
24
|
+
* @param money
|
|
25
|
+
*/
|
|
26
|
+
doPay(title: string, order_id: string, money: number): string;
|
|
27
|
+
rsaCheck(payInfo: any): boolean;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @param method get|post
|
|
31
|
+
* @param notifyUrl 通知回调
|
|
32
|
+
* @param returnUrl
|
|
33
|
+
* @param outTradeNo
|
|
34
|
+
* @param money 价格
|
|
35
|
+
* @param subject 标题
|
|
36
|
+
* @param body 内容介绍
|
|
37
|
+
*/
|
|
38
|
+
getAlipayPage(method: "get" | "post", notifyUrl: string, returnUrl: string, outTradeNo: string, money: number, subject: string, body: string): Promise<string | import("alipay-sdk").AlipaySdkCommonResult>;
|
|
39
|
+
}
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare let GSmsTool: SMSTool;
|
|
2
|
+
declare class SMSTool {
|
|
3
|
+
protected _is_init: boolean;
|
|
4
|
+
protected _sms_client: any;
|
|
5
|
+
init(): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* 发送短信验证码
|
|
8
|
+
* @param code 验证码
|
|
9
|
+
* @param phone 手机号
|
|
10
|
+
* @param callback 回调
|
|
11
|
+
*/
|
|
12
|
+
sendSMS(code: number, phone: string): Promise<String>;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
declare class ReceiptInfo {
|
|
2
|
+
cancellation_date: string;
|
|
3
|
+
cancellation_date_ms: string;
|
|
4
|
+
cancellation_date_pst: string;
|
|
5
|
+
cancellation_date_reason: string;
|
|
6
|
+
expires_date: string;
|
|
7
|
+
expires_date_ms: string;
|
|
8
|
+
expires_date_pst: string;
|
|
9
|
+
in_app_ownership_type: "FAMILY_SHARED" | "PURCHASED";
|
|
10
|
+
is_in_intro_offer_period: boolean;
|
|
11
|
+
is_trial_period: boolean;
|
|
12
|
+
is_upgraded: boolean;
|
|
13
|
+
offer_code_ref_name: string;
|
|
14
|
+
original_purchase_date: string;
|
|
15
|
+
original_purchase_date_ms: string;
|
|
16
|
+
original_purchase_date_pst: string;
|
|
17
|
+
original_transaction_id: string;
|
|
18
|
+
purchase_date: string;
|
|
19
|
+
purchase_date_ms: string;
|
|
20
|
+
purchase_date_pst: string;
|
|
21
|
+
quantity: number;
|
|
22
|
+
subscription_group_identifier: string;
|
|
23
|
+
web_order_line_item_id: string;
|
|
24
|
+
transaction_id: string;
|
|
25
|
+
product_id: string;
|
|
26
|
+
}
|
|
27
|
+
declare class PendingRenewalInfo {
|
|
28
|
+
auto_renew_product_id: string;
|
|
29
|
+
auto_renew_status: number;
|
|
30
|
+
expiration_intent: number;
|
|
31
|
+
grace_period_expires_date: string;
|
|
32
|
+
grace_period_expires_date_ms: string;
|
|
33
|
+
grace_period_expires_date_pst: string;
|
|
34
|
+
is_in_billing_retry_period: number;
|
|
35
|
+
offer_code_ref_name: string;
|
|
36
|
+
original_transaction_id: string;
|
|
37
|
+
price_consent_status: string;
|
|
38
|
+
product_id: string;
|
|
39
|
+
promotional_offer_id: string;
|
|
40
|
+
}
|
|
41
|
+
declare class InApp {
|
|
42
|
+
cancellation_date: string;
|
|
43
|
+
cancellation_date_ms: string;
|
|
44
|
+
cancellation_date_pst: string;
|
|
45
|
+
cancellation_reason: string;
|
|
46
|
+
expires_date: string;
|
|
47
|
+
expires_date_ms: string;
|
|
48
|
+
expires_date_pst: string;
|
|
49
|
+
is_in_intro_offer_period: boolean;
|
|
50
|
+
is_trial_period: boolean;
|
|
51
|
+
original_purchase_date: string;
|
|
52
|
+
original_purchase_date_ms: string;
|
|
53
|
+
original_purchase_date_pst: string;
|
|
54
|
+
original_transaction_id: string;
|
|
55
|
+
product_id: string;
|
|
56
|
+
promotional_offer_id: string;
|
|
57
|
+
purchase_date: string;
|
|
58
|
+
purchase_date_ms: string;
|
|
59
|
+
purchase_date_pst: string;
|
|
60
|
+
quantity: number;
|
|
61
|
+
transaction_id: string;
|
|
62
|
+
web_order_line_item_id: string;
|
|
63
|
+
}
|
|
64
|
+
declare class Receipt {
|
|
65
|
+
adam_id: number;
|
|
66
|
+
app_item_id: number;
|
|
67
|
+
application_version: string;
|
|
68
|
+
bundle_id: string;
|
|
69
|
+
download_id: number;
|
|
70
|
+
expiration_date: string;
|
|
71
|
+
expiration_date_ms: string;
|
|
72
|
+
expiration_date_pst: string;
|
|
73
|
+
in_app: InApp;
|
|
74
|
+
original_application_version: string;
|
|
75
|
+
original_purchase_date: string;
|
|
76
|
+
original_purchase_date_ms: string;
|
|
77
|
+
original_purchase_date_pst: string;
|
|
78
|
+
preorder_date: string;
|
|
79
|
+
preorder_date_ms: string;
|
|
80
|
+
preorder_date_pst: string;
|
|
81
|
+
receipt_creation_date: string;
|
|
82
|
+
receipt_creation_date_ms: string;
|
|
83
|
+
receipt_creation_date_pst: string;
|
|
84
|
+
receipt_type: string;
|
|
85
|
+
request_date: string;
|
|
86
|
+
request_date_ms: string;
|
|
87
|
+
request_date_pst: string;
|
|
88
|
+
version_external_identifier: number;
|
|
89
|
+
}
|
|
90
|
+
export declare class ResponseBody {
|
|
91
|
+
environment: "Sandbox" | "Production";
|
|
92
|
+
is_retryable: boolean;
|
|
93
|
+
latest_receipt: string;
|
|
94
|
+
latest_receipt_info: Array<ReceiptInfo>;
|
|
95
|
+
pending_renewal_info: Array<PendingRenewalInfo>;
|
|
96
|
+
receipt: Receipt;
|
|
97
|
+
status: number;
|
|
98
|
+
}
|
|
99
|
+
export declare class NotificationType {
|
|
100
|
+
static CANCEL: string;
|
|
101
|
+
static DID_CHANGE_RENEWAL_PREF: string;
|
|
102
|
+
static DID_CHANGE_RENEWAL_STATUS: string;
|
|
103
|
+
static DID_RECOVER: string;
|
|
104
|
+
static DID_RENEW: string;
|
|
105
|
+
static INTERACTIVE_RENEWAL: string;
|
|
106
|
+
}
|
|
107
|
+
export declare class NotificationBody {
|
|
108
|
+
unified_receipt: ResponseBody;
|
|
109
|
+
environment: string;
|
|
110
|
+
auto_renew_status: string;
|
|
111
|
+
auto_renew_status_change_date: string;
|
|
112
|
+
bvrs: string;
|
|
113
|
+
bid: string;
|
|
114
|
+
password: string;
|
|
115
|
+
auto_renew_product_id: string;
|
|
116
|
+
notification_type: string;
|
|
117
|
+
}
|
|
118
|
+
export declare let GAppleTool: AppleTool;
|
|
119
|
+
declare class AppleTool {
|
|
120
|
+
protected _verifyUrl: string;
|
|
121
|
+
protected _sandboxVerifyUrl: string;
|
|
122
|
+
onNotify(nb: NotificationBody): Promise<void>;
|
|
123
|
+
onVerify(receipt: string, environment: string): Promise<ResponseBody>;
|
|
124
|
+
signature(nickname: string, create_time: number, appBundleID: string, productIdentifier: string, offerIdentifier: string): {
|
|
125
|
+
keyIdentifier: string;
|
|
126
|
+
nonce: any;
|
|
127
|
+
timestamp: number;
|
|
128
|
+
signature: any;
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export declare class QQUserInfo {
|
|
2
|
+
ret: number;
|
|
3
|
+
msg: string;
|
|
4
|
+
is_lost: number;
|
|
5
|
+
nickname: string;
|
|
6
|
+
gender: string;
|
|
7
|
+
province: string;
|
|
8
|
+
city: string;
|
|
9
|
+
year: string;
|
|
10
|
+
constellation: string;
|
|
11
|
+
figureurl: string;
|
|
12
|
+
figureurl_1: string;
|
|
13
|
+
figureurl_2: string;
|
|
14
|
+
figureurl_qq_1: string;
|
|
15
|
+
figureurl_qq_2: string;
|
|
16
|
+
figureurl_qq: string;
|
|
17
|
+
figureurl_type: string;
|
|
18
|
+
is_yellow_vip: "";
|
|
19
|
+
vip: string;
|
|
20
|
+
yellow_vip_level: string;
|
|
21
|
+
level: string;
|
|
22
|
+
is_yellow_year_vip: string;
|
|
23
|
+
}
|
|
24
|
+
export declare let GQQTool: QQTool;
|
|
25
|
+
export declare class QQTool {
|
|
26
|
+
/**
|
|
27
|
+
* 获取Authorization Code
|
|
28
|
+
* @param scope 可选 请求用户授权时向用户显示的可进行授权的列表。
|
|
29
|
+
可填写的值是API文档中列出的接口,以及一些动作型的授权(目前仅有:do_like),如果要填写多个接口名称,请用逗号隔开。
|
|
30
|
+
例如:scope=get_user_info,list_album,upload_pic,do_like
|
|
31
|
+
不传则默认请求对接口get_user_info进行授权。
|
|
32
|
+
建议控制授权项的数量,只传入必要的接口名称,因为授权项越多,用户越可能拒绝进行任何授权。
|
|
33
|
+
* @param display 仅PC网站接入时使用。
|
|
34
|
+
用于展示的样式。不传则默认展示为PC下的样式。
|
|
35
|
+
如果传入“mobile”,则展示为mobile端下的样式。
|
|
36
|
+
*/
|
|
37
|
+
getAuthCodeUrl(scope?: string, display?: string): string;
|
|
38
|
+
getAccessToken(auth_code: string): Promise<string>;
|
|
39
|
+
getOpenId(access_token: string): Promise<string>;
|
|
40
|
+
getUserInfo(access_token: string, openid: string): Promise<QQUserInfo>;
|
|
41
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare class WechatOAMsg {
|
|
2
|
+
toUserName: string;
|
|
3
|
+
fromUserName: string;
|
|
4
|
+
createTime: number;
|
|
5
|
+
msgType: string;
|
|
6
|
+
content: string;
|
|
7
|
+
msgId: number;
|
|
8
|
+
}
|
|
9
|
+
export declare let GWechatOATool: WechatOATool;
|
|
10
|
+
export declare class WechatOATool {
|
|
11
|
+
convertMsg(xmlStr: string): WechatOAMsg;
|
|
12
|
+
toReplyXmlStr(msg: WechatOAMsg): string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare class WechatUserInfo {
|
|
2
|
+
openid: string;
|
|
3
|
+
nickname: string;
|
|
4
|
+
sex: number;
|
|
5
|
+
province: string;
|
|
6
|
+
city: string;
|
|
7
|
+
country: string;
|
|
8
|
+
headimgurl: string;
|
|
9
|
+
privilege: string[];
|
|
10
|
+
unionid: string;
|
|
11
|
+
}
|
|
12
|
+
export declare let GWechatTool: WechatTool;
|
|
13
|
+
export declare class WechatTool {
|
|
14
|
+
/**
|
|
15
|
+
* 获取获取code的url
|
|
16
|
+
*/
|
|
17
|
+
getAuthCodeUrl(): string;
|
|
18
|
+
getAccessInfo(auth_code: string): Promise<any>;
|
|
19
|
+
getUserInfo(access_token: string, openid: string): Promise<WechatUserInfo>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Engine } from './../Engine/Engine';
|
|
2
|
+
import { Request } from '../Engine/Request';
|
|
3
|
+
import { Response } from '../Engine/Response';
|
|
4
|
+
export declare class BaseController {
|
|
5
|
+
protected _request: Request;
|
|
6
|
+
get request(): Request;
|
|
7
|
+
protected _response: Response;
|
|
8
|
+
get response(): Response;
|
|
9
|
+
protected _module: string;
|
|
10
|
+
protected _ctr_name: string;
|
|
11
|
+
get ctrName(): string;
|
|
12
|
+
protected _engine: Engine;
|
|
13
|
+
get postData(): any;
|
|
14
|
+
get paramData(): any;
|
|
15
|
+
constructor(req: Request, res: Response, engine: Engine);
|
|
16
|
+
init(): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* 方便static ctr使用
|
|
19
|
+
* @param req
|
|
20
|
+
* @param res
|
|
21
|
+
* @param engine
|
|
22
|
+
*/
|
|
23
|
+
initStatic(req: Request, res: Response, engine: Engine): void;
|
|
24
|
+
protected _init_data(model?: any): {
|
|
25
|
+
model: any;
|
|
26
|
+
};
|
|
27
|
+
showJson(model?: any): void;
|
|
28
|
+
show(model?: any): void;
|
|
29
|
+
showText(text: any, noMeta?: boolean): void;
|
|
30
|
+
redirect(module?: string, controller?: string, action?: string, params?: any): void;
|
|
31
|
+
parseFullUrl(module: string, controller: string, action: string): string;
|
|
32
|
+
get remoteHost(): string;
|
|
33
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BaseController } from './BaseController';
|
|
2
|
+
import { UserModel } from '../../Service/UserService';
|
|
3
|
+
export declare class BaseUserController<T extends UserModel> extends BaseController {
|
|
4
|
+
protected _user_session_id: string;
|
|
5
|
+
protected _self_user: T;
|
|
6
|
+
protected _user: T;
|
|
7
|
+
protected _session_id: string;
|
|
8
|
+
get selfUser(): T;
|
|
9
|
+
get isSelf(): boolean;
|
|
10
|
+
get isLogin(): boolean;
|
|
11
|
+
get isCreator(): boolean;
|
|
12
|
+
get isAdmin(): boolean;
|
|
13
|
+
get isProxy(): boolean;
|
|
14
|
+
get isCommon(): boolean;
|
|
15
|
+
init(): Promise<void>;
|
|
16
|
+
protected _logout(): void;
|
|
17
|
+
protected _login(user: T): void;
|
|
18
|
+
/**
|
|
19
|
+
* 用户信息发生更改,同步更新session里面的用户信息
|
|
20
|
+
*/
|
|
21
|
+
protected _update_session(): Promise<void>;
|
|
22
|
+
update_user(user_id: number): Promise<void>;
|
|
23
|
+
protected _init_data(datas: any): {
|
|
24
|
+
model: any;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BaseController } from './BaseController';
|
|
2
|
+
import { UserModel } from '../../Service/MongoUserService';
|
|
3
|
+
export declare class MongoBaseUserController<T extends UserModel> extends BaseController {
|
|
4
|
+
protected _user_session_id: string;
|
|
5
|
+
protected _self_user: T;
|
|
6
|
+
protected _user: T;
|
|
7
|
+
protected _session_id: string;
|
|
8
|
+
get selfUser(): T;
|
|
9
|
+
get isSelf(): boolean;
|
|
10
|
+
get isLogin(): boolean;
|
|
11
|
+
get isCreator(): boolean;
|
|
12
|
+
get isAdmin(): boolean;
|
|
13
|
+
get isProxy(): boolean;
|
|
14
|
+
get isCommon(): boolean;
|
|
15
|
+
init(): Promise<void>;
|
|
16
|
+
protected _logout(): void;
|
|
17
|
+
protected _login(user: T): void;
|
|
18
|
+
/**
|
|
19
|
+
* 用户信息发生更改,同步更新session里面的用户信息
|
|
20
|
+
*/
|
|
21
|
+
protected _update_session(): Promise<void>;
|
|
22
|
+
update_user(user_id: number): Promise<void>;
|
|
23
|
+
protected _init_data(datas: any): {
|
|
24
|
+
model: any;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AdminValidate(target: any, propertyName: string, descriptor: TypedPropertyDescriptor<Function>): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function CreatorValidate(target: any, propertyName: string, descriptor: TypedPropertyDescriptor<Function>): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function JsonAdminValidate(target: any, propertyName: string, descriptor: TypedPropertyDescriptor<Function>): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function JsonCreatorValidate(target: any, propertyName: string, descriptor: TypedPropertyDescriptor<Function>): void;
|