@bedrockio/model 0.7.4 → 0.7.6

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.
@@ -23,7 +23,7 @@ const DATE_TAGS = {
23
23
  'x-schema': 'DateTime',
24
24
  'x-description': 'A `string` in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.'
25
25
  };
26
- const OBJECT_ID_SCHEMA = exports.OBJECT_ID_SCHEMA = _yada.default.string().mongo().message('Must be an ObjectId.').tag({
26
+ const OBJECT_ID_SCHEMA = exports.OBJECT_ID_SCHEMA = _yada.default.string().mongo().message('{field} must be an id.').tag({
27
27
  'x-schema': 'ObjectId',
28
28
  'x-description': 'A 24 character hexadecimal string representing a Mongo [ObjectId](https://bit.ly/3YPtGlU).'
29
29
  });
@@ -33,7 +33,7 @@ const REFERENCE_SCHEMA = _yada.default.allow(OBJECT_ID_SCHEMA, _yada.default.obj
33
33
  stripUnknown: true
34
34
  }).custom(obj => {
35
35
  return obj.id;
36
- })).message('Must be an ObjectId or object containing "id" field.').tag({
36
+ })).message('{field} must be an id or object containing "id" field.').tag({
37
37
  'x-schema': 'Reference',
38
38
  'x-description': `
39
39
  A 24 character hexadecimal string representing a Mongo [ObjectId](https://bit.ly/3YPtGlU).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bedrockio/model",
3
- "version": "0.7.4",
3
+ "version": "0.7.6",
4
4
  "description": "Bedrock utilities for model creation.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -9,8 +9,7 @@
9
9
  "lint": "eslint",
10
10
  "build": "scripts/build",
11
11
  "eject": "scripts/eject.js",
12
- "prepublish": "yarn build && yarn types",
13
- "postpublish": "scripts/tag"
12
+ "prepublish": "yarn build && yarn types"
14
13
  },
15
14
  "main": "dist/cjs/index.js",
16
15
  "module": "src/index.js",
package/src/validation.js CHANGED
@@ -19,7 +19,7 @@ const DATE_TAGS = {
19
19
  export const OBJECT_ID_SCHEMA = yd
20
20
  .string()
21
21
  .mongo()
22
- .message('Must be an ObjectId.')
22
+ .message('{field} must be an id.')
23
23
  .tag({
24
24
  'x-schema': 'ObjectId',
25
25
  'x-description':
@@ -40,7 +40,7 @@ const REFERENCE_SCHEMA = yd
40
40
  return obj.id;
41
41
  })
42
42
  )
43
- .message('Must be an ObjectId or object containing "id" field.')
43
+ .message('{field} must be an id or object containing "id" field.')
44
44
  .tag({
45
45
  'x-schema': 'Reference',
46
46
  'x-description': `