@bluedot-innovation/models 6.2.12 → 7.0.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,6 +1,3 @@
1
- ## 7.0.2
2
- - Re-added Circle radius to be > 5m
3
-
4
1
  ## 7.0.1
5
2
  - Added tempo webhooks array back for migration
6
3
  - Added tempo destinationId back for migration
@@ -11,9 +8,6 @@
11
8
  - BREAKING CHANGE - Moved zone destinationId to object root and removed tempo object from zone
12
9
  - Added 'doorbell' type to project webhooks
13
10
 
14
- ## 6.2.12
15
- - Re-added Circle radius to be > 5m
16
-
17
11
  ## 6.2.11
18
12
  - Replace `isAsync` validators with Mongoose 5.x validators
19
13
 
@@ -51,18 +51,6 @@ testCase('Circle', () => {
51
51
  })
52
52
 
53
53
  testCase('Invalid Circle', () => {
54
- // BD2571
55
- assertions('should not validate a Circle with radius <5 meters', (done) => {
56
- circle.radius = 3
57
- let Circle = new CircleModelBuiltInMongoose(circle)
58
- Circle.validate((err, res) => {
59
- assert.exists(err)
60
- assert.isObject(err.errors)
61
- assert.strictEqual(err.errors.radius.message, `radius [3m] must be greater than 5m`)
62
- done()
63
- })
64
- })
65
-
66
54
  assertions('should not validate a Circle with no radius', (done) => {
67
55
  delete circle.radius
68
56
  let Circle = new CircleModel(circle)
@@ -10,17 +10,7 @@ let schema = {
10
10
  name: {type: String, required: [true, 'name is required. ']},
11
11
  color: String,
12
12
  accuracy: {type: String, enum: Object.values(ZoneEnum.fenceAccuracy)},
13
- radius: {
14
- type: Double,
15
- required: [true, 'radius is required. '],
16
- validate: {
17
- validator: function(v) {
18
- return (v >= 5) ;
19
- },
20
- message: props => `radius [${props.value}m] must be greater than 5m`
21
- },
22
-
23
- },
13
+ radius: {type: Double, required: [true, 'radius is required. '], min: 5},
24
14
  center: {type: Point, required: [true, 'center is required. ']}
25
15
  }
26
16
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bluedot-innovation/models",
3
- "version": "6.2.12",
3
+ "version": "7.0.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",