whitelabel-db 1.0.9 → 1.0.11
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/README.md +18 -1
- package/dist/index.d.ts +1 -1
- package/dist/libs/liteapi.d.ts +63 -0
- package/dist/libs/liteapi.js +24 -0
- package/dist/models/Hotel.d.ts +1 -1
- package/dist/models/Hotel.js +4 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,4 +5,21 @@
|
|
|
5
5
|
```bash
|
|
6
6
|
npm run build
|
|
7
7
|
npm publish
|
|
8
|
-
```
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
### Local testing
|
|
11
|
+
|
|
12
|
+
1. Run below commands to create a tarball from a package.
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm run build
|
|
16
|
+
npm pack
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
2. Add tarball path in backend\package.json for whitelabel-db
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
"whitelabel-db": "file:path/whitelabel-db/whitelabel-db-1.0.8.tgz"
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
3. Re-run the docker.
|
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, } from './libs/liteapi';
|
|
8
|
+
export { LiteApiClient, HotelsRequest, AvailabilityResult, FullRateAvailabilityResult, RoomType, Rate, PrebookRateRequest, PrebookRate, } from './libs/liteapi';
|
package/dist/libs/liteapi.d.ts
CHANGED
|
@@ -15,9 +15,72 @@ export interface AvailabilityResult {
|
|
|
15
15
|
supplier: string;
|
|
16
16
|
supplierId: number;
|
|
17
17
|
}
|
|
18
|
+
export interface Amount {
|
|
19
|
+
amount: number;
|
|
20
|
+
currency: string;
|
|
21
|
+
}
|
|
22
|
+
export interface RetailRate {
|
|
23
|
+
total: Amount[];
|
|
24
|
+
taxesAndFees: number;
|
|
25
|
+
msp?: Amount[];
|
|
26
|
+
}
|
|
27
|
+
export interface CancellationPolicies {
|
|
28
|
+
cancelPolicyInfos: {
|
|
29
|
+
cancelTime: string;
|
|
30
|
+
amount: number;
|
|
31
|
+
currency: string;
|
|
32
|
+
type: string;
|
|
33
|
+
}[];
|
|
34
|
+
hotelRemarks: string[];
|
|
35
|
+
refundableTag: string;
|
|
36
|
+
}
|
|
37
|
+
export interface Rate {
|
|
38
|
+
rateId: string;
|
|
39
|
+
name: string;
|
|
40
|
+
maxOccupancy: number;
|
|
41
|
+
boardType: string;
|
|
42
|
+
boardName: string;
|
|
43
|
+
retailRate: RetailRate;
|
|
44
|
+
cancellationPolicies: CancellationPolicies;
|
|
45
|
+
priceType?: string;
|
|
46
|
+
commission?: Amount[];
|
|
47
|
+
}
|
|
48
|
+
export interface RoomType {
|
|
49
|
+
roomTypeId: string;
|
|
50
|
+
rates: Rate[];
|
|
51
|
+
supplier: string;
|
|
52
|
+
supplierId: number;
|
|
53
|
+
}
|
|
54
|
+
export interface FullRateAvailabilityResult {
|
|
55
|
+
hotelId: string;
|
|
56
|
+
termsAndConditions: string;
|
|
57
|
+
roomTypes: RoomType[];
|
|
58
|
+
}
|
|
59
|
+
export interface PrebookRateRequest {
|
|
60
|
+
rateId: string;
|
|
61
|
+
payWithStripe?: boolean;
|
|
62
|
+
}
|
|
63
|
+
export interface PrebookRate {
|
|
64
|
+
prebookId: string;
|
|
65
|
+
hotelId: string;
|
|
66
|
+
currency: string;
|
|
67
|
+
termsAndConditions: string;
|
|
68
|
+
roomTypes: RoomType[];
|
|
69
|
+
msp: number;
|
|
70
|
+
commission: number;
|
|
71
|
+
price: number;
|
|
72
|
+
priceType: string;
|
|
73
|
+
priceDifferencePercent: number;
|
|
74
|
+
cancellationChanged: boolean;
|
|
75
|
+
boardChanged: boolean;
|
|
76
|
+
supplier: string;
|
|
77
|
+
supplierId: number;
|
|
78
|
+
}
|
|
18
79
|
export declare class LiteApiClient {
|
|
19
80
|
private apiKey;
|
|
20
81
|
constructor(apiKey: string);
|
|
21
82
|
getHotels(options: HotelsRequest): Promise<AvailabilityResult[]>;
|
|
22
83
|
getHotelById(hotelId: string): Promise<AvailabilityResult>;
|
|
84
|
+
getHotelsFullRate(options: HotelsRequest): Promise<FullRateAvailabilityResult[]>;
|
|
85
|
+
preBookedHotelRate(options: PrebookRateRequest): Promise<PrebookRate>;
|
|
23
86
|
}
|
package/dist/libs/liteapi.js
CHANGED
|
@@ -40,5 +40,29 @@ class LiteApiClient {
|
|
|
40
40
|
})).data.data;
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
+
getHotelsFullRate(options) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
return (yield (0, axios_1.default)({
|
|
46
|
+
url: `${baseUrl}/v2.0/hotels/rates`,
|
|
47
|
+
params: options,
|
|
48
|
+
headers: {
|
|
49
|
+
'X-API-Key': this.apiKey,
|
|
50
|
+
},
|
|
51
|
+
})).data.data;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
preBookedHotelRate(options) {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
return (yield (0, axios_1.default)({
|
|
57
|
+
method: 'post',
|
|
58
|
+
url: `${baseUrl}/v2.0/rates/prebook`,
|
|
59
|
+
data: options,
|
|
60
|
+
headers: {
|
|
61
|
+
'X-API-Key': this.apiKey,
|
|
62
|
+
'content-type': 'application/json',
|
|
63
|
+
},
|
|
64
|
+
})).data.data;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
43
67
|
}
|
|
44
68
|
exports.LiteApiClient = LiteApiClient;
|
package/dist/models/Hotel.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export declare class Hotel extends Model<Partial<Hotel>> {
|
|
|
23
23
|
address: string;
|
|
24
24
|
zip: string;
|
|
25
25
|
main_photo: string;
|
|
26
|
-
stars:
|
|
26
|
+
stars: number;
|
|
27
27
|
checkinCheckoutTimes: CheckinCheckoutTimes;
|
|
28
28
|
hotelImages: HotelImage[];
|
|
29
29
|
hotelFacilities: string[];
|
package/dist/models/Hotel.js
CHANGED
|
@@ -91,6 +91,7 @@ __decorate([
|
|
|
91
91
|
__metadata("design:type", String)
|
|
92
92
|
], Hotel.prototype, "zip", void 0);
|
|
93
93
|
__decorate([
|
|
94
|
+
sequelize_typescript_1.Index,
|
|
94
95
|
(0, sequelize_typescript_1.Column)({
|
|
95
96
|
type: sequelize_typescript_1.DataType.STRING,
|
|
96
97
|
allowNull: false,
|
|
@@ -98,11 +99,12 @@ __decorate([
|
|
|
98
99
|
__metadata("design:type", String)
|
|
99
100
|
], Hotel.prototype, "main_photo", void 0);
|
|
100
101
|
__decorate([
|
|
102
|
+
sequelize_typescript_1.Index,
|
|
101
103
|
(0, sequelize_typescript_1.Column)({
|
|
102
|
-
type: sequelize_typescript_1.DataType.
|
|
104
|
+
type: sequelize_typescript_1.DataType.FLOAT,
|
|
103
105
|
allowNull: false,
|
|
104
106
|
}),
|
|
105
|
-
__metadata("design:type",
|
|
107
|
+
__metadata("design:type", Number)
|
|
106
108
|
], Hotel.prototype, "stars", void 0);
|
|
107
109
|
__decorate([
|
|
108
110
|
(0, sequelize_typescript_1.Column)({
|