@resolveio/server-lib 5.0.1-newrole → 5.0.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.
|
@@ -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;
|
|
@@ -726,8 +726,17 @@ var SubscriptionManager = /** @class */ (function () {
|
|
|
726
726
|
that._mainServer.getMethodManager().callMethodInternal('insertSubscriptionLog', type, subscription.publication, collection, JSON.stringify(subscription.subscriptionData));
|
|
727
727
|
}
|
|
728
728
|
(_a = that._publications[subscription.publication].function).call.apply(_a, [Object.assign({}, that, SubscriptionManager.prototype)].concat(subscription.subscriptionData)).then(function (res) {
|
|
729
|
-
if (common_1.getBinarySize(JSON.stringify(_this._subCache))
|
|
730
|
-
_this._subCache
|
|
729
|
+
if (common_1.getBinarySize(JSON.stringify(_this._subCache)) > 750000000) {
|
|
730
|
+
var neededSize = (common_1.getBinarySize(JSON.stringify(_this._subCache))) - 750000000;
|
|
731
|
+
var neededSizeIndex = 0;
|
|
732
|
+
for (var zz = 0; zz < _this._subCache.length; zz++) {
|
|
733
|
+
neededSize -= (common_1.getBinarySize(JSON.stringify(_this._subCache[zz])));
|
|
734
|
+
neededSizeIndex++;
|
|
735
|
+
if (neededSize < 0) {
|
|
736
|
+
break;
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
_this._subCache.splice(0, neededSizeIndex);
|
|
731
740
|
}
|
|
732
741
|
_this._subCache.push({ publication: subscription.publication, subscriptionData: subscription.subscriptionData, res: res });
|
|
733
742
|
var serverRes = {
|
|
@@ -795,8 +804,17 @@ var SubscriptionManager = /** @class */ (function () {
|
|
|
795
804
|
that._mainServer.getMethodManager().callMethodInternal('insertSubscriptionLog', type, subscription.publication, collection, JSON.stringify(subscription.subscriptionData));
|
|
796
805
|
}
|
|
797
806
|
(_a = that._publications[subscription.publication].function).call.apply(_a, [Object.assign({}, that, SubscriptionManager.prototype)].concat(subscription.subscriptionData)).then(function (res) {
|
|
798
|
-
if (common_1.getBinarySize(JSON.stringify(_this._subCache))
|
|
799
|
-
_this._subCache
|
|
807
|
+
if (common_1.getBinarySize(JSON.stringify(_this._subCache)) > 750000000) {
|
|
808
|
+
var neededSize = (common_1.getBinarySize(JSON.stringify(_this._subCache))) - 750000000;
|
|
809
|
+
var neededSizeIndex = 0;
|
|
810
|
+
for (var zz = 0; zz < _this._subCache.length; zz++) {
|
|
811
|
+
neededSize -= (common_1.getBinarySize(JSON.stringify(_this._subCache[zz])));
|
|
812
|
+
neededSizeIndex++;
|
|
813
|
+
if (neededSize < 0) {
|
|
814
|
+
break;
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
_this._subCache.splice(0, neededSizeIndex);
|
|
800
818
|
}
|
|
801
819
|
_this._subCache.push({ publication: subscription.publication, subscriptionData: subscription.subscriptionData, res: res });
|
|
802
820
|
subscription.clients.forEach(function (client) {
|