- Moved mappings into Sb1 impl
- Moved Actual types to @common
- Moved createDirIfMissing to respective functions
- Refactored main into multiple functions
- Moved create db into Sb1impl and close
- Log requests on info
- Created common workspace
- Create Sparebank1Api workspace
- Moved logger to common
- Moved SB1 types to types.ts
- Logger will avoid duplicating first line when capturing console.logs
- Updated imports and added type keyword
- Added nonUniqueId type
- By defining multiple account keys in the .env, will fetch from all and upload to correct account
- If transaction id is 0, will not be marked as cleared
- Added accountKey to Transaction interface
- 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
- 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
- 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
- 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
- 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
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>
- 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>
- 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
- 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