@qite/tide-client 1.0.72 → 1.0.73

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.
Files changed (30) hide show
  1. package/build/index.js +6393 -6393
  2. package/build/types/offer/booking-v2/request/booking-package-details-request.d.ts +19 -19
  3. package/build/types/offer/booking-v2/request/index.d.ts +7 -7
  4. package/build/types/offer/booking-v2/request/selected-flight.d.ts +4 -4
  5. package/build/types/offer/booking-v2/response/booking-package-flight-pool.d.ts +5 -5
  6. package/build/types/offer/booking-v2/response/booking-package-hotel-pool.d.ts +4 -4
  7. package/build/types/offer/booking-v2/response/index.d.ts +10 -10
  8. package/build/types/offer/index.d.ts +5 -0
  9. package/build/types/offer/member-confirmation-request.d.ts +5 -0
  10. package/build/types/offer/member-forgot-password-request.d.ts +4 -0
  11. package/build/types/offer/member-info.d.ts +10 -0
  12. package/build/types/offer/member-login-request.d.ts +4 -0
  13. package/build/types/offer/member-reset-password-request.d.ts +4 -0
  14. package/build/utils/booking-v2-client.d.ts +54 -54
  15. package/build/utils/member-client.d.ts +32 -0
  16. package/package.json +56 -56
  17. package/src/types/offer/booking-v2/request/booking-package-details-request.ts +22 -22
  18. package/src/types/offer/booking-v2/request/index.ts +7 -7
  19. package/src/types/offer/booking-v2/request/selected-flight.ts +4 -4
  20. package/src/types/offer/booking-v2/response/booking-package-flight-pool.ts +6 -6
  21. package/src/types/offer/booking-v2/response/booking-package-hotel-pool.ts +5 -5
  22. package/src/types/offer/booking-v2/response/index.ts +10 -10
  23. package/src/types/offer/index.ts +5 -0
  24. package/src/types/offer/member-confirmation-request.ts +5 -0
  25. package/src/types/offer/member-forgot-password-request.ts +4 -0
  26. package/src/types/offer/member-info.ts +10 -0
  27. package/src/types/offer/member-login-request.ts +4 -0
  28. package/src/types/offer/member-reset-password-request.ts +4 -0
  29. package/src/utils/booking-v2-client.ts +120 -120
  30. package/src/utils/member-client.ts +75 -0
@@ -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
+ };
@@ -0,0 +1,75 @@
1
+ import { TideClientConfig } from "..";
2
+ import {
3
+ MemberConfirmationRequest,
4
+ MemberForgotPasswordRequest,
5
+ MemberInfo,
6
+ MemberLoginRequest,
7
+ MemberResetPasswordRequest,
8
+ } from "../types";
9
+ import { post } from "./common-client";
10
+
11
+ const ENDPOINT = "/api/member";
12
+ const ENDPOINT_LOGIN = `${ENDPOINT}/login`;
13
+ const ENDPOINT_LOGOUT = `${ENDPOINT}/logout`;
14
+ const ENDPOINT_CONFIRM = `${ENDPOINT}/confirm`;
15
+ const ENDPOINT_FORGOT_PASSWORD = `${ENDPOINT}/forgot-password`;
16
+ const ENDPOINT_RESET_PASSWORD = `${ENDPOINT}/reset-password`;
17
+
18
+ export const login = (
19
+ config: TideClientConfig,
20
+ request: MemberLoginRequest,
21
+ signal?: AbortSignal
22
+ ): Promise<MemberInfo> => {
23
+ const url = `${config.host}${ENDPOINT_LOGIN}`;
24
+ const apiKey = config.apiKey;
25
+ const body = JSON.stringify(request);
26
+
27
+ return post(url, apiKey, body, signal);
28
+ };
29
+
30
+ export const logout = (
31
+ config: TideClientConfig,
32
+ signal?: AbortSignal
33
+ ): Promise<Response> => {
34
+ const url = `${config.host}${ENDPOINT_LOGOUT}`;
35
+ const apiKey = config.apiKey;
36
+ const body = "";
37
+
38
+ return post(url, apiKey, body, signal);
39
+ };
40
+
41
+ export const confirm = (
42
+ config: TideClientConfig,
43
+ request: MemberConfirmationRequest,
44
+ signal?: AbortSignal
45
+ ): Promise<Response> => {
46
+ const url = `${config.host}${ENDPOINT_CONFIRM}`;
47
+ const apiKey = config.apiKey;
48
+ const body = JSON.stringify(request);
49
+
50
+ return post(url, apiKey, body, signal);
51
+ };
52
+
53
+ export const forgotPassword = (
54
+ config: TideClientConfig,
55
+ request: MemberForgotPasswordRequest,
56
+ signal?: AbortSignal
57
+ ): Promise<Response> => {
58
+ const url = `${config.host}${ENDPOINT_FORGOT_PASSWORD}`;
59
+ const apiKey = config.apiKey;
60
+ const body = JSON.stringify(request);
61
+
62
+ return post(url, apiKey, body, signal);
63
+ };
64
+
65
+ export const resetPassword = (
66
+ config: TideClientConfig,
67
+ request: MemberResetPasswordRequest,
68
+ signal?: AbortSignal
69
+ ): Promise<Response> => {
70
+ const url = `${config.host}${ENDPOINT_RESET_PASSWORD}`;
71
+ const apiKey = config.apiKey;
72
+ const body = JSON.stringify(request);
73
+
74
+ return post(url, apiKey, body, signal);
75
+ };