whitelabel-db 1.0.25 → 1.0.27

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
@@ -6,4 +6,4 @@ export { Hotel } from './models/Hotel';
6
6
  export { User } from './models/User';
7
7
  export { Project } from './models/Project';
8
8
  export { Booking } from './models/Booking';
9
- export { LiteApiClient, HotelsRequest, AvailabilityResult, FullRateAvailabilityResult, RoomType, Rate, PrebookRateRequest, PrebookRate, CheckoutRequest, BookingInfo, } from './libs/liteapi';
9
+ export { LiteApiClient, HotelsRequest, AvailabilityResult, FullRateAvailabilityResult, RoomType, Rate, PrebookRateRequest, PrebookRate, CheckoutRequest, BookingInfo, CancelBooking, } from './libs/liteapi';
@@ -142,6 +142,13 @@ export interface BookingConfirmation {
142
142
  prebookId: string;
143
143
  transactionId: string;
144
144
  }
145
+ export interface CancelBooking {
146
+ bookingId: string;
147
+ status: string;
148
+ cancellation_fee: number;
149
+ refund_amount: number;
150
+ currency: string;
151
+ }
145
152
  export declare class LiteApiClient {
146
153
  private apiKey;
147
154
  constructor(apiKey: string);
@@ -150,4 +157,5 @@ export declare class LiteApiClient {
150
157
  getHotelsFullRate(options: HotelsRequest): Promise<FullRateAvailabilityResult[]>;
151
158
  preBookedHotelRate(options: PrebookRateRequest): Promise<PrebookRate>;
152
159
  bookHotelRate(options: CheckoutRequest): Promise<BookingInfo>;
160
+ cancelBooking(bookingId: string): Promise<CancelBooking>;
153
161
  }
@@ -77,5 +77,17 @@ class LiteApiClient {
77
77
  })).data.data;
78
78
  });
79
79
  }
80
+ cancelBooking(bookingId) {
81
+ return __awaiter(this, void 0, void 0, function* () {
82
+ return (yield (0, axios_1.default)({
83
+ method: 'put',
84
+ url: `${baseUrl}/v2.0/bookings/${bookingId}`,
85
+ headers: {
86
+ 'X-API-Key': this.apiKey,
87
+ 'content-type': 'application/json',
88
+ },
89
+ })).data.data;
90
+ });
91
+ }
80
92
  }
81
93
  exports.LiteApiClient = LiteApiClient;
@@ -24,6 +24,7 @@ export declare class Hotel extends Model<Partial<Hotel>> {
24
24
  zip: string;
25
25
  main_photo: string;
26
26
  stars: number;
27
+ mapped: boolean;
27
28
  checkinCheckoutTimes: CheckinCheckoutTimes;
28
29
  hotelImages: HotelImage[];
29
30
  hotelFacilities: string[];
@@ -106,6 +106,15 @@ __decorate([
106
106
  }),
107
107
  __metadata("design:type", Number)
108
108
  ], Hotel.prototype, "stars", void 0);
109
+ __decorate([
110
+ sequelize_typescript_1.Index,
111
+ (0, sequelize_typescript_1.Column)({
112
+ type: sequelize_typescript_1.DataType.BOOLEAN,
113
+ allowNull: false,
114
+ defaultValue: false,
115
+ }),
116
+ __metadata("design:type", Boolean)
117
+ ], Hotel.prototype, "mapped", void 0);
109
118
  __decorate([
110
119
  (0, sequelize_typescript_1.Column)({
111
120
  type: sequelize_typescript_1.DataType.JSONB,
@@ -0,0 +1,8 @@
1
+ import { Model } from 'sequelize-typescript';
2
+ export declare class Search extends Model<Partial<Search>> {
3
+ id: string;
4
+ hits: number;
5
+ cacheUpdatedAt?: Date;
6
+ cacheQueuedAt?: Date;
7
+ data?: object;
8
+ }
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.Search = void 0;
13
+ const sequelize_typescript_1 = require("sequelize-typescript");
14
+ let Search = class Search extends sequelize_typescript_1.Model {
15
+ };
16
+ exports.Search = Search;
17
+ __decorate([
18
+ sequelize_typescript_1.PrimaryKey,
19
+ sequelize_typescript_1.Index,
20
+ (0, sequelize_typescript_1.Column)({
21
+ type: sequelize_typescript_1.DataType.STRING(32),
22
+ }),
23
+ __metadata("design:type", String)
24
+ ], Search.prototype, "id", void 0);
25
+ __decorate([
26
+ (0, sequelize_typescript_1.Column)({
27
+ type: sequelize_typescript_1.DataType.INTEGER,
28
+ allowNull: false,
29
+ defaultValue: 0,
30
+ }),
31
+ __metadata("design:type", Number)
32
+ ], Search.prototype, "hits", void 0);
33
+ __decorate([
34
+ sequelize_typescript_1.Unique,
35
+ sequelize_typescript_1.Index,
36
+ (0, sequelize_typescript_1.Column)({
37
+ type: sequelize_typescript_1.DataType.DATE,
38
+ }),
39
+ __metadata("design:type", Date)
40
+ ], Search.prototype, "cacheUpdatedAt", void 0);
41
+ __decorate([
42
+ sequelize_typescript_1.Unique,
43
+ sequelize_typescript_1.Index,
44
+ (0, sequelize_typescript_1.Column)({
45
+ type: sequelize_typescript_1.DataType.DATE,
46
+ }),
47
+ __metadata("design:type", Date)
48
+ ], Search.prototype, "cacheQueuedAt", void 0);
49
+ __decorate([
50
+ (0, sequelize_typescript_1.Column)({
51
+ type: sequelize_typescript_1.DataType.JSONB,
52
+ allowNull: false,
53
+ defaultValue: {},
54
+ }),
55
+ __metadata("design:type", Object)
56
+ ], Search.prototype, "data", void 0);
57
+ exports.Search = Search = __decorate([
58
+ (0, sequelize_typescript_1.Table)({
59
+ tableName: 'searches',
60
+ })
61
+ ], Search);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whitelabel-db",
3
- "version": "1.0.25",
3
+ "version": "1.0.27",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",