@qite/tide-client 1.0.45 → 1.0.48
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/build/index.js +60 -0
- package/build/index.js.map +1 -1
- package/build/types/offer/affiliates.d.ts +5 -0
- package/build/types/offer/booking-v2/response/booking-package-item.d.ts +14 -5
- package/build/types/offer/booking-v2/shared/booking-package-hotel-option.d.ts +10 -10
- package/build/types/offer/booking-v2/shared/booking-package-hotel.d.ts +19 -19
- package/build/types/offer/booking-v2/shared/booking-package.d.ts +39 -39
- package/build/types/offer/flight-meta-data.d.ts +14 -14
- package/build/utils/api.d.ts +5 -0
- package/build/utils/common-client.d.ts +6 -0
- package/build/utils/web-client.d.ts +12 -0
- package/build/utils/web-file.d.ts +14 -0
- package/package.json +56 -56
- package/src/types/offer/affiliates.ts +5 -0
- package/src/types/offer/booking-v2/response/booking-package-item.ts +14 -6
- package/src/types/offer/booking-v2/shared/booking-package-hotel-option.ts +10 -10
- package/src/types/offer/booking-v2/shared/booking-package-hotel.ts +24 -24
- package/src/types/offer/booking-v2/shared/booking-package.ts +47 -47
- package/src/types/offer/flight-meta-data.ts +15 -15
- package/src/utils/api.ts +20 -0
- package/src/utils/common-client.ts +16 -1
- package/src/utils/web-client.ts +20 -0
- package/src/utils/web-file.ts +24 -0
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
import { BookingPackageAllotmentInfo } from "./booking-package-allotment-info";
|
|
2
2
|
export interface BookingPackageItem {
|
|
3
|
+
accommodationCode: string;
|
|
4
|
+
airportCode?: string;
|
|
5
|
+
allotment: BookingPackageAllotmentInfo;
|
|
6
|
+
averagePricePerPerson: number;
|
|
3
7
|
catalogueId: number;
|
|
4
8
|
code: string;
|
|
9
|
+
fromDate: string;
|
|
10
|
+
latitude: number;
|
|
11
|
+
longitude: number;
|
|
5
12
|
name: string;
|
|
13
|
+
outwardFlightCode?: string;
|
|
14
|
+
outwardFlightNumbers?: string[];
|
|
6
15
|
price: number;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
toDate: string;
|
|
16
|
+
regimeCode?: string;
|
|
17
|
+
returnFlightCode?: string;
|
|
18
|
+
returnFlightNumbers?: string[];
|
|
11
19
|
tagIds: number[];
|
|
12
|
-
|
|
20
|
+
toDate: string;
|
|
21
|
+
type: number;
|
|
13
22
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export interface BookingPackageHotelOption {
|
|
2
|
-
entryLineGuid: string;
|
|
3
|
-
accommodationCode: string;
|
|
4
|
-
accommodationName: string;
|
|
5
|
-
regimeCode: string;
|
|
6
|
-
regimeName: string;
|
|
7
|
-
price: number;
|
|
8
|
-
isSelected: boolean;
|
|
9
|
-
roomIndex: number;
|
|
10
|
-
}
|
|
1
|
+
export interface BookingPackageHotelOption {
|
|
2
|
+
entryLineGuid: string;
|
|
3
|
+
accommodationCode: string;
|
|
4
|
+
accommodationName: string;
|
|
5
|
+
regimeCode: string;
|
|
6
|
+
regimeName: string;
|
|
7
|
+
price: number;
|
|
8
|
+
isSelected: boolean;
|
|
9
|
+
roomIndex: number;
|
|
10
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { BookingPackageHotelRoom } from "./booking-package-hotel-room";
|
|
2
|
-
export interface BookingPackageHotel {
|
|
3
|
-
name: string;
|
|
4
|
-
productCode: string;
|
|
5
|
-
isSelected: boolean;
|
|
6
|
-
cheapestPrice: number;
|
|
7
|
-
hotelSupplier: number;
|
|
8
|
-
latitude: number;
|
|
9
|
-
longitude: number;
|
|
10
|
-
rooms: BookingPackageHotelRoom[];
|
|
11
|
-
combinations: string[][];
|
|
12
|
-
stars: string;
|
|
13
|
-
rating: string;
|
|
14
|
-
description: string;
|
|
15
|
-
imageUrl: string;
|
|
16
|
-
facilities: string;
|
|
17
|
-
travelDurationToVenue: string;
|
|
18
|
-
travelDurationToCenter: string;
|
|
19
|
-
}
|
|
1
|
+
import { BookingPackageHotelRoom } from "./booking-package-hotel-room";
|
|
2
|
+
export interface BookingPackageHotel {
|
|
3
|
+
name: string;
|
|
4
|
+
productCode: string;
|
|
5
|
+
isSelected: boolean;
|
|
6
|
+
cheapestPrice: number;
|
|
7
|
+
hotelSupplier: number;
|
|
8
|
+
latitude: number;
|
|
9
|
+
longitude: number;
|
|
10
|
+
rooms: BookingPackageHotelRoom[];
|
|
11
|
+
combinations: string[][];
|
|
12
|
+
stars: string;
|
|
13
|
+
rating: string;
|
|
14
|
+
description: string;
|
|
15
|
+
imageUrl: string;
|
|
16
|
+
facilities: string;
|
|
17
|
+
travelDurationToVenue: string;
|
|
18
|
+
travelDurationToCenter: string;
|
|
19
|
+
}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { BookingOptionGroup } from "./booking-option-group";
|
|
2
|
-
import { BookingOptionPax } from "./booking-option-pax";
|
|
3
|
-
import { BookingOptionUnit } from "./booking-option-unit";
|
|
4
|
-
import { BookingPackageFlight } from "./booking-package-flight";
|
|
5
|
-
import { BookingPackageHotel } from "./booking-package-hotel";
|
|
6
|
-
import { BookingPackageRequestRoom } from "./booking-package-request-room";
|
|
7
|
-
import { BookingPackageRoom } from "./booking-package-room";
|
|
8
|
-
import { PerBookingPackageOption } from "./per-booking-package-option";
|
|
9
|
-
export interface BookingPackage {
|
|
10
|
-
catalogueId: number;
|
|
11
|
-
code: string;
|
|
12
|
-
name: string;
|
|
13
|
-
price: number;
|
|
14
|
-
serviceType: number;
|
|
15
|
-
tagIds: number[];
|
|
16
|
-
countryName: string;
|
|
17
|
-
regionName: string;
|
|
18
|
-
oordName: string;
|
|
19
|
-
locationName: string;
|
|
20
|
-
unitCount: number;
|
|
21
|
-
requestRooms: BookingPackageRequestRoom[];
|
|
22
|
-
fromDate: string;
|
|
23
|
-
toDate: string;
|
|
24
|
-
startTime: string;
|
|
25
|
-
endTime: string;
|
|
26
|
-
outwardFlights: BookingPackageFlight[];
|
|
27
|
-
returnFlights: BookingPackageFlight[];
|
|
28
|
-
hotels: BookingPackageHotel[];
|
|
29
|
-
allotmentTourCode: string;
|
|
30
|
-
allotmentName: string;
|
|
31
|
-
customAllotmentStatus: string;
|
|
32
|
-
allotmentTagIds: number[];
|
|
33
|
-
rooms: BookingPackageRoom[];
|
|
34
|
-
groups: BookingOptionGroup<PerBookingPackageOption>[];
|
|
35
|
-
optionUnits: BookingOptionUnit[];
|
|
36
|
-
optionPax: BookingOptionPax[];
|
|
37
|
-
transactionId: string;
|
|
38
|
-
transactionExpiration: string;
|
|
39
|
-
}
|
|
1
|
+
import { BookingOptionGroup } from "./booking-option-group";
|
|
2
|
+
import { BookingOptionPax } from "./booking-option-pax";
|
|
3
|
+
import { BookingOptionUnit } from "./booking-option-unit";
|
|
4
|
+
import { BookingPackageFlight } from "./booking-package-flight";
|
|
5
|
+
import { BookingPackageHotel } from "./booking-package-hotel";
|
|
6
|
+
import { BookingPackageRequestRoom } from "./booking-package-request-room";
|
|
7
|
+
import { BookingPackageRoom } from "./booking-package-room";
|
|
8
|
+
import { PerBookingPackageOption } from "./per-booking-package-option";
|
|
9
|
+
export interface BookingPackage {
|
|
10
|
+
catalogueId: number;
|
|
11
|
+
code: string;
|
|
12
|
+
name: string;
|
|
13
|
+
price: number;
|
|
14
|
+
serviceType: number;
|
|
15
|
+
tagIds: number[];
|
|
16
|
+
countryName: string;
|
|
17
|
+
regionName: string;
|
|
18
|
+
oordName: string;
|
|
19
|
+
locationName: string;
|
|
20
|
+
unitCount: number;
|
|
21
|
+
requestRooms: BookingPackageRequestRoom[];
|
|
22
|
+
fromDate: string;
|
|
23
|
+
toDate: string;
|
|
24
|
+
startTime: string;
|
|
25
|
+
endTime: string;
|
|
26
|
+
outwardFlights: BookingPackageFlight[];
|
|
27
|
+
returnFlights: BookingPackageFlight[];
|
|
28
|
+
hotels: BookingPackageHotel[];
|
|
29
|
+
allotmentTourCode: string;
|
|
30
|
+
allotmentName: string;
|
|
31
|
+
customAllotmentStatus: string;
|
|
32
|
+
allotmentTagIds: number[];
|
|
33
|
+
rooms: BookingPackageRoom[];
|
|
34
|
+
groups: BookingOptionGroup<PerBookingPackageOption>[];
|
|
35
|
+
optionUnits: BookingOptionUnit[];
|
|
36
|
+
optionPax: BookingOptionPax[];
|
|
37
|
+
transactionId: string;
|
|
38
|
+
transactionExpiration: string;
|
|
39
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { AdditionalServices, FlightMetaDataLine } from ".";
|
|
2
|
-
export interface FlightMetaData {
|
|
3
|
-
flightLines: FlightMetaDataLine[];
|
|
4
|
-
pnr: string;
|
|
5
|
-
orderId: string;
|
|
6
|
-
additionalServices: AdditionalServices;
|
|
7
|
-
isLowCost: boolean;
|
|
8
|
-
luggageIncluded: boolean;
|
|
9
|
-
validatingAirlines: string;
|
|
10
|
-
bagageAllowed: boolean;
|
|
11
|
-
bagage: string;
|
|
12
|
-
mealIncluded: boolean;
|
|
13
|
-
meal: string;
|
|
14
|
-
}
|
|
1
|
+
import { AdditionalServices, FlightMetaDataLine } from ".";
|
|
2
|
+
export interface FlightMetaData {
|
|
3
|
+
flightLines: FlightMetaDataLine[];
|
|
4
|
+
pnr: string;
|
|
5
|
+
orderId: string;
|
|
6
|
+
additionalServices: AdditionalServices;
|
|
7
|
+
isLowCost: boolean;
|
|
8
|
+
luggageIncluded: boolean;
|
|
9
|
+
validatingAirlines: string;
|
|
10
|
+
bagageAllowed: boolean;
|
|
11
|
+
bagage: string;
|
|
12
|
+
mealIncluded: boolean;
|
|
13
|
+
meal: string;
|
|
14
|
+
}
|
package/build/utils/api.d.ts
CHANGED
|
@@ -5,3 +5,9 @@ export declare const post: <T>(
|
|
|
5
5
|
signal?: AbortSignal | undefined,
|
|
6
6
|
skipReviver?: boolean | undefined
|
|
7
7
|
) => Promise<T>;
|
|
8
|
+
export declare const get: <T>(
|
|
9
|
+
url: string,
|
|
10
|
+
apiKey: string,
|
|
11
|
+
signal?: AbortSignal | undefined,
|
|
12
|
+
skipReviver?: boolean | undefined
|
|
13
|
+
) => Promise<T>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CrmContactRequest, TideClientConfig } from "../types";
|
|
2
|
+
import { Affiliates } from "../types/offer/affiliates";
|
|
2
3
|
/**
|
|
3
4
|
* api/web/crmcontact
|
|
4
5
|
* Creates a CRM contact.
|
|
@@ -12,3 +13,14 @@ export declare const createCrmContact: (
|
|
|
12
13
|
request: CrmContactRequest,
|
|
13
14
|
signal?: AbortSignal | undefined
|
|
14
15
|
) => Promise<Response>;
|
|
16
|
+
/**
|
|
17
|
+
* api/web/affiliates
|
|
18
|
+
* Gets all Affiliates
|
|
19
|
+
* @param config
|
|
20
|
+
* @param signal
|
|
21
|
+
* @returns OK if succeeded.
|
|
22
|
+
*/
|
|
23
|
+
export declare const getAffiliates: (
|
|
24
|
+
config: TideClientConfig,
|
|
25
|
+
signal?: AbortSignal | undefined
|
|
26
|
+
) => Promise<[Affiliates]>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TideClientConfig } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* api/web/file/feed
|
|
4
|
+
* fetch a xml from blob feed.
|
|
5
|
+
* @param config
|
|
6
|
+
* @param request
|
|
7
|
+
* @param signal
|
|
8
|
+
* @returns OK if succeeded.
|
|
9
|
+
*/
|
|
10
|
+
export declare const contactForm: (
|
|
11
|
+
config: TideClientConfig,
|
|
12
|
+
request: string,
|
|
13
|
+
signal?: AbortSignal | undefined
|
|
14
|
+
) => Promise<Response>;
|
package/package.json
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@qite/tide-client",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Frontend client for Tide",
|
|
5
|
-
"main": "build/index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"build": "rollup -c",
|
|
8
|
-
"tsc": "tsc --noEmit",
|
|
9
|
-
"format": "prettier --write .",
|
|
10
|
-
"test": "jest"
|
|
11
|
-
},
|
|
12
|
-
"repository": {
|
|
13
|
-
"type": "git",
|
|
14
|
-
"url": "git+ssh://git@bitbucket.org/qitegeneral/tide-client.git"
|
|
15
|
-
},
|
|
16
|
-
"keywords": [
|
|
17
|
-
"tide",
|
|
18
|
-
"client"
|
|
19
|
-
],
|
|
20
|
-
"author": "Kristof Colpaert <kristof.colpaert@qite.be>",
|
|
21
|
-
"license": "OBSD",
|
|
22
|
-
"homepage": "https://bitbucket.org/qitegeneral/tide-client#readme",
|
|
23
|
-
"devDependencies": {
|
|
24
|
-
"@rollup/plugin-commonjs": "^19.0.0",
|
|
25
|
-
"@rollup/plugin-node-resolve": "^13.0.0",
|
|
26
|
-
"@types/jest": "^26.0.23",
|
|
27
|
-
"@types/moment": "^2.13.0",
|
|
28
|
-
"dotenv": "^9.0.2",
|
|
29
|
-
"jest": "^26.6.3",
|
|
30
|
-
"jest-fetch-mock": "^3.0.3",
|
|
31
|
-
"momentjs": "^2.0.0",
|
|
32
|
-
"prettier": "^2.3.0",
|
|
33
|
-
"rollup": "^2.48.0",
|
|
34
|
-
"rollup-plugin-typescript2": "^0.30.0",
|
|
35
|
-
"ts-jest": "^26.5.6",
|
|
36
|
-
"tslib": "^2.2.0",
|
|
37
|
-
"typescript": "^4.2.4"
|
|
38
|
-
},
|
|
39
|
-
"jest": {
|
|
40
|
-
"moduleFileExtensions": [
|
|
41
|
-
"ts",
|
|
42
|
-
"js"
|
|
43
|
-
],
|
|
44
|
-
"transform": {
|
|
45
|
-
"^.+\\.ts$": "ts-jest"
|
|
46
|
-
},
|
|
47
|
-
"globals": {
|
|
48
|
-
"ts-jest": {
|
|
49
|
-
"tsconfig": "tsconfig.json"
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
"testMatch": [
|
|
53
|
-
"**/tests/**/*.test.ts"
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@qite/tide-client",
|
|
3
|
+
"version": "1.0.48",
|
|
4
|
+
"description": "Frontend client for Tide",
|
|
5
|
+
"main": "build/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "rollup -c",
|
|
8
|
+
"tsc": "tsc --noEmit",
|
|
9
|
+
"format": "prettier --write .",
|
|
10
|
+
"test": "jest"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+ssh://git@bitbucket.org/qitegeneral/tide-client.git"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"tide",
|
|
18
|
+
"client"
|
|
19
|
+
],
|
|
20
|
+
"author": "Kristof Colpaert <kristof.colpaert@qite.be>",
|
|
21
|
+
"license": "OBSD",
|
|
22
|
+
"homepage": "https://bitbucket.org/qitegeneral/tide-client#readme",
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@rollup/plugin-commonjs": "^19.0.0",
|
|
25
|
+
"@rollup/plugin-node-resolve": "^13.0.0",
|
|
26
|
+
"@types/jest": "^26.0.23",
|
|
27
|
+
"@types/moment": "^2.13.0",
|
|
28
|
+
"dotenv": "^9.0.2",
|
|
29
|
+
"jest": "^26.6.3",
|
|
30
|
+
"jest-fetch-mock": "^3.0.3",
|
|
31
|
+
"momentjs": "^2.0.0",
|
|
32
|
+
"prettier": "^2.3.0",
|
|
33
|
+
"rollup": "^2.48.0",
|
|
34
|
+
"rollup-plugin-typescript2": "^0.30.0",
|
|
35
|
+
"ts-jest": "^26.5.6",
|
|
36
|
+
"tslib": "^2.2.0",
|
|
37
|
+
"typescript": "^4.2.4"
|
|
38
|
+
},
|
|
39
|
+
"jest": {
|
|
40
|
+
"moduleFileExtensions": [
|
|
41
|
+
"ts",
|
|
42
|
+
"js"
|
|
43
|
+
],
|
|
44
|
+
"transform": {
|
|
45
|
+
"^.+\\.ts$": "ts-jest"
|
|
46
|
+
},
|
|
47
|
+
"globals": {
|
|
48
|
+
"ts-jest": {
|
|
49
|
+
"tsconfig": "tsconfig.json"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"testMatch": [
|
|
53
|
+
"**/tests/**/*.test.ts"
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import { BookingPackageAllotmentInfo } from "./booking-package-allotment-info";
|
|
2
2
|
|
|
3
3
|
export interface BookingPackageItem {
|
|
4
|
+
accommodationCode: string;
|
|
5
|
+
airportCode?: string;
|
|
6
|
+
allotment: BookingPackageAllotmentInfo;
|
|
7
|
+
averagePricePerPerson: number;
|
|
4
8
|
catalogueId: number;
|
|
5
9
|
code: string;
|
|
10
|
+
fromDate: string;
|
|
11
|
+
latitude: number;
|
|
12
|
+
longitude: number;
|
|
6
13
|
name: string;
|
|
14
|
+
outwardFlightCode?: string;
|
|
15
|
+
outwardFlightNumbers?: string[];
|
|
7
16
|
price: number;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
toDate: string;
|
|
17
|
+
regimeCode?: string;
|
|
18
|
+
returnFlightCode?: string;
|
|
19
|
+
returnFlightNumbers?: string[];
|
|
12
20
|
tagIds: number[];
|
|
13
|
-
|
|
14
|
-
|
|
21
|
+
toDate: string;
|
|
22
|
+
type: number;
|
|
15
23
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export interface BookingPackageHotelOption {
|
|
2
|
-
entryLineGuid: string;
|
|
3
|
-
accommodationCode: string;
|
|
4
|
-
accommodationName: string;
|
|
5
|
-
regimeCode: string;
|
|
6
|
-
regimeName: string;
|
|
7
|
-
price: number;
|
|
8
|
-
isSelected: boolean;
|
|
9
|
-
roomIndex: number;
|
|
10
|
-
}
|
|
1
|
+
export interface BookingPackageHotelOption {
|
|
2
|
+
entryLineGuid: string;
|
|
3
|
+
accommodationCode: string;
|
|
4
|
+
accommodationName: string;
|
|
5
|
+
regimeCode: string;
|
|
6
|
+
regimeName: string;
|
|
7
|
+
price: number;
|
|
8
|
+
isSelected: boolean;
|
|
9
|
+
roomIndex: number;
|
|
10
|
+
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { BookingPackageHotelRoom } from "./booking-package-hotel-room";
|
|
2
|
-
|
|
3
|
-
export interface BookingPackageHotel {
|
|
4
|
-
name: string;
|
|
5
|
-
productCode: string;
|
|
6
|
-
isSelected: boolean;
|
|
7
|
-
cheapestPrice: number;
|
|
8
|
-
hotelSupplier: number;
|
|
9
|
-
|
|
10
|
-
latitude: number;
|
|
11
|
-
longitude: number;
|
|
12
|
-
|
|
13
|
-
rooms: BookingPackageHotelRoom[];
|
|
14
|
-
combinations: string[][];
|
|
15
|
-
|
|
16
|
-
stars: string;
|
|
17
|
-
rating: string;
|
|
18
|
-
description: string;
|
|
19
|
-
imageUrl: string;
|
|
20
|
-
facilities: string;
|
|
21
|
-
|
|
22
|
-
travelDurationToVenue: string;
|
|
23
|
-
travelDurationToCenter: string;
|
|
24
|
-
}
|
|
1
|
+
import { BookingPackageHotelRoom } from "./booking-package-hotel-room";
|
|
2
|
+
|
|
3
|
+
export interface BookingPackageHotel {
|
|
4
|
+
name: string;
|
|
5
|
+
productCode: string;
|
|
6
|
+
isSelected: boolean;
|
|
7
|
+
cheapestPrice: number;
|
|
8
|
+
hotelSupplier: number;
|
|
9
|
+
|
|
10
|
+
latitude: number;
|
|
11
|
+
longitude: number;
|
|
12
|
+
|
|
13
|
+
rooms: BookingPackageHotelRoom[];
|
|
14
|
+
combinations: string[][];
|
|
15
|
+
|
|
16
|
+
stars: string;
|
|
17
|
+
rating: string;
|
|
18
|
+
description: string;
|
|
19
|
+
imageUrl: string;
|
|
20
|
+
facilities: string;
|
|
21
|
+
|
|
22
|
+
travelDurationToVenue: string;
|
|
23
|
+
travelDurationToCenter: string;
|
|
24
|
+
}
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { BookingOptionGroup } from "./booking-option-group";
|
|
2
|
-
import { BookingOptionPax } from "./booking-option-pax";
|
|
3
|
-
import { BookingOptionUnit } from "./booking-option-unit";
|
|
4
|
-
import { BookingPackageFlight } from "./booking-package-flight";
|
|
5
|
-
import { BookingPackageHotel } from "./booking-package-hotel";
|
|
6
|
-
import { BookingPackageRequestRoom } from "./booking-package-request-room";
|
|
7
|
-
import { BookingPackageRoom } from "./booking-package-room";
|
|
8
|
-
import { PerBookingPackageOption } from "./per-booking-package-option";
|
|
9
|
-
|
|
10
|
-
export interface BookingPackage {
|
|
11
|
-
catalogueId: number;
|
|
12
|
-
code: string;
|
|
13
|
-
name: string;
|
|
14
|
-
price: number;
|
|
15
|
-
serviceType: number;
|
|
16
|
-
tagIds: number[];
|
|
17
|
-
|
|
18
|
-
countryName: string;
|
|
19
|
-
regionName: string;
|
|
20
|
-
oordName: string;
|
|
21
|
-
locationName: string;
|
|
22
|
-
|
|
23
|
-
unitCount: number;
|
|
24
|
-
requestRooms: BookingPackageRequestRoom[];
|
|
25
|
-
|
|
26
|
-
fromDate: string;
|
|
27
|
-
toDate: string;
|
|
28
|
-
startTime: string;
|
|
29
|
-
endTime: string;
|
|
30
|
-
|
|
31
|
-
outwardFlights: BookingPackageFlight[];
|
|
32
|
-
returnFlights: BookingPackageFlight[];
|
|
33
|
-
hotels: BookingPackageHotel[];
|
|
34
|
-
|
|
35
|
-
allotmentTourCode: string;
|
|
36
|
-
allotmentName: string;
|
|
37
|
-
customAllotmentStatus: string;
|
|
38
|
-
allotmentTagIds: number[];
|
|
39
|
-
|
|
40
|
-
rooms: BookingPackageRoom[];
|
|
41
|
-
groups: BookingOptionGroup<PerBookingPackageOption>[];
|
|
42
|
-
optionUnits: BookingOptionUnit[];
|
|
43
|
-
optionPax: BookingOptionPax[];
|
|
44
|
-
|
|
45
|
-
transactionId: string;
|
|
46
|
-
transactionExpiration: string;
|
|
47
|
-
}
|
|
1
|
+
import { BookingOptionGroup } from "./booking-option-group";
|
|
2
|
+
import { BookingOptionPax } from "./booking-option-pax";
|
|
3
|
+
import { BookingOptionUnit } from "./booking-option-unit";
|
|
4
|
+
import { BookingPackageFlight } from "./booking-package-flight";
|
|
5
|
+
import { BookingPackageHotel } from "./booking-package-hotel";
|
|
6
|
+
import { BookingPackageRequestRoom } from "./booking-package-request-room";
|
|
7
|
+
import { BookingPackageRoom } from "./booking-package-room";
|
|
8
|
+
import { PerBookingPackageOption } from "./per-booking-package-option";
|
|
9
|
+
|
|
10
|
+
export interface BookingPackage {
|
|
11
|
+
catalogueId: number;
|
|
12
|
+
code: string;
|
|
13
|
+
name: string;
|
|
14
|
+
price: number;
|
|
15
|
+
serviceType: number;
|
|
16
|
+
tagIds: number[];
|
|
17
|
+
|
|
18
|
+
countryName: string;
|
|
19
|
+
regionName: string;
|
|
20
|
+
oordName: string;
|
|
21
|
+
locationName: string;
|
|
22
|
+
|
|
23
|
+
unitCount: number;
|
|
24
|
+
requestRooms: BookingPackageRequestRoom[];
|
|
25
|
+
|
|
26
|
+
fromDate: string;
|
|
27
|
+
toDate: string;
|
|
28
|
+
startTime: string;
|
|
29
|
+
endTime: string;
|
|
30
|
+
|
|
31
|
+
outwardFlights: BookingPackageFlight[];
|
|
32
|
+
returnFlights: BookingPackageFlight[];
|
|
33
|
+
hotels: BookingPackageHotel[];
|
|
34
|
+
|
|
35
|
+
allotmentTourCode: string;
|
|
36
|
+
allotmentName: string;
|
|
37
|
+
customAllotmentStatus: string;
|
|
38
|
+
allotmentTagIds: number[];
|
|
39
|
+
|
|
40
|
+
rooms: BookingPackageRoom[];
|
|
41
|
+
groups: BookingOptionGroup<PerBookingPackageOption>[];
|
|
42
|
+
optionUnits: BookingOptionUnit[];
|
|
43
|
+
optionPax: BookingOptionPax[];
|
|
44
|
+
|
|
45
|
+
transactionId: string;
|
|
46
|
+
transactionExpiration: string;
|
|
47
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { AdditionalServices, FlightMetaDataLine } from ".";
|
|
2
|
-
|
|
3
|
-
export interface FlightMetaData {
|
|
4
|
-
flightLines: FlightMetaDataLine[];
|
|
5
|
-
pnr: string;
|
|
6
|
-
orderId: string;
|
|
7
|
-
additionalServices: AdditionalServices;
|
|
8
|
-
isLowCost: boolean;
|
|
9
|
-
luggageIncluded: boolean;
|
|
10
|
-
validatingAirlines: string;
|
|
11
|
-
bagageAllowed: boolean;
|
|
12
|
-
bagage: string;
|
|
13
|
-
mealIncluded: boolean;
|
|
14
|
-
meal: string;
|
|
15
|
-
}
|
|
1
|
+
import { AdditionalServices, FlightMetaDataLine } from ".";
|
|
2
|
+
|
|
3
|
+
export interface FlightMetaData {
|
|
4
|
+
flightLines: FlightMetaDataLine[];
|
|
5
|
+
pnr: string;
|
|
6
|
+
orderId: string;
|
|
7
|
+
additionalServices: AdditionalServices;
|
|
8
|
+
isLowCost: boolean;
|
|
9
|
+
luggageIncluded: boolean;
|
|
10
|
+
validatingAirlines: string;
|
|
11
|
+
bagageAllowed: boolean;
|
|
12
|
+
bagage: string;
|
|
13
|
+
mealIncluded: boolean;
|
|
14
|
+
meal: string;
|
|
15
|
+
}
|
package/src/utils/api.ts
CHANGED
|
@@ -20,3 +20,23 @@ export const post = async (
|
|
|
20
20
|
|
|
21
21
|
return response;
|
|
22
22
|
};
|
|
23
|
+
|
|
24
|
+
export const get = async (
|
|
25
|
+
url: string,
|
|
26
|
+
apiKey: string,
|
|
27
|
+
signal?: AbortSignal
|
|
28
|
+
): Promise<Response> => {
|
|
29
|
+
const response = await fetch(url, {
|
|
30
|
+
method: "GET",
|
|
31
|
+
headers: {
|
|
32
|
+
"Api-Key": apiKey,
|
|
33
|
+
},
|
|
34
|
+
signal,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
if (!response.ok) {
|
|
38
|
+
throw new Error(response.statusText);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return response;
|
|
42
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { post as apiPost } from "./api";
|
|
1
|
+
import { post as apiPost, get as apiGet } from "./api";
|
|
2
2
|
import { reviver } from "./json";
|
|
3
3
|
|
|
4
4
|
export const post = async <T>(
|
|
@@ -16,3 +16,18 @@ export const post = async <T>(
|
|
|
16
16
|
: JSON.parse(responseBody, reviver);
|
|
17
17
|
return result;
|
|
18
18
|
};
|
|
19
|
+
|
|
20
|
+
export const get = async <T>(
|
|
21
|
+
url: string,
|
|
22
|
+
apiKey: string,
|
|
23
|
+
signal?: AbortSignal,
|
|
24
|
+
skipReviver?: boolean
|
|
25
|
+
): Promise<T> => {
|
|
26
|
+
const response = await apiGet(url, apiKey, signal);
|
|
27
|
+
const responseBody = await response.text();
|
|
28
|
+
|
|
29
|
+
const result: T = skipReviver
|
|
30
|
+
? JSON.parse(responseBody)
|
|
31
|
+
: JSON.parse(responseBody, reviver);
|
|
32
|
+
return result;
|
|
33
|
+
};
|