@odynn/awayz-core 0.2.32 → 0.3.0

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 (64) hide show
  1. package/dist/AccountService-Ct4hShV-.js +2037 -0
  2. package/dist/DateFormats-DZD30Nea.js +4 -0
  3. package/dist/{_commonjsHelpers-B52_cu2H.js → _commonjsHelpers-MdHo5S7N.js} +2 -2
  4. package/dist/{AccountService-8OR0UkZ6.js → arrayExtensions-DlcBOj5a.js} +1338 -3360
  5. package/dist/assets/FlightBooking.css +1 -0
  6. package/dist/assets/HotelBooking.css +1 -0
  7. package/dist/assets/Menu.css +1 -0
  8. package/dist/components/Bookings/FlightBooking/FlightBooking.js +88 -0
  9. package/dist/components/Bookings/HotelBooking/HotelBooking.js +75 -0
  10. package/dist/components/CashValue/CashValue.js +519 -2173
  11. package/dist/components/CashValue/CashValue.stories.js +18 -17
  12. package/dist/components/Menu/Menu.js +2491 -0
  13. package/dist/configs/endpoints.js +4 -2
  14. package/dist/hooks/useAwayzAuth/useAwayzAuth.js +12 -11
  15. package/dist/hooks/useBookingManagement/useBookingManagement.js +79 -0
  16. package/dist/hooks/useBookingManagement/useBookingManagement.test.js +79 -0
  17. package/dist/hooks/useBookingManagement/useBookingManagement.types.js +1 -0
  18. package/dist/hooks/useSearchLimit.js +2 -1
  19. package/dist/hooks/useTripManagement/mocks/index.js +19 -0
  20. package/dist/hooks/useTripManagement/useTripManagement.js +190 -0
  21. package/dist/hooks/useTripManagement/useTripManagement.test.js +205 -0
  22. package/dist/hooks/useTripManagement/useTripManagement.types.js +1 -0
  23. package/dist/hooks/useWallet/useWallet.js +7 -6
  24. package/dist/hooks/useWallet/useWallet.test.js +17 -12851
  25. package/dist/index-COgXcb6p.js +1696 -0
  26. package/dist/{index-B7QVGqcx.js → index-Cv-wvFlM.js} +1 -1
  27. package/dist/lib/components/Bookings/FlightBooking/FlightBooking.d.ts +59 -0
  28. package/dist/lib/components/Bookings/HotelBooking/HotelBooking.d.ts +52 -0
  29. package/dist/lib/components/Menu/Menu.d.ts +13 -0
  30. package/dist/lib/configs/endpoints.d.ts +12 -0
  31. package/dist/lib/hooks/useBookingManagement/mocks/FlightBooking200.json.d.ts +312 -0
  32. package/dist/lib/hooks/useBookingManagement/mocks/HotelBooking200.json.d.ts +92 -0
  33. package/dist/lib/hooks/useBookingManagement/useBookingManagement.d.ts +11 -0
  34. package/dist/lib/hooks/useBookingManagement/useBookingManagement.test.d.ts +1 -0
  35. package/dist/lib/hooks/useBookingManagement/useBookingManagement.types.d.ts +49 -0
  36. package/dist/lib/hooks/useTripManagement/mocks/PastTrip200.json.d.ts +20 -0
  37. package/dist/lib/hooks/useTripManagement/mocks/UncategorisedBookings200.json.d.ts +123 -0
  38. package/dist/lib/hooks/useTripManagement/mocks/UpcomingTrip200.json.d.ts +20 -0
  39. package/dist/lib/hooks/useTripManagement/mocks/UpdatedTrip200.json.d.ts +18 -0
  40. package/dist/lib/hooks/useTripManagement/mocks/index.d.ts +5 -0
  41. package/dist/lib/hooks/useTripManagement/useTripManagement.d.ts +9 -0
  42. package/dist/lib/hooks/useTripManagement/useTripManagement.test.d.ts +1 -0
  43. package/dist/lib/hooks/useTripManagement/useTripManagement.types.d.ts +109 -0
  44. package/dist/lib/main.d.ts +1 -0
  45. package/dist/lib/services/bookings/BookingService.d.ts +10 -0
  46. package/dist/lib/services/bookings/BookingService.types.d.ts +110 -0
  47. package/dist/lib/services/trips/TripService.types.d.ts +124 -0
  48. package/dist/lib/services/trips/TripsService.d.ts +19 -0
  49. package/dist/main.js +23 -20
  50. package/dist/providers/AwayzProvider.js +8 -7
  51. package/dist/services/account/AccountService.js +3 -2
  52. package/dist/services/bookings/BookingService.js +51 -0
  53. package/dist/services/bookings/BookingService.types.js +1 -0
  54. package/dist/services/currency/CurrencyService.js +11 -10
  55. package/dist/services/index.js +1 -1
  56. package/dist/services/instance.js +4 -3
  57. package/dist/services/instanceConfig.js +7 -6
  58. package/dist/services/noRetryInstance.js +1 -1
  59. package/dist/services/trips/TripService.types.js +9 -0
  60. package/dist/services/trips/TripsService.js +81 -0
  61. package/dist/services/wallet/WalletService.js +18 -23
  62. package/dist/tests/TestWrapper.js +2 -2
  63. package/dist/vi.ClIskdbk-k6t29WRA.js +12860 -0
  64. package/package.json +2 -1
