@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
|
-
|
|
65
|
+
create_au_production_indexes:
|
|
66
66
|
stage: release
|
|
67
67
|
tags:
|
|
68
68
|
- infrastructure
|
|
69
69
|
when: manual
|
|
70
|
-
allow_failure:
|
|
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
|
@@ -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
|
@@ -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
|