@tillhub/schemas 6.100.0 → 6.101.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,31 @@
1
+ # [6.101.0](https://github.com/tillhub/schemas/compare/v6.100.3...v6.101.0) (2021-10-29)
2
+
3
+
4
+ ### Features
5
+
6
+ * **pricebooks:** add branch groups #API-1115 ([fac9fd0](https://github.com/tillhub/schemas/commit/fac9fd0)), closes [#API-1115](https://github.com/tillhub/schemas/issues/API-1115)
7
+
8
+ ## [6.100.3](https://github.com/tillhub/schemas/compare/v6.100.2...v6.100.3) (2021-10-22)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **products:** q is required property in products search request chema ([#641](https://github.com/tillhub/schemas/issues/641)) ([ceb3019](https://github.com/tillhub/schemas/commit/ceb3019))
14
+
15
+ ## [6.100.2](https://github.com/tillhub/schemas/compare/v6.100.1...v6.100.2) (2021-10-22)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * **products:** Products search schema fixed ([#640](https://github.com/tillhub/schemas/issues/640)) ([24377f9](https://github.com/tillhub/schemas/commit/24377f9))
21
+
22
+ ## [6.100.1](https://github.com/tillhub/schemas/compare/v6.100.0...v6.100.1) (2021-10-22)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * **products:** Products search request schema added ([#639](https://github.com/tillhub/schemas/issues/639)) ([2f0eef0](https://github.com/tillhub/schemas/commit/2f0eef0))
28
+
1
29
  # [6.100.0](https://github.com/tillhub/schemas/compare/v6.99.0...v6.100.0) (2021-10-20)
2
30
 
3
31
 
@@ -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')
@@ -23,6 +23,14 @@ module.exports = {
23
23
  format: 'uuid'
24
24
  }
25
25
  }),
26
+ branch_groups: oneOf({
27
+ description: 'If defined then only these branch groups (plus specified locations if any) will be using this price book',
28
+ type: 'array',
29
+ items: {
30
+ type: 'string',
31
+ format: 'uuid'
32
+ }
33
+ }),
26
34
  active: {
27
35
  type: 'boolean'
28
36
  },
@@ -0,0 +1,77 @@
1
+ module.exports = {
2
+ $id: 'https://schemas.tillhub.com/v1/products.search.request.schema.json',
3
+ $schema: 'http://json-schema.org/draft-07/schema#',
4
+ type: 'object',
5
+ // additional properties are a little bit of a danger zone of not being validated by the upstream service
6
+ additionalProperties: true,
7
+ required: [
8
+ 'q'
9
+ ],
10
+ properties: {
11
+ q: {
12
+ type: 'string',
13
+ minLength: 3,
14
+ maxLength: 256
15
+ },
16
+ types: {
17
+ type: 'array',
18
+ items: {
19
+ type: 'string',
20
+ enum: ['composed_product', 'variant_product', 'linked_product', 'product', 'voucher', 'variant', 'linked']
21
+ }
22
+ },
23
+ branch: {
24
+ type: 'string',
25
+ format: 'uuid'
26
+ },
27
+ location: {
28
+ type: 'string',
29
+ format: 'uuid'
30
+ },
31
+ stockable: {
32
+ type: 'string',
33
+ enum: ['false', 'true']
34
+ },
35
+ sellable: {
36
+ type: 'string',
37
+ enum: ['false', 'true']
38
+ },
39
+ purchasable: {
40
+ type: 'string',
41
+ enum: ['false', 'true']
42
+ },
43
+ limit: {
44
+ type: 'number',
45
+ minimum: 1,
46
+ default: 100
47
+ },
48
+ offset: {
49
+ type: 'number',
50
+ minimum: 0,
51
+ default: 0
52
+ },
53
+ timeout: {
54
+ type: 'number',
55
+ maximum: 1500,
56
+ minimum: 300,
57
+ default: 1500
58
+ },
59
+ filter: {
60
+ oneOf: [
61
+ {
62
+ type: 'string',
63
+ enum: ['contains', 'starts_with', 'search']
64
+ },
65
+ {
66
+ type: 'array',
67
+ maxItems: 2,
68
+ minItems: 2,
69
+ items: {
70
+ type: 'string',
71
+ enum: ['contains', 'starts_with', 'search']
72
+ }
73
+ }
74
+ ]
75
+ }
76
+ }
77
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tillhub/schemas",
3
- "version": "6.100.0",
3
+ "version": "6.101.0",
4
4
  "private": false,
5
5
  "description": "All Tillhub API OpenAPI 3 compatible JSON Schemas.",
6
6
  "main": "./lib/index.js",