@bluedot-innovation/models 8.2.4 → 8.2.6

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,9 @@
1
+ ## 8.2.6
2
+ - Add retryEnabled to webhook model
3
+
4
+ ## 8.2.5
5
+ - Fix validation of mParticle keys and event flags
6
+
1
7
  ## 8.2.4
2
8
  - Add webApiKey and event flags for mParticle integration
3
9
 
@@ -11,21 +11,24 @@
11
11
  "url": "https://webhooklistener.bluedotinnovation.com",
12
12
  "headers" : {
13
13
  "securityToken" : "value"
14
- }
14
+ },
15
+ "retryEnabled": true
15
16
  },
16
17
  {
17
18
  "type": "tempo",
18
19
  "url": "https://webhooklistener.bluedotinnovation.com",
19
20
  "headers" : {
20
21
  "securityToken" : "value"
21
- }
22
+ },
23
+ "retryEnabled": true
22
24
  },
23
25
  {
24
26
  "type": "tempo",
25
27
  "url": "https://webhooklistener2.bluedotinnovation.com",
26
28
  "headers" : {
27
29
  "securityToken" : "value"
28
- }
30
+ },
31
+ "retryEnabled": false
29
32
  },
30
33
  {
31
34
  "type": "wave",
@@ -38,7 +41,8 @@
38
41
  "body": {
39
42
  "key1": "value1",
40
43
  "key2": "value2"
41
- }
44
+ },
45
+ "retryEnabled": true
42
46
  }
43
47
  ],
44
48
  "shouldSync": true,
@@ -49,10 +53,10 @@
49
53
  "androidApiKey": "us1-c5e6eefe90fe704aba0a7d2daa00baaa",
50
54
  "iosApiKey": "us1-a5e6eefe90fe704aba0a7d2daa00baaa",
51
55
  "webApiKey": "us1-a5e6eefe90fe704aba0a7d2daa00baaa",
52
- "trigger": true,
53
- "tempo": true,
54
- "wave": true,
55
- "hello": true,
56
+ "trigger": false,
57
+ "tempo": false,
58
+ "wave": false,
59
+ "hello": false,
56
60
  "environment": "production"
57
61
  },
58
62
  "olo": {
@@ -171,7 +171,7 @@ describe('Project', () => {
171
171
  })
172
172
 
173
173
  assertions('should throw an error if trigger is selected but no android or ios keys provided', (done) => {
174
-
174
+ project.integrations.mparticle.trigger = true
175
175
  delete project.integrations.mparticle.androidApiKey
176
176
  delete project.integrations.mparticle.iosApiKey
177
177
 
@@ -183,7 +183,7 @@ describe('Project', () => {
183
183
  })
184
184
  })
185
185
  assertions('should throw an error if tempo is selected but no android or ios keys provided', (done) => {
186
-
186
+ project.integrations.mparticle.tempo = true
187
187
  delete project.integrations.mparticle.androidApiKey
188
188
  delete project.integrations.mparticle.iosApiKey
189
189
 
@@ -196,7 +196,7 @@ describe('Project', () => {
196
196
  })
197
197
 
198
198
  assertions('should throw an error if wave is selected but no web keys provided', (done) => {
199
-
199
+ project.integrations.mparticle.wave = true
200
200
  delete project.integrations.mparticle.webApiKey
201
201
 
202
202
  let Project = new ProjectModel(project)
@@ -207,7 +207,7 @@ describe('Project', () => {
207
207
  })
208
208
  })
209
209
  assertions('should throw an error if hello is selected but no web keys provided', (done) => {
210
-
210
+ project.integrations.mparticle.hello = true
211
211
  delete project.integrations.mparticle.webApiKey
212
212
 
213
213
  let Project = new ProjectModel(project)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bluedot-innovation/models",
3
- "version": "8.2.4",
3
+ "version": "8.2.6",
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",
@@ -5,16 +5,16 @@ function apiKeyValidator(value){
5
5
  return !(typeof value !=='string' || value.trim() === '')
6
6
  }
7
7
 
8
- function mobileValidator() {
9
- if (!this.androidApiKey && !this.iosApiKey) {
8
+ function mobileValidator(value) {
9
+ if (value && !this.androidApiKey && !this.iosApiKey) {
10
10
  return false
11
11
  } else {
12
12
  return true
13
13
  }
14
14
  }
15
15
 
16
- function webValidator() {
17
- if (!this.webApiKey) {
16
+ function webValidator(value) {
17
+ if (value && !this.webApiKey) {
18
18
  return false
19
19
  } else {
20
20
  return true
@@ -50,7 +50,8 @@ let WebhookSchema = new mongoose.Schema({
50
50
  {validator: validateTealiumRequiredFields, msg: 'tealium webhooks require "tealium_account" and "tealium_profile" body fields to be present'},
51
51
  {validator: validateMobivityRequiredFields, msg: 'mobivity webhooks require "username", "target_id" and "message_text" body fields to be present'}
52
52
  ]
53
- }
53
+ },
54
+ retryEnabled: { type: Boolean, default: false }
54
55
  }, {
55
56
  _id: false
56
57
  })