@qite/tide-client 1.0.73 → 1.0.74
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.d.ts +1 -0
- package/build/index.js +6435 -6393
- package/build/index.js.map +1 -1
- package/build/types/offer/booking-v2/request/booking-package-details-request.d.ts +19 -19
- package/build/types/offer/booking-v2/request/index.d.ts +7 -7
- package/build/types/offer/booking-v2/request/selected-flight.d.ts +4 -4
- package/build/types/offer/booking-v2/response/booking-package-flight-pool.d.ts +5 -5
- package/build/types/offer/booking-v2/response/booking-package-hotel-pool.d.ts +4 -4
- package/build/types/offer/booking-v2/response/index.d.ts +10 -10
- package/build/utils/booking-v2-client.d.ts +54 -54
- package/package.json +56 -56
- package/src/index.ts +1 -0
- package/src/types/offer/booking-v2/request/booking-package-details-request.ts +22 -22
- package/src/types/offer/booking-v2/request/index.ts +7 -7
- package/src/types/offer/booking-v2/request/selected-flight.ts +4 -4
- package/src/types/offer/booking-v2/response/booking-package-flight-pool.ts +6 -6
- package/src/types/offer/booking-v2/response/booking-package-hotel-pool.ts +5 -5
- package/src/types/offer/booking-v2/response/index.ts +10 -10
- package/src/utils/booking-v2-client.ts +120 -120
|
@@ -1,120 +1,120 @@
|
|
|
1
|
-
import { PackageSearchRequest, TideClientConfig } from "..";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
AvailablePackage,
|
|
5
|
-
BookingPackage,
|
|
6
|
-
BookingPackageBookRequest,
|
|
7
|
-
BookingPackageDetailsRequest,
|
|
8
|
-
BookingPackageDossier,
|
|
9
|
-
BookingPackageFlightPool,
|
|
10
|
-
BookingPackageHotelPool,
|
|
11
|
-
BookingPackageItem,
|
|
12
|
-
BookingPackageRequest,
|
|
13
|
-
BookingPackageSearchRequest,
|
|
14
|
-
BookingPriceDetails,
|
|
15
|
-
BookingTravelAgent,
|
|
16
|
-
} from "../types";
|
|
17
|
-
import { get, post } from "./common-client";
|
|
18
|
-
|
|
19
|
-
const ENDPOINT = "/api/web/booking/v2";
|
|
20
|
-
const ENDPOINT_PACKAGE_SEARCH_LIST = `${ENDPOINT}/package-search-list`;
|
|
21
|
-
const ENDPOINT_SEARCH = `${ENDPOINT}/search`;
|
|
22
|
-
const ENDPOINT_DETAILS = `${ENDPOINT}/details`;
|
|
23
|
-
const ENDPOINT_ALTERNATE_HOTELS = `/alternate-hotels`;
|
|
24
|
-
const ENDPOINT_ALTERNATE_FLIGHTS = `/alternate-flights`;
|
|
25
|
-
const ENDPOINT_PRICE_DETAILS = `${ENDPOINT}/price-details`;
|
|
26
|
-
const ENDPOINT_BOOK = `${ENDPOINT}/book`;
|
|
27
|
-
const ENDPOINT_AGENTS = `${ENDPOINT}/agents`;
|
|
28
|
-
|
|
29
|
-
export const readPackageSearchList = (
|
|
30
|
-
config: TideClientConfig,
|
|
31
|
-
request: PackageSearchRequest,
|
|
32
|
-
signal?: AbortSignal
|
|
33
|
-
): Promise<AvailablePackage[]> => {
|
|
34
|
-
const url = `${config.host}${ENDPOINT_PACKAGE_SEARCH_LIST}`;
|
|
35
|
-
const apiKey = config.apiKey;
|
|
36
|
-
const body = JSON.stringify(request);
|
|
37
|
-
|
|
38
|
-
return post(url, apiKey, body, signal);
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
// PACKAGE SEARCH
|
|
42
|
-
export const search = (
|
|
43
|
-
config: TideClientConfig,
|
|
44
|
-
request: BookingPackageRequest<BookingPackageSearchRequest>,
|
|
45
|
-
signal?: AbortSignal
|
|
46
|
-
): Promise<BookingPackageItem[]> => {
|
|
47
|
-
const url = `${config.host}${ENDPOINT_SEARCH}`;
|
|
48
|
-
const apiKey = config.apiKey;
|
|
49
|
-
const body = JSON.stringify(request);
|
|
50
|
-
|
|
51
|
-
return post(url, apiKey, body, signal, true);
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export const details = (
|
|
55
|
-
config: TideClientConfig,
|
|
56
|
-
request: BookingPackageRequest<BookingPackageDetailsRequest>,
|
|
57
|
-
signal?: AbortSignal
|
|
58
|
-
): Promise<BookingPackage> => {
|
|
59
|
-
const url = `${config.host}${ENDPOINT_DETAILS}`;
|
|
60
|
-
const apiKey = config.apiKey;
|
|
61
|
-
const body = JSON.stringify(request);
|
|
62
|
-
|
|
63
|
-
return post(url, apiKey, body, signal, true);
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export const alternateHotels = (
|
|
67
|
-
config: TideClientConfig,
|
|
68
|
-
transactionId: string,
|
|
69
|
-
signal?: AbortSignal
|
|
70
|
-
): Promise<BookingPackageHotelPool> => {
|
|
71
|
-
const url = `${config.host}${ENDPOINT_DETAILS}/${transactionId}${ENDPOINT_ALTERNATE_HOTELS}`;
|
|
72
|
-
const apiKey = config.apiKey;
|
|
73
|
-
|
|
74
|
-
return get(url, apiKey, signal, true);
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export const alternateFlights = (
|
|
78
|
-
config: TideClientConfig,
|
|
79
|
-
transactionId: string,
|
|
80
|
-
signal?: AbortSignal
|
|
81
|
-
): Promise<BookingPackageFlightPool> => {
|
|
82
|
-
const url = `${config.host}${ENDPOINT_DETAILS}/${transactionId}${ENDPOINT_ALTERNATE_FLIGHTS}`;
|
|
83
|
-
const apiKey = config.apiKey;
|
|
84
|
-
|
|
85
|
-
return get(url, apiKey, signal, true);
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
export const priceDetails = (
|
|
89
|
-
config: TideClientConfig,
|
|
90
|
-
request: BookingPackageRequest<BookingPackageBookRequest>,
|
|
91
|
-
signal?: AbortSignal
|
|
92
|
-
): Promise<BookingPriceDetails> => {
|
|
93
|
-
const url = `${config.host}${ENDPOINT_PRICE_DETAILS}`;
|
|
94
|
-
const apiKey = config.apiKey;
|
|
95
|
-
const body = JSON.stringify(request);
|
|
96
|
-
|
|
97
|
-
return post(url, apiKey, body, signal, true);
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
export const book = (
|
|
101
|
-
config: TideClientConfig,
|
|
102
|
-
request: BookingPackageRequest<BookingPackageBookRequest>,
|
|
103
|
-
signal?: AbortSignal
|
|
104
|
-
): Promise<BookingPackageDossier> => {
|
|
105
|
-
const url = `${config.host}${ENDPOINT_BOOK}`;
|
|
106
|
-
const apiKey = config.apiKey;
|
|
107
|
-
const body = JSON.stringify(request);
|
|
108
|
-
|
|
109
|
-
return post(url, apiKey, body, signal, true);
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
export const agents = (
|
|
113
|
-
config: TideClientConfig,
|
|
114
|
-
signal?: AbortSignal
|
|
115
|
-
): Promise<BookingTravelAgent[]> => {
|
|
116
|
-
const url = `${config.host}${ENDPOINT_AGENTS}`;
|
|
117
|
-
const apiKey = config.apiKey;
|
|
118
|
-
|
|
119
|
-
return get(url, apiKey, signal, true);
|
|
120
|
-
};
|
|
1
|
+
import { PackageSearchRequest, TideClientConfig } from "..";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
AvailablePackage,
|
|
5
|
+
BookingPackage,
|
|
6
|
+
BookingPackageBookRequest,
|
|
7
|
+
BookingPackageDetailsRequest,
|
|
8
|
+
BookingPackageDossier,
|
|
9
|
+
BookingPackageFlightPool,
|
|
10
|
+
BookingPackageHotelPool,
|
|
11
|
+
BookingPackageItem,
|
|
12
|
+
BookingPackageRequest,
|
|
13
|
+
BookingPackageSearchRequest,
|
|
14
|
+
BookingPriceDetails,
|
|
15
|
+
BookingTravelAgent,
|
|
16
|
+
} from "../types";
|
|
17
|
+
import { get, post } from "./common-client";
|
|
18
|
+
|
|
19
|
+
const ENDPOINT = "/api/web/booking/v2";
|
|
20
|
+
const ENDPOINT_PACKAGE_SEARCH_LIST = `${ENDPOINT}/package-search-list`;
|
|
21
|
+
const ENDPOINT_SEARCH = `${ENDPOINT}/search`;
|
|
22
|
+
const ENDPOINT_DETAILS = `${ENDPOINT}/details`;
|
|
23
|
+
const ENDPOINT_ALTERNATE_HOTELS = `/alternate-hotels`;
|
|
24
|
+
const ENDPOINT_ALTERNATE_FLIGHTS = `/alternate-flights`;
|
|
25
|
+
const ENDPOINT_PRICE_DETAILS = `${ENDPOINT}/price-details`;
|
|
26
|
+
const ENDPOINT_BOOK = `${ENDPOINT}/book`;
|
|
27
|
+
const ENDPOINT_AGENTS = `${ENDPOINT}/agents`;
|
|
28
|
+
|
|
29
|
+
export const readPackageSearchList = (
|
|
30
|
+
config: TideClientConfig,
|
|
31
|
+
request: PackageSearchRequest,
|
|
32
|
+
signal?: AbortSignal
|
|
33
|
+
): Promise<AvailablePackage[]> => {
|
|
34
|
+
const url = `${config.host}${ENDPOINT_PACKAGE_SEARCH_LIST}`;
|
|
35
|
+
const apiKey = config.apiKey;
|
|
36
|
+
const body = JSON.stringify(request);
|
|
37
|
+
|
|
38
|
+
return post(url, apiKey, body, signal);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// PACKAGE SEARCH
|
|
42
|
+
export const search = (
|
|
43
|
+
config: TideClientConfig,
|
|
44
|
+
request: BookingPackageRequest<BookingPackageSearchRequest>,
|
|
45
|
+
signal?: AbortSignal
|
|
46
|
+
): Promise<BookingPackageItem[]> => {
|
|
47
|
+
const url = `${config.host}${ENDPOINT_SEARCH}`;
|
|
48
|
+
const apiKey = config.apiKey;
|
|
49
|
+
const body = JSON.stringify(request);
|
|
50
|
+
|
|
51
|
+
return post(url, apiKey, body, signal, true);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const details = (
|
|
55
|
+
config: TideClientConfig,
|
|
56
|
+
request: BookingPackageRequest<BookingPackageDetailsRequest>,
|
|
57
|
+
signal?: AbortSignal
|
|
58
|
+
): Promise<BookingPackage> => {
|
|
59
|
+
const url = `${config.host}${ENDPOINT_DETAILS}`;
|
|
60
|
+
const apiKey = config.apiKey;
|
|
61
|
+
const body = JSON.stringify(request);
|
|
62
|
+
|
|
63
|
+
return post(url, apiKey, body, signal, true);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export const alternateHotels = (
|
|
67
|
+
config: TideClientConfig,
|
|
68
|
+
transactionId: string,
|
|
69
|
+
signal?: AbortSignal
|
|
70
|
+
): Promise<BookingPackageHotelPool> => {
|
|
71
|
+
const url = `${config.host}${ENDPOINT_DETAILS}/${transactionId}${ENDPOINT_ALTERNATE_HOTELS}`;
|
|
72
|
+
const apiKey = config.apiKey;
|
|
73
|
+
|
|
74
|
+
return get(url, apiKey, signal, true);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const alternateFlights = (
|
|
78
|
+
config: TideClientConfig,
|
|
79
|
+
transactionId: string,
|
|
80
|
+
signal?: AbortSignal
|
|
81
|
+
): Promise<BookingPackageFlightPool> => {
|
|
82
|
+
const url = `${config.host}${ENDPOINT_DETAILS}/${transactionId}${ENDPOINT_ALTERNATE_FLIGHTS}`;
|
|
83
|
+
const apiKey = config.apiKey;
|
|
84
|
+
|
|
85
|
+
return get(url, apiKey, signal, true);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export const priceDetails = (
|
|
89
|
+
config: TideClientConfig,
|
|
90
|
+
request: BookingPackageRequest<BookingPackageBookRequest>,
|
|
91
|
+
signal?: AbortSignal
|
|
92
|
+
): Promise<BookingPriceDetails> => {
|
|
93
|
+
const url = `${config.host}${ENDPOINT_PRICE_DETAILS}`;
|
|
94
|
+
const apiKey = config.apiKey;
|
|
95
|
+
const body = JSON.stringify(request);
|
|
96
|
+
|
|
97
|
+
return post(url, apiKey, body, signal, true);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export const book = (
|
|
101
|
+
config: TideClientConfig,
|
|
102
|
+
request: BookingPackageRequest<BookingPackageBookRequest>,
|
|
103
|
+
signal?: AbortSignal
|
|
104
|
+
): Promise<BookingPackageDossier> => {
|
|
105
|
+
const url = `${config.host}${ENDPOINT_BOOK}`;
|
|
106
|
+
const apiKey = config.apiKey;
|
|
107
|
+
const body = JSON.stringify(request);
|
|
108
|
+
|
|
109
|
+
return post(url, apiKey, body, signal, true);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export const agents = (
|
|
113
|
+
config: TideClientConfig,
|
|
114
|
+
signal?: AbortSignal
|
|
115
|
+
): Promise<BookingTravelAgent[]> => {
|
|
116
|
+
const url = `${config.host}${ENDPOINT_AGENTS}`;
|
|
117
|
+
const apiKey = config.apiKey;
|
|
118
|
+
|
|
119
|
+
return get(url, apiKey, signal, true);
|
|
120
|
+
};
|