From 95bc22fba6a31c13636dc4ff505ea11bfc4cbb75 Mon Sep 17 00:00:00 2001 From: "sushi.at" Date: Fri, 22 Dec 2023 21:14:45 +0000 Subject: [PATCH] Removed bing maps key from account page --- OpenSky.Website/OpenAPIs/swagger.json | 676 +++++++++++++++++++++++++- OpenSky.Website/Pages/Account.razor | 16 - 2 files changed, 666 insertions(+), 26 deletions(-) diff --git a/OpenSky.Website/OpenAPIs/swagger.json b/OpenSky.Website/OpenAPIs/swagger.json index f4883d2..8f7a4f5 100644 --- a/OpenSky.Website/OpenAPIs/swagger.json +++ b/OpenSky.Website/OpenAPIs/swagger.json @@ -163,6 +163,38 @@ } } }, + "/Account/usernames": { + "get": { + "tags": [ + "Account" + ], + "summary": "Gets the username list of all OpenSky users.", + "description": "sushi.at, 18/12/2023.", + "operationId": "GetUserNames", + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/StringIEnumerableApiResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/StringIEnumerableApiResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/StringIEnumerableApiResponse" + } + } + } + } + } + } + }, "/Account/users": { "get": { "tags": [ @@ -4015,6 +4047,271 @@ } } }, + "/Notification": { + "post": { + "tags": [ + "Notification" + ], + "summary": "Add a new notification.", + "description": "sushi.at, 15/12/2023.", + "operationId": "AddNotification", + "requestBody": { + "description": "The add notification model.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AddNotification" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/AddNotification" + } + }, + "application/*+json": { + "schema": { + "$ref": "#/components/schemas/AddNotification" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/StringApiResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/StringApiResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/StringApiResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "Notification" + ], + "summary": "Get notifications for specified target.", + "description": "sushi.at, 18/12/2023.", + "operationId": "GetNotifications", + "parameters": [ + { + "name": "target", + "in": "query", + "description": "The target for the notification. 0 = Client, 1 = Agent, 2 = ClientAndAgent, 3 = Email, 4 = All", + "schema": { + "$ref": "#/components/schemas/NotificationTarget" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ClientNotificationIEnumerableApiResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientNotificationIEnumerableApiResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ClientNotificationIEnumerableApiResponse" + } + } + } + } + } + } + }, + "/Notification/{notificationID}/{target}": { + "put": { + "tags": [ + "Notification" + ], + "summary": "Confirm successful pickup of a notification for the specified target.", + "description": "sushi.at, 18/12/2023.", + "operationId": "ConfirmNotificationPickup", + "parameters": [ + { + "name": "notificationID", + "in": "path", + "description": "Identifier for the notification.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "target", + "in": "path", + "description": "The target of the notification. 0 = Client, 1 = Agent, 2 = ClientAndAgent, 3 = Email, 4 = All", + "required": true, + "schema": { + "$ref": "#/components/schemas/NotificationTarget" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/StringApiResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/StringApiResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/StringApiResponse" + } + } + } + } + } + } + }, + "/Notification/{groupingID}": { + "delete": { + "tags": [ + "Notification" + ], + "summary": "Delete specified notification group.", + "description": "sushi.at, 19/12/2023.", + "operationId": "DeleteNotification", + "parameters": [ + { + "name": "groupingID", + "in": "path", + "description": "Identifier for the grouping.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/StringApiResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/StringApiResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/StringApiResponse" + } + } + } + } + } + } + }, + "/Notification/fallbackEmailNow/{groupingID}": { + "put": { + "tags": [ + "Notification" + ], + "summary": "Active fallback to email NOW for specified notification.", + "description": "sushi.at, 19/12/2023.", + "operationId": "FallbackNotificationToEmailNow", + "parameters": [ + { + "name": "groupingID", + "in": "path", + "description": "Identifier for the grouping.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/StringApiResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/StringApiResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/StringApiResponse" + } + } + } + } + } + } + }, + "/Notification/all": { + "get": { + "tags": [ + "Notification" + ], + "summary": "Get all currently active notifications.", + "description": "sushi.at, 19/12/2023.", + "operationId": "GetAllNotifications", + "responses": { + "200": { + "description": "Success", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/GroupedNotificationIEnumerableApiResponse" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/GroupedNotificationIEnumerableApiResponse" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/GroupedNotificationIEnumerableApiResponse" + } + } + } + } + } + } + }, "/WorldStatistics": { "get": { "tags": [ @@ -4201,6 +4498,60 @@ "additionalProperties": false, "description": "API standard response model." }, + "AddNotification": { + "required": [ + "message" + ], + "type": "object", + "properties": { + "displayTimeout": { + "type": "integer", + "description": "Optional: Gets or sets the number of seconds after which to auto-dismiss the notification (or NULL for no\r\ntimeout)", + "format": "int32", + "nullable": true + }, + "emailFallbackHours": { + "type": "integer", + "description": "Optional: Gets or sets the number of hours after which the message gets sent via email if no client picked it up.", + "format": "int32", + "nullable": true + }, + "expiresInMinutes": { + "type": "integer", + "description": "Optional: Gets or sets the expiration in minutes.", + "format": "int32", + "nullable": true + }, + "message": { + "maxLength": 500, + "minLength": 0, + "type": "string", + "description": "Gets or sets the message." + }, + "recipientType": { + "$ref": "#/components/schemas/NotificationRecipient" + }, + "recipientUserName": { + "maxLength": 256, + "minLength": 0, + "type": "string", + "description": "Gets or sets the recipient username (only if recipient type is user).", + "nullable": true + }, + "sendAsSystem": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to send the notification as \"OpenSky System\"" + }, + "style": { + "$ref": "#/components/schemas/NotificationStyle" + }, + "target": { + "$ref": "#/components/schemas/NotificationTarget" + } + }, + "additionalProperties": false, + "description": "Add notification model." + }, "Aircraft": { "required": [ "airportICAO", @@ -4333,7 +4684,7 @@ }, "registry": { "maxLength": 12, - "minLength": 7, + "minLength": 6, "type": "string", "description": "Gets or sets the aircraft registration." }, @@ -5568,6 +5919,77 @@ "additionalProperties": false, "description": "Change password model." }, + "ClientNotification": { + "required": [ + "message" + ], + "type": "object", + "properties": { + "displayTimeout": { + "type": "integer", + "description": "Optional: The number of seconds after which to auto-dismiss the notification (or NULL for no\r\ntimeout)", + "format": "int32", + "nullable": true + }, + "id": { + "type": "string", + "description": "Gets or sets the identifier of the notification.", + "format": "uuid" + }, + "message": { + "maxLength": 500, + "minLength": 0, + "type": "string", + "description": "Gets or sets the message." + }, + "sender": { + "maxLength": 256, + "minLength": 0, + "type": "string", + "description": "Gets or sets the sender (or NULL for OpenSky System).", + "nullable": true + }, + "style": { + "$ref": "#/components/schemas/NotificationStyle" + } + }, + "additionalProperties": false, + "description": "Client/Agent notification model." + }, + "ClientNotificationIEnumerableApiResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClientNotification" + }, + "description": "Gets or sets the embedded data of type T.", + "nullable": true + }, + "errorDetails": { + "type": "string", + "description": "Gets or sets the error details (NULL if no error).", + "nullable": true + }, + "isError": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this response is reporting an error." + }, + "message": { + "type": "string", + "description": "Gets or sets the message.", + "nullable": true + }, + "status": { + "type": "string", + "description": "Gets or sets the status.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "API standard response model." + }, "Country": { "enum": [ 1, @@ -6729,8 +7151,8 @@ "type": "object", "properties": { "aircraftRegistry": { - "maxLength": 10, - "minLength": 5, + "maxLength": 12, + "minLength": 6, "type": "string", "description": "Gets or sets the aircraft registry (optional, if record relates to an aircraft).", "nullable": true @@ -6851,6 +7273,9 @@ "flightPhase": { "$ref": "#/components/schemas/FlightPhase" }, + "flightRule": { + "$ref": "#/components/schemas/FlightRule" + }, "fuelGallons": { "type": "number", "description": "Gets or sets the fuel in gallons.", @@ -7161,6 +7586,9 @@ "description": "Gets or sets the atc callsign.", "nullable": true }, + "category": { + "$ref": "#/components/schemas/AircraftTypeCategory" + }, "completed": { "type": "string", "description": "Gets or sets the Date/Time of when the flight was completed.", @@ -7501,6 +7929,9 @@ ], "type": "object", "properties": { + "flightRule": { + "$ref": "#/components/schemas/FlightRule" + }, "aircraft": { "$ref": "#/components/schemas/Aircraft" }, @@ -7649,6 +8080,23 @@ "additionalProperties": false, "description": "API standard response model." }, + "FlightRule": { + "enum": [ + 0, + 1 + ], + "type": "integer", + "description": "Flight rules. 0 = IFR, 1 = VFR", + "format": "int32", + "x-enumNames": [ + "IFR", + "VFR" + ], + "x-enum-varnames": [ + "IFR", + "VFR" + ] + }, "ForgotPassword": { "required": [ "email" @@ -7729,6 +8177,129 @@ "additionalProperties": false, "description": "Ground operations model." }, + "GroupedNotification": { + "type": "object", + "properties": { + "displayTimeout": { + "type": "integer", + "description": "Gets or sets the display timeout.", + "format": "int32", + "nullable": true + }, + "emailFallback": { + "type": "string", + "description": "Gets or sets the Date/Time of the email fallback.", + "format": "date-time", + "nullable": true + }, + "expires": { + "type": "string", + "description": "Gets or sets the Date/Time of the expiration.", + "format": "date-time", + "nullable": true + }, + "groupingID": { + "type": "string", + "description": "Gets or sets the identifier of the grouping.", + "format": "uuid" + }, + "markedForDeletion": { + "type": "string", + "description": "Gets or sets the Date/Time of the marked for deletion time.", + "format": "date-time", + "nullable": true + }, + "message": { + "type": "string", + "description": "Gets or sets the message.", + "nullable": true + }, + "recipients": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GroupedNotificationRecipient" + }, + "description": "Gets or sets the recipients.", + "nullable": true + }, + "sender": { + "type": "string", + "description": "Gets or sets the sender.", + "nullable": true + }, + "style": { + "$ref": "#/components/schemas/NotificationStyle" + }, + "target": { + "$ref": "#/components/schemas/NotificationTarget" + } + }, + "additionalProperties": false, + "description": "Grouped notification model." + }, + "GroupedNotificationIEnumerableApiResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GroupedNotification" + }, + "description": "Gets or sets the embedded data of type T.", + "nullable": true + }, + "errorDetails": { + "type": "string", + "description": "Gets or sets the error details (NULL if no error).", + "nullable": true + }, + "isError": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this response is reporting an error." + }, + "message": { + "type": "string", + "description": "Gets or sets the message.", + "nullable": true + }, + "status": { + "type": "string", + "description": "Gets or sets the status.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "API standard response model." + }, + "GroupedNotificationRecipient": { + "type": "object", + "properties": { + "agentPickup": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the agent has picked up the notification." + }, + "clientPickup": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the client has picked up the notification." + }, + "emailSent": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the email was sent." + }, + "id": { + "type": "string", + "description": "Gets or sets the identifier.", + "nullable": true + }, + "name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Grouped notification recipient." + }, "GuidApiResponse": { "type": "object", "properties": { @@ -7946,11 +8517,6 @@ "LinkedAccounts": { "type": "object", "properties": { - "bingMapsKey": { - "type": "string", - "description": "Gets or sets the Bing maps API key.", - "nullable": true - }, "simbriefUsername": { "type": "string", "description": "Gets or sets the Simbrief username.", @@ -8124,6 +8690,84 @@ "OutsourceFerry" ] }, + "NotificationRecipient": { + "enum": [ + 0, + 1, + 2, + 3 + ], + "type": "integer", + "description": "Notification recipients. 0 = User, 1 = Mods, 2 = Admins, 3 = Everyone", + "format": "int32", + "x-enumNames": [ + "User", + "Mods", + "Admins", + "Everyone" + ], + "x-enum-varnames": [ + "User", + "Mods", + "Admins", + "Everyone" + ] + }, + "NotificationStyle": { + "enum": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "type": "integer", + "description": "Notification styles. 0 = ToastInfo, 1 = MessageBoxInfo, 2 = ToastWarning, 3 = MessageBoxWarning, 4 = ToastError, 5 = MessageBoxError", + "format": "int32", + "x-enumNames": [ + "ToastInfo", + "MessageBoxInfo", + "ToastWarning", + "MessageBoxWarning", + "ToastError", + "MessageBoxError" + ], + "x-enum-varnames": [ + "ToastInfo", + "MessageBoxInfo", + "ToastWarning", + "MessageBoxWarning", + "ToastError", + "MessageBoxError" + ] + }, + "NotificationTarget": { + "enum": [ + 0, + 1, + 2, + 3, + 4 + ], + "type": "integer", + "description": "Notification targets. 0 = Client, 1 = Agent, 2 = ClientAndAgent, 3 = Email, 4 = All", + "format": "int32", + "x-enumNames": [ + "Client", + "Agent", + "ClientAndAgent", + "Email", + "All" + ], + "x-enum-varnames": [ + "Client", + "Agent", + "ClientAndAgent", + "Email", + "All" + ] + }, "OnlineNetwork": { "enum": [ 0, @@ -8149,9 +8793,21 @@ ], "type": "object", "properties": { + "aircraftLatitude": { + "type": "number", + "description": "Gets or sets the aircraft latitude (if currently loaded onto an aircraft).", + "format": "double", + "nullable": true + }, + "aircraftLongitude": { + "type": "number", + "description": "Gets or sets the aircraft longitude (if currently loaded onto an aircraft).", + "format": "double", + "nullable": true + }, "aircraftRegistry": { - "maxLength": 10, - "minLength": 5, + "maxLength": 12, + "minLength": 6, "type": "string", "description": "Gets or sets the aircraft registry the payload is currently loaded on, or NULL if stored at an airport.", "nullable": true diff --git a/OpenSky.Website/Pages/Account.razor b/OpenSky.Website/Pages/Account.razor index 151203a..0fa6a1a 100644 --- a/OpenSky.Website/Pages/Account.razor +++ b/OpenSky.Website/Pages/Account.razor @@ -39,16 +39,6 @@ -

- A Bing Maps key is required to correctly display the maps in the various clients, if you don't already have one please visit the - Bing Maps Dev Center and create one. -

-
-

Bing Maps Key:

- - -
-

You can import your simBrief flight plans into your flight plans and tracking sessions, to enable this feature please enter your account alias as shown on the simBrief Account Settings page. @@ -279,7 +269,6 @@ { AlertService.Error(response.Message); linkedAccounts.SimbriefUsername = string.Empty; - linkedAccounts.BingMapsKey = string.Empty; linkedAccounts.VatsimID = string.Empty; savingAccounts = false; StateHasChanged(); @@ -287,7 +276,6 @@ else { linkedAccounts.SimbriefUsername = response.Data.SimbriefUsername; - linkedAccounts.BingMapsKey = response.Data.BingMapsKey; linkedAccounts.VatsimID = response.Data.VatsimID; savingAccounts = false; StateHasChanged(); @@ -313,7 +301,6 @@ } linkedAccounts.SimbriefUsername = string.Empty; - linkedAccounts.BingMapsKey = string.Empty; linkedAccounts.VatsimID = string.Empty; savingAccounts = false; StateHasChanged(); @@ -322,7 +309,6 @@ { AlertService.Error(ex.Message, false, false); linkedAccounts.SimbriefUsername = string.Empty; - linkedAccounts.BingMapsKey = string.Empty; linkedAccounts.VatsimID = string.Empty; savingAccounts = false; StateHasChanged(); @@ -332,7 +318,6 @@ { AlertService.Error(ex.Message, false, false); linkedAccounts.SimbriefUsername = string.Empty; - linkedAccounts.BingMapsKey = string.Empty; linkedAccounts.VatsimID = string.Empty; savingAccounts = false; StateHasChanged(); @@ -342,7 +327,6 @@ { AlertService.Error(ex.Message, false, false); linkedAccounts.SimbriefUsername = string.Empty; - linkedAccounts.BingMapsKey = string.Empty; linkedAccounts.VatsimID = string.Empty; savingAccounts = false; StateHasChanged();