@justair/justair-library 2.0.0 → 2.1.0
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/package.json +1 -1
- package/src/index.js +3 -1
- package/src/models/admin.js +6 -3
- package/src/models/configurations.js +2 -0
- package/src/models/events.js +3 -0
- package/src/models/lightmonitors.js +3 -1
- package/src/models/measurements.js +3 -0
- package/src/models/monitors.js +3 -0
- package/src/models/users.js +5 -3
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import {monitorRequestsSchema, MonitorRequests} from './models/monitorRequests.j
|
|
|
5
5
|
import {monitorsSchema, Monitors} from './models/monitors.js';
|
|
6
6
|
import {organizationsSchema, Organizations} from './models/organizations.js';
|
|
7
7
|
import {referenceMonitorInfoSchema, ReferenceMonitorInfo} from './models/referenceMonitorInfo.js';
|
|
8
|
+
import { lightMonitorSchema, LightMonitors } from './models/lightmonitors.js';
|
|
8
9
|
import {usersSchema, Users} from './models/users.js';
|
|
9
10
|
import { eventsSchema, Events } from './models/events.js';
|
|
10
11
|
import dbConfig from './config/db.js';
|
|
@@ -27,5 +28,6 @@ export {
|
|
|
27
28
|
organizationsSchema, Organizations,
|
|
28
29
|
referenceMonitorInfoSchema, ReferenceMonitorInfo,
|
|
29
30
|
usersSchema, Users,
|
|
30
|
-
eventsSchema, Events
|
|
31
|
+
eventsSchema, Events,
|
|
32
|
+
lightMonitorSchema, LightMonitors
|
|
31
33
|
};
|
package/src/models/admin.js
CHANGED
|
@@ -11,9 +11,12 @@ const adminSchema = mongoose.Schema({
|
|
|
11
11
|
authorized: { type: Boolean, default: false },
|
|
12
12
|
isActive: { type: Boolean, default: false },
|
|
13
13
|
},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
{
|
|
15
|
+
timestamps: true
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
adminSchema.index({email: 1});
|
|
19
|
+
|
|
17
20
|
|
|
18
21
|
const Admin = mongoose.model('Admin', adminSchema);
|
|
19
22
|
|
package/src/models/events.js
CHANGED
|
@@ -18,6 +18,8 @@ const lightMonitorSchema = mongoose.Schema({
|
|
|
18
18
|
timestamps: true
|
|
19
19
|
});
|
|
20
20
|
|
|
21
|
+
lightMonitorSchema.index({monitorId: 1});
|
|
22
|
+
|
|
21
23
|
const LightMonitors = mongoose.model('LightMonitor', lightMonitorSchema);
|
|
22
24
|
|
|
23
|
-
export
|
|
25
|
+
export {lightMonitorSchema, LightMonitors};
|
|
@@ -11,6 +11,9 @@ const measurementsSchema = mongoose.Schema({
|
|
|
11
11
|
timestamps: true
|
|
12
12
|
});
|
|
13
13
|
|
|
14
|
+
measurementsSchema.index({monitorId: 1});
|
|
15
|
+
measurementsSchema.index({timeUpdated: 1});
|
|
16
|
+
|
|
14
17
|
const Measurements = mongoose.model('Measurements', measurementsSchema);
|
|
15
18
|
|
|
16
19
|
export {measurementsSchema, Measurements};
|
package/src/models/monitors.js
CHANGED
|
@@ -93,6 +93,9 @@ const monitorsSchema = mongoose.Schema(
|
|
|
93
93
|
);
|
|
94
94
|
|
|
95
95
|
monitorsSchema.index({gpsLocation: '2dsphere'});
|
|
96
|
+
monitorsSchema.index({monitorSupplier: 1});
|
|
97
|
+
monitorsSchema.index({monitorIdFromSupplier: 1});
|
|
98
|
+
monitorsSchema.index({monitorState: 1});
|
|
96
99
|
|
|
97
100
|
const Monitors = mongoose.model("Monitors", monitorsSchema);
|
|
98
101
|
|
package/src/models/users.js
CHANGED
|
@@ -19,9 +19,11 @@ const usersSchema = mongoose.Schema({
|
|
|
19
19
|
isSharingLocation: {type: Boolean, default: false},
|
|
20
20
|
toolTips: Object
|
|
21
21
|
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
{
|
|
23
|
+
timestamps: true
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
usersSchema.index({phone: 1});
|
|
25
27
|
|
|
26
28
|
const Users = mongoose.model('Users', usersSchema);
|
|
27
29
|
|