rocketchat-API 3.5.0__tar.gz → 3.6.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.5.0 → rocketchat_api-3.6.1}/PKG-INFO +1 -1
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API/APISections/dm.py +3 -3
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API/APISections/rooms.py +14 -3
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API/APISections/teams.py +1 -3
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API/APISections/users.py +1 -1
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API.egg-info/PKG-INFO +1 -1
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/tests/test_dms.py +1 -1
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/tests/test_rooms.py +41 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/.coveragerc +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/.deepsource.toml +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/.editorconfig +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/.github/actions/test_rocketchat/action.yml +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/.github/dependabot.yml +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/.github/workflows/lint.yml +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/.github/workflows/release.yml +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/.github/workflows/test.yml +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/.github/workflows/test_latest.yml +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/.github/workflows/test_manually.yml +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/.gitignore +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/CONTRIBUTING.md +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/LICENSE.txt +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/README.md +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/bandit.yml +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/docker-compose.yml +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/pyproject.toml +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/qodana.yaml +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API/APIExceptions/RocketExceptions.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API/APIExceptions/__init__.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API/APISections/__init__.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API/APISections/assets.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API/APISections/banners.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API/APISections/base.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API/APISections/channels.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API/APISections/chat.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API/APISections/custom_emoji.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API/APISections/custom_sounds.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API/APISections/custom_user_status.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API/APISections/groups.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API/APISections/integrations.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API/APISections/invites.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API/APISections/licenses.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API/APISections/livechat.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API/APISections/miscellaneous.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API/APISections/moderation.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API/APISections/permissions.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API/APISections/roles.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API/APISections/settings.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API/APISections/statistics.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API/APISections/subscriptions.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API/APISections/users_engagement.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API/__init__.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API/rocketchat.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API.egg-info/SOURCES.txt +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API.egg-info/dependency_links.txt +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API.egg-info/requires.txt +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/rocketchat_API.egg-info/top_level.txt +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/setup.cfg +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/tests/__init__.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/tests/assets/avatar.png +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/tests/assets/avatar.svg +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/tests/assets/logo.png +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/tests/conftest.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/tests/test_assets.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/tests/test_banners.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/tests/test_channels.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/tests/test_chat.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/tests/test_custom_emoji.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/tests/test_custom_sounds.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/tests/test_custom_user_status.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/tests/test_exceptions.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/tests/test_groups.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/tests/test_integrations.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/tests/test_invites.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/tests/test_licenses.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/tests/test_livechat.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/tests/test_moderation.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/tests/test_paginated.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/tests/test_permissions.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/tests/test_roles.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/tests/test_server.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/tests/test_settings.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/tests/test_subscriptions.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/tests/test_teams.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/tests/test_user.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.1}/tests/test_users_engagement.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rocketchat_API
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.6.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>
|
|
@@ -78,10 +78,10 @@ class RocketChatDM(RocketChatBase):
|
|
|
78
78
|
return self.call_api_get("dm.files", username=user_name, kwargs=kwargs)
|
|
79
79
|
raise RocketMissingParamException(ROOM_ID_OR_USERNAME_REQUIRED)
|
|
80
80
|
|
|
81
|
-
def dm_counters(self, room_id,
|
|
81
|
+
def dm_counters(self, room_id, user_id=None):
|
|
82
82
|
"""Gets counters of direct messages."""
|
|
83
|
-
if
|
|
84
|
-
return self.call_api_get("dm.counters", roomId=room_id,
|
|
83
|
+
if user_id:
|
|
84
|
+
return self.call_api_get("dm.counters", roomId=room_id, userId=user_id)
|
|
85
85
|
return self.call_api_get("dm.counters", roomId=room_id)
|
|
86
86
|
|
|
87
87
|
def dm_delete(self, room_id, **kwargs):
|
|
@@ -69,11 +69,22 @@ class RocketChatRooms(RocketChatBase):
|
|
|
69
69
|
"""Upload media files to a room."""
|
|
70
70
|
files = {
|
|
71
71
|
"file": (
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
file
|
|
73
|
+
if isinstance(file, (list, tuple))
|
|
74
|
+
else (
|
|
75
|
+
os.path.basename(file),
|
|
76
|
+
open(file, "rb"),
|
|
77
|
+
mimetypes.guess_type(file)[0],
|
|
78
|
+
)
|
|
75
79
|
),
|
|
76
80
|
}
|
|
77
81
|
return self.call_api_post(
|
|
78
82
|
"rooms.media/" + room_id, kwargs=kwargs, use_json=False, files=files
|
|
79
83
|
)
|
|
84
|
+
|
|
85
|
+
def rooms_media_confirm(self, room_id, file_id, **kwargs):
|
|
86
|
+
"""Confirm a previously uploaded media file in a room."""
|
|
87
|
+
return self.call_api_post(
|
|
88
|
+
"rooms.mediaConfirm/" + room_id + "/" + file_id,
|
|
89
|
+
kwargs=kwargs,
|
|
90
|
+
)
|
|
@@ -173,7 +173,7 @@ class RocketChatTeams(RocketChatBase):
|
|
|
173
173
|
|
|
174
174
|
@paginated("rooms")
|
|
175
175
|
def teams_list_rooms_of_user(
|
|
176
|
-
self, team_id=None, team_name=None, user_id=None,
|
|
176
|
+
self, team_id=None, team_name=None, user_id=None, **kwargs
|
|
177
177
|
):
|
|
178
178
|
"""
|
|
179
179
|
Lists only the team's rooms that a particular user has joined.
|
|
@@ -184,7 +184,6 @@ class RocketChatTeams(RocketChatBase):
|
|
|
184
184
|
"teams.listRoomsOfUser",
|
|
185
185
|
teamId=team_id,
|
|
186
186
|
userId=user_id,
|
|
187
|
-
canAdd=can_add,
|
|
188
187
|
kwargs=kwargs,
|
|
189
188
|
)
|
|
190
189
|
if team_name:
|
|
@@ -192,7 +191,6 @@ class RocketChatTeams(RocketChatBase):
|
|
|
192
191
|
"teams.listRoomsOfUser",
|
|
193
192
|
teamName=team_name,
|
|
194
193
|
userId=user_id,
|
|
195
|
-
canAdd=can_add,
|
|
196
194
|
kwargs=kwargs,
|
|
197
195
|
)
|
|
198
196
|
raise RocketMissingParamException(TEAM_ID_OR_TEAM_NAME_REQUIRED)
|
|
@@ -129,7 +129,7 @@ class RocketChatUsers(RocketChatBase):
|
|
|
129
129
|
|
|
130
130
|
def users_forgot_password(self, email, **kwargs):
|
|
131
131
|
"""Send email to reset your password."""
|
|
132
|
-
return self.call_api_post("users.forgotPassword", email=email,
|
|
132
|
+
return self.call_api_post("users.forgotPassword", email=email, kwargs=kwargs)
|
|
133
133
|
|
|
134
134
|
def users_get_preferences(self, **kwargs):
|
|
135
135
|
"""Gets all preferences of user."""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rocketchat_API
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.6.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>
|
|
@@ -146,7 +146,7 @@ def test_dm_counters(logged_rocket, recipient_user):
|
|
|
146
146
|
|
|
147
147
|
dm_counters = logged_rocket.dm_counters(
|
|
148
148
|
room_id=dm_create.get("room").get("_id"),
|
|
149
|
-
|
|
149
|
+
user_id=logged_rocket.me().get("_id"),
|
|
150
150
|
)
|
|
151
151
|
assert all(
|
|
152
152
|
key in dm_counters
|
|
@@ -15,6 +15,47 @@ def test_rooms_media(logged_rocket):
|
|
|
15
15
|
assert str(rooms_media.get("file").get("url")).endswith("avatar.png")
|
|
16
16
|
|
|
17
17
|
|
|
18
|
+
def test_rooms_media_array_file(logged_rocket):
|
|
19
|
+
with open("tests/assets/avatar.png", "rb") as avatar_file:
|
|
20
|
+
avatar_bytes = avatar_file.read()
|
|
21
|
+
|
|
22
|
+
rooms_media = logged_rocket.rooms_media(
|
|
23
|
+
"GENERAL",
|
|
24
|
+
file=("avatar.png", avatar_bytes, "image/png"),
|
|
25
|
+
description="hey there",
|
|
26
|
+
)
|
|
27
|
+
assert str(rooms_media.get("file").get("url")).endswith("avatar.png")
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def test_rooms_media_array_file_with_list(logged_rocket):
|
|
31
|
+
with open("tests/assets/avatar.png", "rb") as avatar_file:
|
|
32
|
+
avatar_bytes = avatar_file.read()
|
|
33
|
+
|
|
34
|
+
rooms_media = logged_rocket.rooms_media(
|
|
35
|
+
"GENERAL",
|
|
36
|
+
file=["avatar.png", avatar_bytes, "image/png"], # list instead of tuple
|
|
37
|
+
description="hey there",
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
assert str(rooms_media.get("file").get("url")).endswith("avatar.png")
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def test_rooms_media_confirm(logged_rocket):
|
|
44
|
+
uploaded_media = logged_rocket.rooms_media(
|
|
45
|
+
"GENERAL", file="tests/assets/avatar.png"
|
|
46
|
+
)
|
|
47
|
+
file_id = str(uploaded_media.get("file").get("_id"))
|
|
48
|
+
assert file_id
|
|
49
|
+
|
|
50
|
+
confirmed_media = logged_rocket.rooms_media_confirm(
|
|
51
|
+
room_id="GENERAL",
|
|
52
|
+
file_id=file_id,
|
|
53
|
+
msg="confirmed upload",
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
assert confirmed_media.get("message").get("_id")
|
|
57
|
+
|
|
58
|
+
|
|
18
59
|
def test_rooms_get(logged_rocket):
|
|
19
60
|
rooms_get = logged_rocket.rooms_get()
|
|
20
61
|
assert "update" in rooms_get
|
|
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.5.0 → rocketchat_api-3.6.1}/rocketchat_API/APIExceptions/RocketExceptions.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
|
{rocketchat_api-3.5.0 → rocketchat_api-3.6.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
|
{rocketchat_api-3.5.0 → rocketchat_api-3.6.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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|