@bluedot-innovation/models 9.0.2 → 9.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/CHANGELOG.md
CHANGED
|
@@ -105,6 +105,12 @@
|
|
|
105
105
|
"tempo": true,
|
|
106
106
|
"wave": true,
|
|
107
107
|
"hello": true
|
|
108
|
+
},
|
|
109
|
+
"doordash": {
|
|
110
|
+
"authorizationToken": "1986d1de-85ea-4339-93a2-6442d44a31f6"
|
|
111
|
+
},
|
|
112
|
+
"uberEats": {
|
|
113
|
+
"signingKey": "5sWo9i2Ia2v1765_D6Wk20Uvn-sZQvDQ3h0MvwmY"
|
|
108
114
|
}
|
|
109
115
|
},
|
|
110
116
|
"tempo": {
|
|
@@ -998,6 +998,30 @@ describe('Project', () => {
|
|
|
998
998
|
})
|
|
999
999
|
})
|
|
1000
1000
|
})
|
|
1001
|
+
|
|
1002
|
+
describe("Doordash integration validation", () => {
|
|
1003
|
+
it('should throw an error when authorizationToken is missing', (done) => {
|
|
1004
|
+
delete project.integrations.doordash.authorizationToken
|
|
1005
|
+
let Project = new ProjectModel(project)
|
|
1006
|
+
Project.validate((err, res) => {
|
|
1007
|
+
assert.exists(err)
|
|
1008
|
+
assert.match(err.message, /`authorizationToken` is required/)
|
|
1009
|
+
done()
|
|
1010
|
+
})
|
|
1011
|
+
})
|
|
1012
|
+
})
|
|
1013
|
+
|
|
1014
|
+
describe("UberEats integration validation", () => {
|
|
1015
|
+
it('should throw an error when signingKey is missing', (done) => {
|
|
1016
|
+
delete project.integrations.uberEats.signingKey
|
|
1017
|
+
let Project = new ProjectModel(project)
|
|
1018
|
+
Project.validate((err, res) => {
|
|
1019
|
+
assert.exists(err)
|
|
1020
|
+
assert.match(err.message, /`signingKey` is required/)
|
|
1021
|
+
done()
|
|
1022
|
+
})
|
|
1023
|
+
})
|
|
1024
|
+
})
|
|
1001
1025
|
})
|
|
1002
1026
|
|
|
1003
1027
|
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
|
@@ -7,7 +7,9 @@ const flipdishIntegrationSchema = require('./FlipdishIntegration')
|
|
|
7
7
|
const projectAttentiveIntegrationSchema = require('./ProjectAttentiveIntegration')
|
|
8
8
|
const incentivioIntegrationSchema = require('./IncentivioIntegration')
|
|
9
9
|
const mparticleIntegrationSchema = require('./MparticleIntegration')
|
|
10
|
-
const klaviyoIntegrationSchema = require('./KlaviyoIntegration')
|
|
10
|
+
const klaviyoIntegrationSchema = require('./KlaviyoIntegration')
|
|
11
|
+
const doordashIntegrationSchema = require('./DoordashIntegration')
|
|
12
|
+
const uberEatsIntegrationSchema = require('./UberEatsIntegration')
|
|
11
13
|
|
|
12
14
|
function mParticleValidator(value) {
|
|
13
15
|
const { androidApiKey, iosApiKey, webApiKey } = value;
|
|
@@ -23,7 +25,9 @@ const IntegrationSchema = new mongoose.Schema({
|
|
|
23
25
|
flipdish: { type: flipdishIntegrationSchema },
|
|
24
26
|
attentive: { type: projectAttentiveIntegrationSchema },
|
|
25
27
|
incentivio: { type: incentivioIntegrationSchema },
|
|
26
|
-
klaviyo: { type: klaviyoIntegrationSchema }
|
|
28
|
+
klaviyo: { type: klaviyoIntegrationSchema },
|
|
29
|
+
doordash: { type: doordashIntegrationSchema },
|
|
30
|
+
uberEats: { type: uberEatsIntegrationSchema }
|
|
27
31
|
},{ _id : false });
|
|
28
32
|
|
|
29
33
|
module.exports = IntegrationSchema
|