uapi-json 1.14.11 → 1.15.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/docs/Air.md CHANGED
@@ -48,7 +48,8 @@ Low Fare Shop functionality combines air availability and a fare quote request t
48
48
  | maxSolutions | `number` | Maximum number of solutions. <i>Optional.</i> |.
49
49
  | permittedCarriers | `Array<String>` | Array of carriers' codes. <i>Optional. Can not be used when `preferredCarriers` is set</i> |
50
50
  | preferredCarriers | `Array<String>` | Array of carriers' codes. <i>Optional. Can not be used when `permittedCarriers` is set</i> |
51
- | allowDirectAccess | `Boolean` | When passed, first carrier is taken from the carriers list and the search is done in carrier specific display.
51
+ | allowDirectAccess | `Boolean` | When passed, first carrier is taken from the carriers list and the search is done in carrier specific display. <i>Optional.</i> |
52
+ | returnFirstAvailableOnly | `Boolean` | When passed, next days availability is returned if available. <i>Optional.</i> |
52
53
  | preferredConnectionPoints | `Array<String>` | Array of IATA codes. <i>Optional.</i> |
53
54
  | prohibitedConnectionPoints | `Array<String>` | Array of IATA codes. <i>Optional.</i> |
54
55
  | permittedConnectionPoints | `Array<String>` | Array of IATA codes. <i>Optional.</i> |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uapi-json",
3
- "version": "1.14.11",
3
+ "version": "1.15.0",
4
4
  "description": "Travelport Universal API",
5
5
  "main": "src/",
6
6
  "files": [
@@ -39,6 +39,7 @@ Object.assign(AirValidationError, createErrorsList({
39
39
  PlatingCarrierInvalid: 'Plating Carrier Invalid',
40
40
  SearchIdMissing: 'SearchId is missing',
41
41
  VersionMissing: 'Version is missing in request',
42
+ ReturnFirstAvailableOnlyInvalid: 'Invalid value provided for returnFirstAvailableOnly',
42
43
  AllowDirectAccessInvalid: 'Invalid value provided for allowDirectAccess',
43
44
  AllowDirectAccessCarriersNotSpecified: 'Carriers not specified for carrier specific display',
44
45
  EMDItemNumberMissing: 'Missing EMD number. See data.',
@@ -8,7 +8,8 @@ module.exports = {
8
8
  validators.passengers,
9
9
  validators.legs,
10
10
  validators.carriers,
11
- validators.allowDirectAccess
11
+ validators.allowDirectAccess,
12
+ validators.returnFirstAvailableOnly
12
13
  ),
13
14
  transform(
14
15
  transformers.convertPassengersObjectToArray
@@ -22,7 +22,10 @@ module.exports = `
22
22
  <com:CityOrAirport Code="{{to}}" PreferCity="true"/>
23
23
  </air:SearchDestination>
24
24
  <air:SearchDepTime PreferredTime="{{departureDate}}"/>
25
- <air:AirLegModifiers {{#if ../allowDirectAccess}}AllowDirectAccess="true"{{/if}}>
25
+ <air:AirLegModifiers
26
+ {{#if ../allowDirectAccess}}AllowDirectAccess="true"{{/if}}
27
+ {{#if ../returnFirstAvailableOnly}}ReturnFirstAvailableOnly="true"{{/if}}
28
+ >
26
29
  {{#*inline "connectionPoint"}}
27
30
  <com:ConnectionPoint>
28
31
  <com:CityOrAirport Code="{{connection}}" />
@@ -20,6 +20,7 @@ const platingCarrier = require('./platingCarrier');
20
20
  const searchId = require('./search-id');
21
21
  const version = require('./version');
22
22
  const allowDirectAccess = require('./allow-direct-access');
23
+ const returnFirstAvailableOnly = require('./return-first-available-only');
23
24
  const emdNumber = require('./emd-number');
24
25
  const carriers = require('./carriers');
25
26
 
@@ -29,6 +30,7 @@ module.exports = {
29
30
  pricingSolutionXml,
30
31
  paramsIsObject,
31
32
  allowDirectAccess,
33
+ returnFirstAvailableOnly,
32
34
  fop,
33
35
  fopCreditCard,
34
36
  pnr,
@@ -0,0 +1,8 @@
1
+ const { AirValidationError } = require('../AirErrors');
2
+
3
+ module.exports = (params) => {
4
+ const { returnFirstAvailableOnly } = params;
5
+ if (returnFirstAvailableOnly !== undefined && (typeof returnFirstAvailableOnly) !== 'boolean') {
6
+ throw new AirValidationError.ReturnFirstAvailableOnlyInvalid(params);
7
+ }
8
+ };