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,21 @@
|
|
|
1
|
+
import { BaseController } from "../Controller/BaseController";
|
|
2
|
+
export declare let GCtrMgr: ControllerManager;
|
|
3
|
+
declare class ControllerManager {
|
|
4
|
+
protected _ctrs: Map<string, Map<string, BaseController>>;
|
|
5
|
+
protected _ctr_cls: Map<string, Map<string, any>>;
|
|
6
|
+
protected _cache_action_names: Map<string, Map<string, Map<string, string>>>;
|
|
7
|
+
registerController(module_name: string, ctr_name: string, cls: Function): void;
|
|
8
|
+
protected _cacheActionName(module_name: string, ctr_name: string, cls: Function): void;
|
|
9
|
+
getActionName(module_name: string, ctr_name: string, action_name: string): any;
|
|
10
|
+
/**
|
|
11
|
+
* 静态ctr,这样,ctr就不会被多次创建
|
|
12
|
+
* @param module_name
|
|
13
|
+
* @param ctr_name
|
|
14
|
+
* @param obj
|
|
15
|
+
*/
|
|
16
|
+
registerStaticController(module_name: string, ctr_name: string, obj: BaseController): void;
|
|
17
|
+
protected _cacheActionNameForStatic(module_name: string, ctr_name: string, obj: BaseController): void;
|
|
18
|
+
getStaticCtr(module_name: string, controller_name: string): BaseController;
|
|
19
|
+
getClass(module_name: string, controller_name: string): any;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Response } from './Response';
|
|
3
|
+
import { Request } from './Request';
|
|
4
|
+
import { RazorJs } from './RazorJs';
|
|
5
|
+
import * as http from "http";
|
|
6
|
+
import { WebServerConfig } from '../../Config/FrameworkConfig';
|
|
7
|
+
import * as Express from 'express';
|
|
8
|
+
export declare class Engine {
|
|
9
|
+
protected _app: import("express-serve-static-core").Express;
|
|
10
|
+
protected _cfg: WebServerConfig;
|
|
11
|
+
get cfg(): WebServerConfig;
|
|
12
|
+
protected _server: http.Server;
|
|
13
|
+
protected _razorJs: RazorJs;
|
|
14
|
+
protected _root_path: string;
|
|
15
|
+
constructor(cfg: WebServerConfig, razorJs: RazorJs);
|
|
16
|
+
start(): void;
|
|
17
|
+
protected _all(_req: Express.Request, _res: Express.Response): Promise<void>;
|
|
18
|
+
stop(): void;
|
|
19
|
+
getRenderHtml(req: Request, res: Response, datas: any): any;
|
|
20
|
+
protected _getRenderHtml(req: Request, res: Response, tmpl: any, params: any): any;
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare class RazorJs {
|
|
2
|
+
protected _request: any;
|
|
3
|
+
protected _response: any;
|
|
4
|
+
cache: {
|
|
5
|
+
_data: {};
|
|
6
|
+
set: (key: any, val: any) => void;
|
|
7
|
+
get: (key: any) => any;
|
|
8
|
+
reset: () => void;
|
|
9
|
+
};
|
|
10
|
+
localsName: string;
|
|
11
|
+
constructor();
|
|
12
|
+
resolveInclude(name: any, filename: any): any;
|
|
13
|
+
_handleCache(options: any, template?: any): any;
|
|
14
|
+
includeFile(path: any, options: any): any;
|
|
15
|
+
includeSource(path: any, options: any): string;
|
|
16
|
+
_cpOptsInData(data: any, opts: any): void;
|
|
17
|
+
compile(template: any, opts: any): any;
|
|
18
|
+
render(req: any, res: any, tmpl_path: any, data: any, opts: any): any;
|
|
19
|
+
renderFile(): any;
|
|
20
|
+
clearCache(): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/// <reference types="qs" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import * as Express from 'express';
|
|
4
|
+
import { WebServerConfig } from "../../Config/FrameworkConfig";
|
|
5
|
+
export declare class Request {
|
|
6
|
+
protected _req: Express.Request;
|
|
7
|
+
get baseReq(): Express.Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>;
|
|
8
|
+
protected _cfg: WebServerConfig;
|
|
9
|
+
protected _post_cb: () => void;
|
|
10
|
+
set onPost(value: any);
|
|
11
|
+
protected _module: string;
|
|
12
|
+
get module(): string;
|
|
13
|
+
protected _controller: string;
|
|
14
|
+
get controller(): string;
|
|
15
|
+
protected _action: string;
|
|
16
|
+
get action(): string;
|
|
17
|
+
protected _suffix: string;
|
|
18
|
+
get suffix(): string;
|
|
19
|
+
protected _file_url: any;
|
|
20
|
+
get fileUrl(): any;
|
|
21
|
+
protected _params: any;
|
|
22
|
+
get params(): any;
|
|
23
|
+
get postData(): any;
|
|
24
|
+
get url(): string;
|
|
25
|
+
get root(): string;
|
|
26
|
+
get method(): string;
|
|
27
|
+
get headers(): import("http").IncomingHttpHeaders;
|
|
28
|
+
get remoteHost(): string;
|
|
29
|
+
constructor(req: Express.Request, cfg: WebServerConfig);
|
|
30
|
+
getCookie(key: string): any;
|
|
31
|
+
protected _init(): void;
|
|
32
|
+
protected _addListener(event: string | symbol, listener: (...args: any[]) => void): void;
|
|
33
|
+
protected _parseParams(path: string): void;
|
|
34
|
+
debugInfo(): void;
|
|
35
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as Express from 'express';
|
|
2
|
+
import { WebServerConfig } from "../../Config/FrameworkConfig";
|
|
3
|
+
export declare class Response {
|
|
4
|
+
protected _res: Express.Response;
|
|
5
|
+
protected _cookie_prefix: string;
|
|
6
|
+
protected _cfg: WebServerConfig;
|
|
7
|
+
constructor(res: Express.Response, cfg: WebServerConfig);
|
|
8
|
+
protected _init(): void;
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param key
|
|
12
|
+
* @param value
|
|
13
|
+
* @param time 秒
|
|
14
|
+
*/
|
|
15
|
+
setCookie(key: string, value: any, time?: any): void;
|
|
16
|
+
clearCookie(key: string): void;
|
|
17
|
+
redirect(path: string): void;
|
|
18
|
+
renderJson(data: any, origin?: string | string[] | undefined): void;
|
|
19
|
+
renderJson404(origin?: string | string[] | undefined): void;
|
|
20
|
+
renderJson500(origin?: string | string[] | undefined): void;
|
|
21
|
+
renderHtml(html: string): void;
|
|
22
|
+
render404(html?: string): void;
|
|
23
|
+
renderOptions(method: any, origin: any): void;
|
|
24
|
+
renderFile(fullPath: string): void;
|
|
25
|
+
downloadFile(fullPath: string): void;
|
|
26
|
+
render304(): void;
|
|
27
|
+
debugInfo(data: any): void;
|
|
28
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Engine } from './Engine/Engine';
|
|
2
|
+
import { WebServerConfig } from '../Config/FrameworkConfig';
|
|
3
|
+
export declare class IWebServer {
|
|
4
|
+
protected _engine: Engine;
|
|
5
|
+
/**
|
|
6
|
+
* 启动服务器
|
|
7
|
+
* @param server_index 这个是服务器的配置index
|
|
8
|
+
*/
|
|
9
|
+
start(cfg: WebServerConfig): Promise<boolean>;
|
|
10
|
+
stop(): void;
|
|
11
|
+
/**
|
|
12
|
+
* 注册控制器
|
|
13
|
+
* eg:GControllerMgr.registerController("Admin","System",SystemController)
|
|
14
|
+
*/
|
|
15
|
+
protected _registerController(): void;
|
|
16
|
+
/**
|
|
17
|
+
* 注册路由
|
|
18
|
+
*/
|
|
19
|
+
protected _registerRouter(): void;
|
|
20
|
+
}
|