stream-chat 4.15.0__py3-none-any.whl → 4.17.0__py3-none-any.whl

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.
stream_chat/__pkg__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  __author__ = "Tommaso Barbugli"
2
2
  __copyright__ = "Copyright 2019-2022, Stream.io, Inc"
3
- __version__ = "4.15.0"
3
+ __version__ = "4.17.0"
4
4
  __maintainer__ = "Tommaso Barbugli"
5
5
  __email__ = "support@getstream.io"
6
6
  __status__ = "Production"
@@ -333,9 +333,26 @@ class StreamChatAsync(StreamChatInterface, AsyncContextManager):
333
333
  async def delete_message(self, message_id: str, **options: Any) -> StreamResponse:
334
334
  return await self.delete(f"messages/{message_id}", options)
335
335
 
336
+ async def undelete_message(self, message_id: str, user_id: str) -> StreamResponse:
337
+ return await self.post(
338
+ f"messages/{message_id}/undelete", data={"undeleted_by": user_id}
339
+ )
340
+
336
341
  async def get_message(self, message_id: str, **options: Any) -> StreamResponse:
337
342
  return await self.get(f"messages/{message_id}", options)
338
343
 
344
+ async def query_message_history(
345
+ self, filter: Dict = None, sort: List[Dict] = None, **options: Any
346
+ ) -> StreamResponse:
347
+ params = options.copy()
348
+ params.update(
349
+ {
350
+ "filter": filter,
351
+ "sort": self.normalize_sort(sort),
352
+ }
353
+ )
354
+ return await self.post("messages/history", data=params)
355
+
339
356
  async def query_users(
340
357
  self, filter_conditions: Dict, sort: List[Dict] = None, **options: Any
341
358
  ) -> StreamResponse:
@@ -515,6 +515,15 @@ class StreamChatInterface(abc.ABC):
515
515
  """
516
516
  pass
517
517
 
518
+ @abc.abstractmethod
519
+ def undelete_message(
520
+ self, message_id: str, user_id: str
521
+ ) -> Union[StreamResponse, Awaitable[StreamResponse]]:
522
+ """
523
+ Undeletes a message.
524
+ """
525
+ pass
526
+
518
527
  @abc.abstractmethod
519
528
  def get_message(
520
529
  self, message_id: str, **options: Any
@@ -525,6 +534,15 @@ class StreamChatInterface(abc.ABC):
525
534
  """
526
535
  pass
527
536
 
537
+ @abc.abstractmethod
538
+ def query_message_history(
539
+ self, filter: Dict = None, sort: List[Dict] = None, **options: Any
540
+ ) -> Union[StreamResponse, Awaitable[StreamResponse]]:
541
+ """
542
+ Queries message history.
543
+ """
544
+ pass
545
+
528
546
  @abc.abstractmethod
