From 6246f4c500d687fee35c2359e328730a01dcfe7a Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 5 Jul 2025 16:46:10 +0200 Subject: [PATCH 1/2] Feature/upgrade prisma to version 6.11.1 (#5087) * Upgrade prisma to version 6.11.1 * Update changelog --- CHANGELOG.md | 1 + package-lock.json | 72 +++++++++++++++++++++++------------------------ package.json | 4 +-- 3 files changed, 39 insertions(+), 38 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85f68d54a..f4993089f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Improved the language localization for Italian (`it`) +- Upgraded `prisma` from version `6.10.1` to `6.11.1` ## 2.177.0 - 2025-07-03 diff --git a/package-lock.json b/package-lock.json index 573a2c802..bc2b6d82a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,7 +43,7 @@ "@nestjs/schedule": "6.0.0", "@nestjs/serve-static": "5.0.3", "@openrouter/ai-sdk-provider": "0.7.2", - "@prisma/client": "6.10.1", + "@prisma/client": "6.11.1", "@simplewebauthn/browser": "13.1.0", "@simplewebauthn/server": "13.1.1", "@stripe/stripe-js": "7.3.1", @@ -151,7 +151,7 @@ "nx": "21.1.2", "prettier": "3.6.2", "prettier-plugin-organize-attributes": "1.0.0", - "prisma": "6.10.1", + "prisma": "6.11.1", "react": "18.2.0", "react-dom": "18.2.0", "replace-in-file": "8.3.0", @@ -9895,9 +9895,9 @@ "license": "MIT" }, "node_modules/@prisma/client": { - "version": "6.10.1", - "resolved": "https://registry.npmjs.org/@prisma/client/-/client-6.10.1.tgz", - "integrity": "sha512-Re4pMlcUsQsUTAYMK7EJ4Bw2kg3WfZAAlr8GjORJaK4VOP6LxRQUQ1TuLnxcF42XqGkWQ36q5CQF1yVadANQ6w==", + "version": "6.11.1", + "resolved": "https://registry.npmjs.org/@prisma/client/-/client-6.11.1.tgz", + "integrity": "sha512-5CLFh8QP6KxRm83pJ84jaVCeSVPQr8k0L2SEtOJHwdkS57/VQDcI/wQpGmdyOZi+D9gdNabdo8tj1Uk+w+upsQ==", "hasInstallScript": true, "license": "Apache-2.0", "engines": { @@ -9917,9 +9917,9 @@ } }, "node_modules/@prisma/config": { - "version": "6.10.1", - "resolved": "https://registry.npmjs.org/@prisma/config/-/config-6.10.1.tgz", - "integrity": "sha512-kz4/bnqrOrzWo8KzYguN0cden4CzLJJ+2VSpKtF8utHS3l1JS0Lhv6BLwpOX6X9yNreTbZQZwewb+/BMPDCIYQ==", + "version": "6.11.1", + "resolved": "https://registry.npmjs.org/@prisma/config/-/config-6.11.1.tgz", + "integrity": "sha512-z6rCTQN741wxDq82cpdzx2uVykpnQIXalLhrWQSR0jlBVOxCIkz3HZnd8ern3uYTcWKfB3IpVAF7K2FU8t/8AQ==", "devOptional": true, "license": "Apache-2.0", "dependencies": { @@ -9937,53 +9937,53 @@ } }, "node_modules/@prisma/debug": { - "version": "6.10.1", - "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-6.10.1.tgz", - "integrity": "sha512-k2YT53cWxv9OLjW4zSYTZ6Z7j0gPfCzcr2Mj99qsuvlxr8WAKSZ2NcSR0zLf/mP4oxnYG842IMj3utTgcd7CaA==", + "version": "6.11.1", + "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-6.11.1.tgz", + "integrity": "sha512-lWRb/YSWu8l4Yum1UXfGLtqFzZkVS2ygkWYpgkbgMHn9XJlMITIgeMvJyX5GepChzhmxuSuiq/MY/kGFweOpGw==", "devOptional": true, "license": "Apache-2.0" }, "node_modules/@prisma/engines": { - "version": "6.10.1", - "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-6.10.1.tgz", - "integrity": "sha512-Q07P5rS2iPwk2IQr/rUQJ42tHjpPyFcbiH7PXZlV81Ryr9NYIgdxcUrwgVOWVm5T7ap02C0dNd1dpnNcSWig8A==", + "version": "6.11.1", + "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-6.11.1.tgz", + "integrity": "sha512-6eKEcV6V8W2eZAUwX2xTktxqPM4vnx3sxz3SDtpZwjHKpC6lhOtc4vtAtFUuf5+eEqBk+dbJ9Dcaj6uQU+FNNg==", "devOptional": true, "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "@prisma/debug": "6.10.1", - "@prisma/engines-version": "6.10.1-1.9b628578b3b7cae625e8c927178f15a170e74a9c", - "@prisma/fetch-engine": "6.10.1", - "@prisma/get-platform": "6.10.1" + "@prisma/debug": "6.11.1", + "@prisma/engines-version": "6.11.1-1.f40f79ec31188888a2e33acda0ecc8fd10a853a9", + "@prisma/fetch-engine": "6.11.1", + "@prisma/get-platform": "6.11.1" } }, "node_modules/@prisma/engines-version": { - "version": "6.10.1-1.9b628578b3b7cae625e8c927178f15a170e74a9c", - "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-6.10.1-1.9b628578b3b7cae625e8c927178f15a170e74a9c.tgz", - "integrity": "sha512-ZJFTsEqapiTYVzXya6TUKYDFnSWCNegfUiG5ik9fleQva5Sk3DNyyUi7X1+0ZxWFHwHDr6BZV5Vm+iwP+LlciA==", + "version": "6.11.1-1.f40f79ec31188888a2e33acda0ecc8fd10a853a9", + "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-6.11.1-1.f40f79ec31188888a2e33acda0ecc8fd10a853a9.tgz", + "integrity": "sha512-swFJTOOg4tHyOM1zB/pHb3MeH0i6t7jFKn5l+ZsB23d9AQACuIRo9MouvuKGvnDogzkcjbWnXi/NvOZ0+n5Jfw==", "devOptional": true, "license": "Apache-2.0" }, "node_modules/@prisma/fetch-engine": { - "version": "6.10.1", - "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-6.10.1.tgz", - "integrity": "sha512-clmbG/Jgmrc/n6Y77QcBmAUlq9LrwI9Dbgy4pq5jeEARBpRCWJDJ7PWW1P8p0LfFU0i5fsyO7FqRzRB8mkdS4g==", + "version": "6.11.1", + "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-6.11.1.tgz", + "integrity": "sha512-NBYzmkXTkj9+LxNPRSndaAeALOL1Gr3tjvgRYNqruIPlZ6/ixLeuE/5boYOewant58tnaYFZ5Ne0jFBPfGXHpQ==", "devOptional": true, "license": "Apache-2.0", "dependencies": { - "@prisma/debug": "6.10.1", - "@prisma/engines-version": "6.10.1-1.9b628578b3b7cae625e8c927178f15a170e74a9c", - "@prisma/get-platform": "6.10.1" + "@prisma/debug": "6.11.1", + "@prisma/engines-version": "6.11.1-1.f40f79ec31188888a2e33acda0ecc8fd10a853a9", + "@prisma/get-platform": "6.11.1" } }, "node_modules/@prisma/get-platform": { - "version": "6.10.1", - "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-6.10.1.tgz", - "integrity": "sha512-4CY5ndKylcsce9Mv+VWp5obbR2/86SHOLVV053pwIkhVtT9C9A83yqiqI/5kJM9T1v1u1qco/bYjDKycmei9HA==", + "version": "6.11.1", + "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-6.11.1.tgz", + "integrity": "sha512-b2Z8oV2gwvdCkFemBTFd0x4lsL4O2jLSx8lB7D+XqoFALOQZPa7eAPE1NU0Mj1V8gPHRxIsHnyUNtw2i92psUw==", "devOptional": true, "license": "Apache-2.0", "dependencies": { - "@prisma/debug": "6.10.1" + "@prisma/debug": "6.11.1" } }, "node_modules/@redis/client": { @@ -29469,15 +29469,15 @@ } }, "node_modules/prisma": { - "version": "6.10.1", - "resolved": "https://registry.npmjs.org/prisma/-/prisma-6.10.1.tgz", - "integrity": "sha512-khhlC/G49E4+uyA3T3H5PRBut486HD2bDqE2+rvkU0pwk9IAqGFacLFUyIx9Uw+W2eCtf6XGwsp+/strUwMNPw==", + "version": "6.11.1", + "resolved": "https://registry.npmjs.org/prisma/-/prisma-6.11.1.tgz", + "integrity": "sha512-VzJToRlV0s9Vu2bfqHiRJw73hZNCG/AyJeX+kopbu4GATTjTUdEWUteO3p4BLYoHpMS4o8pD3v6tF44BHNZI1w==", "devOptional": true, "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "@prisma/config": "6.10.1", - "@prisma/engines": "6.10.1" + "@prisma/config": "6.11.1", + "@prisma/engines": "6.11.1" }, "bin": { "prisma": "build/index.js" diff --git a/package.json b/package.json index 46aea823f..342f4db54 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ "@nestjs/schedule": "6.0.0", "@nestjs/serve-static": "5.0.3", "@openrouter/ai-sdk-provider": "0.7.2", - "@prisma/client": "6.10.1", + "@prisma/client": "6.11.1", "@simplewebauthn/browser": "13.1.0", "@simplewebauthn/server": "13.1.1", "@stripe/stripe-js": "7.3.1", @@ -197,7 +197,7 @@ "nx": "21.1.2", "prettier": "3.6.2", "prettier-plugin-organize-attributes": "1.0.0", - "prisma": "6.10.1", + "prisma": "6.11.1", "react": "18.2.0", "react-dom": "18.2.0", "replace-in-file": "8.3.0", From 9c37bca43a61a5d6628abb7c770ae3603bf0061e Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 5 Jul 2025 17:08:10 +0200 Subject: [PATCH 2/2] Feature/rename Access to accessesGet in User database schema (#5094) * Rename Access to accessesGet in User database schema * Update changelog --- CHANGELOG.md | 1 + apps/api/src/app/user/user.service.ts | 6 +++--- libs/common/src/lib/permissions.ts | 2 +- libs/common/src/lib/types/user-with-settings.type.ts | 2 +- prisma/schema.prisma | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4993089f..e27460ad6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Renamed `Access` to `accessesGet` in the `User` database schema - Improved the language localization for Italian (`it`) - Upgraded `prisma` from version `6.10.1` to `6.11.1` diff --git a/apps/api/src/app/user/user.service.ts b/apps/api/src/app/user/user.service.ts index 7b55210eb..1652a2b91 100644 --- a/apps/api/src/app/user/user.service.ts +++ b/apps/api/src/app/user/user.service.ts @@ -180,7 +180,7 @@ export class UserService { userWhereUniqueInput: Prisma.UserWhereUniqueInput ): Promise { const { - Access, + accessesGet, accessToken, accounts, analytics, @@ -195,7 +195,7 @@ export class UserService { updatedAt } = await this.prismaService.user.findUnique({ include: { - Access: true, + accessesGet: true, accounts: { include: { platform: true } }, @@ -207,7 +207,7 @@ export class UserService { }); const user: UserWithSettings = { - Access, + accessesGet, accessToken, accounts, authChallenge, diff --git a/libs/common/src/lib/permissions.ts b/libs/common/src/lib/permissions.ts index 5bc8664b8..83ccdbb42 100644 --- a/libs/common/src/lib/permissions.ts +++ b/libs/common/src/lib/permissions.ts @@ -185,7 +185,7 @@ export function hasReadRestrictedAccessPermission({ return false; } - const access = user.Access?.find(({ id }) => { + const access = user.accessesGet?.find(({ id }) => { return id === impersonationId; }); diff --git a/libs/common/src/lib/types/user-with-settings.type.ts b/libs/common/src/lib/types/user-with-settings.type.ts index 9bff8c625..fc4a81280 100644 --- a/libs/common/src/lib/types/user-with-settings.type.ts +++ b/libs/common/src/lib/types/user-with-settings.type.ts @@ -5,7 +5,7 @@ import { Access, Account, Settings, User } from '@prisma/client'; // TODO: Compare with User interface export type UserWithSettings = User & { - Access: Access[]; + accessesGet: Access[]; accounts: Account[]; activityCount: number; dataProviderGhostfolioDailyRequests: number; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 2021a26a1..a7ffe4d21 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -244,6 +244,7 @@ model Tag { } model User { + accessesGet Access[] @relation("accessGet") accessToken String? accounts Account[] activities Order[] @@ -260,7 +261,6 @@ model User { thirdPartyId String? updatedAt DateTime @updatedAt watchlist SymbolProfile[] @relation("UserWatchlist") - Access Access[] @relation("accessGet") AccessGive Access[] @relation("accessGive") Settings Settings? SymbolProfile SymbolProfile[]