From 0841f8bd5ba844f8ee1c81a79bc5bb7498d3be89 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sun, 8 Dec 2024 18:57:22 +0100 Subject: [PATCH 1/4] Bugfix/fix exception in portfolio calculator (#4113) * Fix exception in portfolio calculator * Update changelog --- CHANGELOG.md | 4 ++++ .../src/app/portfolio/calculator/twr/portfolio-calculator.ts | 1 + libs/common/src/lib/models/portfolio-snapshot.ts | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c20027c8..637da61e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Extended the _X-ray_ page by a summary +### Fixed + +- Fixed an exception in the caching of the portfolio snapshot in the portfolio calculator + ## 2.126.1 - 2024-12-07 ### Added diff --git a/apps/api/src/app/portfolio/calculator/twr/portfolio-calculator.ts b/apps/api/src/app/portfolio/calculator/twr/portfolio-calculator.ts index 6c0d230b0..3f53ee04b 100644 --- a/apps/api/src/app/portfolio/calculator/twr/portfolio-calculator.ts +++ b/apps/api/src/app/portfolio/calculator/twr/portfolio-calculator.ts @@ -101,6 +101,7 @@ export class TWRPortfolioCalculator extends PortfolioCalculator { totalInterestWithCurrencyEffect, totalInvestment, totalInvestmentWithCurrencyEffect, + errors: [], historicalData: [], totalLiabilitiesWithCurrencyEffect: new Big(0), totalValuablesWithCurrencyEffect: new Big(0) diff --git a/libs/common/src/lib/models/portfolio-snapshot.ts b/libs/common/src/lib/models/portfolio-snapshot.ts index e51931711..46bd5c18f 100644 --- a/libs/common/src/lib/models/portfolio-snapshot.ts +++ b/libs/common/src/lib/models/portfolio-snapshot.ts @@ -13,7 +13,7 @@ export class PortfolioSnapshot { @Type(() => Big) currentValueInBaseCurrency: Big; - errors?: AssetProfileIdentifier[]; + errors: AssetProfileIdentifier[]; hasErrors: boolean; From 618a918423d8f549ffbb258558c8ec929a07f713 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sun, 8 Dec 2024 18:59:33 +0100 Subject: [PATCH 2/4] Release 2.127.0 (#4114) --- CHANGELOG.md | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 637da61e6..f4771dc63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased +## 2.127.0 - 2024-12-08 ### Added diff --git a/package-lock.json b/package-lock.json index ecbc91c56..9db369481 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ghostfolio", - "version": "2.126.1", + "version": "2.127.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ghostfolio", - "version": "2.126.1", + "version": "2.127.0", "hasInstallScript": true, "license": "AGPL-3.0", "dependencies": { diff --git a/package.json b/package.json index 738f2db8a..598bc40b3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ghostfolio", - "version": "2.126.1", + "version": "2.127.0", "homepage": "https://ghostfol.io", "license": "AGPL-3.0", "repository": "https://github.com/ghostfolio/ghostfolio", From 801030ce64c4cf45acfbb45bdee0d4ff42de9ff3 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Tue, 10 Dec 2024 14:37:44 +0100 Subject: [PATCH 3/4] Feature/upgrade internationalized number to version 3.6.0 (#4112) * Upgrade @internationalized/number to version 3.6.0 * Refactoring * Update changelog --- CHANGELOG.md | 6 ++++++ libs/common/src/lib/helper.spec.ts | 14 +++++++------- package-lock.json | 8 ++++---- package.json | 2 +- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4771dc63..89651095b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Changed + +- Upgraded `@internationalized/number` from version `3.5.2` to `3.6.0` + ## 2.127.0 - 2024-12-08 ### Added diff --git a/libs/common/src/lib/helper.spec.ts b/libs/common/src/lib/helper.spec.ts index 22a171168..1126c3573 100644 --- a/libs/common/src/lib/helper.spec.ts +++ b/libs/common/src/lib/helper.spec.ts @@ -2,37 +2,37 @@ import { extractNumberFromString } from '@ghostfolio/common/helper'; describe('Helper', () => { describe('Extract number from string', () => { - it('Get decimal number', async () => { + it('Get decimal number', () => { expect(extractNumberFromString({ value: '999.99' })).toEqual(999.99); }); - it('Get decimal number (with spaces)', async () => { + it('Get decimal number (with spaces)', () => { expect(extractNumberFromString({ value: ' 999.99 ' })).toEqual(999.99); }); - it('Get decimal number (with currency)', async () => { + it('Get decimal number (with currency)', () => { expect(extractNumberFromString({ value: '999.99 CHF' })).toEqual(999.99); }); - it('Get decimal number (comma notation)', async () => { + it('Get decimal number (comma notation)', () => { expect( extractNumberFromString({ locale: 'de-DE', value: '999,99' }) ).toEqual(999.99); }); - it('Get decimal number with group (dot notation)', async () => { + it('Get decimal number with group (dot notation)', () => { expect( extractNumberFromString({ locale: 'de-CH', value: '99’999.99' }) ).toEqual(99999.99); }); - it('Get decimal number with group (comma notation)', async () => { + it('Get decimal number with group (comma notation)', () => { expect( extractNumberFromString({ locale: 'de-DE', value: '99.999,99' }) ).toEqual(99999.99); }); - it('Not a number', async () => { + it('Not a number', () => { expect(extractNumberFromString({ value: 'X' })).toEqual(NaN); }); }); diff --git a/package-lock.json b/package-lock.json index 9db369481..11a3138ff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,7 +28,7 @@ "@dfinity/identity": "0.15.7", "@dfinity/principal": "0.15.7", "@dinero.js/currencies": "2.0.0-alpha.8", - "@internationalized/number": "3.5.2", + "@internationalized/number": "3.6.0", "@nestjs/bull": "10.0.1", "@nestjs/cache-manager": "2.2.2", "@nestjs/common": "10.1.3", @@ -4126,9 +4126,9 @@ } }, "node_modules/@internationalized/number": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/@internationalized/number/-/number-3.5.2.tgz", - "integrity": "sha512-4FGHTi0rOEX1giSkt5MH4/te0eHBq3cvAYsfLlpguV6pzJAReXymiYpE5wPCqKqjkUO3PIsyvk+tBiIV1pZtbA==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/@internationalized/number/-/number-3.6.0.tgz", + "integrity": "sha512-PtrRcJVy7nw++wn4W2OuePQQfTqDzfusSuY1QTtui4wa7r+rGVtR75pO8CyKvHvzyQYi3Q1uO5sY0AsB4e65Bw==", "license": "Apache-2.0", "dependencies": { "@swc/helpers": "^0.5.0" diff --git a/package.json b/package.json index 598bc40b3..135829b1e 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "@dfinity/identity": "0.15.7", "@dfinity/principal": "0.15.7", "@dinero.js/currencies": "2.0.0-alpha.8", - "@internationalized/number": "3.5.2", + "@internationalized/number": "3.6.0", "@nestjs/bull": "10.0.1", "@nestjs/cache-manager": "2.2.2", "@nestjs/common": "10.1.3", From febb4119c661955debd04d0e4de0a01663b11306 Mon Sep 17 00:00:00 2001 From: Ed <35842874+calmandhandsome@users.noreply.github.com> Date: Wed, 11 Dec 2024 04:04:15 +0700 Subject: [PATCH 4/4] Bugfix/fix jsonpath import (#4115) * Fix jsonpath import * Update changelog --- CHANGELOG.md | 4 ++++ apps/api/src/services/data-provider/manual/manual.service.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89651095b..758e93ced 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Upgraded `@internationalized/number` from version `3.5.2` to `3.6.0` +### Fixed + +- Fixed the import of `jsonpath` to support REST APIs (`JSON`) via the scraper configuration + ## 2.127.0 - 2024-12-08 ### Added diff --git a/apps/api/src/services/data-provider/manual/manual.service.ts b/apps/api/src/services/data-provider/manual/manual.service.ts index 30c7efa6a..c3e274005 100644 --- a/apps/api/src/services/data-provider/manual/manual.service.ts +++ b/apps/api/src/services/data-provider/manual/manual.service.ts @@ -29,7 +29,7 @@ import * as cheerio from 'cheerio'; import { isUUID } from 'class-validator'; import { addDays, format, isBefore } from 'date-fns'; import got, { Headers } from 'got'; -import jsonpath from 'jsonpath'; +import * as jsonpath from 'jsonpath'; @Injectable() export class ManualService implements DataProviderInterface {