mts-booking-library 2.0.0 → 2.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.
- package/lib/index.d.ts +1 -1
- package/lib/mtsStorage.d.ts +0 -11
- package/lib/mtsStorage.js +4 -4
- package/lib/types/common/Payment.d.ts +1 -1
- package/package.json +2 -2
package/lib/index.d.ts
CHANGED
@@ -19,7 +19,7 @@ export { JourneySearchRequest, JourneySearchResult, DEFAULT_JOURNEY_SEARCH } fro
|
|
19
19
|
export { Stop } from "./types/journeys/Stop";
|
20
20
|
export { Trip, CartTrip, ReductionTrip } from "./types/journeys/Trip";
|
21
21
|
export { Line } from "./types/services/Line";
|
22
|
-
export { Service, ServiceTrip } from "./types/services/Service";
|
22
|
+
export { Service, ServiceTrip, ServiceTripsResponse } from "./types/services/Service";
|
23
23
|
export { ServiceCart, ServiceBookingType, CreateServiceCartRequest } from "./types/services/ServiceCart";
|
24
24
|
export { ServiceInfo } from "./types/services/ServiceInfo";
|
25
25
|
export { GetTariffsResponse } from "./types/tpl/GetTariffsResponse";
|
package/lib/mtsStorage.d.ts
CHANGED
@@ -5,17 +5,6 @@ type MtsBookingAction = {
|
|
5
5
|
updateCartGuid: (cartGuid: MtsBookingState["cartGuid"]) => void;
|
6
6
|
resetState: () => void;
|
7
7
|
};
|
8
|
-
export declare const useMtsBookingLocalState: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<MtsBookingState & MtsBookingAction>, "persist"> & {
|
9
|
-
persist: {
|
10
|
-
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<MtsBookingState & MtsBookingAction, MtsBookingState & MtsBookingAction>>) => void;
|
11
|
-
clearStorage: () => void;
|
12
|
-
rehydrate: () => Promise<void> | void;
|
13
|
-
hasHydrated: () => boolean;
|
14
|
-
onHydrate: (fn: (state: MtsBookingState & MtsBookingAction) => void) => () => void;
|
15
|
-
onFinishHydration: (fn: (state: MtsBookingState & MtsBookingAction) => void) => () => void;
|
16
|
-
getOptions: () => Partial<import("zustand/middleware").PersistOptions<MtsBookingState & MtsBookingAction, MtsBookingState & MtsBookingAction>>;
|
17
|
-
};
|
18
|
-
}>;
|
19
8
|
/**
|
20
9
|
* This hook will return the correct Zustand state based on the application which runs the library
|
21
10
|
*/
|
package/lib/mtsStorage.js
CHANGED
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
|
|
11
11
|
return __assign.apply(this, arguments);
|
12
12
|
};
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
14
|
-
exports.useTestState = exports.useMtsBookingState =
|
14
|
+
exports.useTestState = exports.useMtsBookingState = void 0;
|
15
15
|
var async_storage_1 = require("@react-native-async-storage/async-storage");
|
16
16
|
var zustand_1 = require("zustand");
|
17
17
|
var middleware_1 = require("zustand/middleware");
|
@@ -24,7 +24,7 @@ var useMtsBookingAsyncState = (0, zustand_1.create)((0, middleware_1.persist)(fu
|
|
24
24
|
name: "mts-booking-storage",
|
25
25
|
storage: (0, middleware_1.createJSONStorage)(function () { return async_storage_1.default; })
|
26
26
|
}));
|
27
|
-
|
27
|
+
var useMtsBookingLocalState = (0, zustand_1.create)((0, middleware_1.persist)(function (set) { return (__assign(__assign({}, INITIAL_STATE), { updateCartGuid: function (cartGuid) {
|
28
28
|
return set(function () { return ({ cartGuid: cartGuid }); });
|
29
29
|
}, resetState: function () { return set(function () { return INITIAL_STATE; }); } })); }, {
|
30
30
|
name: "mts-booking-storage",
|
@@ -36,7 +36,7 @@ exports.useMtsBookingLocalState = (0, zustand_1.create)((0, middleware_1.persist
|
|
36
36
|
var useMtsBookingState = function () {
|
37
37
|
if (typeof document !== "undefined") {
|
38
38
|
// Web application
|
39
|
-
return
|
39
|
+
return useMtsBookingLocalState;
|
40
40
|
}
|
41
41
|
// react-native application
|
42
42
|
return useMtsBookingAsyncState;
|
@@ -47,6 +47,6 @@ var useTestState = function () {
|
|
47
47
|
var LocalStorage = require("node-localstorage").LocalStorage;
|
48
48
|
global.localStorage = new LocalStorage("./scratch");
|
49
49
|
}
|
50
|
-
return
|
50
|
+
return useMtsBookingLocalState;
|
51
51
|
};
|
52
52
|
exports.useTestState = useTestState;
|
@@ -83,7 +83,7 @@ export type Wallet = {
|
|
83
83
|
walletTransactions: any[];
|
84
84
|
};
|
85
85
|
/**
|
86
|
-
* @description This type represents the response of the {@link Booking.issueCart} API.
|
86
|
+
* @description This type represents the response of the {@link Booking.issueCart()} API.
|
87
87
|
* @param {Wallet} wallet If the booking was performed by a reseller, this field contains the wallet with the updated balance.
|
88
88
|
* @param {string} ticketsSentToEmail This field contains the email address to which the tickets were sent.
|
89
89
|
* If the buyer email was specified, this field will contain the buyer email. Otherwise, if the reseller performed the booking, this
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "mts-booking-library",
|
3
|
-
"version": "2.0.
|
3
|
+
"version": "2.0.1",
|
4
4
|
"description": "Library for using MyTicketSolution Booking API",
|
5
5
|
"main": "lib/index.js",
|
6
6
|
"types": "lib/index.d.ts",
|
@@ -20,7 +20,7 @@
|
|
20
20
|
"jest": "^29.7.0",
|
21
21
|
"prettier": "^3.3.3",
|
22
22
|
"ts-jest": "^29.2.5",
|
23
|
-
"typescript": "^5.6.
|
23
|
+
"typescript": "^5.6.3"
|
24
24
|
},
|
25
25
|
"files": [
|
26
26
|
"lib/**/*"
|