konecty-sdk-python 2.0.0__tar.gz → 2.0.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.
- {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/client.py +2 -11
- konecty_sdk_python-2.0.1/KonectySdkPython/lib/serialization.py +13 -0
- {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/services/aggregation.py +1 -1
- {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/services/export.py +1 -1
- {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/services/query.py +1 -1
- {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/services/stream.py +2 -1
- {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/types.py +2 -0
- {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/PKG-INFO +1 -1
- {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/pyproject.toml +1 -1
- {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/.gitignore +0 -0
- {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/__init__.py +0 -0
- {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/cli/__init__.py +0 -0
- {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/cli/apply.py +0 -0
- {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/cli/backup.py +0 -0
- {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/cli/pull.py +0 -0
- {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/__init__.py +0 -0
- {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/exceptions.py +0 -0
- {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/feature_types/__init__.py +0 -0
- {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/feature_types/cross_module_query.py +0 -0
- {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/feature_types/kpi.py +0 -0
- {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/file_manager.py +0 -0
- {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/filters.py +0 -0
- {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/http.py +0 -0
- {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/model.py +0 -0
- {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/services/__init__.py +0 -0
- {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/services/base.py +0 -0
- {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/services/change_user.py +0 -0
- {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/services/comments.py +0 -0
- {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/services/files.py +0 -0
- {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/services/notifications.py +0 -0
- {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/services/subscriptions.py +0 -0
- {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/settings.py +0 -0
- {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/README.md +0 -0
|
@@ -10,7 +10,6 @@ import aiohttp
|
|
|
10
10
|
from .exceptions import (
|
|
11
11
|
KonectyAPIError,
|
|
12
12
|
KonectyError,
|
|
13
|
-
KonectySerializationError,
|
|
14
13
|
KonectyValidationError,
|
|
15
14
|
)
|
|
16
15
|
from .file_manager import FileManager
|
|
@@ -18,6 +17,7 @@ from .filters import KonectyFilter, KonectyFindParams
|
|
|
18
17
|
from .http import request as _http_request
|
|
19
18
|
from .http import StreamResponse
|
|
20
19
|
from .feature_types.kpi import KpiConfig
|
|
20
|
+
from .serialization import json_serial
|
|
21
21
|
from .services.aggregation import AggregationService
|
|
22
22
|
from .services.change_user import ChangeUserService
|
|
23
23
|
from .services.comments import CommentsService
|
|
@@ -27,15 +27,13 @@ from .services.notifications import NotificationsService
|
|
|
27
27
|
from .services.query import QueryResult, QueryService
|
|
28
28
|
from .services.stream import FindStreamResult, StreamService
|
|
29
29
|
from .services.subscriptions import SubscriptionsService
|
|
30
|
-
from .types import KonectyDateTime, KonectyUpdateId
|
|
30
|
+
from .types import KonectyDateTime, KonectyDict, KonectyUpdateId
|
|
31
31
|
|
|
32
32
|
# Configura o logger do urllib3 para mostrar apenas erros
|
|
33
33
|
logging.getLogger("urllib3.connectionpool").setLevel(logging.ERROR)
|
|
34
34
|
|
|
35
35
|
logger = logging.getLogger(__name__)
|
|
36
36
|
|
|
37
|
-
KonectyDict = Dict[str, Any]
|
|
38
|
-
|
|
39
37
|
KONECTY_UPDATE_IGNORE_FIELDS = [
|
|
40
38
|
"_id",
|
|
41
39
|
"code",
|
|
@@ -57,13 +55,6 @@ def get_first_dict(items: List[Any]) -> Optional[KonectyDict]:
|
|
|
57
55
|
return None
|
|
58
56
|
|
|
59
57
|
|
|
60
|
-
def json_serial(obj: Any) -> str:
|
|
61
|
-
"""Serializa objetos para JSON."""
|
|
62
|
-
if isinstance(obj, datetime):
|
|
63
|
-
return {"$date": obj.isoformat()}
|
|
64
|
-
raise KonectySerializationError()
|
|
65
|
-
|
|
66
|
-
|
|
67
58
|
class KonectyClient:
|
|
68
59
|
def __init__(self, base_url: str, token: str) -> None:
|
|
69
60
|
self.base_url = base_url
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"""JSON serialization helpers for Konecty API (e.g. $date format)."""
|
|
2
|
+
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
from .exceptions import KonectySerializationError
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def json_serial(obj: Any) -> Any:
|
|
10
|
+
"""Serialize objects to JSON-friendly form (e.g. datetime -> $date)."""
|
|
11
|
+
if isinstance(obj, datetime):
|
|
12
|
+
return {"$date": obj.isoformat()}
|
|
13
|
+
raise KonectySerializationError()
|
{konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/services/stream.py
RENAMED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
import json
|
|
4
4
|
from typing import Any, AsyncGenerator, Dict, Optional
|
|
5
5
|
|
|
6
|
-
from ..
|
|
6
|
+
from ..serialization import json_serial
|
|
7
|
+
from ..types import KonectyDict
|
|
7
8
|
from ..filters import KonectyFilter, KonectyFindParams
|
|
8
9
|
from ..http import StreamResponse
|
|
9
10
|
from .base import BaseService
|
|
@@ -8,6 +8,8 @@ from pydantic import BaseModel, ConfigDict, Field
|
|
|
8
8
|
from pydantic.json_schema import JsonSchemaValue
|
|
9
9
|
from pydantic_core import CoreSchema, core_schema
|
|
10
10
|
|
|
11
|
+
KonectyDict = Dict[str, Any]
|
|
12
|
+
|
|
11
13
|
|
|
12
14
|
class KonectyDateTimeError(Exception):
|
|
13
15
|
"""Exceção base para erros de data/hora."""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/feature_types/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/feature_types/kpi.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/services/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/services/change_user.py
RENAMED
|
File without changes
|
{konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/services/comments.py
RENAMED
|
File without changes
|
{konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/services/files.py
RENAMED
|
File without changes
|
{konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/services/notifications.py
RENAMED
|
File without changes
|
{konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/services/subscriptions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|