@bluedot-innovation/models 6.2.1-alpha.1 → 6.2.2

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,6 @@
1
+ ## 6.2.2
2
+ - Added sfmc integrations object to Account model
3
+
1
4
  ## 6.2.0
2
5
  - Renamed all references to eta to tempo
3
6
 
@@ -9,7 +9,6 @@ let chai = require('chai')
9
9
  let assert = chai.assert
10
10
  let mocha = require('mocha')
11
11
  let beforeEach = mocha.beforeEach
12
- let helpers = require("../../helpers");
13
12
 
14
13
  let account
15
14
 
@@ -83,19 +82,6 @@ testCase('Account', () => {
83
82
  })
84
83
 
85
84
  testCase('Salesforce Marketing Cloud Integration', () => {
86
- assertions("check email validator", () => {
87
- const sfmc = account.integrations.sfmc;
88
- sfmc.userEmail = "invalid email"
89
- let Account = new AccountModel(account)
90
-
91
- Account.validate((err, res) => {
92
- assert.notExists(res)
93
- assert.exists(err, 'err object should exist')
94
- assert.isObject(err)
95
- done()
96
- })
97
- })
98
-
99
85
  testCase("check required fields", () => {
100
86
  const { requiredFields } = rules.sfmcIntegration;
101
87
 
package/models/Account.js CHANGED
@@ -26,7 +26,6 @@ let AccountSchema = new mongoose.Schema({
26
26
  },
27
27
  state: {type: String, default: StateEnum.ACTIVE},
28
28
  poiCredits: Number,
29
- integrations: Object,
30
29
  features: accountFeatures,
31
30
  creationTime: {type: Date, default: Date.now},
32
31
  lastUpdateTime: {type: Date, default: Date.now},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bluedot-innovation/models",
3
- "version": "6.2.1-alpha.1",
3
+ "version": "6.2.2",
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",
@@ -1,5 +1,4 @@
1
1
  let mongoose = require("mongoose");
2
- const helpers = require("../helpers");
3
2
 
4
3
  const SfmcIntegrationSchema = new mongoose.Schema({
5
4
  activeToken: {
@@ -20,11 +19,7 @@ const SfmcIntegrationSchema = new mongoose.Schema({
20
19
  },
21
20
  userEmail: {
22
21
  type: String,
23
- required: true,
24
- validate: {
25
- validator: helpers.validateEmail,
26
- message: '{VALUE} is not a valid email'
27
- }
22
+ required: true
28
23
  },
29
24
  dataExtensionsId: {
30
25
  type: String,
@@ -52,6 +47,8 @@ const SfmcIntegrationSchema = new mongoose.Schema({
52
47
  allowedFields: {
53
48
  type: [String]
54
49
  }
50
+ }, {
51
+ _id: false
55
52
  })
56
53
 
57
54
  module.exports = SfmcIntegrationSchema