@qite/tide-client 1.0.71 → 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.
Files changed (33) hide show
  1. package/build/index.d.ts +1 -0
  2. package/build/index.js +86 -17
  3. package/build/index.js.map +1 -1
  4. package/build/types/offer/booking-v2/request/booking-package-details-request.d.ts +4 -0
  5. package/build/types/offer/booking-v2/request/index.d.ts +1 -0
  6. package/build/types/offer/booking-v2/request/selected-flight.d.ts +4 -0
  7. package/build/types/offer/booking-v2/response/booking-package-flight-pool.d.ts +5 -0
  8. package/build/types/offer/booking-v2/response/booking-package-hotel-pool.d.ts +4 -0
  9. package/build/types/offer/booking-v2/response/index.d.ts +2 -0
  10. package/build/types/offer/index.d.ts +5 -0
  11. package/build/types/offer/member-confirmation-request.d.ts +5 -0
  12. package/build/types/offer/member-forgot-password-request.d.ts +4 -0
  13. package/build/types/offer/member-info.d.ts +10 -0
  14. package/build/types/offer/member-login-request.d.ts +4 -0
  15. package/build/types/offer/member-reset-password-request.d.ts +4 -0
  16. package/build/utils/booking-v2-client.d.ts +12 -0
  17. package/build/utils/member-client.d.ts +32 -0
  18. package/package.json +1 -1
  19. package/src/index.ts +1 -0
  20. package/src/types/offer/booking-v2/request/booking-package-details-request.ts +6 -0
  21. package/src/types/offer/booking-v2/request/index.ts +1 -0
  22. package/src/types/offer/booking-v2/request/selected-flight.ts +4 -0
  23. package/src/types/offer/booking-v2/response/booking-package-flight-pool.ts +6 -0
  24. package/src/types/offer/booking-v2/response/booking-package-hotel-pool.ts +5 -0
  25. package/src/types/offer/booking-v2/response/index.ts +2 -0
  26. package/src/types/offer/index.ts +5 -0
  27. package/src/types/offer/member-confirmation-request.ts +5 -0
  28. package/src/types/offer/member-forgot-password-request.ts +4 -0
  29. package/src/types/offer/member-info.ts +10 -0
  30. package/src/types/offer/member-login-request.ts +4 -0
  31. package/src/types/offer/member-reset-password-request.ts +4 -0
  32. package/src/utils/booking-v2-client.ts +27 -0
  33. package/src/utils/member-client.ts +75 -0
@@ -1,4 +1,5 @@
1
1
  import { BookingPackageRequestRoom } from "../shared/booking-package-request-room";
