@bluedot-innovation/models 7.17.0-alpha → 7.17.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/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 7.17.0
2
+ - Upgrade mongoose version to support MongoDB 5.0
3
+
1
4
  ## 7.16.1
2
5
  - Remove attentive webhook and add Attentive project integration
3
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bluedot-innovation/models",
3
- "version": "7.17.0-alpha",
3
+ "version": "7.17.0",
4
4
  "main": "Models.js",
5
5
  "scripts": {
6
6
  "lint": "./node_modules/.bin/eslint -c .eslintrc.js ./models/*.js ./__tests__/**/*.js ./__tests__/**/**/*.js ./schemas/*.js",
@@ -8,23 +8,27 @@ const client = new MongoClient(MONGO_DB_URI)
8
8
 
9
9
  console.log(`Using DB_NAME:${DB_NAME} in ENVIRONMENT:${ENVIRONMENT}`)
10
10
 
11
- try {
12
- await client.connect()
13
- } catch (error) {
14
- console.log("Failed to connect to Mongo DB", error)
15
- process.exit(1)
16
- }
17
-
18
- console.log("Connected to Mongo DB")
19
-
20
- const db = client.db(DB_NAME)
21
-
22
- try{
23
- await createAllIndexesIfNotExists(db)
24
- } catch(error) {
25
- console.log(error)
11
+ const dbInitialiser = async () => {
12
+ try {
13
+ await client.connect()
14
+ } catch (error) {
15
+ console.log("Failed to connect to Mongo DB", error)
16
+ process.exit(1)
17
+ }
18
+
19
+ console.log("Connected to Mongo DB")
20
+
21
+ const db = client.db(DB_NAME)
22
+
23
+ try{
24
+ await createAllIndexesIfNotExists(db)
25
+ } catch(error) {
26
+ console.log(error)
27
+ await client.close()
28
+ process.exit(1)
29
+ }
30
+
26
31
  await client.close()
27
- process.exit(1)
28
32
  }
29
33
 
30
- await client.close()
34
+ dbInitialiser()