whitelabel-db 1.0.52 → 1.0.54
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 +11 -0
- package/dist/libs/liteapiv3.d.ts +3 -1
- package/dist/libs/liteapiv3.js +13 -9
- package/dist/models/Hotel.d.ts +2 -0
- package/dist/models/Hotel.js +14 -0
- package/dist/models/Project.d.ts +1 -1
- package/dist/models/Project.js +2 -2
- package/dist/models/UserRole.d.ts +6 -0
- package/dist/models/{Search.js → UserRole.js} +19 -34
- package/package.json +1 -1
- package/dist/models/Search.d.ts +0 -8
package/README.md
CHANGED
package/dist/libs/liteapiv3.d.ts
CHANGED
|
@@ -195,7 +195,9 @@ export interface CancelBookingV3 {
|
|
|
195
195
|
}
|
|
196
196
|
export declare class LiteApiClientV3 {
|
|
197
197
|
private apiKey;
|
|
198
|
-
|
|
198
|
+
private baseUrl;
|
|
199
|
+
private bookingBaseUrl;
|
|
200
|
+
constructor(apiKey: string, useProduction?: boolean);
|
|
199
201
|
getHotels(options: HotelsRequestV3): Promise<AvailabilityResultV3[]>;
|
|
200
202
|
getHotelById(hotelId: string): Promise<AvailabilityResultV3>;
|
|
201
203
|
getHotelsFullRate(options: HotelsRequestV3): Promise<FullRateAvailabilityResultV3[]>;
|
package/dist/libs/liteapiv3.js
CHANGED
|
@@ -14,16 +14,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.LiteApiClientV3 = void 0;
|
|
16
16
|
const axios_1 = __importDefault(require("axios"));
|
|
17
|
-
const baseUrl = 'https://api.liteapi.travel';
|
|
18
|
-
const bookingBaseUrl = 'https://book.liteapi.travel';
|
|
19
17
|
class LiteApiClientV3 {
|
|
20
|
-
constructor(apiKey) {
|
|
18
|
+
constructor(apiKey, useProduction = true) {
|
|
21
19
|
this.apiKey = apiKey;
|
|
20
|
+
this.baseUrl = useProduction
|
|
21
|
+
? 'https://api.liteapi.travel'
|
|
22
|
+
: 'https://api.dev.liteapi.travel';
|
|
23
|
+
this.bookingBaseUrl = useProduction
|
|
24
|
+
? 'https://book.liteapi.travel'
|
|
25
|
+
: 'https://book.dev.liteapi.travel';
|
|
22
26
|
}
|
|
23
27
|
getHotels(options) {
|
|
24
28
|
return __awaiter(this, void 0, void 0, function* () {
|
|
25
29
|
return (yield (0, axios_1.default)({
|
|
26
|
-
url: `${baseUrl}/v3.0/hotels`,
|
|
30
|
+
url: `${this.baseUrl}/v3.0/hotels`,
|
|
27
31
|
params: options,
|
|
28
32
|
headers: {
|
|
29
33
|
'X-API-Key': this.apiKey,
|
|
@@ -34,7 +38,7 @@ class LiteApiClientV3 {
|
|
|
34
38
|
getHotelById(hotelId) {
|
|
35
39
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36
40
|
return (yield (0, axios_1.default)({
|
|
37
|
-
url: `${baseUrl}/v3.0/hotels/${hotelId}`,
|
|
41
|
+
url: `${this.baseUrl}/v3.0/hotels/${hotelId}`,
|
|
38
42
|
headers: {
|
|
39
43
|
'X-API-Key': this.apiKey,
|
|
40
44
|
},
|
|
@@ -46,7 +50,7 @@ class LiteApiClientV3 {
|
|
|
46
50
|
const query = options.rm ? `rm=${options.rm}` : ``;
|
|
47
51
|
return (yield (0, axios_1.default)({
|
|
48
52
|
method: 'post',
|
|
49
|
-
url: `${baseUrl}/v3.0/hotels/rates?${query}`,
|
|
53
|
+
url: `${this.baseUrl}/v3.0/hotels/rates?${query}`,
|
|
50
54
|
data: options,
|
|
51
55
|
headers: {
|
|
52
56
|
'X-API-Key': this.apiKey,
|
|
@@ -58,7 +62,7 @@ class LiteApiClientV3 {
|
|
|
58
62
|
return __awaiter(this, void 0, void 0, function* () {
|
|
59
63
|
return (yield (0, axios_1.default)({
|
|
60
64
|
method: 'post',
|
|
61
|
-
url: `${bookingBaseUrl}/v3.0/rates/prebook`,
|
|
65
|
+
url: `${this.bookingBaseUrl}/v3.0/rates/prebook`,
|
|
62
66
|
data: options,
|
|
63
67
|
headers: {
|
|
64
68
|
'X-API-Key': this.apiKey,
|
|
@@ -71,7 +75,7 @@ class LiteApiClientV3 {
|
|
|
71
75
|
return __awaiter(this, void 0, void 0, function* () {
|
|
72
76
|
return (yield (0, axios_1.default)({
|
|
73
77
|
method: 'post',
|
|
74
|
-
url: `${bookingBaseUrl}/v3.0/rates/book`,
|
|
78
|
+
url: `${this.bookingBaseUrl}/v3.0/rates/book`,
|
|
75
79
|
data: options,
|
|
76
80
|
headers: {
|
|
77
81
|
'X-API-Key': this.apiKey,
|
|
@@ -84,7 +88,7 @@ class LiteApiClientV3 {
|
|
|
84
88
|
return __awaiter(this, void 0, void 0, function* () {
|
|
85
89
|
return (yield (0, axios_1.default)({
|
|
86
90
|
method: 'put',
|
|
87
|
-
url: `${bookingBaseUrl}/v3.0/bookings/${bookingId}`,
|
|
91
|
+
url: `${this.bookingBaseUrl}/v3.0/bookings/${bookingId}`,
|
|
88
92
|
headers: {
|
|
89
93
|
'X-API-Key': this.apiKey,
|
|
90
94
|
'content-type': 'application/json',
|
package/dist/models/Hotel.d.ts
CHANGED
package/dist/models/Hotel.js
CHANGED
|
@@ -105,6 +105,20 @@ __decorate([
|
|
|
105
105
|
}),
|
|
106
106
|
__metadata("design:type", String)
|
|
107
107
|
], Hotel.prototype, "thumbnail", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, sequelize_typescript_1.Column)({
|
|
110
|
+
type: sequelize_typescript_1.DataType.STRING,
|
|
111
|
+
allowNull: false,
|
|
112
|
+
}),
|
|
113
|
+
__metadata("design:type", String)
|
|
114
|
+
], Hotel.prototype, "hotelType", void 0);
|
|
115
|
+
__decorate([
|
|
116
|
+
(0, sequelize_typescript_1.Column)({
|
|
117
|
+
type: sequelize_typescript_1.DataType.STRING,
|
|
118
|
+
allowNull: false,
|
|
119
|
+
}),
|
|
120
|
+
__metadata("design:type", String)
|
|
121
|
+
], Hotel.prototype, "airportCode", void 0);
|
|
108
122
|
__decorate([
|
|
109
123
|
sequelize_typescript_1.Index,
|
|
110
124
|
(0, sequelize_typescript_1.Column)({
|
package/dist/models/Project.d.ts
CHANGED
|
@@ -16,5 +16,5 @@ export declare class Project extends Model<Partial<Project>> {
|
|
|
16
16
|
appearance?: object;
|
|
17
17
|
generateSession(secret: string): string;
|
|
18
18
|
getLiteApiClient(): LiteApiClient;
|
|
19
|
-
getLiteApiClientV3(): LiteApiClientV3;
|
|
19
|
+
getLiteApiClientV3(useProduction?: boolean): LiteApiClientV3;
|
|
20
20
|
}
|
package/dist/models/Project.js
CHANGED
|
@@ -44,14 +44,14 @@ let Project = class Project extends sequelize_typescript_1.Model {
|
|
|
44
44
|
throw err;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
getLiteApiClientV3() {
|
|
47
|
+
getLiteApiClientV3(useProduction = true) {
|
|
48
48
|
try {
|
|
49
49
|
let key = this.settings.liteApiKey;
|
|
50
50
|
if (!key || !key.length) {
|
|
51
51
|
key = process.env.LITEAPI_KEY;
|
|
52
52
|
}
|
|
53
53
|
if (!clientV3[key]) {
|
|
54
|
-
clientV3[key] = new liteapiv3_1.LiteApiClientV3(key);
|
|
54
|
+
clientV3[key] = new liteapiv3_1.LiteApiClientV3(key, useProduction);
|
|
55
55
|
}
|
|
56
56
|
return clientV3[key];
|
|
57
57
|
}
|
|
@@ -9,53 +9,38 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.UserRole = void 0;
|
|
13
|
+
const sequelize_1 = require("sequelize");
|
|
13
14
|
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
14
|
-
let
|
|
15
|
+
let UserRole = class UserRole extends sequelize_typescript_1.Model {
|
|
15
16
|
};
|
|
16
|
-
exports.
|
|
17
|
+
exports.UserRole = UserRole;
|
|
17
18
|
__decorate([
|
|
18
19
|
sequelize_typescript_1.PrimaryKey,
|
|
19
|
-
sequelize_typescript_1.Index,
|
|
20
20
|
(0, sequelize_typescript_1.Column)({
|
|
21
|
-
type:
|
|
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,
|
|
21
|
+
type: sequelize_1.NUMBER,
|
|
28
22
|
allowNull: false,
|
|
29
|
-
|
|
23
|
+
autoIncrement: true,
|
|
30
24
|
}),
|
|
31
|
-
__metadata("design:type",
|
|
32
|
-
],
|
|
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);
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], UserRole.prototype, "id", void 0);
|
|
41
27
|
__decorate([
|
|
42
28
|
sequelize_typescript_1.Unique,
|
|
43
|
-
sequelize_typescript_1.Index,
|
|
44
29
|
(0, sequelize_typescript_1.Column)({
|
|
45
|
-
type: sequelize_typescript_1.DataType.
|
|
30
|
+
type: sequelize_typescript_1.DataType.STRING,
|
|
31
|
+
allowNull: false,
|
|
46
32
|
}),
|
|
47
|
-
__metadata("design:type",
|
|
48
|
-
],
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], UserRole.prototype, "name", void 0);
|
|
49
35
|
__decorate([
|
|
50
36
|
(0, sequelize_typescript_1.Column)({
|
|
51
|
-
type: sequelize_typescript_1.DataType.
|
|
52
|
-
allowNull:
|
|
53
|
-
defaultValue: {},
|
|
37
|
+
type: sequelize_typescript_1.DataType.STRING,
|
|
38
|
+
allowNull: true,
|
|
54
39
|
}),
|
|
55
|
-
__metadata("design:type",
|
|
56
|
-
],
|
|
57
|
-
exports.
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], UserRole.prototype, "description", void 0);
|
|
42
|
+
exports.UserRole = UserRole = __decorate([
|
|
58
43
|
(0, sequelize_typescript_1.Table)({
|
|
59
|
-
tableName: '
|
|
44
|
+
tableName: 'user_roles',
|
|
60
45
|
})
|
|
61
|
-
],
|
|
46
|
+
], UserRole);
|
package/package.json
CHANGED