diff --git a/package-lock.json b/package-lock.json index b6ed3048..1eb899a8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,7 @@ "hash-it": "^6.0.0", "israeli-bank-scrapers": "^5.1.1", "telegraf": "^4.16.3", - "ynab": "^2.2.0" + "ynab": "^2.4.0" }, "devDependencies": { "@types/debug": "^4.1.12", @@ -6302,9 +6302,9 @@ } }, "node_modules/ynab": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/ynab/-/ynab-2.2.0.tgz", - "integrity": "sha512-07RFqEqhoIxge1JzYriMDxTyX2yEhKhUxHATzIx2V81hQYQs0UV7ieZ5dvUaSbE+05wWAg+tbScfh2PxghmkwA==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/ynab/-/ynab-2.4.0.tgz", + "integrity": "sha512-4fWY4oakic0mKc0EYYadoaEznTKyPMU/N3qz8O7O8WRsJ9U8ze+xa0Gb8ZtSM7F88NjnyZRz0+i2qRc9WUxzsg==", "dependencies": { "fetch-ponyfill": "^7.1.0" }, @@ -11025,9 +11025,9 @@ } }, "ynab": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/ynab/-/ynab-2.2.0.tgz", - "integrity": "sha512-07RFqEqhoIxge1JzYriMDxTyX2yEhKhUxHATzIx2V81hQYQs0UV7ieZ5dvUaSbE+05wWAg+tbScfh2PxghmkwA==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/ynab/-/ynab-2.4.0.tgz", + "integrity": "sha512-4fWY4oakic0mKc0EYYadoaEznTKyPMU/N3qz8O7O8WRsJ9U8ze+xa0Gb8ZtSM7F88NjnyZRz0+i2qRc9WUxzsg==", "requires": { "fetch-ponyfill": "^7.1.0" } diff --git a/package.json b/package.json index 244eacc7..1ed10260 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "hash-it": "^6.0.0", "israeli-bank-scrapers": "^5.1.1", "telegraf": "^4.16.3", - "ynab": "^2.2.0" + "ynab": "^2.4.0" }, "devDependencies": { "@types/debug": "^4.1.12", diff --git a/src/storage/ynab.ts b/src/storage/ynab.ts index dfab073c..b60aceb1 100644 --- a/src/storage/ynab.ts +++ b/src/storage/ynab.ts @@ -49,7 +49,7 @@ export class YNABStorage implements TransactionStorage { } satisfies SaveStats; // Initialize an array to store non-pending and non-empty account ID transactions on YNAB format. - const txToSend: ynab.SaveTransaction[] = []; + const txToSend: ynab.SaveTransactionWithOptionalFields[] = []; const missingAccounts = new Set(); for (let tx of txns) { @@ -127,14 +127,14 @@ export class YNABStorage implements TransactionStorage { private convertTransactionToYnabFormat( tx: TransactionRow, accountId: string, - ): ynab.SaveTransaction { + ): ynab.SaveTransactionWithIdOrImportId { const amount = Math.round(tx.chargedAmount * 1000); return { account_id: accountId, date: format(parseISO(tx.date), YNAB_DATE_FORMAT, {}), amount, - payee_id: null, + payee_id: undefined, payee_name: tx.description, cleared: tx.status === TransactionStatuses.Completed