cgserver 10.0.2 → 10.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.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ByteTool = void 0;
3
+ exports.gByteTool = exports.ByteTool = void 0;
4
4
  class ByteTool {
5
5
  //构建一个视图,把字节数组写到缓存中,索引从0开始
6
6
  getView(bytes) {
@@ -82,3 +82,4 @@ class ByteTool {
82
82
  }
83
83
  }
84
84
  exports.ByteTool = ByteTool;
85
+ exports.gByteTool = new ByteTool();
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MongoServiceManager = void 0;
3
+ exports.gMongoServiceMgr = exports.MongoServiceManager = void 0;
4
4
  const MongoBaseService_1 = require("./MongoBaseService");
5
5
  class MongoServiceManager {
6
6
  _services = {};
@@ -24,3 +24,4 @@ class MongoServiceManager {
24
24
  }
25
25
  }
26
26
  exports.MongoServiceManager = MongoServiceManager;
27
+ exports.gMongoServiceMgr = new MongoServiceManager();
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AlipayTool = exports.AlipayCallBack = exports.AlipayResult = void 0;
3
+ exports.gAlipayTool = exports.AlipayTool = exports.AlipayCallBack = exports.AlipayResult = void 0;
4
4
  const alipay_sdk_1 = require("alipay-sdk");
5
5
  const aliUtil = require("alipay-sdk/lib/util");
6
6
  const AliPayUtil_1 = require("alipay_sdk2/AliPayUtil");
@@ -202,3 +202,4 @@ class AlipayTool {
202
202
  }
203
203
  }
204
204
  exports.AlipayTool = AlipayTool;
205
+ exports.gAlipayTool = new AlipayTool();
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SMSTool = void 0;
3
+ exports.gSMSTool = exports.SMSTool = void 0;
4
4
  const IServerConfig_1 = require("../Config/IServerConfig");
5
5
  const Log_1 = require("../Logic/Log");
6
6
  let SMSClient = require("@alicloud/sms-sdk");
@@ -47,3 +47,4 @@ class SMSTool {
47
47
  }
48
48
  }
49
49
  exports.SMSTool = SMSTool;
50
+ exports.gSMSTool = new SMSTool();
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AppleTool = exports.NotificationBody = exports.NotificationType = exports.ResponseBody = void 0;
3
+ exports.gAppleTool = exports.AppleTool = exports.NotificationBody = exports.NotificationType = exports.ResponseBody = void 0;
4
4
  const ec_key_1 = require("ec-key");
5
5
  const uuid_1 = require("uuid");
6
6
  const fs = require("fs");
@@ -232,3 +232,4 @@ class AppleTool {
232
232
  }
233
233
  }
234
234
  exports.AppleTool = AppleTool;
235
+ exports.gAppleTool = new AppleTool();
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EmailTool = void 0;
3
+ exports.gEmailTool = exports.EmailTool = void 0;
4
4
  const nodeMailer = require("nodemailer");
5
5
  const IServerConfig_1 = require("../Config/IServerConfig");
6
6
  const Log_1 = require("../Logic/Log");
@@ -35,3 +35,4 @@ class EmailTool {
35
35
  }
36
36
  }
37
37
  exports.EmailTool = EmailTool;
38
+ exports.gEmailTool = new EmailTool();
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QiniuTool = void 0;
3
+ exports.gQiniuTool = exports.QiniuTool = void 0;
4
4
  const qiniu = require("qiniu");
5
5
  const IServerConfig_1 = require("../Config/IServerConfig");
6
6
  const Log_1 = require("../Logic/Log");
@@ -26,3 +26,4 @@ class QiniuTool {
26
26
  }
27
27
  }
28
28
  exports.QiniuTool = QiniuTool;
29
+ exports.gQiniuTool = new QiniuTool();
@@ -30,38 +30,38 @@ const Core_1 = require("./Core/Core");
30
30
  * cg引擎的,全局对象
31
31
  */
