israeli-banks-actual-budget-importer 1.0.0-beta.2 → 1.0.0

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.
package/CHANGELOG.md CHANGED
@@ -1,9 +1,9 @@
1
- # [1.0.0-beta.2](https://github.com/tomerh2001/israeli-banks-actual-budget-importer/compare/v1.0.0-beta.1...v1.0.0-beta.2) (2025-04-09)
1
+ # 1.0.0 (2025-04-09)
2
2
 
3
3
 
4
- ### Features
4
+ ### Bug Fixes
5
5
 
6
- * add imported_id field for transaction importing to prevent duplicates ([bb302fb](https://github.com/tomerh2001/israeli-banks-actual-budget-importer/commit/bb302fbfc898644ae276863407e59fda2319edbd))
6
+ * **initial-commit:** restructure project files and update dependencies ([ad1abcf](https://github.com/tomerh2001/israeli-banks-actual-budget-importer/commit/ad1abcf4e405f2356342b684fff3773a92b3b4ce))
7
7
 
8
8
  # 1.0.0-beta.1 (2025-03-24)
9
9
 
package/README.md CHANGED
@@ -5,21 +5,17 @@
5
5
  [![CodeQL](../../actions/workflows/codeql.yml/badge.svg)](../../actions/workflows/codeql.yml)
6
6
  [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/tomerh2001/semantic-release-repo-template/badge)](https://securityscorecards.dev/viewer/?uri=github.com/tomerh2001/semantic-release-repo-template)
7
7
 
8
- This repository provides a simple script to import transactions from Israeli banks (via [israeli-bank-scrapers](https://github.com/eshaham/israeli-bank-scrapers)) into [Actual Budget](https://github.com/actualbudget/actual).
8
+ This project provides an importer from Israeli banks (via [israeli-bank-scrapers](https://github.com/eshaham/israeli-bank-scrapers)) into [Actual Budget](https://github.com/actualbudget/actual).
9
9
 
10
10
  ## Features
11
11
  1. Supports all of the institutions that the [israeli-bank-scrapers](https://github.com/eshaham/israeli-bank-scrapers) library covers (Bank Hapoalim, Cal, Leumi, Discount, etc.).
12
12
  1. Automatically **creates new Actual accounts** if none exist.
13
13
  2. **Prevents duplicate transactions** using Actual’s [`imported_id`](https://actualbudget.org/docs/api/reference/#transactions) logic.
14
14
  3. Configurable via a single JSON file specifying bank credentials, start dates, etc.
15
+ 4. Automatically reconcile account balances.
15
16
 
16
- ## Logging & Errors
17
- The script logs each step (connections, scraping, account creation, transaction import results). If any errors occur, they are printed to stderr.
18
-
19
- ## Common error scenarios
20
- - Wrong credentials (scraper fails).
21
- - Actual Budget server is not running or wrong credentials (password).
22
- - Conflicting or missing environment/config.
17
+ > [!NOTE]
18
+ > This importer is still WIP.
23
19
 
24
20
  ## Contributing
25
21
  Feel free to open pull requests and issues! Suggestions or improvements are welcome.
package/bun.lock CHANGED
@@ -155,7 +155,7 @@
155
155
 
156
156
  "@octokit/types": ["@octokit/types@13.10.0", "", { "dependencies": { "@octokit/openapi-types": "^24.2.0" } }, "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA=="],
157
157
 
158
- "@pkgr/core": ["@pkgr/core@0.2.2", "", {}, "sha512-25L86MyPvnlQoX2MTIV2OiUcb6vJ6aRbFa9pbwByn95INKD5mFH2smgjDhq+fwJoqAgvgbdJLj6Tz7V9X5CFAQ=="],
158
+ "@pkgr/core": ["@pkgr/core@0.2.1", "", {}, "sha512-VzgHzGblFmUeBmmrk55zPyrQIArQN4vujc9shWytaPdB3P7qhi0cpaiKIr7tlCmFv2lYUwnLospIqjL9ZSAhhg=="],
159
159
 
160
160
  "@pnpm/config.env-replace": ["@pnpm/config.env-replace@1.1.0", "", {}, "sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w=="],
161
161
 
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.0-beta.2",
2
+ "version": "1.0.0",
3
3
  "name": "israeli-banks-actual-budget-importer",
4
4
  "module": "index.ts",
5
5
  "type": "module",
package/src/index.ts CHANGED
@@ -5,8 +5,7 @@ import {type CompanyTypes} from 'israeli-bank-scrapers';
5
5
  import _ from 'lodash';
6
6
  import actual from '@actual-app/api';
7
7
  import Queue from 'p-queue';
8
- import {config} from '../config.ts';
9
- import type {ConfigBank} from './config.d.ts';
8
+ import {config, type ConfigBank} from '../config.ts';
10
9
  import {scrapeAndImportTransactions} from './utils.ts';
11
10
 
12
11
  const queue = new Queue({
package/src/utils.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  /* eslint-disable @typescript-eslint/naming-convention */
2
2
  /* eslint-disable @typescript-eslint/no-unsafe-assignment */
3
+
3
4
  /* eslint-disable import/extensions */
4
5
  /* eslint-disable n/file-extension-in-import */
5
-
6
6
  import {createScraper, type ScraperCredentials} from 'israeli-bank-scrapers';
7
7
  import _ from 'lodash';
8
8
  import moment from 'moment';
@@ -52,7 +52,6 @@ export async function scrapeAndImportTransactions({companyId, bank}: ScrapeTrans
52
52
  payee: _.find(payees, {name: x.description})?.id ?? (await actual.createPayee({name: x.description})),
53
53
  imported_payee: x.description,
54
54
  notes: x.status,
55
- imported_id: `${x.identifier}-${moment(x.date).format('YYYY-MM-DD HH:mm:ss')}`,
56
55
  }));
57
56
 
58
57
  const importResult = await actual.importTransactions(bank.actualAccountId, await Promise.all(mappedTransactions), {defaultCleared: true});
@@ -80,7 +79,6 @@ export async function scrapeAndImportTransactions({companyId, bank}: ScrapeTrans
80
79
  payee: null,
81
80
  imported_payee: 'Reconciliation',
82
81
  notes: `Reconciliation from ${currentBalance.toLocaleString()} to ${accountBalance.toLocaleString()}`,
83
- imported_id: `reconciliation-${moment().format('YYYY-MM-DD HH:mm:ss')}`,
84
82
  }]);
85
83
  if (_.isEmpty(reconciliationResult)) {
86
84
  console.error('Reconciliation errors', reconciliationResult.errors);