fshub-api 4.0.2 → 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.
Files changed (128) hide show
  1. package/dist/api/airline/Airline_getAllRoutes.d.ts +3 -0
  2. package/dist/api/airline/Airline_getAllRoutes.d.ts.map +1 -0
  3. package/dist/api/airline/Airline_getAllRoutes.js +57 -0
  4. package/dist/api/airline/Airline_getAllRoutes.js.map +1 -0
  5. package/dist/api/airline/index.d.ts +2 -0
  6. package/dist/api/airline/index.d.ts.map +1 -1
  7. package/dist/api/airline/index.js +2 -0
  8. package/dist/api/airline/index.js.map +1 -1
  9. package/dist/api/airport/Airport_findByICAO.d.ts +3 -0
  10. package/dist/api/airport/Airport_findByICAO.d.ts.map +1 -0
  11. package/dist/api/airport/Airport_findByICAO.js +57 -0
  12. package/dist/api/airport/Airport_findByICAO.js.map +1 -0
  13. package/dist/api/airport/Airport_findMETAR.d.ts +3 -0
  14. package/dist/api/airport/Airport_findMETAR.d.ts.map +1 -0
  15. package/dist/api/airport/Airport_findMETAR.js +57 -0
  16. package/dist/api/airport/Airport_findMETAR.js.map +1 -0
  17. package/dist/api/airport/index.d.ts +7 -0
  18. package/dist/api/airport/index.d.ts.map +1 -0
  19. package/dist/api/airport/index.js +13 -0
  20. package/dist/api/airport/index.js.map +1 -0
  21. package/dist/api/index.d.ts +5 -0
  22. package/dist/api/index.d.ts.map +1 -1
  23. package/dist/api/index.js +3 -1
  24. package/dist/api/index.js.map +1 -1
  25. package/dist/index.d.ts +34 -31
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +33 -0
  28. package/dist/index.js.map +1 -1
  29. package/dist/types/Airline.d.ts +25 -0
  30. package/dist/types/Airline.d.ts.map +1 -0
  31. package/dist/types/Airline.js +3 -0
  32. package/dist/types/Airline.js.map +1 -0
  33. package/dist/types/AirlineRoute.d.ts +53 -0
  34. package/dist/types/AirlineRoute.d.ts.map +1 -0
  35. package/dist/types/AirlineRoute.js +3 -0
  36. package/dist/types/AirlineRoute.js.map +1 -0
  37. package/dist/types/Airport.d.ts +50 -0
  38. package/dist/types/Airport.d.ts.map +1 -0
  39. package/dist/types/Airport.js +3 -0
  40. package/dist/types/Airport.js.map +1 -0
  41. package/dist/types/AirportMETARReport.d.ts +13 -0
  42. package/dist/types/AirportMETARReport.d.ts.map +1 -0
  43. package/dist/types/AirportMETARReport.js +3 -0
  44. package/dist/types/AirportMETARReport.js.map +1 -0
  45. package/dist/types/Common.d.ts +16 -0
  46. package/dist/types/Common.d.ts.map +1 -0
  47. package/dist/types/Common.js +3 -0
  48. package/dist/types/Common.js.map +1 -0
  49. package/dist/types/Config.d.ts +7 -0
  50. package/dist/types/Config.d.ts.map +1 -0
  51. package/dist/types/Config.js +3 -0
  52. package/dist/types/Config.js.map +1 -0
  53. package/dist/types/FSHubAirline.d.ts +65 -0
  54. package/dist/types/FSHubAirline.d.ts.map +1 -0
  55. package/dist/types/FSHubAirline.js +3 -0
  56. package/dist/types/FSHubAirline.js.map +1 -0
  57. package/dist/types/FSHubApi.d.ts +56 -0
  58. package/dist/types/FSHubApi.d.ts.map +1 -0
  59. package/dist/types/FSHubApi.js +3 -0
  60. package/dist/types/FSHubApi.js.map +1 -0
  61. package/dist/types/FSHubApplication.d.ts +8 -0
  62. package/dist/types/FSHubApplication.d.ts.map +1 -0
  63. package/dist/types/FSHubApplication.js +3 -0
  64. package/dist/types/FSHubApplication.js.map +1 -0
  65. package/dist/types/FSHubError.d.ts +9 -0
  66. package/dist/types/FSHubError.d.ts.map +1 -0
  67. package/dist/types/FSHubError.js +3 -0
  68. package/dist/types/FSHubError.js.map +1 -0
  69. package/dist/types/FSHubPilotPointPurchase.d.ts +10 -0
  70. package/dist/types/FSHubPilotPointPurchase.d.ts.map +1 -0
  71. package/dist/types/FSHubPilotPointPurchase.js +3 -0
  72. package/dist/types/FSHubPilotPointPurchase.js.map +1 -0
  73. package/dist/types/FSHubRequestOptions.d.ts +5 -0
  74. package/dist/types/FSHubRequestOptions.d.ts.map +1 -0
  75. package/dist/types/FSHubRequestOptions.js +3 -0
  76. package/dist/types/FSHubRequestOptions.js.map +1 -0
  77. package/dist/types/FSHubResponse.d.ts +12 -0
  78. package/dist/types/FSHubResponse.d.ts.map +1 -0
  79. package/dist/types/FSHubResponse.js +3 -0
  80. package/dist/types/FSHubResponse.js.map +1 -0
  81. package/dist/types/Flight.d.ts +77 -0
  82. package/dist/types/Flight.d.ts.map +1 -0
  83. package/dist/types/Flight.js +3 -0
  84. package/dist/types/Flight.js.map +1 -0
  85. package/dist/types/Pilot.d.ts +20 -0
  86. package/dist/types/Pilot.d.ts.map +1 -0
  87. package/dist/types/Pilot.js +3 -0
  88. package/dist/types/Pilot.js.map +1 -0
  89. package/dist/types/Screenshot.d.ts +14 -0
  90. package/dist/types/Screenshot.d.ts.map +1 -0
  91. package/dist/types/Screenshot.js +3 -0
  92. package/dist/types/Screenshot.js.map +1 -0
  93. package/dist/types/Stats.d.ts +21 -0
  94. package/dist/types/Stats.d.ts.map +1 -0
  95. package/dist/types/Stats.js +3 -0
  96. package/dist/types/Stats.js.map +1 -0
  97. package/dist/types/index.d.ts +20 -305
  98. package/dist/types/index.d.ts.map +1 -1
  99. package/dist/types/index.js +5 -0
  100. package/dist/types/index.js.map +1 -1
  101. package/package.json +56 -56
  102. package/src/api/airline/Airline_getAllRoutes.ts +8 -0
  103. package/src/api/airline/index.ts +2 -0
  104. package/src/api/airport/Airport_findByICAO.ts +9 -0
  105. package/src/api/airport/Airport_findMETAR.ts +9 -0
  106. package/src/api/airport/index.ts +7 -0
  107. package/src/api/index.ts +3 -1
  108. package/src/index.spec.ts +33 -2
  109. package/src/index.ts +18 -2
  110. package/src/types/Airline.ts +26 -0
  111. package/src/types/AirlineRoute.ts +60 -0
  112. package/src/types/Airport.ts +56 -0
  113. package/src/types/AirportMETARReport.ts +14 -0
  114. package/src/types/Common.ts +17 -0
  115. package/src/types/Config.ts +6 -0
  116. package/src/types/FSHubAirline.ts +73 -0
  117. package/src/types/FSHubApi.ts +56 -0
  118. package/src/types/FSHubApplication.ts +8 -0
  119. package/src/types/FSHubError.ts +8 -0
  120. package/src/types/FSHubPilotPointPurchase.ts +10 -0
  121. package/src/types/FSHubRequestOptions.ts +4 -0
  122. package/src/types/FSHubResponse.ts +11 -0
  123. package/src/types/Flight.ts +88 -0
  124. package/src/types/Pilot.ts +21 -0
  125. package/src/types/Screenshot.ts +15 -0
  126. package/src/types/Stats.ts +23 -0
  127. package/src/types/index.ts +65 -348
  128. package/workspace.code-workspace +10 -0
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import axios, { AxiosInstance } from 'axios';
2
- import type{ Config, FSHubApi, FSHubPilotPointPurchaseTransactionData, FSHubPilotSetRankData, FSHubRequestOptions } from './types';
2
+ import type{ Airport, Config, FSHubApi, FSHubPilotPointPurchaseTransactionData, FSHubPilotSetRankData, FSHubRequestOptions, FSHubResponse } from './types';
3
3
  import { Api } from './api';
