@justair/justair-library 3.1.29 → 3.1.31

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": "3.1.29",
3
+ "version": "3.1.31",
4
4
  "description": "JustAir Internal Library",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -1,21 +1,26 @@
1
1
  import mongoose from "mongoose";
2
2
  //TODO: Capture historical data, every hour record AQI values for monitors
3
3
  const eventsSchema = mongoose.Schema(
4
- {
5
- monitorId: {type: mongoose.Types.ObjectId, ref: "Monitors"},
6
- parameter: {
7
- type: String,
8
- enum: ["AQI", "PID"] },
9
- values: Object,
10
- alertLevels: Object
4
+ {
5
+ monitorId: { type: mongoose.Types.ObjectId, ref: "Monitors" },
6
+ parameter: {
7
+ type: String,
8
+ enum: ["AQI", "PID"],
11
9
  },
12
- {
13
- timestamps: true,
14
- }
10
+ values: Object,
11
+ alertLevels: Object,
12
+ currentMonitorState: {
13
+ type: String,
14
+ enum: ["Collocation", "Deployed", "Maintenance", "Pending Deployment"],
15
+ },
16
+ },
17
+ {
18
+ timestamps: true,
19
+ }
15
20
  );
16
21
 
17
- eventsSchema.index({monitorId: 1});
18
- eventsSchema.index({parameter: 1});
22
+ eventsSchema.index({ monitorId: 1 });
23
+ eventsSchema.index({ parameter: 1 });
19
24
 
20
25
  const Events = mongoose.model("Events", eventsSchema);
21
- export {eventsSchema, Events};
26
+ export { eventsSchema, Events };
@@ -4,7 +4,7 @@ const jobsSchema = mongoose.Schema(
4
4
  {
5
5
  requestorId: { type: mongoose.Types.ObjectId, ref: "Admin" },
6
6
  requestorEmail: String,
7
- category: { type: String, enum: ["Truck Detection", "Backfill Monitor Data"] },
7
+ category: { type: String, enum: ["Truck Detection", "Backfill Monitor Data", "AQI Network Summary"] },
8
8
  resourceURL: String,
9
9
  resourceMetaData: Object,
10
10
  resultData: { type: mongoose.Schema.Types.Mixed, default: {} },
@@ -13,6 +13,7 @@ const jobsSchema = mongoose.Schema(
13
13
  enum: ["New", "In-Progress", "Complete", "Cancelled", "Failed"],
14
14
  },
15
15
  jobStatusHistory: [Object],
16
+ sharedWith: [{ type: mongoose.Types.ObjectId, ref: "Admin" }]
16
17
  },
17
18
  {
18
19
  timestamps: true,