lynkora-sdk-python 0.1.0__tar.gz → 0.2.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.
- {lynkora_sdk_python-0.1.0 → lynkora_sdk_python-0.2.1}/PKG-INFO +2 -2
- {lynkora_sdk_python-0.1.0 → lynkora_sdk_python-0.2.1}/README.md +1 -1
- {lynkora_sdk_python-0.1.0 → lynkora_sdk_python-0.2.1}/lynkora_sdk/client.py +3 -1
- {lynkora_sdk_python-0.1.0 → lynkora_sdk_python-0.2.1}/lynkora_sdk_python.egg-info/PKG-INFO +2 -2
- {lynkora_sdk_python-0.1.0 → lynkora_sdk_python-0.2.1}/pyproject.toml +1 -1
- {lynkora_sdk_python-0.1.0 → lynkora_sdk_python-0.2.1}/tests/test_client.py +10 -0
- {lynkora_sdk_python-0.1.0 → lynkora_sdk_python-0.2.1}/LICENSE +0 -0
- {lynkora_sdk_python-0.1.0 → lynkora_sdk_python-0.2.1}/lynkora_sdk/__init__.py +0 -0
- {lynkora_sdk_python-0.1.0 → lynkora_sdk_python-0.2.1}/lynkora_sdk/errors.py +0 -0
- {lynkora_sdk_python-0.1.0 → lynkora_sdk_python-0.2.1}/lynkora_sdk_python.egg-info/SOURCES.txt +0 -0
- {lynkora_sdk_python-0.1.0 → lynkora_sdk_python-0.2.1}/lynkora_sdk_python.egg-info/dependency_links.txt +0 -0
- {lynkora_sdk_python-0.1.0 → lynkora_sdk_python-0.2.1}/lynkora_sdk_python.egg-info/requires.txt +0 -0
- {lynkora_sdk_python-0.1.0 → lynkora_sdk_python-0.2.1}/lynkora_sdk_python.egg-info/top_level.txt +0 -0
- {lynkora_sdk_python-0.1.0 → lynkora_sdk_python-0.2.1}/setup.cfg +0 -0
- {lynkora_sdk_python-0.1.0 → lynkora_sdk_python-0.2.1}/tests/test_errors.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lynkora-sdk-python
|
|
3
|
-
Version: 0.1
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: SDK Python para integração com a API de Actions/Subscribers do Lynkora Admin Service.
|
|
5
5
|
License-Expression: MIT
|
|
6
6
|
Project-URL: Homepage, https://docs.lynkora.dev/docs/para-desenvolvedores/sdks
|
|
@@ -38,7 +38,7 @@ from lynkora_sdk import LynkoraClient
|
|
|
38
38
|
|
|
39
39
|
lynkora = LynkoraClient(
|
|
40
40
|
api_key=os.environ["LYNKORA_API_KEY"],
|
|
41
|
-
base_url
|
|
41
|
+
# base_url é opcional — default "https://api.lynkora.dev"
|
|
42
42
|
)
|
|
43
43
|
|
|
44
44
|
result = lynkora.consume_action(
|
|
@@ -4,9 +4,11 @@ from urllib.request import Request, urlopen
|
|
|
4
4
|
|
|
5
5
|
from .errors import LynkoraApiError
|
|
6
6
|
|
|
7
|
+
DEFAULT_BASE_URL = "https://api.lynkora.dev"
|
|
8
|
+
|
|
7
9
|
|
|
8
10
|
class LynkoraClient:
|
|
9
|
-
def __init__(self, api_key: str, base_url: str) -> None:
|
|
11
|
+
def __init__(self, api_key: str, base_url: str = DEFAULT_BASE_URL) -> None:
|
|
10
12
|
self._api_key = api_key
|
|
11
13
|
self._base_url = base_url
|
|
12
14
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lynkora-sdk-python
|
|
3
|
-
Version: 0.1
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: SDK Python para integração com a API de Actions/Subscribers do Lynkora Admin Service.
|
|
5
5
|
License-Expression: MIT
|
|
6
6
|
Project-URL: Homepage, https://docs.lynkora.dev/docs/para-desenvolvedores/sdks
|
|
@@ -38,7 +38,7 @@ from lynkora_sdk import LynkoraClient
|
|
|
38
38
|
|
|
39
39
|
lynkora = LynkoraClient(
|
|
40
40
|
api_key=os.environ["LYNKORA_API_KEY"],
|
|
41
|
-
base_url
|
|
41
|
+
# base_url é opcional — default "https://api.lynkora.dev"
|
|
42
42
|
)
|
|
43
43
|
|
|
44
44
|
result = lynkora.consume_action(
|
|
@@ -98,3 +98,13 @@ def test_network_error_propagates_unwrapped(client: LynkoraClient) -> None:
|
|
|
98
98
|
with patch("lynkora_sdk.client.urlopen", side_effect=URLError("no route")):
|
|
99
99
|
with pytest.raises(URLError):
|
|
100
100
|
client.consume_action(subscriber_id="sub-1", action_slug="sign_document")
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def test_defaults_to_production_api_when_base_url_is_omitted() -> None:
|
|
104
|
+
default_client = LynkoraClient(api_key=API_KEY)
|
|
105
|
+
fake = FakeResponse(201, b'{"reservationId": "res-1", "quantity": 1}')
|
|
106
|
+
with patch("lynkora_sdk.client.urlopen", return_value=fake) as urlopen_mock:
|
|
107
|
+
default_client.consume_action(subscriber_id="sub-1", action_slug="sign_document")
|
|
108
|
+
|
|
109
|
+
req = urlopen_mock.call_args[0][0]
|
|
110
|
+
assert req.full_url == "https://api.lynkora.dev/v1/actions/consume"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lynkora_sdk_python-0.1.0 → lynkora_sdk_python-0.2.1}/lynkora_sdk_python.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{lynkora_sdk_python-0.1.0 → lynkora_sdk_python-0.2.1}/lynkora_sdk_python.egg-info/requires.txt
RENAMED
|
File without changes
|
{lynkora_sdk_python-0.1.0 → lynkora_sdk_python-0.2.1}/lynkora_sdk_python.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|