@resolveio/server-lib 12.2.18 → 12.3.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/collections/logged-in-users.collection.js +0 -4
- package/collections/logged-in-users.collection.js.map +1 -1
- package/fixtures/init.js +2 -13
- package/fixtures/init.js.map +1 -1
- package/http/auth.js +0 -3
- package/http/auth.js.map +1 -1
- package/managers/method.manager.js +1 -1
- package/managers/method.manager.js.map +1 -1
- package/managers/subscription.manager.js +0 -21
- package/managers/subscription.manager.js.map +1 -1
- package/methods/accounts.js +0 -29
- package/methods/accounts.js.map +1 -1
- package/models/logged-in-users.model.d.ts +0 -1
- package/models/logged-in-users.model.js.map +1 -1
- package/package.json +25 -25
- package/public_api.d.ts +0 -2
- package/public_api.js +0 -2
- package/public_api.js.map +1 -1
- package/server-app.js +61 -101
- package/server-app.js.map +1 -1
- package/collections/app-version.collection.d.ts +0 -3
- package/collections/app-version.collection.js +0 -51
- package/collections/app-version.collection.js.map +0 -1
- package/models/app-version.model.d.ts +0 -4
- package/models/app-version.model.js +0 -4
- package/models/app-version.model.js.map +0 -1
- package/publications/app-version.d.ts +0 -2
- package/publications/app-version.js +0 -17
- package/publications/app-version.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@resolveio/server-lib",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.3.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"package": "npm run build-prod && npm pack ./dist",
|
|
@@ -12,16 +12,16 @@
|
|
|
12
12
|
"author": "",
|
|
13
13
|
"license": "ISC",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@aws-sdk/client-s3": "3.
|
|
16
|
-
"@aws-sdk/s3-request-presigner": "3.
|
|
17
|
-
"axios": "0.
|
|
18
|
-
"body-parser": "1.19.
|
|
15
|
+
"@aws-sdk/client-s3": "3.51.0",
|
|
16
|
+
"@aws-sdk/s3-request-presigner": "3.51.0",
|
|
17
|
+
"axios": "0.26.0",
|
|
18
|
+
"body-parser": "1.19.2",
|
|
19
19
|
"clone": "2.1.2",
|
|
20
20
|
"cron": "1.8.2",
|
|
21
21
|
"crypto": "1.0.1",
|
|
22
22
|
"deep-diff": "1.0.2",
|
|
23
23
|
"exceljs": "3.6.0",
|
|
24
|
-
"express": "4.17.
|
|
24
|
+
"express": "4.17.3",
|
|
25
25
|
"express-xml-bodyparser": "0.3.0",
|
|
26
26
|
"handlebars": "4.7.7",
|
|
27
27
|
"imap": "0.8.19",
|
|
@@ -29,32 +29,32 @@
|
|
|
29
29
|
"jsonwebtoken": "8.5.1",
|
|
30
30
|
"jwt-decode": "3.1.2",
|
|
31
31
|
"moment": "2.29.1",
|
|
32
|
-
"moment-timezone": "0.5.
|
|
32
|
+
"moment-timezone": "0.5.34",
|
|
33
33
|
"mongodb": "4.2.1",
|
|
34
34
|
"node-cache": "5.1.2",
|
|
35
35
|
"node-google-timezone": "0.1.1",
|
|
36
|
-
"nodemailer": "6.7.
|
|
36
|
+
"nodemailer": "6.7.2",
|
|
37
37
|
"nodemailer-ses-transport": "1.5.1",
|
|
38
38
|
"path": "0.12.7",
|
|
39
|
-
"pdf-lib": "1.17.
|
|
39
|
+
"pdf-lib": "1.17.1",
|
|
40
40
|
"pm2": "5.1.2",
|
|
41
|
-
"puppeteer": "13.
|
|
41
|
+
"puppeteer": "13.3.2",
|
|
42
42
|
"rus-diff": "1.1.0",
|
|
43
43
|
"scmp": "2.1.0",
|
|
44
44
|
"simpl-schema": "1.12.0",
|
|
45
45
|
"string-similarity": "4.0.4",
|
|
46
46
|
"string_score": "0.1.22",
|
|
47
|
-
"twilio": "3.
|
|
47
|
+
"twilio": "3.74.0",
|
|
48
48
|
"uuid": "8.3.2",
|
|
49
|
-
"ws": "8.
|
|
49
|
+
"ws": "8.5.0",
|
|
50
50
|
"xlsx": "0.16.8"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/express": "4.17.13",
|
|
54
54
|
"@types/handlebars": "4.1.0",
|
|
55
|
-
"@types/jsonwebtoken": "8.5.
|
|
55
|
+
"@types/jsonwebtoken": "8.5.8",
|
|
56
56
|
"@types/nodemailer": "6.4.4",
|
|
57
|
-
"@types/ws": "8.2.
|
|
57
|
+
"@types/ws": "8.2.2",
|
|
58
58
|
"del": "3.0.0",
|
|
59
59
|
"express-livereload": "0.0.24",
|
|
60
60
|
"gulp": "4.0.2",
|
|
@@ -69,16 +69,16 @@
|
|
|
69
69
|
"typescript": "4.1.3"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
|
-
"@aws-sdk/client-s3": "3.
|
|
73
|
-
"@aws-sdk/s3-request-presigner": "3.
|
|
74
|
-
"axios": "0.
|
|
75
|
-
"body-parser": "1.19.
|
|
72
|
+
"@aws-sdk/client-s3": "3.51.0",
|
|
73
|
+
"@aws-sdk/s3-request-presigner": "3.51.0",
|
|
74
|
+
"axios": "0.26.0",
|
|
75
|
+
"body-parser": "1.19.2",
|
|
76
76
|
"clone": "2.1.2",
|
|
77
77
|
"cron": "1.8.2",
|
|
78
78
|
"crypto": "1.0.1",
|
|
79
79
|
"deep-diff": "1.0.2",
|
|
80
80
|
"exceljs": "3.6.0",
|
|
81
|
-
"express": "4.17.
|
|
81
|
+
"express": "4.17.3",
|
|
82
82
|
"express-xml-bodyparser": "0.3.0",
|
|
83
83
|
"handlebars": "4.7.7",
|
|
84
84
|
"imap": "0.8.19",
|
|
@@ -86,24 +86,24 @@
|
|
|
86
86
|
"jsonwebtoken": "8.5.1",
|
|
87
87
|
"jwt-decode": "3.1.2",
|
|
88
88
|
"moment": "2.29.1",
|
|
89
|
-
"moment-timezone": "0.5.
|
|
89
|
+
"moment-timezone": "0.5.34",
|
|
90
90
|
"mongodb": "4.2.1",
|
|
91
91
|
"node-cache": "5.1.2",
|
|
92
92
|
"node-google-timezone": "0.1.1",
|
|
93
|
-
"nodemailer": "6.7.
|
|
93
|
+
"nodemailer": "6.7.2",
|
|
94
94
|
"nodemailer-ses-transport": "1.5.1",
|
|
95
95
|
"path": "0.12.7",
|
|
96
|
-
"pdf-lib": "1.17.
|
|
96
|
+
"pdf-lib": "1.17.1",
|
|
97
97
|
"pm2": "5.1.2",
|
|
98
|
-
"puppeteer": "13.
|
|
98
|
+
"puppeteer": "13.3.2",
|
|
99
99
|
"rus-diff": "1.1.0",
|
|
100
100
|
"scmp": "2.1.0",
|
|
101
101
|
"simpl-schema": "1.12.0",
|
|
102
102
|
"string-similarity": "4.0.4",
|
|
103
103
|
"string_score": "0.1.22",
|
|
104
|
-
"twilio": "3.
|
|
104
|
+
"twilio": "3.74.0",
|
|
105
105
|
"uuid": "8.3.2",
|
|
106
|
-
"ws": "8.
|
|
106
|
+
"ws": "8.5.0",
|
|
107
107
|
"xlsx": "0.16.8"
|
|
108
108
|
}
|
|
109
109
|
}
|
package/public_api.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export * from './collections/app-status.collection';
|
|
2
|
-
export * from './collections/app-version.collection';
|
|
3
2
|
export * from './collections/counter.collection';
|
|
4
3
|
export * from './collections/cron-job-history.collection';
|
|
5
4
|
export * from './collections/cron-job.collection';
|
|
@@ -22,7 +21,6 @@ export * from './collections/user-group.collection';
|
|
|
22
21
|
export * from './collections/user-guide.collection';
|
|
23
22
|
export * from './collections/user.collection';
|
|
24
23
|
export * from './models/app-status.model';
|
|
25
|
-
export * from './models/app-version.model';
|
|
26
24
|
export * from './models/billing-logged-in-users.model';
|
|
27
25
|
export * from './models/collection-document.model';
|
|
28
26
|
export * from './models/counter.model';
|
package/public_api.js
CHANGED
|
@@ -11,7 +11,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
__exportStar(require("./collections/app-status.collection"), exports);
|
|
14
|
-
__exportStar(require("./collections/app-version.collection"), exports);
|
|
15
14
|
__exportStar(require("./collections/counter.collection"), exports);
|
|
16
15
|
__exportStar(require("./collections/cron-job-history.collection"), exports);
|
|
17
16
|
__exportStar(require("./collections/cron-job.collection"), exports);
|
|
@@ -34,7 +33,6 @@ __exportStar(require("./collections/user-group.collection"), exports);
|
|
|
34
33
|
__exportStar(require("./collections/user-guide.collection"), exports);
|
|
35
34
|
__exportStar(require("./collections/user.collection"), exports);
|
|
36
35
|
__exportStar(require("./models/app-status.model"), exports);
|
|
37
|
-
__exportStar(require("./models/app-version.model"), exports);
|
|
38
36
|
__exportStar(require("./models/billing-logged-in-users.model"), exports);
|
|
39
37
|
__exportStar(require("./models/collection-document.model"), exports);
|
|
40
38
|
__exportStar(require("./models/counter.model"), exports);
|
package/public_api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/public_api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,sEAAoD;AACpD,
|
|
1
|
+
{"version":3,"sources":["../../src/public_api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,sEAAoD;AACpD,mEAAiD;AACjD,4EAA0D;AAC1D,oEAAkD;AAClD,yEAAuD;AACvD,0EAAwD;AACxD,gEAA8C;AAC9C,gEAA8C;AAC9C,8EAA4D;AAC5D,4EAA0D;AAC1D,+DAA6C;AAC7C,2EAAyD;AACzD,2EAAyD;AACzD,uEAAqD;AACrD,0EAAwD;AACxD,yEAAuD;AACvD,wEAAsD;AACtD,kFAAgE;AAChE,iFAA+D;AAC/D,sEAAoD;AACpD,sEAAoD;AACpD,gEAA8C;AAC9C,4DAA0C;AAC1C,yEAAuD;AACvD,qEAAmD;AACnD,yDAAuC;AACvC,kEAAgD;AAChD,0DAAwC;AACxC,wDAAsC;AACtC,+DAA6C;AAC7C,gEAA8C;AAC9C,sDAAoC;AACpC,sDAAoC;AACpC,oEAAkD;AAClD,kEAAgD;AAChD,qDAAmC;AACnC,iEAA+C;AAC/C,iEAA+C;AAC/C,wDAAsC;AACtC,6DAA2C;AAC3C,gEAA8C;AAC9C,+DAA6C;AAC7C,8DAA4C;AAC5C,4DAA0C;AAC1C,4DAA0C;AAC1C,wEAAsD;AACtD,uEAAqD;AACrD,gEAA8C;AAC9C,mEAAiD;AACjD,iEAA+C;AAC/C,8DAA4C;AAC5C,gEAA8C;AAC9C,4DAA0C;AAC1C,4DAA0C;AAC1C,sDAAoC;AACpC,gDAA8B;AAC9B,2DAAyC","file":"public_api.js","sourcesContent":["export * from './collections/app-status.collection';\nexport * from './collections/counter.collection';\nexport * from './collections/cron-job-history.collection';\nexport * from './collections/cron-job.collection';\nexport * from './collections/email-history.collection';\nexport * from './collections/email-verified.collection';\nexport * from './collections/file.collection';\nexport * from './collections/flag.collection';\nexport * from './collections/log-method-latency.collection';\nexport * from './collections/log-subscription.collection';\nexport * from './collections/log.collection';\nexport * from './collections/logged-in-users.collection';\nexport * from './collections/method-response.collection';\nexport * from './collections/monitor-cpu.collection';\nexport * from './collections/monitor-memory.collection';\nexport * from './collections/monitor-mongo.collection';\nexport * from './collections/notification.collection';\nexport * from './collections/report-builder-library.collection';\nexport * from './collections/report-builder-report.collection';\nexport * from './collections/user-group.collection';\nexport * from './collections/user-guide.collection';\nexport * from './collections/user.collection';\nexport * from './models/app-status.model';\nexport * from './models/billing-logged-in-users.model';\nexport * from './models/collection-document.model';\nexport * from './models/counter.model';\nexport * from './models/cron-job-history.model';\nexport * from './models/cron-job.model';\nexport * from './models/dialog.model';\nexport * from './models/email-history.model';\nexport * from './models/email-verified.model';\nexport * from './models/file.model';\nexport * from './models/flag.model';\nexport * from './models/log-method-latency.model';\nexport * from './models/log-subscription.model';\nexport * from './models/log.model';\nexport * from './models/logged-in-users.model';\nexport * from './models/method-response.model';\nexport * from './models/method.model';\nexport * from './models/monitor-cpu.model';\nexport * from './models/monitor-memory.model';\nexport * from './models/monitor-mongo.model';\nexport * from './models/notification.model';\nexport * from './models/pagination.model';\nexport * from './models/permission.model';\nexport * from './models/report-builder-library.model';\nexport * from './models/report-builder-report.model';\nexport * from './models/report-builder.model';\nexport * from './models/select-data-label.model';\nexport * from './models/server-response.model';\nexport * from './models/subscription.model';\nexport * from './models/support-ticket.model';\nexport * from './models/user-group.model';\nexport * from './models/user-guide.model';\nexport * from './models/user.model';\nexport * from './util/common';\nexport * from './managers/mongo.manager';"]}
|
package/server-app.js
CHANGED
|
@@ -286,50 +286,45 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
286
286
|
cb(false, 401, 'Unauthorized');
|
|
287
287
|
}
|
|
288
288
|
else {
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
cb(false, 401, 'Unauthorized');
|
|
293
|
-
}
|
|
294
|
-
else {
|
|
295
|
-
jwt.verify(token, this._serverConfig['JWT_SECRET'], function (err, decoded) { return __awaiter(_this, void 0, void 0, function () {
|
|
296
|
-
var user, err_1;
|
|
297
|
-
return __generator(this, function (_a) {
|
|
298
|
-
switch (_a.label) {
|
|
299
|
-
case 0:
|
|
300
|
-
if (!err) return [3 /*break*/, 1];
|
|
301
|
-
cb(false, 401, 'Unauthorized');
|
|
302
|
-
return [3 /*break*/, 5];
|
|
303
|
-
case 1:
|
|
304
|
-
info.req['id_user'] = decoded['id_user'];
|
|
305
|
-
_a.label = 2;
|
|
306
|
-
case 2:
|
|
307
|
-
_a.trys.push([2, 4, , 5]);
|
|
308
|
-
return [4 /*yield*/, user_collection_1.Users.findById(decoded['id_user'])];
|
|
309
|
-
case 3:
|
|
310
|
-
user = _a.sent();
|
|
311
|
-
if (user) {
|
|
312
|
-
info.req['user'] = user.fullname;
|
|
313
|
-
info.req['user_readonly'] = user.readonly || false;
|
|
314
|
-
info.req['doc_user'] = user;
|
|
315
|
-
cb(true);
|
|
316
|
-
}
|
|
317
|
-
else {
|
|
318
|
-
cb(false);
|
|
319
|
-
}
|
|
320
|
-
return [3 /*break*/, 5];
|
|
321
|
-
case 4:
|
|
322
|
-
err_1 = _a.sent();
|
|
323
|
-
cb(false);
|
|
324
|
-
return [3 /*break*/, 5];
|
|
325
|
-
case 5: return [2 /*return*/];
|
|
326
|
-
}
|
|
327
|
-
});
|
|
328
|
-
}); });
|
|
329
|
-
}
|
|
289
|
+
token = infoData[0];
|
|
290
|
+
if (!token) {
|
|
291
|
+
cb(false, 401, 'Unauthorized');
|
|
330
292
|
}
|
|
331
293
|
else {
|
|
332
|
-
|
|
294
|
+
jwt.verify(token, this._serverConfig['JWT_SECRET'], function (err, decoded) { return __awaiter(_this, void 0, void 0, function () {
|
|
295
|
+
var user, err_1;
|
|
296
|
+
return __generator(this, function (_a) {
|
|
297
|
+
switch (_a.label) {
|
|
298
|
+
case 0:
|
|
299
|
+
if (!err) return [3 /*break*/, 1];
|
|
300
|
+
cb(false, 401, 'Unauthorized');
|
|
301
|
+
return [3 /*break*/, 5];
|
|
302
|
+
case 1:
|
|
303
|
+
info.req['id_user'] = decoded['id_user'];
|
|
304
|
+
_a.label = 2;
|
|
305
|
+
case 2:
|
|
306
|
+
_a.trys.push([2, 4, , 5]);
|
|
307
|
+
return [4 /*yield*/, user_collection_1.Users.findById(decoded['id_user'])];
|
|
308
|
+
case 3:
|
|
309
|
+
user = _a.sent();
|
|
310
|
+
if (user) {
|
|
311
|
+
info.req['user'] = user.fullname;
|
|
312
|
+
info.req['user_readonly'] = user.readonly || false;
|
|
313
|
+
info.req['doc_user'] = user;
|
|
314
|
+
cb(true);
|
|
315
|
+
}
|
|
316
|
+
else {
|
|
317
|
+
cb(false);
|
|
318
|
+
}
|
|
319
|
+
return [3 /*break*/, 5];
|
|
320
|
+
case 4:
|
|
321
|
+
err_1 = _a.sent();
|
|
322
|
+
cb(false);
|
|
323
|
+
return [3 /*break*/, 5];
|
|
324
|
+
case 5: return [2 /*return*/];
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
}); });
|
|
333
328
|
}
|
|
334
329
|
}
|
|
335
330
|
return [2 /*return*/];
|
|
@@ -365,6 +360,14 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
365
360
|
ws['user'] = req['user'];
|
|
366
361
|
ws['user_readonly'] = req['user_readonly'];
|
|
367
362
|
ws['doc_user'] = req['doc_user'];
|
|
363
|
+
if (ws['user'] !== 'Admin' && _this._serverConfig['CLIENT_NAME'] !== 'ResolveIO') {
|
|
364
|
+
_this.getMethodManager().callMethodInternal.call(_this.getMethodManager(), 'supportCreateBillingUser', {
|
|
365
|
+
id_user: ws['id_user'],
|
|
366
|
+
user: ws['user'],
|
|
367
|
+
date: new Date(),
|
|
368
|
+
client: index_1.ResolveIOServer.getClientName()
|
|
369
|
+
});
|
|
370
|
+
}
|
|
368
371
|
var idSocket = '';
|
|
369
372
|
while (!idSocket || Array.from(_this._wss.clients).some(function (a) { return a['id_socket'] === idSocket; })) {
|
|
370
373
|
idSocket = uuid_1.v4();
|
|
@@ -388,19 +391,13 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
388
391
|
ws['latency'] = moment.duration(moment(ws['pongTime']).diff(ws['pingTime'])).asMilliseconds();
|
|
389
392
|
_this._subscriptionManager.loggedInLatency(ws);
|
|
390
393
|
});
|
|
391
|
-
ws['versionTimer'] = setTimeout(function () {
|
|
392
|
-
if (_this._subscriptionManager.getEnableDebug()) {
|
|
393
|
-
console.log(new Date(), 'Server App', 'Version Timer');
|
|
394
|
-
}
|
|
395
|
-
_this.unsubscribeWS(ws);
|
|
396
|
-
}, 20000);
|
|
397
394
|
// On data received (message)
|
|
398
395
|
ws.on('message', function (message) { return __awaiter(_this, void 0, void 0, function () {
|
|
399
|
-
var parseErrorFound, socketData, messageRoute_1, messageDate, messageId, type, subType, pub, serverRes, offlineUpdates, i, update, serverResMethod, i, update, data, updateRoute, updateDate, updateMessageId, updateType, method, methodLatencyId, err_2
|
|
400
|
-
var _a, _b, _c
|
|
396
|
+
var parseErrorFound, socketData, messageRoute_1, messageDate, messageId, type, subType, pub, serverRes, offlineUpdates, i, update, serverResMethod, i, update, data, updateRoute, updateDate, updateMessageId, updateType, method, methodLatencyId, err_2;
|
|
397
|
+
var _a, _b, _c;
|
|
401
398
|
var _this = this;
|
|
402
|
-
return __generator(this, function (
|
|
403
|
-
switch (
|
|
399
|
+
return __generator(this, function (_d) {
|
|
400
|
+
switch (_d.label) {
|
|
404
401
|
case 0:
|
|
405
402
|
if (this.LOGGER === 'DEBUG') {
|
|
406
403
|
console.log('Message from: ' + ws['user'], message);
|
|
@@ -489,7 +486,7 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
489
486
|
}
|
|
490
487
|
}
|
|
491
488
|
i = 0;
|
|
492
|
-
|
|
489
|
+
_d.label = 2;
|
|
493
490
|
case 2:
|
|
494
491
|
if (!(i < offlineUpdates.length)) return [3 /*break*/, 9];
|
|
495
492
|
update = offlineUpdates[i];
|
|
@@ -511,7 +508,7 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
511
508
|
latency_ms: 0,
|
|
512
509
|
method: method
|
|
513
510
|
});
|
|
514
|
-
if (method !== 'reportBuilderGetResults' && method !== 'reportBuilderGetDistinctValue' && method !== 'reportBuilderBuildTree' && method !== 'generatePDF' && method !== 'getWOOfflineData' && method !== 'countQuery' && method !== 'countWithQuery' && method !== 'countCollectionWithQuery' && method !== 'find' && method !== 'findOne' && method !== 'findWithOptions' && method !== '
|
|
511
|
+
if (method !== 'reportBuilderGetResults' && method !== 'reportBuilderGetDistinctValue' && method !== 'reportBuilderBuildTree' && method !== 'generatePDF' && method !== 'getWOOfflineData' && method !== 'countQuery' && method !== 'countWithQuery' && method !== 'countCollectionWithQuery' && method !== 'find' && method !== 'findOne' && method !== 'findWithOptions' && method !== 'getDrivers') {
|
|
515
512
|
log_collection_1.Logs.insertOne({
|
|
516
513
|
_id: mongo_manager_1.objectIdHexString(),
|
|
517
514
|
type: 'client-request',
|
|
@@ -526,15 +523,15 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
526
523
|
});
|
|
527
524
|
}
|
|
528
525
|
if (!this._methodManager._methods[method]) return [3 /*break*/, 7];
|
|
529
|
-
|
|
526
|
+
_d.label = 3;
|
|
530
527
|
case 3:
|
|
531
|
-
|
|
528
|
+
_d.trys.push([3, 5, , 6]);
|
|
532
529
|
return [4 /*yield*/, (_c = this._methodManager.callMethodInternal).call.apply(_c, __spreadArrays([Object.assign({}, this._methodManager, { id_user: ws['id_user'], user: ws['user'], id_ws: ws['id_socket'] }), method], data))];
|
|
533
530
|
case 4:
|
|
534
|
-
|
|
531
|
+
_d.sent();
|
|
535
532
|
return [3 /*break*/, 6];
|
|
536
533
|
case 5:
|
|
537
|
-
err_2 =
|
|
534
|
+
err_2 = _d.sent();
|
|
538
535
|
console.log(new Date(), 'Offline Error', JSON.stringify(err_2, null, 2));
|
|
539
536
|
return [3 /*break*/, 6];
|
|
540
537
|
case 6:
|
|
@@ -544,54 +541,17 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
544
541
|
return [3 /*break*/, 8];
|
|
545
542
|
case 7:
|
|
546
543
|
console.log('Offline - Could not find method: ' + method);
|
|
547
|
-
|
|
544
|
+
_d.label = 8;
|
|
548
545
|
case 8:
|
|
549
546
|
i++;
|
|
550
547
|
return [3 /*break*/, 2];
|
|
551
548
|
case 9: return [3 /*break*/, 11];
|
|
552
549
|
case 10:
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
hasError: false,
|
|
559
|
-
data: 'ACK'
|
|
560
|
-
};
|
|
561
|
-
if (ws && ws.readyState === ws.OPEN) {
|
|
562
|
-
ws.send(JSON.stringify(serverRes), function (error) {
|
|
563
|
-
if (error) {
|
|
564
|
-
console.log('Error on WS: ', error);
|
|
565
|
-
if (_this._subscriptionManager.getEnableDebug()) {
|
|
566
|
-
console.log(new Date(), 'Server App', 'Error WS Set WS APP Version');
|
|
567
|
-
}
|
|
568
|
-
_this.unsubscribeWS(ws);
|
|
569
|
-
}
|
|
570
|
-
});
|
|
571
|
-
}
|
|
572
|
-
methodLatencyId = mongo_manager_1.objectIdHexString();
|
|
573
|
-
log_method_latency_collection_1.LogMethodLatencies.create({
|
|
574
|
-
_id: methodLatencyId,
|
|
575
|
-
__v: 0,
|
|
576
|
-
date_start: new Date(),
|
|
577
|
-
date_end: null,
|
|
578
|
-
latency_ms: 0,
|
|
579
|
-
method: method
|
|
580
|
-
});
|
|
581
|
-
if (this._methodManager._methods[method]) {
|
|
582
|
-
(_d = this._methodManager).callMethod.apply(_d, __spreadArrays([methodLatencyId, ws, messageDate, messageId, method], socketData.slice(5)));
|
|
583
|
-
}
|
|
584
|
-
else {
|
|
585
|
-
console.log('Could not find method: ' + method);
|
|
586
|
-
}
|
|
587
|
-
}
|
|
588
|
-
else {
|
|
589
|
-
this._msgQueue.splice(0, 0, {
|
|
590
|
-
ws: ws,
|
|
591
|
-
data: socketData
|
|
592
|
-
});
|
|
593
|
-
}
|
|
594
|
-
_e.label = 11;
|
|
550
|
+
this._msgQueue.splice(0, 0, {
|
|
551
|
+
ws: ws,
|
|
552
|
+
data: socketData
|
|
553
|
+
});
|
|
554
|
+
_d.label = 11;
|
|
595
555
|
case 11: return [2 /*return*/];
|
|
596
556
|
}
|
|
597
557
|
});
|