cgserver 8.3.6 → 8.4.1
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/README.md +3 -23
- package/dist/lib/Framework/Database/RedisManager.js +12 -367
- package/dist/types/Framework/Database/MongoBaseService.d.ts +2 -2
- package/dist/types/Framework/Database/MongoManager.d.ts +2 -2
- package/dist/types/Framework/Database/RedisManager.d.ts +7 -54
- package/package.json +28 -28
package/README.md
CHANGED
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
1
|
|
3
|
-
2
|
|
4
|
-
6.6.5
|
|
5
|
-
1、mongomanager可单独初始化
|
|
6
|
-
6.6.5
|
|
7
|
-
1、mongoaccountservice增加登录时间和ip
|
|
8
|
-
6.5.8
|
|
9
|
-
1、修改编译bug
|
|
10
|
-
6.5.7
|
|
11
|
-
1、debug标志又cgserver处命令行处理,默认为false
|
|
12
|
-
6.5.7
|
|
13
|
-
1、增加配置debug,是否是debug调试模式,主要区别于读取数据档,debug默认读取file_d文件,release默认读取file_r文件,如果不存在都会读取file文件
|
|
14
|
-
6.5.6
|
|
15
|
-
1、增加一点服务器事件,目前cgserver只支持start
|
|
16
|
-
6.5.5
|
|
17
|
-
1、修改GLog的输出,控制台的输出由FrameworkConfig控制,console_level(默认0) -1都不输出,0仅输出error,1都输出
|
|
18
|
-
6.5.3
|
|
19
|
-
1、增加账号状态EAccountState
|
|
20
|
-
6.5.3
|
|
21
|
-
1、事件分发器GEventTool添加emit
|
|
22
|
-
6.5.2
|
|
23
|
-
1、添加事件分发器GEventTool
|
|
1
|
+
8.4.1
|
|
2
|
+
1、更新所有库到最新版
|
|
3
|
+
2、暴力升级redis接口注意修改
|
|
@@ -9,12 +9,9 @@ class RedisManager {
|
|
|
9
9
|
get redis() {
|
|
10
10
|
return this._redis;
|
|
11
11
|
}
|
|
12
|
-
_resis_init_succ = false;
|
|
13
12
|
_redisCfg = null;
|
|
14
|
-
constructor() {
|
|
15
|
-
}
|
|
16
13
|
async init(redisCfg) {
|
|
17
|
-
|
|
14
|
+
let p = new Promise((resolve) => {
|
|
18
15
|
if (!redisCfg || !redisCfg.open) {
|
|
19
16
|
resolve(null);
|
|
20
17
|
return;
|
|
@@ -24,8 +21,8 @@ class RedisManager {
|
|
|
24
21
|
return;
|
|
25
22
|
}
|
|
26
23
|
this._redisCfg = redisCfg;
|
|
27
|
-
Log_1.GLog.info("begin
|
|
28
|
-
this._redis = redis.createClient(redisCfg
|
|
24
|
+
Log_1.GLog.info("begin connect redis=" + JSON.stringify(redisCfg));
|
|
25
|
+
this._redis = redis.createClient(redisCfg);
|
|
29
26
|
this._redis.on("connect", () => {
|
|
30
27
|
this.onConnect();
|
|
31
28
|
resolve(null);
|
|
@@ -33,376 +30,24 @@ class RedisManager {
|
|
|
33
30
|
this._redis.on("end", this.onEnd.bind(this));
|
|
34
31
|
this._redis.on("error", this.onError.bind(this));
|
|
35
32
|
});
|
|
33
|
+
let ret = await p;
|
|
34
|
+
for (let key in this._redis) {
|
|
35
|
+
if (typeof this._redis[key] == "function") {
|
|
36
|
+
this[key] = this._redis[key].bind(this._redis);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return ret;
|
|
36
40
|
}
|
|
37
41
|
onConnect() {
|
|
38
|
-
if (this._redisCfg.database) {
|
|
39
|
-
this._redis.select(this._redisCfg.database);
|
|
40
|
-
}
|
|
41
|
-
this._resis_init_succ = true;
|
|
42
42
|
Log_1.GLog.info("redis has connected!");
|
|
43
43
|
}
|
|
44
44
|
onEnd() {
|
|
45
|
-
this._resis_init_succ = false;
|
|
46
45
|
this._redis = null;
|
|
47
46
|
this.init(this._redisCfg); //重连
|
|
48
47
|
}
|
|
49
48
|
onError(err) {
|
|
50
|
-
Log_1.GLog.info("Error connected=" + this._redis
|
|
51
|
-
}
|
|
52
|
-
expire(key, seconds) {
|
|
53
|
-
return new Promise((resolve, reject) => {
|
|
54
|
-
if (!this._redis) {
|
|
55
|
-
resolve(null);
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
this._redis.expire(key, seconds, (err, reply) => {
|
|
59
|
-
if (err) {
|
|
60
|
-
Log_1.GLog.error(err);
|
|
61
|
-
}
|
|
62
|
-
resolve(reply);
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
incr(key) {
|
|
67
|
-
return new Promise((resolve, reject) => {
|
|
68
|
-
if (!this._redis) {
|
|
69
|
-
resolve(null);
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
this._redis.incr(key, (err, reply) => {
|
|
73
|
-
if (err) {
|
|
74
|
-
Log_1.GLog.error(err);
|
|
75
|
-
}
|
|
76
|
-
resolve(reply);
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
set(key, value) {
|
|
81
|
-
return new Promise((resolve, reject) => {
|
|
82
|
-
if (!this._redis) {
|
|
83
|
-
resolve(null);
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
this._redis.set(key, value, (err, reply) => {
|
|
87
|
-
if (err) {
|
|
88
|
-
Log_1.GLog.error(err);
|
|
89
|
-
}
|
|
90
|
-
resolve(reply);
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
get(key) {
|
|
95
|
-
return new Promise((resolve, reject) => {
|
|
96
|
-
if (!this._redis) {
|
|
97
|
-
resolve(null);
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
this._redis.get(key, (err, reply) => {
|
|
101
|
-
if (err) {
|
|
102
|
-
Log_1.GLog.error(err);
|
|
103
|
-
}
|
|
104
|
-
resolve(reply);
|
|
105
|
-
});
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
*
|
|
110
|
-
* @param key
|
|
111
|
-
* @param cb 有表示异步
|
|
112
|
-
*/
|
|
113
|
-
del(key, cb) {
|
|
114
|
-
return new Promise((resolve, reject) => {
|
|
115
|
-
if (!this._redis) {
|
|
116
|
-
resolve(null);
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
this._redis.del(key, (err, reply) => {
|
|
120
|
-
if (err) {
|
|
121
|
-
Log_1.GLog.error(err);
|
|
122
|
-
}
|
|
123
|
-
resolve(reply);
|
|
124
|
-
});
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
hset(h, key, value) {
|
|
128
|
-
return new Promise((resolve, reject) => {
|
|
129
|
-
if (!this._redis) {
|
|
130
|
-
resolve(null);
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
this._redis.hset(h, key, value, (err, reply) => {
|
|
134
|
-
if (err) {
|
|
135
|
-
Log_1.GLog.error(err);
|
|
136
|
-
}
|
|
137
|
-
resolve(reply);
|
|
138
|
-
});
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
hget(h, key) {
|
|
142
|
-
return new Promise((resolve, reject) => {
|
|
143
|
-
if (!this._redis) {
|
|
144
|
-
resolve(null);
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
147
|
-
this._redis.hget(h, key, (err, reply) => {
|
|
148
|
-
if (err) {
|
|
149
|
-
Log_1.GLog.error(err);
|
|
150
|
-
}
|
|
151
|
-
resolve(reply);
|
|
152
|
-
});
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
hdel(key, sub_key) {
|
|
156
|
-
return new Promise((resolve, reject) => {
|
|
157
|
-
if (!this._redis) {
|
|
158
|
-
resolve(null);
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
this._redis.hdel(key, sub_key, (err, reply) => {
|
|
162
|
-
if (err) {
|
|
163
|
-
Log_1.GLog.error(err);
|
|
164
|
-
}
|
|
165
|
-
resolve(reply);
|
|
166
|
-
});
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* hash值,能转换位整数的就自动转换为整数
|
|
171
|
-
* @param h key
|
|
172
|
-
*/
|
|
173
|
-
hgetall(h) {
|
|
174
|
-
return new Promise((resolve, reject) => {
|
|
175
|
-
if (!this._redis) {
|
|
176
|
-
resolve(null);
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
this._redis.hgetall(h, (err, replys) => {
|
|
180
|
-
if (err) {
|
|
181
|
-
Log_1.GLog.error(err);
|
|
182
|
-
resolve(replys);
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
185
|
-
let value = {};
|
|
186
|
-
for (let k in replys) {
|
|
187
|
-
let v = replys[k];
|
|
188
|
-
let iv = parseInt(v);
|
|
189
|
-
if (v == "" + iv) {
|
|
190
|
-
value[k] = iv;
|
|
191
|
-
}
|
|
192
|
-
else {
|
|
193
|
-
value[k] = v;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
if (!replys) {
|
|
197
|
-
value = null;
|
|
198
|
-
}
|
|
199
|
-
resolve(value);
|
|
200
|
-
});
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
*
|
|
205
|
-
* @param h
|
|
206
|
-
* @param array
|
|
207
|
-
*/
|
|
208
|
-
hmset(h, array) {
|
|
209
|
-
return new Promise((resolve, reject) => {
|
|
210
|
-
if (!this._redis) {
|
|
211
|
-
resolve(null);
|
|
212
|
-
return;
|
|
213
|
-
}
|
|
214
|
-
this._redis.hmset(h, array, (err, replys) => {
|
|
215
|
-
if (err) {
|
|
216
|
-
Log_1.GLog.error(err);
|
|
217
|
-
}
|
|
218
|
-
resolve(replys);
|
|
219
|
-
});
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
lpush(key, array) {
|
|
223
|
-
return new Promise((resolve, reject) => {
|
|
224
|
-
if (!this._redis) {
|
|
225
|
-
resolve(null);
|
|
226
|
-
return;
|
|
227
|
-
}
|
|
228
|
-
this._redis.lpush(key, array, (err, replys) => {
|
|
229
|
-
if (err) {
|
|
230
|
-
Log_1.GLog.error(err);
|
|
231
|
-
}
|
|
232
|
-
resolve(replys);
|
|
233
|
-
});
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
lrange(key, start, end) {
|
|
237
|
-
return new Promise((resolve, reject) => {
|
|
238
|
-
if (!this._redis) {
|
|
239
|
-
resolve(null);
|
|
240
|
-
return;
|
|
241
|
-
}
|
|
242
|
-
if (!this._redis) {
|
|
243
|
-
return null;
|
|
244
|
-
}
|
|
245
|
-
if (!start) {
|
|
246
|
-
start = 0;
|
|
247
|
-
}
|
|
248
|
-
if (!end) {
|
|
249
|
-
end = -1;
|
|
250
|
-
}
|
|
251
|
-
this._redis.lrange(key, start, end, (err, replys) => {
|
|
252
|
-
if (err) {
|
|
253
|
-
Log_1.GLog.error(err);
|
|
254
|
-
}
|
|
255
|
-
resolve(replys);
|
|
256
|
-
});
|
|
257
|
-
});
|
|
258
|
-
}
|
|
259
|
-
ltrim(key, start, end) {
|
|
260
|
-
return new Promise((resolve, reject) => {
|
|
261
|
-
if (!this._redis) {
|
|
262
|
-
resolve(null);
|
|
263
|
-
return;
|
|
264
|
-
}
|
|
265
|
-
if (!this._redis) {
|
|
266
|
-
return null;
|
|
267
|
-
}
|
|
268
|
-
if (!start) {
|
|
269
|
-
start = 0;
|
|
270
|
-
}
|
|
271
|
-
if (!end) {
|
|
272
|
-
end = -1;
|
|
273
|
-
}
|
|
274
|
-
this._redis.ltrim(key, start, end, (err, replys) => {
|
|
275
|
-
if (err) {
|
|
276
|
-
Log_1.GLog.error(err);
|
|
277
|
-
}
|
|
278
|
-
resolve(replys);
|
|
279
|
-
});
|
|
280
|
-
});
|
|
281
|
-
}
|
|
282
|
-
sadd(key, array) {
|
|
283
|
-
return new Promise((resolve, reject) => {
|
|
284
|
-
if (!this._redis) {
|
|
285
|
-
resolve(null);
|
|
286
|
-
return;
|
|
287
|
-
}
|
|
288
|
-
this._redis.sadd(key, array, (err, replys) => {
|
|
289
|
-
if (err) {
|
|
290
|
-
Log_1.GLog.error(err);
|
|
291
|
-
}
|
|
292
|
-
resolve(replys);
|
|
293
|
-
});
|
|
294
|
-
});
|
|
295
|
-
}
|
|
296
|
-
smembers(key) {
|
|
297
|
-
return new Promise((resolve, reject) => {
|
|
298
|
-
if (!this._redis) {
|
|
299
|
-
resolve(null);
|
|
300
|
-
return;
|
|
301
|
-
}
|
|
302
|
-
this._redis.smembers(key, (err, replys) => {
|
|
303
|
-
if (err) {
|
|
304
|
-
Log_1.GLog.error(err);
|
|
305
|
-
}
|
|
306
|
-
resolve(replys);
|
|
307
|
-
});
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
srem(key, array) {
|
|
311
|
-
return new Promise((resolve, reject) => {
|
|
312
|
-
if (!this._redis) {
|
|
313
|
-
resolve(null);
|
|
314
|
-
return;
|
|
315
|
-
}
|
|
316
|
-
this._redis.srem(key, array, (err, replys) => {
|
|
317
|
-
if (err) {
|
|
318
|
-
Log_1.GLog.error(err);
|
|
319
|
-
}
|
|
320
|
-
resolve(replys);
|
|
321
|
-
});
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
|
-
keys(key) {
|
|
325
|
-
return new Promise((resolve, reject) => {
|
|
326
|
-
if (!this._redis) {
|
|
327
|
-
resolve(null);
|
|
328
|
-
return;
|
|
329
|
-
}
|
|
330
|
-
this._redis.keys(key, (err, replys) => {
|
|
331
|
-
if (err) {
|
|
332
|
-
Log_1.GLog.error(err);
|
|
333
|
-
}
|
|
334
|
-
resolve(replys);
|
|
335
|
-
});
|
|
336
|
-
});
|
|
337
|
-
}
|
|
338
|
-
multi() {
|
|
339
|
-
if (!this._redis) {
|
|
340
|
-
return null;
|
|
341
|
-
}
|
|
342
|
-
return this._redis.multi();
|
|
343
|
-
}
|
|
344
|
-
exists(key) {
|
|
345
|
-
return new Promise((resolve, reject) => {
|
|
346
|
-
if (!this._redis) {
|
|
347
|
-
resolve(null);
|
|
348
|
-
return;
|
|
349
|
-
}
|
|
350
|
-
this._redis.exists(key, (err, replys) => {
|
|
351
|
-
if (err) {
|
|
352
|
-
Log_1.GLog.error(err);
|
|
353
|
-
}
|
|
354
|
-
resolve(replys);
|
|
355
|
-
});
|
|
356
|
-
});
|
|
357
|
-
}
|
|
358
|
-
exec(multi) {
|
|
359
|
-
return new Promise((resolve, reject) => {
|
|
360
|
-
if (!this._redis || !multi) {
|
|
361
|
-
resolve(null);
|
|
362
|
-
return;
|
|
363
|
-
}
|
|
364
|
-
multi.exec((err, replys) => {
|
|
365
|
-
if (err) {
|
|
366
|
-
Log_1.GLog.error(err);
|
|
367
|
-
}
|
|
368
|
-
resolve(replys);
|
|
369
|
-
});
|
|
370
|
-
});
|
|
371
|
-
}
|
|
372
|
-
publish(channel, value) {
|
|
373
|
-
return new Promise((resolve, reject) => {
|
|
374
|
-
if (!this._redis) {
|
|
375
|
-
resolve(null);
|
|
376
|
-
return;
|
|
377
|
-
}
|
|
378
|
-
this._redis.publish(channel, value, (err, num) => {
|
|
379
|
-
if (err) {
|
|
380
|
-
Log_1.GLog.error(err);
|
|
381
|
-
}
|
|
382
|
-
resolve(num);
|
|
383
|
-
});
|
|
384
|
-
});
|
|
385
|
-
}
|
|
386
|
-
subscribe(channel) {
|
|
387
|
-
return new Promise((resolve, reject) => {
|
|
388
|
-
if (!this._redis) {
|
|
389
|
-
resolve(null);
|
|
390
|
-
return;
|
|
391
|
-
}
|
|
392
|
-
this._redis.subscribe(channel, (err, msg) => {
|
|
393
|
-
if (err) {
|
|
394
|
-
Log_1.GLog.error(err);
|
|
395
|
-
}
|
|
396
|
-
resolve(msg);
|
|
397
|
-
});
|
|
398
|
-
});
|
|
399
|
-
}
|
|
400
|
-
on(message, cb) {
|
|
401
|
-
if (!this._redis) {
|
|
402
|
-
return;
|
|
403
|
-
}
|
|
404
|
-
this._redis.on(message, cb);
|
|
49
|
+
Log_1.GLog.info("Error connected=" + this._redis + ": " + err);
|
|
405
50
|
}
|
|
406
51
|
}
|
|
407
52
|
exports.RedisManager = RedisManager;
|
|
408
|
-
exports.GRedisMgr = new RedisManager();
|
|
53
|
+
exports.GRedisMgr = (new RedisManager());
|
|
@@ -26,14 +26,14 @@ export declare class MongoBaseService<T> {
|
|
|
26
26
|
id: number;
|
|
27
27
|
des: string;
|
|
28
28
|
};
|
|
29
|
-
rs: mongo.UpdateResult
|
|
29
|
+
rs: mongo.UpdateResult<mongo.BSON.Document>;
|
|
30
30
|
}>;
|
|
31
31
|
updateMany(model: any, where?: {}): Promise<{
|
|
32
32
|
errcode: {
|
|
33
33
|
id: number;
|
|
34
34
|
des: string;
|
|
35
35
|
};
|
|
36
|
-
rs: mongo.BSON.Document | mongo.UpdateResult
|
|
36
|
+
rs: mongo.BSON.Document | mongo.UpdateResult<mongo.BSON.Document>;
|
|
37
37
|
}>;
|
|
38
38
|
insert(model: T): Promise<{
|
|
39
39
|
errcode: {
|
|
@@ -120,14 +120,14 @@ declare class MongoManager {
|
|
|
120
120
|
id: number;
|
|
121
121
|
des: string;
|
|
122
122
|
};
|
|
123
|
-
rs: mongo.UpdateResult
|
|
123
|
+
rs: mongo.UpdateResult<mongo.BSON.Document>;
|
|
124
124
|
}>;
|
|
125
125
|
updateMany(collection: string, model: any, where?: {}, upsert?: boolean): Promise<{
|
|
126
126
|
errcode: {
|
|
127
127
|
id: number;
|
|
128
128
|
des: string;
|
|
129
129
|
};
|
|
130
|
-
rs: mongo.BSON.Document | mongo.UpdateResult
|
|
130
|
+
rs: mongo.BSON.Document | mongo.UpdateResult<mongo.BSON.Document>;
|
|
131
131
|
}>;
|
|
132
132
|
createIndex(collection: string, index: any, options?: mongo.CreateIndexesOptions): Promise<{
|
|
133
133
|
errcode: {
|
|
@@ -1,64 +1,17 @@
|
|
|
1
1
|
import * as redis from 'redis';
|
|
2
|
-
|
|
2
|
+
declare type RedisClientType = redis.RedisClientType<redis.RedisDefaultModules & redis.RedisModules, redis.RedisFunctions, redis.RedisScripts>;
|
|
3
|
+
export declare let GRedisMgr: RedisManager & RedisClientType;
|
|
3
4
|
export declare class RedisManager {
|
|
4
|
-
protected _redis:
|
|
5
|
-
get redis():
|
|
6
|
-
protected _resis_init_succ: boolean;
|
|
5
|
+
protected _redis: RedisClientType;
|
|
6
|
+
get redis(): RedisClientType;
|
|
7
7
|
protected _redisCfg: {
|
|
8
8
|
open: boolean;
|
|
9
|
-
|
|
10
|
-
port: number;
|
|
11
|
-
database: number;
|
|
12
|
-
password: string;
|
|
13
|
-
};
|
|
14
|
-
constructor();
|
|
9
|
+
} & redis.RedisClientOptions;
|
|
15
10
|
init(redisCfg: {
|
|
16
11
|
open: boolean;
|
|
17
|
-
|
|
18
|
-
port: number;
|
|
19
|
-
database: number;
|
|
20
|
-
password: string;
|
|
21
|
-
}): Promise<unknown>;
|
|
12
|
+
} & redis.RedisClientOptions): Promise<unknown>;
|
|
22
13
|
onConnect(): void;
|
|
23
14
|
onEnd(): void;
|
|
24
15
|
onError(err: any): void;
|
|
25
|
-
expire(key: any, seconds: any): Promise<unknown>;
|
|
26
|
-
incr(key: any): Promise<number>;
|
|
27
|
-
set(key: any, value: any): Promise<unknown>;
|
|
28
|
-
get(key: any): Promise<string>;
|
|
29
|
-
/**
|
|
30
|
-
*
|
|
31
|
-
* @param key
|
|
32
|
-
* @param cb 有表示异步
|
|
33
|
-
*/
|
|
34
|
-
del(key: any, cb?: any): Promise<unknown>;
|
|
35
|
-
hset(h: any, key: any, value: any): Promise<unknown>;
|
|
36
|
-
hget(h: any, key: any): Promise<unknown>;
|
|
37
|
-
hdel(key: any, sub_key: any): Promise<unknown>;
|
|
38
|
-
/**
|
|
39
|
-
* hash值,能转换位整数的就自动转换为整数
|
|
40
|
-
* @param h key
|
|
41
|
-
*/
|
|
42
|
-
hgetall(h: any): Promise<{
|
|
43
|
-
[key: string]: any;
|
|
44
|
-
}>;
|
|
45
|
-
/**
|
|
46
|
-
*
|
|
47
|
-
* @param h
|
|
48
|
-
* @param array
|
|
49
|
-
*/
|
|
50
|
-
hmset(h: any, array: any): Promise<unknown>;
|
|
51
|
-
lpush(key: any, array: any): Promise<unknown>;
|
|
52
|
-
lrange(key: string, start?: number, end?: number): Promise<unknown>;
|
|
53
|
-
ltrim(key: string, start: number, end?: number): Promise<unknown>;
|
|
54
|
-
sadd(key: any, array: any): Promise<unknown>;
|
|
55
|
-
smembers(key: any): Promise<unknown>;
|
|
56
|
-
srem(key: any, array: any): Promise<unknown>;
|
|
57
|
-
keys(key: any): Promise<unknown>;
|
|
58
|
-
multi(): redis.Multi;
|
|
59
|
-
exists(key: string): Promise<unknown>;
|
|
60
|
-
exec(multi: redis.Multi): Promise<Array<any>>;
|
|
61
|
-
publish(channel: string, value: string): Promise<unknown>;
|
|
62
|
-
subscribe(channel: string): Promise<unknown>;
|
|
63
|
-
on(message: string, cb: any): void;
|
|
64
16
|
}
|
|
17
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cgserver",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.4.1",
|
|
4
4
|
"author": "trojan",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"description": "free for all.Websocket or Http",
|
|
@@ -31,53 +31,53 @@
|
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@alicloud/sms-sdk": "^1.1.6",
|
|
34
|
-
"@types/cookie-parser": "^1.4.
|
|
35
|
-
"@types/cors": "^2.8.
|
|
34
|
+
"@types/cookie-parser": "^1.4.3",
|
|
35
|
+
"@types/cors": "^2.8.13",
|
|
36
36
|
"@types/crypto-js": "^4.1.1",
|
|
37
|
-
"@types/express": "^4.17.
|
|
38
|
-
"@types/formidable": "^
|
|
39
|
-
"@types/mime": "^
|
|
40
|
-
"@types/mssql": "^
|
|
41
|
-
"@types/mysql": "^2.15.
|
|
42
|
-
"@types/node": "^
|
|
43
|
-
"@types/nodemailer": "^6.4.
|
|
44
|
-
"@types/redis": "^
|
|
37
|
+
"@types/express": "^4.17.17",
|
|
38
|
+
"@types/formidable": "^3.4.1",
|
|
39
|
+
"@types/mime": "^3.0.1",
|
|
40
|
+
"@types/mssql": "^8.1.2",
|
|
41
|
+
"@types/mysql": "^2.15.21",
|
|
42
|
+
"@types/node": "^20.5.7",
|
|
43
|
+
"@types/nodemailer": "^6.4.9",
|
|
44
|
+
"@types/redis": "^4.0.10",
|
|
45
45
|
"@types/reflect-metadata": "^0.1.0",
|
|
46
|
-
"@types/request": "^2.48.
|
|
47
|
-
"@types/underscore": "^1.11.
|
|
46
|
+
"@types/request": "^2.48.8",
|
|
47
|
+
"@types/underscore": "^1.11.8",
|
|
48
48
|
"@types/urlencode": "^1.1.2",
|
|
49
|
-
"@types/websocket": "^1.0.
|
|
49
|
+
"@types/websocket": "^1.0.6",
|
|
50
50
|
"alipay_sdk2": "^1.1.6",
|
|
51
|
-
"alipay-sdk": "^3.
|
|
51
|
+
"alipay-sdk": "^3.5.0",
|
|
52
52
|
"colors": "^1.4.0",
|
|
53
|
-
"cookie-parser": "^1.4.
|
|
53
|
+
"cookie-parser": "^1.4.6",
|
|
54
54
|
"cors": "^2.8.5",
|
|
55
55
|
"crypto-js": "^4.1.1",
|
|
56
56
|
"ec-key": "0.0.4",
|
|
57
|
-
"express": "^4.
|
|
58
|
-
"fast-xml-parser": "^
|
|
59
|
-
"formidable": "^
|
|
57
|
+
"express": "^4.18.2",
|
|
58
|
+
"fast-xml-parser": "^4.2.7",
|
|
59
|
+
"formidable": "^3.5.1",
|
|
60
60
|
"fs": "0.0.1-security",
|
|
61
61
|
"http": "0.0.0",
|
|
62
62
|
"https": "^1.0.0",
|
|
63
63
|
"jsonc": "^2.0.0",
|
|
64
|
-
"log4js": "^6.
|
|
64
|
+
"log4js": "^6.9.1",
|
|
65
65
|
"mime": "^3.0.0",
|
|
66
|
-
"mongodb": "^
|
|
67
|
-
"mssql": "^
|
|
66
|
+
"mongodb": "^6.0.0",
|
|
67
|
+
"mssql": "^9.2.0",
|
|
68
68
|
"mysql": "^2.18.1",
|
|
69
|
-
"nodemailer": "^6.
|
|
69
|
+
"nodemailer": "^6.9.4",
|
|
70
70
|
"process": "^0.11.10",
|
|
71
|
-
"protobufjs": "^
|
|
72
|
-
"qiniu": "^7.
|
|
71
|
+
"protobufjs": "^7.2.5",
|
|
72
|
+
"qiniu": "^7.9.0",
|
|
73
73
|
"readline2": "^1.0.1",
|
|
74
|
-
"redis": "^
|
|
74
|
+
"redis": "^4.6.8",
|
|
75
75
|
"reflect-metadata": "^0.1.13",
|
|
76
76
|
"request": "^2.88.0",
|
|
77
|
-
"socket.io": "^4.
|
|
77
|
+
"socket.io": "^4.7.2",
|
|
78
78
|
"underscore": "^1.13.6",
|
|
79
79
|
"urlencode": "^1.1.0",
|
|
80
|
-
"webpack": "^5.
|
|
80
|
+
"webpack": "^5.88.2",
|
|
81
81
|
"webpack-node-externals": "^3.0.0",
|
|
82
82
|
"websocket": "^1.0.34"
|
|
83
83
|
}
|