@resolveio/server-lib 5.2.1 → 5.2.2-newrole

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.
@@ -22,13 +22,6 @@ 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
- },
32
25
  attempts: {
33
26
  type: Number,
34
27
  optional: true
@@ -65,53 +58,67 @@ var schema = {
65
58
  type: String
66
59
  },
67
60
  roles: {
61
+ type: Object
62
+ },
63
+ 'roles.super_admin': {
64
+ type: Boolean
65
+ },
66
+ 'roles.approvals': {
68
67
  type: Array
69
68
  },
70
- 'roles.$': {
69
+ 'roles.approvals.$': {
70
+ type: Object
71
+ },
72
+ 'roles.approvals.$.name': {
71
73
  type: String
72
74
  },
73
- phonenumber: {
74
- type: String,
75
- optional: true
75
+ 'roles.approvals.$.type': {
76
+ type: String
76
77
  },
77
- other: {
78
- type: Object,
79
- blackbox: true,
80
- optional: true
78
+ 'roles.approvals.$.accounting_code': {
79
+ type: String
81
80
  },
82
- assets: {
83
- type: Array,
84
- optional: true
81
+ 'roles.groups': {
82
+ type: Array
85
83
  },
86
- 'assets.$': {
84
+ 'roles.groups.$': {
87
85
  type: Object
88
86
  },
89
- 'assets.$.type': {
87
+ 'roles.groups.$.name': {
90
88
  type: String
91
89
  },
92
- 'assets.$.id_asset': {
93
- type: String
90
+ 'roles.groups.$.views': {
91
+ type: Array
94
92
  },
95
- 'assets.$.asset_number': {
93
+ 'roles.groups.$.views.$': {
96
94
  type: String
97
95
  },
98
- 'assets.$.ownership': {
99
- type: String
96
+ 'roles.groups.$.yard': {
97
+ type: String,
98
+ optional: true
99
+ },
100
+ 'roles.notifications': {
101
+ type: Array
100
102
  },
101
- 'assets.$.ownership_driver': {
103
+ 'roles.notifications.$': {
102
104
  type: String
103
105
  },
104
- 'assets.$.date_start': {
105
- type: Date
106
+ 'roles.miscs': {
107
+ type: Array
106
108
  },
107
- 'assets.$.date_end': {
108
- type: Date,
109
- optional: true
109
+ 'roles.miscs.$': {
110
+ type: String
110
111
  },
111
- id_function: {
112
+ active: Boolean,
113
+ phonenumber: {
112
114
  type: String,
113
115
  optional: true
114
116
  },
117
+ other: {
118
+ type: Object,
119
+ optional: true,
120
+ blackbox: true
121
+ },
115
122
  customers: {
116
123
  type: Array,
117
124
  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 active_subscription_collection_1 = require("../collections/active-subscription.collection");
41
40
  var mongoose_1 = require("mongoose");
41
+ var active_subscription_collection_1 = require("../collections/active-subscription.collection");
42
42
  function loadServerInit() {
43
43
  return __awaiter(this, void 0, void 0, function () {
44
44
  var appVersion;
@@ -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-newrole",
4
4
  "description": "",
5
5
  "main": "index.ts",
6
6
  "scripts": {