UNPKG

@finagraph/strongbox-finconnect-react

Version:

React components to integrate with Finagraph Strongbox

72 lines (71 loc) 4.73 kB
import { IDelegatedAccessToken } from '../Models/Api/ClientBase'; import { ConnectionDescriptor, ConnectionRequestDescriptor, ConsumerMetadata, IFinancialStatementImportOptions, ITransactionImportOptions, IReceivablesAndPayablesOptions, ConnectionRequestErrorCode } from '../Models/Api/strongbox.models'; import { AccountingPackage } from '../Models/AccountingPackages'; import { TextContent } from '../Text/TextContent'; /** * ImportDayMonthYear is used to provide the last day of a financial import. The date provided should not be greater * than the current date. If it is not provided, the current date is used. * * @member {number } month - is required if mostRecentDate is provided and represents the 0 based month, * i.e. January = 0 and December = 11. * @member {number} day is required if mostRecentDate is provided. For convenience, if you simply want to represent * the end of a month, you can pass 0 for the day. For example, if you want to collect information through the end * of April 2021, you can pass 3 for the month (months are zero based recall), 0 for the day and 2021 for the year. * Otherwise, this is the 1 based day of the month representing the last full day of imported information. * @member {number} year - is required if mostRecentDate is provided and is simply the full year, e.g. 2021. * * */ export type ImportDayMonthYear = { month: number; day: number; year: number; }; export type LenderConnectionOptions = { mostRecentDate?: ImportDayMonthYear; financialStatementsPeriod?: IFinancialStatementImportOptions; transactionsPeriod?: ITransactionImportOptions; payablesPeriod?: IReceivablesAndPayablesOptions; receivablesPeriod?: IReceivablesAndPayablesOptions; anonymizeCustomersAndVendors: boolean; provideUserCopy: boolean; }; export type PortalFlowType = 'borrower' | 'lender' | 'widget'; export type StrongboxConnectionDescriptor = { accountingPackage: AccountingPackage; delegatedAccessToken: IDelegatedAccessToken; strongboxUri: string; orgId: string; existingConnectionId?: string; submissionId?: string; lenderManagedOptions?: LenderConnectionOptions; initiator?: string; sourceFlow: PortalFlowType; }; export type StrongboxConnectionRequest = { accountingPackage: AccountingPackage; delegatedAccessToken: IDelegatedAccessToken; strongboxUri: string; orgId: string; existingConnectionId?: string; submissionId?: string; sourceFlow: PortalFlowType; }; export type StrongboxImportRequest = { accountingPackage: AccountingPackage; lenderManagedOptions?: LenderConnectionOptions; initiator?: string; sourceFlow: PortalFlowType; delegatedAccessToken: IDelegatedAccessToken; orgId: string; strongboxUri: string; submissionId?: string; connectionId: string; initialMetadata?: ConsumerMetadata[]; }; export declare const LoadConnectWindow: (cxnRequestDescriptor: ConnectionRequestDescriptor | undefined, onOpen?: ((authWindow: Window) => void) | undefined) => Window | undefined; export declare const StartGetFinancialsConnectionDescriptor: (connectionInfo: StrongboxConnectionDescriptor, textContent: TextContent, onError: (msg: string, detailedMsg: string) => void) => Promise<ConnectionRequestDescriptor | undefined>; export declare const GetFinancialsConnectionDescriptor: (connectionInfo: StrongboxConnectionDescriptor, onError: (msg: string, detailedMsg: string) => void) => Promise<ConnectionRequestDescriptor | undefined>; export declare const ConnectAccountingSystem: (cxnRequest: StrongboxConnectionRequest, apiRequestParameters: ConnectionRequestDescriptor | undefined, windowHandle: Window | undefined, onError: ((msg: string, detailedMsg: string, errorCode?: ConnectionRequestErrorCode) => void) | undefined, onConnected: ((cxnRequest: StrongboxConnectionRequest, apiRequestParameters?: ConnectionRequestDescriptor) => void) | undefined, onAborted: (() => void) | undefined, isCancelled: () => boolean, textContent?: TextContent) => Promise<void>; export declare const ImportFinancials: (importRequest: StrongboxImportRequest, onError: ((msg: string, detailedMsg: string) => void) | undefined, onImportStarted: ((financialRecordId: string, importRequest: StrongboxImportRequest) => void) | undefined, textContent?: TextContent) => Promise<void>; export declare const FindConnection: (accessToken: IDelegatedAccessToken, strongboxUri: string, orgId: string, accountingPackage: AccountingPackage) => Promise<ConnectionDescriptor | undefined>; export declare const DisconnectConnection: (connectionInfo: StrongboxConnectionDescriptor) => Promise<boolean>;