Skip to content

Commit

Permalink
Merge pull request #603 from Travelport-Ukraine/master
Browse files Browse the repository at this point in the history
1.14.3
  • Loading branch information
dchertousov authored Sep 30, 2022
2 parents 66c924c + 9bdc952 commit 7c78b49
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 48 deletions.
95 changes: 53 additions & 42 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "uapi-json",
"version": "1.14.2",
"version": "1.14.3",
"description": "Travelport Universal API",
"main": "src/",
"files": [
Expand Down Expand Up @@ -35,7 +35,7 @@
],
"license": "MIT",
"dependencies": {
"@hapi/joi": "^15.1.0",
"joi": "^17.6.2",
"axios": "^0.21.1",
"galileo-screen": "1.0.5",
"handlebars": "^4.7.7",
Expand Down
2 changes: 1 addition & 1 deletion src/Request/RequestErrors.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Object.assign(RequestRuntimeError, createErrorsList({
UnhandledError: 'Error during request. Please try again later',
ResultsMissing: 'Missing results in response',
UAPIServiceError: 'UAPI Service responded with an error',
UAPIServiceTimeout: 'UAPI Service timeout',
UAPIServiceTimeout: ['UAPI Service timeout', 400],
}, RequestRuntimeError));

// Soap errors
Expand Down
6 changes: 3 additions & 3 deletions src/Services/Air/validators/fop-credit-card.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const Joi = require('@hapi/joi');
const Joi = require('joi');

const { AirValidationError } = require('../AirErrors');

Expand All @@ -13,10 +13,10 @@ module.exports = (params) => {
name: Joi.string().max(50).required(),
expDate: Joi.string().regex(/^[0-9]{2}\/[0-9]{2}$/).required(),
cvv2: Joi.string().regex(/^[0-9]{3}$/).required(),
type: Joi.string().valid(['CA', 'VI', 'AX', 'DC', 'JC']).optional(),
type: Joi.string().valid('CA', 'VI', 'AX', 'DC', 'JC').optional(),
}).required();

const result = Joi.validate(params.creditCard, schema);
const result = schema.validate(params.creditCard);
if (result.error) {
// NOTE: doesn't leak CC data into exception
throw new AirValidationError.CreditCardMissing(result.error.toString());
Expand Down

0 comments on commit 7c78b49

Please sign in to comment.