@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.
@@ -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
+ };