polyapi-python 0.3.7.dev1__tar.gz → 0.3.7.dev2__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 (47) hide show
  1. {polyapi_python-0.3.7.dev1/polyapi_python.egg-info → polyapi_python-0.3.7.dev2}/PKG-INFO +1 -1
  2. polyapi_python-0.3.7.dev2/polyapi/__init__.py +92 -0
  3. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2/polyapi_python.egg-info}/PKG-INFO +1 -1
  4. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/pyproject.toml +1 -1
  5. polyapi_python-0.3.7.dev1/polyapi/__init__.py +0 -23
  6. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/LICENSE +0 -0
  7. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/README.md +0 -0
  8. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/polyapi/__main__.py +0 -0
  9. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/polyapi/api.py +0 -0
  10. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/polyapi/auth.py +0 -0
  11. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/polyapi/cli.py +0 -0
  12. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/polyapi/client.py +0 -0
  13. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/polyapi/config.py +0 -0
  14. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/polyapi/constants.py +0 -0
  15. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/polyapi/deployables.py +0 -0
  16. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/polyapi/error_handler.py +0 -0
  17. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/polyapi/exceptions.py +0 -0
  18. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/polyapi/execute.py +0 -0
  19. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/polyapi/function_cli.py +0 -0
  20. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/polyapi/generate.py +0 -0
  21. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/polyapi/parser.py +0 -0
  22. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/polyapi/poly_schemas.py +0 -0
  23. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/polyapi/prepare.py +0 -0
  24. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/polyapi/py.typed +0 -0
  25. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/polyapi/rendered_spec.py +0 -0
  26. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/polyapi/schema.py +0 -0
  27. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/polyapi/server.py +0 -0
  28. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/polyapi/sync.py +0 -0
  29. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/polyapi/typedefs.py +0 -0
  30. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/polyapi/utils.py +0 -0
  31. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/polyapi/variables.py +0 -0
  32. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/polyapi/webhook.py +0 -0
  33. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/polyapi_python.egg-info/SOURCES.txt +0 -0
  34. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/polyapi_python.egg-info/dependency_links.txt +0 -0
  35. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/polyapi_python.egg-info/requires.txt +0 -0
  36. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/polyapi_python.egg-info/top_level.txt +0 -0
  37. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/setup.cfg +0 -0
  38. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/tests/test_api.py +0 -0
  39. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/tests/test_auth.py +0 -0
  40. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/tests/test_deployables.py +0 -0
  41. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/tests/test_generate.py +0 -0
  42. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/tests/test_parser.py +0 -0
  43. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/tests/test_rendered_spec.py +0 -0
  44. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/tests/test_schema.py +0 -0
  45. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/tests/test_server.py +0 -0
  46. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/tests/test_utils.py +0 -0
  47. {polyapi_python-0.3.7.dev1 → polyapi_python-0.3.7.dev2}/tests/test_variables.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: polyapi-python
3
- Version: 0.3.7.dev1
3
+ Version: 0.3.7.dev2
4
4
  Summary: The Python Client for PolyAPI, the IPaaS by Developers for Developers
5
5
  Author-email: Dan Fellin <dan@polyapi.io>
6
6
  License: MIT License
