whitelabel-db 1.0.11 → 1.0.12

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/dist/index.d.ts CHANGED
@@ -5,4 +5,4 @@ export { Country } from './models/Country';
5
5
  export { Hotel } from './models/Hotel';
6
6
  export { User } from './models/User';
7
7
  export { Project } from './models/Project';
8
- export { LiteApiClient, HotelsRequest, AvailabilityResult, FullRateAvailabilityResult, RoomType, Rate, PrebookRateRequest, PrebookRate, } from './libs/liteapi';
8
+ export { LiteApiClient, HotelsRequest, AvailabilityResult, FullRateAvailabilityResult, RoomType, Rate, PrebookRateRequest, PrebookRate, CheckoutRequest, Booking, } from './libs/liteapi';
@@ -75,6 +75,65 @@ export interface PrebookRate {
75
75
  boardChanged: boolean;
76
76
  supplier: string;
77
77
  supplierId: number;
78
+ transactionId: string;
79
+ clientSecret: string;
80
+ }
81
+ export interface GuestInfo {
82
+ guestFirstName: string;
83
+ guestLastName: string;
84
+ guestEmail: string;
85
+ }
86
+ export interface PaymentInfo {
87
+ method: string;
88
+ holderName?: string;
89
+ number?: string;
90
+ expireDate?: string;
91
+ cvc?: string;
92
+ transactionId?: string;
93
+ }
94
+ export interface CheckoutRequest {
95
+ guestInfo: GuestInfo;
96
+ payment: PaymentInfo;
97
+ prebookId: string;
98
+ }
99
+ export interface BookedRoom {
100
+ roomType: {
101
+ name: string;
102
+ };
103
+ adults: number;
104
+ children: number;
105
+ rate: {
106
+ maxOccupancy: number;
107
+ retailRate: RetailRate;
108
+ };
109
+ }
110
+ export interface Booking {
111
+ bookingId: string;
112
+ clientReference: string;
113
+ supplierBookingId: string;
114
+ supplierBookingName: string;
115
+ supplier: string;
116
+ supplierId: number;
117
+ status: string;
118
+ hotelConfirmationCode: string;
119
+ checkin: string;
120
+ checkout: string;
121
+ hotel: {
122
+ hotelId: string;
123
+ name: string;
124
+ };
125
+ bookedRooms: BookedRoom[];
126
+ guestInfo: GuestInfo;
127
+ createdAt: string;
128
+ cancellationPolicies: CancellationPolicies;
129
+ price: number;
130
+ msp: number;
131
+ commission: number;
132
+ currency: string;
133
+ }
134
+ export interface BookingConfirmation {
135
+ prebookId: string;
136
+ transactionId: string;
78
137
  }
79
138
  export declare class LiteApiClient {
80
139
  private apiKey;
@@ -83,4 +142,5 @@ export declare class LiteApiClient {
83
142
  getHotelById(hotelId: string): Promise<AvailabilityResult>;
84
143
  getHotelsFullRate(options: HotelsRequest): Promise<FullRateAvailabilityResult[]>;
85
144
  preBookedHotelRate(options: PrebookRateRequest): Promise<PrebookRate>;
145
+ bookHotelRate(options: CheckoutRequest): Promise<Booking>;
86
146
  }
@@ -64,5 +64,18 @@ class LiteApiClient {
64
64
  })).data.data;
65
65
  });
66
66
  }
67
+ bookHotelRate(options) {
68
+ return __awaiter(this, void 0, void 0, function* () {
69
+ return (yield (0, axios_1.default)({
70
+ method: 'post',
71
+ url: `${baseUrl}/v2.0/rates/book`,
72
+ data: options,
73
+ headers: {
74
+ 'X-API-Key': this.apiKey,
75
+ 'content-type': 'application/json',
76
+ },
77
+ })).data.data;
78
+ });
79
+ }
67
80
  }
68
81
  exports.LiteApiClient = LiteApiClient;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whitelabel-db",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",