ofx4js
Version:
A javascript OFX library, ported from OFX4J
121 lines (120 loc) • 5.11 kB
TypeScript
import { OFXConnection } from "../net/OFXConnection";
import { FinancialInstitutionData } from "../FinancialInstitutionData";
import { FinancialInstitutionProfile } from "../FinancialInstitutionProfile";
import { RequestEnvelope } from "../../domain/data/RequestEnvelope";
import { SignonRequest } from "../../domain/data/signon/SignonRequest";
import { ResponseEnvelope } from "../../domain/data/ResponseEnvelope";
import { AccountProfile } from "../../domain/data/signup/AccountProfile";
import { BankAccountDetails } from "../../domain/data/banking/BankAccountDetails";
import { BankAccount } from "../BankAccount";
import { CreditCardAccountDetails } from "../../domain/data/creditcard/CreditCardAccountDetails";
import { CreditCardAccount } from "../CreditCardAccount";
import { InvestmentAccountDetails } from "../../domain/data/investment/accounts/InvestmentAccountDetails";
import { InvestmentAccount } from "../InvestmentAccount";
import { StatusHolder } from "../../domain/data/common/StatusHolder";
import { ProfileRequestTransaction } from "../../domain/data/profile/ProfileRequestTransaction";
import { ProfileRequest } from "../../domain/data/profile/ProfileRequest";
import { AccountInfoRequestTransaction } from "../../domain/data/signup/AccountInfoRequestTransaction";
import { AccountInfoRequest } from "../../domain/data/signup/AccountInfoRequest";
import { FinancialInstitutionInfo } from "../../domain/data/signon/FinancialInstitution";
/**
* Base implementation for the financial institution.
*/
export declare class FinancialInstitutionImpl extends FinancialInstitutionInfo {
private connection;
private data;
constructor(data: FinancialInstitutionData, connection: OFXConnection);
readProfile(): Promise<FinancialInstitutionProfile>;
readAccountProfiles(username: string, password: string): Promise<Array<AccountProfile>>;
loadBankAccount(details: BankAccountDetails, username: string, password: string): BankAccount;
loadCreditCardAccount(details: CreditCardAccountDetails, username: string, password: string): CreditCardAccount;
loadInvestmentAccount(details: InvestmentAccountDetails, username: string, password: string): InvestmentAccount;
/**
* Create an authenticated request envelope.
*
* @param username The username.
* @param password The password.
* @return The request envelope.
*/
createAuthenticatedRequest(username: string, password: string): RequestEnvelope;
/**
* Send a request to a specific URL.
*
* @param request The request.
* @param url The url.
* @return The request.
*/
sendRequest(request: RequestEnvelope, url?: string): Promise<ResponseEnvelope>;
/**
* Open the specified response envelope and look for the profile.
*
* @param response The response envelope.
* @return The profile.
*/
protected getProfile(response: ResponseEnvelope): FinancialInstitutionProfile;
/**
* General validation checks on the specified response.
*
* @param request The request.
* @param response Their response.
* @throws OFXException Upon invalid response.
*/
doGeneralValidationChecks(request: RequestEnvelope, response: ResponseEnvelope): void;
/**
* Validate the status of the given status holder.
*
* @param statusHolder The status holder.
*/
protected validateStatus(statusHolder: StatusHolder): void;
/**
* Create a transaction message for a profile request.
*
* @return The transaction message.
*/
protected createProfileTransaction(): ProfileRequestTransaction;
/**
* Create a profile request.
*
* @return The profile request.
*/
protected createProfileRequest(): ProfileRequest;
/**
* Create a sign-on request for the specified user.
*
* @param username The username.
* @param password The password.
* @return The signon request.
*/
protected createSignonRequest(username: string, password: string): SignonRequest;
/**
* Create a transaction for an account info request.
*
* @return The transaction.
*/
protected createAccountInfoTransaction(): AccountInfoRequestTransaction;
/**
* Create an account info request.
*
* @return The account info request.
*/
protected createAccountInfoRequest(): AccountInfoRequest;
/**
* Get the account profiles for the specified response envelope.
*
* @param response The response envelope.
* @return The account profiles.
*/
protected getAccountProfiles(response: ResponseEnvelope): Array<AccountProfile>;
/**
* The connection used by this implementation.
*
* @return The connection used by this implementation.
*/
getConnection(): OFXConnection;
/**
* The financial institution data.
*
* @return The financial institution data.
*/
getData(): FinancialInstitutionData;
}