diff --git a/package-lock.json b/package-lock.json index a26bb1ca..0e347394 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "uapi-json", - "version": "1.16.4", + "version": "1.16.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "uapi-json", - "version": "1.16.4", + "version": "1.16.5", "license": "MIT", "dependencies": { "axios": "^1.6.2", @@ -2152,9 +2152,9 @@ "dev": true }, "node_modules/follow-redirects": { - "version": "1.15.5", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", - "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", "funding": [ { "type": "individual", diff --git a/package.json b/package.json index 9be4cdc0..e25f9cdf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "uapi-json", - "version": "1.16.4", + "version": "1.16.5", "description": "Travelport Universal API", "main": "src/", "files": [ diff --git a/src/Services/Air/AirFormat.js b/src/Services/Air/AirFormat.js index 985acc7f..660c5cb7 100644 --- a/src/Services/Air/AirFormat.js +++ b/src/Services/Air/AirFormat.js @@ -79,6 +79,10 @@ function getBaggageInfo(info) { } function formatSegment(segment) { + const operatingAirline = segment['air:CodeshareInfo'] + ? segment['air:CodeshareInfo'].OperatingCarrier + : null; + const seg = { from: segment.Origin, to: segment.Destination, @@ -86,6 +90,7 @@ function formatSegment(segment) { departure: segment.DepartureTime, arrival: segment.ArrivalTime, airline: segment.Carrier, + operatingAirline, flightNumber: segment.FlightNumber, uapi_segment_ref: segment.Key, uapiSegmentReference: segment.Key, diff --git a/test/Air/AirParser.test.js b/test/Air/AirParser.test.js index 3335f65a..01a303be 100644 --- a/test/Air/AirParser.test.js +++ b/test/Air/AirParser.test.js @@ -57,8 +57,8 @@ const checkLowSearchFareXml = (filename) => { (segment) => { expect(segment).to.be.an('object'); expect(segment).to.have.all.keys([ - 'from', 'to', 'departure', 'arrival', 'airline', 'flightNumber', 'serviceClass', - 'plane', 'details', 'duration', 'techStops', 'bookingClass', 'baggage', + 'from', 'to', 'departure', 'arrival', 'airline', 'operatingAirline', 'flightNumber', + 'serviceClass', 'plane', 'details', 'duration', 'techStops', 'bookingClass', 'baggage', 'fareBasisCode', 'group', 'uapi_segment_ref', 'uapiSegmentReference', ]); expect(segment.from).to.match(/^[A-Z]{3}$/); @@ -2195,6 +2195,7 @@ describe('#AirParser', () => { expect(segment).to.be.an('object'); expect(segment).to.have.all.keys([ 'airline', + 'operatingAirline', 'arrival', 'bookingClass', 'departure', @@ -2340,7 +2341,7 @@ describe('#AirParser', () => { leg.forEach((segment) => { expect(segment).to.be.an('object'); expect(segment).to.have.all.keys([ - 'from', 'to', 'departure', 'arrival', 'airline', + 'from', 'to', 'departure', 'arrival', 'airline', 'operatingAirline', 'flightNumber', 'plane', 'duration', 'uapi_segment_ref', 'group', 'availability', 'uapiSegmentReference', ]);