polyapi-python 0.3.9.dev1__tar.gz → 0.3.9.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.
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/PKG-INFO +1 -1
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi/deployables.py +2 -2
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi/execute.py +16 -5
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi/prepare.py +5 -3
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi_python.egg-info/PKG-INFO +1 -1
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/pyproject.toml +1 -1
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/LICENSE +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/README.md +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi/__init__.py +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi/__main__.py +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi/api.py +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi/auth.py +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi/cli.py +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi/client.py +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi/config.py +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi/constants.py +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi/error_handler.py +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi/exceptions.py +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi/function_cli.py +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi/generate.py +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi/parser.py +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi/poly_schemas.py +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi/py.typed +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi/rendered_spec.py +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi/schema.py +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi/server.py +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi/sync.py +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi/typedefs.py +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi/utils.py +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi/variables.py +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi/webhook.py +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi_python.egg-info/SOURCES.txt +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi_python.egg-info/dependency_links.txt +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi_python.egg-info/requires.txt +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi_python.egg-info/top_level.txt +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/setup.cfg +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/tests/test_api.py +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/tests/test_auth.py +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/tests/test_deployables.py +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/tests/test_generate.py +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/tests/test_parser.py +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/tests/test_rendered_spec.py +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/tests/test_schema.py +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/tests/test_server.py +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/tests/test_utils.py +0 -0
- {polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/tests/test_variables.py +0 -0
|
@@ -118,13 +118,13 @@ def get_all_deployable_files_windows(config: PolyDeployConfig) -> List[str]:
|
|
|
118
118
|
pattern = ' '.join(f"/C:\"polyConfig: {name}\"" for name in config["type_names"]) or '/C:"polyConfig"'
|
|
119
119
|
|
|
120
120
|
exclude_command = f" | findstr /V /I \"{exclude_pattern}\"" if exclude_pattern else ''
|
|
121
|
-
search_command = f" | findstr /
|
|
121
|
+
search_command = f" | findstr /M /I /F:/ {pattern}"
|
|
122
122
|
|
|
123
123
|
result = []
|
|
124
124
|
for dir_path in config["include_dirs"]:
|
|
125
125
|
if dir_path != '.':
|
|
126
126
|
include_pattern = " ".join(f"{dir_path}*.{f}" for f in config["include_files_or_extensions"]) or "*"
|
|
127
|
-
dir_command = f"dir {include_pattern} /S /P /B
|
|
127
|
+
dir_command = f"dir {include_pattern} /S /P /B"
|
|
128
128
|
full_command = f"{dir_command}{exclude_command}{search_command}"
|
|
129
129
|
try:
|
|
130
130
|
output = subprocess.check_output(full_command, shell=True, text=True)
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
|
@@ -138,11 +138,13 @@ def prepare_deployables(lazy: bool = False, disable_docs: bool = False, disable_
|
|
|
138
138
|
write_updated_deployable(deployable, disable_docs)
|
|
139
139
|
# Re-stage any updated staged files.
|
|
140
140
|
staged = subprocess.check_output('git diff --name-only --cached', shell=True, text=True, ).split('\n')
|
|
141
|
+
rootPath = subprocess.check_output('git rev-parse --show-toplevel', shell=True, text=True).replace('\n', '')
|
|
141
142
|
for deployable in dirty_deployables:
|
|
142
143
|
try:
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
144
|
+
deployableName = deployable["file"].replace('\\', '/').replace(f"{rootPath}/", '')
|
|
145
|
+
if deployableName in staged:
|
|
146
|
+
print(f'Staging {deployableName}')
|
|
147
|
+
subprocess.run(['git', 'add', deployableName])
|
|
146
148
|
except:
|
|
147
149
|
print('Warning: File staging failed, check that all files are staged properly.')
|
|
148
150
|
|
|
@@ -3,7 +3,7 @@ requires = ["setuptools>=61.2", "wheel"]
|
|
|
3
3
|
|
|
4
4
|
[project]
|
|
5
5
|
name = "polyapi-python"
|
|
6
|
-
version = "0.3.9.
|
|
6
|
+
version = "0.3.9.dev3"
|
|
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 = [
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi_python.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi_python.egg-info/requires.txt
RENAMED
|
File without changes
|
{polyapi_python-0.3.9.dev1 → polyapi_python-0.3.9.dev3}/polyapi_python.egg-info/top_level.txt
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
|