polyapi-python 0.2.3.dev6__py3-none-any.whl → 0.2.3.dev7__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
@@ -23,7 +23,8 @@ def execute_from_cli():
23
23
  )
24
24
  parser.add_argument("--context", required=False, default="")
25
25
  parser.add_argument("--description", required=False, default="")
26
- parser.add_argument("--server", action="store_true", help="Pass --server when adding function to add a server function. By default, new functions are client.")
26
+ parser.add_argument("--client", action="store_true", help="Pass --client when adding function to add a client function.")
27
+ parser.add_argument("--server", action="store_true", help="Pass --server when adding function to add a server function.")
27
28
  parser.add_argument("--logs", action="store_true", help="Pass --logs when adding function if you want to store and see the function logs.")
28
29
  parser.add_argument("command", choices=CLI_COMMANDS)
29
30
  parser.add_argument("subcommands", nargs="*")
@@ -47,4 +48,4 @@ def execute_from_cli():
47
48
  print("Clearing the generated library...")
48
49
  clear()
49
50
  elif command == "function":
50
- function_add_or_update(args.context, args.description, args.server, args.logs, args.subcommands)
51
+ function_add_or_update(args.context, args.description, args.client, args.server, args.logs, args.subcommands)
polyapi/function_cli.py CHANGED
@@ -175,7 +175,7 @@ def _func_already_exists(context: str, function_name: str) -> bool:
175
175
 
176
176
 
177
177
  def function_add_or_update(
178
- context: str, description: str, server: bool, logs_enabled: bool, subcommands: List
178
+ context: str, description: str, client: bool, server: bool, logs_enabled: bool, subcommands: List
179
179
  ):
180
180
  parser = argparse.ArgumentParser()
181
181
  parser.add_argument("subcommand", choices=["add"])
@@ -223,8 +223,12 @@ def function_add_or_update(
223
223
  assert api_key
224
224
  if server:
225
225
  url = f"{api_url}/functions/server"
226
- else:
226
+ elif client:
227
227
  url = f"{api_url}/functions/client"
228
+ else:
229
+ print_red("ERROR")
230
+ print("Please specify type of function with --client or --server")
231
+ sys.exit(1)
228
232
 
229
233
  headers = get_auth_headers(api_key)
230
234
  resp = requests.post(url, headers=headers, json=data)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: polyapi-python
3
- Version: 0.2.3.dev6
3
+ Version: 0.2.3.dev7
4
4
  Summary: The PolyAPI Python Client
5
5
  Author-email: Dan Fellin <dan@polyapi.io>
6
6
  License: MIT License
@@ -2,14 +2,14 @@ polyapi/__init__.py,sha256=VRAaN5WZPDmj7AnprtJ3szHXWlqWInKXBfEmfpyXTK8,434
2
2
  polyapi/__main__.py,sha256=V4zhAh_YGxno5f_KSrlkELxcuDh9bR3WSd0n-2r-qQQ,93
3
3
  polyapi/api.py,sha256=Pq_OT8egmtlzMjovN5GGZXWnF5oWMkrgR0rmrzJ6ifM,1861
4
4
  polyapi/auth.py,sha256=p2KSLt6q52t9gnqPmgXTOQ2_lmdFilZkIoGmQrRTPLQ,5330
5
- polyapi/cli.py,sha256=wMv4RpNDEz2qIQ5NjlRTop-ImfeeqCSkx22ZIrzwA50,2086
5
+ polyapi/cli.py,sha256=xlKH4cSmSo7eXbyXCLWyL4rXM1QFsltC_MxoxMPgt6I,2187
6
6
  polyapi/client.py,sha256=JIHZaun5aebPA_Fv8-wTsOys_Q5RN_tZp-lZG52Ureg,752
7
7
  polyapi/config.py,sha256=S8TU10upy5OW1_vX-CqQTJD-ZOB6329aMjiUCmukfUI,2292
8
8
  polyapi/constants.py,sha256=NGjso6K5rGnE8TGdrXmdEfvvr-HI3DTVGwOYiWO68LM,511
9
9
  polyapi/error_handler.py,sha256=vl6ZBtsHmC3eu13IMpmZEXBTDJbrPrzmViBCCrEspd4,1621
10
10
  polyapi/exceptions.py,sha256=Zh7i7eCUhDuXEdUYjatkLFTeZkrx1BJ1P5ePgbJ9eIY,89
11
11
  polyapi/execute.py,sha256=06XWTxGJqtsDiLY10RjRebIMFRfhtAIMmBRbuWu3e8A,1873
12
- polyapi/function_cli.py,sha256=DPaxCYFausf01solU4pHYVp4ePO_ecg10jP-XW_zCmc,8077
12
+ polyapi/function_cli.py,sha256=KkFvnGSSCwYPMV4cX4yMQmXKyLtgYR64Fz5BfjGv3qY,8230
13
13
  polyapi/generate.py,sha256=O1lb7rLsce7tItIrMx1EbWzRlAKKOp-7upNM80cMmMw,8499
14
14
  polyapi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  polyapi/schema.py,sha256=1a7nIO867Xy3bagmPUNdYMxtS5OoCAv8oKIbYgj55dk,2957
@@ -18,8 +18,8 @@ polyapi/typedefs.py,sha256=a5WfHaAvjeql3y1iA3_SkpUztTbKvS5bPqkVxkCvr9E,1459
18
18
  polyapi/utils.py,sha256=wZQrwSOst5wyoYYLoMk1DnAEbVsJ0-2YkmmDQ9gI3FY,5399
19
19
  polyapi/variables.py,sha256=d36-trnfTL_8m2NkorMiImb4O3UrJbiFV38CHxV5i0A,4200
20
20
  polyapi/webhook.py,sha256=A89eNnYcVpVe9doJPDLfscIhF-C7Q2AI3vu-SzGxMBg,2923
21
- polyapi_python-0.2.3.dev6.dist-info/LICENSE,sha256=Hi0kDr56Dsy0uYIwNt4r9G7tI8x8miXRTlyvbeplCP8,1068
22
- polyapi_python-0.2.3.dev6.dist-info/METADATA,sha256=6sys65C7Lq9DT1EVLph-fVGdmjBOvm6FzmXEkvfzJqY,4823
23
- polyapi_python-0.2.3.dev6.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
24
- polyapi_python-0.2.3.dev6.dist-info/top_level.txt,sha256=CEFllOnzowci_50RYJac-M54KD2IdAptFsayVVF_f04,8
25
- polyapi_python-0.2.3.dev6.dist-info/RECORD,,
21
+ polyapi_python-0.2.3.dev7.dist-info/LICENSE,sha256=Hi0kDr56Dsy0uYIwNt4r9G7tI8x8miXRTlyvbeplCP8,1068
22
+ polyapi_python-0.2.3.dev7.dist-info/METADATA,sha256=455mfifUYBMPumjmx-2-pg1NGiw50PQHUbtOAVyWLJw,4823
23
+ polyapi_python-0.2.3.dev7.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
24
+ polyapi_python-0.2.3.dev7.dist-info/top_level.txt,sha256=CEFllOnzowci_50RYJac-M54KD2IdAptFsayVVF_f04,8
25
+ polyapi_python-0.2.3.dev7.dist-info/RECORD,,