@@ -0,0 +1,92 @@
1
+ import os
2
+ import sys
3
+ import truststore
4
+ from typing import Any, Optional, overload, Literal
5
+ from typing_extensions import TypedDict
6
+ truststore.inject_into_ssl()
7
+ from .cli import CLI_COMMANDS
8
+
9
+ __all__ = ["poly"]
10
+
11
+
12
+ if len(sys.argv) > 1 and sys.argv[1] not in CLI_COMMANDS:
13
+ currdir = os.path.dirname(os.path.abspath(__file__))
14
+ if not os.path.isdir(os.path.join(currdir, "poly")):
15
+ print("No 'poly' found. Please run 'python3 -m polyapi generate' to generate the 'poly' library for your tenant.")
16
+ sys.exit(1)
17
+
18
+
19
+ class PolyCustomDict(TypedDict, total=False):
20
+ """Type definition for polyCustom dictionary."""
21
+ executionId: Optional[str] # Read-only
22
+ executionApiKey: Optional[str]
23
+ responseStatusCode: int
24
+ responseContentType: Optional[str]
25
+
26
+
27
+ class _PolyCustom:
28
+ def __init__(self):
29
+ self._internal_store = {
30
+ "executionId": None,
31
+ "executionApiKey": None,
32
+ "responseStatusCode": 200,
33
+ "responseContentType": None,
34
+ }
35
+ self._execution_id_locked = False
36
+
37
+ def set_once(self, key: str, value: Any) -> None:
38
+ if key == "executionId" and self._execution_id_locked:
39
+ # Silently ignore attempts to overwrite locked executionId
40
+ return
41
+ self._internal_store[key] = value
42
+ if key == "executionId":
43
+ # Lock executionId after setting it
44
+ self.lock_execution_id()
45
+
46
+ def get(self, key: str, default: Any = None) -> Any:
47
+ return self._internal_store.get(key, default)
48
+
49
+ def lock_execution_id(self) -> None:
50
+ self._execution_id_locked = True
51
+
52
+ def unlock_execution_id(self) -> None:
53
+ self._execution_id_locked = False
54
+
55
+ @overload
56
+ def __getitem__(self, key: Literal["executionId"]) -> Optional[str]: ...
57
+
58
+ @overload
59
+ def __getitem__(self, key: Literal["executionApiKey"]) -> Optional[str]: ...
60
+
61
+ @overload
62
+ def __getitem__(self, key: Literal["responseStatusCode"]) -> int: ...
63
+
64
+ @overload
65
+ def __getitem__(self, key: Literal["responseContentType"]) -> Optional[str]: ...
66
+
67
+ def __getitem__(self, key: str) -> Any:
68
+ return self.get(key)
69
+
70
+ @overload
71
+ def __setitem__(self, key: Literal["executionApiKey"], value: Optional[str]) -> None: ...
72
+
73
+ @overload
74
+ def __setitem__(self, key: Literal["responseStatusCode"], value: int) -> None: ...
75
+
76
+ @overload
77
+ def __setitem__(self, key: Literal["responseContentType"], value: Optional[str]) -> None: ...
78
+
79
+ def __setitem__(self, key: str, value: Any) -> None:
80
+ self.set_once(key, value)
81
+
82
+ def __repr__(self) -> str:
83
+ return f"PolyCustom({self._internal_store})"
84
+
85
+ def copy(self) -> '_PolyCustom':
86
+ new = _PolyCustom()
87
+ new._internal_store = self._internal_store.copy()
88
+ new._execution_id_locked = self._execution_id_locked
89
+ return new
90
+
91
+
92
+ polyCustom: PolyCustomDict = _PolyCustom()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: polyapi-python
3
- Version: 0.3.7.dev1
3
+ Version: 0.3.7.dev2
4
4
  Summary: The Python Client for PolyAPI, the IPaaS by Developers for Developers
5
5
  Author-email: Dan Fellin <dan@polyapi.io>
6
6
  License: MIT License
@@ -3,7 +3,7 @@ requires = ["setuptools>=61.2", "wheel"]
3
3
 
4
4
  [project]
5
5
  name = "polyapi-python"
6
- version = "0.3.7.dev1"
6
+ version = "0.3.7.dev2"
7
7
  description = "The Python Client for PolyAPI, the IPaaS by Developers for Developers"
8
8
  authors = [{ name = "Dan Fellin", email = "dan@polyapi.io" }]
9
9
  dependencies = [
@@ -1,23 +0,0 @@
1
- import os
2
- import sys
3
- import truststore
4
- from typing import Dict, Any
5
- truststore.inject_into_ssl()
6
- from .cli import CLI_COMMANDS
7
-
8
- __all__ = ["poly"]
9
-
10
-
11
- if len(sys.argv) > 1 and sys.argv[1] not in CLI_COMMANDS:
12
- currdir = os.path.dirname(os.path.abspath(__file__))
13
- if not os.path.isdir(os.path.join(currdir, "poly")):
14
- print("No 'poly' found. Please run 'python3 -m polyapi generate' to generate the 'poly' library for your tenant.")
15
- sys.exit(1)
16
-
17
-
18
- polyCustom: Dict[str, Any] = {
19
- "executionId": None,
20
- "executionApiKey": None,
21
- "responseStatusCode": 200,
22
- "responseContentType": None,
23
- }