whitelabel-db 1.2.2 → 1.2.4
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 +1 -0
- package/dist/libs/liteapiv3.js +12 -0
- package/dist/migrations/029-add-project-inventoryrule.d.ts +3 -0
- package/dist/migrations/029-add-project-inventoryrule.js +47 -0
- package/dist/models/Project.d.ts +1 -0
- package/dist/models/Project.js +8 -0
- package/package.json +1 -1
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,47 @@
|
|
|
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 inventoryRule column to project table.
|
|
14
|
+
const sequelize_1 = require("sequelize");
|
|
15
|
+
const up = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
try {
|
|
17
|
+
// Check if inventoryRule column already exists
|
|
18
|
+
const tableDescription = yield queryInterface.describeTable('projects');
|
|
19
|
+
const existingColumns = Object.keys(tableDescription);
|
|
20
|
+
if (existingColumns.includes('inventoryRule')) {
|
|
21
|
+
console.log('inventoryRule column already exists, skipping migration.');
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
yield queryInterface.addColumn('projects', 'inventoryRule', {
|
|
25
|
+
type: sequelize_1.DataTypes.JSONB,
|
|
26
|
+
allowNull: false,
|
|
27
|
+
defaultValue: {},
|
|
28
|
+
});
|
|
29
|
+
console.log('inventoryRule column added successfully.');
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
console.error('Error while adding inventoryRule column:', error.message);
|
|
33
|
+
throw error;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
exports.up = up;
|
|
37
|
+
const down = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
|
|
38
|
+
try {
|
|
39
|
+
// Remove columns
|
|
40
|
+
yield queryInterface.removeColumn('projects', 'inventoryRule');
|
|
41
|
+
console.log('column removed successfully.');
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
console.error('Error while removing columns:', error.message);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
exports.down = down;
|
package/dist/models/Project.d.ts
CHANGED
package/dist/models/Project.js
CHANGED
|
@@ -115,6 +115,14 @@ __decorate([
|
|
|
115
115
|
}),
|
|
116
116
|
__metadata("design:type", Array)
|
|
117
117
|
], Project.prototype, "marketSegments", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
(0, sequelize_typescript_1.Column)({
|
|
120
|
+
type: sequelize_typescript_1.DataType.ARRAY(sequelize_typescript_1.DataType.JSONB),
|
|
121
|
+
allowNull: false,
|
|
122
|
+
defaultValue: {},
|
|
123
|
+
}),
|
|
124
|
+
__metadata("design:type", Object)
|
|
125
|
+
], Project.prototype, "inventoryRule", void 0);
|
|
118
126
|
__decorate([
|
|
119
127
|
(0, sequelize_typescript_1.Column)({
|
|
120
128
|
type: sequelize_typescript_1.DataType.JSONB,
|