@bluedot-innovation/models 8.2.5 → 8.3.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 +6 -0
- package/__tests__/account/account.data.json +5 -0
- package/__tests__/project/project.data.json +8 -4
- package/__tests__/user/user.data.js +2 -1
- package/__tests__/user/user.spec.js +13 -0
- package/models/User.js +1 -0
- package/package.json +1 -1
- package/schemas/AccountFeatures.js +3 -1
- package/schemas/CanvasSsoFeature.js +11 -0
- package/schemas/Webhook.js +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -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,
|
|
@@ -53,6 +53,19 @@ describe('User', () => {
|
|
|
53
53
|
done()
|
|
54
54
|
})
|
|
55
55
|
})
|
|
56
|
+
|
|
57
|
+
it('should set identityProvider to internal if not present', (done) => {
|
|
58
|
+
user = JSON.parse(JSON.stringify(user))
|
|
59
|
+
delete user.identityProvider
|
|
60
|
+
|
|
61
|
+
const User = new UserModel(user)
|
|
62
|
+
assert(User.identityProvider === "internal")
|
|
63
|
+
User.validate((err, res) => {
|
|
64
|
+
assert.notExists(res)
|
|
65
|
+
assert(err === null, 'err equals null')
|
|
66
|
+
done()
|
|
67
|
+
})
|
|
68
|
+
})
|
|
56
69
|
})
|
|
57
70
|
|
|
58
71
|
describe('Invalid User', () => {
|
package/models/User.js
CHANGED
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@ let AccountBasicFeatureSchema = require('./AccountBasicFeature')
|
|
|
4
4
|
let AccountScreensSchema = require('./AccountScreens')
|
|
5
5
|
let AccountCemdPersistenceSchema = require('./AccountCemdPersistence')
|
|
6
6
|
let HelloSsoSchema = require('./HelloSso')
|
|
7
|
+
const CanvasSsoSchema = require('./CanvasSsoFeature')
|
|
7
8
|
|
|
8
9
|
let AccountFeaturesSchema = new mongoose.Schema({
|
|
9
10
|
tempo: AccountTempoSchema,
|
|
@@ -14,7 +15,8 @@ let AccountFeaturesSchema = new mongoose.Schema({
|
|
|
14
15
|
hideStores: AccountBasicFeatureSchema,
|
|
15
16
|
automaticDestinationCreation: AccountBasicFeatureSchema,
|
|
16
17
|
nowReadyConfiguration: AccountBasicFeatureSchema,
|
|
17
|
-
helloSso: HelloSsoSchema
|
|
18
|
+
helloSso: HelloSsoSchema,
|
|
19
|
+
canvasSso: CanvasSsoSchema
|
|
18
20
|
}, {
|
|
19
21
|
_id: false
|
|
20
22
|
})
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
let mongoose = require('mongoose')
|
|
2
|
+
|
|
3
|
+
let CanvasSsoSchema = new mongoose.Schema({
|
|
4
|
+
enabled: {type: Boolean, default: true},
|
|
5
|
+
identityProvider: {type: String, required: true},
|
|
6
|
+
domain: {type: String, required: true}
|
|
7
|
+
}, {
|
|
8
|
+
_id: false
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
module.exports = CanvasSsoSchema
|
package/schemas/Webhook.js
CHANGED
|
@@ -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
|
})
|