synapse-admin-api-python

A Python wrapper for Matrix Synapse admin API

MIT License

Downloads
394
Stars
12
Committers
3
synapse-admin-api-python - Major Update (2022/06/09) Latest Release

Published by KnugiHK over 2 years ago

As mentioned in Synapse 1.58.0 release notes, groups feature will be remove in 1.61.0. Therefore, this will be the last version that support groups related API.

Changes since 0.6.7

  1. Implemented two new APIs introduced in 1.52.0.
  2. Added an alias (Media.delete) for Media.delete_media.
  3. Media.delete_media accept a list of media id in "mediaid" argument now.

Bug fixed

  1. When "admin" & "deactivated" in User.create_modify is False, the program does not pass the boolean value to the request body.
synapse-admin-api-python - Lunar Feature Update (2022/2/1)

Published by KnugiHK over 2 years ago

Happy Lunar New Year!

Changes since 0.6.5

  1. Implemented new API to query account data.
synapse-admin-api-python - Major Update (2021/12/15)

Published by KnugiHK almost 3 years ago

Changes since 0.6.0

  1. Implemented new delete room API.
  2. Implemented un-shadow ban API.
  3. Implemented block room APIs.
  4. Implemented APIs related to federation.
  5. Implemented APIs related to background update.
  6. Updated dependency HTTPX from 0.20.0 to 0.21.1.
  7. Added ability to add offset to current time in Utility.get_current_time.
synapse-admin-api-python - Major Update (2021/11/18)

Published by KnugiHK almost 3 years ago

Changes since 0.5.6

  1. Support Python 3.10.0
  2. Updated dependency HTTPX from 0.18.2 to 0.20.0
  3. Show an error when timestamp in seconds is provided to the Media.purge_remote_media API.
  4. ClientAPI.admin_login will now perform auto-retry when HTTP 429 occurs.
  5. Added support for changing user type in User.create_modify.
  6. Added support for background updates status admin API.
synapse-admin-api-python - Minor update (2021/09/11)

Published by KnugiHK about 3 years ago

Changes since 0.5.5

  1. Retry the create room request automatically when being rate-limited
  2. Handle two API endpoints which are removed in Synapse 1.42.0
synapse-admin-api-python - Major update (2021/08/26)

Published by KnugiHK about 3 years ago

Changes since 0.5.0

  1. Added unit testing
  2. Added checking for argument order_by in User.lists
  3. Added username availability checking API
  4. Added delete media uploaded by a user API
  5. Added a new parameter called "external_ids" to User.create_modify
  6. Updated dependency httpx to 0.18.2
  7. Implemented a simple MIME type guessing based on magic
  8. Support sending media in an announcement
  9. Management.announce is now a helper method for old Management.announce and Management.announce_all
  10. Some PEP8
synapse-admin-api-python - Major update (2021/7/30)

Published by KnugiHK about 3 years ago

This version has incompatibility with the previous version

  • Any methods that will return total number and/or next token will now return a new class, named Contents and ContentsDict, instance
    • The returned data (list/dict) can be accessed by Contents and ContentsDict itself
    • The total number can be accessed through Contents.total and ContensDict.total
    • The next token can be accessed through Contents.next and ContensDict.next

Changes since 0.3.0

  1. Added homeserver alias validation
  2. Added default value for size_gt in Media.delete_media
  3. Added type checking on argument "timestamp" in Media.delete_local_media_by_condition
  4. Added checking for the conflict values of members and leave in Room.create
  5. Added some alias for Room, Management, Media and ClientAPI
  6. Added an option for non-admin login in ClientAPI
  7. Added a new class named "Contents" to handle returned data with the total number and/or next token
  8. Replaced all return data which contain a total number and/or next token
  9. Converted some tuple in return data of some methods to NamedTuple
  10. Improved docstrings
  11. Re-implemented User._generate_mac
  12. Handled error in User.deactivate, User.active_sessions and User.query
  13. Renamed the package name in __init__
  14. Renamed ClientAPI.client_create to client_create_room and ClientAPI.client_leave to client_leave_room
  15. Made argument "userid" in Room.set_admin optional to implement the feature of granting power to the user themself
  16. Set the default value of size_gt to 0 in Media.delete_local_media_by_condition
  17. Support encryption when creating room
  18. Raise SynapseException instead of just returning False when an error occurs in _Device.delete and _Device._delete_multiple
  19. Accept a mxc URI as media id in class Media

Bug fixed

  1. User() and ClientAPI() read configuration when connection information is provided in initial variable
  2. Suppression of exception in _Device is missing
  3. The key, purge_id, is being accessed too early in Management.purge_history
  4. Wrong key being accessed in Room.lists and ClientAPI.client_create
  5. Parameter members in Room.create is not being checked for None before goes to the for loop
