22 Commits

Author SHA1 Message Date
18a0fbfac8
Relative from and to date in config, changed default to 3 days
All checks were successful
Deploy application / deploy (push) Successful in 7s
2025-01-31 16:58:02 +01:00
752bdbceb4
Cleared status from API, docker script
All checks were successful
Deploy application / deploy (push) Successful in 6s
2025-01-27 21:30:56 +01:00
61f0153319
Fix typo...
All checks were successful
Deploy application / deploy (push) Successful in 6s
2025-01-26 19:38:08 +01:00
d618438b14
Fix DB_DIRECTORY env is empty in Docker compose
Some checks failed
Deploy application / deploy (push) Failing after 6s
2025-01-26 19:36:17 +01:00
9850017e3a
🐋 Docker volume for Sqlite
Some checks failed
Deploy application / deploy (push) Failing after 7s
- Moved database to subdir specified by env
- Default data dir /data
- Move loggers to cronJob onTick
- Added volume for data dir in Docker compose
- Create any missing dir specified by env
2025-01-26 19:29:43 +01:00
aaa85e99cb
🐋 Docker and Gitea Workflow
All checks were successful
Deploy application / deploy (push) Successful in 19s
- Moved tsx to dependencies as node TS support is 💩
- Renamed start-once to run-once
- TODOs
2025-01-26 17:41:44 +01:00
2e73baf98b
✏ README, fix start-once bug and refactor
- Added some configuration and running to README
- Refactored some code
- Fixed exception when stopping a start-once script
- Only allow running with pnpm
- Moved transactions into sparebank1Api.ts
- Formatted
2025-01-25 22:30:52 +01:00
4977e7ad6a
🔨 Run once, graceful shutdown, db filename in env
- Refactored toISODateString function
- Added Db filename to env
- Added getOrDefault function for fetching envs, replaced LOG_LEVEL with getOrDefault
- Added script to run job once then exit
- Catch SIGINT signal and do a graceful shutdown
2025-01-25 21:12:49 +01:00
b61903f5c8
🎉 Working prototype
- Added missing field payee_name to TransactionEntity type
- Date function to convert DayJs to DateString
- Temp disabled cronjob for testing
- Fixed mapping to ActualModel
- fetchToken db function returns DayJs object for date
- Fixed fetching tokens from db
- Logging
- Fixed fetch previous day transactions
- Fixed token refresh
- Fixed stub based on model changes
2025-01-25 18:01:47 +01:00
9a00592a7a
GitIgnore database 2025-01-23 21:06:42 +01:00
4a773e4b43
🔑 Store tokens in Sqllite, moved queries, other fixes
- Create cache dir if missing
- Moved Sqlite queries to queries.ts
- Updated dependencies
- Added pino-pretty to dev-dependencies
- Changed Sqlite to store tokens as separate rows
- Removed in-memory storage of tokens
- isValidToken function
- Throw Exception if refresh token is present but invalid
- Fixed fetch query in smn http file
2025-01-22 21:00:04 +01:00
Martin Berg Alstad
3bf354b4bf
SQLite
Moved DB queries to separate file
Moved Sparebank1 API call to separate file
Create database tokens table if it doesn't exist

Signed-off-by: Martin Berg Alstad <git@martials.no>
2024-12-26 14:08:09 +01:00
Martin Berg Alstad
8854a22b40
Added better-sqlite3 dep and created default db
Signed-off-by: Martin Berg Alstad <git@martials.no>
2024-12-26 12:49:54 +01:00
Martin Berg Alstad
6650e2cd2b
Removed
- accessToken and refreshToken methods from interface
- accessToken param from transactionsPastDay
- Unused env variables from config.ts

Added
- Initial Refresh token to env
- Dayjs library for working with dates

Implemented
- getAccessToken
- getRefreshToken
- fetchNewRefreshToken
- transactionsPastDay

Signed-off-by: Martin Berg Alstad <git@martials.no>
2024-12-25 21:06:42 +01:00
480c0356f9
Fixes
- Added Actual account ids and log level to .env.example.
- Fixed timestamp error by downloading the budget after init.
- Hardcoded date in test.
- Separate logging file for configurations.
- Organized test
- More logging in main
- Fixed wrong paths for some files
- Load a .env.test.local file when running tests

Signed-off-by: Martin Berg Alstad <git@martials.no>
2024-12-23 16:47:07 +01:00
Martin Berg Alstad
29b394baf4
Moved sparebank1.ts to bank dir
Signed-off-by: Martin Berg Alstad <git@martials.no>
2024-12-22 16:06:20 +01:00
Martin Berg Alstad
966c5f50b3
Fix broken lockfile
Fix @ module path
2024-12-22 13:14:55 +01:00
c43bff3e15 testing with jest 2024-12-16 21:25:36 +00:00
9ed0a19393
Changed:
- Env key to be more generic
- Cache directory to .cache
- Multiply bank amount by 100 to get correct conversion rate

Removed:
- Unused functions in Actual.ts

Added:
- Test for main functionality
- BankStub for testing
- Added imported_id to Actual Transaction to avoid duplicates
2024-12-01 20:48:42 +01:00
cc325b9f08
Added:
- Logging library
- Account Ids to .env
- Split logic in main function
2024-12-01 19:35:45 +01:00
01af64349e
Added:
- CronJob
- interface and simple impl for Actual
- interface and simple impl for Sparebank1
- Mappings between sparebank1 transactions and actual transactions
- Requires type keyword on type imports
2024-11-17 22:27:29 +01:00
90bcf94f14
Initial commit 2024-11-15 23:16:58 +01:00