@@ -0,0 +1,123 @@
1
+ declare const _default: {
2
+ "success": true,
3
+ "data": {
4
+ "hotel_bookings": [
5
+ {
6
+ "_id": "6839bfd88672ca8a09862823",
7
+ "user_id": "67d82b1c52c4a4dbe4e640c0",
8
+ "status": "booking confirmed",
9
+ "accommodation_id": "acc_0000AWPszvlu6zjbTePuxQ",
10
+ "number_of_guests": 2,
11
+ "rate_id": "rat_0000Aucdmscz0HEHDGqxfc",
12
+ "quote_id": "quo_0000AucdnqAnrnymNn6EzF",
13
+ "base_amount": "2970.00",
14
+ "base_currency": "EUR",
15
+ "tax_amount": "0.00",
16
+ "tax_currency": "EUR",
17
+ "fee_amount": "0.00",
18
+ "fee_currency": "EUR",
19
+ "total_amount": "2970.00",
20
+ "total_currency": "EUR",
21
+ "check_in_date": "2025-06-23",
22
+ "check_out_date": "2025-06-29",
23
+ "images": [
24
+ "https://travelport.leonardocontentcloud.com/imageRepo/7/0/166/647/121/vierz-entrance-6310-hor-clsc_H.jpg",
25
+ "https://travelport.leonardocontentcloud.com/imageRepo/3/0/183/668/598/rz-vierz-vienna-sunset-38389_Classic-Hor_H.jpg"
26
+ ],
27
+ "rooms": [
28
+ {
29
+ "beds": null,
30
+ "photos": [],
31
+ "total_amount": "2970.00",
32
+ "name": "Deluxe, Guest Room, 1 King"
33
+ }
34
+ ],
35
+ "address": {
36
+ "line_one": "Schubertring 5-7",
37
+ "city_name": "Vienna",
38
+ "postal_code": "1010 ",
39
+ "country_code": "AT",
40
+ "region": null
41
+ },
42
+ "guests": [
43
+ { "family_name": "Botha", "given_name": "Adriaan", "user_id": null },
44
+ { "family_name": "Doe", "given_name": "John", "user_id": null }
45
+ ],
46
+ "created_at": "2025-05-30T14:25:28.716Z",
47
+ "updated_at": "2025-05-30T14:27:08.631Z",
48
+ "__v": 0,
49
+ "booking_id": "bok_0000Aucdx2TzTC0lAMSc24",
50
+ "reference": "OY3EHG"
51
+ }
52
+ ],
53
+ "flight_bookings": [
54
+ {
55
+ "_id": "6839beb48672ca8a09862483",
56
+ "flight_offer_id": "off_0000AucdLMS6m6Um63c7m8",
57
+ "user_id": "67d82b1c52c4a4dbe4e640c0",
58
+ "status": "flight confirmed",
59
+ "available_actions": ["cancel", "change", "update"],
60
+ "total_currency": "USD",
61
+ "arrival_date": "2025-07-04T02:16:00.000Z",
62
+ "base_amount": "76.27",
63
+ "extras_amount": "0.00",
64
+ "extras_currency": "USD",
65
+ "base_currency": "USD",
66
+ "conditions": {
67
+ "refund_before_departure": {
68
+ "penalty_currency": "GBP",
69
+ "penalty_amount": "10.00",
70
+ "allowed": true
71
+ },
72
+ "change_before_departure": {
73
+ "penalty_currency": null,
74
+ "penalty_amount": null,
75
+ "allowed": false
76
+ }
77
+ },
78
+ "departure_date": "2025-07-04T00:19:00.000Z",
79
+ "passengers": [{ "id": "pas_0000AucdLMBnkjS3HTz6NZ", "type": null }],
80
+ "slices": [
81
+ {
82
+ "id": "sli_0000AucdLMS6m6Um63c7m7",
83
+ "origin": "VIE",
84
+ "destination": "CDG",
85
+ "fare_brand_name": null,
86
+ "carriers": {
87
+ "marketing": ["Duffel Airways"],
88
+ "operating": ["Duffel Airways"]
89
+ }
90
+ }
91
+ ],
92
+ "tax_amount": "13.73",
93
+ "tax_currency": "USD",
94
+ "total_amount": "90.00",
95
+ "type": "instant",
96
+ "synced_at": "2025-05-30T14:21:11Z",
97
+ "order_id": "ord_0000AucdQ6tTnRRInXiCLg",
98
+ "booking_reference": "QGEHM5",
99
+ "cancelled_at": null,
100
+ "payment_status": {
101
+ "paid_at": "2025-05-30T14:21:11Z",
102
+ "price_guarantee_expires_at": null,
103
+ "payment_required_by": null,
104
+ "awaiting_payment": false
105
+ },
106
+ "documents": [
107
+ {
108
+ "passenger_ids": ["pas_0000AucdLMBnkjS3HTz6NZ"],
109
+ "unique_identifier": "1",
110
+ "type": "electronic_ticket"
111
+ }
112
+ ],
113
+ "services": [],
114
+ "createdAt": "2025-05-30T14:20:36.839Z",
115
+ "updatedAt": "2025-05-30T14:21:11.541Z",
116
+ "__v": 0
117
+ }
118
+ ]
119
+ }
120
+ }
121
+ ;
122
+
123
+ export default _default;
@@ -0,0 +1,20 @@
1
+ declare const _default: {
2
+ "success": true,
3
+ "data": [
4
+ {
5
+ "_id": "682f2c51a6cc24f39d99eecb",
6
+ "name": "Jet's JumpOff",
7
+ "user_id": "67fd23bc3a7cbcd0a8757cdc",
8
+ "start_date": "2025-06-23",
9
+ "end_date": "2025-06-26",
10
+ "hotel_bookings": [],
11
+ "flight_bookings": [],
12
+ "created_at": "2025-05-22T13:53:21.392Z",
13
+ "updated_at": "2025-05-22T13:53:21.392Z",
14
+ "__v": 0
15
+ }
16
+ ]
17
+ }
18
+ ;
19
+
20
+ export default _default;
@@ -0,0 +1,18 @@
1
+ declare const _default: {
2
+ "success": true,
3
+ "data": {
4
+ "_id": "682ffebaa6cc24f39d99fdc7",
5
+ "name": "Updated Trip",
6
+ "user_id": "67fd23bc3a7cbcd0a8757cdc",
7
+ "start_date": "2025-09-09",
8
+ "end_date": "2025-09-21",
9
+ "hotel_bookings": [],
10
+ "flight_bookings": [],
11
+ "created_at": "2025-05-23T04:51:06.811Z",
12
+ "updated_at": "2025-05-23T05:30:47.144Z",
13
+ "__v": 0
14
+ }
15
+ }
16
+ ;
17
+
18
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import { default as PastTrip200 } from './PastTrip200.json';
2
+ import { default as UpcomingTrip200 } from './UpcomingTrip200.json';
3
+ import { default as UpdatedTrip200 } from './UpdatedTrip200.json';
4
+ import { default as UncategorisedBookings200 } from './UncategorisedBookings200.json';
5
+ export { PastTrip200, UpcomingTrip200, UpdatedTrip200, UncategorisedBookings200 };
@@ -0,0 +1,9 @@
1
+ import { ITripRequestArgs, IUseTripManagement } from './useTripManagement.types';
2
+ export declare const validateUpdateTripArgs: ({ tripId, tripDetails }: ITripRequestArgs) => void;
3
+ /**
4
+ * Custom hook to manage trips and bookings
5
+ * Provides functionality to create, update, delete trips and manage bookings
6
+ *
7
+ * @returns An object containing all trips, uncategorised bookings, and functions to manage trips
8
+ */
9
+ export declare const useTripManagement: () => IUseTripManagement;
@@ -0,0 +1,109 @@
1
+ import { IBooking, ICreateTripRequest, ITrip } from '../../services/trips/TripService.types';
2
+ export interface ITripRequestArgs {
3
+ /**
4
+ * The ID of the trip to be updated
5
+ */
6
+ tripId: string;
7
+ /**
8
+ * The details of the trip to be updated
9
+ * This should be a partial object of ITrip
10
+ */
11
+ tripDetails: Partial<ITrip>;
12
+ }
13
+ export interface IUseTripManagement {
14
+ /**
15
+ * An array of all trips, including past and upcoming trips
16
+ */
17
+ allTrips: ITrip[];
18
+ /**
19
+ * An array of past trips
20
+ */
21
+ pastTrips: ITrip[];
22
+ /**
23
+ * An array of upcoming trips
24
+ */
25
+ upcomingTrips: ITrip[];
26
+ /**
27
+ * An array of all uncategorised bookings, including flight and hotel bookings
28
+ */
29
+ allUncategorisedBookings: IBooking[];
30
+ /**
31
+ * An array of uncategorised flight bookings
32
+ */
33
+ uncategorisedFlightBookings: IBooking[];
34
+ /**
35
+ * An array of uncategorised hotel bookings
36
+ */
37
+ uncategorisedHotelBookings: IBooking[];
38
+ /**
39
+ * Function to create a new trip
40
+ * @param tripDetails - Details of the trip to be created
41
+ */
42
+ createTrip: (tripDetails: ICreateTripRequest) => void;
43
+ /**
44
+ * Indicates if the create trip request is pending
45
+ */
46
+ isCreateTripPending: boolean;
47
+ /**
48
+ * Indicates if there was an error while creating a trip
49
+ */
50
+ isCreateTripError: boolean;
51
+ /**
52
+ * Error object if there was an error while creating a trip
53
+ */
54
+ createTripError: Error | null;
55
+ /**
56
+ * Function to update an existing trip
57
+ * @param args - Object containing tripId and tripDetails to be updated
58
+ */
59
+ updateTrip: (args: ITripRequestArgs) => void;
60
+ /**
61
+ * Indicates if the update trip request is pending
62
+ */
63
+ isUpdateTripPending: boolean;
64
+ /**
65
+ * Indicates if there was an error while updating a trip
66
+ */
67
+ isUpdateTripError: boolean;
68
+ /**
69
+ * Error object if there was an error while updating a trip
70
+ */
71
+ updateTripError: Error | null;
72
+ /**
73
+ * Function to delete a trip
74
+ * @param tripId - ID of the trip to be deleted
75
+ */
76
+ deleteTrip: (tripId: string) => void;
77
+ /**
78
+ * Indicates if the delete trip request is pending
79
+ */
80
+ isDeleteTripPending: boolean;
81
+ /**
82
+ * Indicates if there was an error while deleting a trip
83
+ */
84
+ isDeleteTripError: boolean;
85
+ /**
86
+ * Error object if there was an error while deleting a trip
87
+ */
88
+ deleteTripError: Error | null;
89
+ /**
90
+ * Function to add a booking to a trip
91
+ * @param args - Object containing tripId and booking to be added
92
+ */
93
+ addBookingToTrip: (args: {
94
+ tripId: string;
95
+ booking: IBooking;
96
+ }) => void;
97
+ /**
98
+ * Indicates if the add booking to trip request is pending
99
+ */
100
+ isAddBookingToTripPending: boolean;
101
+ /**
102
+ * Indicates if there was an error while adding a booking to a trip
103
+ */
104
+ isAddBookingToTripError: boolean;
105
+ /**
106
+ * Error object if there was an error while adding a booking to a trip
107
+ */
108
+ addBookingToTripError: Error | null;
109
+ }
@@ -2,6 +2,7 @@ export * from './providers/AwayzProvider';
2
2
  export * from './hooks/useAwayzContext';
