@tillhub/schemas 6.445.0 → 6.447.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/README.md CHANGED
@@ -63,5 +63,5 @@ Feel free to edit any files you need and don't forget to add the custom properti
63
63
 
64
64
  ## License
65
65
 
66
- Apache-2.0
66
+ Apache-2.0
67
67
 
@@ -1,27 +1,34 @@
1
1
  const contact = {
2
2
  type: 'object',
3
- additionalProperties: false,
3
+ additionalProperties: true,
4
4
  required: [
5
5
  'roles',
6
- 'mmsId',
7
6
  'email'
8
7
  ],
9
8
  properties: {
10
9
  roles: {
11
10
  type: 'array',
12
- minItems: 1,
13
11
  items: {
14
12
  type: 'string',
15
13
  minLength: 1
16
14
  }
17
15
  },
18
16
  mmsId: {
19
- type: 'string',
20
- minLength: 1
17
+ type: ['null', 'string']
21
18
  },
22
19
  email: {
23
20
  type: 'string',
24
21
  format: 'email'
22
+ },
23
+ firstName: {
24
+ type: ['null', 'string']
25
+ },
26
+ lastName: {
27
+ type: ['null', 'string']
28
+ },
29
+ attributes: {
30
+ type: ['null', 'object'],
31
+ additionalProperties: true
25
32
  }
26
33
  }
27
34
  }
