polyapi-python 0.3.9.dev2__tar.gz → 0.3.9.dev4__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 (46) hide show
  1. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/PKG-INFO +2 -2
  2. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/polyapi/execute.py +16 -5
  3. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/polyapi_python.egg-info/PKG-INFO +2 -2
  4. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/polyapi_python.egg-info/requires.txt +1 -1
  5. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/pyproject.toml +2 -2
  6. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/LICENSE +0 -0
  7. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/README.md +0 -0
  8. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/polyapi/__init__.py +0 -0
  9. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/polyapi/__main__.py +0 -0
  10. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/polyapi/api.py +0 -0
  11. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/polyapi/auth.py +0 -0
  12. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/polyapi/cli.py +0 -0
  13. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/polyapi/client.py +0 -0
  14. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/polyapi/config.py +0 -0
  15. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/polyapi/constants.py +0 -0
  16. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/polyapi/deployables.py +0 -0
  17. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/polyapi/error_handler.py +0 -0
  18. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/polyapi/exceptions.py +0 -0
  19. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/polyapi/function_cli.py +0 -0
  20. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/polyapi/generate.py +0 -0
  21. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/polyapi/parser.py +0 -0
  22. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/polyapi/poly_schemas.py +0 -0
  23. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/polyapi/prepare.py +0 -0
  24. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/polyapi/py.typed +0 -0
  25. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/polyapi/rendered_spec.py +0 -0
  26. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/polyapi/schema.py +0 -0
  27. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/polyapi/server.py +0 -0
  28. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/polyapi/sync.py +0 -0
  29. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/polyapi/typedefs.py +0 -0
  30. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/polyapi/utils.py +0 -0
  31. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/polyapi/variables.py +0 -0
  32. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/polyapi/webhook.py +0 -0
  33. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/polyapi_python.egg-info/SOURCES.txt +0 -0
  34. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/polyapi_python.egg-info/dependency_links.txt +0 -0
  35. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/polyapi_python.egg-info/top_level.txt +0 -0
  36. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/setup.cfg +0 -0
  37. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/tests/test_api.py +0 -0
  38. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/tests/test_auth.py +0 -0
  39. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/tests/test_deployables.py +0 -0
  40. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/tests/test_generate.py +0 -0
  41. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/tests/test_parser.py +0 -0
  42. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/tests/test_rendered_spec.py +0 -0
  43. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/tests/test_schema.py +0 -0
  44. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/tests/test_server.py +0 -0
  45. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/tests/test_utils.py +0 -0
  46. {polyapi_python-0.3.9.dev2 → polyapi_python-0.3.9.dev4}/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.9.dev2
3
+ Version: 0.3.9.dev4
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
@@ -32,7 +32,7 @@ Requires-Dist: requests>=2.32.3
32
32
  Requires-Dist: typing_extensions>=4.12.2
33
33
  Requires-Dist: jsonschema-gentypes==2.6.0
34
34
  Requires-Dist: pydantic>=2.8.0
35
- Requires-Dist: stdlib_list==0.10.0
35
+ Requires-Dist: stdlib_list>=0.10.0
36
36
  Requires-Dist: colorama==0.4.4
37
37
  Requires-Dist: python-socketio[asyncio_client]==5.11.1
38
38
  Requires-Dist: truststore==0.8.0
@@ -1,5 +1,6 @@
1
1
  from typing import Dict, Optional
2
2
  import requests
3
+ import os
3
4
  from requests import Response
4
5
  from polyapi.config import get_api_key_and_url, get_mtls_config
5
6
  from polyapi.exceptions import PolyApiException
@@ -13,7 +14,11 @@ def direct_execute(function_type, function_id, data) -> Response:
13
14
 
14
15
  endpoint_info = requests.post(url, json=data, headers=headers)
15
16
  if endpoint_info.status_code < 200 or endpoint_info.status_code >= 300:
