polyapi-python 0.3.13.dev1__py3-none-any.whl → 0.3.13.dev2__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/utils.py CHANGED
@@ -73,9 +73,23 @@ def print_red(s: str):
73
73
 
74
74
  def add_type_import_path(function_name: str, arg: str) -> str:
75
75
  """if not basic type, coerce to camelCase and add the import path"""
76
- # for now, just treat Callables as basic types
76
+ # outdated og comment - for now, just treat Callables as basic types
77
+ # from now, we start qualifying non-basic types :))
78
+ # e.g. Callable[[EmailAddress, Dict, Dict, Dict], None]
79
+ # becomes Callable[[Set_profile_email.EmailAddress, Dict, Dict, Dict], None]
80
+
77
81
  if arg.startswith("Callable"):
78
- return arg
82
+ inner = arg[len("Callable["):-1] # strip outer Callable[...]
83
+ parts = [p.strip() for p in inner.split(",")]
84
+ qualified = []
85
+ for p in parts:
86
+ clean = p.strip("[] ")
87
+ if clean and clean not in BASIC_PYTHON_TYPES:
88
+ replacement = f"{to_func_namespace(function_name)}.{camelCase(clean)}"
89
+ p = p.replace(clean, replacement)
90
+ qualified.append(p)
91
+ return "Callable[" + ",".join(qualified) + "]"
92
+ # return arg
79
93
 
80
94
  if arg in BASIC_PYTHON_TYPES:
81
95
  return arg
polyapi/webhook.py CHANGED
@@ -124,11 +124,7 @@ def render_webhook_handle(
124
124
  ) -> Tuple[str, str]:
125
125
  try:
126
126
  function_args, function_args_def = parse_arguments(function_name, arguments)
127
-
128
- if "WebhookEventType" in function_args:
129
- # let's add the function name import!
130
- function_args = function_args.replace("WebhookEventType", f"{to_func_namespace(function_name)}.WebhookEventType")
131
-
127
+
132
128
  func_str = WEBHOOK_TEMPLATE.format(
133
129
  description=function_description,
134
130
  function_id=function_id,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: polyapi-python
3
- Version: 0.3.13.dev1
3
+ Version: 0.3.13.dev2
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
@@ -22,11 +22,11 @@ polyapi/schema.py,sha256=-mtRV5iL3CV0X3phXhGYFV8sLz0KouTACOKWyGO9Pwc,5309
22
22
  polyapi/server.py,sha256=YXWxhYBx-hluwDQ8Jvfpy2s8ogz0GsNTMcZVNcP5ca8,2147
23
23
  polyapi/sync.py,sha256=52ODc82jBJpbNYTB9zXlrVZLR39iwDPW3cuIC3P8dbM,6742
24
24
  polyapi/typedefs.py,sha256=mfll-KrngOW0wzbvDNiIDaDkFMwbsT-MY5y5hzWj9RE,5642
25
- polyapi/utils.py,sha256=Ca189i4PM4TpwvpzwF3T8MfQsOPD45b_falXjjgYCyI,12603
25
+ polyapi/utils.py,sha256=CZdGusrLOA-e4zb9aZ4aI-UkDPBoyu0-euWj7EE0Vk8,13323
26
26
  polyapi/variables.py,sha256=SJv106ePpQP5mx7Iiafl_shtFlE8FoaO9Q8lvw-3IRg,7270
27
- polyapi/webhook.py,sha256=I3_uOl4f4L2-2WehzRLMVMRrB-76EiXCPA9Vzoaj30I,5326
28
- polyapi_python-0.3.13.dev1.dist-info/licenses/LICENSE,sha256=6b_I7aPVp8JXhqQwdw7_B84Ca0S4JGjHj0sr_1VOdB4,1068
29
- polyapi_python-0.3.13.dev1.dist-info/METADATA,sha256=3dfqvKcLsYjGJpeIGIu-KoC7RjOtSEddhx68R_qTuNc,5318
30
- polyapi_python-0.3.13.dev1.dist-info/WHEEL,sha256=YCfwYGOYMi5Jhw2fU4yNgwErybb2IX5PEwBKV4ZbdBo,91
31
- polyapi_python-0.3.13.dev1.dist-info/top_level.txt,sha256=CEFllOnzowci_50RYJac-M54KD2IdAptFsayVVF_f04,8
32
- polyapi_python-0.3.13.dev1.dist-info/RECORD,,
27
+ polyapi/webhook.py,sha256=0ceLwHNjNd2Yx_8MX5jOIxiQ5Lwhy2pe81ProAuKon0,5108
28
+ polyapi_python-0.3.13.dev2.dist-info/licenses/LICENSE,sha256=6b_I7aPVp8JXhqQwdw7_B84Ca0S4JGjHj0sr_1VOdB4,1068
29
+ polyapi_python-0.3.13.dev2.dist-info/METADATA,sha256=V7aP-XoLF773lEJkHtTwvl0yGWFpzuFkpQEHhKO-C10,5318
30
+ polyapi_python-0.3.13.dev2.dist-info/WHEEL,sha256=YCfwYGOYMi5Jhw2fU4yNgwErybb2IX5PEwBKV4ZbdBo,91
31
+ polyapi_python-0.3.13.dev2.dist-info/top_level.txt,sha256=CEFllOnzowci_50RYJac-M54KD2IdAptFsayVVF_f04,8
32
+ polyapi_python-0.3.13.dev2.dist-info/RECORD,,