fshub-api 1.0.0
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 +252 -0
- package/dist/api/FSHubApiRequest.d.ts +3 -0
- package/dist/api/FSHubApiRequest.d.ts.map +1 -0
- package/dist/api/FSHubApiRequest.js +61 -0
- package/dist/api/FSHubApiRequest.js.map +1 -0
- package/dist/api/airline/Airline_get.d.ts +3 -0
- package/dist/api/airline/Airline_get.d.ts.map +1 -0
- package/dist/api/airline/Airline_get.js +57 -0
- package/dist/api/airline/Airline_get.js.map +1 -0
- package/dist/api/airline/Airline_getAll.d.ts +3 -0
- package/dist/api/airline/Airline_getAll.d.ts.map +1 -0
- package/dist/api/airline/Airline_getAll.js +57 -0
- package/dist/api/airline/Airline_getAll.js.map +1 -0
- package/dist/api/airline/Airline_getAllFlightDeparturesAndArrivals.d.ts +3 -0
- package/dist/api/airline/Airline_getAllFlightDeparturesAndArrivals.d.ts.map +1 -0
- package/dist/api/airline/Airline_getAllFlightDeparturesAndArrivals.js +57 -0
- package/dist/api/airline/Airline_getAllFlightDeparturesAndArrivals.js.map +1 -0
- package/dist/api/airline/Airline_getAllFlightsArrivals.d.ts +3 -0
- package/dist/api/airline/Airline_getAllFlightsArrivals.d.ts.map +1 -0
- package/dist/api/airline/Airline_getAllFlightsArrivals.js +57 -0
- package/dist/api/airline/Airline_getAllFlightsArrivals.js.map +1 -0
- package/dist/api/airline/Airline_getAllFlightsDepartures.d.ts +3 -0
- package/dist/api/airline/Airline_getAllFlightsDepartures.d.ts.map +1 -0
- package/dist/api/airline/Airline_getAllFlightsDepartures.js +57 -0
- package/dist/api/airline/Airline_getAllFlightsDepartures.js.map +1 -0
- package/dist/api/airline/Airline_getAllScreenshots.d.ts +3 -0
- package/dist/api/airline/Airline_getAllScreenshots.d.ts.map +1 -0
- package/dist/api/airline/Airline_getAllScreenshots.js +66 -0
- package/dist/api/airline/Airline_getAllScreenshots.js.map +1 -0
- package/dist/api/airline/Airline_getFlights.d.ts +3 -0
- package/dist/api/airline/Airline_getFlights.d.ts.map +1 -0
- package/dist/api/airline/Airline_getFlights.js +57 -0
- package/dist/api/airline/Airline_getFlights.js.map +1 -0
- package/dist/api/airline/Airline_getPilotStats.d.ts +3 -0
- package/dist/api/airline/Airline_getPilotStats.d.ts.map +1 -0
- package/dist/api/airline/Airline_getPilotStats.js +57 -0
- package/dist/api/airline/Airline_getPilotStats.js.map +1 -0
- package/dist/api/airline/Airline_getPilots.d.ts +3 -0
- package/dist/api/airline/Airline_getPilots.d.ts.map +1 -0
- package/dist/api/airline/Airline_getPilots.js +57 -0
- package/dist/api/airline/Airline_getPilots.js.map +1 -0
- package/dist/api/airline/Airline_getStats.d.ts +3 -0
- package/dist/api/airline/Airline_getStats.d.ts.map +1 -0
- package/dist/api/airline/Airline_getStats.js +57 -0
- package/dist/api/airline/Airline_getStats.js.map +1 -0
- package/dist/api/airline/index.d.ts +23 -0
- package/dist/api/airline/index.d.ts.map +1 -0
- package/dist/api/airline/index.js +29 -0
- package/dist/api/airline/index.js.map +1 -0
- package/dist/api/index.d.ts +28 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +10 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/pilot/Pilot_get.d.ts +3 -0
- package/dist/api/pilot/Pilot_get.d.ts.map +1 -0
- package/dist/api/pilot/Pilot_get.js +57 -0
- package/dist/api/pilot/Pilot_get.js.map +1 -0
- package/dist/api/pilot/Pilot_getAll.d.ts +3 -0
- package/dist/api/pilot/Pilot_getAll.d.ts.map +1 -0
- package/dist/api/pilot/Pilot_getAll.js +57 -0
- package/dist/api/pilot/Pilot_getAll.js.map +1 -0
- package/dist/api/pilot/Pilot_getAllAirlines.d.ts +3 -0
- package/dist/api/pilot/Pilot_getAllAirlines.d.ts.map +1 -0
- package/dist/api/pilot/Pilot_getAllAirlines.js +57 -0
- package/dist/api/pilot/Pilot_getAllAirlines.js.map +1 -0
- package/dist/api/pilot/Pilot_getAllFlightDeparturesAndArrivals.d.ts +3 -0
- package/dist/api/pilot/Pilot_getAllFlightDeparturesAndArrivals.d.ts.map +1 -0
- package/dist/api/pilot/Pilot_getAllFlightDeparturesAndArrivals.js +57 -0
- package/dist/api/pilot/Pilot_getAllFlightDeparturesAndArrivals.js.map +1 -0
- package/dist/api/pilot/Pilot_getAllFlights.d.ts +3 -0
- package/dist/api/pilot/Pilot_getAllFlights.d.ts.map +1 -0
- package/dist/api/pilot/Pilot_getAllFlights.js +57 -0
- package/dist/api/pilot/Pilot_getAllFlights.js.map +1 -0
- package/dist/api/pilot/Pilot_getAllFlightsArrivals.d.ts +3 -0
- package/dist/api/pilot/Pilot_getAllFlightsArrivals.d.ts.map +1 -0
- package/dist/api/pilot/Pilot_getAllFlightsArrivals.js +57 -0
- package/dist/api/pilot/Pilot_getAllFlightsArrivals.js.map +1 -0
- package/dist/api/pilot/Pilot_getAllFlightsDepartures.d.ts +3 -0
- package/dist/api/pilot/Pilot_getAllFlightsDepartures.d.ts.map +1 -0
- package/dist/api/pilot/Pilot_getAllFlightsDepartures.js +57 -0
- package/dist/api/pilot/Pilot_getAllFlightsDepartures.js.map +1 -0
- package/dist/api/pilot/Pilot_getAllScreenshots.d.ts +3 -0
- package/dist/api/pilot/Pilot_getAllScreenshots.d.ts.map +1 -0
- package/dist/api/pilot/Pilot_getAllScreenshots.js +66 -0
- package/dist/api/pilot/Pilot_getAllScreenshots.js.map +1 -0
- package/dist/api/pilot/Pilot_getCurrent.d.ts +3 -0
- package/dist/api/pilot/Pilot_getCurrent.d.ts.map +1 -0
- package/dist/api/pilot/Pilot_getCurrent.js +57 -0
- package/dist/api/pilot/Pilot_getCurrent.js.map +1 -0
- package/dist/api/pilot/Pilot_getLatestFlight.d.ts +3 -0
- package/dist/api/pilot/Pilot_getLatestFlight.d.ts.map +1 -0
- package/dist/api/pilot/Pilot_getLatestFlight.js +57 -0
- package/dist/api/pilot/Pilot_getLatestFlight.js.map +1 -0
- package/dist/api/pilot/Pilot_getStats.d.ts +3 -0
- package/dist/api/pilot/Pilot_getStats.d.ts.map +1 -0
- package/dist/api/pilot/Pilot_getStats.js +57 -0
- package/dist/api/pilot/Pilot_getStats.js.map +1 -0
- package/dist/api/pilot/index.d.ts +25 -0
- package/dist/api/pilot/index.d.ts.map +1 -0
- package/dist/api/pilot/index.js +31 -0
- package/dist/api/pilot/index.js.map +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +291 -0
- package/dist/index.js.map +1 -0
- package/dist/types/index.d.ts +207 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +55 -0
package/README.md
ADDED
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
# FSHub API
|
|
2
|
+
|
|
3
|
+
A TypeScript HTTP API wrapper library for the FSHub REST API, providing a clean and type-safe interface for interacting with FSHub's flight simulation community platform.
|
|
4
|
+
|
|
5
|
+
## 📑 Table of Contents
|
|
6
|
+
|
|
7
|
+
- [🎯 Purpose](#-purpose)
|
|
8
|
+
- [🚀 Installation](#-installation)
|
|
9
|
+
- [📋 Prerequisites](#-prerequisites)
|
|
10
|
+
- [⚙️ Configuration](#️-configuration)
|
|
11
|
+
- [🔧 Basic Setup](#-basic-setup)
|
|
12
|
+
- [📖 Usage Examples](#-usage-examples)
|
|
13
|
+
- [Pilot Operations](#pilot-operations)
|
|
14
|
+
- [Airline Operations](#airline-operations)
|
|
15
|
+
- [🔍 Data Types](#-data-types)
|
|
16
|
+
- [🧪 Testing](#-testing)
|
|
17
|
+
- [🏗️ Development](#️-development)
|
|
18
|
+
- [📚 API Reference](#-api-reference)
|
|
19
|
+
- [Pilot Methods](#pilot-methods)
|
|
20
|
+
- [Airline Methods](#airline-methods)
|
|
21
|
+
- [🤝 Contributing](#-contributing)
|
|
22
|
+
- [📄 License](#-license)
|
|
23
|
+
- [🔗 Links](#-links)
|
|
24
|
+
- [🆘 Support](#-support)
|
|
25
|
+
|
|
26
|
+
## 🎯 Purpose
|
|
27
|
+
|
|
28
|
+
This library simplifies integration with the FSHub API by providing:
|
|
29
|
+
- **Type Safety**: Full TypeScript support with comprehensive type definitions
|
|
30
|
+
- **Clean Interface**: Simple, intuitive methods for all FSHub API endpoints
|
|
31
|
+
- **Error Handling**: Built-in error handling and response validation
|
|
32
|
+
- **Modern JavaScript**: Built with modern ES modules and async/await patterns
|
|
33
|
+
|
|
34
|
+
## 🚀 Installation
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm install fshub-api
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## 📋 Prerequisites
|
|
41
|
+
|
|
42
|
+
- Node.js 18+
|
|
43
|
+
- A valid FSHub API key (get one from [FSHub](https://fshub.io))
|
|
44
|
+
|
|
45
|
+
## ⚙️ Configuration
|
|
46
|
+
|
|
47
|
+
Optionally. create a `.env` file in your project root:
|
|
48
|
+
|
|
49
|
+
```env
|
|
50
|
+
FSHUB_API_KEY=your_api_key_here
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## 🔧 Basic Setup
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
import FSHubApi from 'fshub-api';
|
|
57
|
+
|
|
58
|
+
const api = new FSHubApi({
|
|
59
|
+
apiKey: process.env.FSHUB_API_KEY,
|
|
60
|
+
// Optional configurations:
|
|
61
|
+
baseURL: 'https://fshub.io/api/v3/', // Default
|
|
62
|
+
timeout: 10000, // Default: 10 seconds
|
|
63
|
+
headers: {} // Additional headers
|
|
64
|
+
});
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## 📖 Usage Examples
|
|
68
|
+
|
|
69
|
+
### Pilot Operations
|
|
70
|
+
|
|
71
|
+
#### Get Current Pilot
|
|
72
|
+
```typescript
|
|
73
|
+
const currentPilot = await api.Pilot_getCurrent();
|
|
74
|
+
console.log(`Current pilot: ${currentPilot.name} from ${currentPilot.base}`);
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
#### Get All Pilots
|
|
78
|
+
```typescript
|
|
79
|
+
const allPilots = await api.Pilot_getAll();
|
|
80
|
+
console.log(`Total pilots: ${allPilots.length}`);
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
#### Get Specific Pilot
|
|
84
|
+
```typescript
|
|
85
|
+
const pilot = await api.Pilot_get(123);
|
|
86
|
+
console.log(`Pilot ${pilot.name} is ${pilot.is_online ? 'online' : 'offline'}`);
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
#### Get Pilot Statistics
|
|
90
|
+
```typescript
|
|
91
|
+
const stats = await api.Pilot_getStats(123);
|
|
92
|
+
console.log(`Total flights: ${stats.all_time.total_flights}`);
|
|
93
|
+
console.log(`Total hours: ${stats.all_time.total_hours}`);
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
#### Get Pilot Flights
|
|
97
|
+
```typescript
|
|
98
|
+
// Get all flights
|
|
99
|
+
const allFlights = await api.Pilot_getAllFlights(123);
|
|
100
|
+
|
|
101
|
+
// Get latest flight
|
|
102
|
+
const latestFlight = await api.Pilot_getLatestFlight(123);
|
|
103
|
+
|
|
104
|
+
// Get flights from specific airport
|
|
105
|
+
const departures = await api.Pilot_getAllFlightsDepartures(123, 'KPHX');
|
|
106
|
+
const arrivals = await api.Pilot_getAllFlightsArrivals(123, 'KLAX');
|
|
107
|
+
|
|
108
|
+
// Get flights between specific airports
|
|
109
|
+
const routeFlights = await api.Pilot_getAllFlightDeparturesAndArrivals(123, 'KPHX', 'KLAX');
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
#### Get Pilot Screenshots
|
|
113
|
+
```typescript
|
|
114
|
+
const screenshots = await api.Pilot_getAllScreenshots(123);
|
|
115
|
+
screenshots.forEach(screenshot => {
|
|
116
|
+
console.log(`Screenshot: ${screenshot.name} - ${screenshot.urls.fullsize}`);
|
|
117
|
+
});
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Airline Operations
|
|
121
|
+
|
|
122
|
+
#### Get All Airlines
|
|
123
|
+
```typescript
|
|
124
|
+
const airlines = await api.Airline_getAll();
|
|
125
|
+
console.log(`Total airlines: ${airlines.length}`);
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
#### Get Specific Airline
|
|
129
|
+
```typescript
|
|
130
|
+
const airline = await api.Airline_get(6082);
|
|
131
|
+
console.log(`Airline: ${airline.name} (${airline.abbr})`);
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
#### Get Airline Pilots
|
|
135
|
+
```typescript
|
|
136
|
+
const pilots = await api.Airline_getPilots(6082);
|
|
137
|
+
console.log(`Airline has ${pilots.length} pilots`);
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
#### Get Airline Statistics
|
|
141
|
+
```typescript
|
|
142
|
+
const stats = await api.Airline_getStats(6082);
|
|
143
|
+
console.log(`Total pilots: ${stats.total_pilots}`);
|
|
144
|
+
console.log(`Monthly flights: ${stats.month.total_flights}`);
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
#### Get Airline Flights
|
|
148
|
+
```typescript
|
|
149
|
+
// Get all flights
|
|
150
|
+
const allFlights = await api.Airline_getFlights(6082);
|
|
151
|
+
|
|
152
|
+
// Get flights from specific airport
|
|
153
|
+
const departures = await api.Airline_getAllFlightsDepartures(6082, 'KPHX');
|
|
154
|
+
const arrivals = await api.Airline_getAllFlightsArrivals(6082, 'KLAX');
|
|
155
|
+
|
|
156
|
+
// Get flights between specific airports
|
|
157
|
+
const routeFlights = await api.Airline_getAllFlightDeparturesAndArrivals(6082, 'KPHX', 'KLAX');
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## 🔍 Data Types
|
|
161
|
+
|
|
162
|
+
The library provides comprehensive TypeScript types for all FSHub data structures:
|
|
163
|
+
|
|
164
|
+
- **Pilot**: Pilot information, status, and location
|
|
165
|
+
- **Flight**: Flight details, aircraft, airports, and performance metrics
|
|
166
|
+
- **Airline**: Airline information and ownership details
|
|
167
|
+
- **PilotStats**: Comprehensive pilot statistics (all-time and monthly)
|
|
168
|
+
- **Screenshot**: Pilot screenshot metadata and URLs
|
|
169
|
+
- **Airport**: Airport information with weather and navigation data
|
|
170
|
+
|
|
171
|
+
## 🧪 Testing
|
|
172
|
+
|
|
173
|
+
Run the test suite:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
npm test
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Run tests in watch mode:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
npm run test:watch
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## 🏗️ Development
|
|
186
|
+
|
|
187
|
+
### Build
|
|
188
|
+
```bash
|
|
189
|
+
npm run build
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### Lint
|
|
193
|
+
```bash
|
|
194
|
+
npm run lint
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Development Mode
|
|
198
|
+
```bash
|
|
199
|
+
npm run dev
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## 📚 API Reference
|
|
203
|
+
|
|
204
|
+
### Pilot Methods
|
|
205
|
+
- `Pilot_getCurrent()` - Get current authenticated pilot
|
|
206
|
+
- `Pilot_getAll()` - Get all pilots
|
|
207
|
+
- `Pilot_get(id)` - Get specific pilot by ID
|
|
208
|
+
- `Pilot_getLatestFlight(id)` - Get pilot's latest flight
|
|
209
|
+
- `Pilot_getAllFlights(id)` - Get all pilot flights
|
|
210
|
+
- `Pilot_getStats(id)` - Get pilot statistics
|
|
211
|
+
- `Pilot_getAllFlightsDepartures(id, airportCode)` - Get flights departing from airport
|
|
212
|
+
- `Pilot_getAllFlightsArrivals(id, airportCode)` - Get flights arriving at airport
|
|
213
|
+
- `Pilot_getAllFlightDeparturesAndArrivals(id, departureAirport, arrivalAirport)` - Get flights between airports
|
|
214
|
+
- `Pilot_getAllScreenshots(id)` - Get pilot screenshots
|
|
215
|
+
|
|
216
|
+
### Airline Methods
|
|
217
|
+
- `Airline_getAll()` - Get all airlines
|
|
218
|
+
- `Airline_get(id)` - Get specific airline by ID
|
|
219
|
+
- `Airline_getPilots(id)` - Get airline pilots
|
|
220
|
+
- `Airline_getPilotStats(id, pilotId)` - Get pilot stats within airline
|
|
221
|
+
- `Airline_getFlights(id)` - Get airline flights
|
|
222
|
+
- `Airline_getAllFlightsDepartures(id, airportCode)` - Get airline flights departing from airport
|
|
223
|
+
- `Airline_getAllFlightsArrivals(id, airportCode)` - Get airline flights arriving at airport
|
|
224
|
+
- `Airline_getAllFlightDeparturesAndArrivals(id, departureAirport, arrivalAirport)` - Get airline flights between airports
|
|
225
|
+
- `Airline_getAllScreenshots(id)` - Get airline screenshots
|
|
226
|
+
- `Airline_getStats(id)` - Get airline statistics
|
|
227
|
+
|
|
228
|
+
## 🤝 Contributing
|
|
229
|
+
|
|
230
|
+
1. Fork the repository
|
|
231
|
+
2. Create a feature branch
|
|
232
|
+
3. Make your changes
|
|
233
|
+
4. Add tests for new functionality
|
|
234
|
+
5. Ensure all tests pass
|
|
235
|
+
6. Submit a pull request
|
|
236
|
+
|
|
237
|
+
## 📄 License
|
|
238
|
+
|
|
239
|
+
ISC License
|
|
240
|
+
|
|
241
|
+
## 🔗 Links
|
|
242
|
+
|
|
243
|
+
- [FSHub Website](https://fshub.io)
|
|
244
|
+
- [FSHub API Documentation](https://fshub.io/api/docs)
|
|
245
|
+
- [NPM Package](https://www.npmjs.com/package/fshub-api)
|
|
246
|
+
|
|
247
|
+
## 🆘 Support
|
|
248
|
+
|
|
249
|
+
If you encounter any issues or have questions:
|
|
250
|
+
1. Check the [FSHub API documentation](https://fshub.io/api/docs)
|
|
251
|
+
2. Review the test examples in this repository
|
|
252
|
+
3. Open an issue on GitHub
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FSHubApiRequest.d.ts","sourceRoot":"","sources":["../../src/api/FSHubApiRequest.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAc,QAAQ,EAAE,MAAM,UAAU,CAAC;AAE/D,wBAA8B,eAAe,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAYtG"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.default = FSHubApiRequest;
|
|
40
|
+
function FSHubApiRequest(url, api) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
42
|
+
var response;
|
|
43
|
+
return __generator(this, function (_a) {
|
|
44
|
+
switch (_a.label) {
|
|
45
|
+
case 0: return [4 /*yield*/, api.axios.get(url)
|
|
46
|
+
.then(function (res) { return res.data; })
|
|
47
|
+
.catch(function (err) {
|
|
48
|
+
var _a, _b;
|
|
49
|
+
if (((_a = err.response) === null || _a === void 0 ? void 0 : _a.data.code) === 404) {
|
|
50
|
+
throw new Error('Not Found');
|
|
51
|
+
}
|
|
52
|
+
throw new Error((_b = err.response) === null || _b === void 0 ? void 0 : _b.data.message);
|
|
53
|
+
})];
|
|
54
|
+
case 1:
|
|
55
|
+
response = _a.sent();
|
|
56
|
+
return [2 /*return*/, response];
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=FSHubApiRequest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FSHubApiRequest.js","sourceRoot":"","sources":["../../src/api/FSHubApiRequest.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,kCAYC;AAZD,SAA8B,eAAe,CAAI,GAAW,EAAE,GAAa;;;;;wBACnC,qBAAM,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC;yBACvD,IAAI,CAAC,UAAC,GAAoC,IAAK,OAAA,GAAG,CAAC,IAAI,EAAR,CAAQ,CAAC;yBACxD,KAAK,CAAC,UAAC,GAA2B;;wBAC/B,IAAI,CAAA,MAAA,GAAG,CAAC,QAAQ,0CAAE,IAAI,CAAC,IAAI,MAAK,GAAG,EAAE,CAAC;4BAClC,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC;wBACjC,CAAC;wBAED,MAAM,IAAI,KAAK,CAAC,MAAA,GAAG,CAAC,QAAQ,0CAAE,IAAI,CAAC,OAAO,CAAC,CAAC;oBAChD,CAAC,CAAC,EAAA;;oBARA,QAAQ,GAAsB,SAQ9B;oBAEN,sBAAO,QAAQ,EAAC;;;;CACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Airline_get.d.ts","sourceRoot":"","sources":["../../../src/api/airline/Airline_get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAiB,OAAO,EAAE,MAAM,SAAS,CAAC;AAG3D,wBAA8B,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,CAIrF"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.default = Airline_get;
|
|
43
|
+
var FSHubApiRequest_1 = __importDefault(require("../FSHubApiRequest"));
|
|
44
|
+
function Airline_get(id, api) {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
46
|
+
var response;
|
|
47
|
+
return __generator(this, function (_a) {
|
|
48
|
+
switch (_a.label) {
|
|
49
|
+
case 0: return [4 /*yield*/, (0, FSHubApiRequest_1.default)("airline/".concat(id), api)];
|
|
50
|
+
case 1:
|
|
51
|
+
response = _a.sent();
|
|
52
|
+
return [2 /*return*/, response.data];
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=Airline_get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Airline_get.js","sourceRoot":"","sources":["../../../src/api/airline/Airline_get.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,8BAIC;AAND,uEAAiD;AAEjD,SAA8B,WAAW,CAAC,EAAU,EAAE,GAAa;;;;;wBACtB,qBAAM,IAAA,yBAAe,EAAC,kBAAW,EAAE,CAAE,EAAE,GAAG,CAAC,EAAA;;oBAA9E,QAAQ,GAA2B,SAA2C;oBAEpF,sBAAO,QAAQ,CAAC,IAAI,EAAC;;;;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Airline_getAll.d.ts","sourceRoot":"","sources":["../../../src/api/airline/Airline_getAll.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAiB,OAAO,EAAE,MAAM,SAAS,CAAC;AAG3D,wBAA8B,cAAc,CAAC,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAI9E"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.default = Airline_getAll;
|
|
43
|
+
var FSHubApiRequest_1 = __importDefault(require("../FSHubApiRequest"));
|
|
44
|
+
function Airline_getAll(api) {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
46
|
+
var response;
|
|
47
|
+
return __generator(this, function (_a) {
|
|
48
|
+
switch (_a.label) {
|
|
49
|
+
case 0: return [4 /*yield*/, (0, FSHubApiRequest_1.default)("airline", api)];
|
|
50
|
+
case 1:
|
|
51
|
+
response = _a.sent();
|
|
52
|
+
return [2 /*return*/, response.data];
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=Airline_getAll.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Airline_getAll.js","sourceRoot":"","sources":["../../../src/api/airline/Airline_getAll.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,iCAIC;AAND,uEAAiD;AAEjD,SAA8B,cAAc,CAAC,GAAa;;;;;wBACX,qBAAM,IAAA,yBAAe,EAAC,SAAS,EAAE,GAAG,CAAC,EAAA;;oBAA1E,QAAQ,GAA6B,SAAqC;oBAEhF,sBAAO,QAAQ,CAAC,IAAI,EAAC;;;;CACxB"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Flight, FSHubApi } from "@/types";
|
|
2
|
+
export default function Airline_getAllFlightDeparturesAndArrivals(id: number, departureAirportCode: string, arrivalAirportCode: string, api: FSHubApi): Promise<Flight[]>;
|
|
3
|
+
//# sourceMappingURL=Airline_getAllFlightDeparturesAndArrivals.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Airline_getAllFlightDeparturesAndArrivals.d.ts","sourceRoot":"","sources":["../../../src/api/airline/Airline_getAllFlightDeparturesAndArrivals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAiB,MAAM,SAAS,CAAC;AAG1D,wBAA8B,yCAAyC,CAAC,EAAE,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAI9K"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.default = Airline_getAllFlightDeparturesAndArrivals;
|
|
43
|
+
var FSHubApiRequest_1 = __importDefault(require("../FSHubApiRequest"));
|
|
44
|
+
function Airline_getAllFlightDeparturesAndArrivals(id, departureAirportCode, arrivalAirportCode, api) {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
46
|
+
var response;
|
|
47
|
+
return __generator(this, function (_a) {
|
|
48
|
+
switch (_a.label) {
|
|
49
|
+
case 0: return [4 /*yield*/, (0, FSHubApiRequest_1.default)("airline/".concat(id, "/departure/").concat(departureAirportCode, "/arrival/").concat(arrivalAirportCode), api)];
|
|
50
|
+
case 1:
|
|
51
|
+
response = _a.sent();
|
|
52
|
+
return [2 /*return*/, response.data];
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=Airline_getAllFlightDeparturesAndArrivals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Airline_getAllFlightDeparturesAndArrivals.js","sourceRoot":"","sources":["../../../src/api/airline/Airline_getAllFlightDeparturesAndArrivals.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,4DAIC;AAND,uEAAiD;AAEjD,SAA8B,yCAAyC,CAAC,EAAU,EAAE,oBAA4B,EAAE,kBAA0B,EAAE,GAAa;;;;;wBAC7G,qBAAM,IAAA,yBAAe,EAAC,kBAAW,EAAE,wBAAc,oBAAoB,sBAAY,kBAAkB,CAAE,EAAE,GAAG,CAAC,EAAA;;oBAA/I,QAAQ,GAA4B,SAA2G;oBAErJ,sBAAO,QAAQ,CAAC,IAAI,EAAC;;;;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Airline_getAllFlightsArrivals.d.ts","sourceRoot":"","sources":["../../../src/api/airline/Airline_getAllFlightsArrivals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAiB,MAAM,EAAE,MAAM,SAAS,CAAC;AAG1D,wBAA8B,6BAA6B,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAI7H"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.default = Airline_getAllFlightsArrivals;
|
|
43
|
+
var FSHubApiRequest_1 = __importDefault(require("../FSHubApiRequest"));
|
|
44
|
+
function Airline_getAllFlightsArrivals(id, airportCode, api) {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
46
|
+
var response;
|
|
47
|
+
return __generator(this, function (_a) {
|
|
48
|
+
switch (_a.label) {
|
|
49
|
+
case 0: return [4 /*yield*/, (0, FSHubApiRequest_1.default)("airline/".concat(id, "/arrival/").concat(airportCode), api)];
|
|
50
|
+
case 1:
|
|
51
|
+
response = _a.sent();
|
|
52
|
+
return [2 /*return*/, response.data];
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=Airline_getAllFlightsArrivals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Airline_getAllFlightsArrivals.js","sourceRoot":"","sources":["../../../src/api/airline/Airline_getAllFlightsArrivals.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,gDAIC;AAND,uEAAiD;AAEjD,SAA8B,6BAA6B,CAAC,EAAU,EAAE,WAAmB,EAAE,GAAa;;;;;wBAC5D,qBAAM,IAAA,yBAAe,EAAC,kBAAW,EAAE,sBAAY,WAAW,CAAE,EAAE,GAAG,CAAC,EAAA;;oBAAtG,QAAQ,GAA4B,SAAkE;oBAE5G,sBAAO,QAAQ,CAAC,IAAI,EAAC;;;;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Airline_getAllFlightsDepartures.d.ts","sourceRoot":"","sources":["../../../src/api/airline/Airline_getAllFlightsDepartures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAiB,MAAM,SAAS,CAAC;AAG1D,wBAA8B,+BAA+B,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAI/H"}
|