32
32
  class global {
33
- static gMongoServiceMgr = new MongoServiceManager_1.MongoServiceManager();
34
- static gCgServer = new cgserver_1.CgServer();
35
- static gDbCache = new DBCache_1.DBCache();
36
- static gTriggerMgr = new TriggerMgr_1.TriggerManager();
37
- static gMongoMgr = new MongoManager_1.MongoManager();
38
- static gMSSqlMgr = new MSSqlManager_1.MSSqlManager();
39
- static gMysqlMgr = new MysqlManager_1.MysqlManager();
40
- static gRedisMgr = new RedisManager_1.RedisManager();
41
- static gCacheTool = new CacheTool_1.CacheTool();
42
- static gHttpTool = new HttpTool_1.HttpTool();
43
- static gLog = new Log_1.Log();
44
- static gSyncQueueTool = new SyncQueueTool_1.SyncQueueTool();
45
- static gEventTool = new EventTool_1.EventTool();
46
- static gByteTool = new ByteTool_1.ByteTool();
47
- static gSmsTool = new Alisms_1.SMSTool();
48
- static gEmailTool = new EmailTool_1.EmailTool();
49
- static gQiniuTool = new QiniuTool_1.QiniuTool();
50
- static gQQTool = new QQTool_1.QQTool();
51
- static gWechatTool = new WechatTool_1.WechatTool();
52
- static gWechatOATool = new WechatTool_1.WechatTool();
53
- static gAlipayTool = new AlipayTool_1.AlipayTool();
54
- static gAppleTool = new AppleTool_1.AppleTool();
55
- static gProtoFactory = new ProtoFactory_1.ProtoFactory();
33
+ static gMongoServiceMgr1 = MongoServiceManager_1.gMongoServiceMgr;
34
+ static gCgServer1 = cgserver_1.gCgServer;
35
+ static gDbCache1 = DBCache_1.gDbCache;
36
+ static gTriggerMgr1 = TriggerMgr_1.gTriggerMgr;
37
+ static gMongoMgr1 = MongoManager_1.gMongoMgr;
38
+ static gMSSqlMgr1 = MSSqlManager_1.gMSSqlMgr;
39
+ static gMysqlMgr1 = MysqlManager_1.gMysqlMgr;
40
+ static gRedisMgr1 = RedisManager_1.gRedisMgr;
41
+ static gCacheTool1 = CacheTool_1.gCacheTool;
42
+ static gHttpTool1 = HttpTool_1.gHttpTool;
43
+ static gLog1 = Log_1.gLog;
44
+ static gSyncQueueTool1 = SyncQueueTool_1.gSyncQueueTool;
45
+ static gEventTool1 = EventTool_1.gEventTool;
46
+ static gByteTool1 = ByteTool_1.gByteTool;
47
+ static gSmsTool1 = Alisms_1.gSMSTool;
48
+ static gEmailTool1 = EmailTool_1.gEmailTool;
49
+ static gQiniuTool1 = QiniuTool_1.gQiniuTool;
50
+ static gQQTool1 = QQTool_1.gQQTool;
51
+ static gWechatTool1 = WechatTool_1.gWechatTool;
52
+ static gWechatOATool1 = WechatTool_1.gWechatTool;
53
+ static gAlipayTool1 = AlipayTool_1.gAlipayTool;
54
+ static gAppleTool1 = AppleTool_1.gAppleTool;
55
+ static gProtoFactory1 = ProtoFactory_1.gProtoFactory;
56
56
  /**
57
57
  * web服务中mvc的控制器管理器
58
58
  */
59
- static gCtrMgr = new ControllerManager_1.ControllerManager();
59
+ static gCtrMgr = ControllerManager_1.gCtrMgr;
60
60
  /**
61
61
  * mongo版本的缓存服务
62
62
  * 可以用来缓存kv数据
63
63
  */
64
- static gMongoCacheSer = new MongoCacheService_1.MongoCacheService();
64
+ static gMongoCacheSer = MongoCacheService_1.gMongoCacheSer;
65
65
  /**
66
66
  * 一些通用的常用函数,
67
67
  * 比如格式化字符串,常用加解密,
@@ -18,3 +18,4 @@ export declare class ByteTool {
18
18
  getFloat32Bytes(num: number, littleEndian?: boolean): Uint8Array;
19
19
  getFloat64Bytes(num: number, littleEndian?: boolean): Uint8Array;
20
20
  }
21
+ export declare let gByteTool: ByteTool;
@@ -11,3 +11,4 @@ export declare class MongoServiceManager {
11
11
  }, dbname?: string): MongoBaseService<T>;
12
12
  getService<T extends MongoBaseService<any>>(table: string, dbname?: string): T;
13
13
  }
14
+ export declare let gMongoServiceMgr: MongoServiceManager;
@@ -105,3 +105,4 @@ export declare class AlipayTool {
105
105
  */
106
106
  getAlipayPage(method: "get" | "post", notifyUrl: string, returnUrl: string, outTradeNo: string, money: number, subject: string, body: string): Promise<string | import("alipay-sdk").AlipaySdkCommonResult>;
107
107
  }