@@ -31,16 +38,22 @@ const connection = {
31
38
  additionalProperties: true,
32
39
  required: [
33
40
  'unzerId',
34
- 'contacts'
41
+ 'mmsId'
35
42
  ],
36
43
  properties: {
37
44
  unzerId: {
38
45
  type: 'string',
39
46
  minLength: 1
40
47
  },
48
+ mmsId: {
49
+ type: 'string',
50
+ minLength: 1
51
+ },
52
+ description: {
53
+ type: ['null', 'string']
54
+ },
41
55
  contacts: {
42
56
  type: 'array',
43
- minItems: 1,
44
57
  items: contact
45
58
  }
46
59
  }
@@ -50,14 +63,14 @@ module.exports = {
50
63
  $id: 'https://schemas.tillhub.com/v0/client_accounts.connections.schema.json',
51
64
  $schema: 'http://json-schema.org/draft-07/schema#',
52
65
  type: 'object',
53
- additionalProperties: false,
66
+ additionalProperties: true,
54
67
  required: [
55
68
  'connections'
56
69
  ],
57
70
  properties: {
58
71
  connections: {
59
72
  type: 'object',
60
- additionalProperties: false,
73
+ additionalProperties: true,
61
74
  required: [
62
75
  'hasAccessTo',
63
76
  'accessibleBy'
@@ -0,0 +1,58 @@
1
+ module.exports.request = {
2
+ $id: 'https://schemas.tillhub.com/v0/staff.export.request.schema.json',
3
+ $schema: 'http://json-schema.org/draft-07/schema#',
4
+ type: 'object',
5
+ additionalProperties: true,
6
+ required: ['format', 'documentType', 'email'],
7
+ properties: {
8
+ start: { type: 'string', format: 'date-time' },
9
+ active: { type: 'string', enum: ['true', 'false'] },
10
+ deleted: { type: 'string', enum: ['true', 'false'] },
11
+ firstname: { type: 'string' },
12
+ lastname: { type: 'string' },
13
+ email: { type: 'string' },
14
+ phonenumbers: { type: 'string' },
15
+ staff_number: { type: 'string' },
16
+ staff_groups: { type: 'string', format: 'uuid' },
17
+ branch_group: {
18
+ anyOf: [
19
+ { type: 'string', minLength: 1, maxLength: 64 },
20
+ { type: 'array', items: { type: 'string', minLength: 1, maxLength: 64 } }
21
+ ]
22
+ },
23
+ user: { type: 'string', format: 'uuid' },
24
+ is_user: { type: 'string', enum: ['true', 'false'] },
25
+ default: { type: 'string', enum: ['true', 'false'] },
26
+ q: { type: 'string' },
27
+ location: {
28
+ anyOf: [{ type: 'string' }, { type: 'array', items: { type: 'string' } }]
29
+ },
30
+ branch: {
31
+ anyOf: [{ type: 'string' }, { type: 'array', items: { type: 'string' } }]
32
+ },
33
+ location_ids: {
34
+ anyOf: [{ type: 'string' }, { type: 'array', items: { type: 'string' } }]
35
+ },
36
+ service_ids: {
37
+ anyOf: [{ type: 'string' }, { type: 'array', items: { type: 'string' } }]
38
+ },
39
+ filename_prefix: { type: 'string' },
40
+ timezone: { type: 'string' },
41
+ limit: { type: 'string', maxLength: 10 },
42
+ offset: { type: 'string', maxLength: 10 },
43
+ page: { type: 'string', maxLength: 10 },
44
+ size: { type: 'string', maxLength: 10 },
45
+ pageSize: { type: 'string', maxLength: 10 },
46
+ cursor_field: { type: 'string', enum: ['created_at', 'updated_at', '+created_at', '+updated_at', '-created_at', '-updated_at'] },
47
+ format: { type: 'string', enum: ['csv', 'xls'] },
48
+ delimiter: { type: 'string', enum: ['comma', 'semicolon'] },
49
+ enclosure: { type: 'string', enum: ['single', 'double'] },
50
+ show_column_name: { type: 'string', enum: ['true', 'false'] },
51
+ column_selection: { type: 'array', items: { type: 'string' } },
52
+ documentType: { type: 'string', enum: ['StaffMembersExport'] },
53
+ lang: { type: 'string' },
54
+ scheduled_id: { type: 'string', minLength: 1, maxLength: 64 },
55
+ existingId: { type: 'string', format: 'uuid' },
56
+ correlationId: { type: 'string', format: 'uuid' }
57
+ }
58
+ }
@@ -1,2 +1,3 @@
1
1
  module.exports.create = require('./create')
2
2
  module.exports.update = require('./update')
3
+ module.exports.export = require('./export')
@@ -167,6 +167,14 @@ module.exports = {
167
167
  description: 'Payback customer number, transaction apollo payback bridge service can call the apollo payback backend.'
168
168
  })
169
169
  },
170
+ integration_partner_id: {
171
+ ...oneOf({
172
+ type: 'string',
173
+ format: 'uuid',
174
+ example: '59423b03-eb63-48c2-b427-9134e5e1bf0f',
175
+ description: 'Partner integration ID for remote ordering.'
176
+ })
177
+ },
170
178
  metadata: {
171
179
  ...oneOf({
172
180
  // most probably very incomplete - please check the code in the API
@@ -75,7 +75,15 @@ module.exports = {
75
75
  'terminal_gift_card', // e.g. Adyen Gift Card
76
76
  'buy_now_pay_later', // Unzer: Buy-Now-Pay-Later
77
77
  'unzer_installment', // Unzer: TH LinkPay installments
78
- 'unzer_invoice' // Unzer: TH LinkPay invoice
78
+ 'unzer_invoice', // Unzer: TH LinkPay invoice
79
+ 'applepay',
80
+ 'googlepay',
81
+ 'paypal',
82
+ 'ideal',
83
+ 'wechatpay',
84
+ 'alipay',
85
+ 'twint',
86
+ 'trustly'
79
87
  ],
80
88
  description: 'Payment option type'
81
89
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tillhub/schemas",
3
- "version": "6.445.0",
3
+ "version": "6.447.0",
4
4
  "private": false,
5
5
  "description": "All Tillhub API OpenAPI 3 compatible JSON Schemas.",
6
6
  "main": "./lib/index.js",
@@ -14,8 +14,6 @@
14
14
  "semantic-release": "semantic-release",
15
15
  "precommit": "npm run lint && git add -A",
16
16
  "commit": "npm run precommit && git-cz",
17
- "preversion": "npm run lint && npm test && git add -A .",
18
- "postversion": "TAG=$(echo $(git describe --tags $(git rev-list --tags --max-count=1))) && git tag -a $TAG $TAG -f -m \"$(git log `git describe --tags --abbrev=0 HEAD^`..HEAD --oneline)\" && git push && git push --tags && npm run clean",
19
17
  "clean": "rm -rf coverage coverage.lcov .nyc_output",
20
18
  "deploy:static": "firebase deploy --only=hosting",
21
19
  "compile": "node compile",
@@ -61,9 +59,9 @@
61
59
  "@types/node": "^10.17.28",
62
60
  "chalk": "^2.4.1",
63
61
  "codecov": "^3.7.2",
64
- "commitizen": "^2.10.1",
65
- "conventional-changelog-cli": "^2.1.0",
66
- "cz-conventional-changelog": "^2.1.0",
62
+ "commitizen": "^4.2.4",
63
+ "conventional-changelog-cli": "^5.0.0",
64
+ "cz-conventional-changelog": "^3.3.0",
67
65
  "dotenv": "^6.0.0",
68
66
  "eslint": "^5.4.0",
69
67
  "eslint-config-standard": "^12.0.0",
@@ -72,15 +70,15 @@
72
70
  "eslint-plugin-promise": "^4.0.1",
73
71
  "eslint-plugin-react": "^7.12.4",
74
72
  "eslint-plugin-standard": "^4.0.0",
75
- "firebase-tools": "^11.30.0",
73
+ "firebase-tools": "^15.21.0",
76
74
  "gh-pages": "^1.2.0",
77
75
  "glob": "^7.1.2",
78
76
  "jsdoc": "^3.6.5",
79
- "jsdoc-to-markdown": "^4.0.1",
77
+ "jsdoc-to-markdown": "^9.1.3",
80
78
  "nodemon": "^1.18.3",
81
79
  "nyc": "^12.0.2",
82
80
  "proxyquire": "^2.1.0",
83
- "semantic-release": "^15.9.9",
81
+ "semantic-release": "^25.0.5",
84
82
  "sinon": "^6.1.5",
85
83
  "tap-spec": "^5.0.0",
86
84
  "tape": "^4.9.1",
@@ -90,7 +88,7 @@
90
88
  "dependencies": {
91
89
  "ajv": "^6.12.4",
92
90
  "common-tags": "^1.8.0",
93
- "hygen": "^4.0.9",
91
+ "hygen": "^6.2.11",
94
92
  "just-pick": "^2.1.0"
95
93
  },
96
94
  "config": {
@@ -0,0 +1,55 @@
1
+ const test = require('tape')
2
+ const Ajv = require('ajv')
3
+ const createRequest = require('../../lib/v1/transactions/legacy/payments/create.request')
4
+ const paymentBase = require('../../lib/v1/transactions/legacy/payments/base')
5
+
6
+ const ajv = new Ajv()
7
+ const validatePayment = ajv.compile(createRequest)
8
+
9
+ const onlinePaymentTypes = [
10
+ 'applepay',
11
+ 'googlepay',
12
+ 'paypal',
13
+ 'ideal',
14
+ 'wechatpay',
15
+ 'alipay',
16
+ 'twint',
17
+ 'trustly'
18
+ ]
19
+
20
+ test('Transactions: v1: legacy: payment accepts all payment_option_type_name enum values', function (t) {
21
+ const types = paymentBase.payment_option_type_name.oneOf[0].enum
22
+ t.plan(types.length)
23
+
24
+ types.forEach((type) => {
25
+ const valid = validatePayment({ payment_option_type_name: type })
26
+ t.ok(valid, `should accept payment_option_type_name "${type}"`)
27
+ })
28
+
29
+ t.end()
30
+ })
31
+
32
+ test('Transactions: v1: legacy: payment accepts online payment_option_type_name values', function (t) {
33
+ t.plan(onlinePaymentTypes.length)
34
+
35
+ onlinePaymentTypes.forEach((type) => {
36
+ const valid = validatePayment({ payment_option_type_name: type })
37
+ t.ok(valid, `should accept online payment_option_type_name "${type}"`)
38
+ })
39
+
40
+ t.end()
41
+ })
42
+
43
+ test('Transactions: v1: legacy: payment accepts _type custom for online payments', function (t) {
44
+ t.plan(1)
45
+ const valid = validatePayment({ payment_option_type_name: 'paypal', _type: 'custom' })
46
+ t.ok(valid, 'should accept _type "custom" alongside an online payment_option_type_name')
47
+ t.end()
48
+ })
49
+
50
+ test('Transactions: v1: legacy: payment rejects unknown payment_option_type_name', function (t) {
51
+ t.plan(1)
52
+ const valid = validatePayment({ payment_option_type_name: 'bitcoin' })
53
+ t.notOk(valid, 'should reject unknown payment_option_type_name')
54
+ t.end()
55
+ })