Skip to content

Commit

Permalink
Add endpoint to retrieve available command variables
Browse files Browse the repository at this point in the history
  • Loading branch information
raimannma committed Jan 12, 2025
1 parent 99d66d7 commit 9c95351
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions deadlock_data_api/routers/v1_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,13 @@ def dl_latest_patchnotes_link(
return latest.link


@router.get("/commands/available-variables")
def get_command_variables(res: Response) -> list[str]:
res.headers["Cache-Control"] = "public, max-age=60"
variable_resolvers = inspect.getmembers(CommandVariable(), inspect.ismethod)
return [name for name, _ in variable_resolvers]


@router.get(
"/commands/{region}/{account_id}/resolve",
response_class=PlainTextResponse,
Expand Down

0 comments on commit 9c95351

Please sign in to comment.