@justair/justair-library 3.2.0 → 3.2.1

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.2.0",
3
+ "version": "3.2.1",
4
4
  "description": "JustAir Internal Library",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
package/src/config/db.js CHANGED
@@ -9,7 +9,6 @@ class Database {
9
9
 
10
10
  async connect() {
11
11
  if (mongoose.connection.readyState === 1) {
12
- // If there's an active connection, close it first
13
12
  await mongoose.disconnect();
14
13
  }
15
14
 
package/src/index.js CHANGED
@@ -31,18 +31,15 @@ import { announcementSchema, Announcements } from "./models/announcements.js";
31
31
  import { jobsSchema, Jobs } from "./models/jobs.js";
32
32
  import { apiKeySchema, ApiKey } from "./models/apiKey.js";
33
33
  import { UsageMetrics, usageMetricsSchema } from "./models/usageMetrics.js";
34
- import dbConfig from "./config/db.js";
34
+ import Database from "./config/db.js"; // Import the new Database class
35
35
  import CustomLogger from "./config/logger.js";
36
36
 
37
- export function createDatabaseInstance({ CONNECTION_URL, database }) {
38
- return new dbConfig({ CONNECTION_URL, database });
39
- }
40
-
41
37
  export function createLoggerInstance({ DATADOG_API_KEY, APPLICATION_NAME }) {
42
38
  return new CustomLogger({ DATADOG_API_KEY, APPLICATION_NAME });
43
39
  }
44
40
 
45
41
  export {
42
+ Database, // Export the Database class
46
43
  adminSchema,
47
44
  Admin,
48
45
  configurationsSchema,
@@ -79,4 +76,4 @@ export {
79
76
  ApiKey,
80
77
  UsageMetrics,
81
78
  usageMetricsSchema,
82
- };
79
+ };