@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.
- package/build/index.js +7 -0
- package/build/index.js.map +1 -1
- package/build/types/web/airport.d.ts +10 -0
- package/build/types/web/index.d.ts +1 -0
- package/build/utils/search-client.d.ts +5 -1
- package/package.json +1 -1
- package/src/types/web/airport.ts +11 -0
- package/src/types/web/index.ts +1 -0
- package/src/utils/search-client.ts +12 -1
|
@@ -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
package/src/types/web/index.ts
CHANGED
|
@@ -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
|
+
};
|