diff --git a/_modules/index.html b/_modules/index.html index 0e7332e9..36aa02e0 100644 --- a/_modules/index.html +++ b/_modules/index.html @@ -46,6 +46,7 @@
  • Getting Started
  • Contributor Documentation
  • Changelog
  • +
  • Changelog (deprecated)
  • @@ -73,70 +74,70 @@

    All modules for which code is available

    diff --git a/_modules/matrixctl/addon_manager.html b/_modules/matrixctl/addon_manager.html index fb4d246f..0d702cf4 100644 --- a/_modules/matrixctl/addon_manager.html +++ b/_modules/matrixctl/addon_manager.html @@ -46,6 +46,7 @@
  • Getting Started
  • Contributor Documentation
  • Changelog
  • +
  • Changelog (deprecated)
  • @@ -116,30 +117,30 @@

    Source code for matrixctl.addon_manager

     ParserSetupType = Callable[[], argparse.ArgumentParser]
     
     # global
    -addons: list[SubParserType] = []
    +commands: list[SubParserType] = []
     
     
    -
    -[docs] -def import_addons_from( +
    +[docs] +def import_commands_from( addon_directory: str, addon_module: str, parser_name: str, ) -> None: - """Import addons in (global) addons. + """Import commands in (global) commands. Parameters ---------- addon_directory : str The absolute path as string to the addon directory. addon_module : str - The import path (with dots ``.`` not slashes ``/``) to the addons - from project root e.g. "matrixctl.addons". + The import path (with dots ``.`` not slashes ``/``) to the commands + from project root e.g. "matrixctl.commands". parser_name : str The name of the module the subparser is in. ..Note: The nothing will be imported, when the subparser is not in (global) - addons. To add the subparse to addons you need to decorate the + commands. To add the subparse to commands you need to decorate the subparsers with ``matrixctl.addon_manager.subparser`` Returns @@ -164,7 +165,7 @@

    Source code for matrixctl.addon_manager

     
    [docs] def subparser(func: SubParserType) -> SubParserType: - """Decorate subparsers with, to add them to (global) addons on import. + """Decorate subparsers with, to add them to (global) commands on import. Parameters ---------- @@ -172,7 +173,7 @@

    Source code for matrixctl.addon_manager

             A subparser.
         ..Note:
             The nothing will be imported, when the subparser is not in (global)
    -        addons. To add the subparse to addons you need to decorate the
    +        commands. To add the subparse to commands you need to decorate the
             subparsers with ``matrixctl.addon_manager.subparser``
     
         Returns
    @@ -181,8 +182,8 @@ 

    Source code for matrixctl.addon_manager

             The same subparser which was used as argument. (Without any changes)
     
         """
    -    if func not in addons:
    -        addons.append(func)
    +    if func not in commands:
    +        commands.append(func)
         return func
    @@ -204,15 +205,15 @@

    Source code for matrixctl.addon_manager

     
         """
     
    -    if len(addons) == 0:
    +    if len(commands) == 0:
             logger.error(
    -            "The Argparse Addon Manager was not able to find any addons. "
    -            "Have you imported the addons with "
    -            '"AddonManager.import_addons_from()"?',
    +            "The Argparse Addon Manager was not able to find any commands. "
    +            "Have you imported the commands with "
    +            '"AddonManager.import_commands_from()"?',
             )
     
         parser: argparse.ArgumentParser = func()
    -    if len(addons) > 0:
    +    if len(commands) > 0:
             subparsers: SubParsersAction[t.Any] = parser.add_subparsers(
                 title="Commands",
                 description=(
    @@ -221,7 +222,7 @@ 

    Source code for matrixctl.addon_manager

                 ),
                 metavar="Command",
             )
    -        for subparser_ in addons:
    +        for subparser_ in commands:
                 subparser_(subparsers)
         return parser
    diff --git a/_modules/matrixctl/addons/adduser/addon.html b/_modules/matrixctl/commands/adduser/addon.html similarity index 90% rename from _modules/matrixctl/addons/adduser/addon.html rename to _modules/matrixctl/commands/adduser/addon.html index 8d7dd3c3..74957770 100644 --- a/_modules/matrixctl/addons/adduser/addon.html +++ b/_modules/matrixctl/commands/adduser/addon.html @@ -5,7 +5,7 @@ - matrixctl.addons.adduser.addon — MatrixCtl 0.12.0 documentation + matrixctl.commands.adduser.addon — MatrixCtl 0.12.0 documentation @@ -46,6 +46,7 @@
  • Getting Started
  • Contributor Documentation
  • Changelog
  • +
  • Changelog (deprecated)
  • @@ -63,7 +64,7 @@
    • - +
    @@ -72,7 +73,7 @@
    -

    Source code for matrixctl.addons.adduser.addon

    +  

    Source code for matrixctl.commands.adduser.addon

     # matrixctl
     # Copyright (c) 2020-2023  Michael Sasser <Michael@MichaelSasser.org>
     #
    @@ -113,7 +114,7 @@ 

    Source code for matrixctl.addons.adduser.addon

    -[docs] +[docs] def addon(arg: Namespace, yaml: YAML) -> int: """Add a User to the synapse instance. @@ -157,10 +158,11 @@

    Source code for matrixctl.addons.adduser.addon

    ) return 0 + user_id = f"@{arg.user}:{yaml.get('server', 'api','domain')}" req: RequestBuilder = RequestBuilder( domain=yaml.get("server", "api", "domain"), token=yaml.get("server", "api", "token"), - path=f"users/@{arg.user}:{yaml.get('server', 'api','domain')}", + path=f"/_synapse/admin/v2/users/{user_id}", json={"password": passwd, "admin": arg.admin}, method="PUT", ) diff --git a/_modules/matrixctl/addons/adduser/parser.html b/_modules/matrixctl/commands/adduser/parser.html similarity index 95% rename from _modules/matrixctl/addons/adduser/parser.html rename to _modules/matrixctl/commands/adduser/parser.html index e1a95b3e..72890c35 100644 --- a/_modules/matrixctl/addons/adduser/parser.html +++ b/_modules/matrixctl/commands/adduser/parser.html @@ -5,7 +5,7 @@ - matrixctl.addons.adduser.parser — MatrixCtl 0.12.0 documentation + matrixctl.commands.adduser.parser — MatrixCtl 0.12.0 documentation @@ -46,6 +46,7 @@

  • Getting Started
  • Contributor Documentation
  • Changelog
  • +
  • Changelog (deprecated)
  • @@ -63,7 +64,7 @@
    • - +
    @@ -72,7 +73,7 @@
    -

    Source code for matrixctl.addons.adduser.parser

    +  

    Source code for matrixctl.commands.adduser.parser

     # matrixctl
     # Copyright (c) 2020-2023  Michael Sasser <Michael@MichaelSasser.org>
     #
    @@ -106,7 +107,7 @@ 

    Source code for matrixctl.addons.adduser.parser

    <
    -[docs] +[docs] @subparser def subparser_adduser(subparsers: _SubParsersAction[t.Any]) -> None: """Create a subparser for the ``matrixctl adduser`` command. diff --git a/_modules/matrixctl/addons/check/addon.html b/_modules/matrixctl/commands/check/addon.html similarity index 94% rename from _modules/matrixctl/addons/check/addon.html rename to _modules/matrixctl/commands/check/addon.html index 413af504..a830afd5 100644 --- a/_modules/matrixctl/addons/check/addon.html +++ b/_modules/matrixctl/commands/check/addon.html @@ -5,7 +5,7 @@ - matrixctl.addons.check.addon — MatrixCtl 0.12.0 documentation + matrixctl.commands.check.addon — MatrixCtl 0.12.0 documentation @@ -46,6 +46,7 @@
  • Getting Started
  • Contributor Documentation
  • Changelog
  • +
  • Changelog (deprecated)
  • @@ -63,7 +64,7 @@
    • - +
    @@ -72,7 +73,7 @@
    -

    Source code for matrixctl.addons.check.addon

    +  

    Source code for matrixctl.commands.check.addon

     # matrixctl
     # Copyright (c) 2020-2023  Michael Sasser <Michael@MichaelSasser.org>
     #
    @@ -109,7 +110,7 @@ 

    Source code for matrixctl.addons.check.addon

    -[docs]
    +[docs]
     def addon(_: Namespace, yaml: YAML) -> int:
         """Check the deployment with andible.
     
    diff --git a/_modules/matrixctl/addons/check/parser.html b/_modules/matrixctl/commands/check/parser.html
    similarity index 94%
    rename from _modules/matrixctl/addons/check/parser.html
    rename to _modules/matrixctl/commands/check/parser.html
    index daa70cbd..b982f7ab 100644
    --- a/_modules/matrixctl/addons/check/parser.html
    +++ b/_modules/matrixctl/commands/check/parser.html
    @@ -5,7 +5,7 @@
     
       
       
    -  matrixctl.addons.check.parser — MatrixCtl 0.12.0 documentation
    +  matrixctl.commands.check.parser — MatrixCtl 0.12.0 documentation
           
           
           
    @@ -46,6 +46,7 @@
     
  • Getting Started
  • Contributor Documentation
  • Changelog
  • +
  • Changelog (deprecated)
  • @@ -63,7 +64,7 @@
    • - +
    @@ -72,7 +73,7 @@
    -

    Source code for matrixctl.addons.check.parser

    +  

    Source code for matrixctl.commands.check.parser

     # matrixctl
     # Copyright (c) 2020-2023  Michael Sasser <Michael@MichaelSasser.org>
     #
    @@ -106,7 +107,7 @@ 

    Source code for matrixctl.addons.check.parser

    -[docs] +[docs] @subparser def subparser_check(subparsers: _SubParsersAction[t.Any]) -> None: """Create a subparser for the ``matrixctl check`` command. diff --git a/_modules/matrixctl/addons/delete_local_media/addon.html b/_modules/matrixctl/commands/delete_local_media/addon.html similarity index 94% rename from _modules/matrixctl/addons/delete_local_media/addon.html rename to _modules/matrixctl/commands/delete_local_media/addon.html index ce6093f6..a5958946 100644 --- a/_modules/matrixctl/addons/delete_local_media/addon.html +++ b/_modules/matrixctl/commands/delete_local_media/addon.html @@ -5,7 +5,7 @@ - matrixctl.addons.delete_local_media.addon — MatrixCtl 0.12.0 documentation + matrixctl.commands.delete_local_media.addon — MatrixCtl 0.12.0 documentation @@ -46,6 +46,7 @@
  • Getting Started
  • Contributor Documentation
  • Changelog
  • +
  • Changelog (deprecated)
  • @@ -63,7 +64,7 @@
    • - +
    @@ -72,7 +73,7 @@
    -

    Source code for matrixctl.addons.delete_local_media.addon

    +  

    Source code for matrixctl.commands.delete_local_media.addon

     # matrixctl
     # Copyright (c) 2021-2023  Michael Sasser <Michael@MichaelSasser.org>
     #
    @@ -119,7 +120,7 @@ 

    Source code for matrixctl.addons.delete_local_media.addon

    -[docs] +[docs] def addon(arg: Namespace, yaml: YAML) -> int: """Delete local media. @@ -139,16 +140,16 @@

    Source code for matrixctl.addons.delete_local_media.addon

    timestamp = handle_timestamp(arg.timestamp, force=arg.force) + domain = yaml.get("server", "api", "domain") req: RequestBuilder = RequestBuilder( token=yaml.get("server", "api", "token"), domain=yaml.get("server", "api", "domain"), - path=f"media/{yaml.get('server', 'api', 'domain')}/delete", + path=f"/_synapse/admin/v1/media/{domain}/delete", params={ "before_ts": timestamp, "keep_profiles": arg.no_keep_profiles, "size_gt": arg.greater_than, }, - api_version="v1", method="POST", timeout=1200, ) @@ -176,7 +177,7 @@

    Source code for matrixctl.addons.delete_local_media.addon

    -[docs] +[docs] def handle_timestamp(timestamp: int | None, *, force: bool) -> int: """Ask or generate timestamp. diff --git a/_modules/matrixctl/addons/delete_local_media/parser.html b/_modules/matrixctl/commands/delete_local_media/parser.html similarity index 95% rename from _modules/matrixctl/addons/delete_local_media/parser.html rename to _modules/matrixctl/commands/delete_local_media/parser.html index 80be58c5..0412e2a2 100644 --- a/_modules/matrixctl/addons/delete_local_media/parser.html +++ b/_modules/matrixctl/commands/delete_local_media/parser.html @@ -5,7 +5,7 @@ - matrixctl.addons.delete_local_media.parser — MatrixCtl 0.12.0 documentation + matrixctl.commands.delete_local_media.parser — MatrixCtl 0.12.0 documentation @@ -46,6 +46,7 @@
  • Getting Started
  • Contributor Documentation
  • Changelog
  • +
  • Changelog (deprecated)
  • @@ -63,7 +64,7 @@
    • - +
    @@ -72,7 +73,7 @@
    -

    Source code for matrixctl.addons.delete_local_media.parser

    +  

    Source code for matrixctl.commands.delete_local_media.parser

     # matrixctl
     # Copyright (c) 2020-2023  Michael Sasser <Michael@MichaelSasser.org>
     #
    @@ -106,7 +107,7 @@ 

    Source code for matrixctl.addons.delete_local_media.parser

    -[docs] +[docs] @subparser def subparser_delete_local_media(subparsers: _SubParsersAction[t.Any]) -> None: """Create a subparser for the ``matrixctl delete-local_media`` command. diff --git a/_modules/matrixctl/addons/delroom/addon.html b/_modules/matrixctl/commands/delroom/addon.html similarity index 95% rename from _modules/matrixctl/addons/delroom/addon.html rename to _modules/matrixctl/commands/delroom/addon.html index 92459ec9..d433eb90 100644 --- a/_modules/matrixctl/addons/delroom/addon.html +++ b/_modules/matrixctl/commands/delroom/addon.html @@ -5,7 +5,7 @@ - matrixctl.addons.delroom.addon — MatrixCtl 0.12.0 documentation + matrixctl.commands.delroom.addon — MatrixCtl 0.12.0 documentation @@ -46,6 +46,7 @@
  • Getting Started
  • Contributor Documentation
  • Changelog
  • +
  • Changelog (deprecated)
  • @@ -63,7 +64,7 @@
    • - +
    @@ -72,7 +73,7 @@
    -

    Source code for matrixctl.addons.delroom.addon

    +  

    Source code for matrixctl.commands.delroom.addon

     # matrixctl
     # Copyright (c) 2020-2023  Michael Sasser <Michael@MichaelSasser.org>
     #
    @@ -115,7 +116,7 @@ 

    Source code for matrixctl.addons.delroom.addon

    -[docs] +[docs] def addon(arg: Namespace, yaml: YAML) -> int: """Delete an empty room from the database. @@ -137,9 +138,8 @@

    Source code for matrixctl.addons.delroom.addon

    req: RequestBuilder = RequestBuilder( token=yaml.get("server", "api", "token"), domain=yaml.get("server", "api", "domain"), - path=f"rooms/{arg.room}", + path=f"/_synapse/admin/v2/rooms/{arg.room}", method="DELETE", - api_version="v2", json=body, timeout=1200, ) @@ -158,7 +158,10 @@

    Source code for matrixctl.addons.delroom.addon

    raise InternalResponseError(msg) from e try: - json_response = handle_status(yaml, json_response["delete_id"]) + json_response = handle_status( + yaml, + json_response["delete_id"], + ) except InternalResponseError as e: if e.message: logger.fatal(e.message) @@ -176,7 +179,7 @@

    Source code for matrixctl.addons.delroom.addon

    # TODO: Try to simplify this function # ruff: noqa: C901

    -[docs] +[docs] def handle_status(yaml: YAML, delete_id: str) -> JsonDict: """Handle the status of a delete room request. @@ -196,9 +199,8 @@

    Source code for matrixctl.addons.delroom.addon

    req: RequestBuilder = RequestBuilder( token=yaml.get("server", "api", "token"), domain=yaml.get("server", "api", "domain"), - path=f"rooms/delete_status/{delete_id}", + path=f"/_synapse/admin/v2/rooms/delete_status/{delete_id}", method="GET", - api_version="v2", timeout=1200.0, ) @@ -278,7 +280,7 @@

    Source code for matrixctl.addons.delroom.addon

    -[docs] +[docs] def handle_arguments(arg: Namespace) -> JsonDict: """Build the parameters used for the delroom request. diff --git a/_modules/matrixctl/addons/delroom/parser.html b/_modules/matrixctl/commands/delroom/parser.html similarity index 96% rename from _modules/matrixctl/addons/delroom/parser.html rename to _modules/matrixctl/commands/delroom/parser.html index d5a0a187..cf44f37c 100644 --- a/_modules/matrixctl/addons/delroom/parser.html +++ b/_modules/matrixctl/commands/delroom/parser.html @@ -5,7 +5,7 @@ - matrixctl.addons.delroom.parser — MatrixCtl 0.12.0 documentation + matrixctl.commands.delroom.parser — MatrixCtl 0.12.0 documentation @@ -46,6 +46,7 @@

  • Getting Started
  • Contributor Documentation
  • Changelog
  • +
  • Changelog (deprecated)
  • @@ -63,7 +64,7 @@
    • - +
    @@ -72,7 +73,7 @@
    -

    Source code for matrixctl.addons.delroom.parser

    +  

    Source code for matrixctl.commands.delroom.parser

     # matrixctl
     # Copyright (c) 2020-2023  Michael Sasser <Michael@MichaelSasser.org>
     #
    @@ -107,7 +108,7 @@ 

    Source code for matrixctl.addons.delroom.parser

    <
    -[docs] +[docs] @subparser def subparser_delroom(subparsers: _SubParsersAction[t.Any]) -> None: """Create a subparser for the ``matrixctl delroom`` command. diff --git a/_modules/matrixctl/addons/deluser/addon.html b/_modules/matrixctl/commands/deluser/addon.html similarity index 87% rename from _modules/matrixctl/addons/deluser/addon.html rename to _modules/matrixctl/commands/deluser/addon.html index 754c73fd..80d4caa0 100644 --- a/_modules/matrixctl/addons/deluser/addon.html +++ b/_modules/matrixctl/commands/deluser/addon.html @@ -5,7 +5,7 @@ - matrixctl.addons.deluser.addon — MatrixCtl 0.12.0 documentation + matrixctl.commands.deluser.addon — MatrixCtl 0.12.0 documentation @@ -46,6 +46,7 @@
  • Getting Started
  • Contributor Documentation
  • Changelog
  • +
  • Changelog (deprecated)
  • @@ -63,7 +64,7 @@
    • - +
    @@ -72,7 +73,7 @@
    -

    Source code for matrixctl.addons.deluser.addon

    +  

    Source code for matrixctl.commands.deluser.addon

     # matrixctl
     # Copyright (c) 2020-2023  Michael Sasser <Michael@MichaelSasser.org>
     #
    @@ -111,7 +112,7 @@ 

    Source code for matrixctl.addons.deluser.addon

    -[docs] +[docs] def addon(arg: Namespace, yaml: YAML) -> int: """Delete a user from the the matrix instance. @@ -128,11 +129,11 @@

    Source code for matrixctl.addons.deluser.addon

    Non-zero value indicates error code, or zero on success. """ + user_id = f"@{arg.user}:{yaml.get('server', 'api','domain')}" req: RequestBuilder = RequestBuilder( token=yaml.get("server", "api", "token"), domain=yaml.get("server", "api", "domain"), - path=f"deactivate/@{arg.user}:{yaml.get('server', 'api','domain')}", - api_version="v1", + path=f"/_synapse/admin/v1/deactivate/{user_id}", method="POST", json={"erase": True}, ) diff --git a/_modules/matrixctl/addons/deluser/parser.html b/_modules/matrixctl/commands/deluser/parser.html similarity index 94% rename from _modules/matrixctl/addons/deluser/parser.html rename to _modules/matrixctl/commands/deluser/parser.html index 86ddc167..69e738e5 100644 --- a/_modules/matrixctl/addons/deluser/parser.html +++ b/_modules/matrixctl/commands/deluser/parser.html @@ -5,7 +5,7 @@ - matrixctl.addons.deluser.parser — MatrixCtl 0.12.0 documentation + matrixctl.commands.deluser.parser — MatrixCtl 0.12.0 documentation @@ -46,6 +46,7 @@

  • Getting Started
  • Contributor Documentation
  • Changelog
  • +
  • Changelog (deprecated)
  • @@ -63,7 +64,7 @@
    • - +
    @@ -72,7 +73,7 @@
    -

    Source code for matrixctl.addons.deluser.parser

    +  

    Source code for matrixctl.commands.deluser.parser

     # matrixctl
     # Copyright (c) 2020-2023  Michael Sasser <Michael@MichaelSasser.org>
     #
    @@ -106,7 +107,7 @@ 

    Source code for matrixctl.addons.deluser.parser

    <
    -[docs] +[docs] @subparser def subparser_deluser(subparsers: _SubParsersAction[t.Any]) -> None: """Create a subparser for the ``matrixctl deluser`` command. diff --git a/_modules/matrixctl/addons/deploy/addon.html b/_modules/matrixctl/commands/deploy/addon.html similarity index 94% rename from _modules/matrixctl/addons/deploy/addon.html rename to _modules/matrixctl/commands/deploy/addon.html index b72d377d..86a66b6d 100644 --- a/_modules/matrixctl/addons/deploy/addon.html +++ b/_modules/matrixctl/commands/deploy/addon.html @@ -5,7 +5,7 @@ - matrixctl.addons.deploy.addon — MatrixCtl 0.12.0 documentation + matrixctl.commands.deploy.addon — MatrixCtl 0.12.0 documentation @@ -46,6 +46,7 @@
  • Getting Started
  • Contributor Documentation
  • Changelog
  • +
  • Changelog (deprecated)
  • @@ -63,7 +64,7 @@
    • - +
    @@ -72,7 +73,7 @@
    -

    Source code for matrixctl.addons.deploy.addon

    +  

    Source code for matrixctl.commands.deploy.addon

     # matrixctl
     # Copyright (c) 2020-2023  Michael Sasser <Michael@MichaelSasser.org>
     #
    @@ -109,7 +110,7 @@ 

    Source code for matrixctl.addons.deploy.addon

    -[docs] +[docs] def addon(arg: Namespace, yaml: YAML) -> int: """Deploy the ansible playbook. diff --git a/_modules/matrixctl/addons/deploy/parser.html b/_modules/matrixctl/commands/deploy/parser.html similarity index 94% rename from _modules/matrixctl/addons/deploy/parser.html rename to _modules/matrixctl/commands/deploy/parser.html index 95cda8b7..7b33d568 100644 --- a/_modules/matrixctl/addons/deploy/parser.html +++ b/_modules/matrixctl/commands/deploy/parser.html @@ -5,7 +5,7 @@ - matrixctl.addons.deploy.parser — MatrixCtl 0.12.0 documentation + matrixctl.commands.deploy.parser — MatrixCtl 0.12.0 documentation @@ -46,6 +46,7 @@
  • Getting Started
  • Contributor Documentation
  • Changelog
  • +
  • Changelog (deprecated)
  • @@ -63,7 +64,7 @@
    • - +
    @@ -72,7 +73,7 @@
    -

    Source code for matrixctl.addons.deploy.parser

    +  

    Source code for matrixctl.commands.deploy.parser

     # matrixctl
     # Copyright (c) 2020-2023  Michael Sasser <Michael@MichaelSasser.org>
     #
    @@ -106,7 +107,7 @@ 

    Source code for matrixctl.addons.deploy.parser

    -[docs] +[docs] @subparser def subparser_deploy(subparsers: _SubParsersAction[t.Any]) -> None: """Create a subparser for the ``matrixctl deploy`` command. diff --git a/_modules/matrixctl/addons/download/addon.html b/_modules/matrixctl/commands/download/addon.html similarity index 93% rename from _modules/matrixctl/addons/download/addon.html rename to _modules/matrixctl/commands/download/addon.html index 21a40eef..90721206 100644 --- a/_modules/matrixctl/addons/download/addon.html +++ b/_modules/matrixctl/commands/download/addon.html @@ -5,7 +5,7 @@ - matrixctl.addons.download.addon — MatrixCtl 0.12.0 documentation + matrixctl.commands.download.addon — MatrixCtl 0.12.0 documentation @@ -46,6 +46,7 @@

  • Getting Started
  • Contributor Documentation
  • Changelog
  • +
  • Changelog (deprecated)
  • @@ -63,7 +64,7 @@
    • - +
    @@ -72,7 +73,7 @@
    -

    Source code for matrixctl.addons.download.addon

    +  

    Source code for matrixctl.commands.download.addon

     # matrixctl
     # Copyright (c) 2020-2023  Michael Sasser <Michael@MichaelSasser.org>
     #
    @@ -111,7 +112,7 @@ 

    Source code for matrixctl.addons.download.addon

    <
    -[docs] +[docs] def addon(arg: Namespace, yaml: YAML) -> int: """Download a file or image from the matrix instance. @@ -147,10 +148,8 @@

    Source code for matrixctl.addons.download.addon

    < req: RequestBuilder = RequestBuilder( token=yaml.get("server", "api", "token"), domain=yaml.get("server", "api", "domain"), - path=f"media/download/{homeserver}/{media_id}", - api_path="_matrix/client", + path=f"/_matrix/client/v1/media/download/{homeserver}/{media_id}", method="GET", - api_version="v1", params={"allow_redirect": "true"}, ) # https://matrix.michaelsasser.org/_matrix/media/v3/download/matrix.org/rFzCZiffizZGTyWXWONCVjXw?allow_redirect=true diff --git a/_modules/matrixctl/addons/download/parser.html b/_modules/matrixctl/commands/download/parser.html similarity index 94% rename from _modules/matrixctl/addons/download/parser.html rename to _modules/matrixctl/commands/download/parser.html index 8a976d71..c9736e71 100644 --- a/_modules/matrixctl/addons/download/parser.html +++ b/_modules/matrixctl/commands/download/parser.html @@ -5,7 +5,7 @@ - matrixctl.addons.download.parser — MatrixCtl 0.12.0 documentation + matrixctl.commands.download.parser — MatrixCtl 0.12.0 documentation @@ -46,6 +46,7 @@
  • Getting Started
  • Contributor Documentation
  • Changelog
  • +
  • Changelog (deprecated)
  • @@ -63,7 +64,7 @@
    • - +
    @@ -72,7 +73,7 @@
    -

    Source code for matrixctl.addons.download.parser

    +  

    Source code for matrixctl.commands.download.parser

     # matrixctl
     # Copyright (c) 2020-2024  Michael Sasser <Michael@MichaelSasser.org>
     #
    @@ -106,7 +107,7 @@ 

    Source code for matrixctl.addons.download.parser

    -[docs] +[docs] @subparser def subparser_download(subparsers: _SubParsersAction[t.Any]) -> None: """Create a subparser for the ``matrixctl download`` command. diff --git a/_modules/matrixctl/addons/get_event/addon.html b/_modules/matrixctl/commands/get_event/addon.html similarity index 94% rename from _modules/matrixctl/addons/get_event/addon.html rename to _modules/matrixctl/commands/get_event/addon.html index 4fe247ae..723dc019 100644 --- a/_modules/matrixctl/addons/get_event/addon.html +++ b/_modules/matrixctl/commands/get_event/addon.html @@ -5,7 +5,7 @@ - matrixctl.addons.get_event.addon — MatrixCtl 0.12.0 documentation + matrixctl.commands.get_event.addon — MatrixCtl 0.12.0 documentation @@ -46,6 +46,7 @@
  • Getting Started
  • Contributor Documentation
  • Changelog
  • +
  • Changelog (deprecated)
  • @@ -63,7 +64,7 @@
    • - +
    @@ -72,7 +73,7 @@
    -

    Source code for matrixctl.addons.get_event.addon

    +  

    Source code for matrixctl.commands.get_event.addon

     # matrixctl
     # Copyright (c) 2020-2023  Michael Sasser <Michael@MichaelSasser.org>
     #
    @@ -112,7 +113,7 @@ 

    Source code for matrixctl.addons.get_event.addon

    -[docs] +[docs] def addon(arg: Namespace, yaml: YAML) -> int: """Get an Event from the Server. @@ -152,7 +153,10 @@

    Source code for matrixctl.addons.get_event.addon

    return 1 except Exception: logger.exception( - "Unable to process the response data to JSON. Response was None" + ( + "Unable to process the response data to JSON." + "Response was None" + ), ) return 1 return 0
    diff --git a/_modules/matrixctl/addons/get_event/parser.html b/_modules/matrixctl/commands/get_event/parser.html similarity index 94% rename from _modules/matrixctl/addons/get_event/parser.html rename to _modules/matrixctl/commands/get_event/parser.html index 6f8f9fd7..ba919d08 100644 --- a/_modules/matrixctl/addons/get_event/parser.html +++ b/_modules/matrixctl/commands/get_event/parser.html @@ -5,7 +5,7 @@ - matrixctl.addons.get_event.parser — MatrixCtl 0.12.0 documentation + matrixctl.commands.get_event.parser — MatrixCtl 0.12.0 documentation @@ -46,6 +46,7 @@
  • Getting Started
  • Contributor Documentation
  • Changelog
  • +
  • Changelog (deprecated)
  • @@ -63,7 +64,7 @@
    • - +
    @@ -72,7 +73,7 @@
    -

    Source code for matrixctl.addons.get_event.parser

    +  

    Source code for matrixctl.commands.get_event.parser

     # matrixctl
     # Copyright (c) 2020-2023  Michael Sasser <Michael@MichaelSasser.org>
     #
    @@ -106,7 +107,7 @@ 

    Source code for matrixctl.addons.get_event.parser

    -[docs] +[docs] @subparser def subparser_get_event(subparsers: _SubParsersAction[t.Any]) -> None: """Create a subparser for the ``matrixctl get-event`` command. diff --git a/_modules/matrixctl/addons/get_event_context/addon.html b/_modules/matrixctl/commands/get_event_context/addon.html similarity index 92% rename from _modules/matrixctl/addons/get_event_context/addon.html rename to _modules/matrixctl/commands/get_event_context/addon.html index 0e851e33..74ad9dee 100644 --- a/_modules/matrixctl/addons/get_event_context/addon.html +++ b/_modules/matrixctl/commands/get_event_context/addon.html @@ -5,7 +5,7 @@ - matrixctl.addons.get_event_context.addon — MatrixCtl 0.12.0 documentation + matrixctl.commands.get_event_context.addon — MatrixCtl 0.12.0 documentation @@ -46,6 +46,7 @@
  • Getting Started
  • Contributor Documentation
  • Changelog
  • +
  • Changelog (deprecated)
  • @@ -63,7 +64,7 @@
    • - +
    @@ -72,7 +73,7 @@
    -

    Source code for matrixctl.addons.get_event_context.addon

    +  

    Source code for matrixctl.commands.get_event_context.addon

     # matrixctl
     # Copyright (c) 2021-2023  Michael Sasser <Michael@MichaelSasser.org>
     #
    @@ -113,7 +114,7 @@ 

    Source code for matrixctl.addons.get_event_context.addon

    -[docs] +[docs] def addon(arg: Namespace, yaml: YAML) -> int: """Find the context of an event. @@ -133,8 +134,7 @@

    Source code for matrixctl.addons.get_event_context.addon

    req: RequestBuilder = RequestBuilder( token=yaml.get("server", "api", "token"), domain=yaml.get("server", "api", "domain"), - path=f"rooms/{arg.room}/context/{arg.event}", - api_version="v1", + path=f"/_synapse/admin/v1/rooms/{arg.room}/context/{arg.event}", method="GET", timeout=120, # Usually takes 20 to 30 seconds ) diff --git a/_modules/matrixctl/addons/get_event_context/parser.html b/_modules/matrixctl/commands/get_event_context/parser.html similarity index 94% rename from _modules/matrixctl/addons/get_event_context/parser.html rename to _modules/matrixctl/commands/get_event_context/parser.html index b524e475..a296e189 100644 --- a/_modules/matrixctl/addons/get_event_context/parser.html +++ b/_modules/matrixctl/commands/get_event_context/parser.html @@ -5,7 +5,7 @@ - matrixctl.addons.get_event_context.parser — MatrixCtl 0.12.0 documentation + matrixctl.commands.get_event_context.parser — MatrixCtl 0.12.0 documentation @@ -46,6 +46,7 @@
  • Getting Started
  • Contributor Documentation
  • Changelog
  • +
  • Changelog (deprecated)
  • @@ -63,7 +64,7 @@
    • - +
    @@ -72,7 +73,7 @@
    -

    Source code for matrixctl.addons.get_event_context.parser

    +  

    Source code for matrixctl.commands.get_event_context.parser

     # matrixctl
     # Copyright (c) 2020-2023  Michael Sasser <Michael@MichaelSasser.org>
     #
    @@ -106,7 +107,7 @@ 

    Source code for matrixctl.addons.get_event_context.parser

    -[docs] +[docs] @subparser def subparser_get_event_context(subparsers: _SubParsersAction[t.Any]) -> None: """Create a subparser for the ``matrixctl get-event-context`` command. diff --git a/_modules/matrixctl/addons/get_events/addon.html b/_modules/matrixctl/commands/get_events/addon.html similarity index 95% rename from _modules/matrixctl/addons/get_events/addon.html rename to _modules/matrixctl/commands/get_events/addon.html index b5ebcbe8..16f72a05 100644 --- a/_modules/matrixctl/addons/get_events/addon.html +++ b/_modules/matrixctl/commands/get_events/addon.html @@ -5,7 +5,7 @@ - matrixctl.addons.get_events.addon — MatrixCtl 0.12.0 documentation + matrixctl.commands.get_events.addon — MatrixCtl 0.12.0 documentation @@ -46,6 +46,7 @@
  • Getting Started
  • Contributor Documentation
  • Changelog
  • +
  • Changelog (deprecated)
  • @@ -63,7 +64,7 @@
    • - +
    @@ -72,7 +73,7 @@
    -

    Source code for matrixctl.addons.get_events.addon

    +  

    Source code for matrixctl.commands.get_events.addon

     # matrixctl
     # Copyright (c) 2020-2023  Michael Sasser <Michael@MichaelSasser.org>
     #
    @@ -115,7 +116,7 @@ 

    Source code for matrixctl.addons.get_events.addon

    -[docs] +[docs] def addon(arg: Namespace, yaml: YAML) -> int: """Get Events from the Server. @@ -190,7 +191,9 @@

    Source code for matrixctl.addons.get_events.addon

    ) print("]") except json.decoder.JSONDecodeError: - logger.exception("Unable to process the response data to JSON.") + logger.exception( + "Unable to process the response data to JSON.", + ) return 1 return 0
    diff --git a/_modules/matrixctl/addons/get_events/parser.html b/_modules/matrixctl/commands/get_events/parser.html similarity index 94% rename from _modules/matrixctl/addons/get_events/parser.html rename to _modules/matrixctl/commands/get_events/parser.html index f8284d16..1874d3dd 100644 --- a/_modules/matrixctl/addons/get_events/parser.html +++ b/_modules/matrixctl/commands/get_events/parser.html @@ -5,7 +5,7 @@ - matrixctl.addons.get_events.parser — MatrixCtl 0.12.0 documentation + matrixctl.commands.get_events.parser — MatrixCtl 0.12.0 documentation @@ -46,6 +46,7 @@
  • Getting Started
  • Contributor Documentation
  • Changelog
  • +
  • Changelog (deprecated)
  • @@ -63,7 +64,7 @@
    • - +
    @@ -72,7 +73,7 @@
    -

    Source code for matrixctl.addons.get_events.parser

    +  

    Source code for matrixctl.commands.get_events.parser

     # matrixctl
     # Copyright (c) 2021-2023  Michael Sasser <Michael@MichaelSasser.org>
     #
    @@ -106,7 +107,7 @@ 

    Source code for matrixctl.addons.get_events.parser

    -[docs] +[docs] @subparser def subparser_get_events(subparsers: _SubParsersAction[t.Any]) -> None: """Create a subparser for the ``matrixctl get-event`` command. diff --git a/_modules/matrixctl/addons/is_admin/addon.html b/_modules/matrixctl/commands/is_admin/addon.html similarity index 89% rename from _modules/matrixctl/addons/is_admin/addon.html rename to _modules/matrixctl/commands/is_admin/addon.html index 13fccd83..3179525f 100644 --- a/_modules/matrixctl/addons/is_admin/addon.html +++ b/_modules/matrixctl/commands/is_admin/addon.html @@ -5,7 +5,7 @@ - matrixctl.addons.is_admin.addon — MatrixCtl 0.12.0 documentation + matrixctl.commands.is_admin.addon — MatrixCtl 0.12.0 documentation @@ -46,6 +46,7 @@
  • Getting Started
  • Contributor Documentation
  • Changelog
  • +
  • Changelog (deprecated)
  • @@ -63,7 +64,7 @@
    • - +
    @@ -72,7 +73,7 @@
    -

    Source code for matrixctl.addons.is_admin.addon

    +  

    Source code for matrixctl.commands.is_admin.addon

     # matrixctl
     # Copyright (c) 2021-2023  Michael Sasser <Michael@MichaelSasser.org>
     #
    @@ -115,7 +116,7 @@ 

    Source code for matrixctl.addons.is_admin.addon

    <
    -[docs] +[docs] def addon(arg: Namespace, yaml: YAML) -> int: """Delete a user is an admin. @@ -136,11 +137,11 @@

    Source code for matrixctl.addons.is_admin.addon

    < Non-zero value indicates error code, or zero on success. """ + user_id = f"@{arg.user}:{yaml.get('server', 'api','domain')}" req: RequestBuilder = RequestBuilder( token=yaml.get("server", "api", "token"), domain=yaml.get("server", "api", "domain"), - path=f"users/@{arg.user}:{yaml.get('server', 'api','domain')}/admin", - api_version="v1", + path=f"/_synapse/admin/v1/users/{user_id}/admin", method="GET", ) try: diff --git a/_modules/matrixctl/addons/is_admin/parser.html b/_modules/matrixctl/commands/is_admin/parser.html similarity index 94% rename from _modules/matrixctl/addons/is_admin/parser.html rename to _modules/matrixctl/commands/is_admin/parser.html index dae2d778..20365577 100644 --- a/_modules/matrixctl/addons/is_admin/parser.html +++ b/_modules/matrixctl/commands/is_admin/parser.html @@ -5,7 +5,7 @@ - matrixctl.addons.is_admin.parser — MatrixCtl 0.12.0 documentation + matrixctl.commands.is_admin.parser — MatrixCtl 0.12.0 documentation @@ -46,6 +46,7 @@
  • Getting Started
  • Contributor Documentation
  • Changelog
  • +
  • Changelog (deprecated)
  • @@ -63,7 +64,7 @@
    • - +
    @@ -72,7 +73,7 @@
    -

    Source code for matrixctl.addons.is_admin.parser

    +  

    Source code for matrixctl.commands.is_admin.parser

     # matrixctl
     # Copyright (c) 2020-2023  Michael Sasser <Michael@MichaelSasser.org>
     #
    @@ -106,7 +107,7 @@ 

    Source code for matrixctl.addons.is_admin.parser

    -[docs] +[docs] @subparser def subparser_is_admin(subparsers: _SubParsersAction[t.Any]) -> None: """Create a subparser for the ``matrixctl is-admin`` command. diff --git a/_modules/matrixctl/addons/joinroom/addon.html b/_modules/matrixctl/commands/joinroom/addon.html similarity index 93% rename from _modules/matrixctl/addons/joinroom/addon.html rename to _modules/matrixctl/commands/joinroom/addon.html index 59e2c064..3bf17243 100644 --- a/_modules/matrixctl/addons/joinroom/addon.html +++ b/_modules/matrixctl/commands/joinroom/addon.html @@ -5,7 +5,7 @@ - matrixctl.addons.joinroom.addon — MatrixCtl 0.12.0 documentation + matrixctl.commands.joinroom.addon — MatrixCtl 0.12.0 documentation @@ -46,6 +46,7 @@
  • Getting Started
  • Contributor Documentation
  • Changelog
  • +
  • Changelog (deprecated)
  • @@ -63,7 +64,7 @@
    • - +
    @@ -72,7 +73,7 @@
    -

    Source code for matrixctl.addons.joinroom.addon

    +  

    Source code for matrixctl.commands.joinroom.addon

     # matrixctl
     # Copyright (c) 2020-2023  Michael Sasser <Michael@MichaelSasser.org>
     #
    @@ -111,7 +112,7 @@ 

    Source code for matrixctl.addons.joinroom.addon

    <
    -[docs] +[docs] def addon(arg: Namespace, yaml: YAML) -> int: """Join a user to an room. @@ -156,15 +157,16 @@

    Source code for matrixctl.addons.joinroom.addon

    < request_config: RequestBuilder = RequestBuilder( token=yaml.get("server", "api", "token"), domain=yaml.get("server", "api", "domain"), - path=f"join/{arg.room}", - api_version="v1", + path=f"/_synapse/admin/v1/join/{arg.room}", method="POST", json={"user_id": arg.user}, ) try: request(request_config) except InternalResponseError: - logger.exception("Unknown Error. The user was not joined to the room.") + logger.exception( + "Unknown Error. The user was not joined to the room.", + ) return 0
    diff --git a/_modules/matrixctl/addons/joinroom/parser.html b/_modules/matrixctl/commands/joinroom/parser.html similarity index 94% rename from _modules/matrixctl/addons/joinroom/parser.html rename to _modules/matrixctl/commands/joinroom/parser.html index 48d5e78e..38cd5d7c 100644 --- a/_modules/matrixctl/addons/joinroom/parser.html +++ b/_modules/matrixctl/commands/joinroom/parser.html @@ -5,7 +5,7 @@ - matrixctl.addons.joinroom.parser — MatrixCtl 0.12.0 documentation + matrixctl.commands.joinroom.parser — MatrixCtl 0.12.0 documentation @@ -46,6 +46,7 @@
  • Getting Started
  • Contributor Documentation
  • Changelog
  • +
  • Changelog (deprecated)
  • @@ -63,7 +64,7 @@
    • - +
    @@ -72,7 +73,7 @@
    -

    Source code for matrixctl.addons.joinroom.parser

    +  

    Source code for matrixctl.commands.joinroom.parser

     # matrixctl
     # Copyright (c) 2020-2023  Michael Sasser <Michael@MichaelSasser.org>
     #
    @@ -106,7 +107,7 @@ 

    Source code for matrixctl.addons.joinroom.parser

    -[docs] +[docs] @subparser def subparser_deluser(subparsers: _SubParsersAction[t.Any]) -> None: """Create a subparser for the ``matrixctl joinroom`` command. diff --git a/_modules/matrixctl/addons/largest_rooms/addon.html b/_modules/matrixctl/commands/largest_rooms/addon.html similarity index 95% rename from _modules/matrixctl/addons/largest_rooms/addon.html rename to _modules/matrixctl/commands/largest_rooms/addon.html index 27743766..275013a3 100644 --- a/_modules/matrixctl/addons/largest_rooms/addon.html +++ b/_modules/matrixctl/commands/largest_rooms/addon.html @@ -5,7 +5,7 @@ - matrixctl.addons.largest_rooms.addon — MatrixCtl 0.12.0 documentation + matrixctl.commands.largest_rooms.addon — MatrixCtl 0.12.0 documentation @@ -46,6 +46,7 @@
  • Getting Started
  • Contributor Documentation
  • Changelog
  • +
  • Changelog (deprecated)
  • @@ -63,7 +64,7 @@
    • - +
    @@ -72,7 +73,7 @@
    -

    Source code for matrixctl.addons.largest_rooms.addon

    +  

    Source code for matrixctl.commands.largest_rooms.addon

     # matrixctl
     # Copyright (c) 2020-2023  Michael Sasser <Michael@MichaelSasser.org>
     #
    @@ -118,7 +119,7 @@ 

    Source code for matrixctl.addons.largest_rooms.addon

    -[docs] +[docs] def addon(arg: Namespace, yaml: YAML) -> int: """Generate a table of the top 10 matrix rooms in terms of DB storage. @@ -138,8 +139,7 @@

    Source code for matrixctl.addons.largest_rooms.addon

    req: RequestBuilder = RequestBuilder( token=yaml.get("server", "api", "token"), domain=yaml.get("server", "api", "domain"), - path="statistics/database/rooms", - api_version="v1", + path="/_synapse/admin/v1/statistics/database/rooms", ) try: @@ -159,7 +159,7 @@

    Source code for matrixctl.addons.largest_rooms.addon

    -[docs] +[docs] def generate_output(rooms: list[JsonDict], *, to_json: bool) -> None: """Use this helper to generate the output. diff --git a/_modules/matrixctl/addons/largest_rooms/parser.html b/_modules/matrixctl/commands/largest_rooms/parser.html similarity index 94% rename from _modules/matrixctl/addons/largest_rooms/parser.html rename to _modules/matrixctl/commands/largest_rooms/parser.html index fbfd5c35..6dd3ef35 100644 --- a/_modules/matrixctl/addons/largest_rooms/parser.html +++ b/_modules/matrixctl/commands/largest_rooms/parser.html @@ -5,7 +5,7 @@ - matrixctl.addons.largest_rooms.parser — MatrixCtl 0.12.0 documentation + matrixctl.commands.largest_rooms.parser — MatrixCtl 0.12.0 documentation @@ -46,6 +46,7 @@
  • Getting Started
  • Contributor Documentation
  • Changelog
  • +
  • Changelog (deprecated)
  • @@ -63,7 +64,7 @@
    • - +
    @@ -72,7 +73,7 @@
    -

    Source code for matrixctl.addons.largest_rooms.parser

    +  

    Source code for matrixctl.commands.largest_rooms.parser

     # matrixctl
     # Copyright (c) 2020-2023  Michael Sasser <Michael@MichaelSasser.org>
     #
    @@ -106,7 +107,7 @@ 

    Source code for matrixctl.addons.largest_rooms.parser

    -[docs] +[docs] @subparser def subparser_rooms(subparsers: _SubParsersAction[t.Any]) -> None: """Create a subparser for the ``matrixctl largest-rooms`` command. diff --git a/_modules/matrixctl/addons/largest_rooms/to_table.html b/_modules/matrixctl/commands/largest_rooms/to_table.html similarity index 95% rename from _modules/matrixctl/addons/largest_rooms/to_table.html rename to _modules/matrixctl/commands/largest_rooms/to_table.html index 37b524f6..bcf315c4 100644 --- a/_modules/matrixctl/addons/largest_rooms/to_table.html +++ b/_modules/matrixctl/commands/largest_rooms/to_table.html @@ -5,7 +5,7 @@ - matrixctl.addons.largest_rooms.to_table — MatrixCtl 0.12.0 documentation + matrixctl.commands.largest_rooms.to_table — MatrixCtl 0.12.0 documentation @@ -46,6 +46,7 @@
  • Getting Started
  • Contributor Documentation
  • Changelog
  • +
  • Changelog (deprecated)
  • @@ -63,7 +64,7 @@
    • - +
    @@ -72,7 +73,7 @@
    -

    Source code for matrixctl.addons.largest_rooms.to_table

    +  

    Source code for matrixctl.commands.largest_rooms.to_table

     # matrixctl
     # Copyright (c) 2020-2023  Michael Sasser <Michael@MichaelSasser.org>
     #
    @@ -109,7 +110,7 @@ 

    Source code for matrixctl.addons.largest_rooms.to_table

    -[docs] +[docs] def format_bytes(size: int) -> str: """Format bytes (storage) into a string using the correct prefix. @@ -136,7 +137,7 @@

    Source code for matrixctl.addons.largest_rooms.to_table

    -[docs] +[docs] def to_table(rooms_list: list[JsonDict]) -> Generator[str, None, None]: """Use this function as helper to pint the largest-room table. diff --git a/_modules/matrixctl/addons/maintenance/addon.html b/_modules/matrixctl/commands/maintenance/addon.html similarity index 95% rename from _modules/matrixctl/addons/maintenance/addon.html rename to _modules/matrixctl/commands/maintenance/addon.html index 8d8081ce..c8ef8ab2 100644 --- a/_modules/matrixctl/addons/maintenance/addon.html +++ b/_modules/matrixctl/commands/maintenance/addon.html @@ -5,7 +5,7 @@ - matrixctl.addons.maintenance.addon — MatrixCtl 0.12.0 documentation + matrixctl.commands.maintenance.addon — MatrixCtl 0.12.0 documentation @@ -46,6 +46,7 @@
  • Getting Started
  • Contributor Documentation
  • Changelog
  • +
  • Changelog (deprecated)
  • @@ -63,7 +64,7 @@
    • - +
    @@ -72,7 +73,7 @@
    -

    Source code for matrixctl.addons.maintenance.addon

    +  

    Source code for matrixctl.commands.maintenance.addon

     # matrixctl
     # Copyright (c) 2020-2023  Michael Sasser <Michael@MichaelSasser.org>
     #
    @@ -113,7 +114,7 @@ 

    Source code for matrixctl.addons.maintenance.addon

    -[docs] +[docs] @unique class Task(Enum): """Use this enum for describing the maintenance task. @@ -135,7 +136,7 @@

    Source code for matrixctl.addons.maintenance.addon