108
+ export declare let gAlipayTool: AlipayTool;
@@ -10,3 +10,4 @@ export declare class SMSTool {
10
10
  */
11
11
  sendSMS(code: number, phone: string): Promise<String>;
12
12
  }
13
+ export declare let gSMSTool: SMSTool;
@@ -127,4 +127,5 @@ export declare class AppleTool {
127
127
  signature: any;
128
128
  };
129
129
  }
130
+ export declare let gAppleTool: AppleTool;
130
131
  export {};
@@ -1,3 +1,4 @@
1
1
  export declare class EmailTool {
2
2
  send(to: string, subject: string, html: string): Promise<unknown>;
3
3
  }
4
+ export declare let gEmailTool: EmailTool;
@@ -2,3 +2,4 @@ export declare class QiniuTool {
2
2
  get host(): string;
3
3
  getUploadToken(filename: any): string;
4
4
  }
5
+ export declare let gQiniuTool: QiniuTool;
@@ -1,64 +1,40 @@
1
- import { TriggerManager } from './AI/TriggerMgr';
2
- import { ByteTool } from './Core/ByteTool';
3
- import { DBCache } from './Database/Decorator/DBCache';
4
- import { MSSqlManager } from './Database/MSSqlManager';
5
- import { MongoManager } from './Database/Mongo/MongoManager';
6
- import { MongoServiceManager } from './Database/Mongo/MongoServiceManager';
7
- import { MysqlManager } from './Database/MysqlManager';
8
- import { RedisManager } from './Database/RedisManager';
9
- import { CacheTool } from './Logic/CacheTool';
10
- import { EventTool } from './Logic/EventTool';
11
- import { HttpTool } from './Logic/HttpTool';
12
- import { Log } from './Logic/Log';
13
- import { SyncQueueTool } from './Logic/SyncQueueTool';
14
- import { MongoCacheService } from './Service/MongoCacheService';
15
- import { ProtoFactory } from './SocketServer/ProtoFilter/ProtoFactory';
16
- import { AlipayTool } from './ThirdParty/AlipayTool';
17
- import { SMSTool } from './ThirdParty/Alisms';
18
- import { AppleTool } from './ThirdParty/AppleTool';
19
- import { EmailTool } from './ThirdParty/EmailTool';
20
- import { QQTool } from './ThirdParty/QQTool';
21
- import { QiniuTool } from './ThirdParty/QiniuTool';
22
- import { WechatTool } from './ThirdParty/WechatTool';
23
- import { ControllerManager } from './WebServer/Engine/ControllerManager';
24
- import { CgServer } from './cgserver';
25
- import { core } from './Core/Core';
1
+ import { core } from "./Core/Core";
26
2
  /**
27
3
  * cg引擎的,全局对象
28
4
  */
