uapi-json 1.14.10 → 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 +2 -1
- package/package.json +1 -1
- package/src/Services/Air/AirErrors.js +2 -1
- package/src/Services/Air/AirValidator.js +2 -1
- package/src/Services/Air/templates/AIR_AVAILABILTIY_REQUEST.handlebars.js +4 -1
- package/src/Services/Air/validators/index.js +2 -0
- package/src/Services/Air/validators/return-first-available-only.js +8 -0
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
|
@@ -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.',
|
|
@@ -98,7 +99,7 @@ const AirRuntimeError = createErrorClass(
|
|
|
98
99
|
errorTypes.RuntimeError
|
|
99
100
|
);
|
|
100
101
|
Object.assign(AirRuntimeError, createErrorsList({
|
|
101
|
-
NoSeatsAvailable: 'No seats available',
|
|
102
|
+
NoSeatsAvailable: ['No seats available', errorCodes.Validation],
|
|
102
103
|
PNRSyncFailed: 'Unexpected System Error. PNR(s) sync failed',
|
|
103
104
|
SegmentBookingFailed: 'Failed to book on or more segments',
|
|
104
105
|
SegmentWaitlisted: 'One or more segments is waitlisted, not allowed',
|
|
@@ -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
|
|
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
|
+
};
|