@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 +30 -0
- package/lib/common/response.js +1 -1
- package/lib/v0/audits/index.js +3 -0
- package/lib/v0/audits/logs/base.js +81 -0
- package/lib/v0/audits/logs/index.js +3 -0
- package/lib/v0/audits/logs/read.js +30 -0
- package/lib/v0/category_trees/definitions.js +1 -1
- package/lib/v0/index.js +1 -0
- package/lib/v1/configurations/items/features.js +12 -0
- package/lib/v1/configurations/items/gastro.js +12 -0
- package/package.json +1 -1
- package/test/audits/logs/logs.spec.js +11 -0
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
|
|
package/lib/common/response.js
CHANGED
|
@@ -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,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
|
+
}
|
package/lib/v0/index.js
CHANGED
|
@@ -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
|
@@ -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
|
+
})
|