mts-booking-library 1.2.29 → 1.2.31

Sign up to get free protection for your applications and to get access to all the features.
@@ -238,7 +238,7 @@ var JourneyBooking = /** @class */ (function (_super) {
238
238
  if (request.departureStopName === undefined || request.destinationStopName === undefined) {
239
239
  throw Error("Fields departureStopName and destinationStopName are required");
240
240
  }
241
- searchParams = new URLSearchParams(__assign({ departureStopName: request.departureStopName, destinationStopName: request.destinationStopName, passengersNumber: request.passengersNumber.toString(), date: request.date, roundTripDate: request.roundTripDate ? request.roundTripDate : "null", currency: request.currency, isRoundtrip: request.isRoundtrip.toString() }, (this.cartId && { cartId: this.cartId.toString() })));
241
+ searchParams = new URLSearchParams(__assign({ departureStopName: request.departureStopName, destinationStopName: request.destinationStopName, passengersNumber: request.passengersNumber.toString(), date: request.date, roundTripDate: request.roundTripDate ? request.roundTripDate : "null", currency: request.currency }, (this.cartId && { cartId: this.cartId.toString() })));
242
242
  url = "".concat(this.config.API_ENDPOINT, "/booking/journeys?").concat(searchParams);
243
243
  return [2 /*return*/, this.callGetApi(url).then(function (response) {
244
244
  return (0, ErrorResponse_1.objectIsMTSErrorResponse)(response) ? response : response.journeys;
@@ -12,6 +12,8 @@ import { Extra } from "./Extra";
12
12
  * @property {boolean} hasIssuedTickets - A boolean telling whether the cart has issued tickets. Note that if this is the case,
13
13
  * the cart will be null because it is not possible to add tickets to an issued cart. Thus, all data should be reset.
14
14
  * @property {number} sellerId The id of the seller of the tickets in the cart
15
+ * @property {string} sellerPrivacyUrl The url redirecting to the privacy policy of the seller
16
+ * @property {string} sellerTermsUrl The url redirecting to the terms and conditions of the seller
15
17
  * @property {Map<string, boolean[]>} stepsToStatus This data structure describes the steps of the booking process.
16
18
  * The keys of this dictionary represent the booking steps. See ... for the list of possible steps. If the
17
19
  * key is present, then the booking step shall be displayed. The value is a list of 3 booleans:
@@ -20,23 +22,33 @@ import { Extra } from "./Extra";
20
22
  * - The third tells whether the section is required.
21
23
  * @property {Booking.Currencies} currency The currency of the cart. See {@link Booking.Currencies}
22
24
  * @property {string} bookingDueDate The date and time when the cart expires
25
+ * @property {Reduction[]} reductions The list of reductions applied to the cart
26
+ * @property {Extra[]} extras The list of extras services of the cart
27
+ * @property {string} sellingMethod The selling method of the cart (LinkAvel, Backoffice)
28
+ * @property {number} totalValue The total value of the cart, meaning the sum of the nominal prices of all tickets. It is expressed in the currency of the cart.
29
+ * @property {number} totalResellerFee The total reseller fee of the cart, meaning the sum of the reseller fees of all tickets. It is expressed in the currency of the cart.
30
+ * @property {number} totalCreditFromChange The total credit from change of the cart. This is non zero only during the change process, and represents
31
+ * the credit that the user has from the previous cart. It is expressed in the currency of the cart.
32
+ * @property {number} totalAmountToPay The total amount to pay of the cart, meaning the amount that the user has to pay to complete the booking. This is
33
+ * what is displayed in the payment page. It is expressed in the currency of the cart.
23
34
  */
24
35
  export type Cart = {
25
36
  id: number;
26
37
  sellerId: number;
38
+ sellerPrivacyUrl: string;
39
+ sellerTermsUrl: string;
27
40
  cartCode: string;
28
41
  hasIssuedTickets: boolean;
29
42
  stepsToStatus: Map<string, boolean[]>;
30
43
  currency: Booking.Currencies;
31
44
  bookingDueDate: string;
32
- buyerId: number;
33
45
  reductions: Reduction[];
46
+ extras: Extra[];
34
47
  sellingMethod: string;
35
48
  totalValue: number;
36
49
  totalResellerFee?: number;
37
50
  totalCreditFromChange: number;
38
51
  totalAmountToPay: number;
39
- extras: Extra[];
40
52
  };
41
53
  /**
42
54
  * Base response type for the booking process. All APIs that update the cart, share this.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mts-booking-library",
3
- "version": "1.2.29",
3
+ "version": "1.2.31",
4
4
  "description": "Library for use MyTicketSolution Booking API",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -14,9 +14,9 @@
14
14
  },
15
15
  "license": "ISC",
16
16
  "devDependencies": {
17
- "@types/jest": "^29.5.11",
17
+ "@types/jest": "^29.5.12",
18
18
  "jest": "^29.7.0",
19
- "ts-jest": "^29.1.1",
19
+ "ts-jest": "^29.1.2",
20
20
  "typescript": "^5.3.3"
21
21
  },
22
22
  "files": [
@@ -28,7 +28,7 @@
28
28
  ],
29
29
  "author": "M",
30
30
  "dependencies": {
31
- "axios": "^1.6.5",
31
+ "axios": "^1.6.7",
32
32
  "node-localstorage": "^3.0.5"
33
33
  }
34
34
  }