vysion 2.2.1__py3-none-any.whl → 2.2.2__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.
- vysion/client/client.py +3 -3
- vysion/dto/dto.py +30 -7
- vysion/version.py +1 -1
- {vysion-2.2.1.dist-info → vysion-2.2.2.dist-info}/METADATA +2 -2
- {vysion-2.2.1.dist-info → vysion-2.2.2.dist-info}/RECORD +7 -7
- {vysion-2.2.1.dist-info → vysion-2.2.2.dist-info}/LICENSE +0 -0
- {vysion-2.2.1.dist-info → vysion-2.2.2.dist-info}/WHEEL +0 -0
vysion/client/client.py
CHANGED
|
@@ -30,6 +30,7 @@ from vysion.dto import (
|
|
|
30
30
|
ErrorCode,
|
|
31
31
|
DocumentHit,
|
|
32
32
|
VysionResponse,
|
|
33
|
+
VysionPaginationResponse,
|
|
33
34
|
RansomwareHit,
|
|
34
35
|
Stat,
|
|
35
36
|
Network,
|
|
@@ -39,7 +40,6 @@ from vysion.dto import (
|
|
|
39
40
|
ImProfileHit,
|
|
40
41
|
ImServerHit,
|
|
41
42
|
LeakHit,
|
|
42
|
-
ImChatMessages,
|
|
43
43
|
)
|
|
44
44
|
from vysion.version import __version__ as vysion_version
|
|
45
45
|
|
|
@@ -518,7 +518,7 @@ class Client(BaseClient):
|
|
|
518
518
|
messageId: str | None,
|
|
519
519
|
cursor: str | None,
|
|
520
520
|
limit: str = 30
|
|
521
|
-
) ->
|
|
521
|
+
) -> VysionPaginationResponse:
|
|
522
522
|
url = self._build_api_url__(
|
|
523
523
|
"im/" + platform + "/chat/" + channelId,
|
|
524
524
|
messageId=messageId,
|
|
@@ -526,7 +526,7 @@ class Client(BaseClient):
|
|
|
526
526
|
limit=limit
|
|
527
527
|
)
|
|
528
528
|
|
|
529
|
-
result =
|
|
529
|
+
result = VysionPaginationResponse.model_validate(self._make_request(url))
|
|
530
530
|
return result.data
|
|
531
531
|
|
|
532
532
|
@vysion_error_manager
|
vysion/dto/dto.py
CHANGED
|
@@ -411,13 +411,6 @@ class ImProfileHit(BaseModel):
|
|
|
411
411
|
raise ValueError("DetectionDate field cannot be empty")
|
|
412
412
|
return v
|
|
413
413
|
|
|
414
|
-
|
|
415
|
-
class ImChatMessages(BaseModel):
|
|
416
|
-
messages: List[ImMessageHit]
|
|
417
|
-
prev_cursor: Optional[str] = None
|
|
418
|
-
next_cursor: Optional[str] = None
|
|
419
|
-
|
|
420
|
-
|
|
421
414
|
class ImChannelHit(BaseModel):
|
|
422
415
|
channelId: Union[int, str]
|
|
423
416
|
channelTitles: Optional[List[str]] = Field(default_factory=lambda: None)
|
|
@@ -734,6 +727,31 @@ class Result(BaseModel, Generic[T]):
|
|
|
734
727
|
|
|
735
728
|
return data
|
|
736
729
|
|
|
730
|
+
class ResultPagination(BaseModel, Generic[T]):
|
|
731
|
+
total: int = 0
|
|
732
|
+
hits: List[T] = Field(default_factory=lambda: [])
|
|
733
|
+
prev_cursor: Optional[str] = None
|
|
734
|
+
next_cursor: Optional[str] = None
|
|
735
|
+
|
|
736
|
+
def __init__(self, **kwargs):
|
|
737
|
+
super().__init__(**kwargs)
|
|
738
|
+
if self.total <= 0:
|
|
739
|
+
self.total = len(self.hits)
|
|
740
|
+
|
|
741
|
+
def get_type(self) -> type:
|
|
742
|
+
if len(self.hits) <= 0:
|
|
743
|
+
return NoneType
|
|
744
|
+
|
|
745
|
+
return type(self.hits[0])
|
|
746
|
+
|
|
747
|
+
@model_validator(mode="before")
|
|
748
|
+
@classmethod
|
|
749
|
+
def check_hits(cls, data):
|
|
750
|
+
hits = data.get("hits")
|
|
751
|
+
if not isinstance(hits, list):
|
|
752
|
+
raise ValueError("hits must be a list")
|
|
753
|
+
|
|
754
|
+
return data
|
|
737
755
|
|
|
738
756
|
class ErrorCode(int, Enum):
|
|
739
757
|
BAD_REQUEST = 400
|
|
@@ -765,3 +783,8 @@ class Error(BaseModel):
|
|
|
765
783
|
class VysionResponse(BaseModel, Generic[T]):
|
|
766
784
|
data: Optional[Result[T]] = None
|
|
767
785
|
error: Optional[Error] = None
|
|
786
|
+
|
|
787
|
+
|
|
788
|
+
class VysionPaginationResponse(BaseModel, Generic[T]):
|
|
789
|
+
data: Optional[ResultPagination[T]] = None
|
|
790
|
+
error: Optional[Error] = None
|
vysion/version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: vysion
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.2
|
|
4
4
|
Summary: The official Python client library for Vysion
|
|
5
5
|
Home-page: https://vysion.ai
|
|
6
6
|
License: Apache-2.0
|
|
@@ -29,7 +29,7 @@ Welcome to the PyPi webpage for Vysion, our implementation as a Python library t
|
|
|
29
29
|
|
|
30
30
|
You can request a demo for the web app or an API-key to use in this library at [vysion.ai](https://vysion.ai).
|
|
31
31
|
|
|
32
|
-
Latest version: [2.2.
|
|
32
|
+
Latest version: [2.2.2](https://pypi.org/project/vysion/)
|
|
33
33
|
|
|
34
34
|
You can visit [the documentation](https://developers.vysion.ai/?python) for more information on the searches and requests performed with the library or directly on the API.
|
|
35
35
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
vysion/__init__.py,sha256=yxJiM-S29q8GB3PBff9tV70P2nvydd8aKLEprLkXw5o,664
|
|
2
2
|
vysion/client/__init__.py,sha256=aVHmBuetPdybp7TgcNzUx4HkxTjEuXYzSdDYiYfFQd0,630
|
|
3
|
-
vysion/client/client.py,sha256=
|
|
3
|
+
vysion/client/client.py,sha256=c2MCYNE_-Cyb9Z9skyM-KDHv-d2fVtvki8NGdXfVd70,24116
|
|
4
4
|
vysion/client/error.py,sha256=JK0dsZkyMjmxPtEgO5IStG_N_q8y_-VGbppwWrUtSgM,1166
|
|
5
5
|
vysion/dto/__init__.py,sha256=ct8JxVMfJ0APiOTgr9ju-JIuBlXOrPkx7n2qISSXUts,605
|
|
6
|
-
vysion/dto/dto.py,sha256=
|
|
6
|
+
vysion/dto/dto.py,sha256=mCGkxk2_aSV9brb6TCETu9TZ9nxFJdyGS2yCv7cKIJI,27467
|
|
7
7
|
vysion/dto/tag.py,sha256=whGPsdasgYm8oijrL7MRSMmapzaoCmKNeaJ5ih0aBIk,1503
|
|
8
8
|
vysion/dto/util.py,sha256=AxdMWPdf7xrFtWva5epKxgjI0Bah1GiIw-sEWvIUYb4,4491
|
|
9
9
|
vysion/model/__init__.py,sha256=rJX9eNW9-jQGTgwm97W04jhZa-dV_dSTTTFcbWg73w0,606
|
|
@@ -15,8 +15,8 @@ vysion/model/enum/services.py,sha256=fUfZEO0RNNctU4Gzae5TV3c7BU5A_cEwaEb1tzqgcr0
|
|
|
15
15
|
vysion/taxonomy/__init__.py,sha256=Bc364AYxRCyjIn26-XBPeEDCPe3Hma4r5RAI8R8eblU,635
|
|
16
16
|
vysion/taxonomy/flavours.py,sha256=ubImHBE8v0zhzFy_2YozAQk2SzN1XDQwHAxb2RebtCo,2347
|
|
17
17
|
vysion/taxonomy/taxonomy.py,sha256=mG6vHX5Eyp38AKyJBgfBDqdpEmDMbkv8TA8YUBzko54,12227
|
|
18
|
-
vysion/version.py,sha256=
|
|
19
|
-
vysion-2.2.
|
|
20
|
-
vysion-2.2.
|
|
21
|
-
vysion-2.2.
|
|
22
|
-
vysion-2.2.
|
|
18
|
+
vysion/version.py,sha256=GFkDndghv1jT8gLTuKSLD9wMWvCEgxC1PMCQaOXzq4c,610
|
|
19
|
+
vysion-2.2.2.dist-info/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
|
20
|
+
vysion-2.2.2.dist-info/METADATA,sha256=tFEiYQx8cav3c_1J0DLYhquPCvwqOqX5Qt3frqqdPqU,1958
|
|
21
|
+
vysion-2.2.2.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
22
|
+
vysion-2.2.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|