mts-booking-library 2.4.14 → 3.0.1

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.
Files changed (35) hide show
  1. package/lib/booking/booking.d.ts +2 -1
  2. package/lib/booking/journeyBooking.d.ts +46 -6
  3. package/lib/booking/journeyBooking.js +31 -75
  4. package/lib/booking/serviceBooking.d.ts +48 -8
  5. package/lib/booking/serviceBooking.js +33 -74
  6. package/lib/booking/subscriptionBooking.d.ts +45 -3
  7. package/lib/booking/subscriptionBooking.js +31 -38
  8. package/lib/booking/tplBooking.d.ts +46 -6
  9. package/lib/booking/tplBooking.js +27 -78
  10. package/lib/index.d.ts +6 -5
  11. package/lib/index.js +6 -5
  12. package/lib/mtsStorage.d.ts +10 -6
  13. package/lib/types/common/Cart.d.ts +64 -62
  14. package/lib/types/common/Person.d.ts +0 -11
  15. package/lib/types/common/Person.js +1 -11
  16. package/lib/types/common/Reduction.d.ts +14 -21
  17. package/lib/types/common/Tariffs.d.ts +0 -2
  18. package/lib/types/common/dates.d.ts +8 -0
  19. package/lib/types/common/dates.js +320 -0
  20. package/lib/types/journeys/JourneyCart.d.ts +0 -18
  21. package/lib/types/journeys/JourneyCart.js +0 -8
  22. package/lib/types/journeys/JourneyInfo.d.ts +7 -8
  23. package/lib/types/journeys/JourneySearch.d.ts +5 -4
  24. package/lib/types/journeys/JourneySearch.js +10 -5
  25. package/lib/types/journeys/Stop.d.ts +8 -12
  26. package/lib/types/journeys/Trip.d.ts +70 -6
  27. package/lib/types/services/Service.d.ts +13 -4
  28. package/lib/types/services/ServiceCart.d.ts +4 -31
  29. package/lib/types/subscriptions/SubscriptionAvailabilities.d.ts +20 -22
  30. package/lib/types/subscriptions/SubscriptionCart.d.ts +3 -4
  31. package/lib/types/subscriptions/Subscriptions.d.ts +10 -11
  32. package/lib/types/tpl/TplCart.d.ts +2 -21
  33. package/lib/utils/utils.d.ts +0 -8
  34. package/lib/utils/utils.js +1 -17
  35. package/package.json +16 -16
@@ -56,15 +56,6 @@ export type GetPassenger = Person & {
56
56
  /** Whether the passenger social security number is reuqired, optional or cannot be specified. */
57
57
  passengerSSNOption: PersonDataFieldStatus;
58
58
  };