4
4
  export * from './types';
5
5
 
@@ -52,10 +52,14 @@ export default class FSHubApiClass implements FSHubApi {
52
52
  this.Airline_pilotSetRank = this.Airline_pilotSetRank.bind(this);
53
53
  this.Airline_getAllRanks = this.Airline_getAllRanks.bind(this);
54
54
  this.Airline_getAllRoles = this.Airline_getAllRoles.bind(this);
55
-
55
+ this.Airline_getAllRoutes = this.Airline_getAllRoutes.bind(this);
56
+
56
57
  this.Flight_getFlightById = this.Flight_getFlightById.bind(this);
57
58
  this.Flight_getFlightScreenshotsById = this.Flight_getFlightScreenshotsById.bind(this);
58
59
  this.Flight_getFlights = this.Flight_getFlights.bind(this);
60
+
61
+ this.Airport_findByICAO = this.Airport_findByICAO.bind(this);
62
+ this.Airport_findMETAR = this.Airport_findMETAR.bind(this);
59
63
  }
60
64
 
61
65
  public async Pilot_getCurrent() {
@@ -166,6 +170,10 @@ export default class FSHubApiClass implements FSHubApi {
166
170
  return await Api.airline.getAllRoles(airlineId, this);
167
171
  }
168
172
 
173
+ public async Airline_getAllRoutes(airlineId: number) {
174
+ return await Api.airline.getAllRoutes(airlineId, this);
175
+ }
176
+
169
177
  public async Flight_getFlightById(id: number) {
170
178
  return await Api.flight.getFlightById(id, this);
171
179
  }
@@ -177,4 +185,12 @@ export default class FSHubApiClass implements FSHubApi {
177
185
  public async Flight_getFlights(options?: FSHubRequestOptions) {
178
186
  return await Api.flight.getFlights(this, options);
179
187
  }
188
+
189
+ public async Airport_findByICAO(icao: string): Promise<FSHubResponse<Airport>> {
190
+ return await Api.airport.findByICAO(icao, this);
191
+ }
192
+
193
+ public async Airport_findMETAR(icao: string) {
194
+ return await Api.airport.findMETAR(icao, this);
195
+ }
180
196
  }
@@ -0,0 +1,26 @@
1
+ import { Gps, Handles, Link } from './Common';
2
+
3
+ export type Owner = {
4
+ id: number
5
+ name: string
6
+ bio: any
7
+ handles: Handles
8
+ base: string
9
+ locale: string
10
+ gps: Gps
11
+ timezone: string
12
+ country: string
13
+ is_online: boolean
14
+ online_at: string
15
+ created_at: string
16
+ links: Link[]
17
+ }
18
+
19
+ export type Airline = {
20
+ id: number
21
+ name: string
22
+ abbr: string
23
+ owner: Owner
24
+ handles: Handles
25
+ links: Link[]
26
+ }
@@ -0,0 +1,60 @@
1
+ export type AirlineRoute = {
2
+ id: number
3
+ name: string
4
+ airport: AirlineRouteAirport
5
+ routing: string
6
+ dist_nm: number
7
+ log: AirlineRouteLog[]
8
+ waypoints_ignored: string
9
+ notes: string
10
+ points: number
11
+ enabled: boolean
12
+ created_at: string
13
+ updated_at: string
14
+ links: AirlineRouteLink[]
15
+ }
16
+
17
+ export type AirlineRouteAirport = {
18
+ departure: AirlineRouteDepartureAirport
19
+ arrival: AirlineRouteArrivalAirport
20
+ }
21
+
22
+ export type AirlineRouteDepartureAirport = {
23
+ icao: string
24
+ iata: string
25
+ name: string
26
+ locale: AirlineRouteLocale
27
+ }
28
+
29
+ export type AirlineRouteLocale = {
30
+ city: string
31
+ state: any
32
+ country: string
33
+ gps: AirlineRouteGps
34
+ }
35
+
36
+ export type AirlineRouteGps = {
37
+ lat: number
38
+ lng: number
39
+ }
40
+
41
+ export type AirlineRouteArrivalAirport = {
42
+ icao: string
43
+ iata: string
44
+ name: string
45
+ locale: AirlineRouteLocale
46
+ }
47
+
48
+ export type AirlineRouteLog = {
49
+ ident: string
50
+ freq?: string
51
+ dist: number
52
+ coords: string
53
+ remarks: string
54
+ }
55
+
56
+ export type AirlineRouteLink = {
57
+ rel: string
58
+ uri: string
59
+ }
60
+
@@ -0,0 +1,56 @@
1
+ export type Airport = {
2
+ icao: string
3
+ iata: string
4
+ name: string
5
+ locale: AirportLocale
6
+ geo: AirportGeo
7
+ alt: number
8
+ mag_var: number
9
+ frequencies: AirportFrequencies
10
+ runways: AirportRunway[]
11
+ links: AirportLink[]
12
+ }
13
+
14
+ export type AirportLocale = {
15
+ city: string
16
+ state: string
17
+ county: string
18
+ }
19
+
20
+ export type AirportGeo = {
21
+ lat: number
22
+ lng: number
23
+ }
24
+
25
+ export type AirportFrequencies = {
26
+ atis: string
27
+ cd: string
28
+ gnd: string
29
+ tower: string
30
+ unicom: string
31
+ multicom: any
32
+ app: string
33
+ dep: string
34
+ }
35
+
36
+ export type AirportRunway = {
37
+ name: string
38
+ type: string
39
+ length: number
40
+ hdg: number
41
+ geo: AirportGeo
42
+ ils: AirportIls
43
+ }
44
+
45
+ export type AirportIls = {
46
+ id?: string
47
+ frequency?: string
48
+ hdg?: number
49
+ slope?: number
50
+ }
51
+
52
+ export type AirportLink = {
53
+ rel: string
54
+ uri: string
55
+ }
56
+
@@ -0,0 +1,14 @@
1
+ import { Link } from "./Common"
2
+
3
+ export type AirportMETARReport = {
4
+ icao: string
5
+ iata: string
6
+ name: string
7
+ metar: AirportMETAR
8
+ links: Link[]
9
+ }
10
+
11
+ export type AirportMETAR = {
12
+ error: boolean
13
+ report: string
14
+ }
@@ -0,0 +1,17 @@
1
+ export type Link = {
2
+ rel: string
3
+ uri: string
4
+ }
5
+
6
+ export type Gps = {
7
+ lat: number
8
+ lng: number
9
+ }
10
+
11
+ export type Handles = {
12
+ facebook: any
13
+ twitter: string
14
+ website: any
15
+ vatsim: string
16
+ ivao: string
17
+ }
@@ -0,0 +1,6 @@
1
+ export type Config = {
2
+ baseURL?: string;
3
+ apiKey?: string;
4
+ timeout?: number;
5
+ headers?: Record<string, string>;
6
+ };
@@ -0,0 +1,73 @@
1
+ export type FSHubAirlineRole = {
2
+ id: number;
3
+ name: string;
4
+ created_at: string;
5
+ updated_at: string;
6
+ }
7
+
8
+ export type FSHubAirlineRank = {
9
+ id: number;
10
+ name: string;
11
+ abbreviation: string;
12
+ min_hours: number;
13
+ created_at: string;
14
+ updated_at: string;
15
+ }
16
+
17
+ export type FSHubAirlinePilotStatsRoles = {
18
+ [key: string]: any; // TODO: Add proper type
19
+ }
20
+
21
+ export type FSHubAirlinePilotStatsUserProfile = {
22
+ avatar_url: string
23
+ bio: string
24
+ }
25
+
26
+ export type FSHubAirlinePilotStatsUserLocations = {
27
+ base: string
28
+ locale: string
29
+ }
30
+
31
+ export type FSHubAirlinePilotStatsUserHandles = {
32
+ website: any
33
+ twitter: any
34
+ facebook: any
35
+ vatsim: any
36
+ ivao: any
37
+ }
38
+
39
+ export type FSHubAirlinePilotStatsUser = {
40
+ id: number
41
+ name: string
42
+ email: string
43
+ profile: FSHubAirlinePilotStatsUserProfile
44
+ locations: FSHubAirlinePilotStatsUserLocations
45
+ handles: FSHubAirlinePilotStatsUserHandles
46
+ timezone: string
47
+ country: string
48
+ }
49
+
50
+ export type FSHubAirlinePilotStatsRank = {
51
+ id: number
52
+ name: string
53
+ abbreviation: string
54
+ min_hours: number
55
+ created_at: string
56
+ updated_at: string
57
+ }
58
+
59
+ export type FSHubAirlinePilotStatsLink = {
60
+ rel: string
61
+ uri: string
62
+ }
63
+
64
+ export type FSHubAirlinePilotStats = {
65
+ user: FSHubAirlinePilotStatsUser
66
+ points: number
67
+ carry_hours: number
68
+ rank: FSHubAirlinePilotStatsRank
69
+ roles: FSHubAirlinePilotStatsRoles[]
70
+ hired_at: string
71
+ discord_id: number
72
+ links: FSHubAirlinePilotStatsLink[]
73
+ }
@@ -0,0 +1,56 @@
1
+ import { AxiosInstance } from 'axios';
2
+ import { Pilot } from './Pilot';
3
+ import { CurrentPilot } from './Pilot';
4
+ import { Flight } from './Flight';
5
+ import { Airline } from './Airline';
6
+ import { PilotStats } from './Stats';
7
+ import { AirlineStats } from './Stats';
8
+ import { Screenshot } from './Screenshot';
9
+ import { FSHubRequestOptions } from './FSHubRequestOptions';
10
+ import { FSHubResponse } from './FSHubResponse';
11
+ import { FSHubApplicationResponse } from './FSHubApplication';
12
+ import { FSHubPilotPointPurchaseTransactionData, FSHubPilotPointPurchaseTransactionResponse } from './FSHubPilotPointPurchase';
13
+ import { FSHubPilotSetRankData } from './FSHubApplication';
14
+ import { FSHubAirlineRank } from './FSHubAirline';
15
+ import { FSHubAirlineRole } from './FSHubAirline';
16
+ import { FSHubAirlinePilotStats } from './FSHubAirline';
17
+ import { AirportMETARReport } from './AirportMETARReport';
18
+ import { Airport } from './Airport';
19
+ import { AirlineRoute } from './AirlineRoute';
20
+
21
+ export type FSHubApi = {
22
+ axios: AxiosInstance
23
+ Pilot_getCurrent: () => Promise<FSHubResponse<CurrentPilot>>
24
+ Pilot_getAll: () => Promise<FSHubResponse<Pilot[]>>
25
+ Pilot_get: (id: number) => Promise<FSHubResponse<Pilot>>
26
+ Pilot_getLatestFlight: (id: number) => Promise<FSHubResponse<Flight>>
27
+ Pilot_getAllFlights: (id: number) => Promise<FSHubResponse<Flight[]>>
28
+ Pilot_getAllAirlines: (id: number) => Promise<FSHubResponse<Airline[]>>
29
+ Pilot_getStats: (id: number) => Promise<FSHubResponse<PilotStats>>
30
+ Pilot_getAllFlightsDepartures:(id:number, airportCode:string) => Promise<FSHubResponse<Flight[]>>
31
+ Pilot_getAllFlightsArrivals:(id:number, airportCode:string) => Promise<FSHubResponse<Flight[]>>
32
+ Pilot_getAllFlightDeparturesAndArrivals:(id:number, departureAirportCode:string, arrivalAirportCode:string) => Promise<FSHubResponse<Flight[]>>
33
+ Pilot_getAllScreenshots: (id: number) => Promise<FSHubResponse<Screenshot[]>>
34
+ Airline_getAll: () => Promise<FSHubResponse<Airline[]>>
35
+ Airline_get: (id: number) => Promise<FSHubResponse<Airline>>
36
+ Airline_getPilots: (id: number) => Promise<FSHubResponse<Pilot[]>>
37
+ Airline_getPilotStats: (id: number, pilotId: number) => Promise<FSHubResponse<FSHubAirlinePilotStats>>
38
+ Airline_getFlights: (id: number) => Promise<FSHubResponse<Flight[]>>
39
+ Airline_getAllFlightsDepartures:(id:number, airportCode:string) => Promise<FSHubResponse<Flight[]>>
40
+ Airline_getAllFlightsArrivals:(id:number, airportCode:string) => Promise<FSHubResponse<Flight[]>>
41
+ Airline_getAllFlightDeparturesAndArrivals:(id:number, departureAirportCode:string, arrivalAirportCode:string) => Promise<FSHubResponse<Flight[]>>
42
+ Airline_getAllScreenshots: (id: number) => Promise<FSHubResponse<Screenshot[]>>
43
+ Airline_getStats: (id: number) => Promise<FSHubResponse<AirlineStats>>
44
+ Airline_approveApplication: (pilotId: number, airlineId: number) => Promise<FSHubResponse<FSHubApplicationResponse>>
45
+ Airline_rejectApplication: (pilotId: number, airlineId: number) => Promise<FSHubResponse<FSHubApplicationResponse>>
46
+ Airline_pilotPointPurchase: (pilotId: number, airlineId: number, data: FSHubPilotPointPurchaseTransactionData) => Promise<FSHubResponse<FSHubPilotPointPurchaseTransactionResponse>>
47
+ Airline_pilotSetRank: (pilotId: number, airlineId: number, data: FSHubPilotSetRankData) => Promise<FSHubResponse<FSHubApplicationResponse>>
48
+ Airline_getAllRanks: (airlineId: number) => Promise<FSHubResponse<FSHubAirlineRank[]>>
49
+ Airline_getAllRoles: (airlineId: number) => Promise<FSHubResponse<FSHubAirlineRole[]>>
50
+ Airline_getAllRoutes: (airlineId: number) => Promise<FSHubResponse<AirlineRoute[]>>
51
+ Flight_getFlightById: (id: number) => Promise<FSHubResponse<Flight>>
52
+ Flight_getFlightScreenshotsById: (id: number) => Promise<FSHubResponse<Screenshot[]>>
53
+ Flight_getFlights: (options?: FSHubRequestOptions) => Promise<FSHubResponse<Flight[]>>
54
+ Airport_findByICAO: (icao: string) => Promise<FSHubResponse<Airport>>
55
+ Airport_findMETAR: (icao: string) => Promise<FSHubResponse<AirportMETARReport>>
56
+ }
@@ -0,0 +1,8 @@
1
+ export type FSHubApplicationResponse = {
2
+ successful: boolean;
3
+ message: string;
4
+ }
5
+
6
+ export type FSHubPilotSetRankData = {
7
+ rank_id: number;
8
+ }
@@ -0,0 +1,8 @@
1
+ export type FSHubError = {
2
+ message: string
3
+ code: number
4
+ error?: boolean
5
+ details?: {
6
+ pilot: number
7
+ }
8
+ }
@@ -0,0 +1,10 @@
1
+ export type FSHubPilotPointPurchaseTransactionData = {
2
+ amount: number;
3
+ summary: string;
4
+ }
5
+
6
+ export type FSHubPilotPointPurchaseTransactionResponse = {
7
+ successful: boolean;
8
+ message: string;
9
+ transferred: number;
10
+ }
@@ -0,0 +1,4 @@
1
+ export type FSHubRequestOptions = {
2
+ cursor?: number;
3
+ limit?: number;
4
+ }
@@ -0,0 +1,11 @@
1
+ export type FSHubResponse<T> = {
2
+ data: T
3
+ meta?: {
4
+ cursor: {
5
+ current: number
6
+ prev: number
7
+ next: number
8
+ count: number
9
+ }
10
+ }
11
+ }
@@ -0,0 +1,88 @@
1
+ import { Airline } from './Airline';
2
+ import { Link } from './Common';
3
+
4
+ export type User = {
5
+ id: number
6
+ name: string
7
+ }
8
+
9
+ export type UserConf = {
10
+ tail: string
11
+ icao: string
12
+ }
13
+
14
+ export type Aircraft = {
15
+ icao: string
16
+ icao_name: string
17
+ name: string
18
+ type: string
19
+ user_conf: UserConf
20
+ }
21
+
22
+ export type Distance = {
23
+ nm: number
24
+ km: number
25
+ }
26
+
27
+ export type Average = {
28
+ spd: number
29
+ }
30
+
31
+ export type Max = {
32
+ alt: number
33
+ spd: number
34
+ }
35
+
36
+ export type Geo = {
37
+ lat: number
38
+ lng: number
39
+ }
40
+
41
+ export type Hdg = {
42
+ mag: number
43
+ true: number
44
+ }
45
+
46
+ export type Spd = {
47
+ tas: number
48
+ }
49
+
50
+ export type Wind = {
51
+ spd: number
52
+ dir: number
53
+ }
54
+
55
+ export type Airport = {
56
+ icao: string
57
+ iata: string
58
+ name: string
59
+ time: string
60
+ geo: Geo
61
+ hdg: Hdg
62
+ spd: Spd
63
+ fuel: number
64
+ pitch: number
65
+ bank: number
66
+ wind: Wind
67
+ }
68
+
69
+ export type Flight = {
70
+ id: number
71
+ user: User
72
+ airline: Airline
73
+ schedule_status: any
74
+ aircraft: Aircraft
75
+ plan: any
76
+ fuel_used: number
77
+ landing_rate: number
78
+ distance: Distance
79
+ average: Average
80
+ max: Max
81
+ time: number
82
+ tags: any[]
83
+ flags: any[]
84
+ points: number
85
+ departure: Airport
86
+ arrival: Airport
87
+ links: Link[]
88
+ }
@@ -0,0 +1,21 @@
1
+ import { Gps, Handles, Link } from './Common';
2
+
3
+ export type Pilot = {
4
+ id: number
5
+ name: string
6
+ base: string
7
+ locale: string
8
+ gps: Gps
9
+ is_online: boolean
10
+ online_at: string
11
+ bio?: string
12
+ handles?: Handles
13
+ timezone?: string
14
+ country?: string
15
+ created_at?: string
16
+ links?: Link[]
17
+ }
18
+
19
+ export type CurrentPilot = Pilot & {
20
+ discord_id?: number
21
+ }
@@ -0,0 +1,15 @@
1
+ import { Link } from './Common';
2
+
3
+ export type Urls = {
4
+ fullsize: string
5
+ thumbnail: string
6
+ }
7
+
8
+ export type Screenshot = {
9
+ id: number
10
+ name: string
11
+ desc: any
12
+ urls: Urls
13
+ created_at: string
14
+ links: Link[]
15
+ }
@@ -0,0 +1,23 @@
1
+ import { Link } from './Common';
2
+
3
+ export type PilotStat = {
4
+ total_flights: number
5
+ total_hours: number
6
+ total_distance: number
7
+ average_landing: number
8
+ }
9
+
10
+ export type PilotStats = {
11
+ id: number
12
+ all_time: PilotStat
13
+ month: PilotStat
14
+ links: Link[]
15
+ }
16
+
17
+ export type AirlineStats = {
18
+ id: number
19
+ total_pilots: number
20
+ all_time: PilotStat
21
+ month: PilotStat
22
+ links: Link[]
23
+ }