polyapi-python 0.3.1.dev15__py3-none-any.whl → 0.3.1.dev17__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/function_cli.py CHANGED
@@ -51,7 +51,7 @@ def function_add_or_update(
51
51
  "description": description or parsed["types"]["description"],
52
52
  "code": code,
53
53
  "language": "python",
54
- "returnType": return_type,
54
+ "returnType": get_jsonschema_type(return_type),
55
55
  "returnTypeSchema": parsed["types"]["returns"]["typeSchema"],
56
56
  "arguments": [{**p, "key": p["name"], "type": get_jsonschema_type(p["type"]) } for p in parsed["types"]["params"]],
57
57
  "logsEnabled": logs_enabled or parsed["config"].get("logs_enabled", False),
polyapi/sync.py CHANGED
@@ -50,14 +50,14 @@ def sync_function_and_get_id(deployable: SyncDeployment, code: str) -> str:
50
50
  headers = get_auth_headers(api_key)
51
51
  url = f'{deployable["instance"]}/functions/{deployable["type"].replace("-function", "")}'
52
52
  payload = {
53
+ **deployable["config"],
53
54
  "context": deployable["context"],
54
55
  "name": deployable["name"],
55
56
  "description": deployable["description"],
56
57
  "code": code,
57
58
  "language": "python",
58
- "returnType": deployable["types"]["returns"]["type"],
59
+ "returnType": get_jsonschema_type(deployable["types"]["returns"]["type"]),
59
60
  "returnTypeSchema": deployable["types"]["returns"]["typeSchema"],
60
- **deployable["config"],
61
61
  "arguments": [{**p, "key": p["name"], "type": get_jsonschema_type(p["type"]) } for p in deployable["types"]["params"]],
62
62
  }
63
63
  response = requests.post(url, headers=headers, json=payload)
@@ -84,7 +84,9 @@ def sync_deployable(deployable: SyncDeployment) -> Deployment:
84
84
  "fileRevision": deployable["fileRevision"],
85
85
  }
86
86
 
87
- def sync_deployables(dry_run: bool, instance: str = os.getenv('POLY_API_BASE_URL')):
87
+ def sync_deployables(dry_run: bool, instance: str | None = None):
88
+ if not instance:
89
+ _, instance = get_api_key_and_url()
88
90
  prepare_deployable_directory()
89
91
  git_revision = get_cache_deployments_revision()
90
92
  all_deployables = load_deployable_records()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: polyapi-python
3
- Version: 0.3.1.dev15
3
+ Version: 0.3.1.dev17
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
@@ -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=_mQCi5Eh08L7CWKklazI5UJzOhe1iZlS3pPRWqW5tuY,4165
13
+ polyapi/function_cli.py,sha256=mRXCdxleID4hQhrRzVNZOm8MFmKIfo8Ru7bZcBPnsOY,4186
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
@@ -18,13 +18,13 @@ polyapi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
18
  polyapi/rendered_spec.py,sha256=uaNzBhP4cX7iGfKwzZv0dxMagWzsGeDr0cQYx_AyIhQ,2153
19
19
  polyapi/schema.py,sha256=VVMHAT5yU47cRC7xF44BrmUSemlk5oIKSxH2HTVPaQ8,3169
20
20
  polyapi/server.py,sha256=NzQCZFSAJK7XiRw1kiU_i9uMvgYK7i8qh7UX2xjytJU,1908
21
- polyapi/sync.py,sha256=T6TkGz8FzHF8C-AuAmBgycq3as2iqjxHT22s-xNgQxM,6409
21
+ polyapi/sync.py,sha256=PGdC0feBBjEVrF3d9EluW_OAxbWuzSrfh84czma8kWg,6476
22
22
  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.dev15.dist-info/LICENSE,sha256=Hi0kDr56Dsy0uYIwNt4r9G7tI8x8miXRTlyvbeplCP8,1068
27
- polyapi_python-0.3.1.dev15.dist-info/METADATA,sha256=kAsXy_eQ4MiA2gkLN3UzoRI0wrI5_15mCMXjdgnvO14,5327
28
- polyapi_python-0.3.1.dev15.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
29
- polyapi_python-0.3.1.dev15.dist-info/top_level.txt,sha256=CEFllOnzowci_50RYJac-M54KD2IdAptFsayVVF_f04,8
30
- polyapi_python-0.3.1.dev15.dist-info/RECORD,,
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,,