@bluedot-innovation/models 6.2.7 → 6.2.9-alpha.1

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,11 @@
1
+ ## 6.2.9
2
+ - Remove poiCredits from Account model
3
+ - Remove activated field from account.integrations.sfmc
4
+ - Removed required label on dataExtensionId and dataExtensionVersion in sfmc integration object
5
+
6
+ ## 6.2.8
7
+ - Change `shouldSync` default in Project to false
8
+
1
9
  ## 6.2.7
2
10
  - Add `shouldSync` to Project
3
11
 
@@ -6,7 +6,6 @@
6
6
  "name": "ABC Company",
7
7
  "createdBy": "b0824b76-ce73-4fcf-81f8-1b63edb1114e",
8
8
  "customerApiKey": "55645af4-a8cb-468d-93fa-c15dacc949ca",
9
- "poiCredits": 23,
10
9
  "features": {
11
10
  "tempo": {
12
11
  "enabled": true
@@ -25,7 +24,6 @@
25
24
  "dataExtensionVersion": 2,
26
25
  "dataExtensionId": "example-data-extension-id",
27
26
  "stackKey": "example-stack-key",
28
- "activated": true,
29
27
  "enterpriseId": 1234567,
30
28
  "organizationId": 12345,
31
29
  "allowedFields": ["example-allowed-fields"]
@@ -1,11 +1,10 @@
1
1
  module.exports = {
2
2
  requiredFields: ['name'],
3
3
  customValidators: [
4
- {name: 'poiCredits', invalidInputs: ['a string']},
5
4
  {name: 'creationTime', invalidInputs: ['21/07/2017', 'thursday']},
6
5
  {name: 'lastUpdateTime', invalidInputs: ['21/07/2017', 'saturday']}
7
6
  ],
8
7
  sfmcIntegration: {
9
- requiredFields: ['activeToken', 'activeTokenExpiry', 'refreshToken', 'userId', 'userEmail', 'dataExtensionId', 'dataExtensionVersion', 'enterpriseId', 'organizationId']
8
+ requiredFields: ['activeToken', 'activeTokenExpiry', 'refreshToken', 'userId', 'userEmail', 'enterpriseId', 'organizationId']
10
9
  }
11
10
  }
@@ -12,7 +12,7 @@
12
12
  "securityToken" : "value"
13
13
  }
14
14
  }],
15
- "shouldSync": false,
15
+ "shouldSync": true,
16
16
  "firebaseApiKey": "88888888-4444-4444-4444-121212121212",
17
17
  "apiKey": "88888888-4444-4444-4444-123412341234",
18
18
  "integrations":{
@@ -39,11 +39,11 @@ testCase('Project', () => {
39
39
  })
40
40
  })
41
41
 
42
- assertions('should set the value of shouldSync to true when it is not defined', (done) => {
42
+ assertions('should set the value of shouldSync to false when it is not defined', (done) => {
43
43
  let project = JSON.parse(JSON.stringify(require('./project.remote.config.json')))
44
44
  delete project.shouldSync
45
45
  let Project = new ProjectModel(project)
46
- assert.equal(Project.shouldSync, true, "shouldSync should be set to true")
46
+ assert.equal(Project.shouldSync, false, "shouldSync should be set to false")
47
47
  Project.validate((err, res) => {
48
48
  assert.notExists(err)
49
49
  done()
package/models/Account.js CHANGED
@@ -25,7 +25,6 @@ let AccountSchema = new mongoose.Schema({
25
25
  default: uuidv4
26
26
  },
27
27
  state: {type: String, default: StateEnum.ACTIVE},
28
- poiCredits: Number,
29
28
  features: accountFeatures,
30
29
  creationTime: {type: Date, default: Date.now},
31
30
  lastUpdateTime: {type: Date, default: Date.now},
package/models/Project.js CHANGED
@@ -38,7 +38,7 @@ let ProjectSchema = new mongoose.Schema({
38
38
  lastUpdateTime: {type: Date, default: Date.now},
39
39
  lastSyncTime: {type: Date, default: Date.now},
40
40
  name: {type: String, required: [true, 'name is required']},
41
- shouldSync: { type: Boolean, default: true },
41
+ shouldSync: { type: Boolean, default: false },
42
42
  accountId: {type: String, required: true, validate: {isAsync: false, validator: helpers.validateUUIDv4, msg: 'default error message'}},
43
43
  webhooks: {type:[WebhookSchema], validate: webhooksValidators},
44
44
  configurationParameters: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bluedot-innovation/models",
3
- "version": "6.2.7",
3
+ "version": "6.2.9-alpha.1",
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",
@@ -22,20 +22,14 @@ const SfmcIntegrationSchema = new mongoose.Schema({
22
22
  required: true
23
23
  },
24
24
  dataExtensionId: {
25
- type: String,
26
- required: true
25
+ type: String
27
26
  },
28
27
  dataExtensionVersion: {
29
- type: Number,
30
- required: true
28
+ type: Number
31
29
  },
32
30
  stackKey: {
33
31
  type: String
34
32
  },
35
- activated: {
36
- type: Boolean,
37
- default: false
38
- },
39
33
  enterpriseId: {
40
34
  type: Number,
41
35
  required: true