mts-booking-library 3.0.7 → 3.0.8
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/lib/booking/tplBooking.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +3 -1
- package/lib/types/tpl/SuperArea.d.ts +15 -0
- package/lib/types/tpl/SuperArea.js +10 -0
- package/package.json +1 -1
|
@@ -237,7 +237,7 @@ var TplBooking = /** @class */ (function (_super) {
|
|
|
237
237
|
return __awaiter(this, void 0, void 0, function () {
|
|
238
238
|
var searchParams, url;
|
|
239
239
|
return __generator(this, function (_a) {
|
|
240
|
-
searchParams = new URLSearchParams(__assign(__assign({ includeBasicInfo: "true", includeImage: "true", includeAreaIds: "false", includeTariffIds: "false", includeRouteIds: "false", includeMultilingualDescriptions: "false" }, (request.cityId && { cityId: request.cityId.toString() })), (request.tripId && { tripId: request.tripId.toString() })));
|
|
240
|
+
searchParams = new URLSearchParams(__assign(__assign(__assign({ includeBasicInfo: "true", includeImage: "true", includeAreaIds: "false", includeTariffIds: "false", includeRouteIds: "false", includeMultilingualDescriptions: "false" }, (request.cityId && { cityId: request.cityId.toString() })), (request.tripId && { tripId: request.tripId.toString() })), (request.type && { type: request.type })));
|
|
241
241
|
url = "".concat(this.config.API_ENDPOINT, "/v3_resources/superAreas?").concat(searchParams);
|
|
242
242
|
return [2 /*return*/, this.callGetApi(url, options).then(function (response) {
|
|
243
243
|
return (0, ErrorResponse_1.objectIsMTSErrorResponse)(response) ? response : response.superAreas;
|
package/lib/index.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export { Service, ServiceTrip } from "./types/services/Service";
|
|
|
26
26
|
export { ServiceCart, ServiceBookingType } from "./types/services/ServiceCart";
|
|
27
27
|
export { ServiceInfo } from "./types/services/ServiceInfo";
|
|
28
28
|
export { GetTariffsResponse } from "./types/tpl/GetTariffsResponse";
|
|
29
|
-
export { SuperArea, GetSuperAreasRequest } from "./types/tpl/SuperArea";
|
|
29
|
+
export { SuperArea, GetSuperAreasRequest, SuperAreasTypeFilter } from "./types/tpl/SuperArea";
|
|
30
30
|
export { TplCart, TplBookingType, TplBookingInfo } from "./types/tpl/TplCart";
|
|
31
31
|
export { Subscription } from "./types/subscriptions/Subscriptions";
|
|
32
32
|
export { GetSubscriptionAvailabilityRequest, GetSubscriptionAvailabilityResponse, SubscriptionCalendarDayPeriodInfo } from "./types/subscriptions/SubscriptionAvailabilities";
|
package/lib/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.DEFAULT_JOURNEY_SEARCH = exports.SeatStatus = exports.BusCellTypes = exports.objectIsMTSErrorResponse = exports.PaymentMethods = exports.GatewayTypes = exports.ReductionType = exports.initializePerson = exports.DEFAULT_PERSON = exports.isNullOrWhiteSpace = exports.isNullOrUndefined = exports.useMtsBookingState = exports.TplBooking = exports.SubscriptionBooking = exports.ServiceBooking = exports.JourneyBooking = exports.Booking = void 0;
|
|
17
|
+
exports.SuperAreasTypeFilter = exports.DEFAULT_JOURNEY_SEARCH = exports.SeatStatus = exports.BusCellTypes = exports.objectIsMTSErrorResponse = exports.PaymentMethods = exports.GatewayTypes = exports.ReductionType = exports.initializePerson = exports.DEFAULT_PERSON = exports.isNullOrWhiteSpace = exports.isNullOrUndefined = exports.useMtsBookingState = exports.TplBooking = exports.SubscriptionBooking = exports.ServiceBooking = exports.JourneyBooking = exports.Booking = void 0;
|
|
18
18
|
//#region Export Booking classes
|
|
19
19
|
var booking_1 = require("./booking/booking");
|
|
20
20
|
Object.defineProperty(exports, "Booking", { enumerable: true, get: function () { return booking_1.Booking; } });
|
|
@@ -53,4 +53,6 @@ Object.defineProperty(exports, "BusCellTypes", { enumerable: true, get: function
|
|
|
53
53
|
Object.defineProperty(exports, "SeatStatus", { enumerable: true, get: function () { return BusMatrix_1.SeatStatus; } });
|
|
54
54
|
var JourneySearch_1 = require("./types/journeys/JourneySearch");
|
|
55
55
|
Object.defineProperty(exports, "DEFAULT_JOURNEY_SEARCH", { enumerable: true, get: function () { return JourneySearch_1.DEFAULT_JOURNEY_SEARCH; } });
|
|
56
|
+
var SuperArea_1 = require("./types/tpl/SuperArea");
|
|
57
|
+
Object.defineProperty(exports, "SuperAreasTypeFilter", { enumerable: true, get: function () { return SuperArea_1.SuperAreasTypeFilter; } });
|
|
56
58
|
//#endregion
|
|
@@ -13,9 +13,24 @@ export type SuperArea = {
|
|
|
13
13
|
/** The url of the image of the super area */
|
|
14
14
|
imageUrl: string;
|
|
15
15
|
};
|
|
16
|
+
export declare enum SuperAreasTypeFilter {
|
|
17
|
+
/** No filter applied (default). */
|
|
18
|
+
ALL = "ALL",
|
|
19
|
+
/** Only super areas whose tariffs are classified as tours. */
|
|
20
|
+
TOURS_ONLY = "TOURS_ONLY",
|
|
21
|
+
/** Only super areas whose tariffs are classified as regular tickets. */
|
|
22
|
+
REGULAR_ONLY = "REGULAR_ONLY"
|
|
23
|
+
}
|
|
16
24
|
export type GetSuperAreasRequest = {
|
|
17
25
|
/** The id of the city (as returned by the {@link TplBooking.getCities} method). If present, only the super areas associated with this city will be returned. */
|
|
18
26
|
cityId?: number;
|
|
19
27
|
/** The id of the trip. If present, only the super areas associated with this trip will be returned. This is used by the app. */
|
|
20
28
|
tripId?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Filters super areas by their tour classification (case-insensitive).
|
|
31
|
+
* Accepted values: "ALL" (default – no filter applied, all super areas are returned; this is also the behaviour when the parameter is omitted),
|
|
32
|
+
* "TOURS_ONLY" (only super areas whose tariffs are classified as tours), "REGULAR_ONLY" (only super areas whose tariffs are classified as regular ticket).
|
|
33
|
+
* A super area cannot simultaneously be a tour and a regular super area.
|
|
34
|
+
*/
|
|
35
|
+
type?: SuperAreasTypeFilter;
|
|
21
36
|
};
|
|
@@ -1,2 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SuperAreasTypeFilter = void 0;
|
|
4
|
+
var SuperAreasTypeFilter;
|
|
5
|
+
(function (SuperAreasTypeFilter) {
|
|
6
|
+
/** No filter applied (default). */
|
|
7
|
+
SuperAreasTypeFilter["ALL"] = "ALL";
|
|
8
|
+
/** Only super areas whose tariffs are classified as tours. */
|
|
9
|
+
SuperAreasTypeFilter["TOURS_ONLY"] = "TOURS_ONLY";
|
|
10
|
+
/** Only super areas whose tariffs are classified as regular tickets. */
|
|
11
|
+
SuperAreasTypeFilter["REGULAR_ONLY"] = "REGULAR_ONLY";
|
|
12
|
+
})(SuperAreasTypeFilter || (exports.SuperAreasTypeFilter = SuperAreasTypeFilter = {}));
|