@tillhub/schemas 6.443.0 → 6.445.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,17 @@
1
+ # [6.445.0](https://github.com/tillhub/schemas/compare/v6.444.0...v6.445.0) (2026-06-15)
2
+
3
+
4
+ ### Features
5
+
6
+ * adds online payment options; creates test suite for payment options ([3e6f4ca](https://github.com/tillhub/schemas/commit/3e6f4ca))
7
+
8
+ # [6.444.0](https://github.com/tillhub/schemas/compare/v6.443.0...v6.444.0) (2026-06-12)
9
+
10
+
11
+ ### Features
12
+
13
+ * **mms-hierarchy:** schema for conections ([#1166](https://github.com/tillhub/schemas/issues/1166)) ([d48ad8d](https://github.com/tillhub/schemas/commit/d48ad8d))
14
+
1
15
  # [6.443.0](https://github.com/tillhub/schemas/compare/v6.442.0...v6.443.0) (2026-06-12)
2
16
 
3
17
 
@@ -0,0 +1,77 @@
1
+ const contact = {
2
+ type: 'object',
3
+ additionalProperties: false,
4
+ required: [
5
+ 'roles',
6
+ 'mmsId',
7
+ 'email'
8
+ ],
9
+ properties: {
10
+ roles: {
11
+ type: 'array',
12
+ minItems: 1,
13
+ items: {
14
+ type: 'string',
15
+ minLength: 1
16
+ }
17
+ },
18
+ mmsId: {
19
+ type: 'string',
20
+ minLength: 1
21
+ },
22
+ email: {
23
+ type: 'string',
24
+ format: 'email'
25
+ }
26
+ }
27
+ }
28
+
29
+ const connection = {
30
+ type: 'object',
31
+ additionalProperties: true,
32
+ required: [
33
+ 'unzerId',
34
+ 'contacts'
35
+ ],
36
+ properties: {
37
+ unzerId: {
38
+ type: 'string',
39
+ minLength: 1
40
+ },
41
+ contacts: {
42
+ type: 'array',
43
+ minItems: 1,
44
+ items: contact
45
+ }
46
+ }
47
+ }
48
+
49
+ module.exports = {
50
+ $id: 'https://schemas.tillhub.com/v0/client_accounts.connections.schema.json',
51
+ $schema: 'http://json-schema.org/draft-07/schema#',
52
+ type: 'object',
53
+ additionalProperties: false,
54
+ required: [
55
+ 'connections'
56
+ ],
57
+ properties: {
58
+ connections: {
59
+ type: 'object',
60
+ additionalProperties: false,
61
+ required: [
62
+ 'hasAccessTo',
63
+ 'accessibleBy'
64
+ ],
65
+ properties: {
66
+ hasAccessTo: {
67
+ type: 'array',
68
+ items: connection
69
+ },
70
+ accessibleBy: {
71
+ type: 'array',
72
+ items: connection
73
+ }
74
+ }
75
+ }
76
+ }
77
+ }
@@ -1,2 +1,3 @@
1
1
  module.exports.create = require('./create')
2
2
  module.exports.update = require('./update')
3
+ module.exports.connections = require('./connections')
@@ -24,7 +24,15 @@ module.exports = {
24
24
  'sumup',
25
25
  'buy_now_pay_later', // Unzer: Buy-Now-Pay-Later
26
26
  'unzer_installment', // Unzer: TH LinkPay installments
27
- 'unzer_invoice' // Unzer: TH LinkPay invoice
27
+ 'unzer_invoice', // Unzer: TH LinkPay invoice
28
+ 'applepay',
29
+ 'googlepay',
30
+ 'paypal',
31
+ 'ideal',
32
+ 'wechatpay',
33
+ 'alipay',
34
+ 'twint',
35
+ 'trustly'
28
36
  ]
29
37
  },
30
38
  metadata: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tillhub/schemas",
3
- "version": "6.443.0",
3
+ "version": "6.445.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,69 @@
1
+ const test = require('tape')
2
+ const Ajv = require('ajv')
3
+ const validate = require('../helpers/validate-schema')
4
+ const paymentOptions = require('../../lib/v0/payment_options')
5
+ const paymentOptionBase = require('../../lib/v0/payment_options/base')
6
+
7
+ const ajv = new Ajv()
8
+ const validateCreatePayload = ajv.compile(paymentOptions.create.request)
9
+ const validateUpdatePayload = ajv.compile(paymentOptions.update.request)
10
+
11
+ const basePayload = {
12
+ name: 'Test Payment Option',
13
+ currency: 'EUR',
14
+ order_index: 0
15
+ }
16
+
17
+ test('Payment Options V0: create schema validation', function (t) {
18
+ t.plan(2)
19
+ const { valid, error } = validate(paymentOptions.create.request)
20
+ t.ok(valid, 'create schema is valid')
21
+ t.error(error, 'should not get any error')
22
+ t.end()
23
+ })
24
+
25
+ test('Payment Options V0: update schema validation', function (t) {
26
+ t.plan(2)
27
+ const { valid, error } = validate(paymentOptions.update.request)
28
+ t.ok(valid, 'update schema is valid')
29
+ t.error(error, 'should not get any error')
30
+ t.end()
31
+ })
32
+
33
+ test('Payment Options V0: create accepts all defined payment types', function (t) {
34
+ const types = paymentOptionBase.type.enum
35
+ t.plan(types.length)
36
+
37
+ types.forEach((type) => {
38
+ const valid = validateCreatePayload({ ...basePayload, type })
39
+ t.ok(valid, `should accept type "${type}"`)
40
+ })
41
+
42
+ t.end()
43
+ })
44
+
45
+ test('Payment Options V0: update accepts all defined payment types', function (t) {
46
+ const types = paymentOptionBase.type.enum
47
+ t.plan(types.length)
48
+
49
+ types.forEach((type) => {
50
+ const valid = validateUpdatePayload({ type })
51
+ t.ok(valid, `should accept type "${type}"`)
52
+ })
53
+
54
+ t.end()
55
+ })
56
+
57
+ test('Payment Options V0: create rejects unknown payment type', function (t) {
58
+ t.plan(1)
59
+ const valid = validateCreatePayload({ ...basePayload, type: 'bitcoin' })
60
+ t.notOk(valid, 'should reject unknown type')
61
+ t.end()
62
+ })
63
+
64
+ test('Payment Options V0: update rejects unknown payment type', function (t) {
65
+ t.plan(1)
66
+ const valid = validateUpdatePayload({ type: 'bitcoin' })
67
+ t.notOk(valid, 'should reject unknown type')
68
+ t.end()
69
+ })