@bluedot-innovation/models 5.1.35 → 5.1.38

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,12 @@
1
+ ## 5.1.38
2
+ - Added missing export for ConfigurationParameters model
3
+
4
+ ## 5.1.37
5
+ - Added missing @turf/helpers package
6
+
7
+ ## 5.1.36
8
+ - Added ConfigurationParameters model
9
+
1
10
  ## 5.1.35
2
11
  - Update moongose-json-patch module
3
12
 
package/Models.js CHANGED
@@ -43,6 +43,7 @@ Models.DBEvent = require('./models/DBEvent').Model
43
43
  Models.SingleUseToken = require('./models/SingleUseToken').Model
44
44
  Models.Contract = require('./models/Contract').Model
45
45
  Models.DailyStats = require('./models/DailyStats').Model
46
+ Models.ConfigurationParameters = require('./models/ConfigurationParameters').Model
46
47
 
47
48
  let Schemas = {}
48
49
 
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Copyright : Bluedot Innovations.
3
+ */
4
+
5
+ let mongoose = require('mongoose')
6
+ let Schema = mongoose.Schema
7
+
8
+ // Schemas
9
+ let iosConfigSchema = require('../schemas/IosConfig')
10
+ let androidConfigSchema = require('../schemas/AndroidConfig')
11
+
12
+ let ConfigurationParametersSchema = new Schema({
13
+ name: { type: String, required: true },
14
+ iosConfig: { type: iosConfigSchema, required: true },
15
+ androidConfig: { type: androidConfigSchema, required: true },
16
+ },
17
+ {collection: 'configurationParameters'})
18
+
19
+ // optional mongoose
20
+ let model = (mongooseInstance) => {
21
+ let ConfigurationParameters
22
+ if (mongooseInstance) {
23
+ ConfigurationParameters = mongooseInstance.model('ConfigurationParameters', ConfigurationParametersSchema)
24
+ } else {
25
+ ConfigurationParameters = mongoose.model('ConfigurationParameters', ConfigurationParametersSchema)
26
+ }
27
+
28
+ return ConfigurationParameters
29
+ }
30
+
31
+ // Exports Mongoose Model, Mongoose Schema, JSON schema (required locally for discriminators)
32
+ module.exports = { Model: model, Schema: ConfigurationParametersSchema }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bluedot-innovation/models",
3
- "version": "5.1.35",
3
+ "version": "5.1.38",
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",
@@ -32,6 +32,7 @@
32
32
  "@bluedot-innovation/mongoose-json-patch": "0.0.8",
33
33
  "@mongoosejs/double": "^0.1.2",
34
34
  "@turf/area": "^6.0.1",
35
+ "@turf/helpers": "^6.1.4",
35
36
  "deep-equal": "^1.0.1",
36
37
  "fast-deep-equal": "^2.0.1",
37
38
  "lodash.clonedeep": "4.5.0",