rocketchat-API 3.5.0__tar.gz → 3.6.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.5.0 → rocketchat_api-3.6.0}/PKG-INFO +1 -1
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/rooms.py +14 -3
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API.egg-info/PKG-INFO +1 -1
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/tests/test_rooms.py +41 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/.coveragerc +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/.deepsource.toml +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/.editorconfig +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/.github/actions/test_rocketchat/action.yml +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/.github/dependabot.yml +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/.github/workflows/lint.yml +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/.github/workflows/release.yml +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/.github/workflows/test.yml +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/.github/workflows/test_latest.yml +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/.github/workflows/test_manually.yml +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/.gitignore +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/CONTRIBUTING.md +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/LICENSE.txt +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/README.md +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/bandit.yml +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/docker-compose.yml +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/pyproject.toml +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/qodana.yaml +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API/APIExceptions/RocketExceptions.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API/APIExceptions/__init__.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/__init__.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/assets.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/banners.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/base.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/channels.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/chat.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/custom_emoji.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/custom_sounds.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/custom_user_status.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/dm.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/groups.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/integrations.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/invites.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/licenses.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/livechat.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/miscellaneous.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/moderation.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/permissions.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/roles.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/settings.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/statistics.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/subscriptions.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/teams.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/users.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/users_engagement.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API/__init__.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API/rocketchat.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API.egg-info/SOURCES.txt +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API.egg-info/dependency_links.txt +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API.egg-info/requires.txt +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/rocketchat_API.egg-info/top_level.txt +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/setup.cfg +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/tests/__init__.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/tests/assets/avatar.png +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/tests/assets/avatar.svg +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/tests/assets/logo.png +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/tests/conftest.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/tests/test_assets.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/tests/test_banners.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/tests/test_channels.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/tests/test_chat.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/tests/test_custom_emoji.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/tests/test_custom_sounds.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/tests/test_custom_user_status.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/tests/test_dms.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/tests/test_exceptions.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/tests/test_groups.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/tests/test_integrations.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/tests/test_invites.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/tests/test_licenses.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/tests/test_livechat.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/tests/test_moderation.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/tests/test_paginated.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/tests/test_permissions.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/tests/test_roles.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/tests/test_server.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/tests/test_settings.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/tests/test_subscriptions.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/tests/test_teams.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/tests/test_user.py +0 -0
- {rocketchat_api-3.5.0 → rocketchat_api-3.6.0}/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.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>
|
|
@@ -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
|
+
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rocketchat_API
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.6.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>
|
|
@@ -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.0}/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.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.5.0 → rocketchat_api-3.6.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
|