@bluedot-innovation/models 6.2.6 → 6.2.7

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
+ ## 6.2.7
2
+ - Add `shouldSync` to Project
3
+
1
4
  ## 6.2.6
2
5
  - Add `features.realTimeDashboard` to Account
3
6
 
@@ -12,6 +12,7 @@
12
12
  "securityToken" : "value"
13
13
  }
14
14
  }],
15
+ "shouldSync": false,
15
16
  "firebaseApiKey": "88888888-4444-4444-4444-121212121212",
16
17
  "apiKey": "88888888-4444-4444-4444-123412341234",
17
18
  "integrations":{
@@ -38,6 +38,17 @@ testCase('Project', () => {
38
38
  done()
39
39
  })
40
40
  })
41
+
42
+ assertions('should set the value of shouldSync to true when it is not defined', (done) => {
43
+ let project = JSON.parse(JSON.stringify(require('./project.remote.config.json')))
44
+ delete project.shouldSync
45
+ let Project = new ProjectModel(project)
46
+ assert.equal(Project.shouldSync, true, "shouldSync should be set to true")
47
+ Project.validate((err, res) => {
48
+ assert.notExists(err)
49
+ done()
50
+ })
51
+ })
41
52
  })
42
53
  testCase('Valid Project ', () => {
43
54
  assertions('should validate a valid project ', (done) => {
package/models/Project.js CHANGED
@@ -38,6 +38,7 @@ let ProjectSchema = new mongoose.Schema({
38
38
  lastUpdateTime: {type: Date, default: Date.now},
39
39
  lastSyncTime: {type: Date, default: Date.now},
40
40
  name: {type: String, required: [true, 'name is required']},
41
+ shouldSync: { type: Boolean, default: true },
41
42
  accountId: {type: String, required: true, validate: {isAsync: false, validator: helpers.validateUUIDv4, msg: 'default error message'}},
42
43
  webhooks: {type:[WebhookSchema], validate: webhooksValidators},
43
44
  configurationParameters: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bluedot-innovation/models",
3
- "version": "6.2.6",
3
+ "version": "6.2.7",
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",