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.
Files changed (33) hide show
  1. {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/client.py +2 -11
  2. konecty_sdk_python-2.0.1/KonectySdkPython/lib/serialization.py +13 -0
  3. {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/services/aggregation.py +1 -1
  4. {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/services/export.py +1 -1
  5. {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/services/query.py +1 -1
  6. {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/services/stream.py +2 -1
  7. {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/types.py +2 -0
  8. {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/PKG-INFO +1 -1
  9. {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/pyproject.toml +1 -1
  10. {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/.gitignore +0 -0
  11. {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/__init__.py +0 -0
  12. {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/cli/__init__.py +0 -0
  13. {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/cli/apply.py +0 -0
  14. {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/cli/backup.py +0 -0
  15. {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/cli/pull.py +0 -0
  16. {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/__init__.py +0 -0
  17. {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/exceptions.py +0 -0
  18. {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/feature_types/__init__.py +0 -0
  19. {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/feature_types/cross_module_query.py +0 -0
  20. {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/feature_types/kpi.py +0 -0
  21. {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/file_manager.py +0 -0
  22. {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/filters.py +0 -0
  23. {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/http.py +0 -0
  24. {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/model.py +0 -0
  25. {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/services/__init__.py +0 -0
  26. {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/services/base.py +0 -0
  27. {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/services/change_user.py +0 -0
  28. {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/services/comments.py +0 -0
  29. {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/services/files.py +0 -0
  30. {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/services/notifications.py +0 -0
  31. {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/services/subscriptions.py +0 -0
  32. {konecty_sdk_python-2.0.0 → konecty_sdk_python-2.0.1}/KonectySdkPython/lib/settings.py +0 -0
  33. {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()
@@ -3,7 +3,7 @@
3
3
  import json
4
4
  from typing import Any, Dict, Optional, Union
5
5
 
6
- from ..client import json_serial
6
+ from ..serialization import json_serial
7
7
  from ..filters import KonectyFilter
8
8
  from ..feature_types.kpi import KpiConfig
9
9
  from .base import BaseService
@@ -3,7 +3,7 @@
3
3
  import json
4
4
  from typing import Any, Dict, List, Literal, Optional, Union
5
5
 
6
- from ..client import json_serial
6
+ from ..serialization import json_serial
7
7
  from ..filters import KonectyFilter
8
8
  from .base import BaseService
9
9
 
@@ -3,7 +3,7 @@
3
3
  import json
4
4
  from typing import Any, AsyncGenerator, Dict, List, Optional, Union
5
5
 
6
- from ..client import KonectyDict
6
+ from ..types import KonectyDict
7
7
  from ..exceptions import KonectyAPIError
8
8
  from ..http import StreamResponse
9
9
  from .base import BaseService
@@ -3,7 +3,8 @@
3
3
  import json
4
4
  from typing import Any, AsyncGenerator, Dict, Optional
5
5
 
6
- from ..client import KonectyDict, json_serial
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."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: konecty_sdk_python
3
- Version: 2.0.0
3
+ Version: 2.0.1
4
4
  Summary: Konecty SDK Python
5
5
  Author-email: Leonardo Leal <leonardo.leal@konecty.com>, Derotino Silveira <derotino.silveira@konecty.com>
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "konecty_sdk_python"
3
- version = "2.0.0"
3
+ version = "2.0.1"
4
4
  description = "Konecty SDK Python"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"