polyapi-python 0.3.1.dev17__py3-none-any.whl → 0.3.2.dev1__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 CHANGED
@@ -66,13 +66,13 @@ def execute_from_cli():
66
66
  fn_add_parser.add_argument("--description", required=False, default="", help="Description of the function")
67
67
  fn_add_parser.add_argument("--server", action="store_true", help="Marks the function as a server function")
68
68
  fn_add_parser.add_argument("--client", action="store_true", help="Marks the function as a client function")
69
- fn_add_parser.add_argument("--logs", choices=["enabled", "disabled"], default="disabled", help="Enable or disable logs for the function.")
69
+ fn_add_parser.add_argument("--logs", choices=["enabled", "disabled"], default=None, help="Enable or disable logs for the function.")
70
70
  fn_add_parser.add_argument("--execution-api-key", required=False, default="", help="API key for execution (for server functions only).")
71
71
  fn_add_parser.add_argument("--disable-ai", "--skip-generate", action="store_true", help="Pass --disable-ai skip AI generation of missing descriptions")
72
72
 
73
73
  def add_function(args):
74
74
  initialize_config()
75
- logs_enabled = args.logs == "enabled"
75
+ logs_enabled = args.logs == "enabled" if args.logs else None
76
76
  err = ""
77
77
  if args.server and args.client:
78
78
  err = "Specify either `--server` or `--client`. Found both."
polyapi/function_cli.py CHANGED
@@ -1,5 +1,5 @@
1
1
  import sys
2
- from typing import Any, List
2
+ from typing import Any, List, Optional
3
3
  import requests
4
4
  from polyapi.generate import get_functions_and_parse, generate_functions
5
5
  from polyapi.config import get_api_key_and_url
@@ -23,7 +23,7 @@ def function_add_or_update(
23
23
  description: str,
24
24
  client: bool,
25
25
  server: bool,
26
- logs_enabled: bool,
26
+ logs_enabled: Optional[bool],
27
27
  generate: bool = True,
28
28
  execution_api_key: str = ""
29
29
  ):
@@ -45,6 +45,9 @@ def function_add_or_update(
45
45
  )
46
46
  sys.exit(1)
47
47
 
48
+ if logs_enabled is None:
49
+ logs_enabled = parsed["config"].get("logs_enabled", None)
50
+
48
51
  data = {
49
52
  "context": context or parsed["context"],
50
53
  "name": name,
@@ -54,7 +57,7 @@ def function_add_or_update(
54
57
  "returnType": get_jsonschema_type(return_type),
55
58
  "returnTypeSchema": parsed["types"]["returns"]["typeSchema"],
56
59
  "arguments": [{**p, "key": p["name"], "type": get_jsonschema_type(p["type"]) } for p in parsed["types"]["params"]],
57
- "logsEnabled": logs_enabled or parsed["config"].get("logs_enabled", False),
60
+ "logsEnabled": logs_enabled,
58
61
  }
59
62
 
60
63
  if server and parsed["dependencies"]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: polyapi-python
3
- Version: 0.3.1.dev17
3
+ Version: 0.3.2.dev1
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
@@ -29,7 +29,7 @@ Requires-Python: >=3.10
29
29
  Description-Content-Type: text/markdown
30
30
  License-File: LICENSE
31
31
  Requires-Dist: requests==2.31.0
32
- Requires-Dist: typing_extensions==4.10.0
32
+ Requires-Dist: typing_extensions>=4.10.0
33
33
  Requires-Dist: jsonschema-gentypes==2.6.0
34
34
  Requires-Dist: pydantic==2.6.4
35
35
  Requires-Dist: stdlib_list==0.10.0
@@ -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=e-8nOzq6SXD7_YPVBlW82_9wVxDCc8XD9ioMv_QvnH0,1877
4
4
  polyapi/auth.py,sha256=zrIGatjba5GwUTNjKj1GHQWTEDP9B-HrSzCKbLFoqvc,5336
5
- polyapi/cli.py,sha256=nhqJ437ICZWKcP31hcn6YdzrhSFDXEDn1tTJ5TnubEM,8307
5
+ polyapi/cli.py,sha256=w0SOiRHR7gJRoEwkfyGC1sdBT76sgx8MUcF8_GnGuJU,8324
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,7 +10,7 @@ polyapi/deployables.py,sha256=74Bs2kDhyoQhezc0I1V4pi7l-SYg7_zpYrXYPjAePMw,11954
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=mRXCdxleID4hQhrRzVNZOm8MFmKIfo8Ru7bZcBPnsOY,4186
13
+ polyapi/function_cli.py,sha256=s4ds6-5ePbaDxZSvQ8BwkM7TwFEQJn-54UzoxZxBtuc,4255
14
14
  polyapi/generate.py,sha256=SIRfN7RF3Z7eQ8kSNg4H70LeT7Hmh-Mn5maibvM7kAM,7969
15
15
  polyapi/parser.py,sha256=rtI4-SR6v7mqG2vF_P6qgC-qn-M_QG-e95PJUZv92cc,20248
16
16
  polyapi/prepare.py,sha256=Q8CWV4kmZ2dbXYVsud34AgJkj5ymcQ_IcYhLuikc9yk,6659
@@ -23,8 +23,8 @@ polyapi/typedefs.py,sha256=U0i30Y9CgoUBWeMUbpM28S8eVOEU9NfdckK1VAop3A0,1994
23
23
  polyapi/utils.py,sha256=jzCh-ivKMcgp5fIXynhYmP9UyzsISr9bGGEzdPP8n3w,7644
24
24
  polyapi/variables.py,sha256=d36-trnfTL_8m2NkorMiImb4O3UrJbiFV38CHxV5i0A,4200
25
25
  polyapi/webhook.py,sha256=LWv28c2MLz_OKBI_Nn7WR4C-gs1SWgbdXsoxIIf-9UI,4886
26
- polyapi_python-0.3.1.dev17.dist-info/LICENSE,sha256=Hi0kDr56Dsy0uYIwNt4r9G7tI8x8miXRTlyvbeplCP8,1068
27
- polyapi_python-0.3.1.dev17.dist-info/METADATA,sha256=Ia8oKj5-tZmW59KzZwcouvkw-3vG-Ne3fgXL6YM7Oq8,5327
28
- polyapi_python-0.3.1.dev17.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
29
- polyapi_python-0.3.1.dev17.dist-info/top_level.txt,sha256=CEFllOnzowci_50RYJac-M54KD2IdAptFsayVVF_f04,8
30
- polyapi_python-0.3.1.dev17.dist-info/RECORD,,
26
+ polyapi_python-0.3.2.dev1.dist-info/LICENSE,sha256=Hi0kDr56Dsy0uYIwNt4r9G7tI8x8miXRTlyvbeplCP8,1068
27
+ polyapi_python-0.3.2.dev1.dist-info/METADATA,sha256=-1ed_fSmkmHnDkBP99vXwDBnhQPZKTiBavXQvKgSWRE,5326
28
+ polyapi_python-0.3.2.dev1.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
29
+ polyapi_python-0.3.2.dev1.dist-info/top_level.txt,sha256=CEFllOnzowci_50RYJac-M54KD2IdAptFsayVVF_f04,8
30
+ polyapi_python-0.3.2.dev1.dist-info/RECORD,,