529
547
  def query_users(
530
548
  self, filter_conditions: Dict, sort: List[Dict] = None, **options: Any
stream_chat/client.py CHANGED
@@ -322,9 +322,21 @@ class StreamChat(StreamChatInterface):
322
322
  def delete_message(self, message_id: str, **options: Any) -> StreamResponse:
323
323
  return self.delete(f"messages/{message_id}", options)
324
324
 
325
+ def undelete_message(self, message_id: str, user_id: str) -> StreamResponse:
326
+ return self.post(
327
+ f"messages/{message_id}/undelete", data={"undeleted_by": user_id}
328
+ )
329
+
325
330
  def get_message(self, message_id: str, **options: Any) -> StreamResponse:
326
331
  return self.get(f"messages/{message_id}", options)
327
332
 
333
+ def query_message_history(
334
+ self, filter: Dict = None, sort: List[Dict] = None, **options: Any
335
+ ) -> StreamResponse:
336
+ params = options.copy()
337
+ params.update({"filter": filter, "sort": self.normalize_sort(sort)})
338
+ return self.post("messages/history", data=params)
339
+
328
340
  def query_users(
329
341
  self, filter_conditions: Dict, sort: List[Dict] = None, **options: Any
330
342
  ) -> StreamResponse:
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: stream-chat
3
- Version: 4.15.0
3
+ Version: 4.17.0
4
4
  Summary: Client for Stream Chat.
5
5
  Home-page: https://github.com/GetStream/stream-chat-python
6
6
  Author: Tommaso Barbugli
7
7
  Author-email: support@getstream.io
8
8
  Project-URL: Bug Tracker, https://github.com/GetStream/stream-chat-python/issues
9
9
  Project-URL: Documentation, https://getstream.io/activity-feeds/docs/python/?language=python
10
- Project-URL: Release Notes, https://github.com/GetStream/stream-chat-python/releases/tag/v4.15.0
10
+ Project-URL: Release Notes, https://github.com/GetStream/stream-chat-python/releases/tag/v4.17.0
11
11
  Classifier: Intended Audience :: Developers
12
12
  Classifier: Intended Audience :: System Administrators
13
13
  Classifier: Operating System :: OS Independent
@@ -39,7 +39,7 @@ Requires-Dist: pytest-cov ; extra == 'ci'
39
39
  Requires-Dist: mypy ; extra == 'ci'
40
40
  Requires-Dist: types-requests ; extra == 'ci'
41
41
  Provides-Extra: test
42
- Requires-Dist: pytest ; extra == 'test'
42
+ Requires-Dist: pytest (==8.1.1) ; extra == 'test'
43
43
  Requires-Dist: pytest-asyncio (<=0.21.1) ; extra == 'test'
44
44
 
45
45
  # Official Python SDK for [Stream Chat](https://getstream.io/chat/)
@@ -1,19 +1,19 @@
1
1
  stream_chat/__init__.py,sha256=xYQuC8xcPLJxJnFWzaNaO-sVUc7IJZYe13OIPRaDBEA,116
2
- stream_chat/__pkg__.py,sha256=RN9DPZ9mDk4Rw1kCYuFfQju4HkH3q6au9BzhO-a7tME,206
2
+ stream_chat/__pkg__.py,sha256=EXUQPDLn3wtVYU7qhRCJsNWTHupNK3pPgiKLG8dz7kw,206
3
3
  stream_chat/campaign.py,sha256=Z7bBo2rGMs02JkA1k9_206J0spcSLecjdhQuRnrc2Eo,2156
4
4
  stream_chat/channel.py,sha256=SxlnRM8U1yo_k3wDBC4azz3_LDRPclDV5GBmGCfqB8U,7766
5
- stream_chat/client.py,sha256=iTpHpkoydv-YOE77DS8lztdS0S4ShOspR_cGBw0INPk,28508
5
+ stream_chat/client.py,sha256=sQH_Jkg06saa6BLtjXEwcu51GKdxtlqPDMGBL8jQAvY,29003
6
6
  stream_chat/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  stream_chat/segment.py,sha256=MD1de83rVsaqxcyPy8wTXDudFjxz5Mvr70z4pTkW3P0,2691
8
8
  stream_chat/async_chat/__init__.py,sha256=V6x7yDCdXbP3vMuSan6Xm7RE_njZUvflImqOxfKRt4Y,67
9
9
  stream_chat/async_chat/campaign.py,sha256=Bc3iHZigxserUycZK4wDuXU0wXVH2G6fIDiYNVYPkeE,1885
10
10
  stream_chat/async_chat/channel.py,sha256=yn9P7u1lJdwoCVw9gKotadq6s1rdYSM_wnxhdaZpnTI,8124
11
- stream_chat/async_chat/client.py,sha256=eiiH_tyYNNQB8OXXWiC2xPYuFTEcuYRifU0QD7Tv_qE,30672
11
+ stream_chat/async_chat/client.py,sha256=X7GagduhTgwac8jugISwZxdBAijq14rTzaKWiTS9Q8k,31260
12
12
  stream_chat/async_chat/segment.py,sha256=G_YEwW2SXIE7huTW3Zu_rim2XkYcuFNYekLZZGDjFkA,2777
13
13
  stream_chat/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  stream_chat/base/campaign.py,sha256=dAVkTYyirEpgyOPn8JyDebNMKeJu02vTuqgmPvdQoWU,1449
15
15
  stream_chat/base/channel.py,sha256=G6thUgND74z0gvI-N3b3vEsrDJ-D4MrAfW2um_E4x9w,13788
16
- stream_chat/base/client.py,sha256=v_i6UInERHeIEQh_AJYXhPTfR70bUmTXoyMKIe1Hyb8,40854
16
+ stream_chat/base/client.py,sha256=Yf-yq51xc_-Aa73Im8OJ4SZl1ONAfzbxktLSl6djgj8,41334
17
17
  stream_chat/base/exceptions.py,sha256=eh1qW5d6zjUrlgsHNEBebAr0jVH2UupZ06w8sp2cseI,819
18
18
  stream_chat/base/segment.py,sha256=X82DX8Y-cERJ1OvF2tz9iIM4CBNW6tx8HGaTEXBva9I,2364
19
19
  stream_chat/types/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -22,8 +22,8 @@ stream_chat/types/campaign.py,sha256=JyAn08oMaEsxPSqmVTdsfJK4xpfErPQV7Xr7zLQm99M
22
22
  stream_chat/types/rate_limit.py,sha256=v3Z4Ur0yoEdFLiHa1CNABEej2nxPlHQ6Bpy2XxW-TYQ,165
23
23
  stream_chat/types/segment.py,sha256=KzOi5N-VzLfj0m4zeZ9U_29ey9dxDtewtcNv9g4Aums,1273
24
24
  stream_chat/types/stream_response.py,sha256=jWKPrOU7u6dZ2SyOK53uQCXTstrL1HshO9fA7R6Bt_A,2391
25
- stream_chat-4.15.0.dist-info/LICENSE,sha256=H66SBDuPWSRHzKPEdyjAk3C0THQRcGPfqqve4naQuu0,14424
26
- stream_chat-4.15.0.dist-info/METADATA,sha256=TE4SdHTCbSJMlQDB4iXLA4ZGRcm_qyA1eI11MrehpCY,7395
27
- stream_chat-4.15.0.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
28
- stream_chat-4.15.0.dist-info/top_level.txt,sha256=26uTfg4bWcEaFrVKlzGGgfONH1p5DDe21G07EKfYSvo,12
29
- stream_chat-4.15.0.dist-info/RECORD,,
25
+ stream_chat-4.17.0.dist-info/LICENSE,sha256=H66SBDuPWSRHzKPEdyjAk3C0THQRcGPfqqve4naQuu0,14424
26
+ stream_chat-4.17.0.dist-info/METADATA,sha256=UY_3Hw8pEMiuBRH7d454rkjb3LQZQiw8MpOo3W4H3tU,7405
27
+ stream_chat-4.17.0.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
28
+ stream_chat-4.17.0.dist-info/top_level.txt,sha256=26uTfg4bWcEaFrVKlzGGgfONH1p5DDe21G07EKfYSvo,12
29
+ stream_chat-4.17.0.dist-info/RECORD,,