3
3
  export * from './hooks/useSearchLimit';
4
4
  export * from './hooks/useWallet/useWallet';
5
+ export * from './hooks/useTripManagement/useTripManagement';
5
6
  export * from './types';
6
7
  export * from './services';
7
8
  export * from './configs/awayzClient';
@@ -0,0 +1,10 @@
1
+ import { IFlightBookingDetails, IHotelBookingDetails } from './BookingService.types';
2
+ declare class _BookingService {
3
+ getHotelBooking: (bookindId: string) => Promise<IHotelBookingDetails>;
4
+ getFlightBooking: (bookingId: string) => Promise<IFlightBookingDetails>;
5
+ initiateCancelFlightBooking: (bookingId: string) => Promise<any>;
6
+ confirmCancelFlightBooking: (bookingId: string) => Promise<any>;
7
+ cancelHotelBooking: (bookingId: string) => Promise<any>;
8
+ }
9
+ export declare const BookingService: _BookingService;
10
+ export {};
@@ -0,0 +1,110 @@
1
+ export interface IBed {
2
+ }
3
+ export interface IGuest {
4
+ }
5
+ export interface IRoom {
6
+ beds: IBed[];
7
+ photo: string[];
8
+ totalAmount: number;
9
+ name: string;
10
+ }
11
+ export interface IAddress {
12
+ lineOne: string;
13
+ cityName: string;
14
+ postalCode: string;
15
+ countryCode: string;
16
+ region: string | null;
17
+ }
18
+ export interface IHotelBookingDetails {
19
+ id: string;
20
+ userId: string;
21
+ status: string;
22
+ accommodationId: string;
23
+ numberOfGuests: number;
24
+ rateId: string;
25
+ quoteId: string;
26
+ baseAmount: number;
27
+ baseCurrency: string;
28
+ taxAmount: number;
29
+ taxCurrency: string;
30
+ feeAmount: number;
31
+ feeCurrency: string;
32
+ totalAmount: number;
33
+ totalCurrency: string;
34
+ checkInDate: string;
35
+ checkOutDate: string;
36
+ images: string[];
37
+ rooms: IRoom[];
38
+ address: IAddress;
39
+ guests: IGuest[];
40
+ }
41
+ export interface IFlightPassenger {
42
+ id: string;
43
+ type: string | null;
44
+ }
45
+ export interface IFlightCarriers {
46
+ marketing: string[];
47
+ operating: string[];
48
+ }
49
+ export interface IFlightSlice {
50
+ id: string;
51
+ origin: string;
52
+ destination: string;
53
+ carriers: IFlightCarriers;
54
+ fareBrandName: string | null;
55
+ }
56
+ export interface IFlightConditionDetails {
57
+ allowed: boolean;
58
+ penaltyAmount: string | null;
59
+ penaltyCurrency: string | null;
60
+ }
61
+ export interface IFlightConditions {
62
+ refundBeforeDeparture: IFlightConditionDetails;
63
+ changeBeforeDeparture: IFlightConditionDetails;
64
+ }
65
+ export interface IFlightPaymentStatus {
66
+ paidAt: string;
67
+ priceGuaranteeExpiresAt: string | null;
68
+ paymentRequiredBy: string | null;
69
+ awaitingPayment: boolean;
70
+ }
71
+ export interface IFlightDocument {
72
+ passengerIds: string[];
73
+ uniqueIdentifier: string;
74
+ type: string;
75
+ }
76
+ export interface IFlightService {
77
+ id: string;
78
+ type: string;
79
+ quantity: number;
80
+ totalAmount: string;
81
+ totalCurrency: string;
82
+ }
83
+ export interface IFlightBookingDetails {
84
+ id: string;
85
+ flightOfferId: string;
86
+ userId: string;
87
+ status: string;
88
+ availableActions: string[];
89
+ totalCurrency: string;
90
+ arrivalDate: string;
91
+ baseAmount: string;
92
+ extrasAmount: string;
93
+ extrasCurrency: string;
94
+ baseCurrency: string;
95
+ conditions: IFlightConditions;
96
+ departureDate: string;
97
+ passengers: IFlightPassenger[];
98
+ slices: IFlightSlice[];
99
+ taxAmount: string;
100
+ taxCurrency: string;
101
+ totalAmount: string;
102
+ type: string;
103
+ syncedAt: string;
104
+ orderId: string;
105
+ bookingReference: string;
106
+ cancelledAt: string | null;
107
+ paymentStatus: IFlightPaymentStatus;
108
+ documents: IFlightDocument[];
109
+ services: IFlightService[];
110
+ }
@@ -0,0 +1,124 @@
1
+ import { IPassenger, ISlice } from '@type-op/shared';
2
+ import { Moment } from 'moment';
3
+ export declare const UncategorizedTrips: {
4
+ id: string;
5
+ name: string;
6
+ };
7
+ export declare enum EBookingType {
8
+ HOTEL = "hotel",
9
+ FLIGHT = "flight"
10
+ }
11
+ export interface ICreateTripRequest {
12
+ name: string;
13
+ startDate: string;
14
+ endDate: string;
15
+ hotelDookings?: string[];
16
+ flightDookings?: string[];
17
+ }
18
+ export interface ITrip {
19
+ id: string;
20
+ name: string;
21
+ startDate?: string;
22
+ endDate?: string;
23
+ hotelBookings?: IBooking[];
24
+ flightBookings?: IBooking[];
25
+ }
26
+ export interface IBooking {
27
+ id: string;
28
+ reference: string;
29
+ startDate: Moment;
30
+ endDate: Moment;
31
+ cancelledAt?: Moment;
32
+ bookingType: EBookingType;
33
+ }
34
+ export interface IHotelBooking extends IBooking {
35
+ name: string;
36
+ image: string;
37
+ people: number;
38
+ tripId?: string;
39
+ address?: string;
40
+ rooms?: number;
41
+ bookingId: string;
42
+ }
43
+ export interface IFlightBooking extends IBooking {
44
+ airlines: {
45
+ logo: string;
46
+ name: string;
47
+ }[];
48
+ arrival: {
49
+ airportCode: string;
50
+ location: string;
51
+ };
52
+ departure: {
53
+ airportCode: string;
54
+ location: string;
55
+ };
56
+ class: string;
57
+ passengers: IPassenger[];
58
+ hasAirlineChanges: boolean;
59
+ orderId: string;
60
+ type: string;
61
+ }
62
+ export interface IUncategorizedBookings {
63
+ flightBookings: IFlightBooking[];
64
+ hotelBookings: IHotelBooking[];
65
+ }
66
+ interface IOwner {
67
+ logo_symbol_url: string;
68
+ logo_lockup_url: string | null;
69
+ conditions_of_carriage_url: string | null;
70
+ iata_code: string;
71
+ name: string;
72
+ id: string;
73
+ }
74
+ export interface IFlightBookingResponse {
75
+ _id: string;
76
+ _created: string;
77
+ payment_intent_id: string;
78
+ status: string;
79
+ flight_offer_id: string;
80
+ user_id: string;
81
+ credit_card_fees: string;
82
+ total_amount_with_fees: string;
83
+ total_amount_without_fees: string;
84
+ _modified: string;
85
+ arrival_date: string;
86
+ available_actions: string[];
87
+ base_amount: string;
88
+ base_currency: string;
89
+ booking_reference: string;
90
+ content: string;
91
+ created_at: string;
92
+ departure_date: string;
93
+ metadata: {
94
+ payment_intent_id: string;
95
+ };
96
+ order_id: string;
97
+ passengers: IPassenger[];
98
+ slices: ISlice[];
99
+ tax_amount: string;
100
+ tax_currency: string;
101
+ total_amount: string;
102
+ total_currency: string;
103
+ type: string;
104
+ documents: any[];
105
+ synced_at: string;
106
+ airline_initiated_changes: any[];
107
+ cancellation: any;
108
+ live_mode: boolean;
109
+ cancelled_at: string | null;
110
+ changes: any[];
111
+ services: any[];
112
+ owner: IOwner;
113
+ id: string;
114
+ }
115
+ export interface ICreateComponentKeyArgs {
116
+ bookingId?: string;
117
+ orderId?: string;
118
+ }
119
+ export interface ICreateComponentKeyResponse {
120
+ success: boolean;
121
+ message: string;
122
+ data: string;
123
+ }
124
+ export {};
@@ -0,0 +1,19 @@
1
+ import { ICreateTripRequest, ITrip, IUncategorizedBookings, EBookingType } from './TripService.types';
2
+ declare class _TripsService {
3
+ createTrip: (trip: ICreateTripRequest) => Promise<any>;
4
+ getTripsByStatus: (status?: string) => Promise<ITrip[]>;
5
+ updateTrip: (tripId: string, trip: Partial<ITrip>) => Promise<{
6
+ success: boolean;
7
+ message: string;
8
+ data?: undefined;
9
+ } | {
10
+ success: boolean;
11
+ data: ITrip;
12
+ message: string;
13
+ }>;
14
+ deleteTrip: (tripId: string) => Promise<any>;
15
+ getUncategorisedBookings: () => Promise<IUncategorizedBookings>;
16
+ addBookingToTrip: (tripId: string, bookingId: string, bookingType: EBookingType) => Promise<any>;
17
+ }
18
+ export declare const TripsService: _TripsService;
19
+ export {};
package/dist/main.js CHANGED
@@ -1,28 +1,31 @@
1
- import { AwayzProvider as r } from "./providers/AwayzProvider.js";
1
+ import { AwayzProvider as o } from "./providers/AwayzProvider.js";
2
2
  import { useAwayzContext as a } from "./hooks/useAwayzContext.js";