16
- raise PolyApiException(f"{endpoint_info.status_code}: {endpoint_info.content.decode('utf-8', errors='ignore')}")
17
+ error_content = endpoint_info.content.decode("utf-8", errors="ignore")
18
+ if function_type == 'api' and os.getenv("LOGS_ENABLED"):
19
+ raise PolyApiException(f"Error executing api function with id: {function_id}. Status code: {endpoint_info.status_code}. Request data: {data}, Response: {error_content}")
20
+ elif function_type != 'api':
21
+ raise PolyApiException(f"{endpoint_info.status_code}: {error_content}")
17
22
 
18
23
  endpoint_info_data = endpoint_info.json()
19
24
  request_params = endpoint_info_data.copy()
@@ -38,9 +43,12 @@ def direct_execute(function_type, function_id, data) -> Response:
38
43
  **request_params
39
44
  )
40
45
 
41
- if resp.status_code < 200 or resp.status_code >= 300:
46
+ if (resp.status_code < 200 or resp.status_code >= 300):
42
47
  error_content = resp.content.decode("utf-8", errors="ignore")
43
- raise PolyApiException(f"{resp.status_code}: {error_content}")
48
+ if function_type == 'api' and os.getenv("LOGS_ENABLED"):
49
+ raise PolyApiException(f"Error executing api function with id: {function_id}. Status code: {resp.status_code}. Request data: {data}, Response: {error_content}")
50
+ elif function_type != 'api':
51
+ raise PolyApiException(f"{resp.status_code}: {error_content}")
44
52
 
45
53
  return resp
46
54
 
@@ -59,9 +67,12 @@ def execute(function_type, function_id, data) -> Response:
59
67
  headers=headers,
60
68
  )
61
69
 
62
- if resp.status_code < 200 or resp.status_code >= 300:
70
+ if (resp.status_code < 200 or resp.status_code >= 300) and os.getenv("LOGS_ENABLED"):
63
71
  error_content = resp.content.decode("utf-8", errors="ignore")
64
- raise PolyApiException(f"{resp.status_code}: {error_content}")
72
+ if function_type == 'api' and os.getenv("LOGS_ENABLED"):
73
+ raise PolyApiException(f"Error executing api function with id: {function_id}. Status code: {resp.status_code}. Request data: {data}, Response: {error_content}")
74
+ elif function_type != 'api':
75
+ raise PolyApiException(f"{resp.status_code}: {error_content}")
65
76
 
66
77
  return resp
67
78
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: polyapi-python
3
- Version: 0.3.9.dev2
3
+ Version: 0.3.9.dev4
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
@@ -32,7 +32,7 @@ Requires-Dist: requests>=2.32.3
32
32
  Requires-Dist: typing_extensions>=4.12.2
33
33
  Requires-Dist: jsonschema-gentypes==2.6.0
34
34
  Requires-Dist: pydantic>=2.8.0
35
- Requires-Dist: stdlib_list==0.10.0
35
+ Requires-Dist: stdlib_list>=0.10.0
36
36
  Requires-Dist: colorama==0.4.4
37
37
  Requires-Dist: python-socketio[asyncio_client]==5.11.1
38
38
  Requires-Dist: truststore==0.8.0
@@ -2,7 +2,7 @@ requests>=2.32.3
2
2
  typing_extensions>=4.12.2
3
3
  jsonschema-gentypes==2.6.0
4
4
  pydantic>=2.8.0
5
- stdlib_list==0.10.0
5
+ stdlib_list>=0.10.0
6
6
  colorama==0.4.4
7
7
  python-socketio[asyncio_client]==5.11.1
8
8
  truststore==0.8.0
@@ -3,7 +3,7 @@ requires = ["setuptools>=61.2", "wheel"]
3
3
 
4
4
  [project]
5
5
  name = "polyapi-python"
6
- version = "0.3.9.dev2"
6
+ version = "0.3.9.dev4"
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 = [
@@ -11,7 +11,7 @@ dependencies = [
11
11
  "typing_extensions>=4.12.2",
12
12
  "jsonschema-gentypes==2.6.0",
13
13
  "pydantic>=2.8.0",
14
- "stdlib_list==0.10.0",
14
+ "stdlib_list>=0.10.0",
15
15
  "colorama==0.4.4",
16
16
  "python-socketio[asyncio_client]==5.11.1",
17
17
  "truststore==0.8.0",