@bluedot-innovation/models 8.4.2 → 8.5.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
+ ## 8.5.0
2
+ - Add activeTtl and finalTtl to project.hello and remove registrationTtl
3
+
1
4
  ## 8.4.2
2
5
  - Validate Hello report recipient emails
3
6
 
@@ -102,7 +102,8 @@
102
102
  "isochroneBracketInterval": [60, 120, 300]
103
103
  },
104
104
  "hello": {
105
- "registrationTtl": 86400,
105
+ "activeTtl": 604800,
106
+ "finalTtl": 86400,
106
107
  "ssoLinkingCode": "HGDUS69SDJJ0"
107
108
  },
108
109
  "reportConfigurations": [
@@ -273,12 +273,22 @@ describe('Project', () => {
273
273
  })
274
274
  })
275
275
 
276
- it('should not validate if hello.registrationTtl is not an integer', (done) => {
277
- project.hello.registrationTtl = 1.5
276
+ it('should not validate if hello.activeTtl is not an integer', (done) => {
277
+ project.hello.activeTtl = 1.5
278
278
  let Project = new ProjectModel(project)
279
279
  Project.validate((err, res) => {
280
280
  assert.exists(err)
281
- assert.match(err.message, /hello.registrationTtl should be an integer number/)
281
+ assert.match(err.message, /hello.activeTtl should be an integer number/)
282
+ done()
283
+ })
284
+ })
285
+
286
+ it('should not validate if hello.finalTtl is not an integer', (done) => {
287
+ project.hello.finalTtl = 1.5
288
+ let Project = new ProjectModel(project)
289
+ Project.validate((err, res) => {
290
+ assert.exists(err)
291
+ assert.match(err.message, /hello.finalTtl should be an integer number/)
282
292
  done()
283
293
  })
284
294
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bluedot-innovation/models",
3
- "version": "8.4.2",
3
+ "version": "8.5.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",
@@ -2,7 +2,8 @@ let mongoose = require('mongoose')
2
2
  const helpers = require('../helpers')
3
3
 
4
4
  let ProjectHelloSchema = new mongoose.Schema({
5
- registrationTtl: {type: Number, validate: { validator: Number.isInteger, msg: 'hello.registrationTtl should be an integer number' }},
5
+ activeTtl: {type: Number, validate: { validator: Number.isInteger, msg: 'hello.activeTtl should be an integer number' }},
6
+ finalTtl: {type: Number, validate: { validator: Number.isInteger, msg: 'hello.finalTtl should be an integer number' }},
6
7
  ssoLinkingCode: {type: String, validate: {validator: helpers.validateSsoLinkingCode, msg: 'SSO linking code must be a 12 character capital alphanumeric text'}}
7
8
  }, {
8
9
  _id: false