rocketchat-API 3.6.1__tar.gz → 3.7.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/.github/workflows/lint.yml +1 -1
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/.github/workflows/release.yml +1 -1
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/.github/workflows/test.yml +2 -2
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/.github/workflows/test_latest.yml +1 -1
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/.github/workflows/test_manually.yml +1 -1
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/PKG-INFO +1 -1
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API/APIExceptions/RocketExceptions.py +3 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API/APISections/users.py +30 -5
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API.egg-info/PKG-INFO +1 -1
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/tests/test_user.py +43 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/.coveragerc +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/.deepsource.toml +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/.editorconfig +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/.github/actions/test_rocketchat/action.yml +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/.github/dependabot.yml +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/.gitignore +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/CONTRIBUTING.md +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/LICENSE.txt +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/README.md +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/bandit.yml +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/docker-compose.yml +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/pyproject.toml +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/qodana.yaml +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API/APIExceptions/__init__.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API/APISections/__init__.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API/APISections/assets.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API/APISections/banners.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API/APISections/base.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API/APISections/channels.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API/APISections/chat.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API/APISections/custom_emoji.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API/APISections/custom_sounds.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API/APISections/custom_user_status.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API/APISections/dm.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API/APISections/groups.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API/APISections/integrations.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API/APISections/invites.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API/APISections/licenses.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API/APISections/livechat.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API/APISections/miscellaneous.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API/APISections/moderation.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API/APISections/permissions.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API/APISections/roles.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API/APISections/rooms.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API/APISections/settings.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API/APISections/statistics.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API/APISections/subscriptions.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API/APISections/teams.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API/APISections/users_engagement.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API/__init__.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API/rocketchat.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API.egg-info/SOURCES.txt +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API.egg-info/dependency_links.txt +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API.egg-info/requires.txt +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API.egg-info/top_level.txt +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/setup.cfg +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/tests/__init__.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/tests/assets/avatar.png +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/tests/assets/avatar.svg +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/tests/assets/logo.png +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/tests/conftest.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/tests/test_assets.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/tests/test_banners.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/tests/test_channels.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/tests/test_chat.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/tests/test_custom_emoji.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/tests/test_custom_sounds.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/tests/test_custom_user_status.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/tests/test_dms.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/tests/test_exceptions.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/tests/test_groups.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/tests/test_integrations.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/tests/test_invites.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/tests/test_licenses.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/tests/test_livechat.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/tests/test_moderation.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/tests/test_paginated.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/tests/test_permissions.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/tests/test_roles.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/tests/test_rooms.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/tests/test_server.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/tests/test_settings.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/tests/test_subscriptions.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/tests/test_teams.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/tests/test_users_engagement.py +0 -0
|
@@ -15,10 +15,10 @@ jobs:
|
|
|
15
15
|
fail-fast: false
|
|
16
16
|
matrix:
|
|
17
17
|
python-version: [ '3.10', '3.11', '3.12', '3.13', '3.14' ]
|
|
18
|
-
rocket-chat-version: [ '
|
|
18
|
+
rocket-chat-version: [ '8.0.5', '8.1.5', '8.2.5', '8.3.5', '8.4.3', '8.5.0']
|
|
19
19
|
steps:
|
|
20
20
|
- name: Checkout
|
|
21
|
-
uses: actions/checkout@v6.0.
|
|
21
|
+
uses: actions/checkout@v6.0.3
|
|
22
22
|
- name: Test
|
|
23
23
|
uses: ./.github/actions/test_rocketchat
|
|
24
24
|
with:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rocketchat_API
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.7.0
|
|
4
4
|
Summary: Python API wrapper for Rocket.Chat
|
|
5
5
|
Author-email: "Jorge Alberto Díaz Orozco (Akiel)" <diazorozcoj@gmail.com>
|
|
6
6
|
Maintainer-email: "Jorge Alberto Díaz Orozco (Akiel)" <diazorozcoj@gmail.com>
|
{rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API/APIExceptions/RocketExceptions.py
RENAMED
|
@@ -5,6 +5,9 @@ ROOM_ID_OR_NAME_REQUIRED = "room_id or room_name required"
|
|
|
5
5
|
ROOM_ID_OR_GROUP_REQUIRED = "room_id or group required"
|
|
6
6
|
ROOM_ID_OR_CHANNEL_REQUIRED = "room_id or channel required"
|
|
7
7
|
USER_ID_OR_USERNAME_REQUIRED = "user_id or username required"
|
|
8
|
+
USER_INFO_LOOKUP_REQUIRED = (
|
|
9
|
+
"user_id, username, import_id, email or free_switch_extension required"
|
|
10
|
+
)
|
|
8
11
|
ROOM_ID_OR_USERNAME_REQUIRED = "room_id or username required"
|
|
9
12
|
MESSAGE_RID_REQUIRED = "message.rid required"
|
|
10
13
|
TEAM_ID_OR_TEAM_NAME_REQUIRED = "team_id or team_name required"
|
|
@@ -3,6 +3,7 @@ import os
|
|
|
3
3
|
|
|
4
4
|
from rocketchat_API.APIExceptions.RocketExceptions import (
|
|
5
5
|
USER_ID_OR_USERNAME_REQUIRED,
|
|
6
|
+
USER_INFO_LOOKUP_REQUIRED,
|
|
6
7
|
RocketMissingParamException,
|
|
7
8
|
)
|
|
8
9
|
from rocketchat_API.APISections.base import (
|
|
@@ -10,19 +11,43 @@ from rocketchat_API.APISections.base import (
|
|
|
10
11
|
paginated,
|
|
11
12
|
)
|
|
12
13
|
|
|
14
|
+
USERS_INFO = "users.info"
|
|
15
|
+
|
|
13
16
|
|
|
14
17
|
class RocketChatUsers(RocketChatBase):
|
|
15
18
|
def me(self, **kwargs):
|
|
16
19
|
"""Displays information about the authenticated user."""
|
|
17
20
|
return self.call_api_get("me", kwargs=kwargs)
|
|
18
21
|
|
|
19
|
-
def users_info(
|
|
20
|
-
|
|
22
|
+
def users_info(
|
|
23
|
+
self,
|
|
24
|
+
user_id=None,
|
|
25
|
+
username=None,
|
|
26
|
+
import_id=None,
|
|
27
|
+
email=None,
|
|
28
|
+
free_switch_extension=None,
|
|
29
|
+
**kwargs,
|
|
30
|
+
):
|
|
31
|
+
"""Gets a user's information, limited to the caller's permissions.
|
|
32
|
+
|
|
33
|
+
Exactly one lookup parameter must be provided. ``email`` requires
|
|
34
|
+
Rocket.Chat >= 8.4.0 and ``free_switch_extension`` requires >= 8.5.0.
|
|
35
|
+
"""
|
|
21
36
|
if user_id:
|
|
22
|
-
return self.call_api_get(
|
|
37
|
+
return self.call_api_get(USERS_INFO, userId=user_id, kwargs=kwargs)
|
|
23
38
|
if username:
|
|
24
|
-
return self.call_api_get(
|
|
25
|
-
|
|
39
|
+
return self.call_api_get(USERS_INFO, username=username, kwargs=kwargs)
|
|
40
|
+
if import_id:
|
|
41
|
+
return self.call_api_get(USERS_INFO, importId=import_id, kwargs=kwargs)
|
|
42
|
+
if email:
|
|
43
|
+
return self.call_api_get(USERS_INFO, email=email, kwargs=kwargs)
|
|
44
|
+
if free_switch_extension:
|
|
45
|
+
return self.call_api_get(
|
|
46
|
+
USERS_INFO,
|
|
47
|
+
freeSwitchExtension=free_switch_extension,
|
|
48
|
+
kwargs=kwargs,
|
|
49
|
+
)
|
|
50
|
+
raise RocketMissingParamException(USER_INFO_LOOKUP_REQUIRED)
|
|
26
51
|
|
|
27
52
|
@paginated("users")
|
|
28
53
|
def users_list(self, **kwargs):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rocketchat_API
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.7.0
|
|
4
4
|
Summary: Python API wrapper for Rocket.Chat
|
|
5
5
|
Author-email: "Jorge Alberto Díaz Orozco (Akiel)" <diazorozcoj@gmail.com>
|
|
6
6
|
Maintainer-email: "Jorge Alberto Díaz Orozco (Akiel)" <diazorozcoj@gmail.com>
|
|
@@ -7,6 +7,7 @@ from rocketchat_API.APIExceptions.RocketExceptions import (
|
|
|
7
7
|
RocketMissingParamException,
|
|
8
8
|
RocketApiException,
|
|
9
9
|
)
|
|
10
|
+
from tests.conftest import get_tests_passowrd
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
def test_login(logged_rocket, user):
|
|
@@ -55,6 +56,48 @@ def test_users_info(logged_rocket, user):
|
|
|
55
56
|
logged_rocket.users_info()
|
|
56
57
|
|
|
57
58
|
|
|
59
|
+
def test_users_info_by_email(logged_rocket, skip_if_version_under):
|
|
60
|
+
skip_if_version_under("8.4.0")
|
|
61
|
+
email = f"{uuid.uuid4().hex}@domain.com"
|
|
62
|
+
username = f"info_email_{uuid.uuid4().hex[:8]}"
|
|
63
|
+
|
|
64
|
+
# No user has this email yet, so the lookup must fail.
|
|
65
|
+
with pytest.raises(RocketApiException):
|
|
66
|
+
logged_rocket.users_info(email=email)
|
|
67
|
+
|
|
68
|
+
created = logged_rocket.users_create(
|
|
69
|
+
email, username, get_tests_passowrd(), username
|
|
70
|
+
)
|
|
71
|
+
user_id = created.get("user").get("_id")
|
|
72
|
+
try:
|
|
73
|
+
users_info_by_email = logged_rocket.users_info(email=email)
|
|
74
|
+
assert users_info_by_email.get("user").get("_id") == user_id
|
|
75
|
+
finally:
|
|
76
|
+
logged_rocket.users_delete(user_id)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def test_users_info_by_import_id(logged_rocket):
|
|
80
|
+
# An importId can only be set while importing users (CSV, Slack, ...), which
|
|
81
|
+
# is not exposed through the API, so the success path cannot be set up from
|
|
82
|
+
# code. We only assert the parameter reaches the server: the API answering
|
|
83
|
+
# with a "user not found" error (rather than the wrapper raising a
|
|
84
|
+
# missing-param error) proves importId was sent as a query parameter.
|
|
85
|
+
with pytest.raises(RocketApiException):
|
|
86
|
+
logged_rocket.users_info(import_id="nonexistent")
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def test_users_info_by_free_switch_extension(logged_rocket, skip_if_version_under):
|
|
90
|
+
skip_if_version_under("8.5.0")
|
|
91
|
+
# Assigning a freeSwitchExtension requires a configured FreeSwitch server
|
|
92
|
+
# (VoIP_TeamCollab), which is part of the deployment rather than something we
|
|
93
|
+
# can set up from code, so the success path cannot be exercised here. We only
|
|
94
|
+
# assert the parameter reaches the server: the API answering with a "user not
|
|
95
|
+
# found" error (rather than the wrapper raising a missing-param error) proves
|
|
96
|
+
# freeSwitchExtension was sent as a query parameter.
|
|
97
|
+
with pytest.raises(RocketApiException):
|
|
98
|
+
logged_rocket.users_info(free_switch_extension="0000")
|
|
99
|
+
|
|
100
|
+
|
|
58
101
|
def test_users_get_presence(logged_rocket, user):
|
|
59
102
|
login = logged_rocket.login(user.name, user.password)
|
|
60
103
|
users_get_presence = logged_rocket.users_get_presence(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API/APISections/custom_user_status.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rocketchat_api-3.6.1 → rocketchat_api-3.7.0}/rocketchat_API/APISections/users_engagement.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|