whitelabel-db 1.0.9 → 1.0.10

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 CHANGED
@@ -1,8 +1,25 @@
1
- # Whitelabel DB definition
2
-
3
- ### Deploy
4
-
5
- ```bash
6
- npm run build
7
- npm publish
8
- ```
1
+ # Whitelabel DB definition
2
+
3
+ ### Deploy
4
+
5
+ ```bash
6
+ npm run build
7
+ npm publish
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, } from './libs/liteapi';
@@ -15,9 +15,51 @@ 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
+ }
18
59
  export declare class LiteApiClient {
19
60
  private apiKey;
20
61
  constructor(apiKey: string);
21
62
  getHotels(options: HotelsRequest): Promise<AvailabilityResult[]>;
22
63
  getHotelById(hotelId: string): Promise<AvailabilityResult>;
64
+ getHotelsFullRate(options: HotelsRequest): Promise<FullRateAvailabilityResult[]>;
23
65
  }
@@ -40,5 +40,16 @@ 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
+ }
43
54
  }
44
55
  exports.LiteApiClient = LiteApiClient;
@@ -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: string;
26
+ stars: number;
27
27
  checkinCheckoutTimes: CheckinCheckoutTimes;
28
28
  hotelImages: HotelImage[];
29
29
  hotelFacilities: string[];
@@ -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.STRING,
104
+ type: sequelize_typescript_1.DataType.FLOAT,
103
105
  allowNull: false,
104
106
  }),
105
- __metadata("design:type", String)
107
+ __metadata("design:type", Number)
106
108
  ], Hotel.prototype, "stars", void 0);
107
109
  __decorate([
108
110
  (0, sequelize_typescript_1.Column)({
package/package.json CHANGED
@@ -1,44 +1,44 @@
1
- {
2
- "name": "whitelabel-db",
3
- "version": "1.0.9",
4
- "description": "",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "scripts": {
8
- "start": "node dist/index.js",
9
- "start:dev": "ts-node src/index.ts",
10
- "build": "tsc"
11
- },
12
- "author": "",
13
- "license": "ISC",
14
- "devDependencies": {
15
- "@types/jsonwebtoken": "^9.0.4",
16
- "@types/node": "^20.8.9",
17
- "@types/shuffle-array": "^1.0.3",
18
- "axios": "^1.5.1",
19
- "eslint": "^8.51.0",
20
- "eslint-config-prettier": "^9.0.0",
21
- "eslint-plugin-prettier": "^5.0.1",
22
- "ts-node": "^10.9.1",
23
- "typescript": "^5.2.2"
24
- },
25
- "dependencies": {
26
- "@aws-sdk/client-sqs": "^3.438.0",
27
- "@sentry/node": "^7.74.1",
28
- "@typescript-eslint/eslint-plugin": "^6.8.0",
29
- "@typescript-eslint/parser": "^6.8.0",
30
- "api": "^6.1.1",
31
- "jsonwebtoken": "^9.0.2",
32
- "pg": "^8.11.3",
33
- "pg-hstore": "^2.3.4",
34
- "promise-limit": "^2.7.0",
35
- "reflect-metadata": "^0.1.13",
36
- "sequelize": "^6.33.0",
37
- "sequelize-typescript": "^2.1.5",
38
- "shuffle-array": "^1.0.1",
39
- "sqs-consumer": "^7.4.0"
40
- },
41
- "files": [
42
- "/dist"
43
- ]
44
- }
1
+ {
2
+ "name": "whitelabel-db",
3
+ "version": "1.0.10",
4
+ "description": "",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "start": "node dist/index.js",
9
+ "start:dev": "ts-node src/index.ts",
10
+ "build": "tsc"
11
+ },
12
+ "author": "",
13
+ "license": "ISC",
14
+ "devDependencies": {
15
+ "@types/jsonwebtoken": "^9.0.4",
16
+ "@types/node": "^20.8.9",
17
+ "@types/shuffle-array": "^1.0.3",
18
+ "axios": "^1.5.1",
19
+ "eslint": "^8.51.0",
20
+ "eslint-config-prettier": "^9.0.0",
21
+ "eslint-plugin-prettier": "^5.0.1",
22
+ "ts-node": "^10.9.1",
23
+ "typescript": "^5.2.2"
24
+ },
25
+ "dependencies": {
26
+ "@aws-sdk/client-sqs": "^3.438.0",
27
+ "@sentry/node": "^7.74.1",
28
+ "@typescript-eslint/eslint-plugin": "^6.8.0",
29
+ "@typescript-eslint/parser": "^6.8.0",
30
+ "api": "^6.1.1",
31
+ "jsonwebtoken": "^9.0.2",
32
+ "pg": "^8.11.3",
33
+ "pg-hstore": "^2.3.4",
34
+ "promise-limit": "^2.7.0",
35
+ "reflect-metadata": "^0.1.13",
36
+ "sequelize": "^6.33.0",
37
+ "sequelize-typescript": "^2.1.5",
38
+ "shuffle-array": "^1.0.1",
39
+ "sqs-consumer": "^7.4.0"
40
+ },
41
+ "files": [
42
+ "/dist"
43
+ ]
44
+ }