@bluedot-innovation/models 3.0.8-alpha.2 → 3.0.8

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,5 +1,6 @@
1
1
  ## 3.0.8
2
2
  - Remove validations on `geometry`'s
3
+ - Geofeatures moved to own separate folder
3
4
 
4
5
  ## 3.0.7
5
6
  - `proximityUUID` is now mandatory
package/Models.js CHANGED
@@ -6,18 +6,21 @@ let Models = {}
6
6
 
7
7
  Models.Account = require('./models/Account').Model
8
8
  Models.Beacon = require('./models/Beacon').Model
9
- Models.BoundingBox = require('./models/BoundingBox').Model
10
- Models.Circle = require('./models/Circle').Model
9
+
11
10
  Models.MessageAction = require('./models/MessageAction').Model
12
11
  Models.MonthlyStat = require('./models/MonthlyStats').Model
13
- Models.Polygon = require('./models/Polygon').Model
14
- Models.Polyline = require('./models/Polyline').Model
15
12
  Models.Project = require('./models/Project').Model
16
13
  Models.RuleRequestAggregation = require('./models/RuleRequestAggregation').Model
17
14
  Models.UrlAction = require('./models/UrlAction').Model
18
15
  Models.User = require('./models/User').Model
19
16
  Models.Zone = require('./models/Zone').Model
20
- Models.ZoneBeacon = require('./models/ZoneBeacon').Model
17
+
18
+ // Geofeatures
19
+ Models.BoundingBox = require('./models/geofeatures/BoundingBox').Model
20
+ Models.Circle = require('./models/geofeatures/Circle').Model
21
+ Models.Polygon = require('./models/geofeatures/Polygon').Model
22
+ Models.Polyline = require('./models/geofeatures/Polyline').Model
23
+ Models.ZoneBeacon = require('./models/geofeatures/ZoneBeacon').Model
21
24
 
22
25
  // Filters
23
26
  Models.DayRange = require('./models/filters/DayRange').Model
@@ -30,18 +33,21 @@ let Schemas = {}
30
33
 
31
34
  Schemas.Account = require('./models/Account').Schema
32
35
  Schemas.Beacon = require('./models/Beacon').Schema
33
- Schemas.BoundingBox = require('./models/BoundingBox').Schema
34
- Schemas.Circle = require('./models/Circle').Schema
35
36
  Schemas.MessageAction = require('./models/MessageAction').Schema
36
37
  Schemas.MonthlyStat = require('./models/MonthlyStats').Schema
37
- Schemas.Polygon = require('./models/Polygon').Schema
38
- Schemas.Polyline = require('./models/Polyline').Schema
39
38
  Schemas.Project = require('./models/Project').Schema
40
39
  Schemas.RuleRequestAggregation = require('./models/RuleRequestAggregation').Schema
41
40
  Schemas.UrlAction = require('./models/UrlAction').Schema
42
41
  Schemas.User = require('./models/User').Schema
43
42
  Schemas.Zone = require('./models/Zone').Schema
44
43
 
44
+ // Geofeatures
45
+ Schemas.BoundingBox = require('./models/geofeatures/BoundingBox').Schema
46
+ Schemas.Circle = require('./models/geofeatures/Circle').Schema
47
+ Schemas.Polygon = require('./models/geofeatures/Polygon').Schema
48
+ Schemas.Polyline = require('./models/geofeatures/Polyline').Schema
49
+ Schemas.ZoneBeacon = require('./models/geofeatures/ZoneBeacon').Schema
50
+
45
51
  // Filters
46
52
  Schemas.DayRange = require('./models/filters/DayRange').Schema
47
53
  Schemas.Speed = require('./models/filters/Speed').Schema
package/models/Zone.js CHANGED
@@ -9,11 +9,11 @@ let Schema = mongoose.Schema
9
9
  let StateEnum = require('@bluedot-innovation/enums').StateEnum
10
10
  let messageActionSchema = require('./MessageAction').messageActionSchema
11
11
  let urlActionSchema = require('./UrlAction').urlActionSchema
