rocketchat-API 3.6.1__tar.gz → 3.7.1__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.1}/.github/workflows/lint.yml +2 -2
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/.github/workflows/release.yml +2 -2
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/.github/workflows/test.yml +2 -2
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/.github/workflows/test_latest.yml +1 -1
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/.github/workflows/test_manually.yml +1 -1
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/PKG-INFO +1 -8
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/README.md +0 -7
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API/APIExceptions/RocketExceptions.py +3 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API/APISections/chat.py +0 -1
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API/APISections/users.py +30 -5
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API.egg-info/PKG-INFO +1 -8
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API.egg-info/SOURCES.txt +2 -0
- rocketchat_api-3.7.1/rocketchat_API.egg-info/scm_file_list.json +84 -0
- rocketchat_api-3.7.1/rocketchat_API.egg-info/scm_version.json +8 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/tests/conftest.py +40 -8
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/tests/test_chat.py +3 -1
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/tests/test_livechat.py +4 -2
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/tests/test_user.py +43 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/.coveragerc +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/.deepsource.toml +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/.editorconfig +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/.github/actions/test_rocketchat/action.yml +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/.github/dependabot.yml +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/.gitignore +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/CONTRIBUTING.md +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/LICENSE.txt +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/bandit.yml +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/docker-compose.yml +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/pyproject.toml +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/qodana.yaml +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API/APIExceptions/__init__.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API/APISections/__init__.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API/APISections/assets.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API/APISections/banners.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API/APISections/base.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API/APISections/channels.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API/APISections/custom_emoji.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API/APISections/custom_sounds.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API/APISections/custom_user_status.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API/APISections/dm.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API/APISections/groups.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API/APISections/integrations.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API/APISections/invites.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API/APISections/licenses.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API/APISections/livechat.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API/APISections/miscellaneous.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API/APISections/moderation.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API/APISections/permissions.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API/APISections/roles.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API/APISections/rooms.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API/APISections/settings.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API/APISections/statistics.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API/APISections/subscriptions.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API/APISections/teams.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API/APISections/users_engagement.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API/__init__.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API/rocketchat.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API.egg-info/dependency_links.txt +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API.egg-info/requires.txt +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/rocketchat_API.egg-info/top_level.txt +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/setup.cfg +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/tests/__init__.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/tests/assets/avatar.png +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/tests/assets/avatar.svg +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/tests/assets/logo.png +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/tests/test_assets.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/tests/test_banners.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/tests/test_channels.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/tests/test_custom_emoji.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/tests/test_custom_sounds.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/tests/test_custom_user_status.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/tests/test_dms.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/tests/test_exceptions.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/tests/test_groups.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/tests/test_integrations.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/tests/test_invites.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/tests/test_licenses.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/tests/test_moderation.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/tests/test_paginated.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/tests/test_permissions.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/tests/test_roles.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/tests/test_rooms.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/tests/test_server.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/tests/test_settings.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/tests/test_subscriptions.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/tests/test_teams.py +0 -0
- {rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/tests/test_users_engagement.py +0 -0
|
@@ -12,11 +12,11 @@ jobs:
|
|
|
12
12
|
runs-on: ubuntu-latest
|
|
13
13
|
steps:
|
|
14
14
|
- name: Checkout
|
|
15
|
-
uses: actions/checkout@
|
|
15
|
+
uses: actions/checkout@v7.0.1
|
|
16
16
|
with:
|
|
17
17
|
fetch-depth: 0
|
|
18
18
|
- name: Set up Python
|
|
19
|
-
uses: actions/setup-python@
|
|
19
|
+
uses: actions/setup-python@v7
|
|
20
20
|
with:
|
|
21
21
|
python-version: "3.14"
|
|
22
22
|
- name: Install black
|
|
@@ -14,9 +14,9 @@ jobs:
|
|
|
14
14
|
id-token: write
|
|
15
15
|
steps:
|
|
16
16
|
- name: Checkout
|
|
17
|
-
uses: actions/checkout@
|
|
17
|
+
uses: actions/checkout@v7.0.1
|
|
18
18
|
- name: Set up Python 3.14
|
|
19
|
-
uses: actions/setup-python@
|
|
19
|
+
uses: actions/setup-python@v7
|
|
20
20
|
with:
|
|
21
21
|
python-version: '3.14'
|
|
22
22
|
- name: Install dependencies
|
|
@@ -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.1.7', '8.2.7', '8.3.7', '8.4.5', '8.5.2', '8.6.1', '8.7.0']
|
|
19
19
|
steps:
|
|
20
20
|
- name: Checkout
|
|
21
|
-
uses: actions/checkout@
|
|
21
|
+
uses: actions/checkout@v7.0.1
|
|
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.1
|
|
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>
|
|
@@ -182,10 +182,3 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on how to contribute to th
|
|
|
182
182
|
## License
|
|
183
183
|
|
|
184
184
|
This project is licensed under the MIT License. See [LICENSE.txt](LICENSE.txt) for details.
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
## Supporters
|
|
188
|
-
|
|
189
|
-
[](https://jb.gg/OpenSourceSupport)
|
|
190
|
-
|
|
191
|
-
[JetBrains](https://www.jetbrains.com/) supports this project by providing licenses for their development tools.
|
|
@@ -159,10 +159,3 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on how to contribute to th
|
|
|
159
159
|
## License
|
|
160
160
|
|
|
161
161
|
This project is licensed under the MIT License. See [LICENSE.txt](LICENSE.txt) for details.
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
## Supporters
|
|
165
|
-
|
|
166
|
-
[](https://jb.gg/OpenSourceSupport)
|
|
167
|
-
|
|
168
|
-
[JetBrains](https://www.jetbrains.com/) supports this project by providing licenses for their development tools.
|
{rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/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"
|
|
@@ -72,7 +72,6 @@ class RocketChatChat(RocketChatBase):
|
|
|
72
72
|
"chat.search", roomId=room_id, searchText=search_text, kwargs=kwargs
|
|
73
73
|
)
|
|
74
74
|
|
|
75
|
-
@paginated("receipts")
|
|
76
75
|
def chat_get_message_read_receipts(self, message_id, **kwargs):
|
|
77
76
|
"""Get Message Read Receipts"""
|
|
78
77
|
return self.call_api_get(
|
|
@@ -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.1
|
|
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>
|
|
@@ -182,10 +182,3 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on how to contribute to th
|
|
|
182
182
|
## License
|
|
183
183
|
|
|
184
184
|
This project is licensed under the MIT License. See [LICENSE.txt](LICENSE.txt) for details.
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
## Supporters
|
|
188
|
-
|
|
189
|
-
[](https://jb.gg/OpenSourceSupport)
|
|
190
|
-
|
|
191
|
-
[JetBrains](https://www.jetbrains.com/) supports this project by providing licenses for their development tools.
|
|
@@ -24,6 +24,8 @@ rocketchat_API.egg-info/PKG-INFO
|
|
|
24
24
|
rocketchat_API.egg-info/SOURCES.txt
|
|
25
25
|
rocketchat_API.egg-info/dependency_links.txt
|
|
26
26
|
rocketchat_API.egg-info/requires.txt
|
|
27
|
+
rocketchat_API.egg-info/scm_file_list.json
|
|
28
|
+
rocketchat_API.egg-info/scm_version.json
|
|
27
29
|
rocketchat_API.egg-info/top_level.txt
|
|
28
30
|
rocketchat_API/APIExceptions/RocketExceptions.py
|
|
29
31
|
rocketchat_API/APIExceptions/__init__.py
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
{
|
|
2
|
+
"files": [
|
|
3
|
+
".coveragerc",
|
|
4
|
+
".deepsource.toml",
|
|
5
|
+
".editorconfig",
|
|
6
|
+
".github/ISSUE_TEMPLATE/bug_report.md",
|
|
7
|
+
".github/ISSUE_TEMPLATE/feature_request.md",
|
|
8
|
+
".github/actions/test_rocketchat/action.yml",
|
|
9
|
+
".github/dependabot.yml",
|
|
10
|
+
".github/workflows/lint.yml",
|
|
11
|
+
".github/workflows/release.yml",
|
|
12
|
+
".github/workflows/test.yml",
|
|
13
|
+
".github/workflows/test_latest.yml",
|
|
14
|
+
".github/workflows/test_manually.yml",
|
|
15
|
+
".gitignore",
|
|
16
|
+
"CONTRIBUTING.md",
|
|
17
|
+
"LICENSE.txt",
|
|
18
|
+
"README.md",
|
|
19
|
+
"bandit.yml",
|
|
20
|
+
"docker-compose.yml",
|
|
21
|
+
"pyproject.toml",
|
|
22
|
+
"qodana.yaml",
|
|
23
|
+
"rocketchat_API/APIExceptions/RocketExceptions.py",
|
|
24
|
+
"rocketchat_API/APIExceptions/__init__.py",
|
|
25
|
+
"rocketchat_API/APISections/__init__.py",
|
|
26
|
+
"rocketchat_API/APISections/assets.py",
|
|
27
|
+
"rocketchat_API/APISections/banners.py",
|
|
28
|
+
"rocketchat_API/APISections/base.py",
|
|
29
|
+
"rocketchat_API/APISections/channels.py",
|
|
30
|
+
"rocketchat_API/APISections/chat.py",
|
|
31
|
+
"rocketchat_API/APISections/custom_emoji.py",
|
|
32
|
+
"rocketchat_API/APISections/custom_sounds.py",
|
|
33
|
+
"rocketchat_API/APISections/custom_user_status.py",
|
|
34
|
+
"rocketchat_API/APISections/dm.py",
|
|
35
|
+
"rocketchat_API/APISections/groups.py",
|
|
36
|
+
"rocketchat_API/APISections/integrations.py",
|
|
37
|
+
"rocketchat_API/APISections/invites.py",
|
|
38
|
+
"rocketchat_API/APISections/licenses.py",
|
|
39
|
+
"rocketchat_API/APISections/livechat.py",
|
|
40
|
+
"rocketchat_API/APISections/miscellaneous.py",
|
|
41
|
+
"rocketchat_API/APISections/moderation.py",
|
|
42
|
+
"rocketchat_API/APISections/permissions.py",
|
|
43
|
+
"rocketchat_API/APISections/roles.py",
|
|
44
|
+
"rocketchat_API/APISections/rooms.py",
|
|
45
|
+
"rocketchat_API/APISections/settings.py",
|
|
46
|
+
"rocketchat_API/APISections/statistics.py",
|
|
47
|
+
"rocketchat_API/APISections/subscriptions.py",
|
|
48
|
+
"rocketchat_API/APISections/teams.py",
|
|
49
|
+
"rocketchat_API/APISections/users.py",
|
|
50
|
+
"rocketchat_API/APISections/users_engagement.py",
|
|
51
|
+
"rocketchat_API/__init__.py",
|
|
52
|
+
"rocketchat_API/rocketchat.py",
|
|
53
|
+
"tests/__init__.py",
|
|
54
|
+
"tests/assets/avatar.png",
|
|
55
|
+
"tests/assets/avatar.svg",
|
|
56
|
+
"tests/assets/logo.png",
|
|
57
|
+
"tests/conftest.py",
|
|
58
|
+
"tests/test_assets.py",
|
|
59
|
+
"tests/test_banners.py",
|
|
60
|
+
"tests/test_channels.py",
|
|
61
|
+
"tests/test_chat.py",
|
|
62
|
+
"tests/test_custom_emoji.py",
|
|
63
|
+
"tests/test_custom_sounds.py",
|
|
64
|
+
"tests/test_custom_user_status.py",
|
|
65
|
+
"tests/test_dms.py",
|
|
66
|
+
"tests/test_exceptions.py",
|
|
67
|
+
"tests/test_groups.py",
|
|
68
|
+
"tests/test_integrations.py",
|
|
69
|
+
"tests/test_invites.py",
|
|
70
|
+
"tests/test_licenses.py",
|
|
71
|
+
"tests/test_livechat.py",
|
|
72
|
+
"tests/test_moderation.py",
|
|
73
|
+
"tests/test_paginated.py",
|
|
74
|
+
"tests/test_permissions.py",
|
|
75
|
+
"tests/test_roles.py",
|
|
76
|
+
"tests/test_rooms.py",
|
|
77
|
+
"tests/test_server.py",
|
|
78
|
+
"tests/test_settings.py",
|
|
79
|
+
"tests/test_subscriptions.py",
|
|
80
|
+
"tests/test_teams.py",
|
|
81
|
+
"tests/test_user.py",
|
|
82
|
+
"tests/test_users_engagement.py"
|
|
83
|
+
]
|
|
84
|
+
}
|
|
@@ -92,17 +92,49 @@ def skip_if_version_under(rocket):
|
|
|
92
92
|
|
|
93
93
|
@pytest.fixture
|
|
94
94
|
def skip_if_no_license(logged_rocket):
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
95
|
+
licenses_info = logged_rocket.licenses_info()
|
|
96
|
+
if "license" in licenses_info and "license" in licenses_info.get("license"):
|
|
97
|
+
return
|
|
98
|
+
pytest.skip("No license available") # pragma: no cover
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
@pytest.fixture(scope="session", autouse=True)
|
|
102
|
+
def grant_message_impersonate(logged_rocket):
|
|
103
|
+
"""Grant the 'message-impersonate' permission to the admin role.
|
|
104
|
+
|
|
105
|
+
Incoming integrations that post as a user require that user to hold the
|
|
106
|
+
'message-impersonate' permission. It is granted to the 'bot' and 'app' roles
|
|
107
|
+
by default but not to 'admin', so the integration tests would otherwise fail
|
|
108
|
+
with 'error-user-lacks-message-impersonate-permission'.
|
|
109
|
+
"""
|
|
110
|
+
logged_rocket.permissions_update(
|
|
111
|
+
permissions=[{"_id": "message-impersonate", "roles": ["admin", "bot", "app"]}]
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
@pytest.fixture
|
|
116
|
+
def accept_chats_with_no_agents(logged_rocket):
|
|
117
|
+
"""Allow opening livechat rooms while no agent is online.
|
|
118
|
+
|
|
119
|
+
In a headless test environment there is no persistent connection keeping an
|
|
120
|
+
agent's presence 'online', so Rocket.Chat would otherwise refuse to open a
|
|
121
|
+
room with 'no-agent-online'. Accepting chats with no agents online lets the
|
|
122
|
+
room be created and the inquiry queued regardless.
|
|
123
|
+
"""
|
|
124
|
+
original_accept = logged_rocket.settings_get(
|
|
125
|
+
"Livechat_accept_chats_with_no_agents"
|
|
126
|
+
).get("value")
|
|
127
|
+
logged_rocket.settings_update("Livechat_accept_chats_with_no_agents", True)
|
|
128
|
+
|
|
129
|
+
yield
|
|
130
|
+
|
|
131
|
+
logged_rocket.settings_update(
|
|
132
|
+
"Livechat_accept_chats_with_no_agents", original_accept
|
|
133
|
+
)
|
|
102
134
|
|
|
103
135
|
|
|
104
136
|
@pytest.fixture
|
|
105
|
-
def livechat_inquiry(logged_rocket):
|
|
137
|
+
def livechat_inquiry(logged_rocket, accept_chats_with_no_agents):
|
|
106
138
|
"""Create a livechat agent, visitor, and room to generate an inquiry."""
|
|
107
139
|
# Save original routing method and set to Manual_Selection to prevent auto-assignment
|
|
108
140
|
original_routing = logged_rocket.settings_get("Livechat_Routing_Method")
|
|
@@ -147,7 +147,9 @@ def test_chat_get_message_read_receipts(
|
|
|
147
147
|
second_rocket = RocketChat("secondary", get_tests_passowrd())
|
|
148
148
|
second_rocket.subscriptions_read(rid="GENERAL")
|
|
149
149
|
|
|
150
|
-
receipts =
|
|
150
|
+
receipts = logged_rocket.chat_get_message_read_receipts(message_id=message_id).get(
|
|
151
|
+
"receipts"
|
|
152
|
+
)
|
|
151
153
|
assert len(receipts) > 0
|
|
152
154
|
for receipt in receipts:
|
|
153
155
|
assert "userId" in receipt
|
|
@@ -58,7 +58,7 @@ def test_livechat_visitor_minimal(logged_rocket):
|
|
|
58
58
|
assert "visitor" in new_visitor
|
|
59
59
|
|
|
60
60
|
|
|
61
|
-
def test_livechat_visitor_room_and_message(logged_rocket):
|
|
61
|
+
def test_livechat_visitor_room_and_message(logged_rocket, accept_chats_with_no_agents):
|
|
62
62
|
token = str(uuid.uuid1())
|
|
63
63
|
name = str(uuid.uuid1())
|
|
64
64
|
new_visitor = logged_rocket.livechat_register_visitor(
|
|
@@ -69,7 +69,9 @@ def test_livechat_visitor_room_and_message(logged_rocket):
|
|
|
69
69
|
get_visitor = logged_rocket.livechat_get_visitor(token=token)
|
|
70
70
|
assert name == get_visitor.get("visitor").get("username")
|
|
71
71
|
|
|
72
|
-
# We need to create a livechat agent and set the user online in order to be able to get a room
|
|
72
|
+
# We need to create a livechat agent and set the user online in order to be able to get a room.
|
|
73
|
+
# The accept_chats_with_no_agents fixture allows the room to open despite the agent's presence
|
|
74
|
+
# not staying online in a headless test environment.
|
|
73
75
|
username = logged_rocket.me().get("username")
|
|
74
76
|
new_user = logged_rocket.livechat_create_user(user_type="agent", username=username)
|
|
75
77
|
logged_rocket.users_set_status(message="working on it", status="online")
|
|
@@ -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
|
{rocketchat_api-3.6.1 → rocketchat_api-3.7.1}/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.1}/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
|