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

25 KiB

obp-typescript / 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
oauthConfig? OAuthConfig
token? string
version Version
withFixedVersion? boolean

Defined in

api/client.ts:85


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
discard? (config: APIClientConfig, methodCall: MethodCall<T>) => any
get? (config: APIClientConfig, methodCall: MethodCall<T>) => any
update? (config: APIClientConfig, methodCall: MethodCall<T>) => any

Defined in

api/client.ts:126


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:65


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:107


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:43

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:67


Any

Const Any: APIRequest<Any>

Returns an anonymous function for creating or getting Any data.

Param

The APIClientConfig object

Param

A higher order function

See

Defined in

api/any.ts:138


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:86


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:172


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:65


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:68


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:122


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:64

Functions

CreateAny

CreateAny(config, methodCall): (path: string) => (body: any) => Promise<Any>

Create Any Request.

See

Parameters

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

Returns

fn

A curried function

▸ (path): (body: any) => Promise<Any>

Parameters
Name Type
path string
Returns

fn

▸ (body): Promise<Any>

Parameters
Name Type
body any
Returns

Promise<Any>

Defined in

api/any.ts:68


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:94


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:45


DiscardAny

DiscardAny(config, methodCall): (path: string) => Promise<any>

Delete Any Request.

See

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

▸ (path): Promise<any>

Parameters
Name Type
path string
Returns

Promise<any>

Defined in

api/any.ts:118


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:46


GetAny

GetAny(config, methodCall): (path: string) => Promise<any>

Get any data. Returns the response of the requested endpoint.

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

▸ (path): Promise<any>

Parameters
Name Type
path string
Returns

Promise<any>

Defined in

api/any.ts:47


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:67


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:46


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:99


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:118


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:45


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:45


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:68


UpdateAny

UpdateAny(config, methodCall): (path: string) => (body: any) => Promise<Any>

Update Any Request.

See

Parameters

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

Returns

fn

A curried function

▸ (path): (body: any) => Promise<Any>

Parameters
Name Type
path string
Returns

fn

▸ (body): Promise<Any>

Parameters
Name Type
body any
Returns

Promise<Any>

Defined in

api/any.ts:93


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:431


discard

discard<T>(config, request): any

A DELETE request function that deletes an 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:469


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:412


update

update<T>(config, request): any

A PUT request function that updates 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:450