🌟 Refactor

- 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
This commit is contained in:
2025-02-13 21:07:30 +01:00
parent 06cc89f762
commit 4367c24fb0
13 changed files with 178 additions and 118 deletions

View File

@ -1,8 +1,9 @@
import type { Interval, TransactionResponse } from "./types"
import type { TransactionResponse } from "./types"
import * as querystring from "node:querystring"
import { toISODateString } from "@common/date"
import logger from "@common/logger"
import { baseUrl } from "./common"
import type { Interval } from "@common/types.ts"
export async function list(
accessToken: string,
@ -18,7 +19,7 @@ export async function list(
})
const url = `${baseUrl}/personal/banking/transactions?${queryString}`
logger.debug(`Sending GET request to '${url}'`)
logger.info(`GET '${url}'`)
const response = await fetch(url, {
headers: {
Authorization: `Bearer ${accessToken}`,