2
+ import { SelectedFlight } from "./selected-flight";
2
3
  export interface BookingPackageDetailsRequest {
3
4
  catalogueId?: number;
4
5
  rooms: BookingPackageRequestRoom[];
@@ -12,4 +13,7 @@ export interface BookingPackageDetailsRequest {
12
13
  postNights?: number;
13
14
  includeFlights?: boolean;
14
15
  checkExternalAvailability?: boolean;
16
+ hotelCode?: string;
17
+ outwardFlight?: SelectedFlight;
18
+ returnFlight?: SelectedFlight;
15
19
  }
@@ -4,3 +4,4 @@ export * from "./booking-package-destination";
4
4
  export * from "./booking-package-details-request";
5
5
  export * from "./booking-package-request";
6
6
  export * from "./booking-package-search-request";
7
+ export * from "./selected-flight";
@@ -0,0 +1,4 @@
1
+ export interface SelectedFlight {
2
+ flightCode: string;
3
+ flightNumbers: string[];
4
+ }
@@ -0,0 +1,5 @@
1
+ import { BookingPackageFlight } from "../shared";
2
+ export interface BookingPackageFlightPool {
3
+ outwardFlights: BookingPackageFlight[];
4
+ returnFlights: BookingPackageFlight[];
5
+ }
@@ -0,0 +1,4 @@
1
+ import { BookingPackageHotel } from "../shared";
2
+ export interface BookingPackageHotelPool {
3
+ hotels: BookingPackageHotel[];
4
+ }
@@ -6,3 +6,5 @@ export * from "./booking-price-details";
6
6
  export * from "./booking-price-per-pax";
7
7
  export * from "./booking-travel-agent";
8
8
  export * from "./changed-line";
9
+ export * from "./booking-package-flight-pool";
10
+ export * from "./booking-package-hotel-pool";
@@ -30,6 +30,11 @@ export * from "./flight-meta-data-line";
30
30
  export * from "./flight-meta-data";
31
31
  export * from "./flight-pool";
32
32
  export * from "./language";
33
+ export * from "./member-confirmation-request";
34
+ export * from "./member-forgot-password-request";
35
+ export * from "./member-info";
36
+ export * from "./member-login-request";
37
+ export * from "./member-reset-password-request";
33
38
  export * from "./multiroom-book-request";
34
39
  export * from "./note";
35
40
  export * from "./other-product";
@@ -0,0 +1,5 @@
1
+ export interface MemberConfirmationRequest {
2
+ token: string;
3
+ password: string;
4
+ hasAgreed: boolean;
5
+ }
@@ -0,0 +1,4 @@
1
+ export interface MemberForgotPasswordRequest {
2
+ email: string;
3
+ origin?: string;
4
+ }
@@ -0,0 +1,10 @@
1
+ export interface MemberInfo {
2
+ id: number;
3
+ companyId: number;
4
+ name?: string;
5
+ username?: string;
6
+ email?: string;
7
+ language?: string;
8
+ agentId?: number;
9
+ allowedPortals?: string[];
10
+ }
@@ -0,0 +1,4 @@
1
+ export interface MemberLoginRequest {
2
+ username: string;
3
+ password: string;
4
+ }
@@ -0,0 +1,4 @@
1
+ export interface MemberResetPasswordRequest {
2
+ token: string;
3
+ password: string;
4
+ }
@@ -5,6 +5,8 @@ import {
5
5
  BookingPackageBookRequest,
6
6
  BookingPackageDetailsRequest,
7
7
  BookingPackageDossier,
8
+ BookingPackageFlightPool,
9
+ BookingPackageHotelPool,
8
10
  BookingPackageItem,
9
11
  BookingPackageRequest,
10
12
  BookingPackageSearchRequest,
@@ -26,6 +28,16 @@ export declare const details: (
26
28
  request: BookingPackageRequest<BookingPackageDetailsRequest>,
27
29
  signal?: AbortSignal | undefined
28
30
  ) => Promise<BookingPackage>;
31
+ export declare const alternateHotels: (
32
+ config: TideClientConfig,
33
+ transactionId: string,
34
+ signal?: AbortSignal | undefined
35
+ ) => Promise<BookingPackageHotelPool>;
36
+ export declare const alternateFlights: (
37
+ config: TideClientConfig,
38
+ transactionId: string,
39
+ signal?: AbortSignal | undefined
40
+ ) => Promise<BookingPackageFlightPool>;
29
41
  export declare const priceDetails: (
30
42
  config: TideClientConfig,
31
43
  request: BookingPackageRequest<BookingPackageBookRequest>,
@@ -0,0 +1,32 @@
1
+ import { TideClientConfig } from "..";
2
+ import {
3
+ MemberConfirmationRequest,
4
+ MemberForgotPasswordRequest,
5
+ MemberInfo,
6
+ MemberLoginRequest,
7
+ MemberResetPasswordRequest,
8
+ } from "../types";
9
+ export declare const login: (
10
+ config: TideClientConfig,
11
+ request: MemberLoginRequest,
12
+ signal?: AbortSignal | undefined
13
+ ) => Promise<MemberInfo>;
14
+ export declare const logout: (
15
+ config: TideClientConfig,
16
+ signal?: AbortSignal | undefined
17
+ ) => Promise<Response>;
18
+ export declare const confirm: (
19
+ config: TideClientConfig,
20
+ request: MemberConfirmationRequest,
21
+ signal?: AbortSignal | undefined
22
+ ) => Promise<Response>;
23
+ export declare const forgotPassword: (
24
+ config: TideClientConfig,
25
+ request: MemberForgotPasswordRequest,
26
+ signal?: AbortSignal | undefined
27
+ ) => Promise<Response>;
28
+ export declare const resetPassword: (
29
+ config: TideClientConfig,
30
+ request: MemberResetPasswordRequest,
31
+ signal?: AbortSignal | undefined
32
+ ) => Promise<Response>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qite/tide-client",
3
- "version": "1.0.71",
3
+ "version": "1.0.74",
4
4
  "description": "Frontend client for Tide",
5
5
  "main": "build/index.js",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -60,6 +60,7 @@ export { FlightMetaData } from "./types";
60
60
 
61
61
  export * from "./utils/booking-client";
62
62
  export * from "./utils/booking-v2-client";
63
+ export * from "./utils/member-client";
63
64
  export * from "./utils/mollie-client";
64
65
  export * from "./utils/web-client";
65
66
  export * from "./utils/web-contact-client";
@@ -1,4 +1,5 @@
1
1
  import { BookingPackageRequestRoom } from "../shared/booking-package-request-room";
2
+ import { SelectedFlight } from "./selected-flight";
2
3
 
3
4
  export interface BookingPackageDetailsRequest {
4
5
  catalogueId?: number;
@@ -13,4 +14,9 @@ export interface BookingPackageDetailsRequest {
13
14
  postNights?: number;
14
15
  includeFlights?: boolean;
15
16
  checkExternalAvailability?: boolean;
17
+
18
+ // lazy loading
19
+ hotelCode?: string;
20
+ outwardFlight?: SelectedFlight;
21
+ returnFlight?: SelectedFlight;
16
22
  }
@@ -4,3 +4,4 @@ export * from "./booking-package-destination";
4
4
  export * from "./booking-package-details-request";
5
5
  export * from "./booking-package-request";
6
6
  export * from "./booking-package-search-request";
7
+ export * from "./selected-flight";
@@ -0,0 +1,4 @@
1
+ export interface SelectedFlight {
2
+ flightCode: string;
3
+ flightNumbers: string[];
4
+ }
@@ -0,0 +1,6 @@
1
+ import { BookingPackageFlight } from "../shared";
2
+
3
+ export interface BookingPackageFlightPool {
4
+ outwardFlights: BookingPackageFlight[];
5
+ returnFlights: BookingPackageFlight[];
6
+ }
@@ -0,0 +1,5 @@
1
+ import { BookingPackageHotel } from "../shared";
2
+
3
+ export interface BookingPackageHotelPool {
4
+ hotels: BookingPackageHotel[];
5
+ }
@@ -6,3 +6,5 @@ export * from "./booking-price-details";
6
6
  export * from "./booking-price-per-pax";
7
7
  export * from "./booking-travel-agent";
8
8
  export * from "./changed-line";
9
+ export * from "./booking-package-flight-pool";
10
+ export * from "./booking-package-hotel-pool";
@@ -30,6 +30,11 @@ export * from "./flight-meta-data-line";
30
30
  export * from "./flight-meta-data";
31
31
  export * from "./flight-pool";
32
32
  export * from "./language";
33
+ export * from "./member-confirmation-request";
34
+ export * from "./member-forgot-password-request";
35
+ export * from "./member-info";
36
+ export * from "./member-login-request";
37
+ export * from "./member-reset-password-request";
33
38
  export * from "./multiroom-book-request";
34
39
  export * from "./note";
35
40
  export * from "./other-product";
@@ -0,0 +1,5 @@
1
+ export interface MemberConfirmationRequest {
2
+ token: string;
3
+ password: string;
4
+ hasAgreed: boolean;
5
+ }
@@ -0,0 +1,4 @@
1
+ export interface MemberForgotPasswordRequest {
2
+ email: string;
3
+ origin?: string;
4
+ }
@@ -0,0 +1,10 @@
1
+ export interface MemberInfo {
2
+ id: number;
3
+ companyId: number;
4
+ name?: string;
5
+ username?: string;
6
+ email?: string;
7
+ language?: string;
8
+ agentId?: number;
9
+ allowedPortals?: string[];
10
+ }
@@ -0,0 +1,4 @@
1
+ export interface MemberLoginRequest {
2
+ username: string;
3
+ password: string;
4
+ }
@@ -0,0 +1,4 @@
1
+ export interface MemberResetPasswordRequest {
2
+ token: string;
3
+ password: string;
4
+ }
@@ -6,6 +6,8 @@ import {
6
6
  BookingPackageBookRequest,
7
7
  BookingPackageDetailsRequest,
8
8
  BookingPackageDossier,
9
+ BookingPackageFlightPool,
10
+ BookingPackageHotelPool,
9
11
  BookingPackageItem,
10
12
  BookingPackageRequest,
11
13
  BookingPackageSearchRequest,
@@ -18,6 +20,8 @@ const ENDPOINT = "/api/web/booking/v2";
18
20
  const ENDPOINT_PACKAGE_SEARCH_LIST = `${ENDPOINT}/package-search-list`;
19
21
  const ENDPOINT_SEARCH = `${ENDPOINT}/search`;
20
22
  const ENDPOINT_DETAILS = `${ENDPOINT}/details`;
23
+ const ENDPOINT_ALTERNATE_HOTELS = `/alternate-hotels`;
24
+ const ENDPOINT_ALTERNATE_FLIGHTS = `/alternate-flights`;
21
25
  const ENDPOINT_PRICE_DETAILS = `${ENDPOINT}/price-details`;
22
26
  const ENDPOINT_BOOK = `${ENDPOINT}/book`;
23
27
  const ENDPOINT_AGENTS = `${ENDPOINT}/agents`;
@@ -34,6 +38,7 @@ export const readPackageSearchList = (
34
38
  return post(url, apiKey, body, signal);
35
39
  };
36
40
 
41
+ // PACKAGE SEARCH
37
42
  export const search = (
38
43
  config: TideClientConfig,
39
44
  request: BookingPackageRequest<BookingPackageSearchRequest>,
@@ -58,6 +63,28 @@ export const details = (
58
63
  return post(url, apiKey, body, signal, true);
59
64
  };
60
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
+
61
88
  export const priceDetails = (
62
89
  config: TideClientConfig,
63
90
  request: BookingPackageRequest<BookingPackageBookRequest>,
@@ -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
+ };