3
- import { useSearchLimit as n } from "./hooks/useSearchLimit.js";
3
+ import { useSearchLimit as i } from "./hooks/useSearchLimit.js";
4
4
  import { useWallet as m } from "./hooks/useWallet/useWallet.js";
5
- import { EAuthFlow as f } from "./types/EAuthFlow.js";
6
- import { c as l, i as c } from "./AccountService-8OR0UkZ6.js";
7
- import { clientNoRetryInstance as y } from "./services/noRetryInstance.js";
8
- import { CurrencyService as A } from "./services/currency/CurrencyService.js";
9
- import { awayzClient as h } from "./configs/awayzClient.js";
5
+ import { useTripManagement as x, validateUpdateTripArgs as f } from "./hooks/useTripManagement/useTripManagement.js";
6
+ import { EAuthFlow as c } from "./types/EAuthFlow.js";
7
+ import { c as y, i as A } from "./AccountService-Ct4hShV-.js";
8
+ import { clientNoRetryInstance as v } from "./services/noRetryInstance.js";
9
+ import { CurrencyService as C } from "./services/currency/CurrencyService.js";
10
+ import { awayzClient as g } from "./configs/awayzClient.js";
10
11
  import { CashValue as z } from "./components/CashValue/CashValue.js";
11
- import { EInvalidAmountDisplayOption as I, EToolTipPosition as d } from "./components/CashValue/CashValueTypes.js";
12
- import { getBaseUrl as S } from "./configs/baseUrl.js";
12
+ import { EInvalidAmountDisplayOption as I, EToolTipPosition as P } from "./components/CashValue/CashValueTypes.js";
13
+ import { getBaseUrl as U } from "./configs/baseUrl.js";
13
14
  export {
14
- r as AwayzProvider,
15
+ o as AwayzProvider,
15
16
  z as CashValue,
16
- A as CurrencyService,
17
- f as EAuthFlow,
17
+ C as CurrencyService,
18
+ c as EAuthFlow,
18
19
  I as EInvalidAmountDisplayOption,
19
- d as EToolTipPosition,
20
- h as awayzClient,
21
- l as clientInstance,
22
- y as clientNoRetryInstance,
23
- S as getBaseUrl,
24
- c as instance,
20
+ P as EToolTipPosition,
21
+ g as awayzClient,
22
+ y as clientInstance,
23
+ v as clientNoRetryInstance,
24
+ U as getBaseUrl,
25
+ A as instance,
25
26
  a as useAwayzContext,
26
- n as useSearchLimit,
27
- m as useWallet
27
+ i as useSearchLimit,
28
+ x as useTripManagement,
29
+ m as useWallet,
30
+ f as validateUpdateTripArgs
28
31
  };
