@qite/tide-client 1.1.66 → 1.1.67

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.
@@ -0,0 +1,10 @@
1
+ export interface Airport {
2
+ iata: string;
3
+ name: string;
4
+ isDepartureLocation: boolean;
5
+ localizations: AirportLocalized[];
6
+ }
7
+ export interface AirportLocalized {
8
+ languageCode: string;
9
+ name: string;
10
+ }
@@ -1,3 +1,4 @@
1
1
  export * from "./affiliate";
2
+ export * from "./airport";
2
3
  export * from "./contact-form-request";
3
4
  export * from "./generate-booking-accommodation-request";
@@ -1,4 +1,4 @@
1
- import { CountryItem, PageResult, TideClientConfig } from "../types";
1
+ import { Airport, CountryItem, PageResult, TideClientConfig } from "../types";
2
2
  /**
3
3
  * api/search/countries
4
4
  * Gets all Countries
@@ -10,3 +10,7 @@ export declare const getCountries: (
10
10
  config: TideClientConfig,
11
11
  signal?: AbortSignal | undefined
12
12
  ) => Promise<PageResult<CountryItem>>;
13
+ export declare const getAirports: (
14
+ config: TideClientConfig,
15
+ signal?: AbortSignal | undefined
16
+ ) => Promise<Airport>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qite/tide-client",
3
- "version": "1.1.66",
3
+ "version": "1.1.67",
4
4
  "description": "Frontend client for Tide",
5
5
  "main": "build/index.js",
6
6
  "scripts": {
@@ -0,0 +1,11 @@
1
+ export interface Airport {
2
+ iata: string;
3
+ name: string;
4
+ isDepartureLocation: boolean;
5
+ localizations: AirportLocalized[];
6
+ }
7
+
8
+ export interface AirportLocalized {
9
+ languageCode: string;
10
+ name: string;
11
+ }
@@ -1,3 +1,4 @@
1
1
  export * from "./affiliate";
2
+ export * from "./airport";
2
3
  export * from "./contact-form-request";
3
4
  export * from "./generate-booking-accommodation-request";
@@ -1,8 +1,9 @@
1
- import { CountryItem, PageResult, TideClientConfig } from "../types";
1
+ import { Airport, CountryItem, PageResult, TideClientConfig } from "../types";
2
2
  import { get } from "./common-client";
3
3
 
4
4
  const ENDPOINT = "/api/web/search";
5
5
  const ENDPOINT_COUNTRIES = `${ENDPOINT}/countries`;
6
+ const ENDPOINT_AIRPORTS = `${ENDPOINT}/airports`;
6
7
 
7
8
  /**
8
9
  * api/search/countries
@@ -20,3 +21,13 @@ export const getCountries = (
20
21
 
21
22
  return get(url, apiKey, config.token, signal, true);
22
23
  };
24
+
25
+ export const getAirports = (
26
+ config: TideClientConfig,
27
+ signal?: AbortSignal
28
+ ): Promise<Airport> => {
29
+ const url = `${config.host}${ENDPOINT_AIRPORTS}`;
30
+ const apiKey = config.apiKey;
31
+
32
+ return get(url, apiKey, config.token, signal, true);
33
+ };