@qite/tide-client 1.0.10 → 1.0.14

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 (136) hide show
  1. package/build/index.d.ts +10 -43
  2. package/build/index.js +412 -489
  3. package/build/index.js.map +1 -1
  4. package/build/types/aapi/accommodation-occupancy.d.ts +9 -9
  5. package/build/types/aapi/accommodation-with-available-places.d.ts +14 -14
  6. package/build/types/aapi/accommodation.d.ts +7 -7
  7. package/build/types/aapi/additional-services.d.ts +6 -6
  8. package/build/types/aapi/alternative-flight-data.d.ts +10 -10
  9. package/build/types/aapi/alternative-flight-leg.d.ts +18 -18
  10. package/build/types/aapi/alternative-flight.d.ts +12 -12
  11. package/build/types/aapi/availability-request.d.ts +12 -12
  12. package/build/types/aapi/availability.d.ts +5 -5
  13. package/build/types/aapi/available-products-request.d.ts +32 -32
  14. package/build/types/aapi/duration.d.ts +4 -4
  15. package/build/types/aapi/flight-leg.d.ts +18 -18
  16. package/build/types/aapi/flight.d.ts +23 -23
  17. package/build/types/aapi/hotel.d.ts +35 -35
  18. package/build/types/aapi/index.d.ts +22 -20
  19. package/build/types/aapi/mollie-payment-request.d.ts +6 -0
  20. package/build/types/aapi/mollie-payment.d.ts +3 -0
  21. package/build/types/aapi/option-pax.d.ts +4 -4
  22. package/build/types/aapi/option.d.ts +21 -28
  23. package/build/types/aapi/pax.d.ts +4 -4
  24. package/build/types/aapi/price-detail.d.ts +8 -8
  25. package/build/types/aapi/regime.d.ts +5 -5
  26. package/build/types/aapi/traveler-grouping.d.ts +5 -5
  27. package/build/types/enums/allotment-type.d.ts +5 -5
  28. package/build/types/enums/availability-search-type.d.ts +4 -4
  29. package/build/types/enums/dossier-type.d.ts +6 -6
  30. package/build/types/enums/entry-line-flag.d.ts +6 -6
  31. package/build/types/enums/entry-line-status.d.ts +19 -19
  32. package/build/types/enums/entry-status.d.ts +8 -8
  33. package/build/types/enums/export-status.d.ts +5 -5
  34. package/build/types/enums/gender.d.ts +5 -5
  35. package/build/types/enums/index.d.ts +15 -15
  36. package/build/types/enums/meta-data-type.d.ts +10 -10
  37. package/build/types/enums/online-payment-type.d.ts +3 -0
  38. package/build/types/enums/payment-type.d.ts +6 -6
  39. package/build/types/enums/price-chart-type.d.ts +4 -4
  40. package/build/types/enums/requirement-type.d.ts +5 -5
  41. package/build/types/enums/room-type.d.ts +8 -8
  42. package/build/types/enums/sale-type.d.ts +4 -4
  43. package/build/types/enums/service-type.d.ts +26 -26
  44. package/build/types/index.d.ts +4 -24
  45. package/build/types/offer/additional-services.d.ts +6 -6
  46. package/build/types/offer/address.d.ts +11 -11
  47. package/build/types/offer/alternative-flight-data.d.ts +10 -10
  48. package/build/types/offer/alternative-flight-leg.d.ts +18 -18
  49. package/build/types/offer/alternative-flight.d.ts +14 -14
  50. package/build/types/offer/available-package-accommodation.d.ts +7 -0
  51. package/build/types/offer/available-package-flight.d.ts +9 -0
  52. package/build/types/offer/available-package-option.d.ts +12 -0
  53. package/build/types/offer/available-package-pax-price.d.ts +6 -0
  54. package/build/types/offer/available-package-regime.d.ts +4 -0
  55. package/build/types/offer/available-package.d.ts +7 -0
  56. package/build/types/offer/base-price.d.ts +6 -6
  57. package/build/types/offer/base-prices-from-date-request.d.ts +12 -12
  58. package/build/types/offer/base-prices-request.d.ts +12 -12
  59. package/build/types/offer/book-request.d.ts +36 -36
  60. package/build/types/offer/booking-response.d.ts +4 -4
  61. package/build/types/offer/cached-package-search-result.d.ts +5 -5
  62. package/build/types/offer/confirmed-dossier-check.d.ts +6 -6
  63. package/build/types/offer/crm-contact-request.d.ts +28 -36
  64. package/build/types/offer/customer-request.d.ts +5 -5
  65. package/build/types/offer/dossier-default-product.d.ts +14 -14
  66. package/build/types/offer/entry-check-response.d.ts +8 -8
  67. package/build/types/offer/entry-line-meta-data.d.ts +5 -5
  68. package/build/types/offer/entry-line-pax.d.ts +8 -8
  69. package/build/types/offer/entry-line.d.ts +67 -73
  70. package/build/types/offer/entry-price-line.d.ts +40 -40
  71. package/build/types/offer/entry-room2.d.ts +5 -5
  72. package/build/types/offer/entry.d.ts +49 -59
  73. package/build/types/offer/flight-meta-data-line.d.ts +16 -0
  74. package/build/types/offer/flight-meta-data.d.ts +10 -0
  75. package/build/types/offer/flight-pool.d.ts +5 -5
  76. package/build/types/offer/index.d.ts +64 -56
  77. package/build/types/offer/language.d.ts +5 -5
  78. package/build/types/offer/multiroom-book-request.d.ts +10 -10
  79. package/build/types/offer/note.d.ts +16 -16
  80. package/build/types/offer/other-product.d.ts +13 -13
  81. package/build/types/offer/package-book-request-room.d.ts +5 -5
  82. package/build/types/offer/package-book-request.d.ts +12 -12
  83. package/build/types/offer/package-flight.d.ts +13 -13
  84. package/build/types/offer/package-flights.d.ts +5 -5
  85. package/build/types/offer/package-option.d.ts +22 -22
  86. package/build/types/offer/package-price-details-request-room.d.ts +4 -4
  87. package/build/types/offer/package-price-details-request.d.ts +8 -8
  88. package/build/types/offer/package-room-option.d.ts +10 -10
  89. package/build/types/offer/package-room.d.ts +7 -7
  90. package/build/types/offer/package-search-destination.d.ts +9 -9
  91. package/build/types/offer/package-search-request-date.d.ts +4 -4
  92. package/build/types/offer/package-search-request-room.d.ts +5 -5
  93. package/build/types/offer/package-search-request.d.ts +18 -22
  94. package/build/types/offer/package-search-result.d.ts +12 -12
  95. package/build/types/offer/package-sub-option.d.ts +6 -6
  96. package/build/types/offer/pax.d.ts +29 -29
  97. package/build/types/offer/payment.d.ts +20 -20
  98. package/build/types/offer/person-country-preference.d.ts +7 -7
  99. package/build/types/offer/person-location-preference.d.ts +7 -7
  100. package/build/types/offer/person-oord-preference.d.ts +7 -7
  101. package/build/types/offer/person-period-date-range-preference.d.ts +6 -6
  102. package/build/types/offer/person-period-preference.d.ts +7 -7
  103. package/build/types/offer/person-region-preference.d.ts +7 -7
  104. package/build/types/offer/person-tour-group-preference.d.ts +7 -7
  105. package/build/types/offer/price-detail.d.ts +18 -18
  106. package/build/types/offer/price-per-pax.d.ts +6 -6
  107. package/build/types/offer/product-notification-result.d.ts +9 -9
  108. package/build/types/offer/web-contact-form-request.d.ts +13 -13
  109. package/build/types/offer/web-contact-has-tag-request.d.ts +4 -4
  110. package/build/types/tide-client-config.d.ts +4 -4
  111. package/build/utils/api.d.ts +1 -6
  112. package/build/utils/booking-client.d.ts +102 -169
  113. package/build/utils/booking-v2-client.d.ts +3 -0
  114. package/build/utils/common-client.d.ts +1 -6
  115. package/build/utils/json.d.ts +2 -2
  116. package/build/utils/mollie-client.d.ts +7 -0
  117. package/build/utils/web-client.d.ts +10 -14
  118. package/build/utils/web-contact-client.d.ts +11 -23
  119. package/package.json +1 -1
  120. package/src/index.ts +10 -0
  121. package/src/types/aapi/index.ts +2 -0
  122. package/src/types/aapi/mollie-payment-request.ts +6 -0
  123. package/src/types/aapi/mollie-payment.ts +3 -0
  124. package/src/types/index.ts +2 -0
  125. package/src/types/offer/available-package-accommodation.ts +8 -0
  126. package/src/types/offer/available-package-flight.ts +10 -0
  127. package/src/types/offer/available-package-option.ts +18 -0
  128. package/src/types/offer/available-package-pax-price.ts +6 -0
  129. package/src/types/offer/available-package-regime.ts +4 -0
  130. package/src/types/offer/available-package.ts +8 -0
  131. package/src/types/offer/flight-meta-data-line.ts +16 -0
  132. package/src/types/offer/flight-meta-data.ts +11 -0
  133. package/src/types/offer/index.ts +8 -0
  134. package/src/utils/booking-v2-client.ts +19 -0
  135. package/src/utils/json.ts +6 -5
  136. package/src/utils/mollie-client.ts +27 -0
