Skip to content

Commit

Permalink
Merge pull request #222 from amadeus4dev/trip-parser-deco
Browse files Browse the repository at this point in the history
Trip Parser API decommission
  • Loading branch information
tsolakoua authored Oct 1, 2024
2 parents 439229c + ab6ad4b commit cf17e0f
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 84 deletions.
23 changes: 0 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,29 +342,6 @@ amadeus.travel.analytics.airTraffic.busiestPeriod.get({
direction: Amadeus.direction.arriving
})

// Trip Parser API V3
// parse information from flight, hotel, rail, and rental car confirmation emails
// Parse directly from your confirmation file by using helper `fromFile`
amadeus.travel.tripParser.post(
JSON.stringify({
'payload': amadeus.travel.tripParser.fromFile(fs.readFileSync('confirmation.eml')),
"metadata": {
"documentType": "eml",
"name": "BOOKING_DOCUMENT",
"encoding": "BASE_64"
}
}))
// Alternatively Parse from a string encoded in BASE_64
amadeus.travel.tripParser.post(
JSON.stringify({
'payload': "STRING in BASE_64"
"metadata": {
"documentType": "html",
"name": "BOOKING_DOCUMENT",
"encoding": "BASE_64"
}
}))

// City Search API
// finds cities that match a specific word or string of letters.
// Return a list of cities matching a keyword 'Paris'
Expand Down
15 changes: 0 additions & 15 deletions spec/amadeus/namespaces.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ describe('Namespaces', () => {
expect(amadeus.travel.predictions).toBeDefined();
expect(amadeus.travel.predictions.tripPurpose).toBeDefined();
expect(amadeus.travel.predictions.flightDelay).toBeDefined();
expect(amadeus.travel.tripParser).toBeDefined();

expect(amadeus.shopping).toBeDefined();
expect(amadeus.shopping.flightDates).toBeDefined();
Expand Down Expand Up @@ -152,7 +151,6 @@ describe('Namespaces', () => {
expect(amadeus.shopping.flightOffers.prediction.post).toBeDefined();
expect(amadeus.booking.flightOrders.post).toBeDefined();
expect(amadeus.shopping.flightOffersSearch.post).toBeDefined();
expect(amadeus.travel.tripParser.post).toBeDefined();
expect(amadeus.shopping.flightOffers.pricing.post).toBeDefined();
expect(amadeus.shopping.seatmaps.post).toBeDefined();
expect(amadeus.booking.hotelBookings.post).toBeDefined();
Expand Down Expand Up @@ -306,19 +304,6 @@ describe('Namespaces', () => {
.toHaveBeenCalledWith('/v1/travel/analytics/air-traffic/busiest-period', {});
});

it('.amadeus.travel.tripParser.post', () => {
amadeus.client.post = jest.fn();
amadeus.travel.tripParser.post();
expect(amadeus.client.post)
.toHaveBeenCalledWith('/v3/travel/trip-parser', {});
});

it('.amadeus.travel.tripParser.fromFile', () => {
const utf8Buffer = Buffer.from('file contént', 'utf8');
const base64Encoding = amadeus.travel.tripParser.fromFile(utf8Buffer);
expect(base64Encoding).toEqual('ZmlsZSBjb250w6ludA==');
});

it('.amadeus.shopping.flightDates.get', () => {
amadeus.client.get = jest.fn();
amadeus.shopping.flightDates.get();
Expand Down
3 changes: 0 additions & 3 deletions src/amadeus/namespaces/travel.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Analytics from './travel/analytics';
import Predictions from './travel/predictions';
import TripParser from './travel/trip_parser';

/**
* A namespaced client for the
Expand All @@ -16,15 +15,13 @@ import TripParser from './travel/trip_parser';
* @param {Client} client
* @property {Analytics} analytics
* @property {Predictions} predictions
* @property {TripParser} tripParser
* @protected
*/
class Travel {
constructor(client) {
this.client = client;
this.analytics = new Analytics(client);
this.predictions = new Predictions(client);
this.tripParser = new TripParser(client);
}
}

Expand Down
43 changes: 0 additions & 43 deletions src/amadeus/namespaces/travel/trip_parser.js

This file was deleted.

0 comments on commit cf17e0f

Please sign in to comment.