diff --git a/openapi/functions/applyAdvancedGameSettings/applyAdvancedGameSettings.yml b/openapi/functions/applyAdvancedGameSettings/applyAdvancedGameSettings.yml index 745fb0a..4ef9d00 100644 --- a/openapi/functions/applyAdvancedGameSettings/applyAdvancedGameSettings.yml +++ b/openapi/functions/applyAdvancedGameSettings/applyAdvancedGameSettings.yml @@ -3,6 +3,8 @@ post: operationId: ApplyAdvancedGameSettings description: | Applies new values to the provided Advanced Game Settings properties. Will automatically enable Advanced Game Settings for the currently loaded save if they are not enabled already. + tags: + - Game security: - bearerAuth: ['Administrator'] requestBody: diff --git a/openapi/functions/applyServerOptions/applyServerOptions.yml b/openapi/functions/applyServerOptions/applyServerOptions.yml index 91e858c..aeafc8b 100644 --- a/openapi/functions/applyServerOptions/applyServerOptions.yml +++ b/openapi/functions/applyServerOptions/applyServerOptions.yml @@ -3,6 +3,8 @@ post: operationId: ApplyServerOptions description: | Applies new Server Options to the Dedicated Server. Requires Admin privileges. + tags: + - Server security: - bearerAuth: ['Administrator'] requestBody: diff --git a/openapi/functions/claimServer/claimServer.yml b/openapi/functions/claimServer/claimServer.yml index 5fd5dc5..c4997a1 100644 --- a/openapi/functions/claimServer/claimServer.yml +++ b/openapi/functions/claimServer/claimServer.yml @@ -3,6 +3,9 @@ post: operationId: ClaimServer description: | Claims this Dedicated Server if it is not claimed. Requires InitialAdmin privilege level, which can only be acquired by attempting passwordless login while the server does not have an Admin Password set, e.g. it is not claimed yet. Function does not return any data in case of success, and the server is claimed. The client should drop InitialAdmin privileges after that and use returned AuthenticationToken instead, and update it's cached server game state by calling QueryServerState. + tags: + - Setup + - Server security: - bearerAuth: ['InitialAdmin'] requestBody: diff --git a/openapi/functions/createNewGame/createNewGame.yml b/openapi/functions/createNewGame/createNewGame.yml index 3bb922d..7c6da5f 100644 --- a/openapi/functions/createNewGame/createNewGame.yml +++ b/openapi/functions/createNewGame/createNewGame.yml @@ -3,6 +3,9 @@ post: operationId: CreateNewGame description: | Creates a new session on the Dedicated Server, and immediately loads it. HTTPS API becomes temporarily unavailable when map loading is in progress | Function does not return any data on success. + tags: + - Setup + - Game security: - bearerAuth: [] requestBody: diff --git a/openapi/functions/deleteSaveFile/deleteSaveFile.yml b/openapi/functions/deleteSaveFile/deleteSaveFile.yml index a8f377f..5e9cabc 100644 --- a/openapi/functions/deleteSaveFile/deleteSaveFile.yml +++ b/openapi/functions/deleteSaveFile/deleteSaveFile.yml @@ -3,6 +3,8 @@ post: operationId: DeleteSaveFile description: | Deletes the existing save game file from the server. Requires Admin privileges. SaveName might be changed to satisfy file system restrictions on file names. Function does not return any data on success. + tags: + - Saves security: - bearerAuth: ['Administrator'] requestBody: diff --git a/openapi/functions/deleteSaveSession/deleteSaveSession.yml b/openapi/functions/deleteSaveSession/deleteSaveSession.yml index bbd7d1f..49e297a 100644 --- a/openapi/functions/deleteSaveSession/deleteSaveSession.yml +++ b/openapi/functions/deleteSaveSession/deleteSaveSession.yml @@ -3,6 +3,8 @@ post: operationId: DeleteSaveSession description: | Deletes all save files belonging to the specific session name. Requires Admin privileges. SessionName must be a valid session name with at least one saved save game file belonging to it. Function does not return any data on success. + tags: + - Sessions security: - bearerAuth: ['Administrator'] requestBody: diff --git a/openapi/functions/downloadSaveGame/downloadSaveGame.yml b/openapi/functions/downloadSaveGame/downloadSaveGame.yml index 8ef388c..33db7f6 100644 --- a/openapi/functions/downloadSaveGame/downloadSaveGame.yml +++ b/openapi/functions/downloadSaveGame/downloadSaveGame.yml @@ -3,6 +3,8 @@ post: operationId: DownloadSaveGame description: | Downloads save game with the given name from the Dedicated Server. Requires Admin privileges. This function responds with the file attachment containing the save game file on success, and with normal error response in case of error. + tags: + - Saves security: - bearerAuth: ['Administrator'] requestBody: diff --git a/openapi/functions/enumerateSessions/enumerateSessions.yml b/openapi/functions/enumerateSessions/enumerateSessions.yml index e1c6b79..a6cf985 100644 --- a/openapi/functions/enumerateSessions/enumerateSessions.yml +++ b/openapi/functions/enumerateSessions/enumerateSessions.yml @@ -3,6 +3,8 @@ post: operationId: EnumerateSessions description: | Enumerates all save game files available on the Dedicated Server. Requires Admin privileges. Function does not require any additional parameters. + tags: + - Sessions security: - bearerAuth: ['Administrator'] requestBody: diff --git a/openapi/functions/getAdvancedGameSettings/getAdvancedGameSettings.yml b/openapi/functions/getAdvancedGameSettings/getAdvancedGameSettings.yml index 27110af..781b720 100644 --- a/openapi/functions/getAdvancedGameSettings/getAdvancedGameSettings.yml +++ b/openapi/functions/getAdvancedGameSettings/getAdvancedGameSettings.yml @@ -3,6 +3,8 @@ post: operationId: GetAdvancedGameSettings description: | Retrieves currently applied advanced game settings. Does not require input parameters. + tags: + - Game security: - bearerAuth: [] requestBody: diff --git a/openapi/functions/getServerOptions/getServerOptions.yml b/openapi/functions/getServerOptions/getServerOptions.yml index 3b15d00..8067f48 100644 --- a/openapi/functions/getServerOptions/getServerOptions.yml +++ b/openapi/functions/getServerOptions/getServerOptions.yml @@ -3,6 +3,8 @@ post: operationId: GetServerOptions description: | Retrieves currently applied server options and server options that are still pending application (because of needing session or server restart) Does not require input parameters. + tags: + - Server security: - bearerAuth: [] requestBody: diff --git a/openapi/functions/healthCheck/healthCheck.yml b/openapi/functions/healthCheck/healthCheck.yml index d4ac905..79990c3 100644 --- a/openapi/functions/healthCheck/healthCheck.yml +++ b/openapi/functions/healthCheck/healthCheck.yml @@ -2,6 +2,8 @@ post: summary: Health Check operationId: HealthCheck description: Performs a health check on the Dedicated Server API. Allows passing additional data between Modded Dedicated Server and Modded Game Client. This function requires no Authentication. + tags: + - Server security: - {} requestBody: diff --git a/openapi/functions/loadGame/loadGame.yml b/openapi/functions/loadGame/loadGame.yml index c52903e..0214abf 100644 --- a/openapi/functions/loadGame/loadGame.yml +++ b/openapi/functions/loadGame/loadGame.yml @@ -3,6 +3,8 @@ post: operationId: LoadGame description: | Loads the save game file by name, optionally with Advanced Game Settings enabled. Requires Admin privileges. Dedicated Server HTTPS API will become temporarily unavailable when save game is being loaded. Function does not return any data on succcess. + tags: + - Saves security: - bearerAuth: ['Administrator'] requestBody: diff --git a/openapi/functions/passwordLogin/passwordLogin.yml b/openapi/functions/passwordLogin/passwordLogin.yml index fa56a3c..355169a 100644 --- a/openapi/functions/passwordLogin/passwordLogin.yml +++ b/openapi/functions/passwordLogin/passwordLogin.yml @@ -3,6 +3,8 @@ post: operationId: PasswordLogin description: | Attempts to log in to the Dedicated Server as a player using either Admin Password or Client Protection Password. This function requires no Authentication. + tags: + - Authorization security: - {} requestBody: diff --git a/openapi/functions/passwordlessLogin/passwordlessLogin.yml b/openapi/functions/passwordlessLogin/passwordlessLogin.yml index e51d322..6df0b73 100644 --- a/openapi/functions/passwordlessLogin/passwordlessLogin.yml +++ b/openapi/functions/passwordlessLogin/passwordlessLogin.yml @@ -3,6 +3,8 @@ post: operationId: PasswordlessLogin description: | Attempts to perform a passwordless login to the Dedicated Server as a player. Passwordless login is possible if the Dedicated Server is not claimed, or if Client Protection Password is not set for the Dedicated Server. This function requires no Authentication. + tags: + - Authorization security: - {} requestBody: diff --git a/openapi/functions/queryServerState/queryServerState.yml b/openapi/functions/queryServerState/queryServerState.yml index 085d4c5..d3686e9 100644 --- a/openapi/functions/queryServerState/queryServerState.yml +++ b/openapi/functions/queryServerState/queryServerState.yml @@ -3,6 +3,8 @@ post: operationId: QueryServerState description: | Retrieves the current state of the Dedicated Server. Does not require any input parameters. + tags: + - Server security: - bearerAuth: [] requestBody: diff --git a/openapi/functions/renameServer/renameServer.yml b/openapi/functions/renameServer/renameServer.yml index 5e8c8d2..6361777 100644 --- a/openapi/functions/renameServer/renameServer.yml +++ b/openapi/functions/renameServer/renameServer.yml @@ -3,6 +3,8 @@ post: operationId: RenameServer description: | Renames the Dedicated Server once it has been claimed. Requires Admin privileges. Function does not return any data on success. + tags: + - Server security: - bearerAuth: ['Administrator'] requestBody: diff --git a/openapi/functions/runCommand/runCommand.yml b/openapi/functions/runCommand/runCommand.yml index 3201bc2..6612646 100644 --- a/openapi/functions/runCommand/runCommand.yml +++ b/openapi/functions/runCommand/runCommand.yml @@ -3,6 +3,8 @@ post: operationId: RunCommand description: | Runs the given Console Command on the Dedicated Server, and returns it's output to the Console. Requires Admin privileges. + tags: + - Server security: - bearerAuth: ['Administrator'] requestBody: diff --git a/openapi/functions/saveGame/saveGame.yml b/openapi/functions/saveGame/saveGame.yml index 5183592..6e1246a 100644 --- a/openapi/functions/saveGame/saveGame.yml +++ b/openapi/functions/saveGame/saveGame.yml @@ -3,6 +3,8 @@ post: operationId: SaveGame description: | Saves the currently loaded session into the new save game file named as the argument. Requires Admin privileges. SaveName might be changed to satisfy file system restrictions on file names. Function does not return any data on success. + tags: + - Saves security: - bearerAuth: ['Administrator'] requestBody: diff --git a/openapi/functions/setAdminPassword/setAdminPassword.yml b/openapi/functions/setAdminPassword/setAdminPassword.yml index 739df8e..a0d1c1d 100644 --- a/openapi/functions/setAdminPassword/setAdminPassword.yml +++ b/openapi/functions/setAdminPassword/setAdminPassword.yml @@ -3,6 +3,8 @@ post: operationId: SetAdminPassword description: | Updates the currently set Admin Password. This will invalidate all previously issued Client and Admin authentication tokens. Requires Admin privileges. Function does not return any data on success. + tags: + - Authorization security: - bearerAuth: ['Administrator'] requestBody: diff --git a/openapi/functions/setAutoLoadSessionName/setAutoLoadSessionName.yml b/openapi/functions/setAutoLoadSessionName/setAutoLoadSessionName.yml index c48af8e..572d2f6 100644 --- a/openapi/functions/setAutoLoadSessionName/setAutoLoadSessionName.yml +++ b/openapi/functions/setAutoLoadSessionName/setAutoLoadSessionName.yml @@ -3,6 +3,9 @@ post: operationId: SetAutoLoadSessionName description: | Updates the name of the session that the Dedicated Server will automatically load on startup. Does not change currently loaded session. Requires Admin privileges. Function does not return any data on success. + tags: + - Server + - Sessions security: - bearerAuth: ['Administrator'] requestBody: diff --git a/openapi/functions/setClientPassword/setClientPassword.yml b/openapi/functions/setClientPassword/setClientPassword.yml index 811bc9c..50b2156 100644 --- a/openapi/functions/setClientPassword/setClientPassword.yml +++ b/openapi/functions/setClientPassword/setClientPassword.yml @@ -3,6 +3,9 @@ post: operationId: SetClientPassword description: | Updates the currently set Client Protection Password. This will invalidate all previously issued Client authentication tokens. Pass empty string to remove the password, and let anyone join the server as Client. Requres Admin privileges. Function does not return any data on success. + tags: + - Authorization + - Server security: - bearerAuth: ['Administrator'] requestBody: diff --git a/openapi/functions/shutdown/shutdown.yml b/openapi/functions/shutdown/shutdown.yml index 9484767..ff6cb52 100644 --- a/openapi/functions/shutdown/shutdown.yml +++ b/openapi/functions/shutdown/shutdown.yml @@ -3,6 +3,8 @@ post: operationId: Shutdown description: | Shuts down the Dedicated Server. If automatic restart script is setup, this allows restarting the server to apply new settings or update. Requires Admin privileges. Shutdowns initiated by remote hosts are logged with their IP and their token. Function does not return any data on success, and does not take any parameters. + tags: + - Server security: - bearerAuth: ['Administrator'] requestBody: diff --git a/openapi/functions/uploadSaveGame/uploadSaveGame.yml b/openapi/functions/uploadSaveGame/uploadSaveGame.yml index 303c9f0..95398c5 100644 --- a/openapi/functions/uploadSaveGame/uploadSaveGame.yml +++ b/openapi/functions/uploadSaveGame/uploadSaveGame.yml @@ -3,6 +3,8 @@ post: operationId: UploadSaveGame description: | Shuts down the Dedicated Server. If automatic restart script is setup, this allows restarting the server to apply new settings or update. Requires Admin privileges. Shutdowns initiated by remote hosts are logged with their IP and their token. Function does not return any data on success, and does not take any parameters. + tags: + - Saves security: - bearerAuth: ['Administrator'] requestBody: diff --git a/openapi/functions/verifyAuthenticationToken/verifyAuthenticationToken.yml b/openapi/functions/verifyAuthenticationToken/verifyAuthenticationToken.yml index 41ea5dc..f83a2c0 100644 --- a/openapi/functions/verifyAuthenticationToken/verifyAuthenticationToken.yml +++ b/openapi/functions/verifyAuthenticationToken/verifyAuthenticationToken.yml @@ -2,6 +2,8 @@ post: summary: Verify Authentication Token operationId: VerifyAuthenticationToken description: Verifies the Authentication token provided to the Dedicated Server API. Returns No Content if the provided token is valid. This function does not require input parameters and does not return any data. + tags: + - Authorization security: - bearerAuth: [] requestBody: diff --git a/openapi/openapi.yml b/openapi/openapi.yml index b3a93c0..17d6c31 100644 --- a/openapi/openapi.yml +++ b/openapi/openapi.yml @@ -17,14 +17,32 @@ components: scheme: bearer bearerFormat: JWT +tags: +- name: Setup + description: Functions typically ran shortly after a Game Server starts up for the first time +- name: Authorization + description: Anything related to API or Server access +- name: Server + description: Anything related to managing or adjusting the Server +- name: Game + description: Anything related to the game running on the Server +- name: Saves + description: Individual Save related management +- name: Sessions + description: Save Sessions related management paths: - # HealthCheck - '/api/v1/?function=HealthCheck': - $ref: functions/healthCheck/healthCheck.yml - # VerifyAuthenticationToken - '/api/v1/?function=VerifyAuthenticationToken': - $ref: functions/verifyAuthenticationToken/verifyAuthenticationToken.yml + # --- Initialization + + # ClaimServer + '/api/v1/?function=ClaimServer': + $ref: functions/claimServer/claimServer.yml + + # CreateNewGame + '/api/v1/?function=CreateNewGame': + $ref: functions/createNewGame/createNewGame.yml + + # --- Authorization # PasswordlessLogin '/api/v1/?function=PasswordlessLogin': @@ -34,30 +52,6 @@ paths: '/api/v1/?function=PasswordLogin': $ref: functions/passwordLogin/passwordLogin.yml - # QueryServerState - '/api/v1/?function=QueryServerState': - $ref: functions/queryServerState/queryServerState.yml - - # GetServerOptions - '/api/v1/?function=GetServerOptions': - $ref: functions/getServerOptions/getServerOptions.yml - - # GetAdvancedGameSettings - '/api/v1/?function=GetAdvancedGameSettings': - $ref: functions/getAdvancedGameSettings/getAdvancedGameSettings.yml - - # ApplyAdvancedGameSettings - '/api/v1/?function=ApplyAdvancedGameSettings': - $ref: functions/applyAdvancedGameSettings/applyAdvancedGameSettings.yml - - # ClaimServer - '/api/v1/?function=ClaimServer': - $ref: functions/claimServer/claimServer.yml - - # RenameServer - '/api/v1/?function=RenameServer': - $ref: functions/renameServer/renameServer.yml - # SetClientPassword '/api/v1/?function=SetClientPassword': $ref: functions/setClientPassword/setClientPassword.yml @@ -66,10 +60,43 @@ paths: '/api/v1/?function=SetAdminPassword': $ref: functions/setAdminPassword/setAdminPassword.yml + # VerifyAuthenticationToken + '/api/v1/?function=VerifyAuthenticationToken': + $ref: functions/verifyAuthenticationToken/verifyAuthenticationToken.yml + + # --- Sessions + # - Placed here to keep a specific ordering in our generated documentation + + # EnumerateSessions + '/api/v1/?function=EnumerateSessions': + $ref: functions/enumerateSessions/enumerateSessions.yml + + # --- Server + + # HealthCheck + '/api/v1/?function=HealthCheck': + $ref: functions/healthCheck/healthCheck.yml + + # GetServerOptions + '/api/v1/?function=GetServerOptions': + $ref: functions/getServerOptions/getServerOptions.yml + + # ApplyServerOptions + '/api/v1/?function=ApplyServerOptions': + $ref: functions/applyServerOptions/applyServerOptions.yml + # SetAutoLoadSessionName '/api/v1/?function=SetAutoLoadSessionName': $ref: functions/setAutoLoadSessionName/setAutoLoadSessionName.yml + # QueryServerState + '/api/v1/?function=QueryServerState': + $ref: functions/queryServerState/queryServerState.yml + + # RenameServer + '/api/v1/?function=RenameServer': + $ref: functions/renameServer/renameServer.yml + # RunCommand '/api/v1/?function=RunCommand': $ref: functions/runCommand/runCommand.yml @@ -78,38 +105,41 @@ paths: '/api/v1/?function=Shutdown': $ref: functions/shutdown/shutdown.yml - # ApplyServerOptions - '/api/v1/?function=ApplyServerOptions': - $ref: functions/applyServerOptions/applyServerOptions.yml + # --- Sessions + # - Placed here to keep a specific ordering in our generated documentation - # CreateNewGame - '/api/v1/?function=CreateNewGame': - $ref: functions/createNewGame/createNewGame.yml + # DeleteSaveSession + '/api/v1/?function=DeleteSaveSession': + $ref: functions/deleteSaveSession/deleteSaveSession.yml + + # --- Game + + # GetAdvancedGameSettings + '/api/v1/?function=GetAdvancedGameSettings': + $ref: functions/getAdvancedGameSettings/getAdvancedGameSettings.yml + + # ApplyAdvancedGameSettings + '/api/v1/?function=ApplyAdvancedGameSettings': + $ref: functions/applyAdvancedGameSettings/applyAdvancedGameSettings.yml + + # --- Saves # SaveGame '/api/v1/?function=SaveGame': $ref: functions/saveGame/saveGame.yml - # DeleteSaveFile - '/api/v1/?function=DeleteSaveFile': - $ref: functions/deleteSaveFile/deleteSaveFile.yml - - # DeleteSaveSession - '/api/v1/?function=DeleteSaveSession': - $ref: functions/deleteSaveSession/deleteSaveSession.yml + # DownloadSaveGame + '/api/v1/?function=DownloadSaveGame': + $ref: functions/downloadSaveGame/downloadSaveGame.yml - # EnumerateSessions - '/api/v1/?function=EnumerateSessions': - $ref: functions/enumerateSessions/enumerateSessions.yml + # UploadSaveGame + '/api/v1/?function=UploadSaveGame': + $ref: functions/uploadSaveGame/uploadSaveGame.yml # LoadGame '/api/v1/?function=LoadGame': $ref: functions/loadGame/loadGame.yml - # UploadSaveGame - '/api/v1/?function=UploadSaveGame': - $ref: functions/uploadSaveGame/uploadSaveGame.yml - - # DownloadSaveGame - '/api/v1/?function=DownloadSaveGame': - $ref: functions/downloadSaveGame/downloadSaveGame.yml + # DeleteSaveFile + '/api/v1/?function=DeleteSaveFile': + $ref: functions/deleteSaveFile/deleteSaveFile.yml diff --git a/redocly.yml b/redocly.yml index 3bb6d0e..637ebbd 100644 --- a/redocly.yml +++ b/redocly.yml @@ -11,3 +11,6 @@ rules: theme: openapi: htmlTemplate: ./docs/index.html + jsonSampleExpandLevel: all + schemaExpansionLevel: all + sortOperationsAlphabetically: false