@resolveio/server-lib 5.2.1 → 5.2.2

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.
@@ -95,7 +95,7 @@ var SubscriptionManager = /** @class */ (function () {
95
95
  console.log('Sub Cache Length: ' + _this._subCache.length);
96
96
  console.log('Sub Length: ' + _this._subscriptions.length);
97
97
  console.log(_this._nodeCache.getStats().vsize);
98
- }, 60000);
98
+ }, 43200000);
99
99
  setInterval(function () {
100
100
  if (!_this._runningQueue) {
101
101
  if (_this._sendQueue.length) {
@@ -386,7 +386,7 @@ function loadReportBuilderMethods(methodManager) {
386
386
  };
387
387
  }
388
388
  });
389
- selectedFields.filter(function (a) { return a.fieldType === 'Number' && a.leafValueType === 'Count'; }).forEach(function (field) {
389
+ selectedFields.filter(function (a) { return a.leafValueType === 'Count'; }).forEach(function (field) {
390
390
  var multFields = [];
391
391
  sizes.filter(function (a) { return !field.fieldPath.replace(/\.\$\./g, '_').includes(a) && !groupsRow.some(function (b) { return b.field.replace(/\.\$\./g, '_').includes(a); }) && !filterArrayFields.some(function (b) { return b.fieldPath.replace(/\.\$\./g, '_').includes(a); }) && !fieldsLink.some(function (b) { return b.field_first.replace(/\.\$\./g, '_').includes(a) || b.field_second.replace(/\.\$\./g, '_').includes(a); }); }).forEach(function (size) {
392
392
  multFields.push({ $cond: { if: { $gt: ['$size_' + size, 0] }, then: '$size_' + size, else: 1 } });
@@ -558,19 +558,21 @@ function loadReportBuilderMethods(methodManager) {
558
558
  return [3 /*break*/, 4];
559
559
  case 4:
560
560
  tmpTotals = {};
561
- fieldsTotal.forEach(function (totField) {
562
- selectedFields.filter(function (b) { return b.fieldType === 'Number'; }).forEach(function (selField) {
563
- if (totField.type === 'sum') {
564
- tmpTotals[totField.id + '_' + selField.id] = res.map(function (a) { return a[totField.id + '_' + selField.id] || 0; }).reduce(function (a, b) { return a + b; }, 0);
565
- }
566
- else if (totField.type === 'avg') {
567
- tmpTotals[totField.id + '_' + selField.id] = Math.round(res.map(function (a) { return a[totField.id + '_' + selField.id] || 0; }).reduce(function (a, b) { return a + b; }, 0) / res.length);
568
- }
561
+ if (res) {
562
+ fieldsTotal.forEach(function (totField) {
563
+ selectedFields.filter(function (b) { return b.fieldType === 'Number'; }).forEach(function (selField) {
564
+ if (totField.type === 'sum') {
565
+ tmpTotals[totField.id + '_' + selField.id] = res.map(function (a) { return a[totField.id + '_' + selField.id] || 0; }).reduce(function (a, b) { return a + b; }, 0);
566
+ }
567
+ else if (totField.type === 'avg') {
568
+ tmpTotals[totField.id + '_' + selField.id] = Math.round(res.map(function (a) { return a[totField.id + '_' + selField.id] || 0; }).reduce(function (a, b) { return a + b; }, 0) / res.length);
569
+ }
570
+ });
569
571
  });
570
- });
572
+ }
571
573
  tmpRes = [{
572
- count: res.length,
573
- results: rootOptions.limit ? res.splice(0, rootOptions.limit) : res,
574
+ count: res ? res.length : 0,
575
+ results: res ? (rootOptions.limit ? res.splice(0, rootOptions.limit) : res) : [],
574
576
  totals: tmpTotals
575
577
  }];
576
578
  resolve(tmpRes);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@resolveio/server-lib",
3
- "version": "5.2.1",
3
+ "version": "5.2.2",
4
4
  "description": "",
5
5
  "main": "index.ts",
6
6
  "scripts": {