airport-data-js 4.0.0 → 4.1.1
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/README.md +166 -29
- package/dist/airport-data.lite.min.js +1 -0
- package/dist/airport-data.min.js +1 -1
- package/lib/index.js +1 -1
- package/lib/index.mjs +1 -0
- package/lib/lite.js +1 -0
- package/lib/lite.mjs +1 -0
- package/lib/payload.full.js +2 -0
- package/lib/payload.lite.js +2 -0
- package/lib/tools.js +1 -1
- package/lib/tools.mjs +1 -0
- package/package.json +64 -27
- package/types/core.d.mts +710 -0
- package/types/core.d.ts +710 -0
- package/types/execute.d.mts +28 -0
- package/types/execute.d.ts +28 -0
- package/types/index.d.mts +10 -0
- package/types/index.d.ts +6 -510
- package/types/lite.d.mts +8 -0
- package/types/lite.d.ts +8 -0
- package/types/state.d.mts +18 -0
- package/types/state.d.ts +18 -0
- package/types/tools.d.mts +59 -0
- package/types/tools.d.ts +11 -2
package/lib/tools.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";let e={};(()=>{let t=e;Object.defineProperty(t,"__esModule",{value:!0}),t.airportTools=void 0,t.airportTools=[{name:"getAirportByIata",description:'Look up an airport by its 3-letter IATA code (e.g., "LHR" for London Heathrow, "JFK" for New York JFK, "SIN" for Singapore Changi). Returns full airport details including location, timezone, and links.',parameters:{type:"object",properties:{iataCode:{type:"string",description:'3-letter uppercase IATA airport code (e.g., "LHR", "JFK", "SIN")'}},required:["iataCode"]}},{name:"getAirportByIcao",description:'Look up an airport by its 4-character ICAO code (e.g., "EGLL" for London Heathrow, "KJFK" for New York JFK). Returns full airport details.',parameters:{type:"object",properties:{icaoCode:{type:"string",description:'4-character uppercase ICAO airport code (e.g., "EGLL", "KJFK", "WSSS")'}},required:["icaoCode"]}},{name:"getAirportByCountryCode",description:'Get all airports in a country by its ISO 3166-1 alpha-2 code (e.g., "US" for United States, "GB" for United Kingdom, "SG" for Singapore).',parameters:{type:"object",properties:{countryCode:{type:"string",description:'2-letter uppercase ISO country code (e.g., "US", "GB", "SG")'}},required:["countryCode"]}},{name:"getAirportByContinent",description:"Get all airports on a continent. Valid codes: AF (Africa), AN (Antarctica), AS (Asia), EU (Europe), NA (North America), OC (Oceania), SA (South America).",parameters:{type:"object",properties:{continentCode:{type:"string",description:"2-letter continent code",enum:["AF","AN","AS","EU","NA","OC","SA"]}},required:["continentCode"]}},{name:"searchByName",description:'Search for airports by name using case-insensitive partial matching. Use this when you have an airport name but not its code (e.g., "Heathrow", "Changi", "Charles de Gaulle").',parameters:{type:"object",properties:{query:{type:"string",description:"Airport name or partial name to search for (2-100 characters)"}},required:["query"]}},{name:"findNearbyAirports",description:"Find all airports within a radius of a geographic point. Useful for finding airports near a city or location.",parameters:{type:"object",properties:{lat:{type:"number",description:"Latitude in decimal degrees (-90 to 90)",minimum:-90,maximum:90},lon:{type:"number",description:"Longitude in decimal degrees (-180 to 180)",minimum:-180,maximum:180},radiusKm:{type:"number",description:"Search radius in kilometers",default:100}},required:["lat","lon"]}},{name:"getAirportsByType",description:'Filter airports by classification type. Types: "large_airport", "medium_airport", "small_airport", "heliport", "seaplane_base", "closed". Pass "airport" to get all airport types.',parameters:{type:"object",properties:{type:{type:"string",description:"Airport type classification",enum:["large_airport","medium_airport","small_airport","heliport","seaplane_base","closed","airport"]}},required:["type"]}},{name:"getAutocompleteSuggestions",description:"Get autocomplete suggestions for airports based on partial input. Searches by airport name and IATA code. Returns up to 10 results.",parameters:{type:"object",properties:{query:{type:"string",description:"Partial search query (2-100 characters)"}},required:["query"]}},{name:"calculateDistance",description:"Calculate the great-circle (Haversine) distance in kilometers between two airports. Accepts either IATA or ICAO codes.",parameters:{type:"object",properties:{code1:{type:"string",description:"IATA or ICAO code of the first airport"},code2:{type:"string",description:"IATA or ICAO code of the second airport"}},required:["code1","code2"]}},{name:"getAirportLinks",description:"Get external links for an airport including Wikipedia, official website, FlightRadar24, RadarBox, and FlightAware URLs.",parameters:{type:"object",properties:{code:{type:"string",description:"IATA or ICAO code of the airport"}},required:["code"]}},{name:"getAirportsByTimezone",description:'Get all airports in a specific IANA timezone (e.g., "Europe/London", "Asia/Singapore", "America/New_York").',parameters:{type:"object",properties:{timezone:{type:"string",description:'IANA timezone identifier (e.g., "Europe/London")'}},required:["timezone"]}},{name:"findAirports",description:"Advanced multi-criteria airport search. Combine filters with AND logic. Supports country, continent, type, timezone, scheduled service, and minimum runway length filters.",parameters:{type:"object",properties:{country_code:{type:"string",description:"2-letter ISO country code filter"},continent:{type:"string",description:"2-letter continent code filter",enum:["AF","AN","AS","EU","NA","OC","SA"]},type:{type:"string",description:"Airport type filter",enum:["large_airport","medium_airport","small_airport","heliport","seaplane_base","closed"]},has_scheduled_service:{type:"boolean",description:"Filter by scheduled commercial service availability"},min_runway_ft:{type:"number",description:"Minimum runway length in feet"},time:{type:"string",description:"IANA timezone filter"}},required:[]}},{name:"getAirportStatsByCountry",description:"Get aggregated airport statistics for a country: total count, breakdown by type, scheduled service count, average runway length, average elevation, and timezones.",parameters:{type:"object",properties:{countryCode:{type:"string",description:"2-letter uppercase ISO country code"}},required:["countryCode"]}},{name:"getAirportStatsByContinent",description:"Get aggregated airport statistics for a continent: total count, breakdown by type and country, scheduled service count, average runway length, and average elevation.",parameters:{type:"object",properties:{continentCode:{type:"string",description:"2-letter continent code",enum:["AF","AN","AS","EU","NA","OC","SA"]}},required:["continentCode"]}},{name:"getLargestAirportsByContinent",description:"Get the top airports on a continent ranked by runway length or elevation.",parameters:{type:"object",properties:{continentCode:{type:"string",description:"2-letter continent code",enum:["AF","AN","AS","EU","NA","OC","SA"]},limit:{type:"number",description:"Number of results to return (1-1000)",default:10},sortBy:{type:"string",description:"Ranking criteria",enum:["runway","elevation"]}},required:["continentCode"]}},{name:"getMultipleAirports",description:"Fetch multiple airports in a single call by their IATA or ICAO codes. Returns null for unresolved codes. Maximum 500 codes.",parameters:{type:"object",properties:{codes:{type:"array",description:"Array of IATA or ICAO codes",items:{type:"string"}}},required:["codes"]}},{name:"calculateDistanceMatrix",description:"Calculate distances between all pairs of airports. Returns a symmetric distance matrix. Maximum 100 codes.",parameters:{type:"object",properties:{codes:{type:"array",description:"Array of 2-100 IATA or ICAO codes",items:{type:"string"}}},required:["codes"]}},{name:"findNearestAirport",description:"Find the single closest airport to a geographic point, optionally filtered by type, country, or other criteria.",parameters:{type:"object",properties:{lat:{type:"number",description:"Latitude in decimal degrees (-90 to 90)",minimum:-90,maximum:90},lon:{type:"number",description:"Longitude in decimal degrees (-180 to 180)",minimum:-180,maximum:180},type:{type:"string",description:"Optional airport type filter",enum:["large_airport","medium_airport","small_airport","heliport","seaplane_base"]},country_code:{type:"string",description:"Optional 2-letter country code filter"}},required:["lat","lon"]}},{name:"validateIataCode",description:"Check whether a 3-letter IATA code exists in the airport database. Returns true/false.",parameters:{type:"object",properties:{code:{type:"string",description:"3-letter IATA code to validate"}},required:["code"]}},{name:"validateIcaoCode",description:"Check whether a 4-character ICAO code exists in the airport database. Returns true/false.",parameters:{type:"object",properties:{code:{type:"string",description:"4-character ICAO code to validate"}},required:["code"]}},{name:"getAirportCount",description:"Get the count of airports matching optional filters. Call with no filters for the total number of airports in the database.",parameters:{type:"object",properties:{country_code:{type:"string",description:"Optional country code filter"},type:{type:"string",description:"Optional airport type filter"},continent:{type:"string",description:"Optional continent code filter"}},required:[]}},{name:"isAirportOperational",description:"Check whether an airport has scheduled commercial service (is operational). Accepts IATA or ICAO code.",parameters:{type:"object",properties:{code:{type:"string",description:"IATA or ICAO code of the airport"}},required:["code"]}}]})(),module.exports=e})();
|
|
1
|
+
(()=>{"use strict";let e={};(()=>{let t=e;Object.defineProperty(t,"__esModule",{value:!0}),t.airportTools=void 0,t.airportTools=[{name:"getAirportByIata",description:'Look up an airport by its 3-letter IATA code (e.g., "LHR" for London Heathrow, "JFK" for New York JFK, "SIN" for Singapore Changi). Returns full airport details including location, timezone, and links.',parameters:{type:"object",properties:{iataCode:{type:"string",description:'3-letter uppercase IATA airport code (e.g., "LHR", "JFK", "SIN")',pattern:"^[A-Za-z]{3}$"}},required:["iataCode"]}},{name:"getAirportByIcao",description:'Look up an airport by its 4-character ICAO code (e.g., "EGLL" for London Heathrow, "KJFK" for New York JFK). Returns full airport details.',parameters:{type:"object",properties:{icaoCode:{type:"string",description:'4-character uppercase ICAO airport code (e.g., "EGLL", "KJFK", "WSSS")',pattern:"^[A-Za-z0-9]{4}$"}},required:["icaoCode"]}},{name:"getAirportByCountryCode",description:'Get all airports in a country by its ISO 3166-1 alpha-2 code (e.g., "US" for United States, "GB" for United Kingdom, "SG" for Singapore).',parameters:{type:"object",properties:{countryCode:{type:"string",description:'2-letter uppercase ISO country code (e.g., "US", "GB", "SG")'}},required:["countryCode"]}},{name:"getAirportByContinent",description:"Get all airports on a continent. Valid codes: AF (Africa), AN (Antarctica), AS (Asia), EU (Europe), NA (North America), OC (Oceania), SA (South America).",parameters:{type:"object",properties:{continentCode:{type:"string",description:"2-letter continent code",enum:["AF","AN","AS","EU","NA","OC","SA"]}},required:["continentCode"]}},{name:"searchByName",description:'Search for airports by name using case-insensitive partial matching. Use this when you have an airport name but not its code (e.g., "Heathrow", "Changi", "Charles de Gaulle").',parameters:{type:"object",properties:{query:{type:"string",description:"Airport name or partial name to search for (2-100 characters)"}},required:["query"]}},{name:"findNearbyAirports",description:"Find all airports within a radius of a geographic point. Useful for finding airports near a city or location.",parameters:{type:"object",properties:{lat:{type:"number",description:"Latitude in decimal degrees (-90 to 90)",minimum:-90,maximum:90},lon:{type:"number",description:"Longitude in decimal degrees (-180 to 180)",minimum:-180,maximum:180},radiusKm:{type:"number",description:"Search radius in kilometers (minimum 1)",minimum:1,default:100},limit:{type:"integer",description:"Optional maximum number of results, nearest first (default: all matching airports)",minimum:1,maximum:1e4}},required:["lat","lon"]}},{name:"getAirportsByType",description:'Filter airports by classification type. Types: "large_airport", "medium_airport", "small_airport", "heliport", "seaplane_base", "closed". Pass "airport" to get all airport types.',parameters:{type:"object",properties:{type:{type:"string",description:"Airport type classification",enum:["large_airport","medium_airport","small_airport","heliport","seaplane_base","closed","airport"]},limit:{type:"integer",description:"Optional maximum number of results (default: all matching airports)",minimum:1,maximum:1e5}},required:["type"]}},{name:"getAutocompleteSuggestions",description:"Get autocomplete suggestions for airports based on partial input. Matches IATA/ICAO codes, city names, metro codes, and airport names, with major airports first. Returns up to 10 results.",parameters:{type:"object",properties:{query:{type:"string",description:"Partial search query (2-100 characters)"}},required:["query"]}},{name:"calculateDistance",description:"Calculate the great-circle (Haversine) distance in kilometers between two airports. Accepts either IATA or ICAO codes.",parameters:{type:"object",properties:{code1:{type:"string",description:"IATA or ICAO code of the first airport"},code2:{type:"string",description:"IATA or ICAO code of the second airport"}},required:["code1","code2"]}},{name:"getAirportLinks",description:"Get external links for an airport including Wikipedia, official website, FlightRadar24, RadarBox, and FlightAware URLs.",parameters:{type:"object",properties:{code:{type:"string",description:"IATA or ICAO code of the airport"}},required:["code"]}},{name:"getAirportsByTimezone",description:'Get all airports in a specific IANA timezone (e.g., "Europe/London", "Asia/Singapore", "America/New_York").',parameters:{type:"object",properties:{timezone:{type:"string",description:'IANA timezone identifier (e.g., "Europe/London")'}},required:["timezone"]}},{name:"findAirports",description:"Advanced multi-criteria airport search. Combine filters with AND logic. Supports country, continent, type, timezone, scheduled service, and minimum runway length filters.",parameters:{type:"object",properties:{country_code:{type:"string",description:"2-letter ISO country code filter"},continent:{type:"string",description:"2-letter continent code filter",enum:["AF","AN","AS","EU","NA","OC","SA"]},type:{type:"string",description:"Airport type filter",enum:["large_airport","medium_airport","small_airport","heliport","seaplane_base","closed"]},has_scheduled_service:{type:"boolean",description:"Filter by scheduled commercial service availability"},min_runway_ft:{type:"number",description:"Minimum runway length in feet"},time:{type:"string",description:"IANA timezone filter"}},required:[]}},{name:"getAirportStatsByCountry",description:"Get aggregated airport statistics for a country: total count, breakdown by type, scheduled service count, average runway length, average elevation, and timezones.",parameters:{type:"object",properties:{countryCode:{type:"string",description:"2-letter uppercase ISO country code"}},required:["countryCode"]}},{name:"getAirportStatsByContinent",description:"Get aggregated airport statistics for a continent: total count, breakdown by type and country, scheduled service count, average runway length, and average elevation.",parameters:{type:"object",properties:{continentCode:{type:"string",description:"2-letter continent code",enum:["AF","AN","AS","EU","NA","OC","SA"]}},required:["continentCode"]}},{name:"getLargestAirportsByContinent",description:"Get the top airports on a continent ranked by runway length or elevation.",parameters:{type:"object",properties:{continentCode:{type:"string",description:"2-letter continent code",enum:["AF","AN","AS","EU","NA","OC","SA"]},limit:{type:"integer",description:"Number of results to return (1-1000)",minimum:1,maximum:1e3,default:10},sortBy:{type:"string",description:"Ranking criteria",enum:["runway","elevation"]}},required:["continentCode"]}},{name:"getMultipleAirports",description:"Fetch multiple airports in a single call by their IATA or ICAO codes. Returns null for unresolved codes. Maximum 500 codes.",parameters:{type:"object",properties:{codes:{type:"array",description:"Array of 2-500 IATA or ICAO codes",items:{type:"string",pattern:"^[A-Za-z0-9]{3,4}$"},minItems:1,maxItems:500}},required:["codes"]}},{name:"calculateDistanceMatrix",description:"Calculate distances between all pairs of airports. Returns a symmetric distance matrix. Maximum 100 codes.",parameters:{type:"object",properties:{codes:{type:"array",description:"Array of 2-100 IATA or ICAO codes",items:{type:"string",pattern:"^[A-Za-z0-9]{3,4}$"},minItems:2,maxItems:100}},required:["codes"]}},{name:"findNearestAirport",description:"Find the single closest airport to a geographic point, optionally filtered by type, country, or other criteria.",parameters:{type:"object",properties:{lat:{type:"number",description:"Latitude in decimal degrees (-90 to 90)",minimum:-90,maximum:90},lon:{type:"number",description:"Longitude in decimal degrees (-180 to 180)",minimum:-180,maximum:180},type:{type:"string",description:"Optional airport type filter",enum:["large_airport","medium_airport","small_airport","heliport","seaplane_base"]},country_code:{type:"string",description:"Optional 2-letter country code filter"}},required:["lat","lon"]}},{name:"validateIataCode",description:"Check whether a 3-letter IATA code exists in the airport database. Returns true/false.",parameters:{type:"object",properties:{code:{type:"string",description:"3-letter IATA code to validate",pattern:"^[A-Za-z]{3}$"}},required:["code"]}},{name:"validateIcaoCode",description:"Check whether a 4-character ICAO code exists in the airport database. Returns true/false.",parameters:{type:"object",properties:{code:{type:"string",description:"4-character ICAO code to validate",pattern:"^[A-Za-z0-9]{4}$"}},required:["code"]}},{name:"getAirportCount",description:"Get the count of airports matching optional filters. Call with no filters for the total number of airports in the database.",parameters:{type:"object",properties:{country_code:{type:"string",description:"Optional country code filter",pattern:"^[A-Za-z]{2}$"},type:{type:"string",description:"Optional airport type filter"},continent:{type:"string",description:"Optional continent code filter"}},required:[]}},{name:"isAirportOperational",description:"Check whether an airport has scheduled commercial service (is operational). Accepts IATA or ICAO code.",parameters:{type:"object",properties:{code:{type:"string",description:"IATA or ICAO code of the airport"}},required:["code"]}},{name:"search",description:'Ranked airport search across codes, cities, and names. Best general-purpose lookup when the user gives a city ("New York", "London"), a metro code ("NYC", "LON"), an airport name ("Heathrow"), or a code. Accent-insensitive and typo-tolerant; major airports with scheduled service rank first. Pass limit/scheduledOnly/country_code as the second (options) argument.',parameters:{type:"object",properties:{query:{type:"string",description:'Search text, 2-100 characters (e.g., "new york", "LON", "heathrow", "Zürich")'},limit:{type:"integer",description:"Maximum number of results (1-100, default 10)",minimum:1,maximum:100},scheduledOnly:{type:"boolean",description:"Only return airports with scheduled commercial service"},country_code:{type:"string",description:'Optional 2-letter ISO country code filter (e.g., "US")',pattern:"^[A-Za-z]{2}$"}},required:["query"]}},{name:"getAirportsByCity",description:'Find airports serving a city by name (case- and accent-insensitive), major airports first. Some airports list their own municipality (e.g., EWR is "Newark"); use getAirportsByCityCode for whole metro areas.',parameters:{type:"object",properties:{city:{type:"string",description:'City name (e.g., "London", "São Paulo", "Tokyo")'}},required:["city"]}},{name:"getAirportsByCityCode",description:'Find all airports in an IATA city/metropolitan area code (e.g., "NYC" for JFK, LGA, EWR; "LON" for LHR, LGW, STN, LTN, LCY; "TYO" for HND, NRT).',parameters:{type:"object",properties:{cityCode:{type:"string",description:'3-letter uppercase IATA city code (e.g., "NYC", "LON", "PAR")'}},required:["cityCode"]}},{name:"getUtcOffset",description:"Get the real UTC offset in hours at an airport for a given moment, accounting for daylight saving time (e.g., JFK is -4 in July and -5 in December). Prefer this over the static utc field.",parameters:{type:"object",properties:{code:{type:"string",description:"IATA or ICAO code of the airport"},date:{type:"string",description:"Optional ISO 8601 date-time (default: now)"}},required:["code"]}},{name:"getLocalTime",description:"Get the current (or a given) local date and time at an airport, with UTC offset and whether daylight saving time is in effect.",parameters:{type:"object",properties:{code:{type:"string",description:"IATA or ICAO code of the airport"},date:{type:"string",description:"Optional ISO 8601 date-time to convert (default: now)"}},required:["code"]}},{name:"formatAirportTime",description:"Format a moment as a human-readable string in the airport's local time zone and a given locale. Pass date/locale/dateStyle/timeStyle as the second (options) argument.",parameters:{type:"object",properties:{code:{type:"string",description:"IATA or ICAO code of the airport"},date:{type:"string",description:"Optional ISO 8601 date-time to format (default: now)"},locale:{type:"string",description:'Optional BCP 47 locale (default: "en-US")'},dateStyle:{type:"string",description:"Optional date style",enum:["full","long","medium","short"]},timeStyle:{type:"string",description:"Optional time style",enum:["full","long","medium","short"]}},required:["code"]}}].map(e=>({...e,parameters:{...e.parameters,additionalProperties:!1}}))})(),module.exports=e})();
|
package/lib/tools.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=[{name:"getAirportByIata",description:'Look up an airport by its 3-letter IATA code (e.g., "LHR" for London Heathrow, "JFK" for New York JFK, "SIN" for Singapore Changi). Returns full airport details including location, timezone, and links.',parameters:{type:"object",properties:{iataCode:{type:"string",description:'3-letter uppercase IATA airport code (e.g., "LHR", "JFK", "SIN")',pattern:"^[A-Za-z]{3}$"}},required:["iataCode"]}},{name:"getAirportByIcao",description:'Look up an airport by its 4-character ICAO code (e.g., "EGLL" for London Heathrow, "KJFK" for New York JFK). Returns full airport details.',parameters:{type:"object",properties:{icaoCode:{type:"string",description:'4-character uppercase ICAO airport code (e.g., "EGLL", "KJFK", "WSSS")',pattern:"^[A-Za-z0-9]{4}$"}},required:["icaoCode"]}},{name:"getAirportByCountryCode",description:'Get all airports in a country by its ISO 3166-1 alpha-2 code (e.g., "US" for United States, "GB" for United Kingdom, "SG" for Singapore).',parameters:{type:"object",properties:{countryCode:{type:"string",description:'2-letter uppercase ISO country code (e.g., "US", "GB", "SG")'}},required:["countryCode"]}},{name:"getAirportByContinent",description:"Get all airports on a continent. Valid codes: AF (Africa), AN (Antarctica), AS (Asia), EU (Europe), NA (North America), OC (Oceania), SA (South America).",parameters:{type:"object",properties:{continentCode:{type:"string",description:"2-letter continent code",enum:["AF","AN","AS","EU","NA","OC","SA"]}},required:["continentCode"]}},{name:"searchByName",description:'Search for airports by name using case-insensitive partial matching. Use this when you have an airport name but not its code (e.g., "Heathrow", "Changi", "Charles de Gaulle").',parameters:{type:"object",properties:{query:{type:"string",description:"Airport name or partial name to search for (2-100 characters)"}},required:["query"]}},{name:"findNearbyAirports",description:"Find all airports within a radius of a geographic point. Useful for finding airports near a city or location.",parameters:{type:"object",properties:{lat:{type:"number",description:"Latitude in decimal degrees (-90 to 90)",minimum:-90,maximum:90},lon:{type:"number",description:"Longitude in decimal degrees (-180 to 180)",minimum:-180,maximum:180},radiusKm:{type:"number",description:"Search radius in kilometers (minimum 1)",minimum:1,default:100},limit:{type:"integer",description:"Optional maximum number of results, nearest first (default: all matching airports)",minimum:1,maximum:1e4}},required:["lat","lon"]}},{name:"getAirportsByType",description:'Filter airports by classification type. Types: "large_airport", "medium_airport", "small_airport", "heliport", "seaplane_base", "closed". Pass "airport" to get all airport types.',parameters:{type:"object",properties:{type:{type:"string",description:"Airport type classification",enum:["large_airport","medium_airport","small_airport","heliport","seaplane_base","closed","airport"]},limit:{type:"integer",description:"Optional maximum number of results (default: all matching airports)",minimum:1,maximum:1e5}},required:["type"]}},{name:"getAutocompleteSuggestions",description:"Get autocomplete suggestions for airports based on partial input. Matches IATA/ICAO codes, city names, metro codes, and airport names, with major airports first. Returns up to 10 results.",parameters:{type:"object",properties:{query:{type:"string",description:"Partial search query (2-100 characters)"}},required:["query"]}},{name:"calculateDistance",description:"Calculate the great-circle (Haversine) distance in kilometers between two airports. Accepts either IATA or ICAO codes.",parameters:{type:"object",properties:{code1:{type:"string",description:"IATA or ICAO code of the first airport"},code2:{type:"string",description:"IATA or ICAO code of the second airport"}},required:["code1","code2"]}},{name:"getAirportLinks",description:"Get external links for an airport including Wikipedia, official website, FlightRadar24, RadarBox, and FlightAware URLs.",parameters:{type:"object",properties:{code:{type:"string",description:"IATA or ICAO code of the airport"}},required:["code"]}},{name:"getAirportsByTimezone",description:'Get all airports in a specific IANA timezone (e.g., "Europe/London", "Asia/Singapore", "America/New_York").',parameters:{type:"object",properties:{timezone:{type:"string",description:'IANA timezone identifier (e.g., "Europe/London")'}},required:["timezone"]}},{name:"findAirports",description:"Advanced multi-criteria airport search. Combine filters with AND logic. Supports country, continent, type, timezone, scheduled service, and minimum runway length filters.",parameters:{type:"object",properties:{country_code:{type:"string",description:"2-letter ISO country code filter"},continent:{type:"string",description:"2-letter continent code filter",enum:["AF","AN","AS","EU","NA","OC","SA"]},type:{type:"string",description:"Airport type filter",enum:["large_airport","medium_airport","small_airport","heliport","seaplane_base","closed"]},has_scheduled_service:{type:"boolean",description:"Filter by scheduled commercial service availability"},min_runway_ft:{type:"number",description:"Minimum runway length in feet"},time:{type:"string",description:"IANA timezone filter"}},required:[]}},{name:"getAirportStatsByCountry",description:"Get aggregated airport statistics for a country: total count, breakdown by type, scheduled service count, average runway length, average elevation, and timezones.",parameters:{type:"object",properties:{countryCode:{type:"string",description:"2-letter uppercase ISO country code"}},required:["countryCode"]}},{name:"getAirportStatsByContinent",description:"Get aggregated airport statistics for a continent: total count, breakdown by type and country, scheduled service count, average runway length, and average elevation.",parameters:{type:"object",properties:{continentCode:{type:"string",description:"2-letter continent code",enum:["AF","AN","AS","EU","NA","OC","SA"]}},required:["continentCode"]}},{name:"getLargestAirportsByContinent",description:"Get the top airports on a continent ranked by runway length or elevation.",parameters:{type:"object",properties:{continentCode:{type:"string",description:"2-letter continent code",enum:["AF","AN","AS","EU","NA","OC","SA"]},limit:{type:"integer",description:"Number of results to return (1-1000)",minimum:1,maximum:1e3,default:10},sortBy:{type:"string",description:"Ranking criteria",enum:["runway","elevation"]}},required:["continentCode"]}},{name:"getMultipleAirports",description:"Fetch multiple airports in a single call by their IATA or ICAO codes. Returns null for unresolved codes. Maximum 500 codes.",parameters:{type:"object",properties:{codes:{type:"array",description:"Array of 2-500 IATA or ICAO codes",items:{type:"string",pattern:"^[A-Za-z0-9]{3,4}$"},minItems:1,maxItems:500}},required:["codes"]}},{name:"calculateDistanceMatrix",description:"Calculate distances between all pairs of airports. Returns a symmetric distance matrix. Maximum 100 codes.",parameters:{type:"object",properties:{codes:{type:"array",description:"Array of 2-100 IATA or ICAO codes",items:{type:"string",pattern:"^[A-Za-z0-9]{3,4}$"},minItems:2,maxItems:100}},required:["codes"]}},{name:"findNearestAirport",description:"Find the single closest airport to a geographic point, optionally filtered by type, country, or other criteria.",parameters:{type:"object",properties:{lat:{type:"number",description:"Latitude in decimal degrees (-90 to 90)",minimum:-90,maximum:90},lon:{type:"number",description:"Longitude in decimal degrees (-180 to 180)",minimum:-180,maximum:180},type:{type:"string",description:"Optional airport type filter",enum:["large_airport","medium_airport","small_airport","heliport","seaplane_base"]},country_code:{type:"string",description:"Optional 2-letter country code filter"}},required:["lat","lon"]}},{name:"validateIataCode",description:"Check whether a 3-letter IATA code exists in the airport database. Returns true/false.",parameters:{type:"object",properties:{code:{type:"string",description:"3-letter IATA code to validate",pattern:"^[A-Za-z]{3}$"}},required:["code"]}},{name:"validateIcaoCode",description:"Check whether a 4-character ICAO code exists in the airport database. Returns true/false.",parameters:{type:"object",properties:{code:{type:"string",description:"4-character ICAO code to validate",pattern:"^[A-Za-z0-9]{4}$"}},required:["code"]}},{name:"getAirportCount",description:"Get the count of airports matching optional filters. Call with no filters for the total number of airports in the database.",parameters:{type:"object",properties:{country_code:{type:"string",description:"Optional country code filter",pattern:"^[A-Za-z]{2}$"},type:{type:"string",description:"Optional airport type filter"},continent:{type:"string",description:"Optional continent code filter"}},required:[]}},{name:"isAirportOperational",description:"Check whether an airport has scheduled commercial service (is operational). Accepts IATA or ICAO code.",parameters:{type:"object",properties:{code:{type:"string",description:"IATA or ICAO code of the airport"}},required:["code"]}},{name:"search",description:'Ranked airport search across codes, cities, and names. Best general-purpose lookup when the user gives a city ("New York", "London"), a metro code ("NYC", "LON"), an airport name ("Heathrow"), or a code. Accent-insensitive and typo-tolerant; major airports with scheduled service rank first. Pass limit/scheduledOnly/country_code as the second (options) argument.',parameters:{type:"object",properties:{query:{type:"string",description:'Search text, 2-100 characters (e.g., "new york", "LON", "heathrow", "Zürich")'},limit:{type:"integer",description:"Maximum number of results (1-100, default 10)",minimum:1,maximum:100},scheduledOnly:{type:"boolean",description:"Only return airports with scheduled commercial service"},country_code:{type:"string",description:'Optional 2-letter ISO country code filter (e.g., "US")',pattern:"^[A-Za-z]{2}$"}},required:["query"]}},{name:"getAirportsByCity",description:'Find airports serving a city by name (case- and accent-insensitive), major airports first. Some airports list their own municipality (e.g., EWR is "Newark"); use getAirportsByCityCode for whole metro areas.',parameters:{type:"object",properties:{city:{type:"string",description:'City name (e.g., "London", "São Paulo", "Tokyo")'}},required:["city"]}},{name:"getAirportsByCityCode",description:'Find all airports in an IATA city/metropolitan area code (e.g., "NYC" for JFK, LGA, EWR; "LON" for LHR, LGW, STN, LTN, LCY; "TYO" for HND, NRT).',parameters:{type:"object",properties:{cityCode:{type:"string",description:'3-letter uppercase IATA city code (e.g., "NYC", "LON", "PAR")'}},required:["cityCode"]}},{name:"getUtcOffset",description:"Get the real UTC offset in hours at an airport for a given moment, accounting for daylight saving time (e.g., JFK is -4 in July and -5 in December). Prefer this over the static utc field.",parameters:{type:"object",properties:{code:{type:"string",description:"IATA or ICAO code of the airport"},date:{type:"string",description:"Optional ISO 8601 date-time (default: now)"}},required:["code"]}},{name:"getLocalTime",description:"Get the current (or a given) local date and time at an airport, with UTC offset and whether daylight saving time is in effect.",parameters:{type:"object",properties:{code:{type:"string",description:"IATA or ICAO code of the airport"},date:{type:"string",description:"Optional ISO 8601 date-time to convert (default: now)"}},required:["code"]}},{name:"formatAirportTime",description:"Format a moment as a human-readable string in the airport's local time zone and a given locale. Pass date/locale/dateStyle/timeStyle as the second (options) argument.",parameters:{type:"object",properties:{code:{type:"string",description:"IATA or ICAO code of the airport"},date:{type:"string",description:"Optional ISO 8601 date-time to format (default: now)"},locale:{type:"string",description:'Optional BCP 47 locale (default: "en-US")'},dateStyle:{type:"string",description:"Optional date style",enum:["full","long","medium","short"]},timeStyle:{type:"string",description:"Optional time style",enum:["full","long","medium","short"]}},required:["code"]}}].map(e=>({...e,parameters:{...e.parameters,additionalProperties:!1}}));export{e as airportTools};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "airport-data-js",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.1",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"description": "A comprehensive TypeScript library providing easy retrieval of airport data based on IATA, ICAO, city codes, country codes, and continents. Includes LLM tool definitions for AI integration.",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -8,40 +8,70 @@
|
|
|
8
8
|
"browser": "dist/airport-data.min.js",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
|
-
"
|
|
12
|
-
|
|
11
|
+
"import": {
|
|
12
|
+
"types": "./types/index.d.mts",
|
|
13
|
+
"default": "./lib/index.mjs"
|
|
14
|
+
},
|
|
15
|
+
"require": {
|
|
16
|
+
"types": "./types/index.d.ts",
|
|
17
|
+
"default": "./lib/index.js"
|
|
18
|
+
},
|
|
13
19
|
"default": "./lib/index.js"
|
|
14
20
|
},
|
|
21
|
+
"./lite": {
|
|
22
|
+
"import": {
|
|
23
|
+
"types": "./types/lite.d.mts",
|
|
24
|
+
"default": "./lib/lite.mjs"
|
|
25
|
+
},
|
|
26
|
+
"require": {
|
|
27
|
+
"types": "./types/lite.d.ts",
|
|
28
|
+
"default": "./lib/lite.js"
|
|
29
|
+
},
|
|
30
|
+
"default": "./lib/lite.js"
|
|
31
|
+
},
|
|
15
32
|
"./tools": {
|
|
16
|
-
"
|
|
17
|
-
|
|
33
|
+
"import": {
|
|
34
|
+
"types": "./types/tools.d.mts",
|
|
35
|
+
"default": "./lib/tools.mjs"
|
|
36
|
+
},
|
|
37
|
+
"require": {
|
|
38
|
+
"types": "./types/tools.d.ts",
|
|
39
|
+
"default": "./lib/tools.js"
|
|
40
|
+
},
|
|
18
41
|
"default": "./lib/tools.js"
|
|
19
|
-
}
|
|
42
|
+
},
|
|
43
|
+
"./package.json": "./package.json"
|
|
20
44
|
},
|
|
21
45
|
"files": [
|
|
22
46
|
"lib/",
|
|
23
|
-
"dist/",
|
|
47
|
+
"dist/airport-data.min.js",
|
|
48
|
+
"dist/airport-data.lite.min.js",
|
|
24
49
|
"types/",
|
|
25
50
|
"LICENSE",
|
|
26
51
|
"README.md"
|
|
27
52
|
],
|
|
28
53
|
"scripts": {
|
|
54
|
+
"pretest": "npm run build",
|
|
29
55
|
"test": "vitest run",
|
|
30
56
|
"typecheck": "tsc --noEmit",
|
|
57
|
+
"typecheck:tests": "tsc -p tsconfig.test.json --noEmit",
|
|
31
58
|
"build:types": "tsc --emitDeclarationOnly",
|
|
32
|
-
"build:transpile": "tsc -p tsconfig.build.json",
|
|
33
|
-
"build:
|
|
59
|
+
"build:transpile": "tsc -p tsconfig.build.json && tsc -p tsconfig.build.esm.json",
|
|
60
|
+
"build:payload": "tsx scripts/build_payload.ts",
|
|
61
|
+
"build:lib": "npm run build:payload && webpack --config webpack.node.cjs",
|
|
34
62
|
"build:dist": "webpack --config webpack.browser.cjs",
|
|
35
63
|
"build:tools": "webpack --config webpack.tools.cjs",
|
|
36
|
-
"
|
|
64
|
+
"clean": "node -e \"for (const dir of ['lib','dist','types','.tsbuild','.tsbuild-esm']) require('node:fs').rmSync(dir,{recursive:true,force:true})\"",
|
|
65
|
+
"build": "npm run clean && npm run build:types && npm run build:esm-types && npm run build:transpile && npm run build:lib && npm run build:dist && npm run build:tools && npm run build:esm",
|
|
37
66
|
"check:duplicates": "tsx scripts/check_duplicates.ts",
|
|
38
67
|
"generate:json": "tsx scripts/csv_to_json.ts",
|
|
39
68
|
"generate:compressed": "tsx scripts/compress_json.ts",
|
|
40
69
|
"benchmark": "tsx scripts/benchmark.ts",
|
|
41
|
-
"changelog:extract": "tsx scripts/extract_latest_changelog.ts"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
70
|
+
"changelog:extract": "tsx scripts/extract_latest_changelog.ts",
|
|
71
|
+
"build:esm": "npm run build:payload && webpack --config webpack.esm.cjs",
|
|
72
|
+
"build:esm-types": "tsx scripts/build_esm_types.ts",
|
|
73
|
+
"refresh:data": "tsx scripts/refresh_ourairports.ts",
|
|
74
|
+
"upgrade:https": "tsx scripts/upgrade_https.ts"
|
|
45
75
|
},
|
|
46
76
|
"repository": {
|
|
47
77
|
"type": "git",
|
|
@@ -70,7 +100,7 @@
|
|
|
70
100
|
"timezones"
|
|
71
101
|
],
|
|
72
102
|
"author": "Aashish Vivekanand",
|
|
73
|
-
"license": "CC
|
|
103
|
+
"license": "CC-BY-4.0",
|
|
74
104
|
"engines": {
|
|
75
105
|
"node": "^22.18.0 || >=24.11.0"
|
|
76
106
|
},
|
|
@@ -88,18 +118,25 @@
|
|
|
88
118
|
"baseline-browser-mapping": "^2.11.0"
|
|
89
119
|
},
|
|
90
120
|
"devDependencies": {
|
|
91
|
-
"@babel/core": "^8.0
|
|
92
|
-
"@babel/
|
|
93
|
-
"@
|
|
94
|
-
"@types/node": "^26.1.1",
|
|
121
|
+
"@babel/core": "^8.1.0",
|
|
122
|
+
"@babel/preset-env": "^8.0.7",
|
|
123
|
+
"@types/node": "^26.6.6",
|
|
95
124
|
"babel-loader": "^10.1.1",
|
|
96
|
-
"csv-parse": "^7.0.
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"tsx": "^4.23.13",
|
|
125
|
+
"csv-parse": "^7.0.3",
|
|
126
|
+
"pako": "^3.0.3",
|
|
127
|
+
"tsx": "^4.23.15",
|
|
100
128
|
"typescript": "^7.0.2",
|
|
101
|
-
"vitest": "^5.
|
|
102
|
-
"webpack": "^5.
|
|
103
|
-
"webpack-cli": "^7.
|
|
104
|
-
}
|
|
129
|
+
"vitest": "^5.1.0",
|
|
130
|
+
"webpack": "^5.112.2",
|
|
131
|
+
"webpack-cli": "^7.3.1"
|
|
132
|
+
},
|
|
133
|
+
"module": "lib/index.mjs",
|
|
134
|
+
"sideEffects": [
|
|
135
|
+
"./lib/index.js",
|
|
136
|
+
"./lib/index.mjs",
|
|
137
|
+
"./lib/lite.js",
|
|
138
|
+
"./lib/lite.mjs",
|
|
139
|
+
"./dist/airport-data.min.js",
|
|
140
|
+
"./dist/airport-data.lite.min.js"
|
|
141
|
+
]
|
|
105
142
|
}
|