@tillhub/schemas 6.117.0 → 6.119.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,33 @@
1
+ # [6.119.0](https://github.com/tillhub/schemas/compare/v6.118.1...v6.119.0) (2022-02-15)
2
+
3
+
4
+ ### Features
5
+
6
+ * **audits:** add audit logs response schema #API-1331 ([#668](https://github.com/tillhub/schemas/issues/668)) ([057c73e](https://github.com/tillhub/schemas/commit/057c73e)), closes [#API-1331](https://github.com/tillhub/schemas/issues/API-1331) [#API-1331](https://github.com/tillhub/schemas/issues/API-1331)
7
+
8
+ ## [6.118.1](https://github.com/tillhub/schemas/compare/v6.118.0...v6.118.1) (2022-02-14)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **docs:** fixing the children type on category_trees ([141dc8e](https://github.com/tillhub/schemas/commit/141dc8e))
14
+
15
+ # [6.118.0](https://github.com/tillhub/schemas/compare/v6.117.1...v6.118.0) (2022-02-10)
16
+
17
+
18
+ ### Features
19
+
20
+ * **configurations:** features ([d9ad71d](https://github.com/tillhub/schemas/commit/d9ad71d))
21
+ * **configurations:** gastro ([d977675](https://github.com/tillhub/schemas/commit/d977675))
22
+ * **configurations:** gastro ([71126be](https://github.com/tillhub/schemas/commit/71126be))
23
+
24
+ ## [6.117.1](https://github.com/tillhub/schemas/compare/v6.117.0...v6.117.1) (2022-02-09)
25
+
26
+
27
+ ### Bug Fixes
28
+
29
+ * **documentation:** fixing the circular dependency issue ([b1916ec](https://github.com/tillhub/schemas/commit/b1916ec))
30
+
1
31
  # [6.117.0](https://github.com/tillhub/schemas/compare/v6.116.0...v6.117.0) (2022-02-08)
2
32
 
3
33
 
@@ -84,7 +84,7 @@ function commonResponse ({ resultItems, results, additionals } = {}, { hasCursor
84
84
  }
85
85
  }
86
86
 
87
- if (hasCursor) response.cursor = cursor
87
+ if (hasCursor) response.properties.cursor = cursor
88
88
 
89
89
  return response
90
90
  }
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ logs: require('./logs')
3
+ }
@@ -0,0 +1,81 @@
1
+ const { oneOf } = require('../../../helpers/payload-or-null')
2
+
3
+ const changeEntry = {
4
+ type: 'object',
5
+ additionalProperties: false,
6
+ properties: {
7
+ op: {
8
+ description: 'Operation type',
9
+ type: 'string',
10
+ enum: [
11
+ 'add',
12
+ 'replace',
13
+ 'remove'
14
+ ]
15
+ },
16
+ path: {
17
+ description: 'Changed property path (with dot as separator)',
18
+ type: 'string',
19
+ example: 'images.0.url'
20
+ },
21
+ value: {
22
+ description: 'Changed value',
23
+ type: 'string',
24
+ example: 'This is it'
25
+ }
26
+ }
27
+ }
28
+
29
+ module.exports = {
30
+ type: {
31
+ description: 'Log type (entity type and action type)',
32
+ type: 'string',
33
+ example: 'product.update'
34
+ },
35
+ old: oneOf({
36
+ description: 'Old data',
37
+ type: 'object',
38
+ example: {}
39
+ }),
40
+ new: oneOf({
41
+ description: 'New data',
42
+ type: 'object',
43
+ example: {
44
+ id: '0f91b67b-b1eb-4aba-827a-3a83ff967c5e',
45
+ name: 'Foo bar'
46
+ }
47
+ }),
48
+ change: oneOf({
49
+ description: 'Changes between old and new',
50
+ type: 'array',
51
+ items: changeEntry
52
+ }),
53
+ description: oneOf({
54
+ description: 'Description',
55
+ type: 'string',
56
+ example: 'Login attempt from service account'
57
+ }),
58
+ issuer: oneOf({
59
+ description: 'Issuer data',
60
+ type: 'object',
61
+ properties: {
62
+ sub_user: {
63
+ description: 'Sub-user (person authorized under organization account) UUID',
64
+ type: 'string',
65
+ format: 'uuid',
66
+ example: '8ddb94bf-98cf-4832-9833-c118ebf04675'
67
+ }
68
+ }
69
+ }),
70
+ metadata: oneOf({
71
+ description: 'Metadata',
72
+ type: 'object',
73
+ properties: {
74
+ user_agent: {
75
+ description: 'User-agent data',
76
+ type: 'string',
77
+ example: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36'
78
+ }
79
+ }
80
+ })
81
+ }
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ read: require('./read')
3
+ }
@@ -0,0 +1,30 @@
1
+ const commonBase = { ...require('../../../common/base') }
2
+ const commonResponse = require('../../../common/response')
3
+ const { oneOf } = require('../../../helpers/payload-or-null')
4
+
5
+ const base = require('./base')
6
+
7
+ // Logs are read-only
8
+ delete commonBase.updated_at
9
+
10
+ module.exports.response = {
11
+ $id: 'https://schemas.tillhub.com/v0/audits.logs.read.response.schema.json',
12
+ $schema: 'http://json-schema.org/draft-07/schema#',
13
+ additionalProperties: false,
14
+ ...commonResponse({
15
+ resultItems: {
16
+ type: 'object',
17
+ required: ['id', 'created_at', 'insert_id', 'type'],
18
+ additionalProperties: false,
19
+ properties: {
20
+ ...commonBase,
21
+ insert_id: oneOf({
22
+ description: 'Sequential counter',
23
+ type: 'integer',
24
+ example: 16259
25
+ }),
26
+ ...base
27
+ }
28
+ }
29
+ }, { hasCursor: true })
30
+ }
@@ -10,7 +10,7 @@ module.exports.children = {
10
10
  format: 'uuid'
11
11
  },
12
12
  children: {
13
- '$ref': '#/definitions/children'
13
+ type: 'array'
14
14
  }
15
15
  }
16
16
  }
package/lib/v0/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ module.exports.audits = require('./audits')
1
2
  module.exports.products = require('./products')
2
3
  module.exports.product_groups = require('./product_groups')
3
4
  module.exports.product_templates = require('./product_templates')
@@ -119,6 +119,18 @@ module.exports = oneOf({
119
119
  example: 'Regiondo',
120
120
  minLength: 2,
121
121
  maxLength: 24
122
+ },
123
+ log_level: {
124
+ description: 'defines the granularity of the web api logging.',
125
+ type: 'string',
126
+ enum: [
127
+ 'error',
128
+ 'warning',
129
+ 'info',
130
+ 'debug',
131
+ 'verbose' // request/response bodies
132
+ ],
133
+ default: 'info'
122
134
  }
123
135
  }
124
136
  })
@@ -46,6 +46,18 @@ module.exports = {
46
46
  minimum: 0,
47
47
  maximum: 3600,
48
48
  default: 25
49
+ },
50
+ log_level: {
51
+ description: 'defines the granularity of the local server logging.',
52
+ type: 'string',
53
+ enum: [
54
+ 'error',
55
+ 'warning',
56
+ 'info', // basic server info
57
+ 'debug', // basic request/response info
58
+ 'verbose' // request/response bodies
59
+ ],
60
+ default: 'info'
49
61
  }
50
62
  }
51
63
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tillhub/schemas",
3
- "version": "6.117.0",
3
+ "version": "6.119.0",
4
4
  "private": false,
5
5
  "description": "All Tillhub API OpenAPI 3 compatible JSON Schemas.",
6
6
  "main": "./lib/index.js",
@@ -0,0 +1,11 @@
1
+ const test = require('tape')
2
+ const validate = require('../../helpers/validate-schema')
3
+
4
+ test('Audits:logs: read.response schema validation', function (t) {
5
+ t.plan(2)
6
+ const readResponse = require('../../../lib/v0/audits/logs').read.response
7
+ const { valid, error } = validate(readResponse)
8
+ t.ok(valid, 'create schema is valid')
9
+ t.error(error, 'should not get any error')
10
+ t.end()
11
+ })