29
5
  export declare class global {
30
- static gMongoServiceMgr: MongoServiceManager;
31
- static gCgServer: CgServer;
32
- static gDbCache: DBCache;
33
- static gTriggerMgr: TriggerManager;
34
- static gMongoMgr: MongoManager;
35
- static gMSSqlMgr: MSSqlManager;
36
- static gMysqlMgr: MysqlManager;
37
- static gRedisMgr: RedisManager;
38
- static gCacheTool: CacheTool;
39
- static gHttpTool: HttpTool;
40
- static gLog: Log;
41
- static gSyncQueueTool: SyncQueueTool;
42
- static gEventTool: EventTool;
43
- static gByteTool: ByteTool;
44
- static gSmsTool: SMSTool;
45
- static gEmailTool: EmailTool;
46
- static gQiniuTool: QiniuTool;
47
- static gQQTool: QQTool;
48
- static gWechatTool: WechatTool;
49
- static gWechatOATool: WechatTool;
50
- static gAlipayTool: AlipayTool;
51
- static gAppleTool: AppleTool;
52
- static gProtoFactory: ProtoFactory;
6
+ static gMongoServiceMgr1: import("./Database/Mongo/MongoServiceManager").MongoServiceManager;
7
+ static gCgServer1: import("./cgserver").CgServer;
8
+ static gDbCache1: import("./Database/Decorator/DBCache").DBCache;
9
+ static gTriggerMgr1: import("./AI/TriggerMgr").TriggerManager;
10
+ static gMongoMgr1: import("./Database/Mongo/MongoManager").MongoManager;
11
+ static gMSSqlMgr1: import("./Database/MSSqlManager").MSSqlManager;
12
+ static gMysqlMgr1: import("./Database/MysqlManager").MysqlManager;
13
+ static gRedisMgr1: import("./Database/RedisManager").RedisManager;
14
+ static gCacheTool1: import("./Logic/CacheTool").CacheTool;
15
+ static gHttpTool1: import("./Logic/HttpTool").HttpTool;
16
+ static gLog1: import("./Logic/Log").Log;
17
+ static gSyncQueueTool1: import("./Logic/SyncQueueTool").SyncQueueTool;
18
+ static gEventTool1: import("./Logic/EventTool").EventTool;
19
+ static gByteTool1: import("./Core/ByteTool").ByteTool;
20
+ static gSmsTool1: import("./ThirdParty/Alisms").SMSTool;
21
+ static gEmailTool1: import("./ThirdParty/EmailTool").EmailTool;
22
+ static gQiniuTool1: import("./ThirdParty/QiniuTool").QiniuTool;
23
+ static gQQTool1: import("./ThirdParty/QQTool").QQTool;
24
+ static gWechatTool1: import("./ThirdParty/WechatTool").WechatTool;
25
+ static gWechatOATool1: import("./ThirdParty/WechatTool").WechatTool;
26
+ static gAlipayTool1: import("./ThirdParty/AlipayTool").AlipayTool;
27
+ static gAppleTool1: import("./ThirdParty/AppleTool").AppleTool;
28
+ static gProtoFactory1: import("./SocketServer/ProtoFilter/ProtoFactory").ProtoFactory;
53
29
  /**
54
30
  * web服务中mvc的控制器管理器
55
31
  */
56
- static gCtrMgr: ControllerManager;
32
+ static gCtrMgr: import("./WebServer/Engine/ControllerManager").ControllerManager;
57
33
  /**
58
34
  * mongo版本的缓存服务
59
35
  * 可以用来缓存kv数据
60
36
  */
61
- static gMongoCacheSer: MongoCacheService;
37
+ static gMongoCacheSer: import("./Service/MongoCacheService").MongoCacheService;
62
38
  /**
63
39
  * 一些通用的常用函数,
64
40
  * 比如格式化字符串,常用加解密,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cgserver",
3
- "version": "10.0.2",
3
+ "version": "10.0.3",
4
4
  "author": "trojan",
5
5
  "type": "commonjs",
6
6
  "description": "free for all.Websocket or Http",