diff --git a/CHANGELOG.md b/CHANGELOG.md index e27de4e2b..ab4265dc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,11 +11,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added the data provider information to the asset profile details dialog of the admin control +### Fixed + +- Fixed an issue with the initial annual interest rate in the _FIRE_ calculator + +## 2.83.0 - 2024-05-30 + ### Changed +- Upgraded `@nestjs/passport` from version `10.0.0` to `10.0.3` - Upgraded `angular` from version `17.3.5` to `17.3.10` +- Upgraded `class-validator` from version `0.14.0` to `0.14.1` +- Upgraded `countup.js` from version `2.3.2` to `2.8.0` - Upgraded `Nx` from version `19.0.2` to `19.0.5` +- Upgraded `passport` from version `0.6.0` to `0.7.0` +- Upgraded `passport-jwt` from version `4.0.0` to `4.0.1` - Upgraded `prisma` from version `5.13.0` to `5.14.0` +- Upgraded `yahoo-finance2` from version `2.11.2` to `2.11.3` ## 2.82.0 - 2024-05-22 diff --git a/apps/api/src/app/auth/google.strategy.ts b/apps/api/src/app/auth/google.strategy.ts index 4abc1105a..4d024603b 100644 --- a/apps/api/src/app/auth/google.strategy.ts +++ b/apps/api/src/app/auth/google.strategy.ts @@ -3,7 +3,7 @@ import { ConfigurationService } from '@ghostfolio/api/services/configuration/con import { Injectable, Logger } from '@nestjs/common'; import { PassportStrategy } from '@nestjs/passport'; import { Provider } from '@prisma/client'; -import { Strategy } from 'passport-google-oauth20'; +import { Profile, Strategy } from 'passport-google-oauth20'; import { AuthService } from './auth.service'; @@ -11,7 +11,7 @@ import { AuthService } from './auth.service'; export class GoogleStrategy extends PassportStrategy(Strategy, 'google') { public constructor( private readonly authService: AuthService, - readonly configurationService: ConfigurationService + private readonly configurationService: ConfigurationService ) { super({ callbackURL: `${configurationService.get( @@ -20,7 +20,7 @@ export class GoogleStrategy extends PassportStrategy(Strategy, 'google') { clientID: configurationService.get('GOOGLE_CLIENT_ID'), clientSecret: configurationService.get('GOOGLE_SECRET'), passReqToCallback: true, - scope: ['email', 'profile'] + scope: ['profile'] }); } @@ -28,20 +28,17 @@ export class GoogleStrategy extends PassportStrategy(Strategy, 'google') { request: any, token: string, refreshToken: string, - profile, + profile: Profile, done: Function, done2: Function ) { try { - const jwt: string = await this.authService.validateOAuthLogin({ + const jwt = await this.authService.validateOAuthLogin({ provider: Provider.GOOGLE, thirdPartyId: profile.id }); - const user = { - jwt - }; - done(null, user); + done(null, { jwt }); } catch (error) { Logger.error(error, 'GoogleStrategy'); done(error, false); diff --git a/libs/ui/src/lib/fire-calculator/fire-calculator.component.ts b/libs/ui/src/lib/fire-calculator/fire-calculator.component.ts index 4f6c8dc08..bd52d8b79 100644 --- a/libs/ui/src/lib/fire-calculator/fire-calculator.component.ts +++ b/libs/ui/src/lib/fire-calculator/fire-calculator.component.ts @@ -123,19 +123,6 @@ export class GfFireCalculatorComponent implements OnChanges, OnDestroy { Tooltip ); - this.calculatorForm.setValue( - { - annualInterestRate: this.annualInterestRate, - paymentPerPeriod: this.savingsRate, - principalInvestmentAmount: 0, - projectedTotalAmount: this.projectedTotalAmount, - retirementDate: this.retirementDate ?? this.DEFAULT_RETIREMENT_DATE - }, - { - emitEvent: false - } - ); - this.calculatorForm.valueChanges .pipe(takeUntil(this.unsubscribeSubject)) .subscribe(() => { @@ -169,9 +156,22 @@ export class GfFireCalculatorComponent implements OnChanges, OnDestroy { } public ngOnChanges() { - this.periodsToRetire = this.getPeriodsToRetire(); - if (isNumber(this.fireWealth) && this.fireWealth >= 0) { + this.calculatorForm.setValue( + { + annualInterestRate: this.annualInterestRate, + paymentPerPeriod: this.savingsRate, + principalInvestmentAmount: 0, + projectedTotalAmount: this.projectedTotalAmount, + retirementDate: this.retirementDate ?? this.DEFAULT_RETIREMENT_DATE + }, + { + emitEvent: false + } + ); + + this.periodsToRetire = this.getPeriodsToRetire(); + setTimeout(() => { // Wait for the chartCanvas this.calculatorForm.patchValue( @@ -409,9 +409,9 @@ export class GfFireCalculatorComponent implements OnChanges, OnDestroy { if (this.projectedTotalAmount) { const periods = this.fireCalculatorService.calculatePeriodsToRetire({ P: this.getP(), - totalAmount: this.projectedTotalAmount, PMT: this.getPMT(), - r: this.getR() + r: this.getR(), + totalAmount: this.projectedTotalAmount }); return periods; diff --git a/package.json b/package.json index 7843fbd83..bab74e542 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ghostfolio", - "version": "2.82.0", + "version": "2.83.0", "homepage": "https://ghostfol.io", "license": "AGPL-3.0", "repository": "https://github.com/ghostfolio/ghostfolio", @@ -80,7 +80,7 @@ "@nestjs/core": "10.1.3", "@nestjs/event-emitter": "2.0.4", "@nestjs/jwt": "10.1.0", - "@nestjs/passport": "10.0.0", + "@nestjs/passport": "10.0.3", "@nestjs/platform-express": "10.1.3", "@nestjs/schedule": "3.0.2", "@nestjs/serve-static": "4.0.0", @@ -101,11 +101,11 @@ "chartjs-plugin-datalabels": "2.2.0", "cheerio": "1.0.0-rc.12", "class-transformer": "0.5.1", - "class-validator": "0.14.0", + "class-validator": "0.14.1", "color": "4.2.3", "countries-and-timezones": "3.4.1", "countries-list": "3.1.0", - "countup.js": "2.3.2", + "countup.js": "2.8.0", "date-fns": "2.29.3", "envalid": "7.3.1", "google-spreadsheet": "3.2.0", @@ -123,9 +123,9 @@ "ngx-skeleton-loader": "7.0.0", "ngx-stripe": "15.5.0", "papaparse": "5.3.1", - "passport": "0.6.0", + "passport": "0.7.0", "passport-google-oauth20": "2.0.0", - "passport-jwt": "4.0.0", + "passport-jwt": "4.0.1", "prisma": "5.14.0", "reflect-metadata": "0.1.13", "rxjs": "7.5.6", @@ -133,7 +133,7 @@ "svgmap": "2.6.0", "twitter-api-v2": "1.14.2", "uuid": "9.0.1", - "yahoo-finance2": "2.11.2", + "yahoo-finance2": "2.11.3", "zone.js": "0.14.5" }, "devDependencies": { @@ -175,7 +175,7 @@ "@types/lodash": "4.17.0", "@types/node": "18.16.9", "@types/papaparse": "5.3.7", - "@types/passport-google-oauth20": "2.0.11", + "@types/passport-google-oauth20": "2.0.16", "@typescript-eslint/eslint-plugin": "6.21.0", "@typescript-eslint/parser": "6.21.0", "codelyzer": "6.0.1", diff --git a/yarn.lock b/yarn.lock index 922c97b5d..12b0bdf30 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4830,10 +4830,10 @@ "@types/jsonwebtoken" "9.0.2" jsonwebtoken "9.0.0" -"@nestjs/passport@10.0.0": - version "10.0.0" - resolved "https://registry.yarnpkg.com/@nestjs/passport/-/passport-10.0.0.tgz#92d36d4b8796b373da3f4d1a055db03cb246b127" - integrity sha512-IlKKc6M7JOe+4dBbW6gZsXBSD05ZYgwfGf3GJhgCmUGYVqffpDdALQSS6JftnExrE+12rACoEmHkzYwKAGVK0Q== +"@nestjs/passport@10.0.3": + version "10.0.3" + resolved "https://registry.yarnpkg.com/@nestjs/passport/-/passport-10.0.3.tgz#26ec5b2167d364e04962c115fcef80d10e185367" + integrity sha512-znJ9Y4S8ZDVY+j4doWAJ8EuuVO7SkQN3yOBmzxbGaXbvcSwFDAdGJ+OMCg52NdzIO4tQoN4pYKx8W6M0ArfFRQ== "@nestjs/platform-express@10.1.3": version "10.1.3" @@ -7470,10 +7470,10 @@ resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.1.tgz#27f7559836ad796cea31acb63163b203756a5b4e" integrity sha512-3YmXzzPAdOTVljVMkTMBdBEvlOLg2cDQaDhnnhT3nT9uDbnJzjWhKlzb+desT12Y7tGqaN6d+AbozcKzyL36Ng== -"@types/passport-google-oauth20@2.0.11": - version "2.0.11" - resolved "https://registry.yarnpkg.com/@types/passport-google-oauth20/-/passport-google-oauth20-2.0.11.tgz#271ec71de3030a3e1c004b24e633e4b298ccba97" - integrity sha512-9XMT1GfwhZL7UQEiCepLef55RNPHkbrCtsU7rsWPTEOsmu5qVIW8nSemtB4p+P24CuOhA+IKkv8LsPThYghGww== +"@types/passport-google-oauth20@2.0.16": + version "2.0.16" + resolved "https://registry.yarnpkg.com/@types/passport-google-oauth20/-/passport-google-oauth20-2.0.16.tgz#9e39c1203d56496d89392538e6109626e253bc28" + integrity sha512-ayXK2CJ7uVieqhYOc6k/pIr5pcQxOLB6kBev+QUGS7oEZeTgIs1odDobXRqgfBPvXzl0wXCQHftV5220czZCPA== dependencies: "@types/express" "*" "@types/passport" "*" @@ -7640,10 +7640,10 @@ resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-9.0.7.tgz#b14cebc75455eeeb160d5fe23c2fcc0c64f724d8" integrity sha512-WUtIVRUZ9i5dYXefDEAI7sh9/O7jGvHg7Df/5O/gtH3Yabe5odI3UWopVR1qbPXQtvOxWu3mM4XxlYeZtMWF4g== -"@types/validator@^13.7.10": - version "13.11.5" - resolved "https://registry.yarnpkg.com/@types/validator/-/validator-13.11.5.tgz#1911964fd5556b08d3479d1ded977c06f89a44a7" - integrity sha512-xW4qsT4UIYILu+7ZrBnfQdBYniZrMLYYK3wN9M/NdeIHgBN5pZI2/8Q7UfdWIcr5RLJv/OGENsx91JIpUUoC7Q== +"@types/validator@^13.11.8": + version "13.11.10" + resolved "https://registry.yarnpkg.com/@types/validator/-/validator-13.11.10.tgz#feb364018cdd1f3d970a9e8c7f1c314c0a264fff" + integrity sha512-e2PNXoXLr6Z+dbfx5zSh9TRlXJrELycxiaXznp4S5+D2M3b9bqJEitNHA5923jhnB2zzFiZHa2f0SI1HoIahpg== "@types/webpack-env@^1.18.0": version "1.18.3" @@ -9442,14 +9442,14 @@ class-transformer@0.5.1: resolved "https://registry.yarnpkg.com/class-transformer/-/class-transformer-0.5.1.tgz#24147d5dffd2a6cea930a3250a677addf96ab336" integrity sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw== -class-validator@0.14.0: - version "0.14.0" - resolved "https://registry.yarnpkg.com/class-validator/-/class-validator-0.14.0.tgz#40ed0ecf3c83b2a8a6a320f4edb607be0f0df159" - integrity sha512-ct3ltplN8I9fOwUd8GrP8UQixwff129BkEtuWDKL5W45cQuLd19xqmTLu5ge78YDm/fdje6FMt0hGOhl0lii3A== +class-validator@0.14.1: + version "0.14.1" + resolved "https://registry.yarnpkg.com/class-validator/-/class-validator-0.14.1.tgz#ff2411ed8134e9d76acfeb14872884448be98110" + integrity sha512-2VEG9JICxIqTpoK1eMzZqaV+u/EiwEJkMGzTrZf6sU/fwsnOITVgYJ8yojSy6CaXtO9V0Cc6ZQZ8h8m4UBuLwQ== dependencies: - "@types/validator" "^13.7.10" - libphonenumber-js "^1.10.14" - validator "^13.7.0" + "@types/validator" "^13.11.8" + libphonenumber-js "^1.10.53" + validator "^13.9.0" clean-css@^5.2.2: version "5.3.2" @@ -9937,10 +9937,10 @@ countries-list@3.1.0: resolved "https://registry.yarnpkg.com/countries-list/-/countries-list-3.1.0.tgz#1cbe32f58659c7d6a1e744917689f24c84333ea8" integrity sha512-HpTBLZba1VPTZSjUnUwR7SykxV7Z/7/+ZM5x5wi5tO99Qvom6bE2SC+AQ18016ujg3jSlYBbMITrHNnPAHSM9Q== -countup.js@2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/countup.js/-/countup.js-2.3.2.tgz#9a91d95780be1c908d1e6feb548625f353f57988" - integrity sha512-dQ7F/CmKGjaO6cDfhtEXwsKVlXIpJ89dFs8PvkaZH9jBVJ2Z8GU4iwG/qP7MgY8qwr+1skbwR6qecWWQLUzB8Q== +countup.js@2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/countup.js/-/countup.js-2.8.0.tgz#64951f2df3ede28839413d654d8fef28251c32a8" + integrity sha512-f7xEhX0awl4NOElHulrl4XRfKoNH3rB+qfNSZZyjSZhaAoUk6elvhH+MNxMmlmuUJ2/QNTWPSA7U4mNtIAKljQ== create-jest@^29.7.0: version "29.7.0" @@ -14217,10 +14217,10 @@ jsonwebtoken@9.0.0: ms "^2.1.1" semver "^7.3.8" -jsonwebtoken@^8.2.0: - version "8.5.1" - resolved "https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz#00e71e0b8df54c2121a1f26137df2280673bcc0d" - integrity sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w== +jsonwebtoken@^9.0.0: + version "9.0.2" + resolved "https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz#65ff91f4abef1784697d40952bb1998c504caaf3" + integrity sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ== dependencies: jws "^3.2.2" lodash.includes "^4.3.0" @@ -14231,7 +14231,7 @@ jsonwebtoken@^8.2.0: lodash.isstring "^4.0.1" lodash.once "^4.0.0" ms "^2.1.1" - semver "^5.6.0" + semver "^7.5.4" jsprim@^2.0.2: version "2.0.2" @@ -14417,10 +14417,10 @@ levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" -libphonenumber-js@^1.10.14: - version "1.10.48" - resolved "https://registry.yarnpkg.com/libphonenumber-js/-/libphonenumber-js-1.10.48.tgz#3c426b4aa21dfe3210bfbda47d208acffa3631bf" - integrity sha512-Vvcgt4+o8+puIBJZLdMshPYx9nRN3/kTT7HPtOyfYrSQuN9PGBF1KUv0g07fjNzt4E4GuA7FnsLb+WeAMzyRQg== +libphonenumber-js@^1.10.53: + version "1.11.1" + resolved "https://registry.yarnpkg.com/libphonenumber-js/-/libphonenumber-js-1.11.1.tgz#2596683e1876bfee74082bb49339fe0a85ae34f9" + integrity sha512-Wze1LPwcnzvcKGcRHFGFECTaLzxOtujwpf924difr5zniyYv1C2PiW0419qDR7m8lKDxsImu5mwxFuXhXpjmvw== license-webpack-plugin@4.0.2, license-webpack-plugin@^4.0.2: version "4.0.2" @@ -16110,12 +16110,12 @@ passport-google-oauth20@2.0.0: dependencies: passport-oauth2 "1.x.x" -passport-jwt@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/passport-jwt/-/passport-jwt-4.0.0.tgz#7f0be7ba942e28b9f5d22c2ebbb8ce96ef7cf065" - integrity sha512-BwC0n2GP/1hMVjR4QpnvqA61TxenUMlmfNjYNgK0ZAs0HK4SOQkHcSv4L328blNTLtHq7DbmvyNJiH+bn6C5Mg== +passport-jwt@4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/passport-jwt/-/passport-jwt-4.0.1.tgz#c443795eff322c38d173faa0a3c481479646ec3d" + integrity sha512-UCKMDYhNuGOBE9/9Ycuoyh7vP6jpeTp/+sfMJl7nLff/t6dps+iaeE0hhNkKN8/HZHcJ7lCdOyDxHdDoxoSvdQ== dependencies: - jsonwebtoken "^8.2.0" + jsonwebtoken "^9.0.0" passport-strategy "^1.0.0" passport-oauth2@1.x.x: @@ -16134,10 +16134,10 @@ passport-strategy@1.x.x, passport-strategy@^1.0.0: resolved "https://registry.yarnpkg.com/passport-strategy/-/passport-strategy-1.0.0.tgz#b5539aa8fc225a3d1ad179476ddf236b440f52e4" integrity sha512-CB97UUvDKJde2V0KDWWB3lyf6PC3FaZP7YxZ2G8OAtn9p4HI9j9JLP9qjOGZFvyl8uwNT8qM+hGnz/n16NI7oA== -passport@0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/passport/-/passport-0.6.0.tgz#e869579fab465b5c0b291e841e6cc95c005fac9d" - integrity sha512-0fe+p3ZnrWRW74fe8+SvCyf4a3Pb2/h7gFkQ8yTJpAO50gDzlfjZUZTO1k5Eg9kUct22OxHLqDZoKUWRHOh9ug== +passport@0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/passport/-/passport-0.7.0.tgz#3688415a59a48cf8068417a8a8092d4492ca3a05" + integrity sha512-cPLl+qZpSc+ireUvt+IzqbED1cHHkDoVYMo30jbJIdOOjQ1MQYZBPiNvmi8UM6lJuOpTPXJGZQk0DtC4y61MYQ== dependencies: passport-strategy "1.x.x" pause "0.0.1" @@ -19185,10 +19185,10 @@ validate-npm-package-name@^5.0.0: dependencies: builtins "^5.0.0" -validator@^13.7.0: - version "13.11.0" - resolved "https://registry.yarnpkg.com/validator/-/validator-13.11.0.tgz#23ab3fd59290c61248364eabf4067f04955fbb1b" - integrity sha512-Ii+sehpSfZy+At5nPdnyMhx78fEoPDkR2XW/zimHEL3MyGJQOCQ7WeP20jPYRz7ZCpcKLB21NxuXHF3bxjStBQ== +validator@^13.9.0: + version "13.12.0" + resolved "https://registry.yarnpkg.com/validator/-/validator-13.12.0.tgz#7d78e76ba85504da3fee4fd1922b385914d4b35f" + integrity sha512-c1Q0mCiPlgdTVVVIJIrBuxNicYE+t/7oKeI9MWLj3fh/uq2Pxh/3eeWbVZ4OcGW1TUf53At0njHw5SMdA3tmMg== vary@^1, vary@~1.1.2: version "1.1.2" @@ -19662,10 +19662,10 @@ y18n@^5.0.5: resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== -yahoo-finance2@2.11.2: - version "2.11.2" - resolved "https://registry.yarnpkg.com/yahoo-finance2/-/yahoo-finance2-2.11.2.tgz#44f35105a2500fd1da22ac4f4393106f2bfec6d1" - integrity sha512-S5lHKqneMXMKN/rxowqErEfkvXJE6s/SPuekT7UkOVbsSyRcptea/U3Mud+ikOEXEbKXPiZrU0Jy+iF51ITuSw== +yahoo-finance2@2.11.3: + version "2.11.3" + resolved "https://registry.yarnpkg.com/yahoo-finance2/-/yahoo-finance2-2.11.3.tgz#082fb14ac6312f3b91be4e9a0cc1a97e96c42944" + integrity sha512-yN4ADFNi2oNYtO79ntbEkSWdVi4KVmGYLwDJ5KV0czxILbAGj4ah6oCBYvMONeHAeDqxtS62zrG8xrHNF/2STw== dependencies: "@types/tough-cookie" "^4.0.2" ajv "8.10.0"