-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
samarmeena
committed
Nov 6, 2023
1 parent
16ddbfb
commit 1d6ac50
Showing
18 changed files
with
83 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
## 3.0.0 | ||
# aviationweather | ||
|
||
## 3.0.4 | ||
|
||
### Major Changes | ||
|
||
- migration to latest aviationweather api | ||
|
||
### Patch Changes | ||
|
||
- stations type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,29 @@ | ||
import axios, { AxiosResponse } from "axios"; | ||
import { TafParams } from "./types/params/taf.js"; | ||
import { TafResponse } from "./types/response/taf.js"; | ||
import { MetarResponse } from "./types/response/metar.js"; | ||
import { MetarParams } from "./types/params/metar.js"; | ||
import { | ||
MetarParams, | ||
MetarResponse, | ||
TafParams, | ||
TafResponse, | ||
} from "./types/index.js"; | ||
|
||
export const api = axios.create({ | ||
baseURL: "https://aviationweather.gov/cgi-bin/data", | ||
}); | ||
|
||
export function getMetar( | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
export function getMetar<T = MetarResponse[]>( | ||
params: MetarParams, | ||
): Promise<AxiosResponse<MetarResponse[]>> { | ||
return api.get<MetarResponse[]>("/metar.php", { | ||
): Promise<AxiosResponse<T>> { | ||
return api.get<T>("/metar.php", { | ||
params, | ||
}); | ||
} | ||
|
||
export function getTaf( | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
export function getTaf<T = TafResponse[]>( | ||
params: TafParams, | ||
): Promise<AxiosResponse<TafResponse[]>> { | ||
return api.get<TafResponse[]>("/metar.php", { | ||
): Promise<AxiosResponse<T>> { | ||
return api.get<T>("/taf.php", { | ||
params, | ||
}); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import stations from "./stations.js"; | ||
|
||
export { stations }; | ||
export * from "./sky.js"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { IMetaSkyCondition } from "../types/common/sky.js"; | ||
|
||
export const skyConditions: IMetaSkyCondition[] = [ | ||
{ code: "BKN", description: "Broken cloud" }, | ||
{ code: "CB", description: "Cumulonimbus" }, | ||
{ code: "CLR", description: "Sky clear" }, | ||
{ code: "FEW", description: "Few cloud" }, | ||
{ code: "OVC", description: "Overcast cloud" }, | ||
{ code: "OVCX", description: "Overcast cloud" }, | ||
{ code: "SCT", description: "Scattered cloud" }, | ||
{ code: "SKC", description: "Sky Clear" }, | ||
{ code: "TCU", description: "Towering Cumulus" }, | ||
{ code: "NSC", description: "No Significant Cloud" }, | ||
{ code: "CAVOK", description: "Cloud and Visibility OK" }, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import stations from "./common/stations.js"; | ||
|
||
export * from "./api.js"; | ||
export { stations }; | ||
export * from "./common/index.js"; | ||
export * from "./types/index.js"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export interface Cloud { | ||
cover: string; | ||
base?: number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from "./cloud.js"; | ||
export * from "./sky.js"; | ||
export * from "./station.js"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export interface Station { | ||
icaoId: string; | ||
iataId: string; | ||
faaId: string; | ||
wmoId: string; | ||
lat: number; | ||
lon: number; | ||
elev: number; | ||
site: string; | ||
state: string; | ||
country: string; | ||
priority: number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from "./common/index.js"; | ||
export * from "./params/index.js"; | ||
export * from "./response/index.js"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from "./metar.js"; | ||
export * from "./taf.js"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from "./metar.js"; | ||
export * from "./taf.js"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters