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 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
- secret: bool
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 a secret
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"]["secret"]
82
+ if variable["variable"]["secrecy"] == "SECRET"
82
83
  else GET_TEMPLATE.format(
83
84
  variable_id=variable["id"], variable_type=variable_type
84
85
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: polyapi-python
3
- Version: 0.3.5.dev0
3
+ Version: 0.3.6.dev0
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
@@ -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=HKUjkFJbG3B-m9pEO8naBOuLVdRvS-5sIobQSSsuSTs,11892
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=KniVl7vwcDOhgAJmHSgTJKkP0rKWvSLIPOGsWuf9jRU,2239
23
+ polyapi/typedefs.py,sha256=MGDwWaijLNqokXF9UCHGAP-yKixOzztrH4Lsj800AJs,2328
24
24
  polyapi/utils.py,sha256=vq2seXLhbp9pOvemhS71DDwi1h4YofI8TXiRDjt5Eoo,10308
25
- polyapi/variables.py,sha256=d36-trnfTL_8m2NkorMiImb4O3UrJbiFV38CHxV5i0A,4200
25
+ polyapi/variables.py,sha256=j7WWrGLr2O5SkWGxnsusnnfl25kVL3b6SQYcVGEoC8c,4277
26
26
  polyapi/webhook.py,sha256=LWv28c2MLz_OKBI_Nn7WR4C-gs1SWgbdXsoxIIf-9UI,4886
27
- polyapi_python-0.3.5.dev0.dist-info/licenses/LICENSE,sha256=6b_I7aPVp8JXhqQwdw7_B84Ca0S4JGjHj0sr_1VOdB4,1068
28
- polyapi_python-0.3.5.dev0.dist-info/METADATA,sha256=tTl7KhlZOHrGh3EAhUrqWMQC6kKgC4Vn2mHVgvsgoOY,5782
29
- polyapi_python-0.3.5.dev0.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
30
- polyapi_python-0.3.5.dev0.dist-info/top_level.txt,sha256=CEFllOnzowci_50RYJac-M54KD2IdAptFsayVVF_f04,8
31
- polyapi_python-0.3.5.dev0.dist-info/RECORD,,
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,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.3.1)
2
+ Generator: setuptools (80.4.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5