feat(core): switch to native fetch API for all HTTP requests

This commit is contained in:
2025-07-27 07:19:34 +00:00
parent fb30c6f4e3
commit c9fab7def2
8 changed files with 85 additions and 54 deletions

View File

@@ -114,14 +114,19 @@ export class BunqExport {
// For PDF statements, use the /content endpoint directly
const downloadUrl = `${this.bunqAccount.apiContext.getBaseUrl()}/v1/user/${this.bunqAccount.userId}/monetary-account/${this.monetaryAccount.id}/customer-statement/${this.id}/content`;
const response = await plugins.smartrequest.request(downloadUrl, {
const response = await fetch(downloadUrl, {
method: 'GET',
headers: {
'X-Bunq-Client-Authentication': this.bunqAccount.apiContext.getSession().getContext().sessionToken
}
});
return Buffer.from(response.body);
if (!response.ok) {
throw new Error(`Failed to download export: HTTP ${response.status}`);
}
const arrayBuffer = await response.arrayBuffer();
return Buffer.from(arrayBuffer);
}
/**