diff --git a/README b/offline/README similarity index 100% rename from README rename to offline/README diff --git a/swat-codegen/PKGBUILD b/swat-codegen/PKGBUILD new file mode 100644 index 0000000..6aebf4e --- /dev/null +++ b/swat-codegen/PKGBUILD @@ -0,0 +1,21 @@ +# Maintainer: Zergling_man, from fedora.email + +pkgname=swat-codegen +pkgver=1.0.2 +pkgrel=1 +pkgdesc="A simple CLI interface to RCPDv3, the rank code management service for the game SWAT: Aftermath" +arch=('any') +url=http://rakka.au/contact +license=('WTFPL+nigger') +depends=('jq' 'curl' 'coreutils' 'grep') +source=() +sha256sums=('SKIP') #Don't know how to use this on a repo. + +package() { + cd ${pkgdir} + install -d usr/bin opt/swat-codegen + cd ${srcdir}/${pkgname} + chmod a+x codegen.sh + cp swat_* codegen.sh ${pkgdir}/opt/swat-codegen + ln -s /opt/swat-codegen/codegen.sh /${pkgdir}/usr/bin/rcpd +} \ No newline at end of file diff --git a/swat-codegen/codegen.sh b/swat-codegen/codegen.sh new file mode 100755 index 0000000..b474f5f --- /dev/null +++ b/swat-codegen/codegen.sh @@ -0,0 +1,105 @@ +#!/bin/bash + +loc=$(dirname $(readlink -f "$0")) + +# TOKEN MANAGEMENT +function migrate +{ + curl "https://swataftermath.com:8443/account/$1/activate-migrated" --json '{"currentPassword":"'"$3"'","emailAddress":"'"$2"'","newPassword":"'"$3"'"}' + curl "https://swataftermath.com:8443/account/$1/verify-email" --json '{"verificationCode":"'"$(cat)"'"}' + login "$1" "$3" +} + +function login +{ + [ -n "$2" ] || { echo "Please provide a username and password, in that order, when calling this"; exit; } + curl https://swataftermath.com:8443/login --json '{"username":"'"$1"'","password":"'"$2"'"}' > ~/.config/rcpd.cfg +} + +function get_token +{ + cat ~/.config/rcpd.cfg 2>/dev/null || { echo "Please login first" >&2; exit; } +} + +# CORE API CALLS +function get +{ + TOKE=`get_token` + curl -H "Authorization:Bearer $TOKE" https://swataftermath.com:9443/account/$1 +} + +function post +{ + TOKE=`get_token` + curl -H "Authorization:Bearer $TOKE" https://swataftermath.com:9443/account/$1 --json "$2" +} + +function delete_code +{ + TOKE=`get_token` + curl -H "Authorization:Bearer $TOKE" https://swataftermath.com:9443/account/rank-code/$1 -X DELETE +} + +# UTILS +function lookup +{ + w= + matches=`grep -ic "${*:2}" $loc/swat_$1` + if [ "$matches" -ne 1 ]; then + echo "$1 '${*:2}' is ambiguous (got $matches matches), trying whole-word match" >&2 + # Attempt whole-word match and see if we get exactly one result (and then remember it has happened!!!) + w=w + word_matches=`grep -ic$w "${*:2}" $loc/swat_$1` + if [ "$word_matches" -ne 1 ]; then echo "still ambiguous (got $word_matches matches)" >&2; return 1; fi + fi + read $1 garbage <<< "`grep -i$w "${*:2}" $loc/swat_$1`" +} + +# USER-FACING COMMANDS +function builds +{ + if [ -n "$1" ]; then filter='.[] | select(.buildName=="'"$*"'")'; fi + get saved-builds | jq $filter +} + +function save +{ + if [ -n "$2" ]; then name=',"buildName":"'"${*:2}"'"'; fi + post rank-code '{"rankCode":"'$1'"'$name'}' | jq + if [ -z "$2" ]; then delete_code $1; fi # Don't bother storing any build that doesn't have a name. Assume it's just logging the results of a game. +} + +function generate +{ + # mfw I actually have to do work + IFS=/ read -a hero <<< "$*" + length=${#hero[*]} + if [ $length -eq 6 ]; then IFS=/ read class gun armour trait spec talent <<< "$*" + elif [ $length -eq 5 ]; then IFS=/ read class armour trait spec talent <<< "$*" + elif [ $length -eq 4 ]; then IFS=/ read class trait spec talent <<< "$*"; fi # Probably a borg or a wm. + if [ -z "$gun" ]; then + if [ "${class:2}" = "wm" ]; then gun=${class%wm}; class=wm + elif [ "${class:1}" = "mav" ] || [ "${class:2}" = "mav" ]; then gun=${class%mav}; class=mav; fi + fi + res=0 + lookup class "$class" + res=$((res+$?)) + if [ -z "$gun" ]; then gun=$class; fi # Do this after qualifying class so I don't have to nest the full class table in the gun table. + lookup gun "$gun" + res=$((res+$?)) + if [ -z "$armour" ]; then armour=$class; fi + lookup armour "$armour" + res=$((res+$?)) + lookup trait "$trait" + res=$((res+$?)) + lookup spec "$spec" + res=$((res+$?)) + lookup talent "$talent" + res=$((res+$?)) + if [ $res -gt 0 ]; then echo "Please correct above errors and try again"; exit; fi + echo $class $gun $armour $trait $spec $talent + post generate '{"swatClass":"'$class'","gun":"'$gun'","armor":"'$armour'","trait":"'$trait'","specialization":"'$spec'","talent":"'$talent'"}' | jq '.rankCode//.' +} + +# DO SHIT +$@ \ No newline at end of file diff --git a/swat-codegen/documentation.yaml b/swat-codegen/documentation.yaml new file mode 100644 index 0000000..46a73e6 --- /dev/null +++ b/swat-codegen/documentation.yaml @@ -0,0 +1,1251 @@ +{ + "openapi" : "3.1.0", + "info" : { + "title" : "SWAT Account Service API", + "description" : "API for the SWAT Account Service that allows creation, management, and authentication of SWAT accounts. A SWAT account can be used to access SWAT services, such as RCPD 3.0 (rcpd-service) and map marker. Accounts in RCPD 2.0 have been migrated to SWAT accounts with the same username and password.", + "version" : "0.14.0" + }, + "externalDocs" : { + "url" : "/" + }, + "servers" : [ { + "url" : "https://swataftermath.com:8443/" + } ], + "tags" : [ { + "name" : "Account Resource", + "description" : "Resource for managing accounts, such as creating new accounts, and modifying existing accounts." + }, { + "name" : "Authentication Resource", + "description" : "Resource for authenticating and getting a JWT." + }, { + "name" : "Email Verification Resource", + "description" : "Resource for verifying email addresses on accounts." + }, { + "name" : "Open API Resource", + "description" : "Resource for retrieving Open API documentation." + }, { + "name" : "Password Resource", + "description" : "Resource for resetting forgotten passwords." + } ], + "paths" : { + "/openapi/documentation.yaml" : { + "get" : { + "tags" : [ "Open API Resource" ], + "description" : "Get the raw Open API documentation.", + "parameters" : [ ], + "responses" : { + "200" : { + "description" : "The raw Open API documentation.", + "headers" : { }, + "content" : { + "text/yaml" : { + "schema" : { + "type" : "string", + "title" : "String" + } + } + } + } + }, + "deprecated" : false + } + }, + "/account" : { + "post" : { + "tags" : [ "Account Resource" ], + "description" : "Create a new SWAT account. Email address will need to be verified after the account is created, before you can log in.", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AccountCreationRequest" + } + } + }, + "required" : true + }, + "responses" : { + "500" : { + "description" : "An error occurred in the system.", + "headers" : { }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + }, + "examples" : { + "General Exception Response example" : { + "value" : { + "reference" : "kcog4koca5xhiegavarp", + "message" : "NullPointerException when deserializing value.", + "serviceName" : "swat-account-service" + } + } + } + } + } + }, + "201" : { + "description" : "New SWAT account successfully created.", + "headers" : { } + }, + "409" : { + "description" : "User name or email address is already registered.", + "headers" : { }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + }, + "examples" : { + "Duplicate Username or Email Exception Example" : { + "value" : { + "reference" : "kcog4koca5xhiegavarp", + "message" : "Email address [ testemail@test.com ] is already registered in the system.", + "serviceName" : "swat-account-service" + } + } + } + } + } + }, + "422" : { + "description" : "The request was invalid.", + "headers" : { }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ValidationErrorResponse" + }, + "examples" : { + "Invalid Request Exception Response example" : { + "value" : { + "reference" : "kcog4koca5xhiegavarp", + "message" : "request has validation errors", + "serviceName" : "swat-account-service", + "errors" : { + "emailAddress" : [ "must not be blank" ] + } + } + } + } + } + } + } + }, + "deprecated" : false + } + }, + "/account/{username}" : { + "put" : { + "tags" : [ "Account Resource" ], + "description" : "Update your SWAT account. This resource supports partial PUT operations, where all null values are ignored.", + "parameters" : [ { + "name" : "username", + "in" : "path", + "description" : "The username or email address of your account to update.", + "required" : true, + "deprecated" : false, + "explode" : false, + "schema" : { + "type" : "string", + "title" : "String" + }, + "example" : "Skater901" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AccountUpdateRequest" + } + } + }, + "required" : true + }, + "responses" : { + "500" : { + "description" : "An error occurred in the system.", + "headers" : { }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + }, + "examples" : { + "General Exception Response example" : { + "value" : { + "reference" : "kcog4koca5xhiegavarp", + "message" : "NullPointerException when deserializing value.", + "serviceName" : "swat-account-service" + } + } + } + } + } + }, + "204" : { + "description" : "The account was updated.", + "headers" : { } + }, + "401" : { + "description" : "Authorization token not provided or is invalid.", + "headers" : { }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + }, + "examples" : { + "Example Unauthorized Response" : { + "value" : { + "reference" : "kcog4koca5xhiegavarp", + "message" : "missing or invalid bearer token", + "serviceName" : "swat-account-service" + } + } + } + } + } + }, + "403" : { + "description" : "You are attempting to update an account that you do not have access to.", + "headers" : { }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + }, + "examples" : { + "Example Forbidden Response" : { + "value" : { + "reference" : "kcog4koca5xhiegavarp", + "message" : "HTTP 403 Forbidden", + "serviceName" : "swat-account-service" + } + } + } + } + } + }, + "422" : { + "description" : "The request was invalid.", + "headers" : { }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ValidationErrorResponse" + }, + "examples" : { + "Invalid Request Exception Response example" : { + "value" : { + "reference" : "kcog4koca5xhiegavarp", + "message" : "request has validation errors", + "serviceName" : "swat-account-service", + "errors" : { + "newPassword" : [ "must not be blank" ] + } + } + } + } + } + } + } + }, + "deprecated" : false, + "security" : [ { + "SWAT-Token" : [ ] + } ] + } + }, + "/account/{username}/activate-migrated" : { + "post" : { + "tags" : [ "Account Resource" ], + "description" : "Activate a migrated account, by setting an email address and changing the password. This is required for all migrated accounts before they can be used to get tokens.", + "parameters" : [ { + "name" : "username", + "in" : "path", + "description" : "The username of the account to activate.", + "required" : true, + "deprecated" : false, + "explode" : false, + "schema" : { + "type" : "string", + "title" : "String" + }, + "example" : "Skater901" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ActivateMigratedAccountRequest" + } + } + }, + "required" : true + }, + "responses" : { + "500" : { + "description" : "An error occurred in the system.", + "headers" : { }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + }, + "examples" : { + "General Exception Response example" : { + "value" : { + "reference" : "kcog4koca5xhiegavarp", + "message" : "NullPointerException when deserializing value.", + "serviceName" : "swat-account-service" + } + } + } + } + } + }, + "204" : { + "description" : "Migrated account activated successfully. An email will have been sent to the provided email address with a verification link to verify the email address.", + "headers" : { } + }, + "400" : { + "description" : "Account has already been activated.", + "headers" : { }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + }, + "examples" : { + "Account Already Activated Exception Response" : { + "value" : { + "reference" : "kcog4koca5xhiegavarp", + "message" : "Account has already been activated.", + "serviceName" : "swat-account-service" + } + } + } + } + } + }, + "401" : { + "description" : "The account does not exist or the password is incorrect.", + "headers" : { }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + }, + "examples" : { + "Example Unauthorized Response" : { + "value" : { + "reference" : "kcog4koca5xhiegavarp", + "message" : "Invalid username or password.", + "serviceName" : "swat-account-service" + } + } + } + } + } + }, + "409" : { + "description" : "The requested email address is already registered to another SWAT account.", + "headers" : { }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + }, + "examples" : { + "Email Address Already Registered Exception Response" : { + "value" : { + "reference" : "kcog4koca5xhiegavarp", + "message" : "Email address [ myemailaddress@gmail.com ] is already registered.", + "serviceName" : "swat-account-service" + } + } + } + } + } + }, + "422" : { + "description" : "The request was invalid.", + "headers" : { }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ValidationErrorResponse" + }, + "examples" : { + "Invalid Request Exception Response example" : { + "value" : { + "reference" : "kcog4koca5xhiegavarp", + "message" : "request has validation errors", + "serviceName" : "swat-account-service", + "errors" : { + "emailAddress" : [ "must not be blank" ], + "currentPassword" : [ "must not be blank" ], + "newPassword" : [ "must not be blank" ] + } + } + } + } + } + } + } + }, + "deprecated" : false + } + }, + "/login" : { + "post" : { + "tags" : [ "Authentication Resource" ], + "description" : "Get a JWT from a username/password or email address/password combination.", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/LoginRequest" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "Successfully logged in.", + "headers" : { }, + "content" : { + "application/json" : { + "schema" : { + "type" : "string", + "title" : "String" + }, + "examples" : { + "Example JWT Response" : { + "value" : "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkYjA3Nzc2ZS05ZTg2LTRhNGUtOTRkMC03ZDE3NzY2ODZkOWEiLCJqdGkiOiI4NWY4Njg5Yy0wODg5LTRlODUtOWM5Zi05MzY0MDllN2ZlMDciLCJhdWQiOiIiLCJpc3MiOiIiLCJleHAiOjE2OTA1NTczMzZ9.js0KMh7tyqGV4j7zQUs1du4RX16MQczXDCxgGmE_z_QX-551-O53dqX5MgnTufMOFmJ6pevzOwJqnAUcdM8Y2l2qrvUGuWO57vejwdo-tqZFE96AYZHH0cMuxZMNaA3-gtcd11dOvv01RAJWQkPEcj7aEgA2D0-paayhWClSpvMRUC2IkhTKbDvAO_5yAaseKKrSemJjboWrbfUHYvpz9GtvLhXUhWzFLzemu6ZQu2oSiGtuF7VcZfvJYwYdVL_LlxkPAEdiw_-8DYDWhBW4MuXOW8wlpLqtx4U2Ma2-Mn33e1gQll9xsazn85YnWHe_FAU1wQXiVhBb4PaYnr36yg" + } + } + } + } + }, + "401" : { + "description" : "Account doesn't exist or password is wrong.", + "headers" : { }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + }, + "examples" : { + "Example Unauthorized Response" : { + "value" : { + "reference" : "kcog4koca5xhiegavarp", + "message" : "Invalid username or password.", + "serviceName" : "swat-account-service" + } + } + } + } + } + }, + "422" : { + "description" : "The request was invalid.", + "headers" : { }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ValidationErrorResponse" + }, + "examples" : { + "Invalid Request Exception Response example" : { + "value" : { + "reference" : "kcog4koca5xhiegavarp", + "message" : "request has validation errors", + "serviceName" : "swat-account-service", + "errors" : { + "username" : [ "must not be blank" ] + } + } + } + } + } + } + }, + "490" : { + "description" : "The username and password were correct, but the email address for this account has not yet been verified.", + "headers" : { }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + }, + "examples" : { + "Unverified Email Address Exception Response" : { + "value" : { + "reference" : "kcog4koca5xhiegavarp", + "message" : "Email address has not been verified", + "serviceName" : "swat-account-service" + } + } + } + } + } + }, + "491" : { + "description" : "This is a migrated account from old RCPD. Please activate the account using the /account/{username}/activate-migrated endpoint.", + "headers" : { }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + }, + "examples" : { + "Not Activated Migrated Account Exception Response" : { + "value" : { + "reference" : "kcog4koca5xhiegavarp", + "message" : "Migrated RCPD account, please activate it.", + "serviceName" : "swat-account-service" + } + } + } + } + } + }, + "492" : { + "description" : "Your password is correct, but must be changed.", + "headers" : { }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + }, + "examples" : { + "Password Change Required Exception Response" : { + "value" : { + "reference" : "kcog4koca5xhiegavarp", + "message" : "Your password must be changed.", + "serviceName" : "swat-account-service" + } + } + } + } + } + }, + "500" : { + "description" : "An error occurred in the system.", + "headers" : { }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + }, + "examples" : { + "General Exception Response example" : { + "value" : { + "reference" : "kcog4koca5xhiegavarp", + "message" : "NullPointerException when deserializing value.", + "serviceName" : "swat-account-service" + } + } + } + } + } + } + }, + "deprecated" : false + } + }, + "/account/{username}/request-verification-code" : { + "post" : { + "tags" : [ "Email Verification Resource" ], + "description" : "Re-send the verification code for the specified account, creating a new code if the old code has expired.", + "parameters" : [ { + "name" : "username", + "in" : "path", + "description" : "The username or email address of the account you wish to perform the action on.", + "required" : true, + "deprecated" : false, + "explode" : false, + "schema" : { + "type" : "string", + "title" : "String" + }, + "example" : "test@test.com" + } ], + "responses" : { + "500" : { + "description" : "An error occurred in the system.", + "headers" : { }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + }, + "examples" : { + "General Exception Response example" : { + "value" : { + "reference" : "kcog4koca5xhiegavarp", + "message" : "NullPointerException when deserializing value.", + "serviceName" : "swat-account-service" + } + } + } + } + } + }, + "204" : { + "description" : "An email has been sent with a verification code for the specified email address. Please note, if the email address is not registered, this response will still be returned, in order to prevent malicious actors from discovering registered email addresses.", + "headers" : { } + } + }, + "deprecated" : false + } + }, + "/account/{username}/verify-email" : { + "post" : { + "tags" : [ "Email Verification Resource" ], + "description" : "Verify that your email address is a real email address and you have access to it.", + "parameters" : [ { + "name" : "username", + "in" : "path", + "description" : "The username or email address of the account you wish to perform the action on.", + "required" : true, + "deprecated" : false, + "explode" : false, + "schema" : { + "type" : "string", + "title" : "String" + }, + "example" : "test@test.com" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/VerifyEmailRequest" + } + } + }, + "required" : true + }, + "responses" : { + "500" : { + "description" : "An error occurred in the system.", + "headers" : { }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + }, + "examples" : { + "General Exception Response example" : { + "value" : { + "reference" : "kcog4koca5xhiegavarp", + "message" : "NullPointerException when deserializing value.", + "serviceName" : "swat-account-service" + } + } + } + } + } + }, + "204" : { + "description" : "Your email address has been verified and you are now able to login and get a token.", + "headers" : { } + }, + "403" : { + "description" : "The provided verification code is not valid for the specified account.", + "headers" : { }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + }, + "examples" : { + "Example Forbidden Response" : { + "value" : { + "reference" : "kcog4koca5xhiegavarp", + "message" : "HTTP 403 Forbidden", + "serviceName" : "swat-account-service" + } + } + } + } + } + }, + "404" : { + "description" : "The provided verification code does not exist.", + "headers" : { }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + }, + "examples" : { + "Not Found Exception Response Example" : { + "value" : { + "reference" : "kcog4koca5xhiegavarp", + "message" : "email verification code [ {verificationCode} ] not found", + "serviceName" : "swat-account-service" + } + } + } + } + } + }, + "422" : { + "description" : "The request was invalid.", + "headers" : { }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ValidationErrorResponse" + }, + "examples" : { + "Invalid Request Exception Response example" : { + "value" : { + "reference" : "kcog4koca5xhiegavarp", + "message" : "request has validation errors", + "serviceName" : "swat-account-service", + "errors" : { + "verificationCode" : [ "must not be blank" ] + } + } + } + } + } + } + } + }, + "deprecated" : false + } + }, + "/account/{username}/request-password-reset-code" : { + "post" : { + "tags" : [ "Password Resource" ], + "description" : "Request a one-time use code to be emailed to the account's email address that can be used to change the account's password.", + "parameters" : [ { + "name" : "username", + "in" : "path", + "description" : "The username or email address of the account you wish to request a password reset code for.", + "required" : true, + "deprecated" : false, + "explode" : false, + "schema" : { + "type" : "string", + "title" : "String" + }, + "example" : "test@test.com" + } ], + "responses" : { + "500" : { + "description" : "An error occurred in the system.", + "headers" : { }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + }, + "examples" : { + "General Exception Response example" : { + "value" : { + "reference" : "kcog4koca5xhiegavarp", + "message" : "NullPointerException when deserializing value.", + "serviceName" : "swat-account-service" + } + } + } + } + } + }, + "204" : { + "description" : "An email has been sent with a password reset code for the account specified by the email address. Please note, if the account is not registered, this response will still be returned, in order to prevent malicious actors from discovering registered email addresses.", + "headers" : { } + } + }, + "deprecated" : false + } + }, + "/account/{username}/reset-password" : { + "post" : { + "tags" : [ "Password Resource" ], + "description" : "Use the one-time use code to change the account's password.", + "parameters" : [ { + "name" : "username", + "in" : "path", + "description" : "The username or email address of the account to reset the password on.", + "required" : true, + "deprecated" : false, + "explode" : false, + "schema" : { + "type" : "string", + "title" : "String" + }, + "example" : "test@test.com" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PasswordResetRequest" + } + } + }, + "required" : true + }, + "responses" : { + "500" : { + "description" : "An error occurred in the system.", + "headers" : { }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + }, + "examples" : { + "General Exception Response example" : { + "value" : { + "reference" : "kcog4koca5xhiegavarp", + "message" : "NullPointerException when deserializing value.", + "serviceName" : "swat-account-service" + } + } + } + } + } + }, + "204" : { + "description" : "The password has been successfully changed.", + "headers" : { } + }, + "403" : { + "description" : "The provided code is not valid for the specified account.", + "headers" : { }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + }, + "examples" : { + "Example Forbidden Response" : { + "value" : { + "reference" : "kcog4koca5xhiegavarp", + "message" : "HTTP 403 Forbidden", + "serviceName" : "swat-account-service" + } + } + } + } + } + }, + "404" : { + "description" : "The provided one-time code is not valid.", + "headers" : { }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + }, + "examples" : { + "Password Reset Code not found response example" : { + "value" : { + "reference" : "kcog4koca5xhiegavarp", + "message" : "Password reset code [ 54F5C0BE482828847C650669CE89D57D ] does not exist", + "serviceName" : "swat-account-service" + } + } + } + } + } + }, + "422" : { + "description" : "The request was invalid.", + "headers" : { }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ValidationErrorResponse" + }, + "examples" : { + "Invalid Request Exception Response example" : { + "value" : { + "reference" : "kcog4koca5xhiegavarp", + "message" : "request has validation errors", + "serviceName" : "swat-account-service", + "errors" : { + "code" : [ "must not be blank" ] + } + } + } + } + } + } + } + }, + "deprecated" : false + } + }, + "/account/{username}/change-password" : { + "post" : { + "tags" : [ "Password Resource" ], + "description" : "Change password of the specified account using the existing password to authenticate. Use this endpoint if you are unable to get a token because you are forced to update your password.", + "parameters" : [ { + "name" : "username", + "in" : "path", + "description" : "The username or email address of the account to change the password on.", + "required" : true, + "deprecated" : false, + "explode" : false, + "schema" : { + "type" : "string", + "title" : "String" + }, + "example" : "test@test.com" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ChangePasswordRequest" + } + } + }, + "required" : true + }, + "responses" : { + "500" : { + "description" : "An error occurred in the system.", + "headers" : { }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + }, + "examples" : { + "General Exception Response example" : { + "value" : { + "reference" : "kcog4koca5xhiegavarp", + "message" : "NullPointerException when deserializing value.", + "serviceName" : "swat-account-service" + } + } + } + } + } + }, + "204" : { + "description" : "The password has been successfully changed.", + "headers" : { } + }, + "401" : { + "description" : "The account and password combination is invalid.", + "headers" : { }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + }, + "examples" : { + "Example Unauthorized Response" : { + "value" : { + "reference" : "kcog4koca5xhiegavarp", + "message" : "missing or invalid bearer token", + "serviceName" : "swat-account-service" + } + } + } + } + } + }, + "422" : { + "description" : "The request was invalid.", + "headers" : { }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ValidationErrorResponse" + }, + "examples" : { + "Invalid Request Exception Response example" : { + "value" : { + "reference" : "kcog4koca5xhiegavarp", + "message" : "request has validation errors", + "serviceName" : "swat-account-service", + "errors" : { + "newPassword" : [ "must not be blank" ] + } + } + } + } + } + } + } + }, + "deprecated" : false + } + } + }, + "components" : { + "schemas" : { + "AccountCreationRequest" : { + "type" : "object", + "description" : "User name, email address, and password for this account.", + "properties" : { + "emailAddress" : { + "type" : "string", + "description" : "The email address to register this account under. Must be in the standard email format, characters followed by @ followed by characters followed by . followed by characters.", + "example" : "testemail@test.com", + "maxLength" : 100, + "minLength" : 0, + "title" : "String" + }, + "password" : { + "type" : "string", + "description" : "The password for this SWAT account.", + "example" : "password123", + "maxLength" : 100, + "minLength" : 8, + "title" : "String" + }, + "username" : { + "type" : "string", + "description" : "The username for this SWAT account.", + "example" : "Test User", + "maxLength" : 100, + "minLength" : 0, + "title" : "String" + } + }, + "required" : [ "emailAddress", "password", "username" ], + "title" : "AccountCreationRequest" + }, + "ErrorResponse" : { + "type" : "object", + "properties" : { + "message" : { + "type" : "string", + "description" : "A message describing the error that occurred.", + "example" : "An error occurred.", + "maxLength" : 2147483647, + "minLength" : 0, + "title" : "String" + }, + "reference" : { + "type" : "string", + "description" : "A unique reference for your error. Provide this to the admins to help track down your issue.", + "example" : "kcog4koca5xhiegavarp", + "maxLength" : 20, + "minLength" : 20, + "title" : "String" + }, + "serviceName" : { + "type" : "string", + "description" : "The name of this service. Will always be swat-account-service.", + "example" : "swat-account-service", + "maxLength" : 20, + "minLength" : 20, + "title" : "String" + } + }, + "required" : [ "message", "reference", "serviceName" ], + "title" : "ErrorResponse" + }, + "ValidationErrorResponse" : { + "type" : "object", + "properties" : { + "errors" : { + "type" : "object", + "additionalProperties" : { + "type" : "array", + "items" : { + "type" : "string", + "title" : "String" + }, + "title" : "List" + }, + "description" : "Key value pairs, where each key is the name of a property of the request object, and each value is a list of strings, each string indicating a validation error for that property.", + "example" : "{ \"username\": [ \"must not be blank\" ] }", + "maxLength" : 2147483647, + "minLength" : 0, + "title" : "Map>" + }, + "message" : { + "type" : "string", + "description" : "A message describing the error that occurred.", + "example" : "An error occurred.", + "maxLength" : 2147483647, + "minLength" : 0, + "title" : "String" + }, + "reference" : { + "type" : "string", + "description" : "A unique reference for your error. Provide this to the admins to help track down your issue.", + "example" : "kcog4koca5xhiegavarp", + "maxLength" : 20, + "minLength" : 20, + "title" : "String" + }, + "serviceName" : { + "type" : "string", + "description" : "The name of this service. Will always be swat-account-service.", + "example" : "swat-account-service", + "maxLength" : 20, + "minLength" : 20, + "title" : "String" + } + }, + "required" : [ "errors", "message", "reference", "serviceName" ], + "title" : "ValidationErrorResponse" + }, + "AccountUpdateRequest" : { + "type" : "object", + "description" : "The properties of your SWAT account you wish to update.", + "properties" : { + "password" : { + "type" : [ "null", "string" ], + "description" : "The new password for your account.", + "example" : "mynewpassword123", + "maxLength" : 100, + "minLength" : 8, + "title" : "String" + } + }, + "title" : "AccountUpdateRequest" + }, + "ActivateMigratedAccountRequest" : { + "type" : "object", + "description" : "The email address for the account, along with the current password to authenticate, and the new password.", + "properties" : { + "currentPassword" : { + "type" : "string", + "description" : "The current password for your migrated SWAT account you wish to activate.", + "example" : "mypassword123", + "maxLength" : 2147483647, + "minLength" : 0, + "title" : "String" + }, + "emailAddress" : { + "type" : "string", + "description" : "The email address to set for this account. Must be in the standard email format, characters followed by @ followed by characters followed by . followed by characters.", + "example" : "myemailaddress@gmail.com", + "maxLength" : 100, + "minLength" : 0, + "title" : "String" + }, + "newPassword" : { + "type" : "string", + "description" : "The new password for your SWAT account.", + "example" : "mynewpassword", + "maxLength" : 100, + "minLength" : 8, + "title" : "String" + } + }, + "required" : [ "currentPassword", "emailAddress", "newPassword" ], + "title" : "ActivateMigratedAccountRequest" + }, + "LoginRequest" : { + "type" : "object", + "description" : "The username (or email address) and password to login with.", + "properties" : { + "password" : { + "type" : "string", + "description" : "The password for the SWAT account you wish to log in to.", + "example" : "password123", + "maxLength" : 100, + "minLength" : 0, + "title" : "String" + }, + "username" : { + "type" : "string", + "description" : "The username or email address of the SWAT account you wish to log in to.", + "example" : "Test User", + "maxLength" : 100, + "minLength" : 0, + "title" : "String" + } + }, + "required" : [ "password", "username" ], + "title" : "LoginRequest" + }, + "VerifyEmailRequest" : { + "type" : "object", + "description" : "The verification code sent to your email address.", + "properties" : { + "verificationCode" : { + "type" : "string", + "description" : "The verification code sent to your email address.", + "maxLength" : 2147483647, + "minLength" : 0, + "title" : "String" + } + }, + "required" : [ "verificationCode" ], + "title" : "VerifyEmailRequest" + }, + "PasswordResetRequest" : { + "type" : "object", + "description" : "The one-time use code and new password.", + "properties" : { + "code" : { + "type" : "string", + "description" : "The one-time use code sent to you in an email.", + "example" : "54F5C0BE482828847C650669CE89D57D", + "maxLength" : 32, + "minLength" : 32, + "title" : "String" + }, + "password" : { + "type" : "string", + "description" : "The new password to set for the account.", + "example" : "password123", + "maxLength" : 100, + "minLength" : 8, + "title" : "String" + } + }, + "required" : [ "code", "password" ], + "title" : "PasswordResetRequest" + }, + "ChangePasswordRequest" : { + "type" : "object", + "description" : "The current and new passwords.", + "properties" : { + "newPassword" : { + "type" : "string", + "description" : "The new password.", + "example" : "mynewpassword", + "maxLength" : 100, + "minLength" : 8, + "title" : "String" + }, + "password" : { + "type" : "string", + "description" : "The current password for the account.", + "example" : "mypassword", + "maxLength" : 100, + "minLength" : 0, + "title" : "String" + } + }, + "required" : [ "newPassword", "password" ], + "title" : "ChangePasswordRequest" + } + }, + "examples" : { }, + "securitySchemes" : { + "SWAT-Token" : { + "type" : "http", + "description" : "A JWT provided by this service. Must be provided as an Authorization header using the format \"Bearer {JWT}\"", + "in" : "header", + "scheme" : "bearer", + "bearerFormat" : "JWT" + } + } + } +} \ No newline at end of file diff --git a/swat-codegen/openapi.yaml b/swat-codegen/openapi.yaml new file mode 100644 index 0000000..ebff393 --- /dev/null +++ b/swat-codegen/openapi.yaml @@ -0,0 +1,1931 @@ +openapi: 3.0.1 +info: + title: SWAT Aftermath - RCPD Service + description: "Rank code manager service for storing rank codes, generating rank\ + \ codes, earning titles, etc. The back end for RPCD 3.0" + version: 0.24.3 +servers: +- url: https://swataftermath.com:9443/ +tags: +- name: Account Resource + description: Resource for management of RCPD accounts +- name: Accounts Resource + description: Resource for retrieving multiple accounts. +- name: Rank Code Resource + description: Resource for saving and retrieving rank codes and builds. +- name: Unlocks Resource + description: Resource for retrieving the maximum rank unlocked for each SWAT build + element. +- name: Open API Resource + description: Resource that provides the Open API documentation for this service. +paths: + /account/{username}: + get: + tags: + - Account Resource + summary: Get RCPD account. + description: "Get the specified RCPD account if it exists. Auth token is optional\ + \ for this resource. If provided, and you are the owner of the account, you\ + \ will see all information for the account." + operationId: getAccount + parameters: + - name: username + in: path + description: The username of the RCPD account you wish to retrieve. The username + is case sensitive. + required: true + schema: + type: string + example: teller55 + responses: + "500": + description: Something went wrong when processing the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "502": + description: A dependent service or database had an error. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "200": + description: The requested RCPD account. + content: + application/json: + schema: + $ref: "#/components/schemas/AccountResponse" + "401": + description: "Authorization header is not present, or token is invalid or\ + \ expired." + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "503": + description: The security infrastructure cannot currently handle the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "404": + description: The requested resource could not be found. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + security: + - SWAT-Token: [] + put: + tags: + - Account Resource + summary: Update properties of the specified account + description: "Update certain fields of an RCPD account. This is a partial PUT\ + \ operation, where only the fields you want to update must be provided." + operationId: updateAccount + parameters: + - name: username + in: path + description: The username of the RCPD account you wish to update. The username + is case sensitive. + required: true + schema: + type: string + example: teller55 + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/AccountUpdateRequest" + responses: + "500": + description: Something went wrong when processing the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "502": + description: A dependent service or database had an error. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "401": + description: "Authorization header is not present, or token is invalid or\ + \ expired." + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "503": + description: The security infrastructure cannot currently handle the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "403": + description: You are not allowed to perform the requested action. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "404": + description: The requested resource could not be found. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "422": + description: The request body was invalid and could not be processed + content: + application/json: + schema: + $ref: "#/components/schemas/ValidationErrorResponse" + security: + - SWAT-Token: [] + /account: + get: + tags: + - Account Resource + summary: Get default RCPD account. + description: Get the default RCPD account for this user. + operationId: getDefaultAccount + responses: + "500": + description: Something went wrong when processing the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "502": + description: A dependent service or database had an error. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "200": + description: The requested RCPD account. + content: + application/json: + schema: + $ref: "#/components/schemas/AccountResponse" + "401": + description: "Authorization header is not present, or token is invalid or\ + \ expired." + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "503": + description: The security infrastructure cannot currently handle the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "404": + description: The requested resource could not be found. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + security: + - SWAT-Token: [] + post: + tags: + - Account Resource + summary: Create a new RPCD account + description: "Create a new RPCD account with the given username, and owned by\ + \ the user of the provided token." + operationId: newAccount + requestBody: + description: The details of the RPCD account to create. + content: + application/json: + schema: + $ref: "#/components/schemas/AccountCreationRequest" + required: true + responses: + "500": + description: Something went wrong when processing the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "502": + description: A dependent service or database had an error. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "201": + description: The RCPD account has been created. + headers: + Location: + description: The URL of the newly-created RCPD account. + style: simple + schema: + type: uri + example: /account/Teller55 + "400": + description: The request did not include a request body. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "409": + description: The username is already registered. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "422": + description: The request body was invalid and could not be processed + content: + application/json: + schema: + $ref: "#/components/schemas/ValidationErrorResponse" + "401": + description: "Authorization header is not present, or token is invalid or\ + \ expired." + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "503": + description: The security infrastructure cannot currently handle the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + security: + - SWAT-Token: [] + /account/{username}/set-default: + post: + tags: + - Account Resource + summary: Set default account for user + description: Set the default RCPD account for this user. Must be an account + this user owns. + operationId: setDefaultAccount + parameters: + - name: username + in: path + description: The username of the RCPD account to set as the default account + for this user. The username is case sensitive. + required: true + schema: + type: string + example: teller55 + responses: + "500": + description: Something went wrong when processing the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "502": + description: A dependent service or database had an error. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "204": + description: The account has successfully been set to be the default account. + "401": + description: "Authorization header is not present, or token is invalid or\ + \ expired." + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "503": + description: The security infrastructure cannot currently handle the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "403": + description: You are not allowed to perform the requested action. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "404": + description: The requested resource could not be found. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + security: + - SWAT-Token: [] + /accounts/active-count: + get: + tags: + - Accounts Resource + summary: Get number of active players. + description: Get the number of active RCPD users. Active means somebody who + has logged in or done things on their account recently. + operationId: countActiveAccounts + responses: + "500": + description: Something went wrong when processing the request. + content: + text/plain: + schema: + $ref: "#/components/schemas/ErrorResponse" + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "502": + description: A dependent service or database had an error. + content: + text/plain: + schema: + $ref: "#/components/schemas/ErrorResponse" + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "200": + description: The number of active RCPD users. + content: + text/plain: + example: 47 + /accounts: + get: + tags: + - Accounts Resource + summary: Get users' accounts. + description: Get all the RCPD accounts owned by this user. + operationId: getAccounts + responses: + "500": + description: Something went wrong when processing the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "502": + description: A dependent service or database had an error. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "200": + description: A list of RCPD account summaries. + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/AccountSummaryResponse" + "401": + description: "Authorization header is not present, or token is invalid or\ + \ expired." + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "503": + description: The security infrastructure cannot currently handle the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + security: + - SWAT-Token: [] + /accounts/leaderboard: + get: + tags: + - Accounts Resource + summary: Get the leaderboard + description: "Get accounts on the leaderboard, ordered by account rank and points." + operationId: getLeaderboard + parameters: + - name: limit + in: query + description: The maximum number of accounts to be returned. + schema: + type: integer + format: int32 + default: 30 + responses: + "500": + description: Something went wrong when processing the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "502": + description: A dependent service or database had an error. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "200": + description: The leaderboard accounts. + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/AccountSummaryResponse" + /accounts/search: + get: + tags: + - Accounts Resource + summary: Search for accounts. + description: "Search for any accounts matching the provided username. The results\ + \ will include both partial matches, and sound-alike matches. (IE if you search\ + \ for John, the results will include Jon)" + operationId: searchAccounts + parameters: + - name: searchName + in: query + description: The partial or sound-alike username to search for. + required: true + schema: + type: string + example: teller + responses: + "500": + description: Something went wrong when processing the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "502": + description: A dependent service or database had an error. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "200": + description: A list of RCPD account summaries whose usernames match the + provided search query. + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/AccountSummaryResponse" + "400": + description: Username to search for was not provided. Includes if the provided + query param is blank. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + /account/rank-code/{rankCode}: + delete: + tags: + - Rank Code Resource + summary: Delete saved build for default account. + description: Delete a saved build on the user's default account. + operationId: deleteSavedBuild + parameters: + - name: rankCode + in: path + description: "The SWAT: Aftermath hero build rank code that identifies the\ + \ saved build to be deleted." + required: true + schema: + type: string + example: 1522-4120-7272-0500 + responses: + "500": + description: Something went wrong when processing the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "502": + description: A dependent service or database had an error. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "204": + description: The request was executed successfully. The build is deleted + if it existed. + "400": + description: The provided rank code is invalid. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "404": + description: The requested resource could not be found. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "401": + description: "Authorization header is not present, or token is invalid or\ + \ expired." + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "503": + description: The security infrastructure cannot currently handle the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + security: + - SWAT-Token: [] + /account/{username}/rank-code/{rankCode}: + delete: + tags: + - Rank Code Resource + summary: Delete saved build for specified account. + description: Delete a saved build on the specified account. The user must own + the account. + operationId: deleteSavedBuild_1 + parameters: + - name: username + in: path + description: The RCPD account to delete the saved build from. The username + is case sensitive. + required: true + schema: + type: string + example: teller55 + - name: rankCode + in: path + description: "The SWAT: Aftermath hero build rank code that identifies the\ + \ saved build to be deleted." + required: true + schema: + type: string + example: 1522-4120-7272-0500 + responses: + "500": + description: Something went wrong when processing the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "502": + description: A dependent service or database had an error. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "204": + description: The request was executed successfully. The build is deleted + if it existed. + "400": + description: The provided rank code is invalid. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "403": + description: You are not allowed to perform the requested action. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "404": + description: The requested resource could not be found. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "401": + description: "Authorization header is not present, or token is invalid or\ + \ expired." + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "503": + description: The security infrastructure cannot currently handle the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + security: + - SWAT-Token: [] + /account/generate: + post: + tags: + - Rank Code Resource + summary: Generate a rank code for default account. + description: Generate a SWAT rank code using the default RCPD account for this + user. + operationId: generate + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/BuildRequest" + responses: + "500": + description: Something went wrong when processing the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "502": + description: A dependent service or database had an error. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "200": + description: "The generated rank code, along with the details of the hero\ + \ build, including any medals or titles." + content: + application/json: + schema: + $ref: "#/components/schemas/HeroBuildResponse" + "401": + description: "Authorization header is not present, or token is invalid or\ + \ expired." + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "503": + description: The security infrastructure cannot currently handle the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "404": + description: The requested resource could not be found. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + security: + - SWAT-Token: [] + /account/{username}/generate: + post: + tags: + - Rank Code Resource + summary: Generate a rank code for specified account. + description: Generate a SWAT rank code using the specified RCPD account. The + account must be owned by the user. + operationId: generate_1 + parameters: + - name: username + in: path + description: The RCPD account to get saved builds for. The username is case + sensitive. + required: true + schema: + type: string + example: teller55 + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/BuildRequest" + responses: + "500": + description: Something went wrong when processing the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "502": + description: A dependent service or database had an error. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "200": + description: "The generated rank code, along with the details of the hero\ + \ build, including any medals or titles." + content: + application/json: + schema: + $ref: "#/components/schemas/HeroBuildResponse" + "401": + description: "Authorization header is not present, or token is invalid or\ + \ expired." + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "503": + description: The security infrastructure cannot currently handle the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "403": + description: You are not allowed to perform the requested action. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "404": + description: The requested resource could not be found. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + security: + - SWAT-Token: [] + /account/saved-builds: + get: + tags: + - Rank Code Resource + summary: Get saved builds for default account. + description: Get the saved builds for the default RCPD account. + operationId: getSavedBuilds + responses: + "500": + description: Something went wrong when processing the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "502": + description: A dependent service or database had an error. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "200": + description: The saved builds. + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/HeroBuildResponse" + "401": + description: "Authorization header is not present, or token is invalid or\ + \ expired." + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "503": + description: The security infrastructure cannot currently handle the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "404": + description: The requested resource could not be found. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + security: + - SWAT-Token: [] + /account/{username}/saved-builds: + get: + tags: + - Rank Code Resource + summary: Get saved builds for account. + description: "Get the saved builds for the specified RCPD account. If the account\ + \ is not owned by the user, or no token is provided, a public view of the\ + \ saved builds will be returned." + operationId: getSavedBuilds_1 + parameters: + - name: username + in: path + description: The RCPD account to get saved builds for. The username is case + sensitive. + required: true + schema: + type: string + example: teller55 + responses: + "500": + description: Something went wrong when processing the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "502": + description: A dependent service or database had an error. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "200": + description: The saved builds. + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/HeroBuildResponse" + "401": + description: "Authorization header is not present, or token is invalid or\ + \ expired." + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "503": + description: The security infrastructure cannot currently handle the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "404": + description: The requested resource could not be found. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + security: + - SWAT-Token: [] + /account/rank-code: + post: + tags: + - Rank Code Resource + summary: Save a rank code to the default account + description: "Save a rank code, along with an optional name for this build.\ + \ This will be saved to the default account for this user." + operationId: saveRankCode + requestBody: + description: The rank code and optional build name. + content: + application/json: + schema: + $ref: "#/components/schemas/RankCodeRequest" + required: true + responses: + "500": + description: Something went wrong when processing the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "502": + description: A dependent service or database had an error. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "200": + description: "The saved build, plus any other saved builds that have had\ + \ medals or titles updated as a result of the new build being saved. If\ + \ the build that was saved had earned any medals or titles, then all saved\ + \ builds with the same class/trait/specialization combination will be\ + \ updated and returned. This avoids the scenario of earning a medal/title\ + \ on one build, and then earning the same medal/title on another build\ + \ with the same class/trait/specialization combination which shares the\ + \ new medal/title." + content: + application/json: + schema: + minItems: 1 + type: array + items: + $ref: "#/components/schemas/HeroBuildResponse" + "400": + description: The provided rank code is invalid. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "404": + description: The requested resource could not be found. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "422": + description: The request body was invalid and could not be processed + content: + application/json: + schema: + $ref: "#/components/schemas/ValidationErrorResponse" + "401": + description: "Authorization header is not present, or token is invalid or\ + \ expired." + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "503": + description: The security infrastructure cannot currently handle the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + security: + - SWAT-Token: [] + /account/{username}/rank-code: + post: + tags: + - Rank Code Resource + summary: Save a rank code to the specified account + description: "Save a rank code, along with an optional name for this build,\ + \ to the specified RCPD account." + operationId: saveRankCode_1 + parameters: + - name: username + in: path + description: The RCPD account to save this rank code to. The username is case + sensitive. + required: true + schema: + type: string + example: teller55 + requestBody: + description: The rank code and optional build name. + content: + application/json: + schema: + $ref: "#/components/schemas/RankCodeRequest" + required: true + responses: + "500": + description: Something went wrong when processing the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "502": + description: A dependent service or database had an error. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "200": + description: "The saved build, plus any other saved builds that have had\ + \ medals or titles updated as a result of the new build being saved. If\ + \ the build that was saved had earned any medals or titles, then all saved\ + \ builds with the same class/trait/specialization combination will be\ + \ updated and returned. This avoids the scenario of earning a medal/title\ + \ on one build, and then earning the same medal/title on another build\ + \ with the same class/trait/specialization combination which shares the\ + \ new medal/title." + content: + application/json: + schema: + minItems: 1 + type: array + items: + $ref: "#/components/schemas/HeroBuildResponse" + "400": + description: The provided rank code is invalid. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "403": + description: You are not allowed to perform the requested action. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "404": + description: The requested resource could not be found. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "422": + description: The request body was invalid and could not be processed + content: + application/json: + schema: + $ref: "#/components/schemas/ValidationErrorResponse" + "401": + description: "Authorization header is not present, or token is invalid or\ + \ expired." + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "503": + description: The security infrastructure cannot currently handle the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + security: + - SWAT-Token: [] + /account/unlocks: + get: + tags: + - Unlocks Resource + summary: Get unlocks for default account. + description: Get the currently unlocked rank for each SWAT build element for + the user's default account. + operationId: getUnlocks + responses: + "500": + description: Something went wrong when processing the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "502": + description: A dependent service or database had an error. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "200": + description: The maximum unlocked rank of each element of a SWAT build. + content: + application/json: + schema: + $ref: "#/components/schemas/UnlocksResponse" + "401": + description: "Authorization header is not present, or token is invalid or\ + \ expired." + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "503": + description: The security infrastructure cannot currently handle the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "404": + description: The requested resource could not be found. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + security: + - SWAT-Token: [] + /account/{username}/unlocks: + get: + tags: + - Unlocks Resource + summary: Get unlocks for specified account. + description: Get the currently unlocked rank for each SWAT build element for + the specified RCPD account. The account must be owned by the user. + operationId: getUnlocks_1 + parameters: + - name: username + in: path + description: The RCPD account to retrieve the unlocks for. The username is + case sensitive. + required: true + schema: + type: string + example: teller55 + responses: + "500": + description: Something went wrong when processing the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "502": + description: A dependent service or database had an error. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "200": + description: The maximum unlocked rank of each element of a SWAT build. + content: + application/json: + schema: + $ref: "#/components/schemas/UnlocksResponse" + "401": + description: "Authorization header is not present, or token is invalid or\ + \ expired." + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "503": + description: The security infrastructure cannot currently handle the request. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "403": + description: You are not allowed to perform the requested action. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + "404": + description: The requested resource could not be found. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + security: + - SWAT-Token: [] + /openapi.{type}: + get: + tags: + - Open API Resource + description: Get the Open API documentation in JSON or YAML format. + operationId: getOpenApiSpec + parameters: + - name: type + in: path + description: The extension type of the Open API documentation file. Must be + either yaml or json. + required: true + schema: + pattern: json|yaml + type: string + enum: + - yaml + - json + example: yaml + responses: + "200": + description: The Open API documentation in JSON or YAML format. + content: + application/json: {} + application/yml: {} + /openapi/{file}: + get: + tags: + - Open API Resource + description: "Retrieve a file required for the Swagger UI. It is recommended\ + \ to retrieve the index.html file, and allow the index.html file to retrieve\ + \ the assets it needs." + operationId: getFile + parameters: + - name: file + in: path + description: The file to retrieve. + required: true + schema: + type: string + example: index.html + responses: + "200": + description: The requested file. + content: + image/png: {} + text/css: {} + text/html: {} + text/javascript: {} + text/plain: {} + "404": + description: The requested file was not found. + content: + text/plain: {} + "415": + description: The requested file format is not a format supported by this + resource. + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" +components: + schemas: + ErrorResponse: + type: object + properties: + reference: + type: string + description: A unique reference for your error. Provide this to the admins + to help track down your issue. + example: kcog4koca5xhiegavarp + message: + type: string + description: A message describing the error that occurred. + example: An error occurred. + serviceName: + type: string + description: The name of this service. Will always be rcpd-service. + example: rcpd-service + description: "Response indicating an error has occurred, with a unique reference\ + \ and a description of the error." + AccountResponse: + title: Account Response + type: object + properties: + username: + type: string + description: The username of this RCPD account. + example: Teller55 + icon: + type: integer + description: An integer representing the icon (display picture) for the + account. + format: int32 + example: 0 + description: + type: string + description: A public message for the account that will be displayed on + the leaderboard and to people viewing the account. + nullable: true + example: Swat season 2 lets go! + squad: + type: string + description: The group/clan this account belongs to. + nullable: true + example: XLR8 + note: + type: string + description: A private note for this account. Only visible to the account + owner. + nullable: true + example: My super secret plan for winning every EXT game. + rank: + maximum: 11 + minimum: 1 + type: integer + description: The account rank as an integer. + format: int32 + example: 1 + points: + type: integer + description: The amount of points this account has earned through titles. + format: int64 + example: 100 + leaderboardRanking: + type: integer + description: "The rank of this account amongst all RCPD accounts, based\ + \ on the number of points this account has earned. Will be null if the\ + \ account is inactive." + format: int32 + nullable: true + example: 10 + honorGuard: + type: boolean + description: Whether this account has joined the honor guard. + example: true + titles: + $ref: "#/components/schemas/AccountTitlesResponse" + corrupt: + type: boolean + description: "Whether this account has used a code generator to save generated\ + \ rank codes, rather than earning codes solely through playing SWAT: Aftermath." + example: false + lastActive: + type: integer + description: "The last time this account was active (logged in to, saved\ + \ a build, generated a build, etc.) represented as milliseconds from epoch." + format: int64 + example: 1695474479000 + active: + type: boolean + description: Whether this account has been logged into or done anything + recently. + description: A response containing information about an RCPD account. + AccountTitlesResponse: + title: Account Titles Response + type: object + properties: + valiantMartyr: + type: boolean + description: Whether this account has won a Nightmare game. + citySavior: + type: boolean + description: Whether this account has won an Extinction game. + livingLegend: + type: boolean + description: "Whether this account has unlocked all classes, guns, armors,\ + \ traits, and specializations to rank 12." + monsterSlayer: + minimum: 0 + type: integer + description: Requires killing Megazilla on multiple hero builds. + format: int32 + vigilantHero: + minimum: 0 + type: integer + description: Requires completing a Nightmare or Extinction game without + dying on multiple hero builds. + format: int32 + coreElite: + minimum: 0 + type: integer + description: Requires earning an Impressive title on multiple hero builds. + format: int32 + loneRanger: + minimum: 0 + type: integer + description: Requires winning solo Nightmare games with multiple classes. + format: int32 + hardenedVeteran: + maximum: 1 + minimum: 0 + type: integer + description: "Requires winning Nightmare games with different player counts.\ + \ Solo games do not count. You must win with every possible other player\ + \ combination, IE 2 players, 3 players, 4 players, etc." + format: int32 + renownedVeteran: + maximum: 2 + minimum: 0 + type: integer + description: "Requires winning Extinction games with different player counts.\ + \ IE, win with 2 players, win with 3 players, etc. 7/8 combinations are\ + \ required for tier 1, all 8 combinations are required for tier 2." + format: int32 + highlyDecorated: + maximum: 2 + minimum: 0 + type: integer + description: "Requires earning all medals except KEY on one build for multiple\ + \ classes. 10 classes required for tier 1, 12 classes required for tier\ + \ 2." + format: int32 + keyMaster: + maximum: 2 + minimum: 0 + type: integer + description: "Requires earning KEY on multiple classes. 10 classes required\ + \ for tier 1, 12 classes required for tier 2." + format: int32 + swatCenturion: + minimum: 0 + type: integer + description: Requires winning Nightmare with different unique builds. + format: int32 + infiniteLegion: + minimum: 0 + type: integer + description: Requires winning Extinction with different unique builds. + format: int32 + allSniperWins: + maximum: 2 + minimum: 0 + type: integer + description: Requires winning Nightmare and/or Extinction with every unique + Sniper combination. + format: int32 + allMedicWins: + maximum: 2 + minimum: 0 + type: integer + description: Requires winning Nightmare and/or Extinction with every unique + Medic combination. + format: int32 + allTacticianWins: + maximum: 2 + minimum: 0 + type: integer + description: Requires winning Nightmare and/or Extinction with every unique + Tactician combination. + format: int32 + allPsychologistWins: + maximum: 2 + minimum: 0 + type: integer + description: Requires winning Nightmare and/or Extinction with every unique + Psychologist combination. + format: int32 + allMaverickWins: + maximum: 2 + minimum: 0 + type: integer + description: Requires winning Nightmare and/or Extinction with every unique + Maverick combination. + format: int32 + allHeavyOrdnanceWins: + maximum: 2 + minimum: 0 + type: integer + description: Requires winning Nightmare and/or Extinction with every unique + Heavy Ordnance combination. + format: int32 + allDemolitionWins: + maximum: 2 + minimum: 0 + type: integer + description: Requires winning Nightmare and/or Extinction with every unique + Demolitions combination. + format: int32 + allCyborgWins: + maximum: 2 + minimum: 0 + type: integer + description: Requires winning Nightmare and/or Extinction with every unique + Cyborg combination. + format: int32 + allPyrotechnicianWins: + maximum: 2 + minimum: 0 + type: integer + description: Requires winning Nightmare and/or Extinction with every unique + Pyrotechnician combination. + format: int32 + allWatchmanWins: + maximum: 2 + minimum: 0 + type: integer + description: Requires winning Nightmare and/or Extinction with every unique + Watchman combination. + format: int32 + allTechOpsWins: + maximum: 2 + minimum: 0 + type: integer + description: Requires winning Nightmare and/or Extinction with every unique + Tech Ops combination. + format: int32 + allUmbrellaCloneWins: + maximum: 2 + minimum: 0 + type: integer + description: Requires winning Nightmare and/or Extinction with every unique + Umbrella Clone combination. + format: int32 + description: "A response including all the titles this account has earned. For\ + \ the integer properties, a value of 0 means the title is unearned; 1 or higher\ + \ means the title is earned, and indicates the level of that title." + AccountCreationRequest: + required: + - username + type: object + properties: + username: + maxLength: 15 + minLength: 3 + type: string + description: The username of the new RCPD account. This must be the same + as the name used in Warcraft III. + example: Teller55 + description: The username for the new RCPD account. + ValidationErrorResponse: + type: object + properties: + reference: + type: string + description: A unique reference for your error. Provide this to the admins + to help track down your issue. + example: kcog4koca5xhiegavarp + message: + type: string + description: A message describing the error that occurred. + example: An error occurred. + errors: + type: object + additionalProperties: + type: array + description: "The properties for the given request that were invalid,\ + \ along with all the reasons why each property was invalid." + example: + username: + - must not be blank + - size must be between 3 and 15 + items: + type: string + description: "The properties for the given request that were invalid,\ + \ along with all the reasons why each property was invalid." + example: "{\"username\":[\"must not be blank\",\"size must be between\ + \ 3 and 15\"]}" + description: "The properties for the given request that were invalid, along\ + \ with all the reasons why each property was invalid." + example: + username: + - must not be blank + - size must be between 3 and 15 + serviceName: + type: string + description: The name of this service. Will always be rcpd-service. + example: rcpd-service + description: "Response indicating the request was invalid, along with the validation\ + \ errors." + AccountUpdateRequest: + title: Account Update Request + type: object + properties: + icon: + maximum: 11 + minimum: 0 + type: integer + description: The integer that represents the display icon for the account. + format: int32 + example: 0 + description: + maxLength: 255 + minLength: 0 + type: string + description: The description that will be displayed for this account. + example: I am the best SWAT player ever! + squad: + maxLength: 32 + minLength: 0 + type: string + description: The squad/clan this account belongs to. + example: XLR8 + note: + maxLength: 255 + minLength: 0 + type: string + description: A private note for this account that only the account owner + can see. + example: This is my private note for my eyes only. + description: "A request to update various things on an account. All parameters\ + \ are optional. To delete a value, provide an empty string. This will delete\ + \ the value in the database." + AccountSummaryResponse: + type: object + properties: + username: + type: string + description: The username of this RCPD account. + example: Teller55 + icon: + type: integer + description: An integer representing the icon (display picture) for the + account. + format: int32 + example: 0 + description: + type: string + description: A public message for the account that will be displayed on + the leaderboard and to people viewing the account. + nullable: true + example: Swat season 2 lets go! + squad: + type: string + description: The group/clan this account belongs to. + nullable: true + example: XLR8 + rank: + maximum: 11 + minimum: 1 + type: integer + description: The account rank as an integer. + format: int32 + example: 1 + corrupt: + type: boolean + description: "Whether this account has used a code generator to save generated\ + \ rank codes, rather than earning codes solely through playing SWAT: Aftermath." + example: false + active: + type: boolean + description: Whether this account has been logged into or done anything + recently. + lastActive: + type: integer + description: "The last time this account was active (logged in to, saved\ + \ a build, generated a build, etc.) represented as milliseconds from epoch." + format: int64 + example: 1695474479000 + honorGuard: + type: boolean + description: Whether this account has joined the honor guard. + example: true + description: An RCPD account summary. + HeroBuildResponse: + title: Hero Build Response + type: object + properties: + rankCode: + type: string + description: "The SWAT: Aftermath rank code for this build, which can be\ + \ used in a game of SWAT: Aftermath to load this build. Will not be included\ + \ for public view." + nullable: true + example: 6595-0027-2041-6700 + swatClass: + type: string + description: The class of this build. http://redscull.com/swat/readmeafterclasses.html + example: Sniper + enum: + - Sniper + - Medic + - Tactician + - Psychologist + - Maverick + - HeavyOrdnance + - Demolitions + - Cyborg + - Pyrotechnician + - Watchman + - TechOps + - UmbrellaClone + gun: + type: string + description: The gun used by this build. http://redscull.com/swat/readmeafterweapons.html + example: SniperRifle + enum: + - AssaultRifle + - SniperRifle + - Chaingun + - RocketLauncher + - Flamethrower + - LaserRifle + - GatlingLaser + - Pistols + armor: + type: string + description: The armor used by this build. http://redscull.com/swat/readmeafterarmor.html + example: Light + enum: + - Light + - Medium + - Heavy + - Advanced + trait: + type: string + description: The trait used by this build. http://redscull.com/swat/readmeaftertraits.html + example: Dragoon + enum: + - Skilled + - Gifted + - Survivalist + - Dragoon + - Acrobat + - SwiftLearner + - Healer + - FlowerChild + - ChemReliant + - RadResistant + - Gadgeteer + - Prowler + - Energizer + - PackRat + - Engineer + - Reckless + specialization: + type: string + description: The specialization used by this build. http://redscull.com/swat/readmeafterspecs.html + example: Weaponry + enum: + - Weaponry + - PowerArmor + - EnergyCells + - Cybernetics + - Triage + - Chemistry + - Leadership + - Robotics + - Espionage + talent: + type: string + description: The talent used by this build. Only included if the build's + rank is 9 or higher. http://redscull.com/swat/readmeaftertalents.html + nullable: true + example: Tinkering + enum: + - Courage + - Wiring + - Running + - Spotting + - Toughness + - Tinkering + - Hacking + rank: + maximum: 12 + minimum: 1 + type: integer + description: The rank of this build. http://redscull.com/swat/readmeafterrank.html + format: int32 + example: 1 + maxRank: + maximum: 12 + minimum: 3 + type: integer + description: "The maximum rank this build can achieve, determined by the\ + \ highest difficulty this build has beaten. http://redscull.com/swat/readmeafterrank.html" + format: int32 + example: 3 + key: + type: boolean + description: Whether this build has earned the Key to the City medal. http://redscull.com/swat/readmeafterrank.html#medals + moh: + type: boolean + description: Whether this build has earned the Medal of Honor medal. http://redscull.com/swat/readmeafterrank.html#medals + pcc: + type: boolean + description: Whether this build has earned the Police Combat Cross medal. + http://redscull.com/swat/readmeafterrank.html#medals + cob: + type: boolean + description: Whether this build has earned the Commendation Bar medal. http://redscull.com/swat/readmeafterrank.html#medals + lsa: + type: boolean + description: Whether this build has earned the Life Saving Award medal. + http://redscull.com/swat/readmeafterrank.html#medals + rem: + maximum: 3 + minimum: 0 + type: integer + description: "Whether this build has earned the Recognition for Exceptional\ + \ Merit medal, and what level. http://redscull.com/swat/readmeafterrank.html#medals" + format: int32 + example: 0 + honorGuard: + type: boolean + description: Whether this build is an honor guard build. + nightmare: + type: boolean + description: Whether this build has beaten Nightmare difficulty. http://redscull.com/swat/readmeafterobjectives.html + Will not be included for public view. + extinction: + type: boolean + description: Whether this build has beaten Extinction difficulty. http://redscull.com/swat/readmeafterobjectives.html + Will not be included for public view. + megazilla: + type: boolean + description: Whether this build has helped to kill Megazilla. http://redscull.com/swat/readmeafterobjectives.html#megazilla + Will not be included for public view. + deathless: + type: boolean + description: Whether this build has completed Nightmare or Extinction difficulty + without dying. Will not be included for public view. + impressive: + type: boolean + description: Whether this build has participated in a game that earned a + Medal of Honor while already having a Medal of Honor. http://redscull.com/swat/readmeafterrank.html#medals + Will not be included for public view. + solo: + type: boolean + description: Whether this build has beaten a solo Nightmare game. http://redscull.com/swat/readmeafterobjectives.html + Will not be included for public view. + buildName: + type: string + description: An optional name used to identify this build. + nullable: true + example: hacking psy + description: "A response object describing a SWAT hero, including rank code\ + \ and build name." + BuildRequest: + title: Build Request + required: + - armor + - gun + - specialization + - swatClass + - talent + - trait + type: object + properties: + swatClass: + type: string + description: The class of this SWAT hero. + writeOnly: true + example: Psychologist + enum: + - Sniper + - Medic + - Tactician + - Psychologist + - Maverick + - HeavyOrdnance + - Demolitions + - Cyborg + - Pyrotechnician + - Watchman + - TechOps + - UmbrellaClone + gun: + type: string + description: The gun this SWAT hero uses. + writeOnly: true + example: AssaultRifle + enum: + - AssaultRifle + - SniperRifle + - Chaingun + - RocketLauncher + - Flamethrower + - LaserRifle + - GatlingLaser + - Pistols + armor: + type: string + description: The armor this SWAT hero uses. + writeOnly: true + example: Medium + enum: + - Light + - Medium + - Heavy + - Advanced + trait: + type: string + description: The trait of this SWAT hero. + writeOnly: true + example: Healer + enum: + - Skilled + - Gifted + - Survivalist + - Dragoon + - Acrobat + - SwiftLearner + - Healer + - FlowerChild + - ChemReliant + - RadResistant + - Gadgeteer + - Prowler + - Energizer + - PackRat + - Engineer + - Reckless + specialization: + type: string + description: The specialization of this SWAT hero. + writeOnly: true + example: Triage + enum: + - Weaponry + - PowerArmor + - EnergyCells + - Cybernetics + - Triage + - Chemistry + - Leadership + - Robotics + - Espionage + talent: + type: string + description: The talent of this SWAT hero. + writeOnly: true + example: Hacking + enum: + - Courage + - Wiring + - Running + - Spotting + - Toughness + - Tinkering + - Hacking + rank: + maximum: 12 + minimum: 1 + type: integer + description: "The rank of this SWAT hero. Will be capped at the lowest rank\ + \ part of the build. For example, if the requested talent is only available\ + \ at rank 4, the build will be capped to rank 4, even if the requested\ + \ rank is higher. This parameter is optional; if not specified, the build\ + \ will be generated at the highest possible rank." + format: int32 + example: 10 + spoof: + maxLength: 15 + minLength: 3 + type: string + description: "The name to generate this rank code for, different to the\ + \ account's name. If this name is provided, the rank code will be capped\ + \ at rank 11, and not include any medals." + example: teller55 + description: A request containing all the parts for a SWAT hero. + RankCodeRequest: + title: Rank Code Request + required: + - rankCode + type: object + properties: + rankCode: + maxLength: 19 + minLength: 16 + type: string + description: "The SWAT: Aftermath rank code to save. Must be either 16 or\ + \ 19 characters in length." + example: 6595-0027-2041-6700 + buildName: + maxLength: 32 + minLength: 0 + type: string + description: An optional name for this build. + example: Solo HO + description: A rank code and optional build name to save. + UnlocksResponse: + title: Unlocks Response + type: object + properties: + swatClasses: + type: object + additionalProperties: + type: integer + format: int32 + guns: + type: object + additionalProperties: + type: integer + format: int32 + armor: + type: object + additionalProperties: + type: integer + format: int32 + traits: + type: object + additionalProperties: + type: integer + format: int32 + specializations: + type: object + additionalProperties: + type: integer + format: int32 + talents: + type: object + additionalProperties: + type: integer + format: int32 + description: "The maximum rank achieved for every part of a SWAT hero; classes,\ + \ guns, armors, traits, specializations, and talents. The keys for each map\ + \ can be found by viewing the request schema for the /account/generate endpoint." diff --git a/swat-codegen/swat-codegen-1.0.2-1-any.pkg.tar.zst b/swat-codegen/swat-codegen-1.0.2-1-any.pkg.tar.zst new file mode 100644 index 0000000..7b2fdf4 Binary files /dev/null and b/swat-codegen/swat-codegen-1.0.2-1-any.pkg.tar.zst differ diff --git a/swat-codegen/swat_armour b/swat-codegen/swat_armour new file mode 100644 index 0000000..4ce8582 --- /dev/null +++ b/swat-codegen/swat_armour @@ -0,0 +1,4 @@ +Light +Medium m +Heavy h +Advanced Cyborg Watchman diff --git a/swat-codegen/swat_class b/swat-codegen/swat_class new file mode 100644 index 0000000..014afe2 --- /dev/null +++ b/swat-codegen/swat_class @@ -0,0 +1,12 @@ +Sniper gs ss +Medic +Tactician +Psychologist +Maverick +HeavyOrdnance ho +Demolitions +Cyborg +Pyrotechnician +Watchman wm +TechOps techies +UmbrellaClone gal alice diff --git a/swat-codegen/swat_gun b/swat-codegen/swat_gun new file mode 100644 index 0000000..f49af1b --- /dev/null +++ b/swat-codegen/swat_gun @@ -0,0 +1,8 @@ +AssaultRifle a ar Medic Tactician Psychologist +SniperRifle s sr TechOps +Chaingun c cg HeavyOrdnance Cyborg +RocketLauncher r rl Demolitions +Flamethrower f ft Pyrotechnician +LaserRifle lr +GatlingLaser gl +Pistols fists UmbrellaClone diff --git a/swat-codegen/swat_spec b/swat-codegen/swat_spec new file mode 100644 index 0000000..92c5d53 --- /dev/null +++ b/swat-codegen/swat_spec @@ -0,0 +1,9 @@ +Weaponry +PowerArmor pa +EnergyCells +Cybernetics +Triage +Chemistry +Leadership +Robotics +Espionage diff --git a/swat-codegen/swat_talent b/swat-codegen/swat_talent new file mode 100644 index 0000000..a6be3a0 --- /dev/null +++ b/swat-codegen/swat_talent @@ -0,0 +1,7 @@ +Courage crg +Wiring +Running +Spotting +Toughness +Tinkering +Hacking diff --git a/swat-codegen/swat_trait b/swat-codegen/swat_trait new file mode 100644 index 0000000..519e57f --- /dev/null +++ b/swat-codegen/swat_trait @@ -0,0 +1,16 @@ +Skilled +Gifted +Survivalist +Dragoon +Acrobat +SwiftLearner sl +Healer +FlowerChild fc +ChemReliant cr +RadResistant rr +Gadgeteer +Prowler +Energizer energiser +PackRat pr +Engineer +Reckless