@@ -0,0 +1,3 @@
1
+ import { PackageSearchRequest, TideClientConfig } from "..";
2
+ import { AvailablePackage } from "../types";
3
+ export declare const readPackageSearchList: (config: TideClientConfig, request: PackageSearchRequest, signal?: AbortSignal | undefined) => Promise<AvailablePackage[]>;
@@ -1,6 +1 @@
1
- export declare const post: <T>(
2
- url: string,
3
- apiKey: string,
4
- body: string,
5
- signal?: AbortSignal | undefined
6
- ) => Promise<T>;
1
+ export declare const post: <T>(url: string, apiKey: string, body: string, signal?: AbortSignal | undefined) => Promise<T>;
@@ -1,2 +1,2 @@
1
- export declare const reviver: (_: any, value: any) => any;
2
- export declare const replacer: (_: any, value: any) => any;
1
+ export declare const reviver: (_: any, value: any) => any;
2
+ export declare const replacer: (_: any, value: any) => any;
@@ -0,0 +1,7 @@
1
+ import { MolliePayment, MolliePaymentRequest, TideClientConfig } from "../types";
2
+ /**
3
+ * api/mollie/create-payment
4
+ * @param request
5
+ * @returns mollie payment url
6
+ */
7
+ export declare const getMolliePayment: (config: TideClientConfig, request: MolliePaymentRequest, signal?: AbortSignal | undefined) => Promise<MolliePayment>;
@@ -1,14 +1,10 @@
1
- import { CrmContactRequest, TideClientConfig } from "../types";
2
- /**
3
- * api/web/crmcontact
4
- * Creates a CRM contact.
5
- * @param config
6
- * @param request
7
- * @param signal
8
- * @returns OK if succeeded.
9
- */
10
- export declare const createCrmContact: (
11
- config: TideClientConfig,
12
- request: CrmContactRequest,
13
- signal?: AbortSignal | undefined
14
- ) => Promise<Response>;
1
+ import { CrmContactRequest, TideClientConfig } from "../types";
2
+ /**
3
+ * api/web/crmcontact
4
+ * Creates a CRM contact.
5
+ * @param config
6
+ * @param request
7
+ * @param signal
8
+ * @returns OK if succeeded.
9
+ */
10
+ export declare const createCrmContact: (config: TideClientConfig, request: CrmContactRequest, signal?: AbortSignal | undefined) => Promise<Response>;
@@ -1,23 +1,11 @@
1
- import {
2
- TideClientConfig,
3
- WebContactFormRequest,
4
- WebContactHasTagRequest,
5
- } from "../types";
6
- /**
7
- * api/web/contact/contact-form
8
- * Processes a contact form.
9
- * @param config
10
- * @param request
11
- * @param signal
12
- * @returns OK if succeeded.
13
- */
14
- export declare const contactForm: (
15
- config: TideClientConfig,
16
- request: WebContactFormRequest,
17
- signal?: AbortSignal | undefined
18
- ) => Promise<Response>;
19
- export declare const contactHasTag: (
20
- config: TideClientConfig,
21
- request: WebContactHasTagRequest,
22
- signal?: AbortSignal | undefined
23
- ) => Promise<Response>;
1
+ import { TideClientConfig, WebContactFormRequest, WebContactHasTagRequest } from "../types";
2
+ /**
3
+ * api/web/contact/contact-form
4
+ * Processes a contact form.
5
+ * @param config
6
+ * @param request
7
+ * @param signal
8
+ * @returns OK if succeeded.
9
+ */
10
+ export declare const contactForm: (config: TideClientConfig, request: WebContactFormRequest, signal?: AbortSignal | undefined) => Promise<Response>;
11
+ export declare const contactHasTag: (config: TideClientConfig, request: WebContactHasTagRequest, signal?: AbortSignal | undefined) => Promise<Response>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qite/tide-client",
3
- "version": "1.0.10",
3
+ "version": "1.0.14",
4
4
  "description": "Frontend client for Tide",
