exist-client 0.2.0__tar.gz → 0.2.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.
Files changed (39) hide show
  1. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/PKG-INFO +1 -1
  2. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/pyproject.toml +1 -1
  3. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/client.py +24 -3
  4. exist_client-0.2.1.dev3/src/exist_client/models.py +3 -0
  5. exist_client-0.2.0/src/exist_client/models.py +0 -3
  6. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/README.md +0 -0
  7. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/__init__.py +0 -0
  8. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/__init__.py +0 -0
  9. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/api/__init__.py +0 -0
  10. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/api/default/__init__.py +0 -0
  11. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/api/default/access_token.py +0 -0
  12. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/api/default/accounts_profile.py +0 -0
  13. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/api/default/attribute_values_get.py +0 -0
  14. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/api/default/attributes_acquire.py +0 -0
  15. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/api/default/attributes_get.py +0 -0
  16. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/api/default/attributes_update.py +0 -0
  17. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/client.py +0 -0
  18. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/errors.py +0 -0
  19. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/__init__.py +0 -0
  20. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/access_token_data.py +0 -0
  21. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/attribute.py +0 -0
  22. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/attribute_by_name.py +0 -0
  23. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/attribute_by_template.py +0 -0
  24. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/attribute_group.py +0 -0
  25. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/attribute_value.py +0 -0
  26. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/attribute_values_get_result.py +0 -0
  27. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/attributes_acquire_result.py +0 -0
  28. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/attributes_acquire_result_failed_item.py +0 -0
  29. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/attributes_acquire_result_success_item.py +0 -0
  30. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/attributes_get_result.py +0 -0
  31. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/attributes_update_result.py +0 -0
  32. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/attributes_update_result_failed_item.py +0 -0
  33. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/date_value.py +0 -0
  34. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/error_mixin.py +0 -0
  35. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/paginated_response.py +0 -0
  36. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/tokens.py +0 -0
  37. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/models/user_profile.py +0 -0
  38. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/_exist_io_client/types.py +0 -0
  39. {exist_client-0.2.0 → exist_client-0.2.1.dev3}/src/exist_client/py.typed +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: exist-client
3
- Version: 0.2.0
3
+ Version: 0.2.1.dev3
4
4
  Summary:
5
5
  Author: Ilya Nekhay
6
6
  Author-email: nekhayiv@gmail.com
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "exist-client"
3
- version = "0.2.0"
3
+ version = "0.2.1.dev3"
4
4
  description = ""
5
5
  authors = ["Ilya Nekhay <nekhayiv@gmail.com>"]
6
6
  readme = "README.md"
@@ -1,8 +1,9 @@
1
1
  import itertools
2
2
  from typing import Any, Callable, Iterable, Optional, Protocol, TypeVar
3
3
 
4
- from ._exist_io_client import AuthenticatedClient
4
+ from ._exist_io_client import AuthenticatedClient, Client
5
5
  from ._exist_io_client.api.default import (
6
+ access_token,
6
7
  accounts_profile,
7
8
  attribute_values_get,
8
9
  attributes_acquire,
@@ -12,14 +13,14 @@ from ._exist_io_client.api.default import (
12
13
 
13
14
  # TODO: move to .models
14
15
  from ._exist_io_client.models import (
15
- AttributeByName,
16
+ AccessTokenData,
16
17
  AttributeByTemplate,
17
18
  AttributesAcquireResult,
18
19
  AttributesUpdateResult,
19
20
  DateValue,
20
21
  UserProfile,
21
22
  )
22
- from .models import Attribute, AttributeValue
23
+ from .models import Attribute, AttributeByName, AttributeValue, Tokens
23
24
 
24
25
  EXIST_IO_BASE_URL = "https://exist.io"
25
26
 
@@ -43,6 +44,25 @@ class ExistClient:
43
44
  follow_redirects=True,
44
45
  )
45
46
 
47
+ @staticmethod
48
+ def get_tokens(
49
+ *,
50
+ code: str,
51
+ client_id: str,
52
+ client_secret: str,
53
+ base_url: str = EXIST_IO_BASE_URL,
54
+ ) -> Optional[Tokens]:
55
+ client = Client(base_url)
56
+ return access_token.sync(
57
+ client=client,
58
+ form_data=AccessTokenData(
59
+ grant_type="authorization_code",
60
+ code=code,
61
+ client_id=client_id,
62
+ client_secret=client_secret,
63
+ ),
64
+ )
65
+
46
66
  def get_profile(self) -> Optional[UserProfile]:
47
67
  return accounts_profile.sync(client=self.client)
48
68
 
@@ -89,4 +109,5 @@ class ExistClient:
89
109
  def update_attributes(
90
110
  self, *, updates: list[AttributeValue]
91
111
  ) -> Optional[AttributesUpdateResult]:
112
+ # TODO: verify that the updates actually happened, and maybe return something other than AttributeValue
92
113
  return attributes_update.sync(client=self.client, json_body=updates)
@@ -0,0 +1,3 @@
1
+ from ._exist_io_client.models import Attribute, AttributeByName, AttributeValue, Tokens
2
+
3
+ __all__ = ["Attribute", "AttributeValue", "AttributeByName", "Tokens"]
@@ -1,3 +0,0 @@
1
- from ._exist_io_client.models import Attribute, AttributeByName, AttributeValue
2
-
3
- __all__ = ["Attribute", "AttributeValue", "AttributeByName"]