12
- let circleSchema = require('./Circle').circleSchema
13
- let boundingBoxSchema = require('./BoundingBox').boundingBoxSchema
14
- let polylineSchema = require('./Polyline').polylineSchema
15
- let polygonSchema = require('./Polygon').polygonSchema
16
- let beaconSchema = require('./ZoneBeacon').beaconSchema
12
+ let circleSchema = require('./geofeatures/Circle').circleSchema
13
+ let boundingBoxSchema = require('./geofeatures/BoundingBox').boundingBoxSchema
14
+ let polylineSchema = require('./geofeatures/Polyline').polylineSchema
15
+ let polygonSchema = require('./geofeatures/Polygon').polygonSchema
16
+ let beaconSchema = require('./geofeatures/ZoneBeacon').beaconSchema
17
17
 
18
18
  // Filters
19
19
  let speedRawSchema = require('./filters/Speed').rawSchema
@@ -1,13 +1,12 @@
1
1
  let mongoose = require('mongoose')
2
2
  let StateEnum = require('@bluedot-innovation/enums').StateEnum
3
3
  let uuidv4 = require('uuid/v4')
4
- let Point = require('../schemas/Point')
5
- let PolygonGeometry = require('../schemas/PolygonGeometry')
6
- let helpers = require('../helpers')
4
+ let Point = require('../../schemas/Point')
5
+ let helpers = require('../../helpers')
7
6
 
8
7
  const schema = {
9
8
  _id: {type: String, default: uuidv4},
10
- geometry: {type: PolygonGeometry},
9
+ geometry: {type: {}},
11
10
  name: {type: String, required: [true, 'name is required.']},
12
11
  color: String,
13
12
  northEast: {type: Point, required: [true, 'northEast is required.']},
@@ -1,8 +1,7 @@
1
1
  let mongoose = require('mongoose')
2
2
  let StateEnum = require('@bluedot-innovation/enums').StateEnum
3
- let Point = require('../schemas/Point')
3
+ let Point = require('../../schemas/Point')
4
4
  let uuidv4 = require('uuid/v4')
5
- let PolygonGeometry = require('../schemas/PolygonGeometry')
6
5
 
7
6
  let schema = {
8
7
  _id: {type: String, default: uuidv4},
@@ -1,12 +1,12 @@
1
1
  let mongoose = require('mongoose')
2
2
  let StateEnum = require('@bluedot-innovation/enums').StateEnum
3
- let Point = require('../schemas/Point')
3
+ let Point = require('../../schemas/Point')
4
4
  let uuidv4 = require('uuid/v4')
5
- let helpers = require('../helpers')
5
+ let helpers = require('../../helpers')
6
6
 
7
7
  const schema = {
8
8
  _id: {type: String, default: uuidv4},
9
- geometry: {type: mongoose.Schema.Types.Mixed},
9
+ geometry: {type: {}},
10
10
  name: {type: String, required: [true, 'name is required.']},
11
11
  color: String,
12
12
  vertices: {
@@ -1,12 +1,11 @@
1
1
  let mongoose = require('mongoose')
2
2
  let StateEnum = require('@bluedot-innovation/enums').StateEnum
3
- let Point = require('../schemas/Point')
3
+ let Point = require('../../schemas/Point')
4
4
  let uuidv4 = require('uuid/v4')
5
- let MultiLineStringGeometry = require('../schemas/MultiLineStringGeometry')
6
5
 
7
6
  const schema = {
8
7
  _id: {type: String, default: uuidv4},
9
- geometry: {type: MultiLineStringGeometry},
8
+ geometry: {type: {}},
10
9
  name: {type: String, required: [true, 'name is required. ']},
11
10
  vertices: {type: [Point], required: [true, 'vertices is required. ']}
12
11
  }
@@ -1,6 +1,6 @@
1
1
  const cloneDeep = require('lodash.clonedeep')
2
2
  const mongoose = require('mongoose')
3
- const beaconSchema = require('./Beacon').beaconSchema
3
+ const beaconSchema = require('../Beacon').beaconSchema
4
4
  const BeaconEnum = require('@bluedot-innovation/enums').BeaconEnum
5
5
 
6
6
  const schema = cloneDeep(beaconSchema)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bluedot-innovation/models",
3
- "version": "3.0.8-alpha.2",
3
+ "version": "3.0.8",
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",