@flybywiresim/api-client
Advanced tools
Comparing version 0.6.0 to 0.7.0
@@ -132,2 +132,3 @@ export declare class MetarResponse { | ||
static get(icao: string): Promise<AirportResponse>; | ||
static getBatch(icaos: string[]): Promise<AirportResponse[]>; | ||
} | ||
@@ -134,0 +135,0 @@ export declare class GitVersions { |
@@ -352,2 +352,21 @@ "use strict"; | ||
}; | ||
Airport.getBatch = function (icaos) { | ||
if (!icaos) { | ||
throw new Error("No ICAOs provided"); | ||
} | ||
var body = { | ||
icaos: icaos | ||
}; | ||
var headers = { | ||
"Content-Type": "application/json" | ||
}; | ||
var url = new URL("/api/v1/airport/_batch", NXApi.url); | ||
return fetch(url.href, { method: "POST", body: JSON.stringify(body), headers: headers }) | ||
.then(function (response) { | ||
if (!response.ok) { | ||
throw new HttpError(response.status); | ||
} | ||
return response.json(); | ||
}); | ||
}; | ||
return Airport; | ||
@@ -354,0 +373,0 @@ }()); |
{ | ||
"name": "@flybywiresim/api-client", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"description": "Client library for the FlyByWire Simulations API", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26727
542
16