@bluedot-innovation/models 10.1.0 → 10.2.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
|
@@ -112,7 +112,11 @@
|
|
|
112
112
|
"uberEats": {
|
|
113
113
|
"enabled": true,
|
|
114
114
|
"lastSyncedTime": "2022-10-21T04:12:02.103Z"
|
|
115
|
-
}
|
|
115
|
+
},
|
|
116
|
+
"rezolveChat": {
|
|
117
|
+
"apiKey": "9a690452-78de-465d-a484-053b1448e5f5",
|
|
118
|
+
"url": "https://rezolve.chat.api"
|
|
119
|
+
}
|
|
116
120
|
},
|
|
117
121
|
"tempo": {
|
|
118
122
|
"isochroneBracketInterval": [60, 120, 300]
|
|
@@ -1047,6 +1047,30 @@ describe('Project', () => {
|
|
|
1047
1047
|
}
|
|
1048
1048
|
})
|
|
1049
1049
|
})
|
|
1050
|
+
|
|
1051
|
+
describe("Rezolve Chat integration validation", () => {
|
|
1052
|
+
it('should throw an error when apiKey is missing', async () => {
|
|
1053
|
+
delete project.integrations.rezolveChat.apiKey
|
|
1054
|
+
let Project = new ProjectModel(project)
|
|
1055
|
+
try {
|
|
1056
|
+
await Project.validate()
|
|
1057
|
+
} catch (err) {
|
|
1058
|
+
assert.exists(err, 'err object should exist')
|
|
1059
|
+
assert.match(err.message, /`apiKey` is required/)
|
|
1060
|
+
}
|
|
1061
|
+
})
|
|
1062
|
+
|
|
1063
|
+
it('should throw an error when Rezolve Chat URL is missing', async () => {
|
|
1064
|
+
delete project.integrations.rezolveChat.url
|
|
1065
|
+
let Project = new ProjectModel(project)
|
|
1066
|
+
try {
|
|
1067
|
+
await Project.validate()
|
|
1068
|
+
} catch (err) {
|
|
1069
|
+
assert.exists(err, 'err object should exist')
|
|
1070
|
+
assert.match(err.message, /`url` is required/)
|
|
1071
|
+
}
|
|
1072
|
+
})
|
|
1073
|
+
})
|
|
1050
1074
|
})
|
|
1051
1075
|
|
|
1052
1076
|
describe('should throw an error when any of the values of the array contains a falsy value', () => {
|
package/package.json
CHANGED
package/schemas/Integration.js
CHANGED
|
@@ -10,6 +10,7 @@ const mparticleIntegrationSchema = require('./MparticleIntegration')
|
|
|
10
10
|
const klaviyoIntegrationSchema = require('./KlaviyoIntegration')
|
|
11
11
|
const doordashIntegrationSchema = require('./DoordashIntegration')
|
|
12
12
|
const ubereatsIntegrationSchema = require('./UberEatsIntegration')
|
|
13
|
+
const rezolveChatIntegrationSchema = require('./RezolveChatIntegration')
|
|
13
14
|
|
|
14
15
|
function mParticleValidator(value) {
|
|
15
16
|
const { androidApiKey, iosApiKey, webApiKey } = value;
|
|
@@ -27,7 +28,8 @@ const IntegrationSchema = new mongoose.Schema({
|
|
|
27
28
|
incentivio: { type: incentivioIntegrationSchema },
|
|
28
29
|
klaviyo: { type: klaviyoIntegrationSchema },
|
|
29
30
|
doordash: { type: doordashIntegrationSchema },
|
|
30
|
-
uberEats: { type: ubereatsIntegrationSchema }
|
|
31
|
+
uberEats: { type: ubereatsIntegrationSchema },
|
|
32
|
+
rezolveChat: { type: rezolveChatIntegrationSchema }
|
|
31
33
|
},{ _id : false });
|
|
32
34
|
|
|
33
35
|
module.exports = IntegrationSchema
|