Skip to content

Commit cf17e0f

Browse files
authored
Merge pull request #222 from amadeus4dev/trip-parser-deco
Trip Parser API decommission
2 parents 439229c + ab6ad4b commit cf17e0f

File tree

4 files changed

+0
-84
lines changed

4 files changed

+0
-84
lines changed

README.md

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -342,29 +342,6 @@ amadeus.travel.analytics.airTraffic.busiestPeriod.get({
342342
direction: Amadeus.direction.arriving
343343
})
344344

345-
// Trip Parser API V3
346-
// parse information from flight, hotel, rail, and rental car confirmation emails
347-
// Parse directly from your confirmation file by using helper `fromFile`
348-
amadeus.travel.tripParser.post(
349-
JSON.stringify({
350-
'payload': amadeus.travel.tripParser.fromFile(fs.readFileSync('confirmation.eml')),
351-
"metadata": {
352-
"documentType": "eml",
353-
"name": "BOOKING_DOCUMENT",
354-
"encoding": "BASE_64"
355-
}
356-
}))
357-
// Alternatively Parse from a string encoded in BASE_64
358-
amadeus.travel.tripParser.post(
359-
JSON.stringify({
360-
'payload': "STRING in BASE_64"
361-
"metadata": {
362-
"documentType": "html",
363-
"name": "BOOKING_DOCUMENT",
364-
"encoding": "BASE_64"
365-
}
366-
}))
367-
368345
// City Search API
369346
// finds cities that match a specific word or string of letters.
370347
// Return a list of cities matching a keyword 'Paris'

spec/amadeus/namespaces.test.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ describe('Namespaces', () => {
4848
expect(amadeus.travel.predictions).toBeDefined();
4949
expect(amadeus.travel.predictions.tripPurpose).toBeDefined();
5050
expect(amadeus.travel.predictions.flightDelay).toBeDefined();
51-
expect(amadeus.travel.tripParser).toBeDefined();
5251

5352
expect(amadeus.shopping).toBeDefined();
5453
expect(amadeus.shopping.flightDates).toBeDefined();
@@ -152,7 +151,6 @@ describe('Namespaces', () => {
152151
expect(amadeus.shopping.flightOffers.prediction.post).toBeDefined();
153152
expect(amadeus.booking.flightOrders.post).toBeDefined();
154153
expect(amadeus.shopping.flightOffersSearch.post).toBeDefined();
155-
expect(amadeus.travel.tripParser.post).toBeDefined();
156154
expect(amadeus.shopping.flightOffers.pricing.post).toBeDefined();
157155
expect(amadeus.shopping.seatmaps.post).toBeDefined();
158156
expect(amadeus.booking.hotelBookings.post).toBeDefined();
@@ -306,19 +304,6 @@ describe('Namespaces', () => {
306304
.toHaveBeenCalledWith('/v1/travel/analytics/air-traffic/busiest-period', {});
307305
});
308306

309-
it('.amadeus.travel.tripParser.post', () => {
310-
amadeus.client.post = jest.fn();
311-
amadeus.travel.tripParser.post();
312-
expect(amadeus.client.post)
313-
.toHaveBeenCalledWith('/v3/travel/trip-parser', {});
314-
});
315-
316-
it('.amadeus.travel.tripParser.fromFile', () => {
317-
const utf8Buffer = Buffer.from('file contént', 'utf8');
318-
const base64Encoding = amadeus.travel.tripParser.fromFile(utf8Buffer);
319-
expect(base64Encoding).toEqual('ZmlsZSBjb250w6ludA==');
320-
});
321-
322307
it('.amadeus.shopping.flightDates.get', () => {
323308
amadeus.client.get = jest.fn();
324309
amadeus.shopping.flightDates.get();

src/amadeus/namespaces/travel.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import Analytics from './travel/analytics';
22
import Predictions from './travel/predictions';
3-
import TripParser from './travel/trip_parser';
43

54
/**
65
* A namespaced client for the
@@ -16,15 +15,13 @@ import TripParser from './travel/trip_parser';
1615
* @param {Client} client
1716
* @property {Analytics} analytics
1817
* @property {Predictions} predictions
19-
* @property {TripParser} tripParser
2018
* @protected
2119
*/
2220
class Travel {
2321
constructor(client) {
2422
this.client = client;
2523
this.analytics = new Analytics(client);
2624
this.predictions = new Predictions(client);
27-
this.tripParser = new TripParser(client);
2825
}
2926
}
3027

src/amadeus/namespaces/travel/trip_parser.js

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)