vysion 2.2.0__tar.gz → 2.2.2__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.
- {vysion-2.2.0 → vysion-2.2.2}/PKG-INFO +2 -2
- {vysion-2.2.0 → vysion-2.2.2}/README.md +1 -1
- {vysion-2.2.0 → vysion-2.2.2}/pyproject.toml +1 -1
- {vysion-2.2.0 → vysion-2.2.2}/vysion/client/client.py +14 -5
- {vysion-2.2.0 → vysion-2.2.2}/vysion/dto/dto.py +30 -2
- {vysion-2.2.0 → vysion-2.2.2}/vysion/version.py +1 -1
- {vysion-2.2.0 → vysion-2.2.2}/LICENSE +0 -0
- {vysion-2.2.0 → vysion-2.2.2}/vysion/__init__.py +0 -0
- {vysion-2.2.0 → vysion-2.2.2}/vysion/client/__init__.py +0 -0
- {vysion-2.2.0 → vysion-2.2.2}/vysion/client/error.py +0 -0
- {vysion-2.2.0 → vysion-2.2.2}/vysion/dto/__init__.py +0 -0
- {vysion-2.2.0 → vysion-2.2.2}/vysion/dto/tag.py +0 -0
- {vysion-2.2.0 → vysion-2.2.2}/vysion/dto/util.py +0 -0
- {vysion-2.2.0 → vysion-2.2.2}/vysion/model/__init__.py +0 -0
- {vysion-2.2.0 → vysion-2.2.2}/vysion/model/enum/__init__.py +0 -0
- {vysion-2.2.0 → vysion-2.2.2}/vysion/model/enum/languages.py +0 -0
- {vysion-2.2.0 → vysion-2.2.2}/vysion/model/enum/networks.py +0 -0
- {vysion-2.2.0 → vysion-2.2.2}/vysion/model/enum/ransom_groups.py +0 -0
- {vysion-2.2.0 → vysion-2.2.2}/vysion/model/enum/services.py +0 -0
- {vysion-2.2.0 → vysion-2.2.2}/vysion/taxonomy/__init__.py +0 -0
- {vysion-2.2.0 → vysion-2.2.2}/vysion/taxonomy/flavours.py +0 -0
- {vysion-2.2.0 → vysion-2.2.2}/vysion/taxonomy/taxonomy.py +0 -0
|
@@ -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
|
|
|
@@ -4,7 +4,7 @@ Welcome to the PyPi webpage for Vysion, our implementation as a Python library t
|
|
|
4
4
|
|
|
5
5
|
You can request a demo for the web app or an API-key to use in this library at [vysion.ai](https://vysion.ai).
|
|
6
6
|
|
|
7
|
-
Latest version: [2.2.
|
|
7
|
+
Latest version: [2.2.2](https://pypi.org/project/vysion/)
|
|
8
8
|
|
|
9
9
|
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.
|
|
10
10
|
|
|
@@ -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,
|
|
@@ -510,14 +511,22 @@ class Client(BaseClient):
|
|
|
510
511
|
|
|
511
512
|
|
|
512
513
|
@vysion_error_manager
|
|
513
|
-
def
|
|
514
|
-
self,
|
|
515
|
-
|
|
514
|
+
def get_im_chat_messages(
|
|
515
|
+
self,
|
|
516
|
+
platform: str,
|
|
517
|
+
channelId: str,
|
|
518
|
+
messageId: str | None,
|
|
519
|
+
cursor: str | None,
|
|
520
|
+
limit: str = 30
|
|
521
|
+
) -> VysionPaginationResponse:
|
|
516
522
|
url = self._build_api_url__(
|
|
517
|
-
"im/" + platform + "/chat/" + channelId,
|
|
523
|
+
"im/" + platform + "/chat/" + channelId,
|
|
524
|
+
messageId=messageId,
|
|
525
|
+
cursor=cursor,
|
|
526
|
+
limit=limit
|
|
518
527
|
)
|
|
519
528
|
|
|
520
|
-
result =
|
|
529
|
+
result = VysionPaginationResponse.model_validate(self._make_request(url))
|
|
521
530
|
return result.data
|
|
522
531
|
|
|
523
532
|
@vysion_error_manager
|
|
@@ -411,7 +411,6 @@ class ImProfileHit(BaseModel):
|
|
|
411
411
|
raise ValueError("DetectionDate field cannot be empty")
|
|
412
412
|
return v
|
|
413
413
|
|
|
414
|
-
|
|
415
414
|
class ImChannelHit(BaseModel):
|
|
416
415
|
channelId: Union[int, str]
|
|
417
416
|
channelTitles: Optional[List[str]] = Field(default_factory=lambda: None)
|
|
@@ -550,7 +549,6 @@ class CryptoFeedHit(BaseModel):
|
|
|
550
549
|
id: str
|
|
551
550
|
url: str
|
|
552
551
|
detectionDate: datetime
|
|
553
|
-
url: str
|
|
554
552
|
network: str
|
|
555
553
|
title: Optional[str] = Field(default_factory=lambda: None)
|
|
556
554
|
tag: List[Tag] = Field(default_factory=lambda: [])
|
|
@@ -729,6 +727,31 @@ class Result(BaseModel, Generic[T]):
|
|
|
729
727
|
|
|
730
728
|
return data
|
|
731
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
|
|
732
755
|
|
|
733
756
|
class ErrorCode(int, Enum):
|
|
734
757
|
BAD_REQUEST = 400
|
|
@@ -760,3 +783,8 @@ class Error(BaseModel):
|
|
|
760
783
|
class VysionResponse(BaseModel, Generic[T]):
|
|
761
784
|
data: Optional[Result[T]] = None
|
|
762
785
|
error: Optional[Error] = None
|
|
786
|
+
|
|
787
|
+
|
|
788
|
+
class VysionPaginationResponse(BaseModel, Generic[T]):
|
|
789
|
+
data: Optional[ResultPagination[T]] = None
|
|
790
|
+
error: Optional[Error] = None
|
|
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
|