polyapi-python 0.2.6.dev2__tar.gz → 0.2.7.dev1__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.2.6.dev2/polyapi_python.egg-info → polyapi_python-0.2.7.dev1}/PKG-INFO +1 -1
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/polyapi/cli.py +5 -2
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/polyapi/function_cli.py +9 -1
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/polyapi/schema.py +0 -14
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1/polyapi_python.egg-info}/PKG-INFO +1 -1
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/pyproject.toml +1 -1
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/LICENSE +0 -0
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/README.md +0 -0
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/polyapi/__init__.py +0 -0
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/polyapi/__main__.py +0 -0
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/polyapi/api.py +0 -0
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/polyapi/auth.py +0 -0
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/polyapi/client.py +0 -0
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/polyapi/config.py +0 -0
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/polyapi/constants.py +0 -0
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/polyapi/error_handler.py +0 -0
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/polyapi/exceptions.py +0 -0
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/polyapi/execute.py +0 -0
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/polyapi/generate.py +0 -0
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/polyapi/py.typed +0 -0
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/polyapi/rendered_spec.py +0 -0
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/polyapi/server.py +0 -0
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/polyapi/typedefs.py +0 -0
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/polyapi/utils.py +0 -0
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/polyapi/variables.py +0 -0
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/polyapi/webhook.py +0 -0
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/polyapi_python.egg-info/SOURCES.txt +0 -0
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/polyapi_python.egg-info/dependency_links.txt +0 -0
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/polyapi_python.egg-info/requires.txt +0 -0
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/polyapi_python.egg-info/top_level.txt +0 -0
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/setup.cfg +0 -0
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/tests/test_api.py +0 -0
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/tests/test_auth.py +0 -0
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/tests/test_function_cli.py +0 -0
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/tests/test_rendered_spec.py +0 -0
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/tests/test_schema.py +0 -0
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/tests/test_server.py +0 -0
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/tests/test_utils.py +0 -0
- {polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/tests/test_variables.py +0 -0
|
@@ -4,7 +4,7 @@ from polyapi.utils import print_green
|
|
|
4
4
|
|
|
5
5
|
from .config import clear_config, set_api_key_and_url
|
|
6
6
|
from .generate import generate, clear
|
|
7
|
-
from .function_cli import function_add_or_update
|
|
7
|
+
from .function_cli import function_add_or_update, function_execute
|
|
8
8
|
from .rendered_spec import get_and_update_rendered_spec
|
|
9
9
|
|
|
10
10
|
|
|
@@ -56,4 +56,7 @@ def execute_from_cli() -> None:
|
|
|
56
56
|
print("Clearing the generated library...")
|
|
57
57
|
clear()
|
|
58
58
|
elif command == "function":
|
|
59
|
-
|
|
59
|
+
if args.subcommands[0] == "execute":
|
|
60
|
+
print(function_execute(args.context, args.subcommands))
|
|
61
|
+
else:
|
|
62
|
+
function_add_or_update(args.context, args.description, args.client, args.server, args.logs, args.subcommands, not args.skip_generate)
|
|
@@ -3,7 +3,7 @@ import argparse
|
|
|
3
3
|
import json
|
|
4
4
|
import types
|
|
5
5
|
import sys
|
|
6
|
-
from typing import Dict, List, Mapping, Optional, Tuple
|
|
6
|
+
from typing import Any, Dict, List, Mapping, Optional, Tuple
|
|
7
7
|
from typing import _TypedDictMeta as BaseTypedDict # type: ignore
|
|
8
8
|
from typing_extensions import _TypedDictMeta # type: ignore
|
|
9
9
|
import requests
|
|
@@ -279,3 +279,11 @@ def function_add_or_update(
|
|
|
279
279
|
print(resp.status_code)
|
|
280
280
|
print(resp.content)
|
|
281
281
|
sys.exit(1)
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
def function_execute(context: str, subcommands: List) -> Any:
|
|
285
|
+
assert subcommands[0] == "execute"
|
|
286
|
+
context_code = importlib.import_module(f"polyapi.poly.{context}")
|
|
287
|
+
print(f"Executing poly.{context}.{subcommands[1]}... ")
|
|
288
|
+
fn = getattr(context_code, subcommands[1])
|
|
289
|
+
return fn(*subcommands[2:])
|
|
@@ -77,20 +77,6 @@ def generate_schema_types(input_data: Dict, root=None):
|
|
|
77
77
|
with open(tmp_output) as f:
|
|
78
78
|
output = f.read()
|
|
79
79
|
|
|
80
|
-
output = _fix_title(input_data, output)
|
|
81
|
-
return output
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
def _fix_title(input_data, output) -> str:
|
|
85
|
-
""" the jsonschema_gentypes library changes all titles to Pascalcase
|
|
86
|
-
this function changes them back
|
|
87
|
-
TODO fix bug in gentypes so this step is not necessary
|
|
88
|
-
"""
|
|
89
|
-
for k, v in input_data.items():
|
|
90
|
-
if isinstance(v, dict):
|
|
91
|
-
output = _fix_title(v, output)
|
|
92
|
-
elif k == "title":
|
|
93
|
-
output = output.replace(f"class {v.title()}", f"class {v}")
|
|
94
80
|
return output
|
|
95
81
|
|
|
96
82
|
|
|
@@ -3,7 +3,7 @@ requires = ["setuptools>=61.2", "wheel"]
|
|
|
3
3
|
|
|
4
4
|
[project]
|
|
5
5
|
name = "polyapi-python"
|
|
6
|
-
version = "0.2.
|
|
6
|
+
version = "0.2.7.dev1"
|
|
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
|
{polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/polyapi_python.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/polyapi_python.egg-info/requires.txt
RENAMED
|
File without changes
|
{polyapi_python-0.2.6.dev2 → polyapi_python-0.2.7.dev1}/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
|