@bluedot-innovation/models 2.0.12 → 2.0.13

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,12 @@
1
+ ## 2.0.13
2
+ - Republish to bring changes from 2.0.11
3
+
1
4
  ## 2.0.12
2
5
  - Update bearingFilter to allow wrap around angles (e.g. 315deg & 45deg)
3
6
 
7
+ ## 2.0.11
8
+ - Added uuid as `_id` for user
9
+
4
10
  ## 2.0.10
5
11
  - Added indexes on beacons model
6
12
  - Added `apiKey` to project model (for backwards compatibility)
@@ -31,7 +31,7 @@ function validateDateRange (endDate, magicCallback) {
31
31
  if (endDate && endDate < (new Date())) {
32
32
  return magicCallback(false, `endDate cannot be less than current date.`)
33
33
  } else if (startDate && endDate && endDate < startDate) {
34
- return magicCallback(false, `startDate has to be less than endDate. `)
34
+ return magicCallback(false, `startDate has to be less than endDate.`)
35
35
  }
36
36
  magicCallback(true)
37
37
  }
package/models/User.js CHANGED
@@ -8,8 +8,10 @@ const mongoose = require('mongoose')
8
8
  const patcher = require('mongoose-json-patch')
9
9
  const helpers = require('../helpers')
10
10
  const ProjectPermission = require('../schemas/ProjectPermission')
11
+ const uuidv4 = require('uuid/v4')
11
12
 
12
13
  let UserSchema = new mongoose.Schema({
14
+ _id: {type: String, default: uuidv4},
13
15
  username: {
14
16
  type: String,
15
17
  required: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bluedot-innovation/models",
3
- "version": "2.0.12",
3
+ "version": "2.0.13",
4
4
  "description": "",
5
5
  "main": "Models.js",
6
6
  "scripts": {