@justair/justair-library 1.0.9 → 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.
Files changed (40) hide show
  1. package/dist/config/db.d.ts +11 -0
  2. package/dist/config/db.d.ts.map +1 -0
  3. package/dist/config/logger.d.ts +13 -0
  4. package/dist/config/logger.d.ts.map +1 -0
  5. package/dist/models/admin.d.ts +3 -0
  6. package/dist/models/admin.d.ts.map +1 -0
  7. package/dist/models/configurations.d.ts +3 -0
  8. package/dist/models/configurations.d.ts.map +1 -0
  9. package/dist/models/events.d.ts +3 -0
  10. package/dist/models/events.d.ts.map +1 -0
  11. package/dist/models/measurements.d.ts +3 -0
  12. package/dist/models/measurements.d.ts.map +1 -0
  13. package/dist/models/monitorRequests.d.ts +3 -0
  14. package/dist/models/monitorRequests.d.ts.map +1 -0
  15. package/dist/models/monitors.d.ts +3 -0
  16. package/dist/models/monitors.d.ts.map +1 -0
  17. package/dist/models/organizations.d.ts +3 -0
  18. package/dist/models/organizations.d.ts.map +1 -0
  19. package/dist/models/referenceMonitorInfo.d.ts +3 -0
  20. package/dist/models/referenceMonitorInfo.d.ts.map +1 -0
  21. package/dist/models/tests/admin.test.d.ts +2 -0
  22. package/dist/models/tests/admin.test.d.ts.map +1 -0
  23. package/dist/models/tests/configurations.test.d.ts +2 -0
  24. package/dist/models/tests/configurations.test.d.ts.map +1 -0
  25. package/dist/models/tests/measurements.test.d.ts +2 -0
  26. package/dist/models/tests/measurements.test.d.ts.map +1 -0
  27. package/dist/models/tests/monitorRequests.test.d.ts +2 -0
  28. package/dist/models/tests/monitorRequests.test.d.ts.map +1 -0
  29. package/dist/models/tests/monitors.test.d.ts +2 -0
  30. package/dist/models/tests/monitors.test.d.ts.map +1 -0
  31. package/dist/models/tests/organizations.test.d.ts +2 -0
  32. package/dist/models/tests/organizations.test.d.ts.map +1 -0
  33. package/dist/models/tests/users.test.d.ts +2 -0
  34. package/dist/models/tests/users.test.d.ts.map +1 -0
  35. package/dist/models/users.d.ts +3 -0
  36. package/dist/models/users.d.ts.map +1 -0
  37. package/package.json +12 -3
  38. package/src/models/events.js +19 -0
  39. package/tsconfig.json +21 -0
  40. package/justair-justair-library-1.0.0.tgz +0 -0
@@ -0,0 +1,11 @@
1
+ export default Database;
2
+ declare class Database {
3
+ constructor({ CONNECTION_URL, database }: {
4
+ CONNECTION_URL: any;
5
+ database: any;
6
+ });
7
+ CONNECTION_URL: any;
8
+ database: any;
9
+ _connect(): void;
10
+ }
11
+ //# sourceMappingURL=db.d.ts.map
@@ -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,3 @@
1
+ export const adminSchema: any;
2
+ export const Admin: any;
3
+ //# sourceMappingURL=admin.d.ts.map
@@ -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,3 @@
1
+ export const configurationsSchema: any;
2
+ export const Configurations: any;
3
+ //# sourceMappingURL=configurations.d.ts.map
@@ -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,3 @@
1
+ export const eventsSchema: any;
2
+ export const Events: any;
3
+ //# sourceMappingURL=events.d.ts.map
@@ -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,3 @@
1
+ export const measurementsSchema: any;
2
+ export const Measurements: any;
3
+ //# sourceMappingURL=measurements.d.ts.map
@@ -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,3 @@
1
+ export const monitorRequestsSchema: any;
2
+ export const MonitorRequests: any;
3
+ //# sourceMappingURL=monitorRequests.d.ts.map
@@ -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,3 @@
1
+ export const monitorsSchema: any;
2
+ export const Monitors: any;
3
+ //# sourceMappingURL=monitors.d.ts.map
@@ -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,3 @@
1
+ export const organizationsSchema: any;
2
+ export const Organizations: any;
3
+ //# sourceMappingURL=organizations.d.ts.map
@@ -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,3 @@
1
+ export const referenceMonitorInfoSchema: any;
2
+ export const ReferenceMonitorInfo: any;
3
+ //# sourceMappingURL=referenceMonitorInfo.d.ts.map
@@ -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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=admin.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin.test.d.ts","sourceRoot":"","sources":["../../../src/models/tests/admin.test.js"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=configurations.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configurations.test.d.ts","sourceRoot":"","sources":["../../../src/models/tests/configurations.test.js"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=measurements.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"measurements.test.d.ts","sourceRoot":"","sources":["../../../src/models/tests/measurements.test.js"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=monitorRequests.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"monitorRequests.test.d.ts","sourceRoot":"","sources":["../../../src/models/tests/monitorRequests.test.js"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=monitors.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"monitors.test.d.ts","sourceRoot":"","sources":["../../../src/models/tests/monitors.test.js"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=organizations.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organizations.test.d.ts","sourceRoot":"","sources":["../../../src/models/tests/organizations.test.js"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=users.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"users.test.d.ts","sourceRoot":"","sources":["../../../src/models/tests/users.test.js"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ export const usersSchema: any;
2
+ export const Users: any;
3
+ //# sourceMappingURL=users.d.ts.map
@@ -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.9",
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/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