mts-booking-library 2.4.3 → 2.4.5

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.
package/README.md CHANGED
@@ -1,8 +1,24 @@
1
1
  # Publish
2
+
2
3
  1. `npm i`
3
4
  1. `npm version patch`
4
5
  1. `git push && git push --tags`
5
6
  1. `npm publish`
6
7
 
7
8
  # Test
8
- 1. `npm install && npm run test`
9
+
10
+ 1. `npm install && npm run test`
11
+
12
+ # Linting
13
+
14
+ ### `npm run lint`
15
+
16
+ Will run ESLint on the project.
17
+
18
+ ### `npm run lint:quiet`
19
+
20
+ Will run ESLint on the project, but will ignore warnings.
21
+
22
+ ### `npm run lint:fix`
23
+
24
+ Will run ESLint on the project, fixing the errors that can be fixed automatically.
@@ -1,6 +1,7 @@
1
1
  import { Booking } from "../../booking/booking";
2
2
  import { Reduction } from "./Reduction";
3
3
  import { Extra } from "./Extra";
4
+ import { PaymentMethods } from "./Payment";
4
5
  export declare enum SellingMethod {
5
6
  LINKAVEL = "LINKAVEL",
6
7
  BACKOFFICE = "BACKOFFICE",
@@ -59,6 +60,8 @@ export type Cart = {
59
60
  sellerEmailLinkavel: string | null;
60
61
  /** The code of the cart */
61
62
  cartCode: string;
63
+ /** If true, the tickets in the cart will be automatically printer after the payment */
64
+ autoPrintOption: boolean;
62
65
  /**
63
66
  * A boolean telling whether the cart has issued tickets.
64
67
  * Note that if this is the case, the cart will be null because it is not
@@ -114,6 +117,11 @@ export type Cart = {
114
117
  * It is expressed in the currency of the cart.
115
118
  */
116
119
  totalAmountToPay: number;
120
+ /**
121
+ * A list of string representing the possible ways to cash in the ticket.
122
+ * The first element of the list is the default cash in method (and the preferred by the seller).
123
+ */
124
+ cashInMethods: PaymentMethods[];
117
125
  };
118
126
  /** The type that {@link Cart.stepsToStatus} assumes once parsed to a map */
119
127
  export type processedStepsToStatus = Map<Booking.BookingSteps, [boolean, boolean, boolean]>;
@@ -21,6 +21,8 @@ export type Person = {
21
21
  export type PersonDetails = Person & {
22
22
  /** The social security number of the buyer, if provided. */
23
23
  socialSecurityNumber: string | null;
24
+ /** Whether the person has opposed to tax deduction. */
25
+ noSSN: boolean;
24
26
  };
25
27
  export declare const DEFAULT_PERSON: Person;
26
28
  export declare const initializePerson: (person?: Person | undefined | null) => Person;
@@ -34,6 +34,16 @@ export type Tariff = {
34
34
  label: string;
35
35
  /** The number of passengers to which this tariff applies */
36
36
  quantity: number;
37
+ /**
38
+ * The maximum quantity of this tariff that can be added to the cart.
39
+ * If this value is null or 0, there is no limit to the quantity of this tariff that can be added to the cart.
40
+ */
41
+ quantityPerCart: number;
42
+ /**
43
+ * Whether there can only be this tariff in the cart, meaning that if the user selects this tariff,
44
+ * it should not be possible to select any other tariff
45
+ */
46
+ onlyThisTariffInCart: boolean;
37
47
  /** The custom code for one-way tickets */
38
48
  oneWayCode: string | null;
39
49
  /** The custom code for round trip tickets */
@@ -49,6 +49,8 @@ export type TplBookingType = {
49
49
  export type TplBookingInfo = {
50
50
  /** Whether the booking is a subscription or a single ticket. */
51
51
  isSubscription: boolean;
52
+ /** Only for subscriptions: the PNR of the subscription */
53
+ subscriptionPNR?: string;
52
54
  /** The id of the super area. */
53
55
  superAreaId: number;
54
56
  /** The validity of the ticket (or of the subscription). */
@@ -95,6 +95,7 @@ var makeRequest = function (method, url, data, options) { return __awaiter(void
95
95
  if (!requestFunctions[method]) {
96
96
  throw new Error("MTS Library Error! makeRequest: unsupported method ".concat(method));
97
97
  }
98
+ // eslint-disable-next-line no-async-promise-executor
98
99
  return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(void 0, void 0, void 0, function () {
99
100
  var response, filteredResponse, error_1, message, status_1, isAzureMaintenance, resError, resError;
100
101
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mts-booking-library",
3
- "version": "2.4.3",
3
+ "version": "2.4.5",
4
4
  "description": "Library for using MyTicketSolution Booking API",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -12,17 +12,26 @@
12
12
  "prepublishOnly": "npm run test --runInBand",
13
13
  "version": "git add -A src",
14
14
  "postversion": "git push && git push --tags",
15
+ "lint": "eslint src",
16
+ "lint:quiet": "npm run lint -- --quiet",
17
+ "lint:fix": "npm run lint -- --fix",
15
18
  "format": "prettier --write src/**"
16
19
  },
17
20
  "license": "ISC",
18
21
  "devDependencies": {
22
+ "@eslint/js": "^9.27.0",
19
23
  "@types/jest": "^29.5.14",
20
- "dotenv": "^16.4.7",
24
+ "@types/node-localstorage": "^1.3.3",
25
+ "dotenv": "^16.5.0",
26
+ "eslint": "^9.27.0",
27
+ "eslint-config-prettier": "^10.1.5",
28
+ "globals": "^16.2.0",
21
29
  "jest": "^29.7.0",
22
30
  "node-localstorage": "^3.0.5",
23
- "prettier": "^3.4.2",
24
- "ts-jest": "^29.2.5",
25
- "typescript": "^5.7.2"
31
+ "prettier": "^3.5.3",
32
+ "ts-jest": "^29.3.4",
33
+ "typescript": "^5.8.3",
34
+ "typescript-eslint": "^8.32.1"
26
35
  },
27
36
  "files": [
28
37
  "lib/**/*"
@@ -33,8 +42,8 @@
33
42
  ],
34
43
  "author": "Infoservice s.r.l.",
35
44
  "dependencies": {
36
- "@react-native-async-storage/async-storage": "^2.1.0",
37
- "axios": "^1.7.9",
38
- "zustand": "^4.5.5"
45
+ "@react-native-async-storage/async-storage": "^2.1.2",
46
+ "axios": "^1.9.0",
47
+ "zustand": "^5.0.5"
39
48
  }
40
49
  }