nuxt4, and some changes on packages

This commit is contained in:
2025-08-19 21:38:30 +03:30
parent 61fee6c3da
commit 5b6f1a1cdf
900 changed files with 11139 additions and 15161 deletions
@@ -41,8 +41,11 @@ 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 &&
@@ -70,7 +73,7 @@ class FunctionsClient {
body = JSON.stringify(functionArgs);
}
}
const response = yield this.fetch(`${this.url}/${functionName}`, {
const response = yield this.fetch(url.toString(), {
method: method || 'POST',
// headers priority is (high to low):
// 1. invoke-level headers
@@ -106,10 +109,16 @@ class FunctionsClient {
// default to text
data = yield response.text();
}
return { data, error: null };
return { data, error: null, response };
}
catch (error) {
return { data: null, error };
return {
data: null,
error,
response: error instanceof types_1.FunctionsHttpError || error instanceof types_1.FunctionsRelayError
? error.context
: undefined,
};
}
});
}