@actual-app/sync-server 25.10.0-nightly.20250911 → 25.10.0-nightly.20250912

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.
@@ -18,73 +18,3 @@ export const banks = await loadBanks();
18
18
  export function BankFactory(institutionId) {
19
19
  return (banks.find(b => b.institutionIds.includes(institutionId)) || IntegrationBank);
20
20
  }
21
- export const BANKS_WITH_LIMITED_HISTORY = [
22
- 'ABANCA_CAGLESMM',
23
- 'AIRBANK_AIRACZPP',
24
- 'BANCA_AIDEXA_AIDXITMM',
25
- 'BANCA_PATRIMONI_SENVITT1',
26
- 'BANCA_SELLA_SELBIT2B',
27
- 'BANK_MILLENNIUM_BIGBPLPW',
28
- 'BANKINTER_BKBKESMM',
29
- 'BBVA_BBVAESMM',
30
- 'BELFIUS_GKCCBEBB',
31
- 'BNP_BE_GEBABEBB',
32
- 'BNP_PL_PPABPLPK',
33
- 'BOURSORAMA_BOUSFRPP',
34
- 'BOV_VALLMTMT',
35
- 'BRED_BREDFRPPXXX',
36
- 'CAIXA_GERAL_DEPOSITOS_CGDIPTPL',
37
- 'CAIXABANK_CAIXESBB',
38
- 'CARTALIS_CIMTITR1',
39
- 'CESKA_SPORITELNA_LONG_GIBACZPX',
40
- 'COOP_EKRDEE22',
41
- 'DKB_BYLADEM1',
42
- 'DNB_DNBANOKK',
43
- 'DOTS_HYEEIT22',
44
- 'FINECO_FEBIITM2XXX',
45
- 'FINECO_UK_FEBIITM2XXX',
46
- 'FORTUNEO_FTNOFRP1XXX',
47
- 'GLS_GEMEINSCHAFTSBANK_GENODEM1GLS',
48
- 'HYPE_BUSINESS_HYEEIT22',
49
- 'HYPE_HYEEIT22',
50
- 'ILLIMITY_ITTPIT2M',
51
- 'INDUSTRA_MULTLV2X',
52
- 'INDUSTRIEL_CMCIFRPAXXX',
53
- 'ING_PL_INGBPLPW',
54
- 'JEKYLL_JEYKLL002',
55
- 'KBC_KREDBEBB',
56
- 'KBC_BRUSSELS_KREDBEBB',
57
- 'LABORALKUTXA_CLPEES2M',
58
- 'LANSFORSAKRINGAR_ELLFSESS',
59
- 'LCL_CRLYFRPP',
60
- 'LHV_LHVBEE22',
61
- 'LUMINOR_AGBLLT2X',
62
- 'LUMINOR_NDEAEE2X',
63
- 'LUMINOR_NDEALT2X',
64
- 'LUMINOR_NDEALV2X',
65
- 'LUMINOR_RIKOEE22',
66
- 'LUMINOR_RIKOLV2X',
67
- 'MBANK_RETAIL_BREXPLPW',
68
- 'MEDICINOSBANK_MDBALT22XXX',
69
- 'NORDEA_NDEADKKK',
70
- 'N26_NTSBDEB1',
71
- 'OPYN_BITAITRRB2B',
72
- 'PAYTIPPER_PAYTITM1',
73
- 'QONTO_QNTOFRP1',
74
- 'REVOLUT_REVOLT21',
75
- 'SANTANDER_BSCHESMM',
76
- 'SANTANDER_DE_SCFBDE33',
77
- 'SEB_CBVILT2X',
78
- 'SEB_EEUHEE2X',
79
- 'SEB_UNLALV2X',
80
- 'SELLA_PERSONAL_CREDIT_SELBIT22',
81
- 'BANCOACTIVOBANK_ACTVPTPL',
82
- 'SMARTIKA_SELBIT22',
83
- 'SWEDBANK_HABAEE2X',
84
- 'SWEDBANK_HABALT22',
85
- 'SWEDBANK_HABALV22',
86
- 'SWEDBANK_SWEDSESS',
87
- 'TIM_HYEEIT22',
88
- 'TOT_SELBIT2B',
89
- 'VUB_BANKA_SUBASKBX',
90
- ];
@@ -2,7 +2,7 @@ import jwt from 'jws';
2
2
  import * as nordigenNode from 'nordigen-node';
