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>
This commit is contained in:
@ -1,26 +1,8 @@
|
||||
import type { Bank, OAuthTokenResponse, Transaction } from "@/bank/sparebank1.ts"
|
||||
|
||||
const tokenResponse: OAuthTokenResponse = {
|
||||
access_token: "my_access_token",
|
||||
token_type: "Bearer",
|
||||
expires_in: 3600,
|
||||
refresh_token: "my_refresh_token",
|
||||
refresh_token_expires_in: 3600,
|
||||
refresh_token_absolute_expires_in: 3600,
|
||||
}
|
||||
import type { Bank, Transaction } from "@/bank/sparebank1.ts"
|
||||
|
||||
export class BankStub implements Bank {
|
||||
async accessToken(): Promise<OAuthTokenResponse> {
|
||||
return tokenResponse
|
||||
}
|
||||
|
||||
async refreshToken(_unused: string): Promise<OAuthTokenResponse> {
|
||||
return tokenResponse
|
||||
}
|
||||
|
||||
async transactionsPastDay(
|
||||
_accountIds: ReadonlyArray<string> | string,
|
||||
_accessToken: string,
|
||||
): Promise<ReadonlyArray<Transaction>> {
|
||||
const someFields = {
|
||||
date: "2019-08-20",
|
||||
|
Reference in New Issue
Block a user