polyapi-python 0.3.3.dev3__py3-none-any.whl → 0.3.3.dev4__py3-none-any.whl
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/cli.py +0 -2
- polyapi/function_cli.py +2 -8
- polyapi/generate.py +8 -7
- {polyapi_python-0.3.3.dev3.dist-info → polyapi_python-0.3.3.dev4.dist-info}/METADATA +1 -1
- {polyapi_python-0.3.3.dev3.dist-info → polyapi_python-0.3.3.dev4.dist-info}/RECORD +8 -8
- {polyapi_python-0.3.3.dev3.dist-info → polyapi_python-0.3.3.dev4.dist-info}/WHEEL +0 -0
- {polyapi_python-0.3.3.dev3.dist-info → polyapi_python-0.3.3.dev4.dist-info}/licenses/LICENSE +0 -0
- {polyapi_python-0.3.3.dev3.dist-info → polyapi_python-0.3.3.dev4.dist-info}/top_level.txt +0 -0
polyapi/cli.py
CHANGED
polyapi/function_cli.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import sys
|
|
2
2
|
from typing import Any, List, Optional
|
|
3
3
|
import requests
|
|
4
|
-
from polyapi.generate import
|
|
4
|
+
from polyapi.generate import generate as generate_library
|
|
5
5
|
from polyapi.config import get_api_key_and_url
|
|
6
6
|
from polyapi.utils import get_auth_headers, print_green, print_red, print_yellow
|
|
7
7
|
from polyapi.parser import parse_function_code, get_jsonschema_type
|
|
@@ -87,13 +87,7 @@ def function_add_or_update(
|
|
|
87
87
|
function_id = resp.json()["id"]
|
|
88
88
|
print(f"Function ID: {function_id}")
|
|
89
89
|
if generate:
|
|
90
|
-
|
|
91
|
-
# TODO do something more efficient here rather than regetting ALL the specs again
|
|
92
|
-
specs = get_specs()
|
|
93
|
-
cache_specs(specs)
|
|
94
|
-
functions = parse_function_specs(specs)
|
|
95
|
-
generate_functions(functions)
|
|
96
|
-
print_green("DONE")
|
|
90
|
+
generate_library()
|
|
97
91
|
else:
|
|
98
92
|
print("Error adding function.")
|
|
99
93
|
print(resp.status_code)
|
polyapi/generate.py
CHANGED
|
@@ -4,16 +4,15 @@ import os
|
|
|
4
4
|
import shutil
|
|
5
5
|
from typing import List, cast
|
|
6
6
|
|
|
7
|
-
from
|
|
8
|
-
from
|
|
9
|
-
from
|
|
10
|
-
from
|
|
11
|
-
from polyapi.webhook import render_webhook_handle
|
|
7
|
+
from .auth import render_auth_function
|
|
8
|
+
from .client import render_client_function
|
|
9
|
+
from .poly_schemas import generate_schemas
|
|
10
|
+
from .webhook import render_webhook_handle
|
|
12
11
|
|
|
13
12
|
from .typedefs import PropertySpecification, SchemaSpecDto, SpecificationDto, VariableSpecDto
|
|
14
13
|
from .api import render_api_function
|
|
15
14
|
from .server import render_server_function
|
|
16
|
-
from .utils import add_import_to_init, get_auth_headers, init_the_init, to_func_namespace
|
|
15
|
+
from .utils import add_import_to_init, get_auth_headers, init_the_init, print_green, to_func_namespace
|
|
17
16
|
from .variables import generate_variables
|
|
18
17
|
from .config import get_api_key_and_url
|
|
19
18
|
|
|
@@ -175,7 +174,7 @@ def remove_old_library():
|
|
|
175
174
|
|
|
176
175
|
|
|
177
176
|
def generate() -> None:
|
|
178
|
-
|
|
177
|
+
print("Generating Poly Python SDK...", end="", flush=True)
|
|
179
178
|
remove_old_library()
|
|
180
179
|
|
|
181
180
|
limit_ids: List[str] = [] # useful for narrowing down generation to a single function to debug
|
|
@@ -208,6 +207,8 @@ def generate() -> None:
|
|
|
208
207
|
file_path = os.path.join(os.getcwd(), ".polyapi-python")
|
|
209
208
|
open(file_path, "w").close()
|
|
210
209
|
|
|
210
|
+
print_green("DONE")
|
|
211
|
+
|
|
211
212
|
|
|
212
213
|
def clear() -> None:
|
|
213
214
|
base = os.path.dirname(os.path.abspath(__file__))
|
|
@@ -2,7 +2,7 @@ polyapi/__init__.py,sha256=a1Poy1kaTncYnUg6nWRcTjVm-R1CUQk12UX7VYQ9d5k,616
|
|
|
2
2
|
polyapi/__main__.py,sha256=V4zhAh_YGxno5f_KSrlkELxcuDh9bR3WSd0n-2r-qQQ,93
|
|
3
3
|
polyapi/api.py,sha256=8gXypLOgySjg3fWD_K192idYWPNLBU09c9N35b8irxA,1878
|
|
4
4
|
polyapi/auth.py,sha256=zrIGatjba5GwUTNjKj1GHQWTEDP9B-HrSzCKbLFoqvc,5336
|
|
5
|
-
polyapi/cli.py,sha256=
|
|
5
|
+
polyapi/cli.py,sha256=AKsWVHZPKGnypOdnzIpoZOsTuwcAuDGQajXhLe9OQKI,8239
|
|
6
6
|
polyapi/client.py,sha256=CoFDYvyKsqL4wPQbUDIr0Qb8Q5eD92xN4OEEcJEVuGQ,1296
|
|
7
7
|
polyapi/config.py,sha256=uvEvOfWYZTLmBmZX-5jJxCzWPpwzVmEOIiQIdi98P4Y,3015
|
|
8
8
|
polyapi/constants.py,sha256=sc-FnS0SngBLvSu1ZWMs0UCf9EYD1u1Yhfr-sZXGLns,607
|
|
@@ -10,8 +10,8 @@ polyapi/deployables.py,sha256=WVcNNB6W5ZW_-ukf_kK3moRcnwIkC-O4te6vLepjcco,11936
|
|
|
10
10
|
polyapi/error_handler.py,sha256=I_e0iz6VM23FLVQWJljxs2NGcl_OODbi43OcbnqBlp8,2398
|
|
11
11
|
polyapi/exceptions.py,sha256=Zh7i7eCUhDuXEdUYjatkLFTeZkrx1BJ1P5ePgbJ9eIY,89
|
|
12
12
|
polyapi/execute.py,sha256=kXnvlNQ7nz9cRlV2_5gXH09UCmyiDP5zi3wiAw0uDuk,1943
|
|
13
|
-
polyapi/function_cli.py,sha256=
|
|
14
|
-
polyapi/generate.py,sha256=
|
|
13
|
+
polyapi/function_cli.py,sha256=htgmcx_dPmw4_5NKRgIivcwS7D8bkOsxCTOrJhzV3pU,3989
|
|
14
|
+
polyapi/generate.py,sha256=FEw0cNdv8bwvNf21qGElQrFqEfdLhlQ-bmvQdTzKp4U,10447
|
|
15
15
|
polyapi/parser.py,sha256=Dqkg7cy9yae9HP4WcPtNzyZxrUrtDsGshFYW-vPvTzE,20263
|
|
16
16
|
polyapi/poly_schemas.py,sha256=malK9s0DB_am0tMOZ0bwyjXZmABAQ1WnZpP-IJhpb2g,1845
|
|
17
17
|
polyapi/prepare.py,sha256=Q8CWV4kmZ2dbXYVsud34AgJkj5ymcQ_IcYhLuikc9yk,6659
|
|
@@ -24,8 +24,8 @@ polyapi/typedefs.py,sha256=KniVl7vwcDOhgAJmHSgTJKkP0rKWvSLIPOGsWuf9jRU,2239
|
|
|
24
24
|
polyapi/utils.py,sha256=Y2qMy3mf-1FNif2_IHV-ZD00OZlNmKhHN_7aPyqeWP0,8296
|
|
25
25
|
polyapi/variables.py,sha256=d36-trnfTL_8m2NkorMiImb4O3UrJbiFV38CHxV5i0A,4200
|
|
26
26
|
polyapi/webhook.py,sha256=LWv28c2MLz_OKBI_Nn7WR4C-gs1SWgbdXsoxIIf-9UI,4886
|
|
27
|
-
polyapi_python-0.3.3.
|
|
28
|
-
polyapi_python-0.3.3.
|
|
29
|
-
polyapi_python-0.3.3.
|
|
30
|
-
polyapi_python-0.3.3.
|
|
31
|
-
polyapi_python-0.3.3.
|
|
27
|
+
polyapi_python-0.3.3.dev4.dist-info/licenses/LICENSE,sha256=Hi0kDr56Dsy0uYIwNt4r9G7tI8x8miXRTlyvbeplCP8,1068
|
|
28
|
+
polyapi_python-0.3.3.dev4.dist-info/METADATA,sha256=2fZGhUNKe3n3RPaeEz6YU_RWmD3DYXnzFMvcNmk6mXk,5580
|
|
29
|
+
polyapi_python-0.3.3.dev4.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
30
|
+
polyapi_python-0.3.3.dev4.dist-info/top_level.txt,sha256=CEFllOnzowci_50RYJac-M54KD2IdAptFsayVVF_f04,8
|
|
31
|
+
polyapi_python-0.3.3.dev4.dist-info/RECORD,,
|
|
File without changes
|
{polyapi_python-0.3.3.dev3.dist-info → polyapi_python-0.3.3.dev4.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|