fshub-api 4.0.0 → 4.0.2
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 +30 -0
- package/dist/api/FSHubApiRequest.d.ts +4 -1
- package/dist/api/FSHubApiRequest.d.ts.map +1 -1
- package/dist/api/FSHubApiRequest.js +40 -1
- package/dist/api/FSHubApiRequest.js.map +1 -1
- package/dist/api/airline/Airline_approveApplication.d.ts +3 -0
- package/dist/api/airline/Airline_approveApplication.d.ts.map +1 -0
- package/dist/api/airline/Airline_approveApplication.js +56 -0
- package/dist/api/airline/Airline_approveApplication.js.map +1 -0
- package/dist/api/airline/Airline_getAllRanks.d.ts +3 -0
- package/dist/api/airline/Airline_getAllRanks.d.ts.map +1 -0
- package/dist/api/airline/Airline_getAllRanks.js +57 -0
- package/dist/api/airline/Airline_getAllRanks.js.map +1 -0
- package/dist/api/airline/Airline_getAllRoles.d.ts +3 -0
- package/dist/api/airline/Airline_getAllRoles.d.ts.map +1 -0
- package/dist/api/airline/Airline_getAllRoles.js +57 -0
- package/dist/api/airline/Airline_getAllRoles.js.map +1 -0
- package/dist/api/airline/Airline_getPilotStats.d.ts +2 -2
- package/dist/api/airline/Airline_getPilotStats.d.ts.map +1 -1
- package/dist/api/airline/Airline_getPilotStats.js.map +1 -1
- package/dist/api/airline/Airline_pilotPointPurchase.d.ts +3 -0
- package/dist/api/airline/Airline_pilotPointPurchase.d.ts.map +1 -0
- package/dist/api/airline/Airline_pilotPointPurchase.js +56 -0
- package/dist/api/airline/Airline_pilotPointPurchase.js.map +1 -0
- package/dist/api/airline/Airline_pilotSetRank.d.ts +3 -0
- package/dist/api/airline/Airline_pilotSetRank.d.ts.map +1 -0
- package/dist/api/airline/Airline_pilotSetRank.js +56 -0
- package/dist/api/airline/Airline_pilotSetRank.js.map +1 -0
- package/dist/api/airline/Airline_rejectApplication.d.ts +3 -0
- package/dist/api/airline/Airline_rejectApplication.d.ts.map +1 -0
- package/dist/api/airline/Airline_rejectApplication.js +56 -0
- package/dist/api/airline/Airline_rejectApplication.js.map +1 -0
- package/dist/api/airline/index.d.ts +12 -0
- package/dist/api/airline/index.d.ts.map +1 -1
- package/dist/api/airline/index.js +12 -0
- package/dist/api/airline/index.js.map +1 -1
- package/dist/api/index.d.ts +6 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/index.d.ts +8 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +66 -0
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +87 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/api/FSHubApiRequest.ts +24 -2
- package/src/api/airline/Airline_approveApplication.ts +10 -0
- package/src/api/airline/Airline_getAllRanks.ts +8 -0
- package/src/api/airline/Airline_getAllRoles.ts +8 -0
- package/src/api/airline/Airline_getPilotStats.ts +3 -3
- package/src/api/airline/Airline_pilotPointPurchase.ts +10 -0
- package/src/api/airline/Airline_pilotSetRank.ts +10 -0
- package/src/api/airline/Airline_rejectApplication.ts +10 -0
- package/src/api/airline/index.ts +13 -1
- package/src/index.spec.ts +33 -1
- package/src/index.ts +32 -2
- package/src/types/index.ts +102 -2
package/src/types/index.ts
CHANGED
|
@@ -217,13 +217,19 @@ export type FSHubApi = {
|
|
|
217
217
|
Airline_getAll: () => Promise<FSHubResponse<Airline[]>>
|
|
218
218
|
Airline_get: (id: number) => Promise<FSHubResponse<Airline>>
|
|
219
219
|
Airline_getPilots: (id: number) => Promise<FSHubResponse<Pilot[]>>
|
|
220
|
-
Airline_getPilotStats: (id: number, pilotId: number) => Promise<FSHubResponse<
|
|
220
|
+
Airline_getPilotStats: (id: number, pilotId: number) => Promise<FSHubResponse<FSHubAirlinePilotStats>>
|
|
221
221
|
Airline_getFlights: (id: number) => Promise<FSHubResponse<Flight[]>>
|
|
222
222
|
Airline_getAllFlightsDepartures:(id:number, airportCode:string) => Promise<FSHubResponse<Flight[]>>
|
|
223
223
|
Airline_getAllFlightsArrivals:(id:number, airportCode:string) => Promise<FSHubResponse<Flight[]>>
|
|
224
224
|
Airline_getAllFlightDeparturesAndArrivals:(id:number, departureAirportCode:string, arrivalAirportCode:string) => Promise<FSHubResponse<Flight[]>>
|
|
225
225
|
Airline_getAllScreenshots: (id: number) => Promise<FSHubResponse<Screenshot[]>>
|
|
226
226
|
Airline_getStats: (id: number) => Promise<FSHubResponse<AirlineStats>>
|
|
227
|
+
Airline_approveApplication: (pilotId: number, airlineId: number) => Promise<FSHubResponse<FSHubApplicationResponse>>
|
|
228
|
+
Airline_rejectApplication: (pilotId: number, airlineId: number) => Promise<FSHubResponse<FSHubApplicationResponse>>
|
|
229
|
+
Airline_pilotPointPurchase: (pilotId: number, airlineId: number, data: FSHubPilotPointPurchaseTransactionData) => Promise<FSHubResponse<FSHubPilotPointPurchaseTransactionResponse>>
|
|
230
|
+
Airline_pilotSetRank: (pilotId: number, airlineId: number, data: FSHubPilotSetRankData) => Promise<FSHubResponse<FSHubApplicationResponse>>
|
|
231
|
+
Airline_getAllRanks: (airlineId: number) => Promise<FSHubResponse<FSHubAirlineRank[]>>
|
|
232
|
+
Airline_getAllRoles: (airlineId: number) => Promise<FSHubResponse<FSHubAirlineRole[]>>
|
|
227
233
|
Flight_getFlightById: (id: number) => Promise<FSHubResponse<Flight>>
|
|
228
234
|
Flight_getFlightScreenshotsById: (id: number) => Promise<FSHubResponse<Screenshot[]>>
|
|
229
235
|
Flight_getFlights: (options?: FSHubRequestOptions) => Promise<FSHubResponse<Flight[]>>
|
|
@@ -241,6 +247,22 @@ export type FSHubResponse<T> = {
|
|
|
241
247
|
}
|
|
242
248
|
}
|
|
243
249
|
|
|
250
|
+
export type FSHubApplicationResponse = {
|
|
251
|
+
successful: boolean;
|
|
252
|
+
message: string;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export type FSHubPilotPointPurchaseTransactionData = {
|
|
256
|
+
amount: number;
|
|
257
|
+
summary: string;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export type FSHubPilotPointPurchaseTransactionResponse = {
|
|
261
|
+
successful: boolean;
|
|
262
|
+
message: string;
|
|
263
|
+
transferred: number;
|
|
264
|
+
}
|
|
265
|
+
|
|
244
266
|
export type FSHubError = {
|
|
245
267
|
message: string
|
|
246
268
|
code: number
|
|
@@ -248,4 +270,82 @@ export type FSHubError = {
|
|
|
248
270
|
details?: {
|
|
249
271
|
pilot: number
|
|
250
272
|
}
|
|
251
|
-
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export type FSHubPilotSetRankData = {
|
|
276
|
+
rank_id: number;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
export type FSHubAirlineRole = {
|
|
280
|
+
id: number;
|
|
281
|
+
name: string;
|
|
282
|
+
created_at: string;
|
|
283
|
+
updated_at: string;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export type FSHubAirlineRank = {
|
|
287
|
+
id: number;
|
|
288
|
+
name: string;
|
|
289
|
+
abbreviation: string;
|
|
290
|
+
min_hours: number;
|
|
291
|
+
created_at: string;
|
|
292
|
+
updated_at: string;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export type FSHubAirlinePilotStats = {
|
|
296
|
+
user: FSHubAirlinePilotStatsUser
|
|
297
|
+
points: number
|
|
298
|
+
carry_hours: number
|
|
299
|
+
rank: FSHubAirlinePilotStatsRank
|
|
300
|
+
roles: FSHubAirlinePilotStatsRoles[]
|
|
301
|
+
hired_at: string
|
|
302
|
+
discord_id: number
|
|
303
|
+
links: FSHubAirlinePilotStatsLink[]
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
export type FSHubAirlinePilotStatsRoles = {
|
|
307
|
+
[key: string]: any; // TODO: Add proper type
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
export type FSHubAirlinePilotStatsUser = {
|
|
311
|
+
id: number
|
|
312
|
+
name: string
|
|
313
|
+
email: string
|
|
314
|
+
profile: FSHubAirlinePilotStatsUserProfile
|
|
315
|
+
locations: FSHubAirlinePilotStatsUserLocations
|
|
316
|
+
handles: FSHubAirlinePilotStatsUserHandles
|
|
317
|
+
timezone: string
|
|
318
|
+
country: string
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
export type FSHubAirlinePilotStatsUserProfile = {
|
|
322
|
+
avatar_url: string
|
|
323
|
+
bio: string
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
export type FSHubAirlinePilotStatsUserLocations = {
|
|
327
|
+
base: string
|
|
328
|
+
locale: string
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
export type FSHubAirlinePilotStatsUserHandles = {
|
|
332
|
+
website: any
|
|
333
|
+
twitter: any
|
|
334
|
+
facebook: any
|
|
335
|
+
vatsim: any
|
|
336
|
+
ivao: any
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
export type FSHubAirlinePilotStatsRank = {
|
|
340
|
+
id: number
|
|
341
|
+
name: string
|
|
342
|
+
abbreviation: string
|
|
343
|
+
min_hours: number
|
|
344
|
+
created_at: string
|
|
345
|
+
updated_at: string
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
export type FSHubAirlinePilotStatsLink = {
|
|
349
|
+
rel: string
|
|
350
|
+
uri: string
|
|
351
|
+
}
|