Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trip Parser API decommission #222

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading