@justair/justair-library 4.4.8 → 4.5.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justair/justair-library",
3
- "version": "4.4.8",
3
+ "version": "4.5.0",
4
4
  "description": "JustAir Internal Library",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -37,6 +37,7 @@ const eventsSchema = mongoose.Schema(
37
37
  type: String,
38
38
  enum: ["Collocation", "Deployed", "Maintenance", "Pending Deployment"],
39
39
  },
40
+ pausedParameters: [String],
40
41
  },
41
42
  {
42
43
  timestamps: true,
@@ -1,31 +1,55 @@
1
- import mongoose from 'mongoose';
1
+ import mongoose from "mongoose";
2
2
 
3
- const usersSchema = mongoose.Schema({
3
+ const usersSchema = mongoose.Schema(
4
+ {
4
5
  name: String,
5
6
  phone: String,
6
7
  email: String,
7
8
  zipCode: String,
8
9
  location: [Object],
9
- organizations: [{ type: mongoose.Types.ObjectId, ref: 'Organizations' }],
10
+ organizations: [{ type: mongoose.Types.ObjectId, ref: "Organizations" }],
10
11
  alertPhone: String,
11
12
  alertCount: { type: Number, default: 0 },
12
- subscribedMonitors: [{ type: mongoose.Types.ObjectId, ref: 'Monitors' }],
13
- currentAlertMode: { type: String, enum: ['Good', 'Unhealthy','Moderate', 'Unhealthy for SG', 'Very Unhealthy', 'Hazardous'], default: 'Good' },
13
+ subscribedMonitors: [{ type: mongoose.Types.ObjectId, ref: "Monitors" }],
14
+ currentAlertMode: {
15
+ type: String,
16
+ enum: [
17
+ "Good",
18
+ "Unhealthy",
19
+ "Moderate",
20
+ "Unhealthy for SG",
21
+ "Very Unhealthy",
22
+ "Hazardous",
23
+ ],
24
+ default: "Good",
25
+ },
14
26
  latestAlerts: [Object],
15
27
  optInPhone: { type: Boolean, default: true },
16
- optInEmail: { type: Boolean, default: true },
28
+ optInEmail: { type: Boolean, default: false },
17
29
  isActive: { type: Boolean, default: true },
18
- hasOnboarded: {type: Boolean, default: false},
19
- isSharingLocation: {type: Boolean, default: false},
30
+ hasOnboarded: { type: Boolean, default: false },
31
+ isSharingLocation: { type: Boolean, default: false },
20
32
  toolTips: Object,
21
- alertPreferenceLevel: { type: String, enum: ['Good', 'Moderate', 'Unhealthy for SG', 'Unhealthy', 'Very Unhealthy', 'Hazardous'], default: 'Good' }
22
- },
23
- {
24
- timestamps: true
25
- });
33
+ alertPreferenceLevel: {
34
+ type: String,
35
+ enum: [
36
+ "Good",
37
+ "Moderate",
38
+ "Unhealthy for SG",
39
+ "Unhealthy",
40
+ "Very Unhealthy",
41
+ "Hazardous",
42
+ ],
43
+ default: "Good",
44
+ },
45
+ },
46
+ {
47
+ timestamps: true,
48
+ }
49
+ );
26
50
 
27
- usersSchema.index({phone: 1});
51
+ usersSchema.index({ phone: 1 });
28
52
 
29
- const Users = mongoose.model('Users', usersSchema);
53
+ const Users = mongoose.model("Users", usersSchema);
30
54
 
31
- export {usersSchema, Users};
55
+ export { usersSchema, Users };