mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-10 07:55:21 +02:00
add institution endpoint for teller client
This commit is contained in:
parent
004a94f48e
commit
85250a755f
3 changed files with 26 additions and 0 deletions
|
@ -8,6 +8,7 @@ import type {
|
||||||
GetTransactionsResponse,
|
GetTransactionsResponse,
|
||||||
DeleteAccountResponse,
|
DeleteAccountResponse,
|
||||||
GetAccountDetailsResponse,
|
GetAccountDetailsResponse,
|
||||||
|
GetInstitutionsResponse,
|
||||||
} from './types'
|
} from './types'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import * as fs from 'fs'
|
import * as fs from 'fs'
|
||||||
|
@ -104,6 +105,16 @@ export class TellerApi {
|
||||||
return this.get<GetIdentityResponse>(`/identity`)
|
return this.get<GetIdentityResponse>(`/identity`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get list of supported institutions
|
||||||
|
*
|
||||||
|
* https://teller.io/docs/api/identity
|
||||||
|
*/
|
||||||
|
|
||||||
|
async getInstitutions(): Promise<GetInstitutionsResponse> {
|
||||||
|
return this.get<GetInstitutionsResponse>(`/institutions`)
|
||||||
|
}
|
||||||
|
|
||||||
private async getApi(): Promise<AxiosInstance> {
|
private async getApi(): Promise<AxiosInstance> {
|
||||||
const cert = fs.readFileSync('../../../certs/teller-certificate.pem', 'utf8')
|
const cert = fs.readFileSync('../../../certs/teller-certificate.pem', 'utf8')
|
||||||
const key = fs.readFileSync('../../../certs/teller-private-key.pem', 'utf8')
|
const key = fs.readFileSync('../../../certs/teller-private-key.pem', 'utf8')
|
||||||
|
|
|
@ -3,5 +3,6 @@ export * from './account-balance'
|
||||||
export * from './account-details'
|
export * from './account-details'
|
||||||
export * from './authentication'
|
export * from './authentication'
|
||||||
export * from './identity'
|
export * from './identity'
|
||||||
|
export * from './institutions'
|
||||||
export * from './transactions'
|
export * from './transactions'
|
||||||
export * from './webhooks'
|
export * from './webhooks'
|
||||||
|
|
14
libs/teller-api/src/types/institutions.ts
Normal file
14
libs/teller-api/src/types/institutions.ts
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
// https://api.teller.io/institutions
|
||||||
|
// Note: Teller says this is subject to change, specifically the `capabilities` field
|
||||||
|
|
||||||
|
export type Institution = {
|
||||||
|
id: string
|
||||||
|
name: string
|
||||||
|
capabilities: Capability[]
|
||||||
|
}
|
||||||
|
|
||||||
|
type Capability = 'detail' | 'balance' | 'transaction' | 'identity'
|
||||||
|
|
||||||
|
export type GetInstitutionsResponse = {
|
||||||
|
institutions: Institution[]
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue