@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.
- package/build/index.d.ts +10 -43
- package/build/index.js +412 -489
- package/build/index.js.map +1 -1
- package/build/types/aapi/accommodation-occupancy.d.ts +9 -9
- package/build/types/aapi/accommodation-with-available-places.d.ts +14 -14
- package/build/types/aapi/accommodation.d.ts +7 -7
- package/build/types/aapi/additional-services.d.ts +6 -6
- package/build/types/aapi/alternative-flight-data.d.ts +10 -10
- package/build/types/aapi/alternative-flight-leg.d.ts +18 -18
- package/build/types/aapi/alternative-flight.d.ts +12 -12
- package/build/types/aapi/availability-request.d.ts +12 -12
- package/build/types/aapi/availability.d.ts +5 -5
- package/build/types/aapi/available-products-request.d.ts +32 -32
- package/build/types/aapi/duration.d.ts +4 -4
- package/build/types/aapi/flight-leg.d.ts +18 -18
- package/build/types/aapi/flight.d.ts +23 -23
- package/build/types/aapi/hotel.d.ts +35 -35
- package/build/types/aapi/index.d.ts +22 -20
- package/build/types/aapi/mollie-payment-request.d.ts +6 -0
- package/build/types/aapi/mollie-payment.d.ts +3 -0
- package/build/types/aapi/option-pax.d.ts +4 -4
- package/build/types/aapi/option.d.ts +21 -28
- package/build/types/aapi/pax.d.ts +4 -4
- package/build/types/aapi/price-detail.d.ts +8 -8
- package/build/types/aapi/regime.d.ts +5 -5
- package/build/types/aapi/traveler-grouping.d.ts +5 -5
- package/build/types/enums/allotment-type.d.ts +5 -5
- package/build/types/enums/availability-search-type.d.ts +4 -4
- package/build/types/enums/dossier-type.d.ts +6 -6
- package/build/types/enums/entry-line-flag.d.ts +6 -6
- package/build/types/enums/entry-line-status.d.ts +19 -19
- package/build/types/enums/entry-status.d.ts +8 -8
- package/build/types/enums/export-status.d.ts +5 -5
- package/build/types/enums/gender.d.ts +5 -5
- package/build/types/enums/index.d.ts +15 -15
- package/build/types/enums/meta-data-type.d.ts +10 -10
- package/build/types/enums/online-payment-type.d.ts +3 -0
- package/build/types/enums/payment-type.d.ts +6 -6
- package/build/types/enums/price-chart-type.d.ts +4 -4
- package/build/types/enums/requirement-type.d.ts +5 -5
- package/build/types/enums/room-type.d.ts +8 -8
- package/build/types/enums/sale-type.d.ts +4 -4
- package/build/types/enums/service-type.d.ts +26 -26
- package/build/types/index.d.ts +4 -24
- package/build/types/offer/additional-services.d.ts +6 -6
- package/build/types/offer/address.d.ts +11 -11
- package/build/types/offer/alternative-flight-data.d.ts +10 -10
- package/build/types/offer/alternative-flight-leg.d.ts +18 -18
- package/build/types/offer/alternative-flight.d.ts +14 -14
- package/build/types/offer/available-package-accommodation.d.ts +7 -0
- package/build/types/offer/available-package-flight.d.ts +9 -0
- package/build/types/offer/available-package-option.d.ts +12 -0
- package/build/types/offer/available-package-pax-price.d.ts +6 -0
- package/build/types/offer/available-package-regime.d.ts +4 -0
- package/build/types/offer/available-package.d.ts +7 -0
- package/build/types/offer/base-price.d.ts +6 -6
- package/build/types/offer/base-prices-from-date-request.d.ts +12 -12
- package/build/types/offer/base-prices-request.d.ts +12 -12
- package/build/types/offer/book-request.d.ts +36 -36
- package/build/types/offer/booking-response.d.ts +4 -4
- package/build/types/offer/cached-package-search-result.d.ts +5 -5
- package/build/types/offer/confirmed-dossier-check.d.ts +6 -6
- package/build/types/offer/crm-contact-request.d.ts +28 -36
- package/build/types/offer/customer-request.d.ts +5 -5
- package/build/types/offer/dossier-default-product.d.ts +14 -14
- package/build/types/offer/entry-check-response.d.ts +8 -8
- package/build/types/offer/entry-line-meta-data.d.ts +5 -5
- package/build/types/offer/entry-line-pax.d.ts +8 -8
- package/build/types/offer/entry-line.d.ts +67 -73
- package/build/types/offer/entry-price-line.d.ts +40 -40
- package/build/types/offer/entry-room2.d.ts +5 -5
- package/build/types/offer/entry.d.ts +49 -59
- package/build/types/offer/flight-meta-data-line.d.ts +16 -0
- package/build/types/offer/flight-meta-data.d.ts +10 -0
- package/build/types/offer/flight-pool.d.ts +5 -5
- package/build/types/offer/index.d.ts +64 -56
- package/build/types/offer/language.d.ts +5 -5
- package/build/types/offer/multiroom-book-request.d.ts +10 -10
- package/build/types/offer/note.d.ts +16 -16
- package/build/types/offer/other-product.d.ts +13 -13
- package/build/types/offer/package-book-request-room.d.ts +5 -5
- package/build/types/offer/package-book-request.d.ts +12 -12
- package/build/types/offer/package-flight.d.ts +13 -13
- package/build/types/offer/package-flights.d.ts +5 -5
- package/build/types/offer/package-option.d.ts +22 -22
- package/build/types/offer/package-price-details-request-room.d.ts +4 -4
- package/build/types/offer/package-price-details-request.d.ts +8 -8
- package/build/types/offer/package-room-option.d.ts +10 -10
- package/build/types/offer/package-room.d.ts +7 -7
- package/build/types/offer/package-search-destination.d.ts +9 -9
- package/build/types/offer/package-search-request-date.d.ts +4 -4
- package/build/types/offer/package-search-request-room.d.ts +5 -5
- package/build/types/offer/package-search-request.d.ts +18 -22
- package/build/types/offer/package-search-result.d.ts +12 -12
- package/build/types/offer/package-sub-option.d.ts +6 -6
- package/build/types/offer/pax.d.ts +29 -29
- package/build/types/offer/payment.d.ts +20 -20
- package/build/types/offer/person-country-preference.d.ts +7 -7
- package/build/types/offer/person-location-preference.d.ts +7 -7
- package/build/types/offer/person-oord-preference.d.ts +7 -7
- package/build/types/offer/person-period-date-range-preference.d.ts +6 -6
- package/build/types/offer/person-period-preference.d.ts +7 -7
- package/build/types/offer/person-region-preference.d.ts +7 -7
- package/build/types/offer/person-tour-group-preference.d.ts +7 -7
- package/build/types/offer/price-detail.d.ts +18 -18
- package/build/types/offer/price-per-pax.d.ts +6 -6
- package/build/types/offer/product-notification-result.d.ts +9 -9
- package/build/types/offer/web-contact-form-request.d.ts +13 -13
- package/build/types/offer/web-contact-has-tag-request.d.ts +4 -4
- package/build/types/tide-client-config.d.ts +4 -4
- package/build/utils/api.d.ts +1 -6
- package/build/utils/booking-client.d.ts +102 -169
- package/build/utils/booking-v2-client.d.ts +3 -0
- package/build/utils/common-client.d.ts +1 -6
- package/build/utils/json.d.ts +2 -2
- package/build/utils/mollie-client.d.ts +7 -0
- package/build/utils/web-client.d.ts +10 -14
- package/build/utils/web-contact-client.d.ts +11 -23
- package/package.json +1 -1
- package/src/index.ts +10 -0
- package/src/types/aapi/index.ts +2 -0
- package/src/types/aapi/mollie-payment-request.ts +6 -0
- package/src/types/aapi/mollie-payment.ts +3 -0
- package/src/types/index.ts +2 -0
- package/src/types/offer/available-package-accommodation.ts +8 -0
- package/src/types/offer/available-package-flight.ts +10 -0
- package/src/types/offer/available-package-option.ts +18 -0
- package/src/types/offer/available-package-pax-price.ts +6 -0
- package/src/types/offer/available-package-regime.ts +4 -0
- package/src/types/offer/available-package.ts +8 -0
- package/src/types/offer/flight-meta-data-line.ts +16 -0
- package/src/types/offer/flight-meta-data.ts +11 -0
- package/src/types/offer/index.ts +8 -0
- package/src/utils/booking-v2-client.ts +19 -0
- package/src/utils/json.ts +6 -5
- 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[]>;
|
package/build/utils/json.d.ts
CHANGED
|
@@ -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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
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";
|
package/src/types/aapi/index.ts
CHANGED
|
@@ -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";
|
package/src/types/index.ts
CHANGED
|
@@ -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,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
|
+
}
|
package/src/types/offer/index.ts
CHANGED
|
@@ -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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
+
};
|