OBP-TypeScript/docs/modules/api.md
2023-03-08 21:44:31 +08:00

18 KiB

obp-sdk-ts / Modules / api

Module: api

Table of contents

Enumerations

Type Aliases

Variables

Functions

Type Aliases

APIClientConfig

Ƭ APIClientConfig: Object

Alias for APIClientConfig properties.

Property

baseUri

Property

version

Property

authentication

Property

[token]

See

Type declaration

Name Type
authentication DirectLoginAuthentication
baseUri string
token? string
version Version

Defined in

api/client.ts:58


APIRequest

Ƭ APIRequest<T>: Object

Alias for APIRequest properties.

Property

[get]

Property

[create]

See

Type parameters

Name Description
T Type of object

Type declaration

Name Type
create? (config: APIClientConfig, methodCall: MethodCall<T>) => any
get? (config: APIClientConfig, methodCall: MethodCall<T>) => any

Defined in

api/client.ts:97


DirectLoginAuthentication

Ƭ DirectLoginAuthentication: Object

Alias for DirectLogin properties.

Property

username

Property

passowrd

Property

consumerKey

Type declaration

Name Type
consumerKey string
password string
username string

Defined in

api/client.ts:38


MethodCall

Ƭ MethodCall<T>: (config: APIClientConfig, path: string, body?: any) => Promise<T>

Type parameters

Name Description
T Type of object

Type declaration

▸ (config, path, body?): Promise<T>

Alias for HTTP MethodCall properties.

Property

config

Property

path

Property

[body]

See

APIClientConfig

Parameters
Name Type
config APIClientConfig
path string
body? any
Returns

Promise<T>

Defined in

api/client.ts:78


TransactionRequestAccountBody

Ƭ TransactionRequestAccountBody: Object

Alias for TransactionRequestAccountBody properties.

Property

description

Property

to

Property

value

Type declaration

Name Type
description string
to { account_id: string ; bank_id: string }
to.account_id string
to.bank_id string
value { amount: number ; currency: string }
value.amount number
value.currency string

Defined in

api/transaction.ts:18

Variables

Account

Const Account: APIRequest<Account>

Returns an anonymous function for creating or getting an Account data.

Param

The APIClientConfig object

Param

A higher order function

See

Defined in

api/account.ts:42


Bank

Const Bank: APIRequest<Bank>

Returns an anonymous function for creating or getting Bank data.

Param

The APIClientConfig object

Param

A higher order function

See

Defined in

api/bank.ts:61


Customer

Const Customer: APIRequest<Customer>

Returns an anonymous function for creating or getting Customer data.

Param

The APIClientConfig object

Param

A higher order function

See

Defined in

api/customer.ts:147


KYC

Const KYC: APIRequest<KYC>

Returns an anonymous function for creating or getting KYC data.

Param

The APIClientConfig object

Param

A higher order function

See

Defined in

api/kyc.ts:40


Metadata

Const Metadata: APIRequest<Metadata>

Returns an anonymous function for creating or getting Metadata data.

Param

The APIClientConfig object

Param

A higher order function

See

Defined in

api/metadata.ts:43


Transaction

Const Transaction: APIRequest<Transaction>

Returns an anonymous function for creating or getting Transaction data.

Param

The APIClientConfig object

Param

A higher order function

See

Defined in

api/transaction.ts:97


User

Const User: APIRequest<User>

Returns an anonymous function for creating or getting a User data.

Param

The APIClientConfig object

Param

A higher order function

See

Defined in

api/user.ts:39

Functions

CreateTransactionRequestAccount

CreateTransactionRequestAccount(config, methodCall): (bankId: string, accountId: string, viewId: string, account: string) => (body: TransactionRequestAccountBody) => Promise<Transaction>

Create Transaction Request (ACCOUNT).

See

Parameters

Name Type Description
config APIClientConfig The APIClientConfig object
methodCall (config: APIClientConfig, path: string, body: TransactionRequestAccountBody) => Promise<any> A higher order function

Returns

fn

A curried function

▸ (bankId, accountId, viewId, account): (body: TransactionRequestAccountBody) => Promise<Transaction>

Parameters
Name Type
bankId string
accountId string
viewId string
account string
Returns

fn

▸ (body): Promise<Transaction>

Parameters
Name Type
body TransactionRequestAccountBody
Returns

Promise<Transaction>

Defined in

api/transaction.ts:69


Current

Current(config, methodCall): Promise<User>

Get the logged in user Returns information about the logged in user.

See

APIClientConfig

Parameters

Name Type Description
config APIClientConfig The APIClientConfig object
methodCall (config: APIClientConfig, path: string) => Promise<User> A higher order function

Returns

Promise<User>

A curried function

Defined in

api/user.ts:20


GetAccountsByBankId

