uapi-json 1.17.2 → 1.17.4
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 +13 -12
- package/src/Services/Air/AirParser.js +43 -49
- package/src/Services/Air/templates/AIR_EMD_RETRIEVE.handlebars.js +1 -1
- package/src/Services/Air/templates/GDS_QUEUE_PLACE.handlebars.js +1 -1
- package/src/Services/Hotels/templates/HOTELS_BOOK_REQUEST.handlebars.js +5 -5
- package/src/Services/Hotels/templates/HOTELS_RATE_REQUEST.handlebars.js +1 -1
- package/src/Services/Hotels/templates/HOTELS_SEARCH_GALILEO_REQUEST.handlebars.js +1 -1
- package/src/Services/Hotels/templates/HOTELS_SEARCH_REQUEST.handlebars.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uapi-json",
|
|
3
|
-
"version": "1.17.
|
|
3
|
+
"version": "1.17.4",
|
|
4
4
|
"description": "Travelport Universal API",
|
|
5
5
|
"main": "src/",
|
|
6
6
|
"files": [
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
"coveralls": "nyc report --reporter=text-lcov > coverage.lcov",
|
|
16
16
|
"fix": "eslint --fix src/ test/",
|
|
17
17
|
"lint": "eslint src/ test/",
|
|
18
|
-
"prepublish": "npm run lint && npm run test"
|
|
18
|
+
"prepublish": "npm run lint && npm run test",
|
|
19
|
+
"cleanup": "find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +"
|
|
19
20
|
},
|
|
20
21
|
"repository": {
|
|
21
22
|
"type": "git",
|
|
@@ -36,27 +37,27 @@
|
|
|
36
37
|
],
|
|
37
38
|
"license": "MIT",
|
|
38
39
|
"dependencies": {
|
|
39
|
-
"
|
|
40
|
-
"axios": "^1.6.2",
|
|
40
|
+
"axios": "^1.7.7",
|
|
41
41
|
"galileo-screen": "1.0.5",
|
|
42
|
-
"handlebars": "^4.7.
|
|
42
|
+
"handlebars": "^4.7.8",
|
|
43
43
|
"handlebars-helper-equal": "^1.0.0",
|
|
44
|
-
"
|
|
44
|
+
"joi": "^17.13.3",
|
|
45
|
+
"moment": "^2.30.1",
|
|
45
46
|
"node-errors-helpers": "^1.0.0",
|
|
46
47
|
"pretty-data": "^0.40.0",
|
|
47
|
-
"promise-retry": "^
|
|
48
|
-
"xml2js": "^0.
|
|
48
|
+
"promise-retry": "^2.0.1",
|
|
49
|
+
"xml2js": "^0.6.2"
|
|
49
50
|
},
|
|
50
51
|
"devDependencies": {
|
|
51
|
-
"chai": "^4.
|
|
52
|
+
"chai": "^4.5.0",
|
|
52
53
|
"eslint": "^8.39.0",
|
|
53
54
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
54
55
|
"eslint-plugin-import": "^2.29.0",
|
|
55
|
-
"mocha": "^10.
|
|
56
|
-
"nyc": "^
|
|
56
|
+
"mocha": "^10.7.3",
|
|
57
|
+
"nyc": "^17.1.0",
|
|
57
58
|
"proxyquire": "^2.1.3",
|
|
58
59
|
"readline2": "^1.0.1",
|
|
59
|
-
"sinon": "^
|
|
60
|
+
"sinon": "^19.0.2",
|
|
60
61
|
"sinon-chai": "^3.7.0"
|
|
61
62
|
}
|
|
62
63
|
}
|
|
@@ -585,9 +585,8 @@ function getTicketFromEtr(etr, obj, allowNoProviderLocatorCodeRetrieval = false)
|
|
|
585
585
|
const exchangedTickets = [];
|
|
586
586
|
|
|
587
587
|
const allCoupons = ticketsList.map((ticket) => {
|
|
588
|
-
return Object.
|
|
588
|
+
return Object.values(ticket['air:Coupon']).map((coupon) => {
|
|
589
589
|
return {
|
|
590
|
-
key: couponKey,
|
|
591
590
|
ticketNumber: ticket.TicketNumber,
|
|
592
591
|
couponNumber: coupon.CouponNumber,
|
|
593
592
|
from: coupon.Origin,
|
|
@@ -607,59 +606,54 @@ function getTicketFromEtr(etr, obj, allowNoProviderLocatorCodeRetrieval = false)
|
|
|
607
606
|
return all.concat(nextChunk);
|
|
608
607
|
}, []);
|
|
609
608
|
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
609
|
+
// Filling exchanged tickets array
|
|
610
|
+
ticketsList.forEach((ticket) => {
|
|
611
|
+
if (ticket['air:ExchangedTicketInfo']) {
|
|
612
|
+
ticket['air:ExchangedTicketInfo'].forEach(
|
|
613
|
+
(t) => exchangedTickets.push(t.Number)
|
|
614
|
+
);
|
|
615
|
+
}
|
|
616
|
+
});
|
|
617
617
|
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
);
|
|
636
|
-
|
|
637
|
-
if (bInfo) {
|
|
638
|
-
bookingInfo = bInfo;
|
|
639
|
-
}
|
|
640
|
-
}
|
|
641
|
-
}
|
|
618
|
+
// Getting ticket coupons
|
|
619
|
+
const ticketsObject = allCoupons.reduce((acc, coupon, index) => {
|
|
620
|
+
const { ticketNumber } = coupon;
|
|
621
|
+
const ticket = acc[ticketNumber] || { ticketNumber, coupons: [] };
|
|
622
|
+
const { coupons } = ticket;
|
|
623
|
+
const nextCoupon = allCoupons[index + 1];
|
|
624
|
+
|
|
625
|
+
let bookingInfo = null;
|
|
626
|
+
// looking for fareInfo by it's fareBasis
|
|
627
|
+
// and for bookingInfo by correct FareInfoRef
|
|
628
|
+
if (airPricingInfo && airPricingInfo['air:FareInfo']) {
|
|
629
|
+
Object.keys(airPricingInfo['air:FareInfo']).forEach(
|
|
630
|
+
(fareKey) => {
|
|
631
|
+
const fare = airPricingInfo['air:FareInfo'][fareKey];
|
|
632
|
+
if (fare.FareBasis === coupon.FareBasis && airPricingInfo['air:BookingInfo']) {
|
|
633
|
+
const bInfo = airPricingInfo['air:BookingInfo'].find(
|
|
634
|
+
(info) => info.FareInfoRef === fareKey
|
|
642
635
|
);
|
|
643
|
-
}
|
|
644
636
|
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
? nextCoupon.stopover
|
|
650
|
-
: true
|
|
651
|
-
),
|
|
652
|
-
...(bookingInfo !== null ? { serviceClass: bookingInfo.CabinClass } : null)
|
|
653
|
-
};
|
|
637
|
+
if (bInfo) {
|
|
638
|
+
bookingInfo = bInfo;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
654
641
|
}
|
|
655
642
|
);
|
|
656
|
-
|
|
657
|
-
return {
|
|
658
|
-
ticketNumber: ticket.TicketNumber,
|
|
659
|
-
coupons,
|
|
660
|
-
};
|
|
661
643
|
}
|
|
662
|
-
|
|
644
|
+
const couponData = {
|
|
645
|
+
...coupon,
|
|
646
|
+
stopover: (
|
|
647
|
+
nextCoupon
|
|
648
|
+
? nextCoupon.stopover
|
|
649
|
+
: true
|
|
650
|
+
),
|
|
651
|
+
...(bookingInfo !== null ? { serviceClass: bookingInfo.CabinClass } : null)
|
|
652
|
+
};
|
|
653
|
+
return { ...acc, [ticketNumber]: { ...ticket, coupons: [...coupons, couponData] } };
|
|
654
|
+
}, {});
|
|
655
|
+
|
|
656
|
+
const tickets = Object.values(ticketsObject);
|
|
663
657
|
|
|
664
658
|
const taxes = (airPricingInfo && airPricingInfo['air:TaxInfo'])
|
|
665
659
|
? Object.keys(airPricingInfo['air:TaxInfo']).map(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
module.exports = `
|
|
2
|
-
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:air="http://www.travelport.com/schema/
|
|
2
|
+
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:air="http://www.travelport.com/schema/air_v52_0" xmlns:com="http://www.travelport.com/schema/common_v52_0">
|
|
3
3
|
<soapenv:Header/>
|
|
4
4
|
<soapenv:Body>
|
|
5
5
|
<air:EMDRetrieveReq TraceId="{{requestId}}" TargetBranch="{{TargetBranch}}" RetrieveProviderReservationDetails="false">
|
|
@@ -2,7 +2,7 @@ module.exports = `
|
|
|
2
2
|
<soapenv:Envelope
|
|
3
3
|
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
|
|
4
4
|
xmlns:univ="http://www.travelport.com/schema/universal_v52_0"
|
|
5
|
-
xmlns:gds="http://www.travelport.com/schema/
|
|
5
|
+
xmlns:gds="http://www.travelport.com/schema/gdsQueue_v52_0"
|
|
6
6
|
xmlns:com="http://www.travelport.com/schema/common_v52_0"
|
|
7
7
|
>
|
|
8
8
|
<soapenv:Header />
|
|
@@ -5,7 +5,7 @@ module.exports = `
|
|
|
5
5
|
<univ:HotelCreateReservationReq
|
|
6
6
|
xmlns:com="http://www.travelport.com/schema/common_v52_0"
|
|
7
7
|
xmlns:common_v52_0="http://www.travelport.com/schema/common_v52_0"
|
|
8
|
-
xmlns:hotel="http://www.travelport.com/schema/
|
|
8
|
+
xmlns:hotel="http://www.travelport.com/schema/hotel_v52_0"
|
|
9
9
|
xmlns:univ="http://www.travelport.com/schema/universal_v52_0"
|
|
10
10
|
ProviderCode="TRM"
|
|
11
11
|
TargetBranch="{{{TargetBranch}}}"
|
|
@@ -41,12 +41,12 @@ module.exports = `
|
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
{{#rates}}
|
|
44
|
-
<hotel:HotelRateDetail xmlns:hotel="http://www.travelport.com/schema/
|
|
44
|
+
<hotel:HotelRateDetail xmlns:hotel="http://www.travelport.com/schema/hotel_v52_0" RatePlanType="{{& RatePlanType}}" RateSupplier="{{& RateSupplier}}" RateOfferId="{{& RateOfferId}}" Base="{{& Base.currency}}{{& Base.value}}" Tax="{{& Tax.currency}}{{& Tax.value}}" Total="{{& Total.currency}}{{& Total.value}}" Surcharge="{{& Surcharge.currency}}{{& Surcharge.value}}" />
|
|
45
45
|
{{/rates}}
|
|
46
46
|
|
|
47
|
-
<hotel:HotelProperty xmlns:hotel="http://www.travelport.com/schema/
|
|
47
|
+
<hotel:HotelProperty xmlns:hotel="http://www.travelport.com/schema/hotel_v52_0" HotelChain="{{& HotelChain}}" HotelCode="{{& HotelCode}}" {{#if Name}} Name="{{Name}}" {{/if}}>
|
|
48
48
|
</hotel:HotelProperty>
|
|
49
|
-
<hotel:HotelStay xmlns:hot="http://www.travelport.com/schema/
|
|
49
|
+
<hotel:HotelStay xmlns:hot="http://www.travelport.com/schema/hotel_v52_0">
|
|
50
50
|
<hotel:CheckinDate>{{{startDate}}}</hotel:CheckinDate>
|
|
51
51
|
<hotel:CheckoutDate>{{{endDate}}}</hotel:CheckoutDate>
|
|
52
52
|
</hotel:HotelStay>
|
|
@@ -59,7 +59,7 @@ module.exports = `
|
|
|
59
59
|
<common_v52_0:HostToken Host="TRM">
|
|
60
60
|
{{& HostToken}}
|
|
61
61
|
</common_v52_0:HostToken>
|
|
62
|
-
<hot:BookingGuestInformation xmlns:hot="http://www.travelport.com/schema/
|
|
62
|
+
<hot:BookingGuestInformation xmlns:hot="http://www.travelport.com/schema/hotel_v52_0">
|
|
63
63
|
{{#roomsRefs}}
|
|
64
64
|
<hot:Room>
|
|
65
65
|
<hot:Adults>{{& adults}}</hot:Adults>
|
|
@@ -3,7 +3,7 @@ module.exports = `
|
|
|
3
3
|
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
|
|
4
4
|
<soapenv:Header/>
|
|
5
5
|
<soapenv:Body>
|
|
6
|
-
<hot:HotelDetailsReq xmlns:com="http://www.travelport.com/schema/common_v52_0" xmlns:hot="http://www.travelport.com/schema/
|
|
6
|
+
<hot:HotelDetailsReq xmlns:com="http://www.travelport.com/schema/common_v52_0" xmlns:hot="http://www.travelport.com/schema/hotel_v52_0" ReturnGuestReviews="true" ReturnMediaLinks="true" TargetBranch="{{TargetBranch}}">
|
|
7
7
|
<com:BillingPointOfSaleInfo OriginApplication="UAPI"/>
|
|
8
8
|
<hot:HotelProperty HotelChain="{{HotelChain}}" HotelCode="{{HotelCode}}" {{#if Name}} Name="{{Name}}" {{/if}}/>
|
|
9
9
|
<hot:HotelDetailsModifiers MaxWait="11000" RateRuleDetail="Complete" {{#if currency}} PreferredCurrency="{{currency}}" {{/if}}>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
module.exports = `
|
|
2
|
-
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hot="http://www.travelport.com/schema/
|
|
2
|
+
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hot="http://www.travelport.com/schema/hotel_v52_0" xmlns:com="http://www.travelport.com/schema/common_v52_0">
|
|
3
3
|
<soapenv:Header/>
|
|
4
4
|
<soapenv:Body>
|
|
5
5
|
<hot:HotelSearchAvailabilityReq TargetBranch="{{TargetBranch}}" >
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
module.exports = `
|
|
2
|
-
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hot="http://www.travelport.com/schema/
|
|
2
|
+
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hot="http://www.travelport.com/schema/hotel_v52_0" xmlns:com="http://www.travelport.com/schema/common_v52_0">
|
|
3
3
|
<soapenv:Header/>
|
|
4
4
|
<soapenv:Body>
|
|
5
5
|
<hot:HotelSearchAvailabilityReq TargetBranch="{{TargetBranch}}" >
|