b24api 0.3.1__tar.gz → 0.3.3__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.
- {b24api-0.3.1/b24api.egg-info → b24api-0.3.3}/PKG-INFO +1 -1
- {b24api-0.3.1 → b24api-0.3.3}/b24api/api.py +8 -2
- {b24api-0.3.1 → b24api-0.3.3}/b24api/entity.py +2 -2
- b24api-0.3.1/b24api/httpc.py → b24api-0.3.3/b24api/transport.py +0 -4
- {b24api-0.3.1 → b24api-0.3.3/b24api.egg-info}/PKG-INFO +1 -1
- {b24api-0.3.1 → b24api-0.3.3}/b24api.egg-info/SOURCES.txt +1 -1
- {b24api-0.3.1 → b24api-0.3.3}/pyproject.toml +1 -1
- {b24api-0.3.1 → b24api-0.3.3}/LICENSE +0 -0
- {b24api-0.3.1 → b24api-0.3.3}/MANIFEST.in +0 -0
- {b24api-0.3.1 → b24api-0.3.3}/README.md +0 -0
- {b24api-0.3.1 → b24api-0.3.3}/b24api/__init__.py +0 -0
- {b24api-0.3.1 → b24api-0.3.3}/b24api/error.py +0 -0
- {b24api-0.3.1 → b24api-0.3.3}/b24api/query.py +0 -0
- {b24api-0.3.1 → b24api-0.3.3}/b24api/settings.py +0 -0
- {b24api-0.3.1 → b24api-0.3.3}/b24api/type.py +0 -0
- {b24api-0.3.1 → b24api-0.3.3}/b24api.egg-info/dependency_links.txt +0 -0
- {b24api-0.3.1 → b24api-0.3.3}/b24api.egg-info/requires.txt +0 -0
- {b24api-0.3.1 → b24api-0.3.3}/b24api.egg-info/top_level.txt +0 -0
- {b24api-0.3.1 → b24api-0.3.3}/setup.cfg +0 -0
|
@@ -12,8 +12,8 @@ from retry import retry
|
|
|
12
12
|
|
|
13
13
|
from b24api.entity import ApiTypes, BatchResult, ErrorResponse, ListRequest, Request, Response
|
|
14
14
|
from b24api.error import RetryApiResponseError, RetryHTTPStatusError
|
|
15
|
-
from b24api.httpc import HttpxClient
|
|
16
15
|
from b24api.settings import ApiSettings
|
|
16
|
+
from b24api.transport import HttpxClient
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
class Bitrix24:
|
|
@@ -23,7 +23,13 @@ class Bitrix24:
|
|
|
23
23
|
self.settings = settings
|
|
24
24
|
self.logger = logging.getLogger("b24api")
|
|
25
25
|
self._call_retry = retry(
|
|
26
|
-
exceptions=(
|
|
26
|
+
exceptions=(
|
|
27
|
+
httpx.ConnectError,
|
|
28
|
+
httpx.ConnectTimeout,
|
|
29
|
+
httpx.RemoteProtocolError,
|
|
30
|
+
RetryHTTPStatusError,
|
|
31
|
+
RetryApiResponseError,
|
|
32
|
+
),
|
|
27
33
|
tries=self.settings.retry_tries,
|
|
28
34
|
delay=self.settings.retry_delay,
|
|
29
35
|
backoff=self.settings.retry_backoff,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
2
|
from typing import Annotated, Any, Self
|
|
3
3
|
|
|
4
|
-
from pydantic import BaseModel, BeforeValidator
|
|
4
|
+
from pydantic import BaseModel, BeforeValidator, constr
|
|
5
5
|
|
|
6
6
|
from b24api.error import ApiResponseError, RetryApiResponseError
|
|
7
7
|
from b24api.query import build_query
|
|
@@ -45,7 +45,7 @@ class ListRequest(Request):
|
|
|
45
45
|
class ErrorResponse(BaseModel):
|
|
46
46
|
"""API error response."""
|
|
47
47
|
|
|
48
|
-
error:
|
|
48
|
+
error: constr(to_lower=True)
|
|
49
49
|
error_description: str
|
|
50
50
|
|
|
51
51
|
def raise_error(self, retry_errors: list[str]) -> Self:
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import logging
|
|
2
1
|
from collections.abc import Generator
|
|
3
2
|
from typing import Annotated
|
|
4
3
|
|
|
@@ -7,9 +6,6 @@ from httpx import Client
|
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
def httpx_client() -> Generator[Client, None, None]:
|
|
10
|
-
httpx_logger = logging.getLogger("httpx")
|
|
11
|
-
httpx_logger.setLevel(logging.WARNING)
|
|
12
|
-
|
|
13
9
|
client = Client(http2=True, timeout=30)
|
|
14
10
|
|
|
15
11
|
yield client
|
|
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
|