@resolveio/server-lib 1.0.0 → 1.0.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/managers/method.manager.js +14 -1
- package/managers/queue-method.manager.js +14 -1
- package/package.json +1 -1
- package/server-app.js +42 -3
|
@@ -163,7 +163,7 @@ var MethodManager = /** @class */ (function () {
|
|
|
163
163
|
_this._mainServer.unsubscribeWS(ws);
|
|
164
164
|
}
|
|
165
165
|
});
|
|
166
|
-
if (sendItem.method !== 'countQuery' && sendItem.method !== 'countCollectionWithQuery' && sendItem.method !== 'find' && sendItem.method !== 'findOne' && sendItem.method !== 'findWithOptions' && sendItem.method !== 'setWSAppVersion' && sendItem.method !== 'uploadFileAndSave') {
|
|
166
|
+
if (sendItem.method !== 'generatePDF' && sendItem.method !== 'getWOOfflineData' && sendItem.method !== 'countQuery' && sendItem.method !== 'countCollectionWithQuery' && sendItem.method !== 'find' && sendItem.method !== 'findOne' && sendItem.method !== 'findWithOptions' && sendItem.method !== 'setWSAppVersion' && sendItem.method !== 'uploadFileAndSave') {
|
|
167
167
|
if (common_1.getBinarySize(JSON.stringify(sendItem.methodData)) < 200000 && common_1.getBinarySize(JSON.stringify(sendItem.data)) < 200000) {
|
|
168
168
|
log_collection_1.Logs.create({
|
|
169
169
|
_id: mongoose_1.Types.ObjectId().toHexString(),
|
|
@@ -191,6 +191,19 @@ var MethodManager = /** @class */ (function () {
|
|
|
191
191
|
});
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
|
+
else {
|
|
195
|
+
log_collection_1.Logs.create({
|
|
196
|
+
_id: mongoose_1.Types.ObjectId().toHexString(),
|
|
197
|
+
date: new Date(),
|
|
198
|
+
type: 'client-response',
|
|
199
|
+
title: 'Client Response',
|
|
200
|
+
message: 'User: ' + ws['user'] + ', MessageId: ' + sendItem.data.messageId + ', Method: ' + sendItem.method,
|
|
201
|
+
payload: 'Too Big',
|
|
202
|
+
method: sendItem.method,
|
|
203
|
+
user: ws['user'],
|
|
204
|
+
messageId: sendItem.data.messageId
|
|
205
|
+
});
|
|
206
|
+
}
|
|
194
207
|
method_response_collection_1.MethodResponses.create({
|
|
195
208
|
_id: mongoose_1.Types.ObjectId().toHexString(),
|
|
196
209
|
__v: 0,
|
|
@@ -63,7 +63,7 @@ var QueueMethodManager = /** @class */ (function () {
|
|
|
63
63
|
_this._mainServer.unsubscribeWS(ws);
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
|
-
if (sendItem.method !== 'countQuery' && sendItem.method !== 'countCollectionWithQuery' && sendItem.method !== 'find' && sendItem.method !== 'findOne' && sendItem.method !== 'findWithOptions' && sendItem.method !== 'setWSAppVersion' && sendItem.method !== 'uploadFileAndSave') {
|
|
66
|
+
if (sendItem.method !== 'generatePDF' && sendItem.method !== 'getWOOfflineData' && sendItem.method !== 'countQuery' && sendItem.method !== 'countCollectionWithQuery' && sendItem.method !== 'find' && sendItem.method !== 'findOne' && sendItem.method !== 'findWithOptions' && sendItem.method !== 'setWSAppVersion' && sendItem.method !== 'uploadFileAndSave') {
|
|
67
67
|
if (common_1.getBinarySize(JSON.stringify(sendItem.methodData)) < 200000 && common_1.getBinarySize(JSON.stringify(sendItem.data)) < 200000) {
|
|
68
68
|
log_collection_1.Logs.create({
|
|
69
69
|
_id: mongoose_1.Types.ObjectId().toHexString(),
|
|
@@ -91,6 +91,19 @@ var QueueMethodManager = /** @class */ (function () {
|
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
+
else {
|
|
95
|
+
log_collection_1.Logs.create({
|
|
96
|
+
_id: mongoose_1.Types.ObjectId().toHexString(),
|
|
97
|
+
date: new Date(),
|
|
98
|
+
type: 'client-response',
|
|
99
|
+
title: 'Client Response',
|
|
100
|
+
message: 'User: ' + ws['user'] + ', MessageId: ' + sendItem.messageId + ', Method: ' + sendItem.method,
|
|
101
|
+
payload: 'Too Big',
|
|
102
|
+
method: sendItem.method,
|
|
103
|
+
user: ws['user'],
|
|
104
|
+
messageId: sendItem.messageId
|
|
105
|
+
});
|
|
106
|
+
}
|
|
94
107
|
method_response_collection_1.MethodResponses.create({
|
|
95
108
|
_id: mongoose_1.Types.ObjectId().toHexString(),
|
|
96
109
|
__v: 0,
|
package/package.json
CHANGED
package/server-app.js
CHANGED
|
@@ -280,7 +280,7 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
280
280
|
ws.terminate();
|
|
281
281
|
}, 5000);
|
|
282
282
|
}
|
|
283
|
-
if (method !== 'countQuery' && method !== 'countCollectionWithQuery' && method !== 'find' && method !== 'findOne' && method !== 'findWithOptions' && method !== 'setWSAppVersion') {
|
|
283
|
+
if (method !== 'generatePDF' && method !== 'getWOOfflineData' && method !== 'countQuery' && method !== 'countCollectionWithQuery' && method !== 'find' && method !== 'findOne' && method !== 'findWithOptions' && method !== 'setWSAppVersion') {
|
|
284
284
|
if (common_1.getBinarySize(JSON.stringify(data)) < 200000) {
|
|
285
285
|
log_collection_1.Logs.create({
|
|
286
286
|
_id: mongoose_1.Types.ObjectId().toHexString(),
|
|
@@ -308,6 +308,19 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
308
308
|
});
|
|
309
309
|
}
|
|
310
310
|
}
|
|
311
|
+
else {
|
|
312
|
+
log_collection_1.Logs.create({
|
|
313
|
+
_id: mongoose_1.Types.ObjectId().toHexString(),
|
|
314
|
+
date: new Date(),
|
|
315
|
+
type: 'client-request',
|
|
316
|
+
title: 'Client Request - Method',
|
|
317
|
+
message: 'User: ' + ws['user'] + ', Type: ' + type + ', MessageId: ' + messageId + ', Method: ' + method,
|
|
318
|
+
payload: 'Too Big',
|
|
319
|
+
method: method,
|
|
320
|
+
user: ws['user'],
|
|
321
|
+
messageId: messageId
|
|
322
|
+
});
|
|
323
|
+
}
|
|
311
324
|
serverRes = {
|
|
312
325
|
messageId: messageId,
|
|
313
326
|
hasError: false,
|
|
@@ -383,7 +396,7 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
383
396
|
case 8:
|
|
384
397
|
if (type === 'methodRetry') {
|
|
385
398
|
method = data.shift();
|
|
386
|
-
if (method !== 'countQuery' && method !== 'countCollectionWithQuery' && method !== 'find' && method !== 'findOne' && method !== 'findWithOptions' && method !== 'setWSAppVersion') {
|
|
399
|
+
if (method !== 'generatePDF' && method !== 'getWOOfflineData' && method !== 'countQuery' && method !== 'countCollectionWithQuery' && method !== 'find' && method !== 'findOne' && method !== 'findWithOptions' && method !== 'setWSAppVersion') {
|
|
387
400
|
if (common_1.getBinarySize(JSON.stringify(data)) < 200000) {
|
|
388
401
|
log_collection_1.Logs.create({
|
|
389
402
|
_id: mongoose_1.Types.ObjectId().toHexString(),
|
|
@@ -411,6 +424,19 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
411
424
|
});
|
|
412
425
|
}
|
|
413
426
|
}
|
|
427
|
+
else {
|
|
428
|
+
log_collection_1.Logs.create({
|
|
429
|
+
_id: mongoose_1.Types.ObjectId().toHexString(),
|
|
430
|
+
date: new Date(),
|
|
431
|
+
type: 'client-request',
|
|
432
|
+
title: 'Client Request - Method Retry',
|
|
433
|
+
message: 'User: ' + ws['user'] + ', Type: ' + type + ', MessageId: ' + messageId + ', Method: ' + method,
|
|
434
|
+
payload: 'Too Big',
|
|
435
|
+
method: method,
|
|
436
|
+
user: ws['user'],
|
|
437
|
+
messageId: messageId
|
|
438
|
+
});
|
|
439
|
+
}
|
|
414
440
|
method_call_collection_1.MethodCalls.findOne({ $and: [
|
|
415
441
|
{ id_user: ws['id_user'] },
|
|
416
442
|
{ message_id: messageId },
|
|
@@ -451,7 +477,7 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
451
477
|
}
|
|
452
478
|
else if (type === 'methodResponse') {
|
|
453
479
|
method = data.shift();
|
|
454
|
-
if (method !== 'countQuery' && method !== 'countCollectionWithQuery' && method !== 'find' && method !== 'findOne' && method !== 'findWithOptions' && method !== 'setWSAppVersion') {
|
|
480
|
+
if (method !== 'generatePDF' && method !== 'getWOOfflineData' && method !== 'countQuery' && method !== 'countCollectionWithQuery' && method !== 'find' && method !== 'findOne' && method !== 'findWithOptions' && method !== 'setWSAppVersion') {
|
|
455
481
|
if (common_1.getBinarySize(JSON.stringify(data)) < 200000) {
|
|
456
482
|
log_collection_1.Logs.create({
|
|
457
483
|
_id: mongoose_1.Types.ObjectId().toHexString(),
|
|
@@ -479,6 +505,19 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
479
505
|
});
|
|
480
506
|
}
|
|
481
507
|
}
|
|
508
|
+
else {
|
|
509
|
+
log_collection_1.Logs.create({
|
|
510
|
+
_id: mongoose_1.Types.ObjectId().toHexString(),
|
|
511
|
+
date: new Date(),
|
|
512
|
+
type: 'client-request',
|
|
513
|
+
title: 'Client Request - Method Response',
|
|
514
|
+
message: 'User: ' + ws['user'] + ', Type: ' + type + ', MessageId: ' + messageId + ', Method: ' + method,
|
|
515
|
+
payload: 'Too Big',
|
|
516
|
+
method: method,
|
|
517
|
+
user: ws['user'],
|
|
518
|
+
messageId: messageId
|
|
519
|
+
});
|
|
520
|
+
}
|
|
482
521
|
method_response_collection_1.MethodResponses.findOne({ $and: [
|
|
483
522
|
{ id_user: ws['id_user'] },
|
|
484
523
|
{ message_id: messageId },
|