FsPages laisse la place à Gitlab Pages ! Voici la documentation pour vous en servir : https://docs.gitlab.com/ce/user/project/pages/index.html

Public
Snippet $400 authored by Antoine

Backends

Edited
backends.md

A backend a is a es6 module exporting a series of function required by Kresus : All these exports are required

export async function testInstall()

Description

Asynchronous function testing if the backend is installed.

Parameters

None

Returns

true : backend is installed false : backend is not installed

Raised error

None

export async function getVersion()

Description

Asynchronous function retrieving the backend version.

Parameters

None

Returns

If the version is known or retrived the version as a String If not known, '?'.

Raised error

None

export async function fetchAccounts(access)

Description

Asynchronuous function retrieving all the accounts for an access.

Parameters

access : Instance of an Access (see model description)

{
    uuid: 'string', # Unique identifier for the bank module
    backend: 'string', # The necessary backend to fetch accounts
    password: 'string', # Password of the access
    fields: 'Object', # Object containing all the necessary fields except password to connect to the bank
}

Returns

A table of Accounts (see model description)

{
    accountNumber: 'string', #Unique human readable number of the bank account
    iban: 'string', # IBAN of account, optional
    balance: Number, # Balance of the account
    label: 'string', # Human readable description of the account
    currency: 'string' # Currency of the account, optional. Should use a value defined in ISO 4217
}

Raised errors

Instance of KError with one of the following values :

Mandatory

"INVALID_PASSWORD": The password or credentials are wrong
"MODULE_LOAD": The module in not installed or badly installed. -> To be added
"GENERIC_EXCEPTION": Any other error

Optional

"EXPIRED_PASSWORD": The password has to be changed (only used for some banks)
"INVALID_PARAMETERS": A parameter is missing for the credentials
"UNKNOWN_WEBOOB_MODULE": If the backen uses modules, the called module is not known (??? to be discussed). Change of name for error UNKNOWN_MODULE ?

export async function fetchOperations(access)

Description

Asynchronuous function retrieving all the operations for an access.

Parameters

access : Instance of an Access (see model description)

Returns

An array of operations (see model description)

{
    title: 'string', # Human readable texte describing the operation
    raw: 'string', # Long version of @title (if not provided, make them equal)
    amount: Number, #Positive or negative amount of the operation
    accountNumber: 'string', #Account on which the operation is done. See Account model
    date: Date, # Date at which the operation was done
    type: Number; # Type of operation as defined in shared/types.json
}

Raised errors

See fetchAccounts