@bluedot-innovation/models 3.0.5 → 3.0.6-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 CHANGED
@@ -1,3 +1,6 @@
1
+ ## 3.0.6
2
+ - Require `_id`'s instead of defaulting them
3
+
1
4
  ## 3.0.5
2
5
  - `User` - Remove password field
3
6
 
package/models/Beacon.js CHANGED
@@ -4,9 +4,14 @@ let Point = require('../schemas/Point')
4
4
  let PointGeometry = require('../schemas/PointGeometry')
5
5
  let uuidv4 = require('uuid/v4')
6
6
  let patcher = require('mongoose-json-patch')
7
+ let helpers = require('../helpers')
7
8
 
8
9
  let schema = {
9
- _id: {type: String, default: uuidv4},
10
+ _id: {
11
+ type: String,
12
+ required: true,
13
+ validator: helpers.validateUUIDv4
14
+ },
10
15
  name: {type: String, required: [true, 'name is required.']},
11
16
  description: {type: String, default: ''},
12
17
  creationTime: {type: Date, default: Date.now},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bluedot-innovation/models",
3
- "version": "3.0.5",
3
+ "version": "3.0.6-alpha.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",