5
5
  "main": "build/index.js",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -21,6 +21,7 @@ export {
21
21
  BasePricesRequest,
22
22
  BasePricesFromDateRequest,
23
23
  CrmContactRequest,
24
+ MolliePaymentRequest,
24
25
  MultiroomBookRequest,
25
26
  OtherProduct,
26
27
  PackageBookRequestRoom,
@@ -41,17 +42,26 @@ export {
41
42
 
42
43
  export {
43
44
  Availability,
45
+ AvailablePackage,
44
46
  BasePrice,
45
47
  BookingResponse,
46
48
  CachedPackageSearchResult,
47
49
  Entry,
50
+ MolliePayment,
48
51
  PackageOption,
49
52
  PackageRoom,
50
53
  PriceDetail,
51
54
  } from "./types";
52
55
 
56
+ // Tide Types
57
+ export {
58
+ FlightMetaData
59
+ } from "./types"
60
+
53
61
  // Calls
54
62
 
55
63
  export * from "./utils/booking-client";
64
+ export * from "./utils/booking-v2-client";
65
+ export * from "./utils/mollie-client";
56
66
  export * from "./utils/web-client";
57
67
  export * from "./utils/web-contact-client";
@@ -14,6 +14,8 @@ export * from "./flight";
14
14
  export * from "./hotel";
15
15
  export * from "./option-pax";
16
16
  export * from "./option";
17
+ export * from "./mollie-payment-request";
18
+ export * from "./mollie-payment";
17
19
  export * from "./pax";
18
20
  export * from "./price-detail";
19
21
  export * from "./regime";
@@ -0,0 +1,6 @@
1
+ export interface MolliePaymentRequest {
2
+ locale: string;
3
+ dossierNumber: string;
4
+ currency: string;
5
+ redirectUrl?: string;
6
+ }
@@ -0,0 +1,3 @@
1
+ export interface MolliePayment {
2
+ url: string;
3
+ }
@@ -19,6 +19,8 @@ export {
19
19
  FlightLeg,
20
20
  Flight,
21
21
  Hotel,
22
+ MolliePaymentRequest,
23
+ MolliePayment,
22
24
  OptionPax,
23
25
  Option,
24
26
  Pax as PaxAAPI,
@@ -0,0 +1,8 @@
1
+ import { Pax } from "../aapi";
2
+
3
+ export interface AvailablePackageAccommodation {
4
+ id: number;
5
+ code: string;
6
+ name: string;
7
+ pax: Pax[];
8
+ }
@@ -0,0 +1,10 @@
1
+ import { EntryLineMetaData } from ".";
2
+
3
+ export interface AvailablePackageFlight {
4
+ code: string;
5
+ class: string;
6
+ startDateTime: Date;
7
+ endDateTime: Date;
8
+ externalGuid: string;
9
+ metaDatas: EntryLineMetaData[];
10
+ }
@@ -0,0 +1,18 @@
1
+ import {
2
+ AvailablePackageAccommodation,
3
+ AvailablePackageFlight,
4
+ AvailablePackagePaxPrice,
5
+ AvailablePackageRegime,
6
+ } from ".";
7
+
8
+ export interface AvailablePackageOption {
9
+ accommodations: AvailablePackageAccommodation[];
10
+ regime: AvailablePackageRegime;
11
+ from: Date;
12
+ to: Date;
13
+ outwardFlight: AvailablePackageFlight;
14
+ returnFlight: AvailablePackageFlight;
15
+ price: number;
16
+ pricePerPax: AvailablePackagePaxPrice[];
17
+ averagePricePerPax: number;
18
+ }
@@ -0,0 +1,6 @@
1
+ export interface AvailablePackagePaxPrice {
2
+ paxId: number;
3
+ guid: string;
4
+ age: number;
5
+ price: number;
6
+ }
@@ -0,0 +1,4 @@
1
+ export interface AvailablePackageRegime {
2
+ code: string;
3
+ name: string;
4
+ }
@@ -0,0 +1,8 @@
1
+ import { AvailablePackageOption } from ".";
2
+
3
+ export interface AvailablePackage {
4
+ catalogId: number;
5
+ code: string;
6
+ name: string;
7
+ option: AvailablePackageOption;
8
+ }
@@ -0,0 +1,16 @@
1
+ export interface FlightMetaDataLine {
2
+ airline: string;
3
+ operatingAirlineCode: string;
4
+ operatingAirlineDescription: string;
5
+ number: string;
6
+ departureDate: Date;
7
+ departureAirport: string;
8
+ departureAirportDescription: string;
9
+ departureTime: string;
10
+ arrivalDate: Date;
11
+ arrivalAirport: string;
12
+ arrivalAirportDescription: string;
13
+ arrivalTime: string;
14
+ flightClass: string;
15
+ travelClass: string;
16
+ }
@@ -0,0 +1,11 @@
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
+ }
@@ -3,6 +3,12 @@ export * from "./address";
3
3
  export * from "./alternative-flight-data";
4
4
  export * from "./alternative-flight-leg";
5
5
  export * from "./alternative-flight";
6
+ export * from "./available-package-accommodation";
7
+ export * from "./available-package-flight";
8
+ export * from "./available-package-option";
9
+ export * from "./available-package-pax-price";
10
+ export * from "./available-package-regime";
11
+ export * from "./available-package";
6
12
  export * from "./base-price";
7
13
  export * from "./base-prices-from-date-request";
8
14
  export * from "./base-prices-request";
@@ -20,6 +26,8 @@ export * from "./entry-line";
20
26
  export * from "./entry-price-line";
21
27
  export * from "./entry-room2";
22
28
  export * from "./entry";
29
+ export * from "./flight-meta-data-line";
30
+ export * from "./flight-meta-data";
23
31
  export * from "./flight-pool";
24
32
  export * from "./language";
25
33
  export * from "./multiroom-book-request";
@@ -0,0 +1,19 @@
1
+ import { PackageSearchRequest, TideClientConfig } from "..";
2
+
3
+ import { AvailablePackage } from "../types";
4
+ import { post } from "./common-client";
5
+
6
+ const ENDPOINT = "/api/web/booking/v2";
7
+ const ENDPOINT_PACKAGE_SEARCH_LIST = `${ENDPOINT}/package-search-list`;
8
+
9
+ export const readPackageSearchList = (
10
+ config: TideClientConfig,
11
+ request: PackageSearchRequest,
12
+ signal?: AbortSignal
13
+ ): Promise<AvailablePackage[]> => {
14
+ const url = `${config.host}${ENDPOINT_PACKAGE_SEARCH_LIST}`;
15
+ const apiKey = config.apiKey;
16
+ const body = JSON.stringify(request);
17
+
18
+ return post(url, apiKey, body, signal);
19
+ };
package/src/utils/json.ts CHANGED
@@ -11,11 +11,12 @@ export const replacer = (_: any, value: any) => {
11
11
  if (typeof value === "string") {
12
12
  if (Date.parse(value)) {
13
13
  const date = new Date(value);
14
- const year = date.getFullYear();
15
- const month = date.getMonth() + 1;
16
- const day = date.getDate();
17
-
18
- return `${year}-${month}-${day}`;
14
+ if (date.toISOString() === value) {
15
+ const year = date.getFullYear();
16
+ const month = date.getMonth() + 1;
17
+ const day = date.getDate();
18
+ return `${year}-${month}-${day}`;
19
+ }
19
20
  }
20
21
  }
21
22
  return value;
@@ -0,0 +1,27 @@
1
+ import {
2
+ MolliePayment,
3
+ MolliePaymentRequest,
4
+ TideClientConfig,
5
+ } from "../types";
6
+
7
+ import { post } from "./common-client";
8
+
9
+ const ENDPOINT = "/api/mollie";
10
+ const ENDPOINT_CREATE_PAYMENTS = `${ENDPOINT}/create-payment`;
11
+
12
+ /**
13
+ * api/mollie/create-payment
14
+ * @param request
15
+ * @returns mollie payment url
16
+ */
17
+ export const getMolliePayment = (
18
+ config: TideClientConfig,
19
+ request: MolliePaymentRequest,
20
+ signal?: AbortSignal
21
+ ): Promise<MolliePayment> => {
22
+ const url = `${config.host}${ENDPOINT_CREATE_PAYMENTS}`;
23
+ const apiKey = config.apiKey;
24
+ const body = JSON.stringify(request);
25
+
26
+ return post(url, apiKey, body, signal);
27
+ };