exist-client 0.2.1.dev3__tar.gz → 0.3.1.dev3__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.
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/PKG-INFO +4 -2
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/pyproject.toml +1 -1
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/models/access_token_data.py +28 -9
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/client.py +30 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/README.md +0 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/__init__.py +0 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/__init__.py +0 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/api/__init__.py +0 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/api/default/__init__.py +0 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/api/default/access_token.py +0 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/api/default/accounts_profile.py +0 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/api/default/attribute_values_get.py +0 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/api/default/attributes_acquire.py +0 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/api/default/attributes_get.py +0 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/api/default/attributes_update.py +0 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/client.py +0 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/errors.py +0 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/models/__init__.py +0 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/models/attribute.py +0 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/models/attribute_by_name.py +0 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/models/attribute_by_template.py +0 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/models/attribute_group.py +0 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/models/attribute_value.py +0 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/models/attribute_values_get_result.py +0 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/models/attributes_acquire_result.py +0 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/models/attributes_acquire_result_failed_item.py +0 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/models/attributes_acquire_result_success_item.py +0 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/models/attributes_get_result.py +0 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/models/attributes_update_result.py +0 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/models/attributes_update_result_failed_item.py +0 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/models/date_value.py +0 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/models/error_mixin.py +0 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/models/paginated_response.py +0 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/models/tokens.py +0 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/models/user_profile.py +0 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/types.py +0 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/models.py +0 -0
- {exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: exist-client
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.1.dev3
|
|
4
4
|
Summary:
|
|
5
5
|
Author: Ilya Nekhay
|
|
6
6
|
Author-email: nekhayiv@gmail.com
|
|
@@ -9,6 +9,8 @@ Classifier: Programming Language :: Python :: 3
|
|
|
9
9
|
Classifier: Programming Language :: Python :: 3.10
|
|
10
10
|
Classifier: Programming Language :: Python :: 3.11
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
12
14
|
Requires-Dist: attrs (>=23.1.0,<24.0.0)
|
|
13
15
|
Requires-Dist: loguru
|
|
14
16
|
Requires-Dist: pytilz (>=0.1.0,<0.2.0)
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
from typing import Any, Dict, List, Type, TypeVar
|
|
1
|
+
from typing import Any, Dict, List, Type, TypeVar, Union
|
|
2
2
|
|
|
3
3
|
from attrs import define as _attrs_define
|
|
4
4
|
from attrs import field as _attrs_field
|
|
5
5
|
|
|
6
|
+
from ..types import UNSET, Unset
|
|
7
|
+
|
|
6
8
|
T = TypeVar("T", bound="AccessTokenData")
|
|
7
9
|
|
|
8
10
|
|
|
@@ -10,34 +12,45 @@ T = TypeVar("T", bound="AccessTokenData")
|
|
|
10
12
|
class AccessTokenData:
|
|
11
13
|
"""
|
|
12
14
|
Attributes:
|
|
13
|
-
grant_type (str):
|
|
14
|
-
code (str):
|
|
15
|
+
grant_type (str): Either 'authorization_code' or 'refresh_token'
|
|
15
16
|
client_id (str):
|
|
16
17
|
client_secret (str):
|
|
18
|
+
code (Union[Unset, str]): Required when grant_type is 'authorization_code'
|
|
19
|
+
redirect_uri (Union[Unset, str]): Required when grant_type is 'authorization_code'
|
|
20
|
+
refresh_token (Union[Unset, str]): Required when grant_type is 'refresh_token'
|
|
17
21
|
"""
|
|
18
22
|
|
|
19
23
|
grant_type: str
|
|
20
|
-
code: str
|
|
21
24
|
client_id: str
|
|
22
25
|
client_secret: str
|
|
26
|
+
code: Union[Unset, str] = UNSET
|
|
27
|
+
redirect_uri: Union[Unset, str] = UNSET
|
|
28
|
+
refresh_token: Union[Unset, str] = UNSET
|
|
23
29
|
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
24
30
|
|
|
25
31
|
def to_dict(self) -> Dict[str, Any]:
|
|
26
32
|
grant_type = self.grant_type
|
|
27
|
-
code = self.code
|
|
28
33
|
client_id = self.client_id
|
|
29
34
|
client_secret = self.client_secret
|
|
35
|
+
code = self.code
|
|
36
|
+
redirect_uri = self.redirect_uri
|
|
37
|
+
refresh_token = self.refresh_token
|
|
30
38
|
|
|
31
39
|
field_dict: Dict[str, Any] = {}
|
|
32
40
|
field_dict.update(self.additional_properties)
|
|
33
41
|
field_dict.update(
|
|
34
42
|
{
|
|
35
43
|
"grant_type": grant_type,
|
|
36
|
-
"code": code,
|
|
37
44
|
"client_id": client_id,
|
|
38
45
|
"client_secret": client_secret,
|
|
39
46
|
}
|
|
40
47
|
)
|
|
48
|
+
if code is not UNSET:
|
|
49
|
+
field_dict["code"] = code
|
|
50
|
+
if redirect_uri is not UNSET:
|
|
51
|
+
field_dict["redirect_uri"] = redirect_uri
|
|
52
|
+
if refresh_token is not UNSET:
|
|
53
|
+
field_dict["refresh_token"] = refresh_token
|
|
41
54
|
|
|
42
55
|
return field_dict
|
|
43
56
|
|
|
@@ -46,17 +59,23 @@ class AccessTokenData:
|
|
|
46
59
|
d = src_dict.copy()
|
|
47
60
|
grant_type = d.pop("grant_type")
|
|
48
61
|
|
|
49
|
-
code = d.pop("code")
|
|
50
|
-
|
|
51
62
|
client_id = d.pop("client_id")
|
|
52
63
|
|
|
53
64
|
client_secret = d.pop("client_secret")
|
|
54
65
|
|
|
66
|
+
code = d.pop("code", UNSET)
|
|
67
|
+
|
|
68
|
+
redirect_uri = d.pop("redirect_uri", UNSET)
|
|
69
|
+
|
|
70
|
+
refresh_token = d.pop("refresh_token", UNSET)
|
|
71
|
+
|
|
55
72
|
access_token_data = cls(
|
|
56
73
|
grant_type=grant_type,
|
|
57
|
-
code=code,
|
|
58
74
|
client_id=client_id,
|
|
59
75
|
client_secret=client_secret,
|
|
76
|
+
code=code,
|
|
77
|
+
redirect_uri=redirect_uri,
|
|
78
|
+
refresh_token=refresh_token,
|
|
60
79
|
)
|
|
61
80
|
|
|
62
81
|
access_token_data.additional_properties = d
|
|
@@ -63,6 +63,36 @@ class ExistClient:
|
|
|
63
63
|
),
|
|
64
64
|
)
|
|
65
65
|
|
|
66
|
+
@staticmethod
|
|
67
|
+
def refresh_tokens(
|
|
68
|
+
*,
|
|
69
|
+
refresh_token: str,
|
|
70
|
+
client_id: str,
|
|
71
|
+
client_secret: str,
|
|
72
|
+
base_url: str = EXIST_IO_BASE_URL,
|
|
73
|
+
) -> Optional[Tokens]:
|
|
74
|
+
"""Refresh an expired access token using a refresh token.
|
|
75
|
+
|
|
76
|
+
Args:
|
|
77
|
+
refresh_token: The refresh token from a previous OAuth token response
|
|
78
|
+
client_id: OAuth client ID
|
|
79
|
+
client_secret: OAuth client secret
|
|
80
|
+
base_url: Base URL for the Exist.io API
|
|
81
|
+
|
|
82
|
+
Returns:
|
|
83
|
+
New Tokens object with fresh access_token and refresh_token
|
|
84
|
+
"""
|
|
85
|
+
client = Client(base_url)
|
|
86
|
+
return access_token.sync(
|
|
87
|
+
client=client,
|
|
88
|
+
form_data=AccessTokenData(
|
|
89
|
+
grant_type="refresh_token",
|
|
90
|
+
refresh_token=refresh_token,
|
|
91
|
+
client_id=client_id,
|
|
92
|
+
client_secret=client_secret,
|
|
93
|
+
),
|
|
94
|
+
)
|
|
95
|
+
|
|
66
96
|
def get_profile(self) -> Optional[UserProfile]:
|
|
67
97
|
return accounts_profile.sync(client=self.client)
|
|
68
98
|
|
|
File without changes
|
|
File without changes
|
{exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/__init__.py
RENAMED
|
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
|
{exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/client.py
RENAMED
|
File without changes
|
{exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/errors.py
RENAMED
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{exist_client-0.2.1.dev3 → exist_client-0.3.1.dev3}/src/exist_client/_exist_io_client/types.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|