import { BaseApi, ClientParams } from './baseApi'; import { PluggyPaymentsClient } from './paymentsClient'; import { Account, AccountType, Category, Connector, ConnectorFilters, ConnectTokenOptions, Consent, ConsentFilters, CreateItemOptions, CreateWebhook, IdentityResponse, Investment, InvestmentTransaction, InvestmentType, Item, CursorPageResponse, PageResponse, Parameters, Transaction, TransactionCursorFilters, TransactionFilters, UpdateWebhook, Webhook, Loan, PageFilters, InvestmentsFilters, AccountStatement } from './types'; import { CreditCardBills } from './types/creditCardBills'; import { ValidationResult } from './types/validation'; /** * Creates a new client instance for interacting with Pluggy API * @constructor * @param API_KEY for authenticating to the API * @returns {PluggyClient} a client for making requests */ export declare class PluggyClient extends BaseApi { payments: PluggyPaymentsClient; constructor(params: ClientParams); /** * Fetch all available connectors * @returns {PageResponse} paged response of connectors */ fetchConnectors(options?: ConnectorFilters): Promise>; /** * Fetch a single Connector * @param id The Connector ID * @returns {Connector} a connector object */ fetchConnector(id: number): Promise; /** * Fetch a single item * @param id The Item ID * @returns {Item} a item object */ fetchItem(id: string): Promise; /** * Check that connector parameters are valid * @param id The Connector ID * @param parameters A map of name and value for the credentials to be validated * @returns {ValidationResult} an object with the info of which parameters are wrong */ validateParameters(id: number, parameters: Parameters): Promise; /** * Creates an item * @param connectorId The Connector's id * @param parameters A map of name and value for the needed credentials * @param options Options available to set to the item * @returns {Item} a item object */ createItem(connectorId: number, parameters: Record, options?: CreateItemOptions): Promise; /** * Updates an item * @param id The Item ID * @param parameters A map of name and value for the credentials to be updated. * Optional; if none submitted, an Item update will be attempted with the latest used credentials. * @returns {Item} a item object */ updateItem(id: string, parameters?: Parameters, options?: CreateItemOptions): Promise; /** * Send MFA for item execution * @param id The Item ID * @param parameters A map of name and value for the mfa requested * @returns {Item} a item object */ updateItemMFA(id: string, parameters?: Parameters): Promise; /** * Deletes an item */ deleteItem(id: string): Promise; /** * Fetch accounts from an Item * @param itemId The Item id * @returns {PageResponse} paged response of accounts */ fetchAccounts(itemId: string, type?: AccountType): Promise>; /** * Fetch a single account * @returns {Account} an account object */ fetchAccount(id: string): Promise; /** * Fetch transactions from an account * @param accountId The account id * @param {TransactionFilters} options Transaction options to filter * @returns {PageResponse} object which contains the transactions list and related paging data */ fetchTransactions(accountId: string, options?: TransactionFilters): Promise>; /** * Fetch transactions from an account using cursor-based pagination * @param accountId The account id * @param {TransactionCursorFilters} options Optional filters (dateFrom, createdAtFrom, after cursor) * @returns {CursorPageResponse} object with results and next cursor link */ fetchTransactionsCursor(accountId: string, options?: TransactionCursorFilters): Promise>; /** * Fetch all transactions from an account using cursor-based pagination * @param accountId The account id * @param {TransactionCursorFilters} options Optional filters (dateFrom, createdAtFrom) * @returns {Transaction[]} an array of all transactions */ fetchAllTransactions(accountId: string, options?: Omit): Promise; /** * Fetch account statements from an account * @param accountId The account id * @returns {PageResponse} object which contains the Account statements list and related paging data */ fetchAccountStatements(accountId: string): Promise>; /** * Post transaction user category for transactin * @param id The Transaction id * * @returns {Transaction} updated transaction object */ updateTransactionCategory(id: string, categoryId: string): Promise; /** * Fetch a single transaction * * @returns {Transaction} an transaction object */ fetchTransaction(id: string): Promise; /** * Fetch investments from an Item * * @param itemId The Item id * @returns {PageResponse} paged response of investments */ fetchInvestments(itemId: string, type?: InvestmentType, options?: InvestmentsFilters): Promise>; /** * Fetch a single investment * * @returns {Investment} an investment object */ fetchInvestment(id: string): Promise; /** * Fetch transactions from an investment * * @param investmentId The investment id * @param {TransactionFilters} options Transaction options to filter * @returns {PageResponse} object which contains the transactions list and related paging data */ fetchInvestmentTransactions(investmentId: string, options?: TransactionFilters): Promise>; /** * Fetch all investment transactions from an investment * @param investmentId The investment id * @returns {InvestmentTransaction[]} an array of investment transactions */ fetchAllInvestmentTransactions(investmentId: string): Promise; /** * Fetch loans from an Item * * @param {string} itemId * @param {PageFilters} options - request search filters * @returns {Promise>} - paged response of loans */ fetchLoans(itemId: string, options?: PageFilters): Promise>; /** * Fetch loan by id * * @param {string} id - the loan id * @returns {Promise} - loan object, if found */ fetchLoan(id: string): Promise; /** * Fetch consents from an Item * * @param {string} itemId - the item id * @param {ConsentFilters} options - request search filters * @returns {Promise>} - paged response of consents */ fetchConsents(itemId: string, options?: ConsentFilters): Promise>; /** * Fetch consent by id * * @param {string} id - the consent id * @returns {Promise} - consent object, if found */ fetchConsent(id: string): Promise; /** * Fetch the identity resource * @returns {IdentityResponse} an identity object */ fetchIdentity(id: string): Promise; /** * Fetch the identity resource by it's Item ID * @returns {IdentityResponse} an identity object */ fetchIdentityByItemId(itemId: string): Promise; /** * Fetch credit card bills from an accountId * @returns {PageResponse} an credit card bills object */ fetchCreditCardBills(accountId: string, options?: PageFilters): Promise>; /** * Fetch a single credit card bill by its id * @param {string} id - the credit card bill id * @returns {Promise} - credit card bill object, if found */ fetchCreditCardBill(id: string): Promise; /** * Fetch all available categories * @returns {Categories[]} an paging response of categories */ fetchCategories(): Promise>; /** * Fetch a single category * @returns {Category} a category object */ fetchCategory(id: string): Promise; /** * Fetch a single webhook * @returns {Webhook} a webhook object */ fetchWebhook(id: string): Promise; /** * Fetch all available webhooks * @returns {Webhook[]} a paging response of webhooks */ fetchWebhooks(): Promise>; /** * Creates a Webhook * @param webhookParams - The webhook params to create, this includes: * - url: The url where will receive notifications * - event: The event to listen for * - headers (optional): The headers to send with the webhook * @returns {Webhook} the created webhook object */ createWebhook(event: CreateWebhook['event'], url: CreateWebhook['url'], headers?: CreateWebhook['headers']): Promise; /** * Updates a Webhook * @param id - The Webhook ID * @param updatedWebhookParams - The webhook params to update * @returns {Webhook} The webhook updated */ updateWebhook(id: string, updatedWebhookParams: UpdateWebhook): Promise; /** * Deletes a Webhook */ deleteWebhook(id: string): Promise; /** * Creates a connect token that can be used as API KEY to connect items from the Frontend * @returns {string} Access token to connect items with restrict access */ createConnectToken(itemId?: string, options?: ConnectTokenOptions): Promise<{ accessToken: string; }>; }