@justair/justair-library 2.0.1 → 2.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justair/justair-library",
3
- "version": "2.0.1",
3
+ "version": "2.1.1",
4
4
  "description": "JustAir Internal Library",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -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
- timestamps: true
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
 
@@ -10,6 +10,8 @@ const configurationsSchema = mongoose.Schema({
10
10
  timestamps: true
11
11
  });
12
12
 
13
+ configurationsSchema.index({name: 1});
14
+
13
15
  const Configurations = mongoose.model('Configurations', configurationsSchema);
14
16
 
15
17
  export {configurationsSchema, Configurations};
@@ -14,5 +14,8 @@ const eventsSchema = mongoose.Schema(
14
14
  }
15
15
  );
16
16
 
17
+ eventsSchema.index({monitorId: 1});
18
+ eventsSchema.index({parameter: 1});
19
+
17
20
  const Events = mongoose.model("Events", eventsSchema);
18
21
  export {eventsSchema, Events};
@@ -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
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};
@@ -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
 
@@ -17,11 +17,14 @@ const usersSchema = mongoose.Schema({
17
17
  isActive: { type: Boolean, default: true },
18
18
  hasOnboarded: {type: Boolean, default: false},
19
19
  isSharingLocation: {type: Boolean, default: false},
20
- toolTips: Object
20
+ toolTips: Object,
21
+ alertPreference: { type: String, enum: ['Good', 'Unhealthy for SG', 'Unhealthy', 'Very Unhealthy', 'Hazardous'], default: 'Good' }
21
22
  },
22
- {
23
- timestamps: true
24
- });
23
+ {
24
+ timestamps: true
25
+ });
26
+
27
+ usersSchema.index({phone: 1});
25
28
 
26
29
  const Users = mongoose.model('Users', usersSchema);
27
30