polyapi-python 0.3.5.dev0__py3-none-any.whl → 0.3.6.dev0__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/generate.py +1 -1
- polyapi/typedefs.py +5 -1
- polyapi/variables.py +4 -3
- {polyapi_python-0.3.5.dev0.dist-info → polyapi_python-0.3.6.dev0.dist-info}/METADATA +1 -1
- {polyapi_python-0.3.5.dev0.dist-info → polyapi_python-0.3.6.dev0.dist-info}/RECORD +8 -8
- {polyapi_python-0.3.5.dev0.dist-info → polyapi_python-0.3.6.dev0.dist-info}/WHEEL +1 -1
- {polyapi_python-0.3.5.dev0.dist-info → polyapi_python-0.3.6.dev0.dist-info}/licenses/LICENSE +0 -0
- {polyapi_python-0.3.5.dev0.dist-info → polyapi_python-0.3.6.dev0.dist-info}/top_level.txt +0 -0
polyapi/generate.py
CHANGED
|
@@ -201,7 +201,7 @@ def remove_old_library():
|
|
|
201
201
|
shutil.rmtree(path)
|
|
202
202
|
|
|
203
203
|
|
|
204
|
-
def generate(contexts: Optional[List[str]], no_types: bool = False) -> None:
|
|
204
|
+
def generate(contexts: Optional[List[str]] = None, no_types: bool = False) -> None:
|
|
205
205
|
generate_msg = f"Generating Poly Python SDK for contexts ${contexts}..." if contexts else "Generating Poly Python SDK..."
|
|
206
206
|
print(generate_msg, end="", flush=True)
|
|
207
207
|
remove_old_library()
|
polyapi/typedefs.py
CHANGED
|
@@ -40,11 +40,15 @@ class SpecificationDto(TypedDict):
|
|
|
40
40
|
language: str
|
|
41
41
|
|
|
42
42
|
|
|
43
|
+
# Enum for variable secrecy levels
|
|
44
|
+
Secrecy = Literal['SECRET', 'OBSCURED', 'NONE']
|
|
45
|
+
|
|
46
|
+
|
|
43
47
|
class VariableSpecification(TypedDict):
|
|
44
48
|
environmentId: str
|
|
45
49
|
value: Any
|
|
46
50
|
valueType: PropertyType
|
|
47
|
-
|
|
51
|
+
secrecy: Secrecy
|
|
48
52
|
|
|
49
53
|
|
|
50
54
|
class VariableSpecDto(TypedDict):
|
polyapi/variables.py
CHANGED
|
@@ -2,11 +2,11 @@ import os
|
|
|
2
2
|
from typing import List
|
|
3
3
|
|
|
4
4
|
from polyapi.schema import map_primitive_types
|
|
5
|
-
from polyapi.typedefs import PropertyType, VariableSpecDto
|
|
5
|
+
from polyapi.typedefs import PropertyType, VariableSpecDto, Secrecy
|
|
6
6
|
from polyapi.utils import add_import_to_init, init_the_init
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
# GET is only included if the variable is not
|
|
9
|
+
# GET is only included if the variable is not SECRET
|
|
10
10
|
GET_TEMPLATE = """
|
|
11
11
|
@staticmethod
|
|
12
12
|
def get() -> {variable_type}:
|
|
@@ -76,9 +76,10 @@ def generate_variables(variables: List[VariableSpecDto]):
|
|
|
76
76
|
|
|
77
77
|
def render_variable(variable: VariableSpecDto):
|
|
78
78
|
variable_type = _get_variable_type(variable["variable"]["valueType"])
|
|
79
|
+
# Only include get() method if secrecy is not SECRET
|
|
79
80
|
get_method = (
|
|
80
81
|
""
|
|
81
|
-
if variable["variable"]["
|
|
82
|
+
if variable["variable"]["secrecy"] == "SECRET"
|
|
82
83
|
else GET_TEMPLATE.format(
|
|
83
84
|
variable_id=variable["id"], variable_type=variable_type
|
|
84
85
|
)
|
|
@@ -11,7 +11,7 @@ polyapi/error_handler.py,sha256=I_e0iz6VM23FLVQWJljxs2NGcl_OODbi43OcbnqBlp8,2398
|
|
|
11
11
|
polyapi/exceptions.py,sha256=Zh7i7eCUhDuXEdUYjatkLFTeZkrx1BJ1P5ePgbJ9eIY,89
|
|
12
12
|
polyapi/execute.py,sha256=akfiJMIlRCPNtDfRvGd11baGC7F8gjwD3Uv8w9RVND4,1967
|
|
13
13
|
polyapi/function_cli.py,sha256=iGTjbFJQvfVOAtbcM5xbKbXcG-m22TrBRyZY-NYGDPo,4216
|
|
14
|
-
polyapi/generate.py,sha256=
|
|
14
|
+
polyapi/generate.py,sha256=KdkhvkefHbSWr-XqStLrDNtE61-beIbdIClq9_y5XcI,11899
|
|
15
15
|
polyapi/parser.py,sha256=mdoh4pNq8pyiHE0-i6Coqj8frEXfBLRk6itpAXMrrgI,20373
|
|
16
16
|
polyapi/poly_schemas.py,sha256=T4kfZyfgVLiqLD28GmYNiHnrNx77J_HO4uzk8LUAhlo,3137
|
|
17
17
|
polyapi/prepare.py,sha256=Q8CWV4kmZ2dbXYVsud34AgJkj5ymcQ_IcYhLuikc9yk,6659
|
|
@@ -20,12 +20,12 @@ polyapi/rendered_spec.py,sha256=nJEj2vRgG3N20fU4s-ThRtOIwAuTzXwXuOBIkXljDVc,2240
|
|
|
20
20
|
polyapi/schema.py,sha256=ZSzeUjpqigLvE4tFKB7y4AaZG-W5N5Z9wMH-F-vjMBU,4616
|
|
21
21
|
polyapi/server.py,sha256=YXWxhYBx-hluwDQ8Jvfpy2s8ogz0GsNTMcZVNcP5ca8,2147
|
|
22
22
|
polyapi/sync.py,sha256=PGdC0feBBjEVrF3d9EluW_OAxbWuzSrfh84czma8kWg,6476
|
|
23
|
-
polyapi/typedefs.py,sha256=
|
|
23
|
+
polyapi/typedefs.py,sha256=MGDwWaijLNqokXF9UCHGAP-yKixOzztrH4Lsj800AJs,2328
|
|
24
24
|
polyapi/utils.py,sha256=vq2seXLhbp9pOvemhS71DDwi1h4YofI8TXiRDjt5Eoo,10308
|
|
25
|
-
polyapi/variables.py,sha256=
|
|
25
|
+
polyapi/variables.py,sha256=j7WWrGLr2O5SkWGxnsusnnfl25kVL3b6SQYcVGEoC8c,4277
|
|
26
26
|
polyapi/webhook.py,sha256=LWv28c2MLz_OKBI_Nn7WR4C-gs1SWgbdXsoxIIf-9UI,4886
|
|
27
|
-
polyapi_python-0.3.
|
|
28
|
-
polyapi_python-0.3.
|
|
29
|
-
polyapi_python-0.3.
|
|
30
|
-
polyapi_python-0.3.
|
|
31
|
-
polyapi_python-0.3.
|
|
27
|
+
polyapi_python-0.3.6.dev0.dist-info/licenses/LICENSE,sha256=6b_I7aPVp8JXhqQwdw7_B84Ca0S4JGjHj0sr_1VOdB4,1068
|
|
28
|
+
polyapi_python-0.3.6.dev0.dist-info/METADATA,sha256=W1C6j1oRkKpu4Wd0Vyz9ATCJsstQs7R-lIfcRdBASZI,5782
|
|
29
|
+
polyapi_python-0.3.6.dev0.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
|
|
30
|
+
polyapi_python-0.3.6.dev0.dist-info/top_level.txt,sha256=CEFllOnzowci_50RYJac-M54KD2IdAptFsayVVF_f04,8
|
|
31
|
+
polyapi_python-0.3.6.dev0.dist-info/RECORD,,
|
{polyapi_python-0.3.5.dev0.dist-info → polyapi_python-0.3.6.dev0.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|