@bluedot-innovation/models 2.0.12-alpha.2 → 2.0.13-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 +6 -0
- package/__tests__/user/user.rules.js +1 -1
- package/models/User.js +2 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
## 2.0.13
|
|
2
|
+
- Remove `password` from user model
|
|
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)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
requiredFields: ['username', '
|
|
2
|
+
requiredFields: ['username', 'firstName', 'lastName', 'isAdmin', 'accountId'],
|
|
3
3
|
customValidators: [
|
|
4
4
|
{name: 'phoneNumber', invalidInputs: ['409203492039284232034398']},
|
|
5
5
|
{name: 'creationTime', invalidInputs: ['21/07/2017', 'thursday']},
|
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,
|
|
@@ -24,7 +26,6 @@ let UserSchema = new mongoose.Schema({
|
|
|
24
26
|
message: '{VALUE} is not a valid email'
|
|
25
27
|
}
|
|
26
28
|
},
|
|
27
|
-
password: {type: String, required: true},
|
|
28
29
|
firstName: {type: String, required: true},
|
|
29
30
|
lastName: {type: String, required: true},
|
|
30
31
|
phoneNumber: {type: String, maxlength: 20},
|