@rebilly/instruments 3.37.1 → 3.37.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rebilly/instruments",
3
- "version": "3.37.1",
3
+ "version": "3.37.2",
4
4
  "author": "Rebilly",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -71,7 +71,10 @@ export function validateOptions(data) {
71
71
  });
72
72
  break;
73
73
  case 'enum':
74
- errorMessage = `${instancePathReadable} ${error.message}: ${error.params.allowedValues}. received: ${data[instancePathReadable]}`
74
+ let value = instancePathReadable.split('.').reduce((acc, key) => {
75
+ return acc[key];
76
+ }, data);
77
+ errorMessage = `${instancePathReadable} ${error.message}: ${error.params.allowedValues}. received: ${value}`
75
78
  break;
76
79
  case 'dependentRequired':
77
80
  case 'maxLength':
@@ -89,5 +92,5 @@ export function validateOptions(data) {
89
92
  }
90
93
  });
91
94
 
92
- throw new RebillyInstrumentsConfigError('Configuration is invalid');
95
+ console.error(new RebillyInstrumentsConfigError('Configuration is invalid').trimStack());
93
96
  }
@@ -244,7 +244,6 @@ export default {
244
244
  properties: {
245
245
  buttonColor: {
246
246
  type: 'string',
247
- enum: ['black', 'white'],
248
247
  default: 'black',
249
248
  },
250
249
  buttonHeight: {
@@ -254,7 +253,6 @@ export default {
254
253
  },
255
254
  buttonType: {
256
255
  type: 'string',
257
- enum: ['book', 'buy', 'checkout', 'donate', 'order', 'pay', 'plain', 'subscribe'],
258
256
  default: 'plain',
259
257
  }
260
258
  },
@@ -271,7 +269,6 @@ export default {
271
269
  properties: {
272
270
  buttonColor: {
273
271
  type: 'string',
274
- enum: ['black', 'white', 'white-outline'],
275
272
  default: 'black',
276
273
  },
277
274
  buttonHeight: {
@@ -281,25 +278,6 @@ export default {
281
278
  },
282
279
  buttonType: {
283
280
  type: 'string',
284
- enum: [
285
- 'add-money',
286
- 'book',
287
- 'buy',
288
- 'check-out',
289
- 'continue',
290
- 'contribute',
291
- 'donate',
292
- 'order',
293
- 'pay',
294
- 'plain',
295
- 'reload',
296
- 'rent',
297
- 'set-up',
298
- 'subscribe',
299
- 'support',
300
- 'tip',
301
- 'top-up'
302
- ],
303
281
  default: 'plain',
304
282
  }
305
283
  },