From f1da4473a93ac5b4e6a5ea4788af951bcb681218 Mon Sep 17 00:00:00 2001 From: Sudipta Kumar Date: Sat, 2 Nov 2024 00:20:00 +0600 Subject: [PATCH 1/2] # Feature (3007): Update python -m polyapi function add --logs options - if --logs added, then value must enabled or disabled - If Nothing passed the value is default disabled --- polyapi/cli.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/polyapi/cli.py b/polyapi/cli.py index 66dd234..f39a272 100644 --- a/polyapi/cli.py +++ b/polyapi/cli.py @@ -26,7 +26,7 @@ def execute_from_cli() -> None: parser.add_argument("--description", required=False, default="") parser.add_argument("--client", action="store_true", help="Pass --client when adding function to add a client function.") parser.add_argument("--server", action="store_true", help="Pass --server when adding function to add a server function.") - parser.add_argument("--logs", action="store_true", help="Pass --logs when adding function if you want to store and see the function logs.") + parser.add_argument("--logs", choices=["enabled", "disabled"], default="disabled", help="Enable or disable logs for the function.") parser.add_argument("--skip-generate", action="store_true", help="Pass --skip-generate to skip generating the library after adding a function.") parser.add_argument("--execution-api-key", required=False, default="", help="API key for execution (for server functions only).") parser.add_argument("command", choices=CLI_COMMANDS) @@ -57,6 +57,7 @@ def execute_from_cli() -> None: print("Clearing the generated library...") clear() elif command == "function": + logs_enabled = args.logs == "enabled" if args.subcommands[0] == "execute": print(function_execute(args.context, args.subcommands)) else: @@ -65,7 +66,7 @@ def execute_from_cli() -> None: description=args.description, client=args.client, server=args.server, - logs_enabled=args.logs, + logs_enabled=logs_enabled, subcommands=args.subcommands, generate=not args.skip_generate, execution_api_key=args.execution_api_key From 5494c34c3706fde296074490d483a13f95e8e741 Mon Sep 17 00:00:00 2001 From: Sudipta Kumar Date: Mon, 4 Nov 2024 16:00:07 +0600 Subject: [PATCH 2/2] # Feature (3007): Update python -m polyapi function add --logs options - pyproject.toml version updated --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3969c19..6dfc79c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools>=61.2", "wheel"] [project] name = "polyapi-python" -version = "0.3.0" +version = "0.3.1.dev1" description = "The Python Client for PolyAPI, the IPaaS by Developers for Developers" authors = [{ name = "Dan Fellin", email = "dan@polyapi.io" }] dependencies = [