(
command_id: str,
payload: CommandUpdateRequest,
_auth: AuthContext = Depends(require_tool_scope),
service: CommandService = Depends(get_command_service),
)
| 105 | |
| 106 | @router.patch("/commands/{command_id:path}") |
| 107 | async def update_command( |
| 108 | command_id: str, |
| 109 | payload: CommandUpdateRequest, |
| 110 | _auth: AuthContext = Depends(require_tool_scope), |
| 111 | service: CommandService = Depends(get_command_service), |
| 112 | ): |
| 113 | if payload.enabled is not None: |
| 114 | return await _toggle_command( |
| 115 | CommandToggleRequest( |
| 116 | handler_full_name=command_id, |
| 117 | enabled=payload.enabled, |
| 118 | ), |
| 119 | service, |
| 120 | ) |
| 121 | if payload.alias is not None: |
| 122 | return await _rename_command( |
| 123 | CommandRenameRequest( |
| 124 | handler_full_name=command_id, |
| 125 | new_name=payload.alias, |
| 126 | aliases=payload.aliases, |
| 127 | ), |
| 128 | service, |
| 129 | ) |
| 130 | return await _update_command_permission( |
| 131 | CommandPermissionRequest( |
| 132 | handler_full_name=command_id, |
| 133 | permission=payload.permission_group or "", |
| 134 | ), |
| 135 | service, |
| 136 | ) |
| 137 | |
| 138 | |
| 139 | @legacy_router.get("/commands") |
nothing calls this directly
no test coverage detected