polyapi-python 0.2.1.dev2__py3-none-any.whl → 0.2.2__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
@@ -76,11 +76,14 @@ def cache_specs(specs: List[SpecificationDto]):
76
76
 
77
77
  full_path = os.path.dirname(os.path.abspath(__file__))
78
78
  full_path = os.path.join(full_path, "poly")
79
- if not os.path.exists(full_path):
80
- os.makedirs(full_path)
81
-
82
- with open(os.path.join(full_path, "specs.json"), "w") as f:
83
- f.write(json.dumps(supported))
79
+ try:
80
+ if not os.path.exists(full_path):
81
+ os.makedirs(full_path)
82
+
83
+ with open(os.path.join(full_path, "specs.json"), "w") as f:
84
+ f.write(json.dumps(supported))
85
+ except Exception as e:
86
+ print("Failed to cache specs", e)
84
87
 
85
88
 
86
89
  def read_cached_specs() -> List[SpecificationDto]:
polyapi/webhook.py CHANGED
@@ -34,7 +34,7 @@ def {function_name}(callback, options=None):
34
34
  nonlocal options
35
35
  polyCustom = {{}}
36
36
  resp = await callback(data.get("body"), data.get("headers"), data.get("params"), polyCustom)
37
- if resp and options.get("waitForResponse"):
37
+ if options.get("waitForResponse"):
38
38
  await socket.emit('setWebhookListenerResponse', {{
39
39
  "webhookHandleID": function_id,
40
40
  "apiKey": api_key,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: polyapi-python
3
- Version: 0.2.1.dev2
3
+ Version: 0.2.2
4
4
  Summary: The PolyAPI Python Client
5
5
  Author-email: Dan Fellin <dan@polyapi.io>
6
6
  License: MIT License
@@ -8,16 +8,16 @@ polyapi/constants.py,sha256=NGjso6K5rGnE8TGdrXmdEfvvr-HI3DTVGwOYiWO68LM,511
8
8
  polyapi/exceptions.py,sha256=Zh7i7eCUhDuXEdUYjatkLFTeZkrx1BJ1P5ePgbJ9eIY,89
9
9
  polyapi/execute.py,sha256=06XWTxGJqtsDiLY10RjRebIMFRfhtAIMmBRbuWu3e8A,1873
10
10
  polyapi/function_cli.py,sha256=5e6hJ3nitKxbQNSkp4jbuAzbJvykj3de1_aSsc1MBnY,7331
11
- polyapi/generate.py,sha256=ZZVkA3uL5yPWisnFhIBjoFAYfr96h9m6I0XOCbEpiyk,8970
11
+ polyapi/generate.py,sha256=XGhr0Re-Lwasvc309aYCGaD3V_0BgITmo4u9GQaCJOc,9064
12
12
  polyapi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  polyapi/schema.py,sha256=1a7nIO867Xy3bagmPUNdYMxtS5OoCAv8oKIbYgj55dk,2957
14
14
  polyapi/server.py,sha256=mcbH8pG16fFMiFL52wdii0217ZLsznQnElAFEvXZ7IA,2211
15
15
  polyapi/typedefs.py,sha256=RZ3I6sgJm_5MuuORG1QjUE-UJy_z2WRXNdiWjEdLvQg,1371
16
16
  polyapi/utils.py,sha256=wZQrwSOst5wyoYYLoMk1DnAEbVsJ0-2YkmmDQ9gI3FY,5399
17
17
  polyapi/variables.py,sha256=d36-trnfTL_8m2NkorMiImb4O3UrJbiFV38CHxV5i0A,4200
18
- polyapi/webhook.py,sha256=uFHJkdAcnRv3ZnsfN3Ygy9SGr97z2HHCuXt5cl5x2JE,2932
19
- polyapi_python-0.2.1.dev2.dist-info/LICENSE,sha256=Hi0kDr56Dsy0uYIwNt4r9G7tI8x8miXRTlyvbeplCP8,1068
20
- polyapi_python-0.2.1.dev2.dist-info/METADATA,sha256=fxAim6uvGiZC2zukYI3gQkFfrkzxxASRBa-oNdBMjOk,4823
21
- polyapi_python-0.2.1.dev2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
22
- polyapi_python-0.2.1.dev2.dist-info/top_level.txt,sha256=CEFllOnzowci_50RYJac-M54KD2IdAptFsayVVF_f04,8
23
- polyapi_python-0.2.1.dev2.dist-info/RECORD,,
18
+ polyapi/webhook.py,sha256=A89eNnYcVpVe9doJPDLfscIhF-C7Q2AI3vu-SzGxMBg,2923
19
+ polyapi_python-0.2.2.dist-info/LICENSE,sha256=Hi0kDr56Dsy0uYIwNt4r9G7tI8x8miXRTlyvbeplCP8,1068
20
+ polyapi_python-0.2.2.dist-info/METADATA,sha256=VAxKcFB7eUp5MRe8O0sfpYVN-lXVNP82I4bBo5JbZuE,4818
21
+ polyapi_python-0.2.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
22
+ polyapi_python-0.2.2.dist-info/top_level.txt,sha256=CEFllOnzowci_50RYJac-M54KD2IdAptFsayVVF_f04,8
23
+ polyapi_python-0.2.2.dist-info/RECORD,,