@resolveio/server-lib 4.5.2-newrole → 4.5.4
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/user.collection.js +32 -39
- package/fixtures/init.js +1 -1
- package/methods/report-builder.js +92 -44
- package/package.json +1 -1
- package/server-app.d.ts +1 -0
- package/server-app.js +31 -10
|
@@ -22,6 +22,13 @@ var schema = {
|
|
|
22
22
|
type: Date,
|
|
23
23
|
optional: true
|
|
24
24
|
},
|
|
25
|
+
readonly: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
optional: true
|
|
28
|
+
},
|
|
29
|
+
active: {
|
|
30
|
+
type: Boolean
|
|
31
|
+
},
|
|
25
32
|
attempts: {
|
|
26
33
|
type: Number,
|
|
27
34
|
optional: true
|
|
@@ -58,67 +65,53 @@ var schema = {
|
|
|
58
65
|
type: String
|
|
59
66
|
},
|
|
60
67
|
roles: {
|
|
61
|
-
type: Object
|
|
62
|
-
},
|
|
63
|
-
'roles.super_admin': {
|
|
64
|
-
type: Boolean
|
|
65
|
-
},
|
|
66
|
-
'roles.approvals': {
|
|
67
68
|
type: Array
|
|
68
69
|
},
|
|
69
|
-
'roles
|
|
70
|
-
type: Object
|
|
71
|
-
},
|
|
72
|
-
'roles.approvals.$.name': {
|
|
70
|
+
'roles.$': {
|
|
73
71
|
type: String
|
|
74
72
|
},
|
|
75
|
-
|
|
76
|
-
type: String
|
|
73
|
+
phonenumber: {
|
|
74
|
+
type: String,
|
|
75
|
+
optional: true
|
|
77
76
|
},
|
|
78
|
-
|
|
79
|
-
type:
|
|
77
|
+
other: {
|
|
78
|
+
type: Object,
|
|
79
|
+
blackbox: true,
|
|
80
|
+
optional: true
|
|
80
81
|
},
|
|
81
|
-
|
|
82
|
-
type: Array
|
|
82
|
+
assets: {
|
|
83
|
+
type: Array,
|
|
84
|
+
optional: true
|
|
83
85
|
},
|
|
84
|
-
'
|
|
86
|
+
'assets.$': {
|
|
85
87
|
type: Object
|
|
86
88
|
},
|
|
87
|
-
'
|
|
89
|
+
'assets.$.type': {
|
|
88
90
|
type: String
|
|
89
91
|
},
|
|
90
|
-
'
|
|
91
|
-
type: Array
|
|
92
|
-
},
|
|
93
|
-
'roles.groups.$.views.$': {
|
|
92
|
+
'assets.$.id_asset': {
|
|
94
93
|
type: String
|
|
95
94
|
},
|
|
96
|
-
'
|
|
97
|
-
type: String
|
|
98
|
-
optional: true
|
|
95
|
+
'assets.$.asset_number': {
|
|
96
|
+
type: String
|
|
99
97
|
},
|
|
100
|
-
'
|
|
101
|
-
type:
|
|
98
|
+
'assets.$.ownership': {
|
|
99
|
+
type: String
|
|
102
100
|
},
|
|
103
|
-
'
|
|
101
|
+
'assets.$.ownership_driver': {
|
|
104
102
|
type: String
|
|
105
103
|
},
|
|
106
|
-
'
|
|
107
|
-
type:
|
|
104
|
+
'assets.$.date_start': {
|
|
105
|
+
type: Date
|
|
108
106
|
},
|
|
109
|
-
'
|
|
110
|
-
type:
|
|
107
|
+
'assets.$.date_end': {
|
|
108
|
+
type: Date,
|
|
109
|
+
optional: true
|
|
111
110
|
},
|
|
112
|
-
|
|
113
|
-
phonenumber: {
|
|
111
|
+
id_function: {
|
|
114
112
|
type: String,
|
|
115
113
|
optional: true
|
|
116
114
|
},
|
|
117
|
-
other: {
|
|
118
|
-
type: Object,
|
|
119
|
-
optional: true,
|
|
120
|
-
blackbox: true
|
|
121
|
-
},
|
|
122
115
|
customers: {
|
|
123
116
|
type: Array,
|
|
124
117
|
optional: true,
|
package/fixtures/init.js
CHANGED
|
@@ -37,8 +37,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
38
|
var app_version_collection_1 = require("../collections/app-version.collection");
|
|
39
39
|
var logged_in_users_collection_1 = require("../collections/logged-in-users.collection");
|
|
40
|
-
var mongoose_1 = require("mongoose");
|
|
41
40
|
var active_subscription_collection_1 = require("../collections/active-subscription.collection");
|
|
41
|
+
var mongoose_1 = require("mongoose");
|
|
42
42
|
function loadServerInit() {
|
|
43
43
|
return __awaiter(this, void 0, void 0, function () {
|
|
44
44
|
var appVersion;
|
|
@@ -196,7 +196,7 @@ function loadReportBuilderMethods(methodManager) {
|
|
|
196
196
|
if (date_field === void 0) { date_field = ''; }
|
|
197
197
|
if (date_interval === void 0) { date_interval = ''; }
|
|
198
198
|
return new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
|
|
199
|
-
var _a, uniqueSelectedFieldCollections, modelCollection, queryMatchCondition, queryLookups, queryGroupUnwindCollectionPaths, queryUnwindCollectionPaths, initialProjection, queryGroups, queryGroupUnwind, initialGroup, secondInitialGroup, zipLayers, cnt, _loop_1, correctSort_1, _loop_2, i, queryProjection, queryTotals, query, i, res, err_1;
|
|
199
|
+
var _a, uniqueSelectedFieldCollections, modelCollection, queryMatchCondition, queryLookups, queryGroupUnwindCollectionPaths, queryUnwindCollectionPaths, initialProjection, queryGroups, queryGroupUnwind, initialGroup, secondInitialGroup, zipLayers, initialNonSumFilterProj, initialNonSumElemAtProj, initialNonSumValueProj, cnt, _loop_1, correctSort_1, _loop_2, i, queryProjection, queryTotals, query, i, res, err_1;
|
|
200
200
|
return __generator(this, function (_b) {
|
|
201
201
|
switch (_b.label) {
|
|
202
202
|
case 0:
|
|
@@ -346,7 +346,7 @@ function loadReportBuilderMethods(methodManager) {
|
|
|
346
346
|
initialGroup = { _id: {} };
|
|
347
347
|
groupsRow.forEach(function (row) {
|
|
348
348
|
initialGroup._id[row.id] = '$' + row.field.replace(/\.\$/g, '');
|
|
349
|
-
initialGroup.rb_arrays_0 = { '$
|
|
349
|
+
initialGroup.rb_arrays_0 = { '$push': '$rb_arrays_0' };
|
|
350
350
|
initialGroup.count = { '$sum': '$count' };
|
|
351
351
|
selectedFields.filter(function (a) { return !a.fieldPath.includes('$') && a.collection_name === rootCollectionName; }).forEach(function (field) {
|
|
352
352
|
if (field.leafValueType === 'Average') {
|
|
@@ -425,6 +425,70 @@ function loadReportBuilderMethods(methodManager) {
|
|
|
425
425
|
});
|
|
426
426
|
}
|
|
427
427
|
}
|
|
428
|
+
initialNonSumFilterProj = null;
|
|
429
|
+
initialNonSumElemAtProj = null;
|
|
430
|
+
initialNonSumValueProj = null;
|
|
431
|
+
if (selectedFields.some(function (a) { return a.fieldPath.split('.$').length === 2 && (a.leafValueType !== 'Average' && a.leafValueType !== 'Sum'); })) {
|
|
432
|
+
initialNonSumFilterProj = { $addFields: {} };
|
|
433
|
+
selectedFields.filter(function (a) { return a.fieldPath.split('.$').length === 2; }).forEach(function (field) {
|
|
434
|
+
var _a;
|
|
435
|
+
initialNonSumFilterProj.$addFields['rb_arrays_0_' + field.id] = {
|
|
436
|
+
$filter: {
|
|
437
|
+
input: '$rb_arrays_0',
|
|
438
|
+
cond: {
|
|
439
|
+
$and: [
|
|
440
|
+
{ $ne: ['$$this', null] },
|
|
441
|
+
{ $ne: ['$$this.' + field.fieldPath.split('.$.')[0], null] },
|
|
442
|
+
{ $ne: ['$$this.' + field.fieldPath.split('.$.')[0] + field.fieldPath.split('.$')[1], null] }
|
|
443
|
+
]
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
};
|
|
447
|
+
if (filterArrayPaths.some(function (a) { return a === field.fieldPath; })) {
|
|
448
|
+
var tmpOr_1 = [];
|
|
449
|
+
var filter = common_1.deepCopy(filterArrays[filterArrayPaths.indexOf(field.fieldPath)]);
|
|
450
|
+
if (filter['$or']) {
|
|
451
|
+
filter['$or'].forEach(function (orVal) {
|
|
452
|
+
var _a;
|
|
453
|
+
tmpOr_1.push((_a = {},
|
|
454
|
+
_a[Object.keys(orVal[Object.keys(orVal)[0]])[0]] = ['$$this.' + field.fieldPath.split('.$.')[0] + field.fieldPath.split('.$')[1], orVal[Object.keys(orVal)[0]][Object.keys(orVal[Object.keys(orVal)[0]])[0]]],
|
|
455
|
+
_a));
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
else {
|
|
459
|
+
initialNonSumFilterProj.$addFields['rb_arrays_0_' + field.id].$filter.cond.$and.push((_a = {}, _a[Object.keys(filter[Object.keys(filter)[0]])[0]] = ['$$this.' + field.fieldPath.split('.$.')[0] + field.fieldPath.split('.$')[1], filter[Object.keys(filter)[0]][Object.keys(filter[Object.keys(filter)[0]])[0]]], _a));
|
|
460
|
+
}
|
|
461
|
+
if (tmpOr_1.length) {
|
|
462
|
+
initialNonSumFilterProj.$addFields['rb_arrays_0_' + field.id].$filter.cond.$and.push({ $or: tmpOr_1 });
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
});
|
|
466
|
+
initialNonSumElemAtProj = { $addFields: {} };
|
|
467
|
+
initialNonSumValueProj = { $addFields: {} };
|
|
468
|
+
selectedFields.filter(function (a) { return a.fieldPath.split('.$').length === 2; }).forEach(function (field) {
|
|
469
|
+
initialNonSumElemAtProj.$addFields['rb_arrays_0_' + field.id] = '$rb_arrays_0_' + field.id + '.' + field.fieldPath.split('.$')[0];
|
|
470
|
+
});
|
|
471
|
+
selectedFields.filter(function (a) { return a.fieldPath.split('.$').length === 2; }).forEach(function (field) {
|
|
472
|
+
if (field.leafValueType === 'Count') {
|
|
473
|
+
initialNonSumValueProj.$addFields[field.id] = { '$size': '$rb_arrays_0_' + field.id + field.fieldPath.split('.$')[1] };
|
|
474
|
+
}
|
|
475
|
+
else if (field.leafValueType === 'Minimum') {
|
|
476
|
+
initialNonSumValueProj.$addFields[field.id] = { '$min': '$rb_arrays_0_' + field.id + field.fieldPath.split('.$')[1] };
|
|
477
|
+
}
|
|
478
|
+
else if (field.leafValueType === 'Maximum') {
|
|
479
|
+
initialNonSumValueProj.$addFields[field.id] = { '$max': '$rb_arrays_0_' + field.id + field.fieldPath.split('.$')[1] };
|
|
480
|
+
}
|
|
481
|
+
else if (field.leafValueType === 'First') {
|
|
482
|
+
initialNonSumValueProj.$addFields[field.id] = { '$arrayElemAt': ['$rb_arrays_0_' + field.id + field.fieldPath.split('.$')[1], 0] };
|
|
483
|
+
}
|
|
484
|
+
else if (field.leafValueType === 'Last') {
|
|
485
|
+
initialNonSumValueProj.$addFields[field.id] = { '$arrayElemAt': ['$rb_arrays_0_' + field.id + field.fieldPath.split('.$')[1], -1] };
|
|
486
|
+
}
|
|
487
|
+
else { //push
|
|
488
|
+
initialNonSumValueProj.$addFields[field.id] = '$rb_arrays_0_' + field.id + field.fieldPath.split('.$')[1];
|
|
489
|
+
}
|
|
490
|
+
});
|
|
491
|
+
}
|
|
428
492
|
cnt = 1;
|
|
429
493
|
_loop_1 = function () {
|
|
430
494
|
var group = { $group: { _id: {} } };
|
|
@@ -463,12 +527,12 @@ function loadReportBuilderMethods(methodManager) {
|
|
|
463
527
|
}
|
|
464
528
|
zipLayers.push(group);
|
|
465
529
|
}
|
|
466
|
-
var proj = { $
|
|
530
|
+
var proj = { $addFields: {} };
|
|
467
531
|
selectedFields.filter(function (a) { return a.fieldPath.split('.$').length <= cnt + 1; }).forEach(function (field) {
|
|
468
|
-
proj.$
|
|
532
|
+
proj.$addFields[field.id] = 1;
|
|
469
533
|
});
|
|
470
534
|
if (selectedFields.some(function (a) { return a.fieldPath.split('.$').length === cnt + 2; })) {
|
|
471
|
-
proj.$
|
|
535
|
+
proj.$addFields['rb_arrays_' + cnt] = {
|
|
472
536
|
$map: {
|
|
473
537
|
input: {
|
|
474
538
|
$zip: {
|
|
@@ -485,10 +549,10 @@ function loadReportBuilderMethods(methodManager) {
|
|
|
485
549
|
for (var i = 1; i < cnt + 1; i++) {
|
|
486
550
|
fieldPath += field.fieldPath.split('.$')[i];
|
|
487
551
|
}
|
|
488
|
-
if (!proj.$
|
|
489
|
-
if (!proj.$
|
|
490
|
-
proj.$
|
|
491
|
-
proj.$
|
|
552
|
+
if (!proj.$addFields['rb_arrays_' + cnt].$map.input.$zip.inputs.some(function (a) { return a === '$' + fieldPath; })) {
|
|
553
|
+
if (!proj.$addFields['rb_arrays_' + cnt].$map.input.$zip.inputs.some(function (a) { return a === '$rb_arrays_' + (cnt - 1) + '.' + fieldPath; })) {
|
|
554
|
+
proj.$addFields['rb_arrays_' + cnt].$map.input.$zip.inputs.push('$rb_arrays_' + (cnt - 1) + '.' + fieldPath);
|
|
555
|
+
proj.$addFields['rb_arrays_' + cnt].$map.in[field.fieldPath.split('.$.')[cnt]] = {
|
|
492
556
|
$arrayElemAt: ['$$zipped', index]
|
|
493
557
|
};
|
|
494
558
|
}
|
|
@@ -499,37 +563,6 @@ function loadReportBuilderMethods(methodManager) {
|
|
|
499
563
|
path: '$rb_arrays_' + cnt,
|
|
500
564
|
preserveNullAndEmptyArrays: true
|
|
501
565
|
} });
|
|
502
|
-
var tmpMatch = {
|
|
503
|
-
"$match": {
|
|
504
|
-
$and: []
|
|
505
|
-
}
|
|
506
|
-
};
|
|
507
|
-
var newfilterArrays_1 = [];
|
|
508
|
-
filterArrayPaths.forEach(function (filterPath, index) {
|
|
509
|
-
var _a;
|
|
510
|
-
var tmpOr = [];
|
|
511
|
-
if (filterPath.split('.$').length === cnt + 2) {
|
|
512
|
-
var filter = common_1.deepCopy(filterArrays[index]);
|
|
513
|
-
if (filter['$or']) {
|
|
514
|
-
filter['$or'].forEach(function (orVal) {
|
|
515
|
-
var _a;
|
|
516
|
-
var filterProp = '$rb_arrays_' + cnt + '.' + Object.keys(orVal)[0];
|
|
517
|
-
tmpOr.push((_a = {}, _a[filterProp] = orVal[Object.keys(orVal)[0]], _a));
|
|
518
|
-
});
|
|
519
|
-
}
|
|
520
|
-
else {
|
|
521
|
-
var filterProp = '$rb_arrays_' + cnt + '.' + Object.keys(filter)[0];
|
|
522
|
-
newfilterArrays_1.push((_a = {}, _a[filterProp] = filter[Object.keys(filter)[0]], _a));
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
if (tmpOr.length) {
|
|
526
|
-
newfilterArrays_1.push({ $or: tmpOr });
|
|
527
|
-
}
|
|
528
|
-
});
|
|
529
|
-
tmpMatch.$match.$and = newfilterArrays_1;
|
|
530
|
-
if (tmpMatch.$match.$and.length) {
|
|
531
|
-
zipLayers.push(tmpMatch);
|
|
532
|
-
}
|
|
533
566
|
}
|
|
534
567
|
cnt++;
|
|
535
568
|
};
|
|
@@ -738,17 +771,32 @@ function loadReportBuilderMethods(methodManager) {
|
|
|
738
771
|
$group: initialGroup
|
|
739
772
|
});
|
|
740
773
|
}
|
|
774
|
+
if (secondInitialGroup) {
|
|
775
|
+
query.push({
|
|
776
|
+
$group: secondInitialGroup
|
|
777
|
+
});
|
|
778
|
+
}
|
|
741
779
|
query.push({
|
|
742
780
|
$unwind: {
|
|
743
781
|
"path": "$rb_arrays_0",
|
|
744
782
|
"preserveNullAndEmptyArrays": true
|
|
745
783
|
}
|
|
746
784
|
});
|
|
747
|
-
if (
|
|
748
|
-
query.push(
|
|
749
|
-
$group: secondInitialGroup
|
|
750
|
-
});
|
|
785
|
+
if (initialNonSumFilterProj) {
|
|
786
|
+
query.push(initialNonSumFilterProj);
|
|
751
787
|
}
|
|
788
|
+
if (initialNonSumElemAtProj) {
|
|
789
|
+
query.push(initialNonSumElemAtProj);
|
|
790
|
+
}
|
|
791
|
+
if (initialNonSumValueProj) {
|
|
792
|
+
query.push(initialNonSumValueProj);
|
|
793
|
+
}
|
|
794
|
+
query.push({
|
|
795
|
+
$unwind: {
|
|
796
|
+
"path": "$rb_arrays_0",
|
|
797
|
+
"preserveNullAndEmptyArrays": true
|
|
798
|
+
}
|
|
799
|
+
});
|
|
752
800
|
for (i = 0; i < zipLayers.length; i++) {
|
|
753
801
|
query.push(zipLayers[i]);
|
|
754
802
|
}
|
package/package.json
CHANGED
package/server-app.d.ts
CHANGED
package/server-app.js
CHANGED
|
@@ -64,7 +64,10 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
64
64
|
function ResolveIOMainServer(mainServer, serverConfig, clientDir) {
|
|
65
65
|
this._msgQueue = [];
|
|
66
66
|
this._msgQueueRunning = false;
|
|
67
|
-
|
|
67
|
+
this.LOGGER = 'ERROR'; //ERROR / DEBUG
|
|
68
|
+
if (this.LOGGER === 'DEBUG') {
|
|
69
|
+
console.log('Starting ResolveIO Server');
|
|
70
|
+
}
|
|
68
71
|
this._resolveioServer = mainServer;
|
|
69
72
|
this._serverConfig = serverConfig;
|
|
70
73
|
this._clientDir = clientDir;
|
|
@@ -76,10 +79,14 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
76
79
|
this._app.use(bodyParser.urlencoded({ limit: '5mb', extended: true }));
|
|
77
80
|
// Set port
|
|
78
81
|
this._port = process.env.PORT || serverConfig['PORT'];
|
|
79
|
-
|
|
82
|
+
if (this.LOGGER === 'DEBUG') {
|
|
83
|
+
console.log('Setup ports');
|
|
84
|
+
}
|
|
80
85
|
// Create http server and websock server
|
|
81
86
|
this.createServer();
|
|
82
|
-
|
|
87
|
+
if (this.LOGGER === 'DEBUG') {
|
|
88
|
+
console.log('Create server');
|
|
89
|
+
}
|
|
83
90
|
// Set CORS
|
|
84
91
|
this._app.use(function (req, res, next) {
|
|
85
92
|
// Website you wish to allow to connect
|
|
@@ -96,11 +103,15 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
96
103
|
// Pass to next layer of middleware
|
|
97
104
|
next();
|
|
98
105
|
});
|
|
99
|
-
|
|
106
|
+
if (this.LOGGER === 'DEBUG') {
|
|
107
|
+
console.log('Setup cors');
|
|
108
|
+
}
|
|
100
109
|
// Set up http login route
|
|
101
110
|
auth_1.setupAuthRoutes(this, this._app, serverConfig);
|
|
102
111
|
health_1.setupHealthRoutes(this._app, serverConfig);
|
|
103
|
-
|
|
112
|
+
if (this.LOGGER === 'DEBUG') {
|
|
113
|
+
console.log('Setup express routes');
|
|
114
|
+
}
|
|
104
115
|
}
|
|
105
116
|
ResolveIOMainServer.prototype.getWS = function (id_ws) {
|
|
106
117
|
var res = null;
|
|
@@ -145,7 +156,9 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
145
156
|
var infoData, token;
|
|
146
157
|
var _this = this;
|
|
147
158
|
return __generator(this, function (_a) {
|
|
148
|
-
|
|
159
|
+
if (this.LOGGER === 'DEBUG') {
|
|
160
|
+
console.log('Verify Client', info, cb);
|
|
161
|
+
}
|
|
149
162
|
infoData = info.req.headers['sec-websocket-protocol'].split(/,/);
|
|
150
163
|
if (info.origin !== this._serverConfig['ROOT_URL'] && info.origin !== this._serverConfig['SEC_ROOT_URL'] && info.origin !== this._serverConfig['RESOLVEIO_URL'] && info.origin !== this._serverConfig['RESOLVEIO_SECONDARY_URL']) {
|
|
151
164
|
cb(false, 401, 'Unauthorized');
|
|
@@ -214,14 +227,18 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
214
227
|
__setOptions.apply(this, arguments);
|
|
215
228
|
return this;
|
|
216
229
|
};
|
|
217
|
-
|
|
230
|
+
if (this.LOGGER === 'DEBUG') {
|
|
231
|
+
console.log('Start Managers');
|
|
232
|
+
}
|
|
218
233
|
// Start Managers
|
|
219
234
|
this._subscriptionManager = new subscription_manager_1.SubscriptionManager(this, this._wss, this._serverConfig);
|
|
220
235
|
this._methodManager = new method_manager_1.MethodManager(this, this._serverConfig, this._clientDir);
|
|
221
236
|
this._supportManager = new support_manager_1.SupportManager(this, this._serverConfig, this._clientDir);
|
|
222
237
|
this._cronManager = new cron_manager_1.CronManager(this);
|
|
223
238
|
this._queueManager = new queue_method_manager_1.QueueMethodManager(this);
|
|
224
|
-
|
|
239
|
+
if (this.LOGGER === 'DEBUG') {
|
|
240
|
+
console.log('End Managers');
|
|
241
|
+
}
|
|
225
242
|
this.listen();
|
|
226
243
|
mongoose.set('useFindAndModify', false);
|
|
227
244
|
// mongoose.set('useCreateIndexes', true);
|
|
@@ -248,7 +265,9 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
248
265
|
ws['user_readonly'] = req.user_readonly;
|
|
249
266
|
ws['id_socket'] = uuid();
|
|
250
267
|
ws['retryCnt'] = 0;
|
|
251
|
-
|
|
268
|
+
if (_this.LOGGER === 'DEBUG') {
|
|
269
|
+
console.log('Connection from: ' + req.user);
|
|
270
|
+
}
|
|
252
271
|
// Use for keeping connection alive (ping/pong)
|
|
253
272
|
ws['isAlive'] = true;
|
|
254
273
|
ws.on('pong', function () {
|
|
@@ -266,7 +285,9 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
266
285
|
var _a, _b, socketData, data, messageDate, messageId, type, subType, pub;
|
|
267
286
|
var _this = this;
|
|
268
287
|
return __generator(this, function (_c) {
|
|
269
|
-
|
|
288
|
+
if (this.LOGGER === 'DEBUG') {
|
|
289
|
+
console.log('Message from: ' + ws['user'], message);
|
|
290
|
+
}
|
|
270
291
|
socketData = JSON.parse(message, common_1.dateReviver);
|
|
271
292
|
data = common_2.deepCopy(socketData);
|
|
272
293
|
if (data[0] === 'ping') {
|