whitelabel-db 1.0.10 → 1.0.11

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,25 +1,25 @@
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.
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, FullRateAvailabilityResult, RoomType, Rate, } from './libs/liteapi';
8
+ export { LiteApiClient, HotelsRequest, AvailabilityResult, FullRateAvailabilityResult, RoomType, Rate, PrebookRateRequest, PrebookRate, } from './libs/liteapi';
@@ -56,10 +56,31 @@ export interface FullRateAvailabilityResult {
56
56
  termsAndConditions: string;
57
57
  roomTypes: RoomType[];
58
58
  }
59
+ export interface PrebookRateRequest {
60
+ rateId: string;
61
+ payWithStripe?: boolean;
62
+ }
63
+ export interface PrebookRate {
64
+ prebookId: string;
65
+ hotelId: string;
66
+ currency: string;
67
+ termsAndConditions: string;
68
+ roomTypes: RoomType[];
69
+ msp: number;
70
+ commission: number;
71
+ price: number;
72
+ priceType: string;
73
+ priceDifferencePercent: number;
74
+ cancellationChanged: boolean;
75
+ boardChanged: boolean;
76
+ supplier: string;
77
+ supplierId: number;
78
+ }
59
79
  export declare class LiteApiClient {
60
80
  private apiKey;
61
81
  constructor(apiKey: string);
62
82
  getHotels(options: HotelsRequest): Promise<AvailabilityResult[]>;
63
83
  getHotelById(hotelId: string): Promise<AvailabilityResult>;
64
84
  getHotelsFullRate(options: HotelsRequest): Promise<FullRateAvailabilityResult[]>;
85
+ preBookedHotelRate(options: PrebookRateRequest): Promise<PrebookRate>;
65
86
  }
@@ -51,5 +51,18 @@ class LiteApiClient {
51
51
  })).data.data;
52
52
  });
53
53
  }
54
+ preBookedHotelRate(options) {
55
+ return __awaiter(this, void 0, void 0, function* () {
56
+ return (yield (0, axios_1.default)({
57
+ method: 'post',
58
+ url: `${baseUrl}/v2.0/rates/prebook`,
59
+ data: options,
60
+ headers: {
61
+ 'X-API-Key': this.apiKey,
62
+ 'content-type': 'application/json',
63
+ },
64
+ })).data.data;
65
+ });
66
+ }
54
67
  }
55
68
  exports.LiteApiClient = LiteApiClient;
package/package.json CHANGED
@@ -1,44 +1,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
- }
1
+ {
2
+ "name": "whitelabel-db",
3
+ "version": "1.0.11",
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
+ }