@justair/justair-library 1.0.8 → 1.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/dist/config/db.d.ts +11 -0
- package/dist/config/db.d.ts.map +1 -0
- package/dist/config/logger.d.ts +13 -0
- package/dist/config/logger.d.ts.map +1 -0
- package/dist/models/admin.d.ts +3 -0
- package/dist/models/admin.d.ts.map +1 -0
- package/dist/models/configurations.d.ts +3 -0
- package/dist/models/configurations.d.ts.map +1 -0
- package/dist/models/events.d.ts +3 -0
- package/dist/models/events.d.ts.map +1 -0
- package/dist/models/measurements.d.ts +3 -0
- package/dist/models/measurements.d.ts.map +1 -0
- package/dist/models/monitorRequests.d.ts +3 -0
- package/dist/models/monitorRequests.d.ts.map +1 -0
- package/dist/models/monitors.d.ts +3 -0
- package/dist/models/monitors.d.ts.map +1 -0
- package/dist/models/organizations.d.ts +3 -0
- package/dist/models/organizations.d.ts.map +1 -0
- package/dist/models/referenceMonitorInfo.d.ts +3 -0
- package/dist/models/referenceMonitorInfo.d.ts.map +1 -0
- package/dist/models/tests/admin.test.d.ts +2 -0
- package/dist/models/tests/admin.test.d.ts.map +1 -0
- package/dist/models/tests/configurations.test.d.ts +2 -0
- package/dist/models/tests/configurations.test.d.ts.map +1 -0
- package/dist/models/tests/measurements.test.d.ts +2 -0
- package/dist/models/tests/measurements.test.d.ts.map +1 -0
- package/dist/models/tests/monitorRequests.test.d.ts +2 -0
- package/dist/models/tests/monitorRequests.test.d.ts.map +1 -0
- package/dist/models/tests/monitors.test.d.ts +2 -0
- package/dist/models/tests/monitors.test.d.ts.map +1 -0
- package/dist/models/tests/organizations.test.d.ts +2 -0
- package/dist/models/tests/organizations.test.d.ts.map +1 -0
- package/dist/models/tests/users.test.d.ts +2 -0
- package/dist/models/tests/users.test.d.ts.map +1 -0
- package/dist/models/users.d.ts +3 -0
- package/dist/models/users.d.ts.map +1 -0
- package/package.json +12 -3
- package/src/models/events.js +19 -0
- package/src/models/monitors.js +2 -0
- package/tsconfig.json +21 -0
- package/justair-justair-library-1.0.0.tgz +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../src/config/db.js"],"names":[],"mappings":";AAEA;IACI;;;OAIC;IAHG,oBAAoC;IACpC,cAAwB;IAI5B,iBASC;CACJ"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default CustomLogger;
|
|
2
|
+
declare class CustomLogger {
|
|
3
|
+
constructor({ DATADOG_API_KEY, APPLICATION_NAME }: {
|
|
4
|
+
DATADOG_API_KEY: any;
|
|
5
|
+
APPLICATION_NAME: any;
|
|
6
|
+
});
|
|
7
|
+
DATADOG_API_KEY: any;
|
|
8
|
+
APPLICATION_NAME: any;
|
|
9
|
+
logger: import("winston").Logger;
|
|
10
|
+
_createLogger(): import("winston").Logger;
|
|
11
|
+
getLogger(): import("winston").Logger;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/config/logger.js"],"names":[],"mappings":";AAGA;IACI;;;OAIC;IAHG,qBAAsC;IACtC,sBAAwC;IACxC,iCAAkC;IAGtC,0CA2BC;IAED,sCAEC;CACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../src/models/admin.js"],"names":[],"mappings":"AAEA,8BAaO;AAEP,wBAAmD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configurations.d.ts","sourceRoot":"","sources":["../../src/models/configurations.js"],"names":[],"mappings":"AAEA,uCAOG;AAEH,iCAA8E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/models/events.js"],"names":[],"mappings":"AAEA,+BAaE;AAEF,yBAAsD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"measurements.d.ts","sourceRoot":"","sources":["../../src/models/measurements.js"],"names":[],"mappings":"AAEA,qCASG;AAEH,+BAAwE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monitorRequests.d.ts","sourceRoot":"","sources":["../../src/models/monitorRequests.js"],"names":[],"mappings":"AAEA,wCASG;AAEH,kCAAiF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monitors.d.ts","sourceRoot":"","sources":["../../src/models/monitors.js"],"names":[],"mappings":"AAEA,iCA6EE;AAEF,2BAA4D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organizations.d.ts","sourceRoot":"","sources":["../../src/models/organizations.js"],"names":[],"mappings":"AAEA,sCAgBO;AAEP,gCAA2E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"referenceMonitorInfo.d.ts","sourceRoot":"","sources":["../../src/models/referenceMonitorInfo.js"],"names":[],"mappings":"AAEA,6CAYG;AAEH,uCAAgG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin.test.d.ts","sourceRoot":"","sources":["../../../src/models/tests/admin.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configurations.test.d.ts","sourceRoot":"","sources":["../../../src/models/tests/configurations.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"measurements.test.d.ts","sourceRoot":"","sources":["../../../src/models/tests/measurements.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monitorRequests.test.d.ts","sourceRoot":"","sources":["../../../src/models/tests/monitorRequests.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monitors.test.d.ts","sourceRoot":"","sources":["../../../src/models/tests/monitors.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organizations.test.d.ts","sourceRoot":"","sources":["../../../src/models/tests/organizations.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"users.test.d.ts","sourceRoot":"","sources":["../../../src/models/tests/users.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../src/models/users.js"],"names":[],"mappings":"AAEA,8BAkBO;AAEP,wBAAmD"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justair/justair-library",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "JustAir Internal Library",
|
|
5
|
-
"main": "index.js",
|
|
5
|
+
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
7
8
|
"scripts": {
|
|
8
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
9
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"prepublish": "npm run build"
|
|
9
12
|
},
|
|
10
13
|
"keywords": [
|
|
11
14
|
"JustAir"
|
|
@@ -15,5 +18,11 @@
|
|
|
15
18
|
"dependencies": {
|
|
16
19
|
"mongoose": "^6.8.2",
|
|
17
20
|
"winston": "^3.10.0"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"typescript": "^5.3.2",
|
|
24
|
+
"@types/node": "^16.0.0",
|
|
25
|
+
"@types/mongoose": "^6.0.0",
|
|
26
|
+
"ts-node": "^10.0.0"
|
|
18
27
|
}
|
|
19
28
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
|
|
3
|
+
const eventsSchema = mongoose.Schema(
|
|
4
|
+
{
|
|
5
|
+
monitorId: {type: mongoose.Types.ObjectId, ref: "Monitors"},
|
|
6
|
+
parameter: String,
|
|
7
|
+
value: Number,
|
|
8
|
+
alertLevel:{
|
|
9
|
+
type: String,
|
|
10
|
+
enum: ["Good","Moderate", "Unhealthy for SG", "Unhealthy", "Very Unhealthy", "Hazardous"]
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
timestamps: true,
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
const Events = mongoose.model("Events", eventsSchema);
|
|
19
|
+
export {eventsSchema, Events};
|
package/src/models/monitors.js
CHANGED
package/tsconfig.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Change this to match your project
|
|
3
|
+
"include": ["src/**/*"],
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
// Tells TypeScript to read JS files, as
|
|
6
|
+
// normally they are ignored as source files
|
|
7
|
+
"allowJs": true,
|
|
8
|
+
// Generate d.ts files
|
|
9
|
+
"declaration": true,
|
|
10
|
+
// This compiler run should
|
|
11
|
+
// only output d.ts files
|
|
12
|
+
"emitDeclarationOnly": true,
|
|
13
|
+
// Types should go into this directory.
|
|
14
|
+
// Removing this would place the .d.ts files
|
|
15
|
+
// next to the .js files
|
|
16
|
+
"outDir": "dist",
|
|
17
|
+
// go to js file when using IDE functions like
|
|
18
|
+
// "Go to Definition" in VSCode
|
|
19
|
+
"declarationMap": true
|
|
20
|
+
}
|
|
21
|
+
}
|
|
Binary file
|