@tillhub/schemas 6.98.1 → 6.100.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,31 @@
1
+ ## [6.100.1](https://github.com/tillhub/schemas/compare/v6.100.0...v6.100.1) (2021-10-22)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **products:** Products search request schema added ([#639](https://github.com/tillhub/schemas/issues/639)) ([2f0eef0](https://github.com/tillhub/schemas/commit/2f0eef0))
7
+
8
+ # [6.100.0](https://github.com/tillhub/schemas/compare/v6.99.0...v6.100.0) (2021-10-20)
9
+
10
+
11
+ ### Features
12
+
13
+ * **products:** making `serial_number_input_required` optional ([#638](https://github.com/tillhub/schemas/issues/638)) ([2248cff](https://github.com/tillhub/schemas/commit/2248cff))
14
+
15
+ # [6.99.0](https://github.com/tillhub/schemas/compare/v6.98.2...v6.99.0) (2021-10-14)
16
+
17
+
18
+ ### Features
19
+
20
+ * **configurations:** gastro ([25a1bb4](https://github.com/tillhub/schemas/commit/25a1bb4))
21
+
22
+ ## [6.98.2](https://github.com/tillhub/schemas/compare/v6.98.1...v6.98.2) (2021-10-13)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * **favourites:** Allow null values for some fields on favourite creation ([#637](https://github.com/tillhub/schemas/issues/637)) ([5989cad](https://github.com/tillhub/schemas/commit/5989cad))
28
+
1
29
  ## [6.98.1](https://github.com/tillhub/schemas/compare/v6.98.0...v6.98.1) (2021-10-08)
2
30
 
3
31
 
@@ -1,3 +1,5 @@
1
+ const { oneOf } = require('../../helpers/payload-or-null')
2
+
1
3
  const item = {
2
4
  type: 'object',
3
5
  properties: {
@@ -81,20 +83,22 @@ const favourite = {
81
83
  default: []
82
84
  },
83
85
  registers: {
84
- type: 'array',
85
- items: {
86
- type: 'string',
87
- format: 'uuid'
88
- },
89
- default: []
86
+ ...oneOf([{
87
+ type: 'array',
88
+ items: {
89
+ type: 'string',
90
+ format: 'uuid'
91
+ }
92
+ }], { default: [] })
90
93
  },
91
94
  branches: {
92
- type: 'array',
93
- items: {
94
- type: 'string',
95
- format: 'uuid'
96
- },
97
- default: []
95
+ ...oneOf([{
96
+ type: 'array',
97
+ items: {
98
+ type: 'string',
99
+ format: 'uuid'
100
+ }
101
+ }], { default: [] })
98
102
  },
99
103
  name: {
100
104
  type: 'string'
@@ -18,6 +18,16 @@ module.exports = {
18
18
  type: 'boolean',
19
19
  default: true
20
20
  }),
21
+ open_orders_policy: oneOf({
22
+ type: 'string',
23
+ description: 'Defines behavior if there are open orders when conducting a balance.',
24
+ enum: [
25
+ 'ignore', // Don't block
26
+ 'warning', // Warning (and let the user decide if he still wants to go through)
27
+ 'block' // Do not allow conducting a balance
28
+ ],
29
+ default: 'ignore'
30
+ }),
21
31
  strict_submission: oneOf({
22
32
  type: 'object',
23
33
  additionalProperties: false,
@@ -763,11 +763,12 @@ const request = {
763
763
  }
764
764
  ]
765
765
  },
766
- serial_number_input_required: {
766
+ serial_number_input_required: oneOf({
767
767
  description: 'Define whether a product requires to enter a serial number during the sale',
768
- type: 'boolean',
768
+ type: 'boolean'
769
+ }, {
769
770
  default: false
770
- },
771
+ }),
771
772
  shipping_required: {
772
773
  description: 'Define whether this item requires shipping. This usually the case except for digital goods. Tax and tax splits may apply based on region.',
773
774
  default: true,
@@ -5,6 +5,10 @@ const priceBookBase = require('./prices/book').base
5
5
  const priceBookEntryBase = require('./prices/book/entry').base
6
6
  const commonResponse = require('../../common/response')
7
7
 
8
+ module.exports.search = {
9
+ request: require('./search')
10
+ }
11
+
8
12
  module.exports.create = {
9
13
  request: require('./create.request'),
10
14
  response: require('./create.response')
@@ -0,0 +1,72 @@
1
+ module.exports = {
2
+ type: 'object',
3
+ // additional properties are a little bit of a danger zone of not being validated by the upstream service
4
+ additionalProperties: true,
5
+ properties: {
6
+ q: {
7
+ type: 'string',
8
+ minLength: 3,
9
+ maxLength: 256
10
+ },
11
+ types: {
12
+ type: 'array',
13
+ items: {
14
+ type: 'string',
15
+ enum: ['composed_product', 'variant_product', 'linked_product', 'product', 'voucher', 'variant', 'linked']
16
+ }
17
+ },
18
+ branch: {
19
+ type: 'string',
20
+ format: 'uuid'
21
+ },
22
+ location: {
23
+ type: 'string',
24
+ format: 'uuid'
25
+ },
26
+ stockable: {
27
+ type: 'string',
28
+ enum: ['false', 'true']
29
+ },
30
+ sellable: {
31
+ type: 'string',
32
+ enum: ['false', 'true']
33
+ },
34
+ purchasable: {
35
+ type: 'string',
36
+ enum: ['false', 'true']
37
+ },
38
+ limit: {
39
+ type: 'number',
40
+ minimum: 1,
41
+ default: 100
42
+ },
43
+ offset: {
44
+ type: 'number',
45
+ minimum: 0,
46
+ default: 0
47
+ },
48
+ timeout: {
49
+ type: 'number',
50
+ maximum: 1500,
51
+ minimum: 300,
52
+ default: 1500
53
+ },
54
+ filter: {
55
+ oneOf: [
56
+ {
57
+ type: 'string',
58
+ enum: ['contains', 'starts_with', 'search']
59
+ },
60
+ {
61
+ type: 'array',
62
+ maxItems: 2,
63
+ minItems: 2,
64
+ items: {
65
+ type: 'string',
66
+ enum: ['contains', 'starts_with', 'search']
67
+ }
68
+ }
69
+ ]
70
+ }
71
+ }
72
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tillhub/schemas",
3
- "version": "6.98.1",
3
+ "version": "6.100.1",
4
4
  "private": false,
5
5
  "description": "All Tillhub API OpenAPI 3 compatible JSON Schemas.",
6
6
  "main": "./lib/index.js",