@resolveio/server-lib 5.2.38 → 5.2.39-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.
- package/collections/user.collection.js +39 -32
- package/http/home.d.ts +2 -0
- package/http/home.js +25 -0
- package/package.json +1 -1
- package/server-app.js +4 -0
|
@@ -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
|
-
|
|
74
|
-
type: String
|
|
75
|
-
optional: true
|
|
75
|
+
'roles.approvals.$.type': {
|
|
76
|
+
type: String
|
|
76
77
|
},
|
|
77
|
-
|
|
78
|
-
type:
|
|
79
|
-
blackbox: true,
|
|
80
|
-
optional: true
|
|
78
|
+
'roles.approvals.$.accounting_code': {
|
|
79
|
+
type: String
|
|
81
80
|
},
|
|
82
|
-
|
|
83
|
-
type: Array
|
|
84
|
-
optional: true
|
|
81
|
+
'roles.groups': {
|
|
82
|
+
type: Array
|
|
85
83
|
},
|
|
86
|
-
'
|
|
84
|
+
'roles.groups.$': {
|
|
87
85
|
type: Object
|
|
88
86
|
},
|
|
89
|
-
'
|
|
87
|
+
'roles.groups.$.name': {
|
|
90
88
|
type: String
|
|
91
89
|
},
|
|
92
|
-
'
|
|
93
|
-
type:
|
|
90
|
+
'roles.groups.$.views': {
|
|
91
|
+
type: Array
|
|
94
92
|
},
|
|
95
|
-
'
|
|
93
|
+
'roles.groups.$.views.$': {
|
|
96
94
|
type: String
|
|
97
95
|
},
|
|
98
|
-
'
|
|
99
|
-
type: String
|
|
96
|
+
'roles.groups.$.yard': {
|
|
97
|
+
type: String,
|
|
98
|
+
optional: true
|
|
99
|
+
},
|
|
100
|
+
'roles.notifications': {
|
|
101
|
+
type: Array
|
|
100
102
|
},
|
|
101
|
-
'
|
|
103
|
+
'roles.notifications.$': {
|
|
102
104
|
type: String
|
|
103
105
|
},
|
|
104
|
-
'
|
|
105
|
-
type:
|
|
106
|
+
'roles.miscs': {
|
|
107
|
+
type: Array
|
|
106
108
|
},
|
|
107
|
-
'
|
|
108
|
-
type:
|
|
109
|
-
optional: true
|
|
109
|
+
'roles.miscs.$': {
|
|
110
|
+
type: String
|
|
110
111
|
},
|
|
111
|
-
|
|
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/http/home.d.ts
ADDED
package/http/home.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
function setupHomeRoutes(mainServer, app, serverConfig) {
|
|
4
|
+
app.post('/resolveioContactUs', function (request, response) {
|
|
5
|
+
if (request.headers.origin !== serverConfig['ROOT_URL'] && request.headers.origin !== serverConfig['SEC_ROOT_URL']) {
|
|
6
|
+
response.send(JSON.stringify({
|
|
7
|
+
error: true,
|
|
8
|
+
result: 'Invalid header'
|
|
9
|
+
}));
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
var form = request.body;
|
|
13
|
+
mainServer.getMethodManager().sendEmail('dustin@resolveio.com', 'ResolveIO - Contact Us', '', 'Name: ' + form.name + '<br>' +
|
|
14
|
+
'Email: ' + form.email + '<br>' +
|
|
15
|
+
'Phone: ' + form.phone + '<br>' +
|
|
16
|
+
'Subject: ' + form.subject + '<br>' +
|
|
17
|
+
'Message: ' + form.message + '<br>');
|
|
18
|
+
response.send(JSON.stringify({
|
|
19
|
+
error: false,
|
|
20
|
+
result: null
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
exports.setupHomeRoutes = setupHomeRoutes;
|
package/package.json
CHANGED
package/server-app.js
CHANGED
|
@@ -61,6 +61,7 @@ var support_manager_1 = require("./managers/support.manager");
|
|
|
61
61
|
var queue_method_manager_1 = require("./managers/queue-method.manager");
|
|
62
62
|
var common_2 = require("./util/common");
|
|
63
63
|
var log_method_latency_collection_1 = require("./collections/log-method-latency.collection");
|
|
64
|
+
var home_1 = require("./http/home");
|
|
64
65
|
var ResolveIOMainServer = /** @class */ (function () {
|
|
65
66
|
function ResolveIOMainServer(mainServer, serverConfig, clientDir, sesMail) {
|
|
66
67
|
this._msgQueue = [];
|
|
@@ -112,6 +113,9 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
112
113
|
// Set up http login route
|
|
113
114
|
auth_1.setupAuthRoutes(this, this._app, serverConfig);
|
|
114
115
|
health_1.setupHealthRoutes(this._app, serverConfig);
|
|
116
|
+
if (serverConfig['CLIENT_NAME'] === 'ResolveIO') {
|
|
117
|
+
home_1.setupHomeRoutes(this, this._app, serverConfig);
|
|
118
|
+
}
|
|
115
119
|
if (this.LOGGER === 'DEBUG') {
|
|
116
120
|
console.log('Setup express routes');
|
|
117
121
|
}
|