3
3
  import { v4 as uuidv4 } from 'uuid';
4
4
  import { SecretName, secretsService } from '../../services/secrets-service.js';
5
- import { BankFactory, BANKS_WITH_LIMITED_HISTORY } from '../bank-factory.js';
5
+ import { BankFactory } from '../bank-factory.js';
6
6
  import { AccessDeniedError, AccountNotLinkedToRequisition, GenericGoCardlessError, InvalidInputDataError, InvalidGoCardlessTokenError, NotFoundError, RateLimitError, ResourceSuspended, RequisitionNotLinked, ServiceError, UnknownError, } from '../errors.js';
7
7
  const GoCardlessClient = nordigenNode.default;
8
8
  const clients = new Map();
@@ -239,11 +239,7 @@ export const goCardlessService = {
239
239
  institutionId,
240
240
  referenceId: uuidv4(),
241
241
  accessValidForDays: institution.max_access_valid_for_days,
242
- maxHistoricalDays: BANKS_WITH_LIMITED_HISTORY.includes(institutionId)
243
- ? Number(institution.transaction_total_days) >= 90
244
- ? '89'
245
- : institution.transaction_total_days
246
- : institution.transaction_total_days,
242
+ maxHistoricalDays: institution.transaction_total_days,
247
243
  userLanguage: 'en',
248
244
  ssn: null,
249
245
  redirectImmediate: false,
@@ -256,10 +252,12 @@ export const goCardlessService = {
256
252
  try {
257
253
  console.log('Failed to link using:');
258
254
  console.log(body);
259
- console.log('Falling back to accessValidForDays = 90');
255
+ console.log('Falling back to accessValidForDays = 90 ' +
256
+ 'and maxHistoricalDays = 89');
260
257
  response = await client.initSession({
261
258
  ...body,
262
259
  accessValidForDays: 90,
260
+ maxHistoricalDays: 89,
263
261
  });
264
262
  }
265
263
  catch (error) {
@@ -337,16 +335,19 @@ export const goCardlessService = {
337
335
  catch (error) {
338
336
  handleGoCardlessError(error);
339
337
  }
338
+ // Handle cases where either response is null/undefined
339
+ const accountDetails = detailedAccount?.account || {};
340
+ const metadata = metadataAccount || {};
340
341
  // Some banks provide additional data in both fields, but can do yucky things like have an empty
341
342
  // string in one place but not the other. We'll fix this by merging the two objects, but preferring truthy values
342
343
  // from the metadata object over the details object.
343
344
  const mergedAccount = {};
344
345
  const uniqueKeys = new Set([
345
- ...Object.keys(detailedAccount.account),
346
- ...Object.keys(metadataAccount),
346
+ ...Object.keys(accountDetails),
347
+ ...Object.keys(metadata),
347
348
  ]);
348
349
  for (const key of uniqueKeys) {
349
- mergedAccount[key] = metadataAccount[key] || detailedAccount.account[key];
350
+ mergedAccount[key] = metadata[key] || accountDetails[key];
350
351
  }
351
352
  return mergedAccount;
352
353
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@actual-app/sync-server",
3
- "version": "25.10.0-nightly.20250911",
3
+ "version": "25.10.0-nightly.20250912",
4
4
  "license": "MIT",
5
5
  "description": "actual syncing server",
6
6
  "bin": {
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@actual-app/crdt": "2.1.0",
31
- "@actual-app/web": "25.10.0-nightly.20250911",
31
+ "@actual-app/web": "25.10.0-nightly.20250912",
32
32
  "bcrypt": "^6.0.0",
33
33
  "better-sqlite3": "^12.2.0",
34
34
  "convict": "^6.2.4",