@justair/justair-library 3.1.37 → 3.1.39
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/dist/index.d.ts +35 -33
- package/dist/index.d.ts.map +1 -1
- package/dist/models/announcements.d.ts.map +1 -1
- package/dist/models/events.d.ts.map +1 -1
- package/dist/models/jobs.d.ts +3 -0
- package/dist/models/jobs.d.ts.map +1 -0
- package/dist/models/lightmonitors.d.ts.map +1 -1
- package/dist/models/qanotifications.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/models/monitors.js +19 -26
package/dist/index.d.ts
CHANGED
|
@@ -6,37 +6,39 @@ export function createLoggerInstance({ DATADOG_API_KEY, APPLICATION_NAME }: {
|
|
|
6
6
|
DATADOG_API_KEY: any;
|
|
7
7
|
APPLICATION_NAME: any;
|
|
8
8
|
}): CustomLogger;
|
|
9
|
-
import dbConfig from
|
|
10
|
-
import CustomLogger from
|
|
11
|
-
import { adminSchema } from
|
|
12
|
-
import { Admin } from
|
|
13
|
-
import { configurationsSchema } from
|
|
14
|
-
import { Configurations } from
|
|
15
|
-
import { measurementsSchema } from
|
|
16
|
-
import { Measurements } from
|
|
17
|
-
import { monitorRequestsSchema } from
|
|
18
|
-
import { MonitorRequests } from
|
|
19
|
-
import { monitorsSchema } from
|
|
20
|
-
import { Monitors } from
|
|
21
|
-
import { organizationsSchema } from
|
|
22
|
-
import { Organizations } from
|
|
23
|
-
import { referenceMonitorInfoSchema } from
|
|
24
|
-
import { ReferenceMonitorInfo } from
|
|
25
|
-
import { usersSchema } from
|
|
26
|
-
import { Users } from
|
|
27
|
-
import { eventsSchema } from
|
|
28
|
-
import { Events } from
|
|
29
|
-
import { lightMonitorSchema } from
|
|
30
|
-
import { LightMonitors } from
|
|
31
|
-
import { monitorSuppliersSchema } from
|
|
32
|
-
import { MonitorSuppliers } from
|
|
33
|
-
import { contextsSchema } from
|
|
34
|
-
import { Contexts } from
|
|
35
|
-
import { parametersSchema } from
|
|
36
|
-
import { Parameters } from
|
|
37
|
-
import { qaNotificationsSchema } from
|
|
38
|
-
import { QANotifications } from
|
|
39
|
-
import { announcementSchema } from
|
|
40
|
-
import { Announcements } from
|
|
41
|
-
|
|
9
|
+
import dbConfig from "./config/db.js";
|
|
10
|
+
import CustomLogger from "./config/logger.js";
|
|
11
|
+
import { adminSchema } from "./models/admin.js";
|
|
12
|
+
import { Admin } from "./models/admin.js";
|
|
13
|
+
import { configurationsSchema } from "./models/configurations.js";
|
|
14
|
+
import { Configurations } from "./models/configurations.js";
|
|
15
|
+
import { measurementsSchema } from "./models/measurements.js";
|
|
16
|
+
import { Measurements } from "./models/measurements.js";
|
|
17
|
+
import { monitorRequestsSchema } from "./models/monitorRequests.js";
|
|
18
|
+
import { MonitorRequests } from "./models/monitorRequests.js";
|
|
19
|
+
import { monitorsSchema } from "./models/monitors.js";
|
|
20
|
+
import { Monitors } from "./models/monitors.js";
|
|
21
|
+
import { organizationsSchema } from "./models/organizations.js";
|
|
22
|
+
import { Organizations } from "./models/organizations.js";
|
|
23
|
+
import { referenceMonitorInfoSchema } from "./models/referenceMonitorInfo.js";
|
|
24
|
+
import { ReferenceMonitorInfo } from "./models/referenceMonitorInfo.js";
|
|
25
|
+
import { usersSchema } from "./models/users.js";
|
|
26
|
+
import { Users } from "./models/users.js";
|
|
27
|
+
import { eventsSchema } from "./models/events.js";
|
|
28
|
+
import { Events } from "./models/events.js";
|
|
29
|
+
import { lightMonitorSchema } from "./models/lightmonitors.js";
|
|
30
|
+
import { LightMonitors } from "./models/lightmonitors.js";
|
|
31
|
+
import { monitorSuppliersSchema } from "./models/monitorSuppliers.js";
|
|
32
|
+
import { MonitorSuppliers } from "./models/monitorSuppliers.js";
|
|
33
|
+
import { contextsSchema } from "./models/contexts.js";
|
|
34
|
+
import { Contexts } from "./models/contexts.js";
|
|
35
|
+
import { parametersSchema } from "./models/parameters.js";
|
|
36
|
+
import { Parameters } from "./models/parameters.js";
|
|
37
|
+
import { qaNotificationsSchema } from "./models/qanotifications.js";
|
|
38
|
+
import { QANotifications } from "./models/qanotifications.js";
|
|
39
|
+
import { announcementSchema } from "./models/announcements.js";
|
|
40
|
+
import { Announcements } from "./models/announcements.js";
|
|
41
|
+
import { jobsSchema } from "./models/jobs.js";
|
|
42
|
+
import { Jobs } from "./models/jobs.js";
|
|
43
|
+
export { adminSchema, Admin, configurationsSchema, Configurations, measurementsSchema, Measurements, monitorRequestsSchema, MonitorRequests, monitorsSchema, Monitors, organizationsSchema, Organizations, referenceMonitorInfoSchema, ReferenceMonitorInfo, usersSchema, Users, eventsSchema, Events, lightMonitorSchema, LightMonitors, monitorSuppliersSchema, MonitorSuppliers, contextsSchema, Contexts, parametersSchema, Parameters, qaNotificationsSchema, QANotifications, announcementSchema, Announcements, jobsSchema, Jobs };
|
|
42
44
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"AAkCA;;;aAEC;AAED;;;iBAEC;qBAToB,gBAAgB;yBACZ,oBAAoB;4BAhCV,mBAAmB;sBAAnB,mBAAmB;qCAI/C,4BAA4B;+BAA5B,4BAA4B;mCACc,0BAA0B;6BAA1B,0BAA0B;sCAIpE,6BAA6B;gCAA7B,6BAA6B;+BACK,sBAAsB;yBAAtB,sBAAsB;oCACZ,2BAA2B;8BAA3B,2BAA2B;2CAIvE,kCAAkC;qCAAlC,kCAAkC;4BAQN,mBAAmB;sBAAnB,mBAAmB;6BACjB,oBAAoB;uBAApB,oBAAoB;mCARP,2BAA2B;8BAA3B,2BAA2B;uCAItE,8BAA8B;iCAA9B,8BAA8B;+BACI,sBAAsB;yBAAtB,sBAAsB;iCAClB,wBAAwB;2BAAxB,wBAAwB;sCAM9D,6BAA6B;gCAA7B,6BAA6B;mCACc,2BAA2B;8BAA3B,2BAA2B;2BAC5C,kBAAkB;qBAAlB,kBAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"announcements.d.ts","sourceRoot":"","sources":["../../src/models/announcements.js"],"names":[],"mappings":"AAcA,
|
|
1
|
+
{"version":3,"file":"announcements.d.ts","sourceRoot":"","sources":["../../src/models/announcements.js"],"names":[],"mappings":"AAcA,qCAWE;AAEF,gCAA0E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/models/events.js"],"names":[],"mappings":"AAEA,+
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/models/events.js"],"names":[],"mappings":"AAEA,+BAiBE;AAKF,yBAAsD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jobs.d.ts","sourceRoot":"","sources":["../../src/models/jobs.js"],"names":[],"mappings":"AAEA,6BA4BE;AAEF,uBAAgD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lightmonitors.d.ts","sourceRoot":"","sources":["../../src/models/lightmonitors.js"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"lightmonitors.d.ts","sourceRoot":"","sources":["../../src/models/lightmonitors.js"],"names":[],"mappings":"AAEA,qCAmBE;AAIF,gCAAyE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"qanotifications.d.ts","sourceRoot":"","sources":["../../src/models/qanotifications.js"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"qanotifications.d.ts","sourceRoot":"","sources":["../../src/models/qanotifications.js"],"names":[],"mappings":"AAEA,wCAmBE;AAEF,kCAGE"}
|
package/package.json
CHANGED
package/src/models/monitors.js
CHANGED
|
@@ -15,7 +15,7 @@ const monitorsSchema = mongoose.Schema(
|
|
|
15
15
|
"sensit",
|
|
16
16
|
"blue sky",
|
|
17
17
|
"aq mesh",
|
|
18
|
-
"quant aq"
|
|
18
|
+
"quant aq",
|
|
19
19
|
],
|
|
20
20
|
},
|
|
21
21
|
monitorType: String,
|
|
@@ -30,7 +30,15 @@ const monitorsSchema = mongoose.Schema(
|
|
|
30
30
|
monitorStateHistory: [Object],
|
|
31
31
|
monitorAlertStatus: {
|
|
32
32
|
type: String,
|
|
33
|
-
enum: [
|
|
33
|
+
enum: [
|
|
34
|
+
"Good",
|
|
35
|
+
"Moderate",
|
|
36
|
+
"Unhealthy for SG",
|
|
37
|
+
"Unhealthy",
|
|
38
|
+
"Very Unhealthy",
|
|
39
|
+
"Hazardous",
|
|
40
|
+
"Bad",
|
|
41
|
+
],
|
|
34
42
|
default: "Good",
|
|
35
43
|
},
|
|
36
44
|
sponsor: { type: mongoose.Types.ObjectId, ref: "Organizations" },
|
|
@@ -38,26 +46,11 @@ const monitorsSchema = mongoose.Schema(
|
|
|
38
46
|
monitorLatitude: Number,
|
|
39
47
|
monitorLongitude: Number,
|
|
40
48
|
gpsLocation: {
|
|
41
|
-
type: { type: String, enul: [
|
|
42
|
-
coordinates: { type: [Number], required: true },
|
|
49
|
+
type: { type: String, enul: ["Point"], required: true },
|
|
50
|
+
coordinates: { type: [Number], required: true },
|
|
43
51
|
},
|
|
44
52
|
location: Object, //copied over from associated org
|
|
45
|
-
context: [
|
|
46
|
-
{
|
|
47
|
-
type: String,
|
|
48
|
-
enum: [
|
|
49
|
-
"School",
|
|
50
|
-
"Highway",
|
|
51
|
-
"Factory",
|
|
52
|
-
"Residential",
|
|
53
|
-
"Urban",
|
|
54
|
-
"Rural",
|
|
55
|
-
"Industrial",
|
|
56
|
-
"Street",
|
|
57
|
-
"Park",
|
|
58
|
-
],
|
|
59
|
-
},
|
|
60
|
-
],
|
|
53
|
+
context: [String],
|
|
61
54
|
colocationDate: Date,
|
|
62
55
|
deploymentDate: Date,
|
|
63
56
|
subscriptionDate: Date,
|
|
@@ -76,7 +69,7 @@ const monitorsSchema = mongoose.Schema(
|
|
|
76
69
|
"CO",
|
|
77
70
|
"NO",
|
|
78
71
|
"PM1",
|
|
79
|
-
"WS And Direction"
|
|
72
|
+
"WS And Direction",
|
|
80
73
|
],
|
|
81
74
|
},
|
|
82
75
|
],
|
|
@@ -92,11 +85,11 @@ const monitorsSchema = mongoose.Schema(
|
|
|
92
85
|
}
|
|
93
86
|
);
|
|
94
87
|
|
|
95
|
-
monitorsSchema.index({gpsLocation:
|
|
96
|
-
monitorsSchema.index({monitorSupplier: 1});
|
|
97
|
-
monitorsSchema.index({monitorIdFromSupplier: 1});
|
|
98
|
-
monitorsSchema.index({monitorState: 1});
|
|
88
|
+
monitorsSchema.index({ gpsLocation: "2dsphere" });
|
|
89
|
+
monitorsSchema.index({ monitorSupplier: 1 });
|
|
90
|
+
monitorsSchema.index({ monitorIdFromSupplier: 1 });
|
|
91
|
+
monitorsSchema.index({ monitorState: 1 });
|
|
99
92
|
|
|
100
93
|
const Monitors = mongoose.model("Monitors", monitorsSchema);
|
|
101
94
|
|
|
102
|
-
export {monitorsSchema, Monitors};
|
|
95
|
+
export { monitorsSchema, Monitors };
|