@accounter/modern-poalim-scraper
Version:
Modern scraper for Israeli banks (Hapoalim, Isracard, Max)
124 lines (123 loc) • 4.58 kB
TypeScript
import type { Page } from 'puppeteer';
import { type MaxTransaction } from './types/max/get-transactions-for-month.js';
interface TransactionsAccount {
accountNumber: string;
balance?: number;
txns: MaxTransaction[];
}
export type MaxScrapingResult = TransactionsAccount[];
export interface MaxOptions {
/**
* the date to fetch transactions from (can't be before the minimum allowed time difference for the scraper)
*/
startDate?: Date;
/**
* scrape transactions to be processed X months in the future
*/
futureMonthsToScrape?: number;
}
export type MaxCredentials = {
username: string;
password: string;
};
export declare function max(page: Page, credentials: MaxCredentials, options?: MaxOptions): Promise<{
getTransactions: () => Promise<{
accountNumber: string;
txns: {
actualPaymentAmount: number | null;
arn: string | null;
cardIndex: number;
categoryId: number;
comments: string;
discountKeyAmount: null;
discountKeyRecType: null;
isRegisterCh: boolean;
isSpreadingAutorizationAllowed: boolean;
issuerId: number;
merchantData: {
address: string | null;
coordinates: null;
maxPhone: boolean;
merchant: string;
merchantCommercialName: string | null;
merchantNumber: string;
merchantPhone: string;
merchantTaxId: string | null;
};
merchantName: string;
originalAmount: number;
originalCurrency: "ILS";
paymentCurrency: number | null;
planName: string;
planTypeId: number;
promotionAmount: number | null;
promotionClub: string | null;
promotionType: null;
purchaseDate: string;
refIndex: number;
runtimeReference: {
id: string;
type: number;
};
runtimeReferenceId: null;
shortCardNumber: string;
spreadTransactionByCampainInd: boolean;
spreadTransactionByCampainNumber: number | null;
tableType: number;
tag: null;
uid: string;
upSaleForTransactionResult: null;
userIndex: number;
dealData?: {
acq: string | null;
adjustmentAmount: null;
adjustmentType: number;
amount: number | null;
amountIls: number | null;
amountLeft: number | null;
arn: string | null;
authorizationNumber: string;
cardName: string | null;
cardToken: string | null;
commissionVat: number | null;
directExchange: null;
exchangeCommissionAmount: null;
exchangeCommissionMaam: null;
exchangeCommissionType: null;
exchangeDirect: string | null;
exchangeRate: number | null;
indexRateBase: null;
indexRatePmt: null;
interestAmount: number | null;
isAllowedSpreadWithBenefit: boolean;
issuerCurrency: string | null;
issuerExchangeRate: null;
originalTerm: number | null;
percentMaam: number | null;
plan: number | null;
posEntryEmv: number;
processingDate: string | null;
purchaseAmount: null;
purchaseTime: string | null;
refNbr: string | null;
showCancelDebit: boolean;
showSpread: boolean;
showSpreadBenefitButton: boolean;
showSpreadButton: boolean;
showSpreadForLeumi: boolean;
tdmCardToken: string | null;
tdmTransactionType: number | null;
transactionType: number;
txnCode: number;
userName: string;
withdrawalCommissionAmount: null;
} | undefined;
ethocaInd?: boolean | undefined;
fundsTransferComment?: string | null | undefined;
fundsTransferReceiverOrTransfer?: string | null | undefined;
paymentDate?: string | null | undefined;
receiptPDF?: null | undefined;
}[];
}[]>;
}>;
export {};