Title: EN #4845 fix func arg schema bug with typed dicts by eneumann · Pull Request #75 · polyapi/polyapi-python · GitHub
Open Graph Title: EN #4845 fix func arg schema bug with typed dicts by eneumann · Pull Request #75 · polyapi/polyapi-python
X Title: EN #4845 fix func arg schema bug with typed dicts by eneumann · Pull Request #75 · polyapi/polyapi-python
Description: @eupharis this should fix it in the client until we can properly fix it in the specs API. Example specs api resp: [ { "id": "8e674884-787b-4a5a-bd5a-b48c15c87d8c", "type": "customFunction", "context": "sftp", "name": "connect", "contextName": "sftp.connect", "description": "Establish a secure SFTP connection using provided host, port, username, password, or private key. Supports optional configurations like remote path, upload on save, and keep-alive interval. Returns connection arguments for validation or further use.", "requirements": [], "serverSideAsync": false, "function": { "arguments": [ { "name": "conn_args", "description": "", "required": true, "type": { "kind": "object", "schema": "{\"properties\": {\"host\": {\"title\": \"Host\", \"type\": \"string\"}, \"name\": {\"title\": \"Name\", \"type\": \"string\"}, \"open_ssh\": {\"title\": \"Open Ssh\", \"type\": \"boolean\"}, \"port\": {\"title\": \"Port\", \"type\": \"integer\"}, \"protocol\": {\"title\": \"Protocol\", \"type\": \"string\"}, \"remote_path\": {\"title\": \"Remote Path\", \"type\": \"string\"}, \"upload_on_save\": {\"title\": \"Upload On Save\", \"type\": \"boolean\"}, \"use_temp_file\": {\"title\": \"Use Temp File\", \"type\": \"boolean\"}, \"username\": {\"title\": \"Username\", \"type\": \"string\"}, \"password\": {\"title\": \"Password\", \"type\": \"string\"}, \"private_key\": {\"title\": \"Private Key\", \"type\": \"string\"}, \"keep_alive_interval\": {\"title\": \"Keep Alive Interval\", \"type\": \"integer\"}}, \"required\": [\"host\", \"name\", \"open_ssh\", \"port\", \"protocol\", \"remote_path\", \"upload_on_save\", \"use_temp_file\", \"username\", \"password\", \"private_key\", \"keep_alive_interval\"], \"title\": \"ConnectArgs\", \"type\": \"object\"}" } } ], "returnType": { "kind": "plain", "value": "ConnectArgs" }, "synchronous": true }, "code": "import logging\n# import paramiko\nfrom typing_extensions import TypedDict, Any, Dict\n# from polyapi.typedefs import PolyClientFunction\n\nlogger = logging.getLogger('poly')\n\n# polyConfig: PolyClientFunction = {\n# \"name\": \"connect\",\n# \"context\": \"sftp\",\n# }\n\n\nclass ConnectArgs(TypedDict):\n host: str\n name: str\n open_ssh: bool\n port: int\n protocol: str\n remote_path: str\n upload_on_save: bool\n use_temp_file: bool\n username: str\n password: str\n private_key: str\n keep_alive_interval: int\n\n\n# python -m polyapi function add connect_sftp src/OOB/client_functions/sftp_connect.py --client --context sftp\ndef connect(conn_args: ConnectArgs) -> ConnectArgs:\n return conn_args\n\n # client = paramiko.SSHClient()\n # client.set_missing_host_key_policy(paramiko.AutoAddPolicy())\n\n # try:\n # client.connect(\n # hostname=args[\"host\"],\n # port=args.get(\"port\", 22),\n # username=args[\"username\"],\n # password=args.get(\"password\"),\n # key_filename=args.get(\"privateKey\")\n # )\n # return client.open_sftp()\n # except Exception as error:\n # raise RuntimeError(f\"[SFTP] Connection failed: {error}\")\n", "sourceCode": "import logging\n# import paramiko\nfrom typing_extensions import TypedDict, Any, Dict\n# from polyapi.typedefs import PolyClientFunction\n\nlogger = logging.getLogger('poly')\n\n# polyConfig: PolyClientFunction = {\n# \"name\": \"connect\",\n# \"context\": \"sftp\",\n# }\n\n\nclass ConnectArgs(TypedDict):\n host: str\n name: str\n open_ssh: bool\n port: int\n protocol: str\n remote_path: str\n upload_on_save: bool\n use_temp_file: bool\n username: str\n password: str\n private_key: str\n keep_alive_interval: int\n\n\n# python -m polyapi function add connect_sftp src/OOB/client_functions/sftp_connect.py --client --context sftp\ndef connect(conn_args: ConnectArgs) -> ConnectArgs:\n return conn_args\n\n # client = paramiko.SSHClient()\n # client.set_missing_host_key_policy(paramiko.AutoAddPolicy())\n\n # try:\n # client.connect(\n # hostname=args[\"host\"],\n # port=args.get(\"port\", 22),\n # username=args[\"username\"],\n # password=args.get(\"password\"),\n # key_filename=args.get(\"privateKey\")\n # )\n # return client.open_sftp()\n # except Exception as error:\n # raise RuntimeError(f\"[SFTP] Connection failed: {error}\")\n", "language": "python", "state": "ALPHA", "visibilityMetadata": { "visibility": "ENVIRONMENT" } } ]
Open Graph Description: @eupharis this should fix it in the client until we can properly fix it in the specs API. Example specs api resp: [ { "id": "8e674884-787b-4a5a-bd5a-b48c15c87d8c", ...
X Description: @eupharis this should fix it in the client until we can properly fix it in the specs API. Example specs api resp: [ { "id": "8e674884-787b-4a5a-bd5a-b48c15c87...
Opengraph URL: https://github.com/polyapi/polyapi-python/pull/75
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:edcbb469-f8f5-d88f-fbff-17a482194b2c |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | B3D4:3EEA8F:A74FC8:D54B11:69742846 |
| html-safe-nonce | cccd6c1d303ebb3af67eb17e9e20eb2b0c2ef92a58fecba5aa9c3c0fa428eae8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCM0Q0OjNFRUE4RjpBNzRGQzg6RDU0QjExOjY5NzQyODQ2IiwidmlzaXRvcl9pZCI6IjU3MjE3Njc5MzYxNTAyMTg4MjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 58a5e533ac271977d6b8e6d381aef4165a051a4f29ea18aea267397ddd6771dd |
| hovercard-subject-tag | pull_request:2672360694 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/polyapi/polyapi-python/pull/75/checks |
| twitter:image | https://avatars.githubusercontent.com/u/7992094?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/7992094?s=400&v=4 |
| og:image:alt | @eupharis this should fix it in the client until we can properly fix it in the specs API. Example specs api resp: [ { "id": "8e674884-787b-4a5a-bd5a-b48c15c87d8c", ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | f0c542b740cf8c6c6deff23a0eeffd05a0e8bd35565559ca5ec1535bcbb67e5c |
| turbo-cache-control | no-preview |
| go-import | github.com/polyapi/polyapi-python git https://github.com/polyapi/polyapi-python.git |
| octolytics-dimension-user_id | 124421413 |
| octolytics-dimension-user_login | polyapi |
| octolytics-dimension-repository_id | 720191438 |
| octolytics-dimension-repository_nwo | polyapi/polyapi-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 720191438 |
| octolytics-dimension-repository_network_root_nwo | polyapi/polyapi-python |
| turbo-body-classes | logged-out env-production page-responsive full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4e27a77ef0bf22cd9328967ddc1e1c3dfa6ffe51 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width