GetAccountsByBankId(config, methodCall): (id: string) => Promise<Account>

Get Accounts at Bank. Returns the list of accounts at BANK_ID that the user has access to.

See

APIClientConfig

Parameters

Name Type Description
config APIClientConfig The APIClientConfig object
methodCall (config: APIClientConfig, path: string) => Promise<Account> A higher order function

Returns

fn

A curried function

▸ (id): Promise<Account>

Parameters
Name Type
id string
Returns

Promise<Account>

Defined in

api/account.ts:21


GetBanks

GetBanks(config, methodCall): Promise<any>

Get banks on this API instance. Returns a list of banks.

See

APIClientConfig

Parameters

Name Type Description
config APIClientConfig The APIClientConfig object
methodCall (config: APIClientConfig, path: string) => Promise<any> A higher order function

Returns

Promise<any>

A curried function

Defined in

api/bank.ts:42


GetBanksById

GetBanksById(config, methodCall): (id: string) => Promise<Account>

Get the bank specified by BANK_ID. Returns information about a single bank specified by BANK_ID.

See

APIClientConfig

Parameters

Name Type Description
config APIClientConfig The APIClientConfig object
methodCall (config: APIClientConfig, path: string) => Promise<any> A higher order function

Returns

fn

A curried function

▸ (id): Promise<Account>

Parameters
Name Type
id string
Returns

Promise<Account>

Defined in

api/bank.ts:21


GetCustomersAtAnyBank

GetCustomersAtAnyBank(config, methodCall): Promise<any>

Get Customers at Any Bank.

See

APIClientConfig

Parameters

Name Type Description
config APIClientConfig The APIClientConfig object
methodCall (config: APIClientConfig, path: string) => Promise<any> A higher order function

Returns

Promise<any>

A curried function

Defined in

api/customer.ts:74


GetCustomersAtBank

GetCustomersAtBank(config, methodCall): (bankId: string) => Promise<Customer>

Get Customers at Bank.

See

APIClientConfig

Parameters

Name Type Description
config APIClientConfig The APIClientConfig object
methodCall (config: APIClientConfig, path: string) => Promise<any> A higher order function

Returns

fn

A curried function

▸ (bankId): Promise<Customer>

Parameters
Name Type
bankId string
Returns

Promise<Customer>

Defined in

api/customer.ts:93


GetKYCStatus

GetKYCStatus(config, methodCall): (customerId: string) => Promise<any>

Get the KYC statuses for a customer specified by CUSTOMER_ID over time.

See

APIClientConfig

Parameters

Name Type Description
config APIClientConfig The APIClientConfig object
methodCall (config: APIClientConfig, path: string) => Promise<any> A higher order function

Returns

fn

A curried function

▸ (customerId): Promise<any>

Parameters
Name Type
customerId string
Returns

Promise<any>

Defined in

api/kyc.ts:20


GetTagsOnAccount

GetTagsOnAccount(config, methodCall): (bankId: string, accountId: string, viewId: string) => Promise<any>

Returns the account ACCOUNT_ID tags made on a view (VIEW_ID).

See

APIClientConfig

Parameters

Name Type Description
config APIClientConfig The APIClientConfig object
methodCall (config: APIClientConfig, path: string) => Promise<any> A higher order function

Returns

fn

A curried function

▸ (bankId, accountId, viewId): Promise<any>

Parameters
Name Type
bankId string
accountId string
viewId string
Returns

Promise<any>

Defined in

api/metadata.ts:20


GetTransactionsForAccountFull

GetTransactionsForAccountFull(config, methodCall): (bankId: string, accountId: string, viewId: string) => Promise<Account>

Get Transactions for Account (Full). Returns transactions list of the account specified by ACCOUNT_ID and moderated by the view (VIEW_ID).

See

APIClientConfig

Parameters

Name Type Description
config APIClientConfig The APIClientConfig object
methodCall (config: APIClientConfig, path: string) => Promise<any> A higher order function

Returns

fn

A curried function

▸ (bankId, accountId, viewId): Promise<Account>

Parameters
Name Type
bankId string
accountId string
viewId string
Returns

Promise<Account>

Defined in

api/transaction.ts:43


create

create<T>(config, request): any

A POST request function that creates an API data and returns the result.

See

  • APIClientConfig
  • APIRequest

Type parameters

Name
T

Parameters

Name Type Description
config APIClientConfig The APIClientConfig object
request APIRequest<T> The APIRequest object

Returns

any

An

Defined in

api/client.ts:303


get

get<T>(config, request): any

A GET request function that returns the API data.

See

  • APIClientConfig
  • APIRequest

Type parameters

Name
T

Parameters

Name Type Description
config APIClientConfig The APIClientConfig object
request APIRequest<T> The APIRequest object

Returns

any

An

Defined in

api/client.ts:284