@@ -64,7 +64,7 @@ export class GoCardLessApi {
64
64
undefined ,
65
65
{
66
66
refresh,
67
- }
67
+ } ,
68
68
) ;
69
69
70
70
await this . #kv. put ( this . #accessTokenCacheKey, response . access , {
@@ -94,7 +94,7 @@ export class GoCardLessApi {
94
94
{
95
95
secret_id : this . #secretId,
96
96
secret_key : this . #secretKey,
97
- }
97
+ } ,
98
98
) ;
99
99
100
100
await Promise . all ( [
@@ -110,26 +110,26 @@ export class GoCardLessApi {
110
110
}
111
111
112
112
async getAccountBalance (
113
- accountId : string
113
+ accountId : string ,
114
114
) : Promise <
115
115
GetAccountBalanceResponse [ "balances" ] [ 0 ] [ "balanceAmount" ] | undefined
116
116
> {
117
117
const token = await this . #getAccessToken( ) ;
118
118
119
119
const { balances } = await this . #get< GetAccountBalanceResponse > (
120
120
`/api/v2/accounts/${ accountId } /balances/` ,
121
- token
121
+ token ,
122
122
) ;
123
123
124
124
const foundAccount = balances ?. find (
125
- ( account ) => account . balanceType === "interimAvailable"
125
+ ( account ) => account . balanceType === "interimAvailable" ,
126
126
) ;
127
127
128
128
return foundAccount ?. balanceAmount ;
129
129
}
130
130
131
131
async getInstitutions (
132
- params : GetInstitutionsRequest
132
+ params : GetInstitutionsRequest ,
133
133
) : Promise < GetInstitutionsResponse > {
134
134
const { countryCode } = params ;
135
135
const cacheKey = `${ this . #institutionsCacheKey} _${ countryCode } ` ;
@@ -150,15 +150,15 @@ export class GoCardLessApi {
150
150
params : {
151
151
country : countryCode ,
152
152
} ,
153
- }
153
+ } ,
154
154
) ;
155
155
156
156
this . #kv?. put ( cacheKey , JSON . stringify ( response ) , {
157
157
expirationTtl : this . #oneHour,
158
158
} ) ;
159
159
160
160
return response . filter ( ( insitution ) =>
161
- insitution . countries . includes ( countryCode )
161
+ insitution . countries . includes ( countryCode ) ,
162
162
) ;
163
163
}
164
164
@@ -176,7 +176,7 @@ export class GoCardLessApi {
176
176
redirect,
177
177
institution_id : institutionId ,
178
178
agreement,
179
- }
179
+ } ,
180
180
) ;
181
181
}
182
182
@@ -198,7 +198,7 @@ export class GoCardLessApi {
198
198
access_scope : [ "balances" , "details" , "transactions" ] ,
199
199
access_valid_for_days : this . #accessValidForDays,
200
200
max_historical_days : maxHistoricalDays ,
201
- }
201
+ } ,
202
202
) ;
203
203
}
204
204
@@ -209,7 +209,7 @@ export class GoCardLessApi {
209
209
this . #get< GetAccountResponse > ( `/api/v2/accounts/${ id } /` , token ) ,
210
210
this . #get< GetAccountDetailsResponse > (
211
211
`/api/v2/accounts/${ id } /details/` ,
212
- token
212
+ token ,
213
213
) ,
214
214
] ) ;
215
215
@@ -235,10 +235,10 @@ export class GoCardLessApi {
235
235
return {
236
236
...accountDetails ,
237
237
institution : intitutions . find (
238
- ( institution ) => institution . id === accountDetails . institution_id
238
+ ( institution ) => institution . id === accountDetails . institution_id ,
239
239
) ,
240
240
} ;
241
- } )
241
+ } ) ,
242
242
) ;
243
243
}
244
244
@@ -259,7 +259,7 @@ export class GoCardLessApi {
259
259
representation : "date" ,
260
260
} ) ,
261
261
}
262
- : undefined
262
+ : undefined ,
263
263
) ;
264
264
265
265
return response ?. transactions ?. booked ;
@@ -276,7 +276,7 @@ export class GoCardLessApi {
276
276
277
277
return this . #get< GetRequisitionResponse > (
278
278
`/api/v2/requisitions/${ id } /` ,
279
- token
279
+ token ,
280
280
) ;
281
281
}
282
282
@@ -285,7 +285,7 @@ export class GoCardLessApi {
285
285
286
286
return this . #_delete< DeleteRequistionResponse > (
287
287
`/api/v2/requisitions/${ id } /` ,
288
- token
288
+ token ,
289
289
) ;
290
290
}
291
291
@@ -308,7 +308,7 @@ export class GoCardLessApi {
308
308
path : string ,
309
309
token ?: string ,
310
310
params ?: Record < string , string > ,
311
- config ?: XiorRequestConfig
311
+ config ?: XiorRequestConfig ,
312
312
) : Promise < TResponse > {
313
313
const api = await this . #getApi( token ) ;
314
314
@@ -321,7 +321,7 @@ export class GoCardLessApi {
321
321
path : string ,
322
322
token ?: string ,
323
323
body ?: unknown ,
324
- config ?: XiorRequestConfig
324
+ config ?: XiorRequestConfig ,
325
325
) : Promise < TResponse > {
326
326
const api = await this . #getApi( token ) ;
327
327
return api . post < TResponse > ( path , body , config ) . then ( ( { data } ) => data ) ;
@@ -331,7 +331,7 @@ export class GoCardLessApi {
331
331
path : string ,
332
332
token : string ,
333
333
params ?: Record < string , string > ,
334
- config ?: XiorRequestConfig
334
+ config ?: XiorRequestConfig ,
335
335
) : Promise < TResponse > {
336
336
const api = await this . #getApi( token ) ;
337
337
0 commit comments