@tillhub/schemas 6.127.0 → 6.128.0

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,10 @@
1
+ # [6.128.0](https://github.com/tillhub/schemas/compare/v6.127.0...v6.128.0) (2022-03-18)
2
+
3
+
4
+ ### Features
5
+
6
+ * **branches:** add receipt_footer_image to branches model ([#682](https://github.com/tillhub/schemas/issues/682)) ([132523f](https://github.com/tillhub/schemas/commit/132523f))
7
+
1
8
  # [6.127.0](https://github.com/tillhub/schemas/compare/v6.126.0...v6.127.0) (2022-03-15)
2
9
 
3
10
 
@@ -1,3 +1,5 @@
1
+ const { anyOf } = require('../helpers/payload-or-null')
2
+
1
3
  const definedSizes = {
2
4
  '1x': {
3
5
  description: 'Image transformed to predefined small size',
@@ -31,7 +33,11 @@ const definedSizes = {
31
33
  }
32
34
  }
33
35
 
34
- function getImages (sizes = ['1x', '2x', '3x', 'avatar'], strict = false) {
36
+ const getImages = ({
37
+ sizes = ['1x', '2x', '3x', 'avatar'],
38
+ strict = false,
39
+ description = 'Images object with URLs of various types of images'
40
+ }) => {
35
41
  const sizesMap = sizes.reduce((memo, size) => {
36
42
  if (!definedSizes[size]) {
37
43
  throw new ReferenceError(`Size '${size}' is not defined`)
@@ -42,8 +48,8 @@ function getImages (sizes = ['1x', '2x', '3x', 'avatar'], strict = false) {
42
48
  }, {})
43
49
 
44
50
  return {
45
- description: 'Images object with URLs of various types of images',
46
- anyOf: [{
51
+ description,
52
+ ...anyOf({
47
53
  type: 'object',
48
54
  additionalProperties: !strict,
49
55
  properties: {
@@ -54,9 +60,8 @@ function getImages (sizes = ['1x', '2x', '3x', 'avatar'], strict = false) {
54
60
  type: 'string',
55
61
  format: 'uri'
56
62
  }
57
- } }, {
58
- type: 'null'
59
- }]
63
+ }
64
+ })
60
65
  }
61
66
  }
62
67
 
@@ -124,7 +124,12 @@ module.exports = {
124
124
  }
125
125
  ]
126
126
  },
127
- images: getImages(),
127
+ images: getImages({
128
+ description: 'A Tillhub image object with URLs to display images this for this branch.'
129
+ }),
130
+ receipt_footer_images: getImages({
131
+ description: 'A Tillhub image object with URLs to display receipt footer image this for this branch.'
132
+ }),
128
133
  image: {
129
134
  description: 'DEPRECATED. Omit or set null.',
130
135
  anyOf: [
@@ -154,7 +154,7 @@ module.exports = {
154
154
  format: 'date-time'
155
155
  })
156
156
  },
157
- images: getImages(['1x', '2x', '3x', 'avatar', 'gallery']),
157
+ images: getImages({ sizes: ['1x', '2x', '3x', 'avatar', 'gallery'] }),
158
158
  image: {
159
159
  description: 'DEPRECATED. Omit or set null.',
160
160
  ...anyOf({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tillhub/schemas",
3
- "version": "6.127.0",
3
+ "version": "6.128.0",
4
4
  "private": false,
5
5
  "description": "All Tillhub API OpenAPI 3 compatible JSON Schemas.",
6
6
  "main": "./lib/index.js",