supabase_functions 0.4.7__tar.gz → 0.5.1__tar.gz
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.
- {supabase_functions-0.4.7 → supabase_functions-0.5.1}/PKG-INFO +1 -1
- {supabase_functions-0.4.7 → supabase_functions-0.5.1}/pyproject.toml +1 -1
- {supabase_functions-0.4.7 → supabase_functions-0.5.1}/supabase_functions/_async/functions_client.py +13 -9
- {supabase_functions-0.4.7 → supabase_functions-0.5.1}/supabase_functions/_sync/functions_client.py +13 -9
- {supabase_functions-0.4.7 → supabase_functions-0.5.1}/supabase_functions/utils.py +3 -1
- {supabase_functions-0.4.7 → supabase_functions-0.5.1}/LICENSE +0 -0
- {supabase_functions-0.4.7 → supabase_functions-0.5.1}/README.md +0 -0
- {supabase_functions-0.4.7 → supabase_functions-0.5.1}/supabase_functions/__init__.py +0 -0
- {supabase_functions-0.4.7 → supabase_functions-0.5.1}/supabase_functions/_async/__init__.py +0 -0
- {supabase_functions-0.4.7 → supabase_functions-0.5.1}/supabase_functions/_sync/__init__.py +0 -0
- {supabase_functions-0.4.7 → supabase_functions-0.5.1}/supabase_functions/errors.py +0 -0
{supabase_functions-0.4.7 → supabase_functions-0.5.1}/supabase_functions/_async/functions_client.py
RENAMED
|
@@ -7,7 +7,7 @@ from ..utils import AsyncClient, __version__
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class AsyncFunctionsClient:
|
|
10
|
-
def __init__(self, url: str, headers: Dict, verify: bool = True):
|
|
10
|
+
def __init__(self, url: str, headers: Dict, timeout: int, verify: bool = True):
|
|
11
11
|
self.url = url
|
|
12
12
|
self.headers = {
|
|
13
13
|
"User-Agent": f"supabase-py/functions-py v{__version__}",
|
|
@@ -17,6 +17,7 @@ class AsyncFunctionsClient:
|
|
|
17
17
|
base_url=self.url,
|
|
18
18
|
headers=self.headers,
|
|
19
19
|
verify=bool(verify),
|
|
20
|
+
timeout=timeout,
|
|
20
21
|
follow_redirects=True,
|
|
21
22
|
http2=True,
|
|
22
23
|
)
|
|
@@ -64,18 +65,21 @@ class AsyncFunctionsClient:
|
|
|
64
65
|
`responseType`: how the response should be parsed. The default is `json`
|
|
65
66
|
"""
|
|
66
67
|
headers = self.headers
|
|
68
|
+
body = None
|
|
69
|
+
response_type = "text/plain"
|
|
67
70
|
if invoke_options is not None:
|
|
68
71
|
headers.update(invoke_options.get("headers", {}))
|
|
72
|
+
response_type = invoke_options.get("responseType", "text/plain")
|
|
69
73
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
)
|
|
74
|
+
region = invoke_options.get("region")
|
|
75
|
+
if region and isinstance(region, str) and region != "any":
|
|
76
|
+
headers["x-region"] = region.lower().strip()
|
|
74
77
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
78
|
+
body = invoke_options.get("body")
|
|
79
|
+
if isinstance(body, str):
|
|
80
|
+
headers["Content-Type"] = "text/plain"
|
|
81
|
+
elif isinstance(body, dict):
|
|
82
|
+
headers["Content-Type"] = "application/json"
|
|
79
83
|
|
|
80
84
|
response = await self._request(
|
|
81
85
|
"POST", f"{self.url}/{function_name}", headers=headers, json=body
|
{supabase_functions-0.4.7 → supabase_functions-0.5.1}/supabase_functions/_sync/functions_client.py
RENAMED
|
@@ -7,7 +7,7 @@ from ..utils import SyncClient, __version__
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class SyncFunctionsClient:
|
|
10
|
-
def __init__(self, url: str, headers: Dict, verify: bool = True):
|
|
10
|
+
def __init__(self, url: str, headers: Dict, timeout: int, verify: bool = True):
|
|
11
11
|
self.url = url
|
|
12
12
|
self.headers = {
|
|
13
13
|
"User-Agent": f"supabase-py/functions-py v{__version__}",
|
|
@@ -17,6 +17,7 @@ class SyncFunctionsClient:
|
|
|
17
17
|
base_url=self.url,
|
|
18
18
|
headers=self.headers,
|
|
19
19
|
verify=bool(verify),
|
|
20
|
+
timeout=timeout,
|
|
20
21
|
follow_redirects=True,
|
|
21
22
|
http2=True,
|
|
22
23
|
)
|
|
@@ -64,18 +65,21 @@ class SyncFunctionsClient:
|
|
|
64
65
|
`responseType`: how the response should be parsed. The default is `json`
|
|
65
66
|
"""
|
|
66
67
|
headers = self.headers
|
|
68
|
+
body = None
|
|
69
|
+
response_type = "text/plain"
|
|
67
70
|
if invoke_options is not None:
|
|
68
71
|
headers.update(invoke_options.get("headers", {}))
|
|
72
|
+
response_type = invoke_options.get("responseType", "text/plain")
|
|
69
73
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
)
|
|
74
|
+
region = invoke_options.get("region")
|
|
75
|
+
if region and isinstance(region, str) and region != "any":
|
|
76
|
+
headers["x-region"] = region.lower().strip()
|
|
74
77
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
78
|
+
body = invoke_options.get("body")
|
|
79
|
+
if isinstance(body, str):
|
|
80
|
+
headers["Content-Type"] = "text/plain"
|
|
81
|
+
elif isinstance(body, dict):
|
|
82
|
+
headers["Content-Type"] = "application/json"
|
|
79
83
|
|
|
80
84
|
response = self._request(
|
|
81
85
|
"POST", f"{self.url}/{function_name}", headers=headers, json=body
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|