@tillhub/schemas 6.100.0 → 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,10 @@
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
+
1
8
  # [6.100.0](https://github.com/tillhub/schemas/compare/v6.99.0...v6.100.0) (2021-10-20)
2
9
 
3
10
 
@@ -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.100.0",
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",