mts-booking-library 2.4.10 → 2.4.11
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.
@@ -247,11 +247,12 @@ var JourneyBooking = /** @class */ (function (_super) {
|
|
247
247
|
JourneyBooking.prototype.getJourneys = function (request, options) {
|
248
248
|
return __awaiter(this, void 0, void 0, function () {
|
249
249
|
var searchParams, url;
|
250
|
-
|
250
|
+
var _a, _b, _c;
|
251
|
+
return __generator(this, function (_d) {
|
251
252
|
if (request.departureStopName === undefined || request.destinationStopName === undefined) {
|
252
253
|
throw Error("Fields departureStopName and destinationStopName are required");
|
253
254
|
}
|
254
|
-
searchParams = new URLSearchParams(__assign({ departureStopName: request.departureStopName, destinationStopName: request.destinationStopName, passengersNumber: request.passengersNumber.toString(), date: request.date, roundTripDate: request.roundTripDate ?
|
255
|
+
searchParams = new URLSearchParams(__assign({ departureStopName: request.departureStopName, destinationStopName: request.destinationStopName, passengersNumber: request.passengersNumber.toString(), date: request.date, roundTripDate: (_a = request.roundTripDate) !== null && _a !== void 0 ? _a : "null", currency: request.currency, outboundTripId: (_c = (_b = request.outboundTripId) === null || _b === void 0 ? void 0 : _b.toString()) !== null && _c !== void 0 ? _c : "null" }, (this.cartGuid && { cartGuid: this.cartGuid })));
|
255
256
|
url = "".concat(this.config.API_ENDPOINT, "/v3_booking/journeys?").concat(searchParams);
|
256
257
|
return [2 /*return*/, this.callGetApi(url, options).then(function (response) {
|
257
258
|
return (0, ErrorResponse_1.objectIsMTSErrorResponse)(response)
|
@@ -7,9 +7,10 @@ export type JourneySearchRequest = {
|
|
7
7
|
destinationStopName: string | undefined;
|
8
8
|
passengersNumber: number;
|
9
9
|
date: string;
|
10
|
-
roundTripDate
|
10
|
+
roundTripDate?: string | null;
|
11
11
|
currency: Booking.Currencies;
|
12
12
|
isRoundtrip: boolean;
|
13
|
+
outboundTripId?: number | null;
|
13
14
|
};
|
14
15
|
export declare const DEFAULT_JOURNEY_SEARCH: JourneySearchRequest;
|
15
16
|
export type JourneySearchResult = {
|
@@ -9,7 +9,6 @@ exports.DEFAULT_JOURNEY_SEARCH = {
|
|
9
9
|
date: new Date(Date.UTC(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), 0, 1))
|
10
10
|
.toISOString()
|
11
11
|
.slice(0, -1),
|
12
|
-
roundTripDate: null,
|
13
12
|
currency: booking_1.Booking.Currencies.EUR,
|
14
13
|
isRoundtrip: false
|
15
14
|
};
|