@qite/tide-client 1.1.23 → 1.1.24

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,2 +1,2 @@
1
- export declare const post: (url: string, apiKey: string, body: string, signal?: AbortSignal | undefined) => Promise<Response>;
1
+ export declare const post: (url: string, apiKey: string, body: string, signal?: AbortSignal | undefined, languageCode?: string | undefined) => Promise<Response>;
2
2
  export declare const get: (url: string, apiKey: string, signal?: AbortSignal | undefined) => Promise<Response>;
@@ -3,12 +3,12 @@ import { AvailablePackage, BookableDates, BookableDatesRequest, BookingPackage,
3
3
  import { BookingPackageAvailability } from "../types/offer/booking-v2/shared/booking-package-availability";
4
4
  export declare const readPackageSearchList: (config: TideClientConfig, request: PackageSearchRequest, signal?: AbortSignal | undefined) => Promise<AvailablePackage[]>;
5
5
  export declare const search: (config: TideClientConfig, request: BookingPackageRequest<BookingPackageSearchRequest>, signal?: AbortSignal | undefined) => Promise<BookingPackageItem[]>;
6
- export declare const details: (config: TideClientConfig, request: BookingPackageRequest<BookingPackageDetailsRequest>, signal?: AbortSignal | undefined) => Promise<TideResponse<BookingPackage>>;
6
+ export declare const details: (config: TideClientConfig, request: BookingPackageRequest<BookingPackageDetailsRequest>, signal?: AbortSignal | undefined, languageCode?: string | undefined) => Promise<TideResponse<BookingPackage>>;
7
7
  export declare const validateVoucher: (config: TideClientConfig, request: BookingPackageRequest<BookingPackageVoucherRequest>, signal?: AbortSignal | undefined) => Promise<TideResponse<BookingVoucherResult>>;
8
8
  export declare const alternateHotels: (config: TideClientConfig, transactionId: string, signal?: AbortSignal | undefined) => Promise<BookingPackageHotelPool>;
9
9
  export declare const alternateFlights: (config: TideClientConfig, transactionId: string, signal?: AbortSignal | undefined) => Promise<BookingPackageFlightPool>;
10
10
  export declare const priceDetails: (config: TideClientConfig, request: BookingPackageRequest<BookingPackageBookRequest>, signal?: AbortSignal | undefined) => Promise<BookingPriceDetails>;
11
- export declare const book: (config: TideClientConfig, request: BookingPackageRequest<BookingPackageBookRequest>, signal?: AbortSignal | undefined) => Promise<BookingPackageDossier>;
11
+ export declare const book: (config: TideClientConfig, request: BookingPackageRequest<BookingPackageBookRequest>, signal?: AbortSignal | undefined, languageCode?: string | undefined) => Promise<BookingPackageDossier>;
12
12
  export declare const update: (config: TideClientConfig, request: BookingPackageRequest<BookingPackageUpdateRequest>, signal?: AbortSignal | undefined) => Promise<BookingPackageDossier>;
13
13
  export declare const agents: (config: TideClientConfig, signal?: AbortSignal | undefined) => Promise<BookingTravelAgent[]>;
14
14
  export declare const getAllotmentAvailability: (config: TideClientConfig, eventId: string, productCode: string, signal?: AbortSignal | undefined) => Promise<BookingPackageAvailability[]>;
@@ -1,2 +1,2 @@
1
- export declare const post: <T>(url: string, apiKey: string, body: string, signal?: AbortSignal | undefined, skipReviver?: boolean | undefined) => Promise<T>;
1
+ export declare const post: <T>(url: string, apiKey: string, body: string, signal?: AbortSignal | undefined, skipReviver?: boolean | undefined, languageCode?: string | undefined) => Promise<T>;
2
2
  export declare const get: <T>(url: string, apiKey: string, signal?: AbortSignal | undefined, skipReviver?: boolean | undefined) => Promise<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qite/tide-client",
3
- "version": "1.1.23",
3
+ "version": "1.1.24",
4
4
  "description": "Frontend client for Tide",
5
5
  "main": "build/index.js",
6
6
  "scripts": {
package/src/utils/api.ts CHANGED
@@ -2,13 +2,15 @@ export const post = async (
2
2
  url: string,
3
3
  apiKey: string,
4
4
  body: string,
5
- signal?: AbortSignal
5
+ signal?: AbortSignal,
6
+ languageCode?: string,
6
7
  ): Promise<Response> => {
7
8
  const response = await fetch(url, {
8
9
  method: "POST",
9
10
  headers: {
10
11
  "Content-Type": "application/json",
11
12
  "Api-Key": apiKey,
13
+ "Language": languageCode || "nl-BE",
12
14
  },
13
15
  credentials: "include",
14
16
  body,
@@ -70,13 +70,14 @@ export const search = (
70
70
  export const details = (
71
71
  config: TideClientConfig,
72
72
  request: BookingPackageRequest<BookingPackageDetailsRequest>,
73
- signal?: AbortSignal
73
+ signal?: AbortSignal,
74
+ languageCode?: string
74
75
  ): Promise<TideResponse<BookingPackage>> => {
75
76
  const url = `${config.host}${ENDPOINT_DETAILS}`;
76
77
  const apiKey = config.apiKey;
77
78
  const body = JSON.stringify(request);
78
79
 
79
- return post(url, apiKey, body, signal, true);
80
+ return post(url, apiKey, body, signal, true, languageCode);
80
81
  };
81
82
 
82
83
  export const validateVoucher = (
@@ -128,13 +129,14 @@ export const priceDetails = (
128
129
  export const book = (
129
130
  config: TideClientConfig,
130
131
  request: BookingPackageRequest<BookingPackageBookRequest>,
131
- signal?: AbortSignal
132
+ signal?: AbortSignal,
133
+ languageCode?: string,
132
134
  ): Promise<BookingPackageDossier> => {
133
135
  const url = `${config.host}${ENDPOINT_BOOK}`;
134
136
  const apiKey = config.apiKey;
135
137
  const body = JSON.stringify(request);
136
138
 
137
- return post(url, apiKey, body, signal, true);
139
+ return post(url, apiKey, body, signal, true, languageCode);
138
140
  };
139
141
 
140
142
  export const update = (
@@ -6,9 +6,10 @@ export const post = async <T>(
6
6
  apiKey: string,
7
7
  body: string,
8
8
  signal?: AbortSignal,
9
- skipReviver?: boolean
9
+ skipReviver?: boolean,
10
+ languageCode?: string,
10
11
  ): Promise<T> => {
11
- const response = await apiPost(url, apiKey, body, signal);
12
+ const response = await apiPost(url, apiKey, body, signal, languageCode);
12
13
  const responseBody = await response.text();
13
14
 
14
15
  const result: T = skipReviver