@@ -1,16 +1,17 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
2
  import { useEffect as s } from "react";
3
- import { AwayzContext as l } from "../context/AwayzContext.js";
4
- import { d as t } from "../AccountService-8OR0UkZ6.js";
5
- import { useAwayzAuth as m } from "../hooks/useAwayzAuth/useAwayzAuth.js";
3
+ import { AwayzContext as m } from "../context/AwayzContext.js";
4
+ import "../arrayExtensions-DlcBOj5a.js";
5
+ import { e as t } from "../AccountService-Ct4hShV-.js";
6
+ import { useAwayzAuth as l } from "../hooks/useAwayzAuth/useAwayzAuth.js";
6
7
  import { setBaseUrl as u } from "../configs/baseUrl.js";
7
8
  import { QueryClientProvider as i } from "@tanstack/react-query";
8
9
  import { awayzClient as d } from "../configs/awayzClient.js";
9
10
  import "../services/noRetryInstance.js";
10
11
  import '../assets/_styles.css';/* empty css */
11
12
  import { defaultAwayzConfig as p } from "../configs/defaultAwayzConfig.js";
12
- const v = ({ children: o, config: e }) => {
13
- const a = m({
13
+ const F = ({ children: o, config: e }) => {
14
+ const a = l({
14
15
  authFlow: e.authFlow,
15
16
  onSuccess: e.onAuthSuccess,
16
17
  onError: e.onAuthFailure,
@@ -23,7 +24,7 @@ const v = ({ children: o, config: e }) => {
23
24
  }
24
25
  localStorage.setItem(t.CLIENT_ID, e.clientId), localStorage.setItem(t.AUTH_FLOW, e.authFlow), e.debugRefreshToken && e.testMode && (localStorage.setItem(t.REFRESH_TOKEN, e.debugRefreshToken), localStorage.setItem(t.TOKEN, e.debugRefreshToken)), u(e.testMode ?? !1);
25
26
  }, [e]), /* @__PURE__ */ r(i, { client: d, children: /* @__PURE__ */ r(
26
- l.Provider,
27
+ m.Provider,
27
28
  {
28
29
  value: {
29
30
  ...a,
@@ -37,5 +38,5 @@ const v = ({ children: o, config: e }) => {
37
38
  ) });
38
39
  };
39
40
  export {
40
- v as AwayzProvider
41
+ F as AwayzProvider
41
42
  };
@@ -1,7 +1,8 @@
1
- import { e as m } from "../../AccountService-8OR0UkZ6.js";
1
+ import "../../arrayExtensions-DlcBOj5a.js";
2
+ import { A as c } from "../../AccountService-Ct4hShV-.js";
2
3
  import "react";
3
4
  import "../../configs/endpoints.js";
4
5
  import "../../configs/awayzClient.js";
5
6
  export {
6
- m as AccountService
7
+ c as AccountService
7
8
  };