@resolveio/server-lib 4.4.0-newrole → 4.4.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/collections/user.collection.js +37 -39
- package/fixtures/init.js +1 -1
- package/package.json +1 -1
|
@@ -4,6 +4,7 @@ var mongoose_1 = require("mongoose");
|
|
|
4
4
|
var passportLocalMongoose = require("passport-local-mongoose");
|
|
5
5
|
var simpl_schema_1 = require("simpl-schema");
|
|
6
6
|
var index_1 = require("../index");
|
|
7
|
+
var schema_report_builder_1 = require("../util/schema-report-builder");
|
|
7
8
|
var schema = {
|
|
8
9
|
_id: {
|
|
9
10
|
type: String,
|
|
@@ -21,6 +22,13 @@ var schema = {
|
|
|
21
22
|
type: Date,
|
|
22
23
|
optional: true
|
|
23
24
|
},
|
|
25
|
+
readonly: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
optional: true
|
|
28
|
+
},
|
|
29
|
+
active: {
|
|
30
|
+
type: Boolean
|
|
31
|
+
},
|
|
24
32
|
attempts: {
|
|
25
33
|
type: Number,
|
|
26
34
|
optional: true
|
|
@@ -57,67 +65,53 @@ var schema = {
|
|
|
57
65
|
type: String
|
|
58
66
|
},
|
|
59
67
|
roles: {
|
|
60
|
-
type: Object
|
|
61
|
-
},
|
|
62
|
-
'roles.super_admin': {
|
|
63
|
-
type: Boolean
|
|
64
|
-
},
|
|
65
|
-
'roles.approvals': {
|
|
66
68
|
type: Array
|
|
67
69
|
},
|
|
68
|
-
'roles
|
|
69
|
-
type: Object
|
|
70
|
-
},
|
|
71
|
-
'roles.approvals.$.name': {
|
|
70
|
+
'roles.$': {
|
|
72
71
|
type: String
|
|
73
72
|
},
|
|
74
|
-
|
|
75
|
-
type: String
|
|
73
|
+
phonenumber: {
|
|
74
|
+
type: String,
|
|
75
|
+
optional: true
|
|
76
76
|
},
|
|
77
|
-
|
|
78
|
-
type:
|
|
77
|
+
other: {
|
|
78
|
+
type: Object,
|
|
79
|
+
blackbox: true,
|
|
80
|
+
optional: true
|
|
79
81
|
},
|
|
80
|
-
|
|
81
|
-
type: Array
|
|
82
|
+
assets: {
|
|
83
|
+
type: Array,
|
|
84
|
+
optional: true
|
|
82
85
|
},
|
|
83
|
-
'
|
|
86
|
+
'assets.$': {
|
|
84
87
|
type: Object
|
|
85
88
|
},
|
|
86
|
-
'
|
|
89
|
+
'assets.$.type': {
|
|
87
90
|
type: String
|
|
88
91
|
},
|
|
89
|
-
'
|
|
90
|
-
type: Array
|
|
91
|
-
},
|
|
92
|
-
'roles.groups.$.views.$': {
|
|
92
|
+
'assets.$.id_asset': {
|
|
93
93
|
type: String
|
|
94
94
|
},
|
|
95
|
-
'
|
|
96
|
-
type: String
|
|
97
|
-
optional: true
|
|
95
|
+
'assets.$.asset_number': {
|
|
96
|
+
type: String
|
|
98
97
|
},
|
|
99
|
-
'
|
|
100
|
-
type:
|
|
98
|
+
'assets.$.ownership': {
|
|
99
|
+
type: String
|
|
101
100
|
},
|
|
102
|
-
'
|
|
101
|
+
'assets.$.ownership_driver': {
|
|
103
102
|
type: String
|
|
104
103
|
},
|
|
105
|
-
'
|
|
106
|
-
type:
|
|
104
|
+
'assets.$.date_start': {
|
|
105
|
+
type: Date
|
|
107
106
|
},
|
|
108
|
-
'
|
|
109
|
-
type:
|
|
107
|
+
'assets.$.date_end': {
|
|
108
|
+
type: Date,
|
|
109
|
+
optional: true
|
|
110
110
|
},
|
|
111
|
-
|
|
112
|
-
phonenumber: {
|
|
111
|
+
id_function: {
|
|
113
112
|
type: String,
|
|
114
113
|
optional: true
|
|
115
114
|
},
|
|
116
|
-
other: {
|
|
117
|
-
type: Object,
|
|
118
|
-
optional: true,
|
|
119
|
-
blackbox: true
|
|
120
|
-
},
|
|
121
115
|
customers: {
|
|
122
116
|
type: Array,
|
|
123
117
|
optional: true,
|
|
@@ -188,3 +182,7 @@ var VersionSchema = new mongoose_1.Schema(schema, {
|
|
|
188
182
|
});
|
|
189
183
|
exports.Users['versionCollection'] = 'users.versions';
|
|
190
184
|
exports.UserVersions = index_1.ResolveIOServer.getMainDB().model(exports.Users['versionCollection'], VersionSchema);
|
|
185
|
+
//------------- Report Builder Schema
|
|
186
|
+
var rbLookups = [];
|
|
187
|
+
var rbSchema = Object.assign(schema, schema_report_builder_1.buildRbLookups(rbLookups, DefaultSchema, []));
|
|
188
|
+
exports.Users['rbSchema'] = schema_report_builder_1.buildRbSchema(rbSchema);
|
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;
|