This commit is contained in:
2025-07-26 21:54:04 +03:30
parent f720424180
commit 615dc6a033
682 changed files with 6709 additions and 15232 deletions
@@ -41,11 +41,8 @@ class FunctionsClient {
if (!region) {
region = this.region;
}
// Add region as query parameter using URL API
const url = new URL(`${this.url}/${functionName}`);
if (region && region !== 'any') {
_headers['x-region'] = region;
url.searchParams.set('forceFunctionRegion', region);
}
let body;
if (functionArgs &&
@@ -73,7 +70,7 @@ class FunctionsClient {
body = JSON.stringify(functionArgs);
}
}
const response = yield this.fetch(url.toString(), {
const response = yield this.fetch(`${this.url}/${functionName}`, {
method: method || 'POST',
// headers priority is (high to low):
// 1. invoke-level headers
@@ -109,16 +106,10 @@ class FunctionsClient {
// default to text
data = yield response.text();
}
return { data, error: null, response };
return { data, error: null };
}
catch (error) {
return {
data: null,
error,
response: error instanceof types_1.FunctionsHttpError || error instanceof types_1.FunctionsRelayError
? error.context
: undefined,
};
return { data: null, error };
}
});
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@supabase/functions-js",
"version": "2.4.5",
"version": "2.4.4",
"description": "JS Client library to interact with Supabase Functions.",
"main": "dist/main/index.js",
"module": "dist/module/index.js",