diff --git a/.gitignore b/.gitignore index 5edb8b0..0318b5e 100644 --- a/.gitignore +++ b/.gitignore @@ -342,4 +342,4 @@ healthchecksdb #OpenSky specific Installer/Libraries.wxs Installer/SoundPacks.wxs -OpenSky.AgentMSFS/app.config +OpenSky.Agent/app.config diff --git a/OpenSky.Agent.Simulator/OpenAPIs/swagger.cs b/OpenSky.Agent.Simulator/OpenAPIs/swagger.cs index d8f2284..0ef4901 100644 --- a/OpenSky.Agent.Simulator/OpenAPIs/swagger.cs +++ b/OpenSky.Agent.Simulator/OpenAPIs/swagger.cs @@ -3956,6 +3956,80 @@ public async System.Threading.Tasks.Task ValidateEmailAsync(V } } + /// Get data imports. + /// Success + /// A server side error occurred. + public System.Threading.Tasks.Task GetDataImportsAsync() + { + return GetDataImportsAsync(System.Threading.CancellationToken.None); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// Get data imports. + /// Success + /// A server side error occurred. + public async System.Threading.Tasks.Task GetDataImportsAsync(System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/DataImport"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + /// Get data import status. /// Identifier for the import. /// Success @@ -4036,22 +4110,22 @@ public async System.Threading.Tasks.Task GetImportS } } - /// Get data imports. + /// Post LittleNavmap MSFS sqlite database for import. /// Success /// A server side error occurred. - public System.Threading.Tasks.Task GetDataImportsAsync() + public System.Threading.Tasks.Task LittleNavmapMSFSAsync(FileParameter fileUpload) { - return GetDataImportsAsync(System.Threading.CancellationToken.None); + return LittleNavmapMSFSAsync(fileUpload, System.Threading.CancellationToken.None); } /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// Get data imports. + /// Post LittleNavmap MSFS sqlite database for import. /// Success /// A server side error occurred. - public async System.Threading.Tasks.Task GetDataImportsAsync(System.Threading.CancellationToken cancellationToken) + public async System.Threading.Tasks.Task LittleNavmapMSFSAsync(FileParameter fileUpload, System.Threading.CancellationToken cancellationToken) { var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/DataImport"); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/DataImport/littleNavmapMSFS"); var client_ = _httpClient; var disposeClient_ = false; @@ -4059,7 +4133,21 @@ public async System.Threading.Tasks.Task GetDa { using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) { - request_.Method = new System.Net.Http.HttpMethod("GET"); + var boundary_ = System.Guid.NewGuid().ToString(); + var content_ = new System.Net.Http.MultipartFormDataContent(boundary_); + content_.Headers.Remove("Content-Type"); + content_.Headers.TryAddWithoutValidation("Content-Type", "multipart/form-data; boundary=" + boundary_); + if (fileUpload == null) + throw new System.ArgumentNullException("fileUpload"); + else + { + var content_fileUpload_ = new System.Net.Http.StreamContent(fileUpload.Data); + if (!string.IsNullOrEmpty(fileUpload.ContentType)) + content_fileUpload_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse(fileUpload.ContentType); + content_.Add(content_fileUpload_, "fileUpload", fileUpload.FileName ?? "fileUpload"); + } + request_.Content = content_; + request_.Method = new System.Net.Http.HttpMethod("POST"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); PrepareRequest(client_, request_, urlBuilder_); @@ -4083,7 +4171,7 @@ public async System.Threading.Tasks.Task GetDa var status_ = (int)response_.StatusCode; if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); @@ -4110,22 +4198,22 @@ public async System.Threading.Tasks.Task GetDa } } - /// Post LittleNavmap MSFS sqlite database for import. + /// Post LittleNavmap XPlane11 sqlite database for import. /// Success /// A server side error occurred. - public System.Threading.Tasks.Task LittleNavmapMSFSAsync(FileParameter fileUpload) + public System.Threading.Tasks.Task LittleNavmapXP11Async(FileParameter fileUpload) { - return LittleNavmapMSFSAsync(fileUpload, System.Threading.CancellationToken.None); + return LittleNavmapXP11Async(fileUpload, System.Threading.CancellationToken.None); } /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// Post LittleNavmap MSFS sqlite database for import. + /// Post LittleNavmap XPlane11 sqlite database for import. /// Success /// A server side error occurred. - public async System.Threading.Tasks.Task LittleNavmapMSFSAsync(FileParameter fileUpload, System.Threading.CancellationToken cancellationToken) + public async System.Threading.Tasks.Task LittleNavmapXP11Async(FileParameter fileUpload, System.Threading.CancellationToken cancellationToken) { var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/DataImport/littleNavmapMSFS"); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/DataImport/littleNavmapXP11"); var client_ = _httpClient; var disposeClient_ = false; @@ -5848,6 +5936,98 @@ public async System.Threading.Tasks.Task AcceptJobAsync(Syste } } + /// Gets the available jobs at the specified airport and simulator. + /// The ICAO code of the airport. + /// The direction of the jobs to return. 0 = From, 1 = To, 2 = RoundTrip + /// The simulator (or NULL for all simulators). 0 = MSFS, 1 = XPlane11 + /// Success + /// A server side error occurred. + public System.Threading.Tasks.Task GetJobsAtAirportForSimulatorAsync(string icao, JobDirection direction, Simulator simulator) + { + return GetJobsAtAirportForSimulatorAsync(icao, direction, simulator, System.Threading.CancellationToken.None); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// Gets the available jobs at the specified airport and simulator. + /// The ICAO code of the airport. + /// The direction of the jobs to return. 0 = From, 1 = To, 2 = RoundTrip + /// The simulator (or NULL for all simulators). 0 = MSFS, 1 = XPlane11 + /// Success + /// A server side error occurred. + public async System.Threading.Tasks.Task GetJobsAtAirportForSimulatorAsync(string icao, JobDirection direction, Simulator simulator, System.Threading.CancellationToken cancellationToken) + { + if (icao == null) + throw new System.ArgumentNullException("icao"); + + if (direction == null) + throw new System.ArgumentNullException("direction"); + + if (simulator == null) + throw new System.ArgumentNullException("simulator"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Job/atAirportForSim/{icao}/{direction}/{simulator}"); + urlBuilder_.Replace("{icao}", System.Uri.EscapeDataString(ConvertToString(icao, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Replace("{direction}", System.Uri.EscapeDataString(ConvertToString(direction, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Replace("{simulator}", System.Uri.EscapeDataString(ConvertToString(simulator, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + /// Gets the available jobs at the specified airport. /// The ICAO code of the airport. /// The direction of the jobs to return. 0 = From, 1 = To, 2 = RoundTrip @@ -5934,6 +6114,104 @@ public async System.Threading.Tasks.Task GetJobsAtAir } } + /// Gets the available jobs at the specified airport for the specified aircraft type category and simulator. + /// The ICAO code of the airport. + /// The direction of the jobs to return. 0 = From, 1 = To, 2 = RoundTrip + /// The aircraft type category to return jobs for (recommended category). 0 = SEP, 1 = MEP, 2 = SET, 3 = MET, 4 = JET, 5 = REG, 6 = NBA, 7 = WBA, 8 = HEL + /// The simulator (or NULL for all simulators). 0 = MSFS, 1 = XPlane11 + /// Success + /// A server side error occurred. + public System.Threading.Tasks.Task GetJobsAtAirportForCategoryAndSimulatorAsync(string icao, JobDirection direction, AircraftTypeCategory category, Simulator simulator) + { + return GetJobsAtAirportForCategoryAndSimulatorAsync(icao, direction, category, simulator, System.Threading.CancellationToken.None); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// Gets the available jobs at the specified airport for the specified aircraft type category and simulator. + /// The ICAO code of the airport. + /// The direction of the jobs to return. 0 = From, 1 = To, 2 = RoundTrip + /// The aircraft type category to return jobs for (recommended category). 0 = SEP, 1 = MEP, 2 = SET, 3 = MET, 4 = JET, 5 = REG, 6 = NBA, 7 = WBA, 8 = HEL + /// The simulator (or NULL for all simulators). 0 = MSFS, 1 = XPlane11 + /// Success + /// A server side error occurred. + public async System.Threading.Tasks.Task GetJobsAtAirportForCategoryAndSimulatorAsync(string icao, JobDirection direction, AircraftTypeCategory category, Simulator simulator, System.Threading.CancellationToken cancellationToken) + { + if (icao == null) + throw new System.ArgumentNullException("icao"); + + if (direction == null) + throw new System.ArgumentNullException("direction"); + + if (category == null) + throw new System.ArgumentNullException("category"); + + if (simulator == null) + throw new System.ArgumentNullException("simulator"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Job/atAirportForCategoryAndSim/{icao}/{direction}/{category}/{simulator}"); + urlBuilder_.Replace("{icao}", System.Uri.EscapeDataString(ConvertToString(icao, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Replace("{direction}", System.Uri.EscapeDataString(ConvertToString(direction, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Replace("{category}", System.Uri.EscapeDataString(ConvertToString(category, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Replace("{simulator}", System.Uri.EscapeDataString(ConvertToString(simulator, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + /// Gets the available jobs at the specified airport for the specified aircraft type category. /// The ICAO code of the airport. /// The direction of the jobs to return. 0 = From, 1 = To, 2 = RoundTrip @@ -5964,7 +6242,7 @@ public async System.Threading.Tasks.Task GetJobsAtAir throw new System.ArgumentNullException("category"); var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Job/atAirport/{icao}/{direction}/{category}"); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/Job/atAirportForCategory/{icao}/{direction}/{category}"); urlBuilder_.Replace("{icao}", System.Uri.EscapeDataString(ConvertToString(icao, System.Globalization.CultureInfo.InvariantCulture))); urlBuilder_.Replace("{direction}", System.Uri.EscapeDataString(ConvertToString(direction, System.Globalization.CultureInfo.InvariantCulture))); urlBuilder_.Replace("{category}", System.Uri.EscapeDataString(ConvertToString(category, System.Globalization.CultureInfo.InvariantCulture))); @@ -6602,7 +6880,7 @@ public partial class Aircraft /// Gets or sets the aircraft registration. [Newtonsoft.Json.JsonProperty("registry", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required] - [System.ComponentModel.DataAnnotations.StringLength(10, MinimumLength = 5)] + [System.ComponentModel.DataAnnotations.StringLength(12, MinimumLength = 7)] public string Registry { get; set; } /// Gets or sets the rent price per flight hour for the aircraft. Null if not available for rent. @@ -7121,8 +7399,11 @@ public partial class Airport [Newtonsoft.Json.JsonProperty("hasAvGas", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public bool HasAvGas { get; set; } - [Newtonsoft.Json.JsonProperty("hasBeenPopulated", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public ProcessingStatus HasBeenPopulated { get; set; } + [Newtonsoft.Json.JsonProperty("hasBeenPopulatedMSFS", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public ProcessingStatus HasBeenPopulatedMSFS { get; set; } + + [Newtonsoft.Json.JsonProperty("hasBeenPopulatedXP11", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public ProcessingStatus HasBeenPopulatedXP11 { get; set; } /// Gets or sets a value indicating whether the airport has jet fuel for refueling. [Newtonsoft.Json.JsonProperty("hasJetFuel", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -7164,7 +7445,7 @@ public partial class Airport [Newtonsoft.Json.JsonProperty("longitude", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public double Longitude { get; set; } - /// Gets or sets a value indicating whether the airport if available in MSFS 2020. + /// Gets or sets a value indicating whether the airport is available in MSFS 2020. [Newtonsoft.Json.JsonProperty("msfs", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public bool Msfs { get; set; } @@ -7231,6 +7512,10 @@ public partial class Airport [Newtonsoft.Json.JsonProperty("unicomFrequency", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public int? UnicomFrequency { get; set; } + /// Gets or sets a value indicating whether the airport is available in XPlane 11. + [Newtonsoft.Json.JsonProperty("xP11", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool XP11 { get; set; } + } @@ -8059,7 +8344,7 @@ public partial class FinalReport } - /// Financial categories. 0 = None, 1 = Aircraft, 2 = Fuel, 3 = Maintenance, 4 = AirportFees, 5 = Salaries, 6 = Loan, 7 = Interest, 8 = Shares, 9 = Dividend, 10 = FBO, 11 = Cargo, 12 = Passengers, 13 = SpecialtyJobs, 14 = Fines + /// Financial categories. 0 = None, 1 = Aircraft, 2 = Fuel, 3 = Maintenance, 4 = AirportFees, 5 = Salaries, 6 = Loan, 7 = Interest, 8 = Shares, 9 = Dividend, 10 = FBO, 11 = Cargo, 12 = Passengers, 13 = SpecialtyJobs, 14 = Fines, -1 = Flight [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v11.0.0.0)")] public enum FinancialCategory { @@ -8093,6 +8378,8 @@ public enum FinancialCategory Fines = 14, + Flight = -1, + } /// Financial overview model. @@ -8544,6 +8831,9 @@ public partial class FlightLog [Newtonsoft.Json.JsonProperty("route", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public string Route { get; set; } + [Newtonsoft.Json.JsonProperty("simulator", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Simulator Simulator { get; set; } + /// Gets or sets the Date/Time of when the flight was started. [Newtonsoft.Json.JsonProperty("started", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public System.DateTimeOffset Started { get; set; } @@ -9007,11 +9297,13 @@ public partial class JobIEnumerableApiResponse } - /// Job types. 0 = Cargo + /// Job types. 0 = Cargo_L, 1 = Cargo_S [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v11.0.0.0)")] public enum JobType { - Cargo = 0, + Cargo_L = 0, + + Cargo_S = 1, } diff --git a/OpenSky.Agent.Simulator/OpenAPIs/swagger.json b/OpenSky.Agent.Simulator/OpenAPIs/swagger.json index 881ad01..70dcae1 100644 --- a/OpenSky.Agent.Simulator/OpenAPIs/swagger.json +++ b/OpenSky.Agent.Simulator/OpenAPIs/swagger.json @@ -2156,6 +2156,38 @@ } } }, + "/DataImport": { + "get": { + "tags": [ + "DataImport" + ], + "summary": "Get data imports.", + "description": "sushi.at, 02/07/2021.", + "operationId": "GetDataImports", + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/DataImportIEnumerableApiResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/DataImportIEnumerableApiResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/DataImportIEnumerableApiResponse" + } + } + } + } + } + } + }, "/DataImport/status/{importID}": { "get": { "tags": [ @@ -2200,31 +2232,50 @@ } } }, - "/DataImport": { - "get": { + "/DataImport/littleNavmapMSFS": { + "post": { "tags": [ "DataImport" ], - "summary": "Get data imports.", - "description": "sushi.at, 02/07/2021.", - "operationId": "GetDataImports", + "summary": "Post LittleNavmap MSFS sqlite database for import.", + "description": "sushi.at, 04/05/2021.", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "fileUpload": { + "type": "string", + "format": "binary" + } + } + }, + "encoding": { + "fileUpload": { + "style": "form" + } + } + } + } + }, "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { - "$ref": "#/components/schemas/DataImportIEnumerableApiResponse" + "$ref": "#/components/schemas/GuidNullableApiResponse" } }, "application/json": { "schema": { - "$ref": "#/components/schemas/DataImportIEnumerableApiResponse" + "$ref": "#/components/schemas/GuidNullableApiResponse" } }, "text/json": { "schema": { - "$ref": "#/components/schemas/DataImportIEnumerableApiResponse" + "$ref": "#/components/schemas/GuidNullableApiResponse" } } } @@ -2232,12 +2283,12 @@ } } }, - "/DataImport/littleNavmapMSFS": { + "/DataImport/littleNavmapXP11": { "post": { "tags": [ "DataImport" ], - "summary": "Post LittleNavmap MSFS sqlite database for import.", + "summary": "Post LittleNavmap XPlane11 sqlite database for import.", "description": "sushi.at, 04/05/2021.", "requestBody": { "content": { @@ -3162,6 +3213,67 @@ } } }, + "/Job/atAirportForSim/{icao}/{direction}/{simulator}": { + "get": { + "tags": [ + "Job" + ], + "summary": "Gets the available jobs at the specified airport and simulator.", + "description": "sushi.at, 10/12/2021.", + "operationId": "GetJobsAtAirportForSimulator", + "parameters": [ + { + "name": "icao", + "in": "path", + "description": "The ICAO code of the airport.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "direction", + "in": "path", + "description": "The direction of the jobs to return. 0 = From, 1 = To, 2 = RoundTrip", + "required": true, + "schema": { + "$ref": "#/components/schemas/JobDirection" + } + }, + { + "name": "simulator", + "in": "path", + "description": "The simulator (or NULL for all simulators). 0 = MSFS, 1 = XPlane11", + "required": true, + "schema": { + "$ref": "#/components/schemas/Simulator" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/JobIEnumerableApiResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/JobIEnumerableApiResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/JobIEnumerableApiResponse" + } + } + } + } + } + } + }, "/Job/atAirport/{icao}/{direction}": { "get": { "tags": [ @@ -3214,7 +3326,77 @@ } } }, - "/Job/atAirport/{icao}/{direction}/{category}": { + "/Job/atAirportForCategoryAndSim/{icao}/{direction}/{category}/{simulator}": { + "get": { + "tags": [ + "Job" + ], + "summary": "Gets the available jobs at the specified airport for the specified aircraft type category and simulator.", + "description": "sushi.at, 10/12/2021.", + "operationId": "GetJobsAtAirportForCategoryAndSimulator", + "parameters": [ + { + "name": "icao", + "in": "path", + "description": "The ICAO code of the airport.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "direction", + "in": "path", + "description": "The direction of the jobs to return. 0 = From, 1 = To, 2 = RoundTrip", + "required": true, + "schema": { + "$ref": "#/components/schemas/JobDirection" + } + }, + { + "name": "category", + "in": "path", + "description": "The aircraft type category to return jobs for (recommended category). 0 = SEP, 1 = MEP, 2 = SET, 3 = MET, 4 = JET, 5 = REG, 6 = NBA, 7 = WBA, 8 = HEL", + "required": true, + "schema": { + "$ref": "#/components/schemas/AircraftTypeCategory" + } + }, + { + "name": "simulator", + "in": "path", + "description": "The simulator (or NULL for all simulators). 0 = MSFS, 1 = XPlane11", + "required": true, + "schema": { + "$ref": "#/components/schemas/Simulator" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/JobIEnumerableApiResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/JobIEnumerableApiResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/JobIEnumerableApiResponse" + } + } + } + } + } + } + }, + "/Job/atAirportForCategory/{icao}/{direction}/{category}": { "get": { "tags": [ "Job" @@ -3631,8 +3813,8 @@ "nullable": true }, "registry": { - "maxLength": 10, - "minLength": 5, + "maxLength": 12, + "minLength": 7, "type": "string", "description": "Gets or sets the aircraft registration." }, @@ -4292,7 +4474,10 @@ "type": "boolean", "description": "Gets or sets a value indicating whether the airport has AV gas for refueling." }, - "hasBeenPopulated": { + "hasBeenPopulatedMSFS": { + "$ref": "#/components/schemas/ProcessingStatus" + }, + "hasBeenPopulatedXP11": { "$ref": "#/components/schemas/ProcessingStatus" }, "hasJetFuel": { @@ -4341,7 +4526,7 @@ }, "msfs": { "type": "boolean", - "description": "Gets or sets a value indicating whether the airport if available in MSFS 2020." + "description": "Gets or sets a value indicating whether the airport is available in MSFS 2020." }, "name": { "maxLength": 50, @@ -4424,6 +4609,10 @@ "description": "Gets or sets the unicom frequency (if available).", "format": "int32", "nullable": true + }, + "xP11": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the airport is available in XPlane 11." } }, "additionalProperties": false, @@ -5593,10 +5782,11 @@ 11, 12, 13, - 14 + 14, + -1 ], "type": "integer", - "description": "Financial categories. 0 = None, 1 = Aircraft, 2 = Fuel, 3 = Maintenance, 4 = AirportFees, 5 = Salaries, 6 = Loan, 7 = Interest, 8 = Shares, 9 = Dividend, 10 = FBO, 11 = Cargo, 12 = Passengers, 13 = SpecialtyJobs, 14 = Fines", + "description": "Financial categories. 0 = None, 1 = Aircraft, 2 = Fuel, 3 = Maintenance, 4 = AirportFees, 5 = Salaries, 6 = Loan, 7 = Interest, 8 = Shares, 9 = Dividend, 10 = FBO, 11 = Cargo, 12 = Passengers, 13 = SpecialtyJobs, 14 = Fines, -1 = Flight", "format": "int32", "x-enumNames": [ "None", @@ -5613,7 +5803,8 @@ "Cargo", "Passengers", "SpecialtyJobs", - "Fines" + "Fines", + "Flight" ], "x-enum-varnames": [ "None", @@ -5630,7 +5821,8 @@ "Cargo", "Passengers", "SpecialtyJobs", - "Fines" + "Fines", + "Flight" ] }, "FinancialOverview": { @@ -6219,6 +6411,9 @@ "description": "Gets or sets the route.", "nullable": true }, + "simulator": { + "$ref": "#/components/schemas/Simulator" + }, "started": { "type": "string", "description": "Gets or sets the Date/Time of when the flight was started.", @@ -6825,16 +7020,19 @@ }, "JobType": { "enum": [ - 0 + 0, + 1 ], "type": "integer", - "description": "Job types. 0 = Cargo", + "description": "Job types. 0 = Cargo_L, 1 = Cargo_S", "format": "int32", "x-enumNames": [ - "Cargo" + "Cargo_L", + "Cargo_S" ], "x-enum-varnames": [ - "Cargo" + "Cargo_L", + "Cargo_S" ] }, "LinkedAccounts": { diff --git a/OpenSky.Agent/App.xaml.cs b/OpenSky.Agent/App.xaml.cs index 64b7a0a..943be05 100644 --- a/OpenSky.Agent/App.xaml.cs +++ b/OpenSky.Agent/App.xaml.cs @@ -23,7 +23,9 @@ namespace OpenSky.Agent using OpenSky.Agent.Simulator.Enums; using OpenSky.Agent.Simulator.Models; using OpenSky.Agent.Simulator.Tools; +#if DEBUG using OpenSky.Agent.Tools; +#endif using OpenSkyApi; diff --git a/OpenSky.Agent/Views/Models/StartupViewModel.cs b/OpenSky.Agent/Views/Models/StartupViewModel.cs index be31e97..a0091c9 100644 --- a/OpenSky.Agent/Views/Models/StartupViewModel.cs +++ b/OpenSky.Agent/Views/Models/StartupViewModel.cs @@ -17,7 +17,9 @@ namespace OpenSky.Agent.Views.Models using System.Windows.Media.Imaging; using DiscordRPC; +#if DEBUG using DiscordRPC.Logging; +#endif using JetBrains.Annotations; diff --git a/OpenSky.Agent/app.config b/OpenSky.Agent/app.config deleted file mode 100644 index 05f35e9..0000000 --- a/OpenSky.Agent/app.config +++ /dev/null @@ -1,70 +0,0 @@ - - - - -
- - -
- - - - - - - - - True - - - localhost - - - 500 - - - - - - 1 - - - - - - - - - - - - - - - - - - - - - SimConnectMSFS - - - - - - - http://localhost:5001/apptoken/0932018B-FB9C-4B59-B898-C4244EAC6D0B - - - http://localhost:5000 - - - https://api.github.com/repos/opensky-to/agent/releases/latest - - - http://localhost:5001/changepassword - - - - \ No newline at end of file