uapi-json 1.16.1 → 1.16.3

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": "uapi-json",
3
- "version": "1.16.1",
3
+ "version": "1.16.3",
4
4
  "description": "Travelport Universal API",
5
5
  "main": "src/",
6
6
  "files": [
@@ -37,7 +37,7 @@
37
37
  "license": "MIT",
38
38
  "dependencies": {
39
39
  "joi": "^17.6.2",
40
- "axios": "^0.27.2",
40
+ "axios": "^1.6.2",
41
41
  "galileo-screen": "1.0.5",
42
42
  "handlebars": "^4.7.7",
43
43
  "handlebars-helper-equal": "^1.0.0",
@@ -449,28 +449,30 @@ const setIndexes = (segments) => {
449
449
  segment,
450
450
  });
451
451
  }
452
- if (travelOrder === undefined) {
453
- throw new AirParsingError.NoTravelOrder({
454
- segment,
455
- });
456
- }
457
- return { ...segment, index: parseInt(index, 10), travelOrder: parseInt(travelOrder, 10) };
452
+ return { ...segment, index: parseInt(index, 10), travelOrder };
458
453
  })
459
454
  // Sorting segments in order to remove possible duplicates effectively
460
455
  .sort((a, b) => {
461
456
  // Get segments data required for comparison
462
457
  const { index: aIndex, travelOrder: aTravelOrder } = a;
463
458
  const { index: bIndex, travelOrder: bTravelOrder } = b;
464
- const travelOrderDiff = aTravelOrder - bTravelOrder;
465
- const indexDiff = aIndex - bIndex;
466
459
 
467
- // Comparing provider order (index)
460
+ // Comparing by provider order (index)
461
+ const indexDiff = aIndex - bIndex;
468
462
  if (indexDiff !== 0) {
469
463
  return indexDiff;
470
464
  }
471
465
 
466
+ // If any of the travel order values is not returned by uAPI, first in list goes first
467
+ if (!aTravelOrder || !bTravelOrder) {
468
+ return 0;
469
+ }
470
+
471
+ // No undefined values are now provided, can compare numbers
472
+ const travelOrderDiff = parseInt(aTravelOrder, 10) - parseInt(bTravelOrder, 10);
473
+
472
474
  // Provider order is the same, possible duplicates, comparing travel order
473
- // Travel order could be some high number, regardless of low provirder order (index)
475
+ // Travel order could be some high number, regardless of low provider order (index)
474
476
  if (travelOrderDiff !== 0) {
475
477
  return travelOrderDiff;
476
478
  }
@@ -26,6 +26,7 @@ function errorHandler(rsp) {
26
26
  });
27
27
  case '6207': // Error retrieving AccessProfile Unable to retrieve enough Dynamic GTIDs for this transaction
28
28
  case '6119': // Host system error
29
+ case '14058': // Could not locate Session Token Information Session May Have Timed Out
29
30
  throw new RequestRuntimeError.UAPIServiceError({
30
31
  screen: faultString,
31
32
  });