59
- /** @deprecated Use PersonDataFieldStatus */
60
- export declare enum BuyerDataStatus {
61
- /** The buyer data are optional. PersonDetails form shall be displayed, but the user can skip it. */
62
- OPTIONAL = 0,
63
- /** The buyer data are required. PersonDetails form shall be displayed and the user cannot skip it. */
64
- REQUIRED = 1,
65
- /** The buyer data cannot be specified. PersonDetails form shall not be displayed. */
66
- CANNOT_BE_SPECIFIED = 2
67
- }
68
59
  export declare enum PersonDataFieldStatus {
69
60
  /** The field (e.g. the buyer's email) is optional. The input shall be displayed, but the user can skip it. */
70
61
  OPTIONAL = "OPTIONAL",
@@ -75,8 +66,6 @@ export declare enum PersonDataFieldStatus {
75
66
  }
76
67
  /** Represents the response of the {@link getBuyerPassengersDetails} method. */
77
68
  export type GetBuyerPassengersDetailsResponse = {
78
- /** @deprecated Whether the form for the buyer data is required, optional or cannot be specified. */
79
- buyerDataStatus: BuyerDataStatus;
80
69
  /** The {@link Person} object representing the buyer. */
81
70
  buyer: Person | null;
82
71
  /** Whether the buyer name and last name are required, optional or cannot be specified. */
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PersonDataFieldStatus = exports.BuyerDataStatus = exports.initializePerson = exports.DEFAULT_PERSON = void 0;
3
+ exports.PersonDataFieldStatus = exports.initializePerson = exports.DEFAULT_PERSON = void 0;
4
4
  exports.DEFAULT_PERSON = {
5
5
  id: 0,
6
6
  personCode: "",
@@ -17,16 +17,6 @@ var initializePerson = function (person) {
17
17
  return person;
18
18
  };
19
19
  exports.initializePerson = initializePerson;
20
- /** @deprecated Use PersonDataFieldStatus */
21
- var BuyerDataStatus;
22
- (function (BuyerDataStatus) {
23
- /** The buyer data are optional. PersonDetails form shall be displayed, but the user can skip it. */
24
- BuyerDataStatus[BuyerDataStatus["OPTIONAL"] = 0] = "OPTIONAL";
25
- /** The buyer data are required. PersonDetails form shall be displayed and the user cannot skip it. */
26
- BuyerDataStatus[BuyerDataStatus["REQUIRED"] = 1] = "REQUIRED";
27
- /** The buyer data cannot be specified. PersonDetails form shall not be displayed. */
28
- BuyerDataStatus[BuyerDataStatus["CANNOT_BE_SPECIFIED"] = 2] = "CANNOT_BE_SPECIFIED";
29
- })(BuyerDataStatus || (exports.BuyerDataStatus = BuyerDataStatus = {}));
30
20
  var PersonDataFieldStatus;
31
21
  (function (PersonDataFieldStatus) {
32
22
  /** The field (e.g. the buyer's email) is optional. The input shall be displayed, but the user can skip it. */
@@ -4,55 +4,48 @@ export declare enum ReductionType {
4
4
  WALLET = "WALLET",
5
5
  CASH = "CASH"
6
6
  }
7
- /**
8
- * @description This type represents a reduction applied to the cart. Reductions are applied in the booking step `DISCOUNTS`.
9
- *
10
- * @property {ReductionType} type The type of the reduction
11
- * @property {number} tripId The id of the trip to which the reduction is applied
12
- * @property {string} tripName The name of the trip to which the reduction is applied
13
- * @property {number} value The value of the reduction
14
- * @property {boolean} isPercentage If true, the reduction is a percentage. In this case, it is a number from 0 to 1.
15
- * Otherwise, it is in the currency of the cart.
16
- * @property {string} [voucherCode=undefined] The voucher code used to apply the reduction
17
- */
18
7
  export type Reduction = {
8
+ /**
9
+ * The type of the reduction
10
+ * @see ReductionType
11
+ */
19
12
  type: ReductionType;
13
+ /** The id of the trip to which the reduction is applied */
20
14
  tripId: number;
15
+ /** The name of the trip to which the reduction is applied */
21
16
  tripName: string;
17
+ /** The value of the reduction */
22
18
  value: number;
19
+ /** If true, the reduction is a percentage (a number from 0 to 1). Otherwise, it is in the currency of the cart. */
23
20
  isPercentage: boolean;
21
+ /** The voucher code used to apply the reduction */
24
22
  voucherCode?: string;
25
23
  };
26
24
  /**
27
25
  * @description This type represents a request to add a reduction to the cart
28
- *
29
- * @property {number} tripId The id of the trip to which the reduction is applied. If the tripId is 0,
30
- * then the reduction will be applied to the whole cart
31
- * @property {number} reduction The value of the reduction
32
- * @property {boolean} isPercentage If true, the reduction is a percentage. In this case, it is a number from 0 to 1.
33
- * Otherwise, it is in the currency of the cart (the value must be greater than 0)
34
26
  */
35
27
  export type AddReductionRequest = {
28
+ /** The id of the trip to which the reduction is applied. If the tripId is 0, then the reduction will be applied to the whole cart */
36
29
  tripId: number;
30
+ /** The value of the reduction */
37
31
  reduction: number;
32
+ /** If true, the reduction is a percentage. In this case, it is a number from 0 to 1. Otherwise, it is in the currency of the cart (the value must be greater than 0) */
38
33
  isPercentage: boolean;
39
34
  };
40
35
  /**
41
36
  * @description This type represents a response to add a reduction to the cart. It is used in the APIs
42
37
  * {@link Booking.addReduction}, {@link Booking.useVoucher} and {@link Booking.useWallet}
43
- *
44
- * @property {Reduction} reduction Information about the reduction applied
45
38
  */
46
39
  export type ReductionResponse = BaseReductionResponse & {
40
+ /** Information about the reduction applied */
47
41
  reduction: Reduction;
48
42
  };
49
43
  /**
50
44
  * @description This type represents a base response to handle reduction in the cart. It is used in the APIs
51
45
  * {@link Booking.addReduction}, {@link Booking.removeReduction} {@link Booking.useVoucher}, {@link Booking.useWallet}
52
46
  * and {@link Booking.removeWalletReduction}
53
- *
54
- * @property {number} totalAmountToPay The total amount to pay after the reduction was applied
55
47
  */
56
48
  export type BaseReductionResponse = BaseBookingProcessResponse & {
49
+ /** The total amount to pay after the reduction was applied */
57
50
  totalAmountToPay: number;
58
51
  };
@@ -20,8 +20,6 @@ export type Tariff = {
20
20
  extraId: number | null;
21
21
  /** The value of the tariff (in the currency specified in the {@link Booking} object) */
22
22
  value: number;
23
- /** @deprecated Use {@link Tariff.valueCurrencies} instead */
24
- currency: null;
25
23
  /** The value of the tariff in the different currencies */
26
24
  valueCurrencies: {
27
25
  percentage: number | null;
@@ -0,0 +1,8 @@
1
+ export type DateWithTimeZone = {
2
+ /** The date in ISO string format */
3
+ dateTime: string;
4
+ /** The time zone of the date */
5
+ timeZone: IanaTimeZone | null;
6
+ };
7
+ export type IanaTimeZone = (typeof timeZones)[number];
8
+ export declare const timeZones: readonly ["Pacific/Midway", "Pacific/Pago_Pago", "Pacific/Niue", "Pacific/Rarotonga", "America/Adak", "Pacific/Honolulu", "Pacific/Tahiti", "Pacific/Marquesas", "America/Anchorage", "Pacific/Gambier", "America/Los_Angeles", "America/Tijuana", "America/Vancouver", "Pacific/Pitcairn", "America/Hermosillo", "America/Edmonton", "America/Ciudad_Juarez", "America/Denver", "America/Phoenix", "America/Whitehorse", "America/Belize", "America/Chicago", "America/Guatemala", "America/Managua", "America/Mexico_City", "America/Matamoros", "America/Costa_Rica", "America/El_Salvador", "America/Regina", "America/Tegucigalpa", "America/Winnipeg", "Pacific/Easter", "Pacific/Galapagos", "America/Rio_Branco", "America/Bogota", "America/Havana", "America/Atikokan", "America/Cancun", "America/Cayman", "America/Jamaica", "America/Nassau", "America/New_York", "America/Panama", "America/Port-au-Prince", "America/Grand_Turk", "America/Toronto", "America/Guayaquil", "America/Lima", "America/Manaus", "America/St_Kitts", "America/Blanc-Sablon", "America/Montserrat", "America/Barbados", "America/Port_of_Spain", "America/Martinique", "America/St_Lucia", "America/St_Barthelemy", "America/Halifax", "Atlantic/Bermuda", "America/St_Vincent", "America/Kralendijk", "America/Guadeloupe", "America/Marigot", "America/Aruba", "America/Lower_Princes", "America/Tortola", "America/Dominica", "America/St_Thomas", "America/Grenada", "America/Antigua", "America/Puerto_Rico", "America/Santo_Domingo", "America/Anguilla", "America/Thule", "America/Curacao", "America/La_Paz", "America/Santiago", "America/Guyana", "America/Caracas", "America/St_Johns", "America/Argentina/Buenos_Aires", "America/Sao_Paulo", "Antarctica/Palmer", "America/Punta_Arenas", "Atlantic/Stanley", "America/Cayenne", "America/Asuncion", "America/Miquelon", "America/Paramaribo", "America/Montevideo", "America/Noronha", "America/Nuuk", "Atlantic/South_Georgia", "Atlantic/Azores", "Atlantic/Cape_Verde", "Africa/Abidjan", "Africa/Bamako", "Africa/Bissau", "Africa/Conakry", "Africa/Dakar", "America/Danmarkshavn", "Europe/Isle_of_Man", "Europe/Dublin", "Africa/Freetown", "Atlantic/St_Helena", "Africa/Accra", "Africa/Lome", "Europe/London", "Africa/Monrovia", "Africa/Nouakchott", "Africa/Ouagadougou", "Atlantic/Reykjavik", "Europe/Jersey", "Europe/Guernsey", "Africa/Banjul", "Africa/Sao_Tome", "Antarctica/Troll", "Africa/Casablanca", "Africa/El_Aaiun", "Atlantic/Canary", "Europe/Lisbon", "Atlantic/Faroe", "Africa/Windhoek", "Africa/Algiers", "Europe/Amsterdam", "Europe/Andorra", "Europe/Belgrade", "Europe/Berlin", "Europe/Bratislava", "Europe/Brussels", "Europe/Budapest", "Europe/Copenhagen", "Europe/Gibraltar", "Europe/Ljubljana", "Arctic/Longyearbyen", "Europe/Luxembourg", "Europe/Madrid", "Europe/Monaco", "Europe/Oslo", "Europe/Paris", "Europe/Podgorica", "Europe/Prague", "Europe/Rome", "Europe/San_Marino", "Europe/Malta", "Europe/Sarajevo", "Europe/Skopje", "Europe/Stockholm", "Europe/Tirane", "Africa/Tunis", "Europe/Vaduz", "Europe/Vatican", "Europe/Vienna", "Europe/Warsaw", "Europe/Zagreb", "Europe/Zurich", "Africa/Bangui", "Africa/Malabo", "Africa/Brazzaville", "Africa/Porto-Novo", "Africa/Douala", "Africa/Kinshasa", "Africa/Lagos", "Africa/Libreville", "Africa/Luanda", "Africa/Ndjamena", "Africa/Niamey", "Africa/Bujumbura", "Africa/Gaborone", "Africa/Harare", "Africa/Juba", "Africa/Khartoum", "Africa/Kigali", "Africa/Blantyre", "Africa/Lubumbashi", "Africa/Lusaka", "Africa/Maputo", "Europe/Athens", "Asia/Beirut", "Europe/Bucharest", "Africa/Cairo", "Europe/Chisinau", "Asia/Hebron", "Europe/Helsinki", "Europe/Kaliningrad", "Europe/Kyiv", "Europe/Mariehamn", "Asia/Nicosia", "Europe/Riga", "Europe/Sofia", "Europe/Tallinn", "Africa/Tripoli", "Europe/Vilnius", "Asia/Jerusalem", "Africa/Johannesburg", "Africa/Mbabane", "Africa/Maseru", "Asia/Kuwait", "Asia/Bahrain", "Asia/Baghdad", "Asia/Qatar", "Asia/Riyadh", "Asia/Aden", "Asia/Amman", "Asia/Damascus", "Africa/Addis_Ababa", "Indian/Antananarivo", "Africa/Asmara", "Africa/Dar_es_Salaam", "Africa/Djibouti", "Africa/Kampala", "Indian/Mayotte", "Africa/Mogadishu", "Indian/Comoro", "Africa/Nairobi", "Europe/Minsk", "Europe/Moscow", "Europe/Simferopol", "Antarctica/Syowa", "Europe/Istanbul", "Asia/Tehran", "Asia/Yerevan", "Asia/Baku", "Asia/Tbilisi", "Asia/Dubai", "Asia/Muscat", "Indian/Mauritius", "Indian/Reunion", "Europe/Samara", "Indian/Mahe", "Asia/Kabul", "Indian/Kerguelen", "Asia/Almaty", "Indian/Maldives", "Antarctica/Mawson", "Asia/Karachi", "Asia/Dushanbe", "Asia/Ashgabat", "Asia/Tashkent", "Asia/Yekaterinburg", "Asia/Colombo", "Asia/Kolkata", "Asia/Kathmandu", "Asia/Dhaka", "Asia/Thimphu", "Asia/Urumqi", "Indian/Chagos", "Asia/Bishkek", "Asia/Omsk", "Indian/Cocos", "Asia/Yangon", "Indian/Christmas", "Antarctica/Davis", "Asia/Hovd", "Asia/Bangkok", "Asia/Ho_Chi_Minh", "Asia/Phnom_Penh", "Asia/Vientiane", "Asia/Novosibirsk", "Asia/Jakarta", "Antarctica/Casey", "Australia/Perth", "Asia/Brunei", "Asia/Makassar", "Asia/Macau", "Asia/Shanghai", "Asia/Hong_Kong", "Asia/Irkutsk", "Asia/Kuala_Lumpur", "Asia/Manila", "Asia/Singapore", "Asia/Taipei", "Asia/Ulaanbaatar", "Australia/Eucla", "Asia/Jayapura", "Asia/Tokyo", "Asia/Pyongyang", "Asia/Seoul", "Pacific/Palau", "Asia/Dili", "Asia/Chita", "Australia/Adelaide", "Australia/Darwin", "Australia/Brisbane", "Australia/Sydney", "Pacific/Guam", "Pacific/Saipan", "Pacific/Chuuk", "Antarctica/DumontDUrville", "Pacific/Port_Moresby", "Asia/Vladivostok", "Australia/Lord_Howe", "Pacific/Bougainville", "Pacific/Kosrae", "Pacific/Noumea", "Pacific/Norfolk", "Asia/Sakhalin", "Pacific/Guadalcanal", "Pacific/Efate", "Pacific/Fiji", "Pacific/Tarawa", "Asia/Kamchatka", "Pacific/Majuro", "Pacific/Nauru", "Pacific/Auckland", "Antarctica/McMurdo", "Pacific/Funafuti", "Pacific/Wake", "Pacific/Wallis", "Pacific/Chatham", "Pacific/Kanton", "Pacific/Apia", "Pacific/Fakaofo", "Pacific/Tongatapu", "Pacific/Kiritimati"];
@@ -0,0 +1,320 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.timeZones = void 0;
4
+ exports.timeZones = [
5
+ "Pacific/Midway",
6
+ "Pacific/Pago_Pago",
7
+ "Pacific/Niue",
8
+ "Pacific/Rarotonga",
9
+ "America/Adak",
10
+ "Pacific/Honolulu",
11
+ "Pacific/Tahiti",
12
+ "Pacific/Marquesas",
13
+ "America/Anchorage",
14
+ "Pacific/Gambier",
15
+ "America/Los_Angeles",
16
+ "America/Tijuana",
17
+ "America/Vancouver",
18
+ "Pacific/Pitcairn",
19
+ "America/Hermosillo",
20
+ "America/Edmonton",
21
+ "America/Ciudad_Juarez",
22
+ "America/Denver",
23
+ "America/Phoenix",
24
+ "America/Whitehorse",
25
+ "America/Belize",
26
+ "America/Chicago",
27
+ "America/Guatemala",
28
+ "America/Managua",
29
+ "America/Mexico_City",
30
+ "America/Matamoros",
31
+ "America/Costa_Rica",
32
+ "America/El_Salvador",
33
+ "America/Regina",
34
+ "America/Tegucigalpa",
35
+ "America/Winnipeg",
36
+ "Pacific/Easter",
37
+ "Pacific/Galapagos",
38
+ "America/Rio_Branco",
39
+ "America/Bogota",
40
+ "America/Havana",
41
+ "America/Atikokan",
42
+ "America/Cancun",
43
+ "America/Cayman",
44
+ "America/Jamaica",
45
+ "America/Nassau",
46
+ "America/New_York",
47
+ "America/Panama",
48
+ "America/Port-au-Prince",
49
+ "America/Grand_Turk",
50
+ "America/Toronto",
51
+ "America/Guayaquil",
52
+ "America/Lima",
53
+ "America/Manaus",
54
+ "America/St_Kitts",
55
+ "America/Blanc-Sablon",
56
+ "America/Montserrat",
57
+ "America/Barbados",
58
+ "America/Port_of_Spain",
59
+ "America/Martinique",
60
+ "America/St_Lucia",
61
+ "America/St_Barthelemy",
62
+ "America/Halifax",
63
+ "Atlantic/Bermuda",
64
+ "America/St_Vincent",
65
+ "America/Kralendijk",
66
+ "America/Guadeloupe",
67
+ "America/Marigot",
68
+ "America/Aruba",
69
+ "America/Lower_Princes",
70
+ "America/Tortola",
71
+ "America/Dominica",
72
+ "America/St_Thomas",
73
+ "America/Grenada",
74
+ "America/Antigua",
75
+ "America/Puerto_Rico",
76
+ "America/Santo_Domingo",
77
+ "America/Anguilla",
78
+ "America/Thule",
79
+ "America/Curacao",
80
+ "America/La_Paz",
81
+ "America/Santiago",
82
+ "America/Guyana",
83
+ "America/Caracas",
84
+ "America/St_Johns",
85
+ "America/Argentina/Buenos_Aires",
86
+ "America/Sao_Paulo",
87
+ "Antarctica/Palmer",
88
+ "America/Punta_Arenas",
89
+ "Atlantic/Stanley",
90
+ "America/Cayenne",
91
+ "America/Asuncion",
92
+ "America/Miquelon",
93
+ "America/Paramaribo",
94
+ "America/Montevideo",
95
+ "America/Noronha",
96
+ "America/Nuuk",
97
+ "Atlantic/South_Georgia",
98
+ "Atlantic/Azores",
99
+ "Atlantic/Cape_Verde",
100
+ "Africa/Abidjan",
101
+ "Africa/Bamako",
102
+ "Africa/Bissau",
103
+ "Africa/Conakry",
104
+ "Africa/Dakar",
105
+ "America/Danmarkshavn",
106
+ "Europe/Isle_of_Man",
107
+ "Europe/Dublin",
108
+ "Africa/Freetown",
109
+ "Atlantic/St_Helena",
110
+ "Africa/Accra",
111
+ "Africa/Lome",
112
+ "Europe/London",
113
+ "Africa/Monrovia",
114
+ "Africa/Nouakchott",
115
+ "Africa/Ouagadougou",
116
+ "Atlantic/Reykjavik",
117
+ "Europe/Jersey",
118
+ "Europe/Guernsey",
119
+ "Africa/Banjul",
120
+ "Africa/Sao_Tome",
121
+ "Antarctica/Troll",
122
+ "Africa/Casablanca",
123
+ "Africa/El_Aaiun",
124
+ "Atlantic/Canary",
125
+ "Europe/Lisbon",
126
+ "Atlantic/Faroe",
127
+ "Africa/Windhoek",
128
+ "Africa/Algiers",
129
+ "Europe/Amsterdam",
130
+ "Europe/Andorra",
131
+ "Europe/Belgrade",
132
+ "Europe/Berlin",
133
+ "Europe/Bratislava",
134
+ "Europe/Brussels",
135
+ "Europe/Budapest",
136
+ "Europe/Copenhagen",
137
+ "Europe/Gibraltar",
138
+ "Europe/Ljubljana",
139
+ "Arctic/Longyearbyen",
140
+ "Europe/Luxembourg",
141
+ "Europe/Madrid",
142
+ "Europe/Monaco",
143
+ "Europe/Oslo",
144
+ "Europe/Paris",
145
+ "Europe/Podgorica",
146
+ "Europe/Prague",
147
+ "Europe/Rome",
148
+ "Europe/San_Marino",
149
+ "Europe/Malta",
150
+ "Europe/Sarajevo",
151
+ "Europe/Skopje",
152
+ "Europe/Stockholm",
153
+ "Europe/Tirane",
154
+ "Africa/Tunis",
155
+ "Europe/Vaduz",
156
+ "Europe/Vatican",
157
+ "Europe/Vienna",
158
+ "Europe/Warsaw",
159
+ "Europe/Zagreb",
160
+ "Europe/Zurich",
161
+ "Africa/Bangui",
162
+ "Africa/Malabo",
163
+ "Africa/Brazzaville",
164
+ "Africa/Porto-Novo",
165
+ "Africa/Douala",
166
+ "Africa/Kinshasa",
167
+ "Africa/Lagos",
168
+ "Africa/Libreville",
169
+ "Africa/Luanda",
170
+ "Africa/Ndjamena",
171
+ "Africa/Niamey",
172
+ "Africa/Bujumbura",
173
+ "Africa/Gaborone",
174
+ "Africa/Harare",
175
+ "Africa/Juba",
176
+ "Africa/Khartoum",
177
+ "Africa/Kigali",
178
+ "Africa/Blantyre",
179
+ "Africa/Lubumbashi",
180
+ "Africa/Lusaka",
181
+ "Africa/Maputo",
182
+ "Europe/Athens",
183
+ "Asia/Beirut",
184
+ "Europe/Bucharest",
185
+ "Africa/Cairo",
186
+ "Europe/Chisinau",
187
+ "Asia/Hebron",
188
+ "Europe/Helsinki",
189
+ "Europe/Kaliningrad",
190
+ "Europe/Kyiv",
191
+ "Europe/Mariehamn",
192
+ "Asia/Nicosia",
193
+ "Europe/Riga",
194
+ "Europe/Sofia",
195
+ "Europe/Tallinn",
196
+ "Africa/Tripoli",
197
+ "Europe/Vilnius",
198
+ "Asia/Jerusalem",
199
+ "Africa/Johannesburg",
200
+ "Africa/Mbabane",
201
+ "Africa/Maseru",
202
+ "Asia/Kuwait",
203
+ "Asia/Bahrain",
204
+ "Asia/Baghdad",
205
+ "Asia/Qatar",
206
+ "Asia/Riyadh",
207
+ "Asia/Aden",
208
+ "Asia/Amman",
209
+ "Asia/Damascus",
210
+ "Africa/Addis_Ababa",
211
+ "Indian/Antananarivo",
212
+ "Africa/Asmara",
213
+ "Africa/Dar_es_Salaam",
214
+ "Africa/Djibouti",
215
+ "Africa/Kampala",
216
+ "Indian/Mayotte",
217
+ "Africa/Mogadishu",
218
+ "Indian/Comoro",
219
+ "Africa/Nairobi",
220
+ "Europe/Minsk",
221
+ "Europe/Moscow",
222
+ "Europe/Simferopol",
223
+ "Antarctica/Syowa",
224
+ "Europe/Istanbul",
225
+ "Asia/Tehran",
226
+ "Asia/Yerevan",
227
+ "Asia/Baku",
228
+ "Asia/Tbilisi",
229
+ "Asia/Dubai",
230
+ "Asia/Muscat",
231
+ "Indian/Mauritius",
232
+ "Indian/Reunion",
233
+ "Europe/Samara",
234
+ "Indian/Mahe",
235
+ "Asia/Kabul",
236
+ "Indian/Kerguelen",
237
+ "Asia/Almaty",
238
+ "Indian/Maldives",
239
+ "Antarctica/Mawson",
240
+ "Asia/Karachi",
241
+ "Asia/Dushanbe",
242
+ "Asia/Ashgabat",
243
+ "Asia/Tashkent",
244
+ "Asia/Yekaterinburg",
245
+ "Asia/Colombo",
246
+ "Asia/Kolkata",
247
+ "Asia/Kathmandu",
248
+ "Asia/Dhaka",
249
+ "Asia/Thimphu",
250
+ "Asia/Urumqi",
251
+ "Indian/Chagos",
252
+ "Asia/Bishkek",
253
+ "Asia/Omsk",
254
+ "Indian/Cocos",
255
+ "Asia/Yangon",
256
+ "Indian/Christmas",
257
+ "Antarctica/Davis",
258
+ "Asia/Hovd",
259
+ "Asia/Bangkok",
260
+ "Asia/Ho_Chi_Minh",
261
+ "Asia/Phnom_Penh",
262
+ "Asia/Vientiane",
263
+ "Asia/Novosibirsk",
264
+ "Asia/Jakarta",
265
+ "Antarctica/Casey",
266
+ "Australia/Perth",
267
+ "Asia/Brunei",
268
+ "Asia/Makassar",
269
+ "Asia/Macau",
270
+ "Asia/Shanghai",
271
+ "Asia/Hong_Kong",
272
+ "Asia/Irkutsk",
273
+ "Asia/Kuala_Lumpur",
274
+ "Asia/Manila",
275
+ "Asia/Singapore",
276
+ "Asia/Taipei",
277
+ "Asia/Ulaanbaatar",
278
+ "Australia/Eucla",
279
+ "Asia/Jayapura",
280
+ "Asia/Tokyo",
281
+ "Asia/Pyongyang",
282
+ "Asia/Seoul",
283
+ "Pacific/Palau",
284
+ "Asia/Dili",
285
+ "Asia/Chita",
286
+ "Australia/Adelaide",
287
+ "Australia/Darwin",
288
+ "Australia/Brisbane",
289
+ "Australia/Sydney",
290
+ "Pacific/Guam",
291
+ "Pacific/Saipan",
292
+ "Pacific/Chuuk",
293
+ "Antarctica/DumontDUrville",
294
+ "Pacific/Port_Moresby",
295
+ "Asia/Vladivostok",
296
+ "Australia/Lord_Howe",
297
+ "Pacific/Bougainville",
298
+ "Pacific/Kosrae",
299
+ "Pacific/Noumea",
300
+ "Pacific/Norfolk",
301
+ "Asia/Sakhalin",
302
+ "Pacific/Guadalcanal",
303
+ "Pacific/Efate",
304
+ "Pacific/Fiji",
305
+ "Pacific/Tarawa",
306
+ "Asia/Kamchatka",
307
+ "Pacific/Majuro",
308
+ "Pacific/Nauru",
309
+ "Pacific/Auckland",
310
+ "Antarctica/McMurdo",
311
+ "Pacific/Funafuti",
312
+ "Pacific/Wake",
313
+ "Pacific/Wallis",
314
+ "Pacific/Chatham",
315
+ "Pacific/Kanton",
316
+ "Pacific/Apia",
317
+ "Pacific/Fakaofo",
318
+ "Pacific/Tongatapu",
319
+ "Pacific/Kiritimati"
320
+ ];
@@ -22,24 +22,6 @@ export type TripBookingInfo = {
22
22
  /** A string in base64 representing the picture of the ticket that was sold */
23
23
  otaTicketPicture?: string;
24
24
  };
25
- /**
26
- * @description This is the object to be passed to {@link JourneyBooking.createJourneyCart}, containing information about the selected service.
27
- */
28
- export type CreateJourneyCartRequest = {
29
- /** The unique identifier for the cart. This should be passed during the change process to link the new ticket to the already existing change cart */
30
- cartGuid?: string;
31
- /** The currency in which the journey is priced */
32
- currency: Booking.Currencies;
33
- /**
34
- * Information about outbound journeys. This is an array of {@link TripBookingInfo} objects.
35
- * Note that when searching for journeys, the `trips` property of the {@link JourneySearchResult} object contains an array of {@link Trip} objects.
36
- * Each trip should be mapped into a {@link TripBookingInfo} object.
37
- */
38
- outboundJourney: TripBookingInfo[];
39
- /** Information about return journeys (optional, can be null). See outboundJourney. */
40
- returnJourney: TripBookingInfo[] | null;
41
- };
42
- export declare const DEFAULT_CREATE_JOURNEY_CART: CreateJourneyCartRequest;
43
25
  /**
44
26
  * @description Represents a `JourneyCart`, which extends the {@link Cart} type by including additional
45
27
  * information about the bookings
@@ -1,10 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEFAULT_CREATE_JOURNEY_CART = void 0;
4
- var booking_1 = require("../../booking/booking");
5
- exports.DEFAULT_CREATE_JOURNEY_CART = {
6
- cartGuid: undefined,
7
- currency: booking_1.Booking.Currencies.EUR,
8
- outboundJourney: [],
9
- returnJourney: null
10
- };
@@ -1,20 +1,19 @@
1
1
  /**
2
2
  * @description Represents information about a journey.
3
- *
4
- * @property {string} sellerName - The name of the seller operating the journey.
5
- * @property {string} sellerId - The id of the seller operating the journey.
6
- * @property {string} minimumTotalPrice - The minimum total price for booking the journey, meaning the price if all passenger choose the cheapest tariff.
7
- * @property {number} remainingSeats - The number of remaining seats for the journey.
8
- * @property {number} totalNumberOfSeats - The total number of seats for the journey (including booked seats).
9
- * @property {string} bookingProcessMessage - Optional message to be displayed to the user when booking this journey.
10
- * @property {boolean} isBookable - Indicates whether the journey is bookable (true) or not (false).
11
3
  */
12
4
  export type JourneyInfo = {
5
+ /** The name of the seller operating the journey. */
13
6
  sellerName: string;
7
+ /** The id of the seller operating the journey. */
14
8
  sellerId: string;
9
+ /** The minimum total price for booking the journey, meaning the price if all passengers choose the cheapest tariff. */
15
10
  minimumTotalPrice: string;
11
+ /** The number of remaining seats for the journey. */
16
12
  remainingSeats: number;
13
+ /** The total number of seats for the journey (including booked seats). */
17
14
  totalNumberOfSeats: number;
15
+ /** Optional message to be displayed to the user when booking this journey. */
18
16
  bookingProcessMessage: string;
17
+ /** Indicates whether the journey is bookable (true) or not (false). */
19
18
  isBookable: boolean;
20
19
  };
@@ -1,4 +1,5 @@
1
1
  import { Booking } from "../../booking/booking";
2
+ import { DateWithTimeZone } from "../common/dates";
2
3
  import { JourneyInfo } from "./JourneyInfo";
3
4
  import { Stop } from "./Stop";
4
5
  import { Trip } from "./Trip";
@@ -6,15 +7,15 @@ export type JourneySearchRequest = {
6
7
  departureStopName: string | undefined;
7
8
  destinationStopName: string | undefined;
8
9
  passengersNumber: number;
9
- date: string;
10
- roundTripDate?: string | null;
10
+ outboundDate: DateWithTimeZone;
11
+ returnDate?: DateWithTimeZone | null;
11
12
  currency: Booking.Currencies;
12
- isRoundtrip: boolean;
13
+ isRoundTrip: boolean;
13
14
  outboundTripId?: number | null;
14
15
  };
15
16
  export declare const DEFAULT_JOURNEY_SEARCH: JourneySearchRequest;
16
17
  export type JourneySearchResult = {
17
18
  stops: Stop[];
18
19
  info: JourneyInfo;
19
- trips: Trip[];
20
+ journeyTrips: Trip[];
20
21
  };
@@ -6,9 +6,14 @@ exports.DEFAULT_JOURNEY_SEARCH = {
6
6
  departureStopName: "",
7
7
  destinationStopName: "",
8
8
  passengersNumber: 1,
9
- date: new Date(Date.UTC(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), 0, 1))
10
- .toISOString()
11
- .slice(0, -1),
12
- currency: booking_1.Booking.Currencies.EUR,
13
- isRoundtrip: false
9
+ outboundDate: {
10
+ dateTime: new Date().toISOString(),
11
+ timeZone: "Europe/Rome"
12
+ },
13
+ returnDate: {
14
+ dateTime: new Date().toISOString(),
15
+ timeZone: "Europe/Rome"
16
+ },
17
+ isRoundTrip: false,
18
+ currency: booking_1.Booking.Currencies.EUR
14
19
  };
@@ -1,20 +1,16 @@
1
+ import { DateWithTimeZone } from "../common/dates";
1
2
  /**
2
3
  * @description Represents a stop in a journey.
3
- *
4
- * @property {number} id - The unique identifier for the stop.
5
- * @property {Date} departureTime - The time when the journey departs from this stop.
6
- * @property {Date} destinationTime - The time when the journey arrives at this stop.
7
- * @property {string} departureTimeString - The departure time as a formatted ISO string.
8
- * @property {string} destinationTimeString - The destination time as a formatted ISO string.
9
- * @property {string} name - The name of the stop.
10
- * @property {string} address - The address of the stop.
11
4
  */
12
5
  export type Stop = {
6
+ /** The unique identifier for the stop */
13
7
  id: number;
14
- departureTime: Date;
15
- departureTimeString: string;
16
- destinationTime: Date;
17
- destinationTimeString: string;
8
+ /** The time when the journey departs from this stop in ISO string format */
9
+ departureDateTime: DateWithTimeZone;
10
+ /** The time when the journey arrives at this stop in ISO string format */
11
+ destinationDateTime: DateWithTimeZone;
12
+ /** The name of the stop */
18
13
  name: string;
14
+ /** The address of the stop */
19
15
  address: string;
20
16
  };