mts-booking-library 1.3.19 → 1.3.22
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +0 -1
- package/lib/booking/journeyBooking.js +9 -2
- package/lib/types/common/Cart.d.ts +2 -0
- package/package.json +1 -1
- package/lib/types/Booking.d.ts +0 -0
- package/lib/types/Booking.js +0 -1
- package/lib/types/Cart.d.ts +0 -79
- package/lib/types/Cart.js +0 -2
- package/lib/types/Details.d.ts +0 -9
- package/lib/types/Details.js +0 -2
- package/lib/types/Info.d.ts +0 -7
- package/lib/types/Info.js +0 -2
- package/lib/types/Journeys/Journey.d.ts +0 -8
- package/lib/types/Journeys/Journey.js +0 -2
- package/lib/types/Line.d.ts +0 -6
- package/lib/types/Line.js +0 -2
- package/lib/types/Person.d.ts +0 -7
- package/lib/types/Person.js +0 -2
- package/lib/types/Subscriptions/Subscrptions.d.ts +0 -12
- package/lib/types/Subscriptions/Subscrptions.js +0 -2
- package/lib/types/Subscriptions/ValidityTypes.d.ts +0 -6
- package/lib/types/Subscriptions/ValidityTypes.js +0 -10
- package/lib/types/TermsAndTariffs.d.ts +0 -21
- package/lib/types/TermsAndTariffs.js +0 -2
- package/lib/types/Tours/Tour.d.ts +0 -18
- package/lib/types/Tours/Tour.js +0 -2
- /package/lib/types/{Journeys → journeys}/BusMatrix.d.ts +0 -0
- /package/lib/types/{Journeys → journeys}/BusMatrix.js +0 -0
- /package/lib/types/{Journeys → journeys}/JourneyCart.d.ts +0 -0
- /package/lib/types/{Journeys → journeys}/JourneyCart.js +0 -0
- /package/lib/types/{Journeys → journeys}/JourneyInfo.d.ts +0 -0
- /package/lib/types/{Journeys → journeys}/JourneyInfo.js +0 -0
- /package/lib/types/{Journeys → journeys}/JourneySearch.d.ts +0 -0
- /package/lib/types/{Journeys → journeys}/JourneySearch.js +0 -0
- /package/lib/types/{Journeys → journeys}/Stop.d.ts +0 -0
- /package/lib/types/{Journeys → journeys}/Stop.js +0 -0
- /package/lib/types/{Journeys → journeys}/Trip.d.ts +0 -0
- /package/lib/types/{Journeys → journeys}/Trip.js +0 -0
- /package/lib/types/{Subscriptions → subscriptions}/SubscriptionAvailabilities.d.ts +0 -0
- /package/lib/types/{Subscriptions → subscriptions}/SubscriptionAvailabilities.js +0 -0
- /package/lib/types/{Subscriptions → subscriptions}/SubscriptionCart.d.ts +0 -0
- /package/lib/types/{Subscriptions → subscriptions}/SubscriptionCart.js +0 -0
- /package/lib/types/{Subscriptions → subscriptions}/SubscriptionInfo.d.ts +0 -0
- /package/lib/types/{Subscriptions → subscriptions}/SubscriptionInfo.js +0 -0
- /package/lib/types/{Subscriptions → subscriptions}/Subscriptions.d.ts +0 -0
- /package/lib/types/{Subscriptions → subscriptions}/Subscriptions.js +0 -0
package/README.md
CHANGED
@@ -258,7 +258,14 @@ var JourneyBooking = /** @class */ (function (_super) {
|
|
258
258
|
if (request.departureStopName === undefined || request.destinationStopName === undefined) {
|
259
259
|
throw Error("Fields departureStopName and destinationStopName are required");
|
260
260
|
}
|
261
|
-
searchParams = new URLSearchParams(
|
261
|
+
searchParams = new URLSearchParams({
|
262
|
+
departureStopName: request.departureStopName,
|
263
|
+
destinationStopName: request.destinationStopName,
|
264
|
+
passengersNumber: request.passengersNumber.toString(),
|
265
|
+
date: request.date,
|
266
|
+
roundTripDate: request.roundTripDate ? request.roundTripDate : "null",
|
267
|
+
currency: request.currency
|
268
|
+
});
|
262
269
|
url = "".concat(this.config.API_ENDPOINT, "/v3_booking/journeys?").concat(searchParams);
|
263
270
|
return [2 /*return*/, this.callGetApi(url).then(function (response) {
|
264
271
|
return (0, ErrorResponse_1.objectIsMTSErrorResponse)(response)
|
@@ -274,7 +281,7 @@ var JourneyBooking = /** @class */ (function (_super) {
|
|
274
281
|
var _this = this;
|
275
282
|
return __generator(this, function (_a) {
|
276
283
|
url = "".concat(this.config.API_ENDPOINT, "/v3_booking/journeys/carts");
|
277
|
-
request = __assign(__assign({}, journeyCart), (this.
|
284
|
+
request = __assign(__assign({}, journeyCart), (this.cartGuid && { cartGuid: this.cartGuid }));
|
278
285
|
return [2 /*return*/, this.callPostApi(url, request).then(function (response) {
|
279
286
|
// Check for errors
|
280
287
|
if ((0, ErrorResponse_1.objectIsMTSErrorResponse)(response)) {
|
@@ -29,6 +29,8 @@ export type Cart = {
|
|
29
29
|
sellerPrivacyUrl: string;
|
30
30
|
/** The url redirecting to the terms and conditions of the seller */
|
31
31
|
sellerTermsUrl: string;
|
32
|
+
/** The support email of the seller, if any */
|
33
|
+
sellerEmailLinkavel: string | null;
|
32
34
|
/** The code of the cart */
|
33
35
|
cartCode: string;
|
34
36
|
/**
|
package/package.json
CHANGED
package/lib/types/Booking.d.ts
DELETED
File without changes
|
package/lib/types/Booking.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";
|
package/lib/types/Cart.d.ts
DELETED
@@ -1,79 +0,0 @@
|
|
1
|
-
import { Booking } from "..";
|
2
|
-
import { Person } from "./Person";
|
3
|
-
import { TariffMatrix } from "./TermsAndTariffs";
|
4
|
-
export type Cart = {
|
5
|
-
id: number;
|
6
|
-
cartCode: string;
|
7
|
-
status: Booking.CartStatus;
|
8
|
-
nextStatus: Booking.CartStatus;
|
9
|
-
currency: string;
|
10
|
-
bookingDueDate: string;
|
11
|
-
bookings: {
|
12
|
-
type: string;
|
13
|
-
summary: {
|
14
|
-
quantity: number;
|
15
|
-
label: string;
|
16
|
-
value: number;
|
17
|
-
}[];
|
18
|
-
}[];
|
19
|
-
info: {
|
20
|
-
stops: {
|
21
|
-
id: number;
|
22
|
-
departureTime: Date;
|
23
|
-
destinationTime: Date;
|
24
|
-
name: string;
|
25
|
-
address: string;
|
26
|
-
}[];
|
27
|
-
};
|
28
|
-
buyer: Person;
|
29
|
-
reductions: {
|
30
|
-
tripId: number;
|
31
|
-
tripName: string;
|
32
|
-
value: number;
|
33
|
-
isPercentage: boolean;
|
34
|
-
voucherCode?: string;
|
35
|
-
}[];
|
36
|
-
isSeatsSelectionAllowed: boolean;
|
37
|
-
sellingMethod: string;
|
38
|
-
totalValue: number;
|
39
|
-
totalResellerFee?: number;
|
40
|
-
totalCreditFromChange: number;
|
41
|
-
totalAmountToPay: number;
|
42
|
-
extas: {
|
43
|
-
id: number;
|
44
|
-
resourceId: number;
|
45
|
-
name: string;
|
46
|
-
description: string;
|
47
|
-
notes: string;
|
48
|
-
tariff: {
|
49
|
-
tariffId: number;
|
50
|
-
tariffName: string;
|
51
|
-
};
|
52
|
-
}[];
|
53
|
-
};
|
54
|
-
export type TourCart = {
|
55
|
-
cartId?: number;
|
56
|
-
currency: Booking.Currencies;
|
57
|
-
tour: {
|
58
|
-
tourId: number;
|
59
|
-
date?: Date;
|
60
|
-
tripId?: number;
|
61
|
-
tariffsMatrix: TariffMatrix;
|
62
|
-
};
|
63
|
-
};
|
64
|
-
export type JourneyCart = {
|
65
|
-
cartId?: number;
|
66
|
-
currency: Booking.Currencies;
|
67
|
-
outboundJourney: {
|
68
|
-
departureStopId: number;
|
69
|
-
destinationStopId: number;
|
70
|
-
tripId: number;
|
71
|
-
tariffsMatrix: TariffMatrix;
|
72
|
-
}[];
|
73
|
-
returnJourney: {
|
74
|
-
tripId: number;
|
75
|
-
departureStopId: number;
|
76
|
-
destinationStopId: number;
|
77
|
-
tariffsMatrix: TariffMatrix;
|
78
|
-
}[] | null;
|
79
|
-
};
|
package/lib/types/Cart.js
DELETED
package/lib/types/Details.d.ts
DELETED
package/lib/types/Details.js
DELETED
package/lib/types/Info.d.ts
DELETED
package/lib/types/Info.js
DELETED
package/lib/types/Line.d.ts
DELETED
package/lib/types/Line.js
DELETED
package/lib/types/Person.d.ts
DELETED
package/lib/types/Person.js
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
export type Subscription = {
|
2
|
-
departurePhysicalAgencyStopId: number;
|
3
|
-
departureStopName: string;
|
4
|
-
destinationPhysicalAgencyStopId: number;
|
5
|
-
destinationStopName: string;
|
6
|
-
departureTime: string;
|
7
|
-
destinationTime: string;
|
8
|
-
lineName: string;
|
9
|
-
routeId: number;
|
10
|
-
routeName: string;
|
11
|
-
sellerId: number;
|
12
|
-
};
|
@@ -1,10 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.ValidityTypes = void 0;
|
4
|
-
var ValidityTypes;
|
5
|
-
(function (ValidityTypes) {
|
6
|
-
ValidityTypes["WORKING_WEEK"] = "WORKING_WEEK";
|
7
|
-
ValidityTypes["WEEKLY"] = "WEEKLY";
|
8
|
-
ValidityTypes["MONTHLY"] = "MONTHLY";
|
9
|
-
ValidityTypes["YEARLY"] = "YEARLY";
|
10
|
-
})(ValidityTypes || (exports.ValidityTypes = ValidityTypes = {}));
|
@@ -1,21 +0,0 @@
|
|
1
|
-
export type TariffMatrix = {
|
2
|
-
tariffTypeId: number;
|
3
|
-
termsTypeId: number;
|
4
|
-
value: number;
|
5
|
-
quantity: number;
|
6
|
-
}[][];
|
7
|
-
export type TariffType = {
|
8
|
-
name: string;
|
9
|
-
description: string;
|
10
|
-
requiredPassengersName: boolean;
|
11
|
-
numberOfOccupiedSeats: number;
|
12
|
-
bookingProcessDescription: string;
|
13
|
-
};
|
14
|
-
export type TermsType = {
|
15
|
-
name: string;
|
16
|
-
description: string;
|
17
|
-
isRefundAllowed: boolean;
|
18
|
-
isChangeAllowed: boolean;
|
19
|
-
validationRulesString: string;
|
20
|
-
bookingProcessDescription: string;
|
21
|
-
};
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import { Info } from "../Info";
|
2
|
-
import { Line } from "../Line";
|
3
|
-
import { TariffMatrix, TariffType, TermsType } from "../TermsAndTariffs";
|
4
|
-
export type Tour = {
|
5
|
-
id: number;
|
6
|
-
line: Line;
|
7
|
-
info: Info;
|
8
|
-
tariffsMatrix: TariffMatrix;
|
9
|
-
tariffTypes: TariffType[];
|
10
|
-
termsTypes: TermsType[];
|
11
|
-
isDateOptional: boolean;
|
12
|
-
isDateRequired: boolean;
|
13
|
-
isTripMandatory: boolean;
|
14
|
-
};
|
15
|
-
export type TourTrip = {
|
16
|
-
tripId: number;
|
17
|
-
hour: Date;
|
18
|
-
};
|
package/lib/types/Tours/Tour.js
DELETED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|