import { APIResource } from "../../../core/resource.mjs"; import { APIPromise } from "../../../core/api-promise.mjs"; import { RequestOptions } from "../../../internal/request-options.mjs"; export declare class Search extends APIResource { /** * Returns currently or recently airborne flights based on geospatial search * parameters. If available, flights' predicted OOOI fields will be set. * * @example * ```ts * const response = * await client.foresight.flights.search.advanced(); * ``` */ advanced(query?: SearchAdvancedParams | null | undefined, options?: RequestOptions): APIPromise; } export interface SearchAdvancedResponse { flights: Array; /** * Object containing links to related resources. */ links: SearchAdvancedResponse.Links | null; /** * Number of pages returned */ num_pages: number; } export declare namespace SearchAdvancedResponse { interface Flight { /** * Actual runway departure time. */ actual_off: string | null; /** * Actual runway arrival time. */ actual_on: string | null; /** * Aircraft type will generally be ICAO code, but IATA code will be given when the * ICAO code is not known. */ aircraft_type: string | null; /** * List of 4 coordinates representing the edges of a box that entirely contains * this flight's positions. The order of the coordinates are the top, left, bottom, * and right sides of the box. */ bounding_box: Array | null; /** * Information for this flight's destination airport. */ destination: Flight.Destination | null; /** * Unique identifier assigned by FlightAware for this specific flight. If the * flight is diverted, the new leg of the flight will have a duplicate * fa_flight_id. */ fa_flight_id: string; /** * Timestamp of when the first position for this flight was received. */ first_position_time: string | null; /** * Indicates if Foresight predictions are available for AeroAPI /foresight * endpoints. */ foresight_predictions_available: boolean; /** * Either the operator code followed by the flight number for the flight (for * commercial flights) or the aircraft's registration (for general aviation). */ ident: string; /** * A one or two character identifier prefix code (Common values: G or GG Medevac, L * Lifeguard, A Air Taxi, H Heavy, M Medium). */ ident_prefix: string | null; /** * Most recent position received for this flight. */ last_position: Flight.LastPosition | null; /** * Information for this flight's origin airport. */ origin: Flight.Origin | null; /** * Predicted time of gate arrival event. Only available from /foresight endpoints. */ predicted_in: string | null; /** * Source indicator of the predicted time of the gate arrival event. Only available * from /foresight endpoints. */ predicted_in_source: 'Foresight' | 'Historical Average' | null; /** * Predicted time of runway departure event. Only available from /foresight * endpoints. */ predicted_off: string | null; /** * Source indicator of the predicted time of the runway departure event. Only * available from /foresight endpoints. */ predicted_off_source: 'Foresight' | 'Historical Average' | null; /** * Predicted time of runway arrival event. Only available from /foresight * endpoints. */ predicted_on: string | null; /** * Source indicator of the predicted time of the runway arrival event. Only * available from /foresight endpoints. */ predicted_on_source: 'Foresight' | 'Historical Average' | null; /** * Predicted time of gate departure event. Only available from /foresight * endpoints. */ predicted_out: string | null; /** * Source indicator of the predicted time of the gate departure event. Only * available from /foresight endpoints. */ predicted_out_source: 'Foresight' | 'Historical Average' | null; /** * Predicted duration in seconds of gate departure event. Only available from * /foresight endpoints. */ predicted_taxi_out_duration: number | null; /** * Source indicator of the predicted duration of the gate departure event. Only * available from /foresight endpoints. */ predicted_taxi_out_duration_source: 'Foresight' | null; /** * Route waypoints as an array of alternating latitudes and longitudes. */ waypoints: Array; /** * The IATA operator code followed by the flight number for the flight (for * commercial flights) */ ident_iata?: string | null; /** * The ICAO operator code followed by the flight number for the flight (for * commercial flights) */ ident_icao?: string | null; /** * Aircraft registration (tail number) of the aircraft, when known. This field is * not populated by the `/flights/search`, `flights/{id}/position` and * `/foresight/flights/{id}/position` endpoints. */ registration?: string | null; } namespace Flight { /** * Information for this flight's destination airport. */ interface Destination { /** * The URL to more information about the airport. Will be null for position-only * flights. */ airport_info_url: string | null; /** * ICAO/IATA/LID code or string indicating the location where tracking of the * flight began/ended for position-only flights. */ code: string | null; /** * Closest city to the airport */ city?: string | null; /** * IATA code */ code_iata?: string | null; /** * ICAO code */ code_icao?: string | null; /** * LID code */ code_lid?: string | null; /** * Common name of airport */ name?: string | null; /** * Applicable timezone for the airport, in the TZ database format */ timezone?: string | null; } /** * Most recent position received for this flight. */ interface LastPosition { /** * Aircraft altitude in hundreds of feet */ altitude: number; /** * C when the aircraft is climbing, D when descending, and - when the altitude is * being maintained. */ altitude_change: 'C' | 'D' | '-'; /** * Unique identifier assigned by FlightAware to the flight with this position. This * field is only populated by the `/flights/search/positions` (in other cases, the * user will have already specified the fa_flight_id). */ fa_flight_id: string | null; /** * Most recent groundspeed (knots) */ groundspeed: number; /** * Aircraft heading in degrees (0-360) */ heading: number | null; /** * Most recent latitude position */ latitude: number; /** * Most recent longitude position */ longitude: number; /** * Time that position was received */ timestamp: string; /** * P=projected, O=oceanic, Z=radar, A=ADS-B, M=multilateration, D=datalink, * X=surface and near surface (ADS-B and ASDE-X), S=space-based */ update_type: 'P' | 'O' | 'Z' | 'A' | 'M' | 'D' | 'X' | 'S' | null; } /** * Information for this flight's origin airport. */ interface Origin { /** * The URL to more information about the airport. Will be null for position-only * flights. */ airport_info_url: string | null; /** * ICAO/IATA/LID code or string indicating the location where tracking of the * flight began/ended for position-only flights. */ code: string | null; /** * Closest city to the airport */ city?: string | null; /** * IATA code */ code_iata?: string | null; /** * ICAO code */ code_icao?: string | null; /** * LID code */ code_lid?: string | null; /** * Common name of airport */ name?: string | null; /** * Applicable timezone for the airport, in the TZ database format */ timezone?: string | null; } } /** * Object containing links to related resources. */ interface Links { /** * A link to the next set of records in a collection. */ next: string; } } export interface SearchAdvancedParams { /** * Opaque value used to get the next batch of data from a paged collection. */ cursor?: string; /** * Maximum number of pages to fetch. This is an upper limit and not a guarantee of * how many pages will be returned. */ max_pages?: number; /** * Query to search for airborne or recently arrived flights. It should not exceed * 1000 bytes in length. Search criteria is only applied to the most recent * position for a flight. This function only searches flights within approximately * the last 24 hours. The supported operators include (note that operators take * different numbers of arguments): * * - false - results must have the specified boolean key set to a value of false. * Example: {false arrived} * - true - results must have the specified boolean key set to a value of true. * Example: {true lifeguard} * - null - results must have the specified key set to a null value. Example: {null * waypoints} * - notnull - results must have the specified key not set to a null value. * Example: {notnull aircraftType} * - = - results must have a key that exactly matches the specified value. Example: * {= aircraftType C172} * - != - results must have a key that must not match the specified value. Example: * {!= prefix H} * - < - results must have a key that is lexicographically less-than a specified * value. Example: {< arrivalTime 1276811040} * - \> - results must have a key that is lexicographically greater-than a * specified value. Example: {> speed 500} * - <= - results must have a key that is lexicographically less-than-or-equal-to a * specified value. Example: {<= alt 8000} * - \>= - results must have a key that is lexicographically * greater-than-or-equal-to a specified value. * - match - results must have a key that matches against a case-insensitive * wildcard pattern. Example: {match ident AAL\*} * - notmatch - results must have a key that does not match against a * case-insensitive wildcard pattern. Example: {notmatch aircraftType B76\*} * - range - results must have a key that is numerically between the two specified * values. Example: {range alt 8000 20000} * - in - results must have a key that exactly matches one of the specified values. * Example: {in orig {KLAX KBUR KSNA KLGB}} * - orig_or_dest - results must have either the origin or destination key exactly * match one of the specified values. Example: {orig_or_dest {KLAX KBUR KSNA * KLGB}} * - airline - results will only include airline flight if the argument is 1, or * will only include GA flights if the argument is 0. Example: {airline 1} * - aircraftType - results must have an aircraftType key that matches one of the * specified case-insensitive wildcard patterns. Example: {aircraftType {B76* * B77*}} * - ident - results must have an ident key that matches one of the specified * case-insensitive wildcard patterns. Example: {ident {N123* N456* AAL* UAL*}} * - ident_or_reg - results must have an ident key or was known to be operated by * an aircraft registration that matches one of the specified case-insensitive * wildcard patterns. Example: {ident_or_reg {N123* N456* AAL* UAL*}} * * The supported key names include (note that not all of these key names are * returned in the result structure, and some have slightly different names): * * - actualDepartureTime - Actual time of departure, or null if not departed yet. * UNIX epoch timestamp seconds since 1970 * - aircraftType - aircraft type ID (for example: B763) * - alt - altitude at last reported position (hundreds of feet or Flight Level) * - altChange - altitude change indication (for example: "C" if climbing, "D" if * descending, and empty if it is level) * - arrivalTime - Actual time of arrival, or null if not arrived yet. UNIX epoch * timestamp seconds since 1970 * - arrived - true if the flight has arrived at its destination. * - cancelled - true if the flight has been cancelled. The meaning of cancellation * is that the flight is no longer being tracked by FlightAware. There are a * number of reasons a flight may be cancelled including cancellation by the * airline, but that will not always be the case. * - cdt - Controlled Departure Time, set if there is a ground hold on the flight. * UNIX epoch timestamp seconds since 1970 * - clock - Time of last received position. UNIX epoch timestamp seconds since * 1970 * - cta - Controlled Time of Arrival, set if there is a ground hold on the flight. * UNIX epoch timestamp seconds since 1970 * - dest - ICAO airport code of destination (for example: KLAX) * - edt - Estimated Departure Time. Epoch timestamp seconds since 1970 * - eta - Estimated Time of Arrival. Epoch timestamp seconds since 1970 * - fdt - Field Departure Time. UNIX epoch timestamp seconds since 1970 * - firstPositionTime - Time when first reported position was received, or 0 if no * position has been received yet. Epoch timestamp seconds since 1970 * - fixes - intersections and/or VORs along the route (for example: SLS AMERO * ARTOM VODIR NOTOS ULAPA ACA NUXCO OLULA PERAS ALIPO UPN GDL KEDMA BRISA CUL * PERTI CEN PPE ALTAR ASUTA JLI RONLD LAADY WYVIL OLDEE RAL PDZ ARNES BASET * WELLZ CIVET) * - fp - unique identifier assigned by FlightAware for this flight, aka * fa_flight_id. * - gs - ground speed at last reported position, in kts. * - heading - direction of travel at last reported position. * - hiLat - highest latitude travelled by flight. * - hiLon - highest longitude travelled by flight. * - ident - flight identifier or registration of aircraft. * - lastPositionTime - Time when last reported position was received, or 0 if no * position has been received yet. Epoch timestamp seconds since 1970. * - lat - latitude of last reported position. * - lifeguard - true if a "lifeguard" rescue flight. * - lon - longitude of last reported position. * - lowLat - lowest latitude travelled by flight. * - lowLon - lowest longitude travelled by flight. * - ogta - Original Time of Arrival. UNIX epoch timestamp seconds since 1970 * - ogtd - Original Time of Departure. UNIX epoch timestamp seconds since 1970 * - orig - ICAO airport code of origin (for example: KIAH) * - physClass - physical class (for example: J is jet) * - prefix - A one or two character identifier prefix code (common values: G or GG * Medevac, L Lifeguard, A Air Taxi, H Heavy, M Medium). * - speed - ground speed, in kts. * - status - Single letter code for current flight status, can be S Scheduled, F * Filed, A Active, Z Completed, or X Cancelled. * - updateType - data source of last position (P=projected, O=oceanic, Z=radar, * A=ADS-B, M=multilateration, D=datalink, X=surface and near surface (ADS-B and * ASDE-X), S=space-based). * - waypoints - all of the intersections and VORs comprising the route */ query?: string; } export declare namespace Search { export { type SearchAdvancedResponse as SearchAdvancedResponse, type SearchAdvancedParams as SearchAdvancedParams, }; } //# sourceMappingURL=search.d.mts.map