whitelabel-db 1.2.1 → 1.2.3
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/libs/liteapiv3.d.ts
CHANGED
|
@@ -381,6 +381,7 @@ export declare class LiteApiClientV3 {
|
|
|
381
381
|
bookHotelRate(options: CheckoutRequestV3): Promise<BookingInfoV3>;
|
|
382
382
|
cancelBooking(bookingId: string): Promise<CancelBookingV3>;
|
|
383
383
|
getBooking(bookingId: string, key?: string): Promise<BookingInfoV3>;
|
|
384
|
+
getPrebook(prebookId: string, key?: string): Promise<PrebookRateV3>;
|
|
384
385
|
getGuests(): Promise<GuestV3[]>;
|
|
385
386
|
getGuest(guestId: number): Promise<GuestV3>;
|
|
386
387
|
getGuestBookings(guestId: number): Promise<GuestBookingV3[]>;
|
package/dist/libs/liteapiv3.js
CHANGED
|
@@ -130,6 +130,18 @@ class LiteApiClientV3 {
|
|
|
130
130
|
})).data.data;
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
|
+
getPrebook(prebookId, key) {
|
|
134
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
135
|
+
return (yield (0, axios_1.default)({
|
|
136
|
+
method: 'get',
|
|
137
|
+
url: `${this.bookingBaseUrl}/v3.0/prebooks/${prebookId}`,
|
|
138
|
+
headers: {
|
|
139
|
+
'X-API-Key': key || this.apiKey,
|
|
140
|
+
'content-type': 'application/json',
|
|
141
|
+
},
|
|
142
|
+
})).data.data;
|
|
143
|
+
});
|
|
144
|
+
}
|
|
133
145
|
getGuests() {
|
|
134
146
|
return __awaiter(this, void 0, void 0, function* () {
|
|
135
147
|
return (yield (0, axios_1.default)({
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.down = exports.up = void 0;
|
|
13
|
+
// Purpose: Add deletedAt column to static_hotels table for soft delete functionality.
|
|
14
|
+
const sequelize_1 = require("sequelize");
|
|
15
|
+
const up = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
try {
|
|
17
|
+
// Add deletedAt column to static_hotels table
|
|
18
|
+
yield queryInterface.addColumn('static_hotels', 'deletedAt', {
|
|
19
|
+
type: sequelize_1.DataTypes.DATE,
|
|
20
|
+
allowNull: true,
|
|
21
|
+
});
|
|
22
|
+
yield queryInterface.addColumn('static_hotels', 'primaryId', {
|
|
23
|
+
type: sequelize_1.DataTypes.STRING,
|
|
24
|
+
allowNull: true,
|
|
25
|
+
});
|
|
26
|
+
// Add index for better query performance on deletedAt
|
|
27
|
+
yield queryInterface.addIndex('static_hotels', ['deletedAt'], {
|
|
28
|
+
name: 'idx_static_hotels_deleted_at',
|
|
29
|
+
});
|
|
30
|
+
console.log('deletedAt column and index added successfully to static_hotels table.');
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
console.error('Error while adding deletedAt column:', error.message);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
exports.up = up;
|
|
37
|
+
const down = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
|
|
38
|
+
try {
|
|
39
|
+
// Remove the index first
|
|
40
|
+
yield queryInterface.removeColumn('static_hotels', 'primaryId');
|
|
41
|
+
// Remove the index first
|
|
42
|
+
yield queryInterface.removeIndex('static_hotels', 'idx_static_hotels_deleted_at');
|
|
43
|
+
// Remove deletedAt column
|
|
44
|
+
yield queryInterface.removeColumn('static_hotels', 'deletedAt');
|
|
45
|
+
console.log('deletedAt column and index removed successfully from static_hotels table.');
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
console.error('Error while removing deletedAt column:', error.message);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
exports.down = down;
|
package/dist/models/Hotel.d.ts
CHANGED
|
@@ -109,6 +109,8 @@ export declare class Hotel extends Model<Partial<Hotel>> {
|
|
|
109
109
|
parking?: string;
|
|
110
110
|
video?: string;
|
|
111
111
|
bookingsLast30Days: number;
|
|
112
|
+
deletedAt?: Date;
|
|
113
|
+
primaryId: string;
|
|
112
114
|
accessibility: HotelAccessibility;
|
|
113
115
|
translations: HotelTranslation[];
|
|
114
116
|
hotelFacilityRelations: HotelFacility[];
|
package/dist/models/Hotel.js
CHANGED
|
@@ -452,6 +452,20 @@ __decorate([
|
|
|
452
452
|
}),
|
|
453
453
|
__metadata("design:type", Number)
|
|
454
454
|
], Hotel.prototype, "bookingsLast30Days", void 0);
|
|
455
|
+
__decorate([
|
|
456
|
+
(0, sequelize_typescript_1.Column)({
|
|
457
|
+
type: sequelize_typescript_1.DataType.DATE,
|
|
458
|
+
allowNull: true,
|
|
459
|
+
}),
|
|
460
|
+
__metadata("design:type", Date)
|
|
461
|
+
], Hotel.prototype, "deletedAt", void 0);
|
|
462
|
+
__decorate([
|
|
463
|
+
(0, sequelize_typescript_1.Column)({
|
|
464
|
+
type: sequelize_typescript_1.DataType.STRING,
|
|
465
|
+
allowNull: true,
|
|
466
|
+
}),
|
|
467
|
+
__metadata("design:type", String)
|
|
468
|
+
], Hotel.prototype, "primaryId", void 0);
|
|
455
469
|
__decorate([
|
|
456
470
|
(0, sequelize_typescript_1.HasOne)(() => HotelAccessibility_1.HotelAccessibility),
|
|
457
471
|
__metadata("design:type", HotelAccessibility_1.HotelAccessibility)
|