@bluedot-innovation/models 2.0.19-alpha.18 → 2.0.19-alpha.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/Models.js +10 -10
- package/__tests__/filter/bearing/bearingFilter.spec.js +1 -1
- package/models/{geofeatures/Beacon.js → Beacon.js} +8 -11
- package/models/{geofeatures/BoundingBox.js → BoundingBox.js} +15 -18
- package/models/{geofeatures/Circle.js → Circle.js} +9 -13
- package/models/{geofeatures/Polygon.js → Polygon.js} +6 -10
- package/models/{geofeatures/Polyline.js → Polyline.js} +14 -16
- package/models/Project.js +0 -2
- package/models/User.js +0 -3
- package/models/Zone.js +18 -11
- package/models/ZoneBeacon.js +5 -9
- package/package.json +1 -1
- package/utils/mongooseHidden.js +0 -10
package/Models.js
CHANGED
|
@@ -5,17 +5,17 @@
|
|
|
5
5
|
let Models = {}
|
|
6
6
|
|
|
7
7
|
Models.Account = require('./models/Account').Model
|
|
8
|
-
Models.Beacon = require('./models/
|
|
8
|
+
Models.Beacon = require('./models/Beacon').Model
|
|
9
9
|
Models.BeaconFilter = require('./models/BeaconFilter').Model
|
|
10
10
|
Models.BearingFilter = require('./models/BearingFilter').Model
|
|
11
|
-
Models.BoundingBox = require('./models/
|
|
11
|
+
Models.BoundingBox = require('./models/BoundingBox').Model
|
|
12
12
|
Models.CalendarDateRangeFilter = require('./models/CalendarDateRangeFilter').Model
|
|
13
|
-
Models.Circle = require('./models/
|
|
13
|
+
Models.Circle = require('./models/Circle').Model
|
|
14
14
|
Models.MessageAction = require('./models/MessageAction').Model
|
|
15
15
|
Models.MonthlyStat = require('./models/MonthlyStats').Model
|
|
16
16
|
Models.PercentageCrossedFilter = require('./models/PercentageCrossedFilter').Model
|
|
17
|
-
Models.Polygon = require('./models/
|
|
18
|
-
Models.Polyline = require('./models/
|
|
17
|
+
Models.Polygon = require('./models/Polygon').Model
|
|
18
|
+
Models.Polyline = require('./models/Polyline').Model
|
|
19
19
|
Models.Project = require('./models/Project').Model
|
|
20
20
|
Models.RuleRequestAggregation = require('./models/RuleRequestAggregation').Model
|
|
21
21
|
Models.SpeedFilter = require('./models/SpeedFilter').Model
|
|
@@ -28,17 +28,17 @@ Models.ZoneBeacon = require('./models/ZoneBeacon').Model
|
|
|
28
28
|
let Schemas = {}
|
|
29
29
|
|
|
30
30
|
Schemas.Account = require('./models/Account').Schema
|
|
31
|
-
Schemas.Beacon = require('./models/
|
|
31
|
+
Schemas.Beacon = require('./models/Beacon').Schema
|
|
32
32
|
Schemas.BeaconFilter = require('./models/BeaconFilter').Schema
|
|
33
33
|
Schemas.BearingFilter = require('./models/BearingFilter').Schema
|
|
34
|
-
Schemas.BoundingBox = require('./models/
|
|
34
|
+
Schemas.BoundingBox = require('./models/BoundingBox').Schema
|
|
35
35
|
Schemas.CalendarDateRangeFilter = require('./models/CalendarDateRangeFilter').Schema
|
|
36
|
-
Schemas.Circle = require('./models/
|
|
36
|
+
Schemas.Circle = require('./models/Circle').Schema
|
|
37
37
|
Schemas.MessageAction = require('./models/MessageAction').Schema
|
|
38
38
|
Schemas.MonthlyStat = require('./models/MonthlyStats').Schema
|
|
39
39
|
Schemas.PercentageCrossedFilter = require('./models/PercentageCrossedFilter').Schema
|
|
40
|
-
Schemas.Polygon = require('./models/
|
|
41
|
-
Schemas.Polyline = require('./models/
|
|
40
|
+
Schemas.Polygon = require('./models/Polygon').Schema
|
|
41
|
+
Schemas.Polyline = require('./models/Polyline').Schema
|
|
42
42
|
Schemas.Project = require('./models/Project').Schema
|
|
43
43
|
Schemas.RuleRequestAggregation = require('./models/RuleRequestAggregation').Schema
|
|
44
44
|
Schemas.SpeedFilter = require('./models/SpeedFilter').Schema
|
|
@@ -2,7 +2,7 @@ let mongoose = require('mongoose')
|
|
|
2
2
|
mongoose.Promise = global.Promise
|
|
3
3
|
|
|
4
4
|
const BearingFilterModel = require('../../../Models').BearingFilter(mongoose)
|
|
5
|
-
const { isMinimumNinetyApart } = require('
|
|
5
|
+
const { isMinimumNinetyApart } = require.main.require('models/BearingFilter')
|
|
6
6
|
const describe = require('mocha').describe
|
|
7
7
|
const it = require('mocha').it
|
|
8
8
|
const chai = require('chai')
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const Point = require('../../schemas/Point')
|
|
1
|
+
let mongoose = require('mongoose')
|
|
2
|
+
let StateEnum = require('@bluedot-innovation/enums').StateEnum
|
|
3
|
+
let Point = require('../schemas/Point')
|
|
4
|
+
let PointGeometry = require('../schemas/PointGeometry')
|
|
5
|
+
let uuidv4 = require('uuid/v4')
|
|
6
|
+
let patcher = require('mongoose-json-patch')
|
|
8
7
|
|
|
9
8
|
let schema = {
|
|
10
9
|
_id: {type: String, default: uuidv4},
|
|
@@ -42,7 +41,6 @@ BeaconSchema.index({ accountId: 1, geometry: '2dsphere' })
|
|
|
42
41
|
// accountId: 1, geometry: "2dsphere"
|
|
43
42
|
|
|
44
43
|
BeaconSchema.plugin(patcher)
|
|
45
|
-
BeaconSchema.plugin(mongooseHidden)
|
|
46
44
|
|
|
47
45
|
// mongoose validator helper plugin
|
|
48
46
|
BeaconSchema.post('validate', function (doc) {
|
|
@@ -80,7 +78,7 @@ function validateBeaconType (v, magicCallback) {
|
|
|
80
78
|
}
|
|
81
79
|
|
|
82
80
|
// optional mongoose
|
|
83
|
-
let
|
|
81
|
+
let model = (mongooseInstance) => {
|
|
84
82
|
const instance = mongooseInstance || mongoose
|
|
85
83
|
let Beacon = instance.model('Beacon', BeaconSchema)
|
|
86
84
|
|
|
@@ -90,6 +88,5 @@ let BeaconModel = (mongooseInstance) => {
|
|
|
90
88
|
|
|
91
89
|
return Beacon
|
|
92
90
|
}
|
|
93
|
-
|
|
94
91
|
// Exports Mongoose Model, Mongoose Schema, JSON schema (required locally for discriminators)
|
|
95
|
-
module.exports = { Model:
|
|
92
|
+
module.exports = { Model: model, Schema: BeaconSchema, beaconSchema: schema }
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
let StateEnum = require('@bluedot-innovation/enums').StateEnum
|
|
2
1
|
let mongoose = require('mongoose')
|
|
2
|
+
let StateEnum = require('@bluedot-innovation/enums').StateEnum
|
|
3
3
|
let uuidv4 = require('uuid/v4')
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const mongooseHidden = require('../../utils/mongooseHidden')
|
|
4
|
+
let Point = require('../schemas/Point')
|
|
5
|
+
let PolygonGeometry = require('../schemas/PolygonGeometry')
|
|
7
6
|
|
|
8
7
|
const schema = {
|
|
9
8
|
_id: {type: String, default: uuidv4},
|
|
@@ -17,30 +16,28 @@ const schema = {
|
|
|
17
16
|
state: {type: String, default: StateEnum.active, select: false}
|
|
18
17
|
}
|
|
19
18
|
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
const BoundingBoxSchema = new mongoose.Schema(
|
|
20
|
+
schema,
|
|
21
|
+
{
|
|
22
|
+
_id: false,
|
|
23
|
+
versionKey: false
|
|
24
|
+
})
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
type: {type: String, required: true}
|
|
26
|
+
BoundingBoxSchema.add({
|
|
27
|
+
type:
|
|
28
|
+
{type: String, required: true}
|
|
29
29
|
})
|
|
30
30
|
|
|
31
|
-
boundingBoxSchema.plugin(mongooseHidden)
|
|
32
|
-
|
|
33
|
-
|
|
34
31
|
// optional mongoose
|
|
35
32
|
let model = (mongooseInstance) => {
|
|
36
33
|
let BoundingBox
|
|
37
34
|
if (mongooseInstance) {
|
|
38
|
-
BoundingBox = mongooseInstance.model('BoundingBox',
|
|
35
|
+
BoundingBox = mongooseInstance.model('BoundingBox', BoundingBoxSchema)
|
|
39
36
|
} else {
|
|
40
|
-
BoundingBox = mongoose.model('BoundingBox',
|
|
37
|
+
BoundingBox = mongoose.model('BoundingBox', BoundingBoxSchema)
|
|
41
38
|
}
|
|
42
39
|
|
|
43
40
|
return BoundingBox
|
|
44
41
|
}
|
|
45
42
|
// Exports Mongoose Model, Mongoose Schema, JSON schema (required locally for discriminators)
|
|
46
|
-
module.exports = { Model: model, Schema:
|
|
43
|
+
module.exports = { Model: model, Schema: BoundingBoxSchema, boundingBoxSchema: schema }
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
let mongoose = require('mongoose')
|
|
2
2
|
let StateEnum = require('@bluedot-innovation/enums').StateEnum
|
|
3
|
+
let Point = require('../schemas/Point')
|
|
3
4
|
let uuidv4 = require('uuid/v4')
|
|
4
|
-
|
|
5
|
-
const mongooseHidden = require('../../utils/mongooseHidden')
|
|
6
|
-
const Point = require('../../schemas/Point')
|
|
5
|
+
let PolygonGeometry = require('../schemas/PolygonGeometry')
|
|
7
6
|
|
|
8
7
|
let schema = {
|
|
9
8
|
_id: {type: String, default: uuidv4},
|
|
@@ -17,31 +16,28 @@ let schema = {
|
|
|
17
16
|
state: {type: String, default: StateEnum.active, select: false}
|
|
18
17
|
}
|
|
19
18
|
|
|
20
|
-
let
|
|
19
|
+
let CircleSchema = new mongoose.Schema(
|
|
21
20
|
schema,
|
|
22
21
|
{
|
|
23
22
|
_id: false,
|
|
24
23
|
__v: false
|
|
25
24
|
})
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
type: {type: String, required: true}
|
|
26
|
+
CircleSchema.add({
|
|
27
|
+
type:
|
|
28
|
+
{type: String, required: true}
|
|
31
29
|
})
|
|
32
30
|
|
|
33
|
-
circleSchema.plugin(mongooseHidden)
|
|
34
|
-
|
|
35
31
|
// optional mongoose
|
|
36
32
|
let model = (mongooseInstance) => {
|
|
37
33
|
let Circle
|
|
38
34
|
if (mongooseInstance) {
|
|
39
|
-
Circle = mongooseInstance.model('Circle',
|
|
35
|
+
Circle = mongooseInstance.model('Circle', CircleSchema)
|
|
40
36
|
} else {
|
|
41
|
-
Circle = mongoose.model('Circle',
|
|
37
|
+
Circle = mongoose.model('Circle', CircleSchema)
|
|
42
38
|
}
|
|
43
39
|
|
|
44
40
|
return Circle
|
|
45
41
|
}
|
|
46
42
|
// Exports Mongoose Model, Mongoose Schema, JSON schema (required locally for discriminators)
|
|
47
|
-
module.exports = { Model: model, Schema:
|
|
43
|
+
module.exports = { Model: model, Schema: CircleSchema, circleSchema: schema }
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
let mongoose = require('mongoose')
|
|
2
2
|
let StateEnum = require('@bluedot-innovation/enums').StateEnum
|
|
3
|
-
|
|
4
|
-
const Point = require('../../schemas/Point')
|
|
3
|
+
let Point = require('../schemas/Point')
|
|
5
4
|
let uuidv4 = require('uuid/v4')
|
|
6
5
|
|
|
7
6
|
const schema = {
|
|
@@ -14,31 +13,28 @@ const schema = {
|
|
|
14
13
|
lastUpdateTime: {type: Date, default: Date.now},
|
|
15
14
|
state: {type: String, default: StateEnum.active, select: false}
|
|
16
15
|
}
|
|
17
|
-
const
|
|
16
|
+
const PolygonSchema = new mongoose.Schema(
|
|
18
17
|
schema,
|
|
19
18
|
{
|
|
20
19
|
_id: false,
|
|
21
20
|
versionKey: false
|
|
22
21
|
})
|
|
23
22
|
|
|
24
|
-
|
|
23
|
+
PolygonSchema.add({
|
|
25
24
|
type:
|
|
26
25
|
{type: String, required: true}
|
|
27
26
|
})
|
|
28
27
|
|
|
29
|
-
polygonSchema.plugin(mongooseHidden)
|
|
30
|
-
|
|
31
|
-
|
|
32
28
|
// optional mongoose
|
|
33
29
|
let model = (mongooseInstance) => {
|
|
34
30
|
let Polygon
|
|
35
31
|
if (mongooseInstance) {
|
|
36
|
-
Polygon = mongooseInstance.model('Polygon',
|
|
32
|
+
Polygon = mongooseInstance.model('Polygon', PolygonSchema)
|
|
37
33
|
} else {
|
|
38
|
-
Polygon = mongoose.model('Polygon',
|
|
34
|
+
Polygon = mongoose.model('Polygon', PolygonSchema)
|
|
39
35
|
}
|
|
40
36
|
|
|
41
37
|
return Polygon
|
|
42
38
|
}
|
|
43
39
|
// Exports Mongoose Model, Mongoose Schema, JSON schema (required locally for discriminators)
|
|
44
|
-
module.exports = { Model: model, Schema:
|
|
40
|
+
module.exports = { Model: model, Schema: PolygonSchema, polygonSchema: schema }
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
let mongoose = require('mongoose')
|
|
2
2
|
let StateEnum = require('@bluedot-innovation/enums').StateEnum
|
|
3
|
-
|
|
3
|
+
let Point = require('../schemas/Point')
|
|
4
4
|
let uuidv4 = require('uuid/v4')
|
|
5
|
-
|
|
6
|
-
const mongooseHidden = require('../../utils/mongooseHidden')
|
|
5
|
+
let MultiLineStringGeometry = require('../schemas/MultiLineStringGeometry')
|
|
7
6
|
|
|
8
7
|
const schema = {
|
|
9
8
|
_id: {type: String, default: uuidv4},
|
|
@@ -15,29 +14,28 @@ const schema = {
|
|
|
15
14
|
state: {type: String, default: StateEnum.active, select: false}
|
|
16
15
|
}
|
|
17
16
|
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
const PolylineSchema = new mongoose.Schema(
|
|
18
|
+
schema,
|
|
19
|
+
{
|
|
20
|
+
_id: false,
|
|
21
|
+
versionKey: false
|
|
22
|
+
})
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
type: {type: String, required: true}
|
|
24
|
+
PolylineSchema.add({
|
|
25
|
+
type:
|
|
26
|
+
{type: String, required: true}
|
|
27
27
|
})
|
|
28
28
|
|
|
29
|
-
polylineSchema.plugin(mongooseHidden)
|
|
30
|
-
|
|
31
29
|
// optional mongoose
|
|
32
30
|
let model = (mongooseInstance) => {
|
|
33
31
|
let Polyline
|
|
34
32
|
if (mongooseInstance) {
|
|
35
|
-
Polyline = mongooseInstance.model('Polyline',
|
|
33
|
+
Polyline = mongooseInstance.model('Polyline', PolylineSchema)
|
|
36
34
|
} else {
|
|
37
|
-
Polyline = mongoose.model('Polyline',
|
|
35
|
+
Polyline = mongoose.model('Polyline', PolylineSchema)
|
|
38
36
|
}
|
|
39
37
|
|
|
40
38
|
return Polyline
|
|
41
39
|
}
|
|
42
40
|
// Exports Mongoose Model, Mongoose Schema, JSON schema (required locally for discriminators)
|
|
43
|
-
module.exports = { Model: model, Schema:
|
|
41
|
+
module.exports = { Model: model, Schema: PolylineSchema, polylineSchema: schema }
|
package/models/Project.js
CHANGED
|
@@ -9,7 +9,6 @@ let Schema = mongoose.Schema
|
|
|
9
9
|
let StateEnum = require('@bluedot-innovation/enums').StateEnum
|
|
10
10
|
let uuidv4 = require('uuid/v4')
|
|
11
11
|
let patcher = require('mongoose-json-patch')
|
|
12
|
-
const mongooseHidden = require('../utils/mongooseHidden')
|
|
13
12
|
let helpers = require('../helpers')
|
|
14
13
|
|
|
15
14
|
let WebhookSchema = require('../schemas/Webhook')
|
|
@@ -39,7 +38,6 @@ let ProjectSchema = new mongoose.Schema({
|
|
|
39
38
|
{collection: 'project'})
|
|
40
39
|
|
|
41
40
|
ProjectSchema.plugin(patcher)
|
|
42
|
-
ProjectSchema.plugin(mongooseHidden)
|
|
43
41
|
|
|
44
42
|
// optional mongoose
|
|
45
43
|
let model = (mongooseInstance) => {
|
package/models/User.js
CHANGED
|
@@ -9,7 +9,6 @@ const patcher = require('mongoose-json-patch')
|
|
|
9
9
|
const helpers = require('../helpers')
|
|
10
10
|
const ProjectPermission = require('../schemas/ProjectPermission')
|
|
11
11
|
const uuidv4 = require('uuid/v4')
|
|
12
|
-
const mongooseHidden = require('../utils/mongooseHidden')
|
|
13
12
|
|
|
14
13
|
let UserSchema = new mongoose.Schema({
|
|
15
14
|
_id: {type: String, default: uuidv4},
|
|
@@ -46,8 +45,6 @@ let UserSchema = new mongoose.Schema({
|
|
|
46
45
|
{collection: 'user'})
|
|
47
46
|
|
|
48
47
|
UserSchema.plugin(patcher)
|
|
49
|
-
UserSchema.plugin(mongooseHidden)
|
|
50
|
-
|
|
51
48
|
|
|
52
49
|
// optional mongoose
|
|
53
50
|
let model = (mongooseInstance) => {
|
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('./
|
|
13
|
-
let boundingBoxSchema = require('./
|
|
14
|
-
let polylineSchema = require('./
|
|
15
|
-
let polygonSchema = require('./
|
|
16
|
-
let beaconSchema = require('./
|
|
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
|
|
17
17
|
let speedFilterSchema = require('./SpeedFilter').speedFilterSchema
|
|
18
18
|
let bearingFilterSchema = require('./BearingFilter').bearingFilterSchema
|
|
19
19
|
let timeOfDayRangeFilterSchema = require('./TimeOfDayRangeFilter').timeOfDayRangeFilterSchema
|
|
@@ -22,7 +22,14 @@ let percentageCrossedFilterSchema = require('./PercentageCrossedFilter').percent
|
|
|
22
22
|
let uuidv4 = require('uuid/v4')
|
|
23
23
|
let patcher = require('mongoose-json-patch')
|
|
24
24
|
let helpers = require('../helpers')
|
|
25
|
-
|
|
25
|
+
|
|
26
|
+
const mongooseHidden = require('mongoose-hidden')({defaultHidden: {
|
|
27
|
+
_id: false,
|
|
28
|
+
state: true,
|
|
29
|
+
creationTime: true,
|
|
30
|
+
lastUpdateTime: true,
|
|
31
|
+
__v: true
|
|
32
|
+
}})
|
|
26
33
|
|
|
27
34
|
// ////// //
|
|
28
35
|
// Schema //
|
|
@@ -83,11 +90,11 @@ zoneSchema.path('filters').discriminator('percentageCrossed', new Schema(percent
|
|
|
83
90
|
zoneSchema.path('filters').discriminator('speed', new Schema(speedFilterSchema))
|
|
84
91
|
zoneSchema.path('filters').discriminator('timeOfDayRange', new Schema(timeOfDayRangeFilterSchema))
|
|
85
92
|
|
|
86
|
-
zoneSchema.path('geofeatures').discriminator('beacon', new Schema(beaconSchema)
|
|
87
|
-
zoneSchema.path('geofeatures').discriminator('
|
|
88
|
-
zoneSchema.path('geofeatures').discriminator('
|
|
89
|
-
zoneSchema.path('geofeatures').discriminator('
|
|
90
|
-
zoneSchema.path('geofeatures').discriminator('
|
|
93
|
+
zoneSchema.path('geofeatures').discriminator('beacon', new Schema(beaconSchema))
|
|
94
|
+
zoneSchema.path('geofeatures').discriminator('circle', new Schema(circleSchema))
|
|
95
|
+
zoneSchema.path('geofeatures').discriminator('polygon', new Schema(polygonSchema))
|
|
96
|
+
zoneSchema.path('geofeatures').discriminator('polyline', new Schema(polylineSchema))
|
|
97
|
+
zoneSchema.path('geofeatures').discriminator('boundingBox', new Schema(boundingBoxSchema))
|
|
91
98
|
|
|
92
99
|
// optional mongoose
|
|
93
100
|
const model = (mongooseInstance) => {
|
package/models/ZoneBeacon.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const cloneDeep = require('lodash.clonedeep')
|
|
2
2
|
const mongoose = require('mongoose')
|
|
3
|
-
const beaconSchema = require('./
|
|
3
|
+
const beaconSchema = require('./Beacon').beaconSchema
|
|
4
4
|
const BeaconEnum = require('@bluedot-innovation/enums').BeaconEnum
|
|
5
5
|
|
|
6
6
|
const schema = cloneDeep(beaconSchema)
|
|
@@ -11,17 +11,13 @@ schema.proximity = {
|
|
|
11
11
|
enum: [BeaconEnum.NEAR, BeaconEnum.FAR]
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
zoneBeaconSchema.add({
|
|
17
|
-
type: {type: String, required: true}
|
|
18
|
-
})
|
|
14
|
+
const ZoneBeaconSchema = new mongoose.Schema(schema)
|
|
19
15
|
|
|
20
16
|
// optional mongoose
|
|
21
|
-
let
|
|
17
|
+
let model = (mongooseInstance) => {
|
|
22
18
|
const instance = mongooseInstance || mongoose
|
|
23
|
-
return instance.model('ZoneBeacon',
|
|
19
|
+
return instance.model('ZoneBeacon', ZoneBeaconSchema)
|
|
24
20
|
}
|
|
25
21
|
|
|
26
22
|
// Exports Mongoose Model, Mongoose Schema, JSON schema (required locally for discriminators)
|
|
27
|
-
module.exports = { Model:
|
|
23
|
+
module.exports = { Model: model, Schema: ZoneBeaconSchema, beaconSchema: schema }
|
package/package.json
CHANGED