synapse-admin-api-python - Major update (2021/7/5)

Published by KnugiHK over 3 years ago

Changes since 0.2.0

  1. Implement the whole media statistics API
  2. Room.lists will now return dict item individually instead of returning the whole dict
  3. Return next_token in Management.event_reports
  4. Return a dict with user id as key and the event id as value in Management.announce_all
  5. Return bool instead of a list in Media.delete_local_media
  6. More docstrings
  7. Refactored some return line
  8. Removed SynapseAPIError

Bug fixed

  1. User.lists return one more value now, hence Management.announce_all is broken
  2. Fix some broken docstring contents
synapse-admin-api-python - Minor update (2021/6/30)

Published by KnugiHK over 3 years ago

Changes since 0.2.0

  1. Force the user to enter only "y" or "n" or leave it blank in saving config dialog

Bug fixed

  1. Failure to authenticate the user after invoking Admin.modify_config
  2. Even the user chose not to save the config in the dialog, the config still being saved
synapse-admin-api-python - First beta release (2021/6/16)

Published by KnugiHK over 3 years ago

Changes since 0.2.0rc2

  1. Development status changed from alpha to beta!
  2. Added a helper method for deleting local and remote media
  3. Refactored some code
  4. Made kwargs in User.create() keyword-only arguments
  5. More and better documentation
  6. Returning next_token in User.lists
  7. Support argument "dir" in User.lists
  8. Returning the admin status of the user after invoking User.set_admin
  9. User.validity will now return expiration_ts instead of a dict with only one key

Bug fixed

  1. server_name in Media.quarantine_remove should be optional
synapse-admin-api-python - Major update (2021/6/10)

Published by KnugiHK over 3 years ago

Changes since 0.2.0rc1

  1. Allow user to get the access token by logging in their admin account
  2. Correct the data type of argument "federation" in ClientAPI.client_create and Room.create
  3. Separated the client API to another module
  4. Added 'Mgt' as an alias for Management
  5. Unprotected two new APIs introduced in 1.36.0
  6. Added more type hints

Bug fixed

  1. Wrong Pypi classifier
  2. No exception information available when the user authenticated successfully but not an admin
synapse-admin-api-python - Major update (2021/6/6)

Published by KnugiHK over 3 years ago

Changes since 0.1.5:

  1. Support automatically set or revoke admin in User.set_admin
  2. Support enter password interactively
  3. Re-implemented Admin.modify_config
  4. Added context managers (with User() as user)
  5. Added some type hints
  6. Added some documentation strings
  7. Added docs
synapse-admin-api-python - Major update (2021/5/30)

Published by KnugiHK over 3 years ago

As the original HTTP client library Hyper is no longer maintained, this update migrated the HTTP client from Hyper to HTTPX.

Changes since 0.1.5rc2:

  1. Tested all API endpoints after the HTTP library migrated.
  2. Changed the User.modify from a method to an alias.
  3. Removed redundant validation of username in User.
  4. Separated the endpoint of getting nonce for register.
  5. Changed type hint in Room.create.
  6. Renamed a variable in Management.
  7. Added validate_group method.
  8. Support argument "valid_until_ms" in User.login.

Bug fixed

  1. Exception will be raised when DELETE requests have a body.
  2. Unusable _Device class.
  3. Some returned status_code variables are incorrect in Management and Room.
synapse-admin-api-python - Major update (2021/5/30)

Published by KnugiHK over 3 years ago

As the original HTTP client library Hyper is no longer maintained, this update migrated the HTTP client from Hyper to HTTPX.
This update is not yet tested heavily, use it at your own risk.

Changes since 0.1.5rc1:

  1. Allow the connection information not to be saved after the prompt of asking for the information.
  2. Support protocol selection in the connection information
  3. Refactored code
  4. Added some type hints
  5. Added some documentation
  6. Requires at least Python 3.7
synapse-admin-api-python - Major update (2021/5/21)

Published by KnugiHK over 3 years ago

Major update

As the original HTTP client library Hyper is no longer maintained, this major update migrated the HTTP client from Hyper to HTTPX.
This update is not yet tested heavily, use it at your own risk.

Bug fixed:

  1. Configuration creation function will be invoked even connection information is provided in the instantiation of classes.
  2. HTTP/1 was not supported properly.
synapse-admin-api-python - Minor bug fix for User.creates

Published by KnugiHK over 3 years ago

Description of the fixed bug: The function goes into the exception section instead of returning True when user is created successfully.

No other changes since 0.1.0.

synapse-admin-api-python - First pre-release

Published by KnugiHK over 3 years ago

This version is now up to Synapse 1.34.0.

All functions have been tested, however, they are not being tested heavily.