@bluedot-innovation/models 7.0.6-alpha.1 → 7.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.
package/.gitlab-ci.yml CHANGED
@@ -62,16 +62,38 @@ create_dev_indexes:
62
62
  - ENVIRONMENT=dev MONGO_DB_URI=$DEV_MONGO_DB_URI make deploy-db-changes
63
63
 
64
64
  # Create any newly required indexes in the production dbs
65
- create_production_indexes:
65
+ create_au_production_indexes:
66
66
  stage: release
67
67
  tags:
68
68
  - infrastructure
69
69
  when: manual
70
- allow_failure: false
70
+ allow_failure: true
71
71
  only:
72
72
  - master
73
73
 
74
74
  script:
75
75
  - ENVIRONMENT=prod_au MONGO_DB_URI="$AU_MONGO_DB_URI" make deploy-db-changes
76
+
77
+ create_eu_production_indexes:
78
+ stage: release
79
+ tags:
80
+ - infrastructure
81
+ when: manual
82
+ allow_failure: true
83
+ only:
84
+ - master
85
+
86
+ script:
76
87
  - ENVIRONMENT=prod_eu MONGO_DB_URI="$EU_MONGO_DB_URI" make deploy-db-changes
88
+
89
+ create_us_production_indexes:
90
+ stage: release
91
+ tags:
92
+ - infrastructure
93
+ when: manual
94
+ allow_failure: true
95
+ only:
96
+ - master
97
+
98
+ script:
77
99
  - ENVIRONMENT=prod_us MONGO_DB_URI="$US_MONGO_DB_URI" make deploy-db-changes
package/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 7.1.0
2
+ - Added `hello.registrationTtl` to Project
3
+
1
4
  ## 7.0.6
2
5
  - Removed tempo webhooks array for post wave migration deployment
3
6
  - Removed tempo destinationId for post wave migration deployment
@@ -41,5 +41,8 @@
41
41
  },
42
42
  "tempo": {
43
43
  "isochroneBracketInterval": [60, 120, 300]
44
+ },
45
+ "hello": {
46
+ "registrationTtl": 86400
44
47
  }
45
48
  }
@@ -278,6 +278,16 @@ testCase('Project', () => {
278
278
  })
279
279
  })
280
280
 
281
+ it('should not validate if hello.registrationTtl is not an integer', (done) => {
282
+ project.hello.registrationTtl = 1.5
283
+ let Project = new ProjectModel(project)
284
+ Project.validate((err, res) => {
285
+ assert.exists(err)
286
+ assert.match(err.message, /hello.registrationTtl should be an integer number/)
287
+ done()
288
+ })
289
+ })
290
+
281
291
  testCase('should not validate if webhooks contains two webhooks of the same type', () => {
282
292
  const webhookTypes = ['tempo', 'wave', 'trigger']
283
293
 
package/models/Project.js CHANGED
@@ -16,6 +16,7 @@ let WebhookSchema = require('../schemas/Webhook')
16
16
  let iosConfig = require('../schemas/IosConfig')
17
17
  let androidConfig = require('../schemas/AndroidConfig')
18
18
  let projectTempoSchema = require('../schemas/ProjectTempo')
19
+ let projectHelloSchema = require('../schemas/ProjectHello')
19
20
 
20
21
  let webhooksValidators = [
21
22
  {validator: helpers.validateNotNull},
@@ -48,7 +49,8 @@ let ProjectSchema = new mongoose.Schema({
48
49
  firebaseApiKey: {type: String, validate: helpers.validateNotNull},
49
50
  apiKey: {type: String},
50
51
  integrations: IntegrationSchema,
51
- tempo: projectTempoSchema
52
+ tempo: projectTempoSchema,
53
+ hello: projectHelloSchema
52
54
  },
53
55
  {collection: 'project'})
54
56
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bluedot-innovation/models",
3
- "version": "7.0.6-alpha.1",
3
+ "version": "7.1.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",
@@ -0,0 +1,9 @@
1
+ let mongoose = require('mongoose')
2
+
3
+ let ProjectHelloSchema = new mongoose.Schema({
4
+ registrationTtl: {type: Number, validate: { validator: Number.isInteger, msg: 'hello.registrationTtl should be an integer number' }},
5
+ }, {
6
+ _id: false
7
+ })
8
+
9
+ module.exports = ProjectHelloSchema