From 2a619e2ed759dd3534cec8dca428b0e3a284ab10 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Wed, 31 Dec 2025 18:26:15 +0100 Subject: [PATCH 1/6] Task/upgrade class-validator to version 0.14.3 (#6091) * Upgrade class-validator to version 0.14.3 * Update changelog --- CHANGELOG.md | 6 ++++++ package-lock.json | 18 +++++++++--------- package.json | 2 +- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 65a8794e9..51e189518 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 `class-validator` from version `0.14.2` to `0.14.3` + ## 2.225.0 - 2025-12-31 ### Added diff --git a/package-lock.json b/package-lock.json index f7deee502..45a100d6f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -53,7 +53,7 @@ "chartjs-plugin-datalabels": "2.2.0", "cheerio": "1.0.0", "class-transformer": "0.5.1", - "class-validator": "0.14.2", + "class-validator": "0.14.3", "color": "5.0.3", "countries-and-timezones": "3.8.0", "countries-list": "3.2.0", @@ -12687,9 +12687,9 @@ "optional": true }, "node_modules/@types/validator": { - "version": "13.15.2", - "resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.15.2.tgz", - "integrity": "sha512-y7pa/oEJJ4iGYBxOpfAKn5b9+xuihvzDVnC/OSvlVnGxVg0pOqmjiMafiJ1KVNQEaPZf9HsEp5icEwGg8uIe5Q==", + "version": "13.15.10", + "resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.15.10.tgz", + "integrity": "sha512-T8L6i7wCuyoK8A/ZeLYt1+q0ty3Zb9+qbSSvrIVitzT3YjZqkTZ40IbRsPanlB4h1QB3JVL1SYCdR6ngtFYcuA==", "license": "MIT" }, "node_modules/@types/ws": { @@ -15635,14 +15635,14 @@ "license": "MIT" }, "node_modules/class-validator": { - "version": "0.14.2", - "resolved": "https://registry.npmjs.org/class-validator/-/class-validator-0.14.2.tgz", - "integrity": "sha512-3kMVRF2io8N8pY1IFIXlho9r8IPUUIfHe2hYVtiebvAzU2XeQFXTv+XI4WX+TnXmtwXMDcjngcpkiPM0O9PvLw==", + "version": "0.14.3", + "resolved": "https://registry.npmjs.org/class-validator/-/class-validator-0.14.3.tgz", + "integrity": "sha512-rXXekcjofVN1LTOSw+u4u9WXVEUvNBVjORW154q/IdmYWy1nMbOU9aNtZB0t8m+FJQ9q91jlr2f9CwwUFdFMRA==", "license": "MIT", "dependencies": { - "@types/validator": "^13.11.8", + "@types/validator": "^13.15.3", "libphonenumber-js": "^1.11.1", - "validator": "^13.9.0" + "validator": "^13.15.20" } }, "node_modules/clean-css": { diff --git a/package.json b/package.json index c5f40be89..bc7c0d46f 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ "chartjs-plugin-datalabels": "2.2.0", "cheerio": "1.0.0", "class-transformer": "0.5.1", - "class-validator": "0.14.2", + "class-validator": "0.14.3", "color": "5.0.3", "countries-and-timezones": "3.8.0", "countries-list": "3.2.0", From 57ed1fadb21a5ba16a4700f259eeb85007f7e02f Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Thu, 1 Jan 2026 08:18:47 +0100 Subject: [PATCH 2/6] Task/update year to 2026 (#6119) * Update year --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 822825b57..fc16435bf 100644 --- a/README.md +++ b/README.md @@ -331,6 +331,6 @@ If you like to support this project, become a [**Sponsor**](https://github.com/s ## License -© 2021 - 2025 [Ghostfolio](https://ghostfol.io) +© 2021 - 2026 [Ghostfolio](https://ghostfol.io) Licensed under the [AGPLv3 License](https://www.gnu.org/licenses/agpl-3.0.html). From 549436d919fb5957ff44608ad84853085a353b5b Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Thu, 1 Jan 2026 15:12:08 +0100 Subject: [PATCH 3/6] Task/extend data providers content in self-hosting FAQ (#6123) * Extend data providers content * Update changelog --- CHANGELOG.md | 4 ++++ README.md | 4 +++- .../faq/self-hosting/self-hosting-page.html | 17 +++++++++++++---- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 51e189518..43e559503 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Added + +- Extended the content of the _Self-Hosting_ section by information about additional data providers on the Frequently Asked Questions (FAQ) page + ### Changed - Upgraded `class-validator` from version `0.14.2` to `0.14.3` diff --git a/README.md b/README.md index fc16435bf..35276b232 100644 --- a/README.md +++ b/README.md @@ -241,7 +241,7 @@ Deprecated: `GET http://localhost:3333/api/v1/auth/anonymous/Which data providers are supported? COINGECKO, MANUAL and - YAHOO are officially supported while all other data - providers are considered experimental.COINGECKO, GHOSTFOLIO (available with + Ghostfolio Premium), MANUAL, and YAHOO are officially + supported while all other data providers are considered + experimental. @@ -147,7 +155,8 @@ > Yes, access to a professional data provider is included with a + >Yes, access to a professional data provider (GHOSTFOLIO) + is included with a Date: Thu, 1 Jan 2026 15:12:36 +0100 Subject: [PATCH 4/6] Task/upgrade yahoo-finance2 to version 3.11.2 (#6126) * Upgrade yahoo-finance2 to version 3.11.2 * Update changelog --- CHANGELOG.md | 1 + package-lock.json | 8 ++++---- package.json | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43e559503..676ea346d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Upgraded `class-validator` from version `0.14.2` to `0.14.3` +- Upgraded `yahoo-finance2` from version `3.10.2` to `3.11.2` ## 2.225.0 - 2025-12-31 diff --git a/package-lock.json b/package-lock.json index 45a100d6f..934191dda 100644 --- a/package-lock.json +++ b/package-lock.json @@ -88,7 +88,7 @@ "svgmap": "2.14.0", "tablemark": "4.1.0", "twitter-api-v2": "1.27.0", - "yahoo-finance2": "3.10.2", + "yahoo-finance2": "3.11.2", "zone.js": "0.16.0" }, "devDependencies": { @@ -35183,9 +35183,9 @@ } }, "node_modules/yahoo-finance2": { - "version": "3.10.2", - "resolved": "https://registry.npmjs.org/yahoo-finance2/-/yahoo-finance2-3.10.2.tgz", - "integrity": "sha512-MH4EdugRurygLTMd1UryPwfYR8aWSOeyh++JSarMrf+bROfvNGmE0lAi/C9TuTc3mH8ORuRdt+O9PEeCCmzTLg==", + "version": "3.11.2", + "resolved": "https://registry.npmjs.org/yahoo-finance2/-/yahoo-finance2-3.11.2.tgz", + "integrity": "sha512-SIvMXjrOktBRD8m+qXAGCK+vR1vwBKuMgCnvmbxv29+t6LTDu0vAUxNYfbigsMRTmBzS4F9TQwbYF90g3Om4HA==", "license": "MIT", "dependencies": { "@deno/shim-deno": "~0.18.0", diff --git a/package.json b/package.json index bc7c0d46f..2762d027a 100644 --- a/package.json +++ b/package.json @@ -132,7 +132,7 @@ "svgmap": "2.14.0", "tablemark": "4.1.0", "twitter-api-v2": "1.27.0", - "yahoo-finance2": "3.10.2", + "yahoo-finance2": "3.11.2", "zone.js": "0.16.0" }, "devDependencies": { From f67fc0edbbd2138ed8862e580fe7f2e6e1646dad Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Thu, 1 Jan 2026 15:17:12 +0100 Subject: [PATCH 5/6] Release 2.226.0 (#6127) --- 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 676ea346d..088dd774b 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.226.0 - 2026-01-01 ### Added diff --git a/package-lock.json b/package-lock.json index 934191dda..9e897adc4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ghostfolio", - "version": "2.225.0", + "version": "2.226.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ghostfolio", - "version": "2.225.0", + "version": "2.226.0", "hasInstallScript": true, "license": "AGPL-3.0", "dependencies": { diff --git a/package.json b/package.json index 2762d027a..464a9a7cd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ghostfolio", - "version": "2.225.0", + "version": "2.226.0", "homepage": "https://ghostfol.io", "license": "AGPL-3.0", "repository": "https://github.com/ghostfolio/ghostfolio", From 7999ff973b8aab86f1f6b064ec3424fa8a34207f Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Fri, 2 Jan 2026 10:43:39 +0100 Subject: [PATCH 6/6] Bugfix/jsonpath import in manual service (#6129) * Fix jsonpath import * Update changelog --- CHANGELOG.md | 6 +++++ apps/api/src/helper/object.helper.spec.ts | 22 ++++++++++++++++++- apps/api/src/helper/object.helper.ts | 11 ++++++++++ .../data-provider/manual/manual.service.ts | 11 +++++++--- package-lock.json | 8 +++++++ package.json | 1 + 6 files changed, 55 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 088dd774b..2ee1be4c1 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 + +### Fixed + +- Fixed the import of `jsonpath` to support REST APIs (`JSON`) via the scraper configuration + ## 2.226.0 - 2026-01-01 ### Added diff --git a/apps/api/src/helper/object.helper.spec.ts b/apps/api/src/helper/object.helper.spec.ts index 433490325..e1ec81b8f 100644 --- a/apps/api/src/helper/object.helper.spec.ts +++ b/apps/api/src/helper/object.helper.spec.ts @@ -1,4 +1,24 @@ -import { redactAttributes } from './object.helper'; +import { query, redactAttributes } from './object.helper'; + +describe('query', () => { + it('should get market price from stock API response', () => { + const object = { + currency: 'USD', + market: { + previousClose: 273.04, + price: 271.86 + }, + symbol: 'AAPL' + }; + + const result = query({ + object, + pathExpression: '$.market.price' + })[0]; + + expect(result).toBe(271.86); + }); +}); describe('redactAttributes', () => { it('should redact provided attributes', () => { diff --git a/apps/api/src/helper/object.helper.ts b/apps/api/src/helper/object.helper.ts index a5854e9d9..6bb6579d2 100644 --- a/apps/api/src/helper/object.helper.ts +++ b/apps/api/src/helper/object.helper.ts @@ -1,4 +1,5 @@ import { Big } from 'big.js'; +import jsonpath from 'jsonpath'; import { cloneDeep, isArray, isObject } from 'lodash'; export function hasNotDefinedValuesInObject(aObject: Object): boolean { @@ -31,6 +32,16 @@ export function nullifyValuesInObjects(aObjects: T[], keys: string[]): T[] { }); } +export function query({ + object, + pathExpression +}: { + object: object; + pathExpression: string; +}) { + return jsonpath.query(object, pathExpression); +} + export function redactAttributes({ isFirstRun = true, object, 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 f18da49ab..7392f0914 100644 --- a/apps/api/src/services/data-provider/manual/manual.service.ts +++ b/apps/api/src/services/data-provider/manual/manual.service.ts @@ -1,3 +1,4 @@ +import { query } from '@ghostfolio/api/helper/object.helper'; import { ConfigurationService } from '@ghostfolio/api/services/configuration/configuration.service'; import { DataProviderInterface, @@ -26,7 +27,6 @@ import { Injectable, Logger } from '@nestjs/common'; import { DataSource, SymbolProfile } from '@prisma/client'; import * as cheerio from 'cheerio'; import { addDays, format, isBefore } from 'date-fns'; -import * as jsonpath from 'jsonpath'; @Injectable() export class ManualService implements DataProviderInterface { @@ -286,9 +286,14 @@ export class ManualService implements DataProviderInterface { let value: string; if (response.headers.get('content-type')?.includes('application/json')) { - const data = await response.json(); + const object = await response.json(); - value = String(jsonpath.query(data, scraperConfiguration.selector)[0]); + value = String( + query({ + object, + pathExpression: scraperConfiguration.selector + })[0] + ); } else { const $ = cheerio.load(await response.text()); diff --git a/package-lock.json b/package-lock.json index 9e897adc4..6512d2162 100644 --- a/package-lock.json +++ b/package-lock.json @@ -124,6 +124,7 @@ "@types/big.js": "6.2.2", "@types/google-spreadsheet": "3.1.5", "@types/jest": "30.0.0", + "@types/jsonpath": "0.2.4", "@types/lodash": "4.17.20", "@types/node": "22.15.17", "@types/papaparse": "5.3.7", @@ -12436,6 +12437,13 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/jsonpath": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/@types/jsonpath/-/jsonpath-0.2.4.tgz", + "integrity": "sha512-K3hxB8Blw0qgW6ExKgMbXQv2UPZBoE2GqLpVY+yr7nMD2Pq86lsuIzyAaiQ7eMqFL5B6di6pxSkogLJEyEHoGA==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/jsonwebtoken": { "version": "9.0.10", "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.10.tgz", diff --git a/package.json b/package.json index 464a9a7cd..59a455ae1 100644 --- a/package.json +++ b/package.json @@ -168,6 +168,7 @@ "@types/big.js": "6.2.2", "@types/google-spreadsheet": "3.1.5", "@types/jest": "30.0.0", + "@types/jsonpath": "0.2.4", "@types/lodash": "4.17.20", "@types/node": "22.15.17", "@types/papaparse": "5.3.7",