From 15d28e37cf9c9e74ddcdb13046f9a1cfc22d8beb Mon Sep 17 00:00:00 2001 From: aXenDeveloper Date: Wed, 19 Jun 2024 17:31:23 +0200 Subject: [PATCH 01/27] feat(backend): Add nestjsMainApp function --- apps/backend/package.json | 6 +-- apps/backend/src/main.ts | 33 ++++++--------- packages/backend/package.json | 2 + packages/backend/src/graphql-upload/index.ts | 2 +- packages/backend/src/index.ts | 1 + packages/backend/src/main.ts | 43 ++++++++++++++++++++ packages/backend/tsconfig.json | 5 ++- pnpm-lock.yaml | 12 +++--- 8 files changed, 71 insertions(+), 33 deletions(-) create mode 100644 packages/backend/src/main.ts diff --git a/apps/backend/package.json b/apps/backend/package.json index 8a9f822e1..21cf158bf 100644 --- a/apps/backend/package.json +++ b/apps/backend/package.json @@ -52,17 +52,14 @@ "@swc/cli": "^0.3.12", "@swc/core": "^1.6.1", "@types/bcrypt": "^5.0.2", - "@types/cookie-parser": "^1.4.7", "@types/express": "^4.17.21", "@types/node": "^20.14.2", "@types/nodemailer": "^6.4.15", "@types/pg": "^8.11.6", "@types/react": "^18.3.3", - "vitnode-backend": "workspace:*", "@vitnode/shared": "workspace:*", "class-transformer": "^0.5.1", "class-validator": "^0.14.1", - "cookie-parser": "^1.4.6", "cross-env": "^7.0.3", "dotenv": "^16.4.5", "drizzle-kit": "^0.22.7", @@ -73,6 +70,7 @@ "react-email": "^2.1.4", "ts-node": "^10.9.2", "tsconfig-paths": "^4.2.0", - "typescript": "^5.4.5" + "typescript": "^5.4.5", + "vitnode-backend": "workspace:*" } } diff --git a/apps/backend/src/main.ts b/apps/backend/src/main.ts index 391123c7e..730fea368 100644 --- a/apps/backend/src/main.ts +++ b/apps/backend/src/main.ts @@ -1,31 +1,22 @@ /* eslint-disable no-console */ import { NestFactory } from "@nestjs/core"; -import cookieParser from "cookie-parser"; -import { ValidationPipe } from "@nestjs/common"; -import { graphqlUploadExpress } from "vitnode-backend"; +import { INestApplication } from "@nestjs/common"; +import { nestjsMainApp } from "vitnode-backend"; import { AppModule } from "./app.module"; async function bootstrap() { - const app = await NestFactory.create(AppModule); - app.use(cookieParser()); - app.enableCors({ - credentials: true, - origin: [ - process.env.NEXT_PUBLIC_FRONTEND_URL - ? process.env.NEXT_PUBLIC_FRONTEND_URL - : "http://localhost:3000", - "https://sandbox.embed.apollographql.com" - ] - }); - app.use(graphqlUploadExpress({ maxFiles: 100 })); + const app: INestApplication = await NestFactory.create(AppModule); - // Class Validation - app.useGlobalPipes( - new ValidationPipe({ - transform: true - }) - ); + nestjsMainApp(app, { + cors: { + origin: [ + process.env.NEXT_PUBLIC_FRONTEND_URL + ? process.env.NEXT_PUBLIC_FRONTEND_URL + : "http://localhost:3000" + ] + } + }); await app.listen(process.env.PORT ?? "8080", null, () => { console.log( diff --git a/packages/backend/package.json b/packages/backend/package.json index a2e77ebb8..e701ff8fc 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -17,6 +17,7 @@ "@nestjs/common": "^10.3.9", "@nestjs/graphql": "^12.1.1", "@types/busboy": "^1.5.4", + "@types/cookie-parser": "^1.4.7", "@types/express": "^4.17.21", "@types/http-errors": "^2.0.4", "@types/node": "^20.14.2", @@ -29,6 +30,7 @@ }, "dependencies": { "class-validator": "^0.14.1", + "cookie-parser": "^1.4.6", "drizzle-orm": "^0.31.2", "express": "^4.19.2", "graphql": "^16.8.2", diff --git a/packages/backend/src/graphql-upload/index.ts b/packages/backend/src/graphql-upload/index.ts index b11cb751d..4d17e103c 100644 --- a/packages/backend/src/graphql-upload/index.ts +++ b/packages/backend/src/graphql-upload/index.ts @@ -1,3 +1,3 @@ -export * from "./graphql-upload-express"; +// export * from "./graphql-upload-express"; export * from "./upload"; export * from "./graphql-upload"; diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts index c131b32d3..f23ae5a12 100644 --- a/packages/backend/src/index.ts +++ b/packages/backend/src/index.ts @@ -3,3 +3,4 @@ export * from "./errors"; export * from "./functions"; export * from "./utils"; export * from "./decorators"; +export * from "./main"; diff --git a/packages/backend/src/main.ts b/packages/backend/src/main.ts new file mode 100644 index 000000000..4b8b876f1 --- /dev/null +++ b/packages/backend/src/main.ts @@ -0,0 +1,43 @@ +import { INestApplication, ValidationPipe } from "@nestjs/common"; +import * as cookieParser from "cookie-parser"; +import { CorsOptions } from "@nestjs/common/interfaces/external/cors-options.interface"; + +import { + ProcessRequestOptions, + graphqlUploadExpress +} from "./graphql-upload/graphql-upload-express"; + +interface CorsOptionsMain extends Omit { + origin?: (RegExp | string)[]; +} + +interface Args { + cors?: CorsOptionsMain; + graphqlUpload?: ProcessRequestOptions; +} + +export const nestjsMainApp = async (app: INestApplication, options?: Args) => { + app.use(cookieParser()); + app.enableCors({ + ...options?.cors, + credentials: true, + origin: [ + "https://sandbox.embed.apollographql.com", + ...(options?.cors?.origin ?? []) + ] + }); + + // Class Validation + app.useGlobalPipes( + new ValidationPipe({ + transform: true + }) + ); + + app.use( + graphqlUploadExpress({ + maxFiles: options?.graphqlUpload ? options.graphqlUpload.maxFiles : 100, + ...options?.graphqlUpload + }) + ); +}; diff --git a/packages/backend/tsconfig.json b/packages/backend/tsconfig.json index 47e19d19c..ccf0ad3f9 100644 --- a/packages/backend/tsconfig.json +++ b/packages/backend/tsconfig.json @@ -7,7 +7,10 @@ "outDir": "dist", "declaration": true, "experimentalDecorators": true, - "strictNullChecks": false + "strictNullChecks": false, + "paths": { + "@/*": ["./src/*"] + } }, "include": ["src/**/*"] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 856324d38..592acb1a1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -114,9 +114,6 @@ importers: '@types/bcrypt': specifier: ^5.0.2 version: 5.0.2 - '@types/cookie-parser': - specifier: ^1.4.7 - version: 1.4.7 '@types/express': specifier: ^4.17.21 version: 4.17.21 @@ -141,9 +138,6 @@ importers: class-validator: specifier: ^0.14.1 version: 0.14.1 - cookie-parser: - specifier: ^1.4.6 - version: 1.4.6 cross-env: specifier: ^7.0.3 version: 7.0.3 @@ -481,6 +475,9 @@ importers: class-validator: specifier: ^0.14.1 version: 0.14.1 + cookie-parser: + specifier: ^1.4.6 + version: 1.4.6 drizzle-orm: specifier: ^0.31.2 version: 0.31.2(@types/pg@8.11.6)(@types/react@18.3.3)(pg@8.12.0)(react@18.3.1) @@ -503,6 +500,9 @@ importers: '@types/busboy': specifier: ^1.5.4 version: 1.5.4 + '@types/cookie-parser': + specifier: ^1.4.7 + version: 1.4.7 '@types/express': specifier: ^4.17.21 version: 4.17.21 From 413de1aecaa79df4ad838ffed08c04bfbbb59cda Mon Sep 17 00:00:00 2001 From: aXenDeveloper Date: Wed, 19 Jun 2024 19:19:44 +0200 Subject: [PATCH 02/27] perf(backend): Add VitNodeCoreModule --- apps/backend/src/app.module.ts | 30 ++++---------- packages/backend/package.json | 5 +++ packages/backend/src/app.module.ts | 43 ++++++++++++++++++++ packages/backend/src/graphql-upload/index.ts | 1 - packages/backend/src/index.ts | 1 + pnpm-lock.yaml | 15 +++++++ 6 files changed, 72 insertions(+), 23 deletions(-) create mode 100644 packages/backend/src/app.module.ts diff --git a/apps/backend/src/app.module.ts b/apps/backend/src/app.module.ts index acb5f5b1d..65353b665 100644 --- a/apps/backend/src/app.module.ts +++ b/apps/backend/src/app.module.ts @@ -2,13 +2,7 @@ import { join } from "path"; import { Module } from "@nestjs/common"; import { ConfigModule } from "@nestjs/config"; -import { JwtModule } from "@nestjs/jwt"; -import { ScheduleModule } from "@nestjs/schedule"; -import { GraphQLModule } from "@nestjs/graphql"; -import { ApolloDriver, ApolloDriverConfig } from "@nestjs/apollo"; -import { ApolloServerPluginLandingPageLocalDefault } from "@apollo/server/plugin/landingPage/default"; -import { ServeStaticModule } from "@nestjs/serve-static"; -import { Ctx } from "vitnode-backend"; +import { VitNodeCoreModule } from "vitnode-backend"; import { DatabaseModule } from "./database/database.module"; import { PluginsModule } from "./plugins/plugins.module"; @@ -21,22 +15,14 @@ import { ABSOLUTE_PATHS, configForAppModule } from "./config"; load: [configForAppModule], envFilePath: join(process.cwd(), "..", "..", ".env") }), - GraphQLModule.forRoot({ - driver: ApolloDriver, - autoSchemaFile: join(process.cwd(), "schema.gql"), - sortSchema: true, - playground: false, - plugins: [ApolloServerPluginLandingPageLocalDefault()], - context: ({ req, res }): Ctx => ({ req, res }) - }), - JwtModule.register({ global: true }), - ServeStaticModule.forRoot({ - rootPath: join(ABSOLUTE_PATHS.uploads.public), - serveRoot: "/public/" - }), - ScheduleModule.forRoot(), PluginsModule, - DatabaseModule + DatabaseModule, + VitNodeCoreModule.register({ + paths: { + uploadPublic: ABSOLUTE_PATHS.uploads.public, + graphqlSchema: join(process.cwd(), "schema.gql") + } + }) ] }) export class AppModule {} diff --git a/packages/backend/package.json b/packages/backend/package.json index e701ff8fc..69750f493 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -14,8 +14,13 @@ "main": "./dist/index.js", "types": "./dist/index.d.ts", "devDependencies": { + "@apollo/server": "^4.10.4", + "@nestjs/apollo": "^12.1.0", "@nestjs/common": "^10.3.9", "@nestjs/graphql": "^12.1.1", + "@nestjs/jwt": "^10.2.0", + "@nestjs/schedule": "^4.0.2", + "@nestjs/serve-static": "^4.0.2", "@types/busboy": "^1.5.4", "@types/cookie-parser": "^1.4.7", "@types/express": "^4.17.21", diff --git a/packages/backend/src/app.module.ts b/packages/backend/src/app.module.ts new file mode 100644 index 000000000..6294df719 --- /dev/null +++ b/packages/backend/src/app.module.ts @@ -0,0 +1,43 @@ +import { join } from "path"; + +import { DynamicModule, Module } from "@nestjs/common"; +import { ScheduleModule } from "@nestjs/schedule"; +import { JwtModule } from "@nestjs/jwt"; +import { ServeStaticModule } from "@nestjs/serve-static"; +import { GraphQLModule } from "@nestjs/graphql"; +import { ApolloDriver, ApolloDriverConfig } from "@nestjs/apollo"; +import { ApolloServerPluginLandingPageLocalDefault } from "@apollo/server/plugin/landingPage/default"; + +import { Ctx } from "./utils"; + +interface Args { + paths: { + graphqlSchema: string; + uploadPublic: string; + }; +} + +@Module({}) +export class VitNodeCoreModule { + static register({ paths }: Args): DynamicModule { + return { + module: VitNodeCoreModule, + imports: [ + GraphQLModule.forRoot({ + driver: ApolloDriver, + autoSchemaFile: join(process.cwd(), "schema.gql"), + sortSchema: true, + playground: false, + plugins: [ApolloServerPluginLandingPageLocalDefault()], + context: ({ req, res }): Ctx => ({ req, res }) + }), + ScheduleModule.forRoot(), + JwtModule.register({ global: true }), + ServeStaticModule.forRoot({ + rootPath: paths.uploadPublic, + serveRoot: "/public/" + }) + ] + }; + } +} diff --git a/packages/backend/src/graphql-upload/index.ts b/packages/backend/src/graphql-upload/index.ts index 4d17e103c..c47243945 100644 --- a/packages/backend/src/graphql-upload/index.ts +++ b/packages/backend/src/graphql-upload/index.ts @@ -1,3 +1,2 @@ -// export * from "./graphql-upload-express"; export * from "./upload"; export * from "./graphql-upload"; diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts index f23ae5a12..cef803081 100644 --- a/packages/backend/src/index.ts +++ b/packages/backend/src/index.ts @@ -4,3 +4,4 @@ export * from "./functions"; export * from "./utils"; export * from "./decorators"; export * from "./main"; +export * from "./app.module"; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 592acb1a1..12ff14672 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -491,12 +491,27 @@ importers: specifier: 2.0.0-beta.3 version: 2.0.0-beta.3 devDependencies: + '@apollo/server': + specifier: ^4.10.4 + version: 4.10.4(graphql@16.8.2) + '@nestjs/apollo': + specifier: ^12.1.0 + version: 12.1.0(@apollo/server@4.10.4(graphql@16.8.2))(@nestjs/common@10.3.9(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.9(@nestjs/common@10.3.9(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.9)(@nestjs/websockets@10.3.8)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/graphql@12.1.1(@nestjs/common@10.3.9(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.9(@nestjs/common@10.3.9(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.9)(@nestjs/websockets@10.3.8)(reflect-metadata@0.2.2)(rxjs@7.8.1))(class-transformer@0.5.1)(class-validator@0.14.1)(graphql@16.8.2)(reflect-metadata@0.2.2))(graphql@16.8.2) '@nestjs/common': specifier: ^10.3.9 version: 10.3.9(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) '@nestjs/graphql': specifier: ^12.1.1 version: 12.1.1(@nestjs/common@10.3.9(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.9(@nestjs/common@10.3.9(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.9)(@nestjs/websockets@10.3.8)(reflect-metadata@0.2.2)(rxjs@7.8.1))(class-transformer@0.5.1)(class-validator@0.14.1)(graphql@16.8.2)(reflect-metadata@0.2.2) + '@nestjs/jwt': + specifier: ^10.2.0 + version: 10.2.0(@nestjs/common@10.3.9(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1)) + '@nestjs/schedule': + specifier: ^4.0.2 + version: 4.0.2(@nestjs/common@10.3.9(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.9(@nestjs/common@10.3.9(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.9)(@nestjs/websockets@10.3.8)(reflect-metadata@0.2.2)(rxjs@7.8.1)) + '@nestjs/serve-static': + specifier: ^4.0.2 + version: 4.0.2(@nestjs/common@10.3.9(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.9(@nestjs/common@10.3.9(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.9)(@nestjs/websockets@10.3.8)(reflect-metadata@0.2.2)(rxjs@7.8.1))(express@4.19.2) '@types/busboy': specifier: ^1.5.4 version: 1.5.4 From 3379f1062a3025061433c3c7b02330a295f474ed Mon Sep 17 00:00:00 2001 From: aXenDeveloper Date: Wed, 19 Jun 2024 22:40:35 +0200 Subject: [PATCH 03/27] perf(backend): Move config to package --- apps/backend/src/app.module.ts | 14 ++-- apps/backend/src/config.ts | 42 ------------ packages/backend/package.json | 5 +- packages/backend/src/app.module.ts | 86 +++++++++++++++++++++--- packages/backend/src/core/core.module.ts | 6 ++ pnpm-lock.yaml | 12 +++- 6 files changed, 101 insertions(+), 64 deletions(-) create mode 100644 packages/backend/src/core/core.module.ts diff --git a/apps/backend/src/app.module.ts b/apps/backend/src/app.module.ts index 65353b665..81b623685 100644 --- a/apps/backend/src/app.module.ts +++ b/apps/backend/src/app.module.ts @@ -1,27 +1,21 @@ import { join } from "path"; import { Module } from "@nestjs/common"; -import { ConfigModule } from "@nestjs/config"; import { VitNodeCoreModule } from "vitnode-backend"; import { DatabaseModule } from "./database/database.module"; import { PluginsModule } from "./plugins/plugins.module"; -import { ABSOLUTE_PATHS, configForAppModule } from "./config"; +import { schemaDatabase } from "./database/schema"; @Module({ imports: [ - ConfigModule.forRoot({ - isGlobal: true, - load: [configForAppModule], - envFilePath: join(process.cwd(), "..", "..", ".env") - }), PluginsModule, DatabaseModule, VitNodeCoreModule.register({ paths: { - uploadPublic: ABSOLUTE_PATHS.uploads.public, - graphqlSchema: join(process.cwd(), "schema.gql") - } + envFile: join(process.cwd(), "..", "..", ".env") + }, + schemaDatabase }) ] }) diff --git a/apps/backend/src/config.ts b/apps/backend/src/config.ts index f1cfd0cfd..4a1c1484e 100644 --- a/apps/backend/src/config.ts +++ b/apps/backend/src/config.ts @@ -1,48 +1,6 @@ import * as fs from "fs"; import { join } from "path"; -import { parseFrontendUrlFromEnv } from "./functions/envs"; - -export const configForAppModule = () => { - const frontend_url = parseFrontendUrlFromEnv(); - - const data = { - login_token_secret: process.env.LOGIN_TOKEN_SECRET ?? "", - frontend_url: frontend_url.url, - port: parseInt(process.env.PORT, 10) || 8080, - password_salt: 10, - cookies: { - domain: - frontend_url.hostname === "localhost" - ? "localhost" - : frontend_url.hostname - .replace(/:\d+$/, "") - .split(".") - .slice(-2) - .join("."), - login_token: { - expiresIn: 3, // 3 days - expiresInRemember: 90, // 90 days - name: "vitnode-login-token", - admin: { - name: "vitnode-login-token-admin", - expiresIn: 1 // 1 day - } - }, - known_device: { - name: "vitnode-device", - expiresIn: 365 // 1 year - } - } - }; - - if (!data.login_token_secret) { - throw new Error("`LOGIN_TOKEN_SECRET` is not defined in .env file"); - } - - return data; -}; - const internalPaths = { uploads: join(process.cwd(), "uploads"), frontend: join(process.cwd(), "..", "frontend"), diff --git a/packages/backend/package.json b/packages/backend/package.json index 69750f493..b9f73e840 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -9,7 +9,8 @@ "build": "tsc", "dev": "tsc -w", "lint": "eslint .", - "lint:fix": "eslint . --fix" + "lint:fix": "eslint . --fix", + "migrate:admin": "drizzle-kit up --config src/drizzle.config.ts && drizzle-kit generate --config src/drizzle.config.ts" }, "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -17,6 +18,7 @@ "@apollo/server": "^4.10.4", "@nestjs/apollo": "^12.1.0", "@nestjs/common": "^10.3.9", + "@nestjs/config": "^3.2.2", "@nestjs/graphql": "^12.1.1", "@nestjs/jwt": "^10.2.0", "@nestjs/schedule": "^4.0.2", @@ -36,6 +38,7 @@ "dependencies": { "class-validator": "^0.14.1", "cookie-parser": "^1.4.6", + "drizzle-kit": "^0.22.7", "drizzle-orm": "^0.31.2", "express": "^4.19.2", "graphql": "^16.8.2", diff --git a/packages/backend/src/app.module.ts b/packages/backend/src/app.module.ts index 6294df719..39576e427 100644 --- a/packages/backend/src/app.module.ts +++ b/packages/backend/src/app.module.ts @@ -5,27 +5,96 @@ import { ScheduleModule } from "@nestjs/schedule"; import { JwtModule } from "@nestjs/jwt"; import { ServeStaticModule } from "@nestjs/serve-static"; import { GraphQLModule } from "@nestjs/graphql"; +import { ConfigModule } from "@nestjs/config"; import { ApolloDriver, ApolloDriverConfig } from "@nestjs/apollo"; import { ApolloServerPluginLandingPageLocalDefault } from "@apollo/server/plugin/landingPage/default"; import { Ctx } from "./utils"; +import { CoreModule } from "./core/core.module"; -interface Args { - paths: { - graphqlSchema: string; - uploadPublic: string; +export const ABSOLUTE_PATHS_BACKEND = { + schema: join(process.cwd(), "schema.gql"), + uploads: { + public: join(process.cwd(), "uploads", "public") + } +}; + +const parseFrontendUrlFromEnv = () => { + const envUrl = process.env.NEXT_PUBLIC_FRONTEND_URL; + const frontendUrl = envUrl ? envUrl : "http://localhost:3000"; + const urlObj = new URL(frontendUrl); + + return { + url: frontendUrl, + protocol: urlObj.protocol, + hostname: urlObj.hostname, + port: urlObj.port }; +}; + +const config = () => { + const frontend_url = parseFrontendUrlFromEnv(); + + const data = { + login_token_secret: process.env.LOGIN_TOKEN_SECRET ?? "", + frontend_url: frontend_url.url, + port: parseInt(process.env.PORT, 10) || 8080, + password_salt: 10, + cookies: { + domain: + frontend_url.hostname === "localhost" + ? "localhost" + : frontend_url.hostname + .replace(/:\d+$/, "") + .split(".") + .slice(-2) + .join("."), + login_token: { + expiresIn: 3, // 3 days + expiresInRemember: 90, // 90 days + name: "vitnode-login-token", + admin: { + name: "vitnode-login-token-admin", + expiresIn: 1 // 1 day + } + }, + known_device: { + name: "vitnode-device", + expiresIn: 365 // 1 year + } + } + }; + + if (!data.login_token_secret) { + throw new Error("`LOGIN_TOKEN_SECRET` is not defined in .env file"); + } + + return data; +}; + +export interface VitNodePaths { + envFile: string; +} + +interface Args { + paths: VitNodePaths; + schemaDatabase: Record; } @Module({}) export class VitNodeCoreModule { - static register({ paths }: Args): DynamicModule { + static register({ paths, schemaDatabase }: Args): DynamicModule { return { module: VitNodeCoreModule, imports: [ + ConfigModule.forRoot({ + isGlobal: true, + load: [config], + envFilePath: paths.envFile + }), GraphQLModule.forRoot({ driver: ApolloDriver, - autoSchemaFile: join(process.cwd(), "schema.gql"), + autoSchemaFile: ABSOLUTE_PATHS_BACKEND.schema, sortSchema: true, playground: false, plugins: [ApolloServerPluginLandingPageLocalDefault()], @@ -34,9 +103,10 @@ export class VitNodeCoreModule { ScheduleModule.forRoot(), JwtModule.register({ global: true }), ServeStaticModule.forRoot({ - rootPath: paths.uploadPublic, + rootPath: ABSOLUTE_PATHS_BACKEND.uploads.public, serveRoot: "/public/" - }) + }), + CoreModule ] }; } diff --git a/packages/backend/src/core/core.module.ts b/packages/backend/src/core/core.module.ts new file mode 100644 index 000000000..e1302b80d --- /dev/null +++ b/packages/backend/src/core/core.module.ts @@ -0,0 +1,6 @@ +import { Module } from "@nestjs/common"; + +@Module({ + imports: [] +}) +export class CoreModule {} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 12ff14672..5bcab4d5d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -478,6 +478,9 @@ importers: cookie-parser: specifier: ^1.4.6 version: 1.4.6 + drizzle-kit: + specifier: ^0.22.7 + version: 0.22.7 drizzle-orm: specifier: ^0.31.2 version: 0.31.2(@types/pg@8.11.6)(@types/react@18.3.3)(pg@8.12.0)(react@18.3.1) @@ -500,6 +503,9 @@ importers: '@nestjs/common': specifier: ^10.3.9 version: 10.3.9(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) + '@nestjs/config': + specifier: ^3.2.2 + version: 3.2.2(@nestjs/common@10.3.9(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(rxjs@7.8.1) '@nestjs/graphql': specifier: ^12.1.1 version: 12.1.1(@nestjs/common@10.3.9(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.9(@nestjs/common@10.3.9(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.9)(@nestjs/websockets@10.3.8)(reflect-metadata@0.2.2)(rxjs@7.8.1))(class-transformer@0.5.1)(class-validator@0.14.1)(graphql@16.8.2)(reflect-metadata@0.2.2) @@ -13522,7 +13528,7 @@ snapshots: eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) eslint-plugin-jsx-a11y: 6.8.0(eslint@8.57.0) eslint-plugin-react: 7.34.2(eslint@8.57.0) eslint-plugin-react-hooks: 4.6.2(eslint@8.57.0) @@ -13559,7 +13565,7 @@ snapshots: enhanced-resolve: 5.17.0 eslint: 8.57.0 eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) fast-glob: 3.3.2 get-tsconfig: 4.7.5 is-core-module: 2.13.1 @@ -13581,7 +13587,7 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): + eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0): dependencies: array-includes: 3.1.8 array.prototype.findlastindex: 1.2.5 From c228fea277dc13dcd10a0b9e41df00d74f132ddc Mon Sep 17 00:00:00 2001 From: aXenDeveloper Date: Thu, 20 Jun 2024 11:31:36 +0200 Subject: [PATCH 04/27] perf(backend): Move database service to package --- apps/backend/index.d.ts | 12 ++++++ apps/backend/src/app.module.ts | 12 +++--- apps/backend/src/database/database.module.ts | 16 -------- apps/backend/src/database/database.service.ts | 14 ------- .../admin/categories/create/create.service.ts | 2 +- .../blog/categories/show/show.service.ts | 4 +- .../core/admin/files/delete/delete.service.ts | 3 +- .../files/download/download.controller.ts | 2 +- .../core/admin/files/show/show.service.ts | 4 +- .../admin/groups/create/create.service.ts | 2 +- .../admin/groups/delete/delete.service.ts | 3 +- .../core/admin/groups/edit/edit.service.ts | 3 +- .../core/admin/groups/show/show.service.ts | 4 +- .../create_database.service.ts | 3 +- .../admin/install/layout/layout.service.ts | 3 +- .../admin/languages/create/create.service.ts | 3 +- .../admin/languages/delete/delete.service.ts | 3 +- .../languages/download/download.service.ts | 8 +++- .../core/admin/languages/edit/edit.service.ts | 3 +- .../admin/languages/update/update.service.ts | 3 +- .../core/admin/members/edit/edit.service.ts | 7 +++- .../core/admin/members/show/show.service.ts | 4 +- .../core/admin/members/stats/stats.service.ts | 3 +- .../metadata/manifest/edit/edit.service.ts | 2 +- .../change_position.service.ts | 3 +- .../core/admin/nav/create/create.service.ts | 2 +- .../core/admin/nav/delete/delete.service.ts | 3 +- .../core/admin/nav/edit/edit.service.ts | 3 +- .../admin/plugins/create/create.service.ts | 3 +- .../admin/plugins/delete/delete.service.ts | 3 +- .../plugins/download/download.service.ts | 4 +- .../core/admin/plugins/edit/edit.service.ts | 3 +- .../core/admin/plugins/files/files.service.ts | 3 +- .../core/admin/plugins/show/show.service.ts | 4 +- .../admin/plugins/upload/upload.service.ts | 3 +- .../authorization/authorization.service.ts | 4 +- .../sessions/sign_out/sign_out.service.ts | 3 +- .../admin/settings/main/edit/edit.service.ts | 2 +- .../administrators/create/create.service.ts | 3 +- .../administrators/delete/delete.service.ts | 3 +- .../staff/administrators/show/show.service.ts | 4 +- .../staff/moderators/create/create.service.ts | 3 +- .../staff/moderators/delete/delete.service.ts | 3 +- .../staff/moderators/show/show.service.ts | 4 +- .../admin/theme_editor/edit/edit.service.ts | 3 +- .../core/editor/delete/delete.service.ts | 3 +- .../core/editor/upload/upload.service.ts | 3 +- .../files/download/download.controller.ts | 2 +- .../src/plugins/core/files/files.cron.ts | 3 +- .../files/helpers/upload/upload.service.ts | 3 +- .../plugins/core/files/show/show.service.ts | 2 +- .../text_language/parser/helpers.service.ts | 2 +- .../text_language/parser/parser.service.ts | 8 ++-- .../core/languages/show/show.service.ts | 4 +- .../members/avatar/delete/delete.service.ts | 3 +- .../members/avatar/upload/upload.service.ts | 3 +- .../core/members/delete/delete.service.ts | 7 +++- .../plugins/core/members/show/show.service.ts | 4 +- .../core/members/sign_up/sign_up.service.ts | 3 +- .../core/middleware/middleware.cron.ts | 2 +- .../src/plugins/core/nav/show/show.service.ts | 4 +- .../plugins/core/plugins/show/show.service.ts | 3 +- .../authorization/authorization.service.ts | 3 +- .../internal_authorization.service.ts | 4 +- .../sessions/devices/show/show.service.ts | 3 +- .../plugins/core/sessions/sessions.cron.ts | 2 +- .../core/sessions/sign_in/device.service.ts | 8 +++- .../core/sessions/sign_in/sign_in.service.ts | 8 +++- .../sessions/sign_out/sign_out.service.ts | 3 +- .../core/settings/show/show.service.ts | 2 +- .../utils/guards/admin-permission.guard.ts | 3 +- packages/backend/README.md | 7 +++- packages/backend/package.json | 2 + packages/backend/src/app.module.ts | 7 +++- packages/backend/src/database/client.ts | 19 ++++++++++ .../backend/src/database/database.module.ts | 33 ++++++++++++++++ .../backend/src/database/database.service.ts | 22 +++++++++++ packages/backend/src/database/index.ts | 3 ++ packages/backend/src/index.ts | 1 + pnpm-lock.yaml | 38 ++++++++++--------- 80 files changed, 236 insertions(+), 180 deletions(-) create mode 100644 apps/backend/index.d.ts delete mode 100644 apps/backend/src/database/database.module.ts delete mode 100644 apps/backend/src/database/database.service.ts create mode 100644 packages/backend/src/database/client.ts create mode 100644 packages/backend/src/database/database.module.ts create mode 100644 packages/backend/src/database/database.service.ts create mode 100644 packages/backend/src/database/index.ts diff --git a/apps/backend/index.d.ts b/apps/backend/index.d.ts new file mode 100644 index 000000000..f8b500948 --- /dev/null +++ b/apps/backend/index.d.ts @@ -0,0 +1,12 @@ +// eslint-disable-next-line @typescript-eslint/no-unused-vars +import { DatabaseService } from "vitnode-backend"; +import { NodePgDatabase } from "drizzle-orm/node-postgres"; + +import { schemaDatabase } from "@/database/schema"; + +// Overwrite the DatabaseService class to include the db property +declare module "vitnode-backend" { + export declare class DatabaseService { + db: NodePgDatabase; + } +} diff --git a/apps/backend/src/app.module.ts b/apps/backend/src/app.module.ts index 81b623685..2e26519fa 100644 --- a/apps/backend/src/app.module.ts +++ b/apps/backend/src/app.module.ts @@ -3,20 +3,20 @@ import { join } from "path"; import { Module } from "@nestjs/common"; import { VitNodeCoreModule } from "vitnode-backend"; -import { DatabaseModule } from "./database/database.module"; import { PluginsModule } from "./plugins/plugins.module"; -import { schemaDatabase } from "./database/schema"; +import { DATABASE_ENVS } from "./database/client"; @Module({ imports: [ - PluginsModule, - DatabaseModule, VitNodeCoreModule.register({ paths: { envFile: join(process.cwd(), "..", "..", ".env") }, - schemaDatabase - }) + database: { + config: DATABASE_ENVS + } + }), + PluginsModule ] }) export class AppModule {} diff --git a/apps/backend/src/database/database.module.ts b/apps/backend/src/database/database.module.ts deleted file mode 100644 index b39f98aaf..000000000 --- a/apps/backend/src/database/database.module.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Global, Module } from "@nestjs/common"; -import { registerEnumType } from "@nestjs/graphql"; -import { SortDirectionEnum } from "vitnode-backend"; - -import { DatabaseService } from "./database.service"; - -registerEnumType(SortDirectionEnum, { - name: "SortDirectionEnum" -}); - -@Global() -@Module({ - exports: [DatabaseService], - providers: [DatabaseService] -}) -export class DatabaseModule {} diff --git a/apps/backend/src/database/database.service.ts b/apps/backend/src/database/database.service.ts deleted file mode 100644 index ef34d19e7..000000000 --- a/apps/backend/src/database/database.service.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Injectable } from "@nestjs/common"; -import { NodePgDatabase } from "drizzle-orm/node-postgres"; - -import { schemaDatabase } from "./schema"; -import { db } from "./client"; - -@Injectable() -export class DatabaseService { - public db: NodePgDatabase; - - constructor() { - this.db = db; - } -} diff --git a/apps/backend/src/plugins/blog/admin/categories/create/create.service.ts b/apps/backend/src/plugins/blog/admin/categories/create/create.service.ts index 7c52ce0b6..a63499377 100644 --- a/apps/backend/src/plugins/blog/admin/categories/create/create.service.ts +++ b/apps/backend/src/plugins/blog/admin/categories/create/create.service.ts @@ -1,4 +1,5 @@ import { Injectable } from "@nestjs/common"; +import { DatabaseService } from "vitnode-backend"; import { CreatePluginCategoriesArgs } from "./dto/create.args"; @@ -10,7 +11,6 @@ import { blog_categories_permissions } from "../../database/schema/categories"; import { ParserTextLanguageCoreHelpersService } from "@/plugins/core/helpers/text_language/parser/parser.service"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class CreateBlogCategoriesService { diff --git a/apps/backend/src/plugins/blog/categories/show/show.service.ts b/apps/backend/src/plugins/blog/categories/show/show.service.ts index a3fce0293..6a376c6c6 100644 --- a/apps/backend/src/plugins/blog/categories/show/show.service.ts +++ b/apps/backend/src/plugins/blog/categories/show/show.service.ts @@ -3,14 +3,14 @@ import { count } from "drizzle-orm"; import { inputPaginationCursor, outputPagination, - SortDirectionEnum + SortDirectionEnum, + DatabaseService } from "vitnode-backend"; import { ShowBlogCategoriesArgs } from "./dto/show.args"; import { ShowBlogCategoriesObj } from "./dto/show.obj"; import { blog_categories } from "../../admin/database/schema/categories"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class ShowBlogCategoriesService { diff --git a/apps/backend/src/plugins/core/admin/files/delete/delete.service.ts b/apps/backend/src/plugins/core/admin/files/delete/delete.service.ts index 4e4dda231..0f4de891d 100644 --- a/apps/backend/src/plugins/core/admin/files/delete/delete.service.ts +++ b/apps/backend/src/plugins/core/admin/files/delete/delete.service.ts @@ -1,12 +1,11 @@ import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; -import { NotFoundError } from "vitnode-backend"; +import { NotFoundError, DatabaseService } from "vitnode-backend"; import { DeleteAdminFilesArgs } from "./dto/delete.args"; import { core_files } from "../../database/schema/files"; import { DeleteCoreFilesService } from "@/plugins/core/files/helpers/delete/delete.service"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class DeleteAdminFilesService { diff --git a/apps/backend/src/plugins/core/admin/files/download/download.controller.ts b/apps/backend/src/plugins/core/admin/files/download/download.controller.ts index ec9f25755..3df81bed7 100644 --- a/apps/backend/src/plugins/core/admin/files/download/download.controller.ts +++ b/apps/backend/src/plugins/core/admin/files/download/download.controller.ts @@ -10,10 +10,10 @@ import { StreamableFile } from "@nestjs/common"; import { Request, Response } from "express"; +import { DatabaseService } from "vitnode-backend"; import { AuthorizationAdminSessionsService } from "../../sessions/authorization/authorization.service"; import { InternalAuthorizationCoreSessionsService } from "@/plugins/core/sessions/authorization/internal/internal_authorization.service"; -import { DatabaseService } from "@/database/database.service"; import { ABSOLUTE_PATHS } from "@/config"; @Controller("files") diff --git a/apps/backend/src/plugins/core/admin/files/show/show.service.ts b/apps/backend/src/plugins/core/admin/files/show/show.service.ts index d2cef421c..f19ac63ec 100644 --- a/apps/backend/src/plugins/core/admin/files/show/show.service.ts +++ b/apps/backend/src/plugins/core/admin/files/show/show.service.ts @@ -3,14 +3,14 @@ import { and, count, eq, ilike, or } from "drizzle-orm"; import { inputPaginationCursor, outputPagination, - SortDirectionEnum + SortDirectionEnum, + DatabaseService } from "vitnode-backend"; import { ShowAdminFilesArgs } from "./dto/show.args"; import { ShowAdminFilesObj } from "./dto/show.obj"; import { core_files, core_files_using } from "../../database/schema/files"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class ShowAdminFilesService { diff --git a/apps/backend/src/plugins/core/admin/groups/create/create.service.ts b/apps/backend/src/plugins/core/admin/groups/create/create.service.ts index 6489e0e95..2d17b8b60 100644 --- a/apps/backend/src/plugins/core/admin/groups/create/create.service.ts +++ b/apps/backend/src/plugins/core/admin/groups/create/create.service.ts @@ -1,4 +1,5 @@ import { Injectable } from "@nestjs/common"; +import { DatabaseService } from "vitnode-backend"; import { ShowAdminGroups } from "../show/dto/show.obj"; import { CreateAdminGroupsArgs } from "./dto/create.args"; @@ -8,7 +9,6 @@ import { core_groups_names } from "@/plugins/core/admin/database/schema/groups"; import { ParserTextLanguageCoreHelpersService } from "@/plugins/core/helpers/text_language/parser/parser.service"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class CreateAdminGroupsService { diff --git a/apps/backend/src/plugins/core/admin/groups/delete/delete.service.ts b/apps/backend/src/plugins/core/admin/groups/delete/delete.service.ts index 0e104ae1d..841c16c03 100644 --- a/apps/backend/src/plugins/core/admin/groups/delete/delete.service.ts +++ b/apps/backend/src/plugins/core/admin/groups/delete/delete.service.ts @@ -1,12 +1,11 @@ import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; -import { NotFoundError } from "vitnode-backend"; +import { NotFoundError, DatabaseService } from "vitnode-backend"; import { DeleteAdminGroupsArgs } from "./dto/delete.args"; import { core_users } from "@/plugins/core/admin/database/schema/users"; import { core_groups } from "@/plugins/core/admin/database/schema/groups"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class DeleteAdminGroupsService { diff --git a/apps/backend/src/plugins/core/admin/groups/edit/edit.service.ts b/apps/backend/src/plugins/core/admin/groups/edit/edit.service.ts index 112fbaaf7..9f71df933 100644 --- a/apps/backend/src/plugins/core/admin/groups/edit/edit.service.ts +++ b/apps/backend/src/plugins/core/admin/groups/edit/edit.service.ts @@ -1,6 +1,6 @@ import { Injectable } from "@nestjs/common"; import { count, eq } from "drizzle-orm"; -import { NotFoundError } from "vitnode-backend"; +import { NotFoundError, DatabaseService } from "vitnode-backend"; import { EditAdminGroupsArgs } from "./dto/edit.args"; import { ShowAdminGroups } from "../show/dto/show.obj"; @@ -11,7 +11,6 @@ import { } from "@/plugins/core/admin/database/schema/groups"; import { core_users } from "@/plugins/core/admin/database/schema/users"; import { ParserTextLanguageCoreHelpersService } from "@/plugins/core/helpers/text_language/parser/parser.service"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class EditAdminGroupsService { diff --git a/apps/backend/src/plugins/core/admin/groups/show/show.service.ts b/apps/backend/src/plugins/core/admin/groups/show/show.service.ts index 4cce0fe01..34e41f6f4 100644 --- a/apps/backend/src/plugins/core/admin/groups/show/show.service.ts +++ b/apps/backend/src/plugins/core/admin/groups/show/show.service.ts @@ -3,7 +3,8 @@ import { and, count, eq, ilike, inArray } from "drizzle-orm"; import { inputPaginationCursor, outputPagination, - SortDirectionEnum + SortDirectionEnum, + DatabaseService } from "vitnode-backend"; import { ShowAdminGroupsArgs } from "./dto/show.args"; @@ -14,7 +15,6 @@ import { core_groups_names } from "@/plugins/core/admin/database/schema/groups"; import { core_users } from "../../database/schema/users"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class ShowAdminGroupsService { diff --git a/apps/backend/src/plugins/core/admin/install/create_database/create_database.service.ts b/apps/backend/src/plugins/core/admin/install/create_database/create_database.service.ts index 03a3b0f52..60ae9fd97 100644 --- a/apps/backend/src/plugins/core/admin/install/create_database/create_database.service.ts +++ b/apps/backend/src/plugins/core/admin/install/create_database/create_database.service.ts @@ -1,6 +1,6 @@ import { Injectable } from "@nestjs/common"; import { count } from "drizzle-orm"; -import { CustomError } from "vitnode-backend"; +import { CustomError, DatabaseService } from "vitnode-backend"; import { core_languages } from "@/plugins/core/admin/database/schema/languages"; import { @@ -10,7 +10,6 @@ import { import { core_admin_permissions } from "@/plugins/core/admin/database/schema/admins"; import { core_moderators_permissions } from "../../database/schema/moderators"; import { core_nav, core_nav_name } from "../../database/schema/nav"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class CreateDatabaseAdminInstallService { diff --git a/apps/backend/src/plugins/core/admin/install/layout/layout.service.ts b/apps/backend/src/plugins/core/admin/install/layout/layout.service.ts index f48cf5162..124ffaf02 100644 --- a/apps/backend/src/plugins/core/admin/install/layout/layout.service.ts +++ b/apps/backend/src/plugins/core/admin/install/layout/layout.service.ts @@ -1,6 +1,6 @@ import { Injectable } from "@nestjs/common"; import { count } from "drizzle-orm"; -import { AccessDeniedError } from "vitnode-backend"; +import { AccessDeniedError, DatabaseService } from "vitnode-backend"; import { LayoutAdminInstallEnum, @@ -11,7 +11,6 @@ import { core_users } from "@/plugins/core/admin/database/schema/users"; import { core_sessions } from "@/plugins/core/admin/database/schema/sessions"; import { core_admin_sessions } from "@/plugins/core/admin/database/schema/admins"; import { core_languages } from "@/plugins/core/admin/database/schema/languages"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class LayoutAdminInstallService { diff --git a/apps/backend/src/plugins/core/admin/languages/create/create.service.ts b/apps/backend/src/plugins/core/admin/languages/create/create.service.ts index 32aa35eaa..5713d6439 100644 --- a/apps/backend/src/plugins/core/admin/languages/create/create.service.ts +++ b/apps/backend/src/plugins/core/admin/languages/create/create.service.ts @@ -2,13 +2,12 @@ import * as fs from "fs"; import { join } from "path"; import { Injectable } from "@nestjs/common"; -import { CustomError } from "vitnode-backend"; +import { CustomError, DatabaseService } from "vitnode-backend"; import { CreateCoreAdminLanguagesArgs } from "./dto/create.args"; import { ShowCoreLanguages } from "@/plugins/core/languages/show/dto/show.obj"; import { core_languages } from "../../database/schema/languages"; -import { DatabaseService } from "@/database/database.service"; import { setRebuildRequired } from "@/functions/rebuild-required"; import { ABSOLUTE_PATHS } from "@/config"; diff --git a/apps/backend/src/plugins/core/admin/languages/delete/delete.service.ts b/apps/backend/src/plugins/core/admin/languages/delete/delete.service.ts index 726ddc25c..1af129677 100644 --- a/apps/backend/src/plugins/core/admin/languages/delete/delete.service.ts +++ b/apps/backend/src/plugins/core/admin/languages/delete/delete.service.ts @@ -4,12 +4,11 @@ import { unlinkSync } from "fs"; import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; -import { NotFoundError, CustomError } from "vitnode-backend"; +import { NotFoundError, CustomError, DatabaseService } from "vitnode-backend"; import { DeleteCoreAdminLanguagesArgs } from "./dto/delete.args"; import { core_languages } from "../../database/schema/languages"; -import { DatabaseService } from "@/database/database.service"; import { setRebuildRequired } from "@/functions/rebuild-required"; import { ABSOLUTE_PATHS } from "@/config"; diff --git a/apps/backend/src/plugins/core/admin/languages/download/download.service.ts b/apps/backend/src/plugins/core/admin/languages/download/download.service.ts index 735dab642..3c160bd8c 100644 --- a/apps/backend/src/plugins/core/admin/languages/download/download.service.ts +++ b/apps/backend/src/plugins/core/admin/languages/download/download.service.ts @@ -9,11 +9,15 @@ import { generateRandomString, removeSpecialCharacters } from "@vitnode/shared"; -import { NotFoundError, CustomError, User } from "vitnode-backend"; +import { + NotFoundError, + CustomError, + User, + DatabaseService +} from "vitnode-backend"; import { DownloadCoreAdminLanguagesArgs } from "./dto/download.args"; -import { DatabaseService } from "@/database/database.service"; import { ABSOLUTE_PATHS } from "@/config"; @Injectable() diff --git a/apps/backend/src/plugins/core/admin/languages/edit/edit.service.ts b/apps/backend/src/plugins/core/admin/languages/edit/edit.service.ts index 10d8d70f7..8e689e4ce 100644 --- a/apps/backend/src/plugins/core/admin/languages/edit/edit.service.ts +++ b/apps/backend/src/plugins/core/admin/languages/edit/edit.service.ts @@ -1,11 +1,10 @@ import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; -import { NotFoundError } from "vitnode-backend"; +import { NotFoundError, DatabaseService } from "vitnode-backend"; import { EditCoreAdminLanguagesArgs } from "./dto/edit.args"; import { core_languages } from "@/plugins/core/admin/database/schema/languages"; -import { DatabaseService } from "@/database/database.service"; import { ShowCoreLanguages } from "@/plugins/core/languages/show/dto/show.obj"; @Injectable() diff --git a/apps/backend/src/plugins/core/admin/languages/update/update.service.ts b/apps/backend/src/plugins/core/admin/languages/update/update.service.ts index 7e05f5ea0..4a07faeaa 100644 --- a/apps/backend/src/plugins/core/admin/languages/update/update.service.ts +++ b/apps/backend/src/plugins/core/admin/languages/update/update.service.ts @@ -5,12 +5,11 @@ import { Injectable } from "@nestjs/common"; import * as tar from "tar"; import { eq } from "drizzle-orm"; import { currentUnixDate, generateRandomString } from "@vitnode/shared"; -import { NotFoundError } from "vitnode-backend"; +import { NotFoundError, DatabaseService } from "vitnode-backend"; import { UpdateCoreAdminLanguagesArgs } from "./dto/update.args"; import { core_languages } from "../../database/schema/languages"; -import { DatabaseService } from "@/database/database.service"; import { setRebuildRequired } from "@/functions/rebuild-required"; import { ABSOLUTE_PATHS } from "@/config"; diff --git a/apps/backend/src/plugins/core/admin/members/edit/edit.service.ts b/apps/backend/src/plugins/core/admin/members/edit/edit.service.ts index 1ce1d6f5d..598cdfd29 100644 --- a/apps/backend/src/plugins/core/admin/members/edit/edit.service.ts +++ b/apps/backend/src/plugins/core/admin/members/edit/edit.service.ts @@ -1,12 +1,15 @@ import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; -import { NotFoundError, AccessDeniedError } from "vitnode-backend"; +import { + NotFoundError, + AccessDeniedError, + DatabaseService +} from "vitnode-backend"; import { EditAdminMembersArgs } from "./dto/edit.args"; import { EditAdminMembersObj } from "./dto/edit.obj"; import { core_users } from "@/plugins/core/admin/database/schema/users"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class EditAdminMembersService { diff --git a/apps/backend/src/plugins/core/admin/members/show/show.service.ts b/apps/backend/src/plugins/core/admin/members/show/show.service.ts index df218b28c..6ebb0482c 100644 --- a/apps/backend/src/plugins/core/admin/members/show/show.service.ts +++ b/apps/backend/src/plugins/core/admin/members/show/show.service.ts @@ -3,14 +3,14 @@ import { and, count, eq, ilike, inArray, or } from "drizzle-orm"; import { inputPaginationCursor, outputPagination, - SortDirectionEnum + SortDirectionEnum, + DatabaseService } from "vitnode-backend"; import { ShowAdminMembersObj } from "./dto/show.obj"; import { ShowAdminMembersArgs } from "./dto/show.args"; import { core_users } from "@/plugins/core/admin/database/schema/users"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class ShowAdminMembersService { diff --git a/apps/backend/src/plugins/core/admin/members/stats/stats.service.ts b/apps/backend/src/plugins/core/admin/members/stats/stats.service.ts index 426a87c47..a06b9fb18 100644 --- a/apps/backend/src/plugins/core/admin/members/stats/stats.service.ts +++ b/apps/backend/src/plugins/core/admin/members/stats/stats.service.ts @@ -1,10 +1,9 @@ import { Injectable } from "@nestjs/common"; import { sql } from "drizzle-orm"; +import { DatabaseService } from "vitnode-backend"; import { SignUpStatsAdminMembers } from "./dto/stats.obj"; -import { DatabaseService } from "@/database/database.service"; - @Injectable() export class StatsAdminMembersService { constructor(private readonly databaseService: DatabaseService) {} diff --git a/apps/backend/src/plugins/core/admin/metadata/manifest/edit/edit.service.ts b/apps/backend/src/plugins/core/admin/metadata/manifest/edit/edit.service.ts index 17e8c203c..599560a49 100644 --- a/apps/backend/src/plugins/core/admin/metadata/manifest/edit/edit.service.ts +++ b/apps/backend/src/plugins/core/admin/metadata/manifest/edit/edit.service.ts @@ -3,13 +3,13 @@ import { join } from "path"; import { Injectable } from "@nestjs/common"; import { ConfigService } from "@nestjs/config"; +import { DatabaseService } from "vitnode-backend"; import { EditAdminManifestMetadataObj } from "./dto/edit.args"; import { ShowAdminManifestMetadataObj } from "../show/dto/show.obj"; import { getManifest } from "../functions"; import { core_languages } from "../../../database/schema/languages"; -import { DatabaseService } from "@/database/database.service"; import { ABSOLUTE_PATHS } from "@/config"; @Injectable() diff --git a/apps/backend/src/plugins/core/admin/nav/change_position/change_position.service.ts b/apps/backend/src/plugins/core/admin/nav/change_position/change_position.service.ts index 486e704a9..18e18f836 100644 --- a/apps/backend/src/plugins/core/admin/nav/change_position/change_position.service.ts +++ b/apps/backend/src/plugins/core/admin/nav/change_position/change_position.service.ts @@ -1,11 +1,10 @@ import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; -import { NotFoundError } from "vitnode-backend"; +import { NotFoundError, DatabaseService } from "vitnode-backend"; import { ChangePositionAdminNavArgs } from "./dto/change_position.args"; import { core_nav } from "../../database/schema/nav"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class ChangePositionAdminNavService { diff --git a/apps/backend/src/plugins/core/admin/nav/create/create.service.ts b/apps/backend/src/plugins/core/admin/nav/create/create.service.ts index fa2ef591e..44a34f0c1 100644 --- a/apps/backend/src/plugins/core/admin/nav/create/create.service.ts +++ b/apps/backend/src/plugins/core/admin/nav/create/create.service.ts @@ -1,4 +1,5 @@ import { Injectable } from "@nestjs/common"; +import { DatabaseService } from "vitnode-backend"; import { CreateAdminNavArgs } from "./dto/create.args"; @@ -9,7 +10,6 @@ import { } from "../../database/schema/nav"; import { ShowCoreNav } from "@/plugins/core/nav/show/dto/show.obj"; import { ParserTextLanguageCoreHelpersService } from "@/plugins/core/helpers/text_language/parser/parser.service"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class CreateAdminNavService { diff --git a/apps/backend/src/plugins/core/admin/nav/delete/delete.service.ts b/apps/backend/src/plugins/core/admin/nav/delete/delete.service.ts index e7e2d6542..b99090907 100644 --- a/apps/backend/src/plugins/core/admin/nav/delete/delete.service.ts +++ b/apps/backend/src/plugins/core/admin/nav/delete/delete.service.ts @@ -1,6 +1,6 @@ import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; -import { NotFoundError } from "vitnode-backend"; +import { NotFoundError, DatabaseService } from "vitnode-backend"; import { DeleteAdminNavArgs } from "./dto/delete.args"; @@ -10,7 +10,6 @@ import { core_nav_name } from "../../database/schema/nav"; import { ParserTextLanguageCoreHelpersService } from "@/plugins/core/helpers/text_language/parser/parser.service"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class DeleteAdminNavService { diff --git a/apps/backend/src/plugins/core/admin/nav/edit/edit.service.ts b/apps/backend/src/plugins/core/admin/nav/edit/edit.service.ts index 6903664da..54f0c0595 100644 --- a/apps/backend/src/plugins/core/admin/nav/edit/edit.service.ts +++ b/apps/backend/src/plugins/core/admin/nav/edit/edit.service.ts @@ -1,6 +1,6 @@ import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; -import { NotFoundError } from "vitnode-backend"; +import { NotFoundError, DatabaseService } from "vitnode-backend"; import { EditAdminNavArgs } from "./dto/edit.args"; @@ -11,7 +11,6 @@ import { core_nav_name } from "../../database/schema/nav"; import { ParserTextLanguageCoreHelpersService } from "@/plugins/core/helpers/text_language/parser/parser.service"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class EditAdminNavService { diff --git a/apps/backend/src/plugins/core/admin/plugins/create/create.service.ts b/apps/backend/src/plugins/core/admin/plugins/create/create.service.ts index a20a637a0..fcda5d238 100644 --- a/apps/backend/src/plugins/core/admin/plugins/create/create.service.ts +++ b/apps/backend/src/plugins/core/admin/plugins/create/create.service.ts @@ -2,7 +2,7 @@ import { join } from "path"; import * as fs from "fs"; import { Injectable } from "@nestjs/common"; -import { CustomError } from "vitnode-backend"; +import { CustomError, DatabaseService } from "vitnode-backend"; import { CreateAdminPluginsArgs } from "./dto/create.args"; import { ShowAdminPlugins } from "../show/dto/show.obj"; @@ -10,7 +10,6 @@ import { CreateFilesAdminPluginsService } from "../helpers/files/create/create-f import { ChangeFilesAdminPluginsService } from "../helpers/files/change/change.service"; import { core_plugins } from "../../database/schema/plugins"; -import { DatabaseService } from "@/database/database.service"; import { ABSOLUTE_PATHS } from "@/config"; @Injectable() diff --git a/apps/backend/src/plugins/core/admin/plugins/delete/delete.service.ts b/apps/backend/src/plugins/core/admin/plugins/delete/delete.service.ts index 499b4faff..fdab2cd2c 100644 --- a/apps/backend/src/plugins/core/admin/plugins/delete/delete.service.ts +++ b/apps/backend/src/plugins/core/admin/plugins/delete/delete.service.ts @@ -2,13 +2,12 @@ import * as fs from "fs"; import { Injectable } from "@nestjs/common"; import { eq, sql } from "drizzle-orm"; -import { NotFoundError, CustomError } from "vitnode-backend"; +import { NotFoundError, CustomError, DatabaseService } from "vitnode-backend"; import { DeleteAdminPluginsArgs } from "./dto/delete.args"; import { ChangeFilesAdminPluginsService } from "../helpers/files/change/change.service"; import { core_plugins } from "../../database/schema/plugins"; -import { DatabaseService } from "@/database/database.service"; import { setRebuildRequired } from "@/functions/rebuild-required"; import { ABSOLUTE_PATHS } from "@/config"; import { core_migrations } from "../../database/schema/files"; diff --git a/apps/backend/src/plugins/core/admin/plugins/download/download.service.ts b/apps/backend/src/plugins/core/admin/plugins/download/download.service.ts index eea7e45f4..3e86f46a0 100644 --- a/apps/backend/src/plugins/core/admin/plugins/download/download.service.ts +++ b/apps/backend/src/plugins/core/admin/plugins/download/download.service.ts @@ -13,14 +13,14 @@ import { NotFoundError, CustomError, execShellCommand, - User + User, + DatabaseService } from "vitnode-backend"; import { DownloadAdminPluginsArgs } from "./dto/download.args"; import { PluginInfoJSONType } from "../helpers/files/create/contents"; import { core_plugins } from "../../database/schema/plugins"; -import { DatabaseService } from "@/database/database.service"; import { ABSOLUTE_PATHS } from "@/config"; @Injectable() diff --git a/apps/backend/src/plugins/core/admin/plugins/edit/edit.service.ts b/apps/backend/src/plugins/core/admin/plugins/edit/edit.service.ts index 816aa1fcb..a71afa216 100644 --- a/apps/backend/src/plugins/core/admin/plugins/edit/edit.service.ts +++ b/apps/backend/src/plugins/core/admin/plugins/edit/edit.service.ts @@ -2,14 +2,13 @@ import * as fs from "fs"; import { Injectable } from "@nestjs/common"; import { eq, ne } from "drizzle-orm"; -import { NotFoundError, CustomError } from "vitnode-backend"; +import { NotFoundError, CustomError, DatabaseService } from "vitnode-backend"; import { ShowAdminPlugins } from "../show/dto/show.obj"; import { EditAdminPluginsArgs } from "./dto/edit.args"; import { ConfigPlugin } from "../plugins.module"; import { core_plugins } from "../../database/schema/plugins"; -import { DatabaseService } from "@/database/database.service"; import { ABSOLUTE_PATHS } from "@/config"; @Injectable() diff --git a/apps/backend/src/plugins/core/admin/plugins/files/files.service.ts b/apps/backend/src/plugins/core/admin/plugins/files/files.service.ts index 418722b2a..07a8d4fae 100644 --- a/apps/backend/src/plugins/core/admin/plugins/files/files.service.ts +++ b/apps/backend/src/plugins/core/admin/plugins/files/files.service.ts @@ -1,12 +1,11 @@ import * as fs from "fs"; import { Injectable } from "@nestjs/common"; -import { NotFoundError } from "vitnode-backend"; +import { NotFoundError, DatabaseService } from "vitnode-backend"; import { FilesAdminPluginsArgs } from "./dto/files.args"; import { FilesAdminPluginsObj } from "./dto/files.obj"; -import { DatabaseService } from "@/database/database.service"; import { ABSOLUTE_PATHS } from "@/config"; @Injectable() diff --git a/apps/backend/src/plugins/core/admin/plugins/show/show.service.ts b/apps/backend/src/plugins/core/admin/plugins/show/show.service.ts index 5c5d38f7a..76cda678b 100644 --- a/apps/backend/src/plugins/core/admin/plugins/show/show.service.ts +++ b/apps/backend/src/plugins/core/admin/plugins/show/show.service.ts @@ -3,14 +3,14 @@ import { and, count, eq, ilike } from "drizzle-orm"; import { inputPaginationCursor, outputPagination, - SortDirectionEnum + SortDirectionEnum, + DatabaseService } from "vitnode-backend"; import { ShowAdminPluginsArgs } from "./dto/show.args"; import { ShowAdminPluginsObj } from "./dto/show.obj"; import { core_plugins } from "../../database/schema/plugins"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class ShowAdminPluginsService { diff --git a/apps/backend/src/plugins/core/admin/plugins/upload/upload.service.ts b/apps/backend/src/plugins/core/admin/plugins/upload/upload.service.ts index 568a0f8bb..4e46ae966 100644 --- a/apps/backend/src/plugins/core/admin/plugins/upload/upload.service.ts +++ b/apps/backend/src/plugins/core/admin/plugins/upload/upload.service.ts @@ -5,7 +5,7 @@ import { Injectable } from "@nestjs/common"; import * as tar from "tar"; import { eq } from "drizzle-orm"; import { currentUnixDate, generateRandomString } from "@vitnode/shared"; -import { FileUpload, CustomError } from "vitnode-backend"; +import { FileUpload, CustomError, DatabaseService } from "vitnode-backend"; import { ShowAdminPlugins } from "../show/dto/show.obj"; import { UploadAdminPluginsArgs } from "./dto/upload.args"; @@ -13,7 +13,6 @@ import { ChangeFilesAdminPluginsService } from "../helpers/files/change/change.s import { ConfigPlugin } from "../plugins.module"; import { core_plugins } from "../../database/schema/plugins"; -import { DatabaseService } from "@/database/database.service"; import { ABSOLUTE_PATHS } from "@/config"; import { migrate } from "@/utils/actions/migrate"; diff --git a/apps/backend/src/plugins/core/admin/sessions/authorization/authorization.service.ts b/apps/backend/src/plugins/core/admin/sessions/authorization/authorization.service.ts index 00d8aa189..83c459f7a 100644 --- a/apps/backend/src/plugins/core/admin/sessions/authorization/authorization.service.ts +++ b/apps/backend/src/plugins/core/admin/sessions/authorization/authorization.service.ts @@ -9,7 +9,8 @@ import { AccessDeniedError, getUserAgentData, getUserIp, - Ctx + Ctx, + DatabaseService } from "vitnode-backend"; import { @@ -18,7 +19,6 @@ import { } from "./dto/authorization.obj"; import { AuthorizationCurrentUserObj } from "@/plugins/core/sessions/authorization/dto/authorization.obj"; -import { DatabaseService } from "@/database/database.service"; import { getCoreInfo } from "../../settings/functions/get-core-info"; import { ABSOLUTE_PATHS } from "@/config"; import { ConfigPlugin } from "../../plugins/plugins.module"; diff --git a/apps/backend/src/plugins/core/admin/sessions/sign_out/sign_out.service.ts b/apps/backend/src/plugins/core/admin/sessions/sign_out/sign_out.service.ts index 67607bfc9..ff07256c4 100644 --- a/apps/backend/src/plugins/core/admin/sessions/sign_out/sign_out.service.ts +++ b/apps/backend/src/plugins/core/admin/sessions/sign_out/sign_out.service.ts @@ -1,10 +1,9 @@ import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; import { ConfigService } from "@nestjs/config"; -import { Ctx } from "vitnode-backend"; +import { Ctx, DatabaseService } from "vitnode-backend"; import { core_admin_sessions } from "@/plugins/core/admin/database/schema/admins"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class SignOutAdminSessionsService { diff --git a/apps/backend/src/plugins/core/admin/settings/main/edit/edit.service.ts b/apps/backend/src/plugins/core/admin/settings/main/edit/edit.service.ts index 9f102826b..dc8746326 100644 --- a/apps/backend/src/plugins/core/admin/settings/main/edit/edit.service.ts +++ b/apps/backend/src/plugins/core/admin/settings/main/edit/edit.service.ts @@ -3,12 +3,12 @@ import { join } from "path"; import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; +import { DatabaseService } from "vitnode-backend"; import { EditAdminMainSettingsArgs } from "./dto/edit.args"; import { EditAdminSettingsObj } from "./dto/edit.obj"; import { core_languages } from "../../../database/schema/languages"; -import { DatabaseService } from "@/database/database.service"; import { ManifestWithLang } from "@/plugins/core/settings/settings.module"; import { ABSOLUTE_PATHS, diff --git a/apps/backend/src/plugins/core/admin/staff/administrators/create/create.service.ts b/apps/backend/src/plugins/core/admin/staff/administrators/create/create.service.ts index 1865b7c66..a4dc97bdc 100644 --- a/apps/backend/src/plugins/core/admin/staff/administrators/create/create.service.ts +++ b/apps/backend/src/plugins/core/admin/staff/administrators/create/create.service.ts @@ -1,11 +1,10 @@ import { Injectable } from "@nestjs/common"; -import { CustomError } from "vitnode-backend"; +import { CustomError, DatabaseService } from "vitnode-backend"; import { ShowAdminStaffAdministrators } from "../show/dto/show.obj"; import { CreateAdminStaffAdministratorsArgs } from "./dto/create.args"; import { core_admin_permissions } from "@/plugins/core/admin/database/schema/admins"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class CreateAdminStaffAdministratorsService { diff --git a/apps/backend/src/plugins/core/admin/staff/administrators/delete/delete.service.ts b/apps/backend/src/plugins/core/admin/staff/administrators/delete/delete.service.ts index b3f6e6a9b..89a9b17d7 100644 --- a/apps/backend/src/plugins/core/admin/staff/administrators/delete/delete.service.ts +++ b/apps/backend/src/plugins/core/admin/staff/administrators/delete/delete.service.ts @@ -1,11 +1,10 @@ import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; -import { NotFoundError, CustomError } from "vitnode-backend"; +import { NotFoundError, CustomError, DatabaseService } from "vitnode-backend"; import { DeleteAdminStaffAdministratorsArgs } from "./dto/delete.args"; import { core_admin_permissions } from "@/plugins/core/admin/database/schema/admins"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class DeleteAdminStaffAdministratorsService { diff --git a/apps/backend/src/plugins/core/admin/staff/administrators/show/show.service.ts b/apps/backend/src/plugins/core/admin/staff/administrators/show/show.service.ts index 6d4264343..2a07c0f2b 100644 --- a/apps/backend/src/plugins/core/admin/staff/administrators/show/show.service.ts +++ b/apps/backend/src/plugins/core/admin/staff/administrators/show/show.service.ts @@ -3,14 +3,14 @@ import { count } from "drizzle-orm"; import { inputPaginationCursor, outputPagination, - SortDirectionEnum + SortDirectionEnum, + DatabaseService } from "vitnode-backend"; import { ShowAdminStaffAdministratorsArgs } from "./dto/show.args"; import { ShowAdminStaffAdministratorsObj } from "./dto/show.obj"; import { core_admin_permissions } from "@/plugins/core/admin/database/schema/admins"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class ShowAdminStaffAdministratorsService { diff --git a/apps/backend/src/plugins/core/admin/staff/moderators/create/create.service.ts b/apps/backend/src/plugins/core/admin/staff/moderators/create/create.service.ts index c17d8d91e..eebf4cd12 100644 --- a/apps/backend/src/plugins/core/admin/staff/moderators/create/create.service.ts +++ b/apps/backend/src/plugins/core/admin/staff/moderators/create/create.service.ts @@ -1,11 +1,10 @@ import { Injectable } from "@nestjs/common"; -import { CustomError } from "vitnode-backend"; +import { CustomError, DatabaseService } from "vitnode-backend"; import { ShowAdminStaffModerators } from "../show/dto/show.obj"; import { CreateAdminStaffModeratorsArgs } from "./dto/create.args"; import { core_moderators_permissions } from "@/plugins/core/admin/database/schema/moderators"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class CreateAdminStaffModeratorsService { diff --git a/apps/backend/src/plugins/core/admin/staff/moderators/delete/delete.service.ts b/apps/backend/src/plugins/core/admin/staff/moderators/delete/delete.service.ts index 470ac0fb3..87907e582 100644 --- a/apps/backend/src/plugins/core/admin/staff/moderators/delete/delete.service.ts +++ b/apps/backend/src/plugins/core/admin/staff/moderators/delete/delete.service.ts @@ -1,11 +1,10 @@ import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; -import { CustomError } from "vitnode-backend"; +import { CustomError, DatabaseService } from "vitnode-backend"; import { DeleteAdminStaffModeratorsArgs } from "./dto/delete.args"; import { core_moderators_permissions } from "@/plugins/core/admin/database/schema/moderators"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class DeleteAdminStaffModeratorsService { diff --git a/apps/backend/src/plugins/core/admin/staff/moderators/show/show.service.ts b/apps/backend/src/plugins/core/admin/staff/moderators/show/show.service.ts index cbb98a249..3f4f9b233 100644 --- a/apps/backend/src/plugins/core/admin/staff/moderators/show/show.service.ts +++ b/apps/backend/src/plugins/core/admin/staff/moderators/show/show.service.ts @@ -3,14 +3,14 @@ import { count } from "drizzle-orm"; import { inputPaginationCursor, outputPagination, - SortDirectionEnum + SortDirectionEnum, + DatabaseService } from "vitnode-backend"; import { ShowAdminStaffModeratorsArgs } from "./dto/show.args"; import { ShowAdminStaffModeratorsObj } from "./dto/show.obj"; import { core_moderators_permissions } from "@/plugins/core/admin/database/schema/moderators"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class ShowAdminStaffModeratorsService { diff --git a/apps/backend/src/plugins/core/admin/theme_editor/edit/edit.service.ts b/apps/backend/src/plugins/core/admin/theme_editor/edit/edit.service.ts index b755f421b..dba8797b2 100644 --- a/apps/backend/src/plugins/core/admin/theme_editor/edit/edit.service.ts +++ b/apps/backend/src/plugins/core/admin/theme_editor/edit/edit.service.ts @@ -3,12 +3,11 @@ import * as fs from "fs"; import { Injectable } from "@nestjs/common"; import { ConfigService } from "@nestjs/config"; -import { NotFoundError } from "vitnode-backend"; +import { NotFoundError, DatabaseService } from "vitnode-backend"; import { EditAdminThemeEditorArgs, ThemeVariableInput } from "./dto/edit.args"; import { ABSOLUTE_PATHS } from "@/config"; -import { DatabaseService } from "@/database/database.service"; export const keysFromCSSThemeEditor = [ "primary", diff --git a/apps/backend/src/plugins/core/editor/delete/delete.service.ts b/apps/backend/src/plugins/core/editor/delete/delete.service.ts index 87087368e..63e13e34d 100644 --- a/apps/backend/src/plugins/core/editor/delete/delete.service.ts +++ b/apps/backend/src/plugins/core/editor/delete/delete.service.ts @@ -1,6 +1,6 @@ import { Injectable } from "@nestjs/common"; import { count, eq } from "drizzle-orm"; -import { AccessDeniedError, User } from "vitnode-backend"; +import { AccessDeniedError, User, DatabaseService } from "vitnode-backend"; import { DeleteCoreEditorArgs } from "./dto/delete.args"; @@ -9,7 +9,6 @@ import { core_files, core_files_using } from "../../admin/database/schema/files"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class DeleteCoreEditorService { diff --git a/apps/backend/src/plugins/core/editor/upload/upload.service.ts b/apps/backend/src/plugins/core/editor/upload/upload.service.ts index c8e3184e8..8b26f121c 100644 --- a/apps/backend/src/plugins/core/editor/upload/upload.service.ts +++ b/apps/backend/src/plugins/core/editor/upload/upload.service.ts @@ -1,7 +1,7 @@ import { Injectable } from "@nestjs/common"; import { eq, sum } from "drizzle-orm"; import { generateRandomString } from "@vitnode/shared"; -import { AccessDeniedError, User } from "vitnode-backend"; +import { AccessDeniedError, User, DatabaseService } from "vitnode-backend"; import { UploadCoreEditorArgs } from "./dto/upload.args"; @@ -14,7 +14,6 @@ import { import { UploadCoreFilesArgs } from "../../files/helpers/upload/dto/upload.args"; import { core_files } from "../../admin/database/schema/files"; import { ShowCoreFiles } from "../../files/show/dto/show.obj"; -import { DatabaseService } from "@/database/database.service"; import { getConfigFile } from "@/config"; interface GetFilesAfterUploadArgs extends UploadCoreEditorArgs { diff --git a/apps/backend/src/plugins/core/files/download/download.controller.ts b/apps/backend/src/plugins/core/files/download/download.controller.ts index dd539101c..e8f870945 100644 --- a/apps/backend/src/plugins/core/files/download/download.controller.ts +++ b/apps/backend/src/plugins/core/files/download/download.controller.ts @@ -10,8 +10,8 @@ import { Query } from "@nestjs/common"; import { Response } from "express"; +import { DatabaseService } from "vitnode-backend"; -import { DatabaseService } from "@/database/database.service"; import { ABSOLUTE_PATHS } from "@/config"; @Controller("secure_files") diff --git a/apps/backend/src/plugins/core/files/files.cron.ts b/apps/backend/src/plugins/core/files/files.cron.ts index a8251b7dc..03a73d2ad 100644 --- a/apps/backend/src/plugins/core/files/files.cron.ts +++ b/apps/backend/src/plugins/core/files/files.cron.ts @@ -1,12 +1,11 @@ import { Injectable } from "@nestjs/common"; import { Cron, CronExpression } from "@nestjs/schedule"; import { desc, eq, lt, sql } from "drizzle-orm"; +import { DatabaseService } from "vitnode-backend"; import { core_files_using, core_files } from "../admin/database/schema/files"; import { DeleteCoreFilesService } from "./helpers/delete/delete.service"; -import { DatabaseService } from "@/database/database.service"; - @Injectable() export class CoreFilesCron { constructor( diff --git a/apps/backend/src/plugins/core/files/helpers/upload/upload.service.ts b/apps/backend/src/plugins/core/files/helpers/upload/upload.service.ts index 9f7600aab..37426992f 100644 --- a/apps/backend/src/plugins/core/files/helpers/upload/upload.service.ts +++ b/apps/backend/src/plugins/core/files/helpers/upload/upload.service.ts @@ -10,13 +10,12 @@ import { join } from "path"; import sharp from "sharp"; import { Injectable } from "@nestjs/common"; import { generateRandomString, removeSpecialCharacters } from "@vitnode/shared"; -import { CustomError } from "vitnode-backend"; +import { CustomError, DatabaseService } from "vitnode-backend"; import { UploadCoreFilesArgs } from "./dto/upload.args"; import { UploadCoreFilesObj } from "./dto/upload.obj"; import { HelpersUploadCoreFilesService, acceptMimeTypeImage } from "./helpers"; -import { DatabaseService } from "@/database/database.service"; import { ABSOLUTE_PATHS } from "@/config"; @Injectable() diff --git a/apps/backend/src/plugins/core/files/show/show.service.ts b/apps/backend/src/plugins/core/files/show/show.service.ts index 0afa718fe..676ff1b38 100644 --- a/apps/backend/src/plugins/core/files/show/show.service.ts +++ b/apps/backend/src/plugins/core/files/show/show.service.ts @@ -1,6 +1,7 @@ import { Injectable } from "@nestjs/common"; import { and, count, eq, ilike, or } from "drizzle-orm"; import { + DatabaseService, inputPaginationCursor, outputPagination, SortDirectionEnum, @@ -14,7 +15,6 @@ import { core_files_using, core_files } from "../../admin/database/schema/files"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class ShowCoreFilesService { diff --git a/apps/backend/src/plugins/core/helpers/text_language/parser/helpers.service.ts b/apps/backend/src/plugins/core/helpers/text_language/parser/helpers.service.ts index 18611e32c..39b60caab 100644 --- a/apps/backend/src/plugins/core/helpers/text_language/parser/helpers.service.ts +++ b/apps/backend/src/plugins/core/helpers/text_language/parser/helpers.service.ts @@ -1,8 +1,8 @@ import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; +import { DatabaseService } from "vitnode-backend"; import { core_files_using } from "@/plugins/core/admin/database/schema/files"; -import { DatabaseService } from "@/database/database.service"; interface TextLanguageJSONContentType { type: string; diff --git a/apps/backend/src/plugins/core/helpers/text_language/parser/parser.service.ts b/apps/backend/src/plugins/core/helpers/text_language/parser/parser.service.ts index e8de02a75..28d29edd3 100644 --- a/apps/backend/src/plugins/core/helpers/text_language/parser/parser.service.ts +++ b/apps/backend/src/plugins/core/helpers/text_language/parser/parser.service.ts @@ -1,15 +1,17 @@ import { Injectable } from "@nestjs/common"; import { Placeholder, SQL, eq } from "drizzle-orm"; import { PgTableWithColumns, TableConfig } from "drizzle-orm/pg-core"; -import { CustomError, TextLanguageInput } from "vitnode-backend"; +import { + CustomError, + TextLanguageInput, + DatabaseService +} from "vitnode-backend"; import { HelpersParserTextLanguageCoreHelpersService, InfoFromTextLanguageContentReturnValues } from "./helpers.service"; -import { DatabaseService } from "@/database/database.service"; - interface Args { data: TextLanguageInput[]; database: PgTableWithColumns; diff --git a/apps/backend/src/plugins/core/languages/show/show.service.ts b/apps/backend/src/plugins/core/languages/show/show.service.ts index 5bd0c12b6..95f953920 100644 --- a/apps/backend/src/plugins/core/languages/show/show.service.ts +++ b/apps/backend/src/plugins/core/languages/show/show.service.ts @@ -3,14 +3,14 @@ import { and, count, ilike } from "drizzle-orm"; import { inputPaginationCursor, outputPagination, - SortDirectionEnum + SortDirectionEnum, + DatabaseService } from "vitnode-backend"; import { ShowCoreLanguagesArgs } from "./dto/show.args"; import { ShowCoreLanguagesObj } from "./dto/show.obj"; import { core_languages } from "@/plugins/core/admin/database/schema/languages"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class ShowCoreLanguageService { diff --git a/apps/backend/src/plugins/core/members/avatar/delete/delete.service.ts b/apps/backend/src/plugins/core/members/avatar/delete/delete.service.ts index 085c3b8ed..3b7b39973 100644 --- a/apps/backend/src/plugins/core/members/avatar/delete/delete.service.ts +++ b/apps/backend/src/plugins/core/members/avatar/delete/delete.service.ts @@ -1,10 +1,9 @@ import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; -import { User } from "vitnode-backend"; +import { User, DatabaseService } from "vitnode-backend"; import { DeleteCoreFilesService } from "@/plugins/core/files/helpers/delete/delete.service"; import { core_files_avatars } from "@/plugins/core/admin/database/schema/users"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class DeleteAvatarCoreMembersService { diff --git a/apps/backend/src/plugins/core/members/avatar/upload/upload.service.ts b/apps/backend/src/plugins/core/members/avatar/upload/upload.service.ts index 78422c2b2..80864dbb0 100644 --- a/apps/backend/src/plugins/core/members/avatar/upload/upload.service.ts +++ b/apps/backend/src/plugins/core/members/avatar/upload/upload.service.ts @@ -1,6 +1,6 @@ import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; -import { CustomError, User } from "vitnode-backend"; +import { CustomError, User, DatabaseService } from "vitnode-backend"; import { UploadAvatarCoreMembersArgs } from "./dto/upload.args"; import { UploadAvatarCoreMembersObj } from "./dto/upload.obj"; @@ -8,7 +8,6 @@ import { UploadAvatarCoreMembersObj } from "./dto/upload.obj"; import { UploadCoreFilesService } from "@/plugins/core/files/helpers/upload/upload.service"; import { DeleteCoreFilesService } from "@/plugins/core/files/helpers/delete/delete.service"; import { core_files_avatars } from "@/plugins/core/admin/database/schema/users"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class UploadAvatarCoreMembersService { diff --git a/apps/backend/src/plugins/core/members/delete/delete.service.ts b/apps/backend/src/plugins/core/members/delete/delete.service.ts index a53f46961..f5bd54e57 100644 --- a/apps/backend/src/plugins/core/members/delete/delete.service.ts +++ b/apps/backend/src/plugins/core/members/delete/delete.service.ts @@ -1,11 +1,14 @@ import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; -import { NotFoundError, AccessDeniedError } from "vitnode-backend"; +import { + NotFoundError, + AccessDeniedError, + DatabaseService +} from "vitnode-backend"; import { DeleteCoreMembersArgs } from "./dto/delete.args"; import { core_users } from "@/plugins/core/admin/database/schema/users"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class DeleteCoreMembersService { diff --git a/apps/backend/src/plugins/core/members/show/show.service.ts b/apps/backend/src/plugins/core/members/show/show.service.ts index a7b4f5f18..1e16989b0 100644 --- a/apps/backend/src/plugins/core/members/show/show.service.ts +++ b/apps/backend/src/plugins/core/members/show/show.service.ts @@ -3,14 +3,14 @@ import { and, count, eq, ilike, or } from "drizzle-orm"; import { inputPaginationCursor, outputPagination, - SortDirectionEnum + SortDirectionEnum, + DatabaseService } from "vitnode-backend"; import { ShowCoreMembersObj } from "./dto/show.obj"; import { ShowCoreMembersArgs } from "./dto/show.args"; import { core_users } from "@/plugins/core/admin/database/schema/users"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class ShowCoreMembersService { diff --git a/apps/backend/src/plugins/core/members/sign_up/sign_up.service.ts b/apps/backend/src/plugins/core/members/sign_up/sign_up.service.ts index 00d6a61e6..eb0c07300 100644 --- a/apps/backend/src/plugins/core/members/sign_up/sign_up.service.ts +++ b/apps/backend/src/plugins/core/members/sign_up/sign_up.service.ts @@ -3,14 +3,13 @@ import { genSalt, hash } from "bcrypt"; import { count } from "drizzle-orm"; import { ConfigService } from "@nestjs/config"; import { removeSpecialCharacters } from "@vitnode/shared"; -import { CustomError, getUserIp, Ctx } from "vitnode-backend"; +import { CustomError, getUserIp, Ctx, DatabaseService } from "vitnode-backend"; import { SignUpCoreMembersArgs } from "./dto/sign_up.args"; import { SignUpCoreMembersObj } from "./dto/sign_up.obj"; import { generateAvatarColor } from "@/plugins/core/members/sign_up/functions/generate-avatar-color"; import { core_users } from "@/plugins/core/admin/database/schema/users"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class SignUpCoreMembersService { diff --git a/apps/backend/src/plugins/core/middleware/middleware.cron.ts b/apps/backend/src/plugins/core/middleware/middleware.cron.ts index def611c50..0be3f5f14 100644 --- a/apps/backend/src/plugins/core/middleware/middleware.cron.ts +++ b/apps/backend/src/plugins/core/middleware/middleware.cron.ts @@ -2,9 +2,9 @@ import { Injectable } from "@nestjs/common"; import { Cron, CronExpression } from "@nestjs/schedule"; import { lte } from "drizzle-orm"; import { ConfigService } from "@nestjs/config"; +import { DatabaseService } from "vitnode-backend"; import { core_sessions_known_devices } from "@/plugins/core/admin/database/schema/sessions"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class CoreMiddlewareCron { diff --git a/apps/backend/src/plugins/core/nav/show/show.service.ts b/apps/backend/src/plugins/core/nav/show/show.service.ts index 0bae0f4d8..98e08d2d3 100644 --- a/apps/backend/src/plugins/core/nav/show/show.service.ts +++ b/apps/backend/src/plugins/core/nav/show/show.service.ts @@ -3,14 +3,14 @@ import { and, count, eq } from "drizzle-orm"; import { inputPaginationCursor, outputPagination, - SortDirectionEnum + SortDirectionEnum, + DatabaseService } from "vitnode-backend"; import { ShowCoreNavArgs } from "./dto/show.args"; import { ShowCoreNavObj } from "./dto/show.obj"; import { core_nav } from "@/plugins/core/admin/database/schema/nav"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class ShowCoreNavService { diff --git a/apps/backend/src/plugins/core/plugins/show/show.service.ts b/apps/backend/src/plugins/core/plugins/show/show.service.ts index a53b4b5a0..a2e7a55b1 100644 --- a/apps/backend/src/plugins/core/plugins/show/show.service.ts +++ b/apps/backend/src/plugins/core/plugins/show/show.service.ts @@ -1,9 +1,8 @@ import { Injectable } from "@nestjs/common"; +import { DatabaseService } from "vitnode-backend"; import { ShowCorePluginsObj } from "./dto/show.obj"; -import { DatabaseService } from "@/database/database.service"; - @Injectable() export class ShowCorePluginsService { constructor(private readonly databaseService: DatabaseService) {} diff --git a/apps/backend/src/plugins/core/sessions/authorization/authorization.service.ts b/apps/backend/src/plugins/core/sessions/authorization/authorization.service.ts index 9d5e35a28..9b973ef71 100644 --- a/apps/backend/src/plugins/core/sessions/authorization/authorization.service.ts +++ b/apps/backend/src/plugins/core/sessions/authorization/authorization.service.ts @@ -1,12 +1,11 @@ import { Injectable } from "@nestjs/common"; import { eq, sum } from "drizzle-orm"; -import { Ctx } from "vitnode-backend"; +import { Ctx, DatabaseService } from "vitnode-backend"; import { InternalAuthorizationCoreSessionsService } from "./internal/internal_authorization.service"; import { AuthorizationCoreSessionsObj } from "./dto/authorization.obj"; import { core_files } from "../../admin/database/schema/files"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class AuthorizationCoreSessionsService { diff --git a/apps/backend/src/plugins/core/sessions/authorization/internal/internal_authorization.service.ts b/apps/backend/src/plugins/core/sessions/authorization/internal/internal_authorization.service.ts index 69899ed58..c07f5b6d1 100644 --- a/apps/backend/src/plugins/core/sessions/authorization/internal/internal_authorization.service.ts +++ b/apps/backend/src/plugins/core/sessions/authorization/internal/internal_authorization.service.ts @@ -8,12 +8,12 @@ import { getUserAgentData, getUserIp, User, - Ctx + Ctx, + DatabaseService } from "vitnode-backend"; import { core_sessions_known_devices } from "@/plugins/core/admin/database/schema/sessions"; import { DeviceSignInCoreSessionsService } from "../../sign_in/device.service"; -import { DatabaseService } from "@/database/database.service"; import { core_users } from "@/plugins/core/admin/database/schema/users"; @Injectable() diff --git a/apps/backend/src/plugins/core/sessions/devices/show/show.service.ts b/apps/backend/src/plugins/core/sessions/devices/show/show.service.ts index 38e8b2959..618d82030 100644 --- a/apps/backend/src/plugins/core/sessions/devices/show/show.service.ts +++ b/apps/backend/src/plugins/core/sessions/devices/show/show.service.ts @@ -1,6 +1,6 @@ import { Injectable } from "@nestjs/common"; import { desc, eq } from "drizzle-orm"; -import { User } from "vitnode-backend"; +import { User, DatabaseService } from "vitnode-backend"; import { ShowCoreSessionDevicesObj } from "./dto/show.obj"; @@ -8,7 +8,6 @@ import { core_sessions, core_sessions_known_devices } from "@/plugins/core/admin/database/schema/sessions"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class ShowCoreSessionDevicesService { diff --git a/apps/backend/src/plugins/core/sessions/sessions.cron.ts b/apps/backend/src/plugins/core/sessions/sessions.cron.ts index 512658efd..7617f452e 100644 --- a/apps/backend/src/plugins/core/sessions/sessions.cron.ts +++ b/apps/backend/src/plugins/core/sessions/sessions.cron.ts @@ -2,11 +2,11 @@ import { Injectable } from "@nestjs/common"; import { Cron, CronExpression } from "@nestjs/schedule"; import { and, lte } from "drizzle-orm"; import { ConfigService } from "@nestjs/config"; +import { DatabaseService } from "vitnode-backend"; import { core_admin_sessions } from "../admin/database/schema/admins"; import { core_sessions } from "@/plugins/core/admin/database/schema/sessions"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class CoreSessionsCron { diff --git a/apps/backend/src/plugins/core/sessions/sign_in/device.service.ts b/apps/backend/src/plugins/core/sessions/sign_in/device.service.ts index 14efbc9be..783a7acc4 100644 --- a/apps/backend/src/plugins/core/sessions/sign_in/device.service.ts +++ b/apps/backend/src/plugins/core/sessions/sign_in/device.service.ts @@ -1,9 +1,13 @@ import { Injectable } from "@nestjs/common"; import { ConfigService } from "@nestjs/config"; -import { getUserAgentData, getUserIp, Ctx } from "vitnode-backend"; +import { + getUserAgentData, + getUserIp, + Ctx, + DatabaseService +} from "vitnode-backend"; import { core_sessions_known_devices } from "@/plugins/core/admin/database/schema/sessions"; -import { DatabaseService } from "@/database/database.service"; interface DeviceType { id: number; diff --git a/apps/backend/src/plugins/core/sessions/sign_in/sign_in.service.ts b/apps/backend/src/plugins/core/sessions/sign_in/sign_in.service.ts index 0a801a7ee..34f203f11 100644 --- a/apps/backend/src/plugins/core/sessions/sign_in/sign_in.service.ts +++ b/apps/backend/src/plugins/core/sessions/sign_in/sign_in.service.ts @@ -3,14 +3,18 @@ import { compare } from "bcrypt"; import { JwtService } from "@nestjs/jwt"; import { ConfigService } from "@nestjs/config"; import { and, eq } from "drizzle-orm"; -import { AccessDeniedError, CustomError, Ctx } from "vitnode-backend"; +import { + AccessDeniedError, + CustomError, + Ctx, + DatabaseService +} from "vitnode-backend"; import { SignInCoreSessionsArgs } from "./dto/sign_in.args"; import { DeviceSignInCoreSessionsService } from "./device.service"; import { core_admin_sessions } from "@/plugins/core/admin/database/schema/admins"; import { core_sessions } from "@/plugins/core/admin/database/schema/sessions"; -import { DatabaseService } from "@/database/database.service"; interface CreateSessionArgs extends Ctx { email: string; diff --git a/apps/backend/src/plugins/core/sessions/sign_out/sign_out.service.ts b/apps/backend/src/plugins/core/sessions/sign_out/sign_out.service.ts index 665699371..9bb6de3fa 100644 --- a/apps/backend/src/plugins/core/sessions/sign_out/sign_out.service.ts +++ b/apps/backend/src/plugins/core/sessions/sign_out/sign_out.service.ts @@ -1,10 +1,9 @@ import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; import { ConfigService } from "@nestjs/config"; -import { Ctx } from "vitnode-backend"; +import { Ctx, DatabaseService } from "vitnode-backend"; import { core_sessions } from "@/plugins/core/admin/database/schema/sessions"; -import { DatabaseService } from "@/database/database.service"; @Injectable() export class SignOutCoreSessionsService { diff --git a/apps/backend/src/plugins/core/settings/show/show.service.ts b/apps/backend/src/plugins/core/settings/show/show.service.ts index fc3a0c433..1bd905b9f 100644 --- a/apps/backend/src/plugins/core/settings/show/show.service.ts +++ b/apps/backend/src/plugins/core/settings/show/show.service.ts @@ -2,12 +2,12 @@ import { join } from "path"; import * as fs from "fs"; import { Injectable } from "@nestjs/common"; +import { DatabaseService } from "vitnode-backend"; import { ShowSettingsObj } from "./dto/show.obj"; import { ManifestWithLang } from "../settings.module"; import { core_languages } from "../../admin/database/schema/languages"; -import { DatabaseService } from "@/database/database.service"; import { ABSOLUTE_PATHS, getConfigFile } from "@/config"; @Injectable() diff --git a/apps/backend/src/utils/guards/admin-permission.guard.ts b/apps/backend/src/utils/guards/admin-permission.guard.ts index 2df643603..adba05597 100644 --- a/apps/backend/src/utils/guards/admin-permission.guard.ts +++ b/apps/backend/src/utils/guards/admin-permission.guard.ts @@ -2,9 +2,8 @@ import { CanActivate, ExecutionContext, Injectable } from "@nestjs/common"; import { Reflector } from "@nestjs/core"; import { GqlExecutionContext } from "@nestjs/graphql"; import { eq } from "drizzle-orm"; -import { Ctx } from "vitnode-backend"; +import { Ctx, DatabaseService } from "vitnode-backend"; -import { DatabaseService } from "@/database/database.service"; import { AuthorizationAdminSessionsService } from "@/plugins/core/admin/sessions/authorization/authorization.service"; import { core_users } from "@/plugins/core/admin/database/schema/users"; diff --git a/packages/backend/README.md b/packages/backend/README.md index f9e45b3f8..651faa7f9 100644 --- a/packages/backend/README.md +++ b/packages/backend/README.md @@ -1,3 +1,6 @@ -# VitNode - test package +# Vitnode - Backend Package -This is a test package for the VitNode framework. +This package is used to create wrapper for a backend server in NestJS for the VitNode framework. + +> [!WARNING] +> 🛠️ VitNode is still in development! You can try it out, but it is not recommended to use it now in production. diff --git a/packages/backend/package.json b/packages/backend/package.json index b9f73e840..831b77265 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -29,6 +29,7 @@ "@types/http-errors": "^2.0.4", "@types/node": "^20.14.2", "@types/object-path": "^0.11.4", + "@types/pg": "^8.11.6", "busboy": "^1.6.0", "eslint-config-vitnode": "workspace:*", "http-errors": "^2.0.0", @@ -42,6 +43,7 @@ "drizzle-orm": "^0.31.2", "express": "^4.19.2", "graphql": "^16.8.2", + "pg": "^8.12.0", "ua-parser-js": "2.0.0-beta.3" } } diff --git a/packages/backend/src/app.module.ts b/packages/backend/src/app.module.ts index 39576e427..8fc71e207 100644 --- a/packages/backend/src/app.module.ts +++ b/packages/backend/src/app.module.ts @@ -11,6 +11,7 @@ import { ApolloServerPluginLandingPageLocalDefault } from "@apollo/server/plugin import { Ctx } from "./utils"; import { CoreModule } from "./core/core.module"; +import { DatabaseModule, DatabaseModuleArgs } from "./database/database.module"; export const ABSOLUTE_PATHS_BACKEND = { schema: join(process.cwd(), "schema.gql"), @@ -77,13 +78,14 @@ export interface VitNodePaths { } interface Args { + database: DatabaseModuleArgs; paths: VitNodePaths; - schemaDatabase: Record; + // schemaDatabase: Record; } @Module({}) export class VitNodeCoreModule { - static register({ paths, schemaDatabase }: Args): DynamicModule { + static register({ paths, database }: Args): DynamicModule { return { module: VitNodeCoreModule, imports: [ @@ -106,6 +108,7 @@ export class VitNodeCoreModule { rootPath: ABSOLUTE_PATHS_BACKEND.uploads.public, serveRoot: "/public/" }), + DatabaseModule.register(database), CoreModule ] }; diff --git a/packages/backend/src/database/client.ts b/packages/backend/src/database/client.ts new file mode 100644 index 000000000..cee7cf4f3 --- /dev/null +++ b/packages/backend/src/database/client.ts @@ -0,0 +1,19 @@ +import { drizzle } from "drizzle-orm/node-postgres"; +import { Pool, PoolConfig } from "pg"; + +interface Args { + config: PoolConfig; + schemaDatabase: T; +} + +export function createClientDatabase< + T extends Record = Record +>({ config, schemaDatabase }: Args) { + const poolDB = new Pool(config); + const db = drizzle(poolDB, { schema: schemaDatabase }); + + return { + db, + poolDB + }; +} diff --git a/packages/backend/src/database/database.module.ts b/packages/backend/src/database/database.module.ts new file mode 100644 index 000000000..190f1df11 --- /dev/null +++ b/packages/backend/src/database/database.module.ts @@ -0,0 +1,33 @@ +import { DynamicModule, Global, Module } from "@nestjs/common"; +import { registerEnumType } from "@nestjs/graphql"; +import { PoolConfig } from "pg"; + +import { DatabaseService } from "./database.service"; + +import { SortDirectionEnum } from ".."; + +registerEnumType(SortDirectionEnum, { + name: "SortDirectionEnum" +}); + +export interface DatabaseModuleArgs { + config: PoolConfig; +} + +@Global() +@Module({}) +export class DatabaseModule { + static register(options: DatabaseModuleArgs): DynamicModule { + return { + module: DatabaseModule, + providers: [ + { + provide: "DATABASE_MODULE_OPTIONS", + useValue: options + }, + DatabaseService + ], + exports: [DatabaseService] + }; + } +} diff --git a/packages/backend/src/database/database.service.ts b/packages/backend/src/database/database.service.ts new file mode 100644 index 000000000..e5ad13cb1 --- /dev/null +++ b/packages/backend/src/database/database.service.ts @@ -0,0 +1,22 @@ +import { Inject, Injectable } from "@nestjs/common"; +import { NodePgDatabase } from "drizzle-orm/node-postgres"; + +import { DatabaseModuleArgs } from "./database.module"; +import { createClientDatabase } from "./client"; + +@Injectable() +export class DatabaseService { + public db: NodePgDatabase; + + constructor( + @Inject("DATABASE_MODULE_OPTIONS") + private readonly options: DatabaseModuleArgs + ) { + const client = createClientDatabase({ + schemaDatabase: {}, + config: this.options.config + }); + + this.db = client.db; + } +} diff --git a/packages/backend/src/database/index.ts b/packages/backend/src/database/index.ts new file mode 100644 index 000000000..79e0fe58c --- /dev/null +++ b/packages/backend/src/database/index.ts @@ -0,0 +1,3 @@ +export * from "./client"; +export * from "./database.module"; +export * from "./database.service"; diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts index cef803081..4b4acf751 100644 --- a/packages/backend/src/index.ts +++ b/packages/backend/src/index.ts @@ -5,3 +5,4 @@ export * from "./utils"; export * from "./decorators"; export * from "./main"; export * from "./app.module"; +export * from "./database"; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5bcab4d5d..c36989d7b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -101,7 +101,7 @@ importers: version: 4.2.1(graphql@16.8.2) '@nestjs/cli': specifier: ^10.3.2 - version: 10.3.2(@swc/cli@0.3.12(@swc/core@1.6.1(@swc/helpers@0.5.11))(chokidar@3.6.0))(@swc/core@1.6.1(@swc/helpers@0.5.11))(esbuild@0.19.12) + version: 10.3.2(@swc/cli@0.3.12(@swc/core@1.6.1(@swc/helpers@0.5.11))(chokidar@3.6.0))(@swc/core@1.6.1(@swc/helpers@0.5.11)) '@nestjs/schematics': specifier: ^10.1.1 version: 10.1.1(chokidar@3.6.0)(typescript@5.4.5) @@ -490,6 +490,9 @@ importers: graphql: specifier: ^16.8.2 version: 16.8.2 + pg: + specifier: ^8.12.0 + version: 8.12.0 ua-parser-js: specifier: 2.0.0-beta.3 version: 2.0.0-beta.3 @@ -536,6 +539,9 @@ importers: '@types/object-path': specifier: ^0.11.4 version: 0.11.4 + '@types/pg': + specifier: ^8.11.6 + version: 8.11.6 busboy: specifier: ^1.6.0 version: 1.6.0 @@ -10053,7 +10059,7 @@ snapshots: lodash.omit: 4.5.0 tslib: 2.6.2 - '@nestjs/cli@10.3.2(@swc/cli@0.3.12(@swc/core@1.6.1(@swc/helpers@0.5.11))(chokidar@3.6.0))(@swc/core@1.6.1(@swc/helpers@0.5.11))(esbuild@0.19.12)': + '@nestjs/cli@10.3.2(@swc/cli@0.3.12(@swc/core@1.6.1(@swc/helpers@0.5.11))(chokidar@3.6.0))(@swc/core@1.6.1(@swc/helpers@0.5.11))': dependencies: '@angular-devkit/core': 17.1.2(chokidar@3.6.0) '@angular-devkit/schematics': 17.1.2(chokidar@3.6.0) @@ -10063,7 +10069,7 @@ snapshots: chokidar: 3.6.0 cli-table3: 0.6.3 commander: 4.1.1 - fork-ts-checker-webpack-plugin: 9.0.2(typescript@5.3.3)(webpack@5.90.1(@swc/core@1.6.1(@swc/helpers@0.5.11))(esbuild@0.19.12)) + fork-ts-checker-webpack-plugin: 9.0.2(typescript@5.3.3)(webpack@5.90.1(@swc/core@1.6.1(@swc/helpers@0.5.11))) glob: 10.3.10 inquirer: 8.2.6 node-emoji: 1.11.0 @@ -10075,7 +10081,7 @@ snapshots: tsconfig-paths: 4.2.0 tsconfig-paths-webpack-plugin: 4.1.0 typescript: 5.3.3 - webpack: 5.90.1(@swc/core@1.6.1(@swc/helpers@0.5.11))(esbuild@0.19.12) + webpack: 5.90.1(@swc/core@1.6.1(@swc/helpers@0.5.11)) webpack-node-externals: 3.0.0 optionalDependencies: '@swc/cli': 0.3.12(@swc/core@1.6.1(@swc/helpers@0.5.11))(chokidar@3.6.0) @@ -11975,7 +11981,7 @@ snapshots: dependencies: '@types/node': 20.14.2 tapable: 2.2.1 - webpack: 5.92.0(@swc/core@1.6.1(@swc/helpers@0.5.11))(esbuild@0.19.12) + webpack: 5.92.0(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11) transitivePeerDependencies: - '@swc/core' - esbuild @@ -13987,7 +13993,7 @@ snapshots: cross-spawn: 7.0.3 signal-exit: 4.1.0 - fork-ts-checker-webpack-plugin@9.0.2(typescript@5.3.3)(webpack@5.90.1(@swc/core@1.6.1(@swc/helpers@0.5.11))(esbuild@0.19.12)): + fork-ts-checker-webpack-plugin@9.0.2(typescript@5.3.3)(webpack@5.90.1(@swc/core@1.6.1(@swc/helpers@0.5.11))): dependencies: '@babel/code-frame': 7.24.7 chalk: 4.1.2 @@ -14002,7 +14008,7 @@ snapshots: semver: 7.6.2 tapable: 2.2.1 typescript: 5.3.3 - webpack: 5.90.1(@swc/core@1.6.1(@swc/helpers@0.5.11))(esbuild@0.19.12) + webpack: 5.90.1(@swc/core@1.6.1(@swc/helpers@0.5.11)) form-data@4.0.0: dependencies: @@ -16607,29 +16613,27 @@ snapshots: mkdirp: 3.0.1 yallist: 5.0.0 - terser-webpack-plugin@5.3.10(@swc/core@1.6.1(@swc/helpers@0.5.11))(esbuild@0.19.12)(webpack@5.90.1(@swc/core@1.6.1(@swc/helpers@0.5.11))(esbuild@0.19.12)): + terser-webpack-plugin@5.3.10(@swc/core@1.6.1(@swc/helpers@0.5.11))(webpack@5.90.1(@swc/core@1.6.1(@swc/helpers@0.5.11))): dependencies: '@jridgewell/trace-mapping': 0.3.25 jest-worker: 27.5.1 schema-utils: 3.3.0 serialize-javascript: 6.0.2 terser: 5.31.1 - webpack: 5.90.1(@swc/core@1.6.1(@swc/helpers@0.5.11))(esbuild@0.19.12) + webpack: 5.90.1(@swc/core@1.6.1(@swc/helpers@0.5.11)) optionalDependencies: '@swc/core': 1.6.1(@swc/helpers@0.5.11) - esbuild: 0.19.12 - terser-webpack-plugin@5.3.10(@swc/core@1.6.1(@swc/helpers@0.5.11))(esbuild@0.19.12)(webpack@5.92.0(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11)): + terser-webpack-plugin@5.3.10(@swc/core@1.6.1(@swc/helpers@0.5.11))(webpack@5.92.0(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11)): dependencies: '@jridgewell/trace-mapping': 0.3.25 jest-worker: 27.5.1 schema-utils: 3.3.0 serialize-javascript: 6.0.2 terser: 5.31.1 - webpack: 5.92.0(@swc/core@1.6.1(@swc/helpers@0.5.11))(esbuild@0.19.12) + webpack: 5.92.0(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11) optionalDependencies: '@swc/core': 1.6.1(@swc/helpers@0.5.11) - esbuild: 0.19.12 terser@5.31.1: dependencies: @@ -17001,7 +17005,7 @@ snapshots: webpack-sources@3.2.3: {} - webpack@5.90.1(@swc/core@1.6.1(@swc/helpers@0.5.11))(esbuild@0.19.12): + webpack@5.90.1(@swc/core@1.6.1(@swc/helpers@0.5.11)): dependencies: '@types/eslint-scope': 3.7.7 '@types/estree': 1.0.5 @@ -17024,7 +17028,7 @@ snapshots: neo-async: 2.6.2 schema-utils: 3.3.0 tapable: 2.2.1 - terser-webpack-plugin: 5.3.10(@swc/core@1.6.1(@swc/helpers@0.5.11))(esbuild@0.19.12)(webpack@5.90.1(@swc/core@1.6.1(@swc/helpers@0.5.11))(esbuild@0.19.12)) + terser-webpack-plugin: 5.3.10(@swc/core@1.6.1(@swc/helpers@0.5.11))(webpack@5.90.1(@swc/core@1.6.1(@swc/helpers@0.5.11))) watchpack: 2.4.1 webpack-sources: 3.2.3 transitivePeerDependencies: @@ -17032,7 +17036,7 @@ snapshots: - esbuild - uglify-js - webpack@5.92.0(@swc/core@1.6.1(@swc/helpers@0.5.11))(esbuild@0.19.12): + webpack@5.92.0(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11): dependencies: '@types/eslint-scope': 3.7.7 '@types/estree': 1.0.5 @@ -17055,7 +17059,7 @@ snapshots: neo-async: 2.6.2 schema-utils: 3.3.0 tapable: 2.2.1 - terser-webpack-plugin: 5.3.10(@swc/core@1.6.1(@swc/helpers@0.5.11))(esbuild@0.19.12)(webpack@5.92.0(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11)) + terser-webpack-plugin: 5.3.10(@swc/core@1.6.1(@swc/helpers@0.5.11))(webpack@5.92.0(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11)) watchpack: 2.4.1 webpack-sources: 3.2.3 transitivePeerDependencies: From 4347a438af18c39394e1e92d72620e8d7b68ba30 Mon Sep 17 00:00:00 2001 From: aXenDeveloper Date: Thu, 20 Jun 2024 22:57:37 +0200 Subject: [PATCH 05/27] feat(backend): Create "vitnode-backend init" script to init require resources & data into project --- apps/backend/package.json | 3 +- packages/backend/package.json | 6 +- .../backend/src/database/database.service.ts | 6 +- packages/backend/src/index.ts | 1 + packages/backend/src/scripts/index.ts | 1 + packages/backend/src/scripts/init.ts | 44 +++++++ .../templates/core/admin/database/index.ts | 21 ++++ .../core/admin/database/schema/admins.ts | 93 +++++++++++++++ .../core/admin/database/schema/files.ts | 82 +++++++++++++ .../core/admin/database/schema/groups.ts | 67 +++++++++++ .../core/admin/database/schema/languages.ts | 33 ++++++ .../core/admin/database/schema/moderators.ts | 51 ++++++++ .../core/admin/database/schema/nav.ts | 109 ++++++++++++++++++ .../core/admin/database/schema/plugins.ts | 33 ++++++ .../core/admin/database/schema/sessions.ts | 78 +++++++++++++ .../core/admin/database/schema/users.ts | 73 ++++++++++++ 16 files changed, 696 insertions(+), 5 deletions(-) create mode 100644 packages/backend/src/scripts/index.ts create mode 100644 packages/backend/src/scripts/init.ts create mode 100644 packages/backend/templates/core/admin/database/index.ts create mode 100644 packages/backend/templates/core/admin/database/schema/admins.ts create mode 100644 packages/backend/templates/core/admin/database/schema/files.ts create mode 100644 packages/backend/templates/core/admin/database/schema/groups.ts create mode 100644 packages/backend/templates/core/admin/database/schema/languages.ts create mode 100644 packages/backend/templates/core/admin/database/schema/moderators.ts create mode 100644 packages/backend/templates/core/admin/database/schema/nav.ts create mode 100644 packages/backend/templates/core/admin/database/schema/plugins.ts create mode 100644 packages/backend/templates/core/admin/database/schema/sessions.ts create mode 100644 packages/backend/templates/core/admin/database/schema/users.ts diff --git a/apps/backend/package.json b/apps/backend/package.json index 21cf158bf..80d702466 100644 --- a/apps/backend/package.json +++ b/apps/backend/package.json @@ -17,7 +17,8 @@ "migrate:forum": "drizzle-kit generate --config src/plugins/forum/admin/database/drizzle.config.ts", "migrate:admin": "drizzle-kit up --config src/plugins/core/admin/database/drizzle.config.ts && drizzle-kit generate --config src/plugins/core/admin/database/drizzle.config.ts", "migrate:blog": "drizzle-kit up --config src/plugins/blog/admin/database/drizzle.config.ts && drizzle-kit generate --config src/plugins/blog/admin/database/drizzle.config.ts", - "codegen": "graphql-codegen --config codegen.ts" + "codegen": "graphql-codegen --config codegen.ts", + "test123": "vitnode-backend init" }, "dependencies": { "@apollo/server": "^4.10.4", diff --git a/packages/backend/package.json b/packages/backend/package.json index 831b77265..70746f9ef 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -5,12 +5,14 @@ "repository": { "url": "https://github.com/aXenDeveloper/vitnode/" }, + "bin": { + "vitnode-backend": "./dist/scripts/init.js" + }, "scripts": { "build": "tsc", "dev": "tsc -w", "lint": "eslint .", - "lint:fix": "eslint . --fix", - "migrate:admin": "drizzle-kit up --config src/drizzle.config.ts && drizzle-kit generate --config src/drizzle.config.ts" + "lint:fix": "eslint . --fix" }, "main": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/packages/backend/src/database/database.service.ts b/packages/backend/src/database/database.service.ts index e5ad13cb1..21292cfec 100644 --- a/packages/backend/src/database/database.service.ts +++ b/packages/backend/src/database/database.service.ts @@ -4,9 +4,11 @@ import { NodePgDatabase } from "drizzle-orm/node-postgres"; import { DatabaseModuleArgs } from "./database.module"; import { createClientDatabase } from "./client"; +import coreSchemaDatabase from "@/../templates/core/admin/database"; + @Injectable() export class DatabaseService { - public db: NodePgDatabase; + public db: NodePgDatabase; constructor( @Inject("DATABASE_MODULE_OPTIONS") @@ -17,6 +19,6 @@ export class DatabaseService { config: this.options.config }); - this.db = client.db; + this.db = client.db as NodePgDatabase; } } diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts index 4b4acf751..dca0dfadb 100644 --- a/packages/backend/src/index.ts +++ b/packages/backend/src/index.ts @@ -6,3 +6,4 @@ export * from "./decorators"; export * from "./main"; export * from "./app.module"; export * from "./database"; +export * from "./scripts"; diff --git a/packages/backend/src/scripts/index.ts b/packages/backend/src/scripts/index.ts new file mode 100644 index 000000000..fccf97681 --- /dev/null +++ b/packages/backend/src/scripts/index.ts @@ -0,0 +1 @@ +export * from "./init"; diff --git a/packages/backend/src/scripts/init.ts b/packages/backend/src/scripts/init.ts new file mode 100644 index 000000000..fe2169832 --- /dev/null +++ b/packages/backend/src/scripts/init.ts @@ -0,0 +1,44 @@ +#!/usr/bin/env node + +import { join } from "path"; +import * as fs from "fs"; + +/* eslint-disable no-console */ + +const copyDatabaseSchema = ({ corePluginPath }: { corePluginPath: string }) => { + const currentPathToSchema = join( + __dirname, + "..", + "..", + "templates", + "core", + "admin", + "database" + ); + if (!fs.existsSync(currentPathToSchema)) { + throw new Error( + "Database schema not found in 'templates/core/admin/database' directory." + ); + } + + const userPathToSchema = join(corePluginPath, "admin", "database"); + fs.cpSync(currentPathToSchema, userPathToSchema, { recursive: true }); +}; + +export const init = () => { + const corePluginPath = join(process.cwd(), "src", "plugins", "core"); + + if (!fs.existsSync(corePluginPath)) { + console.error("Plugin 'core' not found in 'src/plugins' directory."); + process.exit(1); + } + + // Copy the schema from the template to the core plugin + copyDatabaseSchema({ corePluginPath }); + + console.log("Hello, world!", process.cwd()); +}; + +if (process.argv[2] === "init") { + init(); +} diff --git a/packages/backend/templates/core/admin/database/index.ts b/packages/backend/templates/core/admin/database/index.ts new file mode 100644 index 000000000..92713a56a --- /dev/null +++ b/packages/backend/templates/core/admin/database/index.ts @@ -0,0 +1,21 @@ +import * as groups from "./schema/groups"; +import * as languages from "./schema/languages"; +import * as users from "./schema/users"; +import * as sessions from "./schema/sessions"; +import * as files from "./schema/files"; +import * as admins from "./schema/admins"; +import * as moderators from "./schema/moderators"; +import * as plugins from "./schema/plugins"; +import * as nav from "./schema/nav"; + +export default { + ...groups, + ...languages, + ...users, + ...sessions, + ...files, + ...admins, + ...moderators, + ...plugins, + ...nav +}; diff --git a/packages/backend/templates/core/admin/database/schema/admins.ts b/packages/backend/templates/core/admin/database/schema/admins.ts new file mode 100644 index 000000000..3aa32f4b8 --- /dev/null +++ b/packages/backend/templates/core/admin/database/schema/admins.ts @@ -0,0 +1,93 @@ +import { + boolean, + index, + integer, + jsonb, + pgTable, + serial, + timestamp, + varchar +} from "drizzle-orm/pg-core"; +import { relations } from "drizzle-orm"; + +import { core_groups } from "./groups"; +import { core_users } from "./users"; +import { core_sessions_known_devices } from "./sessions"; + +export const core_admin_permissions = pgTable( + "core_admin_permissions", + { + id: serial("id").primaryKey(), + group_id: integer("group_id").references(() => core_groups.id, { + onDelete: "cascade" + }), + user_id: integer("user_id").references(() => core_users.id, { + onDelete: "cascade" + }), + unrestricted: boolean("unrestricted").notNull().default(false), + created: timestamp("created").notNull().defaultNow(), + updated: timestamp("updated").notNull().defaultNow(), + protected: boolean("protected").notNull().default(false), + permissions: jsonb("permissions").default("{}") + }, + table => ({ + group_id_idx: index("core_admin_permissions_group_id_idx").on( + table.group_id + ), + user_id_idx: index("core_admin_permissions_user_id_idx").on(table.user_id) + }) +); + +export const core_admin_permissions_relations = relations( + core_admin_permissions, + ({ one }) => ({ + group: one(core_groups, { + fields: [core_admin_permissions.group_id], + references: [core_groups.id] + }), + user: one(core_users, { + fields: [core_admin_permissions.user_id], + references: [core_users.id] + }) + }) +); + +export const core_admin_sessions = pgTable( + "core_admin_sessions", + { + login_token: varchar("login_token", { length: 255 }).primaryKey(), + user_id: integer("user_id") + .notNull() + .references(() => core_users.id, { + onDelete: "cascade" + }), + created: timestamp("created").notNull().defaultNow(), + last_seen: timestamp("last_seen").notNull().defaultNow(), + expires: timestamp("expires").notNull(), + device_id: integer("device_id") + .references(() => core_sessions_known_devices.id, { + onDelete: "cascade" + }) + .notNull() + }, + table => ({ + login_token_idx: index("core_admin_sessions_login_token_idx").on( + table.login_token + ), + user_id_idx: index("core_admin_sessions_user_id_idx").on(table.user_id) + }) +); + +export const core_admin_sessions_relations = relations( + core_admin_sessions, + ({ one }) => ({ + user: one(core_users, { + fields: [core_admin_sessions.user_id], + references: [core_users.id] + }), + device: one(core_sessions_known_devices, { + fields: [core_admin_sessions.device_id], + references: [core_sessions_known_devices.id] + }) + }) +); diff --git a/packages/backend/templates/core/admin/database/schema/files.ts b/packages/backend/templates/core/admin/database/schema/files.ts new file mode 100644 index 000000000..489851e0e --- /dev/null +++ b/packages/backend/templates/core/admin/database/schema/files.ts @@ -0,0 +1,82 @@ +import { + bigint, + index, + integer, + pgTable, + serial, + text, + timestamp, + varchar +} from "drizzle-orm/pg-core"; +import { relations } from "drizzle-orm"; + +import { core_users } from "./users"; + +export const core_files = pgTable( + "core_files", + { + id: serial("id").primaryKey(), + extension: varchar("extension", { length: 32 }).notNull(), + file_alt: varchar("file_alt", { length: 255 }), + file_name: varchar("file_name", { length: 255 }).notNull(), + file_name_original: varchar("file_name_original", { + length: 255 + }).notNull(), + dir_folder: varchar("dir_folder", { length: 255 }).notNull(), + user_id: integer("user_id") + .notNull() + .references(() => core_users.id, { + onDelete: "cascade" + }), + created: timestamp("created").notNull().defaultNow(), + file_size: integer("file_size").notNull(), + mimetype: varchar("mimetype", { length: 255 }).notNull(), + width: integer("width"), + height: integer("height"), + security_key: varchar("security_key", { length: 255 }) + }, + table => ({ + user_id_idx: index("core_files_user_id_idx").on(table.user_id) + }) +); + +export const core_files_relations = relations(core_files, ({ many, one }) => ({ + user: one(core_users, { + fields: [core_files.user_id], + references: [core_users.id] + }), + using: many(core_files_using) +})); + +export const core_files_using = pgTable( + "core_files_using", + { + id: serial("id").primaryKey(), + file_id: integer("file_id") + .notNull() + .references(() => core_files.id), + plugin: varchar("plugin", { length: 255 }).notNull(), + folder: varchar("folder", { length: 255 }).notNull() + }, + table => ({ + file_id_idx: index("core_files_using_file_id_idx").on(table.file_id) + }) +); + +export const core_files_using_relations = relations( + core_files_using, + ({ one }) => ({ + file: one(core_files, { + fields: [core_files_using.file_id], + references: [core_files.id] + }) + }) +); + +export const core_migrations = pgTable("core_migrations", { + id: serial("id").primaryKey(), + hash: text("hash").notNull(), + plugin: varchar("plugin", { length: 255 }).notNull(), + created_migration: bigint("created_migration", { mode: "bigint" }), + created: timestamp("created").notNull().defaultNow() +}); diff --git a/packages/backend/templates/core/admin/database/schema/groups.ts b/packages/backend/templates/core/admin/database/schema/groups.ts new file mode 100644 index 000000000..d8a95a9f7 --- /dev/null +++ b/packages/backend/templates/core/admin/database/schema/groups.ts @@ -0,0 +1,67 @@ +import { relations } from "drizzle-orm"; +import { + boolean, + index, + integer, + pgTable, + serial, + timestamp, + varchar +} from "drizzle-orm/pg-core"; + +import { core_languages } from "./languages"; + +export const core_groups = pgTable("core_groups", { + id: serial("id").primaryKey(), + created: timestamp("created").notNull().defaultNow(), + updated: timestamp("updated").notNull().defaultNow(), + protected: boolean("protected").notNull().default(false), + default: boolean("default").notNull().default(false), + root: boolean("root").notNull().default(false), + guest: boolean("guest").notNull().default(false), + files_allow_upload: boolean("files_allow_upload").notNull().default(true), + files_total_max_storage: integer("files_total_max_storage") + .notNull() + .default(500000), + files_max_storage_for_submit: integer("files_max_storage_for_submit") + .notNull() + .default(10000) +}); + +export const core_groups_relations = relations(core_groups, ({ many }) => ({ + name: many(core_groups_names) +})); + +export const core_groups_names = pgTable( + "core_groups_names", + { + id: serial("id").primaryKey(), + item_id: integer("item_id") + .notNull() + .references(() => core_groups.id, { + onDelete: "cascade" + }), + language_code: varchar("language_code") + .notNull() + .references(() => core_languages.code, { + onDelete: "cascade" + }), + value: varchar("value", { length: 255 }).notNull() + }, + table => ({ + item_id_idx: index("core_groups_names_item_id_idx").on(table.item_id), + language_code_idx: index("core_groups_names_language_code_idx").on( + table.language_code + ) + }) +); + +export const core_groups_names_relations = relations( + core_groups_names, + ({ one }) => ({ + group: one(core_groups, { + fields: [core_groups_names.item_id], + references: [core_groups.id] + }) + }) +); diff --git a/packages/backend/templates/core/admin/database/schema/languages.ts b/packages/backend/templates/core/admin/database/schema/languages.ts new file mode 100644 index 000000000..6b1919d0c --- /dev/null +++ b/packages/backend/templates/core/admin/database/schema/languages.ts @@ -0,0 +1,33 @@ +import { + boolean, + index, + pgTable, + serial, + timestamp, + varchar +} from "drizzle-orm/pg-core"; + +export const core_languages = pgTable( + "core_languages", + { + id: serial("id").primaryKey(), + code: varchar("code", { length: 32 }).notNull().unique(), + name: varchar("name", { length: 255 }).notNull(), + timezone: varchar("timezone", { length: 255 }).notNull().default("UTC"), + protected: boolean("protected").notNull().default(false), + default: boolean("default").notNull().default(false), + enabled: boolean("enabled").notNull().default(true), + created: timestamp("created").notNull().defaultNow(), + updated: timestamp("updated").notNull().defaultNow(), + time_24: boolean("time_24").notNull().default(false), + locale: varchar("locale", { length: 50 }).notNull().default("enUS"), + allow_in_input: boolean("allow_in_input").default(true), + site_copyright: varchar("site_copyright", { + length: 255 + }).default("") + }, + table => ({ + code_idx: index("core_languages_code_idx").on(table.code), + name_idx: index("core_languages_name_idx").on(table.name) + }) +); diff --git a/packages/backend/templates/core/admin/database/schema/moderators.ts b/packages/backend/templates/core/admin/database/schema/moderators.ts new file mode 100644 index 000000000..cae6f5187 --- /dev/null +++ b/packages/backend/templates/core/admin/database/schema/moderators.ts @@ -0,0 +1,51 @@ +import { + boolean, + index, + integer, + pgTable, + serial, + timestamp +} from "drizzle-orm/pg-core"; +import { relations } from "drizzle-orm"; + +import { core_groups } from "./groups"; +import { core_users } from "./users"; + +export const core_moderators_permissions = pgTable( + "core_moderators_permissions", + { + id: serial("id").primaryKey(), + group_id: integer("group_id").references(() => core_groups.id, { + onDelete: "cascade" + }), + user_id: integer("user_id").references(() => core_users.id, { + onDelete: "cascade" + }), + unrestricted: boolean("unrestricted").notNull().default(false), + created: timestamp("created").notNull().defaultNow(), + updated: timestamp("updated").notNull().defaultNow(), + protected: boolean("protected").notNull().default(false) + }, + table => ({ + group_id_idx: index("core_moderators_permissions_group_id_idx").on( + table.group_id + ), + user_id_idx: index("core_moderators_permissions_user_id_idx").on( + table.user_id + ) + }) +); + +export const core_moderators_permissions_relations = relations( + core_moderators_permissions, + ({ one }) => ({ + group: one(core_groups, { + fields: [core_moderators_permissions.group_id], + references: [core_groups.id] + }), + user: one(core_users, { + fields: [core_moderators_permissions.user_id], + references: [core_users.id] + }) + }) +); diff --git a/packages/backend/templates/core/admin/database/schema/nav.ts b/packages/backend/templates/core/admin/database/schema/nav.ts new file mode 100644 index 000000000..54aad0e6d --- /dev/null +++ b/packages/backend/templates/core/admin/database/schema/nav.ts @@ -0,0 +1,109 @@ +import { relations } from "drizzle-orm"; +import { + boolean, + index, + integer, + pgTable, + serial, + varchar +} from "drizzle-orm/pg-core"; + +import { core_languages } from "./languages"; + +export const core_nav = pgTable( + "core_nav", + { + id: serial("id").primaryKey(), + href: varchar("href", { length: 255 }).notNull(), + external: boolean("external").notNull().default(false), + position: integer("position").notNull().default(0), + // ! Warning: this is a recursive relation. It's not supported by drizzle-orm yet. + parent_id: integer("parent_id").notNull().default(0), + icon: varchar("icon", { length: 50 }) + }, + table => ({ + parent_id_idx: index("core_nav_parent_id_idx").on(table.parent_id) + }) +); + +export const core_nav_relations = relations(core_nav, ({ many, one }) => ({ + name: many(core_nav_name), + description: many(core_nav_description), + parent: one(core_nav, { + fields: [core_nav.parent_id], + references: [core_nav.id] + }) +})); + +export const core_nav_name = pgTable( + "core_nav_name", + { + id: serial("id").primaryKey(), + item_id: serial("item_id") + .notNull() + .references(() => core_nav.id, { + onDelete: "cascade" + }), + language_code: varchar("language_code") + .notNull() + .references(() => core_languages.code, { + onDelete: "cascade" + }), + value: varchar("value", { length: 100 }).notNull() + }, + table => ({ + item_id_idx: index("core_nav_name_item_id_idx").on(table.item_id), + language_code_idx: index("core_nav_name_language_code_idx").on( + table.language_code + ) + }) +); + +export const core_nav_name_relations = relations(core_nav_name, ({ one }) => ({ + nav: one(core_nav, { + fields: [core_nav_name.item_id], + references: [core_nav.id] + }), + language: one(core_languages, { + fields: [core_nav_name.language_code], + references: [core_languages.code] + }) +})); + +export const core_nav_description = pgTable( + "core_nav_description", + { + id: serial("id").primaryKey(), + item_id: serial("item_id") + .notNull() + .references(() => core_nav.id, { + onDelete: "cascade" + }), + language_code: varchar("language_code") + .notNull() + .references(() => core_languages.code, { + onDelete: "cascade" + }), + value: varchar("value", { length: 200 }).notNull() + }, + table => ({ + item_id_idx: index("core_nav_description_item_id_idx").on(table.item_id), + language_code_idx: index("core_nav_description_language_code_idx").on( + table.language_code + ) + }) +); + +export const core_nav_description_relations = relations( + core_nav_description, + ({ one }) => ({ + nav: one(core_nav, { + fields: [core_nav_description.item_id], + references: [core_nav.id] + }), + language: one(core_languages, { + fields: [core_nav_description.language_code], + references: [core_languages.code] + }) + }) +); diff --git a/packages/backend/templates/core/admin/database/schema/plugins.ts b/packages/backend/templates/core/admin/database/schema/plugins.ts new file mode 100644 index 000000000..b9597140c --- /dev/null +++ b/packages/backend/templates/core/admin/database/schema/plugins.ts @@ -0,0 +1,33 @@ +import { + boolean, + index, + integer, + pgTable, + serial, + timestamp, + varchar +} from "drizzle-orm/pg-core"; + +export const core_plugins = pgTable( + "core_plugins", + { + id: serial("id").primaryKey(), + code: varchar("code", { length: 50 }).notNull(), + name: varchar("name", { length: 50 }).notNull(), + description: varchar("description", { length: 255 }), + version: varchar("version", { length: 255 }), + version_code: integer("version_code"), + enabled: boolean("enabled").notNull().default(true), + created: timestamp("created").notNull().defaultNow(), + updated: timestamp("updated").notNull().defaultNow(), + support_url: varchar("support_url", { length: 255 }).notNull(), + author: varchar("author", { length: 100 }).notNull(), + author_url: varchar("author_url", { length: 255 }), + default: boolean("default").notNull().default(false), + allow_default: boolean("allow_default").notNull().default(true) + }, + table => ({ + code_idx: index("core_plugins_code_idx").on(table.code), + name_idx: index("core_plugins_name_idx").on(table.name) + }) +); diff --git a/packages/backend/templates/core/admin/database/schema/sessions.ts b/packages/backend/templates/core/admin/database/schema/sessions.ts new file mode 100644 index 000000000..f054850cb --- /dev/null +++ b/packages/backend/templates/core/admin/database/schema/sessions.ts @@ -0,0 +1,78 @@ +import { + index, + integer, + pgTable, + serial, + text, + timestamp, + varchar +} from "drizzle-orm/pg-core"; +import { relations } from "drizzle-orm"; + +import { core_users } from "./users"; +import { core_admin_sessions } from "./admins"; + +export const core_sessions = pgTable( + "core_sessions", + { + login_token: varchar("login_token", { length: 255 }).primaryKey(), + user_id: integer("user_id") + .notNull() + .references(() => core_users.id, { + onDelete: "cascade" + }), + created: timestamp("created").notNull().defaultNow(), + expires: timestamp("expires").notNull(), + device_id: integer("device_id") + .references(() => core_sessions_known_devices.id, { + onDelete: "cascade" + }) + .notNull() + }, + table => ({ + user_id_idx: index("core_sessions_user_id_idx").on(table.user_id) + }) +); + +export const core_sessions_relations = relations(core_sessions, ({ one }) => ({ + user: one(core_users, { + fields: [core_sessions.user_id], + references: [core_users.id] + }), + device: one(core_sessions_known_devices, { + fields: [core_sessions.device_id], + references: [core_sessions_known_devices.id] + }) +})); + +export const core_sessions_known_devices = pgTable( + "core_sessions_known_devices", + { + id: serial("id").primaryKey(), + ip_address: varchar("ip_address", { length: 255 }).notNull(), + user_agent: text("user_agent").notNull(), + uagent_browser: varchar("uagent_browser", { length: 200 }).notNull(), + uagent_version: varchar("uagent_version", { length: 100 }).notNull(), + uagent_os: varchar("uagent_os", { length: 100 }).notNull(), + last_seen: timestamp("last_seen").notNull().defaultNow() + }, + table => ({ + ip_address_idx: index("core_sessions_known_devices_ip_address_idx").on( + table.ip_address + ) + }) +); + +export const core_sessions_known_devices_relations = relations( + core_sessions_known_devices, + ({ one }) => ({ + session: one(core_sessions, { + fields: [core_sessions_known_devices.id], + references: [core_sessions.device_id] + }), + admin_session: one(core_admin_sessions, { + fields: [core_sessions_known_devices.id], + references: [core_admin_sessions.device_id] + }) + }) +); diff --git a/packages/backend/templates/core/admin/database/schema/users.ts b/packages/backend/templates/core/admin/database/schema/users.ts new file mode 100644 index 000000000..d3ed418cd --- /dev/null +++ b/packages/backend/templates/core/admin/database/schema/users.ts @@ -0,0 +1,73 @@ +import { relations } from "drizzle-orm"; +import { + boolean, + index, + integer, + pgTable, + serial, + text, + timestamp, + varchar +} from "drizzle-orm/pg-core"; + +import { core_groups } from "./groups"; + +export const core_users = pgTable( + "core_users", + { + id: serial("id").primaryKey(), + name_seo: varchar("name_seo", { length: 255 }).unique(), + name: varchar("name", { length: 255 }).notNull().unique(), + email: varchar("email", { length: 255 }).notNull().unique(), + password: text("password").notNull(), + joined: timestamp("joined").notNull().defaultNow(), + posts: integer("posts").notNull().default(0), + newsletter: boolean("newsletter").notNull().default(false), + avatar_color: varchar("avatar_color", { length: 6 }).notNull(), + group_id: integer("group_id").references(() => core_groups.id), + first_name: varchar("first_name", { length: 255 }), + last_name: varchar("last_name", { length: 255 }), + birthday: timestamp("birthday"), + ip_address: varchar("ip_address", { length: 255 }).notNull(), + language: varchar("language", { length: 5 }).notNull().default("en") + }, + table => ({ + name_seo_idx: index("core_users_name_seo_idx").on(table.name_seo), + name_idx: index("core_users_name_idx").on(table.name), + email_idx: index("core_users_email_idx").on(table.email) + }) +); + +export const core_users_relations = relations(core_users, ({ one }) => ({ + group: one(core_groups, { + fields: [core_users.group_id], + references: [core_groups.id] + }), + avatar: one(core_files_avatars, { + fields: [core_users.id], + references: [core_files_avatars.user_id] + }) +})); + +export const core_files_avatars = pgTable("core_files_avatars", { + id: serial("id").primaryKey(), + dir_folder: varchar("dir_folder", { length: 255 }).notNull(), + file_name: varchar("file_name", { length: 255 }).notNull(), + created: timestamp("created").notNull().defaultNow(), + file_size: integer("file_size").notNull(), + mimetype: varchar("mimetype", { length: 255 }).notNull(), + extension: varchar("extension", { length: 32 }).notNull(), + user_id: integer("user_id").references(() => core_users.id, { + onDelete: "cascade" + }) +}); + +export const core_files_avatars_relations = relations( + core_files_avatars, + ({ one }) => ({ + user: one(core_users, { + fields: [core_files_avatars.user_id], + references: [core_users.id] + }) + }) +); From 9e3f1b97f71cd5cd60067c9b891668ff13388011 Mon Sep 17 00:00:00 2001 From: aXenDeveloper Date: Thu, 20 Jun 2024 23:14:21 +0200 Subject: [PATCH 06/27] fix(backend): Fix install packages when vitnode-backend packages has scripts --- packages/backend/package.json | 2 +- .../{src/scripts/init.ts => scripts/init.mjs} | 23 ++++++++++++------- packages/backend/src/index.ts | 1 - packages/backend/src/scripts/index.ts | 1 - packages/backend/tsconfig.json | 2 +- 5 files changed, 17 insertions(+), 12 deletions(-) rename packages/backend/{src/scripts/init.ts => scripts/init.mjs} (59%) mode change 100644 => 100755 delete mode 100644 packages/backend/src/scripts/index.ts diff --git a/packages/backend/package.json b/packages/backend/package.json index 70746f9ef..529cc7b53 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -6,7 +6,7 @@ "url": "https://github.com/aXenDeveloper/vitnode/" }, "bin": { - "vitnode-backend": "./dist/scripts/init.js" + "vitnode-backend": "./scripts/init.mjs" }, "scripts": { "build": "tsc", diff --git a/packages/backend/src/scripts/init.ts b/packages/backend/scripts/init.mjs old mode 100644 new mode 100755 similarity index 59% rename from packages/backend/src/scripts/init.ts rename to packages/backend/scripts/init.mjs index fe2169832..a3d13180b --- a/packages/backend/src/scripts/init.ts +++ b/packages/backend/scripts/init.mjs @@ -1,15 +1,22 @@ #!/usr/bin/env node +// @ts-check +/* eslint-disable no-console */ -import { join } from "path"; +import * as path from "path"; import * as fs from "fs"; +import { fileURLToPath } from "url"; -/* eslint-disable no-console */ +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); -const copyDatabaseSchema = ({ corePluginPath }: { corePluginPath: string }) => { - const currentPathToSchema = join( +/** + * + * @param {string} corePluginPath + */ +const copyDatabaseSchema = corePluginPath => { + const currentPathToSchema = path.join( __dirname, "..", - "..", "templates", "core", "admin", @@ -21,12 +28,12 @@ const copyDatabaseSchema = ({ corePluginPath }: { corePluginPath: string }) => { ); } - const userPathToSchema = join(corePluginPath, "admin", "database"); + const userPathToSchema = path.join(corePluginPath, "admin", "database"); fs.cpSync(currentPathToSchema, userPathToSchema, { recursive: true }); }; export const init = () => { - const corePluginPath = join(process.cwd(), "src", "plugins", "core"); + const corePluginPath = path.join(process.cwd(), "src", "plugins", "core"); if (!fs.existsSync(corePluginPath)) { console.error("Plugin 'core' not found in 'src/plugins' directory."); @@ -34,7 +41,7 @@ export const init = () => { } // Copy the schema from the template to the core plugin - copyDatabaseSchema({ corePluginPath }); + copyDatabaseSchema(corePluginPath); console.log("Hello, world!", process.cwd()); }; diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts index dca0dfadb..4b4acf751 100644 --- a/packages/backend/src/index.ts +++ b/packages/backend/src/index.ts @@ -6,4 +6,3 @@ export * from "./decorators"; export * from "./main"; export * from "./app.module"; export * from "./database"; -export * from "./scripts"; diff --git a/packages/backend/src/scripts/index.ts b/packages/backend/src/scripts/index.ts deleted file mode 100644 index fccf97681..000000000 --- a/packages/backend/src/scripts/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./init"; diff --git a/packages/backend/tsconfig.json b/packages/backend/tsconfig.json index ccf0ad3f9..3de750532 100644 --- a/packages/backend/tsconfig.json +++ b/packages/backend/tsconfig.json @@ -12,5 +12,5 @@ "@/*": ["./src/*"] } }, - "include": ["src/**/*"] + "include": ["src/**/*", "scripts"] } From 4746d0e5bdaba36f35e6da65676af67f550a2019 Mon Sep 17 00:00:00 2001 From: aXenDeveloper Date: Fri, 21 Jun 2024 09:27:52 +0200 Subject: [PATCH 07/27] fix(backend): Build vitnode-backend package --- packages/backend/scripts/init.mjs | 3 ++- packages/backend/src/database/database.service.ts | 2 +- .../backend/{ => src}/templates/core/admin/database/index.ts | 0 .../{ => src}/templates/core/admin/database/schema/admins.ts | 0 .../{ => src}/templates/core/admin/database/schema/files.ts | 0 .../{ => src}/templates/core/admin/database/schema/groups.ts | 0 .../templates/core/admin/database/schema/languages.ts | 0 .../templates/core/admin/database/schema/moderators.ts | 0 .../{ => src}/templates/core/admin/database/schema/nav.ts | 0 .../{ => src}/templates/core/admin/database/schema/plugins.ts | 0 .../{ => src}/templates/core/admin/database/schema/sessions.ts | 0 .../{ => src}/templates/core/admin/database/schema/users.ts | 0 packages/backend/tsconfig.json | 2 +- 13 files changed, 4 insertions(+), 3 deletions(-) rename packages/backend/{ => src}/templates/core/admin/database/index.ts (100%) rename packages/backend/{ => src}/templates/core/admin/database/schema/admins.ts (100%) rename packages/backend/{ => src}/templates/core/admin/database/schema/files.ts (100%) rename packages/backend/{ => src}/templates/core/admin/database/schema/groups.ts (100%) rename packages/backend/{ => src}/templates/core/admin/database/schema/languages.ts (100%) rename packages/backend/{ => src}/templates/core/admin/database/schema/moderators.ts (100%) rename packages/backend/{ => src}/templates/core/admin/database/schema/nav.ts (100%) rename packages/backend/{ => src}/templates/core/admin/database/schema/plugins.ts (100%) rename packages/backend/{ => src}/templates/core/admin/database/schema/sessions.ts (100%) rename packages/backend/{ => src}/templates/core/admin/database/schema/users.ts (100%) diff --git a/packages/backend/scripts/init.mjs b/packages/backend/scripts/init.mjs index a3d13180b..a6f0ea783 100755 --- a/packages/backend/scripts/init.mjs +++ b/packages/backend/scripts/init.mjs @@ -17,6 +17,7 @@ const copyDatabaseSchema = corePluginPath => { const currentPathToSchema = path.join( __dirname, "..", + "src", "templates", "core", "admin", @@ -24,7 +25,7 @@ const copyDatabaseSchema = corePluginPath => { ); if (!fs.existsSync(currentPathToSchema)) { throw new Error( - "Database schema not found in 'templates/core/admin/database' directory." + `Database schema not found in 'templates/core/admin/database' directory. "${currentPathToSchema}"` ); } diff --git a/packages/backend/src/database/database.service.ts b/packages/backend/src/database/database.service.ts index 21292cfec..8af9cbfc2 100644 --- a/packages/backend/src/database/database.service.ts +++ b/packages/backend/src/database/database.service.ts @@ -4,7 +4,7 @@ import { NodePgDatabase } from "drizzle-orm/node-postgres"; import { DatabaseModuleArgs } from "./database.module"; import { createClientDatabase } from "./client"; -import coreSchemaDatabase from "@/../templates/core/admin/database"; +import coreSchemaDatabase from "@/templates/core/admin/database"; @Injectable() export class DatabaseService { diff --git a/packages/backend/templates/core/admin/database/index.ts b/packages/backend/src/templates/core/admin/database/index.ts similarity index 100% rename from packages/backend/templates/core/admin/database/index.ts rename to packages/backend/src/templates/core/admin/database/index.ts diff --git a/packages/backend/templates/core/admin/database/schema/admins.ts b/packages/backend/src/templates/core/admin/database/schema/admins.ts similarity index 100% rename from packages/backend/templates/core/admin/database/schema/admins.ts rename to packages/backend/src/templates/core/admin/database/schema/admins.ts diff --git a/packages/backend/templates/core/admin/database/schema/files.ts b/packages/backend/src/templates/core/admin/database/schema/files.ts similarity index 100% rename from packages/backend/templates/core/admin/database/schema/files.ts rename to packages/backend/src/templates/core/admin/database/schema/files.ts diff --git a/packages/backend/templates/core/admin/database/schema/groups.ts b/packages/backend/src/templates/core/admin/database/schema/groups.ts similarity index 100% rename from packages/backend/templates/core/admin/database/schema/groups.ts rename to packages/backend/src/templates/core/admin/database/schema/groups.ts diff --git a/packages/backend/templates/core/admin/database/schema/languages.ts b/packages/backend/src/templates/core/admin/database/schema/languages.ts similarity index 100% rename from packages/backend/templates/core/admin/database/schema/languages.ts rename to packages/backend/src/templates/core/admin/database/schema/languages.ts diff --git a/packages/backend/templates/core/admin/database/schema/moderators.ts b/packages/backend/src/templates/core/admin/database/schema/moderators.ts similarity index 100% rename from packages/backend/templates/core/admin/database/schema/moderators.ts rename to packages/backend/src/templates/core/admin/database/schema/moderators.ts diff --git a/packages/backend/templates/core/admin/database/schema/nav.ts b/packages/backend/src/templates/core/admin/database/schema/nav.ts similarity index 100% rename from packages/backend/templates/core/admin/database/schema/nav.ts rename to packages/backend/src/templates/core/admin/database/schema/nav.ts diff --git a/packages/backend/templates/core/admin/database/schema/plugins.ts b/packages/backend/src/templates/core/admin/database/schema/plugins.ts similarity index 100% rename from packages/backend/templates/core/admin/database/schema/plugins.ts rename to packages/backend/src/templates/core/admin/database/schema/plugins.ts diff --git a/packages/backend/templates/core/admin/database/schema/sessions.ts b/packages/backend/src/templates/core/admin/database/schema/sessions.ts similarity index 100% rename from packages/backend/templates/core/admin/database/schema/sessions.ts rename to packages/backend/src/templates/core/admin/database/schema/sessions.ts diff --git a/packages/backend/templates/core/admin/database/schema/users.ts b/packages/backend/src/templates/core/admin/database/schema/users.ts similarity index 100% rename from packages/backend/templates/core/admin/database/schema/users.ts rename to packages/backend/src/templates/core/admin/database/schema/users.ts diff --git a/packages/backend/tsconfig.json b/packages/backend/tsconfig.json index 3de750532..ccf0ad3f9 100644 --- a/packages/backend/tsconfig.json +++ b/packages/backend/tsconfig.json @@ -12,5 +12,5 @@ "@/*": ["./src/*"] } }, - "include": ["src/**/*", "scripts"] + "include": ["src/**/*"] } From acfa95afc78ddd4bcacf59e200580fc275e079e7 Mon Sep 17 00:00:00 2001 From: aXenDeveloper Date: Fri, 21 Jun 2024 09:42:15 +0200 Subject: [PATCH 08/27] chore: Update packages --- .github/workflows/build.yml | 9 +- apps/backend/package.json | 10 +- apps/frontend/components/ui/alert-dialog.tsx | 2 +- apps/frontend/package.json | 63 +- package.json | 2 +- packages/backend/package.json | 6 +- packages/eslint-config-vitnode/package.json | 4 +- packages/frontend/package.json | 6 +- packages/shared/package.json | 2 +- pnpm-lock.yaml | 2108 +++++++++++------- 10 files changed, 1372 insertions(+), 840 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4f302b15d..d3b52e8c9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,14 +14,17 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + fetch-depth: 2 - name: Install Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 20 + cache: "pnpm" - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v4 name: Install pnpm with: version: 9 diff --git a/apps/backend/package.json b/apps/backend/package.json index 80d702466..7570951a9 100644 --- a/apps/backend/package.json +++ b/apps/backend/package.json @@ -36,12 +36,12 @@ "bcrypt": "^5.1.1", "express": "^4.19.2", "graphql": "^16.8.2", - "nodemailer": "^6.9.13", + "nodemailer": "^6.9.14", "react": "^18.3.1", "reflect-metadata": "^0.2.2", "rxjs": "^7.8.1", "sharp": "^0.33.4", - "tar": "^7.2.0" + "tar": "^7.4.0" }, "devDependencies": { "@graphql-codegen/cli": "^5.0.2", @@ -51,10 +51,10 @@ "@nestjs/cli": "^10.3.2", "@nestjs/schematics": "^10.1.1", "@swc/cli": "^0.3.12", - "@swc/core": "^1.6.1", + "@swc/core": "^1.6.3", "@types/bcrypt": "^5.0.2", "@types/express": "^4.17.21", - "@types/node": "^20.14.2", + "@types/node": "^20.14.7", "@types/nodemailer": "^6.4.15", "@types/pg": "^8.11.6", "@types/react": "^18.3.3", @@ -71,7 +71,7 @@ "react-email": "^2.1.4", "ts-node": "^10.9.2", "tsconfig-paths": "^4.2.0", - "typescript": "^5.4.5", + "typescript": "^5.5.2", "vitnode-backend": "workspace:*" } } diff --git a/apps/frontend/components/ui/alert-dialog.tsx b/apps/frontend/components/ui/alert-dialog.tsx index 43f00699b..f2b7c975c 100644 --- a/apps/frontend/components/ui/alert-dialog.tsx +++ b/apps/frontend/components/ui/alert-dialog.tsx @@ -23,7 +23,7 @@ const AlertDialog = ({ onOpenChange, open: openProp, ...props -}: AlertDialogPrimitive.DialogProps) => { +}: AlertDialogPrimitive.AlertDialogProps) => { const [open, setOpen] = React.useState(false); return ( diff --git a/apps/frontend/package.json b/apps/frontend/package.json index b7601b6df..6b6df6d6f 100644 --- a/apps/frontend/package.json +++ b/apps/frontend/package.json @@ -1,5 +1,6 @@ { "name": "frontend", + "version": "0.0.3", "author": "Maciej Piotr (aXenDev) Balcerzak", "license": "GPL-3.0 license", "scripts": { @@ -17,23 +18,23 @@ "docker:run": "docker run -p 3000:3000 vitnode_frontend" }, "dependencies": { - "@radix-ui/react-accordion": "^1.1.2", - "@radix-ui/react-alert-dialog": "^1.0.5", - "@radix-ui/react-checkbox": "^1.0.4", - "@radix-ui/react-dialog": "^1.0.5", - "@radix-ui/react-hover-card": "^1.0.7", - "@radix-ui/react-label": "^2.0.2", - "@radix-ui/react-navigation-menu": "^1.1.4", - "@radix-ui/react-progress": "^1.0.3", - "@radix-ui/react-radio-group": "^1.1.3", - "@radix-ui/react-select": "^2.0.0", - "@radix-ui/react-separator": "^1.0.3", - "@radix-ui/react-slot": "^1.0.2", - "@radix-ui/react-switch": "^1.0.3", - "@radix-ui/react-tabs": "^1.0.4", - "@radix-ui/react-toggle": "^1.0.3", - "@radix-ui/react-toggle-group": "^1.0.4", - "@radix-ui/react-tooltip": "^1.0.7", + "@radix-ui/react-accordion": "^1.2.0", + "@radix-ui/react-alert-dialog": "^1.1.0", + "@radix-ui/react-checkbox": "^1.1.0", + "@radix-ui/react-dialog": "^1.1.0", + "@radix-ui/react-hover-card": "^1.1.0", + "@radix-ui/react-label": "^2.1.0", + "@radix-ui/react-navigation-menu": "^1.2.0", + "@radix-ui/react-progress": "^1.1.0", + "@radix-ui/react-radio-group": "^1.2.0", + "@radix-ui/react-select": "^2.1.0", + "@radix-ui/react-separator": "^1.1.0", + "@radix-ui/react-slot": "^1.1.0", + "@radix-ui/react-switch": "^1.1.0", + "@radix-ui/react-tabs": "^1.1.0", + "@radix-ui/react-toggle": "^1.1.0", + "@radix-ui/react-toggle-group": "^1.1.0", + "@radix-ui/react-tooltip": "^1.1.0", "@tiptap/extension-code-block-lowlight": "^2.4.0", "@tiptap/extension-color": "^2.4.0", "@tiptap/extension-heading": "^2.4.0", @@ -54,15 +55,15 @@ "date-fns": "^3.6.0", "embla-carousel-react": "^8.1.5", "emoji-mart": "^5.6.0", - "framer-motion": "^11.2.10", + "framer-motion": "^11.2.11", "graphql": "^16.8.2", "graphql-tag": "^2.12.6", "html-react-parser": "^5.1.10", "lodash": "^4.17.21", "lowlight": "^3.1.0", "lucide-react": "^0.395.0", - "next": "15.0.0-canary.35", - "next-intl": "^3.15.0", + "next": "^15.0.0-canary.39", + "next-intl": "^3.15.2", "next-themes": "^0.3.0", "nextjs-toploader": "^1.6.12", "react": "19.0.0-rc.0", @@ -81,26 +82,26 @@ "tippy.js": "^6.3.7", "use-debounce": "^10.0.1", "vaul": "^0.9.1", - "zod": "^3.23.8" - }, - "devDependencies": { + "zod": "^3.23.8", + "@radix-ui/react-dropdown-menu": "^2.1.0", + "@radix-ui/react-icons": "^1.3.0", + "@radix-ui/react-popover": "^1.1.0", + "@radix-ui/react-toolbar": "^1.1.0", "@dnd-kit/core": "^6.1.0", "@dnd-kit/sortable": "^8.0.0", "@dnd-kit/utilities": "^3.2.2", - "@emoji-mart/data": "^1.2.1", + "@emoji-mart/data": "^1.2.1" + }, + "devDependencies": { "@hookform/devtools": "^4.3.1", "@hookform/resolvers": "^3.6.0", - "@next/bundle-analyzer": "15.0.0-canary.35", - "@radix-ui/react-dropdown-menu": "^2.0.6", - "@radix-ui/react-icons": "^1.3.0", - "@radix-ui/react-popover": "^1.0.7", - "@radix-ui/react-toolbar": "^1.0.4", + "@next/bundle-analyzer": "^15.0.0-canary.39", "@tailwindcss/container-queries": "^0.1.1", "@tanstack/eslint-plugin-query": "^5.43.1", "@tanstack/react-query": "^5.45.1", "@tanstack/react-table": "^8.17.3", "@types/lodash": "^4.17.5", - "@types/node": "^20.14.2", + "@types/node": "^20.14.7", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", "@vitnode/frontend": "workspace:*", @@ -115,6 +116,6 @@ "tailwind-merge": "^2.3.0", "tailwindcss": "^3.4.4", "ts-node": "^10.9.2", - "typescript": "^5.4.5" + "typescript": "^5.5.2" } } diff --git a/package.json b/package.json index 74474f519..d9dfdf125 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vitnode", - "version": "0.0.1", + "version": "0.0.3", "version_code": "10000", "description": "VitNode app", "author": "Maciej Piotr (aXenDev) Balcerzak", diff --git a/packages/backend/package.json b/packages/backend/package.json index 529cc7b53..44816ae4b 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -1,6 +1,6 @@ { "name": "vitnode-backend", - "version": "0.0.1", + "version": "0.0.3", "homepage": "https://vitnode.com/", "repository": { "url": "https://github.com/aXenDeveloper/vitnode/" @@ -29,14 +29,14 @@ "@types/cookie-parser": "^1.4.7", "@types/express": "^4.17.21", "@types/http-errors": "^2.0.4", - "@types/node": "^20.14.2", + "@types/node": "^20.14.7", "@types/object-path": "^0.11.4", "@types/pg": "^8.11.6", "busboy": "^1.6.0", "eslint-config-vitnode": "workspace:*", "http-errors": "^2.0.0", "object-path": "^0.11.8", - "typescript": "^5.4.5" + "typescript": "^5.5.2" }, "dependencies": { "class-validator": "^0.14.1", diff --git a/packages/eslint-config-vitnode/package.json b/packages/eslint-config-vitnode/package.json index d53bd50d6..251fe242d 100644 --- a/packages/eslint-config-vitnode/package.json +++ b/packages/eslint-config-vitnode/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-vitnode", - "version": "1.0.0", + "version": "0.0.3", "description": "ESLint, TSConfig & Prettier config for VitNode", "type": "module", "keywords": [ @@ -27,6 +27,6 @@ "eslint-plugin-prettier": "^5.1.3", "eslint-plugin-sort-destructure-keys": "^2.0.0", "eslint-plugin-typescript-sort-keys": "^3.2.0", - "typescript": "^5.4.5" + "typescript": "^5.5.2" } } diff --git a/packages/frontend/package.json b/packages/frontend/package.json index 6c9477be5..bc61dc0ef 100644 --- a/packages/frontend/package.json +++ b/packages/frontend/package.json @@ -1,6 +1,6 @@ { "name": "@vitnode/frontend", - "version": "1.0.0", + "version": "0.0.3", "exports": { "./navigation": { "types": "./src/navigation/index.ts", @@ -24,11 +24,11 @@ "clsx": "^2.1.1", "eslint-config-vitnode": "workspace:*", "tailwind-merge": "^2.3.0", - "typescript": "^5.4.5" + "typescript": "^5.5.2" }, "dependencies": { "next": "15.0.0-canary.28", - "next-intl": "^3.15.0", + "next-intl": "^3.15.2", "nprogress": "^0.2.0", "react": "19.0.0-rc.0", "react-dom": "19.0.0-rc.0", diff --git a/packages/shared/package.json b/packages/shared/package.json index d230b37cd..1ffe973d8 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@vitnode/shared", - "version": "1.0.0", + "version": "0.0.3", "main": "./dist/index.js", "types": "./src/index.ts", "scripts": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c36989d7b..8bd635b57 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -69,8 +69,8 @@ importers: specifier: ^16.8.2 version: 16.8.2 nodemailer: - specifier: ^6.9.13 - version: 6.9.13 + specifier: ^6.9.14 + version: 6.9.14 react: specifier: ^18.3.1 version: 18.3.1 @@ -84,12 +84,12 @@ importers: specifier: ^0.33.4 version: 0.33.4 tar: - specifier: ^7.2.0 - version: 7.2.0 + specifier: ^7.4.0 + version: 7.4.0 devDependencies: '@graphql-codegen/cli': specifier: ^5.0.2 - version: 5.0.2(@types/node@20.14.2)(graphql@16.8.2)(typescript@5.4.5) + version: 5.0.2(@types/node@20.14.7)(graphql@16.8.2)(typescript@5.5.2) '@graphql-codegen/typescript': specifier: ^4.0.7 version: 4.0.7(graphql@16.8.2) @@ -101,16 +101,16 @@ importers: version: 4.2.1(graphql@16.8.2) '@nestjs/cli': specifier: ^10.3.2 - version: 10.3.2(@swc/cli@0.3.12(@swc/core@1.6.1(@swc/helpers@0.5.11))(chokidar@3.6.0))(@swc/core@1.6.1(@swc/helpers@0.5.11)) + version: 10.3.2(@swc/cli@0.3.12(@swc/core@1.6.3(@swc/helpers@0.5.11))(chokidar@3.6.0))(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12) '@nestjs/schematics': specifier: ^10.1.1 - version: 10.1.1(chokidar@3.6.0)(typescript@5.4.5) + version: 10.1.1(chokidar@3.6.0)(typescript@5.5.2) '@swc/cli': specifier: ^0.3.12 - version: 0.3.12(@swc/core@1.6.1(@swc/helpers@0.5.11))(chokidar@3.6.0) + version: 0.3.12(@swc/core@1.6.3(@swc/helpers@0.5.11))(chokidar@3.6.0) '@swc/core': - specifier: ^1.6.1 - version: 1.6.1(@swc/helpers@0.5.11) + specifier: ^1.6.3 + version: 1.6.3(@swc/helpers@0.5.11) '@types/bcrypt': specifier: ^5.0.2 version: 5.0.2 @@ -118,8 +118,8 @@ importers: specifier: ^4.17.21 version: 4.17.21 '@types/node': - specifier: ^20.14.2 - version: 20.14.2 + specifier: ^20.14.7 + version: 20.14.7 '@types/nodemailer': specifier: ^6.4.15 version: 6.4.15 @@ -161,73 +161,97 @@ importers: version: 8.12.0 react-email: specifier: ^2.1.4 - version: 2.1.4(@swc/helpers@0.5.11)(eslint@8.57.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.11))(@types/node@20.14.2)(typescript@5.4.5)) + version: 2.1.4(@swc/helpers@0.5.11)(eslint@8.57.0)(ts-node@10.9.2(@swc/core@1.6.3(@swc/helpers@0.5.11))(@types/node@20.14.7)(typescript@5.5.2)) ts-node: specifier: ^10.9.2 - version: 10.9.2(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5) + version: 10.9.2(@swc/core@1.6.3)(@types/node@20.14.7)(typescript@5.5.2) tsconfig-paths: specifier: ^4.2.0 version: 4.2.0 typescript: - specifier: ^5.4.5 - version: 5.4.5 + specifier: ^5.5.2 + version: 5.5.2 vitnode-backend: specifier: workspace:* version: link:../../packages/backend apps/frontend: dependencies: + '@dnd-kit/core': + specifier: ^6.1.0 + version: 6.1.0(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@dnd-kit/sortable': + specifier: ^8.0.0 + version: 8.0.0(@dnd-kit/core@6.1.0(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@dnd-kit/utilities': + specifier: ^3.2.2 + version: 3.2.2(react@19.0.0-rc.0) + '@emoji-mart/data': + specifier: ^1.2.1 + version: 1.2.1 '@radix-ui/react-accordion': - specifier: ^1.1.2 - version: 1.1.2(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + specifier: ^1.2.0 + version: 1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) '@radix-ui/react-alert-dialog': - specifier: ^1.0.5 - version: 1.0.5(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + specifier: ^1.1.0 + version: 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) '@radix-ui/react-checkbox': - specifier: ^1.0.4 - version: 1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + specifier: ^1.1.0 + version: 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) '@radix-ui/react-dialog': - specifier: ^1.0.5 - version: 1.0.5(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + specifier: ^1.1.0 + version: 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-dropdown-menu': + specifier: ^2.1.0 + version: 2.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) '@radix-ui/react-hover-card': - specifier: ^1.0.7 - version: 1.0.7(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + specifier: ^1.1.0 + version: 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-icons': + specifier: ^1.3.0 + version: 1.3.0(react@19.0.0-rc.0) '@radix-ui/react-label': - specifier: ^2.0.2 - version: 2.0.2(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + specifier: ^2.1.0 + version: 2.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) '@radix-ui/react-navigation-menu': - specifier: ^1.1.4 - version: 1.1.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + specifier: ^1.2.0 + version: 1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-popover': + specifier: ^1.1.0 + version: 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) '@radix-ui/react-progress': - specifier: ^1.0.3 - version: 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + specifier: ^1.1.0 + version: 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) '@radix-ui/react-radio-group': - specifier: ^1.1.3 - version: 1.1.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + specifier: ^1.2.0 + version: 1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) '@radix-ui/react-select': - specifier: ^2.0.0 - version: 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + specifier: ^2.1.0 + version: 2.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) '@radix-ui/react-separator': - specifier: ^1.0.3 - version: 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + specifier: ^1.1.0 + version: 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) '@radix-ui/react-slot': - specifier: ^1.0.2 - version: 1.0.2(@types/react@18.3.3)(react@19.0.0-rc.0) + specifier: ^1.1.0 + version: 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) '@radix-ui/react-switch': - specifier: ^1.0.3 - version: 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + specifier: ^1.1.0 + version: 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) '@radix-ui/react-tabs': - specifier: ^1.0.4 - version: 1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + specifier: ^1.1.0 + version: 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) '@radix-ui/react-toggle': - specifier: ^1.0.3 - version: 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + specifier: ^1.1.0 + version: 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) '@radix-ui/react-toggle-group': - specifier: ^1.0.4 - version: 1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + specifier: ^1.1.0 + version: 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-toolbar': + specifier: ^1.1.0 + version: 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) '@radix-ui/react-tooltip': - specifier: ^1.0.7 - version: 1.0.7(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + specifier: ^1.1.0 + version: 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) '@tiptap/extension-code-block-lowlight': specifier: ^2.4.0 version: 2.4.0(@tiptap/core@2.4.0(@tiptap/pm@2.4.0))(@tiptap/extension-code-block@2.4.0(@tiptap/core@2.4.0(@tiptap/pm@2.4.0))(@tiptap/pm@2.4.0))(@tiptap/pm@2.4.0) @@ -289,8 +313,8 @@ importers: specifier: ^5.6.0 version: 5.6.0 framer-motion: - specifier: ^11.2.10 - version: 11.2.10(@emotion/is-prop-valid@1.2.2)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + specifier: ^11.2.11 + version: 11.2.11(@emotion/is-prop-valid@1.2.2)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) graphql: specifier: ^16.8.2 version: 16.8.2 @@ -310,17 +334,17 @@ importers: specifier: ^0.395.0 version: 0.395.0(react@19.0.0-rc.0) next: - specifier: 15.0.0-canary.35 - version: 15.0.0-canary.35(babel-plugin-react-compiler@0.0.0-experimental-938cd9a-20240601)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + specifier: ^15.0.0-canary.39 + version: 15.0.0-rc.0(babel-plugin-react-compiler@0.0.0-experimental-938cd9a-20240601)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) next-intl: - specifier: ^3.15.0 - version: 3.15.0(next@15.0.0-canary.35(babel-plugin-react-compiler@0.0.0-experimental-938cd9a-20240601)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0))(react@19.0.0-rc.0) + specifier: ^3.15.2 + version: 3.15.2(next@15.0.0-rc.0(babel-plugin-react-compiler@0.0.0-experimental-938cd9a-20240601)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0))(react@19.0.0-rc.0) next-themes: specifier: ^0.3.0 version: 0.3.0(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) nextjs-toploader: specifier: ^1.6.12 - version: 1.6.12(next@15.0.0-canary.35(babel-plugin-react-compiler@0.0.0-experimental-938cd9a-20240601)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0))(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + version: 1.6.12(next@15.0.0-rc.0(babel-plugin-react-compiler@0.0.0-experimental-938cd9a-20240601)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0))(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) react: specifier: 19.0.0-rc.0 version: 19.0.0-rc.0 @@ -359,7 +383,7 @@ importers: version: 1.5.0(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) tailwindcss-animate: specifier: ^1.0.7 - version: 1.0.7(tailwindcss@3.4.4(ts-node@10.9.2(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5))) + version: 1.0.7(tailwindcss@3.4.4(ts-node@10.9.2(@swc/core@1.6.3)(@types/node@20.14.7)(typescript@5.5.2))) tippy.js: specifier: ^6.3.7 version: 6.3.7 @@ -373,18 +397,6 @@ importers: specifier: ^3.23.8 version: 3.23.8 devDependencies: - '@dnd-kit/core': - specifier: ^6.1.0 - version: 6.1.0(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@dnd-kit/sortable': - specifier: ^8.0.0 - version: 8.0.0(@dnd-kit/core@6.1.0(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@dnd-kit/utilities': - specifier: ^3.2.2 - version: 3.2.2(react@19.0.0-rc.0) - '@emoji-mart/data': - specifier: ^1.2.1 - version: 1.2.1 '@hookform/devtools': specifier: ^4.3.1 version: 4.3.1(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) @@ -392,26 +404,14 @@ importers: specifier: ^3.6.0 version: 3.6.0(react-hook-form@7.52.0(react@19.0.0-rc.0)) '@next/bundle-analyzer': - specifier: 15.0.0-canary.35 - version: 15.0.0-canary.35 - '@radix-ui/react-dropdown-menu': - specifier: ^2.0.6 - version: 2.0.6(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-icons': - specifier: ^1.3.0 - version: 1.3.0(react@19.0.0-rc.0) - '@radix-ui/react-popover': - specifier: ^1.0.7 - version: 1.0.7(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-toolbar': - specifier: ^1.0.4 - version: 1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + specifier: ^15.0.0-canary.39 + version: 15.0.0-rc.0 '@tailwindcss/container-queries': specifier: ^0.1.1 - version: 0.1.1(tailwindcss@3.4.4(ts-node@10.9.2(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5))) + version: 0.1.1(tailwindcss@3.4.4(ts-node@10.9.2(@swc/core@1.6.3)(@types/node@20.14.7)(typescript@5.5.2))) '@tanstack/eslint-plugin-query': specifier: ^5.43.1 - version: 5.43.1(eslint@8.57.0)(typescript@5.4.5) + version: 5.43.1(eslint@8.57.0)(typescript@5.5.2) '@tanstack/react-query': specifier: ^5.45.1 version: 5.45.1(react@19.0.0-rc.0) @@ -422,8 +422,8 @@ importers: specifier: ^4.17.5 version: 4.17.5 '@types/node': - specifier: ^20.14.2 - version: 20.14.2 + specifier: ^20.14.7 + version: 20.14.7 '@types/react': specifier: ^18.3.3 version: 18.3.3 @@ -447,13 +447,13 @@ importers: version: 8.57.0 eslint-config-next: specifier: 15.0.0-canary.28 - version: 15.0.0-canary.28(eslint@8.57.0)(typescript@5.4.5) + version: 15.0.0-canary.28(eslint@8.57.0)(typescript@5.5.2) eslint-config-vitnode: specifier: workspace:* version: link:../../packages/eslint-config-vitnode geist: specifier: ^1.3.0 - version: 1.3.0(next@15.0.0-canary.35(babel-plugin-react-compiler@0.0.0-experimental-938cd9a-20240601)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)) + version: 1.3.0(next@15.0.0-rc.0(babel-plugin-react-compiler@0.0.0-experimental-938cd9a-20240601)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)) postcss: specifier: ^8.4.38 version: 8.4.38 @@ -462,13 +462,13 @@ importers: version: 2.3.0 tailwindcss: specifier: ^3.4.4 - version: 3.4.4(ts-node@10.9.2(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)) + version: 3.4.4(ts-node@10.9.2(@swc/core@1.6.3)(@types/node@20.14.7)(typescript@5.5.2)) ts-node: specifier: ^10.9.2 - version: 10.9.2(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5) + version: 10.9.2(@swc/core@1.6.3)(@types/node@20.14.7)(typescript@5.5.2) typescript: - specifier: ^5.4.5 - version: 5.4.5 + specifier: ^5.5.2 + version: 5.5.2 packages/backend: dependencies: @@ -534,8 +534,8 @@ importers: specifier: ^2.0.4 version: 2.0.4 '@types/node': - specifier: ^20.14.2 - version: 20.14.2 + specifier: ^20.14.7 + version: 20.14.7 '@types/object-path': specifier: ^0.11.4 version: 0.11.4 @@ -555,17 +555,17 @@ importers: specifier: ^0.11.8 version: 0.11.8 typescript: - specifier: ^5.4.5 - version: 5.4.5 + specifier: ^5.5.2 + version: 5.5.2 packages/eslint-config-vitnode: devDependencies: '@typescript-eslint/eslint-plugin': specifier: ^7.13.1 - version: 7.13.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5) + version: 7.13.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.5.2))(eslint@8.57.0)(typescript@5.5.2) '@typescript-eslint/parser': specifier: ^7.13.1 - version: 7.13.1(eslint@8.57.0)(typescript@5.4.5) + version: 7.13.1(eslint@8.57.0)(typescript@5.5.2) eslint: specifier: 8.57.0 version: 8.57.0 @@ -580,10 +580,10 @@ importers: version: 2.0.0(eslint@8.57.0) eslint-plugin-typescript-sort-keys: specifier: ^3.2.0 - version: 3.2.0(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5) + version: 3.2.0(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.5.2))(eslint@8.57.0)(typescript@5.5.2) typescript: - specifier: ^5.4.5 - version: 5.4.5 + specifier: ^5.5.2 + version: 5.5.2 packages/frontend: dependencies: @@ -591,8 +591,8 @@ importers: specifier: 15.0.0-canary.28 version: 15.0.0-canary.28(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) next-intl: - specifier: ^3.15.0 - version: 3.15.0(next@15.0.0-canary.28(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0))(react@19.0.0-rc.0) + specifier: ^3.15.2 + version: 3.15.2(next@15.0.0-canary.28(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0))(react@19.0.0-rc.0) nprogress: specifier: ^0.2.0 version: 0.2.0 @@ -625,8 +625,8 @@ importers: specifier: ^2.3.0 version: 2.3.0 typescript: - specifier: ^5.4.5 - version: 5.4.5 + specifier: ^5.5.2 + version: 5.5.2 packages/shared: devDependencies: @@ -1612,9 +1612,6 @@ packages: '@floating-ui/utils@0.2.2': resolution: {integrity: sha512-J4yDIIthosAsRZ5CPYP/jQvUAQtlZTTD/4suA08/FEnlxqW3sKS9iAhgsa9VYLZ6vDHn/ixJgIqRQPotoBjxIw==} - '@formatjs/ecma402-abstract@1.18.3': - resolution: {integrity: sha512-J961RbhyjHWeCIv+iOceNxpoZ/qomJOs5lH+rUJCeKNa59gME4KC0LJVMeWODjHsnv/hTH8Hvd6sevzcAzjuaQ==} - '@formatjs/ecma402-abstract@2.0.0': resolution: {integrity: sha512-rRqXOqdFmk7RYvj4khklyqzcfQl9vEL/usogncBHRZfZBDOwMGuSRNFl02fu5KGHXdbinju+YXyuR+Nk8xlr/g==} @@ -2227,8 +2224,8 @@ packages: '@nestjs/platform-socket.io': optional: true - '@next/bundle-analyzer@15.0.0-canary.35': - resolution: {integrity: sha512-tM4KFTu/js4urXumEuJgbxa2g8B+ty19nt/adSqb6v6r99RqQ9ves7hzMboFR+/PcpPoYXCYBv24AdvyegK6wA==} + '@next/bundle-analyzer@15.0.0-rc.0': + resolution: {integrity: sha512-42idubQ3sV0BsP+x+BC5XuESr8jO5o5jnmhKOKI/lCFzq5hUvnAxkqcmehkiyCy6b3bTSUv6D8nC1fOisqFtew==} '@next/env@14.1.4': resolution: {integrity: sha512-e7X7bbn3Z6DWnDi75UWn+REgAbLEqxI8Tq2pkFOFAMpWAWApz/YCUhtWMWn410h8Q2fYiYL7Yg5OlxMOCfFjJQ==} @@ -2236,8 +2233,8 @@ packages: '@next/env@15.0.0-canary.28': resolution: {integrity: sha512-0ITy8GHxw1UnCe6qr65gnGyHraY3f9eifRjdKybFvAGXHhakkepwIVPuQDBYAOwa3bnP7dgzZpk2VGF9jxXzPA==} - '@next/env@15.0.0-canary.35': - resolution: {integrity: sha512-0e/NE9bFrPH1UMkFDKd3ZOc2341hp4lAh1EXDL9uFsseAuffNLtlDzgsa4nM+AkohGS2lNtexfmryMVDoz4c7Q==} + '@next/env@15.0.0-rc.0': + resolution: {integrity: sha512-6W0ndQvHR9sXcqcKeR/inD2UTRCs9+VkSK3lfaGmEuZs7EjwwXMO2BPYjz9oBrtfPL3xuTjtXsHKSsalYQ5l1Q==} '@next/eslint-plugin-next@15.0.0-canary.28': resolution: {integrity: sha512-rUl+pAvNX9G2v9akH+nHnjuGGBawfpuxakfk3bQiwwHtj9N1CU2PENw6ArBMSloQFbQYUkPM4M7pZkXOLKS4ZA==} @@ -2254,8 +2251,8 @@ packages: cpu: [arm64] os: [darwin] - '@next/swc-darwin-arm64@15.0.0-canary.35': - resolution: {integrity: sha512-EIbEcrQQ38TMuYyu7ZcOCATQy9BnrH1b1oP4PFj/IZutQOEGDueo85nDE91qmQwkYSLaRGqrY0Ai3KDkmlsOcQ==} + '@next/swc-darwin-arm64@15.0.0-rc.0': + resolution: {integrity: sha512-4OpTXvAWcSabXA5d688zdUwa3sfT9QrLnHMdpv4q2UDnnuqmOI0xLb6lrOxwpi+vHJNkneuNLqyc5HGBhkqL6A==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] @@ -2272,8 +2269,8 @@ packages: cpu: [x64] os: [darwin] - '@next/swc-darwin-x64@15.0.0-canary.35': - resolution: {integrity: sha512-x2f5dXJRCj77Vinsp0GA4tfeYtIXPYbxQ/cnYXnR55cZIsrPysKbURNxsFoBLCL12fLV8Rba7z7E8w5CuNWSYA==} + '@next/swc-darwin-x64@15.0.0-rc.0': + resolution: {integrity: sha512-/TD8M9DT244uhtFA8P/0DUbM7ftg2zio6yOo6ajV16vNjkcug9Kt9//Wa4SrJjWcsGZpViLctOlwn3/6JFAuAA==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] @@ -2290,8 +2287,8 @@ packages: cpu: [arm64] os: [linux] - '@next/swc-linux-arm64-gnu@15.0.0-canary.35': - resolution: {integrity: sha512-g4cC+kdE9lHMTKbV8bz3WuwtU0aWxjzoNxkM1EnGM67mlRmpP/vWlFIE1H1UPoWPirymAqwc7+p2lJTopcgxwA==} + '@next/swc-linux-arm64-gnu@15.0.0-rc.0': + resolution: {integrity: sha512-3VTO32938AcqOlOI/U61/MIpeYrblP22VU1GrgmMQJozsAXEJgLCgf3wxZtn61/FG4Yc0tp7rPZE2t1fIGe0+w==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] @@ -2308,8 +2305,8 @@ packages: cpu: [arm64] os: [linux] - '@next/swc-linux-arm64-musl@15.0.0-canary.35': - resolution: {integrity: sha512-V7R4G7t09GmBxu/plZ4LcoGNXWonqj9sw6AsncTfoeP76+bUKZC+l5u4EPyUO/P35suGVyy8fPZcwjDTGQWtRg==} + '@next/swc-linux-arm64-musl@15.0.0-rc.0': + resolution: {integrity: sha512-0kDnxM3AfrrHFJ/wTkjkv7cVHIaGwv+CzDg9lL2BoLEM4kMQhH20DTsBOMqpTpo1K2KCg67LuTGd3QOITT5uFQ==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] @@ -2326,8 +2323,8 @@ packages: cpu: [x64] os: [linux] - '@next/swc-linux-x64-gnu@15.0.0-canary.35': - resolution: {integrity: sha512-lRUOjlEi02LcCUxxMNO3tg6Hy4WsC5uyRKu1MSQf0NFxigbvjkV1RcBsiuD+lSLWAB3+c0OMIcTugwSOjVPDkA==} + '@next/swc-linux-x64-gnu@15.0.0-rc.0': + resolution: {integrity: sha512-fPMNahzqYFjm5h0ncJ5+F3NrShmWhpusM+zrQl01MMU0Ed5xsL4pJJDSuXV4wPkNUSjCP3XstTjxR5kBdO4juQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] @@ -2344,8 +2341,8 @@ packages: cpu: [x64] os: [linux] - '@next/swc-linux-x64-musl@15.0.0-canary.35': - resolution: {integrity: sha512-AQQhMQB5QtCVmUchnpdqL0zyhjXhoWmEIFcmsiPNv7FjfGZuyfX4Pf/XIlvTPhMzpUVpDJO44U7HWqGlLwrIFw==} + '@next/swc-linux-x64-musl@15.0.0-rc.0': + resolution: {integrity: sha512-7/FLgOqrrQAxOVQrxfr3bGgZ83pSCmc2S3TXBILnHw0S8qLxmFjhSjH5ogaDmjrES/PSYMaX1FsP5Af88hp7Gw==} engines: {node: '>= 10'} cpu: [x64] os: [linux] @@ -2362,8 +2359,8 @@ packages: cpu: [arm64] os: [win32] - '@next/swc-win32-arm64-msvc@15.0.0-canary.35': - resolution: {integrity: sha512-eJhoSZRKCoO0bEe7JTWJB2r2UD8Vex1wP4YsKzrfR5/lMgXnAWPWWP9+1nbq7vciuyyvdXkv44BxJvSmnC5Q/g==} + '@next/swc-win32-arm64-msvc@15.0.0-rc.0': + resolution: {integrity: sha512-5wcqoYHh7hbdghjH6Xs3i5/f0ov+i1Xw2E3O+BzZNESYVLgCM1q7KJu5gdGFoXA2gz5XaKF/VBcYHikLzyjgmA==} engines: {node: '>= 10'} cpu: [arm64] os: [win32] @@ -2380,8 +2377,8 @@ packages: cpu: [ia32] os: [win32] - '@next/swc-win32-ia32-msvc@15.0.0-canary.35': - resolution: {integrity: sha512-BsOY4uV9tQo6tnQpxdseImVi52cN8KGx2+37XRXykL1W71BZg5X/UutQEpWSK0bDBKxVnmoGWo8EQ+hWH4snbg==} + '@next/swc-win32-ia32-msvc@15.0.0-rc.0': + resolution: {integrity: sha512-/hqOmYRTvtBPToE4Dbl9n+sLYU7DPd52R+TtjIrrEzTMgFo2/d7un3sD7GKmb2OwOj/ExyGv6Bd/JzytBVxXlw==} engines: {node: '>= 10'} cpu: [ia32] os: [win32] @@ -2398,8 +2395,8 @@ packages: cpu: [x64] os: [win32] - '@next/swc-win32-x64-msvc@15.0.0-canary.35': - resolution: {integrity: sha512-NsRYXoCjrnjypZAjlLpWIhUW1mBabmfpnPRn94HjoX3MxaG0fSGkV6GI5akGRfNKogXWRbJpt88R1qzYIZiDjQ==} + '@next/swc-win32-x64-msvc@15.0.0-rc.0': + resolution: {integrity: sha512-2Jly5nShvCUzzngP3RzdQ3JcuEcHcnIEvkvZDCXqFAK+bWks4+qOkEUO1QIAERQ99J5J9/1AN/8zFBme3Mm57A==} engines: {node: '>= 10'} cpu: [x64] os: [win32] @@ -2482,32 +2479,35 @@ packages: '@radix-ui/colors@1.0.1': resolution: {integrity: sha512-xySw8f0ZVsAEP+e7iLl3EvcBXX7gsIlC1Zso/sPBW9gIWerBTgz6axrjU+MZ39wD+WFi5h5zdWpsg3+hwt2Qsg==} - '@radix-ui/number@1.0.1': - resolution: {integrity: sha512-T5gIdVO2mmPW3NNhjNgEP3cqMXjXL9UbO0BzWcXfvdBs+BohbQxvd/K5hSVKmn9/lbTdsQVKbUcP5WLCwvUbBg==} + '@radix-ui/number@1.1.0': + resolution: {integrity: sha512-V3gRzhVNU1ldS5XhAPTom1fOIo4ccrjjJgmE+LI2h/WaFpHmx0MQApT+KZHnx8abG6Avtfcz4WoEciMnpFT3HQ==} '@radix-ui/primitive@1.0.1': resolution: {integrity: sha512-yQ8oGX2GVsEYMWGxcovu1uGWPCxV5BFfeeYxqPmuAzUyLT9qmaMXSAhXpb0WrspIeqYzdJpkh2vHModJPgRIaw==} - '@radix-ui/react-accordion@1.1.2': - resolution: {integrity: sha512-fDG7jcoNKVjSK6yfmuAs0EnPDro0WMXIhMtXdTBWqEioVW206ku+4Lw07e+13lUkFkpoEQ2PdeMIAGpdqEAmDg==} + '@radix-ui/primitive@1.1.0': + resolution: {integrity: sha512-4Z8dn6Upk0qk4P74xBhZ6Hd/w0mPEzOOLxy4xiPXOXqjF7jZS0VAKk7/x/H6FyY2zCkYJqePf1G5KmkmNJ4RBA==} + + '@radix-ui/react-accordion@1.2.0': + resolution: {integrity: sha512-HJOzSX8dQqtsp/3jVxCU3CXEONF7/2jlGAB28oX8TTw1Dz8JYbEI1UcL8355PuLBE41/IRRMvCw7VkiK/jcUOQ==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true '@types/react-dom': optional: true - '@radix-ui/react-alert-dialog@1.0.5': - resolution: {integrity: sha512-OrVIOcZL0tl6xibeuGt5/+UxoT2N27KCFOPjFyfXMnchxSHZ/OW7cCX2nGlIYJrbHK/fczPcFzAwvNBB6XBNMA==} + '@radix-ui/react-alert-dialog@1.1.0': + resolution: {integrity: sha512-kM8Pfn78tg0aqFD2E1KfO0sZDY75hTkrZd9DIWkncQFwlIB1FV96J0+KsNvK1AotgQO8IMxntRyPMrh8+2vghA==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true @@ -2527,13 +2527,26 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-checkbox@1.0.4': - resolution: {integrity: sha512-CBuGQa52aAYnADZVt/KBQzXrwx6TqnlwtcIPGtVt5JkkzQwMOLJjPukimhfKEr4GQNd43C+djUh5Ikopj8pSLg==} + '@radix-ui/react-arrow@1.1.0': + resolution: {integrity: sha512-FmlW1rCg7hBpEBwFbjHwCW6AmWLQM6g/v0Sn8XbP9NvmSZ2San1FpQeyPtufzOMSIx7Y4dzjlHoifhp+7NkZhw==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + + '@radix-ui/react-checkbox@1.1.0': + resolution: {integrity: sha512-3+kSzVfMONtP3B6CvaOrXLVTyGYws7tGmG5kOY0AfyH9sexkLytIwciNwjZhY0RoGOEbxI7bMS21XYB8H5itWQ==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true @@ -2553,6 +2566,19 @@ packages: '@types/react-dom': optional: true + '@radix-ui/react-collapsible@1.1.0': + resolution: {integrity: sha512-zQY7Epa8sTL0mq4ajSJpjgn2YmCgyrG7RsQgLp3C0LQVkG7+Tf6Pv1CeNWZLyqMjhdPkBa5Lx7wYBeSu7uCSTA==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + '@radix-ui/react-collection@1.0.3': resolution: {integrity: sha512-3SzW+0PW7yBBoQlT8wNcGtaxaD0XSu0uLUFgrtHY08Acx05TaHaOmVLR73c0j/cqpDy53KBMO7s0dx2wmOIDIA==} peerDependencies: @@ -2566,6 +2592,19 @@ packages: '@types/react-dom': optional: true + '@radix-ui/react-collection@1.1.0': + resolution: {integrity: sha512-GZsZslMJEyo1VKm5L1ZJY8tGDxZNPAoUeQUIbKeJfoi7Q4kmig5AsgLMYYuyYbfjd8fBmFORAIwYAkXMnXZgZw==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + '@radix-ui/react-compose-refs@1.0.1': resolution: {integrity: sha512-fDSBgd44FKHa1FRMU59qBMPFcl2PZE+2nmqunj+BWFyYYjnhIDWL2ItDs3rrbJDQOtzt5nIebLCQc4QRfz6LJw==} peerDependencies: @@ -2575,6 +2614,15 @@ packages: '@types/react': optional: true + '@radix-ui/react-compose-refs@1.1.0': + resolution: {integrity: sha512-b4inOtiaOnYf9KWyO3jAeeCG6FeyfY6ldiEPanbUjWd+xIk5wZeHa8yVwmrJ2vderhu/BQvzCrJI0lHd+wIiqw==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@radix-ui/react-context@1.0.1': resolution: {integrity: sha512-ebbrdFoYTcuZ0v4wG5tedGnp9tzcV8awzsxYph7gXUyvnNLuTIcCk1q17JEbnVhXAKG9oX3KtchwiMIAYp9NLg==} peerDependencies: @@ -2584,6 +2632,15 @@ packages: '@types/react': optional: true + '@radix-ui/react-context@1.1.0': + resolution: {integrity: sha512-OKrckBy+sMEgYM/sMmqmErVn0kZqrHPJze+Ql3DzYsDDp0hl0L62nx/2122/Bvps1qz645jlcu2tD9lrRSdf8A==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@radix-ui/react-dialog@1.0.5': resolution: {integrity: sha512-GjWJX/AUpB703eEBanuBnIWdIXg6NvJFCXcNlSZk4xdszCdhrJgBoUd1cGk67vFO+WdA2pfI/plOpqz/5GUP6Q==} peerDependencies: @@ -2597,6 +2654,19 @@ packages: '@types/react-dom': optional: true + '@radix-ui/react-dialog@1.1.0': + resolution: {integrity: sha512-oiSJcsjbdC8JqbXrOuhOd7oaEaPp3x2L2zn6V7ie6SSpEjrAha/WabDX4po6laGwbhAu9DT0XxHL0DmcIXrR0A==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + '@radix-ui/react-direction@1.0.1': resolution: {integrity: sha512-RXcvnXgyvYvBEOhCBuddKecVkoMiI10Jcm5cTI7abJRAHYfFxeu+FBQs/DvdxSYucxR5mna0dNsL6QFlds5TMA==} peerDependencies: @@ -2606,6 +2676,15 @@ packages: '@types/react': optional: true + '@radix-ui/react-direction@1.1.0': + resolution: {integrity: sha512-BUuBvgThEiAXh2DWu93XsT+a3aWrGqolGlqqw5VU1kG7p/ZH2cuDlM1sRLNnY3QcBS69UIz2mcKhMxDsdewhjg==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@radix-ui/react-dismissable-layer@1.0.5': resolution: {integrity: sha512-aJeDjQhywg9LBu2t/At58hCvr7pEm0o2Ke1x33B+MhjNmmZ17sy4KImo0KPLgsnc/zN7GPdce8Cnn0SWvwZO7g==} peerDependencies: @@ -2619,13 +2698,26 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-dropdown-menu@2.0.6': - resolution: {integrity: sha512-i6TuFOoWmLWq+M/eCLGd/bQ2HfAX1RJgvrBQ6AQLmzfvsLdefxbWu8G9zczcPFfcSPehz9GcpF6K9QYreFV8hA==} + '@radix-ui/react-dismissable-layer@1.1.0': + resolution: {integrity: sha512-/UovfmmXGptwGcBQawLzvn2jOfM0t4z3/uKffoBlj724+n3FvBbZ7M0aaBOmkp6pqFYpO4yx8tSVJjx3Fl2jig==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + + '@radix-ui/react-dropdown-menu@2.1.0': + resolution: {integrity: sha512-8fAz27yxVaYTkXMm5dVOcKCHOiio9b4nl7rO1HmK8rpzcEl0kSSmwFQsYDyJxB/Em48PvXTez/iaBj3VEd2N4g==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true @@ -2641,6 +2733,15 @@ packages: '@types/react': optional: true + '@radix-ui/react-focus-guards@1.1.0': + resolution: {integrity: sha512-w6XZNUPVv6xCpZUqb/yN9DL6auvpGX3C/ee6Hdi16v2UUy25HV2Q5bcflsiDyT/g5RwbPQ/GIT1vLkeRb+ITBw==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@radix-ui/react-focus-scope@1.0.4': resolution: {integrity: sha512-sL04Mgvf+FmyvZeYfNu1EPAaaxD+aw7cYeIB9L9Fvq8+urhltTRaEo5ysKOpHuKPclsZcSUMKlN05x4u+CINpA==} peerDependencies: @@ -2654,13 +2755,26 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-hover-card@1.0.7': - resolution: {integrity: sha512-OcUN2FU0YpmajD/qkph3XzMcK/NmSk9hGWnjV68p6QiZMgILugusgQwnLSDs3oFSJYGKf3Y49zgFedhGh04k9A==} + '@radix-ui/react-focus-scope@1.1.0': + resolution: {integrity: sha512-200UD8zylvEyL8Bx+z76RJnASR2gRMuxlgFCPAe/Q/679a/r0eK3MBVYMb7vZODZcffZBdob1EGnky78xmVvcA==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + + '@radix-ui/react-hover-card@1.1.0': + resolution: {integrity: sha512-vckj26sPXXFsX/fi1kqvTDMJAXtur9TyP1NgV5m2QJbV3R+E766QJRccsJkfdo9uBvhLsRCg8gz1tRUbe4HCqA==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true @@ -2681,39 +2795,48 @@ packages: '@types/react': optional: true - '@radix-ui/react-label@2.0.2': - resolution: {integrity: sha512-N5ehvlM7qoTLx7nWPodsPYPgMzA5WM8zZChQg8nyFJKnDO5WHdba1vv5/H6IO5LtJMfD2Q3wh1qHFGNtK0w3bQ==} + '@radix-ui/react-id@1.1.0': + resolution: {integrity: sha512-EJUrI8yYh7WOjNOqpoJaf1jlFIH2LvtgAl+YcFqNCa+4hj64ZXmPkAKOFs/ukjz3byN6bdb/AVUqHkI8/uWWMA==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + '@radix-ui/react-label@2.1.0': + resolution: {integrity: sha512-peLblDlFw/ngk3UWq0VnYaOLy6agTZZ+MUO/WhVfm14vJGML+xH4FAl2XQGLqdefjNb7ApRg6Yn7U42ZhmYXdw==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true '@types/react-dom': optional: true - '@radix-ui/react-menu@2.0.6': - resolution: {integrity: sha512-BVkFLS+bUC8HcImkRKPSiVumA1VPOOEC5WBMiT+QAVsPzW1FJzI9KnqgGxVDPBcql5xXrHkD3JOVoXWEXD8SYA==} + '@radix-ui/react-menu@2.1.0': + resolution: {integrity: sha512-0AxIUQJpimipHDgTVISZbdOY+wZzgICKAsqfI1rF2Hp0Jh3YSv9e9J1tYYyurPBONe5vKi3hZPtVt2E85Sac7A==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true '@types/react-dom': optional: true - '@radix-ui/react-navigation-menu@1.1.4': - resolution: {integrity: sha512-Cc+seCS3PmWmjI51ufGG7zp1cAAIRqHVw7C9LOA2TZ+R4hG6rDvHcTqIsEEFLmZO3zNVH72jOOE7kKNy8W+RtA==} + '@radix-ui/react-navigation-menu@1.2.0': + resolution: {integrity: sha512-OQ8tcwAOR0DhPlSY3e4VMXeHiol7la4PPdJWhhwJiJA+NLX0SaCaonOkRnI3gCDHoZ7Fo7bb/G6q25fRM2Y+3Q==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true @@ -2733,6 +2856,19 @@ packages: '@types/react-dom': optional: true + '@radix-ui/react-popover@1.1.0': + resolution: {integrity: sha512-2wdgj6eKNVoFNFtYv2xwkzhIJPlJ5L2aV0eKTZHi5dUVrGy+MhgoV8IyyeFpkZQrwwFzbFlnWl1bwyjVBCNapQ==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + '@radix-ui/react-popper@1.1.3': resolution: {integrity: sha512-cKpopj/5RHZWjrbF2846jBNacjQVwkP068DfmgrNJXpvVWrOvlAmE9xSiy5OqeE+Gi8D9fP+oDhUnPqNMY8/5w==} peerDependencies: @@ -2746,6 +2882,19 @@ packages: '@types/react-dom': optional: true + '@radix-ui/react-popper@1.2.0': + resolution: {integrity: sha512-ZnRMshKF43aBxVWPWvbj21+7TQCvhuULWJ4gNIKYpRlQt5xGRhLx66tMp8pya2UkGHTSlhpXwmjqltDYHhw7Vg==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + '@radix-ui/react-portal@1.0.4': resolution: {integrity: sha512-Qki+C/EuGUVCQTOTD5vzJzJuMUlewbzuKyUy+/iHM2uwGiru9gZeBJtHAPKAEkB5KWGi9mP/CHKcY0wt1aW45Q==} peerDependencies: @@ -2759,6 +2908,19 @@ packages: '@types/react-dom': optional: true + '@radix-ui/react-portal@1.1.0': + resolution: {integrity: sha512-0tXZ5O6qAVvuN9SWP0X+zadHf9hzHiMf/vxOU+kXO+fbtS8lS57MXa6EmikDxk9s/Bmkk80+dcxgbvisIyeqxg==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + '@radix-ui/react-presence@1.0.1': resolution: {integrity: sha512-UXLW4UAbIY5ZjcvzjfRFo5gxva8QirC9hF7wRE4U5gz+TP0DbRk+//qyuAQ1McDxBt1xNMBTaciFGvEmJvAZCg==} peerDependencies: @@ -2772,6 +2934,19 @@ packages: '@types/react-dom': optional: true + '@radix-ui/react-presence@1.1.0': + resolution: {integrity: sha512-Gq6wuRN/asf9H/E/VzdKoUtT8GC9PQc9z40/vEr0VCJ4u5XvvhWIrSsCB6vD2/cH7ugTdSfYq9fLJCcM00acrQ==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + '@radix-ui/react-primitive@1.0.3': resolution: {integrity: sha512-yi58uVyoAcK/Nq1inRY56ZSjKypBNKTa/1mcL8qdl6oJeEaDbOldlzrGn7P6Q3Id5d+SYNGc5AJgc4vGhjs5+g==} peerDependencies: @@ -2785,26 +2960,39 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-progress@1.0.3': - resolution: {integrity: sha512-5G6Om/tYSxjSeEdrb1VfKkfZfn/1IlPWd731h2RfPuSbIfNUgfqAwbKfJCg/PP6nuUCTrYzalwHSpSinoWoCag==} + '@radix-ui/react-primitive@2.0.0': + resolution: {integrity: sha512-ZSpFm0/uHa8zTvKBDjLFWLo8dkr4MBsiDLz0g3gMUwqgLHz9rTaRRGYDgvZPtBJgYCBKXkS9fzmoySgr8CO6Cw==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true '@types/react-dom': optional: true - '@radix-ui/react-radio-group@1.1.3': - resolution: {integrity: sha512-x+yELayyefNeKeTx4fjK6j99Fs6c4qKm3aY38G3swQVTN6xMpsrbigC0uHs2L//g8q4qR7qOcww8430jJmi2ag==} + '@radix-ui/react-progress@1.1.0': + resolution: {integrity: sha512-aSzvnYpP725CROcxAOEBVZZSIQVQdHgBr2QQFKySsaD14u8dNT0batuXI+AAGDdAHfXH8rbnHmjYFqVJ21KkRg==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + + '@radix-ui/react-radio-group@1.2.0': + resolution: {integrity: sha512-yv+oiLaicYMBpqgfpSPw6q+RyXlLdIpQWDHZbUKURxe+nEh53hFXPPlfhfQQtYkS5MMK/5IWIa76SksleQZSzw==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true @@ -2824,26 +3012,39 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-select@2.0.0': - resolution: {integrity: sha512-RH5b7af4oHtkcHS7pG6Sgv5rk5Wxa7XI8W5gvB1N/yiuDGZxko1ynvOiVhFM7Cis2A8zxF9bTOUVbRDzPepe6w==} + '@radix-ui/react-roving-focus@1.1.0': + resolution: {integrity: sha512-EA6AMGeq9AEeQDeSH0aZgG198qkfHSbvWTf1HvoDmOB5bBG/qTxjYMWUKMnYiV6J/iP/J8MEFSuB2zRU2n7ODA==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true '@types/react-dom': optional: true - '@radix-ui/react-separator@1.0.3': - resolution: {integrity: sha512-itYmTy/kokS21aiV5+Z56MZB54KrhPgn6eHDKkFeOLR34HMN2s8PaN47qZZAGnvupcjxHaFZnW4pQEh0BvvVuw==} + '@radix-ui/react-select@2.1.0': + resolution: {integrity: sha512-g6uR+e9o4EB3laMekSDEEKpwRmoZdfiZmZSfc1fO4A1EAVCukZplyNB2TIrNao5cw9HQOyhhy2W1ZQo72RXrJg==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + + '@radix-ui/react-separator@1.1.0': + resolution: {integrity: sha512-3uBAs+egzvJBDZAzvb/n4NxxOYpnspmWxO2u5NbZ8Y6FM/NdrGSF9bop3Cf6F6C71z1rTSn8KV0Fo2ZVd79lGA==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true @@ -2859,26 +3060,35 @@ packages: '@types/react': optional: true - '@radix-ui/react-switch@1.0.3': - resolution: {integrity: sha512-mxm87F88HyHztsI7N+ZUmEoARGkC22YVW5CaC+Byc+HRpuvCrOBPTAnXgf+tZ/7i0Sg/eOePGdMhUKhPaQEqow==} + '@radix-ui/react-slot@1.1.0': + resolution: {integrity: sha512-FUCf5XMfmW4dtYl69pdS4DbxKy8nj4M7SafBgPllysxmdachynNflAdp/gCsnYWNDnge6tI9onzMp5ARYc1KNw==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + '@radix-ui/react-switch@1.1.0': + resolution: {integrity: sha512-OBzy5WAj641k0AOSpKQtreDMe+isX0MQJ1IVyF03ucdF3DunOnROVrjWs8zsXUxC3zfZ6JL9HFVCUlMghz9dJw==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true '@types/react-dom': optional: true - '@radix-ui/react-tabs@1.0.4': - resolution: {integrity: sha512-egZfYY/+wRNCflXNHx+dePvnz9FbmssDTJBtgRfDY7e8SE5oIo3Py2eCB1ckAbh1Q7cQ/6yJZThJ++sgbxibog==} + '@radix-ui/react-tabs@1.1.0': + resolution: {integrity: sha512-bZgOKB/LtZIij75FSuPzyEti/XBhJH52ExgtdVqjCIh+Nx/FW+LhnbXtbCzIi34ccyMsyOja8T0thCzoHFXNKA==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true @@ -2898,6 +3108,19 @@ packages: '@types/react-dom': optional: true + '@radix-ui/react-toggle-group@1.1.0': + resolution: {integrity: sha512-PpTJV68dZU2oqqgq75Uzto5o/XfOVgkrJ9rulVmfTKxWp3HfUjHE6CP/WLRR4AzPX9HWxw7vFow2me85Yu+Naw==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + '@radix-ui/react-toggle@1.0.3': resolution: {integrity: sha512-Pkqg3+Bc98ftZGsl60CLANXQBBQ4W3mTFS9EJvNxKMZ7magklKV69/id1mlAlOFDDfHvlCms0fx8fA4CMKDJHg==} peerDependencies: @@ -2911,13 +3134,26 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-toolbar@1.0.4': - resolution: {integrity: sha512-tBgmM/O7a07xbaEkYJWYTXkIdU/1pW4/KZORR43toC/4XWyBCURK0ei9kMUdp+gTPPKBgYLxXmRSH1EVcIDp8Q==} + '@radix-ui/react-toggle@1.1.0': + resolution: {integrity: sha512-gwoxaKZ0oJ4vIgzsfESBuSgJNdc0rv12VhHgcqN0TEJmmZixXG/2XpsLK8kzNWYcnaoRIEEQc0bEi3dIvdUpjw==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + + '@radix-ui/react-toolbar@1.1.0': + resolution: {integrity: sha512-ZUKknxhMTL/4hPh+4DuaTot9aO7UD6Kupj4gqXCsBTayX1pD1L+0C2/2VZKXb4tIifQklZ3pf2hG9T+ns+FclQ==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true @@ -2937,6 +3173,19 @@ packages: '@types/react-dom': optional: true + '@radix-ui/react-tooltip@1.1.0': + resolution: {integrity: sha512-DZZvEn5WUJyd9+JzVT/cTjt7m0rymjxpzJZMmb09lCWo8kRqOp4rsckFrGgocD5cR8e3gtaNINvWWqFMccvV/w==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + '@radix-ui/react-use-callback-ref@1.0.1': resolution: {integrity: sha512-D94LjX4Sp0xJFVaoQOd3OO9k7tpBYNOXdVhkltUbGv2Qb9OXdrg/CpsjlZv7ia14Sylv398LswWBVVu5nqKzAQ==} peerDependencies: @@ -2946,6 +3195,15 @@ packages: '@types/react': optional: true + '@radix-ui/react-use-callback-ref@1.1.0': + resolution: {integrity: sha512-CasTfvsy+frcFkbXtSJ2Zu9JHpN8TYKxkgJGWbjiZhFivxaeW7rMeZt7QELGVLaYVfFMsKHjb7Ak0nMEe+2Vfw==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@radix-ui/react-use-controllable-state@1.0.1': resolution: {integrity: sha512-Svl5GY5FQeN758fWKrjM6Qb7asvXeiZltlT4U2gVfl8Gx5UAv2sMR0LWo8yhsIZh2oQ0eFdZ59aoOOMV7b47VA==} peerDependencies: @@ -2955,6 +3213,15 @@ packages: '@types/react': optional: true + '@radix-ui/react-use-controllable-state@1.1.0': + resolution: {integrity: sha512-MtfMVJiSr2NjzS0Aa90NPTnvTSg6C/JLCV7ma0W6+OMV78vd8OyRpID+Ng9LxzsPbLeuBnWBA1Nq30AtBIDChw==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@radix-ui/react-use-escape-keydown@1.0.3': resolution: {integrity: sha512-vyL82j40hcFicA+M4Ex7hVkB9vHgSse1ZWomAqV2Je3RleKGO5iM8KMOEtfoSB0PnIelMd2lATjTGMYqN5ylTg==} peerDependencies: @@ -2964,6 +3231,15 @@ packages: '@types/react': optional: true + '@radix-ui/react-use-escape-keydown@1.1.0': + resolution: {integrity: sha512-L7vwWlR1kTTQ3oh7g1O0CBF3YCyyTj8NmhLR+phShpyA50HCfBFKVJTpshm9PzLiKmehsrQzTYTpX9HvmC9rhw==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@radix-ui/react-use-layout-effect@1.0.1': resolution: {integrity: sha512-v/5RegiJWYdoCvMnITBkNNx6bCj20fiaJnWtRkU18yITptraXjffz5Qbn05uOiQnOvi+dbkznkoaMltz1GnszQ==} peerDependencies: @@ -2973,11 +3249,20 @@ packages: '@types/react': optional: true - '@radix-ui/react-use-previous@1.0.1': - resolution: {integrity: sha512-cV5La9DPwiQ7S0gf/0qiD6YgNqM5Fk97Kdrlc5yBcrF3jyEZQwm7vYFqMo4IfeHgJXsRaMvLABFtd0OVEmZhDw==} + '@radix-ui/react-use-layout-effect@1.1.0': + resolution: {integrity: sha512-+FPE0rOdziWSrH9athwI1R0HDVbWlEhd+FR+aSDk4uWGmSJ9Z54sdZVDQPZAinJhJXwfT+qnj969mCsT2gfm5w==} peerDependencies: '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + '@radix-ui/react-use-previous@1.1.0': + resolution: {integrity: sha512-Z/e78qg2YFnnXcW88A4JmTtm4ADckLno6F7OXotmkQfeuCVaKuYzqAATPhVzl3delXE7CxIV8shofPn3jPc5Og==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true @@ -2991,6 +3276,15 @@ packages: '@types/react': optional: true + '@radix-ui/react-use-rect@1.1.0': + resolution: {integrity: sha512-0Fmkebhr6PiseyZlYAOtLS+nb7jLmpqTrJyv61Pe68MKYW6OWdRE2kI70TaYY27u7H0lajqM3hSMMLFq18Z7nQ==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@radix-ui/react-use-size@1.0.1': resolution: {integrity: sha512-ibay+VqrgcaI6veAojjofPATwledXiSmX+C0KrBk/xgpX9rBzPV3OsfwlhQdUOFbh+LKQorLYT+xTXW9V8yd0g==} peerDependencies: @@ -3000,6 +3294,15 @@ packages: '@types/react': optional: true + '@radix-ui/react-use-size@1.1.0': + resolution: {integrity: sha512-XW3/vWuIXHa+2Uwcc2ABSfcCledmXhhQPlGbfcRXbiUQI5Icjcg19BGCZVKKInYbvUCut/ufbbLLPFC5cbb1hw==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@radix-ui/react-visually-hidden@1.0.3': resolution: {integrity: sha512-D4w41yN5YRKtu464TLnByKzMDG/JlMPHtfZgQAu9v6mNakUqGUI9vUrfQKz8NK41VMm/xbZbh76NUTVtIYqOMA==} peerDependencies: @@ -3013,9 +3316,25 @@ packages: '@types/react-dom': optional: true + '@radix-ui/react-visually-hidden@1.1.0': + resolution: {integrity: sha512-N8MDZqtgCgG5S3aV60INAB475osJousYpZ4cTJ2cFbMpdHS5Y6loLTH8LPtkj2QN0x93J30HT/M3qJXM0+lyeQ==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + '@radix-ui/rect@1.0.1': resolution: {integrity: sha512-fyrgCaedtvMg9NK3en0pnOYJdtfwxUcNolezkNPUsoX57X8oQk+NkqcvzHXD2uKNij6GXmWU9NDru2IWjrO4BQ==} + '@radix-ui/rect@1.1.0': + resolution: {integrity: sha512-A9+lCBZoaMJlVKcRBz2YByCG+Cp2t6nAnMnNba+XiWxnj6r4JUFqfsgwocMBZU9LPtdxC6wB56ySYpc7LQIoJg==} + '@react-email/body@0.0.8': resolution: {integrity: sha512-gqdkNYlIaIw0OdpWu8KjIcQSIFvx7t2bZpXVxMMvBS859Ia1+1X3b5RNbjI3S1ZqLddUf7owOHkO4MiXGE+nxg==} peerDependencies: @@ -3174,8 +3493,8 @@ packages: cpu: [arm64] os: [darwin] - '@swc/core-darwin-arm64@1.6.1': - resolution: {integrity: sha512-u6GdwOXsOEdNAdSI6nWq6G2BQw5HiSNIZVcBaH1iSvBnxZvWbnIKyDiZKaYnDwTLHLzig2GuUjjE2NaCJPy4jg==} + '@swc/core-darwin-arm64@1.6.3': + resolution: {integrity: sha512-3r7cJf1BcE30iyF1rnOSKrEzIR+cqnyYSZvivrm62TZdXVsIjfXe1xulsKGxZgNeLY5erIu7ukvMvBvPhnQvqA==} engines: {node: '>=10'} cpu: [arm64] os: [darwin] @@ -3186,8 +3505,8 @@ packages: cpu: [x64] os: [darwin] - '@swc/core-darwin-x64@1.6.1': - resolution: {integrity: sha512-/tXwQibkDNLVbAtr7PUQI0iQjoB708fjhDDDfJ6WILSBVZ3+qs/LHjJ7jHwumEYxVq1XA7Fv2Q7SE/ZSQoWHcQ==} + '@swc/core-darwin-x64@1.6.3': + resolution: {integrity: sha512-8GLZ23IgVpF5xh2SbS5ZW/12/EEBuRU1hFOLB5rKERJU0y1RJ6YhDMf/FuOWhfHQcFM7TeedBwHIzaF+tdKKlw==} engines: {node: '>=10'} cpu: [x64] os: [darwin] @@ -3198,8 +3517,8 @@ packages: cpu: [arm] os: [linux] - '@swc/core-linux-arm-gnueabihf@1.6.1': - resolution: {integrity: sha512-aDgipxhJTms8iH78emHVutFR2c16LNhO+NTRCdYi+X4PyIn58/DyYTH6VDZ0AeEcS5f132ZFldU5AEgExwihXA==} + '@swc/core-linux-arm-gnueabihf@1.6.3': + resolution: {integrity: sha512-VQ/bduX7WhLOlGbJLMG7UH0LBehjjx43R4yuk55rjjJLqpvX5fQzMsWhQdIZ5vsc+4ORzdgtEAlpumTv6bsD1A==} engines: {node: '>=10'} cpu: [arm] os: [linux] @@ -3210,8 +3529,8 @@ packages: cpu: [arm64] os: [linux] - '@swc/core-linux-arm64-gnu@1.6.1': - resolution: {integrity: sha512-XkJ+eO4zUKG5g458RyhmKPyBGxI0FwfWFgpfIj5eDybxYJ6s4HBT5MoxyBLorB5kMlZ0XoY/usUMobPVY3nL0g==} + '@swc/core-linux-arm64-gnu@1.6.3': + resolution: {integrity: sha512-jHIQ/PCwtdDBIF/BiC5DochswuCAIW/T5skJ+eDMbta7+QtEnZCXTZWpT5ORoEY/gtsE2fjpOA4TS6fBBvXqUw==} engines: {node: '>=10'} cpu: [arm64] os: [linux] @@ -3222,8 +3541,8 @@ packages: cpu: [arm64] os: [linux] - '@swc/core-linux-arm64-musl@1.6.1': - resolution: {integrity: sha512-dr6YbLBg/SsNxs1hDqJhxdcrS8dGMlOXJwXIrUvACiA8jAd6S5BxYCaqsCefLYXtaOmu0bbx1FB/evfodqB70Q==} + '@swc/core-linux-arm64-musl@1.6.3': + resolution: {integrity: sha512-gA6velEUD27Dwu0BlR9hCcFzkWq2YL2pDAU5qbgeuGhaMiUCBssfqTQB+2ctEnV+AZx+hSMJOHvtA+uFZjfRrw==} engines: {node: '>=10'} cpu: [arm64] os: [linux] @@ -3234,8 +3553,8 @@ packages: cpu: [x64] os: [linux] - '@swc/core-linux-x64-gnu@1.6.1': - resolution: {integrity: sha512-A0b/3V+yFy4LXh3O9umIE7LXPC7NBWdjl6AQYqymSMcMu0EOb1/iygA6s6uWhz9y3e172Hpb9b/CGsuD8Px/bg==} + '@swc/core-linux-x64-gnu@1.6.3': + resolution: {integrity: sha512-fy4qoBDr5I8r+ZNCZxs/oZcmu4j/8mtSud6Ka102DaSxEjNg0vfIdo9ITsVIPsofhUTmDKjQsPB2O7YUlJAioQ==} engines: {node: '>=10'} cpu: [x64] os: [linux] @@ -3246,8 +3565,8 @@ packages: cpu: [x64] os: [linux] - '@swc/core-linux-x64-musl@1.6.1': - resolution: {integrity: sha512-5dJjlzZXhC87nZZZWbpiDP8kBIO0ibis893F/rtPIQBI5poH+iJuA32EU3wN4/WFHeK4et8z6SGSVghPtWyk4g==} + '@swc/core-linux-x64-musl@1.6.3': + resolution: {integrity: sha512-c/twcMbq/Gpq47G+b3kWgoaCujpXO11aRgJx6am+CprvP4uNeBHEpQkxD+DQmdWFHisZd0i9GB8NG3e7L9Rz9Q==} engines: {node: '>=10'} cpu: [x64] os: [linux] @@ -3258,8 +3577,8 @@ packages: cpu: [arm64] os: [win32] - '@swc/core-win32-arm64-msvc@1.6.1': - resolution: {integrity: sha512-HBi1ZlwvfcUibLtT3g/lP57FaDPC799AD6InolB2KSgkqyBbZJ9wAXM8/CcH67GLIP0tZ7FqblrJTzGXxetTJQ==} + '@swc/core-win32-arm64-msvc@1.6.3': + resolution: {integrity: sha512-y6RxMtX45acReQmzkxcEfJscfBXce6QjuNgWQHHs9exA592BZzmolDUwgmAyjyvopz1lWX+KdymdZFKvuDSx4w==} engines: {node: '>=10'} cpu: [arm64] os: [win32] @@ -3270,8 +3589,8 @@ packages: cpu: [ia32] os: [win32] - '@swc/core-win32-ia32-msvc@1.6.1': - resolution: {integrity: sha512-AKqHohlWERclexar5y6ux4sQ8yaMejEXNxeKXm7xPhXrp13/1p4/I3E5bPVX/jMnvpm4HpcKSP0ee2WsqmhhPw==} + '@swc/core-win32-ia32-msvc@1.6.3': + resolution: {integrity: sha512-41h7z3xgukl1HDDwhquaeOPSP1OWeHl+mWKnJVmmwd3ui/oowUDCO856qa6JagBgPSnAGfyXwv6vthuXwyCcWA==} engines: {node: '>=10'} cpu: [ia32] os: [win32] @@ -3282,8 +3601,8 @@ packages: cpu: [x64] os: [win32] - '@swc/core-win32-x64-msvc@1.6.1': - resolution: {integrity: sha512-0dLdTLd+ONve8kgC5T6VQ2Y5G+OZ7y0ujjapnK66wpvCBM6BKYGdT/OKhZKZydrC5gUKaxFN6Y5oOt9JOFUrOQ==} + '@swc/core-win32-x64-msvc@1.6.3': + resolution: {integrity: sha512-//bnwo9b8Vp1ED06eXCHyGZ5xIpdkQgg2fuFDdtd1FITl7r5bdQh2ryRzPiKiGwgXZwZQitUshI4JeEX9IuW+Q==} engines: {node: '>=10'} cpu: [x64] os: [win32] @@ -3297,8 +3616,8 @@ packages: '@swc/helpers': optional: true - '@swc/core@1.6.1': - resolution: {integrity: sha512-Yz5uj5hNZpS5brLtBvKY0L4s2tBAbQ4TjmW8xF1EC3YLFxQRrUjMP49Zm1kp/KYyYvTkSaG48Ffj2YWLu9nChw==} + '@swc/core@1.6.3': + resolution: {integrity: sha512-mZpei+LqE+AL+nwgERMQey9EJA9/yhHTN6nwbobH5GnSij/lhfTdGfAb1iumOrroqEcXbHUaK//7wOw7DjBGdA==} engines: {node: '>=10'} peerDependencies: '@swc/helpers': '*' @@ -3635,8 +3954,8 @@ packages: '@types/node-fetch@2.6.11': resolution: {integrity: sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==} - '@types/node@20.14.2': - resolution: {integrity: sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q==} + '@types/node@20.14.7': + resolution: {integrity: sha512-uTr2m2IbJJucF3KUxgnGOZvYbN0QgkGyWxG6973HCpMYFy2KfcgYuIwkJQMQkt1VbBMlvWRbpshFTLxnxCZjKQ==} '@types/nodemailer@6.4.15': resolution: {integrity: sha512-0EBJxawVNjPkng1zm2vopRctuWVCxk34JcIlRuXSf54habUWdz1FB7wHDqOqvDa8Mtpt0Q3LTXQkAs2LNyK5jQ==} @@ -4060,8 +4379,8 @@ packages: resolution: {integrity: sha512-y+CcFFwelSXpLZk/7fMB2mUbGtX9lKycf1MWJ7CaTIERyitVlyQx6C+sxcROU2BAJ24OiZyK+8wj2i8AlBoS3A==} engines: {node: '>=10'} - aria-query@5.3.0: - resolution: {integrity: sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==} + aria-query@5.1.3: + resolution: {integrity: sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ==} array-buffer-byte-length@1.0.1: resolution: {integrity: sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==} @@ -4150,12 +4469,12 @@ packages: resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} engines: {node: '>= 0.4'} - axe-core@4.7.0: - resolution: {integrity: sha512-M0JtH+hlOL5pLQwHOLNYZaXuhqmvS8oExsqB1SBYgA4Dk7u/xx+YdGHXaK5pyUfed5mYXdlYiphWq3G8cRi5JQ==} + axe-core@4.9.1: + resolution: {integrity: sha512-QbUdXJVTpvUTHU7871ppZkdOLBeGUKBQWHkHrvN2V9IQWGMt61zf3B45BtzjxEJzYuj0JBjBZP/hmYS/R9pmAw==} engines: {node: '>=4'} - axobject-query@3.2.1: - resolution: {integrity: sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg==} + axobject-query@3.1.1: + resolution: {integrity: sha512-goKlv8DZrK9hUh975fnHzhNIO4jUnFCfv/dszV5VwUGDFjI6vQ2VwoyjYjYNEbBE8AH87TduWP5uyDR1D+Iteg==} babel-plugin-macros@3.1.0: resolution: {integrity: sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==} @@ -4274,9 +4593,6 @@ packages: resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} engines: {node: '>=6'} - caniuse-lite@1.0.30001632: - resolution: {integrity: sha512-udx3o7yHJfUxMLkGohMlVHCvFvWmirKh9JAH/d7WOLPetlH+LTL5cocMZ0t7oZx/mdlOWXti97xLZWc8uURRHg==} - caniuse-lite@1.0.30001636: resolution: {integrity: sha512-bMg2vmr8XBsbL6Lr0UHXy/21m84FTxDLWn2FSqMd5PrlbMxwJlQnC2YWYxVgp66PZE+BBNF2jYQUBKCo1FDeZg==} @@ -4651,6 +4967,10 @@ packages: resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} engines: {node: '>=10'} + deep-equal@2.2.3: + resolution: {integrity: sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA==} + engines: {node: '>= 0.4'} + deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} @@ -4900,15 +5220,15 @@ packages: end-of-stream@1.4.4: resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} - engine.io-client@6.5.3: - resolution: {integrity: sha512-9Z0qLB0NIisTRt1DZ/8U2k12RJn8yls/nXMZLn+/N8hANT3TcYjKFKcwbw5zFQiN4NTde3TSY9zb79e1ij6j9Q==} + engine.io-client@6.5.4: + resolution: {integrity: sha512-GeZeeRjpD2qf49cZQ0Wvh/8NJNfeXkXXcoGh+F77oEAgo9gUHwT1fCRxSNU+YEEaysOJTnsFHmM5oAcPy4ntvQ==} engine.io-parser@5.2.2: resolution: {integrity: sha512-RcyUFKA93/CXH20l4SoVvzZfrSDMOTUS3bWVpTt2FuFP+XYrL8i8oonHP7WInRyVHXh0n/ORtoeiE1os+8qkSw==} engines: {node: '>=10.0.0'} - engine.io@6.5.4: - resolution: {integrity: sha512-KdVSDKhVKyOi+r5uEabrDLZw2qXStVvCsEB/LN3mw4WFi6Gx50jTyuxYVCwAAC0U46FdnzP/ScKRBTXb/NiEOg==} + engine.io@6.5.5: + resolution: {integrity: sha512-C5Pn8Wk+1vKBoHghJODM63yk8MvrO9EWZUfkAt5HAqIgPE4/8FF0PEGHXtEd40l223+cE5ABWuPzm38PHFXfMA==} engines: {node: '>=10.2.0'} enhanced-resolve@5.17.0: @@ -4937,6 +5257,9 @@ packages: resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} engines: {node: '>= 0.4'} + es-get-iterator@1.1.3: + resolution: {integrity: sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==} + es-iterator-helpers@1.0.19: resolution: {integrity: sha512-zoMwbCcH5hwUkKJkT8kDIBZSz9I6mVG//+lDCinLCGov4+r7NIy0ld8o03M0cJxl2spVf6ESYVS6/gpIfq1FFw==} engines: {node: '>= 0.4'} @@ -5065,8 +5388,8 @@ packages: '@typescript-eslint/parser': optional: true - eslint-plugin-jsx-a11y@6.8.0: - resolution: {integrity: sha512-Hdh937BS3KdwwbBaKd5+PLCOmYY6U4f2h9Z2ktwtNKvIdIEu137rjYbcb9ApSbVJfWxANNuiKTD/9tOKjK9qOA==} + eslint-plugin-jsx-a11y@6.9.0: + resolution: {integrity: sha512-nOFOCaJG2pYqORjK19lqPqxMO/JpvdCZdPtNdxY3kvom3jTvkAbOvQvD8wuD0G8BYR0IGAGYDlzqWJOh/ybn2g==} engines: {node: '>=4.0'} peerDependencies: eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 @@ -5091,8 +5414,8 @@ packages: peerDependencies: eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 - eslint-plugin-react@7.34.2: - resolution: {integrity: sha512-2HCmrU+/JNigDN6tg55cRDKCQWicYAPB38JGSFDQt95jDm8rrvSUo7YPkOIm5l6ts1j1zCvysNcasvfTMQzUOw==} + eslint-plugin-react@7.34.3: + resolution: {integrity: sha512-aoW4MV891jkUulwDApQbPYTVZmeuSyFrudpbTAQuj5Fv8VL+o6df2xIGpw8B0hPjAaih1/Fb0om9grCdyFYemA==} engines: {node: '>=4'} peerDependencies: eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 @@ -5347,8 +5670,8 @@ packages: react-dom: optional: true - framer-motion@11.2.10: - resolution: {integrity: sha512-/gr3PLZUVFCc86a9MqCUboVrALscrdluzTb3yew+2/qKBU8CX6nzs918/SRBRCqaPbx0TZP10CB6yFgK2C5cYQ==} + framer-motion@11.2.11: + resolution: {integrity: sha512-n+ozoEzgJu/2h9NoQMokF+CwNqIRVyuRC4RwMPwklfrrTjbVV32k9uBIgqYAwn7Jfpt5LuDVCtT57MWz1FbaLw==} peerDependencies: '@emotion/is-prop-valid': '*' react: ^18.0.0 @@ -5460,8 +5783,8 @@ packages: engines: {node: '>=16 || 14 >=14.17'} hasBin: true - glob@10.4.1: - resolution: {integrity: sha512-2jelhlq3E4ho74ZyVLN03oKdAZVUa6UDZzFLVH1H7dnoax+y9qyaq8zBkfDIggjniU19z0wU18y16jMB2eyVIw==} + glob@10.4.2: + resolution: {integrity: sha512-GwMlUF6PkPo3Gk21UxkCohOv0PLcIXVtKyLlpEI28R/cO/4eNOdmLk3CMW1wROV/WR/EsZOWAfBbBOqYvs88/w==} engines: {node: '>=16 || 14 >=14.18'} hasBin: true @@ -5720,6 +6043,10 @@ packages: resolution: {integrity: sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==} engines: {node: '>=0.10.0'} + is-arguments@1.1.1: + resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==} + engines: {node: '>= 0.4'} + is-array-buffer@3.0.4: resolution: {integrity: sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==} engines: {node: '>= 0.4'} @@ -5749,8 +6076,9 @@ packages: resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} engines: {node: '>= 0.4'} - is-core-module@2.13.1: - resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==} + is-core-module@2.14.0: + resolution: {integrity: sha512-a5dFJih5ZLYlRtDc0dZWP7RiKr6xIKzmn/oAYCDvdLThadVgyJwlaoQPmRtMSpz+rk0OGAgIu+TcM9HUF0fk1A==} + engines: {node: '>= 0.4'} is-data-view@1.0.1: resolution: {integrity: sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==} @@ -5920,8 +6248,8 @@ packages: resolution: {integrity: sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==} hasBin: true - jose@5.4.0: - resolution: {integrity: sha512-6rpxTHPAQyWMb9A35BroFl1Sp0ST3DpPcm5EVIxZxdH+e0Hv9fwhyB3XLKFUcHNpdSDnETmBfuPPTTlYz5+USw==} + jose@5.4.1: + resolution: {integrity: sha512-U6QajmpV/nhL9SyfAewo000fkiRQ+Yd2H0lBxJJ9apjpOgkOcBQJWOrMo917lxLptdS/n/o/xPzMkXhF46K8hQ==} js-beautify@1.15.1: resolution: {integrity: sha512-ESjNzSlt/sWE8sciZH8kBF8BPlwXPwhR6pWKAw8bw4Bwj+iZcnKW6ONWUutJ7eObuBZQpiIb8S7OYspWrKt7rA==} @@ -6362,8 +6690,8 @@ packages: neo-async@2.6.2: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} - next-intl@3.15.0: - resolution: {integrity: sha512-mccmy6oIbgV3QY2GsgHrgRLoEYYVEIXa+hEaK6OBeG3zYJ+H5AACVBAhLcf+5ctY06RFr95hYt1XcJJ+bNtkag==} + next-intl@3.15.2: + resolution: {integrity: sha512-OkKHvsnLiX3brG78I+DYHn9mz3Ui+fsXS8iHi8ulxr89wBrVu78CSVin7sMe+snGZuh4wg+aedbOUPwPr2OKVg==} peerDependencies: next: ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0 react: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -6410,16 +6738,16 @@ packages: sass: optional: true - next@15.0.0-canary.35: - resolution: {integrity: sha512-nDEaTTkwRi1kPlX7pg4gJ8OJ7+2qVPpq1s4Vu5D3JV5OMIoNJi/xa9OzQmrO56Kz6ff05ubTcpoNZzRl2rVL0g==} + next@15.0.0-rc.0: + resolution: {integrity: sha512-IWcCvxUSCAuOK5gig4+9yiyt/dLKpIa+WT01Qcx4CBE4TtwJljyTDnCVVn64jDZ4qmSzsaEYXpb4DTI8qbk03A==} engines: {node: '>=18.17.0'} hasBin: true peerDependencies: '@opentelemetry/api': ^1.1.0 '@playwright/test': ^1.41.2 babel-plugin-react-compiler: '*' - react: 19.0.0-rc.0 - react-dom: 19.0.0-rc.0 + react: 19.0.0-rc-f994737d14-20240522 + react-dom: 19.0.0-rc-f994737d14-20240522 sass: ^1.3.0 peerDependenciesMeta: '@opentelemetry/api': @@ -6476,8 +6804,8 @@ packages: node-releases@2.0.14: resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==} - nodemailer@6.9.13: - resolution: {integrity: sha512-7o38Yogx6krdoBf3jCAqnIN4oSQFx+fMa0I7dK1D+me9kBxx12D+/33wSb+fhOCtIxvYJ+4x4IMEhmhCKfAiOA==} + nodemailer@6.9.14: + resolution: {integrity: sha512-Dobp/ebDKBvz91sbtRKhcznLThrKxKt97GI2FAlAyy+fk19j73Uz3sBXolVtmcXjaorivqsbbbjDY+Jkt4/bQA==} engines: {node: '>=6.0.0'} nopt@5.0.0: @@ -6535,6 +6863,10 @@ packages: object-inspect@1.13.1: resolution: {integrity: sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==} + object-is@1.1.6: + resolution: {integrity: sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==} + engines: {node: '>= 0.4'} + object-keys@1.1.1: resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} engines: {node: '>= 0.4'} @@ -6636,6 +6968,9 @@ packages: resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} engines: {node: '>=6'} + package-json-from-dist@1.0.0: + resolution: {integrity: sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==} + param-case@3.0.4: resolution: {integrity: sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==} @@ -6776,8 +7111,8 @@ packages: resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==} engines: {node: '>= 6'} - piscina@4.5.1: - resolution: {integrity: sha512-DVhySLPfqAW+uRH9dF0bjA2xEWr5ANLAzkYXx5adSLMFnwssSIVJYhg0FlvgYsnT/khILQJ3WkjqbAlBvt+maw==} + piscina@4.6.0: + resolution: {integrity: sha512-VofazM7TCa/2cYhbtZQFyxJJIKe1JYZ5JBTxGMOo770CYupdVpHNvMrX+fuL+mACQ10ISWbzXFBmYjZvzELG5w==} pluralize@8.0.0: resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} @@ -7132,6 +7467,16 @@ packages: '@types/react': optional: true + react-remove-scroll@2.5.7: + resolution: {integrity: sha512-FnrTWO4L7/Bhhf3CYBNArEG/yROV0tKmTv7/3h9QCFvH6sndeFf1wPqOcbFVu5VAulS5dV1wGT3GZZ/1GawqiA==} + engines: {node: '>=10'} + peerDependencies: + '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + '@types/react': + optional: true + react-resizable-panels@2.0.19: resolution: {integrity: sha512-v3E41kfKSuCPIvJVb4nL4mIZjjKIn/gh6YqZF/gDfQDolv/8XnhJBek4EiV2gOr3hhc5A3kOGOayk3DhanpaQw==} peerDependencies: @@ -7480,8 +7825,8 @@ packages: snake-case@3.0.4: resolution: {integrity: sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==} - socket.io-adapter@2.5.4: - resolution: {integrity: sha512-wDNHGXGewWAjQPt3pyeYBtpWSq9cLE5UW1ZUPL/2eGK9jtse/FpXib7epSTsz0Q0m+6sg6Y4KtcFTlah1bdOVg==} + socket.io-adapter@2.5.5: + resolution: {integrity: sha512-eLDQas5dzPgOWCk9GuuJC2lBqItuhKI4uxGgo9aIV7MYbk2h9Q6uULEh8WBzThoI7l+qU9Ast9fVUmkqPP9wYg==} socket.io-client@4.7.3: resolution: {integrity: sha512-nU+ywttCyBitXIl9Xe0RSEfek4LneYkJxCeNnKCuhwoH4jGXO1ipIUw/VA/+Vvv2G1MTym11fzFC0SxkrcfXDw==} @@ -7569,6 +7914,10 @@ packages: resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} engines: {node: '>= 0.8'} + stop-iteration-iterator@1.0.0: + resolution: {integrity: sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==} + engines: {node: '>= 0.4'} + streamsearch@1.1.0: resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} engines: {node: '>=10.0.0'} @@ -7584,6 +7933,9 @@ packages: resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} engines: {node: '>=12'} + string.prototype.includes@2.0.0: + resolution: {integrity: sha512-E34CkBgyeqNDcrbU76cDjL5JLcVrtSdYq0MEh/B10r17pRP4ciHLwTgnuLV8Ay6cgEMLkcBkFCKyFZ43YldYzg==} + string.prototype.matchall@4.0.11: resolution: {integrity: sha512-NUdh0aDavY2og7IbBPenWqR9exH+E26Sv8e0/eTe1tltDGZL+GtBkDAnnyBtmekfK6/Dq3MkcGtzXFEd1LQrtg==} engines: {node: '>= 0.4'} @@ -7656,6 +8008,19 @@ packages: babel-plugin-macros: optional: true + styled-jsx@5.1.3: + resolution: {integrity: sha512-qLRShOWTE/Mf6Bvl72kFeKBl8N2Eq9WIFfoAuvbtP/6tqlnj1SCjv117n2MIjOPpa1jTorYqLJgsHKy5Y3ziww==} + engines: {node: '>= 12.0.0'} + peerDependencies: + '@babel/core': '*' + babel-plugin-macros: '*' + react: '>= 16.8.0 || 17.x.x || ^18.0.0-0 || ^19.0.0-0' + peerDependenciesMeta: + '@babel/core': + optional: true + babel-plugin-macros: + optional: true + styled-jsx@5.1.6: resolution: {integrity: sha512-qSVyDTeMotdvQYoHWLNGwRFJHC+i+ZvdBRYosOFgC+Wg1vx4frN2/RG/NA7SYqqvKNLf39P2LSRA2pu6n0XYZA==} engines: {node: '>= 12.0.0'} @@ -7746,8 +8111,8 @@ packages: resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} engines: {node: '>=10'} - tar@7.2.0: - resolution: {integrity: sha512-hctwP0Nb4AB60bj8WQgRYaMOuJYRAPMGiQUAotms5igN8ppfQM+IvjQ5HcKu1MaZh2Wy2KWVTe563Yj8dfc14w==} + tar@7.4.0: + resolution: {integrity: sha512-XQs0S8fuAkQWuqhDeCdMlJXDX80D7EOVLDPVFkna9yQfzS+PHKgfxcei0jf6/+QAWcjqrnC8uM3fSAnrQl+XYg==} engines: {node: '>=18'} terser-webpack-plugin@5.3.10: @@ -7979,6 +8344,11 @@ packages: engines: {node: '>=14.17'} hasBin: true + typescript@5.5.2: + resolution: {integrity: sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==} + engines: {node: '>=14.17'} + hasBin: true + ua-parser-js@1.0.38: resolution: {integrity: sha512-Aq5ppTOfvrCMgAPneW1HfWj66Xi7XL+/mIy996R1/CLS/rcyJQm6QZdsKrUeivDFQ+Oc9Wyuwor8Ze8peEoUoQ==} @@ -8058,8 +8428,8 @@ packages: peerDependencies: react: '>=16.13' - use-intl@3.15.0: - resolution: {integrity: sha512-vPCa7nbmH3RLfsy4pLLag8PvlzxQYHd5CkPE/AobkX72NE7JjhXk9UFtuFmD1UWiwQzM7njysnuwQlhtV6vV2Q==} + use-intl@3.15.2: + resolution: {integrity: sha512-dYq8bMjFXwtsZti2j6Z8KeIKV0XeNXmUX9M6/8wShOk9iYd2+0rMyAgJ4hbu/vDKDoOpAWAXcRKhqGz6kpnzOQ==} peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -8152,8 +8522,8 @@ packages: webpack-cli: optional: true - webpack@5.92.0: - resolution: {integrity: sha512-Bsw2X39MYIgxouNATyVpCNVWBCuUwDgWtN78g6lSdPJRLaQ/PUVm/oXcaRAyY/sMFoKFQrsPeqvTizWtq7QPCA==} + webpack@5.92.1: + resolution: {integrity: sha512-JECQ7IwJb+7fgUFBlrJzbyu3GEuNBcdqr1LD7IbSzwkSmIevTm8PF+wej3Oxuz/JFBUZ6O1o43zsPkwm1C4TmA==} engines: {node: '>=10.13.0'} hasBin: true peerDependencies: @@ -8242,18 +8612,6 @@ packages: utf-8-validate: optional: true - ws@8.11.0: - resolution: {integrity: sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==} - engines: {node: '>=10.0.0'} - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: ^5.0.2 - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - ws@8.16.0: resolution: {integrity: sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==} engines: {node: '>=10.0.0'} @@ -8567,7 +8925,7 @@ snapshots: '@babel/helper-compilation-targets': 7.24.7 '@babel/helper-module-transforms': 7.24.7(@babel/core@7.24.5) '@babel/helpers': 7.24.7 - '@babel/parser': 7.24.7 + '@babel/parser': 7.24.5 '@babel/template': 7.24.7 '@babel/traverse': 7.24.7 '@babel/types': 7.24.7 @@ -9346,11 +9704,6 @@ snapshots: '@floating-ui/utils@0.2.2': {} - '@formatjs/ecma402-abstract@1.18.3': - dependencies: - '@formatjs/intl-localematcher': 0.5.4 - tslib: 2.6.3 - '@formatjs/ecma402-abstract@2.0.0': dependencies: '@formatjs/intl-localematcher': 0.5.4 @@ -9385,7 +9738,7 @@ snapshots: graphql: 16.8.2 tslib: 2.6.3 - '@graphql-codegen/cli@5.0.2(@types/node@20.14.2)(graphql@16.8.2)(typescript@5.4.5)': + '@graphql-codegen/cli@5.0.2(@types/node@20.14.7)(graphql@16.8.2)(typescript@5.5.2)': dependencies: '@babel/generator': 7.24.7 '@babel/template': 7.24.7 @@ -9396,20 +9749,20 @@ snapshots: '@graphql-tools/apollo-engine-loader': 8.0.1(graphql@16.8.2) '@graphql-tools/code-file-loader': 8.1.2(graphql@16.8.2) '@graphql-tools/git-loader': 8.0.6(graphql@16.8.2) - '@graphql-tools/github-loader': 8.0.1(@types/node@20.14.2)(graphql@16.8.2) + '@graphql-tools/github-loader': 8.0.1(@types/node@20.14.7)(graphql@16.8.2) '@graphql-tools/graphql-file-loader': 8.0.1(graphql@16.8.2) '@graphql-tools/json-file-loader': 8.0.1(graphql@16.8.2) '@graphql-tools/load': 8.0.2(graphql@16.8.2) - '@graphql-tools/prisma-loader': 8.0.4(@types/node@20.14.2)(graphql@16.8.2) - '@graphql-tools/url-loader': 8.0.2(@types/node@20.14.2)(graphql@16.8.2) + '@graphql-tools/prisma-loader': 8.0.4(@types/node@20.14.7)(graphql@16.8.2) + '@graphql-tools/url-loader': 8.0.2(@types/node@20.14.7)(graphql@16.8.2) '@graphql-tools/utils': 10.2.2(graphql@16.8.2) '@whatwg-node/fetch': 0.8.8 chalk: 4.1.2 - cosmiconfig: 8.3.6(typescript@5.4.5) + cosmiconfig: 8.3.6(typescript@5.5.2) debounce: 1.2.1 detect-indent: 6.1.0 graphql: 16.8.2 - graphql-config: 5.0.3(@types/node@20.14.2)(graphql@16.8.2)(typescript@5.4.5) + graphql-config: 5.0.3(@types/node@20.14.7)(graphql@16.8.2)(typescript@5.5.2) inquirer: 8.2.6 is-glob: 4.0.3 jiti: 1.21.6 @@ -9612,14 +9965,14 @@ snapshots: - bufferutil - utf-8-validate - '@graphql-tools/executor-http@1.0.9(@types/node@20.14.2)(graphql@16.8.2)': + '@graphql-tools/executor-http@1.0.9(@types/node@20.14.7)(graphql@16.8.2)': dependencies: '@graphql-tools/utils': 10.2.2(graphql@16.8.2) '@repeaterjs/repeater': 3.0.6 '@whatwg-node/fetch': 0.9.18 extract-files: 11.0.0 graphql: 16.8.2 - meros: 1.3.0(@types/node@20.14.2) + meros: 1.3.0(@types/node@20.14.7) tslib: 2.6.3 value-or-promise: 1.0.12 transitivePeerDependencies: @@ -9658,10 +10011,10 @@ snapshots: transitivePeerDependencies: - supports-color - '@graphql-tools/github-loader@8.0.1(@types/node@20.14.2)(graphql@16.8.2)': + '@graphql-tools/github-loader@8.0.1(@types/node@20.14.7)(graphql@16.8.2)': dependencies: '@ardatan/sync-fetch': 0.0.1 - '@graphql-tools/executor-http': 1.0.9(@types/node@20.14.2)(graphql@16.8.2) + '@graphql-tools/executor-http': 1.0.9(@types/node@20.14.7)(graphql@16.8.2) '@graphql-tools/graphql-tag-pluck': 8.3.1(graphql@16.8.2) '@graphql-tools/utils': 10.2.2(graphql@16.8.2) '@whatwg-node/fetch': 0.9.18 @@ -9741,9 +10094,9 @@ snapshots: graphql: 16.8.2 tslib: 2.6.3 - '@graphql-tools/prisma-loader@8.0.4(@types/node@20.14.2)(graphql@16.8.2)': + '@graphql-tools/prisma-loader@8.0.4(@types/node@20.14.7)(graphql@16.8.2)': dependencies: - '@graphql-tools/url-loader': 8.0.2(@types/node@20.14.2)(graphql@16.8.2) + '@graphql-tools/url-loader': 8.0.2(@types/node@20.14.7)(graphql@16.8.2) '@graphql-tools/utils': 10.2.2(graphql@16.8.2) '@types/js-yaml': 4.0.9 '@whatwg-node/fetch': 0.9.18 @@ -9754,7 +10107,7 @@ snapshots: graphql-request: 6.1.0(graphql@16.8.2) http-proxy-agent: 7.0.2 https-proxy-agent: 7.0.4 - jose: 5.4.0 + jose: 5.4.1 js-yaml: 4.1.0 lodash: 4.17.21 scuid: 1.1.0 @@ -9801,12 +10154,12 @@ snapshots: tslib: 2.6.3 value-or-promise: 1.0.12 - '@graphql-tools/url-loader@8.0.2(@types/node@20.14.2)(graphql@16.8.2)': + '@graphql-tools/url-loader@8.0.2(@types/node@20.14.7)(graphql@16.8.2)': dependencies: '@ardatan/sync-fetch': 0.0.1 '@graphql-tools/delegate': 10.0.11(graphql@16.8.2) '@graphql-tools/executor-graphql-ws': 1.1.2(graphql@16.8.2) - '@graphql-tools/executor-http': 1.0.9(@types/node@20.14.2)(graphql@16.8.2) + '@graphql-tools/executor-http': 1.0.9(@types/node@20.14.7)(graphql@16.8.2) '@graphql-tools/executor-legacy-ws': 1.0.6(graphql@16.8.2) '@graphql-tools/utils': 10.2.2(graphql@16.8.2) '@graphql-tools/wrap': 10.0.5(graphql@16.8.2) @@ -10059,7 +10412,7 @@ snapshots: lodash.omit: 4.5.0 tslib: 2.6.2 - '@nestjs/cli@10.3.2(@swc/cli@0.3.12(@swc/core@1.6.1(@swc/helpers@0.5.11))(chokidar@3.6.0))(@swc/core@1.6.1(@swc/helpers@0.5.11))': + '@nestjs/cli@10.3.2(@swc/cli@0.3.12(@swc/core@1.6.3(@swc/helpers@0.5.11))(chokidar@3.6.0))(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)': dependencies: '@angular-devkit/core': 17.1.2(chokidar@3.6.0) '@angular-devkit/schematics': 17.1.2(chokidar@3.6.0) @@ -10069,7 +10422,7 @@ snapshots: chokidar: 3.6.0 cli-table3: 0.6.3 commander: 4.1.1 - fork-ts-checker-webpack-plugin: 9.0.2(typescript@5.3.3)(webpack@5.90.1(@swc/core@1.6.1(@swc/helpers@0.5.11))) + fork-ts-checker-webpack-plugin: 9.0.2(typescript@5.3.3)(webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)) glob: 10.3.10 inquirer: 8.2.6 node-emoji: 1.11.0 @@ -10081,11 +10434,11 @@ snapshots: tsconfig-paths: 4.2.0 tsconfig-paths-webpack-plugin: 4.1.0 typescript: 5.3.3 - webpack: 5.90.1(@swc/core@1.6.1(@swc/helpers@0.5.11)) + webpack: 5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12) webpack-node-externals: 3.0.0 optionalDependencies: - '@swc/cli': 0.3.12(@swc/core@1.6.1(@swc/helpers@0.5.11))(chokidar@3.6.0) - '@swc/core': 1.6.1(@swc/helpers@0.5.11) + '@swc/cli': 0.3.12(@swc/core@1.6.3(@swc/helpers@0.5.11))(chokidar@3.6.0) + '@swc/core': 1.6.3(@swc/helpers@0.5.11) transitivePeerDependencies: - esbuild - uglify-js @@ -10199,14 +10552,14 @@ snapshots: transitivePeerDependencies: - chokidar - '@nestjs/schematics@10.1.1(chokidar@3.6.0)(typescript@5.4.5)': + '@nestjs/schematics@10.1.1(chokidar@3.6.0)(typescript@5.5.2)': dependencies: '@angular-devkit/core': 17.1.2(chokidar@3.6.0) '@angular-devkit/schematics': 17.1.2(chokidar@3.6.0) comment-json: 4.2.3 jsonc-parser: 3.2.1 pluralize: 8.0.0 - typescript: 5.4.5 + typescript: 5.5.2 transitivePeerDependencies: - chokidar @@ -10229,7 +10582,7 @@ snapshots: tslib: 2.6.2 optional: true - '@next/bundle-analyzer@15.0.0-canary.35': + '@next/bundle-analyzer@15.0.0-rc.0': dependencies: webpack-bundle-analyzer: 4.10.1 transitivePeerDependencies: @@ -10240,7 +10593,7 @@ snapshots: '@next/env@15.0.0-canary.28': {} - '@next/env@15.0.0-canary.35': {} + '@next/env@15.0.0-rc.0': {} '@next/eslint-plugin-next@15.0.0-canary.28': dependencies: @@ -10252,7 +10605,7 @@ snapshots: '@next/swc-darwin-arm64@15.0.0-canary.28': optional: true - '@next/swc-darwin-arm64@15.0.0-canary.35': + '@next/swc-darwin-arm64@15.0.0-rc.0': optional: true '@next/swc-darwin-x64@14.1.4': @@ -10261,7 +10614,7 @@ snapshots: '@next/swc-darwin-x64@15.0.0-canary.28': optional: true - '@next/swc-darwin-x64@15.0.0-canary.35': + '@next/swc-darwin-x64@15.0.0-rc.0': optional: true '@next/swc-linux-arm64-gnu@14.1.4': @@ -10270,7 +10623,7 @@ snapshots: '@next/swc-linux-arm64-gnu@15.0.0-canary.28': optional: true - '@next/swc-linux-arm64-gnu@15.0.0-canary.35': + '@next/swc-linux-arm64-gnu@15.0.0-rc.0': optional: true '@next/swc-linux-arm64-musl@14.1.4': @@ -10279,7 +10632,7 @@ snapshots: '@next/swc-linux-arm64-musl@15.0.0-canary.28': optional: true - '@next/swc-linux-arm64-musl@15.0.0-canary.35': + '@next/swc-linux-arm64-musl@15.0.0-rc.0': optional: true '@next/swc-linux-x64-gnu@14.1.4': @@ -10288,7 +10641,7 @@ snapshots: '@next/swc-linux-x64-gnu@15.0.0-canary.28': optional: true - '@next/swc-linux-x64-gnu@15.0.0-canary.35': + '@next/swc-linux-x64-gnu@15.0.0-rc.0': optional: true '@next/swc-linux-x64-musl@14.1.4': @@ -10297,7 +10650,7 @@ snapshots: '@next/swc-linux-x64-musl@15.0.0-canary.28': optional: true - '@next/swc-linux-x64-musl@15.0.0-canary.35': + '@next/swc-linux-x64-musl@15.0.0-rc.0': optional: true '@next/swc-win32-arm64-msvc@14.1.4': @@ -10306,7 +10659,7 @@ snapshots: '@next/swc-win32-arm64-msvc@15.0.0-canary.28': optional: true - '@next/swc-win32-arm64-msvc@15.0.0-canary.35': + '@next/swc-win32-arm64-msvc@15.0.0-rc.0': optional: true '@next/swc-win32-ia32-msvc@14.1.4': @@ -10315,7 +10668,7 @@ snapshots: '@next/swc-win32-ia32-msvc@15.0.0-canary.28': optional: true - '@next/swc-win32-ia32-msvc@15.0.0-canary.35': + '@next/swc-win32-ia32-msvc@15.0.0-rc.0': optional: true '@next/swc-win32-x64-msvc@14.1.4': @@ -10324,7 +10677,7 @@ snapshots: '@next/swc-win32-x64-msvc@15.0.0-canary.28': optional: true - '@next/swc-win32-x64-msvc@15.0.0-canary.35': + '@next/swc-win32-x64-msvc@15.0.0-rc.0': optional: true '@nodelib/fs.scandir@2.1.5': @@ -10401,41 +10754,39 @@ snapshots: '@radix-ui/colors@1.0.1': {} - '@radix-ui/number@1.0.1': - dependencies: - '@babel/runtime': 7.24.7 + '@radix-ui/number@1.1.0': {} '@radix-ui/primitive@1.0.1': dependencies: '@babel/runtime': 7.24.7 - '@radix-ui/react-accordion@1.1.2(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': + '@radix-ui/primitive@1.1.0': {} + + '@radix-ui/react-accordion@1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': dependencies: - '@babel/runtime': 7.24.7 - '@radix-ui/primitive': 1.0.1 - '@radix-ui/react-collapsible': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-collection': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-context': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-direction': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-id': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/primitive': 1.1.0 + '@radix-ui/react-collapsible': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-collection': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-direction': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-id': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) react: 19.0.0-rc.0 react-dom: 19.0.0-rc.0(react@19.0.0-rc.0) optionalDependencies: '@types/react': 18.3.3 '@types/react-dom': 18.3.0 - '@radix-ui/react-alert-dialog@1.0.5(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': + '@radix-ui/react-alert-dialog@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': dependencies: - '@babel/runtime': 7.24.7 - '@radix-ui/primitive': 1.0.1 - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-context': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-dialog': 1.0.5(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-slot': 1.0.2(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/primitive': 1.1.0 + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-dialog': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-slot': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) react: 19.0.0-rc.0 react-dom: 19.0.0-rc.0(react@19.0.0-rc.0) optionalDependencies: @@ -10452,27 +10803,25 @@ snapshots: '@types/react': 18.3.3 '@types/react-dom': 18.3.0 - '@radix-ui/react-arrow@1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': + '@radix-ui/react-arrow@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': dependencies: - '@babel/runtime': 7.24.7 - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) react: 19.0.0-rc.0 react-dom: 19.0.0-rc.0(react@19.0.0-rc.0) optionalDependencies: '@types/react': 18.3.3 '@types/react-dom': 18.3.0 - '@radix-ui/react-checkbox@1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': + '@radix-ui/react-checkbox@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': dependencies: - '@babel/runtime': 7.24.7 - '@radix-ui/primitive': 1.0.1 - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-context': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-presence': 1.0.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-use-previous': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-use-size': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/primitive': 1.1.0 + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-presence': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-use-previous': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-use-size': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) react: 19.0.0-rc.0 react-dom: 19.0.0-rc.0(react@19.0.0-rc.0) optionalDependencies: @@ -10496,17 +10845,16 @@ snapshots: '@types/react': 18.3.3 '@types/react-dom': 18.3.0 - '@radix-ui/react-collapsible@1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': + '@radix-ui/react-collapsible@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': dependencies: - '@babel/runtime': 7.24.7 - '@radix-ui/primitive': 1.0.1 - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-context': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-id': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-presence': 1.0.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/primitive': 1.1.0 + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-id': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-presence': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) react: 19.0.0-rc.0 react-dom: 19.0.0-rc.0(react@19.0.0-rc.0) optionalDependencies: @@ -10526,13 +10874,12 @@ snapshots: '@types/react': 18.3.3 '@types/react-dom': 18.3.0 - '@radix-ui/react-collection@1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': + '@radix-ui/react-collection@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': dependencies: - '@babel/runtime': 7.24.7 - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-context': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-slot': 1.0.2(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-slot': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) react: 19.0.0-rc.0 react-dom: 19.0.0-rc.0(react@19.0.0-rc.0) optionalDependencies: @@ -10553,6 +10900,12 @@ snapshots: optionalDependencies: '@types/react': 18.3.3 + '@radix-ui/react-compose-refs@1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0)': + dependencies: + react: 19.0.0-rc.0 + optionalDependencies: + '@types/react': 18.3.3 + '@radix-ui/react-context@1.0.1(@types/react@18.3.3)(react@18.3.1)': dependencies: '@babel/runtime': 7.24.7 @@ -10567,6 +10920,12 @@ snapshots: optionalDependencies: '@types/react': 18.3.3 + '@radix-ui/react-context@1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0)': + dependencies: + react: 19.0.0-rc.0 + optionalDependencies: + '@types/react': 18.3.3 + '@radix-ui/react-dialog@1.0.5(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': dependencies: '@babel/runtime': 7.24.7 @@ -10590,6 +10949,28 @@ snapshots: '@types/react': 18.3.3 '@types/react-dom': 18.3.0 + '@radix-ui/react-dialog@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': + dependencies: + '@radix-ui/primitive': 1.1.0 + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-dismissable-layer': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-focus-guards': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-focus-scope': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-id': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-portal': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-presence': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-slot': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + aria-hidden: 1.2.4 + react: 19.0.0-rc.0 + react-dom: 19.0.0-rc.0(react@19.0.0-rc.0) + react-remove-scroll: 2.5.7(@types/react@18.3.3)(react@19.0.0-rc.0) + optionalDependencies: + '@types/react': 18.3.3 + '@types/react-dom': 18.3.0 + '@radix-ui/react-direction@1.0.1(@types/react@18.3.3)(react@18.3.1)': dependencies: '@babel/runtime': 7.24.7 @@ -10597,9 +10978,8 @@ snapshots: optionalDependencies: '@types/react': 18.3.3 - '@radix-ui/react-direction@1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0)': + '@radix-ui/react-direction@1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0)': dependencies: - '@babel/runtime': 7.24.7 react: 19.0.0-rc.0 optionalDependencies: '@types/react': 18.3.3 @@ -10632,16 +11012,28 @@ snapshots: '@types/react': 18.3.3 '@types/react-dom': 18.3.0 - '@radix-ui/react-dropdown-menu@2.0.6(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': + '@radix-ui/react-dismissable-layer@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': dependencies: - '@babel/runtime': 7.24.7 - '@radix-ui/primitive': 1.0.1 - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-context': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-id': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-menu': 2.0.6(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/primitive': 1.1.0 + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-use-escape-keydown': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + react: 19.0.0-rc.0 + react-dom: 19.0.0-rc.0(react@19.0.0-rc.0) + optionalDependencies: + '@types/react': 18.3.3 + '@types/react-dom': 18.3.0 + + '@radix-ui/react-dropdown-menu@2.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': + dependencies: + '@radix-ui/primitive': 1.1.0 + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-id': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-menu': 2.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) react: 19.0.0-rc.0 react-dom: 19.0.0-rc.0(react@19.0.0-rc.0) optionalDependencies: @@ -10662,6 +11054,12 @@ snapshots: optionalDependencies: '@types/react': 18.3.3 + '@radix-ui/react-focus-guards@1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0)': + dependencies: + react: 19.0.0-rc.0 + optionalDependencies: + '@types/react': 18.3.3 + '@radix-ui/react-focus-scope@1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@babel/runtime': 7.24.7 @@ -10686,18 +11084,28 @@ snapshots: '@types/react': 18.3.3 '@types/react-dom': 18.3.0 - '@radix-ui/react-hover-card@1.0.7(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': + '@radix-ui/react-focus-scope@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': dependencies: - '@babel/runtime': 7.24.7 - '@radix-ui/primitive': 1.0.1 - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-context': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-dismissable-layer': 1.0.5(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-popper': 1.1.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-portal': 1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-presence': 1.0.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + react: 19.0.0-rc.0 + react-dom: 19.0.0-rc.0(react@19.0.0-rc.0) + optionalDependencies: + '@types/react': 18.3.3 + '@types/react-dom': 18.3.0 + + '@radix-ui/react-hover-card@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': + dependencies: + '@radix-ui/primitive': 1.1.0 + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-dismissable-layer': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-popper': 1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-portal': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-presence': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) react: 19.0.0-rc.0 react-dom: 19.0.0-rc.0(react@19.0.0-rc.0) optionalDependencies: @@ -10716,68 +11124,72 @@ snapshots: optionalDependencies: '@types/react': 18.3.3 - '@radix-ui/react-id@1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0)': + '@radix-ui/react-id@1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0)': + dependencies: + '@babel/runtime': 7.24.7 + '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) + react: 19.0.0-rc.0 + optionalDependencies: + '@types/react': 18.3.3 + + '@radix-ui/react-id@1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0)': dependencies: - '@babel/runtime': 7.24.7 - '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) react: 19.0.0-rc.0 optionalDependencies: '@types/react': 18.3.3 - '@radix-ui/react-label@2.0.2(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': + '@radix-ui/react-label@2.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': dependencies: - '@babel/runtime': 7.24.7 - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) react: 19.0.0-rc.0 react-dom: 19.0.0-rc.0(react@19.0.0-rc.0) optionalDependencies: '@types/react': 18.3.3 '@types/react-dom': 18.3.0 - '@radix-ui/react-menu@2.0.6(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': - dependencies: - '@babel/runtime': 7.24.7 - '@radix-ui/primitive': 1.0.1 - '@radix-ui/react-collection': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-context': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-direction': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-dismissable-layer': 1.0.5(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-focus-guards': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-focus-scope': 1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-id': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-popper': 1.1.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-portal': 1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-presence': 1.0.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-roving-focus': 1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-slot': 1.0.2(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-menu@2.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': + dependencies: + '@radix-ui/primitive': 1.1.0 + '@radix-ui/react-collection': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-direction': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-dismissable-layer': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-focus-guards': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-focus-scope': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-id': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-popper': 1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-portal': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-presence': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-roving-focus': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-slot': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) aria-hidden: 1.2.4 react: 19.0.0-rc.0 react-dom: 19.0.0-rc.0(react@19.0.0-rc.0) - react-remove-scroll: 2.5.5(@types/react@18.3.3)(react@19.0.0-rc.0) + react-remove-scroll: 2.5.7(@types/react@18.3.3)(react@19.0.0-rc.0) optionalDependencies: '@types/react': 18.3.3 '@types/react-dom': 18.3.0 - '@radix-ui/react-navigation-menu@1.1.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': - dependencies: - '@babel/runtime': 7.24.7 - '@radix-ui/primitive': 1.0.1 - '@radix-ui/react-collection': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-context': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-direction': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-dismissable-layer': 1.0.5(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-id': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-presence': 1.0.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-use-previous': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-visually-hidden': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-navigation-menu@1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': + dependencies: + '@radix-ui/primitive': 1.1.0 + '@radix-ui/react-collection': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-direction': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-dismissable-layer': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-id': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-presence': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-use-previous': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-visually-hidden': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) react: 19.0.0-rc.0 react-dom: 19.0.0-rc.0(react@19.0.0-rc.0) optionalDependencies: @@ -10808,26 +11220,25 @@ snapshots: '@types/react': 18.3.3 '@types/react-dom': 18.3.0 - '@radix-ui/react-popover@1.0.7(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': - dependencies: - '@babel/runtime': 7.24.7 - '@radix-ui/primitive': 1.0.1 - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-context': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-dismissable-layer': 1.0.5(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-focus-guards': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-focus-scope': 1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-id': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-popper': 1.1.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-portal': 1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-presence': 1.0.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-slot': 1.0.2(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-popover@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': + dependencies: + '@radix-ui/primitive': 1.1.0 + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-dismissable-layer': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-focus-guards': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-focus-scope': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-id': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-popper': 1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-portal': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-presence': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-slot': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) aria-hidden: 1.2.4 react: 19.0.0-rc.0 react-dom: 19.0.0-rc.0(react@19.0.0-rc.0) - react-remove-scroll: 2.5.5(@types/react@18.3.3)(react@19.0.0-rc.0) + react-remove-scroll: 2.5.7(@types/react@18.3.3)(react@19.0.0-rc.0) optionalDependencies: '@types/react': 18.3.3 '@types/react-dom': 18.3.0 @@ -10851,19 +11262,18 @@ snapshots: '@types/react': 18.3.3 '@types/react-dom': 18.3.0 - '@radix-ui/react-popper@1.1.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': + '@radix-ui/react-popper@1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': dependencies: - '@babel/runtime': 7.24.7 '@floating-ui/react-dom': 2.1.0(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-arrow': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-context': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-use-rect': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-use-size': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/rect': 1.0.1 + '@radix-ui/react-arrow': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-use-rect': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-use-size': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/rect': 1.1.0 react: 19.0.0-rc.0 react-dom: 19.0.0-rc.0(react@19.0.0-rc.0) optionalDependencies: @@ -10890,6 +11300,15 @@ snapshots: '@types/react': 18.3.3 '@types/react-dom': 18.3.0 + '@radix-ui/react-portal@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': + dependencies: + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + react: 19.0.0-rc.0 + react-dom: 19.0.0-rc.0(react@19.0.0-rc.0) + optionalDependencies: + '@types/react': 18.3.3 + '@types/react-dom': 18.3.0 + '@radix-ui/react-presence@1.0.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@babel/runtime': 7.24.7 @@ -10912,6 +11331,16 @@ snapshots: '@types/react': 18.3.3 '@types/react-dom': 18.3.0 + '@radix-ui/react-presence@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': + dependencies: + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + react: 19.0.0-rc.0 + react-dom: 19.0.0-rc.0(react@19.0.0-rc.0) + optionalDependencies: + '@types/react': 18.3.3 + '@types/react-dom': 18.3.0 + '@radix-ui/react-primitive@1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@babel/runtime': 7.24.7 @@ -10932,30 +11361,37 @@ snapshots: '@types/react': 18.3.3 '@types/react-dom': 18.3.0 - '@radix-ui/react-progress@1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': + '@radix-ui/react-primitive@2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': dependencies: - '@babel/runtime': 7.24.7 - '@radix-ui/react-context': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-slot': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) react: 19.0.0-rc.0 react-dom: 19.0.0-rc.0(react@19.0.0-rc.0) optionalDependencies: '@types/react': 18.3.3 '@types/react-dom': 18.3.0 - '@radix-ui/react-radio-group@1.1.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': + '@radix-ui/react-progress@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': dependencies: - '@babel/runtime': 7.24.7 - '@radix-ui/primitive': 1.0.1 - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-context': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-direction': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-presence': 1.0.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-roving-focus': 1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-use-previous': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-use-size': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + react: 19.0.0-rc.0 + react-dom: 19.0.0-rc.0(react@19.0.0-rc.0) + optionalDependencies: + '@types/react': 18.3.3 + '@types/react-dom': 18.3.0 + + '@radix-ui/react-radio-group@1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': + dependencies: + '@radix-ui/primitive': 1.1.0 + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-direction': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-presence': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-roving-focus': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-use-previous': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-use-size': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) react: 19.0.0-rc.0 react-dom: 19.0.0-rc.0(react@19.0.0-rc.0) optionalDependencies: @@ -10980,58 +11416,55 @@ snapshots: '@types/react': 18.3.3 '@types/react-dom': 18.3.0 - '@radix-ui/react-roving-focus@1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': - dependencies: - '@babel/runtime': 7.24.7 - '@radix-ui/primitive': 1.0.1 - '@radix-ui/react-collection': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-context': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-direction': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-id': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-roving-focus@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': + dependencies: + '@radix-ui/primitive': 1.1.0 + '@radix-ui/react-collection': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-direction': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-id': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) react: 19.0.0-rc.0 react-dom: 19.0.0-rc.0(react@19.0.0-rc.0) optionalDependencies: '@types/react': 18.3.3 '@types/react-dom': 18.3.0 - '@radix-ui/react-select@2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': - dependencies: - '@babel/runtime': 7.24.7 - '@radix-ui/number': 1.0.1 - '@radix-ui/primitive': 1.0.1 - '@radix-ui/react-collection': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-context': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-direction': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-dismissable-layer': 1.0.5(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-focus-guards': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-focus-scope': 1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-id': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-popper': 1.1.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-portal': 1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-slot': 1.0.2(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-use-previous': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-visually-hidden': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-select@2.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': + dependencies: + '@radix-ui/number': 1.1.0 + '@radix-ui/primitive': 1.1.0 + '@radix-ui/react-collection': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-direction': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-dismissable-layer': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-focus-guards': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-focus-scope': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-id': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-popper': 1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-portal': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-slot': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-use-previous': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-visually-hidden': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) aria-hidden: 1.2.4 react: 19.0.0-rc.0 react-dom: 19.0.0-rc.0(react@19.0.0-rc.0) - react-remove-scroll: 2.5.5(@types/react@18.3.3)(react@19.0.0-rc.0) + react-remove-scroll: 2.5.7(@types/react@18.3.3)(react@19.0.0-rc.0) optionalDependencies: '@types/react': 18.3.3 '@types/react-dom': 18.3.0 - '@radix-ui/react-separator@1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': + '@radix-ui/react-separator@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': dependencies: - '@babel/runtime': 7.24.7 - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) react: 19.0.0-rc.0 react-dom: 19.0.0-rc.0(react@19.0.0-rc.0) optionalDependencies: @@ -11054,33 +11487,38 @@ snapshots: optionalDependencies: '@types/react': 18.3.3 - '@radix-ui/react-switch@1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': + '@radix-ui/react-slot@1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0)': dependencies: - '@babel/runtime': 7.24.7 - '@radix-ui/primitive': 1.0.1 - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-context': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-use-previous': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-use-size': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + react: 19.0.0-rc.0 + optionalDependencies: + '@types/react': 18.3.3 + + '@radix-ui/react-switch@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': + dependencies: + '@radix-ui/primitive': 1.1.0 + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-use-previous': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-use-size': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) react: 19.0.0-rc.0 react-dom: 19.0.0-rc.0(react@19.0.0-rc.0) optionalDependencies: '@types/react': 18.3.3 '@types/react-dom': 18.3.0 - '@radix-ui/react-tabs@1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': + '@radix-ui/react-tabs@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': dependencies: - '@babel/runtime': 7.24.7 - '@radix-ui/primitive': 1.0.1 - '@radix-ui/react-context': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-direction': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-id': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-presence': 1.0.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-roving-focus': 1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/primitive': 1.1.0 + '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-direction': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-id': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-presence': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-roving-focus': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) react: 19.0.0-rc.0 react-dom: 19.0.0-rc.0(react@19.0.0-rc.0) optionalDependencies: @@ -11103,16 +11541,15 @@ snapshots: '@types/react': 18.3.3 '@types/react-dom': 18.3.0 - '@radix-ui/react-toggle-group@1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': + '@radix-ui/react-toggle-group@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': dependencies: - '@babel/runtime': 7.24.7 - '@radix-ui/primitive': 1.0.1 - '@radix-ui/react-context': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-direction': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-roving-focus': 1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-toggle': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/primitive': 1.1.0 + '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-direction': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-roving-focus': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-toggle': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) react: 19.0.0-rc.0 react-dom: 19.0.0-rc.0(react@19.0.0-rc.0) optionalDependencies: @@ -11131,28 +11568,26 @@ snapshots: '@types/react': 18.3.3 '@types/react-dom': 18.3.0 - '@radix-ui/react-toggle@1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': + '@radix-ui/react-toggle@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': dependencies: - '@babel/runtime': 7.24.7 - '@radix-ui/primitive': 1.0.1 - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/primitive': 1.1.0 + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) react: 19.0.0-rc.0 react-dom: 19.0.0-rc.0(react@19.0.0-rc.0) optionalDependencies: '@types/react': 18.3.3 '@types/react-dom': 18.3.0 - '@radix-ui/react-toolbar@1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': + '@radix-ui/react-toolbar@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': dependencies: - '@babel/runtime': 7.24.7 - '@radix-ui/primitive': 1.0.1 - '@radix-ui/react-context': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-direction': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-roving-focus': 1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-separator': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-toggle-group': 1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/primitive': 1.1.0 + '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-direction': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-roving-focus': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-separator': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-toggle-group': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) react: 19.0.0-rc.0 react-dom: 19.0.0-rc.0(react@19.0.0-rc.0) optionalDependencies: @@ -11180,21 +11615,20 @@ snapshots: '@types/react': 18.3.3 '@types/react-dom': 18.3.0 - '@radix-ui/react-tooltip@1.0.7(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': - dependencies: - '@babel/runtime': 7.24.7 - '@radix-ui/primitive': 1.0.1 - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-context': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-dismissable-layer': 1.0.5(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-id': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-popper': 1.1.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-portal': 1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-presence': 1.0.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) - '@radix-ui/react-slot': 1.0.2(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) - '@radix-ui/react-visually-hidden': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-tooltip@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': + dependencies: + '@radix-ui/primitive': 1.1.0 + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-dismissable-layer': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-id': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-popper': 1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-portal': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-presence': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-slot': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-visually-hidden': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) react: 19.0.0-rc.0 react-dom: 19.0.0-rc.0(react@19.0.0-rc.0) optionalDependencies: @@ -11215,6 +11649,12 @@ snapshots: optionalDependencies: '@types/react': 18.3.3 + '@radix-ui/react-use-callback-ref@1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0)': + dependencies: + react: 19.0.0-rc.0 + optionalDependencies: + '@types/react': 18.3.3 + '@radix-ui/react-use-controllable-state@1.0.1(@types/react@18.3.3)(react@18.3.1)': dependencies: '@babel/runtime': 7.24.7 @@ -11231,6 +11671,13 @@ snapshots: optionalDependencies: '@types/react': 18.3.3 + '@radix-ui/react-use-controllable-state@1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0)': + dependencies: + '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + react: 19.0.0-rc.0 + optionalDependencies: + '@types/react': 18.3.3 + '@radix-ui/react-use-escape-keydown@1.0.3(@types/react@18.3.3)(react@18.3.1)': dependencies: '@babel/runtime': 7.24.7 @@ -11247,6 +11694,13 @@ snapshots: optionalDependencies: '@types/react': 18.3.3 + '@radix-ui/react-use-escape-keydown@1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0)': + dependencies: + '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) + react: 19.0.0-rc.0 + optionalDependencies: + '@types/react': 18.3.3 + '@radix-ui/react-use-layout-effect@1.0.1(@types/react@18.3.3)(react@18.3.1)': dependencies: '@babel/runtime': 7.24.7 @@ -11261,9 +11715,14 @@ snapshots: optionalDependencies: '@types/react': 18.3.3 - '@radix-ui/react-use-previous@1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0)': + '@radix-ui/react-use-layout-effect@1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0)': + dependencies: + react: 19.0.0-rc.0 + optionalDependencies: + '@types/react': 18.3.3 + + '@radix-ui/react-use-previous@1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0)': dependencies: - '@babel/runtime': 7.24.7 react: 19.0.0-rc.0 optionalDependencies: '@types/react': 18.3.3 @@ -11276,10 +11735,9 @@ snapshots: optionalDependencies: '@types/react': 18.3.3 - '@radix-ui/react-use-rect@1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0)': + '@radix-ui/react-use-rect@1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0)': dependencies: - '@babel/runtime': 7.24.7 - '@radix-ui/rect': 1.0.1 + '@radix-ui/rect': 1.1.0 react: 19.0.0-rc.0 optionalDependencies: '@types/react': 18.3.3 @@ -11292,10 +11750,9 @@ snapshots: optionalDependencies: '@types/react': 18.3.3 - '@radix-ui/react-use-size@1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0)': + '@radix-ui/react-use-size@1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0)': dependencies: - '@babel/runtime': 7.24.7 - '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.3.3)(react@19.0.0-rc.0) + '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.3)(react@19.0.0-rc.0) react: 19.0.0-rc.0 optionalDependencies: '@types/react': 18.3.3 @@ -11310,10 +11767,9 @@ snapshots: '@types/react': 18.3.3 '@types/react-dom': 18.3.0 - '@radix-ui/react-visually-hidden@1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': + '@radix-ui/react-visually-hidden@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)': dependencies: - '@babel/runtime': 7.24.7 - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) react: 19.0.0-rc.0 react-dom: 19.0.0-rc.0(react@19.0.0-rc.0) optionalDependencies: @@ -11324,6 +11780,8 @@ snapshots: dependencies: '@babel/runtime': 7.24.7 + '@radix-ui/rect@1.1.0': {} + '@react-email/body@0.0.8(react@18.3.1)': dependencies: react: 18.3.1 @@ -11454,15 +11912,15 @@ snapshots: '@socket.io/component-emitter@3.1.2': {} - '@swc/cli@0.3.12(@swc/core@1.6.1(@swc/helpers@0.5.11))(chokidar@3.6.0)': + '@swc/cli@0.3.12(@swc/core@1.6.3(@swc/helpers@0.5.11))(chokidar@3.6.0)': dependencies: '@mole-inc/bin-wrapper': 8.0.1 - '@swc/core': 1.6.1(@swc/helpers@0.5.11) + '@swc/core': 1.6.3(@swc/helpers@0.5.11) '@swc/counter': 0.1.3 commander: 8.3.0 fast-glob: 3.3.2 minimatch: 9.0.4 - piscina: 4.5.1 + piscina: 4.6.0 semver: 7.6.2 slash: 3.0.0 source-map: 0.7.4 @@ -11472,61 +11930,61 @@ snapshots: '@swc/core-darwin-arm64@1.3.101': optional: true - '@swc/core-darwin-arm64@1.6.1': + '@swc/core-darwin-arm64@1.6.3': optional: true '@swc/core-darwin-x64@1.3.101': optional: true - '@swc/core-darwin-x64@1.6.1': + '@swc/core-darwin-x64@1.6.3': optional: true '@swc/core-linux-arm-gnueabihf@1.3.101': optional: true - '@swc/core-linux-arm-gnueabihf@1.6.1': + '@swc/core-linux-arm-gnueabihf@1.6.3': optional: true '@swc/core-linux-arm64-gnu@1.3.101': optional: true - '@swc/core-linux-arm64-gnu@1.6.1': + '@swc/core-linux-arm64-gnu@1.6.3': optional: true '@swc/core-linux-arm64-musl@1.3.101': optional: true - '@swc/core-linux-arm64-musl@1.6.1': + '@swc/core-linux-arm64-musl@1.6.3': optional: true '@swc/core-linux-x64-gnu@1.3.101': optional: true - '@swc/core-linux-x64-gnu@1.6.1': + '@swc/core-linux-x64-gnu@1.6.3': optional: true '@swc/core-linux-x64-musl@1.3.101': optional: true - '@swc/core-linux-x64-musl@1.6.1': + '@swc/core-linux-x64-musl@1.6.3': optional: true '@swc/core-win32-arm64-msvc@1.3.101': optional: true - '@swc/core-win32-arm64-msvc@1.6.1': + '@swc/core-win32-arm64-msvc@1.6.3': optional: true '@swc/core-win32-ia32-msvc@1.3.101': optional: true - '@swc/core-win32-ia32-msvc@1.6.1': + '@swc/core-win32-ia32-msvc@1.6.3': optional: true '@swc/core-win32-x64-msvc@1.3.101': optional: true - '@swc/core-win32-x64-msvc@1.6.1': + '@swc/core-win32-x64-msvc@1.6.3': optional: true '@swc/core@1.3.101(@swc/helpers@0.5.11)': @@ -11546,21 +12004,21 @@ snapshots: '@swc/core-win32-x64-msvc': 1.3.101 '@swc/helpers': 0.5.11 - '@swc/core@1.6.1(@swc/helpers@0.5.11)': + '@swc/core@1.6.3(@swc/helpers@0.5.11)': dependencies: '@swc/counter': 0.1.3 '@swc/types': 0.1.8 optionalDependencies: - '@swc/core-darwin-arm64': 1.6.1 - '@swc/core-darwin-x64': 1.6.1 - '@swc/core-linux-arm-gnueabihf': 1.6.1 - '@swc/core-linux-arm64-gnu': 1.6.1 - '@swc/core-linux-arm64-musl': 1.6.1 - '@swc/core-linux-x64-gnu': 1.6.1 - '@swc/core-linux-x64-musl': 1.6.1 - '@swc/core-win32-arm64-msvc': 1.6.1 - '@swc/core-win32-ia32-msvc': 1.6.1 - '@swc/core-win32-x64-msvc': 1.6.1 + '@swc/core-darwin-arm64': 1.6.3 + '@swc/core-darwin-x64': 1.6.3 + '@swc/core-linux-arm-gnueabihf': 1.6.3 + '@swc/core-linux-arm64-gnu': 1.6.3 + '@swc/core-linux-arm64-musl': 1.6.3 + '@swc/core-linux-x64-gnu': 1.6.3 + '@swc/core-linux-x64-musl': 1.6.3 + '@swc/core-win32-arm64-msvc': 1.6.3 + '@swc/core-win32-ia32-msvc': 1.6.3 + '@swc/core-win32-x64-msvc': 1.6.3 '@swc/helpers': 0.5.11 '@swc/counter@0.1.3': {} @@ -11581,13 +12039,13 @@ snapshots: dependencies: defer-to-connect: 2.0.1 - '@tailwindcss/container-queries@0.1.1(tailwindcss@3.4.4(ts-node@10.9.2(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)))': + '@tailwindcss/container-queries@0.1.1(tailwindcss@3.4.4(ts-node@10.9.2(@swc/core@1.6.3)(@types/node@20.14.7)(typescript@5.5.2)))': dependencies: - tailwindcss: 3.4.4(ts-node@10.9.2(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)) + tailwindcss: 3.4.4(ts-node@10.9.2(@swc/core@1.6.3)(@types/node@20.14.7)(typescript@5.5.2)) - '@tanstack/eslint-plugin-query@5.43.1(eslint@8.57.0)(typescript@5.4.5)': + '@tanstack/eslint-plugin-query@5.43.1(eslint@8.57.0)(typescript@5.5.2)': dependencies: - '@typescript-eslint/utils': 8.0.0-alpha.28(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/utils': 8.0.0-alpha.28(eslint@8.57.0)(typescript@5.5.2) eslint: 8.57.0 transitivePeerDependencies: - supports-color @@ -11813,27 +12271,27 @@ snapshots: '@types/bcrypt@5.0.2': dependencies: - '@types/node': 20.14.2 + '@types/node': 20.14.7 '@types/body-parser@1.19.5': dependencies: '@types/connect': 3.4.38 - '@types/node': 20.14.2 + '@types/node': 20.14.7 '@types/busboy@1.5.4': dependencies: - '@types/node': 20.14.2 + '@types/node': 20.14.7 '@types/cacheable-request@6.0.3': dependencies: '@types/http-cache-semantics': 4.0.4 '@types/keyv': 3.1.4 - '@types/node': 20.14.2 + '@types/node': 20.14.7 '@types/responselike': 1.0.3 '@types/connect@3.4.38': dependencies: - '@types/node': 20.14.2 + '@types/node': 20.14.7 '@types/cookie-parser@1.4.7': dependencies: @@ -11843,7 +12301,7 @@ snapshots: '@types/cors@2.8.17': dependencies: - '@types/node': 20.14.2 + '@types/node': 20.14.7 '@types/eslint-scope@3.7.7': dependencies: @@ -11859,7 +12317,7 @@ snapshots: '@types/express-serve-static-core@4.19.3': dependencies: - '@types/node': 20.14.2 + '@types/node': 20.14.7 '@types/qs': 6.9.15 '@types/range-parser': 1.2.7 '@types/send': 0.17.4 @@ -11900,11 +12358,11 @@ snapshots: '@types/jsonwebtoken@9.0.5': dependencies: - '@types/node': 20.14.2 + '@types/node': 20.14.7 '@types/keyv@3.1.4': dependencies: - '@types/node': 20.14.2 + '@types/node': 20.14.7 '@types/lodash@4.17.5': {} @@ -11916,16 +12374,16 @@ snapshots: '@types/node-fetch@2.6.11': dependencies: - '@types/node': 20.14.2 + '@types/node': 20.14.7 form-data: 4.0.0 - '@types/node@20.14.2': + '@types/node@20.14.7': dependencies: undici-types: 5.26.5 '@types/nodemailer@6.4.15': dependencies: - '@types/node': 20.14.2 + '@types/node': 20.14.7 '@types/nprogress@0.2.3': {} @@ -11935,7 +12393,7 @@ snapshots: '@types/pg@8.11.6': dependencies: - '@types/node': 20.14.2 + '@types/node': 20.14.7 pg-protocol: 1.6.1 pg-types: 4.0.2 @@ -11958,19 +12416,19 @@ snapshots: '@types/responselike@1.0.3': dependencies: - '@types/node': 20.14.2 + '@types/node': 20.14.7 '@types/semver@7.5.8': {} '@types/send@0.17.4': dependencies: '@types/mime': 1.3.5 - '@types/node': 20.14.2 + '@types/node': 20.14.7 '@types/serve-static@1.15.7': dependencies: '@types/http-errors': 2.0.4 - '@types/node': 20.14.2 + '@types/node': 20.14.7 '@types/send': 0.17.4 '@types/unist@3.0.2': {} @@ -11979,9 +12437,9 @@ snapshots: '@types/webpack@5.28.5(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11)': dependencies: - '@types/node': 20.14.2 + '@types/node': 20.14.7 tapable: 2.2.1 - webpack: 5.92.0(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11) + webpack: 5.92.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12) transitivePeerDependencies: - '@swc/core' - esbuild @@ -11990,7 +12448,7 @@ snapshots: '@types/ws@8.5.10': dependencies: - '@types/node': 20.14.2 + '@types/node': 20.14.7 '@types/yargs-parser@21.0.3': {} @@ -11998,55 +12456,55 @@ snapshots: dependencies: '@types/yargs-parser': 21.0.3 - '@typescript-eslint/eslint-plugin@7.13.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5)': + '@typescript-eslint/eslint-plugin@7.13.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.5.2))(eslint@8.57.0)(typescript@5.5.2)': dependencies: '@eslint-community/regexpp': 4.10.1 - '@typescript-eslint/parser': 7.13.1(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/parser': 7.13.1(eslint@8.57.0)(typescript@5.5.2) '@typescript-eslint/scope-manager': 7.13.1 - '@typescript-eslint/type-utils': 7.13.1(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/utils': 7.13.1(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/type-utils': 7.13.1(eslint@8.57.0)(typescript@5.5.2) + '@typescript-eslint/utils': 7.13.1(eslint@8.57.0)(typescript@5.5.2) '@typescript-eslint/visitor-keys': 7.13.1 eslint: 8.57.0 graphemer: 1.4.0 ignore: 5.3.1 natural-compare: 1.4.0 - ts-api-utils: 1.3.0(typescript@5.4.5) + ts-api-utils: 1.3.0(typescript@5.5.2) optionalDependencies: - typescript: 5.4.5 + typescript: 5.5.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/experimental-utils@5.62.0(eslint@8.57.0)(typescript@5.4.5)': + '@typescript-eslint/experimental-utils@5.62.0(eslint@8.57.0)(typescript@5.5.2)': dependencies: - '@typescript-eslint/utils': 5.62.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/utils': 5.62.0(eslint@8.57.0)(typescript@5.5.2) eslint: 8.57.0 transitivePeerDependencies: - supports-color - typescript - '@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.4.5)': + '@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.5.2)': dependencies: '@typescript-eslint/scope-manager': 7.13.1 '@typescript-eslint/types': 7.13.1 - '@typescript-eslint/typescript-estree': 7.13.1(typescript@5.4.5) + '@typescript-eslint/typescript-estree': 7.13.1(typescript@5.5.2) '@typescript-eslint/visitor-keys': 7.13.1 debug: 4.3.5 eslint: 8.57.0 optionalDependencies: - typescript: 5.4.5 + typescript: 5.5.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5)': + '@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2)': dependencies: '@typescript-eslint/scope-manager': 7.2.0 '@typescript-eslint/types': 7.2.0 - '@typescript-eslint/typescript-estree': 7.2.0(typescript@5.4.5) + '@typescript-eslint/typescript-estree': 7.2.0(typescript@5.5.2) '@typescript-eslint/visitor-keys': 7.2.0 debug: 4.3.5 eslint: 8.57.0 optionalDependencies: - typescript: 5.4.5 + typescript: 5.5.2 transitivePeerDependencies: - supports-color @@ -12070,15 +12528,15 @@ snapshots: '@typescript-eslint/types': 8.0.0-alpha.28 '@typescript-eslint/visitor-keys': 8.0.0-alpha.28 - '@typescript-eslint/type-utils@7.13.1(eslint@8.57.0)(typescript@5.4.5)': + '@typescript-eslint/type-utils@7.13.1(eslint@8.57.0)(typescript@5.5.2)': dependencies: - '@typescript-eslint/typescript-estree': 7.13.1(typescript@5.4.5) - '@typescript-eslint/utils': 7.13.1(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/typescript-estree': 7.13.1(typescript@5.5.2) + '@typescript-eslint/utils': 7.13.1(eslint@8.57.0)(typescript@5.5.2) debug: 4.3.5 eslint: 8.57.0 - ts-api-utils: 1.3.0(typescript@5.4.5) + ts-api-utils: 1.3.0(typescript@5.5.2) optionalDependencies: - typescript: 5.4.5 + typescript: 5.5.2 transitivePeerDependencies: - supports-color @@ -12090,7 +12548,7 @@ snapshots: '@typescript-eslint/types@8.0.0-alpha.28': {} - '@typescript-eslint/typescript-estree@5.62.0(typescript@5.4.5)': + '@typescript-eslint/typescript-estree@5.62.0(typescript@5.5.2)': dependencies: '@typescript-eslint/types': 5.62.0 '@typescript-eslint/visitor-keys': 5.62.0 @@ -12098,13 +12556,13 @@ snapshots: globby: 11.1.0 is-glob: 4.0.3 semver: 7.6.2 - tsutils: 3.21.0(typescript@5.4.5) + tsutils: 3.21.0(typescript@5.5.2) optionalDependencies: - typescript: 5.4.5 + typescript: 5.5.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/typescript-estree@7.13.1(typescript@5.4.5)': + '@typescript-eslint/typescript-estree@7.13.1(typescript@5.5.2)': dependencies: '@typescript-eslint/types': 7.13.1 '@typescript-eslint/visitor-keys': 7.13.1 @@ -12113,13 +12571,13 @@ snapshots: is-glob: 4.0.3 minimatch: 9.0.4 semver: 7.6.2 - ts-api-utils: 1.3.0(typescript@5.4.5) + ts-api-utils: 1.3.0(typescript@5.5.2) optionalDependencies: - typescript: 5.4.5 + typescript: 5.5.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/typescript-estree@7.2.0(typescript@5.4.5)': + '@typescript-eslint/typescript-estree@7.2.0(typescript@5.5.2)': dependencies: '@typescript-eslint/types': 7.2.0 '@typescript-eslint/visitor-keys': 7.2.0 @@ -12128,13 +12586,13 @@ snapshots: is-glob: 4.0.3 minimatch: 9.0.3 semver: 7.6.2 - ts-api-utils: 1.3.0(typescript@5.4.5) + ts-api-utils: 1.3.0(typescript@5.5.2) optionalDependencies: - typescript: 5.4.5 + typescript: 5.5.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/typescript-estree@8.0.0-alpha.28(typescript@5.4.5)': + '@typescript-eslint/typescript-estree@8.0.0-alpha.28(typescript@5.5.2)': dependencies: '@typescript-eslint/types': 8.0.0-alpha.28 '@typescript-eslint/visitor-keys': 8.0.0-alpha.28 @@ -12143,20 +12601,20 @@ snapshots: is-glob: 4.0.3 minimatch: 9.0.4 semver: 7.6.2 - ts-api-utils: 1.3.0(typescript@5.4.5) + ts-api-utils: 1.3.0(typescript@5.5.2) optionalDependencies: - typescript: 5.4.5 + typescript: 5.5.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@5.62.0(eslint@8.57.0)(typescript@5.4.5)': + '@typescript-eslint/utils@5.62.0(eslint@8.57.0)(typescript@5.5.2)': dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) '@types/json-schema': 7.0.15 '@types/semver': 7.5.8 '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.4.5) + '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.5.2) eslint: 8.57.0 eslint-scope: 5.1.1 semver: 7.6.2 @@ -12164,23 +12622,23 @@ snapshots: - supports-color - typescript - '@typescript-eslint/utils@7.13.1(eslint@8.57.0)(typescript@5.4.5)': + '@typescript-eslint/utils@7.13.1(eslint@8.57.0)(typescript@5.5.2)': dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) '@typescript-eslint/scope-manager': 7.13.1 '@typescript-eslint/types': 7.13.1 - '@typescript-eslint/typescript-estree': 7.13.1(typescript@5.4.5) + '@typescript-eslint/typescript-estree': 7.13.1(typescript@5.5.2) eslint: 8.57.0 transitivePeerDependencies: - supports-color - typescript - '@typescript-eslint/utils@8.0.0-alpha.28(eslint@8.57.0)(typescript@5.4.5)': + '@typescript-eslint/utils@8.0.0-alpha.28(eslint@8.57.0)(typescript@5.5.2)': dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) '@typescript-eslint/scope-manager': 8.0.0-alpha.28 '@typescript-eslint/types': 8.0.0-alpha.28 - '@typescript-eslint/typescript-estree': 8.0.0-alpha.28(typescript@5.4.5) + '@typescript-eslint/typescript-estree': 8.0.0-alpha.28(typescript@5.5.2) eslint: 8.57.0 transitivePeerDependencies: - supports-color @@ -12439,9 +12897,9 @@ snapshots: dependencies: tslib: 2.6.3 - aria-query@5.3.0: + aria-query@5.1.3: dependencies: - dequal: 2.0.3 + deep-equal: 2.2.3 array-buffer-byte-length@1.0.1: dependencies: @@ -12565,11 +13023,11 @@ snapshots: dependencies: possible-typed-array-names: 1.0.0 - axe-core@4.7.0: {} + axe-core@4.9.1: {} - axobject-query@3.2.1: + axobject-query@3.1.1: dependencies: - dequal: 2.0.3 + deep-equal: 2.2.3 babel-plugin-macros@3.1.0: dependencies: @@ -12749,8 +13207,6 @@ snapshots: camelcase@5.3.1: {} - caniuse-lite@1.0.30001632: {} - caniuse-lite@1.0.30001636: {} capital-case@1.0.4: @@ -13032,14 +13488,14 @@ snapshots: optionalDependencies: typescript: 5.3.3 - cosmiconfig@8.3.6(typescript@5.4.5): + cosmiconfig@8.3.6(typescript@5.5.2): dependencies: import-fresh: 3.3.0 js-yaml: 4.1.0 parse-json: 5.2.0 path-type: 4.0.0 optionalDependencies: - typescript: 5.4.5 + typescript: 5.5.2 create-require@1.1.1: {} @@ -13141,6 +13597,27 @@ snapshots: dependencies: mimic-response: 3.1.0 + deep-equal@2.2.3: + dependencies: + array-buffer-byte-length: 1.0.1 + call-bind: 1.0.7 + es-get-iterator: 1.1.3 + get-intrinsic: 1.2.4 + is-arguments: 1.1.1 + is-array-buffer: 3.0.4 + is-date-object: 1.0.5 + is-regex: 1.1.4 + is-shared-array-buffer: 1.0.3 + isarray: 2.0.5 + object-is: 1.1.6 + object-keys: 1.1.1 + object.assign: 4.1.5 + regexp.prototype.flags: 1.5.2 + side-channel: 1.0.6 + which-boxed-primitive: 1.0.2 + which-collection: 1.0.2 + which-typed-array: 1.1.15 + deep-is@0.1.4: {} deepmerge@4.3.1: {} @@ -13292,12 +13769,12 @@ snapshots: dependencies: once: 1.4.0 - engine.io-client@6.5.3: + engine.io-client@6.5.4: dependencies: '@socket.io/component-emitter': 3.1.2 debug: 4.3.5 engine.io-parser: 5.2.2 - ws: 8.11.0 + ws: 8.17.1 xmlhttprequest-ssl: 2.0.0 transitivePeerDependencies: - bufferutil @@ -13306,18 +13783,18 @@ snapshots: engine.io-parser@5.2.2: {} - engine.io@6.5.4: + engine.io@6.5.5: dependencies: '@types/cookie': 0.4.1 '@types/cors': 2.8.17 - '@types/node': 20.14.2 + '@types/node': 20.14.7 accepts: 1.3.8 base64id: 2.0.0 cookie: 0.4.2 cors: 2.8.5 debug: 4.3.5 engine.io-parser: 5.2.2 - ws: 8.11.0 + ws: 8.17.1 transitivePeerDependencies: - bufferutil - supports-color @@ -13393,6 +13870,18 @@ snapshots: es-errors@1.3.0: {} + es-get-iterator@1.1.3: + dependencies: + call-bind: 1.0.7 + get-intrinsic: 1.2.4 + has-symbols: 1.0.3 + is-arguments: 1.1.1 + is-map: 2.0.3 + is-set: 2.0.3 + is-string: 1.0.7 + isarray: 2.0.5 + stop-iteration-iterator: 1.0.0 + es-iterator-helpers@1.0.19: dependencies: call-bind: 1.0.7 @@ -13526,20 +14015,20 @@ snapshots: escape-string-regexp@5.0.0: {} - eslint-config-next@15.0.0-canary.28(eslint@8.57.0)(typescript@5.4.5): + eslint-config-next@15.0.0-canary.28(eslint@8.57.0)(typescript@5.5.2): dependencies: '@next/eslint-plugin-next': 15.0.0-canary.28 '@rushstack/eslint-patch': 1.10.3 - '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.5.2) eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) - eslint-plugin-jsx-a11y: 6.8.0(eslint@8.57.0) - eslint-plugin-react: 7.34.2(eslint@8.57.0) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) + eslint-plugin-jsx-a11y: 6.9.0(eslint@8.57.0) + eslint-plugin-react: 7.34.3(eslint@8.57.0) eslint-plugin-react-hooks: 4.6.2(eslint@8.57.0) optionalDependencies: - typescript: 5.4.5 + typescript: 5.5.2 transitivePeerDependencies: - eslint-import-resolver-webpack - supports-color @@ -13560,21 +14049,21 @@ snapshots: eslint-import-resolver-node@0.3.9: dependencies: debug: 3.2.7 - is-core-module: 2.13.1 + is-core-module: 2.14.0 resolve: 1.22.8 transitivePeerDependencies: - supports-color - eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0): + eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0): dependencies: debug: 4.3.5 enhanced-resolve: 5.17.0 eslint: 8.57.0 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) fast-glob: 3.3.2 get-tsconfig: 4.7.5 - is-core-module: 2.13.1 + is-core-module: 2.14.0 is-glob: 4.0.3 transitivePeerDependencies: - '@typescript-eslint/parser' @@ -13582,18 +14071,18 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-module-utils@2.8.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0): + eslint-module-utils@2.8.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0): dependencies: debug: 3.2.7 optionalDependencies: - '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.5.2) eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0) transitivePeerDependencies: - supports-color - eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0): + eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0): dependencies: array-includes: 3.1.8 array.prototype.findlastindex: 1.2.5 @@ -13603,9 +14092,9 @@ snapshots: doctrine: 2.1.0 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) hasown: 2.0.2 - is-core-module: 2.13.1 + is-core-module: 2.14.0 is-glob: 4.0.3 minimatch: 3.1.2 object.fromentries: 2.0.8 @@ -13614,21 +14103,20 @@ snapshots: semver: 6.3.1 tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.5.2) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack - supports-color - eslint-plugin-jsx-a11y@6.8.0(eslint@8.57.0): + eslint-plugin-jsx-a11y@6.9.0(eslint@8.57.0): dependencies: - '@babel/runtime': 7.24.7 - aria-query: 5.3.0 + aria-query: 5.1.3 array-includes: 3.1.8 array.prototype.flatmap: 1.3.2 ast-types-flow: 0.0.8 - axe-core: 4.7.0 - axobject-query: 3.2.1 + axe-core: 4.9.1 + axobject-query: 3.1.1 damerau-levenshtein: 1.0.8 emoji-regex: 9.2.2 es-iterator-helpers: 1.0.19 @@ -13637,8 +14125,9 @@ snapshots: jsx-ast-utils: 3.3.5 language-tags: 1.0.9 minimatch: 3.1.2 - object.entries: 1.1.8 object.fromentries: 2.0.8 + safe-regex-test: 1.0.3 + string.prototype.includes: 2.0.0 eslint-plugin-prettier@5.1.3(@types/eslint@8.56.10)(eslint-config-prettier@9.1.0(eslint@8.57.0))(eslint@8.57.0)(prettier@3.3.2): dependencies: @@ -13654,7 +14143,7 @@ snapshots: dependencies: eslint: 8.57.0 - eslint-plugin-react@7.34.2(eslint@8.57.0): + eslint-plugin-react@7.34.3(eslint@8.57.0): dependencies: array-includes: 3.1.8 array.prototype.findlast: 1.2.5 @@ -13686,14 +14175,14 @@ snapshots: dotenv: 16.0.3 eslint: 8.57.0 - eslint-plugin-typescript-sort-keys@3.2.0(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5): + eslint-plugin-typescript-sort-keys@3.2.0(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.5.2))(eslint@8.57.0)(typescript@5.5.2): dependencies: - '@typescript-eslint/experimental-utils': 5.62.0(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/parser': 7.13.1(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/experimental-utils': 5.62.0(eslint@8.57.0)(typescript@5.5.2) + '@typescript-eslint/parser': 7.13.1(eslint@8.57.0)(typescript@5.5.2) eslint: 8.57.0 json-schema: 0.4.0 natural-compare-lite: 1.4.0 - typescript: 5.4.5 + typescript: 5.5.2 transitivePeerDependencies: - supports-color @@ -13993,7 +14482,7 @@ snapshots: cross-spawn: 7.0.3 signal-exit: 4.1.0 - fork-ts-checker-webpack-plugin@9.0.2(typescript@5.3.3)(webpack@5.90.1(@swc/core@1.6.1(@swc/helpers@0.5.11))): + fork-ts-checker-webpack-plugin@9.0.2(typescript@5.3.3)(webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)): dependencies: '@babel/code-frame': 7.24.7 chalk: 4.1.2 @@ -14008,7 +14497,7 @@ snapshots: semver: 7.6.2 tapable: 2.2.1 typescript: 5.3.3 - webpack: 5.90.1(@swc/core@1.6.1(@swc/helpers@0.5.11)) + webpack: 5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12) form-data@4.0.0: dependencies: @@ -14028,7 +14517,7 @@ snapshots: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - framer-motion@11.2.10(@emotion/is-prop-valid@1.2.2)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0): + framer-motion@11.2.11(@emotion/is-prop-valid@1.2.2)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0): dependencies: tslib: 2.6.3 optionalDependencies: @@ -14078,9 +14567,9 @@ snapshots: strip-ansi: 6.0.1 wide-align: 1.1.5 - geist@1.3.0(next@15.0.0-canary.35(babel-plugin-react-compiler@0.0.0-experimental-938cd9a-20240601)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)): + geist@1.3.0(next@15.0.0-rc.0(babel-plugin-react-compiler@0.0.0-experimental-938cd9a-20240601)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0)): dependencies: - next: 15.0.0-canary.35(babel-plugin-react-compiler@0.0.0-experimental-938cd9a-20240601)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + next: 15.0.0-rc.0(babel-plugin-react-compiler@0.0.0-experimental-938cd9a-20240601)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) gensync@1.0.0-beta.2: {} @@ -14140,12 +14629,13 @@ snapshots: minipass: 7.1.2 path-scurry: 1.11.1 - glob@10.4.1: + glob@10.4.2: dependencies: foreground-child: 3.2.1 jackspeak: 3.4.0 minimatch: 9.0.4 minipass: 7.1.2 + package-json-from-dist: 1.0.0 path-scurry: 1.11.1 glob@7.2.3: @@ -14206,15 +14696,15 @@ snapshots: graphemer@1.4.0: {} - graphql-config@5.0.3(@types/node@20.14.2)(graphql@16.8.2)(typescript@5.4.5): + graphql-config@5.0.3(@types/node@20.14.7)(graphql@16.8.2)(typescript@5.5.2): dependencies: '@graphql-tools/graphql-file-loader': 8.0.1(graphql@16.8.2) '@graphql-tools/json-file-loader': 8.0.1(graphql@16.8.2) '@graphql-tools/load': 8.0.2(graphql@16.8.2) '@graphql-tools/merge': 9.0.4(graphql@16.8.2) - '@graphql-tools/url-loader': 8.0.2(@types/node@20.14.2)(graphql@16.8.2) + '@graphql-tools/url-loader': 8.0.2(@types/node@20.14.7)(graphql@16.8.2) '@graphql-tools/utils': 10.2.2(graphql@16.8.2) - cosmiconfig: 8.3.6(typescript@5.4.5) + cosmiconfig: 8.3.6(typescript@5.5.2) graphql: 16.8.2 jiti: 1.21.6 minimatch: 4.2.3 @@ -14469,6 +14959,11 @@ snapshots: is-relative: 1.0.0 is-windows: 1.0.2 + is-arguments@1.1.1: + dependencies: + call-bind: 1.0.7 + has-tostringtag: 1.0.2 + is-array-buffer@3.0.4: dependencies: call-bind: 1.0.7 @@ -14497,7 +14992,7 @@ snapshots: is-callable@1.2.7: {} - is-core-module@2.13.1: + is-core-module@2.14.0: dependencies: hasown: 2.0.2 @@ -14639,19 +15134,19 @@ snapshots: jest-worker@27.5.1: dependencies: - '@types/node': 20.14.2 + '@types/node': 20.14.7 merge-stream: 2.0.0 supports-color: 8.1.1 jiti@1.21.6: {} - jose@5.4.0: {} + jose@5.4.1: {} js-beautify@1.15.1: dependencies: config-chain: 1.1.13 editorconfig: 1.0.4 - glob: 10.4.1 + glob: 10.4.2 js-cookie: 3.0.5 nopt: 7.2.1 @@ -14908,9 +15403,9 @@ snapshots: merge2@1.4.1: {} - meros@1.3.0(@types/node@20.14.2): + meros@1.3.0(@types/node@20.14.7): optionalDependencies: - '@types/node': 20.14.2 + '@types/node': 20.14.7 methods@1.1.2: {} @@ -15038,21 +15533,21 @@ snapshots: neo-async@2.6.2: {} - next-intl@3.15.0(next@15.0.0-canary.28(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0))(react@19.0.0-rc.0): + next-intl@3.15.2(next@15.0.0-canary.28(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0))(react@19.0.0-rc.0): dependencies: '@formatjs/intl-localematcher': 0.2.32 negotiator: 0.6.3 next: 15.0.0-canary.28(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) react: 19.0.0-rc.0 - use-intl: 3.15.0(react@19.0.0-rc.0) + use-intl: 3.15.2(react@19.0.0-rc.0) - next-intl@3.15.0(next@15.0.0-canary.35(babel-plugin-react-compiler@0.0.0-experimental-938cd9a-20240601)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0))(react@19.0.0-rc.0): + next-intl@3.15.2(next@15.0.0-rc.0(babel-plugin-react-compiler@0.0.0-experimental-938cd9a-20240601)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0))(react@19.0.0-rc.0): dependencies: '@formatjs/intl-localematcher': 0.2.32 negotiator: 0.6.3 - next: 15.0.0-canary.35(babel-plugin-react-compiler@0.0.0-experimental-938cd9a-20240601)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + next: 15.0.0-rc.0(babel-plugin-react-compiler@0.0.0-experimental-938cd9a-20240601)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) react: 19.0.0-rc.0 - use-intl: 3.15.0(react@19.0.0-rc.0) + use-intl: 3.15.2(react@19.0.0-rc.0) next-themes@0.3.0(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0): dependencies: @@ -15089,7 +15584,7 @@ snapshots: '@next/env': 15.0.0-canary.28 '@swc/helpers': 0.5.11 busboy: 1.6.0 - caniuse-lite: 1.0.30001632 + caniuse-lite: 1.0.30001636 graceful-fs: 4.2.11 postcss: 8.4.31 react: 19.0.0-rc.0 @@ -15110,9 +15605,9 @@ snapshots: - '@babel/core' - babel-plugin-macros - next@15.0.0-canary.35(babel-plugin-react-compiler@0.0.0-experimental-938cd9a-20240601)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0): + next@15.0.0-rc.0(babel-plugin-react-compiler@0.0.0-experimental-938cd9a-20240601)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0): dependencies: - '@next/env': 15.0.0-canary.35 + '@next/env': 15.0.0-rc.0 '@swc/helpers': 0.5.11 busboy: 1.6.0 caniuse-lite: 1.0.30001636 @@ -15120,26 +15615,26 @@ snapshots: postcss: 8.4.31 react: 19.0.0-rc.0 react-dom: 19.0.0-rc.0(react@19.0.0-rc.0) - styled-jsx: 5.1.6(react@19.0.0-rc.0) + styled-jsx: 5.1.3(react@19.0.0-rc.0) optionalDependencies: - '@next/swc-darwin-arm64': 15.0.0-canary.35 - '@next/swc-darwin-x64': 15.0.0-canary.35 - '@next/swc-linux-arm64-gnu': 15.0.0-canary.35 - '@next/swc-linux-arm64-musl': 15.0.0-canary.35 - '@next/swc-linux-x64-gnu': 15.0.0-canary.35 - '@next/swc-linux-x64-musl': 15.0.0-canary.35 - '@next/swc-win32-arm64-msvc': 15.0.0-canary.35 - '@next/swc-win32-ia32-msvc': 15.0.0-canary.35 - '@next/swc-win32-x64-msvc': 15.0.0-canary.35 + '@next/swc-darwin-arm64': 15.0.0-rc.0 + '@next/swc-darwin-x64': 15.0.0-rc.0 + '@next/swc-linux-arm64-gnu': 15.0.0-rc.0 + '@next/swc-linux-arm64-musl': 15.0.0-rc.0 + '@next/swc-linux-x64-gnu': 15.0.0-rc.0 + '@next/swc-linux-x64-musl': 15.0.0-rc.0 + '@next/swc-win32-arm64-msvc': 15.0.0-rc.0 + '@next/swc-win32-ia32-msvc': 15.0.0-rc.0 + '@next/swc-win32-x64-msvc': 15.0.0-rc.0 babel-plugin-react-compiler: 0.0.0-experimental-938cd9a-20240601 sharp: 0.33.4 transitivePeerDependencies: - '@babel/core' - babel-plugin-macros - nextjs-toploader@1.6.12(next@15.0.0-canary.35(babel-plugin-react-compiler@0.0.0-experimental-938cd9a-20240601)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0))(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0): + nextjs-toploader@1.6.12(next@15.0.0-rc.0(babel-plugin-react-compiler@0.0.0-experimental-938cd9a-20240601)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0))(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0): dependencies: - next: 15.0.0-canary.35(babel-plugin-react-compiler@0.0.0-experimental-938cd9a-20240601)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + next: 15.0.0-rc.0(babel-plugin-react-compiler@0.0.0-experimental-938cd9a-20240601)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) nprogress: 0.2.0 prop-types: 15.8.1 react: 19.0.0-rc.0 @@ -15178,7 +15673,7 @@ snapshots: node-releases@2.0.14: {} - nodemailer@6.9.13: {} + nodemailer@6.9.14: {} nopt@5.0.0: dependencies: @@ -15223,6 +15718,11 @@ snapshots: object-inspect@1.13.1: {} + object-is@1.1.6: + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + object-keys@1.1.1: {} object-path@0.11.8: {} @@ -15336,6 +15836,8 @@ snapshots: p-try@2.2.0: {} + package-json-from-dist@1.0.0: {} + param-case@3.0.4: dependencies: dot-case: 3.0.4 @@ -15465,7 +15967,7 @@ snapshots: pirates@4.0.6: {} - piscina@4.5.1: + piscina@4.6.0: optionalDependencies: nice-napi: 1.0.2 @@ -15485,13 +15987,13 @@ snapshots: camelcase-css: 2.0.1 postcss: 8.4.38 - postcss-load-config@4.0.2(postcss@8.4.38)(ts-node@10.9.2(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)): + postcss-load-config@4.0.2(postcss@8.4.38)(ts-node@10.9.2(@swc/core@1.6.3)(@types/node@20.14.7)(typescript@5.5.2)): dependencies: lilconfig: 3.1.2 yaml: 2.4.5 optionalDependencies: postcss: 8.4.38 - ts-node: 10.9.2(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5) + ts-node: 10.9.2(@swc/core@1.6.3)(@types/node@20.14.7)(typescript@5.5.2) postcss-nested@6.0.1(postcss@8.4.38): dependencies: @@ -15753,7 +16255,7 @@ snapshots: react: 19.0.0-rc.0 scheduler: 0.25.0-rc.0 - react-email@2.1.4(@swc/helpers@0.5.11)(eslint@8.57.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.11))(@types/node@20.14.2)(typescript@5.4.5)): + react-email@2.1.4(@swc/helpers@0.5.11)(eslint@8.57.0)(ts-node@10.9.2(@swc/core@1.6.3(@swc/helpers@0.5.11))(@types/node@20.14.7)(typescript@5.5.2)): dependencies: '@babel/core': 7.24.5 '@babel/parser': 7.24.5 @@ -15794,7 +16296,7 @@ snapshots: source-map-js: 1.0.2 stacktrace-parser: 0.1.10 tailwind-merge: 2.2.0 - tailwindcss: 3.4.0(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.11))(@types/node@20.14.2)(typescript@5.4.5)) + tailwindcss: 3.4.0(ts-node@10.9.2(@swc/core@1.6.3(@swc/helpers@0.5.11))(@types/node@20.14.7)(typescript@5.5.2)) typescript: 5.1.6 transitivePeerDependencies: - '@opentelemetry/api' @@ -15859,6 +16361,17 @@ snapshots: optionalDependencies: '@types/react': 18.3.3 + react-remove-scroll@2.5.7(@types/react@18.3.3)(react@19.0.0-rc.0): + dependencies: + react: 19.0.0-rc.0 + react-remove-scroll-bar: 2.3.6(@types/react@18.3.3)(react@19.0.0-rc.0) + react-style-singleton: 2.2.1(@types/react@18.3.3)(react@19.0.0-rc.0) + tslib: 2.6.3 + use-callback-ref: 1.3.2(@types/react@18.3.3)(react@19.0.0-rc.0) + use-sidecar: 1.1.2(@types/react@18.3.3)(react@19.0.0-rc.0) + optionalDependencies: + '@types/react': 18.3.3 + react-resizable-panels@2.0.19(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0): dependencies: react: 19.0.0-rc.0 @@ -16008,13 +16521,13 @@ snapshots: resolve@1.22.8: dependencies: - is-core-module: 2.13.1 + is-core-module: 2.14.0 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 resolve@2.0.0-next.5: dependencies: - is-core-module: 2.13.1 + is-core-module: 2.14.0 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 @@ -16043,7 +16556,7 @@ snapshots: rimraf@5.0.7: dependencies: - glob: 10.4.1 + glob: 10.4.2 rope-sequence@1.3.4: {} @@ -16268,10 +16781,10 @@ snapshots: dot-case: 3.0.4 tslib: 2.6.3 - socket.io-adapter@2.5.4: + socket.io-adapter@2.5.5: dependencies: debug: 4.3.5 - ws: 8.11.0 + ws: 8.17.1 transitivePeerDependencies: - bufferutil - supports-color @@ -16281,7 +16794,7 @@ snapshots: dependencies: '@socket.io/component-emitter': 3.1.2 debug: 4.3.5 - engine.io-client: 6.5.3 + engine.io-client: 6.5.4 socket.io-parser: 4.2.4 transitivePeerDependencies: - bufferutil @@ -16301,8 +16814,8 @@ snapshots: base64id: 2.0.0 cors: 2.8.5 debug: 4.3.5 - engine.io: 6.5.4 - socket.io-adapter: 2.5.4 + engine.io: 6.5.5 + socket.io-adapter: 2.5.5 socket.io-parser: 4.2.4 transitivePeerDependencies: - bufferutil @@ -16373,6 +16886,10 @@ snapshots: statuses@2.0.1: {} + stop-iteration-iterator@1.0.0: + dependencies: + internal-slot: 1.0.7 + streamsearch@1.1.0: {} string-env-interpolation@1.0.1: {} @@ -16389,6 +16906,11 @@ snapshots: emoji-regex: 9.2.2 strip-ansi: 7.1.0 + string.prototype.includes@2.0.0: + dependencies: + define-properties: 1.2.1 + es-abstract: 1.23.3 + string.prototype.matchall@4.0.11: dependencies: call-bind: 1.0.7 @@ -16469,6 +16991,11 @@ snapshots: optionalDependencies: '@babel/core': 7.24.5 + styled-jsx@5.1.3(react@19.0.0-rc.0): + dependencies: + client-only: 0.0.1 + react: 19.0.0-rc.0 + styled-jsx@5.1.6(react@19.0.0-rc.0): dependencies: client-only: 0.0.1 @@ -16494,7 +17021,7 @@ snapshots: dependencies: '@jridgewell/gen-mapping': 0.3.5 commander: 4.1.1 - glob: 10.4.1 + glob: 10.4.2 lines-and-columns: 1.2.4 mz: 2.7.0 pirates: 4.0.6 @@ -16535,15 +17062,15 @@ snapshots: dependencies: '@babel/runtime': 7.24.7 - tailwindcss-animate@1.0.7(tailwindcss@3.4.4(ts-node@10.9.2(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5))): + tailwindcss-animate@1.0.7(tailwindcss@3.4.4(ts-node@10.9.2(@swc/core@1.6.3)(@types/node@20.14.7)(typescript@5.5.2))): dependencies: - tailwindcss: 3.4.4(ts-node@10.9.2(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)) + tailwindcss: 3.4.4(ts-node@10.9.2(@swc/core@1.6.3)(@types/node@20.14.7)(typescript@5.5.2)) - tailwindcss@3.4.0(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.11))(@types/node@20.14.2)(typescript@5.4.5)): + tailwindcss@3.4.0(ts-node@10.9.2(@swc/core@1.6.3(@swc/helpers@0.5.11))(@types/node@20.14.7)(typescript@5.5.2)): dependencies: '@alloc/quick-lru': 5.2.0 arg: 5.0.2 - chokidar: 3.6.0 + chokidar: 3.5.3 didyoumean: 1.2.2 dlv: 1.1.3 fast-glob: 3.3.2 @@ -16558,7 +17085,7 @@ snapshots: postcss: 8.4.38 postcss-import: 15.1.0(postcss@8.4.38) postcss-js: 4.0.1(postcss@8.4.38) - postcss-load-config: 4.0.2(postcss@8.4.38)(ts-node@10.9.2(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)) + postcss-load-config: 4.0.2(postcss@8.4.38)(ts-node@10.9.2(@swc/core@1.6.3)(@types/node@20.14.7)(typescript@5.5.2)) postcss-nested: 6.0.1(postcss@8.4.38) postcss-selector-parser: 6.1.0 resolve: 1.22.8 @@ -16566,7 +17093,7 @@ snapshots: transitivePeerDependencies: - ts-node - tailwindcss@3.4.4(ts-node@10.9.2(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)): + tailwindcss@3.4.4(ts-node@10.9.2(@swc/core@1.6.3)(@types/node@20.14.7)(typescript@5.5.2)): dependencies: '@alloc/quick-lru': 5.2.0 arg: 5.0.2 @@ -16585,7 +17112,7 @@ snapshots: postcss: 8.4.38 postcss-import: 15.1.0(postcss@8.4.38) postcss-js: 4.0.1(postcss@8.4.38) - postcss-load-config: 4.0.2(postcss@8.4.38)(ts-node@10.9.2(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)) + postcss-load-config: 4.0.2(postcss@8.4.38)(ts-node@10.9.2(@swc/core@1.6.3)(@types/node@20.14.7)(typescript@5.5.2)) postcss-nested: 6.0.1(postcss@8.4.38) postcss-selector-parser: 6.1.0 resolve: 1.22.8 @@ -16604,7 +17131,7 @@ snapshots: mkdirp: 1.0.4 yallist: 4.0.0 - tar@7.2.0: + tar@7.4.0: dependencies: '@isaacs/fs-minipass': 4.0.1 chownr: 3.0.0 @@ -16613,27 +17140,29 @@ snapshots: mkdirp: 3.0.1 yallist: 5.0.0 - terser-webpack-plugin@5.3.10(@swc/core@1.6.1(@swc/helpers@0.5.11))(webpack@5.90.1(@swc/core@1.6.1(@swc/helpers@0.5.11))): + terser-webpack-plugin@5.3.10(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)(webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)): dependencies: '@jridgewell/trace-mapping': 0.3.25 jest-worker: 27.5.1 schema-utils: 3.3.0 serialize-javascript: 6.0.2 terser: 5.31.1 - webpack: 5.90.1(@swc/core@1.6.1(@swc/helpers@0.5.11)) + webpack: 5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12) optionalDependencies: - '@swc/core': 1.6.1(@swc/helpers@0.5.11) + '@swc/core': 1.6.3(@swc/helpers@0.5.11) + esbuild: 0.19.12 - terser-webpack-plugin@5.3.10(@swc/core@1.6.1(@swc/helpers@0.5.11))(webpack@5.92.0(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11)): + terser-webpack-plugin@5.3.10(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)(webpack@5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11)): dependencies: '@jridgewell/trace-mapping': 0.3.25 jest-worker: 27.5.1 schema-utils: 3.3.0 serialize-javascript: 6.0.2 terser: 5.31.1 - webpack: 5.92.0(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11) + webpack: 5.92.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12) optionalDependencies: - '@swc/core': 1.6.1(@swc/helpers@0.5.11) + '@swc/core': 1.6.3(@swc/helpers@0.5.11) + esbuild: 0.19.12 terser@5.31.1: dependencies: @@ -16695,9 +17224,9 @@ snapshots: trim-right@1.0.1: {} - ts-api-utils@1.3.0(typescript@5.4.5): + ts-api-utils@1.3.0(typescript@5.5.2): dependencies: - typescript: 5.4.5 + typescript: 5.5.2 ts-easing@0.2.0: {} @@ -16705,25 +17234,25 @@ snapshots: ts-log@2.2.5: {} - ts-node@10.9.2(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5): + ts-node@10.9.2(@swc/core@1.6.3)(@types/node@20.14.7)(typescript@5.5.2): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.11 '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 20.14.2 + '@types/node': 20.14.7 acorn: 8.12.0 acorn-walk: 8.3.3 arg: 4.1.3 create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 5.4.5 + typescript: 5.5.2 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 optionalDependencies: - '@swc/core': 1.6.1(@swc/helpers@0.5.11) + '@swc/core': 1.6.3(@swc/helpers@0.5.11) tsconfig-paths-webpack-plugin@4.1.0: dependencies: @@ -16750,10 +17279,10 @@ snapshots: tslib@2.6.3: {} - tsutils@3.21.0(typescript@5.4.5): + tsutils@3.21.0(typescript@5.5.2): dependencies: tslib: 1.14.1 - typescript: 5.4.5 + typescript: 5.5.2 turbo-darwin-64@2.0.4: optional: true @@ -16837,6 +17366,8 @@ snapshots: typescript@5.4.5: {} + typescript@5.5.2: {} + ua-parser-js@1.0.38: {} ua-parser-js@2.0.0-beta.3: {} @@ -16912,9 +17443,8 @@ snapshots: dequal: 2.0.3 react: 19.0.0-rc.0 - use-intl@3.15.0(react@19.0.0-rc.0): + use-intl@3.15.2(react@19.0.0-rc.0): dependencies: - '@formatjs/ecma402-abstract': 1.18.3 intl-messageformat: 10.5.14 react: 19.0.0-rc.0 @@ -16952,7 +17482,7 @@ snapshots: vaul@0.9.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0): dependencies: - '@radix-ui/react-dialog': 1.0.5(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) + '@radix-ui/react-dialog': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@19.0.0-rc.0(react@19.0.0-rc.0))(react@19.0.0-rc.0) react: 19.0.0-rc.0 react-dom: 19.0.0-rc.0(react@19.0.0-rc.0) transitivePeerDependencies: @@ -17005,7 +17535,7 @@ snapshots: webpack-sources@3.2.3: {} - webpack@5.90.1(@swc/core@1.6.1(@swc/helpers@0.5.11)): + webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12): dependencies: '@types/eslint-scope': 3.7.7 '@types/estree': 1.0.5 @@ -17028,7 +17558,7 @@ snapshots: neo-async: 2.6.2 schema-utils: 3.3.0 tapable: 2.2.1 - terser-webpack-plugin: 5.3.10(@swc/core@1.6.1(@swc/helpers@0.5.11))(webpack@5.90.1(@swc/core@1.6.1(@swc/helpers@0.5.11))) + terser-webpack-plugin: 5.3.10(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)(webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)) watchpack: 2.4.1 webpack-sources: 3.2.3 transitivePeerDependencies: @@ -17036,7 +17566,7 @@ snapshots: - esbuild - uglify-js - webpack@5.92.0(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11): + webpack@5.92.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12): dependencies: '@types/eslint-scope': 3.7.7 '@types/estree': 1.0.5 @@ -17059,7 +17589,7 @@ snapshots: neo-async: 2.6.2 schema-utils: 3.3.0 tapable: 2.2.1 - terser-webpack-plugin: 5.3.10(@swc/core@1.6.1(@swc/helpers@0.5.11))(webpack@5.92.0(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11)) + terser-webpack-plugin: 5.3.10(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)(webpack@5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11)) watchpack: 2.4.1 webpack-sources: 3.2.3 transitivePeerDependencies: @@ -17152,8 +17682,6 @@ snapshots: ws@7.5.9: {} - ws@8.11.0: {} - ws@8.16.0: {} ws@8.17.1: {} From b5de3a5e701931c83ae32dd3aa36d54767ccc6c6 Mon Sep 17 00:00:00 2001 From: aXenDeveloper Date: Fri, 21 Jun 2024 09:45:56 +0200 Subject: [PATCH 09/27] fix(github): Pre-install pnpm in build workflow --- .github/workflows/build.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d3b52e8c9..b8d642507 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,18 +18,17 @@ jobs: with: fetch-depth: 2 + - uses: pnpm/action-setup@v4 + name: Install pnpm + with: + version: 9 + - name: Install Node.js uses: actions/setup-node@v4 with: node-version: 20 cache: "pnpm" - - uses: pnpm/action-setup@v4 - name: Install pnpm - with: - version: 9 - run_install: false - - name: Install dependencies run: pnpm install From 368b52cbe9565e7566db7b2aa2cb11f48c2ab19d Mon Sep 17 00:00:00 2001 From: aXenDeveloper Date: Fri, 21 Jun 2024 09:46:41 +0200 Subject: [PATCH 10/27] chore: Change pnpm version --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b8d642507..f20752338 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: - uses: pnpm/action-setup@v4 name: Install pnpm with: - version: 9 + version: 9.3.0 - name: Install Node.js uses: actions/setup-node@v4 From 1ecfbfe25471dbeb267f4b2ae8e5ccbd6c44ad6b Mon Sep 17 00:00:00 2001 From: aXenDeveloper Date: Fri, 21 Jun 2024 10:35:28 +0200 Subject: [PATCH 11/27] perf(backend): Move nav module into package --- apps/backend/schema.gql | 4 --- apps/backend/src/app.module.ts | 4 ++- .../src/plugins/core/admin/admin.module.ts | 4 +-- apps/backend/src/plugins/core/core.module.ts | 2 -- packages/backend/package.json | 1 + packages/backend/src/core/core.module.ts | 4 ++- .../backend/src}/core/nav/nav.module.ts | 0 .../src}/core/nav/show/dto/show.args.ts | 3 +- .../src}/core/nav/show/dto/show.obj.ts | 3 +- .../src}/core/nav/show/show.resolver.ts | 0 .../src}/core/nav/show/show.service.ts | 12 +++---- .../backend/src/database/database.module.ts | 1 + .../backend/src/database/database.service.ts | 5 ++- packages/backend/tsconfig.json | 4 +-- pnpm-lock.yaml | 35 ++++++++++--------- 15 files changed, 39 insertions(+), 43 deletions(-) rename {apps/backend/src/plugins => packages/backend/src}/core/nav/nav.module.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/nav/show/dto/show.args.ts (67%) rename {apps/backend/src/plugins => packages/backend/src}/core/nav/show/dto/show.obj.ts (92%) rename {apps/backend/src/plugins => packages/backend/src}/core/nav/show/show.resolver.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/nav/show/show.service.ts (86%) diff --git a/apps/backend/schema.gql b/apps/backend/schema.gql index 9b73aac22..f2903aeab 100644 --- a/apps/backend/schema.gql +++ b/apps/backend/schema.gql @@ -175,10 +175,6 @@ type Mutation { admin__core_main_settings__edit(site_copyright: [TextLanguageInput!]!, site_description: [TextLanguageInput!]!, site_name: String!, site_short_name: String!): EditAdminSettingsObj! admin__core_manifest_metadata__edit(background_color: String!, display: String!, start_url: String!, theme_color: String!): ShowAdminManifestMetadataObj! admin__core_members__edit(birthday: DateTime!, email: String!, first_name: String!, id: Int!, last_name: String!, name: String!, newsletter: Boolean!): EditAdminMembersObj! - admin__core_nav__change_position(id: Int!, index_to_move: Int!, parent_id: Int!): String! - admin__core_nav__create(description: [TextLanguageInput!]!, external: Boolean!, href: String!, icon: String, name: [TextLanguageInput!]!): ShowCoreNav! - admin__core_nav__delete(id: Int!): String! - admin__core_nav__edit(description: [TextLanguageInput!]!, external: Boolean!, href: String!, icon: String, id: Int!, name: [TextLanguageInput!]!): ShowCoreNav! admin__core_plugins__create(author: String!, author_url: String, code: String!, description: String, name: String!, support_url: String!): ShowAdminPlugins! admin__core_plugins__delete(code: String!): String! admin__core_plugins__download(code: String!, version: String, version_code: Int): String! diff --git a/apps/backend/src/app.module.ts b/apps/backend/src/app.module.ts index 2e26519fa..4b6521118 100644 --- a/apps/backend/src/app.module.ts +++ b/apps/backend/src/app.module.ts @@ -5,6 +5,7 @@ import { VitNodeCoreModule } from "vitnode-backend"; import { PluginsModule } from "./plugins/plugins.module"; import { DATABASE_ENVS } from "./database/client"; +import { schemaDatabase } from "./database/schema"; @Module({ imports: [ @@ -13,7 +14,8 @@ import { DATABASE_ENVS } from "./database/client"; envFile: join(process.cwd(), "..", "..", ".env") }, database: { - config: DATABASE_ENVS + config: DATABASE_ENVS, + schemaDatabase } }), PluginsModule diff --git a/apps/backend/src/plugins/core/admin/admin.module.ts b/apps/backend/src/plugins/core/admin/admin.module.ts index d1d08438c..e90e43b5c 100644 --- a/apps/backend/src/plugins/core/admin/admin.module.ts +++ b/apps/backend/src/plugins/core/admin/admin.module.ts @@ -12,7 +12,7 @@ import { AdminFilesModule } from "./files/files.module"; import { AdminGroupsModule } from "./groups/groups.module"; import { AdminLanguagesModule } from "./languages/languages.module"; import { AdminMembersModule } from "./members/members.module"; -import { AdminNavModule } from "./nav/nav.module"; +// import { AdminNavModule } from "./nav/nav.module"; import { AdminStaffModule } from "./staff/staff.module"; import { AdminThemeEditorModule } from "./theme_editor/theme_editor.module"; import { AdminEmailModule } from "./email/email.module"; @@ -29,7 +29,7 @@ import { AdminEmailModule } from "./email/email.module"; AdminGroupsModule, AdminLanguagesModule, AdminMembersModule, - AdminNavModule, + // AdminNavModule, AdminStaffModule, AdminThemeEditorModule, AdminEmailModule diff --git a/apps/backend/src/plugins/core/core.module.ts b/apps/backend/src/plugins/core/core.module.ts index 2be409614..70a55f6e5 100644 --- a/apps/backend/src/plugins/core/core.module.ts +++ b/apps/backend/src/plugins/core/core.module.ts @@ -12,7 +12,6 @@ import { GlobalCoreHelpersModule } from "./helpers/helpers.module"; import { CoreLanguagesModule } from "./languages/languages.module"; import { CoreMembersModule } from "./members/members.module"; import { CoreMiddlewareModule } from "./middleware/middleware.module"; -import { CoreNavModule } from "./nav/nav.module"; import { CorePluginsModule } from "./plugins/plugins.module"; import { CoreThemeEditorModule } from "./theme_editor/theme_editor.module"; @@ -29,7 +28,6 @@ import { CoreThemeEditorModule } from "./theme_editor/theme_editor.module"; CoreLanguagesModule, CoreMembersModule, CoreMiddlewareModule, - CoreNavModule, CorePluginsModule, CoreThemeEditorModule ] diff --git a/packages/backend/package.json b/packages/backend/package.json index 44816ae4b..40eb35285 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -33,6 +33,7 @@ "@types/object-path": "^0.11.4", "@types/pg": "^8.11.6", "busboy": "^1.6.0", + "class-transformer": "^0.5.1", "eslint-config-vitnode": "workspace:*", "http-errors": "^2.0.0", "object-path": "^0.11.8", diff --git a/packages/backend/src/core/core.module.ts b/packages/backend/src/core/core.module.ts index e1302b80d..ed1927779 100644 --- a/packages/backend/src/core/core.module.ts +++ b/packages/backend/src/core/core.module.ts @@ -1,6 +1,8 @@ import { Module } from "@nestjs/common"; +import { CoreNavModule } from "./nav/nav.module"; + @Module({ - imports: [] + imports: [CoreNavModule] }) export class CoreModule {} diff --git a/apps/backend/src/plugins/core/nav/nav.module.ts b/packages/backend/src/core/nav/nav.module.ts similarity index 100% rename from apps/backend/src/plugins/core/nav/nav.module.ts rename to packages/backend/src/core/nav/nav.module.ts diff --git a/apps/backend/src/plugins/core/nav/show/dto/show.args.ts b/packages/backend/src/core/nav/show/dto/show.args.ts similarity index 67% rename from apps/backend/src/plugins/core/nav/show/dto/show.args.ts rename to packages/backend/src/core/nav/show/dto/show.args.ts index 91e3eb231..6d83678f2 100644 --- a/apps/backend/src/plugins/core/nav/show/dto/show.args.ts +++ b/packages/backend/src/core/nav/show/dto/show.args.ts @@ -1,5 +1,6 @@ import { ArgsType } from "@nestjs/graphql"; -import { PaginationArgs } from "vitnode-backend"; + +import { PaginationArgs } from "../../../../utils"; @ArgsType() export class ShowCoreNavArgs extends PaginationArgs {} diff --git a/apps/backend/src/plugins/core/nav/show/dto/show.obj.ts b/packages/backend/src/core/nav/show/dto/show.obj.ts similarity index 92% rename from apps/backend/src/plugins/core/nav/show/dto/show.obj.ts rename to packages/backend/src/core/nav/show/dto/show.obj.ts index 8b31bfb50..405d123fd 100644 --- a/apps/backend/src/plugins/core/nav/show/dto/show.obj.ts +++ b/packages/backend/src/core/nav/show/dto/show.obj.ts @@ -1,5 +1,6 @@ import { Field, Int, ObjectType } from "@nestjs/graphql"; -import { PageInfo, TextLanguage } from "vitnode-backend"; + +import { PageInfo, TextLanguage } from "../../../../utils"; @ObjectType() class ShowCoreNavItem { diff --git a/apps/backend/src/plugins/core/nav/show/show.resolver.ts b/packages/backend/src/core/nav/show/show.resolver.ts similarity index 100% rename from apps/backend/src/plugins/core/nav/show/show.resolver.ts rename to packages/backend/src/core/nav/show/show.resolver.ts diff --git a/apps/backend/src/plugins/core/nav/show/show.service.ts b/packages/backend/src/core/nav/show/show.service.ts similarity index 86% rename from apps/backend/src/plugins/core/nav/show/show.service.ts rename to packages/backend/src/core/nav/show/show.service.ts index 98e08d2d3..e3d252408 100644 --- a/apps/backend/src/plugins/core/nav/show/show.service.ts +++ b/packages/backend/src/core/nav/show/show.service.ts @@ -1,16 +1,12 @@ import { Injectable } from "@nestjs/common"; import { and, count, eq } from "drizzle-orm"; -import { - inputPaginationCursor, - outputPagination, - SortDirectionEnum, - DatabaseService -} from "vitnode-backend"; import { ShowCoreNavArgs } from "./dto/show.args"; import { ShowCoreNavObj } from "./dto/show.obj"; - -import { core_nav } from "@/plugins/core/admin/database/schema/nav"; +import { DatabaseService } from "../../../database"; +import { inputPaginationCursor, outputPagination } from "../../../functions"; +import { core_nav } from "../../../templates/core/admin/database/schema/nav"; +import { SortDirectionEnum } from "../../../utils"; @Injectable() export class ShowCoreNavService { diff --git a/packages/backend/src/database/database.module.ts b/packages/backend/src/database/database.module.ts index 190f1df11..375816d7f 100644 --- a/packages/backend/src/database/database.module.ts +++ b/packages/backend/src/database/database.module.ts @@ -12,6 +12,7 @@ registerEnumType(SortDirectionEnum, { export interface DatabaseModuleArgs { config: PoolConfig; + schemaDatabase: Record; } @Global() diff --git a/packages/backend/src/database/database.service.ts b/packages/backend/src/database/database.service.ts index 8af9cbfc2..cad217b10 100644 --- a/packages/backend/src/database/database.service.ts +++ b/packages/backend/src/database/database.service.ts @@ -3,8 +3,7 @@ import { NodePgDatabase } from "drizzle-orm/node-postgres"; import { DatabaseModuleArgs } from "./database.module"; import { createClientDatabase } from "./client"; - -import coreSchemaDatabase from "@/templates/core/admin/database"; +import coreSchemaDatabase from "../templates/core/admin/database"; @Injectable() export class DatabaseService { @@ -15,7 +14,7 @@ export class DatabaseService { private readonly options: DatabaseModuleArgs ) { const client = createClientDatabase({ - schemaDatabase: {}, + schemaDatabase: this.options.schemaDatabase, config: this.options.config }); diff --git a/packages/backend/tsconfig.json b/packages/backend/tsconfig.json index ccf0ad3f9..7b285e14d 100644 --- a/packages/backend/tsconfig.json +++ b/packages/backend/tsconfig.json @@ -8,9 +8,7 @@ "declaration": true, "experimentalDecorators": true, "strictNullChecks": false, - "paths": { - "@/*": ["./src/*"] - } + "emitDecoratorMetadata": true }, "include": ["src/**/*"] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8bd635b57..ff37cd56e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -101,7 +101,7 @@ importers: version: 4.2.1(graphql@16.8.2) '@nestjs/cli': specifier: ^10.3.2 - version: 10.3.2(@swc/cli@0.3.12(@swc/core@1.6.3(@swc/helpers@0.5.11))(chokidar@3.6.0))(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12) + version: 10.3.2(@swc/cli@0.3.12(@swc/core@1.6.3(@swc/helpers@0.5.11))(chokidar@3.6.0))(@swc/core@1.6.3(@swc/helpers@0.5.11)) '@nestjs/schematics': specifier: ^10.1.1 version: 10.1.1(chokidar@3.6.0)(typescript@5.5.2) @@ -545,6 +545,9 @@ importers: busboy: specifier: ^1.6.0 version: 1.6.0 + class-transformer: + specifier: ^0.5.1 + version: 0.5.1 eslint-config-vitnode: specifier: workspace:* version: link:../eslint-config-vitnode @@ -10412,7 +10415,7 @@ snapshots: lodash.omit: 4.5.0 tslib: 2.6.2 - '@nestjs/cli@10.3.2(@swc/cli@0.3.12(@swc/core@1.6.3(@swc/helpers@0.5.11))(chokidar@3.6.0))(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)': + '@nestjs/cli@10.3.2(@swc/cli@0.3.12(@swc/core@1.6.3(@swc/helpers@0.5.11))(chokidar@3.6.0))(@swc/core@1.6.3(@swc/helpers@0.5.11))': dependencies: '@angular-devkit/core': 17.1.2(chokidar@3.6.0) '@angular-devkit/schematics': 17.1.2(chokidar@3.6.0) @@ -10422,7 +10425,7 @@ snapshots: chokidar: 3.6.0 cli-table3: 0.6.3 commander: 4.1.1 - fork-ts-checker-webpack-plugin: 9.0.2(typescript@5.3.3)(webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)) + fork-ts-checker-webpack-plugin: 9.0.2(typescript@5.3.3)(webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))) glob: 10.3.10 inquirer: 8.2.6 node-emoji: 1.11.0 @@ -10434,7 +10437,7 @@ snapshots: tsconfig-paths: 4.2.0 tsconfig-paths-webpack-plugin: 4.1.0 typescript: 5.3.3 - webpack: 5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12) + webpack: 5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11)) webpack-node-externals: 3.0.0 optionalDependencies: '@swc/cli': 0.3.12(@swc/core@1.6.3(@swc/helpers@0.5.11))(chokidar@3.6.0) @@ -12439,7 +12442,7 @@ snapshots: dependencies: '@types/node': 20.14.7 tapable: 2.2.1 - webpack: 5.92.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12) + webpack: 5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11) transitivePeerDependencies: - '@swc/core' - esbuild @@ -14482,7 +14485,7 @@ snapshots: cross-spawn: 7.0.3 signal-exit: 4.1.0 - fork-ts-checker-webpack-plugin@9.0.2(typescript@5.3.3)(webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)): + fork-ts-checker-webpack-plugin@9.0.2(typescript@5.3.3)(webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))): dependencies: '@babel/code-frame': 7.24.7 chalk: 4.1.2 @@ -14497,7 +14500,7 @@ snapshots: semver: 7.6.2 tapable: 2.2.1 typescript: 5.3.3 - webpack: 5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12) + webpack: 5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11)) form-data@4.0.0: dependencies: @@ -17140,29 +17143,27 @@ snapshots: mkdirp: 3.0.1 yallist: 5.0.0 - terser-webpack-plugin@5.3.10(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)(webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)): + terser-webpack-plugin@5.3.10(@swc/core@1.6.3(@swc/helpers@0.5.11))(webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))): dependencies: '@jridgewell/trace-mapping': 0.3.25 jest-worker: 27.5.1 schema-utils: 3.3.0 serialize-javascript: 6.0.2 terser: 5.31.1 - webpack: 5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12) + webpack: 5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11)) optionalDependencies: '@swc/core': 1.6.3(@swc/helpers@0.5.11) - esbuild: 0.19.12 - terser-webpack-plugin@5.3.10(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)(webpack@5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11)): + terser-webpack-plugin@5.3.10(@swc/core@1.6.3(@swc/helpers@0.5.11))(webpack@5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11)): dependencies: '@jridgewell/trace-mapping': 0.3.25 jest-worker: 27.5.1 schema-utils: 3.3.0 serialize-javascript: 6.0.2 terser: 5.31.1 - webpack: 5.92.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12) + webpack: 5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11) optionalDependencies: '@swc/core': 1.6.3(@swc/helpers@0.5.11) - esbuild: 0.19.12 terser@5.31.1: dependencies: @@ -17535,7 +17536,7 @@ snapshots: webpack-sources@3.2.3: {} - webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12): + webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11)): dependencies: '@types/eslint-scope': 3.7.7 '@types/estree': 1.0.5 @@ -17558,7 +17559,7 @@ snapshots: neo-async: 2.6.2 schema-utils: 3.3.0 tapable: 2.2.1 - terser-webpack-plugin: 5.3.10(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)(webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)) + terser-webpack-plugin: 5.3.10(@swc/core@1.6.3(@swc/helpers@0.5.11))(webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))) watchpack: 2.4.1 webpack-sources: 3.2.3 transitivePeerDependencies: @@ -17566,7 +17567,7 @@ snapshots: - esbuild - uglify-js - webpack@5.92.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12): + webpack@5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11): dependencies: '@types/eslint-scope': 3.7.7 '@types/estree': 1.0.5 @@ -17589,7 +17590,7 @@ snapshots: neo-async: 2.6.2 schema-utils: 3.3.0 tapable: 2.2.1 - terser-webpack-plugin: 5.3.10(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)(webpack@5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11)) + terser-webpack-plugin: 5.3.10(@swc/core@1.6.3(@swc/helpers@0.5.11))(webpack@5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11)) watchpack: 2.4.1 webpack-sources: 3.2.3 transitivePeerDependencies: From 62dfbe1133b65daaa0ef6d229bc337b633315a7f Mon Sep 17 00:00:00 2001 From: aXenDeveloper Date: Fri, 21 Jun 2024 12:01:02 +0200 Subject: [PATCH 12/27] perf(backend): Move session module to package --- apps/backend/schema.gql | 1 - .../src/plugins/core/admin/admin.module.ts | 8 --- .../files/download/download.controller.ts | 8 ++- apps/backend/src/plugins/core/core.module.ts | 6 -- .../src/plugins/core/files/files.module.ts | 3 +- .../src/utils/guards/admin-auth.guard.ts | 4 +- .../utils/guards/admin-permission.guard.ts | 7 ++- apps/backend/src/utils/guards/auth.guard.ts | 4 +- packages/backend/package.json | 6 +- packages/backend/src/app.module.ts | 6 +- .../backend/src/core/admin/admin.module.ts | 11 ++++ .../authorization/authorization.resolver.ts | 3 +- .../authorization/authorization.service.ts | 32 ++++------ .../authorization/dto/authorization.obj.ts | 7 +-- .../core/admin/sessions/sessions.module.ts | 0 .../sessions/sign_out/sign_out.resolver.ts | 3 +- .../sessions/sign_out/sign_out.service.ts | 5 +- packages/backend/src/core/core.module.ts | 12 +++- .../backend/src/core/nav/show/show.service.ts | 1 + .../authorization/authorization.resolver.ts | 3 +- .../authorization/authorization.service.ts | 5 +- .../authorization/dto/authorization.obj.ts | 3 +- .../internal_authorization.service.ts | 17 +++--- .../core/sessions/devices/devices.module.ts | 0 .../sessions/devices/show/dto/show.obj.ts | 0 .../sessions/devices/show/show.resolver.ts | 4 +- .../sessions/devices/show/show.service.ts | 5 +- .../src}/core/sessions/sessions.cron.ts | 7 +-- .../src}/core/sessions/sessions.module.ts | 0 .../core/sessions/sign_in/device.service.ts | 11 ++-- .../core/sessions/sign_in/dto/sign_in.args.ts | 0 .../core/sessions/sign_in/sign_in.resolver.ts | 3 +- .../core/sessions/sign_in/sign_in.service.ts | 13 ++-- .../sessions/sign_out/sign_out.resolver.ts | 3 +- .../sessions/sign_out/sign_out.service.ts | 5 +- packages/backend/src/index.ts | 4 ++ .../src/utils/guards/admin-auth.guard.ts | 31 ++++++++++ .../utils/guards/admin-permission.guard.ts | 61 +++++++++++++++++++ .../backend/src/utils/guards/auth.guard.ts | 45 ++++++++++++++ .../backend/src/utils/guards/dev.guard.ts | 14 +++++ pnpm-lock.yaml | 44 ++++++++----- 41 files changed, 292 insertions(+), 113 deletions(-) create mode 100644 packages/backend/src/core/admin/admin.module.ts rename {apps/backend/src/plugins => packages/backend/src}/core/admin/sessions/authorization/authorization.resolver.ts (93%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/sessions/authorization/authorization.service.ts (78%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/sessions/authorization/dto/authorization.obj.ts (63%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/sessions/sessions.module.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/sessions/sign_out/sign_out.resolver.ts (90%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/sessions/sign_out/sign_out.service.ts (84%) rename {apps/backend/src/plugins => packages/backend/src}/core/sessions/authorization/authorization.resolver.ts (93%) rename {apps/backend/src/plugins => packages/backend/src}/core/sessions/authorization/authorization.service.ts (95%) rename {apps/backend/src/plugins => packages/backend/src}/core/sessions/authorization/dto/authorization.obj.ts (94%) rename {apps/backend/src/plugins => packages/backend/src}/core/sessions/authorization/internal/internal_authorization.service.ts (87%) rename {apps/backend/src/plugins => packages/backend/src}/core/sessions/devices/devices.module.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/sessions/devices/show/dto/show.obj.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/sessions/devices/show/show.resolver.ts (82%) rename {apps/backend/src/plugins => packages/backend/src}/core/sessions/devices/show/show.service.ts (83%) rename {apps/backend/src/plugins => packages/backend/src}/core/sessions/sessions.cron.ts (83%) rename {apps/backend/src/plugins => packages/backend/src}/core/sessions/sessions.module.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/sessions/sign_in/device.service.ts (87%) rename {apps/backend/src/plugins => packages/backend/src}/core/sessions/sign_in/dto/sign_in.args.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/sessions/sign_in/sign_in.resolver.ts (93%) rename {apps/backend/src/plugins => packages/backend/src}/core/sessions/sign_in/sign_in.service.ts (94%) rename {apps/backend/src/plugins => packages/backend/src}/core/sessions/sign_out/sign_out.resolver.ts (91%) rename {apps/backend/src/plugins => packages/backend/src}/core/sessions/sign_out/sign_out.service.ts (84%) create mode 100644 packages/backend/src/utils/guards/admin-auth.guard.ts create mode 100644 packages/backend/src/utils/guards/admin-permission.guard.ts create mode 100644 packages/backend/src/utils/guards/auth.guard.ts create mode 100644 packages/backend/src/utils/guards/dev.guard.ts diff --git a/apps/backend/schema.gql b/apps/backend/schema.gql index f2903aeab..b05ea5e10 100644 --- a/apps/backend/schema.gql +++ b/apps/backend/schema.gql @@ -204,7 +204,6 @@ type Mutation { type NavAdminPluginsAuthorization { code: String! - nav: [ShowAdminNavPluginsObj!]! } type PageInfo { diff --git a/apps/backend/src/plugins/core/admin/admin.module.ts b/apps/backend/src/plugins/core/admin/admin.module.ts index e90e43b5c..38a52cf63 100644 --- a/apps/backend/src/plugins/core/admin/admin.module.ts +++ b/apps/backend/src/plugins/core/admin/admin.module.ts @@ -1,10 +1,6 @@ import { Module } from "@nestjs/common"; import { AdminInstallModule } from "./install/install.module"; -import { - AdminSessionsModule, - GlobalAdminSessionsModule -} from "./sessions/sessions.module"; import { AdminSettingsModule } from "./settings/settings.module"; import { AdminPluginsModule } from "./plugins/plugins.module"; import { AdminMetadataModule } from "./metadata/metadata.module"; @@ -12,7 +8,6 @@ import { AdminFilesModule } from "./files/files.module"; import { AdminGroupsModule } from "./groups/groups.module"; import { AdminLanguagesModule } from "./languages/languages.module"; import { AdminMembersModule } from "./members/members.module"; -// import { AdminNavModule } from "./nav/nav.module"; import { AdminStaffModule } from "./staff/staff.module"; import { AdminThemeEditorModule } from "./theme_editor/theme_editor.module"; import { AdminEmailModule } from "./email/email.module"; @@ -20,8 +15,6 @@ import { AdminEmailModule } from "./email/email.module"; @Module({ imports: [ AdminInstallModule, - GlobalAdminSessionsModule, - AdminSessionsModule, AdminSettingsModule, AdminPluginsModule, AdminMetadataModule, @@ -29,7 +22,6 @@ import { AdminEmailModule } from "./email/email.module"; AdminGroupsModule, AdminLanguagesModule, AdminMembersModule, - // AdminNavModule, AdminStaffModule, AdminThemeEditorModule, AdminEmailModule diff --git a/apps/backend/src/plugins/core/admin/files/download/download.controller.ts b/apps/backend/src/plugins/core/admin/files/download/download.controller.ts index 3df81bed7..165558a53 100644 --- a/apps/backend/src/plugins/core/admin/files/download/download.controller.ts +++ b/apps/backend/src/plugins/core/admin/files/download/download.controller.ts @@ -10,10 +10,12 @@ import { StreamableFile } from "@nestjs/common"; import { Request, Response } from "express"; -import { DatabaseService } from "vitnode-backend"; +import { + AuthorizationAdminSessionsService, + DatabaseService, + InternalAuthorizationCoreSessionsService +} from "vitnode-backend"; -import { AuthorizationAdminSessionsService } from "../../sessions/authorization/authorization.service"; -import { InternalAuthorizationCoreSessionsService } from "@/plugins/core/sessions/authorization/internal/internal_authorization.service"; import { ABSOLUTE_PATHS } from "@/config"; @Controller("files") diff --git a/apps/backend/src/plugins/core/core.module.ts b/apps/backend/src/plugins/core/core.module.ts index 70a55f6e5..6005ceb4f 100644 --- a/apps/backend/src/plugins/core/core.module.ts +++ b/apps/backend/src/plugins/core/core.module.ts @@ -1,10 +1,6 @@ import { Module } from "@nestjs/common"; import { AdminModule } from "./admin/admin.module"; -import { - CoreSessionsModule, - GlobalCoreSessionsModule -} from "./sessions/sessions.module"; import { CoreSettingsModule } from "./settings/settings.module"; import { CoreFilesModule, GlobalCoreFilesModule } from "./files/files.module"; import { CoreEditorModule } from "./editor/editor.module"; @@ -18,8 +14,6 @@ import { CoreThemeEditorModule } from "./theme_editor/theme_editor.module"; @Module({ imports: [ AdminModule, - GlobalCoreSessionsModule, - CoreSessionsModule, CoreSettingsModule, GlobalCoreFilesModule, CoreFilesModule, diff --git a/apps/backend/src/plugins/core/files/files.module.ts b/apps/backend/src/plugins/core/files/files.module.ts index e42396848..9ab6326b3 100644 --- a/apps/backend/src/plugins/core/files/files.module.ts +++ b/apps/backend/src/plugins/core/files/files.module.ts @@ -2,12 +2,13 @@ import { Global, Module } from "@nestjs/common"; import { UploadCoreFilesService } from "./helpers/upload/upload.service"; import { DeleteCoreFilesService } from "./helpers/delete/delete.service"; -import { AuthorizationAdminSessionsService } from "../admin/sessions/authorization/authorization.service"; import { ShowCoreFilesService } from "./show/show.service"; import { ShowCoreFilesResolver } from "./show/show.resolver"; import { CoreFilesCron } from "./files.cron"; import { DownloadSecureFilesController } from "./download/download.controller"; +import { AuthorizationAdminSessionsService } from "vitnode-backend"; + @Module({ providers: [ShowCoreFilesService, ShowCoreFilesResolver, CoreFilesCron] }) diff --git a/apps/backend/src/utils/guards/admin-auth.guard.ts b/apps/backend/src/utils/guards/admin-auth.guard.ts index 6ab1cd89e..73e53fba9 100644 --- a/apps/backend/src/utils/guards/admin-auth.guard.ts +++ b/apps/backend/src/utils/guards/admin-auth.guard.ts @@ -1,8 +1,6 @@ import { CanActivate, ExecutionContext, Injectable } from "@nestjs/common"; import { GqlExecutionContext } from "@nestjs/graphql"; -import { Ctx } from "vitnode-backend"; - -import { AuthorizationAdminSessionsService } from "@/plugins/core/admin/sessions/authorization/authorization.service"; +import { AuthorizationAdminSessionsService, Ctx } from "vitnode-backend"; @Injectable() export class AdminAuthGuards implements CanActivate { diff --git a/apps/backend/src/utils/guards/admin-permission.guard.ts b/apps/backend/src/utils/guards/admin-permission.guard.ts index adba05597..01e92ec6b 100644 --- a/apps/backend/src/utils/guards/admin-permission.guard.ts +++ b/apps/backend/src/utils/guards/admin-permission.guard.ts @@ -2,9 +2,12 @@ import { CanActivate, ExecutionContext, Injectable } from "@nestjs/common"; import { Reflector } from "@nestjs/core"; import { GqlExecutionContext } from "@nestjs/graphql"; import { eq } from "drizzle-orm"; -import { Ctx, DatabaseService } from "vitnode-backend"; +import { + AuthorizationAdminSessionsService, + Ctx, + DatabaseService +} from "vitnode-backend"; -import { AuthorizationAdminSessionsService } from "@/plugins/core/admin/sessions/authorization/authorization.service"; import { core_users } from "@/plugins/core/admin/database/schema/users"; @Injectable() diff --git a/apps/backend/src/utils/guards/auth.guard.ts b/apps/backend/src/utils/guards/auth.guard.ts index ae94b436a..f9f0ef5ee 100644 --- a/apps/backend/src/utils/guards/auth.guard.ts +++ b/apps/backend/src/utils/guards/auth.guard.ts @@ -1,9 +1,7 @@ import { CanActivate, ExecutionContext, Injectable } from "@nestjs/common"; import { GqlExecutionContext } from "@nestjs/graphql"; import { Reflector } from "@nestjs/core"; -import { Ctx } from "vitnode-backend"; - -import { InternalAuthorizationCoreSessionsService } from "@/plugins/core/sessions/authorization/internal/internal_authorization.service"; +import { Ctx, InternalAuthorizationCoreSessionsService } from "vitnode-backend"; @Injectable() export class AuthGuards implements CanActivate { diff --git a/packages/backend/package.json b/packages/backend/package.json index 40eb35285..36116eba2 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -21,10 +21,12 @@ "@nestjs/apollo": "^12.1.0", "@nestjs/common": "^10.3.9", "@nestjs/config": "^3.2.2", + "@nestjs/core": "^10.3.9", "@nestjs/graphql": "^12.1.1", "@nestjs/jwt": "^10.2.0", "@nestjs/schedule": "^4.0.2", "@nestjs/serve-static": "^4.0.2", + "@types/bcrypt": "^5.0.2", "@types/busboy": "^1.5.4", "@types/cookie-parser": "^1.4.7", "@types/express": "^4.17.21", @@ -37,9 +39,11 @@ "eslint-config-vitnode": "workspace:*", "http-errors": "^2.0.0", "object-path": "^0.11.8", - "typescript": "^5.5.2" + "typescript": "^5.5.2", + "@vitnode/shared": "workspace:*" }, "dependencies": { + "bcrypt": "^5.1.1", "class-validator": "^0.14.1", "cookie-parser": "^1.4.6", "drizzle-kit": "^0.22.7", diff --git a/packages/backend/src/app.module.ts b/packages/backend/src/app.module.ts index 8fc71e207..ede501e9a 100644 --- a/packages/backend/src/app.module.ts +++ b/packages/backend/src/app.module.ts @@ -17,7 +17,11 @@ export const ABSOLUTE_PATHS_BACKEND = { schema: join(process.cwd(), "schema.gql"), uploads: { public: join(process.cwd(), "uploads", "public") - } + }, + plugin: ({ code }: { code: string }) => ({ + root: join(process.cwd(), "src", "plugin", code), + config: join(process.cwd(), "src", "plugin", code, "config.json") + }) }; const parseFrontendUrlFromEnv = () => { diff --git a/packages/backend/src/core/admin/admin.module.ts b/packages/backend/src/core/admin/admin.module.ts new file mode 100644 index 000000000..cd1c06f82 --- /dev/null +++ b/packages/backend/src/core/admin/admin.module.ts @@ -0,0 +1,11 @@ +import { Module } from "@nestjs/common"; + +import { + AdminSessionsModule, + GlobalAdminSessionsModule +} from "./sessions/sessions.module"; + +@Module({ + imports: [GlobalAdminSessionsModule, AdminSessionsModule] +}) +export class AdminModule {} diff --git a/apps/backend/src/plugins/core/admin/sessions/authorization/authorization.resolver.ts b/packages/backend/src/core/admin/sessions/authorization/authorization.resolver.ts similarity index 93% rename from apps/backend/src/plugins/core/admin/sessions/authorization/authorization.resolver.ts rename to packages/backend/src/core/admin/sessions/authorization/authorization.resolver.ts index 867ff1722..18b4022c8 100644 --- a/apps/backend/src/plugins/core/admin/sessions/authorization/authorization.resolver.ts +++ b/packages/backend/src/core/admin/sessions/authorization/authorization.resolver.ts @@ -1,9 +1,10 @@ import { Context, Query, Resolver } from "@nestjs/graphql"; -import { Ctx } from "vitnode-backend"; import { AuthorizationAdminSessionsService } from "./authorization.service"; import { AuthorizationAdminSessionsObj } from "./dto/authorization.obj"; +import { Ctx } from "../../../../utils"; + @Resolver() export class AuthorizationAdminSessionsResolver { constructor(private readonly service: AuthorizationAdminSessionsService) {} diff --git a/apps/backend/src/plugins/core/admin/sessions/authorization/authorization.service.ts b/packages/backend/src/core/admin/sessions/authorization/authorization.service.ts similarity index 78% rename from apps/backend/src/plugins/core/admin/sessions/authorization/authorization.service.ts rename to packages/backend/src/core/admin/sessions/authorization/authorization.service.ts index 83c459f7a..d2301c328 100644 --- a/apps/backend/src/plugins/core/admin/sessions/authorization/authorization.service.ts +++ b/packages/backend/src/core/admin/sessions/authorization/authorization.service.ts @@ -5,25 +5,18 @@ import { JwtService } from "@nestjs/jwt"; import { ConfigService } from "@nestjs/config"; import { eq } from "drizzle-orm"; import { currentUnixDate } from "@vitnode/shared"; -import { - AccessDeniedError, - getUserAgentData, - getUserIp, - Ctx, - DatabaseService -} from "vitnode-backend"; import { AuthorizationAdminSessionsObj, NavAdminPluginsAuthorization } from "./dto/authorization.obj"; -import { AuthorizationCurrentUserObj } from "@/plugins/core/sessions/authorization/dto/authorization.obj"; -import { getCoreInfo } from "../../settings/functions/get-core-info"; -import { ABSOLUTE_PATHS } from "@/config"; -import { ConfigPlugin } from "../../plugins/plugins.module"; -import { DeviceSignInCoreSessionsService } from "@/plugins/core/sessions/sign_in/device.service"; -import { core_sessions_known_devices } from "../../database/schema/sessions"; +import { DatabaseService } from "../../../../database"; +import { DeviceSignInCoreSessionsService } from "../../../sessions/sign_in/device.service"; +import { ABSOLUTE_PATHS_BACKEND, AccessDeniedError, Ctx } from "../../../.."; +import { AuthorizationCurrentUserObj } from "../../../sessions/authorization/dto/authorization.obj"; +import { core_sessions_known_devices } from "../../../../templates/core/admin/database/schema/sessions"; +import { getUserAgentData, getUserIp } from "../../../../functions"; @Injectable() export class AuthorizationAdminSessionsService { @@ -44,7 +37,7 @@ export class AuthorizationAdminSessionsService { return adminNav .map(({ code }) => { - const pathConfig = ABSOLUTE_PATHS.plugin({ code }).config; + const pathConfig = ABSOLUTE_PATHS_BACKEND.plugin({ code }).config; if (!fs.existsSync(pathConfig)) { return { code, @@ -52,9 +45,11 @@ export class AuthorizationAdminSessionsService { }; } - const config: ConfigPlugin = JSON.parse( - fs.readFileSync(pathConfig, "utf8") - ); + // TODO: Fix this + // const config: ConfigPlugin = JSON.parse( + // fs.readFileSync(pathConfig, "utf8") + // ); + const config = JSON.parse(fs.readFileSync(pathConfig, "utf8")); return { code, @@ -133,11 +128,10 @@ export class AuthorizationAdminSessionsService { async authorization(ctx: Ctx): Promise { const user = await this.initialAuthorization(ctx); - const coreInfo = await getCoreInfo(); return { user, - version: coreInfo.version, + version: "0.0.3", // TODO: Get version from package.json nav: await this.getAdminNav() }; } diff --git a/apps/backend/src/plugins/core/admin/sessions/authorization/dto/authorization.obj.ts b/packages/backend/src/core/admin/sessions/authorization/dto/authorization.obj.ts similarity index 63% rename from apps/backend/src/plugins/core/admin/sessions/authorization/dto/authorization.obj.ts rename to packages/backend/src/core/admin/sessions/authorization/dto/authorization.obj.ts index 8aaaed973..0c6e714ad 100644 --- a/apps/backend/src/plugins/core/admin/sessions/authorization/dto/authorization.obj.ts +++ b/packages/backend/src/core/admin/sessions/authorization/dto/authorization.obj.ts @@ -1,15 +1,14 @@ import { Field, ObjectType } from "@nestjs/graphql"; -import { AuthorizationCurrentUserObj } from "@/plugins/core/sessions/authorization/dto/authorization.obj"; -import { ShowAdminNavPluginsObj } from "../../../plugins/nav/show/dto/show.obj"; +import { AuthorizationCurrentUserObj } from "../../../../sessions/authorization/dto/authorization.obj"; @ObjectType() export class NavAdminPluginsAuthorization { @Field(() => String) code: string; - @Field(() => [ShowAdminNavPluginsObj]) - nav: ShowAdminNavPluginsObj[]; + // @Field(() => [ShowAdminNavPluginsObj]) + // nav: ShowAdminNavPluginsObj[]; } @ObjectType() diff --git a/apps/backend/src/plugins/core/admin/sessions/sessions.module.ts b/packages/backend/src/core/admin/sessions/sessions.module.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/sessions/sessions.module.ts rename to packages/backend/src/core/admin/sessions/sessions.module.ts diff --git a/apps/backend/src/plugins/core/admin/sessions/sign_out/sign_out.resolver.ts b/packages/backend/src/core/admin/sessions/sign_out/sign_out.resolver.ts similarity index 90% rename from apps/backend/src/plugins/core/admin/sessions/sign_out/sign_out.resolver.ts rename to packages/backend/src/core/admin/sessions/sign_out/sign_out.resolver.ts index 19c9df185..fa3944cf1 100644 --- a/apps/backend/src/plugins/core/admin/sessions/sign_out/sign_out.resolver.ts +++ b/packages/backend/src/core/admin/sessions/sign_out/sign_out.resolver.ts @@ -1,8 +1,9 @@ import { Context, Mutation, Resolver } from "@nestjs/graphql"; -import { Ctx } from "vitnode-backend"; import { SignOutAdminSessionsService } from "./sign_out.service"; +import { Ctx } from "../../../../utils"; + @Resolver() export class SignOutAdminSessionsResolver { constructor(private readonly service: SignOutAdminSessionsService) {} diff --git a/apps/backend/src/plugins/core/admin/sessions/sign_out/sign_out.service.ts b/packages/backend/src/core/admin/sessions/sign_out/sign_out.service.ts similarity index 84% rename from apps/backend/src/plugins/core/admin/sessions/sign_out/sign_out.service.ts rename to packages/backend/src/core/admin/sessions/sign_out/sign_out.service.ts index ff07256c4..a87c37d5b 100644 --- a/apps/backend/src/plugins/core/admin/sessions/sign_out/sign_out.service.ts +++ b/packages/backend/src/core/admin/sessions/sign_out/sign_out.service.ts @@ -1,9 +1,10 @@ import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; import { ConfigService } from "@nestjs/config"; -import { Ctx, DatabaseService } from "vitnode-backend"; -import { core_admin_sessions } from "@/plugins/core/admin/database/schema/admins"; +import { DatabaseService } from "../../../../database"; +import { Ctx } from "../../../../utils"; +import { core_admin_sessions } from "../../../../templates/core/admin/database/schema/admins"; @Injectable() export class SignOutAdminSessionsService { diff --git a/packages/backend/src/core/core.module.ts b/packages/backend/src/core/core.module.ts index ed1927779..f9d2d71ec 100644 --- a/packages/backend/src/core/core.module.ts +++ b/packages/backend/src/core/core.module.ts @@ -1,8 +1,18 @@ import { Module } from "@nestjs/common"; import { CoreNavModule } from "./nav/nav.module"; +import { + CoreSessionsModule, + GlobalCoreSessionsModule +} from "./sessions/sessions.module"; +import { AdminModule } from "./admin/admin.module"; @Module({ - imports: [CoreNavModule] + imports: [ + AdminModule, + CoreNavModule, + GlobalCoreSessionsModule, + CoreSessionsModule + ] }) export class CoreModule {} diff --git a/packages/backend/src/core/nav/show/show.service.ts b/packages/backend/src/core/nav/show/show.service.ts index e3d252408..b26b2f467 100644 --- a/packages/backend/src/core/nav/show/show.service.ts +++ b/packages/backend/src/core/nav/show/show.service.ts @@ -3,6 +3,7 @@ import { and, count, eq } from "drizzle-orm"; import { ShowCoreNavArgs } from "./dto/show.args"; import { ShowCoreNavObj } from "./dto/show.obj"; + import { DatabaseService } from "../../../database"; import { inputPaginationCursor, outputPagination } from "../../../functions"; import { core_nav } from "../../../templates/core/admin/database/schema/nav"; diff --git a/apps/backend/src/plugins/core/sessions/authorization/authorization.resolver.ts b/packages/backend/src/core/sessions/authorization/authorization.resolver.ts similarity index 93% rename from apps/backend/src/plugins/core/sessions/authorization/authorization.resolver.ts rename to packages/backend/src/core/sessions/authorization/authorization.resolver.ts index ae89b83f8..1470b643d 100644 --- a/apps/backend/src/plugins/core/sessions/authorization/authorization.resolver.ts +++ b/packages/backend/src/core/sessions/authorization/authorization.resolver.ts @@ -1,9 +1,10 @@ import { Context, Query, Resolver } from "@nestjs/graphql"; -import { Ctx } from "vitnode-backend"; import { AuthorizationCoreSessionsService } from "./authorization.service"; import { AuthorizationCoreSessionsObj } from "./dto/authorization.obj"; +import { Ctx } from "../../../utils"; + @Resolver() export class AuthorizationCoreSessionsResolver { constructor(private readonly service: AuthorizationCoreSessionsService) {} diff --git a/apps/backend/src/plugins/core/sessions/authorization/authorization.service.ts b/packages/backend/src/core/sessions/authorization/authorization.service.ts similarity index 95% rename from apps/backend/src/plugins/core/sessions/authorization/authorization.service.ts rename to packages/backend/src/core/sessions/authorization/authorization.service.ts index 9b973ef71..de16ed074 100644 --- a/apps/backend/src/plugins/core/sessions/authorization/authorization.service.ts +++ b/packages/backend/src/core/sessions/authorization/authorization.service.ts @@ -1,11 +1,12 @@ import { Injectable } from "@nestjs/common"; import { eq, sum } from "drizzle-orm"; -import { Ctx, DatabaseService } from "vitnode-backend"; import { InternalAuthorizationCoreSessionsService } from "./internal/internal_authorization.service"; import { AuthorizationCoreSessionsObj } from "./dto/authorization.obj"; -import { core_files } from "../../admin/database/schema/files"; +import { DatabaseService } from "../../../database"; +import { core_files } from "../../../templates/core/admin/database/schema/files"; +import { Ctx } from "../../../utils"; @Injectable() export class AuthorizationCoreSessionsService { diff --git a/apps/backend/src/plugins/core/sessions/authorization/dto/authorization.obj.ts b/packages/backend/src/core/sessions/authorization/dto/authorization.obj.ts similarity index 94% rename from apps/backend/src/plugins/core/sessions/authorization/dto/authorization.obj.ts rename to packages/backend/src/core/sessions/authorization/dto/authorization.obj.ts index 85698f9cb..175abc39e 100644 --- a/apps/backend/src/plugins/core/sessions/authorization/dto/authorization.obj.ts +++ b/packages/backend/src/core/sessions/authorization/dto/authorization.obj.ts @@ -1,5 +1,6 @@ import { Field, Float, Int, ObjectType } from "@nestjs/graphql"; -import { User } from "vitnode-backend"; + +import { User } from "../../../../decorators"; @ObjectType() export class AuthorizationCurrentUserObj extends User { diff --git a/apps/backend/src/plugins/core/sessions/authorization/internal/internal_authorization.service.ts b/packages/backend/src/core/sessions/authorization/internal/internal_authorization.service.ts similarity index 87% rename from apps/backend/src/plugins/core/sessions/authorization/internal/internal_authorization.service.ts rename to packages/backend/src/core/sessions/authorization/internal/internal_authorization.service.ts index c07f5b6d1..88f250435 100644 --- a/apps/backend/src/plugins/core/sessions/authorization/internal/internal_authorization.service.ts +++ b/packages/backend/src/core/sessions/authorization/internal/internal_authorization.service.ts @@ -3,18 +3,15 @@ import { JwtService } from "@nestjs/jwt"; import { ConfigService } from "@nestjs/config"; import { eq } from "drizzle-orm"; import { currentUnixDate } from "@vitnode/shared"; -import { - AccessDeniedError, - getUserAgentData, - getUserIp, - User, - Ctx, - DatabaseService -} from "vitnode-backend"; -import { core_sessions_known_devices } from "@/plugins/core/admin/database/schema/sessions"; import { DeviceSignInCoreSessionsService } from "../../sign_in/device.service"; -import { core_users } from "@/plugins/core/admin/database/schema/users"; +import { DatabaseService } from "../../../../database"; +import { User } from "../../../../decorators"; +import { Ctx } from "../../../../utils"; +import { AccessDeniedError } from "../../../../errors"; +import { core_users } from "../../../../templates/core/admin/database/schema/users"; +import { core_sessions_known_devices } from "../../../../templates/core/admin/database/schema/sessions"; +import { getUserAgentData, getUserIp } from "../../../../functions"; @Injectable() export class InternalAuthorizationCoreSessionsService { diff --git a/apps/backend/src/plugins/core/sessions/devices/devices.module.ts b/packages/backend/src/core/sessions/devices/devices.module.ts similarity index 100% rename from apps/backend/src/plugins/core/sessions/devices/devices.module.ts rename to packages/backend/src/core/sessions/devices/devices.module.ts diff --git a/apps/backend/src/plugins/core/sessions/devices/show/dto/show.obj.ts b/packages/backend/src/core/sessions/devices/show/dto/show.obj.ts similarity index 100% rename from apps/backend/src/plugins/core/sessions/devices/show/dto/show.obj.ts rename to packages/backend/src/core/sessions/devices/show/dto/show.obj.ts diff --git a/apps/backend/src/plugins/core/sessions/devices/show/show.resolver.ts b/packages/backend/src/core/sessions/devices/show/show.resolver.ts similarity index 82% rename from apps/backend/src/plugins/core/sessions/devices/show/show.resolver.ts rename to packages/backend/src/core/sessions/devices/show/show.resolver.ts index faee6c3a1..4b242bb30 100644 --- a/apps/backend/src/plugins/core/sessions/devices/show/show.resolver.ts +++ b/packages/backend/src/core/sessions/devices/show/show.resolver.ts @@ -1,11 +1,11 @@ import { Query, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { CurrentUser, User } from "vitnode-backend"; import { ShowCoreSessionDevicesService } from "./show.service"; import { ShowCoreSessionDevicesObj } from "./dto/show.obj"; -import { AuthGuards } from "@/utils/guards/auth.guard"; +import { CurrentUser, User } from "../../../../decorators"; +import { AuthGuards } from "../../../../utils/guards/auth.guard"; @Resolver() export class ShowCoreSessionDevicesResolver { diff --git a/apps/backend/src/plugins/core/sessions/devices/show/show.service.ts b/packages/backend/src/core/sessions/devices/show/show.service.ts similarity index 83% rename from apps/backend/src/plugins/core/sessions/devices/show/show.service.ts rename to packages/backend/src/core/sessions/devices/show/show.service.ts index 618d82030..bea1a6b8e 100644 --- a/apps/backend/src/plugins/core/sessions/devices/show/show.service.ts +++ b/packages/backend/src/core/sessions/devices/show/show.service.ts @@ -1,13 +1,14 @@ import { Injectable } from "@nestjs/common"; import { desc, eq } from "drizzle-orm"; -import { User, DatabaseService } from "vitnode-backend"; import { ShowCoreSessionDevicesObj } from "./dto/show.obj"; +import { DatabaseService } from "../../../../database"; +import { User } from "../../../../decorators"; import { core_sessions, core_sessions_known_devices -} from "@/plugins/core/admin/database/schema/sessions"; +} from "../../../../templates/core/admin/database/schema/sessions"; @Injectable() export class ShowCoreSessionDevicesService { diff --git a/apps/backend/src/plugins/core/sessions/sessions.cron.ts b/packages/backend/src/core/sessions/sessions.cron.ts similarity index 83% rename from apps/backend/src/plugins/core/sessions/sessions.cron.ts rename to packages/backend/src/core/sessions/sessions.cron.ts index 7617f452e..60250a6ab 100644 --- a/apps/backend/src/plugins/core/sessions/sessions.cron.ts +++ b/packages/backend/src/core/sessions/sessions.cron.ts @@ -2,11 +2,10 @@ import { Injectable } from "@nestjs/common"; import { Cron, CronExpression } from "@nestjs/schedule"; import { and, lte } from "drizzle-orm"; import { ConfigService } from "@nestjs/config"; -import { DatabaseService } from "vitnode-backend"; -import { core_admin_sessions } from "../admin/database/schema/admins"; - -import { core_sessions } from "@/plugins/core/admin/database/schema/sessions"; +import { DatabaseService } from "../../database"; +import { core_sessions } from "../../templates/core/admin/database/schema/sessions"; +import { core_admin_sessions } from "../../templates/core/admin/database/schema/admins"; @Injectable() export class CoreSessionsCron { diff --git a/apps/backend/src/plugins/core/sessions/sessions.module.ts b/packages/backend/src/core/sessions/sessions.module.ts similarity index 100% rename from apps/backend/src/plugins/core/sessions/sessions.module.ts rename to packages/backend/src/core/sessions/sessions.module.ts diff --git a/apps/backend/src/plugins/core/sessions/sign_in/device.service.ts b/packages/backend/src/core/sessions/sign_in/device.service.ts similarity index 87% rename from apps/backend/src/plugins/core/sessions/sign_in/device.service.ts rename to packages/backend/src/core/sessions/sign_in/device.service.ts index 783a7acc4..2e14a4c57 100644 --- a/apps/backend/src/plugins/core/sessions/sign_in/device.service.ts +++ b/packages/backend/src/core/sessions/sign_in/device.service.ts @@ -1,13 +1,10 @@ import { Injectable } from "@nestjs/common"; import { ConfigService } from "@nestjs/config"; -import { - getUserAgentData, - getUserIp, - Ctx, - DatabaseService -} from "vitnode-backend"; -import { core_sessions_known_devices } from "@/plugins/core/admin/database/schema/sessions"; +import { DatabaseService } from "../../../database"; +import { core_sessions_known_devices } from "../../../templates/core/admin/database/schema/sessions"; +import { Ctx } from "../../../utils"; +import { getUserIp, getUserAgentData } from "../../../functions"; interface DeviceType { id: number; diff --git a/apps/backend/src/plugins/core/sessions/sign_in/dto/sign_in.args.ts b/packages/backend/src/core/sessions/sign_in/dto/sign_in.args.ts similarity index 100% rename from apps/backend/src/plugins/core/sessions/sign_in/dto/sign_in.args.ts rename to packages/backend/src/core/sessions/sign_in/dto/sign_in.args.ts diff --git a/apps/backend/src/plugins/core/sessions/sign_in/sign_in.resolver.ts b/packages/backend/src/core/sessions/sign_in/sign_in.resolver.ts similarity index 93% rename from apps/backend/src/plugins/core/sessions/sign_in/sign_in.resolver.ts rename to packages/backend/src/core/sessions/sign_in/sign_in.resolver.ts index fdff02a81..d7f5b063c 100644 --- a/apps/backend/src/plugins/core/sessions/sign_in/sign_in.resolver.ts +++ b/packages/backend/src/core/sessions/sign_in/sign_in.resolver.ts @@ -1,9 +1,10 @@ import { Args, Context, Mutation, Resolver } from "@nestjs/graphql"; -import { Ctx } from "vitnode-backend"; import { SignInCoreSessionsService } from "./sign_in.service"; import { SignInCoreSessionsArgs } from "./dto/sign_in.args"; +import { Ctx } from "../../../utils"; + @Resolver() export class SignInCoreSessionsResolver { constructor(private readonly service: SignInCoreSessionsService) {} diff --git a/apps/backend/src/plugins/core/sessions/sign_in/sign_in.service.ts b/packages/backend/src/core/sessions/sign_in/sign_in.service.ts similarity index 94% rename from apps/backend/src/plugins/core/sessions/sign_in/sign_in.service.ts rename to packages/backend/src/core/sessions/sign_in/sign_in.service.ts index 34f203f11..3fe2e4b1e 100644 --- a/apps/backend/src/plugins/core/sessions/sign_in/sign_in.service.ts +++ b/packages/backend/src/core/sessions/sign_in/sign_in.service.ts @@ -3,18 +3,15 @@ import { compare } from "bcrypt"; import { JwtService } from "@nestjs/jwt"; import { ConfigService } from "@nestjs/config"; import { and, eq } from "drizzle-orm"; -import { - AccessDeniedError, - CustomError, - Ctx, - DatabaseService -} from "vitnode-backend"; import { SignInCoreSessionsArgs } from "./dto/sign_in.args"; import { DeviceSignInCoreSessionsService } from "./device.service"; -import { core_admin_sessions } from "@/plugins/core/admin/database/schema/admins"; -import { core_sessions } from "@/plugins/core/admin/database/schema/sessions"; +import { Ctx } from "../../../utils"; +import { DatabaseService } from "../../../database"; +import { AccessDeniedError, CustomError } from "../../../errors"; +import { core_admin_sessions } from "../../../templates/core/admin/database/schema/admins"; +import { core_sessions } from "../../../templates/core/admin/database/schema/sessions"; interface CreateSessionArgs extends Ctx { email: string; diff --git a/apps/backend/src/plugins/core/sessions/sign_out/sign_out.resolver.ts b/packages/backend/src/core/sessions/sign_out/sign_out.resolver.ts similarity index 91% rename from apps/backend/src/plugins/core/sessions/sign_out/sign_out.resolver.ts rename to packages/backend/src/core/sessions/sign_out/sign_out.resolver.ts index e28b9c1c7..0beee9c81 100644 --- a/apps/backend/src/plugins/core/sessions/sign_out/sign_out.resolver.ts +++ b/packages/backend/src/core/sessions/sign_out/sign_out.resolver.ts @@ -1,8 +1,9 @@ import { Context, Mutation, Resolver } from "@nestjs/graphql"; -import { Ctx } from "vitnode-backend"; import { SignOutCoreSessionsService } from "./sign_out.service"; +import { Ctx } from "../../../utils"; + @Resolver() export class SignOutCoreSessionsResolver { constructor(private readonly service: SignOutCoreSessionsService) {} diff --git a/apps/backend/src/plugins/core/sessions/sign_out/sign_out.service.ts b/packages/backend/src/core/sessions/sign_out/sign_out.service.ts similarity index 84% rename from apps/backend/src/plugins/core/sessions/sign_out/sign_out.service.ts rename to packages/backend/src/core/sessions/sign_out/sign_out.service.ts index 9bb6de3fa..7dd0f3414 100644 --- a/apps/backend/src/plugins/core/sessions/sign_out/sign_out.service.ts +++ b/packages/backend/src/core/sessions/sign_out/sign_out.service.ts @@ -1,9 +1,10 @@ import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; import { ConfigService } from "@nestjs/config"; -import { Ctx, DatabaseService } from "vitnode-backend"; -import { core_sessions } from "@/plugins/core/admin/database/schema/sessions"; +import { DatabaseService } from "../../../database"; +import { Ctx } from "../../../utils"; +import { core_sessions } from "../../../templates/core/admin/database/schema/sessions"; @Injectable() export class SignOutCoreSessionsService { diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts index 4b4acf751..f913a6411 100644 --- a/packages/backend/src/index.ts +++ b/packages/backend/src/index.ts @@ -6,3 +6,7 @@ export * from "./decorators"; export * from "./main"; export * from "./app.module"; export * from "./database"; + +// Services +export * from "./core/admin/sessions/authorization/authorization.service"; +export * from "./core/sessions/authorization/internal/internal_authorization.service"; diff --git a/packages/backend/src/utils/guards/admin-auth.guard.ts b/packages/backend/src/utils/guards/admin-auth.guard.ts new file mode 100644 index 000000000..cb55a8538 --- /dev/null +++ b/packages/backend/src/utils/guards/admin-auth.guard.ts @@ -0,0 +1,31 @@ +import { CanActivate, ExecutionContext, Injectable } from "@nestjs/common"; +import { GqlExecutionContext } from "@nestjs/graphql"; + +import { Ctx } from "../context"; +import { AuthorizationAdminSessionsService } from "../../core/admin/sessions/authorization/authorization.service"; + +@Injectable() +export class AdminAuthGuards implements CanActivate { + constructor(private readonly service: AuthorizationAdminSessionsService) {} + + protected async getAuth({ req, res }: Ctx) { + const data = await this.service.authorization({ + req, + res + }); + req.user = data.user; + + return data; + } + + async canActivate(context: ExecutionContext): Promise { + const ctx = GqlExecutionContext.create(context).getContext(); + + try { + return !!(await this.getAuth(ctx)); + } catch (e) { + // Return true if auth is optional + return true; + } + } +} diff --git a/packages/backend/src/utils/guards/admin-permission.guard.ts b/packages/backend/src/utils/guards/admin-permission.guard.ts new file mode 100644 index 000000000..b9d21bda9 --- /dev/null +++ b/packages/backend/src/utils/guards/admin-permission.guard.ts @@ -0,0 +1,61 @@ +import { CanActivate, ExecutionContext, Injectable } from "@nestjs/common"; +import { Reflector } from "@nestjs/core"; +import { GqlExecutionContext } from "@nestjs/graphql"; +import { eq } from "drizzle-orm"; + +import { Ctx } from "../context"; + +import { DatabaseService } from "../../database"; +import { AuthorizationAdminSessionsService } from "../../core/admin/sessions/authorization/authorization.service"; + +@Injectable() +export class AdminPermissionGuards implements CanActivate { + constructor( + private readonly reflector: Reflector, + private readonly service: AuthorizationAdminSessionsService, + private readonly databaseService: DatabaseService + ) {} + + protected async getAuth({ req, res }: Ctx) { + const data = await this.service.authorization({ + req, + res + }); + req.user = data.user; + + return data; + } + + async canActivate(context: ExecutionContext): Promise { + const ctx = GqlExecutionContext.create(context).getContext(); + + try { + const permission = this.reflector.get( + "permission", + context.getHandler() + ); + + const userId = ctx.getContext().user.id; + const user = await this.databaseService.db.query.core_users.findFirst({ + where: (table, { eq }) => eq(table.id, userId) + }); + + if (!user) return false; + + const admin = + await this.databaseService.db.query.core_admin_permissions.findFirst({ + where: (table, { or, eq }) => + or(eq(table.user_id, user.id), eq(table.group_id, user.group_id)) + }); + + if (!admin?.permissions) return false; + const permissions = admin.permissions; + if (permissions[permission] === true) return true; + + return false; + } catch (e) { + // Return true if auth is optional + return true; + } + } +} diff --git a/packages/backend/src/utils/guards/auth.guard.ts b/packages/backend/src/utils/guards/auth.guard.ts new file mode 100644 index 000000000..c2d2bdd9a --- /dev/null +++ b/packages/backend/src/utils/guards/auth.guard.ts @@ -0,0 +1,45 @@ +import { CanActivate, ExecutionContext, Injectable } from "@nestjs/common"; +import { GqlExecutionContext } from "@nestjs/graphql"; +import { Reflector } from "@nestjs/core"; + +import { Ctx } from "../context"; + +import { InternalAuthorizationCoreSessionsService } from "../../core/sessions/authorization/internal/internal_authorization.service"; + +@Injectable() +export class AuthGuards implements CanActivate { + constructor( + private readonly reflector: Reflector, + private readonly service: InternalAuthorizationCoreSessionsService + ) {} + + protected async getAuth({ req, res }: Ctx) { + const data = await this.service.authorization({ + req, + res + }); + req.user = data; + + return data; + } + + async canActivate(context: ExecutionContext): Promise { + const optionalAuth = this.reflector.get(OptionalAuth, context.getHandler()); + + const ctx = GqlExecutionContext.create(context).getContext(); + + // If optional auth decorator is not set, check auth + if (optionalAuth === undefined) { + return !!(await this.getAuth(ctx)); + } else { + try { + return !!(await this.getAuth(ctx)); + } catch (e) { + // Return true if auth is optional + return true; + } + } + } +} + +export const OptionalAuth = Reflector.createDecorator(); diff --git a/packages/backend/src/utils/guards/dev.guard.ts b/packages/backend/src/utils/guards/dev.guard.ts new file mode 100644 index 000000000..14ed47e61 --- /dev/null +++ b/packages/backend/src/utils/guards/dev.guard.ts @@ -0,0 +1,14 @@ +import { CanActivate, Injectable } from "@nestjs/common"; + +import { AccessDeniedError } from "../../errors"; + +@Injectable() +export class OnlyForDevelopment implements CanActivate { + canActivate(): boolean { + if (process.env.NODE_ENV !== "development") { + throw new AccessDeniedError(); + } + + return true; + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ff37cd56e..4eb08ac39 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -101,7 +101,7 @@ importers: version: 4.2.1(graphql@16.8.2) '@nestjs/cli': specifier: ^10.3.2 - version: 10.3.2(@swc/cli@0.3.12(@swc/core@1.6.3(@swc/helpers@0.5.11))(chokidar@3.6.0))(@swc/core@1.6.3(@swc/helpers@0.5.11)) + version: 10.3.2(@swc/cli@0.3.12(@swc/core@1.6.3(@swc/helpers@0.5.11))(chokidar@3.6.0))(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12) '@nestjs/schematics': specifier: ^10.1.1 version: 10.1.1(chokidar@3.6.0)(typescript@5.5.2) @@ -472,6 +472,9 @@ importers: packages/backend: dependencies: + bcrypt: + specifier: ^5.1.1 + version: 5.1.1 class-validator: specifier: ^0.14.1 version: 0.14.1 @@ -509,6 +512,9 @@ importers: '@nestjs/config': specifier: ^3.2.2 version: 3.2.2(@nestjs/common@10.3.9(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(rxjs@7.8.1) + '@nestjs/core': + specifier: ^10.3.9 + version: 10.3.9(@nestjs/common@10.3.9(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.9)(@nestjs/websockets@10.3.8)(reflect-metadata@0.2.2)(rxjs@7.8.1) '@nestjs/graphql': specifier: ^12.1.1 version: 12.1.1(@nestjs/common@10.3.9(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.9(@nestjs/common@10.3.9(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.9)(@nestjs/websockets@10.3.8)(reflect-metadata@0.2.2)(rxjs@7.8.1))(class-transformer@0.5.1)(class-validator@0.14.1)(graphql@16.8.2)(reflect-metadata@0.2.2) @@ -521,6 +527,9 @@ importers: '@nestjs/serve-static': specifier: ^4.0.2 version: 4.0.2(@nestjs/common@10.3.9(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.9(@nestjs/common@10.3.9(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.9)(@nestjs/websockets@10.3.8)(reflect-metadata@0.2.2)(rxjs@7.8.1))(express@4.19.2) + '@types/bcrypt': + specifier: ^5.0.2 + version: 5.0.2 '@types/busboy': specifier: ^1.5.4 version: 1.5.4 @@ -542,6 +551,9 @@ importers: '@types/pg': specifier: ^8.11.6 version: 8.11.6 + '@vitnode/shared': + specifier: workspace:* + version: link:../shared busboy: specifier: ^1.6.0 version: 1.6.0 @@ -10415,7 +10427,7 @@ snapshots: lodash.omit: 4.5.0 tslib: 2.6.2 - '@nestjs/cli@10.3.2(@swc/cli@0.3.12(@swc/core@1.6.3(@swc/helpers@0.5.11))(chokidar@3.6.0))(@swc/core@1.6.3(@swc/helpers@0.5.11))': + '@nestjs/cli@10.3.2(@swc/cli@0.3.12(@swc/core@1.6.3(@swc/helpers@0.5.11))(chokidar@3.6.0))(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)': dependencies: '@angular-devkit/core': 17.1.2(chokidar@3.6.0) '@angular-devkit/schematics': 17.1.2(chokidar@3.6.0) @@ -10425,7 +10437,7 @@ snapshots: chokidar: 3.6.0 cli-table3: 0.6.3 commander: 4.1.1 - fork-ts-checker-webpack-plugin: 9.0.2(typescript@5.3.3)(webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))) + fork-ts-checker-webpack-plugin: 9.0.2(typescript@5.3.3)(webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)) glob: 10.3.10 inquirer: 8.2.6 node-emoji: 1.11.0 @@ -10437,7 +10449,7 @@ snapshots: tsconfig-paths: 4.2.0 tsconfig-paths-webpack-plugin: 4.1.0 typescript: 5.3.3 - webpack: 5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11)) + webpack: 5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12) webpack-node-externals: 3.0.0 optionalDependencies: '@swc/cli': 0.3.12(@swc/core@1.6.3(@swc/helpers@0.5.11))(chokidar@3.6.0) @@ -12442,7 +12454,7 @@ snapshots: dependencies: '@types/node': 20.14.7 tapable: 2.2.1 - webpack: 5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11) + webpack: 5.92.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12) transitivePeerDependencies: - '@swc/core' - esbuild @@ -14485,7 +14497,7 @@ snapshots: cross-spawn: 7.0.3 signal-exit: 4.1.0 - fork-ts-checker-webpack-plugin@9.0.2(typescript@5.3.3)(webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))): + fork-ts-checker-webpack-plugin@9.0.2(typescript@5.3.3)(webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)): dependencies: '@babel/code-frame': 7.24.7 chalk: 4.1.2 @@ -14500,7 +14512,7 @@ snapshots: semver: 7.6.2 tapable: 2.2.1 typescript: 5.3.3 - webpack: 5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11)) + webpack: 5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12) form-data@4.0.0: dependencies: @@ -17143,27 +17155,29 @@ snapshots: mkdirp: 3.0.1 yallist: 5.0.0 - terser-webpack-plugin@5.3.10(@swc/core@1.6.3(@swc/helpers@0.5.11))(webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))): + terser-webpack-plugin@5.3.10(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)(webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)): dependencies: '@jridgewell/trace-mapping': 0.3.25 jest-worker: 27.5.1 schema-utils: 3.3.0 serialize-javascript: 6.0.2 terser: 5.31.1 - webpack: 5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11)) + webpack: 5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12) optionalDependencies: '@swc/core': 1.6.3(@swc/helpers@0.5.11) + esbuild: 0.19.12 - terser-webpack-plugin@5.3.10(@swc/core@1.6.3(@swc/helpers@0.5.11))(webpack@5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11)): + terser-webpack-plugin@5.3.10(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)(webpack@5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11)): dependencies: '@jridgewell/trace-mapping': 0.3.25 jest-worker: 27.5.1 schema-utils: 3.3.0 serialize-javascript: 6.0.2 terser: 5.31.1 - webpack: 5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11) + webpack: 5.92.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12) optionalDependencies: '@swc/core': 1.6.3(@swc/helpers@0.5.11) + esbuild: 0.19.12 terser@5.31.1: dependencies: @@ -17536,7 +17550,7 @@ snapshots: webpack-sources@3.2.3: {} - webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11)): + webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12): dependencies: '@types/eslint-scope': 3.7.7 '@types/estree': 1.0.5 @@ -17559,7 +17573,7 @@ snapshots: neo-async: 2.6.2 schema-utils: 3.3.0 tapable: 2.2.1 - terser-webpack-plugin: 5.3.10(@swc/core@1.6.3(@swc/helpers@0.5.11))(webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))) + terser-webpack-plugin: 5.3.10(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)(webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)) watchpack: 2.4.1 webpack-sources: 3.2.3 transitivePeerDependencies: @@ -17567,7 +17581,7 @@ snapshots: - esbuild - uglify-js - webpack@5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11): + webpack@5.92.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12): dependencies: '@types/eslint-scope': 3.7.7 '@types/estree': 1.0.5 @@ -17590,7 +17604,7 @@ snapshots: neo-async: 2.6.2 schema-utils: 3.3.0 tapable: 2.2.1 - terser-webpack-plugin: 5.3.10(@swc/core@1.6.3(@swc/helpers@0.5.11))(webpack@5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11)) + terser-webpack-plugin: 5.3.10(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)(webpack@5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11)) watchpack: 2.4.1 webpack-sources: 3.2.3 transitivePeerDependencies: From 1cef579f221e72be6d0bc4e491f80a841aaece94 Mon Sep 17 00:00:00 2001 From: aXenDeveloper Date: Fri, 21 Jun 2024 22:22:58 +0200 Subject: [PATCH 13/27] perf(backend): Move all guards to package --- apps/backend/package.json | 1 + .../categories/create/create.resolver.ts | 2 +- .../email/settings/edit/edit.resolver.ts | 3 +- .../email/settings/show/show.resolver.ts | 3 +- .../email/settings/test/test.resolver.ts | 3 +- .../admin/files/delete/delete.resolver.ts | 3 +- .../core/admin/files/show/show.resolver.ts | 3 +- .../admin/groups/create/create.resolver.ts | 3 +- .../admin/groups/delete/delete.resolver.ts | 3 +- .../core/admin/groups/edit/edit.resolver.ts | 3 +- .../core/admin/groups/show/show.resolver.ts | 3 +- .../admin/languages/create/create.resolver.ts | 2 +- .../admin/languages/delete/delete.resolver.ts | 3 +- .../languages/download/download.resolver.ts | 4 +- .../admin/languages/edit/edit.resolver.ts | 2 +- .../admin/languages/update/update.resolver.ts | 3 +- .../core/admin/members/edit/edit.resolver.ts | 3 +- .../core/admin/members/show/show.resolver.ts | 3 +- .../admin/members/stats/stats.resolver.ts | 3 +- .../metadata/manifest/edit/edit.resolver.ts | 3 +- .../metadata/manifest/show/show.resolver.ts | 3 +- .../change_position.resolver.ts | 3 +- .../core/admin/nav/create/create.resolver.ts | 2 +- .../core/admin/nav/delete/delete.resolver.ts | 3 +- .../core/admin/nav/edit/edit.resolver.ts | 2 +- .../admin/plugins/create/create.resolver.ts | 4 +- .../admin/plugins/delete/delete.resolver.ts | 3 +- .../plugins/download/download.resolver.ts | 10 +-- .../core/admin/plugins/edit/edit.resolver.ts | 4 +- .../admin/plugins/files/files.resolver.ts | 4 +- .../change_position.resolver.ts | 4 +- .../plugins/nav/create/create.resolver.ts | 4 +- .../plugins/nav/delete/delete.resolver.ts | 4 +- .../admin/plugins/nav/edit/edit.resolver.ts | 4 +- .../admin/plugins/nav/show/show.resolver.ts | 4 +- .../core/admin/plugins/show/show.resolver.ts | 3 +- .../admin/plugins/upload/upload.resolver.ts | 3 +- .../admin/settings/main/edit/edit.resolver.ts | 3 +- .../administrators/create/create.resolver.ts | 3 +- .../administrators/delete/delete.resolver.ts | 3 +- .../administrators/show/show.resolver.ts | 3 +- .../moderators/create/create.resolver.ts | 3 +- .../moderators/delete/delete.resolver.ts | 3 +- .../staff/moderators/show/show.resolver.ts | 3 +- .../admin/theme_editor/edit/edit.resolver.ts | 3 +- apps/backend/src/plugins/core/core.module.ts | 3 +- .../core/editor/delete/delete.resolver.ts | 4 +- .../core/editor/upload/upload.resolver.ts | 3 +- .../src/plugins/core/files/files.module.ts | 3 +- .../plugins/core/files/show/show.resolver.ts | 4 +- .../members/avatar/delete/delete.resolver.ts | 4 +- .../members/avatar/upload/upload.resolver.ts | 4 +- .../core/members/delete/delete.resolver.ts | 3 +- .../core/members/show/show.resolver.ts | 3 +- .../src/utils/guards/admin-auth.guard.ts | 29 --------- .../utils/guards/admin-permission.guard.ts | 63 ------------------- apps/backend/src/utils/guards/auth.guard.ts | 42 ------------- apps/backend/src/utils/guards/dev.guard.ts | 13 ---- packages/backend/src/app.module.ts | 2 + .../core/admin/sessions/sessions.module.ts | 6 +- packages/backend/src/guards.module.ts | 20 ++++++ .../src/utils/guards/admin-auth.guard.ts | 19 +++++- .../utils/guards/admin-permission.guard.ts | 62 ++++++++++-------- .../backend/src/utils/guards/auth.guard.ts | 15 ++++- packages/backend/src/utils/guards/index.ts | 4 ++ packages/backend/src/utils/index.ts | 1 + pnpm-lock.yaml | 20 ++++++ 67 files changed, 175 insertions(+), 296 deletions(-) delete mode 100644 apps/backend/src/utils/guards/admin-auth.guard.ts delete mode 100644 apps/backend/src/utils/guards/admin-permission.guard.ts delete mode 100644 apps/backend/src/utils/guards/auth.guard.ts delete mode 100644 apps/backend/src/utils/guards/dev.guard.ts create mode 100644 packages/backend/src/guards.module.ts create mode 100644 packages/backend/src/utils/guards/index.ts diff --git a/apps/backend/package.json b/apps/backend/package.json index 7570951a9..b851680cd 100644 --- a/apps/backend/package.json +++ b/apps/backend/package.json @@ -69,6 +69,7 @@ "eslint-config-vitnode": "workspace:*", "pg": "^8.12.0", "react-email": "^2.1.4", + "ts-loader": "^9.5.1", "ts-node": "^10.9.2", "tsconfig-paths": "^4.2.0", "typescript": "^5.5.2", diff --git a/apps/backend/src/plugins/blog/admin/categories/create/create.resolver.ts b/apps/backend/src/plugins/blog/admin/categories/create/create.resolver.ts index 83a5efa05..d5c03326f 100644 --- a/apps/backend/src/plugins/blog/admin/categories/create/create.resolver.ts +++ b/apps/backend/src/plugins/blog/admin/categories/create/create.resolver.ts @@ -1,10 +1,10 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards } from "vitnode-backend"; import { CreateBlogCategoriesService } from "./create.service"; import { CreatePluginCategoriesArgs } from "./dto/create.args"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; import { ShowBlogCategories } from "@/plugins/blog/categories/show/dto/show.obj"; @Resolver() diff --git a/apps/backend/src/plugins/core/admin/email/settings/edit/edit.resolver.ts b/apps/backend/src/plugins/core/admin/email/settings/edit/edit.resolver.ts index 33ec677e9..379f4d10f 100644 --- a/apps/backend/src/plugins/core/admin/email/settings/edit/edit.resolver.ts +++ b/apps/backend/src/plugins/core/admin/email/settings/edit/edit.resolver.ts @@ -1,12 +1,11 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards } from "vitnode-backend"; import { EditAdminEmailSettingsService } from "./edit.service"; import { EditAdminEmailSettingsServiceArgs } from "./dto/edit.args"; import { ShowAdminEmailSettingsServiceObj } from "../show/dto/show.obj"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; - @Resolver() export class EditAdminEmailSettingsResolver { constructor(private readonly service: EditAdminEmailSettingsService) {} diff --git a/apps/backend/src/plugins/core/admin/email/settings/show/show.resolver.ts b/apps/backend/src/plugins/core/admin/email/settings/show/show.resolver.ts index 94a1875a9..e9be435ba 100644 --- a/apps/backend/src/plugins/core/admin/email/settings/show/show.resolver.ts +++ b/apps/backend/src/plugins/core/admin/email/settings/show/show.resolver.ts @@ -1,11 +1,10 @@ import { Query, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards } from "vitnode-backend"; import { ShowAdminEmailSettingsServiceObj } from "./dto/show.obj"; import { ShowAdminEmailSettingsService } from "./show.service"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; - @Resolver() export class ShowAdminEmailSettingsResolver { constructor(private readonly service: ShowAdminEmailSettingsService) {} diff --git a/apps/backend/src/plugins/core/admin/email/settings/test/test.resolver.ts b/apps/backend/src/plugins/core/admin/email/settings/test/test.resolver.ts index 2bbcb40de..1675eeeda 100644 --- a/apps/backend/src/plugins/core/admin/email/settings/test/test.resolver.ts +++ b/apps/backend/src/plugins/core/admin/email/settings/test/test.resolver.ts @@ -1,11 +1,10 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards } from "vitnode-backend"; import { TestAdminEmailSettingsService } from "./test.service"; import { TestAdminEmailSettingsServiceArgs } from "./dto/test.args"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; - @Resolver() export class TestAdminEmailSettingsResolver { constructor(private readonly service: TestAdminEmailSettingsService) {} diff --git a/apps/backend/src/plugins/core/admin/files/delete/delete.resolver.ts b/apps/backend/src/plugins/core/admin/files/delete/delete.resolver.ts index 2650967db..1e817d43e 100644 --- a/apps/backend/src/plugins/core/admin/files/delete/delete.resolver.ts +++ b/apps/backend/src/plugins/core/admin/files/delete/delete.resolver.ts @@ -1,11 +1,10 @@ import { UseGuards } from "@nestjs/common"; import { Args, Mutation, Resolver } from "@nestjs/graphql"; +import { AdminAuthGuards } from "vitnode-backend"; import { DeleteAdminFilesService } from "./delete.service"; import { DeleteAdminFilesArgs } from "./dto/delete.args"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; - @Resolver() export class DeleteAdminFilesResolver { constructor(private readonly service: DeleteAdminFilesService) {} diff --git a/apps/backend/src/plugins/core/admin/files/show/show.resolver.ts b/apps/backend/src/plugins/core/admin/files/show/show.resolver.ts index bb3aee7ba..ac94518bb 100644 --- a/apps/backend/src/plugins/core/admin/files/show/show.resolver.ts +++ b/apps/backend/src/plugins/core/admin/files/show/show.resolver.ts @@ -1,12 +1,11 @@ import { UseGuards } from "@nestjs/common"; import { Args, Query, Resolver } from "@nestjs/graphql"; +import { AdminAuthGuards } from "vitnode-backend"; import { ShowAdminFilesService } from "./show.service"; import { ShowAdminFilesObj } from "./dto/show.obj"; import { ShowAdminFilesArgs } from "./dto/show.args"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; - @Resolver() export class ShowAdminFilesResolver { constructor(private readonly service: ShowAdminFilesService) {} diff --git a/apps/backend/src/plugins/core/admin/groups/create/create.resolver.ts b/apps/backend/src/plugins/core/admin/groups/create/create.resolver.ts index 3e038d468..9442e7074 100644 --- a/apps/backend/src/plugins/core/admin/groups/create/create.resolver.ts +++ b/apps/backend/src/plugins/core/admin/groups/create/create.resolver.ts @@ -1,12 +1,11 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { SetMetadata, UseGuards } from "@nestjs/common"; +import { AdminPermissionGuards } from "vitnode-backend"; import { CreateAdminGroupsService } from "./create.service"; import { CreateAdminGroupsArgs } from "./dto/create.args"; import { ShowAdminGroups } from "../show/dto/show.obj"; -import { AdminPermissionGuards } from "@/utils/guards/admin-permission.guard"; - @Resolver() export class CreateAdminGroupsResolver { constructor(private readonly service: CreateAdminGroupsService) {} diff --git a/apps/backend/src/plugins/core/admin/groups/delete/delete.resolver.ts b/apps/backend/src/plugins/core/admin/groups/delete/delete.resolver.ts index d240cf05f..1c0d3c40d 100644 --- a/apps/backend/src/plugins/core/admin/groups/delete/delete.resolver.ts +++ b/apps/backend/src/plugins/core/admin/groups/delete/delete.resolver.ts @@ -1,11 +1,10 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards } from "vitnode-backend"; import { DeleteAdminGroupsService } from "./delete.service"; import { DeleteAdminGroupsArgs } from "./dto/delete.args"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; - @Resolver() export class DeleteAdminGroupsResolver { constructor(private readonly service: DeleteAdminGroupsService) {} diff --git a/apps/backend/src/plugins/core/admin/groups/edit/edit.resolver.ts b/apps/backend/src/plugins/core/admin/groups/edit/edit.resolver.ts index 925780209..b93558568 100644 --- a/apps/backend/src/plugins/core/admin/groups/edit/edit.resolver.ts +++ b/apps/backend/src/plugins/core/admin/groups/edit/edit.resolver.ts @@ -1,12 +1,11 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards } from "vitnode-backend"; import { ShowAdminGroups } from "../show/dto/show.obj"; import { EditAdminGroupsService } from "./edit.service"; import { EditAdminGroupsArgs } from "./dto/edit.args"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; - @Resolver() export class EditAdminGroupsResolver { constructor(private readonly service: EditAdminGroupsService) {} diff --git a/apps/backend/src/plugins/core/admin/groups/show/show.resolver.ts b/apps/backend/src/plugins/core/admin/groups/show/show.resolver.ts index 752a6c702..38afb0a73 100644 --- a/apps/backend/src/plugins/core/admin/groups/show/show.resolver.ts +++ b/apps/backend/src/plugins/core/admin/groups/show/show.resolver.ts @@ -1,12 +1,11 @@ import { UseGuards } from "@nestjs/common"; import { Args, Query, Resolver } from "@nestjs/graphql"; +import { AdminAuthGuards } from "vitnode-backend"; import { ShowAdminGroupsService } from "./show.service"; import { ShowAdminGroupsObj } from "./dto/show.obj"; import { ShowAdminGroupsArgs } from "./dto/show.args"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; - @Resolver() export class ShowAdminGroupsResolver { constructor(private readonly service: ShowAdminGroupsService) {} diff --git a/apps/backend/src/plugins/core/admin/languages/create/create.resolver.ts b/apps/backend/src/plugins/core/admin/languages/create/create.resolver.ts index 2f6f96269..8c35231a6 100644 --- a/apps/backend/src/plugins/core/admin/languages/create/create.resolver.ts +++ b/apps/backend/src/plugins/core/admin/languages/create/create.resolver.ts @@ -1,10 +1,10 @@ import { UseGuards } from "@nestjs/common"; import { Args, Mutation, Resolver } from "@nestjs/graphql"; +import { AdminAuthGuards } from "vitnode-backend"; import { CreateAdminCoreLanguageService } from "./create.service"; import { CreateCoreAdminLanguagesArgs } from "./dto/create.args"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; import { ShowCoreLanguages } from "@/plugins/core/languages/show/dto/show.obj"; @Resolver() diff --git a/apps/backend/src/plugins/core/admin/languages/delete/delete.resolver.ts b/apps/backend/src/plugins/core/admin/languages/delete/delete.resolver.ts index f5f3a41ad..2056905a7 100644 --- a/apps/backend/src/plugins/core/admin/languages/delete/delete.resolver.ts +++ b/apps/backend/src/plugins/core/admin/languages/delete/delete.resolver.ts @@ -1,11 +1,10 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards } from "vitnode-backend"; import { DeleteAdminCoreLanguageService } from "./delete.service"; import { DeleteCoreAdminLanguagesArgs } from "./dto/delete.args"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; - @Resolver() export class DeleteAdminCoreLanguagesResolver { constructor(private readonly service: DeleteAdminCoreLanguageService) {} diff --git a/apps/backend/src/plugins/core/admin/languages/download/download.resolver.ts b/apps/backend/src/plugins/core/admin/languages/download/download.resolver.ts index ed71f03db..48739c7c7 100644 --- a/apps/backend/src/plugins/core/admin/languages/download/download.resolver.ts +++ b/apps/backend/src/plugins/core/admin/languages/download/download.resolver.ts @@ -1,12 +1,10 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { CurrentUser, User } from "vitnode-backend"; +import { CurrentUser, User, AdminAuthGuards } from "vitnode-backend"; import { DownloadAdminCoreLanguageService } from "./download.service"; import { DownloadCoreAdminLanguagesArgs } from "./dto/download.args"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; - @Resolver() export class DownloadAdminCoreLanguagesResolver { constructor(private readonly service: DownloadAdminCoreLanguageService) {} diff --git a/apps/backend/src/plugins/core/admin/languages/edit/edit.resolver.ts b/apps/backend/src/plugins/core/admin/languages/edit/edit.resolver.ts index 24e4458e7..50f28e40c 100644 --- a/apps/backend/src/plugins/core/admin/languages/edit/edit.resolver.ts +++ b/apps/backend/src/plugins/core/admin/languages/edit/edit.resolver.ts @@ -1,10 +1,10 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards } from "vitnode-backend"; import { EditAdminCoreLanguagesService } from "./edit.service"; import { EditCoreAdminLanguagesArgs } from "./dto/edit.args"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; import { ShowCoreLanguages } from "@/plugins/core/languages/show/dto/show.obj"; @Resolver() diff --git a/apps/backend/src/plugins/core/admin/languages/update/update.resolver.ts b/apps/backend/src/plugins/core/admin/languages/update/update.resolver.ts index c1744e6a2..da10a7cc8 100644 --- a/apps/backend/src/plugins/core/admin/languages/update/update.resolver.ts +++ b/apps/backend/src/plugins/core/admin/languages/update/update.resolver.ts @@ -1,11 +1,10 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards } from "vitnode-backend"; import { UpdateAdminCoreLanguageService } from "./update.service"; import { UpdateCoreAdminLanguagesArgs } from "./dto/update.args"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; - @Resolver() export class UpdateAdminCoreLanguagesResolver { constructor(private readonly service: UpdateAdminCoreLanguageService) {} diff --git a/apps/backend/src/plugins/core/admin/members/edit/edit.resolver.ts b/apps/backend/src/plugins/core/admin/members/edit/edit.resolver.ts index 7eb20ccf2..648dd2e1c 100644 --- a/apps/backend/src/plugins/core/admin/members/edit/edit.resolver.ts +++ b/apps/backend/src/plugins/core/admin/members/edit/edit.resolver.ts @@ -1,12 +1,11 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards } from "vitnode-backend"; import { EditAdminMembersService } from "./edit.service"; import { EditAdminMembersArgs } from "./dto/edit.args"; import { EditAdminMembersObj } from "./dto/edit.obj"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; - @Resolver() export class EditAdminMembersResolver { constructor(private readonly service: EditAdminMembersService) {} diff --git a/apps/backend/src/plugins/core/admin/members/show/show.resolver.ts b/apps/backend/src/plugins/core/admin/members/show/show.resolver.ts index dc7b0388f..b949715b1 100644 --- a/apps/backend/src/plugins/core/admin/members/show/show.resolver.ts +++ b/apps/backend/src/plugins/core/admin/members/show/show.resolver.ts @@ -1,12 +1,11 @@ import { Args, Query, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards } from "vitnode-backend"; import { ShowAdminMembersService } from "./show.service"; import { ShowAdminMembersObj } from "./dto/show.obj"; import { ShowAdminMembersArgs } from "./dto/show.args"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; - @Resolver() export class ShowAdminMembersResolver { constructor(private readonly service: ShowAdminMembersService) {} diff --git a/apps/backend/src/plugins/core/admin/members/stats/stats.resolver.ts b/apps/backend/src/plugins/core/admin/members/stats/stats.resolver.ts index 6f226fca2..5c5453a0f 100644 --- a/apps/backend/src/plugins/core/admin/members/stats/stats.resolver.ts +++ b/apps/backend/src/plugins/core/admin/members/stats/stats.resolver.ts @@ -1,11 +1,10 @@ import { Query, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards } from "vitnode-backend"; import { StatsAdminMembersService } from "./stats.service"; import { SignUpStatsAdminMembers } from "./dto/stats.obj"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; - @Resolver() export class StatsAdminMembersResolver { constructor(private readonly service: StatsAdminMembersService) {} diff --git a/apps/backend/src/plugins/core/admin/metadata/manifest/edit/edit.resolver.ts b/apps/backend/src/plugins/core/admin/metadata/manifest/edit/edit.resolver.ts index 4e05b8b2f..71249827c 100644 --- a/apps/backend/src/plugins/core/admin/metadata/manifest/edit/edit.resolver.ts +++ b/apps/backend/src/plugins/core/admin/metadata/manifest/edit/edit.resolver.ts @@ -1,12 +1,11 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards } from "vitnode-backend"; import { EditAdminManifestMetadataService } from "./edit.service"; import { EditAdminManifestMetadataObj } from "./dto/edit.args"; import { ShowAdminManifestMetadataObj } from "../show/dto/show.obj"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; - @Resolver() export class EditAdminManifestMetadataResolver { constructor(private readonly service: EditAdminManifestMetadataService) {} diff --git a/apps/backend/src/plugins/core/admin/metadata/manifest/show/show.resolver.ts b/apps/backend/src/plugins/core/admin/metadata/manifest/show/show.resolver.ts index a4120b2c6..e2032ff5d 100644 --- a/apps/backend/src/plugins/core/admin/metadata/manifest/show/show.resolver.ts +++ b/apps/backend/src/plugins/core/admin/metadata/manifest/show/show.resolver.ts @@ -1,11 +1,10 @@ import { Query, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards } from "vitnode-backend"; import { ShowAdminManifestMetadataService } from "./show.service"; import { ShowAdminManifestMetadataObj } from "./dto/show.obj"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; - @Resolver() export class ShowAdminManifestMetadataResolver { constructor(private readonly service: ShowAdminManifestMetadataService) {} diff --git a/apps/backend/src/plugins/core/admin/nav/change_position/change_position.resolver.ts b/apps/backend/src/plugins/core/admin/nav/change_position/change_position.resolver.ts index 868152f63..722b24929 100644 --- a/apps/backend/src/plugins/core/admin/nav/change_position/change_position.resolver.ts +++ b/apps/backend/src/plugins/core/admin/nav/change_position/change_position.resolver.ts @@ -1,11 +1,10 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards } from "vitnode-backend"; import { ChangePositionAdminNavService } from "./change_position.service"; import { ChangePositionAdminNavArgs } from "./dto/change_position.args"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; - @Resolver() export class ChangePositionAdminNavResolver { constructor(private readonly service: ChangePositionAdminNavService) {} diff --git a/apps/backend/src/plugins/core/admin/nav/create/create.resolver.ts b/apps/backend/src/plugins/core/admin/nav/create/create.resolver.ts index 2b43be540..38db3efab 100644 --- a/apps/backend/src/plugins/core/admin/nav/create/create.resolver.ts +++ b/apps/backend/src/plugins/core/admin/nav/create/create.resolver.ts @@ -1,10 +1,10 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards } from "vitnode-backend"; import { CreateAdminNavService } from "./create.service"; import { CreateAdminNavArgs } from "./dto/create.args"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; import { ShowCoreNav } from "@/plugins/core/nav/show/dto/show.obj"; @Resolver() diff --git a/apps/backend/src/plugins/core/admin/nav/delete/delete.resolver.ts b/apps/backend/src/plugins/core/admin/nav/delete/delete.resolver.ts index 57749e2c7..18f105583 100644 --- a/apps/backend/src/plugins/core/admin/nav/delete/delete.resolver.ts +++ b/apps/backend/src/plugins/core/admin/nav/delete/delete.resolver.ts @@ -1,11 +1,10 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards } from "vitnode-backend"; import { DeleteAdminNavService } from "./delete.service"; import { DeleteAdminNavArgs } from "./dto/delete.args"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; - @Resolver() export class DeleteAdminNavResolver { constructor(private readonly service: DeleteAdminNavService) {} diff --git a/apps/backend/src/plugins/core/admin/nav/edit/edit.resolver.ts b/apps/backend/src/plugins/core/admin/nav/edit/edit.resolver.ts index d50087f1b..71487b7c5 100644 --- a/apps/backend/src/plugins/core/admin/nav/edit/edit.resolver.ts +++ b/apps/backend/src/plugins/core/admin/nav/edit/edit.resolver.ts @@ -1,10 +1,10 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards } from "vitnode-backend"; import { EditAdminNavService } from "./edit.service"; import { EditAdminNavArgs } from "./dto/edit.args"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; import { ShowCoreNav } from "@/plugins/core/nav/show/dto/show.obj"; @Resolver() diff --git a/apps/backend/src/plugins/core/admin/plugins/create/create.resolver.ts b/apps/backend/src/plugins/core/admin/plugins/create/create.resolver.ts index a07c965b2..a4a965772 100644 --- a/apps/backend/src/plugins/core/admin/plugins/create/create.resolver.ts +++ b/apps/backend/src/plugins/core/admin/plugins/create/create.resolver.ts @@ -1,13 +1,11 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards, OnlyForDevelopment } from "vitnode-backend"; import { CreateAdminPluginsService } from "./create.service"; import { CreateAdminPluginsArgs } from "./dto/create.args"; import { ShowAdminPlugins } from "../show/dto/show.obj"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; -import { OnlyForDevelopment } from "@/utils/guards/dev.guard"; - @Resolver() export class CreateAdminPluginsResolver { constructor(private readonly service: CreateAdminPluginsService) {} diff --git a/apps/backend/src/plugins/core/admin/plugins/delete/delete.resolver.ts b/apps/backend/src/plugins/core/admin/plugins/delete/delete.resolver.ts index 792fdddfe..e6f3479d0 100644 --- a/apps/backend/src/plugins/core/admin/plugins/delete/delete.resolver.ts +++ b/apps/backend/src/plugins/core/admin/plugins/delete/delete.resolver.ts @@ -1,11 +1,10 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards } from "vitnode-backend"; import { DeleteAdminPluginsService } from "./delete.service"; import { DeleteAdminPluginsArgs } from "./dto/delete.args"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; - @Resolver() export class DeleteAdminPluginsResolver { constructor(private readonly service: DeleteAdminPluginsService) {} diff --git a/apps/backend/src/plugins/core/admin/plugins/download/download.resolver.ts b/apps/backend/src/plugins/core/admin/plugins/download/download.resolver.ts index fac99f35f..e1e52b78a 100644 --- a/apps/backend/src/plugins/core/admin/plugins/download/download.resolver.ts +++ b/apps/backend/src/plugins/core/admin/plugins/download/download.resolver.ts @@ -1,13 +1,15 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { CurrentUser, User } from "vitnode-backend"; +import { + CurrentUser, + User, + AdminAuthGuards, + OnlyForDevelopment +} from "vitnode-backend"; import { DownloadAdminPluginsService } from "./download.service"; import { DownloadAdminPluginsArgs } from "./dto/download.args"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; -import { OnlyForDevelopment } from "@/utils/guards/dev.guard"; - @Resolver() export class DownloadAdminPluginsResolver { constructor(private readonly service: DownloadAdminPluginsService) {} diff --git a/apps/backend/src/plugins/core/admin/plugins/edit/edit.resolver.ts b/apps/backend/src/plugins/core/admin/plugins/edit/edit.resolver.ts index 6c7b8becf..dd94c5bc4 100644 --- a/apps/backend/src/plugins/core/admin/plugins/edit/edit.resolver.ts +++ b/apps/backend/src/plugins/core/admin/plugins/edit/edit.resolver.ts @@ -1,13 +1,11 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards, OnlyForDevelopment } from "vitnode-backend"; import { EditAdminPluginsService } from "./edit.service"; import { ShowAdminPlugins } from "../show/dto/show.obj"; import { EditAdminPluginsArgs } from "./dto/edit.args"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; -import { OnlyForDevelopment } from "@/utils/guards/dev.guard"; - @Resolver() export class EditAdminPluginsResolver { constructor(private readonly service: EditAdminPluginsService) {} diff --git a/apps/backend/src/plugins/core/admin/plugins/files/files.resolver.ts b/apps/backend/src/plugins/core/admin/plugins/files/files.resolver.ts index 64db3eab7..a79a664b7 100644 --- a/apps/backend/src/plugins/core/admin/plugins/files/files.resolver.ts +++ b/apps/backend/src/plugins/core/admin/plugins/files/files.resolver.ts @@ -1,13 +1,11 @@ import { Args, Query, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards, OnlyForDevelopment } from "vitnode-backend"; import { FilesAdminPluginsService } from "./files.service"; import { FilesAdminPluginsArgs } from "./dto/files.args"; import { FilesAdminPluginsObj } from "./dto/files.obj"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; -import { OnlyForDevelopment } from "@/utils/guards/dev.guard"; - @Resolver() export class FilesAdminPluginsResolver { constructor(private readonly service: FilesAdminPluginsService) {} diff --git a/apps/backend/src/plugins/core/admin/plugins/nav/change_position/change_position.resolver.ts b/apps/backend/src/plugins/core/admin/plugins/nav/change_position/change_position.resolver.ts index ed20cded9..2452d8fc9 100644 --- a/apps/backend/src/plugins/core/admin/plugins/nav/change_position/change_position.resolver.ts +++ b/apps/backend/src/plugins/core/admin/plugins/nav/change_position/change_position.resolver.ts @@ -1,12 +1,10 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards, OnlyForDevelopment } from "vitnode-backend"; import { ChangePositionAdminNavPluginsService } from "./change_position.service"; import { ChangePositionAdminNavPluginsArgs } from "./dto/change_position.args"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; -import { OnlyForDevelopment } from "@/utils/guards/dev.guard"; - @Resolver() export class ChangePositionAdminNavPluginsResolver { constructor(private readonly service: ChangePositionAdminNavPluginsService) {} diff --git a/apps/backend/src/plugins/core/admin/plugins/nav/create/create.resolver.ts b/apps/backend/src/plugins/core/admin/plugins/nav/create/create.resolver.ts index 16ae0bdc2..498664f28 100644 --- a/apps/backend/src/plugins/core/admin/plugins/nav/create/create.resolver.ts +++ b/apps/backend/src/plugins/core/admin/plugins/nav/create/create.resolver.ts @@ -1,13 +1,11 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards, OnlyForDevelopment } from "vitnode-backend"; import { CreateAdminNavPluginsService } from "./create.service"; import { ShowAdminNavPluginsObj } from "../show/dto/show.obj"; import { CreateAdminNavPluginsArgs } from "./dto/create.args"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; -import { OnlyForDevelopment } from "@/utils/guards/dev.guard"; - @Resolver() export class CreateAdminNavPluginsResolver { constructor(private readonly service: CreateAdminNavPluginsService) {} diff --git a/apps/backend/src/plugins/core/admin/plugins/nav/delete/delete.resolver.ts b/apps/backend/src/plugins/core/admin/plugins/nav/delete/delete.resolver.ts index 5d9415470..2d30fde51 100644 --- a/apps/backend/src/plugins/core/admin/plugins/nav/delete/delete.resolver.ts +++ b/apps/backend/src/plugins/core/admin/plugins/nav/delete/delete.resolver.ts @@ -1,12 +1,10 @@ import { UseGuards } from "@nestjs/common"; import { Args, Mutation, Resolver } from "@nestjs/graphql"; +import { AdminAuthGuards, OnlyForDevelopment } from "vitnode-backend"; import { DeleteAdminNavPluginsService } from "./delete.service"; import { DeleteCreateAdminNavPluginsArgs } from "./dto/delete.args"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; -import { OnlyForDevelopment } from "@/utils/guards/dev.guard"; - @Resolver() export class DeleteAdminNavPluginsResolver { constructor(private readonly service: DeleteAdminNavPluginsService) {} diff --git a/apps/backend/src/plugins/core/admin/plugins/nav/edit/edit.resolver.ts b/apps/backend/src/plugins/core/admin/plugins/nav/edit/edit.resolver.ts index 3798e2b82..8bed251f8 100644 --- a/apps/backend/src/plugins/core/admin/plugins/nav/edit/edit.resolver.ts +++ b/apps/backend/src/plugins/core/admin/plugins/nav/edit/edit.resolver.ts @@ -1,13 +1,11 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards, OnlyForDevelopment } from "vitnode-backend"; import { EditAdminNavPluginsService } from "./edit.service"; import { ShowAdminNavPluginsObj } from "../show/dto/show.obj"; import { EditCreateAdminNavPluginsArgs } from "./dto/edit.args"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; -import { OnlyForDevelopment } from "@/utils/guards/dev.guard"; - @Resolver() export class EditAdminNavPluginsResolver { constructor(private readonly service: EditAdminNavPluginsService) {} diff --git a/apps/backend/src/plugins/core/admin/plugins/nav/show/show.resolver.ts b/apps/backend/src/plugins/core/admin/plugins/nav/show/show.resolver.ts index 0cd470a37..5e9dd3da5 100644 --- a/apps/backend/src/plugins/core/admin/plugins/nav/show/show.resolver.ts +++ b/apps/backend/src/plugins/core/admin/plugins/nav/show/show.resolver.ts @@ -1,13 +1,11 @@ import { Args, Query, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards, OnlyForDevelopment } from "vitnode-backend"; import { ShowAdminNavPluginsArgs } from "./dto/show.args"; import { ShowAdminNavPluginsService } from "./show.service"; import { ShowAdminNavPluginsObj } from "./dto/show.obj"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; -import { OnlyForDevelopment } from "@/utils/guards/dev.guard"; - @Resolver() export class ShowAdminNavPluginsResolver { constructor(private readonly service: ShowAdminNavPluginsService) {} diff --git a/apps/backend/src/plugins/core/admin/plugins/show/show.resolver.ts b/apps/backend/src/plugins/core/admin/plugins/show/show.resolver.ts index 290da6f31..4c8b3cb8a 100644 --- a/apps/backend/src/plugins/core/admin/plugins/show/show.resolver.ts +++ b/apps/backend/src/plugins/core/admin/plugins/show/show.resolver.ts @@ -1,12 +1,11 @@ import { Args, Query, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards } from "vitnode-backend"; import { ShowAdminPluginsService } from "./show.service"; import { ShowAdminPluginsObj } from "./dto/show.obj"; import { ShowAdminPluginsArgs } from "./dto/show.args"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; - @Resolver() export class ShowAdminPluginsResolver { constructor(private readonly service: ShowAdminPluginsService) {} diff --git a/apps/backend/src/plugins/core/admin/plugins/upload/upload.resolver.ts b/apps/backend/src/plugins/core/admin/plugins/upload/upload.resolver.ts index 17de998df..039f6d4aa 100644 --- a/apps/backend/src/plugins/core/admin/plugins/upload/upload.resolver.ts +++ b/apps/backend/src/plugins/core/admin/plugins/upload/upload.resolver.ts @@ -1,12 +1,11 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards } from "vitnode-backend"; import { UploadAdminPluginsService } from "./upload.service"; import { UploadAdminPluginsArgs } from "./dto/upload.args"; import { ShowAdminPlugins } from "../show/dto/show.obj"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; - @Resolver() export class UploadAdminPluginsResolver { constructor(private readonly service: UploadAdminPluginsService) {} diff --git a/apps/backend/src/plugins/core/admin/settings/main/edit/edit.resolver.ts b/apps/backend/src/plugins/core/admin/settings/main/edit/edit.resolver.ts index 07385a0dd..42947471e 100644 --- a/apps/backend/src/plugins/core/admin/settings/main/edit/edit.resolver.ts +++ b/apps/backend/src/plugins/core/admin/settings/main/edit/edit.resolver.ts @@ -1,12 +1,11 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards } from "vitnode-backend"; import { EditAdminMainSettingsService } from "./edit.service"; import { EditAdminMainSettingsArgs } from "./dto/edit.args"; import { EditAdminSettingsObj } from "./dto/edit.obj"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; - @Resolver() export class EditAdminMainSettingsResolver { constructor(private readonly service: EditAdminMainSettingsService) {} diff --git a/apps/backend/src/plugins/core/admin/staff/administrators/create/create.resolver.ts b/apps/backend/src/plugins/core/admin/staff/administrators/create/create.resolver.ts index 21e1df8f3..98523bbb4 100644 --- a/apps/backend/src/plugins/core/admin/staff/administrators/create/create.resolver.ts +++ b/apps/backend/src/plugins/core/admin/staff/administrators/create/create.resolver.ts @@ -1,12 +1,11 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards } from "vitnode-backend"; import { CreateAdminStaffAdministratorsService } from "./create.service"; import { CreateAdminStaffAdministratorsArgs } from "./dto/create.args"; import { ShowAdminStaffAdministrators } from "../show/dto/show.obj"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; - @Resolver() export class CreateAdminStaffAdministratorResolver { constructor( diff --git a/apps/backend/src/plugins/core/admin/staff/administrators/delete/delete.resolver.ts b/apps/backend/src/plugins/core/admin/staff/administrators/delete/delete.resolver.ts index dc483fd81..3f1ef2566 100644 --- a/apps/backend/src/plugins/core/admin/staff/administrators/delete/delete.resolver.ts +++ b/apps/backend/src/plugins/core/admin/staff/administrators/delete/delete.resolver.ts @@ -1,11 +1,10 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards } from "vitnode-backend"; import { DeleteAdminStaffAdministratorsService } from "./delete.service"; import { DeleteAdminStaffAdministratorsArgs } from "./dto/delete.args"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; - @Resolver() export class DeleteAdminStaffAdministratorsResolver { constructor( diff --git a/apps/backend/src/plugins/core/admin/staff/administrators/show/show.resolver.ts b/apps/backend/src/plugins/core/admin/staff/administrators/show/show.resolver.ts index 743250b7a..343e47e30 100644 --- a/apps/backend/src/plugins/core/admin/staff/administrators/show/show.resolver.ts +++ b/apps/backend/src/plugins/core/admin/staff/administrators/show/show.resolver.ts @@ -1,12 +1,11 @@ import { Args, Query, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards } from "vitnode-backend"; import { ShowAdminStaffAdministratorsService } from "./show.service"; import { ShowAdminStaffAdministratorsObj } from "./dto/show.obj"; import { ShowAdminStaffAdministratorsArgs } from "./dto/show.args"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; - @Resolver() export class ShowAdminStaffAdministratorResolver { constructor(private readonly service: ShowAdminStaffAdministratorsService) {} diff --git a/apps/backend/src/plugins/core/admin/staff/moderators/create/create.resolver.ts b/apps/backend/src/plugins/core/admin/staff/moderators/create/create.resolver.ts index cfa464357..29e310523 100644 --- a/apps/backend/src/plugins/core/admin/staff/moderators/create/create.resolver.ts +++ b/apps/backend/src/plugins/core/admin/staff/moderators/create/create.resolver.ts @@ -1,12 +1,11 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards } from "vitnode-backend"; import { CreateAdminStaffModeratorsService } from "./create.service"; import { CreateAdminStaffModeratorsArgs } from "./dto/create.args"; import { ShowAdminStaffModerators } from "../show/dto/show.obj"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; - @Resolver() export class CreateAdminStaffModeratorsResolver { constructor(private readonly service: CreateAdminStaffModeratorsService) {} diff --git a/apps/backend/src/plugins/core/admin/staff/moderators/delete/delete.resolver.ts b/apps/backend/src/plugins/core/admin/staff/moderators/delete/delete.resolver.ts index 29d3c6004..cfbad721c 100644 --- a/apps/backend/src/plugins/core/admin/staff/moderators/delete/delete.resolver.ts +++ b/apps/backend/src/plugins/core/admin/staff/moderators/delete/delete.resolver.ts @@ -1,11 +1,10 @@ import { UseGuards } from "@nestjs/common"; import { Args, Mutation, Resolver } from "@nestjs/graphql"; +import { AdminAuthGuards } from "vitnode-backend"; import { DeleteAdminStaffModeratorsArgs } from "./dto/delete.args"; import { DeleteAdminStaffModeratorsService } from "./delete.service"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; - @Resolver() export class DeleteAdminStaffModeratorsResolver { constructor(private readonly service: DeleteAdminStaffModeratorsService) {} diff --git a/apps/backend/src/plugins/core/admin/staff/moderators/show/show.resolver.ts b/apps/backend/src/plugins/core/admin/staff/moderators/show/show.resolver.ts index 741be1bf2..b2638589c 100644 --- a/apps/backend/src/plugins/core/admin/staff/moderators/show/show.resolver.ts +++ b/apps/backend/src/plugins/core/admin/staff/moderators/show/show.resolver.ts @@ -1,12 +1,11 @@ import { Args, Query, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards } from "vitnode-backend"; import { ShowAdminStaffModeratorsService } from "./show.service"; import { ShowAdminStaffModeratorsObj } from "./dto/show.obj"; import { ShowAdminStaffModeratorsArgs } from "./dto/show.args"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; - @Resolver() export class ShowAdminStaffModeratorsResolver { constructor(private readonly service: ShowAdminStaffModeratorsService) {} diff --git a/apps/backend/src/plugins/core/admin/theme_editor/edit/edit.resolver.ts b/apps/backend/src/plugins/core/admin/theme_editor/edit/edit.resolver.ts index 86e1317a7..7185b6cd4 100644 --- a/apps/backend/src/plugins/core/admin/theme_editor/edit/edit.resolver.ts +++ b/apps/backend/src/plugins/core/admin/theme_editor/edit/edit.resolver.ts @@ -1,11 +1,10 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards } from "vitnode-backend"; import { EditAdminThemeEditorService } from "./edit.service"; import { EditAdminThemeEditorArgs } from "./dto/edit.args"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; - @Resolver() export class EditAdminThemeEditorResolver { constructor(private readonly service: EditAdminThemeEditorService) {} diff --git a/apps/backend/src/plugins/core/core.module.ts b/apps/backend/src/plugins/core/core.module.ts index 6005ceb4f..4eceac42d 100644 --- a/apps/backend/src/plugins/core/core.module.ts +++ b/apps/backend/src/plugins/core/core.module.ts @@ -24,6 +24,7 @@ import { CoreThemeEditorModule } from "./theme_editor/theme_editor.module"; CoreMiddlewareModule, CorePluginsModule, CoreThemeEditorModule - ] + ], + providers: [] }) export class CoreModule {} diff --git a/apps/backend/src/plugins/core/editor/delete/delete.resolver.ts b/apps/backend/src/plugins/core/editor/delete/delete.resolver.ts index 62a9745bc..42212f0e1 100644 --- a/apps/backend/src/plugins/core/editor/delete/delete.resolver.ts +++ b/apps/backend/src/plugins/core/editor/delete/delete.resolver.ts @@ -1,12 +1,10 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { CurrentUser, User } from "vitnode-backend"; +import { CurrentUser, User, AuthGuards } from "vitnode-backend"; import { DeleteCoreEditorService } from "./delete.service"; import { DeleteCoreEditorArgs } from "./dto/delete.args"; -import { AuthGuards } from "@/utils/guards/auth.guard"; - @Resolver() export class DeleteCoreEditorResolver { constructor(private readonly service: DeleteCoreEditorService) {} diff --git a/apps/backend/src/plugins/core/editor/upload/upload.resolver.ts b/apps/backend/src/plugins/core/editor/upload/upload.resolver.ts index 3b1596b37..6719070f2 100644 --- a/apps/backend/src/plugins/core/editor/upload/upload.resolver.ts +++ b/apps/backend/src/plugins/core/editor/upload/upload.resolver.ts @@ -1,11 +1,10 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { CurrentUser, User } from "vitnode-backend"; +import { CurrentUser, User, AuthGuards, OptionalAuth } from "vitnode-backend"; import { UploadCoreEditorService } from "./upload.service"; import { UploadCoreEditorArgs } from "./dto/upload.args"; -import { AuthGuards, OptionalAuth } from "@/utils/guards/auth.guard"; import { ShowCoreFiles } from "../../files/show/dto/show.obj"; @Resolver() diff --git a/apps/backend/src/plugins/core/files/files.module.ts b/apps/backend/src/plugins/core/files/files.module.ts index 9ab6326b3..de217ced9 100644 --- a/apps/backend/src/plugins/core/files/files.module.ts +++ b/apps/backend/src/plugins/core/files/files.module.ts @@ -1,4 +1,5 @@ import { Global, Module } from "@nestjs/common"; +import { AuthorizationAdminSessionsService } from "vitnode-backend"; import { UploadCoreFilesService } from "./helpers/upload/upload.service"; import { DeleteCoreFilesService } from "./helpers/delete/delete.service"; @@ -7,8 +8,6 @@ import { ShowCoreFilesResolver } from "./show/show.resolver"; import { CoreFilesCron } from "./files.cron"; import { DownloadSecureFilesController } from "./download/download.controller"; -import { AuthorizationAdminSessionsService } from "vitnode-backend"; - @Module({ providers: [ShowCoreFilesService, ShowCoreFilesResolver, CoreFilesCron] }) diff --git a/apps/backend/src/plugins/core/files/show/show.resolver.ts b/apps/backend/src/plugins/core/files/show/show.resolver.ts index ba4460abf..21a6f41a0 100644 --- a/apps/backend/src/plugins/core/files/show/show.resolver.ts +++ b/apps/backend/src/plugins/core/files/show/show.resolver.ts @@ -1,13 +1,11 @@ import { Args, Query, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { CurrentUser, User } from "vitnode-backend"; +import { CurrentUser, User, AuthGuards } from "vitnode-backend"; import { ShowCoreFilesService } from "./show.service"; import { ShowCoreFilesObj } from "./dto/show.obj"; import { ShowCoreFilesArgs } from "./dto/show.args"; -import { AuthGuards } from "@/utils/guards/auth.guard"; - @Resolver() export class ShowCoreFilesResolver { constructor(private readonly service: ShowCoreFilesService) {} diff --git a/apps/backend/src/plugins/core/members/avatar/delete/delete.resolver.ts b/apps/backend/src/plugins/core/members/avatar/delete/delete.resolver.ts index a2fdcada1..82858c96f 100644 --- a/apps/backend/src/plugins/core/members/avatar/delete/delete.resolver.ts +++ b/apps/backend/src/plugins/core/members/avatar/delete/delete.resolver.ts @@ -1,11 +1,9 @@ import { Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { User, CurrentUser } from "vitnode-backend"; +import { User, CurrentUser, AuthGuards } from "vitnode-backend"; import { DeleteAvatarCoreMembersService } from "./delete.service"; -import { AuthGuards } from "@/utils/guards/auth.guard"; - @Resolver() export class DeleteAvatarCoreMembersResolver { constructor(private readonly service: DeleteAvatarCoreMembersService) {} diff --git a/apps/backend/src/plugins/core/members/avatar/upload/upload.resolver.ts b/apps/backend/src/plugins/core/members/avatar/upload/upload.resolver.ts index 6d8bc6298..6d5227c09 100644 --- a/apps/backend/src/plugins/core/members/avatar/upload/upload.resolver.ts +++ b/apps/backend/src/plugins/core/members/avatar/upload/upload.resolver.ts @@ -1,13 +1,11 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { User, CurrentUser } from "vitnode-backend"; +import { User, CurrentUser, AuthGuards } from "vitnode-backend"; import { UploadAvatarCoreMembersService } from "./upload.service"; import { UploadAvatarCoreMembersArgs } from "./dto/upload.args"; import { UploadAvatarCoreMembersObj } from "./dto/upload.obj"; -import { AuthGuards } from "@/utils/guards/auth.guard"; - @Resolver() export class UploadAvatarCoreMembersResolver { constructor(private readonly service: UploadAvatarCoreMembersService) {} diff --git a/apps/backend/src/plugins/core/members/delete/delete.resolver.ts b/apps/backend/src/plugins/core/members/delete/delete.resolver.ts index f530b22a2..79f618473 100644 --- a/apps/backend/src/plugins/core/members/delete/delete.resolver.ts +++ b/apps/backend/src/plugins/core/members/delete/delete.resolver.ts @@ -1,11 +1,10 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AdminAuthGuards } from "vitnode-backend"; import { DeleteCoreMembersService } from "./delete.service"; import { DeleteCoreMembersArgs } from "./dto/delete.args"; -import { AdminAuthGuards } from "@/utils/guards/admin-auth.guard"; - @Resolver() export class DeleteCoreMembersResolver { constructor(private readonly service: DeleteCoreMembersService) {} diff --git a/apps/backend/src/plugins/core/members/show/show.resolver.ts b/apps/backend/src/plugins/core/members/show/show.resolver.ts index b7fa0c193..dceb99aa4 100644 --- a/apps/backend/src/plugins/core/members/show/show.resolver.ts +++ b/apps/backend/src/plugins/core/members/show/show.resolver.ts @@ -1,12 +1,11 @@ import { Args, Query, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; +import { AuthGuards, OptionalAuth } from "vitnode-backend"; import { ShowCoreMembersService } from "./show.service"; import { ShowCoreMembersObj } from "./dto/show.obj"; import { ShowCoreMembersArgs } from "./dto/show.args"; -import { AuthGuards, OptionalAuth } from "@/utils/guards/auth.guard"; - @Resolver() export class ShowCoreMembersResolver { constructor(private readonly service: ShowCoreMembersService) {} diff --git a/apps/backend/src/utils/guards/admin-auth.guard.ts b/apps/backend/src/utils/guards/admin-auth.guard.ts deleted file mode 100644 index 73e53fba9..000000000 --- a/apps/backend/src/utils/guards/admin-auth.guard.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { CanActivate, ExecutionContext, Injectable } from "@nestjs/common"; -import { GqlExecutionContext } from "@nestjs/graphql"; -import { AuthorizationAdminSessionsService, Ctx } from "vitnode-backend"; - -@Injectable() -export class AdminAuthGuards implements CanActivate { - constructor(private readonly service: AuthorizationAdminSessionsService) {} - - protected async getAuth({ req, res }: Ctx) { - const data = await this.service.authorization({ - req, - res - }); - req.user = data.user; - - return data; - } - - async canActivate(context: ExecutionContext): Promise { - const ctx = GqlExecutionContext.create(context).getContext(); - - try { - return !!(await this.getAuth(ctx)); - } catch (e) { - // Return true if auth is optional - return true; - } - } -} diff --git a/apps/backend/src/utils/guards/admin-permission.guard.ts b/apps/backend/src/utils/guards/admin-permission.guard.ts deleted file mode 100644 index 01e92ec6b..000000000 --- a/apps/backend/src/utils/guards/admin-permission.guard.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { CanActivate, ExecutionContext, Injectable } from "@nestjs/common"; -import { Reflector } from "@nestjs/core"; -import { GqlExecutionContext } from "@nestjs/graphql"; -import { eq } from "drizzle-orm"; -import { - AuthorizationAdminSessionsService, - Ctx, - DatabaseService -} from "vitnode-backend"; - -import { core_users } from "@/plugins/core/admin/database/schema/users"; - -@Injectable() -export class AdminPermissionGuards implements CanActivate { - constructor( - private readonly reflector: Reflector, - private readonly service: AuthorizationAdminSessionsService, - private readonly databaseService: DatabaseService - ) {} - - protected async getAuth({ req, res }: Ctx) { - const data = await this.service.authorization({ - req, - res - }); - req.user = data.user; - - return data; - } - - async canActivate(context: ExecutionContext): Promise { - const ctx = GqlExecutionContext.create(context).getContext(); - - try { - const permission = this.reflector.get( - "permission", - context.getHandler() - ); - - const userId = ctx.getContext().user.id; - const user = await this.databaseService.db.query.core_users.findFirst({ - where: eq(core_users.id, userId) - }); - - if (!user) return false; - - const admin = - await this.databaseService.db.query.core_admin_permissions.findFirst({ - where: (table, { or, eq }) => - or(eq(table.user_id, user.id), eq(table.group_id, user.group_id)) - }); - - if (!admin?.permissions) return false; - const permissions = admin.permissions; - if (permissions[permission] === true) return true; - - return false; - } catch (e) { - // Return true if auth is optional - return true; - } - } -} diff --git a/apps/backend/src/utils/guards/auth.guard.ts b/apps/backend/src/utils/guards/auth.guard.ts deleted file mode 100644 index f9f0ef5ee..000000000 --- a/apps/backend/src/utils/guards/auth.guard.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { CanActivate, ExecutionContext, Injectable } from "@nestjs/common"; -import { GqlExecutionContext } from "@nestjs/graphql"; -import { Reflector } from "@nestjs/core"; -import { Ctx, InternalAuthorizationCoreSessionsService } from "vitnode-backend"; - -@Injectable() -export class AuthGuards implements CanActivate { - constructor( - private readonly reflector: Reflector, - private readonly service: InternalAuthorizationCoreSessionsService - ) {} - - protected async getAuth({ req, res }: Ctx) { - const data = await this.service.authorization({ - req, - res - }); - req.user = data; - - return data; - } - - async canActivate(context: ExecutionContext): Promise { - const optionalAuth = this.reflector.get(OptionalAuth, context.getHandler()); - - const ctx = GqlExecutionContext.create(context).getContext(); - - // If optional auth decorator is not set, check auth - if (optionalAuth === undefined) { - return !!(await this.getAuth(ctx)); - } else { - try { - return !!(await this.getAuth(ctx)); - } catch (e) { - // Return true if auth is optional - return true; - } - } - } -} - -export const OptionalAuth = Reflector.createDecorator(); diff --git a/apps/backend/src/utils/guards/dev.guard.ts b/apps/backend/src/utils/guards/dev.guard.ts deleted file mode 100644 index f2f128cca..000000000 --- a/apps/backend/src/utils/guards/dev.guard.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { CanActivate, Injectable } from "@nestjs/common"; -import { AccessDeniedError } from "vitnode-backend"; - -@Injectable() -export class OnlyForDevelopment implements CanActivate { - canActivate(): boolean { - if (process.env.NODE_ENV !== "development") { - throw new AccessDeniedError(); - } - - return true; - } -} diff --git a/packages/backend/src/app.module.ts b/packages/backend/src/app.module.ts index ede501e9a..ac599e85c 100644 --- a/packages/backend/src/app.module.ts +++ b/packages/backend/src/app.module.ts @@ -12,6 +12,7 @@ import { ApolloServerPluginLandingPageLocalDefault } from "@apollo/server/plugin import { Ctx } from "./utils"; import { CoreModule } from "./core/core.module"; import { DatabaseModule, DatabaseModuleArgs } from "./database/database.module"; +import { GlobalGuardsModule } from "./guards.module"; export const ABSOLUTE_PATHS_BACKEND = { schema: join(process.cwd(), "schema.gql"), @@ -113,6 +114,7 @@ export class VitNodeCoreModule { serveRoot: "/public/" }), DatabaseModule.register(database), + GlobalGuardsModule, CoreModule ] }; diff --git a/packages/backend/src/core/admin/sessions/sessions.module.ts b/packages/backend/src/core/admin/sessions/sessions.module.ts index 1ff1e1ebe..d028783f1 100644 --- a/packages/backend/src/core/admin/sessions/sessions.module.ts +++ b/packages/backend/src/core/admin/sessions/sessions.module.ts @@ -14,7 +14,11 @@ export class AdminSessionsModule {} @Module({ providers: [ AuthorizationAdminSessionsResolver, - AuthorizationAdminSessionsService + AuthorizationAdminSessionsService, + { + provide: "IOAdminAuthGuards", + useClass: AuthorizationAdminSessionsService + } ], exports: [ AuthorizationAdminSessionsResolver, diff --git a/packages/backend/src/guards.module.ts b/packages/backend/src/guards.module.ts new file mode 100644 index 000000000..930ef4db5 --- /dev/null +++ b/packages/backend/src/guards.module.ts @@ -0,0 +1,20 @@ +import { Global, Module } from "@nestjs/common"; + +import { AuthorizationAdminSessionsService } from "./core/admin/sessions/authorization/authorization.service"; +import { InternalAuthorizationCoreSessionsService } from "./core/sessions/authorization/internal/internal_authorization.service"; + +@Global() +@Module({ + providers: [ + { + provide: "IOAdminAuthGuards", + useClass: AuthorizationAdminSessionsService + }, + { + provide: "IOAuthGuards", + useClass: InternalAuthorizationCoreSessionsService + } + ], + exports: ["IOAdminAuthGuards", "IOAuthGuards"] +}) +export class GlobalGuardsModule {} diff --git a/packages/backend/src/utils/guards/admin-auth.guard.ts b/packages/backend/src/utils/guards/admin-auth.guard.ts index cb55a8538..ba2797a85 100644 --- a/packages/backend/src/utils/guards/admin-auth.guard.ts +++ b/packages/backend/src/utils/guards/admin-auth.guard.ts @@ -1,18 +1,31 @@ -import { CanActivate, ExecutionContext, Injectable } from "@nestjs/common"; +import { + CanActivate, + ExecutionContext, + Inject, + Injectable +} from "@nestjs/common"; import { GqlExecutionContext } from "@nestjs/graphql"; import { Ctx } from "../context"; -import { AuthorizationAdminSessionsService } from "../../core/admin/sessions/authorization/authorization.service"; + +import { AuthorizationAdminSessionsObj } from "../../core/admin/sessions/authorization/dto/authorization.obj"; + +export interface IOAdminAuthGuards { + authorization: (context: Ctx) => Promise; +} @Injectable() export class AdminAuthGuards implements CanActivate { - constructor(private readonly service: AuthorizationAdminSessionsService) {} + constructor( + @Inject("IOAdminAuthGuards") private readonly service: IOAdminAuthGuards + ) {} protected async getAuth({ req, res }: Ctx) { const data = await this.service.authorization({ req, res }); + req.user = data.user; return data; diff --git a/packages/backend/src/utils/guards/admin-permission.guard.ts b/packages/backend/src/utils/guards/admin-permission.guard.ts index b9d21bda9..d0440399b 100644 --- a/packages/backend/src/utils/guards/admin-permission.guard.ts +++ b/packages/backend/src/utils/guards/admin-permission.guard.ts @@ -1,19 +1,27 @@ -import { CanActivate, ExecutionContext, Injectable } from "@nestjs/common"; +import { + CanActivate, + ExecutionContext, + Inject, + Injectable +} from "@nestjs/common"; import { Reflector } from "@nestjs/core"; import { GqlExecutionContext } from "@nestjs/graphql"; -import { eq } from "drizzle-orm"; import { Ctx } from "../context"; +import { IOAdminAuthGuards } from "./admin-auth.guard"; -import { DatabaseService } from "../../database"; -import { AuthorizationAdminSessionsService } from "../../core/admin/sessions/authorization/authorization.service"; +// TODO: Implement in DOCS +// ? Example use +// @UseGuards(AdminPermissionGuards) +// @SetMetadata("permission", "create_group") @Injectable() export class AdminPermissionGuards implements CanActivate { + // TODO: Add inject for service // Basic service is not compatible with this package constructor( private readonly reflector: Reflector, - private readonly service: AuthorizationAdminSessionsService, - private readonly databaseService: DatabaseService + @Inject("IOAdminAuthGuards") private readonly service: IOAdminAuthGuards + // private readonly databaseService: DatabaseService ) {} protected async getAuth({ req, res }: Ctx) { @@ -30,27 +38,27 @@ export class AdminPermissionGuards implements CanActivate { const ctx = GqlExecutionContext.create(context).getContext(); try { - const permission = this.reflector.get( - "permission", - context.getHandler() - ); - - const userId = ctx.getContext().user.id; - const user = await this.databaseService.db.query.core_users.findFirst({ - where: (table, { eq }) => eq(table.id, userId) - }); - - if (!user) return false; - - const admin = - await this.databaseService.db.query.core_admin_permissions.findFirst({ - where: (table, { or, eq }) => - or(eq(table.user_id, user.id), eq(table.group_id, user.group_id)) - }); - - if (!admin?.permissions) return false; - const permissions = admin.permissions; - if (permissions[permission] === true) return true; + // const permission = this.reflector.get( + // "permission", + // context.getHandler() + // ); + + // const userId = ctx.getContext().user.id; + // const user = await this.databaseService.db.query.core_users.findFirst({ + // where: (table, { eq }) => eq(table.id, userId) + // }); + + // if (!user) return false; + + // const admin = + // await this.databaseService.db.query.core_admin_permissions.findFirst({ + // where: (table, { or, eq }) => + // or(eq(table.user_id, user.id), eq(table.group_id, user.group_id)) + // }); + + // if (!admin?.permissions) return false; + // const permissions = admin.permissions; + // if (permissions[permission] === true) return true; return false; } catch (e) { diff --git a/packages/backend/src/utils/guards/auth.guard.ts b/packages/backend/src/utils/guards/auth.guard.ts index c2d2bdd9a..0502122ac 100644 --- a/packages/backend/src/utils/guards/auth.guard.ts +++ b/packages/backend/src/utils/guards/auth.guard.ts @@ -1,16 +1,25 @@ -import { CanActivate, ExecutionContext, Injectable } from "@nestjs/common"; +import { + CanActivate, + ExecutionContext, + Inject, + Injectable +} from "@nestjs/common"; import { GqlExecutionContext } from "@nestjs/graphql"; import { Reflector } from "@nestjs/core"; import { Ctx } from "../context"; -import { InternalAuthorizationCoreSessionsService } from "../../core/sessions/authorization/internal/internal_authorization.service"; +import { User } from "../../decorators"; + +interface IOAuthGuards { + authorization: (context: Ctx) => Promise; +} @Injectable() export class AuthGuards implements CanActivate { constructor( private readonly reflector: Reflector, - private readonly service: InternalAuthorizationCoreSessionsService + @Inject("IOAuthGuards") private readonly service: IOAuthGuards ) {} protected async getAuth({ req, res }: Ctx) { diff --git a/packages/backend/src/utils/guards/index.ts b/packages/backend/src/utils/guards/index.ts new file mode 100644 index 000000000..a86a25e65 --- /dev/null +++ b/packages/backend/src/utils/guards/index.ts @@ -0,0 +1,4 @@ +export * from "./admin-auth.guard"; +export * from "./dev.guard"; +export * from "./auth.guard"; +export * from "./admin-permission.guard"; diff --git a/packages/backend/src/utils/index.ts b/packages/backend/src/utils/index.ts index d3b03bb28..4fb5d4cad 100644 --- a/packages/backend/src/utils/index.ts +++ b/packages/backend/src/utils/index.ts @@ -1,3 +1,4 @@ export * from "./pagination"; export * from "./text-language"; export * from "./context"; +export * from "./guards"; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4eb08ac39..0250bb409 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -162,6 +162,9 @@ importers: react-email: specifier: ^2.1.4 version: 2.1.4(@swc/helpers@0.5.11)(eslint@8.57.0)(ts-node@10.9.2(@swc/core@1.6.3(@swc/helpers@0.5.11))(@types/node@20.14.7)(typescript@5.5.2)) + ts-loader: + specifier: ^9.5.1 + version: 9.5.1(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11)) ts-node: specifier: ^10.9.2 version: 10.9.2(@swc/core@1.6.3)(@types/node@20.14.7)(typescript@5.5.2) @@ -8228,6 +8231,13 @@ packages: ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} + ts-loader@9.5.1: + resolution: {integrity: sha512-rNH3sK9kGZcH9dYzC7CewQm4NtxJTjSEVRJ2DyBZR7f8/wcta+iV44UPCXc5+nzDzivKtlzV6c9P4e+oFhDLYg==} + engines: {node: '>=12.0.0'} + peerDependencies: + typescript: '*' + webpack: ^5.0.0 + ts-log@2.2.5: resolution: {integrity: sha512-PGcnJoTBnVGy6yYNFxWVNkdcAuAMstvutN9MgDJIV6L0oG8fB+ZNNy1T+wJzah8RPGor1mZuPQkVfXNDpy9eHA==} @@ -17247,6 +17257,16 @@ snapshots: ts-interface-checker@0.1.13: {} + ts-loader@9.5.1(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11)): + dependencies: + chalk: 4.1.2 + enhanced-resolve: 5.17.0 + micromatch: 4.0.7 + semver: 7.6.2 + source-map: 0.7.4 + typescript: 5.5.2 + webpack: 5.92.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12) + ts-log@2.2.5: {} ts-node@10.9.2(@swc/core@1.6.3)(@types/node@20.14.7)(typescript@5.5.2): From b6a17912f0e4b5fcd5b36345841a56bde0ec2ce3 Mon Sep 17 00:00:00 2001 From: aXenDeveloper Date: Fri, 21 Jun 2024 23:18:21 +0200 Subject: [PATCH 14/27] perf(backend): Move plugins module to package --- .../src/plugins/core/admin/admin.module.ts | 2 - .../admin/settings/functions/get-core-info.ts | 2 +- .../utils/actions/helpers/update-plugins.ts | 2 +- packages/backend/package.json | 5 +- packages/backend/src/app.module.ts | 75 ++++++++++++++++++- .../backend/src/core/admin/admin.module.ts | 3 +- .../admin/plugins/create/create.resolver.ts | 3 +- .../admin/plugins/create/create.service.ts | 11 ++- .../admin/plugins/create/dto/create.args.ts | 3 +- .../core/admin/plugins/delete/contents.ts | 0 .../admin/plugins/delete/delete.resolver.ts | 3 +- .../admin/plugins/delete/delete.service.ts | 17 +++-- .../admin/plugins/delete/dto/delete.args.ts | 0 .../plugins/download/download.resolver.ts | 9 +-- .../plugins/download/download.service.ts | 32 ++++---- .../plugins/download/dto/download.args.ts | 0 .../core/admin/plugins/edit/dto/edit.args.ts | 0 .../core/admin/plugins/edit/edit.resolver.ts | 3 +- .../core/admin/plugins/edit/edit.service.ts | 10 +-- .../admin/plugins/files/dto/files.args.ts | 0 .../core/admin/plugins/files/dto/files.obj.ts | 0 .../admin/plugins/files/files.resolver.ts | 3 +- .../core/admin/plugins/files/files.service.ts | 7 +- .../change-code-plugin-to-capital-letters.ts | 0 .../helpers/files/change/change.service.ts | 16 ++-- .../plugins/helpers/files/change/contents.ts | 0 .../plugins/helpers/files/create/contents.ts | 18 +---- .../files/create/create-files.service.ts | 14 ++-- .../change_position.resolver.ts | 3 +- .../change_position.service.ts | 9 ++- .../dto/change_position.args.ts | 0 .../plugins/nav/create/create.resolver.ts | 3 +- .../plugins/nav/create/create.service.ts | 9 ++- .../plugins/nav/create/dto/create.args.ts | 3 +- .../plugins/nav/delete/delete.resolver.ts | 3 +- .../plugins/nav/delete/delete.service.ts | 9 ++- .../plugins/nav/delete/dto/delete.args.ts | 0 .../admin/plugins/nav/edit/dto/edit.args.ts | 0 .../admin/plugins/nav/edit/edit.resolver.ts | 3 +- .../admin/plugins/nav/edit/edit.service.ts | 9 ++- .../core/admin/plugins/nav/helpers.service.ts | 3 +- .../admin/plugins/nav/nav-plugins.module.ts | 0 .../admin/plugins/nav/show/dto/show.args.ts | 0 .../admin/plugins/nav/show/dto/show.obj.ts | 0 .../admin/plugins/nav/show/show.resolver.ts | 3 +- .../admin/plugins/nav/show/show.service.ts | 9 ++- .../src}/core/admin/plugins/plugins.module.ts | 16 ++-- .../core/admin/plugins/show/dto/show.args.ts | 3 +- .../core/admin/plugins/show/dto/show.obj.ts | 3 +- .../core/admin/plugins/show/show.resolver.ts | 3 +- .../core/admin/plugins/show/show.service.ts | 11 +-- .../backend/src/core/admin/plugins/type.ts | 22 ++++++ .../admin/plugins/upload/dto/upload.args.ts | 3 +- .../admin/plugins/upload/upload.resolver.ts | 3 +- .../admin/plugins/upload/upload.service.ts | 33 ++++---- packages/backend/src/index.ts | 1 + pnpm-lock.yaml | 37 ++++----- 57 files changed, 266 insertions(+), 173 deletions(-) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/create/create.resolver.ts (89%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/create/create.service.ts (86%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/create/dto/create.args.ts (94%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/delete/contents.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/delete/delete.resolver.ts (91%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/delete/delete.service.ts (79%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/delete/dto/delete.args.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/download/download.resolver.ts (82%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/download/download.service.ts (83%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/download/dto/download.args.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/edit/dto/edit.args.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/edit/edit.resolver.ts (89%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/edit/edit.service.ts (85%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/files/dto/files.args.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/files/dto/files.obj.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/files/files.resolver.ts (89%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/files/files.service.ts (87%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/helpers/change-code-plugin-to-capital-letters.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/helpers/files/change/change.service.ts (82%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/helpers/files/change/contents.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/helpers/files/create/contents.ts (79%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/helpers/files/create/create-files.service.ts (87%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/nav/change_position/change_position.resolver.ts (89%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/nav/change_position/change_position.service.ts (90%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/nav/change_position/dto/change_position.args.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/nav/create/create.resolver.ts (89%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/nav/create/create.service.ts (87%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/nav/create/dto/create.args.ts (91%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/nav/delete/delete.resolver.ts (88%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/nav/delete/delete.service.ts (83%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/nav/delete/dto/delete.args.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/nav/edit/dto/edit.args.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/nav/edit/edit.resolver.ts (89%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/nav/edit/edit.service.ts (87%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/nav/helpers.service.ts (80%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/nav/nav-plugins.module.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/nav/show/dto/show.args.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/nav/show/dto/show.obj.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/nav/show/show.resolver.ts (89%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/nav/show/show.service.ts (70%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/plugins.module.ts (91%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/show/dto/show.args.ts (91%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/show/dto/show.obj.ts (95%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/show/show.resolver.ts (91%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/show/show.service.ts (82%) create mode 100644 packages/backend/src/core/admin/plugins/type.ts rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/upload/dto/upload.args.ts (75%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/upload/upload.resolver.ts (92%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/plugins/upload/upload.service.ts (91%) diff --git a/apps/backend/src/plugins/core/admin/admin.module.ts b/apps/backend/src/plugins/core/admin/admin.module.ts index 38a52cf63..9d7ed2997 100644 --- a/apps/backend/src/plugins/core/admin/admin.module.ts +++ b/apps/backend/src/plugins/core/admin/admin.module.ts @@ -2,7 +2,6 @@ import { Module } from "@nestjs/common"; import { AdminInstallModule } from "./install/install.module"; import { AdminSettingsModule } from "./settings/settings.module"; -import { AdminPluginsModule } from "./plugins/plugins.module"; import { AdminMetadataModule } from "./metadata/metadata.module"; import { AdminFilesModule } from "./files/files.module"; import { AdminGroupsModule } from "./groups/groups.module"; @@ -16,7 +15,6 @@ import { AdminEmailModule } from "./email/email.module"; imports: [ AdminInstallModule, AdminSettingsModule, - AdminPluginsModule, AdminMetadataModule, AdminFilesModule, AdminGroupsModule, diff --git a/apps/backend/src/plugins/core/admin/settings/functions/get-core-info.ts b/apps/backend/src/plugins/core/admin/settings/functions/get-core-info.ts index b74a275cd..68c71af37 100644 --- a/apps/backend/src/plugins/core/admin/settings/functions/get-core-info.ts +++ b/apps/backend/src/plugins/core/admin/settings/functions/get-core-info.ts @@ -1,7 +1,7 @@ import { join } from "path"; import * as fs from "fs"; -import { PluginInfoJSONType } from "../../plugins/helpers/files/create/contents"; +import { PluginInfoJSONType } from "vitnode-backend"; export const getCoreInfo = async () => { const path = join(process.cwd(), "src", "plugins", "core"); diff --git a/apps/backend/src/utils/actions/helpers/update-plugins.ts b/apps/backend/src/utils/actions/helpers/update-plugins.ts index 4aa1a61a0..9576ae571 100644 --- a/apps/backend/src/utils/actions/helpers/update-plugins.ts +++ b/apps/backend/src/utils/actions/helpers/update-plugins.ts @@ -3,8 +3,8 @@ import * as fs from "fs"; import { NodePgDatabase } from "drizzle-orm/node-postgres"; import { eq } from "drizzle-orm"; +import { ConfigPlugin } from "vitnode-backend"; -import { ConfigPlugin } from "@/plugins/core/admin/plugins/plugins.module"; import { core_plugins } from "@/plugins/core/admin/database/schema/plugins"; import { schemaDatabase } from "@/database/schema"; import { poolDB } from "@/database/client"; diff --git a/packages/backend/package.json b/packages/backend/package.json index 36116eba2..d3f4c2b9a 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -34,13 +34,13 @@ "@types/node": "^20.14.7", "@types/object-path": "^0.11.4", "@types/pg": "^8.11.6", + "@vitnode/shared": "workspace:*", "busboy": "^1.6.0", "class-transformer": "^0.5.1", "eslint-config-vitnode": "workspace:*", "http-errors": "^2.0.0", "object-path": "^0.11.8", - "typescript": "^5.5.2", - "@vitnode/shared": "workspace:*" + "typescript": "^5.5.2" }, "dependencies": { "bcrypt": "^5.1.1", @@ -51,6 +51,7 @@ "express": "^4.19.2", "graphql": "^16.8.2", "pg": "^8.12.0", + "tar": "^7.4.0", "ua-parser-js": "2.0.0-beta.3" } } diff --git a/packages/backend/src/app.module.ts b/packages/backend/src/app.module.ts index ac599e85c..33284407b 100644 --- a/packages/backend/src/app.module.ts +++ b/packages/backend/src/app.module.ts @@ -14,15 +14,82 @@ import { CoreModule } from "./core/core.module"; import { DatabaseModule, DatabaseModuleArgs } from "./database/database.module"; import { GlobalGuardsModule } from "./guards.module"; +const internalPaths = { + backend: join(process.cwd(), "src"), + frontend: join(process.cwd(), "..", "frontend"), + uploads: join(process.cwd(), "uploads"), + plugins: join(process.cwd(), "src", "plugins") +}; + export const ABSOLUTE_PATHS_BACKEND = { + backend: internalPaths.backend, schema: join(process.cwd(), "schema.gql"), uploads: { - public: join(process.cwd(), "uploads", "public") + public: join(internalPaths.uploads, "public"), + private: join(internalPaths.uploads, "private"), + temp: join(internalPaths.uploads, "temp") }, + plugins: internalPaths.plugins, plugin: ({ code }: { code: string }) => ({ - root: join(process.cwd(), "src", "plugin", code), - config: join(process.cwd(), "src", "plugin", code, "config.json") - }) + root: join(internalPaths.plugins, code), + versions: join(internalPaths.plugins, code, "versions.json"), + admin: join(internalPaths.plugins, code, "admin"), + config: join(internalPaths.plugins, code, "config.json"), + database: { + init: join(internalPaths.plugins, code, "admin", "database"), + schema: join(internalPaths.plugins, code, "admin", "database", "schema"), + migrations: join( + internalPaths.plugins, + code, + "admin", + "database", + "migrations" + ), + migration_info: join( + internalPaths.plugins, + code, + "admin", + "database", + "migrations", + "meta", + "_journal.json" + ) + }, + frontend: { + admin_pages: join( + internalPaths.frontend, + "app", + "[locale]", + "(admin)", + "admin", + "(auth)", + code + ), + admin_templates: join(internalPaths.frontend, "plugins", code, "admin"), + pages_container: join( + internalPaths.frontend, + "app", + "[locale]", + "(main)", + "(container)", + code + ), + default_page: join( + internalPaths.frontend, + "plugins", + code, + "templates", + "default-page.tsx" + ), + pages: join(internalPaths.frontend, "app", "[locale]", "(main)", code), + templates: join(internalPaths.frontend, "plugins", code, "templates"), + plugin: join(internalPaths.frontend, "plugins", code), + language: join(internalPaths.frontend, "plugins", code, "langs") + } + }), + frontend: { + init: join(process.cwd(), "..", "frontend") + } }; const parseFrontendUrlFromEnv = () => { diff --git a/packages/backend/src/core/admin/admin.module.ts b/packages/backend/src/core/admin/admin.module.ts index cd1c06f82..73b4cfeeb 100644 --- a/packages/backend/src/core/admin/admin.module.ts +++ b/packages/backend/src/core/admin/admin.module.ts @@ -4,8 +4,9 @@ import { AdminSessionsModule, GlobalAdminSessionsModule } from "./sessions/sessions.module"; +import { AdminPluginsModule } from "./plugins/plugins.module"; @Module({ - imports: [GlobalAdminSessionsModule, AdminSessionsModule] + imports: [GlobalAdminSessionsModule, AdminSessionsModule, AdminPluginsModule] }) export class AdminModule {} diff --git a/apps/backend/src/plugins/core/admin/plugins/create/create.resolver.ts b/packages/backend/src/core/admin/plugins/create/create.resolver.ts similarity index 89% rename from apps/backend/src/plugins/core/admin/plugins/create/create.resolver.ts rename to packages/backend/src/core/admin/plugins/create/create.resolver.ts index a4a965772..5b9751594 100644 --- a/apps/backend/src/plugins/core/admin/plugins/create/create.resolver.ts +++ b/packages/backend/src/core/admin/plugins/create/create.resolver.ts @@ -1,11 +1,12 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards, OnlyForDevelopment } from "vitnode-backend"; import { CreateAdminPluginsService } from "./create.service"; import { CreateAdminPluginsArgs } from "./dto/create.args"; import { ShowAdminPlugins } from "../show/dto/show.obj"; +import { AdminAuthGuards, OnlyForDevelopment } from "../../../../utils"; + @Resolver() export class CreateAdminPluginsResolver { constructor(private readonly service: CreateAdminPluginsService) {} diff --git a/apps/backend/src/plugins/core/admin/plugins/create/create.service.ts b/packages/backend/src/core/admin/plugins/create/create.service.ts similarity index 86% rename from apps/backend/src/plugins/core/admin/plugins/create/create.service.ts rename to packages/backend/src/core/admin/plugins/create/create.service.ts index fcda5d238..3e74953e9 100644 --- a/apps/backend/src/plugins/core/admin/plugins/create/create.service.ts +++ b/packages/backend/src/core/admin/plugins/create/create.service.ts @@ -2,15 +2,16 @@ import { join } from "path"; import * as fs from "fs"; import { Injectable } from "@nestjs/common"; -import { CustomError, DatabaseService } from "vitnode-backend"; import { CreateAdminPluginsArgs } from "./dto/create.args"; import { ShowAdminPlugins } from "../show/dto/show.obj"; import { CreateFilesAdminPluginsService } from "../helpers/files/create/create-files.service"; import { ChangeFilesAdminPluginsService } from "../helpers/files/change/change.service"; -import { core_plugins } from "../../database/schema/plugins"; -import { ABSOLUTE_PATHS } from "@/config"; +import { DatabaseService } from "../../../../database"; +import { CustomError } from "../../../../errors"; +import { ABSOLUTE_PATHS_BACKEND } from "../../../.."; +import { core_plugins } from "../../../../templates/core/admin/database/schema/plugins"; @Injectable() export class CreateAdminPluginsService { @@ -59,7 +60,9 @@ export class CreateAdminPluginsService { }); languages.forEach(async lang => { - const langPath = join(ABSOLUTE_PATHS.plugin({ code }).frontend.language); + const langPath = join( + ABSOLUTE_PATHS_BACKEND.plugin({ code }).frontend.language + ); if (!fs.existsSync(langPath)) { fs.mkdirSync(langPath, { recursive: true }); diff --git a/apps/backend/src/plugins/core/admin/plugins/create/dto/create.args.ts b/packages/backend/src/core/admin/plugins/create/dto/create.args.ts similarity index 94% rename from apps/backend/src/plugins/core/admin/plugins/create/dto/create.args.ts rename to packages/backend/src/core/admin/plugins/create/dto/create.args.ts index 256ae1a4a..d56d262a4 100644 --- a/apps/backend/src/plugins/core/admin/plugins/create/dto/create.args.ts +++ b/packages/backend/src/core/admin/plugins/create/dto/create.args.ts @@ -7,7 +7,8 @@ import { MaxLength, MinLength } from "class-validator"; -import { TransformString } from "vitnode-backend"; + +import { TransformString } from "../../../../../utils"; @ArgsType() export class CreateAdminPluginsArgs { diff --git a/apps/backend/src/plugins/core/admin/plugins/delete/contents.ts b/packages/backend/src/core/admin/plugins/delete/contents.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/plugins/delete/contents.ts rename to packages/backend/src/core/admin/plugins/delete/contents.ts diff --git a/apps/backend/src/plugins/core/admin/plugins/delete/delete.resolver.ts b/packages/backend/src/core/admin/plugins/delete/delete.resolver.ts similarity index 91% rename from apps/backend/src/plugins/core/admin/plugins/delete/delete.resolver.ts rename to packages/backend/src/core/admin/plugins/delete/delete.resolver.ts index e6f3479d0..874936fa6 100644 --- a/apps/backend/src/plugins/core/admin/plugins/delete/delete.resolver.ts +++ b/packages/backend/src/core/admin/plugins/delete/delete.resolver.ts @@ -1,10 +1,11 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards } from "vitnode-backend"; import { DeleteAdminPluginsService } from "./delete.service"; import { DeleteAdminPluginsArgs } from "./dto/delete.args"; +import { AdminAuthGuards } from "../../../../utils"; + @Resolver() export class DeleteAdminPluginsResolver { constructor(private readonly service: DeleteAdminPluginsService) {} diff --git a/apps/backend/src/plugins/core/admin/plugins/delete/delete.service.ts b/packages/backend/src/core/admin/plugins/delete/delete.service.ts similarity index 79% rename from apps/backend/src/plugins/core/admin/plugins/delete/delete.service.ts rename to packages/backend/src/core/admin/plugins/delete/delete.service.ts index fdab2cd2c..37859aded 100644 --- a/apps/backend/src/plugins/core/admin/plugins/delete/delete.service.ts +++ b/packages/backend/src/core/admin/plugins/delete/delete.service.ts @@ -2,15 +2,15 @@ import * as fs from "fs"; import { Injectable } from "@nestjs/common"; import { eq, sql } from "drizzle-orm"; -import { NotFoundError, CustomError, DatabaseService } from "vitnode-backend"; import { DeleteAdminPluginsArgs } from "./dto/delete.args"; import { ChangeFilesAdminPluginsService } from "../helpers/files/change/change.service"; -import { core_plugins } from "../../database/schema/plugins"; -import { setRebuildRequired } from "@/functions/rebuild-required"; -import { ABSOLUTE_PATHS } from "@/config"; -import { core_migrations } from "../../database/schema/files"; +import { DatabaseService } from "../../../../database"; +import { CustomError, NotFoundError } from "../../../../errors"; +import { core_migrations } from "../../../../templates/core/admin/database/schema/files"; +import { ABSOLUTE_PATHS_BACKEND } from "../../../.."; +import { core_plugins } from "../../../../templates/core/admin/database/schema/plugins"; @Injectable() export class DeleteAdminPluginsService { @@ -65,13 +65,13 @@ export class DeleteAdminPluginsService { .where(eq(core_migrations.plugin, code)); this.changeFilesService.changeFilesWhenDelete({ code }); - const modulePath = ABSOLUTE_PATHS.plugin({ code }).root; + const modulePath = ABSOLUTE_PATHS_BACKEND.plugin({ code }).root; this.deleteFolderWhenExists(modulePath); // Frontend const frontendPaths = ["admin_pages", "pages", "plugin", "pages_container"]; frontendPaths.forEach(path => { this.deleteFolderWhenExists( - ABSOLUTE_PATHS.plugin({ code }).frontend[path] + ABSOLUTE_PATHS_BACKEND.plugin({ code }).frontend[path] ); }); @@ -79,7 +79,8 @@ export class DeleteAdminPluginsService { .delete(core_plugins) .where(eq(core_plugins.code, code)); - await setRebuildRequired({ set: "plugins" }); + // TODO: Set rebuild required + // await setRebuildRequired({ set: "plugins" }); return "Success!"; } diff --git a/apps/backend/src/plugins/core/admin/plugins/delete/dto/delete.args.ts b/packages/backend/src/core/admin/plugins/delete/dto/delete.args.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/plugins/delete/dto/delete.args.ts rename to packages/backend/src/core/admin/plugins/delete/dto/delete.args.ts diff --git a/apps/backend/src/plugins/core/admin/plugins/download/download.resolver.ts b/packages/backend/src/core/admin/plugins/download/download.resolver.ts similarity index 82% rename from apps/backend/src/plugins/core/admin/plugins/download/download.resolver.ts rename to packages/backend/src/core/admin/plugins/download/download.resolver.ts index e1e52b78a..f658b70f1 100644 --- a/apps/backend/src/plugins/core/admin/plugins/download/download.resolver.ts +++ b/packages/backend/src/core/admin/plugins/download/download.resolver.ts @@ -1,15 +1,12 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { - CurrentUser, - User, - AdminAuthGuards, - OnlyForDevelopment -} from "vitnode-backend"; import { DownloadAdminPluginsService } from "./download.service"; import { DownloadAdminPluginsArgs } from "./dto/download.args"; +import { AdminAuthGuards, OnlyForDevelopment } from "../../../../utils"; +import { CurrentUser, User } from "../../../../decorators"; + @Resolver() export class DownloadAdminPluginsResolver { constructor(private readonly service: DownloadAdminPluginsService) {} diff --git a/apps/backend/src/plugins/core/admin/plugins/download/download.service.ts b/packages/backend/src/core/admin/plugins/download/download.service.ts similarity index 83% rename from apps/backend/src/plugins/core/admin/plugins/download/download.service.ts rename to packages/backend/src/core/admin/plugins/download/download.service.ts index 3e86f46a0..490f4e2a1 100644 --- a/apps/backend/src/plugins/core/admin/plugins/download/download.service.ts +++ b/packages/backend/src/core/admin/plugins/download/download.service.ts @@ -9,23 +9,19 @@ import { generateRandomString, removeSpecialCharacters } from "@vitnode/shared"; -import { - NotFoundError, - CustomError, - execShellCommand, - User, - DatabaseService -} from "vitnode-backend"; import { DownloadAdminPluginsArgs } from "./dto/download.args"; -import { PluginInfoJSONType } from "../helpers/files/create/contents"; -import { core_plugins } from "../../database/schema/plugins"; -import { ABSOLUTE_PATHS } from "@/config"; +import { DatabaseService } from "../../../../database"; +import { CustomError, NotFoundError } from "../../../../errors"; +import { execShellCommand } from "../../../../functions"; +import { User } from "../../../../decorators"; +import { ABSOLUTE_PATHS_BACKEND, PluginInfoJSONType } from "../../../.."; +import { core_plugins } from "../../../../templates/core/admin/database/schema/plugins"; @Injectable() export class DownloadAdminPluginsService { - protected tempPath = join(ABSOLUTE_PATHS.uploads.temp, "plugins"); + protected tempPath = join(ABSOLUTE_PATHS_BACKEND.uploads.temp, "plugins"); constructor(private readonly databaseService: DatabaseService) {} @@ -72,7 +68,7 @@ export class DownloadAdminPluginsService { frontendPaths.forEach(path => { this.copyFiles({ destination: join(frontendPath, path), - source: ABSOLUTE_PATHS.plugin({ code }).frontend[path] + source: ABSOLUTE_PATHS_BACKEND.plugin({ code }).frontend[path] }); }); @@ -85,12 +81,12 @@ export class DownloadAdminPluginsService { version_code }: DownloadAdminPluginsArgs): Promise { // Update allow_default in config.json - const pathInfoJSON = ABSOLUTE_PATHS.plugin({ code }).config; + const pathInfoJSON = ABSOLUTE_PATHS_BACKEND.plugin({ code }).config; const infoJSON: PluginInfoJSONType = JSON.parse( fs.readFileSync(pathInfoJSON, "utf-8") ); const allow_default = fs.existsSync( - ABSOLUTE_PATHS.plugin({ code }).frontend.default_page + ABSOLUTE_PATHS_BACKEND.plugin({ code }).frontend.default_page ); infoJSON.allow_default = allow_default; @@ -132,7 +128,7 @@ export class DownloadAdminPluginsService { .where(eq(core_plugins.code, code)) .returning(); - const pathToVersions = ABSOLUTE_PATHS.plugin({ code }).versions; + const pathToVersions = ABSOLUTE_PATHS_BACKEND.plugin({ code }).versions; if (!fs.existsSync(pathToVersions)) { throw new CustomError({ code: "VERSIONS_FILE_NOT_FOUND", @@ -148,8 +144,8 @@ export class DownloadAdminPluginsService { } protected async generateMigration({ code }: { code: string }): Promise { - const path = ABSOLUTE_PATHS.plugin({ code }).database.migrations; - const schemaPath = ABSOLUTE_PATHS.plugin({ code }).database.schema; + const path = ABSOLUTE_PATHS_BACKEND.plugin({ code }).database.migrations; + const schemaPath = ABSOLUTE_PATHS_BACKEND.plugin({ code }).database.schema; if (!fs.existsSync(schemaPath)) return; if (!fs.existsSync(path)) { fs.mkdirSync(path, { @@ -197,7 +193,7 @@ export class DownloadAdminPluginsService { .c( { gzip: true, - file: join(ABSOLUTE_PATHS.uploads.temp, `${name}.tgz`), + file: join(ABSOLUTE_PATHS_BACKEND.uploads.temp, `${name}.tgz`), cwd: tempPath }, ["."] diff --git a/apps/backend/src/plugins/core/admin/plugins/download/dto/download.args.ts b/packages/backend/src/core/admin/plugins/download/dto/download.args.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/plugins/download/dto/download.args.ts rename to packages/backend/src/core/admin/plugins/download/dto/download.args.ts diff --git a/apps/backend/src/plugins/core/admin/plugins/edit/dto/edit.args.ts b/packages/backend/src/core/admin/plugins/edit/dto/edit.args.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/plugins/edit/dto/edit.args.ts rename to packages/backend/src/core/admin/plugins/edit/dto/edit.args.ts diff --git a/apps/backend/src/plugins/core/admin/plugins/edit/edit.resolver.ts b/packages/backend/src/core/admin/plugins/edit/edit.resolver.ts similarity index 89% rename from apps/backend/src/plugins/core/admin/plugins/edit/edit.resolver.ts rename to packages/backend/src/core/admin/plugins/edit/edit.resolver.ts index dd94c5bc4..54039856b 100644 --- a/apps/backend/src/plugins/core/admin/plugins/edit/edit.resolver.ts +++ b/packages/backend/src/core/admin/plugins/edit/edit.resolver.ts @@ -1,11 +1,12 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards, OnlyForDevelopment } from "vitnode-backend"; import { EditAdminPluginsService } from "./edit.service"; import { ShowAdminPlugins } from "../show/dto/show.obj"; import { EditAdminPluginsArgs } from "./dto/edit.args"; +import { AdminAuthGuards, OnlyForDevelopment } from "../../../../utils"; + @Resolver() export class EditAdminPluginsResolver { constructor(private readonly service: EditAdminPluginsService) {} diff --git a/apps/backend/src/plugins/core/admin/plugins/edit/edit.service.ts b/packages/backend/src/core/admin/plugins/edit/edit.service.ts similarity index 85% rename from apps/backend/src/plugins/core/admin/plugins/edit/edit.service.ts rename to packages/backend/src/core/admin/plugins/edit/edit.service.ts index a71afa216..8c81a32e9 100644 --- a/apps/backend/src/plugins/core/admin/plugins/edit/edit.service.ts +++ b/packages/backend/src/core/admin/plugins/edit/edit.service.ts @@ -2,14 +2,14 @@ import * as fs from "fs"; import { Injectable } from "@nestjs/common"; import { eq, ne } from "drizzle-orm"; -import { NotFoundError, CustomError, DatabaseService } from "vitnode-backend"; import { ShowAdminPlugins } from "../show/dto/show.obj"; import { EditAdminPluginsArgs } from "./dto/edit.args"; -import { ConfigPlugin } from "../plugins.module"; -import { core_plugins } from "../../database/schema/plugins"; -import { ABSOLUTE_PATHS } from "@/config"; +import { DatabaseService } from "../../../../database"; +import { CustomError, NotFoundError } from "../../../../errors"; +import { core_plugins } from "../../../../templates/core/admin/database/schema/plugins"; +import { ABSOLUTE_PATHS_BACKEND, ConfigPlugin } from "../../../.."; @Injectable() export class EditAdminPluginsService { @@ -62,7 +62,7 @@ export class EditAdminPluginsService { .returning(); // Update config.json - const path = ABSOLUTE_PATHS.plugin({ code }).config; + const path = ABSOLUTE_PATHS_BACKEND.plugin({ code }).config; const pluginFile = fs.readFileSync(path, "utf8"); const config: Omit = JSON.parse(pluginFile); diff --git a/apps/backend/src/plugins/core/admin/plugins/files/dto/files.args.ts b/packages/backend/src/core/admin/plugins/files/dto/files.args.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/plugins/files/dto/files.args.ts rename to packages/backend/src/core/admin/plugins/files/dto/files.args.ts diff --git a/apps/backend/src/plugins/core/admin/plugins/files/dto/files.obj.ts b/packages/backend/src/core/admin/plugins/files/dto/files.obj.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/plugins/files/dto/files.obj.ts rename to packages/backend/src/core/admin/plugins/files/dto/files.obj.ts diff --git a/apps/backend/src/plugins/core/admin/plugins/files/files.resolver.ts b/packages/backend/src/core/admin/plugins/files/files.resolver.ts similarity index 89% rename from apps/backend/src/plugins/core/admin/plugins/files/files.resolver.ts rename to packages/backend/src/core/admin/plugins/files/files.resolver.ts index a79a664b7..b73e63904 100644 --- a/apps/backend/src/plugins/core/admin/plugins/files/files.resolver.ts +++ b/packages/backend/src/core/admin/plugins/files/files.resolver.ts @@ -1,11 +1,12 @@ import { Args, Query, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards, OnlyForDevelopment } from "vitnode-backend"; import { FilesAdminPluginsService } from "./files.service"; import { FilesAdminPluginsArgs } from "./dto/files.args"; import { FilesAdminPluginsObj } from "./dto/files.obj"; +import { AdminAuthGuards, OnlyForDevelopment } from "../../../../utils"; + @Resolver() export class FilesAdminPluginsResolver { constructor(private readonly service: FilesAdminPluginsService) {} diff --git a/apps/backend/src/plugins/core/admin/plugins/files/files.service.ts b/packages/backend/src/core/admin/plugins/files/files.service.ts similarity index 87% rename from apps/backend/src/plugins/core/admin/plugins/files/files.service.ts rename to packages/backend/src/core/admin/plugins/files/files.service.ts index 07a8d4fae..6518363a3 100644 --- a/apps/backend/src/plugins/core/admin/plugins/files/files.service.ts +++ b/packages/backend/src/core/admin/plugins/files/files.service.ts @@ -1,12 +1,13 @@ import * as fs from "fs"; import { Injectable } from "@nestjs/common"; -import { NotFoundError, DatabaseService } from "vitnode-backend"; import { FilesAdminPluginsArgs } from "./dto/files.args"; import { FilesAdminPluginsObj } from "./dto/files.obj"; -import { ABSOLUTE_PATHS } from "@/config"; +import { DatabaseService } from "../../../../database"; +import { NotFoundError } from "../../../../errors"; +import { ABSOLUTE_PATHS_BACKEND } from "../../../.."; @Injectable() export class FilesAdminPluginsService { @@ -33,7 +34,7 @@ export class FilesAdminPluginsService { throw new NotFoundError("Plugin"); } - const pluginPaths = ABSOLUTE_PATHS.plugin({ code }); + const pluginPaths = ABSOLUTE_PATHS_BACKEND.plugin({ code }); return { databases: await this.checkNumberOfFiles({ diff --git a/apps/backend/src/plugins/core/admin/plugins/helpers/change-code-plugin-to-capital-letters.ts b/packages/backend/src/core/admin/plugins/helpers/change-code-plugin-to-capital-letters.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/plugins/helpers/change-code-plugin-to-capital-letters.ts rename to packages/backend/src/core/admin/plugins/helpers/change-code-plugin-to-capital-letters.ts diff --git a/apps/backend/src/plugins/core/admin/plugins/helpers/files/change/change.service.ts b/packages/backend/src/core/admin/plugins/helpers/files/change/change.service.ts similarity index 82% rename from apps/backend/src/plugins/core/admin/plugins/helpers/files/change/change.service.ts rename to packages/backend/src/core/admin/plugins/helpers/files/change/change.service.ts index 29edae331..db97c4c59 100644 --- a/apps/backend/src/plugins/core/admin/plugins/helpers/files/change/change.service.ts +++ b/packages/backend/src/core/admin/plugins/helpers/files/change/change.service.ts @@ -2,7 +2,6 @@ import { join } from "path"; import * as fs from "fs"; import { Injectable } from "@nestjs/common"; -import { CustomError } from "vitnode-backend"; import { changeDatabaseService, @@ -15,7 +14,8 @@ import { removeLangFromTypes, removeModuleFromRootSchema } from "../../../delete/contents"; -import { ABSOLUTE_PATHS } from "@/config"; +import { CustomError } from "../../../../../../errors"; +import { ABSOLUTE_PATHS_BACKEND } from "../../../../../.."; interface ChangeFilesContentType { condition: (content: string) => boolean; @@ -57,7 +57,7 @@ export class ChangeFilesAdminPluginsService { changeFilesWhenCreate({ code }: { code: string }): void { const files: ChangeFilesContentType[] = [ { - path: join(ABSOLUTE_PATHS.plugins, "plugins.module.ts"), + path: join(ABSOLUTE_PATHS_BACKEND.plugins, "plugins.module.ts"), content: content => changeModuleRootSchema({ content, @@ -66,7 +66,7 @@ export class ChangeFilesAdminPluginsService { condition: content => !content.includes(`./${code}/${code}.module`) }, { - path: join(ABSOLUTE_PATHS.backend, "database", "schema.ts"), + path: join(ABSOLUTE_PATHS_BACKEND.backend, "database", "schema.ts"), content: content => changeDatabaseService({ content, @@ -75,7 +75,7 @@ export class ChangeFilesAdminPluginsService { condition: () => true }, { - path: join(ABSOLUTE_PATHS.frontend.init, "global.d.ts"), + path: join(ABSOLUTE_PATHS_BACKEND.frontend.init, "global.d.ts"), content: content => changeLangTypes({ content, @@ -91,7 +91,7 @@ export class ChangeFilesAdminPluginsService { changeFilesWhenDelete({ code }: { code: string }): void { const files: ChangeFilesContentType[] = [ { - path: join(ABSOLUTE_PATHS.plugins, "plugins.module.ts"), + path: join(ABSOLUTE_PATHS_BACKEND.plugins, "plugins.module.ts"), content: content => removeModuleFromRootSchema({ content, @@ -100,7 +100,7 @@ export class ChangeFilesAdminPluginsService { condition: () => true }, { - path: join(ABSOLUTE_PATHS.backend, "database", "schema.ts"), + path: join(ABSOLUTE_PATHS_BACKEND.backend, "database", "schema.ts"), content: content => removeDatabaseFromService({ content, @@ -109,7 +109,7 @@ export class ChangeFilesAdminPluginsService { condition: () => true }, { - path: join(ABSOLUTE_PATHS.frontend.init, "global.d.ts"), + path: join(ABSOLUTE_PATHS_BACKEND.frontend.init, "global.d.ts"), content: content => removeLangFromTypes({ content, diff --git a/apps/backend/src/plugins/core/admin/plugins/helpers/files/change/contents.ts b/packages/backend/src/core/admin/plugins/helpers/files/change/contents.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/plugins/helpers/files/change/contents.ts rename to packages/backend/src/core/admin/plugins/helpers/files/change/contents.ts diff --git a/apps/backend/src/plugins/core/admin/plugins/helpers/files/create/contents.ts b/packages/backend/src/core/admin/plugins/helpers/files/create/contents.ts similarity index 79% rename from apps/backend/src/plugins/core/admin/plugins/helpers/files/create/contents.ts rename to packages/backend/src/core/admin/plugins/helpers/files/create/contents.ts index 5de2cfd8d..86862b55f 100644 --- a/apps/backend/src/plugins/core/admin/plugins/helpers/files/create/contents.ts +++ b/packages/backend/src/core/admin/plugins/helpers/files/create/contents.ts @@ -1,22 +1,6 @@ -import { CreateAdminPluginsArgs } from "../../../create/dto/create.args"; +import { PluginInfoJSONType } from "../../../type"; import { changeCodePluginToCapitalLetters } from "../../change-code-plugin-to-capital-letters"; -interface NavPluginInfoJSONType { - code: string; - href: string; - icon: string | null; -} - -export interface NavPluginInfoJSONTypeWithChildren - extends NavPluginInfoJSONType { - children?: NavPluginInfoJSONType[]; -} - -export interface PluginInfoJSONType extends CreateAdminPluginsArgs { - allow_default: boolean; - nav: NavPluginInfoJSONTypeWithChildren[]; -} - export const createModuleSchema = ({ code }: { code: string }) => { const name = changeCodePluginToCapitalLetters(code); diff --git a/apps/backend/src/plugins/core/admin/plugins/helpers/files/create/create-files.service.ts b/packages/backend/src/core/admin/plugins/helpers/files/create/create-files.service.ts similarity index 87% rename from apps/backend/src/plugins/core/admin/plugins/helpers/files/create/create-files.service.ts rename to packages/backend/src/core/admin/plugins/helpers/files/create/create-files.service.ts index e9cdbd983..8aad8ae98 100644 --- a/apps/backend/src/plugins/core/admin/plugins/helpers/files/create/create-files.service.ts +++ b/packages/backend/src/core/admin/plugins/helpers/files/create/create-files.service.ts @@ -2,10 +2,8 @@ import * as fs from "fs"; import { join } from "path"; import { Injectable } from "@nestjs/common"; -import { CustomError } from "vitnode-backend"; import { - PluginInfoJSONType, createConfigForDrizzle, createFunctionsDatabase, createInfoJSON, @@ -13,7 +11,11 @@ import { createModuleSchema } from "./contents"; -import { ABSOLUTE_PATHS } from "@/config"; +import { + ABSOLUTE_PATHS_BACKEND, + CustomError, + PluginInfoJSONType +} from "../../../../../.."; @Injectable() export class CreateFilesAdminPluginsService { @@ -23,7 +25,7 @@ export class CreateFilesAdminPluginsService { path: string; }[] = [ { - path: join(ABSOLUTE_PATHS.plugins, code), + path: ABSOLUTE_PATHS_BACKEND.plugin({ code }).root, files: [ { name: `${code}.module.ts`, @@ -40,7 +42,7 @@ export class CreateFilesAdminPluginsService { ] }, { - path: join(ABSOLUTE_PATHS.plugins, code, "admin"), + path: ABSOLUTE_PATHS_BACKEND.plugin({ code }).admin, files: [ { name: "admin.module.ts", @@ -49,7 +51,7 @@ export class CreateFilesAdminPluginsService { ] }, { - path: join(ABSOLUTE_PATHS.plugins, code, "admin", "database"), + path: ABSOLUTE_PATHS_BACKEND.plugin({ code }).database.init, files: [ { name: "index.ts", diff --git a/apps/backend/src/plugins/core/admin/plugins/nav/change_position/change_position.resolver.ts b/packages/backend/src/core/admin/plugins/nav/change_position/change_position.resolver.ts similarity index 89% rename from apps/backend/src/plugins/core/admin/plugins/nav/change_position/change_position.resolver.ts rename to packages/backend/src/core/admin/plugins/nav/change_position/change_position.resolver.ts index 2452d8fc9..0dc93bb01 100644 --- a/apps/backend/src/plugins/core/admin/plugins/nav/change_position/change_position.resolver.ts +++ b/packages/backend/src/core/admin/plugins/nav/change_position/change_position.resolver.ts @@ -1,10 +1,11 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards, OnlyForDevelopment } from "vitnode-backend"; import { ChangePositionAdminNavPluginsService } from "./change_position.service"; import { ChangePositionAdminNavPluginsArgs } from "./dto/change_position.args"; +import { AdminAuthGuards, OnlyForDevelopment } from "../../../../../utils"; + @Resolver() export class ChangePositionAdminNavPluginsResolver { constructor(private readonly service: ChangePositionAdminNavPluginsService) {} diff --git a/apps/backend/src/plugins/core/admin/plugins/nav/change_position/change_position.service.ts b/packages/backend/src/core/admin/plugins/nav/change_position/change_position.service.ts similarity index 90% rename from apps/backend/src/plugins/core/admin/plugins/nav/change_position/change_position.service.ts rename to packages/backend/src/core/admin/plugins/nav/change_position/change_position.service.ts index 4bcabe969..c15f1ed15 100644 --- a/apps/backend/src/plugins/core/admin/plugins/nav/change_position/change_position.service.ts +++ b/packages/backend/src/core/admin/plugins/nav/change_position/change_position.service.ts @@ -1,13 +1,12 @@ import * as fs from "fs"; import { Injectable } from "@nestjs/common"; -import { NotFoundError } from "vitnode-backend"; import { ChangePositionAdminNavPluginsArgs } from "./dto/change_position.args"; import { HelpersAdminNavPluginsService } from "../helpers.service"; -import { ABSOLUTE_PATHS } from "@/config"; -import { ConfigPlugin } from "../../plugins.module"; +import { NotFoundError } from "../../../../../errors"; +import { ABSOLUTE_PATHS_BACKEND, ConfigPlugin } from "../../../../.."; @Injectable() export class ChangePositionAdminNavPluginsService extends HelpersAdminNavPluginsService { @@ -40,7 +39,9 @@ export class ChangePositionAdminNavPluginsService extends HelpersAdminNavPlugins index_to_move, parent_code }: ChangePositionAdminNavPluginsArgs): string { - const pathConfig = ABSOLUTE_PATHS.plugin({ code: plugin_code }).config; + const pathConfig = ABSOLUTE_PATHS_BACKEND.plugin({ + code: plugin_code + }).config; if (!fs.existsSync(pathConfig)) { throw new NotFoundError("Plugin"); } diff --git a/apps/backend/src/plugins/core/admin/plugins/nav/change_position/dto/change_position.args.ts b/packages/backend/src/core/admin/plugins/nav/change_position/dto/change_position.args.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/plugins/nav/change_position/dto/change_position.args.ts rename to packages/backend/src/core/admin/plugins/nav/change_position/dto/change_position.args.ts diff --git a/apps/backend/src/plugins/core/admin/plugins/nav/create/create.resolver.ts b/packages/backend/src/core/admin/plugins/nav/create/create.resolver.ts similarity index 89% rename from apps/backend/src/plugins/core/admin/plugins/nav/create/create.resolver.ts rename to packages/backend/src/core/admin/plugins/nav/create/create.resolver.ts index 498664f28..0dc96698f 100644 --- a/apps/backend/src/plugins/core/admin/plugins/nav/create/create.resolver.ts +++ b/packages/backend/src/core/admin/plugins/nav/create/create.resolver.ts @@ -1,11 +1,12 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards, OnlyForDevelopment } from "vitnode-backend"; import { CreateAdminNavPluginsService } from "./create.service"; import { ShowAdminNavPluginsObj } from "../show/dto/show.obj"; import { CreateAdminNavPluginsArgs } from "./dto/create.args"; +import { AdminAuthGuards, OnlyForDevelopment } from "../../../../../utils"; + @Resolver() export class CreateAdminNavPluginsResolver { constructor(private readonly service: CreateAdminNavPluginsService) {} diff --git a/apps/backend/src/plugins/core/admin/plugins/nav/create/create.service.ts b/packages/backend/src/core/admin/plugins/nav/create/create.service.ts similarity index 87% rename from apps/backend/src/plugins/core/admin/plugins/nav/create/create.service.ts rename to packages/backend/src/core/admin/plugins/nav/create/create.service.ts index b74f54e28..a52506b6c 100644 --- a/apps/backend/src/plugins/core/admin/plugins/nav/create/create.service.ts +++ b/packages/backend/src/core/admin/plugins/nav/create/create.service.ts @@ -2,14 +2,13 @@ import * as fs from "fs"; import { Injectable } from "@nestjs/common"; import { removeSpecialCharacters } from "@vitnode/shared"; -import { NotFoundError, CustomError } from "vitnode-backend"; import { ShowAdminNavPluginsObj } from "../show/dto/show.obj"; import { CreateAdminNavPluginsArgs } from "./dto/create.args"; import { HelpersAdminNavPluginsService } from "../helpers.service"; -import { ABSOLUTE_PATHS } from "@/config"; -import { ConfigPlugin } from "../../plugins.module"; +import { CustomError, NotFoundError } from "../../../../../errors"; +import { ABSOLUTE_PATHS_BACKEND, ConfigPlugin } from "../../../../.."; @Injectable() export class CreateAdminNavPluginsService extends HelpersAdminNavPluginsService { @@ -20,7 +19,9 @@ export class CreateAdminNavPluginsService extends HelpersAdminNavPluginsService plugin_code, parent_code }: CreateAdminNavPluginsArgs): ShowAdminNavPluginsObj { - const pathConfig = ABSOLUTE_PATHS.plugin({ code: plugin_code }).config; + const pathConfig = ABSOLUTE_PATHS_BACKEND.plugin({ + code: plugin_code + }).config; if (!fs.existsSync(pathConfig)) { throw new NotFoundError("Plugin"); } diff --git a/apps/backend/src/plugins/core/admin/plugins/nav/create/dto/create.args.ts b/packages/backend/src/core/admin/plugins/nav/create/dto/create.args.ts similarity index 91% rename from apps/backend/src/plugins/core/admin/plugins/nav/create/dto/create.args.ts rename to packages/backend/src/core/admin/plugins/nav/create/dto/create.args.ts index c708856cb..ec7df80b0 100644 --- a/apps/backend/src/plugins/core/admin/plugins/nav/create/dto/create.args.ts +++ b/packages/backend/src/core/admin/plugins/nav/create/dto/create.args.ts @@ -1,7 +1,8 @@ import { ArgsType, Field } from "@nestjs/graphql"; import { Transform } from "class-transformer"; import { IsNotEmpty, MaxLength, MinLength } from "class-validator"; -import { TransformString } from "vitnode-backend"; + +import { TransformString } from "../../../../../../utils"; @ArgsType() export class CreateAdminNavPluginsArgs { diff --git a/apps/backend/src/plugins/core/admin/plugins/nav/delete/delete.resolver.ts b/packages/backend/src/core/admin/plugins/nav/delete/delete.resolver.ts similarity index 88% rename from apps/backend/src/plugins/core/admin/plugins/nav/delete/delete.resolver.ts rename to packages/backend/src/core/admin/plugins/nav/delete/delete.resolver.ts index 2d30fde51..fd88093e4 100644 --- a/apps/backend/src/plugins/core/admin/plugins/nav/delete/delete.resolver.ts +++ b/packages/backend/src/core/admin/plugins/nav/delete/delete.resolver.ts @@ -1,10 +1,11 @@ import { UseGuards } from "@nestjs/common"; import { Args, Mutation, Resolver } from "@nestjs/graphql"; -import { AdminAuthGuards, OnlyForDevelopment } from "vitnode-backend"; import { DeleteAdminNavPluginsService } from "./delete.service"; import { DeleteCreateAdminNavPluginsArgs } from "./dto/delete.args"; +import { AdminAuthGuards, OnlyForDevelopment } from "../../../../../utils"; + @Resolver() export class DeleteAdminNavPluginsResolver { constructor(private readonly service: DeleteAdminNavPluginsService) {} diff --git a/apps/backend/src/plugins/core/admin/plugins/nav/delete/delete.service.ts b/packages/backend/src/core/admin/plugins/nav/delete/delete.service.ts similarity index 83% rename from apps/backend/src/plugins/core/admin/plugins/nav/delete/delete.service.ts rename to packages/backend/src/core/admin/plugins/nav/delete/delete.service.ts index b51dfabb7..fd58269c2 100644 --- a/apps/backend/src/plugins/core/admin/plugins/nav/delete/delete.service.ts +++ b/packages/backend/src/core/admin/plugins/nav/delete/delete.service.ts @@ -1,12 +1,11 @@ import * as fs from "fs"; import { Injectable } from "@nestjs/common"; -import { NotFoundError } from "vitnode-backend"; import { DeleteCreateAdminNavPluginsArgs } from "./dto/delete.args"; -import { ABSOLUTE_PATHS } from "@/config"; -import { ConfigPlugin } from "../../plugins.module"; +import { NotFoundError } from "../../../../../errors"; +import { ABSOLUTE_PATHS_BACKEND, ConfigPlugin } from "../../../../.."; @Injectable() export class DeleteAdminNavPluginsService { @@ -15,7 +14,9 @@ export class DeleteAdminNavPluginsService { plugin_code, parent_code }: DeleteCreateAdminNavPluginsArgs): string { - const pathConfig = ABSOLUTE_PATHS.plugin({ code: plugin_code }).config; + const pathConfig = ABSOLUTE_PATHS_BACKEND.plugin({ + code: plugin_code + }).config; if (!fs.existsSync(pathConfig)) { throw new NotFoundError("Plugin"); } diff --git a/apps/backend/src/plugins/core/admin/plugins/nav/delete/dto/delete.args.ts b/packages/backend/src/core/admin/plugins/nav/delete/dto/delete.args.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/plugins/nav/delete/dto/delete.args.ts rename to packages/backend/src/core/admin/plugins/nav/delete/dto/delete.args.ts diff --git a/apps/backend/src/plugins/core/admin/plugins/nav/edit/dto/edit.args.ts b/packages/backend/src/core/admin/plugins/nav/edit/dto/edit.args.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/plugins/nav/edit/dto/edit.args.ts rename to packages/backend/src/core/admin/plugins/nav/edit/dto/edit.args.ts diff --git a/apps/backend/src/plugins/core/admin/plugins/nav/edit/edit.resolver.ts b/packages/backend/src/core/admin/plugins/nav/edit/edit.resolver.ts similarity index 89% rename from apps/backend/src/plugins/core/admin/plugins/nav/edit/edit.resolver.ts rename to packages/backend/src/core/admin/plugins/nav/edit/edit.resolver.ts index 8bed251f8..7d4233227 100644 --- a/apps/backend/src/plugins/core/admin/plugins/nav/edit/edit.resolver.ts +++ b/packages/backend/src/core/admin/plugins/nav/edit/edit.resolver.ts @@ -1,11 +1,12 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards, OnlyForDevelopment } from "vitnode-backend"; import { EditAdminNavPluginsService } from "./edit.service"; import { ShowAdminNavPluginsObj } from "../show/dto/show.obj"; import { EditCreateAdminNavPluginsArgs } from "./dto/edit.args"; +import { AdminAuthGuards, OnlyForDevelopment } from "../../../../../utils"; + @Resolver() export class EditAdminNavPluginsResolver { constructor(private readonly service: EditAdminNavPluginsService) {} diff --git a/apps/backend/src/plugins/core/admin/plugins/nav/edit/edit.service.ts b/packages/backend/src/core/admin/plugins/nav/edit/edit.service.ts similarity index 87% rename from apps/backend/src/plugins/core/admin/plugins/nav/edit/edit.service.ts rename to packages/backend/src/core/admin/plugins/nav/edit/edit.service.ts index 82e5acb97..6ebea7457 100644 --- a/apps/backend/src/plugins/core/admin/plugins/nav/edit/edit.service.ts +++ b/packages/backend/src/core/admin/plugins/nav/edit/edit.service.ts @@ -2,13 +2,12 @@ import * as fs from "fs"; import { Injectable } from "@nestjs/common"; import { removeSpecialCharacters } from "@vitnode/shared"; -import { NotFoundError, CustomError } from "vitnode-backend"; import { ShowAdminNavPluginsObj } from "../show/dto/show.obj"; import { EditCreateAdminNavPluginsArgs } from "./dto/edit.args"; -import { ABSOLUTE_PATHS } from "@/config"; -import { ConfigPlugin } from "../../plugins.module"; +import { CustomError, NotFoundError } from "../../../../../errors"; +import { ABSOLUTE_PATHS_BACKEND, ConfigPlugin } from "../../../../.."; @Injectable() export class EditAdminNavPluginsService { @@ -20,7 +19,9 @@ export class EditAdminNavPluginsService { plugin_code, parent_code }: EditCreateAdminNavPluginsArgs): ShowAdminNavPluginsObj { - const pathConfig = ABSOLUTE_PATHS.plugin({ code: plugin_code }).config; + const pathConfig = ABSOLUTE_PATHS_BACKEND.plugin({ + code: plugin_code + }).config; if (!fs.existsSync(pathConfig)) { throw new NotFoundError("Plugin"); } diff --git a/apps/backend/src/plugins/core/admin/plugins/nav/helpers.service.ts b/packages/backend/src/core/admin/plugins/nav/helpers.service.ts similarity index 80% rename from apps/backend/src/plugins/core/admin/plugins/nav/helpers.service.ts rename to packages/backend/src/core/admin/plugins/nav/helpers.service.ts index 33d5875be..bc2de896a 100644 --- a/apps/backend/src/plugins/core/admin/plugins/nav/helpers.service.ts +++ b/packages/backend/src/core/admin/plugins/nav/helpers.service.ts @@ -1,7 +1,6 @@ import { Injectable } from "@nestjs/common"; -import { ConfigPlugin } from "../plugins.module"; -import { NavPluginInfoJSONTypeWithChildren } from "../helpers/files/create/contents"; +import { ConfigPlugin, NavPluginInfoJSONTypeWithChildren } from "../type"; @Injectable() export class HelpersAdminNavPluginsService { diff --git a/apps/backend/src/plugins/core/admin/plugins/nav/nav-plugins.module.ts b/packages/backend/src/core/admin/plugins/nav/nav-plugins.module.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/plugins/nav/nav-plugins.module.ts rename to packages/backend/src/core/admin/plugins/nav/nav-plugins.module.ts diff --git a/apps/backend/src/plugins/core/admin/plugins/nav/show/dto/show.args.ts b/packages/backend/src/core/admin/plugins/nav/show/dto/show.args.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/plugins/nav/show/dto/show.args.ts rename to packages/backend/src/core/admin/plugins/nav/show/dto/show.args.ts diff --git a/apps/backend/src/plugins/core/admin/plugins/nav/show/dto/show.obj.ts b/packages/backend/src/core/admin/plugins/nav/show/dto/show.obj.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/plugins/nav/show/dto/show.obj.ts rename to packages/backend/src/core/admin/plugins/nav/show/dto/show.obj.ts diff --git a/apps/backend/src/plugins/core/admin/plugins/nav/show/show.resolver.ts b/packages/backend/src/core/admin/plugins/nav/show/show.resolver.ts similarity index 89% rename from apps/backend/src/plugins/core/admin/plugins/nav/show/show.resolver.ts rename to packages/backend/src/core/admin/plugins/nav/show/show.resolver.ts index 5e9dd3da5..5931b267e 100644 --- a/apps/backend/src/plugins/core/admin/plugins/nav/show/show.resolver.ts +++ b/packages/backend/src/core/admin/plugins/nav/show/show.resolver.ts @@ -1,11 +1,12 @@ import { Args, Query, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards, OnlyForDevelopment } from "vitnode-backend"; import { ShowAdminNavPluginsArgs } from "./dto/show.args"; import { ShowAdminNavPluginsService } from "./show.service"; import { ShowAdminNavPluginsObj } from "./dto/show.obj"; +import { AdminAuthGuards, OnlyForDevelopment } from "../../../../../utils"; + @Resolver() export class ShowAdminNavPluginsResolver { constructor(private readonly service: ShowAdminNavPluginsService) {} diff --git a/apps/backend/src/plugins/core/admin/plugins/nav/show/show.service.ts b/packages/backend/src/core/admin/plugins/nav/show/show.service.ts similarity index 70% rename from apps/backend/src/plugins/core/admin/plugins/nav/show/show.service.ts rename to packages/backend/src/core/admin/plugins/nav/show/show.service.ts index 88aad878a..89ecee22a 100644 --- a/apps/backend/src/plugins/core/admin/plugins/nav/show/show.service.ts +++ b/packages/backend/src/core/admin/plugins/nav/show/show.service.ts @@ -1,18 +1,19 @@ import * as fs from "fs"; import { Injectable } from "@nestjs/common"; -import { NotFoundError } from "vitnode-backend"; import { ShowAdminNavPluginsArgs } from "./dto/show.args"; import { ShowAdminNavPluginsObj } from "./dto/show.obj"; -import { ABSOLUTE_PATHS } from "@/config"; -import { ConfigPlugin } from "../../plugins.module"; +import { NotFoundError } from "../../../../../errors"; +import { ABSOLUTE_PATHS_BACKEND, ConfigPlugin } from "../../../../.."; @Injectable() export class ShowAdminNavPluginsService { show({ plugin_code }: ShowAdminNavPluginsArgs): ShowAdminNavPluginsObj[] { - const pathConfig = ABSOLUTE_PATHS.plugin({ code: plugin_code }).config; + const pathConfig = ABSOLUTE_PATHS_BACKEND.plugin({ + code: plugin_code + }).config; if (!fs.existsSync(pathConfig)) { throw new NotFoundError("Plugin"); } diff --git a/apps/backend/src/plugins/core/admin/plugins/plugins.module.ts b/packages/backend/src/core/admin/plugins/plugins.module.ts similarity index 91% rename from apps/backend/src/plugins/core/admin/plugins/plugins.module.ts rename to packages/backend/src/core/admin/plugins/plugins.module.ts index 93a15c4cc..287621e88 100644 --- a/apps/backend/src/plugins/core/admin/plugins/plugins.module.ts +++ b/packages/backend/src/core/admin/plugins/plugins.module.ts @@ -1,28 +1,22 @@ import { Module } from "@nestjs/common"; +import { AdminNavPluginsModule } from "./nav/nav-plugins.module"; +import { CreateAdminPluginsService } from "./create/create.service"; +import { CreateAdminPluginsResolver } from "./create/create.resolver"; import { ShowAdminPluginsService } from "./show/show.service"; import { ShowAdminPluginsResolver } from "./show/show.resolver"; -import { CreateAdminPluginsResolver } from "./create/create.resolver"; -import { CreateAdminPluginsService } from "./create/create.service"; import { DeleteAdminPluginsResolver } from "./delete/delete.resolver"; import { DeleteAdminPluginsService } from "./delete/delete.service"; import { CreateFilesAdminPluginsService } from "./helpers/files/create/create-files.service"; import { ChangeFilesAdminPluginsService } from "./helpers/files/change/change.service"; +import { EditAdminPluginsResolver } from "./edit/edit.resolver"; +import { EditAdminPluginsService } from "./edit/edit.service"; import { DownloadAdminPluginsResolver } from "./download/download.resolver"; import { DownloadAdminPluginsService } from "./download/download.service"; import { UploadAdminPluginsResolver } from "./upload/upload.resolver"; import { UploadAdminPluginsService } from "./upload/upload.service"; import { FilesAdminPluginsService } from "./files/files.service"; import { FilesAdminPluginsResolver } from "./files/files.resolver"; -import { EditAdminPluginsResolver } from "./edit/edit.resolver"; -import { EditAdminPluginsService } from "./edit/edit.service"; -import { AdminNavPluginsModule } from "./nav/nav-plugins.module"; -import { PluginInfoJSONType } from "./helpers/files/create/contents"; - -export interface ConfigPlugin extends PluginInfoJSONType { - version: string; - version_code: number; -} @Module({ providers: [ diff --git a/apps/backend/src/plugins/core/admin/plugins/show/dto/show.args.ts b/packages/backend/src/core/admin/plugins/show/dto/show.args.ts similarity index 91% rename from apps/backend/src/plugins/core/admin/plugins/show/dto/show.args.ts rename to packages/backend/src/core/admin/plugins/show/dto/show.args.ts index 661eca6a2..f0373dd80 100644 --- a/apps/backend/src/plugins/core/admin/plugins/show/dto/show.args.ts +++ b/packages/backend/src/core/admin/plugins/show/dto/show.args.ts @@ -1,5 +1,6 @@ import { ArgsType, Field, InputType, registerEnumType } from "@nestjs/graphql"; -import { PaginationArgs, SortDirectionEnum } from "vitnode-backend"; + +import { PaginationArgs, SortDirectionEnum } from "../../../../../utils"; enum ShowAdminPluginsSortingColumnEnum { created = "created", diff --git a/apps/backend/src/plugins/core/admin/plugins/show/dto/show.obj.ts b/packages/backend/src/core/admin/plugins/show/dto/show.obj.ts similarity index 95% rename from apps/backend/src/plugins/core/admin/plugins/show/dto/show.obj.ts rename to packages/backend/src/core/admin/plugins/show/dto/show.obj.ts index 82ba31e83..a6720b641 100644 --- a/apps/backend/src/plugins/core/admin/plugins/show/dto/show.obj.ts +++ b/packages/backend/src/core/admin/plugins/show/dto/show.obj.ts @@ -1,5 +1,6 @@ import { Field, Int, ObjectType } from "@nestjs/graphql"; -import { PageInfo } from "vitnode-backend"; + +import { PageInfo } from "../../../../../utils"; @ObjectType() export class ShowAdminPlugins { diff --git a/apps/backend/src/plugins/core/admin/plugins/show/show.resolver.ts b/packages/backend/src/core/admin/plugins/show/show.resolver.ts similarity index 91% rename from apps/backend/src/plugins/core/admin/plugins/show/show.resolver.ts rename to packages/backend/src/core/admin/plugins/show/show.resolver.ts index 4c8b3cb8a..62df90ef7 100644 --- a/apps/backend/src/plugins/core/admin/plugins/show/show.resolver.ts +++ b/packages/backend/src/core/admin/plugins/show/show.resolver.ts @@ -1,11 +1,12 @@ import { Args, Query, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards } from "vitnode-backend"; import { ShowAdminPluginsService } from "./show.service"; import { ShowAdminPluginsObj } from "./dto/show.obj"; import { ShowAdminPluginsArgs } from "./dto/show.args"; +import { AdminAuthGuards } from "../../../../utils"; + @Resolver() export class ShowAdminPluginsResolver { constructor(private readonly service: ShowAdminPluginsService) {} diff --git a/apps/backend/src/plugins/core/admin/plugins/show/show.service.ts b/packages/backend/src/core/admin/plugins/show/show.service.ts similarity index 82% rename from apps/backend/src/plugins/core/admin/plugins/show/show.service.ts rename to packages/backend/src/core/admin/plugins/show/show.service.ts index 76cda678b..a6cc23e87 100644 --- a/apps/backend/src/plugins/core/admin/plugins/show/show.service.ts +++ b/packages/backend/src/core/admin/plugins/show/show.service.ts @@ -1,16 +1,13 @@ import { Injectable } from "@nestjs/common"; import { and, count, eq, ilike } from "drizzle-orm"; -import { - inputPaginationCursor, - outputPagination, - SortDirectionEnum, - DatabaseService -} from "vitnode-backend"; import { ShowAdminPluginsArgs } from "./dto/show.args"; import { ShowAdminPluginsObj } from "./dto/show.obj"; -import { core_plugins } from "../../database/schema/plugins"; +import { inputPaginationCursor, outputPagination } from "../../../../functions"; +import { core_plugins } from "../../../../templates/core/admin/database/schema/plugins"; +import { SortDirectionEnum } from "../../../../utils"; +import { DatabaseService } from "../../../../database"; @Injectable() export class ShowAdminPluginsService { diff --git a/packages/backend/src/core/admin/plugins/type.ts b/packages/backend/src/core/admin/plugins/type.ts new file mode 100644 index 000000000..5297cbd6a --- /dev/null +++ b/packages/backend/src/core/admin/plugins/type.ts @@ -0,0 +1,22 @@ +import { CreateAdminPluginsArgs } from "./create/dto/create.args"; + +interface NavPluginInfoJSONType { + code: string; + href: string; + icon: string | null; +} + +export interface NavPluginInfoJSONTypeWithChildren + extends NavPluginInfoJSONType { + children?: NavPluginInfoJSONType[]; +} + +export interface PluginInfoJSONType extends CreateAdminPluginsArgs { + allow_default: boolean; + nav: NavPluginInfoJSONTypeWithChildren[]; +} + +export interface ConfigPlugin extends PluginInfoJSONType { + version: string; + version_code: number; +} diff --git a/apps/backend/src/plugins/core/admin/plugins/upload/dto/upload.args.ts b/packages/backend/src/core/admin/plugins/upload/dto/upload.args.ts similarity index 75% rename from apps/backend/src/plugins/core/admin/plugins/upload/dto/upload.args.ts rename to packages/backend/src/core/admin/plugins/upload/dto/upload.args.ts index 5c399b423..a02e8402f 100644 --- a/apps/backend/src/plugins/core/admin/plugins/upload/dto/upload.args.ts +++ b/packages/backend/src/core/admin/plugins/upload/dto/upload.args.ts @@ -1,5 +1,6 @@ import { ArgsType, Field } from "@nestjs/graphql"; -import { FileUpload, GraphQLUpload } from "vitnode-backend"; + +import { FileUpload, GraphQLUpload } from "../../../../../graphql-upload"; @ArgsType() export class UploadAdminPluginsArgs { diff --git a/apps/backend/src/plugins/core/admin/plugins/upload/upload.resolver.ts b/packages/backend/src/core/admin/plugins/upload/upload.resolver.ts similarity index 92% rename from apps/backend/src/plugins/core/admin/plugins/upload/upload.resolver.ts rename to packages/backend/src/core/admin/plugins/upload/upload.resolver.ts index 039f6d4aa..ddbc7eeb1 100644 --- a/apps/backend/src/plugins/core/admin/plugins/upload/upload.resolver.ts +++ b/packages/backend/src/core/admin/plugins/upload/upload.resolver.ts @@ -1,11 +1,12 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards } from "vitnode-backend"; import { UploadAdminPluginsService } from "./upload.service"; import { UploadAdminPluginsArgs } from "./dto/upload.args"; import { ShowAdminPlugins } from "../show/dto/show.obj"; +import { AdminAuthGuards } from "../../../../utils"; + @Resolver() export class UploadAdminPluginsResolver { constructor(private readonly service: UploadAdminPluginsService) {} diff --git a/apps/backend/src/plugins/core/admin/plugins/upload/upload.service.ts b/packages/backend/src/core/admin/plugins/upload/upload.service.ts similarity index 91% rename from apps/backend/src/plugins/core/admin/plugins/upload/upload.service.ts rename to packages/backend/src/core/admin/plugins/upload/upload.service.ts index 4e46ae966..86b4d9124 100644 --- a/apps/backend/src/plugins/core/admin/plugins/upload/upload.service.ts +++ b/packages/backend/src/core/admin/plugins/upload/upload.service.ts @@ -5,22 +5,25 @@ import { Injectable } from "@nestjs/common"; import * as tar from "tar"; import { eq } from "drizzle-orm"; import { currentUnixDate, generateRandomString } from "@vitnode/shared"; -import { FileUpload, CustomError, DatabaseService } from "vitnode-backend"; import { ShowAdminPlugins } from "../show/dto/show.obj"; import { UploadAdminPluginsArgs } from "./dto/upload.args"; import { ChangeFilesAdminPluginsService } from "../helpers/files/change/change.service"; -import { ConfigPlugin } from "../plugins.module"; -import { core_plugins } from "../../database/schema/plugins"; -import { ABSOLUTE_PATHS } from "@/config"; -import { migrate } from "@/utils/actions/migrate"; +import { core_plugins } from "../../../../templates/core/admin/database/schema/plugins"; +import { DatabaseService } from "../../../../database"; +import { + ABSOLUTE_PATHS_BACKEND, + ConfigPlugin, + CustomError, + FileUpload +} from "../../../.."; @Injectable() export class UploadAdminPluginsService { protected path: string = join(process.cwd()); protected tempPath: string = join( - ABSOLUTE_PATHS.uploads.temp, + ABSOLUTE_PATHS_BACKEND.uploads.temp, "plugins", `upload-${generateRandomString(5)}${currentUnixDate()}` ); @@ -98,7 +101,9 @@ export class UploadAdminPluginsService { config: ConfigPlugin; upload_new_version?: boolean; }): Promise { - const newPathBackend = ABSOLUTE_PATHS.plugin({ code: config.code }).root; + const newPathBackend = ABSOLUTE_PATHS_BACKEND.plugin({ + code: config.code + }).root; if (fs.existsSync(newPathBackend)) { await fs.promises.rm(newPathBackend, { recursive: true }); } @@ -161,8 +166,9 @@ export class UploadAdminPluginsService { await Promise.all( frontendPaths.map(async path => { const source = join(this.tempPath, "frontend", path); - const destination: string = ABSOLUTE_PATHS.plugin({ code: config.code }) - .frontend[path]; + const destination: string = ABSOLUTE_PATHS_BACKEND.plugin({ + code: config.code + }).frontend[path]; return this.copyFilesToPluginFolder({ source, destination }); }) @@ -178,7 +184,7 @@ export class UploadAdminPluginsService { languages.forEach(lang => { const checkExist = join( - ABSOLUTE_PATHS.plugin({ + ABSOLUTE_PATHS_BACKEND.plugin({ code: config.code }).frontend.language, `${lang.code}.json` @@ -189,13 +195,13 @@ export class UploadAdminPluginsService { } const source = join( - ABSOLUTE_PATHS.plugin({ + ABSOLUTE_PATHS_BACKEND.plugin({ code: config.code }).frontend.language, `en.json` ); const destination = join( - ABSOLUTE_PATHS.plugin({ + ABSOLUTE_PATHS_BACKEND.plugin({ code: config.code }).frontend.language, `${lang.code}.json` @@ -278,7 +284,8 @@ export class UploadAdminPluginsService { const plugin = plugins[0]; // Run migration - await migrate({ pluginCode: config.code }); + // TODO: Fix this + // await migrate({ pluginCode: config.code }); return plugin; } diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts index f913a6411..01cef375c 100644 --- a/packages/backend/src/index.ts +++ b/packages/backend/src/index.ts @@ -10,3 +10,4 @@ export * from "./database"; // Services export * from "./core/admin/sessions/authorization/authorization.service"; export * from "./core/sessions/authorization/internal/internal_authorization.service"; +export * from "./core/admin/plugins/type"; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0250bb409..ce0da76cb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -101,7 +101,7 @@ importers: version: 4.2.1(graphql@16.8.2) '@nestjs/cli': specifier: ^10.3.2 - version: 10.3.2(@swc/cli@0.3.12(@swc/core@1.6.3(@swc/helpers@0.5.11))(chokidar@3.6.0))(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12) + version: 10.3.2(@swc/cli@0.3.12(@swc/core@1.6.3(@swc/helpers@0.5.11))(chokidar@3.6.0))(@swc/core@1.6.3(@swc/helpers@0.5.11)) '@nestjs/schematics': specifier: ^10.1.1 version: 10.1.1(chokidar@3.6.0)(typescript@5.5.2) @@ -499,6 +499,9 @@ importers: pg: specifier: ^8.12.0 version: 8.12.0 + tar: + specifier: ^7.4.0 + version: 7.4.0 ua-parser-js: specifier: 2.0.0-beta.3 version: 2.0.0-beta.3 @@ -10437,7 +10440,7 @@ snapshots: lodash.omit: 4.5.0 tslib: 2.6.2 - '@nestjs/cli@10.3.2(@swc/cli@0.3.12(@swc/core@1.6.3(@swc/helpers@0.5.11))(chokidar@3.6.0))(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)': + '@nestjs/cli@10.3.2(@swc/cli@0.3.12(@swc/core@1.6.3(@swc/helpers@0.5.11))(chokidar@3.6.0))(@swc/core@1.6.3(@swc/helpers@0.5.11))': dependencies: '@angular-devkit/core': 17.1.2(chokidar@3.6.0) '@angular-devkit/schematics': 17.1.2(chokidar@3.6.0) @@ -10447,7 +10450,7 @@ snapshots: chokidar: 3.6.0 cli-table3: 0.6.3 commander: 4.1.1 - fork-ts-checker-webpack-plugin: 9.0.2(typescript@5.3.3)(webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)) + fork-ts-checker-webpack-plugin: 9.0.2(typescript@5.3.3)(webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))) glob: 10.3.10 inquirer: 8.2.6 node-emoji: 1.11.0 @@ -10459,7 +10462,7 @@ snapshots: tsconfig-paths: 4.2.0 tsconfig-paths-webpack-plugin: 4.1.0 typescript: 5.3.3 - webpack: 5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12) + webpack: 5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11)) webpack-node-externals: 3.0.0 optionalDependencies: '@swc/cli': 0.3.12(@swc/core@1.6.3(@swc/helpers@0.5.11))(chokidar@3.6.0) @@ -12464,7 +12467,7 @@ snapshots: dependencies: '@types/node': 20.14.7 tapable: 2.2.1 - webpack: 5.92.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12) + webpack: 5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11) transitivePeerDependencies: - '@swc/core' - esbuild @@ -14507,7 +14510,7 @@ snapshots: cross-spawn: 7.0.3 signal-exit: 4.1.0 - fork-ts-checker-webpack-plugin@9.0.2(typescript@5.3.3)(webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)): + fork-ts-checker-webpack-plugin@9.0.2(typescript@5.3.3)(webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))): dependencies: '@babel/code-frame': 7.24.7 chalk: 4.1.2 @@ -14522,7 +14525,7 @@ snapshots: semver: 7.6.2 tapable: 2.2.1 typescript: 5.3.3 - webpack: 5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12) + webpack: 5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11)) form-data@4.0.0: dependencies: @@ -17165,29 +17168,27 @@ snapshots: mkdirp: 3.0.1 yallist: 5.0.0 - terser-webpack-plugin@5.3.10(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)(webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)): + terser-webpack-plugin@5.3.10(@swc/core@1.6.3(@swc/helpers@0.5.11))(webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))): dependencies: '@jridgewell/trace-mapping': 0.3.25 jest-worker: 27.5.1 schema-utils: 3.3.0 serialize-javascript: 6.0.2 terser: 5.31.1 - webpack: 5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12) + webpack: 5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11)) optionalDependencies: '@swc/core': 1.6.3(@swc/helpers@0.5.11) - esbuild: 0.19.12 - terser-webpack-plugin@5.3.10(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)(webpack@5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11)): + terser-webpack-plugin@5.3.10(@swc/core@1.6.3(@swc/helpers@0.5.11))(webpack@5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11)): dependencies: '@jridgewell/trace-mapping': 0.3.25 jest-worker: 27.5.1 schema-utils: 3.3.0 serialize-javascript: 6.0.2 terser: 5.31.1 - webpack: 5.92.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12) + webpack: 5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11) optionalDependencies: '@swc/core': 1.6.3(@swc/helpers@0.5.11) - esbuild: 0.19.12 terser@5.31.1: dependencies: @@ -17265,7 +17266,7 @@ snapshots: semver: 7.6.2 source-map: 0.7.4 typescript: 5.5.2 - webpack: 5.92.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12) + webpack: 5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11) ts-log@2.2.5: {} @@ -17570,7 +17571,7 @@ snapshots: webpack-sources@3.2.3: {} - webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12): + webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11)): dependencies: '@types/eslint-scope': 3.7.7 '@types/estree': 1.0.5 @@ -17593,7 +17594,7 @@ snapshots: neo-async: 2.6.2 schema-utils: 3.3.0 tapable: 2.2.1 - terser-webpack-plugin: 5.3.10(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)(webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)) + terser-webpack-plugin: 5.3.10(@swc/core@1.6.3(@swc/helpers@0.5.11))(webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))) watchpack: 2.4.1 webpack-sources: 3.2.3 transitivePeerDependencies: @@ -17601,7 +17602,7 @@ snapshots: - esbuild - uglify-js - webpack@5.92.1(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12): + webpack@5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11): dependencies: '@types/eslint-scope': 3.7.7 '@types/estree': 1.0.5 @@ -17624,7 +17625,7 @@ snapshots: neo-async: 2.6.2 schema-utils: 3.3.0 tapable: 2.2.1 - terser-webpack-plugin: 5.3.10(@swc/core@1.6.3(@swc/helpers@0.5.11))(esbuild@0.19.12)(webpack@5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11)) + terser-webpack-plugin: 5.3.10(@swc/core@1.6.3(@swc/helpers@0.5.11))(webpack@5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11)) watchpack: 2.4.1 webpack-sources: 3.2.3 transitivePeerDependencies: From 1ea62868350116b4bf75106afccaaafb0753c630 Mon Sep 17 00:00:00 2001 From: aXenDeveloper Date: Sat, 22 Jun 2024 09:46:54 +0200 Subject: [PATCH 15/27] perf(backend): Move nav admin service to package --- apps/backend/schema.gql | 4 + .../backend/src/core/admin/admin.module.ts | 8 +- .../change_position.resolver.ts | 3 +- .../change_position.service.ts | 5 +- .../dto/change_position.args.ts | 0 .../core/admin/nav/create/create.resolver.ts | 4 +- .../core/admin/nav/create/create.service.ts | 8 +- .../core/admin/nav/create/dto/create.args.ts | 3 +- .../core/admin/nav/delete/delete.resolver.ts | 3 +- .../core/admin/nav/delete/delete.service.ts | 7 +- .../core/admin/nav/delete/dto/delete.args.ts | 0 .../src}/core/admin/nav/edit/dto/edit.args.ts | 0 .../src}/core/admin/nav/edit/edit.resolver.ts | 4 +- .../src}/core/admin/nav/edit/edit.service.ts | 9 +- .../backend/src}/core/admin/nav/nav.module.ts | 0 packages/backend/src/core/core.module.ts | 4 +- .../src/core/helpers/helpers.module.ts | 10 + .../text_language/parser/helpers.service.ts | 95 ++++++++++ .../text_language/parser/parser.service.ts | 179 ++++++++++++++++++ 19 files changed, 324 insertions(+), 22 deletions(-) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/nav/change_position/change_position.resolver.ts (91%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/nav/change_position/change_position.service.ts (90%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/nav/change_position/dto/change_position.args.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/nav/create/create.resolver.ts (81%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/nav/create/create.service.ts (82%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/nav/create/dto/create.args.ts (96%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/nav/delete/delete.resolver.ts (90%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/nav/delete/delete.service.ts (80%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/nav/delete/dto/delete.args.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/nav/edit/dto/edit.args.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/nav/edit/edit.resolver.ts (81%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/nav/edit/edit.service.ts (81%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/nav/nav.module.ts (100%) create mode 100644 packages/backend/src/core/helpers/helpers.module.ts create mode 100644 packages/backend/src/core/helpers/text_language/parser/helpers.service.ts create mode 100644 packages/backend/src/core/helpers/text_language/parser/parser.service.ts diff --git a/apps/backend/schema.gql b/apps/backend/schema.gql index b05ea5e10..c5fd8b7da 100644 --- a/apps/backend/schema.gql +++ b/apps/backend/schema.gql @@ -175,6 +175,10 @@ type Mutation { admin__core_main_settings__edit(site_copyright: [TextLanguageInput!]!, site_description: [TextLanguageInput!]!, site_name: String!, site_short_name: String!): EditAdminSettingsObj! admin__core_manifest_metadata__edit(background_color: String!, display: String!, start_url: String!, theme_color: String!): ShowAdminManifestMetadataObj! admin__core_members__edit(birthday: DateTime!, email: String!, first_name: String!, id: Int!, last_name: String!, name: String!, newsletter: Boolean!): EditAdminMembersObj! + admin__core_nav__change_position(id: Int!, index_to_move: Int!, parent_id: Int!): String! + admin__core_nav__create(description: [TextLanguageInput!]!, external: Boolean!, href: String!, icon: String, name: [TextLanguageInput!]!): ShowCoreNav! + admin__core_nav__delete(id: Int!): String! + admin__core_nav__edit(description: [TextLanguageInput!]!, external: Boolean!, href: String!, icon: String, id: Int!, name: [TextLanguageInput!]!): ShowCoreNav! admin__core_plugins__create(author: String!, author_url: String, code: String!, description: String, name: String!, support_url: String!): ShowAdminPlugins! admin__core_plugins__delete(code: String!): String! admin__core_plugins__download(code: String!, version: String, version_code: Int): String! diff --git a/packages/backend/src/core/admin/admin.module.ts b/packages/backend/src/core/admin/admin.module.ts index 73b4cfeeb..6d9ba0f55 100644 --- a/packages/backend/src/core/admin/admin.module.ts +++ b/packages/backend/src/core/admin/admin.module.ts @@ -5,8 +5,14 @@ import { GlobalAdminSessionsModule } from "./sessions/sessions.module"; import { AdminPluginsModule } from "./plugins/plugins.module"; +import { AdminNavModule } from "./nav/nav.module"; @Module({ - imports: [GlobalAdminSessionsModule, AdminSessionsModule, AdminPluginsModule] + imports: [ + GlobalAdminSessionsModule, + AdminSessionsModule, + AdminPluginsModule, + AdminNavModule + ] }) export class AdminModule {} diff --git a/apps/backend/src/plugins/core/admin/nav/change_position/change_position.resolver.ts b/packages/backend/src/core/admin/nav/change_position/change_position.resolver.ts similarity index 91% rename from apps/backend/src/plugins/core/admin/nav/change_position/change_position.resolver.ts rename to packages/backend/src/core/admin/nav/change_position/change_position.resolver.ts index 722b24929..dde3e84b9 100644 --- a/apps/backend/src/plugins/core/admin/nav/change_position/change_position.resolver.ts +++ b/packages/backend/src/core/admin/nav/change_position/change_position.resolver.ts @@ -1,10 +1,11 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards } from "vitnode-backend"; import { ChangePositionAdminNavService } from "./change_position.service"; import { ChangePositionAdminNavArgs } from "./dto/change_position.args"; +import { AdminAuthGuards } from "../../../../utils"; + @Resolver() export class ChangePositionAdminNavResolver { constructor(private readonly service: ChangePositionAdminNavService) {} diff --git a/apps/backend/src/plugins/core/admin/nav/change_position/change_position.service.ts b/packages/backend/src/core/admin/nav/change_position/change_position.service.ts similarity index 90% rename from apps/backend/src/plugins/core/admin/nav/change_position/change_position.service.ts rename to packages/backend/src/core/admin/nav/change_position/change_position.service.ts index 18e18f836..605d3f8ab 100644 --- a/apps/backend/src/plugins/core/admin/nav/change_position/change_position.service.ts +++ b/packages/backend/src/core/admin/nav/change_position/change_position.service.ts @@ -1,10 +1,11 @@ import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; -import { NotFoundError, DatabaseService } from "vitnode-backend"; import { ChangePositionAdminNavArgs } from "./dto/change_position.args"; -import { core_nav } from "../../database/schema/nav"; +import { DatabaseService } from "../../../../database"; +import { NotFoundError } from "../../../../errors"; +import { core_nav } from "../../../../templates/core/admin/database/schema/nav"; @Injectable() export class ChangePositionAdminNavService { diff --git a/apps/backend/src/plugins/core/admin/nav/change_position/dto/change_position.args.ts b/packages/backend/src/core/admin/nav/change_position/dto/change_position.args.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/nav/change_position/dto/change_position.args.ts rename to packages/backend/src/core/admin/nav/change_position/dto/change_position.args.ts diff --git a/apps/backend/src/plugins/core/admin/nav/create/create.resolver.ts b/packages/backend/src/core/admin/nav/create/create.resolver.ts similarity index 81% rename from apps/backend/src/plugins/core/admin/nav/create/create.resolver.ts rename to packages/backend/src/core/admin/nav/create/create.resolver.ts index 38db3efab..2b5266e1a 100644 --- a/apps/backend/src/plugins/core/admin/nav/create/create.resolver.ts +++ b/packages/backend/src/core/admin/nav/create/create.resolver.ts @@ -1,11 +1,11 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards } from "vitnode-backend"; import { CreateAdminNavService } from "./create.service"; import { CreateAdminNavArgs } from "./dto/create.args"; -import { ShowCoreNav } from "@/plugins/core/nav/show/dto/show.obj"; +import { ShowCoreNav } from "../../../nav/show/dto/show.obj"; +import { AdminAuthGuards } from "../../../../utils"; @Resolver() export class CreateAdminNavResolver { diff --git a/apps/backend/src/plugins/core/admin/nav/create/create.service.ts b/packages/backend/src/core/admin/nav/create/create.service.ts similarity index 82% rename from apps/backend/src/plugins/core/admin/nav/create/create.service.ts rename to packages/backend/src/core/admin/nav/create/create.service.ts index 44a34f0c1..363068f3f 100644 --- a/apps/backend/src/plugins/core/admin/nav/create/create.service.ts +++ b/packages/backend/src/core/admin/nav/create/create.service.ts @@ -1,15 +1,15 @@ import { Injectable } from "@nestjs/common"; -import { DatabaseService } from "vitnode-backend"; import { CreateAdminNavArgs } from "./dto/create.args"; +import { DatabaseService } from "../../../../database"; +import { ParserTextLanguageCoreHelpersService } from "../../../helpers/text_language/parser/parser.service"; +import { ShowCoreNav } from "../../../nav/show/dto/show.obj"; import { core_nav, core_nav_description, core_nav_name -} from "../../database/schema/nav"; -import { ShowCoreNav } from "@/plugins/core/nav/show/dto/show.obj"; -import { ParserTextLanguageCoreHelpersService } from "@/plugins/core/helpers/text_language/parser/parser.service"; +} from "../../../../templates/core/admin/database/schema/nav"; @Injectable() export class CreateAdminNavService { diff --git a/apps/backend/src/plugins/core/admin/nav/create/dto/create.args.ts b/packages/backend/src/core/admin/nav/create/dto/create.args.ts similarity index 96% rename from apps/backend/src/plugins/core/admin/nav/create/dto/create.args.ts rename to packages/backend/src/core/admin/nav/create/dto/create.args.ts index f57cec578..5bb25ce87 100644 --- a/apps/backend/src/plugins/core/admin/nav/create/dto/create.args.ts +++ b/packages/backend/src/core/admin/nav/create/dto/create.args.ts @@ -7,12 +7,13 @@ import { ValidateNested } from "class-validator"; import { Transform } from "class-transformer"; + import { IsTextLanguageInput, TextLanguageInput, TransformString, TransformTextLanguageInput -} from "vitnode-backend"; +} from "../../../../../utils"; @ArgsType() export class CreateAdminNavArgs { diff --git a/apps/backend/src/plugins/core/admin/nav/delete/delete.resolver.ts b/packages/backend/src/core/admin/nav/delete/delete.resolver.ts similarity index 90% rename from apps/backend/src/plugins/core/admin/nav/delete/delete.resolver.ts rename to packages/backend/src/core/admin/nav/delete/delete.resolver.ts index 18f105583..82d159414 100644 --- a/apps/backend/src/plugins/core/admin/nav/delete/delete.resolver.ts +++ b/packages/backend/src/core/admin/nav/delete/delete.resolver.ts @@ -1,10 +1,11 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards } from "vitnode-backend"; import { DeleteAdminNavService } from "./delete.service"; import { DeleteAdminNavArgs } from "./dto/delete.args"; +import { AdminAuthGuards } from "../../../../utils"; + @Resolver() export class DeleteAdminNavResolver { constructor(private readonly service: DeleteAdminNavService) {} diff --git a/apps/backend/src/plugins/core/admin/nav/delete/delete.service.ts b/packages/backend/src/core/admin/nav/delete/delete.service.ts similarity index 80% rename from apps/backend/src/plugins/core/admin/nav/delete/delete.service.ts rename to packages/backend/src/core/admin/nav/delete/delete.service.ts index b99090907..3e1af41c2 100644 --- a/apps/backend/src/plugins/core/admin/nav/delete/delete.service.ts +++ b/packages/backend/src/core/admin/nav/delete/delete.service.ts @@ -1,15 +1,16 @@ import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; -import { NotFoundError, DatabaseService } from "vitnode-backend"; import { DeleteAdminNavArgs } from "./dto/delete.args"; +import { DatabaseService } from "../../../../database"; +import { ParserTextLanguageCoreHelpersService } from "../../../helpers/text_language/parser/parser.service"; +import { NotFoundError } from "../../../../errors"; import { core_nav, core_nav_description, core_nav_name -} from "../../database/schema/nav"; -import { ParserTextLanguageCoreHelpersService } from "@/plugins/core/helpers/text_language/parser/parser.service"; +} from "../../../../templates/core/admin/database/schema/nav"; @Injectable() export class DeleteAdminNavService { diff --git a/apps/backend/src/plugins/core/admin/nav/delete/dto/delete.args.ts b/packages/backend/src/core/admin/nav/delete/dto/delete.args.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/nav/delete/dto/delete.args.ts rename to packages/backend/src/core/admin/nav/delete/dto/delete.args.ts diff --git a/apps/backend/src/plugins/core/admin/nav/edit/dto/edit.args.ts b/packages/backend/src/core/admin/nav/edit/dto/edit.args.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/nav/edit/dto/edit.args.ts rename to packages/backend/src/core/admin/nav/edit/dto/edit.args.ts diff --git a/apps/backend/src/plugins/core/admin/nav/edit/edit.resolver.ts b/packages/backend/src/core/admin/nav/edit/edit.resolver.ts similarity index 81% rename from apps/backend/src/plugins/core/admin/nav/edit/edit.resolver.ts rename to packages/backend/src/core/admin/nav/edit/edit.resolver.ts index 71487b7c5..35d3022f5 100644 --- a/apps/backend/src/plugins/core/admin/nav/edit/edit.resolver.ts +++ b/packages/backend/src/core/admin/nav/edit/edit.resolver.ts @@ -1,11 +1,11 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards } from "vitnode-backend"; import { EditAdminNavService } from "./edit.service"; import { EditAdminNavArgs } from "./dto/edit.args"; -import { ShowCoreNav } from "@/plugins/core/nav/show/dto/show.obj"; +import { ShowCoreNav } from "../../../nav/show/dto/show.obj"; +import { AdminAuthGuards } from "../../../../utils"; @Resolver() export class EditAdminNavResolver { diff --git a/apps/backend/src/plugins/core/admin/nav/edit/edit.service.ts b/packages/backend/src/core/admin/nav/edit/edit.service.ts similarity index 81% rename from apps/backend/src/plugins/core/admin/nav/edit/edit.service.ts rename to packages/backend/src/core/admin/nav/edit/edit.service.ts index 54f0c0595..0c6d79e43 100644 --- a/apps/backend/src/plugins/core/admin/nav/edit/edit.service.ts +++ b/packages/backend/src/core/admin/nav/edit/edit.service.ts @@ -1,16 +1,17 @@ import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; -import { NotFoundError, DatabaseService } from "vitnode-backend"; import { EditAdminNavArgs } from "./dto/edit.args"; -import { ShowCoreNav } from "@/plugins/core/nav/show/dto/show.obj"; +import { DatabaseService } from "../../../../database"; +import { ParserTextLanguageCoreHelpersService } from "../../../helpers/text_language/parser/parser.service"; +import { ShowCoreNav } from "../../../nav/show/dto/show.obj"; +import { NotFoundError } from "../../../../errors"; import { core_nav, core_nav_description, core_nav_name -} from "../../database/schema/nav"; -import { ParserTextLanguageCoreHelpersService } from "@/plugins/core/helpers/text_language/parser/parser.service"; +} from "../../../../templates/core/admin/database/schema/nav"; @Injectable() export class EditAdminNavService { diff --git a/apps/backend/src/plugins/core/admin/nav/nav.module.ts b/packages/backend/src/core/admin/nav/nav.module.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/nav/nav.module.ts rename to packages/backend/src/core/admin/nav/nav.module.ts diff --git a/packages/backend/src/core/core.module.ts b/packages/backend/src/core/core.module.ts index f9d2d71ec..a49a4c88d 100644 --- a/packages/backend/src/core/core.module.ts +++ b/packages/backend/src/core/core.module.ts @@ -6,13 +6,15 @@ import { GlobalCoreSessionsModule } from "./sessions/sessions.module"; import { AdminModule } from "./admin/admin.module"; +import { GlobalCoreHelpersModule } from "./helpers/helpers.module"; @Module({ imports: [ AdminModule, CoreNavModule, GlobalCoreSessionsModule, - CoreSessionsModule + CoreSessionsModule, + GlobalCoreHelpersModule ] }) export class CoreModule {} diff --git a/packages/backend/src/core/helpers/helpers.module.ts b/packages/backend/src/core/helpers/helpers.module.ts new file mode 100644 index 000000000..5f19b7b4b --- /dev/null +++ b/packages/backend/src/core/helpers/helpers.module.ts @@ -0,0 +1,10 @@ +import { Global, Module } from "@nestjs/common"; + +import { ParserTextLanguageCoreHelpersService } from "./text_language/parser/parser.service"; + +@Global() +@Module({ + providers: [ParserTextLanguageCoreHelpersService], + exports: [ParserTextLanguageCoreHelpersService] +}) +export class GlobalCoreHelpersModule {} diff --git a/packages/backend/src/core/helpers/text_language/parser/helpers.service.ts b/packages/backend/src/core/helpers/text_language/parser/helpers.service.ts new file mode 100644 index 000000000..25a5ebf6c --- /dev/null +++ b/packages/backend/src/core/helpers/text_language/parser/helpers.service.ts @@ -0,0 +1,95 @@ +import { Injectable } from "@nestjs/common"; +import { eq } from "drizzle-orm"; + +import { DatabaseService } from "../../../../database"; +import { core_files_using } from "../../../../templates/core/admin/database/schema/files"; +interface TextLanguageJSONContentType { + type: string; + attrs?: { id: number }; + content?: TextLanguageJSONContentType[]; +} + +export interface InfoFromTextLanguageContentReturnValues { + fileIds: number[]; +} + +@Injectable() +export class HelpersParserTextLanguageCoreHelpersService { + protected state: InfoFromTextLanguageContentReturnValues = { + fileIds: [] + }; + + constructor(protected databaseService: DatabaseService) {} + + protected async parseFiles({ + fileIds, + oldFileIds + }: { + fileIds: InfoFromTextLanguageContentReturnValues["fileIds"]; + oldFileIds: InfoFromTextLanguageContentReturnValues["fileIds"]; + }) { + await Promise.all( + fileIds.map(async id => { + if (this.state.fileIds.includes(id)) return; + + this.state.fileIds.push(id); + + if (oldFileIds.includes(id)) return; + + await this.databaseService.db.insert(core_files_using).values({ + file_id: id, + plugin: "core", + folder: "text-language" + }); + }) + ); + + // Delete remaining files + await Promise.all( + oldFileIds.map(async id => { + const exist = this.state.fileIds.find(fileId => fileId === id); + if (exist) return; + + const fileUsing = + await this.databaseService.db.query.core_files_using.findFirst({ + where: (table, { eq }) => eq(table.file_id, id) + }); + + await this.databaseService.db + .delete(core_files_using) + .where(eq(core_files_using.id, fileUsing.id)); + }) + ); + } + + protected getInfoFromContent({ + content + }: { + content: string; + }): InfoFromTextLanguageContentReturnValues { + const fileIds: number[] = []; + + const mapContent = (values: TextLanguageJSONContentType[]) => { + values.forEach(value => { + // Get all file ids + if (value.type === "files" && !fileIds.includes(value.attrs.id)) { + fileIds.push(value.attrs.id); + } + + if (value.content) { + mapContent(value.content); + } + }); + }; + + try { + const json = JSON.parse(content).content as TextLanguageJSONContentType[]; + + mapContent(json); + } catch (error) { + /* empty */ + } + + return { fileIds }; + } +} diff --git a/packages/backend/src/core/helpers/text_language/parser/parser.service.ts b/packages/backend/src/core/helpers/text_language/parser/parser.service.ts new file mode 100644 index 000000000..303176119 --- /dev/null +++ b/packages/backend/src/core/helpers/text_language/parser/parser.service.ts @@ -0,0 +1,179 @@ +import { Injectable } from "@nestjs/common"; +import { Placeholder, SQL, eq } from "drizzle-orm"; +import { PgTableWithColumns, TableConfig } from "drizzle-orm/pg-core"; + +import { + HelpersParserTextLanguageCoreHelpersService, + InfoFromTextLanguageContentReturnValues +} from "./helpers.service"; + +import { TextLanguageInput } from "../../../../utils"; +import { DatabaseService } from "../../../../database"; +import { CustomError } from "../../../../errors"; + +interface Args { + data: TextLanguageInput[]; + database: PgTableWithColumns; + item_id: number; +} + +interface ReturnValues extends TextLanguageInput { + id: number; + item_id: number; +} + +@Injectable() +export class ParserTextLanguageCoreHelpersService extends HelpersParserTextLanguageCoreHelpersService { + constructor(databaseService: DatabaseService) { + super(databaseService); + } + + protected async contentParser({ + content, + infoOldData + }: { + content: string; + infoOldData: InfoFromTextLanguageContentReturnValues[]; + }) { + const oldInfo = infoOldData.reduce( + (acc, item) => { + // Check if already exists file id + item.fileIds.forEach(id => { + if (!acc.fileIds.includes(id)) { + acc.fileIds.push(id); + } + }); + + return acc; + }, + { fileIds: [] } as InfoFromTextLanguageContentReturnValues + ); + const info = this.getInfoFromContent({ content }); + + await this.parseFiles({ + oldFileIds: oldInfo.fileIds, + fileIds: info.fileIds + }); + } + + async parse({ + data, + database, + item_id + }: Args): Promise { + ["language_code", "value", "item_id"].forEach(key => { + if (!database[key]) { + throw new CustomError({ + code: "DATABASE_COLUMN_NOT_FOUND", + message: `Column ${key} not found in database` + }); + } + }); + + const oldData: ReturnValues[] = (await this.databaseService.db + .select({ + id: database.id, + language_code: database.language_code, + value: database.value + }) + .from(database) + .where(eq(database.item_id, item_id))) as unknown as ReturnValues[]; + + const infoOldData: InfoFromTextLanguageContentReturnValues[] = oldData.map( + item => this.getInfoFromContent({ content: item.value }) + ); + + const updateData: ReturnValues[] = await Promise.all( + data.map(async item => { + const itemExist = oldData.find( + el => el.language_code === item.language_code + ); + + await this.contentParser({ + content: item.value, + infoOldData + }); + + if (itemExist) { + const update = await this.databaseService.db + .update(database) + .set({ ...item, item_id }) + .where(eq(database.id, itemExist.id)) + .returning(); + + return update[0]; + } + + const data = await this.databaseService.db + .insert(database) + .values({ ...item, item_id } as { + [Key in keyof PgTableWithColumns["$inferInsert"]]: + | PgTableWithColumns["$inferInsert"][Key] + | Placeholder + | SQL; + }) + .returning(); + + return data[0]; + }) + ); + + // Delete remaining translations + await Promise.all( + oldData.map(async item => { + const exist = updateData.find( + el => el.language_code === item.language_code + ); + if (exist) return; + + await this.contentParser({ + content: "", + infoOldData + }); + + await this.databaseService.db + .delete(database) + .where(eq(database.id, item.id)); + }) + ); + + // Reset state + this.state = { + fileIds: [] + }; + + return updateData; + } + + async delete({ + database, + item_id + }: Omit, "data">) { + ["language_code", "value", "item_id"].forEach(key => { + if (!database[key]) { + throw new CustomError({ + code: "DATABASE_COLUMN_NOT_FOUND", + message: `Column ${key} not found in database` + }); + } + }); + + const oldData: ReturnValues[] = (await this.databaseService.db + .select({ + id: database.id, + language_code: database.language_code, + value: database.value + }) + .from(database) + .where(eq(database.item_id, item_id))) as unknown as ReturnValues[]; + + const infoOldData: InfoFromTextLanguageContentReturnValues[] = oldData.map( + item => this.getInfoFromContent({ content: item.value }) + ); + + await this.contentParser({ + content: "", + infoOldData + }); + } +} From 9b80d5da031163c8368775b5e572007a0ed3d0f0 Mon Sep 17 00:00:00 2001 From: aXenDeveloper Date: Sat, 22 Jun 2024 10:09:47 +0200 Subject: [PATCH 16/27] perf(backend): Move langs & plugins modules to package --- apps/backend/schema.gql | 1 + .../src/plugins/core/admin/admin.module.ts | 4 ---- apps/backend/src/plugins/core/core.module.ts | 4 ---- .../backend/src/core/admin/admin.module.ts | 6 ++++- .../admin/languages/create/create.resolver.ts | 5 ++-- .../admin/languages/create/create.service.ts | 22 +++++++++--------- .../admin/languages/create/dto/create.args.ts | 2 +- .../admin/languages/delete/delete.resolver.ts | 2 +- .../admin/languages/delete/delete.service.ts | 23 +++++++++++-------- .../admin/languages/delete/dto/delete.args.ts | 0 .../languages/download/download.resolver.ts | 3 ++- .../languages/download/download.service.ts | 22 +++++++++--------- .../languages/download/dto/download.args.ts | 0 .../admin/languages/edit/dto/edit.args.ts | 0 .../admin/languages/edit/edit.resolver.ts | 5 ++-- .../core/admin/languages/edit/edit.service.ts | 8 +++---- .../core/admin/languages/languages.module.ts | 0 .../admin/languages/update/dto/update.args.ts | 2 +- .../admin/languages/update/update.resolver.ts | 2 +- .../admin/languages/update/update.service.ts | 22 ++++++++++-------- .../authorization/dto/authorization.obj.ts | 5 ++-- .../administrators/create/create.resolver.ts | 2 +- .../administrators/create/create.service.ts | 6 ++--- .../administrators/create/dto/create.args.ts | 0 .../administrators/delete/delete.resolver.ts | 2 +- .../administrators/delete/delete.service.ts | 6 ++--- .../administrators/delete/dto/delete.args.ts | 0 .../administrators/show/dto/show.args.ts | 2 +- .../staff/administrators/show/dto/show.obj.ts | 3 ++- .../administrators/show/show.resolver.ts | 2 +- .../staff/administrators/show/show.service.ts | 15 ++++++------ .../moderators/create/create.resolver.ts | 2 +- .../staff/moderators/create/create.service.ts | 6 ++--- .../moderators/create/dto/create.args.ts | 0 .../moderators/delete/delete.resolver.ts | 2 +- .../staff/moderators/delete/delete.service.ts | 6 ++--- .../moderators/delete/dto/delete.args.ts | 0 .../staff/moderators/show/dto/show.args.ts | 2 +- .../staff/moderators/show/dto/show.obj.ts | 3 ++- .../staff/moderators/show/show.resolver.ts | 2 +- .../staff/moderators/show/show.service.ts | 15 ++++++------ .../src}/core/admin/staff/staff.module.ts | 0 packages/backend/src/core/core.module.ts | 6 ++++- .../src}/core/languages/languages.module.ts | 0 .../src}/core/languages/show/dto/show.args.ts | 2 +- .../src}/core/languages/show/dto/show.obj.ts | 20 ++++++++-------- .../src}/core/languages/show/show.resolver.ts | 0 .../src}/core/languages/show/show.service.ts | 12 ++++------ .../src}/core/plugins/plugins.module.ts | 0 .../src}/core/plugins/show/dto/show.obj.ts | 0 .../src}/core/plugins/show/show.resolver.ts | 0 .../src}/core/plugins/show/show.service.ts | 2 +- 52 files changed, 130 insertions(+), 126 deletions(-) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/languages/create/create.resolver.ts (82%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/languages/create/create.service.ts (76%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/languages/create/dto/create.args.ts (91%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/languages/delete/delete.resolver.ts (91%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/languages/delete/delete.service.ts (74%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/languages/delete/dto/delete.args.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/languages/download/download.resolver.ts (84%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/languages/download/download.service.ts (81%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/languages/download/dto/download.args.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/languages/edit/dto/edit.args.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/languages/edit/edit.resolver.ts (81%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/languages/edit/edit.service.ts (79%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/languages/languages.module.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/languages/update/dto/update.args.ts (73%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/languages/update/update.resolver.ts (91%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/languages/update/update.service.ts (79%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/staff/administrators/create/create.resolver.ts (93%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/staff/administrators/create/create.service.ts (90%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/staff/administrators/create/dto/create.args.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/staff/administrators/delete/delete.resolver.ts (91%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/staff/administrators/delete/delete.service.ts (80%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/staff/administrators/delete/dto/delete.args.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/staff/administrators/show/dto/show.args.ts (90%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/staff/administrators/show/dto/show.obj.ts (89%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/staff/administrators/show/show.resolver.ts (92%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/staff/administrators/show/show.service.ts (87%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/staff/moderators/create/create.resolver.ts (92%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/staff/moderators/create/create.service.ts (90%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/staff/moderators/create/dto/create.args.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/staff/moderators/delete/delete.resolver.ts (91%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/staff/moderators/delete/delete.service.ts (79%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/staff/moderators/delete/dto/delete.args.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/staff/moderators/show/dto/show.args.ts (90%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/staff/moderators/show/dto/show.obj.ts (87%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/staff/moderators/show/show.resolver.ts (92%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/staff/moderators/show/show.service.ts (87%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/staff/staff.module.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/languages/languages.module.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/languages/show/dto/show.args.ts (91%) rename {apps/backend/src/plugins => packages/backend/src}/core/languages/show/dto/show.obj.ts (94%) rename {apps/backend/src/plugins => packages/backend/src}/core/languages/show/show.resolver.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/languages/show/show.service.ts (82%) rename {apps/backend/src/plugins => packages/backend/src}/core/plugins/plugins.module.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/plugins/show/dto/show.obj.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/plugins/show/show.resolver.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/plugins/show/show.service.ts (89%) diff --git a/apps/backend/schema.gql b/apps/backend/schema.gql index c5fd8b7da..9b73aac22 100644 --- a/apps/backend/schema.gql +++ b/apps/backend/schema.gql @@ -208,6 +208,7 @@ type Mutation { type NavAdminPluginsAuthorization { code: String! + nav: [ShowAdminNavPluginsObj!]! } type PageInfo { diff --git a/apps/backend/src/plugins/core/admin/admin.module.ts b/apps/backend/src/plugins/core/admin/admin.module.ts index 9d7ed2997..9182e3ac5 100644 --- a/apps/backend/src/plugins/core/admin/admin.module.ts +++ b/apps/backend/src/plugins/core/admin/admin.module.ts @@ -5,9 +5,7 @@ import { AdminSettingsModule } from "./settings/settings.module"; import { AdminMetadataModule } from "./metadata/metadata.module"; import { AdminFilesModule } from "./files/files.module"; import { AdminGroupsModule } from "./groups/groups.module"; -import { AdminLanguagesModule } from "./languages/languages.module"; import { AdminMembersModule } from "./members/members.module"; -import { AdminStaffModule } from "./staff/staff.module"; import { AdminThemeEditorModule } from "./theme_editor/theme_editor.module"; import { AdminEmailModule } from "./email/email.module"; @@ -18,9 +16,7 @@ import { AdminEmailModule } from "./email/email.module"; AdminMetadataModule, AdminFilesModule, AdminGroupsModule, - AdminLanguagesModule, AdminMembersModule, - AdminStaffModule, AdminThemeEditorModule, AdminEmailModule ] diff --git a/apps/backend/src/plugins/core/core.module.ts b/apps/backend/src/plugins/core/core.module.ts index 4eceac42d..4b050a370 100644 --- a/apps/backend/src/plugins/core/core.module.ts +++ b/apps/backend/src/plugins/core/core.module.ts @@ -5,10 +5,8 @@ import { CoreSettingsModule } from "./settings/settings.module"; import { CoreFilesModule, GlobalCoreFilesModule } from "./files/files.module"; import { CoreEditorModule } from "./editor/editor.module"; import { GlobalCoreHelpersModule } from "./helpers/helpers.module"; -import { CoreLanguagesModule } from "./languages/languages.module"; import { CoreMembersModule } from "./members/members.module"; import { CoreMiddlewareModule } from "./middleware/middleware.module"; -import { CorePluginsModule } from "./plugins/plugins.module"; import { CoreThemeEditorModule } from "./theme_editor/theme_editor.module"; @Module({ @@ -19,10 +17,8 @@ import { CoreThemeEditorModule } from "./theme_editor/theme_editor.module"; CoreFilesModule, CoreEditorModule, GlobalCoreHelpersModule, - CoreLanguagesModule, CoreMembersModule, CoreMiddlewareModule, - CorePluginsModule, CoreThemeEditorModule ], providers: [] diff --git a/packages/backend/src/core/admin/admin.module.ts b/packages/backend/src/core/admin/admin.module.ts index 6d9ba0f55..862590b6a 100644 --- a/packages/backend/src/core/admin/admin.module.ts +++ b/packages/backend/src/core/admin/admin.module.ts @@ -6,13 +6,17 @@ import { } from "./sessions/sessions.module"; import { AdminPluginsModule } from "./plugins/plugins.module"; import { AdminNavModule } from "./nav/nav.module"; +import { AdminStaffModule } from "./staff/staff.module"; +import { AdminLanguagesModule } from "./languages/languages.module"; @Module({ imports: [ GlobalAdminSessionsModule, AdminSessionsModule, AdminPluginsModule, - AdminNavModule + AdminNavModule, + AdminStaffModule, + AdminLanguagesModule ] }) export class AdminModule {} diff --git a/apps/backend/src/plugins/core/admin/languages/create/create.resolver.ts b/packages/backend/src/core/admin/languages/create/create.resolver.ts similarity index 82% rename from apps/backend/src/plugins/core/admin/languages/create/create.resolver.ts rename to packages/backend/src/core/admin/languages/create/create.resolver.ts index 8c35231a6..d1a771467 100644 --- a/apps/backend/src/plugins/core/admin/languages/create/create.resolver.ts +++ b/packages/backend/src/core/admin/languages/create/create.resolver.ts @@ -1,11 +1,10 @@ import { UseGuards } from "@nestjs/common"; import { Args, Mutation, Resolver } from "@nestjs/graphql"; -import { AdminAuthGuards } from "vitnode-backend"; import { CreateAdminCoreLanguageService } from "./create.service"; import { CreateCoreAdminLanguagesArgs } from "./dto/create.args"; - -import { ShowCoreLanguages } from "@/plugins/core/languages/show/dto/show.obj"; +import { ShowCoreLanguages } from "../../../languages/show/dto/show.obj"; +import { AdminAuthGuards } from "../../../../utils"; @Resolver() export class CreateAdminCoreLanguagesResolver { diff --git a/apps/backend/src/plugins/core/admin/languages/create/create.service.ts b/packages/backend/src/core/admin/languages/create/create.service.ts similarity index 76% rename from apps/backend/src/plugins/core/admin/languages/create/create.service.ts rename to packages/backend/src/core/admin/languages/create/create.service.ts index 5713d6439..933abedd3 100644 --- a/apps/backend/src/plugins/core/admin/languages/create/create.service.ts +++ b/packages/backend/src/core/admin/languages/create/create.service.ts @@ -2,14 +2,12 @@ import * as fs from "fs"; import { join } from "path"; import { Injectable } from "@nestjs/common"; -import { CustomError, DatabaseService } from "vitnode-backend"; import { CreateCoreAdminLanguagesArgs } from "./dto/create.args"; - -import { ShowCoreLanguages } from "@/plugins/core/languages/show/dto/show.obj"; -import { core_languages } from "../../database/schema/languages"; -import { setRebuildRequired } from "@/functions/rebuild-required"; -import { ABSOLUTE_PATHS } from "@/config"; +import { DatabaseService } from "../../../../database"; +import { ABSOLUTE_PATHS_BACKEND, CustomError } from "../../../.."; +import { core_languages } from "../../../../templates/core/admin/database/schema/languages"; +import { ShowCoreLanguages } from "../../../languages/show/dto/show.obj"; @Injectable() export class CreateAdminCoreLanguageService { @@ -25,14 +23,15 @@ export class CreateAdminCoreLanguageService { [...plugins, { code: "core" }, { code: "admin" }].forEach(async plugin => { const path = join( - ABSOLUTE_PATHS.plugin({ code: plugin.code }).frontend.language, + ABSOLUTE_PATHS_BACKEND.plugin({ code: plugin.code }).frontend.language, `${pluginCode}.json` ); if (fs.existsSync(path)) return; fs.cpSync( join( - ABSOLUTE_PATHS.plugin({ code: plugin.code }).frontend.language, + ABSOLUTE_PATHS_BACKEND.plugin({ code: plugin.code }).frontend + .language, "en.json" ), path, @@ -65,13 +64,13 @@ export class CreateAdminCoreLanguageService { // Clone JSON for manifest fs.cpSync( join( - ABSOLUTE_PATHS.uploads.public, + ABSOLUTE_PATHS_BACKEND.uploads.public, "assets", "en", "manifest.webmanifest" ), join( - ABSOLUTE_PATHS.uploads.public, + ABSOLUTE_PATHS_BACKEND.uploads.public, "assets", code, "manifest.webmanifest" @@ -98,7 +97,8 @@ export class CreateAdminCoreLanguageService { }) .returning(); - await setRebuildRequired({ set: "langs" }); + // TODO: Fix this + // await setRebuildRequired({ set: "langs" }); return newLanguage[0]; } diff --git a/apps/backend/src/plugins/core/admin/languages/create/dto/create.args.ts b/packages/backend/src/core/admin/languages/create/dto/create.args.ts similarity index 91% rename from apps/backend/src/plugins/core/admin/languages/create/dto/create.args.ts rename to packages/backend/src/core/admin/languages/create/dto/create.args.ts index b0f226362..6e034b162 100644 --- a/apps/backend/src/plugins/core/admin/languages/create/dto/create.args.ts +++ b/packages/backend/src/core/admin/languages/create/dto/create.args.ts @@ -1,7 +1,7 @@ import { ArgsType, Field } from "@nestjs/graphql"; import { Transform } from "class-transformer"; import { IsNotEmpty } from "class-validator"; -import { TransformString } from "vitnode-backend"; +import { TransformString } from "../../../../../utils"; @ArgsType() export class CreateCoreAdminLanguagesArgs { diff --git a/apps/backend/src/plugins/core/admin/languages/delete/delete.resolver.ts b/packages/backend/src/core/admin/languages/delete/delete.resolver.ts similarity index 91% rename from apps/backend/src/plugins/core/admin/languages/delete/delete.resolver.ts rename to packages/backend/src/core/admin/languages/delete/delete.resolver.ts index 2056905a7..bf4bb2178 100644 --- a/apps/backend/src/plugins/core/admin/languages/delete/delete.resolver.ts +++ b/packages/backend/src/core/admin/languages/delete/delete.resolver.ts @@ -1,9 +1,9 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards } from "vitnode-backend"; import { DeleteAdminCoreLanguageService } from "./delete.service"; import { DeleteCoreAdminLanguagesArgs } from "./dto/delete.args"; +import { AdminAuthGuards } from "../../../../utils"; @Resolver() export class DeleteAdminCoreLanguagesResolver { diff --git a/apps/backend/src/plugins/core/admin/languages/delete/delete.service.ts b/packages/backend/src/core/admin/languages/delete/delete.service.ts similarity index 74% rename from apps/backend/src/plugins/core/admin/languages/delete/delete.service.ts rename to packages/backend/src/core/admin/languages/delete/delete.service.ts index 1af129677..e6513138d 100644 --- a/apps/backend/src/plugins/core/admin/languages/delete/delete.service.ts +++ b/packages/backend/src/core/admin/languages/delete/delete.service.ts @@ -4,14 +4,11 @@ import { unlinkSync } from "fs"; import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; -import { NotFoundError, CustomError, DatabaseService } from "vitnode-backend"; - +import { DatabaseService } from "../../../../database"; import { DeleteCoreAdminLanguagesArgs } from "./dto/delete.args"; - -import { core_languages } from "../../database/schema/languages"; -import { setRebuildRequired } from "@/functions/rebuild-required"; -import { ABSOLUTE_PATHS } from "@/config"; - +import { CustomError, NotFoundError } from "../../../../errors"; +import { ABSOLUTE_PATHS_BACKEND } from "../../../.."; +import { core_languages } from "../../../../templates/core/admin/database/schema/languages"; @Injectable() export class DeleteAdminCoreLanguageService { constructor(private readonly databaseService: DatabaseService) {} @@ -50,21 +47,27 @@ export class DeleteAdminCoreLanguageService { [...plugins, { code: "core" }, { code: "admin" }].forEach(async plugin => { unlinkSync( join( - ABSOLUTE_PATHS.plugin({ code: plugin.code }).frontend.language, + ABSOLUTE_PATHS_BACKEND.plugin({ code: plugin.code }).frontend + .language, `${code}.json` ) ); }); // Remove assets - const assetsPath = join(ABSOLUTE_PATHS.uploads.public, "assets", code); + const assetsPath = join( + ABSOLUTE_PATHS_BACKEND.uploads.public, + "assets", + code + ); rm(assetsPath, { recursive: true }); await this.databaseService.db .delete(core_languages) .where(eq(core_languages.code, code)); - await setRebuildRequired({ set: "langs" }); + // TODO: Fix this + // await setRebuildRequired({ set: "langs" }); return "Success!"; } diff --git a/apps/backend/src/plugins/core/admin/languages/delete/dto/delete.args.ts b/packages/backend/src/core/admin/languages/delete/dto/delete.args.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/languages/delete/dto/delete.args.ts rename to packages/backend/src/core/admin/languages/delete/dto/delete.args.ts diff --git a/apps/backend/src/plugins/core/admin/languages/download/download.resolver.ts b/packages/backend/src/core/admin/languages/download/download.resolver.ts similarity index 84% rename from apps/backend/src/plugins/core/admin/languages/download/download.resolver.ts rename to packages/backend/src/core/admin/languages/download/download.resolver.ts index 48739c7c7..59bc9e575 100644 --- a/apps/backend/src/plugins/core/admin/languages/download/download.resolver.ts +++ b/packages/backend/src/core/admin/languages/download/download.resolver.ts @@ -1,9 +1,10 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { CurrentUser, User, AdminAuthGuards } from "vitnode-backend"; import { DownloadAdminCoreLanguageService } from "./download.service"; import { DownloadCoreAdminLanguagesArgs } from "./dto/download.args"; +import { AdminAuthGuards } from "../../../../utils"; +import { CurrentUser, User } from "../../../../decorators"; @Resolver() export class DownloadAdminCoreLanguagesResolver { diff --git a/apps/backend/src/plugins/core/admin/languages/download/download.service.ts b/packages/backend/src/core/admin/languages/download/download.service.ts similarity index 81% rename from apps/backend/src/plugins/core/admin/languages/download/download.service.ts rename to packages/backend/src/core/admin/languages/download/download.service.ts index 3c160bd8c..af6762a4e 100644 --- a/apps/backend/src/plugins/core/admin/languages/download/download.service.ts +++ b/packages/backend/src/core/admin/languages/download/download.service.ts @@ -9,16 +9,12 @@ import { generateRandomString, removeSpecialCharacters } from "@vitnode/shared"; -import { - NotFoundError, - CustomError, - User, - DatabaseService -} from "vitnode-backend"; import { DownloadCoreAdminLanguagesArgs } from "./dto/download.args"; - -import { ABSOLUTE_PATHS } from "@/config"; +import { DatabaseService } from "../../../../database"; +import { User } from "../../../../decorators"; +import { CustomError, NotFoundError } from "../../../../errors"; +import { ABSOLUTE_PATHS_BACKEND } from "../../../.."; @Injectable() export class DownloadAdminCoreLanguageService { @@ -39,7 +35,11 @@ export class DownloadAdminCoreLanguageService { // Create temp folder const tempNameFolder = `${code}-download--${generateRandomString(5)}-${currentUnixDate()}`; - const pathTemp = join(ABSOLUTE_PATHS.uploads.temp, "langs", tempNameFolder); + const pathTemp = join( + ABSOLUTE_PATHS_BACKEND.uploads.temp, + "langs", + tempNameFolder + ); if (!fs.existsSync(pathTemp)) { fs.mkdirSync(pathTemp, { recursive: true }); } @@ -53,7 +53,7 @@ export class DownloadAdminCoreLanguageService { [...plugins, { code: "admin" }, { code: "core" }].forEach(plugin => { const path = join( - ABSOLUTE_PATHS.plugin({ code: plugin.code }).frontend.language, + ABSOLUTE_PATHS_BACKEND.plugin({ code: plugin.code }).frontend.language, `${code}.json` ); if ( @@ -75,7 +75,7 @@ export class DownloadAdminCoreLanguageService { await tar.create( { gzip: true, - file: join(ABSOLUTE_PATHS.uploads.temp, `${name}.tgz`), + file: join(ABSOLUTE_PATHS_BACKEND.uploads.temp, `${name}.tgz`), cwd: pathTemp }, ["."] diff --git a/apps/backend/src/plugins/core/admin/languages/download/dto/download.args.ts b/packages/backend/src/core/admin/languages/download/dto/download.args.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/languages/download/dto/download.args.ts rename to packages/backend/src/core/admin/languages/download/dto/download.args.ts diff --git a/apps/backend/src/plugins/core/admin/languages/edit/dto/edit.args.ts b/packages/backend/src/core/admin/languages/edit/dto/edit.args.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/languages/edit/dto/edit.args.ts rename to packages/backend/src/core/admin/languages/edit/dto/edit.args.ts diff --git a/apps/backend/src/plugins/core/admin/languages/edit/edit.resolver.ts b/packages/backend/src/core/admin/languages/edit/edit.resolver.ts similarity index 81% rename from apps/backend/src/plugins/core/admin/languages/edit/edit.resolver.ts rename to packages/backend/src/core/admin/languages/edit/edit.resolver.ts index 50f28e40c..827e5be46 100644 --- a/apps/backend/src/plugins/core/admin/languages/edit/edit.resolver.ts +++ b/packages/backend/src/core/admin/languages/edit/edit.resolver.ts @@ -1,11 +1,10 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards } from "vitnode-backend"; import { EditAdminCoreLanguagesService } from "./edit.service"; import { EditCoreAdminLanguagesArgs } from "./dto/edit.args"; - -import { ShowCoreLanguages } from "@/plugins/core/languages/show/dto/show.obj"; +import { ShowCoreLanguages } from "../../../languages/show/dto/show.obj"; +import { AdminAuthGuards } from "../../../../utils"; @Resolver() export class EditAdminCoreLanguagesResolver { diff --git a/apps/backend/src/plugins/core/admin/languages/edit/edit.service.ts b/packages/backend/src/core/admin/languages/edit/edit.service.ts similarity index 79% rename from apps/backend/src/plugins/core/admin/languages/edit/edit.service.ts rename to packages/backend/src/core/admin/languages/edit/edit.service.ts index 8e689e4ce..13675d82e 100644 --- a/apps/backend/src/plugins/core/admin/languages/edit/edit.service.ts +++ b/packages/backend/src/core/admin/languages/edit/edit.service.ts @@ -1,11 +1,11 @@ import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; -import { NotFoundError, DatabaseService } from "vitnode-backend"; import { EditCoreAdminLanguagesArgs } from "./dto/edit.args"; - -import { core_languages } from "@/plugins/core/admin/database/schema/languages"; -import { ShowCoreLanguages } from "@/plugins/core/languages/show/dto/show.obj"; +import { DatabaseService } from "../../../../database"; +import { ShowCoreLanguages } from "../../../languages/show/dto/show.obj"; +import { NotFoundError } from "../../../../errors"; +import { core_languages } from "../../../../templates/core/admin/database/schema/languages"; @Injectable() export class EditAdminCoreLanguagesService { diff --git a/apps/backend/src/plugins/core/admin/languages/languages.module.ts b/packages/backend/src/core/admin/languages/languages.module.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/languages/languages.module.ts rename to packages/backend/src/core/admin/languages/languages.module.ts diff --git a/apps/backend/src/plugins/core/admin/languages/update/dto/update.args.ts b/packages/backend/src/core/admin/languages/update/dto/update.args.ts similarity index 73% rename from apps/backend/src/plugins/core/admin/languages/update/dto/update.args.ts rename to packages/backend/src/core/admin/languages/update/dto/update.args.ts index 48f00ee12..0469d205a 100644 --- a/apps/backend/src/plugins/core/admin/languages/update/dto/update.args.ts +++ b/packages/backend/src/core/admin/languages/update/dto/update.args.ts @@ -1,5 +1,5 @@ import { ArgsType, Field } from "@nestjs/graphql"; -import { FileUpload, GraphQLUpload } from "vitnode-backend"; +import { FileUpload, GraphQLUpload } from "../../../../../graphql-upload"; @ArgsType() export class UpdateCoreAdminLanguagesArgs { diff --git a/apps/backend/src/plugins/core/admin/languages/update/update.resolver.ts b/packages/backend/src/core/admin/languages/update/update.resolver.ts similarity index 91% rename from apps/backend/src/plugins/core/admin/languages/update/update.resolver.ts rename to packages/backend/src/core/admin/languages/update/update.resolver.ts index da10a7cc8..ac1f0569a 100644 --- a/apps/backend/src/plugins/core/admin/languages/update/update.resolver.ts +++ b/packages/backend/src/core/admin/languages/update/update.resolver.ts @@ -1,9 +1,9 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards } from "vitnode-backend"; import { UpdateAdminCoreLanguageService } from "./update.service"; import { UpdateCoreAdminLanguagesArgs } from "./dto/update.args"; +import { AdminAuthGuards } from "../../../../utils"; @Resolver() export class UpdateAdminCoreLanguagesResolver { diff --git a/apps/backend/src/plugins/core/admin/languages/update/update.service.ts b/packages/backend/src/core/admin/languages/update/update.service.ts similarity index 79% rename from apps/backend/src/plugins/core/admin/languages/update/update.service.ts rename to packages/backend/src/core/admin/languages/update/update.service.ts index 4a07faeaa..46b085900 100644 --- a/apps/backend/src/plugins/core/admin/languages/update/update.service.ts +++ b/packages/backend/src/core/admin/languages/update/update.service.ts @@ -5,13 +5,12 @@ import { Injectable } from "@nestjs/common"; import * as tar from "tar"; import { eq } from "drizzle-orm"; import { currentUnixDate, generateRandomString } from "@vitnode/shared"; -import { NotFoundError, DatabaseService } from "vitnode-backend"; import { UpdateCoreAdminLanguagesArgs } from "./dto/update.args"; - -import { core_languages } from "../../database/schema/languages"; -import { setRebuildRequired } from "@/functions/rebuild-required"; -import { ABSOLUTE_PATHS } from "@/config"; +import { DatabaseService } from "../../../../database"; +import { NotFoundError } from "../../../../errors"; +import { ABSOLUTE_PATHS_BACKEND } from "../../../.."; +import { core_languages } from "../../../../templates/core/admin/database/schema/languages"; @Injectable() export class UpdateAdminCoreLanguageService { @@ -29,7 +28,11 @@ export class UpdateAdminCoreLanguageService { // Unpack the file to the temp folder const tgz = await file; const tempNameFolder = `${code}-update--${generateRandomString(5)}-${currentUnixDate()}`; - const pathTemp = join(ABSOLUTE_PATHS.uploads.temp, "langs", tempNameFolder); + const pathTemp = join( + ABSOLUTE_PATHS_BACKEND.uploads.temp, + "langs", + tempNameFolder + ); if (!fs.existsSync(pathTemp)) { fs.mkdirSync(pathTemp, { recursive: true }); } @@ -52,8 +55,8 @@ export class UpdateAdminCoreLanguageService { plugins.forEach(plugin => { // Check if the plugin exists - const path = ABSOLUTE_PATHS.plugin({ code: plugin }).frontend - .language; + const path = ABSOLUTE_PATHS_BACKEND.plugin({ code: plugin }) + .frontend.language; if (!fs.existsSync(path)) { return; @@ -78,7 +81,8 @@ export class UpdateAdminCoreLanguageService { .set({ updated: new Date() }) .where(eq(core_languages.code, code)); - await setRebuildRequired({ set: "langs" }); + // TODO: Fix this + // await setRebuildRequired({ set: "langs" }); return "Success!"; } diff --git a/packages/backend/src/core/admin/sessions/authorization/dto/authorization.obj.ts b/packages/backend/src/core/admin/sessions/authorization/dto/authorization.obj.ts index 0c6e714ad..15b4c372c 100644 --- a/packages/backend/src/core/admin/sessions/authorization/dto/authorization.obj.ts +++ b/packages/backend/src/core/admin/sessions/authorization/dto/authorization.obj.ts @@ -1,14 +1,15 @@ import { Field, ObjectType } from "@nestjs/graphql"; import { AuthorizationCurrentUserObj } from "../../../../sessions/authorization/dto/authorization.obj"; +import { ShowAdminNavPluginsObj } from "../../../plugins/nav/show/dto/show.obj"; @ObjectType() export class NavAdminPluginsAuthorization { @Field(() => String) code: string; - // @Field(() => [ShowAdminNavPluginsObj]) - // nav: ShowAdminNavPluginsObj[]; + @Field(() => [ShowAdminNavPluginsObj]) + nav: ShowAdminNavPluginsObj[]; } @ObjectType() diff --git a/apps/backend/src/plugins/core/admin/staff/administrators/create/create.resolver.ts b/packages/backend/src/core/admin/staff/administrators/create/create.resolver.ts similarity index 93% rename from apps/backend/src/plugins/core/admin/staff/administrators/create/create.resolver.ts rename to packages/backend/src/core/admin/staff/administrators/create/create.resolver.ts index 98523bbb4..c3646e6c5 100644 --- a/apps/backend/src/plugins/core/admin/staff/administrators/create/create.resolver.ts +++ b/packages/backend/src/core/admin/staff/administrators/create/create.resolver.ts @@ -1,10 +1,10 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards } from "vitnode-backend"; import { CreateAdminStaffAdministratorsService } from "./create.service"; import { CreateAdminStaffAdministratorsArgs } from "./dto/create.args"; import { ShowAdminStaffAdministrators } from "../show/dto/show.obj"; +import { AdminAuthGuards } from "../../../../../utils"; @Resolver() export class CreateAdminStaffAdministratorResolver { diff --git a/apps/backend/src/plugins/core/admin/staff/administrators/create/create.service.ts b/packages/backend/src/core/admin/staff/administrators/create/create.service.ts similarity index 90% rename from apps/backend/src/plugins/core/admin/staff/administrators/create/create.service.ts rename to packages/backend/src/core/admin/staff/administrators/create/create.service.ts index a4dc97bdc..6da65bd9a 100644 --- a/apps/backend/src/plugins/core/admin/staff/administrators/create/create.service.ts +++ b/packages/backend/src/core/admin/staff/administrators/create/create.service.ts @@ -1,10 +1,10 @@ import { Injectable } from "@nestjs/common"; -import { CustomError, DatabaseService } from "vitnode-backend"; import { ShowAdminStaffAdministrators } from "../show/dto/show.obj"; import { CreateAdminStaffAdministratorsArgs } from "./dto/create.args"; - -import { core_admin_permissions } from "@/plugins/core/admin/database/schema/admins"; +import { CustomError } from "../../../../../errors"; +import { DatabaseService } from "../../../../../database"; +import { core_admin_permissions } from "../../../../../templates/core/admin/database/schema/admins"; @Injectable() export class CreateAdminStaffAdministratorsService { diff --git a/apps/backend/src/plugins/core/admin/staff/administrators/create/dto/create.args.ts b/packages/backend/src/core/admin/staff/administrators/create/dto/create.args.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/staff/administrators/create/dto/create.args.ts rename to packages/backend/src/core/admin/staff/administrators/create/dto/create.args.ts diff --git a/apps/backend/src/plugins/core/admin/staff/administrators/delete/delete.resolver.ts b/packages/backend/src/core/admin/staff/administrators/delete/delete.resolver.ts similarity index 91% rename from apps/backend/src/plugins/core/admin/staff/administrators/delete/delete.resolver.ts rename to packages/backend/src/core/admin/staff/administrators/delete/delete.resolver.ts index 3f1ef2566..21093d57c 100644 --- a/apps/backend/src/plugins/core/admin/staff/administrators/delete/delete.resolver.ts +++ b/packages/backend/src/core/admin/staff/administrators/delete/delete.resolver.ts @@ -1,9 +1,9 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards } from "vitnode-backend"; import { DeleteAdminStaffAdministratorsService } from "./delete.service"; import { DeleteAdminStaffAdministratorsArgs } from "./dto/delete.args"; +import { AdminAuthGuards } from "../../../../../utils"; @Resolver() export class DeleteAdminStaffAdministratorsResolver { diff --git a/apps/backend/src/plugins/core/admin/staff/administrators/delete/delete.service.ts b/packages/backend/src/core/admin/staff/administrators/delete/delete.service.ts similarity index 80% rename from apps/backend/src/plugins/core/admin/staff/administrators/delete/delete.service.ts rename to packages/backend/src/core/admin/staff/administrators/delete/delete.service.ts index 89a9b17d7..8b06ff06c 100644 --- a/apps/backend/src/plugins/core/admin/staff/administrators/delete/delete.service.ts +++ b/packages/backend/src/core/admin/staff/administrators/delete/delete.service.ts @@ -1,10 +1,10 @@ import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; -import { NotFoundError, CustomError, DatabaseService } from "vitnode-backend"; import { DeleteAdminStaffAdministratorsArgs } from "./dto/delete.args"; - -import { core_admin_permissions } from "@/plugins/core/admin/database/schema/admins"; +import { DatabaseService } from "../../../../../database"; +import { CustomError, NotFoundError } from "../../../../../errors"; +import { core_admin_permissions } from "../../../../../templates/core/admin/database/schema/admins"; @Injectable() export class DeleteAdminStaffAdministratorsService { diff --git a/apps/backend/src/plugins/core/admin/staff/administrators/delete/dto/delete.args.ts b/packages/backend/src/core/admin/staff/administrators/delete/dto/delete.args.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/staff/administrators/delete/dto/delete.args.ts rename to packages/backend/src/core/admin/staff/administrators/delete/dto/delete.args.ts diff --git a/apps/backend/src/plugins/core/admin/staff/administrators/show/dto/show.args.ts b/packages/backend/src/core/admin/staff/administrators/show/dto/show.args.ts similarity index 90% rename from apps/backend/src/plugins/core/admin/staff/administrators/show/dto/show.args.ts rename to packages/backend/src/core/admin/staff/administrators/show/dto/show.args.ts index b97a1c9c7..5c7ca6591 100644 --- a/apps/backend/src/plugins/core/admin/staff/administrators/show/dto/show.args.ts +++ b/packages/backend/src/core/admin/staff/administrators/show/dto/show.args.ts @@ -1,5 +1,5 @@ import { ArgsType, Field, InputType, registerEnumType } from "@nestjs/graphql"; -import { PaginationArgs, SortDirectionEnum } from "vitnode-backend"; +import { PaginationArgs, SortDirectionEnum } from "../../../../../../utils"; enum ShowAdminStaffAdministratorsSortingColumnEnum { updated = "updated" diff --git a/apps/backend/src/plugins/core/admin/staff/administrators/show/dto/show.obj.ts b/packages/backend/src/core/admin/staff/administrators/show/dto/show.obj.ts similarity index 89% rename from apps/backend/src/plugins/core/admin/staff/administrators/show/dto/show.obj.ts rename to packages/backend/src/core/admin/staff/administrators/show/dto/show.obj.ts index 93b771f73..c5b0aa590 100644 --- a/apps/backend/src/plugins/core/admin/staff/administrators/show/dto/show.obj.ts +++ b/packages/backend/src/core/admin/staff/administrators/show/dto/show.obj.ts @@ -5,7 +5,8 @@ import { OmitType, createUnionType } from "@nestjs/graphql"; -import { PageInfo, TextLanguage, GroupUser, User } from "vitnode-backend"; +import { GroupUser, User } from "../../../../../../decorators"; +import { PageInfo, TextLanguage } from "../../../../../../utils"; @ObjectType() export class ShowAdminStaffAdministratorsObj { diff --git a/apps/backend/src/plugins/core/admin/staff/administrators/show/show.resolver.ts b/packages/backend/src/core/admin/staff/administrators/show/show.resolver.ts similarity index 92% rename from apps/backend/src/plugins/core/admin/staff/administrators/show/show.resolver.ts rename to packages/backend/src/core/admin/staff/administrators/show/show.resolver.ts index 343e47e30..61acc9602 100644 --- a/apps/backend/src/plugins/core/admin/staff/administrators/show/show.resolver.ts +++ b/packages/backend/src/core/admin/staff/administrators/show/show.resolver.ts @@ -1,10 +1,10 @@ import { Args, Query, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards } from "vitnode-backend"; import { ShowAdminStaffAdministratorsService } from "./show.service"; import { ShowAdminStaffAdministratorsObj } from "./dto/show.obj"; import { ShowAdminStaffAdministratorsArgs } from "./dto/show.args"; +import { AdminAuthGuards } from "../../../../../utils"; @Resolver() export class ShowAdminStaffAdministratorResolver { diff --git a/apps/backend/src/plugins/core/admin/staff/administrators/show/show.service.ts b/packages/backend/src/core/admin/staff/administrators/show/show.service.ts similarity index 87% rename from apps/backend/src/plugins/core/admin/staff/administrators/show/show.service.ts rename to packages/backend/src/core/admin/staff/administrators/show/show.service.ts index 2a07c0f2b..b5bc40047 100644 --- a/apps/backend/src/plugins/core/admin/staff/administrators/show/show.service.ts +++ b/packages/backend/src/core/admin/staff/administrators/show/show.service.ts @@ -1,16 +1,15 @@ import { Injectable } from "@nestjs/common"; import { count } from "drizzle-orm"; -import { - inputPaginationCursor, - outputPagination, - SortDirectionEnum, - DatabaseService -} from "vitnode-backend"; import { ShowAdminStaffAdministratorsArgs } from "./dto/show.args"; import { ShowAdminStaffAdministratorsObj } from "./dto/show.obj"; - -import { core_admin_permissions } from "@/plugins/core/admin/database/schema/admins"; +import { DatabaseService } from "../../../../../database"; +import { + inputPaginationCursor, + outputPagination +} from "../../../../../functions"; +import { core_admin_permissions } from "../../../../../templates/core/admin/database/schema/admins"; +import { SortDirectionEnum } from "../../../../../utils"; @Injectable() export class ShowAdminStaffAdministratorsService { diff --git a/apps/backend/src/plugins/core/admin/staff/moderators/create/create.resolver.ts b/packages/backend/src/core/admin/staff/moderators/create/create.resolver.ts similarity index 92% rename from apps/backend/src/plugins/core/admin/staff/moderators/create/create.resolver.ts rename to packages/backend/src/core/admin/staff/moderators/create/create.resolver.ts index 29e310523..8c4c14d60 100644 --- a/apps/backend/src/plugins/core/admin/staff/moderators/create/create.resolver.ts +++ b/packages/backend/src/core/admin/staff/moderators/create/create.resolver.ts @@ -1,10 +1,10 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards } from "vitnode-backend"; import { CreateAdminStaffModeratorsService } from "./create.service"; import { CreateAdminStaffModeratorsArgs } from "./dto/create.args"; import { ShowAdminStaffModerators } from "../show/dto/show.obj"; +import { AdminAuthGuards } from "../../../../../utils"; @Resolver() export class CreateAdminStaffModeratorsResolver { diff --git a/apps/backend/src/plugins/core/admin/staff/moderators/create/create.service.ts b/packages/backend/src/core/admin/staff/moderators/create/create.service.ts similarity index 90% rename from apps/backend/src/plugins/core/admin/staff/moderators/create/create.service.ts rename to packages/backend/src/core/admin/staff/moderators/create/create.service.ts index eebf4cd12..d03c33785 100644 --- a/apps/backend/src/plugins/core/admin/staff/moderators/create/create.service.ts +++ b/packages/backend/src/core/admin/staff/moderators/create/create.service.ts @@ -1,10 +1,10 @@ import { Injectable } from "@nestjs/common"; -import { CustomError, DatabaseService } from "vitnode-backend"; import { ShowAdminStaffModerators } from "../show/dto/show.obj"; import { CreateAdminStaffModeratorsArgs } from "./dto/create.args"; - -import { core_moderators_permissions } from "@/plugins/core/admin/database/schema/moderators"; +import { DatabaseService } from "../../../../../database"; +import { CustomError } from "../../../../../errors"; +import { core_moderators_permissions } from "../../../../../templates/core/admin/database/schema/moderators"; @Injectable() export class CreateAdminStaffModeratorsService { diff --git a/apps/backend/src/plugins/core/admin/staff/moderators/create/dto/create.args.ts b/packages/backend/src/core/admin/staff/moderators/create/dto/create.args.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/staff/moderators/create/dto/create.args.ts rename to packages/backend/src/core/admin/staff/moderators/create/dto/create.args.ts diff --git a/apps/backend/src/plugins/core/admin/staff/moderators/delete/delete.resolver.ts b/packages/backend/src/core/admin/staff/moderators/delete/delete.resolver.ts similarity index 91% rename from apps/backend/src/plugins/core/admin/staff/moderators/delete/delete.resolver.ts rename to packages/backend/src/core/admin/staff/moderators/delete/delete.resolver.ts index cfbad721c..18daa6025 100644 --- a/apps/backend/src/plugins/core/admin/staff/moderators/delete/delete.resolver.ts +++ b/packages/backend/src/core/admin/staff/moderators/delete/delete.resolver.ts @@ -1,9 +1,9 @@ import { UseGuards } from "@nestjs/common"; import { Args, Mutation, Resolver } from "@nestjs/graphql"; -import { AdminAuthGuards } from "vitnode-backend"; import { DeleteAdminStaffModeratorsArgs } from "./dto/delete.args"; import { DeleteAdminStaffModeratorsService } from "./delete.service"; +import { AdminAuthGuards } from "../../../../../utils"; @Resolver() export class DeleteAdminStaffModeratorsResolver { diff --git a/apps/backend/src/plugins/core/admin/staff/moderators/delete/delete.service.ts b/packages/backend/src/core/admin/staff/moderators/delete/delete.service.ts similarity index 79% rename from apps/backend/src/plugins/core/admin/staff/moderators/delete/delete.service.ts rename to packages/backend/src/core/admin/staff/moderators/delete/delete.service.ts index 87907e582..05a9b0bfa 100644 --- a/apps/backend/src/plugins/core/admin/staff/moderators/delete/delete.service.ts +++ b/packages/backend/src/core/admin/staff/moderators/delete/delete.service.ts @@ -1,10 +1,10 @@ import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; -import { CustomError, DatabaseService } from "vitnode-backend"; import { DeleteAdminStaffModeratorsArgs } from "./dto/delete.args"; - -import { core_moderators_permissions } from "@/plugins/core/admin/database/schema/moderators"; +import { DatabaseService } from "../../../../../database"; +import { CustomError } from "../../../../../errors"; +import { core_moderators_permissions } from "../../../../../templates/core/admin/database/schema/moderators"; @Injectable() export class DeleteAdminStaffModeratorsService { diff --git a/apps/backend/src/plugins/core/admin/staff/moderators/delete/dto/delete.args.ts b/packages/backend/src/core/admin/staff/moderators/delete/dto/delete.args.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/staff/moderators/delete/dto/delete.args.ts rename to packages/backend/src/core/admin/staff/moderators/delete/dto/delete.args.ts diff --git a/apps/backend/src/plugins/core/admin/staff/moderators/show/dto/show.args.ts b/packages/backend/src/core/admin/staff/moderators/show/dto/show.args.ts similarity index 90% rename from apps/backend/src/plugins/core/admin/staff/moderators/show/dto/show.args.ts rename to packages/backend/src/core/admin/staff/moderators/show/dto/show.args.ts index 31a913797..5c0ce748a 100644 --- a/apps/backend/src/plugins/core/admin/staff/moderators/show/dto/show.args.ts +++ b/packages/backend/src/core/admin/staff/moderators/show/dto/show.args.ts @@ -1,5 +1,5 @@ import { ArgsType, Field, InputType, registerEnumType } from "@nestjs/graphql"; -import { PaginationArgs, SortDirectionEnum } from "vitnode-backend"; +import { PaginationArgs, SortDirectionEnum } from "../../../../../../utils"; enum ShowAdminStaffModeratorsSortingColumnEnum { updated = "updated" diff --git a/apps/backend/src/plugins/core/admin/staff/moderators/show/dto/show.obj.ts b/packages/backend/src/core/admin/staff/moderators/show/dto/show.obj.ts similarity index 87% rename from apps/backend/src/plugins/core/admin/staff/moderators/show/dto/show.obj.ts rename to packages/backend/src/core/admin/staff/moderators/show/dto/show.obj.ts index 4a151f7e5..7e45738ca 100644 --- a/apps/backend/src/plugins/core/admin/staff/moderators/show/dto/show.obj.ts +++ b/packages/backend/src/core/admin/staff/moderators/show/dto/show.obj.ts @@ -1,10 +1,11 @@ import { Field, Int, ObjectType } from "@nestjs/graphql"; -import { PageInfo, User } from "vitnode-backend"; import { StaffGroupUser, UserOrGroupCoreStaffUnion } from "../../../administrators/show/dto/show.obj"; +import { PageInfo } from "../../../../../../utils"; +import { User } from "../../../../../../decorators"; @ObjectType() export class ShowAdminStaffModeratorsObj { diff --git a/apps/backend/src/plugins/core/admin/staff/moderators/show/show.resolver.ts b/packages/backend/src/core/admin/staff/moderators/show/show.resolver.ts similarity index 92% rename from apps/backend/src/plugins/core/admin/staff/moderators/show/show.resolver.ts rename to packages/backend/src/core/admin/staff/moderators/show/show.resolver.ts index b2638589c..45a558a56 100644 --- a/apps/backend/src/plugins/core/admin/staff/moderators/show/show.resolver.ts +++ b/packages/backend/src/core/admin/staff/moderators/show/show.resolver.ts @@ -1,10 +1,10 @@ import { Args, Query, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards } from "vitnode-backend"; import { ShowAdminStaffModeratorsService } from "./show.service"; import { ShowAdminStaffModeratorsObj } from "./dto/show.obj"; import { ShowAdminStaffModeratorsArgs } from "./dto/show.args"; +import { AdminAuthGuards } from "../../../../../utils"; @Resolver() export class ShowAdminStaffModeratorsResolver { diff --git a/apps/backend/src/plugins/core/admin/staff/moderators/show/show.service.ts b/packages/backend/src/core/admin/staff/moderators/show/show.service.ts similarity index 87% rename from apps/backend/src/plugins/core/admin/staff/moderators/show/show.service.ts rename to packages/backend/src/core/admin/staff/moderators/show/show.service.ts index 3f4f9b233..ddc190dcf 100644 --- a/apps/backend/src/plugins/core/admin/staff/moderators/show/show.service.ts +++ b/packages/backend/src/core/admin/staff/moderators/show/show.service.ts @@ -1,16 +1,15 @@ import { Injectable } from "@nestjs/common"; import { count } from "drizzle-orm"; -import { - inputPaginationCursor, - outputPagination, - SortDirectionEnum, - DatabaseService -} from "vitnode-backend"; import { ShowAdminStaffModeratorsArgs } from "./dto/show.args"; import { ShowAdminStaffModeratorsObj } from "./dto/show.obj"; - -import { core_moderators_permissions } from "@/plugins/core/admin/database/schema/moderators"; +import { DatabaseService } from "../../../../../database"; +import { + inputPaginationCursor, + outputPagination +} from "../../../../../functions"; +import { core_moderators_permissions } from "../../../../../templates/core/admin/database/schema/moderators"; +import { SortDirectionEnum } from "../../../../../utils"; @Injectable() export class ShowAdminStaffModeratorsService { diff --git a/apps/backend/src/plugins/core/admin/staff/staff.module.ts b/packages/backend/src/core/admin/staff/staff.module.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/staff/staff.module.ts rename to packages/backend/src/core/admin/staff/staff.module.ts diff --git a/packages/backend/src/core/core.module.ts b/packages/backend/src/core/core.module.ts index a49a4c88d..25d4a48b3 100644 --- a/packages/backend/src/core/core.module.ts +++ b/packages/backend/src/core/core.module.ts @@ -7,6 +7,8 @@ import { } from "./sessions/sessions.module"; import { AdminModule } from "./admin/admin.module"; import { GlobalCoreHelpersModule } from "./helpers/helpers.module"; +import { CorePluginsModule } from "./plugins/plugins.module"; +import { CoreLanguagesModule } from "./languages/languages.module"; @Module({ imports: [ @@ -14,7 +16,9 @@ import { GlobalCoreHelpersModule } from "./helpers/helpers.module"; CoreNavModule, GlobalCoreSessionsModule, CoreSessionsModule, - GlobalCoreHelpersModule + GlobalCoreHelpersModule, + CorePluginsModule, + CoreLanguagesModule ] }) export class CoreModule {} diff --git a/apps/backend/src/plugins/core/languages/languages.module.ts b/packages/backend/src/core/languages/languages.module.ts similarity index 100% rename from apps/backend/src/plugins/core/languages/languages.module.ts rename to packages/backend/src/core/languages/languages.module.ts diff --git a/apps/backend/src/plugins/core/languages/show/dto/show.args.ts b/packages/backend/src/core/languages/show/dto/show.args.ts similarity index 91% rename from apps/backend/src/plugins/core/languages/show/dto/show.args.ts rename to packages/backend/src/core/languages/show/dto/show.args.ts index 96b052a9a..e2ca7288e 100644 --- a/apps/backend/src/plugins/core/languages/show/dto/show.args.ts +++ b/packages/backend/src/core/languages/show/dto/show.args.ts @@ -1,5 +1,5 @@ import { ArgsType, Field, InputType, registerEnumType } from "@nestjs/graphql"; -import { PaginationArgs, SortDirectionEnum } from "vitnode-backend"; +import { PaginationArgs, SortDirectionEnum } from "../../../../utils"; enum ShowCoreLanguagesSortingColumnEnum { created = "created", diff --git a/apps/backend/src/plugins/core/languages/show/dto/show.obj.ts b/packages/backend/src/core/languages/show/dto/show.obj.ts similarity index 94% rename from apps/backend/src/plugins/core/languages/show/dto/show.obj.ts rename to packages/backend/src/core/languages/show/dto/show.obj.ts index a7c488d83..b6cdad5af 100644 --- a/apps/backend/src/plugins/core/languages/show/dto/show.obj.ts +++ b/packages/backend/src/core/languages/show/dto/show.obj.ts @@ -1,14 +1,5 @@ import { Field, Int, ObjectType } from "@nestjs/graphql"; -import { PageInfo } from "vitnode-backend"; - -@ObjectType() -export class ShowCoreLanguagesObj { - @Field(() => [ShowCoreLanguages]) - edges: ShowCoreLanguages[]; - - @Field(() => PageInfo) - pageInfo: PageInfo; -} +import { PageInfo } from "../../../../utils"; @ObjectType() export class ShowCoreLanguages { @@ -48,3 +39,12 @@ export class ShowCoreLanguages { @Field(() => Date) updated: Date; } + +@ObjectType() +export class ShowCoreLanguagesObj { + @Field(() => [ShowCoreLanguages]) + edges: ShowCoreLanguages[]; + + @Field(() => PageInfo) + pageInfo: PageInfo; +} diff --git a/apps/backend/src/plugins/core/languages/show/show.resolver.ts b/packages/backend/src/core/languages/show/show.resolver.ts similarity index 100% rename from apps/backend/src/plugins/core/languages/show/show.resolver.ts rename to packages/backend/src/core/languages/show/show.resolver.ts diff --git a/apps/backend/src/plugins/core/languages/show/show.service.ts b/packages/backend/src/core/languages/show/show.service.ts similarity index 82% rename from apps/backend/src/plugins/core/languages/show/show.service.ts rename to packages/backend/src/core/languages/show/show.service.ts index 95f953920..ef15cdf67 100644 --- a/apps/backend/src/plugins/core/languages/show/show.service.ts +++ b/packages/backend/src/core/languages/show/show.service.ts @@ -1,16 +1,12 @@ import { Injectable } from "@nestjs/common"; import { and, count, ilike } from "drizzle-orm"; -import { - inputPaginationCursor, - outputPagination, - SortDirectionEnum, - DatabaseService -} from "vitnode-backend"; import { ShowCoreLanguagesArgs } from "./dto/show.args"; import { ShowCoreLanguagesObj } from "./dto/show.obj"; - -import { core_languages } from "@/plugins/core/admin/database/schema/languages"; +import { DatabaseService } from "../../../database"; +import { inputPaginationCursor, outputPagination } from "../../../functions"; +import { core_languages } from "../../../templates/core/admin/database/schema/languages"; +import { SortDirectionEnum } from "../../../utils"; @Injectable() export class ShowCoreLanguageService { diff --git a/apps/backend/src/plugins/core/plugins/plugins.module.ts b/packages/backend/src/core/plugins/plugins.module.ts similarity index 100% rename from apps/backend/src/plugins/core/plugins/plugins.module.ts rename to packages/backend/src/core/plugins/plugins.module.ts diff --git a/apps/backend/src/plugins/core/plugins/show/dto/show.obj.ts b/packages/backend/src/core/plugins/show/dto/show.obj.ts similarity index 100% rename from apps/backend/src/plugins/core/plugins/show/dto/show.obj.ts rename to packages/backend/src/core/plugins/show/dto/show.obj.ts diff --git a/apps/backend/src/plugins/core/plugins/show/show.resolver.ts b/packages/backend/src/core/plugins/show/show.resolver.ts similarity index 100% rename from apps/backend/src/plugins/core/plugins/show/show.resolver.ts rename to packages/backend/src/core/plugins/show/show.resolver.ts diff --git a/apps/backend/src/plugins/core/plugins/show/show.service.ts b/packages/backend/src/core/plugins/show/show.service.ts similarity index 89% rename from apps/backend/src/plugins/core/plugins/show/show.service.ts rename to packages/backend/src/core/plugins/show/show.service.ts index a2e7a55b1..560ac8b52 100644 --- a/apps/backend/src/plugins/core/plugins/show/show.service.ts +++ b/packages/backend/src/core/plugins/show/show.service.ts @@ -1,7 +1,7 @@ import { Injectable } from "@nestjs/common"; -import { DatabaseService } from "vitnode-backend"; import { ShowCorePluginsObj } from "./dto/show.obj"; +import { DatabaseService } from "../../../database"; @Injectable() export class ShowCorePluginsService { From daa1b43709b641481821479bdcf57cedb11adfe1 Mon Sep 17 00:00:00 2001 From: aXenDeveloper Date: Sat, 22 Jun 2024 10:43:41 +0200 Subject: [PATCH 17/27] perf(backend): Move users module to package --- .../src/plugins/core/admin/admin.module.ts | 4 - apps/backend/src/plugins/core/core.module.ts | 7 -- packages/backend/package.json | 1 + .../backend/src/core/admin/admin.module.ts | 6 +- .../admin/files/delete/delete.resolver.ts | 3 +- .../core/admin/files/delete/delete.service.ts | 7 +- .../admin/files/delete/dto/delete.args.ts | 0 .../files/download/download.controller.ts | 10 +- .../src}/core/admin/files/files.module.ts | 0 .../core/admin/files/show/dto/show.args.ts | 2 +- .../core/admin/files/show/dto/show.obj.ts | 5 +- .../core/admin/files/show/show.resolver.ts | 3 +- .../core/admin/files/show/show.service.ts | 14 +-- .../admin/languages/create/create.resolver.ts | 1 + .../admin/languages/create/create.service.ts | 1 + .../admin/languages/create/dto/create.args.ts | 1 + .../admin/languages/delete/delete.resolver.ts | 1 + .../admin/languages/delete/delete.service.ts | 4 +- .../languages/download/download.resolver.ts | 1 + .../languages/download/download.service.ts | 1 + .../admin/languages/edit/edit.resolver.ts | 1 + .../core/admin/languages/edit/edit.service.ts | 1 + .../admin/languages/update/dto/update.args.ts | 1 + .../admin/languages/update/update.resolver.ts | 1 + .../admin/languages/update/update.service.ts | 1 + .../core/admin/members/edit/dto/edit.args.ts | 0 .../core/admin/members/edit/dto/edit.obj.ts | 0 .../core/admin/members/edit/edit.resolver.ts | 3 +- .../core/admin/members/edit/edit.service.ts | 9 +- .../src}/core/admin/members/members.module.ts | 0 .../core/admin/members/show/dto/show.args.ts | 3 +- .../core/admin/members/show/dto/show.obj.ts | 22 ++-- .../core/admin/members/show/show.resolver.ts | 3 +- .../core/admin/members/show/show.service.ts | 11 +- .../core/admin/members/stats/dto/stats.obj.ts | 0 .../admin/members/stats/stats.resolver.ts | 3 +- .../core/admin/members/stats/stats.service.ts | 3 +- .../administrators/create/create.resolver.ts | 1 + .../administrators/create/create.service.ts | 1 + .../administrators/delete/delete.resolver.ts | 1 + .../administrators/delete/delete.service.ts | 1 + .../administrators/show/dto/show.args.ts | 1 + .../staff/administrators/show/dto/show.obj.ts | 1 + .../administrators/show/show.resolver.ts | 1 + .../staff/administrators/show/show.service.ts | 1 + .../moderators/create/create.resolver.ts | 1 + .../staff/moderators/create/create.service.ts | 1 + .../moderators/delete/delete.resolver.ts | 1 + .../staff/moderators/delete/delete.service.ts | 1 + .../staff/moderators/show/dto/show.args.ts | 1 + .../staff/moderators/show/show.resolver.ts | 1 + .../staff/moderators/show/show.service.ts | 1 + packages/backend/src/core/config.ts | 119 ++++++++++++++++++ packages/backend/src/core/core.module.ts | 9 +- .../core/editor/delete/delete.resolver.ts | 4 +- .../src}/core/editor/delete/delete.service.ts | 6 +- .../core/editor/delete/dto/delete.args.ts | 0 .../backend/src}/core/editor/editor.module.ts | 0 .../core/editor/upload/dto/upload.args.ts | 3 +- .../core/editor/upload/upload.resolver.ts | 3 +- .../src}/core/editor/upload/upload.service.ts | 8 +- .../files/download/download.controller.ts | 6 +- .../backend/src}/core/files/files.cron.ts | 8 +- .../backend/src}/core/files/files.module.ts | 7 +- .../files/helpers/delete/delete.service.ts | 7 +- .../files/helpers/delete/dto/delete.args.ts | 0 .../files/helpers/upload/dto/upload.args.ts | 3 +- .../files/helpers/upload/dto/upload.obj.ts | 0 .../src}/core/files/helpers/upload/helpers.ts | 3 +- .../files/helpers/upload/upload.service.ts | 9 +- .../src}/core/files/show/dto/show.args.ts | 3 +- .../src}/core/files/show/dto/show.obj.ts | 2 +- .../src}/core/files/show/show.resolver.ts | 4 +- .../src}/core/files/show/show.service.ts | 17 ++- .../src/core/languages/show/dto/show.args.ts | 1 + .../src/core/languages/show/dto/show.obj.ts | 1 + .../src/core/languages/show/show.service.ts | 1 + .../avatar/avatar-core_members.module.ts | 0 .../members/avatar/delete/delete.resolver.ts | 4 +- .../members/avatar/delete/delete.service.ts | 7 +- .../members/avatar/upload/dto/upload.args.ts | 3 +- .../members/avatar/upload/dto/upload.obj.ts | 2 +- .../members/avatar/upload/upload.resolver.ts | 4 +- .../members/avatar/upload/upload.service.ts | 10 +- .../core/members/delete/delete.resolver.ts | 3 +- .../core/members/delete/delete.service.ts | 11 +- .../core/members/delete/dto/delete.args.ts | 0 .../src}/core/members/members.module.ts | 0 .../src}/core/members/show/dto/show.args.ts | 3 +- .../src}/core/members/show/dto/show.obj.ts | 4 +- .../src}/core/members/show/show.resolver.ts | 3 +- .../src}/core/members/show/show.service.ts | 11 +- .../core/members/sign_up/dto/sign_up.args.ts | 5 +- .../core/members/sign_up/dto/sign_up.obj.ts | 2 +- .../functions/generate-avatar-color.ts | 0 .../core/members/sign_up/sign_up.resolver.ts | 3 +- .../core/members/sign_up/sign_up.service.ts | 9 +- .../src/core/plugins/show/show.service.ts | 1 + packages/backend/src/index.ts | 1 + pnpm-lock.yaml | 3 + 100 files changed, 320 insertions(+), 142 deletions(-) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/files/delete/delete.resolver.ts (90%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/files/delete/delete.service.ts (74%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/files/delete/dto/delete.args.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/files/download/download.controller.ts (87%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/files/files.module.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/files/show/dto/show.args.ts (60%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/files/show/dto/show.obj.ts (65%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/files/show/show.resolver.ts (91%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/files/show/show.service.ts (87%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/members/edit/dto/edit.args.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/members/edit/dto/edit.obj.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/members/edit/edit.resolver.ts (91%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/members/edit/edit.service.ts (85%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/members/members.module.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/members/show/dto/show.args.ts (97%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/members/show/dto/show.obj.ts (75%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/members/show/show.resolver.ts (91%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/members/show/show.service.ts (86%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/members/stats/dto/stats.obj.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/members/stats/stats.resolver.ts (91%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/members/stats/stats.service.ts (92%) create mode 100644 packages/backend/src/core/config.ts rename {apps/backend/src/plugins => packages/backend/src}/core/editor/delete/delete.resolver.ts (85%) rename {apps/backend/src/plugins => packages/backend/src}/core/editor/delete/delete.service.ts (87%) rename {apps/backend/src/plugins => packages/backend/src}/core/editor/delete/dto/delete.args.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/editor/editor.module.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/editor/upload/dto/upload.args.ts (77%) rename {apps/backend/src/plugins => packages/backend/src}/core/editor/upload/upload.resolver.ts (85%) rename {apps/backend/src/plugins => packages/backend/src}/core/editor/upload/upload.service.ts (93%) rename {apps/backend/src/plugins => packages/backend/src}/core/files/download/download.controller.ts (88%) rename {apps/backend/src/plugins => packages/backend/src}/core/files/files.cron.ts (89%) rename {apps/backend/src/plugins => packages/backend/src}/core/files/files.module.ts (80%) rename {apps/backend/src/plugins => packages/backend/src}/core/files/helpers/delete/delete.service.ts (85%) rename {apps/backend/src/plugins => packages/backend/src}/core/files/helpers/delete/dto/delete.args.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/files/helpers/upload/dto/upload.args.ts (84%) rename {apps/backend/src/plugins => packages/backend/src}/core/files/helpers/upload/dto/upload.obj.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/files/helpers/upload/helpers.ts (93%) rename {apps/backend/src/plugins => packages/backend/src}/core/files/helpers/upload/upload.service.ts (92%) rename {apps/backend/src/plugins => packages/backend/src}/core/files/show/dto/show.args.ts (90%) rename {apps/backend/src/plugins => packages/backend/src}/core/files/show/dto/show.obj.ts (93%) rename {apps/backend/src/plugins => packages/backend/src}/core/files/show/show.resolver.ts (85%) rename {apps/backend/src/plugins => packages/backend/src}/core/files/show/show.service.ts (85%) rename {apps/backend/src/plugins => packages/backend/src}/core/members/avatar/avatar-core_members.module.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/members/avatar/delete/delete.resolver.ts (82%) rename {apps/backend/src/plugins => packages/backend/src}/core/members/avatar/delete/delete.service.ts (74%) rename {apps/backend/src/plugins => packages/backend/src}/core/members/avatar/upload/dto/upload.args.ts (68%) rename {apps/backend/src/plugins => packages/backend/src}/core/members/avatar/upload/dto/upload.obj.ts (66%) rename {apps/backend/src/plugins => packages/backend/src}/core/members/avatar/upload/upload.resolver.ts (87%) rename {apps/backend/src/plugins => packages/backend/src}/core/members/avatar/upload/upload.service.ts (82%) rename {apps/backend/src/plugins => packages/backend/src}/core/members/delete/delete.resolver.ts (91%) rename {apps/backend/src/plugins => packages/backend/src}/core/members/delete/delete.service.ts (78%) rename {apps/backend/src/plugins => packages/backend/src}/core/members/delete/dto/delete.args.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/members/members.module.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/members/show/dto/show.args.ts (97%) rename {apps/backend/src/plugins => packages/backend/src}/core/members/show/dto/show.obj.ts (81%) rename {apps/backend/src/plugins => packages/backend/src}/core/members/show/show.resolver.ts (91%) rename {apps/backend/src/plugins => packages/backend/src}/core/members/show/show.service.ts (87%) rename {apps/backend/src/plugins => packages/backend/src}/core/members/sign_up/dto/sign_up.args.ts (86%) rename {apps/backend/src/plugins => packages/backend/src}/core/members/sign_up/dto/sign_up.obj.ts (91%) rename {apps/backend/src/plugins => packages/backend/src}/core/members/sign_up/functions/generate-avatar-color.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/members/sign_up/sign_up.resolver.ts (93%) rename {apps/backend/src/plugins => packages/backend/src}/core/members/sign_up/sign_up.service.ts (89%) diff --git a/apps/backend/src/plugins/core/admin/admin.module.ts b/apps/backend/src/plugins/core/admin/admin.module.ts index 9182e3ac5..f32d83e3c 100644 --- a/apps/backend/src/plugins/core/admin/admin.module.ts +++ b/apps/backend/src/plugins/core/admin/admin.module.ts @@ -3,9 +3,7 @@ import { Module } from "@nestjs/common"; import { AdminInstallModule } from "./install/install.module"; import { AdminSettingsModule } from "./settings/settings.module"; import { AdminMetadataModule } from "./metadata/metadata.module"; -import { AdminFilesModule } from "./files/files.module"; import { AdminGroupsModule } from "./groups/groups.module"; -import { AdminMembersModule } from "./members/members.module"; import { AdminThemeEditorModule } from "./theme_editor/theme_editor.module"; import { AdminEmailModule } from "./email/email.module"; @@ -14,9 +12,7 @@ import { AdminEmailModule } from "./email/email.module"; AdminInstallModule, AdminSettingsModule, AdminMetadataModule, - AdminFilesModule, AdminGroupsModule, - AdminMembersModule, AdminThemeEditorModule, AdminEmailModule ] diff --git a/apps/backend/src/plugins/core/core.module.ts b/apps/backend/src/plugins/core/core.module.ts index 4b050a370..0530d8cb4 100644 --- a/apps/backend/src/plugins/core/core.module.ts +++ b/apps/backend/src/plugins/core/core.module.ts @@ -2,10 +2,7 @@ import { Module } from "@nestjs/common"; import { AdminModule } from "./admin/admin.module"; import { CoreSettingsModule } from "./settings/settings.module"; -import { CoreFilesModule, GlobalCoreFilesModule } from "./files/files.module"; -import { CoreEditorModule } from "./editor/editor.module"; import { GlobalCoreHelpersModule } from "./helpers/helpers.module"; -import { CoreMembersModule } from "./members/members.module"; import { CoreMiddlewareModule } from "./middleware/middleware.module"; import { CoreThemeEditorModule } from "./theme_editor/theme_editor.module"; @@ -13,11 +10,7 @@ import { CoreThemeEditorModule } from "./theme_editor/theme_editor.module"; imports: [ AdminModule, CoreSettingsModule, - GlobalCoreFilesModule, - CoreFilesModule, - CoreEditorModule, GlobalCoreHelpersModule, - CoreMembersModule, CoreMiddlewareModule, CoreThemeEditorModule ], diff --git a/packages/backend/package.json b/packages/backend/package.json index d3f4c2b9a..34661f0ae 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -51,6 +51,7 @@ "express": "^4.19.2", "graphql": "^16.8.2", "pg": "^8.12.0", + "sharp": "^0.33.4", "tar": "^7.4.0", "ua-parser-js": "2.0.0-beta.3" } diff --git a/packages/backend/src/core/admin/admin.module.ts b/packages/backend/src/core/admin/admin.module.ts index 862590b6a..a53169378 100644 --- a/packages/backend/src/core/admin/admin.module.ts +++ b/packages/backend/src/core/admin/admin.module.ts @@ -8,6 +8,8 @@ import { AdminPluginsModule } from "./plugins/plugins.module"; import { AdminNavModule } from "./nav/nav.module"; import { AdminStaffModule } from "./staff/staff.module"; import { AdminLanguagesModule } from "./languages/languages.module"; +import { AdminFilesModule } from "./files/files.module"; +import { AdminMembersModule } from "./members/members.module"; @Module({ imports: [ @@ -16,7 +18,9 @@ import { AdminLanguagesModule } from "./languages/languages.module"; AdminPluginsModule, AdminNavModule, AdminStaffModule, - AdminLanguagesModule + AdminLanguagesModule, + AdminFilesModule, + AdminMembersModule ] }) export class AdminModule {} diff --git a/apps/backend/src/plugins/core/admin/files/delete/delete.resolver.ts b/packages/backend/src/core/admin/files/delete/delete.resolver.ts similarity index 90% rename from apps/backend/src/plugins/core/admin/files/delete/delete.resolver.ts rename to packages/backend/src/core/admin/files/delete/delete.resolver.ts index 1e817d43e..aa4b333c4 100644 --- a/apps/backend/src/plugins/core/admin/files/delete/delete.resolver.ts +++ b/packages/backend/src/core/admin/files/delete/delete.resolver.ts @@ -1,10 +1,11 @@ import { UseGuards } from "@nestjs/common"; import { Args, Mutation, Resolver } from "@nestjs/graphql"; -import { AdminAuthGuards } from "vitnode-backend"; import { DeleteAdminFilesService } from "./delete.service"; import { DeleteAdminFilesArgs } from "./dto/delete.args"; +import { AdminAuthGuards } from "../../../../utils"; + @Resolver() export class DeleteAdminFilesResolver { constructor(private readonly service: DeleteAdminFilesService) {} diff --git a/apps/backend/src/plugins/core/admin/files/delete/delete.service.ts b/packages/backend/src/core/admin/files/delete/delete.service.ts similarity index 74% rename from apps/backend/src/plugins/core/admin/files/delete/delete.service.ts rename to packages/backend/src/core/admin/files/delete/delete.service.ts index 0f4de891d..f54caeb8c 100644 --- a/apps/backend/src/plugins/core/admin/files/delete/delete.service.ts +++ b/packages/backend/src/core/admin/files/delete/delete.service.ts @@ -1,11 +1,12 @@ import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; -import { NotFoundError, DatabaseService } from "vitnode-backend"; import { DeleteAdminFilesArgs } from "./dto/delete.args"; -import { core_files } from "../../database/schema/files"; -import { DeleteCoreFilesService } from "@/plugins/core/files/helpers/delete/delete.service"; +import { DatabaseService } from "../../../../database"; +import { DeleteCoreFilesService } from "../../../files/helpers/delete/delete.service"; +import { NotFoundError } from "../../../../errors"; +import { core_files } from "../../../../templates/core/admin/database/schema/files"; @Injectable() export class DeleteAdminFilesService { diff --git a/apps/backend/src/plugins/core/admin/files/delete/dto/delete.args.ts b/packages/backend/src/core/admin/files/delete/dto/delete.args.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/files/delete/dto/delete.args.ts rename to packages/backend/src/core/admin/files/delete/dto/delete.args.ts diff --git a/apps/backend/src/plugins/core/admin/files/download/download.controller.ts b/packages/backend/src/core/admin/files/download/download.controller.ts similarity index 87% rename from apps/backend/src/plugins/core/admin/files/download/download.controller.ts rename to packages/backend/src/core/admin/files/download/download.controller.ts index 165558a53..cebcb9781 100644 --- a/apps/backend/src/plugins/core/admin/files/download/download.controller.ts +++ b/packages/backend/src/core/admin/files/download/download.controller.ts @@ -10,13 +10,11 @@ import { StreamableFile } from "@nestjs/common"; import { Request, Response } from "express"; -import { - AuthorizationAdminSessionsService, - DatabaseService, - InternalAuthorizationCoreSessionsService -} from "vitnode-backend"; -import { ABSOLUTE_PATHS } from "@/config"; +import { InternalAuthorizationCoreSessionsService } from "../../../sessions/authorization/internal/internal_authorization.service"; +import { AuthorizationAdminSessionsService } from "../../sessions/authorization/authorization.service"; +import { DatabaseService } from "../../../../database"; +import { ABSOLUTE_PATHS } from "../../../config"; @Controller("files") export class DownloadFilesAdminController { diff --git a/apps/backend/src/plugins/core/admin/files/files.module.ts b/packages/backend/src/core/admin/files/files.module.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/files/files.module.ts rename to packages/backend/src/core/admin/files/files.module.ts diff --git a/apps/backend/src/plugins/core/admin/files/show/dto/show.args.ts b/packages/backend/src/core/admin/files/show/dto/show.args.ts similarity index 60% rename from apps/backend/src/plugins/core/admin/files/show/dto/show.args.ts rename to packages/backend/src/core/admin/files/show/dto/show.args.ts index e51828d54..0360e6735 100644 --- a/apps/backend/src/plugins/core/admin/files/show/dto/show.args.ts +++ b/packages/backend/src/core/admin/files/show/dto/show.args.ts @@ -1,6 +1,6 @@ import { ArgsType } from "@nestjs/graphql"; -import { ShowCoreFilesArgs } from "@/plugins/core/files/show/dto/show.args"; +import { ShowCoreFilesArgs } from "../../../../files/show/dto/show.args"; @ArgsType() export class ShowAdminFilesArgs extends ShowCoreFilesArgs {} diff --git a/apps/backend/src/plugins/core/admin/files/show/dto/show.obj.ts b/packages/backend/src/core/admin/files/show/dto/show.obj.ts similarity index 65% rename from apps/backend/src/plugins/core/admin/files/show/dto/show.obj.ts rename to packages/backend/src/core/admin/files/show/dto/show.obj.ts index 99b02d8b1..782e5325e 100644 --- a/apps/backend/src/plugins/core/admin/files/show/dto/show.obj.ts +++ b/packages/backend/src/core/admin/files/show/dto/show.obj.ts @@ -1,7 +1,8 @@ import { Field, ObjectType } from "@nestjs/graphql"; -import { PageInfo, User } from "vitnode-backend"; -import { ShowCoreFiles } from "@/plugins/core/files/show/dto/show.obj"; +import { ShowCoreFiles } from "../../../../files/show/dto/show.obj"; +import { User } from "../../../../../decorators"; +import { PageInfo } from "../../../../../utils"; @ObjectType() export class ShowAdminFiles extends ShowCoreFiles { diff --git a/apps/backend/src/plugins/core/admin/files/show/show.resolver.ts b/packages/backend/src/core/admin/files/show/show.resolver.ts similarity index 91% rename from apps/backend/src/plugins/core/admin/files/show/show.resolver.ts rename to packages/backend/src/core/admin/files/show/show.resolver.ts index ac94518bb..db0378cfd 100644 --- a/apps/backend/src/plugins/core/admin/files/show/show.resolver.ts +++ b/packages/backend/src/core/admin/files/show/show.resolver.ts @@ -1,11 +1,12 @@ import { UseGuards } from "@nestjs/common"; import { Args, Query, Resolver } from "@nestjs/graphql"; -import { AdminAuthGuards } from "vitnode-backend"; import { ShowAdminFilesService } from "./show.service"; import { ShowAdminFilesObj } from "./dto/show.obj"; import { ShowAdminFilesArgs } from "./dto/show.args"; +import { AdminAuthGuards } from "../../../../utils"; + @Resolver() export class ShowAdminFilesResolver { constructor(private readonly service: ShowAdminFilesService) {} diff --git a/apps/backend/src/plugins/core/admin/files/show/show.service.ts b/packages/backend/src/core/admin/files/show/show.service.ts similarity index 87% rename from apps/backend/src/plugins/core/admin/files/show/show.service.ts rename to packages/backend/src/core/admin/files/show/show.service.ts index f19ac63ec..ed5936e17 100644 --- a/apps/backend/src/plugins/core/admin/files/show/show.service.ts +++ b/packages/backend/src/core/admin/files/show/show.service.ts @@ -1,16 +1,16 @@ import { Injectable } from "@nestjs/common"; import { and, count, eq, ilike, or } from "drizzle-orm"; -import { - inputPaginationCursor, - outputPagination, - SortDirectionEnum, - DatabaseService -} from "vitnode-backend"; import { ShowAdminFilesArgs } from "./dto/show.args"; import { ShowAdminFilesObj } from "./dto/show.obj"; -import { core_files, core_files_using } from "../../database/schema/files"; +import { DatabaseService } from "../../../../database"; +import { inputPaginationCursor, outputPagination } from "../../../../functions"; +import { + core_files, + core_files_using +} from "../../../../templates/core/admin/database/schema/files"; +import { SortDirectionEnum } from "../../../../utils"; @Injectable() export class ShowAdminFilesService { diff --git a/packages/backend/src/core/admin/languages/create/create.resolver.ts b/packages/backend/src/core/admin/languages/create/create.resolver.ts index d1a771467..4e29baf02 100644 --- a/packages/backend/src/core/admin/languages/create/create.resolver.ts +++ b/packages/backend/src/core/admin/languages/create/create.resolver.ts @@ -3,6 +3,7 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { CreateAdminCoreLanguageService } from "./create.service"; import { CreateCoreAdminLanguagesArgs } from "./dto/create.args"; + import { ShowCoreLanguages } from "../../../languages/show/dto/show.obj"; import { AdminAuthGuards } from "../../../../utils"; diff --git a/packages/backend/src/core/admin/languages/create/create.service.ts b/packages/backend/src/core/admin/languages/create/create.service.ts index 933abedd3..6d6a20027 100644 --- a/packages/backend/src/core/admin/languages/create/create.service.ts +++ b/packages/backend/src/core/admin/languages/create/create.service.ts @@ -4,6 +4,7 @@ import { join } from "path"; import { Injectable } from "@nestjs/common"; import { CreateCoreAdminLanguagesArgs } from "./dto/create.args"; + import { DatabaseService } from "../../../../database"; import { ABSOLUTE_PATHS_BACKEND, CustomError } from "../../../.."; import { core_languages } from "../../../../templates/core/admin/database/schema/languages"; diff --git a/packages/backend/src/core/admin/languages/create/dto/create.args.ts b/packages/backend/src/core/admin/languages/create/dto/create.args.ts index 6e034b162..4ce4ac8f0 100644 --- a/packages/backend/src/core/admin/languages/create/dto/create.args.ts +++ b/packages/backend/src/core/admin/languages/create/dto/create.args.ts @@ -1,6 +1,7 @@ import { ArgsType, Field } from "@nestjs/graphql"; import { Transform } from "class-transformer"; import { IsNotEmpty } from "class-validator"; + import { TransformString } from "../../../../../utils"; @ArgsType() diff --git a/packages/backend/src/core/admin/languages/delete/delete.resolver.ts b/packages/backend/src/core/admin/languages/delete/delete.resolver.ts index bf4bb2178..d2bd9b6b9 100644 --- a/packages/backend/src/core/admin/languages/delete/delete.resolver.ts +++ b/packages/backend/src/core/admin/languages/delete/delete.resolver.ts @@ -3,6 +3,7 @@ import { UseGuards } from "@nestjs/common"; import { DeleteAdminCoreLanguageService } from "./delete.service"; import { DeleteCoreAdminLanguagesArgs } from "./dto/delete.args"; + import { AdminAuthGuards } from "../../../../utils"; @Resolver() diff --git a/packages/backend/src/core/admin/languages/delete/delete.service.ts b/packages/backend/src/core/admin/languages/delete/delete.service.ts index e6513138d..26abd893f 100644 --- a/packages/backend/src/core/admin/languages/delete/delete.service.ts +++ b/packages/backend/src/core/admin/languages/delete/delete.service.ts @@ -4,8 +4,10 @@ import { unlinkSync } from "fs"; import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; -import { DatabaseService } from "../../../../database"; + import { DeleteCoreAdminLanguagesArgs } from "./dto/delete.args"; + +import { DatabaseService } from "../../../../database"; import { CustomError, NotFoundError } from "../../../../errors"; import { ABSOLUTE_PATHS_BACKEND } from "../../../.."; import { core_languages } from "../../../../templates/core/admin/database/schema/languages"; diff --git a/packages/backend/src/core/admin/languages/download/download.resolver.ts b/packages/backend/src/core/admin/languages/download/download.resolver.ts index 59bc9e575..a1c623ea6 100644 --- a/packages/backend/src/core/admin/languages/download/download.resolver.ts +++ b/packages/backend/src/core/admin/languages/download/download.resolver.ts @@ -3,6 +3,7 @@ import { UseGuards } from "@nestjs/common"; import { DownloadAdminCoreLanguageService } from "./download.service"; import { DownloadCoreAdminLanguagesArgs } from "./dto/download.args"; + import { AdminAuthGuards } from "../../../../utils"; import { CurrentUser, User } from "../../../../decorators"; diff --git a/packages/backend/src/core/admin/languages/download/download.service.ts b/packages/backend/src/core/admin/languages/download/download.service.ts index af6762a4e..64b949562 100644 --- a/packages/backend/src/core/admin/languages/download/download.service.ts +++ b/packages/backend/src/core/admin/languages/download/download.service.ts @@ -11,6 +11,7 @@ import { } from "@vitnode/shared"; import { DownloadCoreAdminLanguagesArgs } from "./dto/download.args"; + import { DatabaseService } from "../../../../database"; import { User } from "../../../../decorators"; import { CustomError, NotFoundError } from "../../../../errors"; diff --git a/packages/backend/src/core/admin/languages/edit/edit.resolver.ts b/packages/backend/src/core/admin/languages/edit/edit.resolver.ts index 827e5be46..23261a5ea 100644 --- a/packages/backend/src/core/admin/languages/edit/edit.resolver.ts +++ b/packages/backend/src/core/admin/languages/edit/edit.resolver.ts @@ -3,6 +3,7 @@ import { UseGuards } from "@nestjs/common"; import { EditAdminCoreLanguagesService } from "./edit.service"; import { EditCoreAdminLanguagesArgs } from "./dto/edit.args"; + import { ShowCoreLanguages } from "../../../languages/show/dto/show.obj"; import { AdminAuthGuards } from "../../../../utils"; diff --git a/packages/backend/src/core/admin/languages/edit/edit.service.ts b/packages/backend/src/core/admin/languages/edit/edit.service.ts index 13675d82e..abca47c3a 100644 --- a/packages/backend/src/core/admin/languages/edit/edit.service.ts +++ b/packages/backend/src/core/admin/languages/edit/edit.service.ts @@ -2,6 +2,7 @@ import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; import { EditCoreAdminLanguagesArgs } from "./dto/edit.args"; + import { DatabaseService } from "../../../../database"; import { ShowCoreLanguages } from "../../../languages/show/dto/show.obj"; import { NotFoundError } from "../../../../errors"; diff --git a/packages/backend/src/core/admin/languages/update/dto/update.args.ts b/packages/backend/src/core/admin/languages/update/dto/update.args.ts index 0469d205a..3cecd487f 100644 --- a/packages/backend/src/core/admin/languages/update/dto/update.args.ts +++ b/packages/backend/src/core/admin/languages/update/dto/update.args.ts @@ -1,4 +1,5 @@ import { ArgsType, Field } from "@nestjs/graphql"; + import { FileUpload, GraphQLUpload } from "../../../../../graphql-upload"; @ArgsType() diff --git a/packages/backend/src/core/admin/languages/update/update.resolver.ts b/packages/backend/src/core/admin/languages/update/update.resolver.ts index ac1f0569a..60bf42312 100644 --- a/packages/backend/src/core/admin/languages/update/update.resolver.ts +++ b/packages/backend/src/core/admin/languages/update/update.resolver.ts @@ -3,6 +3,7 @@ import { UseGuards } from "@nestjs/common"; import { UpdateAdminCoreLanguageService } from "./update.service"; import { UpdateCoreAdminLanguagesArgs } from "./dto/update.args"; + import { AdminAuthGuards } from "../../../../utils"; @Resolver() diff --git a/packages/backend/src/core/admin/languages/update/update.service.ts b/packages/backend/src/core/admin/languages/update/update.service.ts index 46b085900..aa5555d7c 100644 --- a/packages/backend/src/core/admin/languages/update/update.service.ts +++ b/packages/backend/src/core/admin/languages/update/update.service.ts @@ -7,6 +7,7 @@ import { eq } from "drizzle-orm"; import { currentUnixDate, generateRandomString } from "@vitnode/shared"; import { UpdateCoreAdminLanguagesArgs } from "./dto/update.args"; + import { DatabaseService } from "../../../../database"; import { NotFoundError } from "../../../../errors"; import { ABSOLUTE_PATHS_BACKEND } from "../../../.."; diff --git a/apps/backend/src/plugins/core/admin/members/edit/dto/edit.args.ts b/packages/backend/src/core/admin/members/edit/dto/edit.args.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/members/edit/dto/edit.args.ts rename to packages/backend/src/core/admin/members/edit/dto/edit.args.ts diff --git a/apps/backend/src/plugins/core/admin/members/edit/dto/edit.obj.ts b/packages/backend/src/core/admin/members/edit/dto/edit.obj.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/members/edit/dto/edit.obj.ts rename to packages/backend/src/core/admin/members/edit/dto/edit.obj.ts diff --git a/apps/backend/src/plugins/core/admin/members/edit/edit.resolver.ts b/packages/backend/src/core/admin/members/edit/edit.resolver.ts similarity index 91% rename from apps/backend/src/plugins/core/admin/members/edit/edit.resolver.ts rename to packages/backend/src/core/admin/members/edit/edit.resolver.ts index 648dd2e1c..f633957bd 100644 --- a/apps/backend/src/plugins/core/admin/members/edit/edit.resolver.ts +++ b/packages/backend/src/core/admin/members/edit/edit.resolver.ts @@ -1,11 +1,12 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards } from "vitnode-backend"; import { EditAdminMembersService } from "./edit.service"; import { EditAdminMembersArgs } from "./dto/edit.args"; import { EditAdminMembersObj } from "./dto/edit.obj"; +import { AdminAuthGuards } from "../../../../utils"; + @Resolver() export class EditAdminMembersResolver { constructor(private readonly service: EditAdminMembersService) {} diff --git a/apps/backend/src/plugins/core/admin/members/edit/edit.service.ts b/packages/backend/src/core/admin/members/edit/edit.service.ts similarity index 85% rename from apps/backend/src/plugins/core/admin/members/edit/edit.service.ts rename to packages/backend/src/core/admin/members/edit/edit.service.ts index 598cdfd29..18df4bc36 100644 --- a/apps/backend/src/plugins/core/admin/members/edit/edit.service.ts +++ b/packages/backend/src/core/admin/members/edit/edit.service.ts @@ -1,15 +1,12 @@ import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; -import { - NotFoundError, - AccessDeniedError, - DatabaseService -} from "vitnode-backend"; import { EditAdminMembersArgs } from "./dto/edit.args"; import { EditAdminMembersObj } from "./dto/edit.obj"; -import { core_users } from "@/plugins/core/admin/database/schema/users"; +import { DatabaseService } from "../../../../database"; +import { core_users } from "../../../../templates/core/admin/database/schema/users"; +import { AccessDeniedError, NotFoundError } from "../../../../errors"; @Injectable() export class EditAdminMembersService { diff --git a/apps/backend/src/plugins/core/admin/members/members.module.ts b/packages/backend/src/core/admin/members/members.module.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/members/members.module.ts rename to packages/backend/src/core/admin/members/members.module.ts diff --git a/apps/backend/src/plugins/core/admin/members/show/dto/show.args.ts b/packages/backend/src/core/admin/members/show/dto/show.args.ts similarity index 97% rename from apps/backend/src/plugins/core/admin/members/show/dto/show.args.ts rename to packages/backend/src/core/admin/members/show/dto/show.args.ts index fc220e9a8..4a872361a 100644 --- a/apps/backend/src/plugins/core/admin/members/show/dto/show.args.ts +++ b/packages/backend/src/core/admin/members/show/dto/show.args.ts @@ -6,11 +6,12 @@ import { registerEnumType } from "@nestjs/graphql"; import { Transform } from "class-transformer"; + import { PaginationArgs, SortDirectionEnum, TransformString -} from "vitnode-backend"; +} from "../../../../../utils"; export enum ShowAdminMembersSortingColumnEnum { name = "name", diff --git a/apps/backend/src/plugins/core/admin/members/show/dto/show.obj.ts b/packages/backend/src/core/admin/members/show/dto/show.obj.ts similarity index 75% rename from apps/backend/src/plugins/core/admin/members/show/dto/show.obj.ts rename to packages/backend/src/core/admin/members/show/dto/show.obj.ts index d69698c54..f6a8f563a 100644 --- a/apps/backend/src/plugins/core/admin/members/show/dto/show.obj.ts +++ b/packages/backend/src/core/admin/members/show/dto/show.obj.ts @@ -1,16 +1,7 @@ import { Field, ObjectType } from "@nestjs/graphql"; -import { PageInfo } from "vitnode-backend"; -import { ShowCoreMembers } from "@/plugins/core/members/show/dto/show.obj"; - -@ObjectType() -export class ShowAdminMembersObj { - @Field(() => [ShowAdminMembers]) - edges: ShowAdminMembers[]; - - @Field(() => PageInfo) - pageInfo: PageInfo; -} +import { PageInfo } from "../../../../../utils"; +import { ShowCoreMembers } from "../../../../members/show/dto/show.obj"; @ObjectType() export class ShowAdminMembers extends ShowCoreMembers { @@ -20,3 +11,12 @@ export class ShowAdminMembers extends ShowCoreMembers { @Field(() => Boolean) newsletter: boolean; } + +@ObjectType() +export class ShowAdminMembersObj { + @Field(() => [ShowAdminMembers]) + edges: ShowAdminMembers[]; + + @Field(() => PageInfo) + pageInfo: PageInfo; +} diff --git a/apps/backend/src/plugins/core/admin/members/show/show.resolver.ts b/packages/backend/src/core/admin/members/show/show.resolver.ts similarity index 91% rename from apps/backend/src/plugins/core/admin/members/show/show.resolver.ts rename to packages/backend/src/core/admin/members/show/show.resolver.ts index b949715b1..67e6001f1 100644 --- a/apps/backend/src/plugins/core/admin/members/show/show.resolver.ts +++ b/packages/backend/src/core/admin/members/show/show.resolver.ts @@ -1,11 +1,12 @@ import { Args, Query, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards } from "vitnode-backend"; import { ShowAdminMembersService } from "./show.service"; import { ShowAdminMembersObj } from "./dto/show.obj"; import { ShowAdminMembersArgs } from "./dto/show.args"; +import { AdminAuthGuards } from "../../../../utils"; + @Resolver() export class ShowAdminMembersResolver { constructor(private readonly service: ShowAdminMembersService) {} diff --git a/apps/backend/src/plugins/core/admin/members/show/show.service.ts b/packages/backend/src/core/admin/members/show/show.service.ts similarity index 86% rename from apps/backend/src/plugins/core/admin/members/show/show.service.ts rename to packages/backend/src/core/admin/members/show/show.service.ts index 6ebb0482c..09b53d2b1 100644 --- a/apps/backend/src/plugins/core/admin/members/show/show.service.ts +++ b/packages/backend/src/core/admin/members/show/show.service.ts @@ -1,16 +1,13 @@ import { Injectable } from "@nestjs/common"; import { and, count, eq, ilike, inArray, or } from "drizzle-orm"; -import { - inputPaginationCursor, - outputPagination, - SortDirectionEnum, - DatabaseService -} from "vitnode-backend"; import { ShowAdminMembersObj } from "./dto/show.obj"; import { ShowAdminMembersArgs } from "./dto/show.args"; -import { core_users } from "@/plugins/core/admin/database/schema/users"; +import { inputPaginationCursor, outputPagination } from "../../../../functions"; +import { DatabaseService } from "../../../../database"; +import { core_users } from "../../../../templates/core/admin/database/schema/users"; +import { SortDirectionEnum } from "../../../../utils"; @Injectable() export class ShowAdminMembersService { diff --git a/apps/backend/src/plugins/core/admin/members/stats/dto/stats.obj.ts b/packages/backend/src/core/admin/members/stats/dto/stats.obj.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/members/stats/dto/stats.obj.ts rename to packages/backend/src/core/admin/members/stats/dto/stats.obj.ts diff --git a/apps/backend/src/plugins/core/admin/members/stats/stats.resolver.ts b/packages/backend/src/core/admin/members/stats/stats.resolver.ts similarity index 91% rename from apps/backend/src/plugins/core/admin/members/stats/stats.resolver.ts rename to packages/backend/src/core/admin/members/stats/stats.resolver.ts index 5c5453a0f..9d79ef268 100644 --- a/apps/backend/src/plugins/core/admin/members/stats/stats.resolver.ts +++ b/packages/backend/src/core/admin/members/stats/stats.resolver.ts @@ -1,10 +1,11 @@ import { Query, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards } from "vitnode-backend"; import { StatsAdminMembersService } from "./stats.service"; import { SignUpStatsAdminMembers } from "./dto/stats.obj"; +import { AdminAuthGuards } from "../../../../utils"; + @Resolver() export class StatsAdminMembersResolver { constructor(private readonly service: StatsAdminMembersService) {} diff --git a/apps/backend/src/plugins/core/admin/members/stats/stats.service.ts b/packages/backend/src/core/admin/members/stats/stats.service.ts similarity index 92% rename from apps/backend/src/plugins/core/admin/members/stats/stats.service.ts rename to packages/backend/src/core/admin/members/stats/stats.service.ts index a06b9fb18..a07d4982e 100644 --- a/apps/backend/src/plugins/core/admin/members/stats/stats.service.ts +++ b/packages/backend/src/core/admin/members/stats/stats.service.ts @@ -1,9 +1,10 @@ import { Injectable } from "@nestjs/common"; import { sql } from "drizzle-orm"; -import { DatabaseService } from "vitnode-backend"; import { SignUpStatsAdminMembers } from "./dto/stats.obj"; +import { DatabaseService } from "../../../../database"; + @Injectable() export class StatsAdminMembersService { constructor(private readonly databaseService: DatabaseService) {} diff --git a/packages/backend/src/core/admin/staff/administrators/create/create.resolver.ts b/packages/backend/src/core/admin/staff/administrators/create/create.resolver.ts index c3646e6c5..b447e2f59 100644 --- a/packages/backend/src/core/admin/staff/administrators/create/create.resolver.ts +++ b/packages/backend/src/core/admin/staff/administrators/create/create.resolver.ts @@ -4,6 +4,7 @@ import { UseGuards } from "@nestjs/common"; import { CreateAdminStaffAdministratorsService } from "./create.service"; import { CreateAdminStaffAdministratorsArgs } from "./dto/create.args"; import { ShowAdminStaffAdministrators } from "../show/dto/show.obj"; + import { AdminAuthGuards } from "../../../../../utils"; @Resolver() diff --git a/packages/backend/src/core/admin/staff/administrators/create/create.service.ts b/packages/backend/src/core/admin/staff/administrators/create/create.service.ts index 6da65bd9a..425c19939 100644 --- a/packages/backend/src/core/admin/staff/administrators/create/create.service.ts +++ b/packages/backend/src/core/admin/staff/administrators/create/create.service.ts @@ -2,6 +2,7 @@ import { Injectable } from "@nestjs/common"; import { ShowAdminStaffAdministrators } from "../show/dto/show.obj"; import { CreateAdminStaffAdministratorsArgs } from "./dto/create.args"; + import { CustomError } from "../../../../../errors"; import { DatabaseService } from "../../../../../database"; import { core_admin_permissions } from "../../../../../templates/core/admin/database/schema/admins"; diff --git a/packages/backend/src/core/admin/staff/administrators/delete/delete.resolver.ts b/packages/backend/src/core/admin/staff/administrators/delete/delete.resolver.ts index 21093d57c..4b41b4d71 100644 --- a/packages/backend/src/core/admin/staff/administrators/delete/delete.resolver.ts +++ b/packages/backend/src/core/admin/staff/administrators/delete/delete.resolver.ts @@ -3,6 +3,7 @@ import { UseGuards } from "@nestjs/common"; import { DeleteAdminStaffAdministratorsService } from "./delete.service"; import { DeleteAdminStaffAdministratorsArgs } from "./dto/delete.args"; + import { AdminAuthGuards } from "../../../../../utils"; @Resolver() diff --git a/packages/backend/src/core/admin/staff/administrators/delete/delete.service.ts b/packages/backend/src/core/admin/staff/administrators/delete/delete.service.ts index 8b06ff06c..2d02558a9 100644 --- a/packages/backend/src/core/admin/staff/administrators/delete/delete.service.ts +++ b/packages/backend/src/core/admin/staff/administrators/delete/delete.service.ts @@ -2,6 +2,7 @@ import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; import { DeleteAdminStaffAdministratorsArgs } from "./dto/delete.args"; + import { DatabaseService } from "../../../../../database"; import { CustomError, NotFoundError } from "../../../../../errors"; import { core_admin_permissions } from "../../../../../templates/core/admin/database/schema/admins"; diff --git a/packages/backend/src/core/admin/staff/administrators/show/dto/show.args.ts b/packages/backend/src/core/admin/staff/administrators/show/dto/show.args.ts index 5c7ca6591..6d6645444 100644 --- a/packages/backend/src/core/admin/staff/administrators/show/dto/show.args.ts +++ b/packages/backend/src/core/admin/staff/administrators/show/dto/show.args.ts @@ -1,4 +1,5 @@ import { ArgsType, Field, InputType, registerEnumType } from "@nestjs/graphql"; + import { PaginationArgs, SortDirectionEnum } from "../../../../../../utils"; enum ShowAdminStaffAdministratorsSortingColumnEnum { diff --git a/packages/backend/src/core/admin/staff/administrators/show/dto/show.obj.ts b/packages/backend/src/core/admin/staff/administrators/show/dto/show.obj.ts index c5b0aa590..7ed1b69d2 100644 --- a/packages/backend/src/core/admin/staff/administrators/show/dto/show.obj.ts +++ b/packages/backend/src/core/admin/staff/administrators/show/dto/show.obj.ts @@ -5,6 +5,7 @@ import { OmitType, createUnionType } from "@nestjs/graphql"; + import { GroupUser, User } from "../../../../../../decorators"; import { PageInfo, TextLanguage } from "../../../../../../utils"; diff --git a/packages/backend/src/core/admin/staff/administrators/show/show.resolver.ts b/packages/backend/src/core/admin/staff/administrators/show/show.resolver.ts index 61acc9602..b3ce7bd1a 100644 --- a/packages/backend/src/core/admin/staff/administrators/show/show.resolver.ts +++ b/packages/backend/src/core/admin/staff/administrators/show/show.resolver.ts @@ -4,6 +4,7 @@ import { UseGuards } from "@nestjs/common"; import { ShowAdminStaffAdministratorsService } from "./show.service"; import { ShowAdminStaffAdministratorsObj } from "./dto/show.obj"; import { ShowAdminStaffAdministratorsArgs } from "./dto/show.args"; + import { AdminAuthGuards } from "../../../../../utils"; @Resolver() diff --git a/packages/backend/src/core/admin/staff/administrators/show/show.service.ts b/packages/backend/src/core/admin/staff/administrators/show/show.service.ts index b5bc40047..12808321d 100644 --- a/packages/backend/src/core/admin/staff/administrators/show/show.service.ts +++ b/packages/backend/src/core/admin/staff/administrators/show/show.service.ts @@ -3,6 +3,7 @@ import { count } from "drizzle-orm"; import { ShowAdminStaffAdministratorsArgs } from "./dto/show.args"; import { ShowAdminStaffAdministratorsObj } from "./dto/show.obj"; + import { DatabaseService } from "../../../../../database"; import { inputPaginationCursor, diff --git a/packages/backend/src/core/admin/staff/moderators/create/create.resolver.ts b/packages/backend/src/core/admin/staff/moderators/create/create.resolver.ts index 8c4c14d60..8a6b261b1 100644 --- a/packages/backend/src/core/admin/staff/moderators/create/create.resolver.ts +++ b/packages/backend/src/core/admin/staff/moderators/create/create.resolver.ts @@ -4,6 +4,7 @@ import { UseGuards } from "@nestjs/common"; import { CreateAdminStaffModeratorsService } from "./create.service"; import { CreateAdminStaffModeratorsArgs } from "./dto/create.args"; import { ShowAdminStaffModerators } from "../show/dto/show.obj"; + import { AdminAuthGuards } from "../../../../../utils"; @Resolver() diff --git a/packages/backend/src/core/admin/staff/moderators/create/create.service.ts b/packages/backend/src/core/admin/staff/moderators/create/create.service.ts index d03c33785..9c5c501aa 100644 --- a/packages/backend/src/core/admin/staff/moderators/create/create.service.ts +++ b/packages/backend/src/core/admin/staff/moderators/create/create.service.ts @@ -2,6 +2,7 @@ import { Injectable } from "@nestjs/common"; import { ShowAdminStaffModerators } from "../show/dto/show.obj"; import { CreateAdminStaffModeratorsArgs } from "./dto/create.args"; + import { DatabaseService } from "../../../../../database"; import { CustomError } from "../../../../../errors"; import { core_moderators_permissions } from "../../../../../templates/core/admin/database/schema/moderators"; diff --git a/packages/backend/src/core/admin/staff/moderators/delete/delete.resolver.ts b/packages/backend/src/core/admin/staff/moderators/delete/delete.resolver.ts index 18daa6025..b2d42c4b3 100644 --- a/packages/backend/src/core/admin/staff/moderators/delete/delete.resolver.ts +++ b/packages/backend/src/core/admin/staff/moderators/delete/delete.resolver.ts @@ -3,6 +3,7 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { DeleteAdminStaffModeratorsArgs } from "./dto/delete.args"; import { DeleteAdminStaffModeratorsService } from "./delete.service"; + import { AdminAuthGuards } from "../../../../../utils"; @Resolver() diff --git a/packages/backend/src/core/admin/staff/moderators/delete/delete.service.ts b/packages/backend/src/core/admin/staff/moderators/delete/delete.service.ts index 05a9b0bfa..901c74801 100644 --- a/packages/backend/src/core/admin/staff/moderators/delete/delete.service.ts +++ b/packages/backend/src/core/admin/staff/moderators/delete/delete.service.ts @@ -2,6 +2,7 @@ import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; import { DeleteAdminStaffModeratorsArgs } from "./dto/delete.args"; + import { DatabaseService } from "../../../../../database"; import { CustomError } from "../../../../../errors"; import { core_moderators_permissions } from "../../../../../templates/core/admin/database/schema/moderators"; diff --git a/packages/backend/src/core/admin/staff/moderators/show/dto/show.args.ts b/packages/backend/src/core/admin/staff/moderators/show/dto/show.args.ts index 5c0ce748a..a95b47980 100644 --- a/packages/backend/src/core/admin/staff/moderators/show/dto/show.args.ts +++ b/packages/backend/src/core/admin/staff/moderators/show/dto/show.args.ts @@ -1,4 +1,5 @@ import { ArgsType, Field, InputType, registerEnumType } from "@nestjs/graphql"; + import { PaginationArgs, SortDirectionEnum } from "../../../../../../utils"; enum ShowAdminStaffModeratorsSortingColumnEnum { diff --git a/packages/backend/src/core/admin/staff/moderators/show/show.resolver.ts b/packages/backend/src/core/admin/staff/moderators/show/show.resolver.ts index 45a558a56..fb2886caf 100644 --- a/packages/backend/src/core/admin/staff/moderators/show/show.resolver.ts +++ b/packages/backend/src/core/admin/staff/moderators/show/show.resolver.ts @@ -4,6 +4,7 @@ import { UseGuards } from "@nestjs/common"; import { ShowAdminStaffModeratorsService } from "./show.service"; import { ShowAdminStaffModeratorsObj } from "./dto/show.obj"; import { ShowAdminStaffModeratorsArgs } from "./dto/show.args"; + import { AdminAuthGuards } from "../../../../../utils"; @Resolver() diff --git a/packages/backend/src/core/admin/staff/moderators/show/show.service.ts b/packages/backend/src/core/admin/staff/moderators/show/show.service.ts index ddc190dcf..60b00c030 100644 --- a/packages/backend/src/core/admin/staff/moderators/show/show.service.ts +++ b/packages/backend/src/core/admin/staff/moderators/show/show.service.ts @@ -3,6 +3,7 @@ import { count } from "drizzle-orm"; import { ShowAdminStaffModeratorsArgs } from "./dto/show.args"; import { ShowAdminStaffModeratorsObj } from "./dto/show.obj"; + import { DatabaseService } from "../../../../../database"; import { inputPaginationCursor, diff --git a/packages/backend/src/core/config.ts b/packages/backend/src/core/config.ts new file mode 100644 index 000000000..4a1c1484e --- /dev/null +++ b/packages/backend/src/core/config.ts @@ -0,0 +1,119 @@ +import * as fs from "fs"; +import { join } from "path"; + +const internalPaths = { + uploads: join(process.cwd(), "uploads"), + frontend: join(process.cwd(), "..", "frontend"), + plugins: join(process.cwd(), "src", "plugins") +}; + +export const ABSOLUTE_PATHS = { + uploads: { + init: internalPaths.uploads, + public: join(internalPaths.uploads, "public"), + private: join(internalPaths.uploads, "private"), + temp: join(internalPaths.uploads, "temp") + }, + frontend: { + init: internalPaths.frontend + }, + backend: join(process.cwd(), "src"), + plugins: internalPaths.plugins, + plugin: ({ code }: { code: string }) => ({ + root: join(internalPaths.plugins, code), + config: join(internalPaths.plugins, code, "config.json"), + versions: join(internalPaths.plugins, code, "versions.json"), + database: { + schema: join(internalPaths.plugins, code, "admin", "database", "schema"), + migrations: join( + internalPaths.plugins, + code, + "admin", + "database", + "migrations" + ), + migration_info: join( + internalPaths.plugins, + code, + "admin", + "database", + "migrations", + "meta", + "_journal.json" + ) + }, + frontend: { + admin_pages: join( + internalPaths.frontend, + "app", + "[locale]", + "(admin)", + "admin", + "(auth)", + code + ), + admin_templates: join(internalPaths.frontend, "plugins", code, "admin"), + pages_container: join( + internalPaths.frontend, + "app", + "[locale]", + "(main)", + "(container)", + code + ), + default_page: join( + internalPaths.frontend, + "plugins", + code, + "templates", + "default-page.tsx" + ), + pages: join(internalPaths.frontend, "app", "[locale]", "(main)", code), + templates: join(internalPaths.frontend, "plugins", code, "templates"), + plugin: join(internalPaths.frontend, "plugins", code), + language: join(internalPaths.frontend, "plugins", code, "langs") + } + }) +}; + +export interface ConfigType { + editor: { + files: { + allow_type: "all" | "images_videos" | "images" | "none"; + }; + sticky: boolean; + }; + langs: { + code: string; + default: boolean; + enabled: boolean; + }[]; + rebuild_required: { + langs: boolean; + plugins: boolean; + }; + settings: { + email: { + color_primary: string; + color_primary_foreground: string; + }; + general: { + site_name: string; + site_short_name: string; + }; + }; +} + +export const configPath = join( + process.cwd(), + "..", + "frontend", + "config", + "config.json" +); + +export const getConfigFile = () => { + const file = fs.readFileSync(configPath, "utf-8"); + + return JSON.parse(file) as ConfigType; +}; diff --git a/packages/backend/src/core/core.module.ts b/packages/backend/src/core/core.module.ts index 25d4a48b3..3c4fbda5d 100644 --- a/packages/backend/src/core/core.module.ts +++ b/packages/backend/src/core/core.module.ts @@ -9,6 +9,9 @@ import { AdminModule } from "./admin/admin.module"; import { GlobalCoreHelpersModule } from "./helpers/helpers.module"; import { CorePluginsModule } from "./plugins/plugins.module"; import { CoreLanguagesModule } from "./languages/languages.module"; +import { CoreFilesModule, GlobalCoreFilesModule } from "./files/files.module"; +import { CoreEditorModule } from "./editor/editor.module"; +import { CoreMembersModule } from "./members/members.module"; @Module({ imports: [ @@ -18,7 +21,11 @@ import { CoreLanguagesModule } from "./languages/languages.module"; CoreSessionsModule, GlobalCoreHelpersModule, CorePluginsModule, - CoreLanguagesModule + CoreLanguagesModule, + GlobalCoreFilesModule, + CoreFilesModule, + CoreEditorModule, + CoreMembersModule ] }) export class CoreModule {} diff --git a/apps/backend/src/plugins/core/editor/delete/delete.resolver.ts b/packages/backend/src/core/editor/delete/delete.resolver.ts similarity index 85% rename from apps/backend/src/plugins/core/editor/delete/delete.resolver.ts rename to packages/backend/src/core/editor/delete/delete.resolver.ts index 42212f0e1..dc171eee7 100644 --- a/apps/backend/src/plugins/core/editor/delete/delete.resolver.ts +++ b/packages/backend/src/core/editor/delete/delete.resolver.ts @@ -1,10 +1,12 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { CurrentUser, User, AuthGuards } from "vitnode-backend"; import { DeleteCoreEditorService } from "./delete.service"; import { DeleteCoreEditorArgs } from "./dto/delete.args"; +import { AuthGuards } from "../../../utils"; +import { CurrentUser, User } from "../../../decorators"; + @Resolver() export class DeleteCoreEditorResolver { constructor(private readonly service: DeleteCoreEditorService) {} diff --git a/apps/backend/src/plugins/core/editor/delete/delete.service.ts b/packages/backend/src/core/editor/delete/delete.service.ts similarity index 87% rename from apps/backend/src/plugins/core/editor/delete/delete.service.ts rename to packages/backend/src/core/editor/delete/delete.service.ts index 63e13e34d..e5b441103 100644 --- a/apps/backend/src/plugins/core/editor/delete/delete.service.ts +++ b/packages/backend/src/core/editor/delete/delete.service.ts @@ -1,14 +1,16 @@ import { Injectable } from "@nestjs/common"; import { count, eq } from "drizzle-orm"; -import { AccessDeniedError, User, DatabaseService } from "vitnode-backend"; import { DeleteCoreEditorArgs } from "./dto/delete.args"; import { DeleteCoreFilesService } from "../../files/helpers/delete/delete.service"; +import { DatabaseService } from "../../../database"; +import { User } from "../../../decorators"; +import { AccessDeniedError } from "../../../errors"; import { core_files, core_files_using -} from "../../admin/database/schema/files"; +} from "../../../templates/core/admin/database/schema/files"; @Injectable() export class DeleteCoreEditorService { diff --git a/apps/backend/src/plugins/core/editor/delete/dto/delete.args.ts b/packages/backend/src/core/editor/delete/dto/delete.args.ts similarity index 100% rename from apps/backend/src/plugins/core/editor/delete/dto/delete.args.ts rename to packages/backend/src/core/editor/delete/dto/delete.args.ts diff --git a/apps/backend/src/plugins/core/editor/editor.module.ts b/packages/backend/src/core/editor/editor.module.ts similarity index 100% rename from apps/backend/src/plugins/core/editor/editor.module.ts rename to packages/backend/src/core/editor/editor.module.ts diff --git a/apps/backend/src/plugins/core/editor/upload/dto/upload.args.ts b/packages/backend/src/core/editor/upload/dto/upload.args.ts similarity index 77% rename from apps/backend/src/plugins/core/editor/upload/dto/upload.args.ts rename to packages/backend/src/core/editor/upload/dto/upload.args.ts index 90f70c9e1..ff35d0d05 100644 --- a/apps/backend/src/plugins/core/editor/upload/dto/upload.args.ts +++ b/packages/backend/src/core/editor/upload/dto/upload.args.ts @@ -1,5 +1,6 @@ import { ArgsType, Field } from "@nestjs/graphql"; -import { FileUpload, GraphQLUpload } from "vitnode-backend"; + +import { FileUpload, GraphQLUpload } from "../../../../graphql-upload"; @ArgsType() export class UploadCoreEditorArgs { diff --git a/apps/backend/src/plugins/core/editor/upload/upload.resolver.ts b/packages/backend/src/core/editor/upload/upload.resolver.ts similarity index 85% rename from apps/backend/src/plugins/core/editor/upload/upload.resolver.ts rename to packages/backend/src/core/editor/upload/upload.resolver.ts index 6719070f2..cd0475a2e 100644 --- a/apps/backend/src/plugins/core/editor/upload/upload.resolver.ts +++ b/packages/backend/src/core/editor/upload/upload.resolver.ts @@ -1,11 +1,12 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { CurrentUser, User, AuthGuards, OptionalAuth } from "vitnode-backend"; import { UploadCoreEditorService } from "./upload.service"; import { UploadCoreEditorArgs } from "./dto/upload.args"; import { ShowCoreFiles } from "../../files/show/dto/show.obj"; +import { AuthGuards, OptionalAuth } from "../../../utils"; +import { CurrentUser, User } from "../../../decorators"; @Resolver() export class UploadCoreEditorResolver { diff --git a/apps/backend/src/plugins/core/editor/upload/upload.service.ts b/packages/backend/src/core/editor/upload/upload.service.ts similarity index 93% rename from apps/backend/src/plugins/core/editor/upload/upload.service.ts rename to packages/backend/src/core/editor/upload/upload.service.ts index 8b26f121c..22b3b62dc 100644 --- a/apps/backend/src/plugins/core/editor/upload/upload.service.ts +++ b/packages/backend/src/core/editor/upload/upload.service.ts @@ -1,7 +1,6 @@ import { Injectable } from "@nestjs/common"; import { eq, sum } from "drizzle-orm"; import { generateRandomString } from "@vitnode/shared"; -import { AccessDeniedError, User, DatabaseService } from "vitnode-backend"; import { UploadCoreEditorArgs } from "./dto/upload.args"; @@ -12,9 +11,12 @@ import { acceptMimeTypeVideo } from "../../files/helpers/upload/helpers"; import { UploadCoreFilesArgs } from "../../files/helpers/upload/dto/upload.args"; -import { core_files } from "../../admin/database/schema/files"; import { ShowCoreFiles } from "../../files/show/dto/show.obj"; -import { getConfigFile } from "@/config"; +import { DatabaseService } from "../../../database"; +import { User } from "../../../decorators"; +import { AccessDeniedError } from "../../../errors"; +import { core_files } from "../../../templates/core/admin/database/schema/files"; +import { getConfigFile } from "../../config"; interface GetFilesAfterUploadArgs extends UploadCoreEditorArgs { maxUploadSizeKb: number; diff --git a/apps/backend/src/plugins/core/files/download/download.controller.ts b/packages/backend/src/core/files/download/download.controller.ts similarity index 88% rename from apps/backend/src/plugins/core/files/download/download.controller.ts rename to packages/backend/src/core/files/download/download.controller.ts index e8f870945..3286bce1e 100644 --- a/apps/backend/src/plugins/core/files/download/download.controller.ts +++ b/packages/backend/src/core/files/download/download.controller.ts @@ -10,9 +10,9 @@ import { Query } from "@nestjs/common"; import { Response } from "express"; -import { DatabaseService } from "vitnode-backend"; -import { ABSOLUTE_PATHS } from "@/config"; +import { DatabaseService } from "../../../database"; +import { ABSOLUTE_PATHS_BACKEND } from "../../.."; @Controller("secure_files") export class DownloadSecureFilesController { @@ -35,7 +35,7 @@ export class DownloadSecureFilesController { } const path = join( - ABSOLUTE_PATHS.uploads.private, + ABSOLUTE_PATHS_BACKEND.uploads.private, file.dir_folder, file.file_name ); diff --git a/apps/backend/src/plugins/core/files/files.cron.ts b/packages/backend/src/core/files/files.cron.ts similarity index 89% rename from apps/backend/src/plugins/core/files/files.cron.ts rename to packages/backend/src/core/files/files.cron.ts index 03a73d2ad..d79279157 100644 --- a/apps/backend/src/plugins/core/files/files.cron.ts +++ b/packages/backend/src/core/files/files.cron.ts @@ -1,11 +1,15 @@ import { Injectable } from "@nestjs/common"; import { Cron, CronExpression } from "@nestjs/schedule"; import { desc, eq, lt, sql } from "drizzle-orm"; -import { DatabaseService } from "vitnode-backend"; -import { core_files_using, core_files } from "../admin/database/schema/files"; import { DeleteCoreFilesService } from "./helpers/delete/delete.service"; +import { DatabaseService } from "../../database"; +import { + core_files, + core_files_using +} from "../../templates/core/admin/database/schema/files"; + @Injectable() export class CoreFilesCron { constructor( diff --git a/apps/backend/src/plugins/core/files/files.module.ts b/packages/backend/src/core/files/files.module.ts similarity index 80% rename from apps/backend/src/plugins/core/files/files.module.ts rename to packages/backend/src/core/files/files.module.ts index de217ced9..3c35587d3 100644 --- a/apps/backend/src/plugins/core/files/files.module.ts +++ b/packages/backend/src/core/files/files.module.ts @@ -1,5 +1,4 @@ import { Global, Module } from "@nestjs/common"; -import { AuthorizationAdminSessionsService } from "vitnode-backend"; import { UploadCoreFilesService } from "./helpers/upload/upload.service"; import { DeleteCoreFilesService } from "./helpers/delete/delete.service"; @@ -15,11 +14,7 @@ export class CoreFilesModule {} @Global() @Module({ - providers: [ - UploadCoreFilesService, - DeleteCoreFilesService, - AuthorizationAdminSessionsService - ], + providers: [UploadCoreFilesService, DeleteCoreFilesService], exports: [UploadCoreFilesService, DeleteCoreFilesService], controllers: [DownloadSecureFilesController] }) diff --git a/apps/backend/src/plugins/core/files/helpers/delete/delete.service.ts b/packages/backend/src/core/files/helpers/delete/delete.service.ts similarity index 85% rename from apps/backend/src/plugins/core/files/helpers/delete/delete.service.ts rename to packages/backend/src/core/files/helpers/delete/delete.service.ts index 76fad4fc4..6ed2dbf82 100644 --- a/apps/backend/src/plugins/core/files/helpers/delete/delete.service.ts +++ b/packages/backend/src/core/files/helpers/delete/delete.service.ts @@ -2,11 +2,10 @@ import { existsSync, unlink } from "fs"; import { join } from "path"; import { Injectable } from "@nestjs/common"; -import { CustomError } from "vitnode-backend"; import { DeleteCoreFilesArgs } from "./dto/delete.args"; -import { ABSOLUTE_PATHS } from "@/config"; +import { ABSOLUTE_PATHS_BACKEND, CustomError } from "../../../.."; @Injectable() export class DeleteCoreFilesService { @@ -16,8 +15,8 @@ export class DeleteCoreFilesService { file_secure }: DeleteCoreFilesArgs) { const path = file_secure - ? ABSOLUTE_PATHS.uploads.private - : ABSOLUTE_PATHS.uploads.public; + ? ABSOLUTE_PATHS_BACKEND.uploads.private + : ABSOLUTE_PATHS_BACKEND.uploads.public; const filePath = join(path, dir_folder, file_name); diff --git a/apps/backend/src/plugins/core/files/helpers/delete/dto/delete.args.ts b/packages/backend/src/core/files/helpers/delete/dto/delete.args.ts similarity index 100% rename from apps/backend/src/plugins/core/files/helpers/delete/dto/delete.args.ts rename to packages/backend/src/core/files/helpers/delete/dto/delete.args.ts diff --git a/apps/backend/src/plugins/core/files/helpers/upload/dto/upload.args.ts b/packages/backend/src/core/files/helpers/upload/dto/upload.args.ts similarity index 84% rename from apps/backend/src/plugins/core/files/helpers/upload/dto/upload.args.ts rename to packages/backend/src/core/files/helpers/upload/dto/upload.args.ts index ea100f73c..1622013d7 100644 --- a/apps/backend/src/plugins/core/files/helpers/upload/dto/upload.args.ts +++ b/packages/backend/src/core/files/helpers/upload/dto/upload.args.ts @@ -1,5 +1,6 @@ import { ArgsType, Field } from "@nestjs/graphql"; -import { FileUpload, GraphQLUpload } from "vitnode-backend"; + +import { FileUpload, GraphQLUpload } from "../../../../../graphql-upload"; @ArgsType() export class UploadCoreFilesArgs { diff --git a/apps/backend/src/plugins/core/files/helpers/upload/dto/upload.obj.ts b/packages/backend/src/core/files/helpers/upload/dto/upload.obj.ts similarity index 100% rename from apps/backend/src/plugins/core/files/helpers/upload/dto/upload.obj.ts rename to packages/backend/src/core/files/helpers/upload/dto/upload.obj.ts diff --git a/apps/backend/src/plugins/core/files/helpers/upload/helpers.ts b/packages/backend/src/core/files/helpers/upload/helpers.ts similarity index 93% rename from apps/backend/src/plugins/core/files/helpers/upload/helpers.ts rename to packages/backend/src/core/files/helpers/upload/helpers.ts index e1b31cc2c..5c36a0e25 100644 --- a/apps/backend/src/plugins/core/files/helpers/upload/helpers.ts +++ b/packages/backend/src/core/files/helpers/upload/helpers.ts @@ -1,4 +1,5 @@ -import { FileUpload, CustomError } from "vitnode-backend"; +import { CustomError } from "../../../../errors"; +import { FileUpload } from "../../../../graphql-upload"; export const acceptMimeTypeImage = [ "image/jpeg", diff --git a/apps/backend/src/plugins/core/files/helpers/upload/upload.service.ts b/packages/backend/src/core/files/helpers/upload/upload.service.ts similarity index 92% rename from apps/backend/src/plugins/core/files/helpers/upload/upload.service.ts rename to packages/backend/src/core/files/helpers/upload/upload.service.ts index 37426992f..f2170aeb7 100644 --- a/apps/backend/src/plugins/core/files/helpers/upload/upload.service.ts +++ b/packages/backend/src/core/files/helpers/upload/upload.service.ts @@ -10,13 +10,14 @@ import { join } from "path"; import sharp from "sharp"; import { Injectable } from "@nestjs/common"; import { generateRandomString, removeSpecialCharacters } from "@vitnode/shared"; -import { CustomError, DatabaseService } from "vitnode-backend"; import { UploadCoreFilesArgs } from "./dto/upload.args"; import { UploadCoreFilesObj } from "./dto/upload.obj"; import { HelpersUploadCoreFilesService, acceptMimeTypeImage } from "./helpers"; -import { ABSOLUTE_PATHS } from "@/config"; +import { DatabaseService } from "../../../../database"; +import { CustomError } from "../../../../errors"; +import { ABSOLUTE_PATHS_BACKEND } from "../../../.."; @Injectable() export class UploadCoreFilesService extends HelpersUploadCoreFilesService { @@ -65,8 +66,8 @@ export class UploadCoreFilesService extends HelpersUploadCoreFilesService { folder ); const dirFolder = secure - ? join(ABSOLUTE_PATHS.uploads.private, dir) - : join(ABSOLUTE_PATHS.uploads.public, dir); + ? join(ABSOLUTE_PATHS_BACKEND.uploads.private, dir) + : join(ABSOLUTE_PATHS_BACKEND.uploads.public, dir); if (!existsSync(dirFolder)) { mkdirSync(dirFolder, { recursive: true }); } diff --git a/apps/backend/src/plugins/core/files/show/dto/show.args.ts b/packages/backend/src/core/files/show/dto/show.args.ts similarity index 90% rename from apps/backend/src/plugins/core/files/show/dto/show.args.ts rename to packages/backend/src/core/files/show/dto/show.args.ts index 40d761b90..75f489094 100644 --- a/apps/backend/src/plugins/core/files/show/dto/show.args.ts +++ b/packages/backend/src/core/files/show/dto/show.args.ts @@ -1,5 +1,6 @@ import { ArgsType, Field, InputType, registerEnumType } from "@nestjs/graphql"; -import { PaginationArgs, SortDirectionEnum } from "vitnode-backend"; + +import { PaginationArgs, SortDirectionEnum } from "../../../../utils"; enum ShowCoreFilesSortingColumnEnum { created = "created", diff --git a/apps/backend/src/plugins/core/files/show/dto/show.obj.ts b/packages/backend/src/core/files/show/dto/show.obj.ts similarity index 93% rename from apps/backend/src/plugins/core/files/show/dto/show.obj.ts rename to packages/backend/src/core/files/show/dto/show.obj.ts index 8d9013b94..7f9ec95bf 100644 --- a/apps/backend/src/plugins/core/files/show/dto/show.obj.ts +++ b/packages/backend/src/core/files/show/dto/show.obj.ts @@ -1,7 +1,7 @@ import { Field, Int, ObjectType } from "@nestjs/graphql"; -import { PageInfo } from "vitnode-backend"; import { UploadCoreFilesObj } from "../../helpers/upload/dto/upload.obj"; +import { PageInfo } from "../../../../utils"; @ObjectType() export class ShowCoreFiles extends UploadCoreFilesObj { diff --git a/apps/backend/src/plugins/core/files/show/show.resolver.ts b/packages/backend/src/core/files/show/show.resolver.ts similarity index 85% rename from apps/backend/src/plugins/core/files/show/show.resolver.ts rename to packages/backend/src/core/files/show/show.resolver.ts index 21a6f41a0..538673f4e 100644 --- a/apps/backend/src/plugins/core/files/show/show.resolver.ts +++ b/packages/backend/src/core/files/show/show.resolver.ts @@ -1,11 +1,13 @@ import { Args, Query, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { CurrentUser, User, AuthGuards } from "vitnode-backend"; import { ShowCoreFilesService } from "./show.service"; import { ShowCoreFilesObj } from "./dto/show.obj"; import { ShowCoreFilesArgs } from "./dto/show.args"; +import { AuthGuards } from "../../../utils"; +import { CurrentUser, User } from "../../../decorators"; + @Resolver() export class ShowCoreFilesResolver { constructor(private readonly service: ShowCoreFilesService) {} diff --git a/apps/backend/src/plugins/core/files/show/show.service.ts b/packages/backend/src/core/files/show/show.service.ts similarity index 85% rename from apps/backend/src/plugins/core/files/show/show.service.ts rename to packages/backend/src/core/files/show/show.service.ts index 676ff1b38..bfdd16c03 100644 --- a/apps/backend/src/plugins/core/files/show/show.service.ts +++ b/packages/backend/src/core/files/show/show.service.ts @@ -1,20 +1,17 @@ import { Injectable } from "@nestjs/common"; import { and, count, eq, ilike, or } from "drizzle-orm"; -import { - DatabaseService, - inputPaginationCursor, - outputPagination, - SortDirectionEnum, - User -} from "vitnode-backend"; import { ShowCoreFilesArgs } from "./dto/show.args"; import { ShowCoreFilesObj } from "./dto/show.obj"; +import { DatabaseService } from "../../../database"; +import { inputPaginationCursor, outputPagination } from "../../../functions"; import { - core_files_using, - core_files -} from "../../admin/database/schema/files"; + core_files, + core_files_using +} from "../../../templates/core/admin/database/schema/files"; +import { User } from "../../../decorators"; +import { SortDirectionEnum } from "../../../utils"; @Injectable() export class ShowCoreFilesService { diff --git a/packages/backend/src/core/languages/show/dto/show.args.ts b/packages/backend/src/core/languages/show/dto/show.args.ts index e2ca7288e..fc59b259f 100644 --- a/packages/backend/src/core/languages/show/dto/show.args.ts +++ b/packages/backend/src/core/languages/show/dto/show.args.ts @@ -1,4 +1,5 @@ import { ArgsType, Field, InputType, registerEnumType } from "@nestjs/graphql"; + import { PaginationArgs, SortDirectionEnum } from "../../../../utils"; enum ShowCoreLanguagesSortingColumnEnum { diff --git a/packages/backend/src/core/languages/show/dto/show.obj.ts b/packages/backend/src/core/languages/show/dto/show.obj.ts index b6cdad5af..be4c26885 100644 --- a/packages/backend/src/core/languages/show/dto/show.obj.ts +++ b/packages/backend/src/core/languages/show/dto/show.obj.ts @@ -1,4 +1,5 @@ import { Field, Int, ObjectType } from "@nestjs/graphql"; + import { PageInfo } from "../../../../utils"; @ObjectType() diff --git a/packages/backend/src/core/languages/show/show.service.ts b/packages/backend/src/core/languages/show/show.service.ts index ef15cdf67..080ed92f4 100644 --- a/packages/backend/src/core/languages/show/show.service.ts +++ b/packages/backend/src/core/languages/show/show.service.ts @@ -3,6 +3,7 @@ import { and, count, ilike } from "drizzle-orm"; import { ShowCoreLanguagesArgs } from "./dto/show.args"; import { ShowCoreLanguagesObj } from "./dto/show.obj"; + import { DatabaseService } from "../../../database"; import { inputPaginationCursor, outputPagination } from "../../../functions"; import { core_languages } from "../../../templates/core/admin/database/schema/languages"; diff --git a/apps/backend/src/plugins/core/members/avatar/avatar-core_members.module.ts b/packages/backend/src/core/members/avatar/avatar-core_members.module.ts similarity index 100% rename from apps/backend/src/plugins/core/members/avatar/avatar-core_members.module.ts rename to packages/backend/src/core/members/avatar/avatar-core_members.module.ts diff --git a/apps/backend/src/plugins/core/members/avatar/delete/delete.resolver.ts b/packages/backend/src/core/members/avatar/delete/delete.resolver.ts similarity index 82% rename from apps/backend/src/plugins/core/members/avatar/delete/delete.resolver.ts rename to packages/backend/src/core/members/avatar/delete/delete.resolver.ts index 82858c96f..b50e4d559 100644 --- a/apps/backend/src/plugins/core/members/avatar/delete/delete.resolver.ts +++ b/packages/backend/src/core/members/avatar/delete/delete.resolver.ts @@ -1,9 +1,11 @@ import { Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { User, CurrentUser, AuthGuards } from "vitnode-backend"; import { DeleteAvatarCoreMembersService } from "./delete.service"; +import { AuthGuards } from "../../../../utils"; +import { CurrentUser, User } from "../../../../decorators"; + @Resolver() export class DeleteAvatarCoreMembersResolver { constructor(private readonly service: DeleteAvatarCoreMembersService) {} diff --git a/apps/backend/src/plugins/core/members/avatar/delete/delete.service.ts b/packages/backend/src/core/members/avatar/delete/delete.service.ts similarity index 74% rename from apps/backend/src/plugins/core/members/avatar/delete/delete.service.ts rename to packages/backend/src/core/members/avatar/delete/delete.service.ts index 3b7b39973..61c849287 100644 --- a/apps/backend/src/plugins/core/members/avatar/delete/delete.service.ts +++ b/packages/backend/src/core/members/avatar/delete/delete.service.ts @@ -1,9 +1,10 @@ import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; -import { User, DatabaseService } from "vitnode-backend"; -import { DeleteCoreFilesService } from "@/plugins/core/files/helpers/delete/delete.service"; -import { core_files_avatars } from "@/plugins/core/admin/database/schema/users"; +import { DeleteCoreFilesService } from "../../../files/helpers/delete/delete.service"; +import { DatabaseService } from "../../../../database"; +import { User } from "../../../../decorators"; +import { core_files_avatars } from "../../../../templates/core/admin/database/schema/users"; @Injectable() export class DeleteAvatarCoreMembersService { diff --git a/apps/backend/src/plugins/core/members/avatar/upload/dto/upload.args.ts b/packages/backend/src/core/members/avatar/upload/dto/upload.args.ts similarity index 68% rename from apps/backend/src/plugins/core/members/avatar/upload/dto/upload.args.ts rename to packages/backend/src/core/members/avatar/upload/dto/upload.args.ts index 6ce22f793..179199a29 100644 --- a/apps/backend/src/plugins/core/members/avatar/upload/dto/upload.args.ts +++ b/packages/backend/src/core/members/avatar/upload/dto/upload.args.ts @@ -1,5 +1,6 @@ import { ArgsType, Field } from "@nestjs/graphql"; -import { FileUpload, GraphQLUpload } from "vitnode-backend"; + +import { FileUpload, GraphQLUpload } from "../../../../../graphql-upload"; @ArgsType() export class UploadAvatarCoreMembersArgs { diff --git a/apps/backend/src/plugins/core/members/avatar/upload/dto/upload.obj.ts b/packages/backend/src/core/members/avatar/upload/dto/upload.obj.ts similarity index 66% rename from apps/backend/src/plugins/core/members/avatar/upload/dto/upload.obj.ts rename to packages/backend/src/core/members/avatar/upload/dto/upload.obj.ts index 079d8cf73..10bd4b810 100644 --- a/apps/backend/src/plugins/core/members/avatar/upload/dto/upload.obj.ts +++ b/packages/backend/src/core/members/avatar/upload/dto/upload.obj.ts @@ -1,6 +1,6 @@ import { Field, Int, ObjectType } from "@nestjs/graphql"; -import { UploadCoreFilesObj } from "@/plugins/core/files/helpers/upload/dto/upload.obj"; +import { UploadCoreFilesObj } from "../../../../files/helpers/upload/dto/upload.obj"; @ObjectType() export class UploadAvatarCoreMembersObj extends UploadCoreFilesObj { diff --git a/apps/backend/src/plugins/core/members/avatar/upload/upload.resolver.ts b/packages/backend/src/core/members/avatar/upload/upload.resolver.ts similarity index 87% rename from apps/backend/src/plugins/core/members/avatar/upload/upload.resolver.ts rename to packages/backend/src/core/members/avatar/upload/upload.resolver.ts index 6d5227c09..c5b16a46a 100644 --- a/apps/backend/src/plugins/core/members/avatar/upload/upload.resolver.ts +++ b/packages/backend/src/core/members/avatar/upload/upload.resolver.ts @@ -1,11 +1,13 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { User, CurrentUser, AuthGuards } from "vitnode-backend"; import { UploadAvatarCoreMembersService } from "./upload.service"; import { UploadAvatarCoreMembersArgs } from "./dto/upload.args"; import { UploadAvatarCoreMembersObj } from "./dto/upload.obj"; +import { AuthGuards } from "../../../../utils"; +import { CurrentUser, User } from "../../../../decorators"; + @Resolver() export class UploadAvatarCoreMembersResolver { constructor(private readonly service: UploadAvatarCoreMembersService) {} diff --git a/apps/backend/src/plugins/core/members/avatar/upload/upload.service.ts b/packages/backend/src/core/members/avatar/upload/upload.service.ts similarity index 82% rename from apps/backend/src/plugins/core/members/avatar/upload/upload.service.ts rename to packages/backend/src/core/members/avatar/upload/upload.service.ts index 80864dbb0..be4a86911 100644 --- a/apps/backend/src/plugins/core/members/avatar/upload/upload.service.ts +++ b/packages/backend/src/core/members/avatar/upload/upload.service.ts @@ -1,13 +1,15 @@ import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; -import { CustomError, User, DatabaseService } from "vitnode-backend"; import { UploadAvatarCoreMembersArgs } from "./dto/upload.args"; import { UploadAvatarCoreMembersObj } from "./dto/upload.obj"; -import { UploadCoreFilesService } from "@/plugins/core/files/helpers/upload/upload.service"; -import { DeleteCoreFilesService } from "@/plugins/core/files/helpers/delete/delete.service"; -import { core_files_avatars } from "@/plugins/core/admin/database/schema/users"; +import { UploadCoreFilesService } from "../../../files/helpers/upload/upload.service"; +import { DeleteCoreFilesService } from "../../../files/helpers/delete/delete.service"; +import { DatabaseService } from "../../../../database"; +import { User } from "../../../../decorators"; +import { core_files_avatars } from "../../../../templates/core/admin/database/schema/users"; +import { CustomError } from "../../../../errors"; @Injectable() export class UploadAvatarCoreMembersService { diff --git a/apps/backend/src/plugins/core/members/delete/delete.resolver.ts b/packages/backend/src/core/members/delete/delete.resolver.ts similarity index 91% rename from apps/backend/src/plugins/core/members/delete/delete.resolver.ts rename to packages/backend/src/core/members/delete/delete.resolver.ts index 79f618473..28c6eae79 100644 --- a/apps/backend/src/plugins/core/members/delete/delete.resolver.ts +++ b/packages/backend/src/core/members/delete/delete.resolver.ts @@ -1,10 +1,11 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards } from "vitnode-backend"; import { DeleteCoreMembersService } from "./delete.service"; import { DeleteCoreMembersArgs } from "./dto/delete.args"; +import { AdminAuthGuards } from "../../../utils"; + @Resolver() export class DeleteCoreMembersResolver { constructor(private readonly service: DeleteCoreMembersService) {} diff --git a/apps/backend/src/plugins/core/members/delete/delete.service.ts b/packages/backend/src/core/members/delete/delete.service.ts similarity index 78% rename from apps/backend/src/plugins/core/members/delete/delete.service.ts rename to packages/backend/src/core/members/delete/delete.service.ts index f5bd54e57..bd5ca4ddd 100644 --- a/apps/backend/src/plugins/core/members/delete/delete.service.ts +++ b/packages/backend/src/core/members/delete/delete.service.ts @@ -1,14 +1,11 @@ import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; -import { - NotFoundError, - AccessDeniedError, - DatabaseService -} from "vitnode-backend"; import { DeleteCoreMembersArgs } from "./dto/delete.args"; -import { core_users } from "@/plugins/core/admin/database/schema/users"; +import { core_users } from "../../../templates/core/admin/database/schema/users"; +import { DatabaseService } from "../../../database"; +import { AccessDeniedError, NotFoundError } from "../../../errors"; @Injectable() export class DeleteCoreMembersService { @@ -27,7 +24,7 @@ export class DeleteCoreMembersService { or(eq(table.user_id, user.id), eq(table.group_id, user.group_id)) }); - if (admin) throw new AccessDeniedError(); //Protects against deletion users with admin permisssions + if (admin) throw new AccessDeniedError(); //Protects against deletion users with admin permissions await this.databaseService.db .delete(core_users) diff --git a/apps/backend/src/plugins/core/members/delete/dto/delete.args.ts b/packages/backend/src/core/members/delete/dto/delete.args.ts similarity index 100% rename from apps/backend/src/plugins/core/members/delete/dto/delete.args.ts rename to packages/backend/src/core/members/delete/dto/delete.args.ts diff --git a/apps/backend/src/plugins/core/members/members.module.ts b/packages/backend/src/core/members/members.module.ts similarity index 100% rename from apps/backend/src/plugins/core/members/members.module.ts rename to packages/backend/src/core/members/members.module.ts diff --git a/apps/backend/src/plugins/core/members/show/dto/show.args.ts b/packages/backend/src/core/members/show/dto/show.args.ts similarity index 97% rename from apps/backend/src/plugins/core/members/show/dto/show.args.ts rename to packages/backend/src/core/members/show/dto/show.args.ts index 5fd0f816c..4a1fbadf8 100644 --- a/apps/backend/src/plugins/core/members/show/dto/show.args.ts +++ b/packages/backend/src/core/members/show/dto/show.args.ts @@ -1,10 +1,11 @@ import { ArgsType, Field, InputType, registerEnumType } from "@nestjs/graphql"; import { Transform } from "class-transformer"; + import { PaginationArgs, SortDirectionEnum, TransformString -} from "vitnode-backend"; +} from "../../../../utils"; enum ShowCoreMembersSortingColumnEnum { name = "name", diff --git a/apps/backend/src/plugins/core/members/show/dto/show.obj.ts b/packages/backend/src/core/members/show/dto/show.obj.ts similarity index 81% rename from apps/backend/src/plugins/core/members/show/dto/show.obj.ts rename to packages/backend/src/core/members/show/dto/show.obj.ts index d41189599..689170f6c 100644 --- a/apps/backend/src/plugins/core/members/show/dto/show.obj.ts +++ b/packages/backend/src/core/members/show/dto/show.obj.ts @@ -1,5 +1,7 @@ import { Field, Int, ObjectType } from "@nestjs/graphql"; -import { PageInfo, TextLanguage, User } from "vitnode-backend"; + +import { PageInfo, TextLanguage } from "../../../../utils"; +import { User } from "../../../../decorators"; @ObjectType() export class ShowCoreMembersObj { diff --git a/apps/backend/src/plugins/core/members/show/show.resolver.ts b/packages/backend/src/core/members/show/show.resolver.ts similarity index 91% rename from apps/backend/src/plugins/core/members/show/show.resolver.ts rename to packages/backend/src/core/members/show/show.resolver.ts index dceb99aa4..c82843b60 100644 --- a/apps/backend/src/plugins/core/members/show/show.resolver.ts +++ b/packages/backend/src/core/members/show/show.resolver.ts @@ -1,11 +1,12 @@ import { Args, Query, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AuthGuards, OptionalAuth } from "vitnode-backend"; import { ShowCoreMembersService } from "./show.service"; import { ShowCoreMembersObj } from "./dto/show.obj"; import { ShowCoreMembersArgs } from "./dto/show.args"; +import { AuthGuards, OptionalAuth } from "../../../utils"; + @Resolver() export class ShowCoreMembersResolver { constructor(private readonly service: ShowCoreMembersService) {} diff --git a/apps/backend/src/plugins/core/members/show/show.service.ts b/packages/backend/src/core/members/show/show.service.ts similarity index 87% rename from apps/backend/src/plugins/core/members/show/show.service.ts rename to packages/backend/src/core/members/show/show.service.ts index 1e16989b0..ff2a6562f 100644 --- a/apps/backend/src/plugins/core/members/show/show.service.ts +++ b/packages/backend/src/core/members/show/show.service.ts @@ -1,16 +1,13 @@ import { Injectable } from "@nestjs/common"; import { and, count, eq, ilike, or } from "drizzle-orm"; -import { - inputPaginationCursor, - outputPagination, - SortDirectionEnum, - DatabaseService -} from "vitnode-backend"; import { ShowCoreMembersObj } from "./dto/show.obj"; import { ShowCoreMembersArgs } from "./dto/show.args"; -import { core_users } from "@/plugins/core/admin/database/schema/users"; +import { DatabaseService } from "../../../database"; +import { inputPaginationCursor, outputPagination } from "../../../functions"; +import { core_users } from "../../../templates/core/admin/database/schema/users"; +import { SortDirectionEnum } from "../../../utils"; @Injectable() export class ShowCoreMembersService { diff --git a/apps/backend/src/plugins/core/members/sign_up/dto/sign_up.args.ts b/packages/backend/src/core/members/sign_up/dto/sign_up.args.ts similarity index 86% rename from apps/backend/src/plugins/core/members/sign_up/dto/sign_up.args.ts rename to packages/backend/src/core/members/sign_up/dto/sign_up.args.ts index 49ae6c810..09c3be699 100644 --- a/apps/backend/src/plugins/core/members/sign_up/dto/sign_up.args.ts +++ b/packages/backend/src/core/members/sign_up/dto/sign_up.args.ts @@ -7,9 +7,10 @@ import { MinLength } from "class-validator"; import { Transform } from "class-transformer"; -import { TransformString } from "vitnode-backend"; -import { nameRegex } from "@/utils/regex"; +import { TransformString } from "../../../../utils"; + +export const nameRegex = /^(?!.* {2})[\p{L}\p{N}._@ -]*$/u; @ArgsType() export class SignUpCoreMembersArgs { diff --git a/apps/backend/src/plugins/core/members/sign_up/dto/sign_up.obj.ts b/packages/backend/src/core/members/sign_up/dto/sign_up.obj.ts similarity index 91% rename from apps/backend/src/plugins/core/members/sign_up/dto/sign_up.obj.ts rename to packages/backend/src/core/members/sign_up/dto/sign_up.obj.ts index cfebc3ccc..c5c4e459c 100644 --- a/apps/backend/src/plugins/core/members/sign_up/dto/sign_up.obj.ts +++ b/packages/backend/src/core/members/sign_up/dto/sign_up.obj.ts @@ -1,7 +1,7 @@ import { Field, Int, ObjectType } from "@nestjs/graphql"; import { IsEmail, Matches, MaxLength, MinLength } from "class-validator"; -import { nameRegex } from "@/utils/regex"; +import { nameRegex } from "./sign_up.args"; @ObjectType() export class SignUpCoreMembersObj { diff --git a/apps/backend/src/plugins/core/members/sign_up/functions/generate-avatar-color.ts b/packages/backend/src/core/members/sign_up/functions/generate-avatar-color.ts similarity index 100% rename from apps/backend/src/plugins/core/members/sign_up/functions/generate-avatar-color.ts rename to packages/backend/src/core/members/sign_up/functions/generate-avatar-color.ts diff --git a/apps/backend/src/plugins/core/members/sign_up/sign_up.resolver.ts b/packages/backend/src/core/members/sign_up/sign_up.resolver.ts similarity index 93% rename from apps/backend/src/plugins/core/members/sign_up/sign_up.resolver.ts rename to packages/backend/src/core/members/sign_up/sign_up.resolver.ts index 8b01ac1fa..02a92ee8e 100644 --- a/apps/backend/src/plugins/core/members/sign_up/sign_up.resolver.ts +++ b/packages/backend/src/core/members/sign_up/sign_up.resolver.ts @@ -1,10 +1,11 @@ import { Args, Context, Mutation, Resolver } from "@nestjs/graphql"; -import { Ctx } from "vitnode-backend"; import { SignUpCoreMembersObj } from "./dto/sign_up.obj"; import { SignUpCoreMembersService } from "./sign_up.service"; import { SignUpCoreMembersArgs } from "./dto/sign_up.args"; +import { Ctx } from "../../../utils"; + @Resolver() export class SignUpCoreMembersResolver { constructor(private readonly service: SignUpCoreMembersService) {} diff --git a/apps/backend/src/plugins/core/members/sign_up/sign_up.service.ts b/packages/backend/src/core/members/sign_up/sign_up.service.ts similarity index 89% rename from apps/backend/src/plugins/core/members/sign_up/sign_up.service.ts rename to packages/backend/src/core/members/sign_up/sign_up.service.ts index eb0c07300..3ec8a1859 100644 --- a/apps/backend/src/plugins/core/members/sign_up/sign_up.service.ts +++ b/packages/backend/src/core/members/sign_up/sign_up.service.ts @@ -3,13 +3,16 @@ import { genSalt, hash } from "bcrypt"; import { count } from "drizzle-orm"; import { ConfigService } from "@nestjs/config"; import { removeSpecialCharacters } from "@vitnode/shared"; -import { CustomError, getUserIp, Ctx, DatabaseService } from "vitnode-backend"; import { SignUpCoreMembersArgs } from "./dto/sign_up.args"; import { SignUpCoreMembersObj } from "./dto/sign_up.obj"; +import { generateAvatarColor } from "./functions/generate-avatar-color"; -import { generateAvatarColor } from "@/plugins/core/members/sign_up/functions/generate-avatar-color"; -import { core_users } from "@/plugins/core/admin/database/schema/users"; +import { DatabaseService } from "../../../database"; +import { core_users } from "../../../templates/core/admin/database/schema/users"; +import { Ctx } from "../../../utils"; +import { CustomError } from "../../../errors"; +import { getUserIp } from "../../../functions"; @Injectable() export class SignUpCoreMembersService { diff --git a/packages/backend/src/core/plugins/show/show.service.ts b/packages/backend/src/core/plugins/show/show.service.ts index 560ac8b52..fe37ca24e 100644 --- a/packages/backend/src/core/plugins/show/show.service.ts +++ b/packages/backend/src/core/plugins/show/show.service.ts @@ -1,6 +1,7 @@ import { Injectable } from "@nestjs/common"; import { ShowCorePluginsObj } from "./dto/show.obj"; + import { DatabaseService } from "../../../database"; @Injectable() diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts index 01cef375c..7d6c33cdc 100644 --- a/packages/backend/src/index.ts +++ b/packages/backend/src/index.ts @@ -11,3 +11,4 @@ export * from "./database"; export * from "./core/admin/sessions/authorization/authorization.service"; export * from "./core/sessions/authorization/internal/internal_authorization.service"; export * from "./core/admin/plugins/type"; +export * from "./core/config"; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ce0da76cb..39f0d06c7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -499,6 +499,9 @@ importers: pg: specifier: ^8.12.0 version: 8.12.0 + sharp: + specifier: ^0.33.4 + version: 0.33.4 tar: specifier: ^7.4.0 version: 7.4.0 From b3e043ddc0347e53f5dc62d9e409854615319e0b Mon Sep 17 00:00:00 2001 From: aXenDeveloper Date: Sat, 22 Jun 2024 10:58:21 +0200 Subject: [PATCH 18/27] perf(backend): Move settings & middleware modules to package --- .../src/plugins/core/admin/admin.module.ts | 12 +-- apps/backend/src/plugins/core/core.module.ts | 10 +-- .../backend/src/core/admin/admin.module.ts | 8 +- .../files/download/download.controller.ts | 4 +- .../admin/groups/create/create.resolver.ts | 3 +- .../admin/groups/create/create.service.ts | 6 +- .../admin/groups/create/dto/create.args.ts | 3 +- .../admin/groups/delete/delete.resolver.ts | 3 +- .../admin/groups/delete/delete.service.ts | 7 +- .../admin/groups/delete/dto/delete.args.ts | 0 .../core/admin/groups/edit/dto/edit.args.ts | 0 .../core/admin/groups/edit/edit.resolver.ts | 3 +- .../core/admin/groups/edit/edit.service.ts | 9 ++- .../src}/core/admin/groups/groups.module.ts | 0 .../core/admin/groups/show/dto/show.args.ts | 3 +- .../core/admin/groups/show/dto/show.obj.ts | 3 +- .../core/admin/groups/show/show.resolver.ts | 3 +- .../core/admin/groups/show/show.service.ts | 13 ++-- .../metadata/manifest/edit/dto/edit.args.ts | 0 .../metadata/manifest/edit/edit.resolver.ts | 3 +- .../metadata/manifest/edit/edit.service.ts | 8 +- .../core/admin/metadata/manifest/functions.ts | 6 +- .../metadata/manifest/show/dto/show.obj.ts | 0 .../metadata/manifest/show/show.resolver.ts | 3 +- .../metadata/manifest/show/show.service.ts | 0 .../core/admin/metadata/metadata.module.ts | 0 .../admin/settings/functions/get-core-info.ts | 2 +- .../admin/settings/main/edit/dto/edit.args.ts | 3 +- .../admin/settings/main/edit/dto/edit.obj.ts | 2 +- .../admin/settings/main/edit/edit.resolver.ts | 3 +- .../admin/settings/main/edit/edit.service.ts | 14 ++-- .../admin/settings/main/general.module.ts | 0 .../core/admin/settings/settings.module.ts | 0 packages/backend/src/core/config.ts | 75 ------------------- packages/backend/src/core/core.module.ts | 6 +- .../core/middleware/dto/middleware.obj.ts | 0 .../src}/core/middleware/middleware.cron.ts | 4 +- .../src}/core/middleware/middleware.module.ts | 0 .../core/middleware/show/dto/languages.obj.ts | 0 .../core/middleware/show/show.resolver.ts | 0 .../src}/core/middleware/show/show.service.ts | 4 +- .../src}/core/settings/settings.module.ts | 0 .../src}/core/settings/show/dto/show.obj.ts | 3 +- .../src}/core/settings/show/show.resolver.ts | 0 .../src}/core/settings/show/show.service.ts | 8 +- 45 files changed, 80 insertions(+), 154 deletions(-) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/groups/create/create.resolver.ts (91%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/groups/create/create.service.ts (79%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/groups/create/dto/create.args.ts (96%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/groups/delete/delete.resolver.ts (91%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/groups/delete/delete.service.ts (80%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/groups/delete/dto/delete.args.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/groups/edit/dto/edit.args.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/groups/edit/edit.resolver.ts (91%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/groups/edit/edit.service.ts (80%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/groups/groups.module.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/groups/show/dto/show.args.ts (96%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/groups/show/dto/show.obj.ts (93%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/groups/show/show.resolver.ts (91%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/groups/show/show.service.ts (88%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/metadata/manifest/edit/dto/edit.args.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/metadata/manifest/edit/edit.resolver.ts (92%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/metadata/manifest/edit/edit.service.ts (86%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/metadata/manifest/functions.ts (81%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/metadata/manifest/show/dto/show.obj.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/metadata/manifest/show/show.resolver.ts (90%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/metadata/manifest/show/show.service.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/metadata/metadata.module.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/settings/functions/get-core-info.ts (92%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/settings/main/edit/dto/edit.args.ts (85%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/settings/main/edit/dto/edit.obj.ts (77%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/settings/main/edit/edit.resolver.ts (91%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/settings/main/edit/edit.service.ts (91%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/settings/main/general.module.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/settings/settings.module.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/middleware/dto/middleware.obj.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/middleware/middleware.cron.ts (85%) rename {apps/backend/src/plugins => packages/backend/src}/core/middleware/middleware.module.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/middleware/show/dto/languages.obj.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/middleware/show/show.resolver.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/middleware/show/show.service.ts (78%) rename {apps/backend/src/plugins => packages/backend/src}/core/settings/settings.module.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/settings/show/dto/show.obj.ts (86%) rename {apps/backend/src/plugins => packages/backend/src}/core/settings/show/show.resolver.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/settings/show/show.service.ts (85%) diff --git a/apps/backend/src/plugins/core/admin/admin.module.ts b/apps/backend/src/plugins/core/admin/admin.module.ts index f32d83e3c..b5a814c92 100644 --- a/apps/backend/src/plugins/core/admin/admin.module.ts +++ b/apps/backend/src/plugins/core/admin/admin.module.ts @@ -1,20 +1,10 @@ import { Module } from "@nestjs/common"; import { AdminInstallModule } from "./install/install.module"; -import { AdminSettingsModule } from "./settings/settings.module"; -import { AdminMetadataModule } from "./metadata/metadata.module"; -import { AdminGroupsModule } from "./groups/groups.module"; import { AdminThemeEditorModule } from "./theme_editor/theme_editor.module"; import { AdminEmailModule } from "./email/email.module"; @Module({ - imports: [ - AdminInstallModule, - AdminSettingsModule, - AdminMetadataModule, - AdminGroupsModule, - AdminThemeEditorModule, - AdminEmailModule - ] + imports: [AdminInstallModule, AdminThemeEditorModule, AdminEmailModule] }) export class AdminModule {} diff --git a/apps/backend/src/plugins/core/core.module.ts b/apps/backend/src/plugins/core/core.module.ts index 0530d8cb4..38010ca54 100644 --- a/apps/backend/src/plugins/core/core.module.ts +++ b/apps/backend/src/plugins/core/core.module.ts @@ -1,19 +1,11 @@ import { Module } from "@nestjs/common"; import { AdminModule } from "./admin/admin.module"; -import { CoreSettingsModule } from "./settings/settings.module"; import { GlobalCoreHelpersModule } from "./helpers/helpers.module"; -import { CoreMiddlewareModule } from "./middleware/middleware.module"; import { CoreThemeEditorModule } from "./theme_editor/theme_editor.module"; @Module({ - imports: [ - AdminModule, - CoreSettingsModule, - GlobalCoreHelpersModule, - CoreMiddlewareModule, - CoreThemeEditorModule - ], + imports: [AdminModule, GlobalCoreHelpersModule, CoreThemeEditorModule], providers: [] }) export class CoreModule {} diff --git a/packages/backend/src/core/admin/admin.module.ts b/packages/backend/src/core/admin/admin.module.ts index a53169378..f6212efcd 100644 --- a/packages/backend/src/core/admin/admin.module.ts +++ b/packages/backend/src/core/admin/admin.module.ts @@ -10,6 +10,9 @@ import { AdminStaffModule } from "./staff/staff.module"; import { AdminLanguagesModule } from "./languages/languages.module"; import { AdminFilesModule } from "./files/files.module"; import { AdminMembersModule } from "./members/members.module"; +import { AdminGroupsModule } from "./groups/groups.module"; +import { AdminMetadataModule } from "./metadata/metadata.module"; +import { AdminSettingsModule } from "./settings/settings.module"; @Module({ imports: [ @@ -20,7 +23,10 @@ import { AdminMembersModule } from "./members/members.module"; AdminStaffModule, AdminLanguagesModule, AdminFilesModule, - AdminMembersModule + AdminMembersModule, + AdminGroupsModule, + AdminMetadataModule, + AdminSettingsModule ] }) export class AdminModule {} diff --git a/packages/backend/src/core/admin/files/download/download.controller.ts b/packages/backend/src/core/admin/files/download/download.controller.ts index cebcb9781..3e8af92c0 100644 --- a/packages/backend/src/core/admin/files/download/download.controller.ts +++ b/packages/backend/src/core/admin/files/download/download.controller.ts @@ -14,7 +14,7 @@ import { Request, Response } from "express"; import { InternalAuthorizationCoreSessionsService } from "../../../sessions/authorization/internal/internal_authorization.service"; import { AuthorizationAdminSessionsService } from "../../sessions/authorization/authorization.service"; import { DatabaseService } from "../../../../database"; -import { ABSOLUTE_PATHS } from "../../../config"; +import { ABSOLUTE_PATHS_BACKEND } from "../../../.."; @Controller("files") export class DownloadFilesAdminController { @@ -30,7 +30,7 @@ export class DownloadFilesAdminController { @Req() req: Request, @Param() { file }: { file: string } ): Promise { - const path = join(ABSOLUTE_PATHS.uploads.temp, file); + const path = join(ABSOLUTE_PATHS_BACKEND.uploads.temp, file); if (!existsSync(path)) { res.status(404); diff --git a/apps/backend/src/plugins/core/admin/groups/create/create.resolver.ts b/packages/backend/src/core/admin/groups/create/create.resolver.ts similarity index 91% rename from apps/backend/src/plugins/core/admin/groups/create/create.resolver.ts rename to packages/backend/src/core/admin/groups/create/create.resolver.ts index 9442e7074..5888fe90f 100644 --- a/apps/backend/src/plugins/core/admin/groups/create/create.resolver.ts +++ b/packages/backend/src/core/admin/groups/create/create.resolver.ts @@ -1,11 +1,12 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { SetMetadata, UseGuards } from "@nestjs/common"; -import { AdminPermissionGuards } from "vitnode-backend"; import { CreateAdminGroupsService } from "./create.service"; import { CreateAdminGroupsArgs } from "./dto/create.args"; import { ShowAdminGroups } from "../show/dto/show.obj"; +import { AdminPermissionGuards } from "../../../../utils"; + @Resolver() export class CreateAdminGroupsResolver { constructor(private readonly service: CreateAdminGroupsService) {} diff --git a/apps/backend/src/plugins/core/admin/groups/create/create.service.ts b/packages/backend/src/core/admin/groups/create/create.service.ts similarity index 79% rename from apps/backend/src/plugins/core/admin/groups/create/create.service.ts rename to packages/backend/src/core/admin/groups/create/create.service.ts index 2d17b8b60..1faa3646d 100644 --- a/apps/backend/src/plugins/core/admin/groups/create/create.service.ts +++ b/packages/backend/src/core/admin/groups/create/create.service.ts @@ -1,14 +1,14 @@ import { Injectable } from "@nestjs/common"; -import { DatabaseService } from "vitnode-backend"; import { ShowAdminGroups } from "../show/dto/show.obj"; import { CreateAdminGroupsArgs } from "./dto/create.args"; +import { DatabaseService } from "../../../../database"; +import { ParserTextLanguageCoreHelpersService } from "../../../helpers/text_language/parser/parser.service"; import { core_groups, core_groups_names -} from "@/plugins/core/admin/database/schema/groups"; -import { ParserTextLanguageCoreHelpersService } from "@/plugins/core/helpers/text_language/parser/parser.service"; +} from "../../../../templates/core/admin/database/schema/groups"; @Injectable() export class CreateAdminGroupsService { diff --git a/apps/backend/src/plugins/core/admin/groups/create/dto/create.args.ts b/packages/backend/src/core/admin/groups/create/dto/create.args.ts similarity index 96% rename from apps/backend/src/plugins/core/admin/groups/create/dto/create.args.ts rename to packages/backend/src/core/admin/groups/create/dto/create.args.ts index 5497b0284..08d370576 100644 --- a/apps/backend/src/plugins/core/admin/groups/create/dto/create.args.ts +++ b/packages/backend/src/core/admin/groups/create/dto/create.args.ts @@ -1,11 +1,12 @@ import { ArgsType, Field, InputType, Int } from "@nestjs/graphql"; import { ArrayMinSize, IsArray, Min, ValidateNested } from "class-validator"; import { Transform } from "class-transformer"; + import { IsTextLanguageInput, TextLanguageInput, TransformTextLanguageInput -} from "vitnode-backend"; +} from "../../../../../utils"; @InputType() export class ContentCreateAdminGroups { diff --git a/apps/backend/src/plugins/core/admin/groups/delete/delete.resolver.ts b/packages/backend/src/core/admin/groups/delete/delete.resolver.ts similarity index 91% rename from apps/backend/src/plugins/core/admin/groups/delete/delete.resolver.ts rename to packages/backend/src/core/admin/groups/delete/delete.resolver.ts index 1c0d3c40d..b963e4958 100644 --- a/apps/backend/src/plugins/core/admin/groups/delete/delete.resolver.ts +++ b/packages/backend/src/core/admin/groups/delete/delete.resolver.ts @@ -1,10 +1,11 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards } from "vitnode-backend"; import { DeleteAdminGroupsService } from "./delete.service"; import { DeleteAdminGroupsArgs } from "./dto/delete.args"; +import { AdminAuthGuards } from "../../../../utils"; + @Resolver() export class DeleteAdminGroupsResolver { constructor(private readonly service: DeleteAdminGroupsService) {} diff --git a/apps/backend/src/plugins/core/admin/groups/delete/delete.service.ts b/packages/backend/src/core/admin/groups/delete/delete.service.ts similarity index 80% rename from apps/backend/src/plugins/core/admin/groups/delete/delete.service.ts rename to packages/backend/src/core/admin/groups/delete/delete.service.ts index 841c16c03..7427dc26b 100644 --- a/apps/backend/src/plugins/core/admin/groups/delete/delete.service.ts +++ b/packages/backend/src/core/admin/groups/delete/delete.service.ts @@ -1,11 +1,12 @@ import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; -import { NotFoundError, DatabaseService } from "vitnode-backend"; import { DeleteAdminGroupsArgs } from "./dto/delete.args"; -import { core_users } from "@/plugins/core/admin/database/schema/users"; -import { core_groups } from "@/plugins/core/admin/database/schema/groups"; +import { DatabaseService } from "../../../../database"; +import { NotFoundError } from "../../../../errors"; +import { core_users } from "../../../../templates/core/admin/database/schema/users"; +import { core_groups } from "../../../../templates/core/admin/database/schema/groups"; @Injectable() export class DeleteAdminGroupsService { diff --git a/apps/backend/src/plugins/core/admin/groups/delete/dto/delete.args.ts b/packages/backend/src/core/admin/groups/delete/dto/delete.args.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/groups/delete/dto/delete.args.ts rename to packages/backend/src/core/admin/groups/delete/dto/delete.args.ts diff --git a/apps/backend/src/plugins/core/admin/groups/edit/dto/edit.args.ts b/packages/backend/src/core/admin/groups/edit/dto/edit.args.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/groups/edit/dto/edit.args.ts rename to packages/backend/src/core/admin/groups/edit/dto/edit.args.ts diff --git a/apps/backend/src/plugins/core/admin/groups/edit/edit.resolver.ts b/packages/backend/src/core/admin/groups/edit/edit.resolver.ts similarity index 91% rename from apps/backend/src/plugins/core/admin/groups/edit/edit.resolver.ts rename to packages/backend/src/core/admin/groups/edit/edit.resolver.ts index b93558568..a39867947 100644 --- a/apps/backend/src/plugins/core/admin/groups/edit/edit.resolver.ts +++ b/packages/backend/src/core/admin/groups/edit/edit.resolver.ts @@ -1,11 +1,12 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards } from "vitnode-backend"; import { ShowAdminGroups } from "../show/dto/show.obj"; import { EditAdminGroupsService } from "./edit.service"; import { EditAdminGroupsArgs } from "./dto/edit.args"; +import { AdminAuthGuards } from "../../../../utils"; + @Resolver() export class EditAdminGroupsResolver { constructor(private readonly service: EditAdminGroupsService) {} diff --git a/apps/backend/src/plugins/core/admin/groups/edit/edit.service.ts b/packages/backend/src/core/admin/groups/edit/edit.service.ts similarity index 80% rename from apps/backend/src/plugins/core/admin/groups/edit/edit.service.ts rename to packages/backend/src/core/admin/groups/edit/edit.service.ts index 9f71df933..5477446c9 100644 --- a/apps/backend/src/plugins/core/admin/groups/edit/edit.service.ts +++ b/packages/backend/src/core/admin/groups/edit/edit.service.ts @@ -1,16 +1,17 @@ import { Injectable } from "@nestjs/common"; import { count, eq } from "drizzle-orm"; -import { NotFoundError, DatabaseService } from "vitnode-backend"; import { EditAdminGroupsArgs } from "./dto/edit.args"; import { ShowAdminGroups } from "../show/dto/show.obj"; +import { DatabaseService } from "../../../../database"; +import { ParserTextLanguageCoreHelpersService } from "../../../helpers/text_language/parser/parser.service"; +import { NotFoundError } from "../../../../errors"; import { core_groups, core_groups_names -} from "@/plugins/core/admin/database/schema/groups"; -import { core_users } from "@/plugins/core/admin/database/schema/users"; -import { ParserTextLanguageCoreHelpersService } from "@/plugins/core/helpers/text_language/parser/parser.service"; +} from "../../../../templates/core/admin/database/schema/groups"; +import { core_users } from "../../../../templates/core/admin/database/schema/users"; @Injectable() export class EditAdminGroupsService { diff --git a/apps/backend/src/plugins/core/admin/groups/groups.module.ts b/packages/backend/src/core/admin/groups/groups.module.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/groups/groups.module.ts rename to packages/backend/src/core/admin/groups/groups.module.ts diff --git a/apps/backend/src/plugins/core/admin/groups/show/dto/show.args.ts b/packages/backend/src/core/admin/groups/show/dto/show.args.ts similarity index 96% rename from apps/backend/src/plugins/core/admin/groups/show/dto/show.args.ts rename to packages/backend/src/core/admin/groups/show/dto/show.args.ts index b5a7f11a8..1bc942bbe 100644 --- a/apps/backend/src/plugins/core/admin/groups/show/dto/show.args.ts +++ b/packages/backend/src/core/admin/groups/show/dto/show.args.ts @@ -1,10 +1,11 @@ import { ArgsType, Field, InputType, registerEnumType } from "@nestjs/graphql"; import { Transform } from "class-transformer"; + import { PaginationArgs, SortDirectionEnum, TransformString -} from "vitnode-backend"; +} from "../../../../../utils"; enum ShowAdminGroupsSortingColumnEnum { created = "created", diff --git a/apps/backend/src/plugins/core/admin/groups/show/dto/show.obj.ts b/packages/backend/src/core/admin/groups/show/dto/show.obj.ts similarity index 93% rename from apps/backend/src/plugins/core/admin/groups/show/dto/show.obj.ts rename to packages/backend/src/core/admin/groups/show/dto/show.obj.ts index 2b200e096..63545e161 100644 --- a/apps/backend/src/plugins/core/admin/groups/show/dto/show.obj.ts +++ b/packages/backend/src/core/admin/groups/show/dto/show.obj.ts @@ -1,5 +1,6 @@ import { Field, Int, ObjectType } from "@nestjs/graphql"; -import { PageInfo, TextLanguage } from "vitnode-backend"; + +import { PageInfo, TextLanguage } from "../../../../../utils"; @ObjectType() export class ContentShowAdminGroups { diff --git a/apps/backend/src/plugins/core/admin/groups/show/show.resolver.ts b/packages/backend/src/core/admin/groups/show/show.resolver.ts similarity index 91% rename from apps/backend/src/plugins/core/admin/groups/show/show.resolver.ts rename to packages/backend/src/core/admin/groups/show/show.resolver.ts index 38afb0a73..f5a43d14b 100644 --- a/apps/backend/src/plugins/core/admin/groups/show/show.resolver.ts +++ b/packages/backend/src/core/admin/groups/show/show.resolver.ts @@ -1,11 +1,12 @@ import { UseGuards } from "@nestjs/common"; import { Args, Query, Resolver } from "@nestjs/graphql"; -import { AdminAuthGuards } from "vitnode-backend"; import { ShowAdminGroupsService } from "./show.service"; import { ShowAdminGroupsObj } from "./dto/show.obj"; import { ShowAdminGroupsArgs } from "./dto/show.args"; +import { AdminAuthGuards } from "../../../../utils"; + @Resolver() export class ShowAdminGroupsResolver { constructor(private readonly service: ShowAdminGroupsService) {} diff --git a/apps/backend/src/plugins/core/admin/groups/show/show.service.ts b/packages/backend/src/core/admin/groups/show/show.service.ts similarity index 88% rename from apps/backend/src/plugins/core/admin/groups/show/show.service.ts rename to packages/backend/src/core/admin/groups/show/show.service.ts index 34e41f6f4..0cb6860ec 100644 --- a/apps/backend/src/plugins/core/admin/groups/show/show.service.ts +++ b/packages/backend/src/core/admin/groups/show/show.service.ts @@ -1,11 +1,5 @@ import { Injectable } from "@nestjs/common"; import { and, count, eq, ilike, inArray } from "drizzle-orm"; -import { - inputPaginationCursor, - outputPagination, - SortDirectionEnum, - DatabaseService -} from "vitnode-backend"; import { ShowAdminGroupsArgs } from "./dto/show.args"; import { ShowAdminGroupsObj } from "./dto/show.obj"; @@ -13,8 +7,11 @@ import { ShowAdminGroupsObj } from "./dto/show.obj"; import { core_groups, core_groups_names -} from "@/plugins/core/admin/database/schema/groups"; -import { core_users } from "../../database/schema/users"; +} from "../../../../templates/core/admin/database/schema/groups"; +import { inputPaginationCursor, outputPagination } from "../../../../functions"; +import { core_users } from "../../../../templates/core/admin/database/schema/users"; +import { SortDirectionEnum } from "../../../../utils"; +import { DatabaseService } from "../../../../database"; @Injectable() export class ShowAdminGroupsService { diff --git a/apps/backend/src/plugins/core/admin/metadata/manifest/edit/dto/edit.args.ts b/packages/backend/src/core/admin/metadata/manifest/edit/dto/edit.args.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/metadata/manifest/edit/dto/edit.args.ts rename to packages/backend/src/core/admin/metadata/manifest/edit/dto/edit.args.ts diff --git a/apps/backend/src/plugins/core/admin/metadata/manifest/edit/edit.resolver.ts b/packages/backend/src/core/admin/metadata/manifest/edit/edit.resolver.ts similarity index 92% rename from apps/backend/src/plugins/core/admin/metadata/manifest/edit/edit.resolver.ts rename to packages/backend/src/core/admin/metadata/manifest/edit/edit.resolver.ts index 71249827c..d82c1100b 100644 --- a/apps/backend/src/plugins/core/admin/metadata/manifest/edit/edit.resolver.ts +++ b/packages/backend/src/core/admin/metadata/manifest/edit/edit.resolver.ts @@ -1,11 +1,12 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards } from "vitnode-backend"; import { EditAdminManifestMetadataService } from "./edit.service"; import { EditAdminManifestMetadataObj } from "./dto/edit.args"; import { ShowAdminManifestMetadataObj } from "../show/dto/show.obj"; +import { AdminAuthGuards } from "../../../../../utils"; + @Resolver() export class EditAdminManifestMetadataResolver { constructor(private readonly service: EditAdminManifestMetadataService) {} diff --git a/apps/backend/src/plugins/core/admin/metadata/manifest/edit/edit.service.ts b/packages/backend/src/core/admin/metadata/manifest/edit/edit.service.ts similarity index 86% rename from apps/backend/src/plugins/core/admin/metadata/manifest/edit/edit.service.ts rename to packages/backend/src/core/admin/metadata/manifest/edit/edit.service.ts index 599560a49..1d8e61813 100644 --- a/apps/backend/src/plugins/core/admin/metadata/manifest/edit/edit.service.ts +++ b/packages/backend/src/core/admin/metadata/manifest/edit/edit.service.ts @@ -3,14 +3,14 @@ import { join } from "path"; import { Injectable } from "@nestjs/common"; import { ConfigService } from "@nestjs/config"; -import { DatabaseService } from "vitnode-backend"; import { EditAdminManifestMetadataObj } from "./dto/edit.args"; import { ShowAdminManifestMetadataObj } from "../show/dto/show.obj"; import { getManifest } from "../functions"; -import { core_languages } from "../../../database/schema/languages"; -import { ABSOLUTE_PATHS } from "@/config"; +import { DatabaseService } from "../../../../../database"; +import { ABSOLUTE_PATHS_BACKEND } from "../../../../.."; +import { core_languages } from "../../../../../templates/core/admin/database/schema/languages"; @Injectable() export class EditAdminManifestMetadataService { @@ -37,7 +37,7 @@ export class EditAdminManifestMetadataService { fs.writeFileSync( join( - ABSOLUTE_PATHS.uploads.public, + ABSOLUTE_PATHS_BACKEND.uploads.public, "assets", lang_code, "manifest.webmanifest" diff --git a/apps/backend/src/plugins/core/admin/metadata/manifest/functions.ts b/packages/backend/src/core/admin/metadata/manifest/functions.ts similarity index 81% rename from apps/backend/src/plugins/core/admin/metadata/manifest/functions.ts rename to packages/backend/src/core/admin/metadata/manifest/functions.ts index 5cb9eb3d7..21baae5ce 100644 --- a/apps/backend/src/plugins/core/admin/metadata/manifest/functions.ts +++ b/packages/backend/src/core/admin/metadata/manifest/functions.ts @@ -1,11 +1,9 @@ import { join } from "path"; import * as fs from "fs"; -import { NotFoundError } from "vitnode-backend"; - import { ShowAdminManifestMetadataObj } from "./show/dto/show.obj"; -import { ABSOLUTE_PATHS } from "@/config"; +import { ABSOLUTE_PATHS_BACKEND, NotFoundError } from "../../../.."; export const getManifest = ({ lang_code @@ -13,7 +11,7 @@ export const getManifest = ({ lang_code: string; }): ShowAdminManifestMetadataObj => { const path = join( - ABSOLUTE_PATHS.uploads.public, + ABSOLUTE_PATHS_BACKEND.uploads.public, "assets", lang_code, "manifest.webmanifest" diff --git a/apps/backend/src/plugins/core/admin/metadata/manifest/show/dto/show.obj.ts b/packages/backend/src/core/admin/metadata/manifest/show/dto/show.obj.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/metadata/manifest/show/dto/show.obj.ts rename to packages/backend/src/core/admin/metadata/manifest/show/dto/show.obj.ts diff --git a/apps/backend/src/plugins/core/admin/metadata/manifest/show/show.resolver.ts b/packages/backend/src/core/admin/metadata/manifest/show/show.resolver.ts similarity index 90% rename from apps/backend/src/plugins/core/admin/metadata/manifest/show/show.resolver.ts rename to packages/backend/src/core/admin/metadata/manifest/show/show.resolver.ts index e2032ff5d..dfbe62bce 100644 --- a/apps/backend/src/plugins/core/admin/metadata/manifest/show/show.resolver.ts +++ b/packages/backend/src/core/admin/metadata/manifest/show/show.resolver.ts @@ -1,10 +1,11 @@ import { Query, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards } from "vitnode-backend"; import { ShowAdminManifestMetadataService } from "./show.service"; import { ShowAdminManifestMetadataObj } from "./dto/show.obj"; +import { AdminAuthGuards } from "../../../../../utils"; + @Resolver() export class ShowAdminManifestMetadataResolver { constructor(private readonly service: ShowAdminManifestMetadataService) {} diff --git a/apps/backend/src/plugins/core/admin/metadata/manifest/show/show.service.ts b/packages/backend/src/core/admin/metadata/manifest/show/show.service.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/metadata/manifest/show/show.service.ts rename to packages/backend/src/core/admin/metadata/manifest/show/show.service.ts diff --git a/apps/backend/src/plugins/core/admin/metadata/metadata.module.ts b/packages/backend/src/core/admin/metadata/metadata.module.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/metadata/metadata.module.ts rename to packages/backend/src/core/admin/metadata/metadata.module.ts diff --git a/apps/backend/src/plugins/core/admin/settings/functions/get-core-info.ts b/packages/backend/src/core/admin/settings/functions/get-core-info.ts similarity index 92% rename from apps/backend/src/plugins/core/admin/settings/functions/get-core-info.ts rename to packages/backend/src/core/admin/settings/functions/get-core-info.ts index 68c71af37..2efe0a6c4 100644 --- a/apps/backend/src/plugins/core/admin/settings/functions/get-core-info.ts +++ b/packages/backend/src/core/admin/settings/functions/get-core-info.ts @@ -1,7 +1,7 @@ import { join } from "path"; import * as fs from "fs"; -import { PluginInfoJSONType } from "vitnode-backend"; +import { PluginInfoJSONType } from "../../plugins/type"; export const getCoreInfo = async () => { const path = join(process.cwd(), "src", "plugins", "core"); diff --git a/apps/backend/src/plugins/core/admin/settings/main/edit/dto/edit.args.ts b/packages/backend/src/core/admin/settings/main/edit/dto/edit.args.ts similarity index 85% rename from apps/backend/src/plugins/core/admin/settings/main/edit/dto/edit.args.ts rename to packages/backend/src/core/admin/settings/main/edit/dto/edit.args.ts index d1e5055b7..283d0d500 100644 --- a/apps/backend/src/plugins/core/admin/settings/main/edit/dto/edit.args.ts +++ b/packages/backend/src/core/admin/settings/main/edit/dto/edit.args.ts @@ -1,5 +1,6 @@ import { ArgsType, Field } from "@nestjs/graphql"; -import { TextLanguageInput } from "vitnode-backend"; + +import { TextLanguageInput } from "../../../../../../utils"; @ArgsType() export class EditAdminMainSettingsArgs { diff --git a/apps/backend/src/plugins/core/admin/settings/main/edit/dto/edit.obj.ts b/packages/backend/src/core/admin/settings/main/edit/dto/edit.obj.ts similarity index 77% rename from apps/backend/src/plugins/core/admin/settings/main/edit/dto/edit.obj.ts rename to packages/backend/src/core/admin/settings/main/edit/dto/edit.obj.ts index 202b9ceac..7459e6089 100644 --- a/apps/backend/src/plugins/core/admin/settings/main/edit/dto/edit.obj.ts +++ b/packages/backend/src/core/admin/settings/main/edit/dto/edit.obj.ts @@ -1,6 +1,6 @@ import { ObjectType, PickType } from "@nestjs/graphql"; -import { ShowSettingsObj } from "@/plugins/core/settings/show/dto/show.obj"; +import { ShowSettingsObj } from "../../../../../settings/show/dto/show.obj"; @ObjectType() export class EditAdminSettingsObj extends PickType(ShowSettingsObj, [ diff --git a/apps/backend/src/plugins/core/admin/settings/main/edit/edit.resolver.ts b/packages/backend/src/core/admin/settings/main/edit/edit.resolver.ts similarity index 91% rename from apps/backend/src/plugins/core/admin/settings/main/edit/edit.resolver.ts rename to packages/backend/src/core/admin/settings/main/edit/edit.resolver.ts index 42947471e..cbeaf6705 100644 --- a/apps/backend/src/plugins/core/admin/settings/main/edit/edit.resolver.ts +++ b/packages/backend/src/core/admin/settings/main/edit/edit.resolver.ts @@ -1,11 +1,12 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards } from "vitnode-backend"; import { EditAdminMainSettingsService } from "./edit.service"; import { EditAdminMainSettingsArgs } from "./dto/edit.args"; import { EditAdminSettingsObj } from "./dto/edit.obj"; +import { AdminAuthGuards } from "../../../../../utils"; + @Resolver() export class EditAdminMainSettingsResolver { constructor(private readonly service: EditAdminMainSettingsService) {} diff --git a/apps/backend/src/plugins/core/admin/settings/main/edit/edit.service.ts b/packages/backend/src/core/admin/settings/main/edit/edit.service.ts similarity index 91% rename from apps/backend/src/plugins/core/admin/settings/main/edit/edit.service.ts rename to packages/backend/src/core/admin/settings/main/edit/edit.service.ts index dc8746326..58125be2b 100644 --- a/apps/backend/src/plugins/core/admin/settings/main/edit/edit.service.ts +++ b/packages/backend/src/core/admin/settings/main/edit/edit.service.ts @@ -3,19 +3,19 @@ import { join } from "path"; import { Injectable } from "@nestjs/common"; import { eq } from "drizzle-orm"; -import { DatabaseService } from "vitnode-backend"; import { EditAdminMainSettingsArgs } from "./dto/edit.args"; import { EditAdminSettingsObj } from "./dto/edit.obj"; -import { core_languages } from "../../../database/schema/languages"; -import { ManifestWithLang } from "@/plugins/core/settings/settings.module"; +import { DatabaseService } from "../../../../../database"; import { - ABSOLUTE_PATHS, + ABSOLUTE_PATHS_BACKEND, ConfigType, configPath, getConfigFile -} from "@/config"; +} from "../../../../.."; +import { ManifestWithLang } from "../../../../settings/settings.module"; +import { core_languages } from "../../../../../templates/core/admin/database/schema/languages"; @Injectable() export class EditAdminMainSettingsService { @@ -37,7 +37,7 @@ export class EditAdminMainSettingsService { : site_description.find(el => el.value); const path = join( - ABSOLUTE_PATHS.uploads.public, + ABSOLUTE_PATHS_BACKEND.uploads.public, "assets", item.language_code, "manifest.webmanifest" @@ -65,7 +65,7 @@ export class EditAdminMainSettingsService { ""; const path = join( - ABSOLUTE_PATHS.uploads.public, + ABSOLUTE_PATHS_BACKEND.uploads.public, "assets", item.code, "manifest.webmanifest" diff --git a/apps/backend/src/plugins/core/admin/settings/main/general.module.ts b/packages/backend/src/core/admin/settings/main/general.module.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/settings/main/general.module.ts rename to packages/backend/src/core/admin/settings/main/general.module.ts diff --git a/apps/backend/src/plugins/core/admin/settings/settings.module.ts b/packages/backend/src/core/admin/settings/settings.module.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/settings/settings.module.ts rename to packages/backend/src/core/admin/settings/settings.module.ts diff --git a/packages/backend/src/core/config.ts b/packages/backend/src/core/config.ts index 4a1c1484e..ae95de5fd 100644 --- a/packages/backend/src/core/config.ts +++ b/packages/backend/src/core/config.ts @@ -1,81 +1,6 @@ import * as fs from "fs"; import { join } from "path"; -const internalPaths = { - uploads: join(process.cwd(), "uploads"), - frontend: join(process.cwd(), "..", "frontend"), - plugins: join(process.cwd(), "src", "plugins") -}; - -export const ABSOLUTE_PATHS = { - uploads: { - init: internalPaths.uploads, - public: join(internalPaths.uploads, "public"), - private: join(internalPaths.uploads, "private"), - temp: join(internalPaths.uploads, "temp") - }, - frontend: { - init: internalPaths.frontend - }, - backend: join(process.cwd(), "src"), - plugins: internalPaths.plugins, - plugin: ({ code }: { code: string }) => ({ - root: join(internalPaths.plugins, code), - config: join(internalPaths.plugins, code, "config.json"), - versions: join(internalPaths.plugins, code, "versions.json"), - database: { - schema: join(internalPaths.plugins, code, "admin", "database", "schema"), - migrations: join( - internalPaths.plugins, - code, - "admin", - "database", - "migrations" - ), - migration_info: join( - internalPaths.plugins, - code, - "admin", - "database", - "migrations", - "meta", - "_journal.json" - ) - }, - frontend: { - admin_pages: join( - internalPaths.frontend, - "app", - "[locale]", - "(admin)", - "admin", - "(auth)", - code - ), - admin_templates: join(internalPaths.frontend, "plugins", code, "admin"), - pages_container: join( - internalPaths.frontend, - "app", - "[locale]", - "(main)", - "(container)", - code - ), - default_page: join( - internalPaths.frontend, - "plugins", - code, - "templates", - "default-page.tsx" - ), - pages: join(internalPaths.frontend, "app", "[locale]", "(main)", code), - templates: join(internalPaths.frontend, "plugins", code, "templates"), - plugin: join(internalPaths.frontend, "plugins", code), - language: join(internalPaths.frontend, "plugins", code, "langs") - } - }) -}; - export interface ConfigType { editor: { files: { diff --git a/packages/backend/src/core/core.module.ts b/packages/backend/src/core/core.module.ts index 3c4fbda5d..61d011e76 100644 --- a/packages/backend/src/core/core.module.ts +++ b/packages/backend/src/core/core.module.ts @@ -12,6 +12,8 @@ import { CoreLanguagesModule } from "./languages/languages.module"; import { CoreFilesModule, GlobalCoreFilesModule } from "./files/files.module"; import { CoreEditorModule } from "./editor/editor.module"; import { CoreMembersModule } from "./members/members.module"; +import { CoreMiddlewareModule } from "./middleware/middleware.module"; +import { CoreSettingsModule } from "./settings/settings.module"; @Module({ imports: [ @@ -25,7 +27,9 @@ import { CoreMembersModule } from "./members/members.module"; GlobalCoreFilesModule, CoreFilesModule, CoreEditorModule, - CoreMembersModule + CoreMembersModule, + CoreMiddlewareModule, + CoreSettingsModule ] }) export class CoreModule {} diff --git a/apps/backend/src/plugins/core/middleware/dto/middleware.obj.ts b/packages/backend/src/core/middleware/dto/middleware.obj.ts similarity index 100% rename from apps/backend/src/plugins/core/middleware/dto/middleware.obj.ts rename to packages/backend/src/core/middleware/dto/middleware.obj.ts diff --git a/apps/backend/src/plugins/core/middleware/middleware.cron.ts b/packages/backend/src/core/middleware/middleware.cron.ts similarity index 85% rename from apps/backend/src/plugins/core/middleware/middleware.cron.ts rename to packages/backend/src/core/middleware/middleware.cron.ts index 0be3f5f14..81c7b5119 100644 --- a/apps/backend/src/plugins/core/middleware/middleware.cron.ts +++ b/packages/backend/src/core/middleware/middleware.cron.ts @@ -2,9 +2,9 @@ import { Injectable } from "@nestjs/common"; import { Cron, CronExpression } from "@nestjs/schedule"; import { lte } from "drizzle-orm"; import { ConfigService } from "@nestjs/config"; -import { DatabaseService } from "vitnode-backend"; -import { core_sessions_known_devices } from "@/plugins/core/admin/database/schema/sessions"; +import { DatabaseService } from "../../database"; +import { core_sessions_known_devices } from "../../templates/core/admin/database/schema/sessions"; @Injectable() export class CoreMiddlewareCron { diff --git a/apps/backend/src/plugins/core/middleware/middleware.module.ts b/packages/backend/src/core/middleware/middleware.module.ts similarity index 100% rename from apps/backend/src/plugins/core/middleware/middleware.module.ts rename to packages/backend/src/core/middleware/middleware.module.ts diff --git a/apps/backend/src/plugins/core/middleware/show/dto/languages.obj.ts b/packages/backend/src/core/middleware/show/dto/languages.obj.ts similarity index 100% rename from apps/backend/src/plugins/core/middleware/show/dto/languages.obj.ts rename to packages/backend/src/core/middleware/show/dto/languages.obj.ts diff --git a/apps/backend/src/plugins/core/middleware/show/show.resolver.ts b/packages/backend/src/core/middleware/show/show.resolver.ts similarity index 100% rename from apps/backend/src/plugins/core/middleware/show/show.resolver.ts rename to packages/backend/src/core/middleware/show/show.resolver.ts diff --git a/apps/backend/src/plugins/core/middleware/show/show.service.ts b/packages/backend/src/core/middleware/show/show.service.ts similarity index 78% rename from apps/backend/src/plugins/core/middleware/show/show.service.ts rename to packages/backend/src/core/middleware/show/show.service.ts index 53fd46a00..fc55e2c04 100644 --- a/apps/backend/src/plugins/core/middleware/show/show.service.ts +++ b/packages/backend/src/core/middleware/show/show.service.ts @@ -4,14 +4,14 @@ import { Injectable } from "@nestjs/common"; import { ShowCoreMiddlewareObj } from "./dto/languages.obj"; -import { ABSOLUTE_PATHS, getConfigFile } from "@/config"; +import { ABSOLUTE_PATHS_BACKEND, getConfigFile } from "../../.."; @Injectable() export class ShowCoreMiddlewareService { async languages(): Promise { const config = getConfigFile(); - const plugins = await readdir(ABSOLUTE_PATHS.plugins); + const plugins = await readdir(ABSOLUTE_PATHS_BACKEND.plugins); return { languages: config.langs, diff --git a/apps/backend/src/plugins/core/settings/settings.module.ts b/packages/backend/src/core/settings/settings.module.ts similarity index 100% rename from apps/backend/src/plugins/core/settings/settings.module.ts rename to packages/backend/src/core/settings/settings.module.ts diff --git a/apps/backend/src/plugins/core/settings/show/dto/show.obj.ts b/packages/backend/src/core/settings/show/dto/show.obj.ts similarity index 86% rename from apps/backend/src/plugins/core/settings/show/dto/show.obj.ts rename to packages/backend/src/core/settings/show/dto/show.obj.ts index 7ff283799..4c8a3c3a8 100644 --- a/apps/backend/src/plugins/core/settings/show/dto/show.obj.ts +++ b/packages/backend/src/core/settings/show/dto/show.obj.ts @@ -1,5 +1,6 @@ import { Field, ObjectType } from "@nestjs/graphql"; -import { TextLanguage } from "vitnode-backend"; + +import { TextLanguage } from "../../../../utils"; @ObjectType() export class ShowSettingsObj { diff --git a/apps/backend/src/plugins/core/settings/show/show.resolver.ts b/packages/backend/src/core/settings/show/show.resolver.ts similarity index 100% rename from apps/backend/src/plugins/core/settings/show/show.resolver.ts rename to packages/backend/src/core/settings/show/show.resolver.ts diff --git a/apps/backend/src/plugins/core/settings/show/show.service.ts b/packages/backend/src/core/settings/show/show.service.ts similarity index 85% rename from apps/backend/src/plugins/core/settings/show/show.service.ts rename to packages/backend/src/core/settings/show/show.service.ts index 1bd905b9f..5df677f7c 100644 --- a/apps/backend/src/plugins/core/settings/show/show.service.ts +++ b/packages/backend/src/core/settings/show/show.service.ts @@ -2,13 +2,13 @@ import { join } from "path"; import * as fs from "fs"; import { Injectable } from "@nestjs/common"; -import { DatabaseService } from "vitnode-backend"; import { ShowSettingsObj } from "./dto/show.obj"; import { ManifestWithLang } from "../settings.module"; -import { core_languages } from "../../admin/database/schema/languages"; -import { ABSOLUTE_PATHS, getConfigFile } from "@/config"; +import { DatabaseService } from "../../../database"; +import { ABSOLUTE_PATHS_BACKEND, getConfigFile } from "../../.."; +import { core_languages } from "../../../templates/core/admin/database/schema/languages"; @Injectable() export class ShowSettingsService { @@ -21,7 +21,7 @@ export class ShowSettingsService { }): ManifestWithLang[] { return langCodes.map(lang => { const path = join( - ABSOLUTE_PATHS.uploads.public, + ABSOLUTE_PATHS_BACKEND.uploads.public, "assets", lang, "manifest.webmanifest" From 2dc9d95c37820f1ca54300d7b3e6aa07b53dc776 Mon Sep 17 00:00:00 2001 From: aXenDeveloper Date: Sat, 22 Jun 2024 11:32:23 +0200 Subject: [PATCH 19/27] perf(backend): Move email module to package --- .../admin/categories/create/create.service.ts | 2 +- .../plugins/core/{admin/email => }/.gitignore | 0 .../src/plugins/core/admin/admin.module.ts | 10 - apps/backend/src/plugins/core/config.json | 10 - apps/backend/src/plugins/core/core.module.ts | 11 -- .../plugins/core/helpers/helpers.module.ts | 10 - .../text_language/parser/helpers.service.ts | 96 ---------- .../text_language/parser/parser.service.ts | 180 ------------------ .../core/theme_editor/theme_editor.module.ts | 9 - apps/backend/src/plugins/core/versions.json | 3 - apps/backend/src/plugins/plugins.module.ts | 4 +- packages/backend/package.json | 7 + .../backend/src/core/admin/admin.module.ts | 8 +- .../src}/core/admin/email/email.module.ts | 0 .../admin/email/emails/_components/header.tsx | 0 .../admin/email/emails/email-template.tsx | 0 .../src}/core/admin/email/helpers.service.ts | 7 +- .../backend/src}/core/admin/email/helpers.ts | 16 +- .../src}/core/admin/email/mail.service.ts | 18 +- .../core/admin/email/send/send.service.ts | 0 .../email/settings/edit/dto/edit.args.ts | 0 .../email/settings/edit/edit.resolver.ts | 2 +- .../admin/email/settings/edit/edit.service.ts | 2 +- .../admin/email/settings/show/dto/show.obj.ts | 0 .../email/settings/show/show.resolver.ts | 2 +- .../admin/email/settings/show/show.service.ts | 2 +- .../email/settings/test/dto/test.args.ts | 2 +- .../email/settings/test/test.resolver.ts | 2 +- .../admin/email/settings/test/test.service.ts | 0 .../create_database.resolver.ts | 0 .../create_database.service.ts | 17 +- .../src}/core/admin/install/install.module.ts | 0 .../admin/install/layout/dto/layout.obj.ts | 0 .../admin/install/layout/layout.resolver.ts | 0 .../admin/install/layout/layout.service.ts | 12 +- .../admin/theme_editor/edit/dto/edit.args.ts | 0 .../admin/theme_editor/edit/edit.resolver.ts | 2 +- .../admin/theme_editor/edit/edit.service.ts | 31 +-- .../admin/theme_editor/theme_editor.module.ts | 0 packages/backend/src/core/core.module.ts | 4 +- .../core/theme_editor/show/dto/show.obj.ts | 0 .../core/theme_editor/show/show.resolver.ts | 0 .../core/theme_editor/show/show.service.ts | 8 +- .../core/theme_editor/theme_editor.module.ts | 27 +++ packages/backend/src/index.ts | 1 + packages/backend/tsconfig.json | 1 + pnpm-lock.yaml | 163 ++++++++++++++-- 47 files changed, 251 insertions(+), 418 deletions(-) rename apps/backend/src/plugins/core/{admin/email => }/.gitignore (100%) delete mode 100644 apps/backend/src/plugins/core/admin/admin.module.ts delete mode 100644 apps/backend/src/plugins/core/config.json delete mode 100644 apps/backend/src/plugins/core/core.module.ts delete mode 100644 apps/backend/src/plugins/core/helpers/helpers.module.ts delete mode 100644 apps/backend/src/plugins/core/helpers/text_language/parser/helpers.service.ts delete mode 100644 apps/backend/src/plugins/core/helpers/text_language/parser/parser.service.ts delete mode 100644 apps/backend/src/plugins/core/theme_editor/theme_editor.module.ts delete mode 100644 apps/backend/src/plugins/core/versions.json rename {apps/backend/src/plugins => packages/backend/src}/core/admin/email/email.module.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/email/emails/_components/header.tsx (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/email/emails/email-template.tsx (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/email/helpers.service.ts (78%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/email/helpers.ts (83%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/email/mail.service.ts (83%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/email/send/send.service.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/email/settings/edit/dto/edit.args.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/email/settings/edit/edit.resolver.ts (92%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/email/settings/edit/edit.service.ts (95%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/email/settings/show/dto/show.obj.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/email/settings/show/show.resolver.ts (90%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/email/settings/show/show.service.ts (92%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/email/settings/test/dto/test.args.ts (89%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/email/settings/test/test.resolver.ts (91%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/email/settings/test/test.service.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/install/create_database/create_database.resolver.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/install/create_database/create_database.service.ts (88%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/install/install.module.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/install/layout/dto/layout.obj.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/install/layout/layout.resolver.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/install/layout/layout.service.ts (72%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/theme_editor/edit/dto/edit.args.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/theme_editor/edit/edit.resolver.ts (91%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/theme_editor/edit/edit.service.ts (71%) rename {apps/backend/src/plugins => packages/backend/src}/core/admin/theme_editor/theme_editor.module.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/theme_editor/show/dto/show.obj.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/theme_editor/show/show.resolver.ts (100%) rename {apps/backend/src/plugins => packages/backend/src}/core/theme_editor/show/show.service.ts (89%) create mode 100644 packages/backend/src/core/theme_editor/theme_editor.module.ts diff --git a/apps/backend/src/plugins/blog/admin/categories/create/create.service.ts b/apps/backend/src/plugins/blog/admin/categories/create/create.service.ts index a63499377..ff6480476 100644 --- a/apps/backend/src/plugins/blog/admin/categories/create/create.service.ts +++ b/apps/backend/src/plugins/blog/admin/categories/create/create.service.ts @@ -10,7 +10,7 @@ import { blog_categories_name, blog_categories_permissions } from "../../database/schema/categories"; -import { ParserTextLanguageCoreHelpersService } from "@/plugins/core/helpers/text_language/parser/parser.service"; +import { ParserTextLanguageCoreHelpersService } from "vitnode-backend"; @Injectable() export class CreateBlogCategoriesService { diff --git a/apps/backend/src/plugins/core/admin/email/.gitignore b/apps/backend/src/plugins/core/.gitignore similarity index 100% rename from apps/backend/src/plugins/core/admin/email/.gitignore rename to apps/backend/src/plugins/core/.gitignore diff --git a/apps/backend/src/plugins/core/admin/admin.module.ts b/apps/backend/src/plugins/core/admin/admin.module.ts deleted file mode 100644 index b5a814c92..000000000 --- a/apps/backend/src/plugins/core/admin/admin.module.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Module } from "@nestjs/common"; - -import { AdminInstallModule } from "./install/install.module"; -import { AdminThemeEditorModule } from "./theme_editor/theme_editor.module"; -import { AdminEmailModule } from "./email/email.module"; - -@Module({ - imports: [AdminInstallModule, AdminThemeEditorModule, AdminEmailModule] -}) -export class AdminModule {} diff --git a/apps/backend/src/plugins/core/config.json b/apps/backend/src/plugins/core/config.json deleted file mode 100644 index 2c4cdd638..000000000 --- a/apps/backend/src/plugins/core/config.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "Core", - "description": "Core module for VitNode", - "code": "core", - "author": "VitNode", - "author_url": "https://vitnode.com/", - "support_url": "https://vitnode.com/", - "allow_default": false, - "nav": [] -} diff --git a/apps/backend/src/plugins/core/core.module.ts b/apps/backend/src/plugins/core/core.module.ts deleted file mode 100644 index 38010ca54..000000000 --- a/apps/backend/src/plugins/core/core.module.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Module } from "@nestjs/common"; - -import { AdminModule } from "./admin/admin.module"; -import { GlobalCoreHelpersModule } from "./helpers/helpers.module"; -import { CoreThemeEditorModule } from "./theme_editor/theme_editor.module"; - -@Module({ - imports: [AdminModule, GlobalCoreHelpersModule, CoreThemeEditorModule], - providers: [] -}) -export class CoreModule {} diff --git a/apps/backend/src/plugins/core/helpers/helpers.module.ts b/apps/backend/src/plugins/core/helpers/helpers.module.ts deleted file mode 100644 index 5f19b7b4b..000000000 --- a/apps/backend/src/plugins/core/helpers/helpers.module.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Global, Module } from "@nestjs/common"; - -import { ParserTextLanguageCoreHelpersService } from "./text_language/parser/parser.service"; - -@Global() -@Module({ - providers: [ParserTextLanguageCoreHelpersService], - exports: [ParserTextLanguageCoreHelpersService] -}) -export class GlobalCoreHelpersModule {} diff --git a/apps/backend/src/plugins/core/helpers/text_language/parser/helpers.service.ts b/apps/backend/src/plugins/core/helpers/text_language/parser/helpers.service.ts deleted file mode 100644 index 39b60caab..000000000 --- a/apps/backend/src/plugins/core/helpers/text_language/parser/helpers.service.ts +++ /dev/null @@ -1,96 +0,0 @@ -import { Injectable } from "@nestjs/common"; -import { eq } from "drizzle-orm"; -import { DatabaseService } from "vitnode-backend"; - -import { core_files_using } from "@/plugins/core/admin/database/schema/files"; - -interface TextLanguageJSONContentType { - type: string; - attrs?: { id: number }; - content?: TextLanguageJSONContentType[]; -} - -export interface InfoFromTextLanguageContentReturnValues { - fileIds: number[]; -} - -@Injectable() -export class HelpersParserTextLanguageCoreHelpersService { - protected state: InfoFromTextLanguageContentReturnValues = { - fileIds: [] - }; - - constructor(protected databaseService: DatabaseService) {} - - protected async parseFiles({ - fileIds, - oldFileIds - }: { - fileIds: InfoFromTextLanguageContentReturnValues["fileIds"]; - oldFileIds: InfoFromTextLanguageContentReturnValues["fileIds"]; - }) { - await Promise.all( - fileIds.map(async id => { - if (this.state.fileIds.includes(id)) return; - - this.state.fileIds.push(id); - - if (oldFileIds.includes(id)) return; - - await this.databaseService.db.insert(core_files_using).values({ - file_id: id, - plugin: "core", - folder: "text-language" - }); - }) - ); - - // Delete remaining files - await Promise.all( - oldFileIds.map(async id => { - const exist = this.state.fileIds.find(fileId => fileId === id); - if (exist) return; - - const fileUsing = - await this.databaseService.db.query.core_files_using.findFirst({ - where: (table, { eq }) => eq(table.file_id, id) - }); - - await this.databaseService.db - .delete(core_files_using) - .where(eq(core_files_using.id, fileUsing.id)); - }) - ); - } - - protected getInfoFromContent({ - content - }: { - content: string; - }): InfoFromTextLanguageContentReturnValues { - const fileIds: number[] = []; - - const mapContent = (values: TextLanguageJSONContentType[]) => { - values.forEach(value => { - // Get all file ids - if (value.type === "files" && !fileIds.includes(value.attrs.id)) { - fileIds.push(value.attrs.id); - } - - if (value.content) { - mapContent(value.content); - } - }); - }; - - try { - const json = JSON.parse(content).content as TextLanguageJSONContentType[]; - - mapContent(json); - } catch (error) { - /* empty */ - } - - return { fileIds }; - } -} diff --git a/apps/backend/src/plugins/core/helpers/text_language/parser/parser.service.ts b/apps/backend/src/plugins/core/helpers/text_language/parser/parser.service.ts deleted file mode 100644 index 28d29edd3..000000000 --- a/apps/backend/src/plugins/core/helpers/text_language/parser/parser.service.ts +++ /dev/null @@ -1,180 +0,0 @@ -import { Injectable } from "@nestjs/common"; -import { Placeholder, SQL, eq } from "drizzle-orm"; -import { PgTableWithColumns, TableConfig } from "drizzle-orm/pg-core"; -import { - CustomError, - TextLanguageInput, - DatabaseService -} from "vitnode-backend"; - -import { - HelpersParserTextLanguageCoreHelpersService, - InfoFromTextLanguageContentReturnValues -} from "./helpers.service"; - -interface Args { - data: TextLanguageInput[]; - database: PgTableWithColumns; - item_id: number; -} - -interface ReturnValues extends TextLanguageInput { - id: number; - item_id: number; -} - -@Injectable() -export class ParserTextLanguageCoreHelpersService extends HelpersParserTextLanguageCoreHelpersService { - constructor(databaseService: DatabaseService) { - super(databaseService); - } - - protected async contentParser({ - content, - infoOldData - }: { - content: string; - infoOldData: InfoFromTextLanguageContentReturnValues[]; - }) { - const oldInfo = infoOldData.reduce( - (acc, item) => { - // Check if already exists file id - item.fileIds.forEach(id => { - if (!acc.fileIds.includes(id)) { - acc.fileIds.push(id); - } - }); - - return acc; - }, - { fileIds: [] } as InfoFromTextLanguageContentReturnValues - ); - const info = this.getInfoFromContent({ content }); - - await this.parseFiles({ - oldFileIds: oldInfo.fileIds, - fileIds: info.fileIds - }); - } - - async parse({ - data, - database, - item_id - }: Args): Promise { - ["language_code", "value", "item_id"].forEach(key => { - if (!database[key]) { - throw new CustomError({ - code: "DATABASE_COLUMN_NOT_FOUND", - message: `Column ${key} not found in database` - }); - } - }); - - const oldData: ReturnValues[] = (await this.databaseService.db - .select({ - id: database.id, - language_code: database.language_code, - value: database.value - }) - .from(database) - .where(eq(database.item_id, item_id))) as unknown as ReturnValues[]; - - const infoOldData: InfoFromTextLanguageContentReturnValues[] = oldData.map( - item => this.getInfoFromContent({ content: item.value }) - ); - - const updateData: ReturnValues[] = await Promise.all( - data.map(async item => { - const itemExist = oldData.find( - el => el.language_code === item.language_code - ); - - await this.contentParser({ - content: item.value, - infoOldData - }); - - if (itemExist) { - const update = await this.databaseService.db - .update(database) - .set({ ...item, item_id }) - .where(eq(database.id, itemExist.id)) - .returning(); - - return update[0]; - } - - const data = await this.databaseService.db - .insert(database) - .values({ ...item, item_id } as { - [Key in keyof PgTableWithColumns["$inferInsert"]]: - | PgTableWithColumns["$inferInsert"][Key] - | Placeholder - | SQL; - }) - .returning(); - - return data[0]; - }) - ); - - // Delete remaining translations - await Promise.all( - oldData.map(async item => { - const exist = updateData.find( - el => el.language_code === item.language_code - ); - if (exist) return; - - await this.contentParser({ - content: "", - infoOldData - }); - - await this.databaseService.db - .delete(database) - .where(eq(database.id, item.id)); - }) - ); - - // Reset state - this.state = { - fileIds: [] - }; - - return updateData; - } - - async delete({ - database, - item_id - }: Omit, "data">) { - ["language_code", "value", "item_id"].forEach(key => { - if (!database[key]) { - throw new CustomError({ - code: "DATABASE_COLUMN_NOT_FOUND", - message: `Column ${key} not found in database` - }); - } - }); - - const oldData: ReturnValues[] = (await this.databaseService.db - .select({ - id: database.id, - language_code: database.language_code, - value: database.value - }) - .from(database) - .where(eq(database.item_id, item_id))) as unknown as ReturnValues[]; - - const infoOldData: InfoFromTextLanguageContentReturnValues[] = oldData.map( - item => this.getInfoFromContent({ content: item.value }) - ); - - await this.contentParser({ - content: "", - infoOldData - }); - } -} diff --git a/apps/backend/src/plugins/core/theme_editor/theme_editor.module.ts b/apps/backend/src/plugins/core/theme_editor/theme_editor.module.ts deleted file mode 100644 index 13e960341..000000000 --- a/apps/backend/src/plugins/core/theme_editor/theme_editor.module.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Module } from "@nestjs/common"; - -import { ShowCoreThemeEditorResolver } from "./show/show.resolver"; -import { ShowCoreThemeEditorService } from "./show/show.service"; - -@Module({ - providers: [ShowCoreThemeEditorResolver, ShowCoreThemeEditorService] -}) -export class CoreThemeEditorModule {} diff --git a/apps/backend/src/plugins/core/versions.json b/apps/backend/src/plugins/core/versions.json deleted file mode 100644 index 1143a9b2a..000000000 --- a/apps/backend/src/plugins/core/versions.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "10000": "0.1.0" -} diff --git a/apps/backend/src/plugins/plugins.module.ts b/apps/backend/src/plugins/plugins.module.ts index 228ad3e59..b5df97674 100644 --- a/apps/backend/src/plugins/plugins.module.ts +++ b/apps/backend/src/plugins/plugins.module.ts @@ -2,15 +2,13 @@ import { Module } from "@nestjs/common"; -import { CoreModule } from "./core/core.module"; import { BlogModule } from "./blog/blog.module"; // ! === IMPORT === @Module({ imports: [ - BlogModule, + BlogModule // ! === MODULE === - CoreModule ] }) export class PluginsModule {} diff --git a/packages/backend/package.json b/packages/backend/package.json index 34661f0ae..f6e6e44b7 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -32,17 +32,22 @@ "@types/express": "^4.17.21", "@types/http-errors": "^2.0.4", "@types/node": "^20.14.7", + "@types/nodemailer": "^6.4.15", "@types/object-path": "^0.11.4", "@types/pg": "^8.11.6", + "@types/react": "^18.3.3", "@vitnode/shared": "workspace:*", "busboy": "^1.6.0", "class-transformer": "^0.5.1", "eslint-config-vitnode": "workspace:*", "http-errors": "^2.0.0", "object-path": "^0.11.8", + "react-email": "^2.1.4", "typescript": "^5.5.2" }, "dependencies": { + "@react-email/components": "^0.0.19", + "@react-email/render": "^0.0.15", "bcrypt": "^5.1.1", "class-validator": "^0.14.1", "cookie-parser": "^1.4.6", @@ -50,7 +55,9 @@ "drizzle-orm": "^0.31.2", "express": "^4.19.2", "graphql": "^16.8.2", + "nodemailer": "^6.9.14", "pg": "^8.12.0", + "react": "^18.3.1", "sharp": "^0.33.4", "tar": "^7.4.0", "ua-parser-js": "2.0.0-beta.3" diff --git a/packages/backend/src/core/admin/admin.module.ts b/packages/backend/src/core/admin/admin.module.ts index f6212efcd..9a2a95a37 100644 --- a/packages/backend/src/core/admin/admin.module.ts +++ b/packages/backend/src/core/admin/admin.module.ts @@ -13,6 +13,9 @@ import { AdminMembersModule } from "./members/members.module"; import { AdminGroupsModule } from "./groups/groups.module"; import { AdminMetadataModule } from "./metadata/metadata.module"; import { AdminSettingsModule } from "./settings/settings.module"; +import { AdminThemeEditorModule } from "./theme_editor/theme_editor.module"; +import { AdminInstallModule } from "./install/install.module"; +import { AdminEmailModule } from "./email/email.module"; @Module({ imports: [ @@ -26,7 +29,10 @@ import { AdminSettingsModule } from "./settings/settings.module"; AdminMembersModule, AdminGroupsModule, AdminMetadataModule, - AdminSettingsModule + AdminSettingsModule, + AdminThemeEditorModule, + AdminInstallModule, + AdminEmailModule ] }) export class AdminModule {} diff --git a/apps/backend/src/plugins/core/admin/email/email.module.ts b/packages/backend/src/core/admin/email/email.module.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/email/email.module.ts rename to packages/backend/src/core/admin/email/email.module.ts diff --git a/apps/backend/src/plugins/core/admin/email/emails/_components/header.tsx b/packages/backend/src/core/admin/email/emails/_components/header.tsx similarity index 100% rename from apps/backend/src/plugins/core/admin/email/emails/_components/header.tsx rename to packages/backend/src/core/admin/email/emails/_components/header.tsx diff --git a/apps/backend/src/plugins/core/admin/email/emails/email-template.tsx b/packages/backend/src/core/admin/email/emails/email-template.tsx similarity index 100% rename from apps/backend/src/plugins/core/admin/email/emails/email-template.tsx rename to packages/backend/src/core/admin/email/emails/email-template.tsx diff --git a/apps/backend/src/plugins/core/admin/email/helpers.service.ts b/packages/backend/src/core/admin/email/helpers.service.ts similarity index 78% rename from apps/backend/src/plugins/core/admin/email/helpers.service.ts rename to packages/backend/src/core/admin/email/helpers.service.ts index 364848cee..f1b7f78e4 100644 --- a/apps/backend/src/plugins/core/admin/email/helpers.service.ts +++ b/packages/backend/src/core/admin/email/helpers.service.ts @@ -3,8 +3,7 @@ import { join } from "path"; import { Injectable } from "@nestjs/common"; import { ShowAdminEmailSettingsServiceObj } from "./settings/show/dto/show.obj"; - -import { ABSOLUTE_PATHS } from "@/config"; +import { ABSOLUTE_PATHS_BACKEND } from "../../.."; export interface ShowAdminEmailSettingsServiceObjWithPassword extends ShowAdminEmailSettingsServiceObj { @@ -14,9 +13,7 @@ export interface ShowAdminEmailSettingsServiceObjWithPassword @Injectable() export class HelpersAdminEmailSettingsService { protected readonly path: string = join( - ABSOLUTE_PATHS.plugin({ code: "core" }).root, - "admin", - "email", + ABSOLUTE_PATHS_BACKEND.plugin({ code: "core" }).root, "email.config.json" ); } diff --git a/apps/backend/src/plugins/core/admin/email/helpers.ts b/packages/backend/src/core/admin/email/helpers.ts similarity index 83% rename from apps/backend/src/plugins/core/admin/email/helpers.ts rename to packages/backend/src/core/admin/email/helpers.ts index f7d03f406..fa56bdf5d 100644 --- a/apps/backend/src/plugins/core/admin/email/helpers.ts +++ b/packages/backend/src/core/admin/email/helpers.ts @@ -2,13 +2,19 @@ import { join } from "path"; import * as fs from "fs"; import { convertColor, getHSLFromString } from "@vitnode/shared"; +import { getConfigFile } from "../../config"; -import { getConfigFile } from "@/config"; -import { parseFrontendUrlFromEnv } from "@/functions/envs"; +export interface HelpersForEmailReturnValues { + url: string; + protocol: string; + hostname: string; + port: string; +} export const getHelpersForEmail = () => { const config = getConfigFile(); - const frontend_url = parseFrontendUrlFromEnv(); + // TODO: Implement parseFrontendUrlFromEnv + // const frontend_url = parseFrontendUrlFromEnv(); const primaryHSL = getHSLFromString(config.settings.email.color_primary); const primaryForegroundHSL = getHSLFromString( @@ -18,7 +24,9 @@ export const getHelpersForEmail = () => { return { site_name: config.settings.general.site_name, site_short_name: config.settings.general.site_short_name, - frontend_url, + frontend_url: { + url: "http://localhost:3000" + }, color: { primary: { DEFAULT: `[${primaryHSL ? convertColor.hslToHex(primaryHSL) : "#215fdc"}]`, diff --git a/apps/backend/src/plugins/core/admin/email/mail.service.ts b/packages/backend/src/core/admin/email/mail.service.ts similarity index 83% rename from apps/backend/src/plugins/core/admin/email/mail.service.ts rename to packages/backend/src/core/admin/email/mail.service.ts index b035759a7..501452744 100644 --- a/apps/backend/src/plugins/core/admin/email/mail.service.ts +++ b/packages/backend/src/core/admin/email/mail.service.ts @@ -6,9 +6,11 @@ import { render } from "@react-email/render"; import * as nodemailer from "nodemailer"; import * as React from "react"; -import { ShowAdminEmailSettingsServiceObjWithPassword } from "./helpers.service"; - -import { ABSOLUTE_PATHS } from "@/config"; +import { + HelpersAdminEmailSettingsService, + ShowAdminEmailSettingsServiceObjWithPassword +} from "./helpers.service"; +import { ABSOLUTE_PATHS_BACKEND } from "../../.."; interface SendMailConfiguration { subject: string; @@ -18,16 +20,10 @@ interface SendMailConfiguration { } @Injectable() -export class MailService { - protected readonly path: string = join( - ABSOLUTE_PATHS.plugin({ code: "core" }).root, - "admin", - "email", - "email.config.json" - ); +export class MailService extends HelpersAdminEmailSettingsService { private readonly transporter: nodemailer.Transporter; - constructor() { + super(); if (!fs.existsSync(this.path)) { // Create a default config file fs.writeFileSync( diff --git a/apps/backend/src/plugins/core/admin/email/send/send.service.ts b/packages/backend/src/core/admin/email/send/send.service.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/email/send/send.service.ts rename to packages/backend/src/core/admin/email/send/send.service.ts diff --git a/apps/backend/src/plugins/core/admin/email/settings/edit/dto/edit.args.ts b/packages/backend/src/core/admin/email/settings/edit/dto/edit.args.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/email/settings/edit/dto/edit.args.ts rename to packages/backend/src/core/admin/email/settings/edit/dto/edit.args.ts diff --git a/apps/backend/src/plugins/core/admin/email/settings/edit/edit.resolver.ts b/packages/backend/src/core/admin/email/settings/edit/edit.resolver.ts similarity index 92% rename from apps/backend/src/plugins/core/admin/email/settings/edit/edit.resolver.ts rename to packages/backend/src/core/admin/email/settings/edit/edit.resolver.ts index 379f4d10f..f3f97cbc5 100644 --- a/apps/backend/src/plugins/core/admin/email/settings/edit/edit.resolver.ts +++ b/packages/backend/src/core/admin/email/settings/edit/edit.resolver.ts @@ -1,10 +1,10 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards } from "vitnode-backend"; import { EditAdminEmailSettingsService } from "./edit.service"; import { EditAdminEmailSettingsServiceArgs } from "./dto/edit.args"; import { ShowAdminEmailSettingsServiceObj } from "../show/dto/show.obj"; +import { AdminAuthGuards } from "../../../../../utils"; @Resolver() export class EditAdminEmailSettingsResolver { diff --git a/apps/backend/src/plugins/core/admin/email/settings/edit/edit.service.ts b/packages/backend/src/core/admin/email/settings/edit/edit.service.ts similarity index 95% rename from apps/backend/src/plugins/core/admin/email/settings/edit/edit.service.ts rename to packages/backend/src/core/admin/email/settings/edit/edit.service.ts index ee094bda5..103268485 100644 --- a/apps/backend/src/plugins/core/admin/email/settings/edit/edit.service.ts +++ b/packages/backend/src/core/admin/email/settings/edit/edit.service.ts @@ -9,7 +9,7 @@ import { HelpersAdminEmailSettingsService, ShowAdminEmailSettingsServiceObjWithPassword } from "../../helpers.service"; -import { ConfigType, configPath, getConfigFile } from "@/config"; +import { ConfigType, configPath, getConfigFile } from "../../../../config"; @Injectable() export class EditAdminEmailSettingsService extends HelpersAdminEmailSettingsService { diff --git a/apps/backend/src/plugins/core/admin/email/settings/show/dto/show.obj.ts b/packages/backend/src/core/admin/email/settings/show/dto/show.obj.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/email/settings/show/dto/show.obj.ts rename to packages/backend/src/core/admin/email/settings/show/dto/show.obj.ts diff --git a/apps/backend/src/plugins/core/admin/email/settings/show/show.resolver.ts b/packages/backend/src/core/admin/email/settings/show/show.resolver.ts similarity index 90% rename from apps/backend/src/plugins/core/admin/email/settings/show/show.resolver.ts rename to packages/backend/src/core/admin/email/settings/show/show.resolver.ts index e9be435ba..f5ce229e9 100644 --- a/apps/backend/src/plugins/core/admin/email/settings/show/show.resolver.ts +++ b/packages/backend/src/core/admin/email/settings/show/show.resolver.ts @@ -1,9 +1,9 @@ import { Query, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards } from "vitnode-backend"; import { ShowAdminEmailSettingsServiceObj } from "./dto/show.obj"; import { ShowAdminEmailSettingsService } from "./show.service"; +import { AdminAuthGuards } from "../../../../../utils"; @Resolver() export class ShowAdminEmailSettingsResolver { diff --git a/apps/backend/src/plugins/core/admin/email/settings/show/show.service.ts b/packages/backend/src/core/admin/email/settings/show/show.service.ts similarity index 92% rename from apps/backend/src/plugins/core/admin/email/settings/show/show.service.ts rename to packages/backend/src/core/admin/email/settings/show/show.service.ts index f60c04158..3da671c1e 100644 --- a/apps/backend/src/plugins/core/admin/email/settings/show/show.service.ts +++ b/packages/backend/src/core/admin/email/settings/show/show.service.ts @@ -5,7 +5,7 @@ import { Injectable } from "@nestjs/common"; import { ShowAdminEmailSettingsServiceObj } from "./dto/show.obj"; import { HelpersAdminEmailSettingsService } from "../../helpers.service"; -import { getConfigFile } from "@/config"; +import { getConfigFile } from "../../../../config"; @Injectable() export class ShowAdminEmailSettingsService extends HelpersAdminEmailSettingsService { diff --git a/apps/backend/src/plugins/core/admin/email/settings/test/dto/test.args.ts b/packages/backend/src/core/admin/email/settings/test/dto/test.args.ts similarity index 89% rename from apps/backend/src/plugins/core/admin/email/settings/test/dto/test.args.ts rename to packages/backend/src/core/admin/email/settings/test/dto/test.args.ts index 511249fc1..325e59eaa 100644 --- a/apps/backend/src/plugins/core/admin/email/settings/test/dto/test.args.ts +++ b/packages/backend/src/core/admin/email/settings/test/dto/test.args.ts @@ -1,7 +1,7 @@ import { ArgsType, Field } from "@nestjs/graphql"; import { Transform } from "class-transformer"; import { IsEmail } from "class-validator"; -import { TransformString } from "vitnode-backend"; +import { TransformString } from "../../../../../../utils"; @ArgsType() export class TestAdminEmailSettingsServiceArgs { diff --git a/apps/backend/src/plugins/core/admin/email/settings/test/test.resolver.ts b/packages/backend/src/core/admin/email/settings/test/test.resolver.ts similarity index 91% rename from apps/backend/src/plugins/core/admin/email/settings/test/test.resolver.ts rename to packages/backend/src/core/admin/email/settings/test/test.resolver.ts index 1675eeeda..0ef83984f 100644 --- a/apps/backend/src/plugins/core/admin/email/settings/test/test.resolver.ts +++ b/packages/backend/src/core/admin/email/settings/test/test.resolver.ts @@ -1,9 +1,9 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards } from "vitnode-backend"; import { TestAdminEmailSettingsService } from "./test.service"; import { TestAdminEmailSettingsServiceArgs } from "./dto/test.args"; +import { AdminAuthGuards } from "../../../../../utils"; @Resolver() export class TestAdminEmailSettingsResolver { diff --git a/apps/backend/src/plugins/core/admin/email/settings/test/test.service.ts b/packages/backend/src/core/admin/email/settings/test/test.service.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/email/settings/test/test.service.ts rename to packages/backend/src/core/admin/email/settings/test/test.service.ts diff --git a/apps/backend/src/plugins/core/admin/install/create_database/create_database.resolver.ts b/packages/backend/src/core/admin/install/create_database/create_database.resolver.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/install/create_database/create_database.resolver.ts rename to packages/backend/src/core/admin/install/create_database/create_database.resolver.ts diff --git a/apps/backend/src/plugins/core/admin/install/create_database/create_database.service.ts b/packages/backend/src/core/admin/install/create_database/create_database.service.ts similarity index 88% rename from apps/backend/src/plugins/core/admin/install/create_database/create_database.service.ts rename to packages/backend/src/core/admin/install/create_database/create_database.service.ts index 60ae9fd97..3db77b795 100644 --- a/apps/backend/src/plugins/core/admin/install/create_database/create_database.service.ts +++ b/packages/backend/src/core/admin/install/create_database/create_database.service.ts @@ -1,15 +1,18 @@ import { Injectable } from "@nestjs/common"; import { count } from "drizzle-orm"; -import { CustomError, DatabaseService } from "vitnode-backend"; - -import { core_languages } from "@/plugins/core/admin/database/schema/languages"; +import { DatabaseService } from "../../../../database"; +import { CustomError } from "../../../../errors"; +import { core_languages } from "../../../../templates/core/admin/database/schema/languages"; import { core_groups, core_groups_names -} from "@/plugins/core/admin/database/schema/groups"; -import { core_admin_permissions } from "@/plugins/core/admin/database/schema/admins"; -import { core_moderators_permissions } from "../../database/schema/moderators"; -import { core_nav, core_nav_name } from "../../database/schema/nav"; +} from "../../../../templates/core/admin/database/schema/groups"; +import { core_admin_permissions } from "../../../../templates/core/admin/database/schema/admins"; +import { + core_nav, + core_nav_name +} from "../../../../templates/core/admin/database/schema/nav"; +import { core_moderators_permissions } from "../../../../templates/core/admin/database/schema/moderators"; @Injectable() export class CreateDatabaseAdminInstallService { diff --git a/apps/backend/src/plugins/core/admin/install/install.module.ts b/packages/backend/src/core/admin/install/install.module.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/install/install.module.ts rename to packages/backend/src/core/admin/install/install.module.ts diff --git a/apps/backend/src/plugins/core/admin/install/layout/dto/layout.obj.ts b/packages/backend/src/core/admin/install/layout/dto/layout.obj.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/install/layout/dto/layout.obj.ts rename to packages/backend/src/core/admin/install/layout/dto/layout.obj.ts diff --git a/apps/backend/src/plugins/core/admin/install/layout/layout.resolver.ts b/packages/backend/src/core/admin/install/layout/layout.resolver.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/install/layout/layout.resolver.ts rename to packages/backend/src/core/admin/install/layout/layout.resolver.ts diff --git a/apps/backend/src/plugins/core/admin/install/layout/layout.service.ts b/packages/backend/src/core/admin/install/layout/layout.service.ts similarity index 72% rename from apps/backend/src/plugins/core/admin/install/layout/layout.service.ts rename to packages/backend/src/core/admin/install/layout/layout.service.ts index 124ffaf02..bbd07fedd 100644 --- a/apps/backend/src/plugins/core/admin/install/layout/layout.service.ts +++ b/packages/backend/src/core/admin/install/layout/layout.service.ts @@ -1,16 +1,16 @@ import { Injectable } from "@nestjs/common"; import { count } from "drizzle-orm"; -import { AccessDeniedError, DatabaseService } from "vitnode-backend"; import { LayoutAdminInstallEnum, LayoutAdminInstallObj } from "./dto/layout.obj"; - -import { core_users } from "@/plugins/core/admin/database/schema/users"; -import { core_sessions } from "@/plugins/core/admin/database/schema/sessions"; -import { core_admin_sessions } from "@/plugins/core/admin/database/schema/admins"; -import { core_languages } from "@/plugins/core/admin/database/schema/languages"; +import { DatabaseService } from "../../../../database"; +import { core_users } from "../../../../templates/core/admin/database/schema/users"; +import { core_sessions } from "../../../../templates/core/admin/database/schema/sessions"; +import { core_admin_sessions } from "../../../../templates/core/admin/database/schema/admins"; +import { AccessDeniedError } from "../../../../errors"; +import { core_languages } from "../../../../templates/core/admin/database/schema/languages"; @Injectable() export class LayoutAdminInstallService { diff --git a/apps/backend/src/plugins/core/admin/theme_editor/edit/dto/edit.args.ts b/packages/backend/src/core/admin/theme_editor/edit/dto/edit.args.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/theme_editor/edit/dto/edit.args.ts rename to packages/backend/src/core/admin/theme_editor/edit/dto/edit.args.ts diff --git a/apps/backend/src/plugins/core/admin/theme_editor/edit/edit.resolver.ts b/packages/backend/src/core/admin/theme_editor/edit/edit.resolver.ts similarity index 91% rename from apps/backend/src/plugins/core/admin/theme_editor/edit/edit.resolver.ts rename to packages/backend/src/core/admin/theme_editor/edit/edit.resolver.ts index 7185b6cd4..75c93cabb 100644 --- a/apps/backend/src/plugins/core/admin/theme_editor/edit/edit.resolver.ts +++ b/packages/backend/src/core/admin/theme_editor/edit/edit.resolver.ts @@ -1,9 +1,9 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql"; import { UseGuards } from "@nestjs/common"; -import { AdminAuthGuards } from "vitnode-backend"; import { EditAdminThemeEditorService } from "./edit.service"; import { EditAdminThemeEditorArgs } from "./dto/edit.args"; +import { AdminAuthGuards } from "../../../../utils"; @Resolver() export class EditAdminThemeEditorResolver { diff --git a/apps/backend/src/plugins/core/admin/theme_editor/edit/edit.service.ts b/packages/backend/src/core/admin/theme_editor/edit/edit.service.ts similarity index 71% rename from apps/backend/src/plugins/core/admin/theme_editor/edit/edit.service.ts rename to packages/backend/src/core/admin/theme_editor/edit/edit.service.ts index dba8797b2..764127c0e 100644 --- a/apps/backend/src/plugins/core/admin/theme_editor/edit/edit.service.ts +++ b/packages/backend/src/core/admin/theme_editor/edit/edit.service.ts @@ -2,37 +2,14 @@ import { join } from "path"; import * as fs from "fs"; import { Injectable } from "@nestjs/common"; -import { ConfigService } from "@nestjs/config"; -import { NotFoundError, DatabaseService } from "vitnode-backend"; import { EditAdminThemeEditorArgs, ThemeVariableInput } from "./dto/edit.args"; - -import { ABSOLUTE_PATHS } from "@/config"; - -export const keysFromCSSThemeEditor = [ - "primary", - "primary-foreground", - "secondary", - "secondary-foreground", - "background", - "destructive", - "destructive-foreground", - "cover", - "cover-foreground", - "muted", - "muted-foreground", - "accent", - "accent-foreground", - "card", - "border" -] as const; +import { ABSOLUTE_PATHS_BACKEND, NotFoundError } from "../../../.."; +import { keysFromCSSThemeEditor } from "../../../theme_editor/theme_editor.module"; @Injectable() export class EditAdminThemeEditorService { - constructor( - private readonly databaseService: DatabaseService, - private readonly configService: ConfigService - ) {} + constructor() {} protected changeVariable({ cssAsString, @@ -61,7 +38,7 @@ export class EditAdminThemeEditorService { async edit({ colors }: EditAdminThemeEditorArgs): Promise { const pathToCss = join( - ABSOLUTE_PATHS.plugin({ code: "core" }).frontend.templates, + ABSOLUTE_PATHS_BACKEND.plugin({ code: "core" }).frontend.templates, "layout", "global.css" ); diff --git a/apps/backend/src/plugins/core/admin/theme_editor/theme_editor.module.ts b/packages/backend/src/core/admin/theme_editor/theme_editor.module.ts similarity index 100% rename from apps/backend/src/plugins/core/admin/theme_editor/theme_editor.module.ts rename to packages/backend/src/core/admin/theme_editor/theme_editor.module.ts diff --git a/packages/backend/src/core/core.module.ts b/packages/backend/src/core/core.module.ts index 61d011e76..ecae77f7d 100644 --- a/packages/backend/src/core/core.module.ts +++ b/packages/backend/src/core/core.module.ts @@ -14,6 +14,7 @@ import { CoreEditorModule } from "./editor/editor.module"; import { CoreMembersModule } from "./members/members.module"; import { CoreMiddlewareModule } from "./middleware/middleware.module"; import { CoreSettingsModule } from "./settings/settings.module"; +import { CoreThemeEditorModule } from "./theme_editor/theme_editor.module"; @Module({ imports: [ @@ -29,7 +30,8 @@ import { CoreSettingsModule } from "./settings/settings.module"; CoreEditorModule, CoreMembersModule, CoreMiddlewareModule, - CoreSettingsModule + CoreSettingsModule, + CoreThemeEditorModule ] }) export class CoreModule {} diff --git a/apps/backend/src/plugins/core/theme_editor/show/dto/show.obj.ts b/packages/backend/src/core/theme_editor/show/dto/show.obj.ts similarity index 100% rename from apps/backend/src/plugins/core/theme_editor/show/dto/show.obj.ts rename to packages/backend/src/core/theme_editor/show/dto/show.obj.ts diff --git a/apps/backend/src/plugins/core/theme_editor/show/show.resolver.ts b/packages/backend/src/core/theme_editor/show/show.resolver.ts similarity index 100% rename from apps/backend/src/plugins/core/theme_editor/show/show.resolver.ts rename to packages/backend/src/core/theme_editor/show/show.resolver.ts diff --git a/apps/backend/src/plugins/core/theme_editor/show/show.service.ts b/packages/backend/src/core/theme_editor/show/show.service.ts similarity index 89% rename from apps/backend/src/plugins/core/theme_editor/show/show.service.ts rename to packages/backend/src/core/theme_editor/show/show.service.ts index 215d278e2..3f36b2aa8 100644 --- a/apps/backend/src/plugins/core/theme_editor/show/show.service.ts +++ b/packages/backend/src/core/theme_editor/show/show.service.ts @@ -2,16 +2,14 @@ import { join } from "path"; import * as fs from "fs"; import { Injectable } from "@nestjs/common"; -import { NotFoundError } from "vitnode-backend"; import { ColorsShowCoreThemeEditor, HslColor, ShowCoreThemeEditorObj } from "./dto/show.obj"; - -import { ABSOLUTE_PATHS } from "@/config"; -import { keysFromCSSThemeEditor } from "../../admin/theme_editor/edit/edit.service"; +import { ABSOLUTE_PATHS_BACKEND, NotFoundError } from "../../.."; +import { keysFromCSSThemeEditor } from "../theme_editor.module"; @Injectable() export class ShowCoreThemeEditorService { @@ -69,7 +67,7 @@ export class ShowCoreThemeEditorService { show(): ShowCoreThemeEditorObj { const pathToCss = join( - ABSOLUTE_PATHS.plugin({ code: "core" }).frontend.templates, + ABSOLUTE_PATHS_BACKEND.plugin({ code: "core" }).frontend.templates, "layout", "global.css" ); diff --git a/packages/backend/src/core/theme_editor/theme_editor.module.ts b/packages/backend/src/core/theme_editor/theme_editor.module.ts new file mode 100644 index 000000000..a1217c35a --- /dev/null +++ b/packages/backend/src/core/theme_editor/theme_editor.module.ts @@ -0,0 +1,27 @@ +import { Module } from "@nestjs/common"; + +import { ShowCoreThemeEditorResolver } from "./show/show.resolver"; +import { ShowCoreThemeEditorService } from "./show/show.service"; + +export const keysFromCSSThemeEditor = [ + "primary", + "primary-foreground", + "secondary", + "secondary-foreground", + "background", + "destructive", + "destructive-foreground", + "cover", + "cover-foreground", + "muted", + "muted-foreground", + "accent", + "accent-foreground", + "card", + "border" +] as const; + +@Module({ + providers: [ShowCoreThemeEditorResolver, ShowCoreThemeEditorService] +}) +export class CoreThemeEditorModule {} diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts index 7d6c33cdc..06c846b85 100644 --- a/packages/backend/src/index.ts +++ b/packages/backend/src/index.ts @@ -11,4 +11,5 @@ export * from "./database"; export * from "./core/admin/sessions/authorization/authorization.service"; export * from "./core/sessions/authorization/internal/internal_authorization.service"; export * from "./core/admin/plugins/type"; +export * from "./core/helpers/text_language/parser/parser.service"; export * from "./core/config"; diff --git a/packages/backend/tsconfig.json b/packages/backend/tsconfig.json index 7b285e14d..d1b953a58 100644 --- a/packages/backend/tsconfig.json +++ b/packages/backend/tsconfig.json @@ -2,6 +2,7 @@ "$schema": "https://json.schemastore.org/tsconfig", "extends": "eslint-config-vitnode/tsconfig.base.json", "compilerOptions": { + "jsx": "react", "target": "ESNext", "module": "CommonJS", "outDir": "dist", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 39f0d06c7..5a47edbfb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -164,10 +164,10 @@ importers: version: 2.1.4(@swc/helpers@0.5.11)(eslint@8.57.0)(ts-node@10.9.2(@swc/core@1.6.3(@swc/helpers@0.5.11))(@types/node@20.14.7)(typescript@5.5.2)) ts-loader: specifier: ^9.5.1 - version: 9.5.1(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11)) + version: 9.5.1(typescript@5.5.2)(webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))) ts-node: specifier: ^10.9.2 - version: 10.9.2(@swc/core@1.6.3)(@types/node@20.14.7)(typescript@5.5.2) + version: 10.9.2(@swc/core@1.6.3(@swc/helpers@0.5.11))(@types/node@20.14.7)(typescript@5.5.2) tsconfig-paths: specifier: ^4.2.0 version: 4.2.0 @@ -475,6 +475,12 @@ importers: packages/backend: dependencies: + '@react-email/components': + specifier: ^0.0.19 + version: 0.0.19(@types/react@18.3.3)(react@18.3.1) + '@react-email/render': + specifier: ^0.0.15 + version: 0.0.15 bcrypt: specifier: ^5.1.1 version: 5.1.1 @@ -496,9 +502,15 @@ importers: graphql: specifier: ^16.8.2 version: 16.8.2 + nodemailer: + specifier: ^6.9.14 + version: 6.9.14 pg: specifier: ^8.12.0 version: 8.12.0 + react: + specifier: ^18.3.1 + version: 18.3.1 sharp: specifier: ^0.33.4 version: 0.33.4 @@ -554,12 +566,18 @@ importers: '@types/node': specifier: ^20.14.7 version: 20.14.7 + '@types/nodemailer': + specifier: ^6.4.15 + version: 6.4.15 '@types/object-path': specifier: ^0.11.4 version: 0.11.4 '@types/pg': specifier: ^8.11.6 version: 8.11.6 + '@types/react': + specifier: ^18.3.3 + version: 18.3.3 '@vitnode/shared': specifier: workspace:* version: link:../shared @@ -578,6 +596,9 @@ importers: object-path: specifier: ^0.11.8 version: 0.11.8 + react-email: + specifier: ^2.1.4 + version: 2.1.4(@swc/helpers@0.5.11)(eslint@8.57.0)(ts-node@10.9.2(@types/node@20.14.7)(typescript@5.5.2)) typescript: specifier: ^5.5.2 version: 5.5.2 @@ -16018,6 +16039,14 @@ snapshots: camelcase-css: 2.0.1 postcss: 8.4.38 + postcss-load-config@4.0.2(postcss@8.4.38)(ts-node@10.9.2(@swc/core@1.6.3(@swc/helpers@0.5.11))(@types/node@20.14.7)(typescript@5.5.2)): + dependencies: + lilconfig: 3.1.2 + yaml: 2.4.5 + optionalDependencies: + postcss: 8.4.38 + ts-node: 10.9.2(@swc/core@1.6.3(@swc/helpers@0.5.11))(@types/node@20.14.7)(typescript@5.5.2) + postcss-load-config@4.0.2(postcss@8.4.38)(ts-node@10.9.2(@swc/core@1.6.3)(@types/node@20.14.7)(typescript@5.5.2)): dependencies: lilconfig: 3.1.2 @@ -16026,6 +16055,14 @@ snapshots: postcss: 8.4.38 ts-node: 10.9.2(@swc/core@1.6.3)(@types/node@20.14.7)(typescript@5.5.2) + postcss-load-config@4.0.2(postcss@8.4.38)(ts-node@10.9.2(@types/node@20.14.7)(typescript@5.5.2)): + dependencies: + lilconfig: 3.1.2 + yaml: 2.4.5 + optionalDependencies: + postcss: 8.4.38 + ts-node: 10.9.2(@swc/core@1.6.3)(@types/node@20.14.7)(typescript@5.5.2) + postcss-nested@6.0.1(postcss@8.4.38): dependencies: postcss: 8.4.38 @@ -16342,6 +16379,62 @@ snapshots: - utf-8-validate - webpack-cli + react-email@2.1.4(@swc/helpers@0.5.11)(eslint@8.57.0)(ts-node@10.9.2(@types/node@20.14.7)(typescript@5.5.2)): + dependencies: + '@babel/core': 7.24.5 + '@babel/parser': 7.24.5 + '@radix-ui/colors': 1.0.1 + '@radix-ui/react-collapsible': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@radix-ui/react-popover': 1.0.7(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@radix-ui/react-slot': 1.0.2(@types/react@18.3.3)(react@18.3.1) + '@radix-ui/react-toggle-group': 1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@radix-ui/react-tooltip': 1.0.7(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@swc/core': 1.3.101(@swc/helpers@0.5.11) + '@types/react': 18.3.3 + '@types/react-dom': 18.3.0 + '@types/webpack': 5.28.5(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11) + autoprefixer: 10.4.14(postcss@8.4.38) + chalk: 4.1.2 + chokidar: 3.5.3 + clsx: 2.1.0 + commander: 11.1.0 + debounce: 2.0.0 + esbuild: 0.19.11 + eslint-config-prettier: 9.0.0(eslint@8.57.0) + eslint-config-turbo: 1.10.12(eslint@8.57.0) + framer-motion: 10.17.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + glob: 10.3.4 + log-symbols: 4.1.0 + mime-types: 2.1.35 + next: 14.1.4(@babel/core@7.24.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + normalize-path: 3.0.0 + ora: 5.4.1 + postcss: 8.4.38 + prism-react-renderer: 2.1.0(react@18.3.1) + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + shelljs: 0.8.5 + socket.io: 4.7.3 + socket.io-client: 4.7.3 + sonner: 1.3.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + source-map-js: 1.0.2 + stacktrace-parser: 0.1.10 + tailwind-merge: 2.2.0 + tailwindcss: 3.4.0(ts-node@10.9.2(@types/node@20.14.7)(typescript@5.5.2)) + typescript: 5.1.6 + transitivePeerDependencies: + - '@opentelemetry/api' + - '@swc/helpers' + - babel-plugin-macros + - bufferutil + - eslint + - sass + - supports-color + - ts-node + - uglify-js + - utf-8-validate + - webpack-cli + react-hook-form@7.52.0(react@19.0.0-rc.0): dependencies: react: 19.0.0-rc.0 @@ -17116,7 +17209,34 @@ snapshots: postcss: 8.4.38 postcss-import: 15.1.0(postcss@8.4.38) postcss-js: 4.0.1(postcss@8.4.38) - postcss-load-config: 4.0.2(postcss@8.4.38)(ts-node@10.9.2(@swc/core@1.6.3)(@types/node@20.14.7)(typescript@5.5.2)) + postcss-load-config: 4.0.2(postcss@8.4.38)(ts-node@10.9.2(@swc/core@1.6.3(@swc/helpers@0.5.11))(@types/node@20.14.7)(typescript@5.5.2)) + postcss-nested: 6.0.1(postcss@8.4.38) + postcss-selector-parser: 6.1.0 + resolve: 1.22.8 + sucrase: 3.35.0 + transitivePeerDependencies: + - ts-node + + tailwindcss@3.4.0(ts-node@10.9.2(@types/node@20.14.7)(typescript@5.5.2)): + dependencies: + '@alloc/quick-lru': 5.2.0 + arg: 5.0.2 + chokidar: 3.5.3 + didyoumean: 1.2.2 + dlv: 1.1.3 + fast-glob: 3.3.2 + glob-parent: 6.0.2 + is-glob: 4.0.3 + jiti: 1.21.6 + lilconfig: 2.1.0 + micromatch: 4.0.7 + normalize-path: 3.0.0 + object-hash: 3.0.0 + picocolors: 1.0.1 + postcss: 8.4.38 + postcss-import: 15.1.0(postcss@8.4.38) + postcss-js: 4.0.1(postcss@8.4.38) + postcss-load-config: 4.0.2(postcss@8.4.38)(ts-node@10.9.2(@types/node@20.14.7)(typescript@5.5.2)) postcss-nested: 6.0.1(postcss@8.4.38) postcss-selector-parser: 6.1.0 resolve: 1.22.8 @@ -17171,25 +17291,26 @@ snapshots: mkdirp: 3.0.1 yallist: 5.0.0 - terser-webpack-plugin@5.3.10(@swc/core@1.6.3(@swc/helpers@0.5.11))(webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))): + terser-webpack-plugin@5.3.10(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11)(webpack@5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11)): dependencies: '@jridgewell/trace-mapping': 0.3.25 jest-worker: 27.5.1 schema-utils: 3.3.0 serialize-javascript: 6.0.2 terser: 5.31.1 - webpack: 5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11)) + webpack: 5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11) optionalDependencies: - '@swc/core': 1.6.3(@swc/helpers@0.5.11) + '@swc/core': 1.3.101(@swc/helpers@0.5.11) + esbuild: 0.19.11 - terser-webpack-plugin@5.3.10(@swc/core@1.6.3(@swc/helpers@0.5.11))(webpack@5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11)): + terser-webpack-plugin@5.3.10(@swc/core@1.6.3(@swc/helpers@0.5.11))(webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))): dependencies: '@jridgewell/trace-mapping': 0.3.25 jest-worker: 27.5.1 schema-utils: 3.3.0 serialize-javascript: 6.0.2 terser: 5.31.1 - webpack: 5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11) + webpack: 5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11)) optionalDependencies: '@swc/core': 1.6.3(@swc/helpers@0.5.11) @@ -17261,7 +17382,7 @@ snapshots: ts-interface-checker@0.1.13: {} - ts-loader@9.5.1(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11)): + ts-loader@9.5.1(typescript@5.5.2)(webpack@5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11))): dependencies: chalk: 4.1.2 enhanced-resolve: 5.17.0 @@ -17269,10 +17390,30 @@ snapshots: semver: 7.6.2 source-map: 0.7.4 typescript: 5.5.2 - webpack: 5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11) + webpack: 5.90.1(@swc/core@1.6.3(@swc/helpers@0.5.11)) ts-log@2.2.5: {} + ts-node@10.9.2(@swc/core@1.6.3(@swc/helpers@0.5.11))(@types/node@20.14.7)(typescript@5.5.2): + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.11 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 20.14.7 + acorn: 8.12.0 + acorn-walk: 8.3.3 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 5.5.2 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + optionalDependencies: + '@swc/core': 1.6.3(@swc/helpers@0.5.11) + ts-node@10.9.2(@swc/core@1.6.3)(@types/node@20.14.7)(typescript@5.5.2): dependencies: '@cspotcode/source-map-support': 0.8.1 @@ -17628,7 +17769,7 @@ snapshots: neo-async: 2.6.2 schema-utils: 3.3.0 tapable: 2.2.1 - terser-webpack-plugin: 5.3.10(@swc/core@1.6.3(@swc/helpers@0.5.11))(webpack@5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11)) + terser-webpack-plugin: 5.3.10(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11)(webpack@5.92.1(@swc/core@1.3.101(@swc/helpers@0.5.11))(esbuild@0.19.11)) watchpack: 2.4.1 webpack-sources: 3.2.3 transitivePeerDependencies: From 3aa8f9ac3a171fd61146ac44de1b4712dd507869 Mon Sep 17 00:00:00 2001 From: aXenDeveloper Date: Sat, 22 Jun 2024 11:55:47 +0200 Subject: [PATCH 20/27] fix(backend): Send emails when change config --- apps/backend/src/utils/regex.ts | 1 - .../src/core/admin/email/helpers.service.ts | 1 + .../backend/src/core/admin/email/helpers.ts | 5 +-- .../src/core/admin/email/mail.service.ts | 34 ++++--------------- .../email/settings/edit/edit.resolver.ts | 1 + .../email/settings/show/show.resolver.ts | 1 + .../email/settings/test/dto/test.args.ts | 1 + .../email/settings/test/test.resolver.ts | 1 + .../create_database.service.ts | 1 + .../admin/install/layout/layout.service.ts | 1 + .../admin/languages/create/create.service.ts | 4 +-- .../admin/languages/delete/delete.service.ts | 4 +-- .../admin/languages/update/update.service.ts | 4 +-- .../admin/plugins/delete/delete.service.ts | 4 +-- .../admin/theme_editor/edit/edit.resolver.ts | 1 + .../admin/theme_editor/edit/edit.service.ts | 1 + .../core/theme_editor/show/show.service.ts | 3 +- .../backend/src/functions/rebuild-required.ts | 5 ++- 18 files changed, 31 insertions(+), 42 deletions(-) delete mode 100644 apps/backend/src/utils/regex.ts rename {apps => packages}/backend/src/functions/rebuild-required.ts (81%) diff --git a/apps/backend/src/utils/regex.ts b/apps/backend/src/utils/regex.ts deleted file mode 100644 index 7de4f0bb9..000000000 --- a/apps/backend/src/utils/regex.ts +++ /dev/null @@ -1 +0,0 @@ -export const nameRegex = /^(?!.* {2})[\p{L}\p{N}._@ -]*$/u; diff --git a/packages/backend/src/core/admin/email/helpers.service.ts b/packages/backend/src/core/admin/email/helpers.service.ts index f1b7f78e4..db46c5781 100644 --- a/packages/backend/src/core/admin/email/helpers.service.ts +++ b/packages/backend/src/core/admin/email/helpers.service.ts @@ -3,6 +3,7 @@ import { join } from "path"; import { Injectable } from "@nestjs/common"; import { ShowAdminEmailSettingsServiceObj } from "./settings/show/dto/show.obj"; + import { ABSOLUTE_PATHS_BACKEND } from "../../.."; export interface ShowAdminEmailSettingsServiceObjWithPassword diff --git a/packages/backend/src/core/admin/email/helpers.ts b/packages/backend/src/core/admin/email/helpers.ts index fa56bdf5d..3a9e35985 100644 --- a/packages/backend/src/core/admin/email/helpers.ts +++ b/packages/backend/src/core/admin/email/helpers.ts @@ -2,13 +2,14 @@ import { join } from "path"; import * as fs from "fs"; import { convertColor, getHSLFromString } from "@vitnode/shared"; + import { getConfigFile } from "../../config"; export interface HelpersForEmailReturnValues { - url: string; - protocol: string; hostname: string; port: string; + protocol: string; + url: string; } export const getHelpersForEmail = () => { diff --git a/packages/backend/src/core/admin/email/mail.service.ts b/packages/backend/src/core/admin/email/mail.service.ts index 501452744..b115e81b3 100644 --- a/packages/backend/src/core/admin/email/mail.service.ts +++ b/packages/backend/src/core/admin/email/mail.service.ts @@ -1,4 +1,3 @@ -import { join } from "path"; import * as fs from "fs"; import { Injectable } from "@nestjs/common"; @@ -10,7 +9,6 @@ import { HelpersAdminEmailSettingsService, ShowAdminEmailSettingsServiceObjWithPassword } from "./helpers.service"; -import { ABSOLUTE_PATHS_BACKEND } from "../../.."; interface SendMailConfiguration { subject: string; @@ -21,27 +19,17 @@ interface SendMailConfiguration { @Injectable() export class MailService extends HelpersAdminEmailSettingsService { - private readonly transporter: nodemailer.Transporter; - constructor() { - super(); - if (!fs.existsSync(this.path)) { - // Create a default config file - fs.writeFileSync( - this.path, - JSON.stringify({ - smtp_host: "", - smtp_user: "", - smtp_secure: false, - smtp_port: 587 - }) - ); - } + private readonly generateEmail = (template: React.ReactElement) => { + return render(template); + }; + async sendMail({ to, subject, template }: SendMailConfiguration) { + const html = this.generateEmail(template); const data = fs.readFileSync(this.path, "utf-8"); const config: ShowAdminEmailSettingsServiceObjWithPassword = JSON.parse(data); - this.transporter = nodemailer.createTransport( + const transporter = nodemailer.createTransport( { host: config.smtp_host, port: config.smtp_port, @@ -58,16 +46,8 @@ export class MailService extends HelpersAdminEmailSettingsService { } } ); - } - - private readonly generateEmail = (template: React.ReactElement) => { - return render(template); - }; - - async sendMail({ to, subject, template }: SendMailConfiguration) { - const html = this.generateEmail(template); - await this.transporter.sendMail({ + await transporter.sendMail({ to, from: "test", subject, diff --git a/packages/backend/src/core/admin/email/settings/edit/edit.resolver.ts b/packages/backend/src/core/admin/email/settings/edit/edit.resolver.ts index f3f97cbc5..20215ec3f 100644 --- a/packages/backend/src/core/admin/email/settings/edit/edit.resolver.ts +++ b/packages/backend/src/core/admin/email/settings/edit/edit.resolver.ts @@ -4,6 +4,7 @@ import { UseGuards } from "@nestjs/common"; import { EditAdminEmailSettingsService } from "./edit.service"; import { EditAdminEmailSettingsServiceArgs } from "./dto/edit.args"; import { ShowAdminEmailSettingsServiceObj } from "../show/dto/show.obj"; + import { AdminAuthGuards } from "../../../../../utils"; @Resolver() diff --git a/packages/backend/src/core/admin/email/settings/show/show.resolver.ts b/packages/backend/src/core/admin/email/settings/show/show.resolver.ts index f5ce229e9..d164fefa1 100644 --- a/packages/backend/src/core/admin/email/settings/show/show.resolver.ts +++ b/packages/backend/src/core/admin/email/settings/show/show.resolver.ts @@ -3,6 +3,7 @@ import { UseGuards } from "@nestjs/common"; import { ShowAdminEmailSettingsServiceObj } from "./dto/show.obj"; import { ShowAdminEmailSettingsService } from "./show.service"; + import { AdminAuthGuards } from "../../../../../utils"; @Resolver() diff --git a/packages/backend/src/core/admin/email/settings/test/dto/test.args.ts b/packages/backend/src/core/admin/email/settings/test/dto/test.args.ts index 325e59eaa..21a70923d 100644 --- a/packages/backend/src/core/admin/email/settings/test/dto/test.args.ts +++ b/packages/backend/src/core/admin/email/settings/test/dto/test.args.ts @@ -1,6 +1,7 @@ import { ArgsType, Field } from "@nestjs/graphql"; import { Transform } from "class-transformer"; import { IsEmail } from "class-validator"; + import { TransformString } from "../../../../../../utils"; @ArgsType() diff --git a/packages/backend/src/core/admin/email/settings/test/test.resolver.ts b/packages/backend/src/core/admin/email/settings/test/test.resolver.ts index 0ef83984f..34ae50816 100644 --- a/packages/backend/src/core/admin/email/settings/test/test.resolver.ts +++ b/packages/backend/src/core/admin/email/settings/test/test.resolver.ts @@ -3,6 +3,7 @@ import { UseGuards } from "@nestjs/common"; import { TestAdminEmailSettingsService } from "./test.service"; import { TestAdminEmailSettingsServiceArgs } from "./dto/test.args"; + import { AdminAuthGuards } from "../../../../../utils"; @Resolver() diff --git a/packages/backend/src/core/admin/install/create_database/create_database.service.ts b/packages/backend/src/core/admin/install/create_database/create_database.service.ts index 3db77b795..2c714558a 100644 --- a/packages/backend/src/core/admin/install/create_database/create_database.service.ts +++ b/packages/backend/src/core/admin/install/create_database/create_database.service.ts @@ -1,5 +1,6 @@ import { Injectable } from "@nestjs/common"; import { count } from "drizzle-orm"; + import { DatabaseService } from "../../../../database"; import { CustomError } from "../../../../errors"; import { core_languages } from "../../../../templates/core/admin/database/schema/languages"; diff --git a/packages/backend/src/core/admin/install/layout/layout.service.ts b/packages/backend/src/core/admin/install/layout/layout.service.ts index bbd07fedd..43d03a797 100644 --- a/packages/backend/src/core/admin/install/layout/layout.service.ts +++ b/packages/backend/src/core/admin/install/layout/layout.service.ts @@ -5,6 +5,7 @@ import { LayoutAdminInstallEnum, LayoutAdminInstallObj } from "./dto/layout.obj"; + import { DatabaseService } from "../../../../database"; import { core_users } from "../../../../templates/core/admin/database/schema/users"; import { core_sessions } from "../../../../templates/core/admin/database/schema/sessions"; diff --git a/packages/backend/src/core/admin/languages/create/create.service.ts b/packages/backend/src/core/admin/languages/create/create.service.ts index 6d6a20027..4e3681a26 100644 --- a/packages/backend/src/core/admin/languages/create/create.service.ts +++ b/packages/backend/src/core/admin/languages/create/create.service.ts @@ -9,6 +9,7 @@ import { DatabaseService } from "../../../../database"; import { ABSOLUTE_PATHS_BACKEND, CustomError } from "../../../.."; import { core_languages } from "../../../../templates/core/admin/database/schema/languages"; import { ShowCoreLanguages } from "../../../languages/show/dto/show.obj"; +import { setRebuildRequired } from "../../../../functions/rebuild-required"; @Injectable() export class CreateAdminCoreLanguageService { @@ -98,8 +99,7 @@ export class CreateAdminCoreLanguageService { }) .returning(); - // TODO: Fix this - // await setRebuildRequired({ set: "langs" }); + await setRebuildRequired({ set: "langs" }); return newLanguage[0]; } diff --git a/packages/backend/src/core/admin/languages/delete/delete.service.ts b/packages/backend/src/core/admin/languages/delete/delete.service.ts index 26abd893f..888361165 100644 --- a/packages/backend/src/core/admin/languages/delete/delete.service.ts +++ b/packages/backend/src/core/admin/languages/delete/delete.service.ts @@ -11,6 +11,7 @@ import { DatabaseService } from "../../../../database"; import { CustomError, NotFoundError } from "../../../../errors"; import { ABSOLUTE_PATHS_BACKEND } from "../../../.."; import { core_languages } from "../../../../templates/core/admin/database/schema/languages"; +import { setRebuildRequired } from "../../../../functions/rebuild-required"; @Injectable() export class DeleteAdminCoreLanguageService { constructor(private readonly databaseService: DatabaseService) {} @@ -68,8 +69,7 @@ export class DeleteAdminCoreLanguageService { .delete(core_languages) .where(eq(core_languages.code, code)); - // TODO: Fix this - // await setRebuildRequired({ set: "langs" }); + await setRebuildRequired({ set: "langs" }); return "Success!"; } diff --git a/packages/backend/src/core/admin/languages/update/update.service.ts b/packages/backend/src/core/admin/languages/update/update.service.ts index aa5555d7c..e245c733f 100644 --- a/packages/backend/src/core/admin/languages/update/update.service.ts +++ b/packages/backend/src/core/admin/languages/update/update.service.ts @@ -12,6 +12,7 @@ import { DatabaseService } from "../../../../database"; import { NotFoundError } from "../../../../errors"; import { ABSOLUTE_PATHS_BACKEND } from "../../../.."; import { core_languages } from "../../../../templates/core/admin/database/schema/languages"; +import { setRebuildRequired } from "../../../../functions/rebuild-required"; @Injectable() export class UpdateAdminCoreLanguageService { @@ -82,8 +83,7 @@ export class UpdateAdminCoreLanguageService { .set({ updated: new Date() }) .where(eq(core_languages.code, code)); - // TODO: Fix this - // await setRebuildRequired({ set: "langs" }); + await setRebuildRequired({ set: "langs" }); return "Success!"; } diff --git a/packages/backend/src/core/admin/plugins/delete/delete.service.ts b/packages/backend/src/core/admin/plugins/delete/delete.service.ts index 37859aded..fc26d4d4a 100644 --- a/packages/backend/src/core/admin/plugins/delete/delete.service.ts +++ b/packages/backend/src/core/admin/plugins/delete/delete.service.ts @@ -11,6 +11,7 @@ import { CustomError, NotFoundError } from "../../../../errors"; import { core_migrations } from "../../../../templates/core/admin/database/schema/files"; import { ABSOLUTE_PATHS_BACKEND } from "../../../.."; import { core_plugins } from "../../../../templates/core/admin/database/schema/plugins"; +import { setRebuildRequired } from "../../../../functions/rebuild-required"; @Injectable() export class DeleteAdminPluginsService { @@ -79,8 +80,7 @@ export class DeleteAdminPluginsService { .delete(core_plugins) .where(eq(core_plugins.code, code)); - // TODO: Set rebuild required - // await setRebuildRequired({ set: "plugins" }); + await setRebuildRequired({ set: "plugins" }); return "Success!"; } diff --git a/packages/backend/src/core/admin/theme_editor/edit/edit.resolver.ts b/packages/backend/src/core/admin/theme_editor/edit/edit.resolver.ts index 75c93cabb..1d2e2b5cc 100644 --- a/packages/backend/src/core/admin/theme_editor/edit/edit.resolver.ts +++ b/packages/backend/src/core/admin/theme_editor/edit/edit.resolver.ts @@ -3,6 +3,7 @@ import { UseGuards } from "@nestjs/common"; import { EditAdminThemeEditorService } from "./edit.service"; import { EditAdminThemeEditorArgs } from "./dto/edit.args"; + import { AdminAuthGuards } from "../../../../utils"; @Resolver() diff --git a/packages/backend/src/core/admin/theme_editor/edit/edit.service.ts b/packages/backend/src/core/admin/theme_editor/edit/edit.service.ts index 764127c0e..52669e2d5 100644 --- a/packages/backend/src/core/admin/theme_editor/edit/edit.service.ts +++ b/packages/backend/src/core/admin/theme_editor/edit/edit.service.ts @@ -4,6 +4,7 @@ import * as fs from "fs"; import { Injectable } from "@nestjs/common"; import { EditAdminThemeEditorArgs, ThemeVariableInput } from "./dto/edit.args"; + import { ABSOLUTE_PATHS_BACKEND, NotFoundError } from "../../../.."; import { keysFromCSSThemeEditor } from "../../../theme_editor/theme_editor.module"; diff --git a/packages/backend/src/core/theme_editor/show/show.service.ts b/packages/backend/src/core/theme_editor/show/show.service.ts index 3f36b2aa8..7cf9e6414 100644 --- a/packages/backend/src/core/theme_editor/show/show.service.ts +++ b/packages/backend/src/core/theme_editor/show/show.service.ts @@ -8,9 +8,10 @@ import { HslColor, ShowCoreThemeEditorObj } from "./dto/show.obj"; -import { ABSOLUTE_PATHS_BACKEND, NotFoundError } from "../../.."; import { keysFromCSSThemeEditor } from "../theme_editor.module"; +import { ABSOLUTE_PATHS_BACKEND, NotFoundError } from "../../.."; + @Injectable() export class ShowCoreThemeEditorService { private parseStringToHsl(string: string): HslColor { diff --git a/apps/backend/src/functions/rebuild-required.ts b/packages/backend/src/functions/rebuild-required.ts similarity index 81% rename from apps/backend/src/functions/rebuild-required.ts rename to packages/backend/src/functions/rebuild-required.ts index 17e32e865..37fbd5f89 100644 --- a/apps/backend/src/functions/rebuild-required.ts +++ b/packages/backend/src/functions/rebuild-required.ts @@ -1,8 +1,7 @@ import * as fs from "fs"; -import { CustomError } from "vitnode-backend"; - -import { ConfigType, configPath, getConfigFile } from "@/config"; +import { ConfigType, configPath, getConfigFile } from "../core/config"; +import { CustomError } from "../errors"; export const setRebuildRequired = async ({ set From 924eb2e90c323db3d860ef02e1f9201b93d3f2c6 Mon Sep 17 00:00:00 2001 From: aXenDeveloper Date: Sat, 22 Jun 2024 16:16:38 +0200 Subject: [PATCH 21/27] feat(backend): Create helpers service for email --- apps/backend/src/config.ts | 119 ------------------ .../src/utils/actions/helpers/manifest.ts | 12 +- .../utils/actions/helpers/update-plugins.ts | 4 +- apps/backend/src/utils/actions/migrate.ts | 6 +- packages/backend/scripts/init.mjs | 2 +- packages/backend/src/app.module.ts | 4 +- .../backend/src/core/admin/email/helpers.ts | 86 ------------- .../src/core/admin/email/send/send.service.ts | 15 ++- .../admin/email/settings/edit/edit.service.ts | 6 +- .../admin/email/settings/show/show.service.ts | 2 +- .../plugins/helpers/files/create/contents.ts | 2 +- .../core/admin/plugins/nav/helpers.service.ts | 5 +- .../admin/settings/functions/get-core-info.ts | 2 +- .../src/core/editor/upload/upload.service.ts | 2 +- .../backend/src/functions/rebuild-required.ts | 2 +- packages/backend/src/guards.module.ts | 20 --- packages/backend/src/index.ts | 5 +- .../backend/src/{core => providers}/config.ts | 0 .../providers/email/email-helpers.service.ts | 49 ++++++++ .../src/providers/email/email-helpers.type.ts | 28 +++++ packages/backend/src/providers/email/email.ts | 38 ++++++ .../email/template}/_components/header.tsx | 0 .../email/template}/email-template.tsx | 13 +- packages/backend/src/providers/index.ts | 4 + .../type.ts => providers/plugins.type.ts} | 2 +- .../backend/src/providers/providers.module.ts | 25 ++++ 26 files changed, 197 insertions(+), 256 deletions(-) delete mode 100644 apps/backend/src/config.ts delete mode 100644 packages/backend/src/core/admin/email/helpers.ts delete mode 100644 packages/backend/src/guards.module.ts rename packages/backend/src/{core => providers}/config.ts (100%) create mode 100644 packages/backend/src/providers/email/email-helpers.service.ts create mode 100644 packages/backend/src/providers/email/email-helpers.type.ts create mode 100644 packages/backend/src/providers/email/email.ts rename packages/backend/src/{core/admin/email/emails => providers/email/template}/_components/header.tsx (100%) rename packages/backend/src/{core/admin/email/emails => providers/email/template}/email-template.tsx (92%) create mode 100644 packages/backend/src/providers/index.ts rename packages/backend/src/{core/admin/plugins/type.ts => providers/plugins.type.ts} (84%) create mode 100644 packages/backend/src/providers/providers.module.ts diff --git a/apps/backend/src/config.ts b/apps/backend/src/config.ts deleted file mode 100644 index 4a1c1484e..000000000 --- a/apps/backend/src/config.ts +++ /dev/null @@ -1,119 +0,0 @@ -import * as fs from "fs"; -import { join } from "path"; - -const internalPaths = { - uploads: join(process.cwd(), "uploads"), - frontend: join(process.cwd(), "..", "frontend"), - plugins: join(process.cwd(), "src", "plugins") -}; - -export const ABSOLUTE_PATHS = { - uploads: { - init: internalPaths.uploads, - public: join(internalPaths.uploads, "public"), - private: join(internalPaths.uploads, "private"), - temp: join(internalPaths.uploads, "temp") - }, - frontend: { - init: internalPaths.frontend - }, - backend: join(process.cwd(), "src"), - plugins: internalPaths.plugins, - plugin: ({ code }: { code: string }) => ({ - root: join(internalPaths.plugins, code), - config: join(internalPaths.plugins, code, "config.json"), - versions: join(internalPaths.plugins, code, "versions.json"), - database: { - schema: join(internalPaths.plugins, code, "admin", "database", "schema"), - migrations: join( - internalPaths.plugins, - code, - "admin", - "database", - "migrations" - ), - migration_info: join( - internalPaths.plugins, - code, - "admin", - "database", - "migrations", - "meta", - "_journal.json" - ) - }, - frontend: { - admin_pages: join( - internalPaths.frontend, - "app", - "[locale]", - "(admin)", - "admin", - "(auth)", - code - ), - admin_templates: join(internalPaths.frontend, "plugins", code, "admin"), - pages_container: join( - internalPaths.frontend, - "app", - "[locale]", - "(main)", - "(container)", - code - ), - default_page: join( - internalPaths.frontend, - "plugins", - code, - "templates", - "default-page.tsx" - ), - pages: join(internalPaths.frontend, "app", "[locale]", "(main)", code), - templates: join(internalPaths.frontend, "plugins", code, "templates"), - plugin: join(internalPaths.frontend, "plugins", code), - language: join(internalPaths.frontend, "plugins", code, "langs") - } - }) -}; - -export interface ConfigType { - editor: { - files: { - allow_type: "all" | "images_videos" | "images" | "none"; - }; - sticky: boolean; - }; - langs: { - code: string; - default: boolean; - enabled: boolean; - }[]; - rebuild_required: { - langs: boolean; - plugins: boolean; - }; - settings: { - email: { - color_primary: string; - color_primary_foreground: string; - }; - general: { - site_name: string; - site_short_name: string; - }; - }; -} - -export const configPath = join( - process.cwd(), - "..", - "frontend", - "config", - "config.json" -); - -export const getConfigFile = () => { - const file = fs.readFileSync(configPath, "utf-8"); - - return JSON.parse(file) as ConfigType; -}; diff --git a/apps/backend/src/utils/actions/helpers/manifest.ts b/apps/backend/src/utils/actions/helpers/manifest.ts index aac8f474b..defdce1eb 100644 --- a/apps/backend/src/utils/actions/helpers/manifest.ts +++ b/apps/backend/src/utils/actions/helpers/manifest.ts @@ -3,9 +3,9 @@ import * as fs from "fs"; import * as dotenv from "dotenv"; -import { ABSOLUTE_PATHS, getConfigFile } from "@/config"; import { parseFrontendUrlFromEnv } from "@/functions/envs"; import { objectToArray, updateObject } from "@/functions/update-object"; +import { ABSOLUTE_PATHS_BACKEND, getConfigFile } from "vitnode-backend"; dotenv.config({ path: join(process.cwd(), "..", ".env") @@ -95,7 +95,9 @@ const generateDefaultManifest = ({ export const generateManifest = () => { const config = getConfigFile(); const languages = fs - .readdirSync(ABSOLUTE_PATHS.plugin({ code: "core" }).frontend.language) + .readdirSync( + ABSOLUTE_PATHS_BACKEND.plugin({ code: "core" }).frontend.language + ) .map(fileName => fileName.replace(".json", "")); const frontend_url = parseFrontendUrlFromEnv().url; @@ -106,7 +108,11 @@ export const generateManifest = () => { site_name: config.settings.general.site_name, site_short_name: config.settings.general.site_short_name }); - const path = join(ABSOLUTE_PATHS.uploads.public, "assets", lang_code); + const path = join( + ABSOLUTE_PATHS_BACKEND.uploads.public, + "assets", + lang_code + ); const filePath = join(path, "manifest.webmanifest"); if (fs.existsSync(filePath)) { diff --git a/apps/backend/src/utils/actions/helpers/update-plugins.ts b/apps/backend/src/utils/actions/helpers/update-plugins.ts index 9576ae571..4fc60584a 100644 --- a/apps/backend/src/utils/actions/helpers/update-plugins.ts +++ b/apps/backend/src/utils/actions/helpers/update-plugins.ts @@ -8,7 +8,7 @@ import { ConfigPlugin } from "vitnode-backend"; import { core_plugins } from "@/plugins/core/admin/database/schema/plugins"; import { schemaDatabase } from "@/database/schema"; import { poolDB } from "@/database/client"; -import { ABSOLUTE_PATHS } from "@/config"; +import { ABSOLUTE_PATHS_BACKEND } from "vitnode-backend"; export const updatePlugins = async ({ db @@ -27,7 +27,7 @@ export const updatePlugins = async ({ plugin => !["database", "plugins.module.ts", "core"].includes(plugin) ) .map(async (code, index) => { - const paths = ABSOLUTE_PATHS.plugin({ code }); + const paths = ABSOLUTE_PATHS_BACKEND.plugin({ code }); const config: ConfigPlugin = JSON.parse( fs.readFileSync(paths.config, "utf8") ); diff --git a/apps/backend/src/utils/actions/migrate.ts b/apps/backend/src/utils/actions/migrate.ts index b35723fbf..41750ecc5 100644 --- a/apps/backend/src/utils/actions/migrate.ts +++ b/apps/backend/src/utils/actions/migrate.ts @@ -4,7 +4,7 @@ import * as fs from "fs"; import { sql } from "drizzle-orm"; import { MigrationMeta } from "drizzle-orm/migrator"; -import { ABSOLUTE_PATHS } from "@/config"; +import { ABSOLUTE_PATHS_BACKEND } from "vitnode-backend"; import { db } from "@/database/client"; // Source: https://github.com/drizzle-team/drizzle-orm/blob/main/drizzle-orm/src/migrator.ts @@ -13,8 +13,8 @@ const readMigrationFiles = ({ }: { pluginCode: string; }): MigrationMeta[] => { - const migrationFolderTo = ABSOLUTE_PATHS.plugin({ code: pluginCode }).database - .migrations; + const migrationFolderTo = ABSOLUTE_PATHS_BACKEND.plugin({ code: pluginCode }) + .database.migrations; const journalPath = `${migrationFolderTo}/meta/_journal.json`; if (!fs.existsSync(journalPath)) { // eslint-disable-next-line no-console diff --git a/packages/backend/scripts/init.mjs b/packages/backend/scripts/init.mjs index a6f0ea783..2c674c708 100755 --- a/packages/backend/scripts/init.mjs +++ b/packages/backend/scripts/init.mjs @@ -10,7 +10,7 @@ const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); /** - * + * Copy the database schema from the template to the core plugin * @param {string} corePluginPath */ const copyDatabaseSchema = corePluginPath => { diff --git a/packages/backend/src/app.module.ts b/packages/backend/src/app.module.ts index 33284407b..bc9697517 100644 --- a/packages/backend/src/app.module.ts +++ b/packages/backend/src/app.module.ts @@ -12,7 +12,7 @@ import { ApolloServerPluginLandingPageLocalDefault } from "@apollo/server/plugin import { Ctx } from "./utils"; import { CoreModule } from "./core/core.module"; import { DatabaseModule, DatabaseModuleArgs } from "./database/database.module"; -import { GlobalGuardsModule } from "./guards.module"; +import { GlobalProvidersModule } from "./providers/providers.module"; const internalPaths = { backend: join(process.cwd(), "src"), @@ -181,7 +181,7 @@ export class VitNodeCoreModule { serveRoot: "/public/" }), DatabaseModule.register(database), - GlobalGuardsModule, + GlobalProvidersModule, CoreModule ] }; diff --git a/packages/backend/src/core/admin/email/helpers.ts b/packages/backend/src/core/admin/email/helpers.ts deleted file mode 100644 index 3a9e35985..000000000 --- a/packages/backend/src/core/admin/email/helpers.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { join } from "path"; -import * as fs from "fs"; - -import { convertColor, getHSLFromString } from "@vitnode/shared"; - -import { getConfigFile } from "../../config"; - -export interface HelpersForEmailReturnValues { - hostname: string; - port: string; - protocol: string; - url: string; -} - -export const getHelpersForEmail = () => { - const config = getConfigFile(); - // TODO: Implement parseFrontendUrlFromEnv - // const frontend_url = parseFrontendUrlFromEnv(); - - const primaryHSL = getHSLFromString(config.settings.email.color_primary); - const primaryForegroundHSL = getHSLFromString( - config.settings.email.color_primary_foreground - ); - - return { - site_name: config.settings.general.site_name, - site_short_name: config.settings.general.site_short_name, - frontend_url: { - url: "http://localhost:3000" - }, - color: { - primary: { - DEFAULT: `[${primaryHSL ? convertColor.hslToHex(primaryHSL) : "#215fdc"}]`, - foreground: `[${ - primaryForegroundHSL - ? convertColor.hslToHex(primaryForegroundHSL) - : "#131415" - }]` - }, - background: "[#f8f9fc]", - foreground: "[#131415]", - card: "[#fff]", - border: "[#e0e4eb]", - muted: { - DEFAULT: "[#f1f3f9]", - foreground: "[#676d79]" - } - } - }; -}; - -export const getTranslationForEmail = (plugin: string) => { - const resolvePlugin = plugin.split("."); - const path = join( - process.cwd(), - "..", - "frontend", - "plugins", - resolvePlugin[0], - "langs", - "en.json" - ); - - const read = fs.readFileSync(path, "utf-8"); - const messages = JSON.parse(read); - - return (key: string) => { - let message = messages; - - [...resolvePlugin, ...key.split(".")].forEach(part => { - try { - const next = message[part as any]; - - if (part == null || next == null) { - return key; - } - - message = next; - } catch (e) { - return key; - } - }); - - return message; - }; -}; diff --git a/packages/backend/src/core/admin/email/send/send.service.ts b/packages/backend/src/core/admin/email/send/send.service.ts index b35569c68..b0621ba93 100644 --- a/packages/backend/src/core/admin/email/send/send.service.ts +++ b/packages/backend/src/core/admin/email/send/send.service.ts @@ -1,7 +1,7 @@ -import { Injectable } from "@nestjs/common"; +import { Inject, Injectable } from "@nestjs/common"; import { MailService } from "../mail.service"; -import { EmailTemplate } from "../emails/email-template"; +import { EmailHelpersServiceType } from "../../../../providers/email/email-helpers.type"; interface Args { from: string; @@ -12,13 +12,20 @@ interface Args { @Injectable() export class SendAdminEmailService { - constructor(private readonly mailService: MailService) {} + constructor( + private readonly mailService: MailService, + @Inject("EmailHelpersService") + private readonly emailHelpersService: EmailHelpersServiceType + ) {} async send({ to, from, subject, message }: Args): Promise { await this.mailService.sendMail({ to, subject, - template: EmailTemplate({ previewText: "test", children: message }) + template: this.emailHelpersService.template({ + previewText: "test", + children: message + }) }); return "Email sent with Message!"; diff --git a/packages/backend/src/core/admin/email/settings/edit/edit.service.ts b/packages/backend/src/core/admin/email/settings/edit/edit.service.ts index 103268485..f8e536a0e 100644 --- a/packages/backend/src/core/admin/email/settings/edit/edit.service.ts +++ b/packages/backend/src/core/admin/email/settings/edit/edit.service.ts @@ -9,7 +9,11 @@ import { HelpersAdminEmailSettingsService, ShowAdminEmailSettingsServiceObjWithPassword } from "../../helpers.service"; -import { ConfigType, configPath, getConfigFile } from "../../../../config"; +import { + ConfigType, + configPath, + getConfigFile +} from "../../../../../providers/config"; @Injectable() export class EditAdminEmailSettingsService extends HelpersAdminEmailSettingsService { diff --git a/packages/backend/src/core/admin/email/settings/show/show.service.ts b/packages/backend/src/core/admin/email/settings/show/show.service.ts index 3da671c1e..21b8155ef 100644 --- a/packages/backend/src/core/admin/email/settings/show/show.service.ts +++ b/packages/backend/src/core/admin/email/settings/show/show.service.ts @@ -5,7 +5,7 @@ import { Injectable } from "@nestjs/common"; import { ShowAdminEmailSettingsServiceObj } from "./dto/show.obj"; import { HelpersAdminEmailSettingsService } from "../../helpers.service"; -import { getConfigFile } from "../../../../config"; +import { getConfigFile } from "../../../../../providers/config"; @Injectable() export class ShowAdminEmailSettingsService extends HelpersAdminEmailSettingsService { diff --git a/packages/backend/src/core/admin/plugins/helpers/files/create/contents.ts b/packages/backend/src/core/admin/plugins/helpers/files/create/contents.ts index 86862b55f..94cb255e2 100644 --- a/packages/backend/src/core/admin/plugins/helpers/files/create/contents.ts +++ b/packages/backend/src/core/admin/plugins/helpers/files/create/contents.ts @@ -1,4 +1,4 @@ -import { PluginInfoJSONType } from "../../../type"; +import { PluginInfoJSONType } from "../../../../../../providers/plugins.type"; import { changeCodePluginToCapitalLetters } from "../../change-code-plugin-to-capital-letters"; export const createModuleSchema = ({ code }: { code: string }) => { diff --git a/packages/backend/src/core/admin/plugins/nav/helpers.service.ts b/packages/backend/src/core/admin/plugins/nav/helpers.service.ts index bc2de896a..92b0ff27c 100644 --- a/packages/backend/src/core/admin/plugins/nav/helpers.service.ts +++ b/packages/backend/src/core/admin/plugins/nav/helpers.service.ts @@ -1,6 +1,9 @@ import { Injectable } from "@nestjs/common"; -import { ConfigPlugin, NavPluginInfoJSONTypeWithChildren } from "../type"; +import { + ConfigPlugin, + NavPluginInfoJSONTypeWithChildren +} from "../../../../providers/plugins.type"; @Injectable() export class HelpersAdminNavPluginsService { diff --git a/packages/backend/src/core/admin/settings/functions/get-core-info.ts b/packages/backend/src/core/admin/settings/functions/get-core-info.ts index 2efe0a6c4..c1b558fab 100644 --- a/packages/backend/src/core/admin/settings/functions/get-core-info.ts +++ b/packages/backend/src/core/admin/settings/functions/get-core-info.ts @@ -1,7 +1,7 @@ import { join } from "path"; import * as fs from "fs"; -import { PluginInfoJSONType } from "../../plugins/type"; +import { PluginInfoJSONType } from "../../../../providers/plugins.type"; export const getCoreInfo = async () => { const path = join(process.cwd(), "src", "plugins", "core"); diff --git a/packages/backend/src/core/editor/upload/upload.service.ts b/packages/backend/src/core/editor/upload/upload.service.ts index 22b3b62dc..22321d269 100644 --- a/packages/backend/src/core/editor/upload/upload.service.ts +++ b/packages/backend/src/core/editor/upload/upload.service.ts @@ -16,7 +16,7 @@ import { DatabaseService } from "../../../database"; import { User } from "../../../decorators"; import { AccessDeniedError } from "../../../errors"; import { core_files } from "../../../templates/core/admin/database/schema/files"; -import { getConfigFile } from "../../config"; +import { getConfigFile } from "../../../providers/config"; interface GetFilesAfterUploadArgs extends UploadCoreEditorArgs { maxUploadSizeKb: number; diff --git a/packages/backend/src/functions/rebuild-required.ts b/packages/backend/src/functions/rebuild-required.ts index 37fbd5f89..9e80209f6 100644 --- a/packages/backend/src/functions/rebuild-required.ts +++ b/packages/backend/src/functions/rebuild-required.ts @@ -1,6 +1,6 @@ import * as fs from "fs"; -import { ConfigType, configPath, getConfigFile } from "../core/config"; +import { ConfigType, configPath, getConfigFile } from "../providers/config"; import { CustomError } from "../errors"; export const setRebuildRequired = async ({ diff --git a/packages/backend/src/guards.module.ts b/packages/backend/src/guards.module.ts deleted file mode 100644 index 930ef4db5..000000000 --- a/packages/backend/src/guards.module.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Global, Module } from "@nestjs/common"; - -import { AuthorizationAdminSessionsService } from "./core/admin/sessions/authorization/authorization.service"; -import { InternalAuthorizationCoreSessionsService } from "./core/sessions/authorization/internal/internal_authorization.service"; - -@Global() -@Module({ - providers: [ - { - provide: "IOAdminAuthGuards", - useClass: AuthorizationAdminSessionsService - }, - { - provide: "IOAuthGuards", - useClass: InternalAuthorizationCoreSessionsService - } - ], - exports: ["IOAdminAuthGuards", "IOAuthGuards"] -}) -export class GlobalGuardsModule {} diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts index 06c846b85..15b756c75 100644 --- a/packages/backend/src/index.ts +++ b/packages/backend/src/index.ts @@ -10,6 +10,7 @@ export * from "./database"; // Services export * from "./core/admin/sessions/authorization/authorization.service"; export * from "./core/sessions/authorization/internal/internal_authorization.service"; -export * from "./core/admin/plugins/type"; export * from "./core/helpers/text_language/parser/parser.service"; -export * from "./core/config"; + +// Providers / Helpers +export * from "./providers"; diff --git a/packages/backend/src/core/config.ts b/packages/backend/src/providers/config.ts similarity index 100% rename from packages/backend/src/core/config.ts rename to packages/backend/src/providers/config.ts diff --git a/packages/backend/src/providers/email/email-helpers.service.ts b/packages/backend/src/providers/email/email-helpers.service.ts new file mode 100644 index 000000000..1446766a3 --- /dev/null +++ b/packages/backend/src/providers/email/email-helpers.service.ts @@ -0,0 +1,49 @@ +import { Injectable } from "@nestjs/common"; +import { getConfigFile } from "../config"; +import { convertColor, getHSLFromString } from "@vitnode/shared"; +import { EmailHelpersServiceType } from "./email-helpers.type"; +import EmailTemplate from "./template/email-template"; + +@Injectable() +export class EmailHelpersService { + getHelpersForEmail: EmailHelpersServiceType["getHelpersForEmail"] = () => { + const config = getConfigFile(); + // TODO: Implement parseFrontendUrlFromEnv + // const frontend_url = parseFrontendUrlFromEnv(); + + const primaryHSL = getHSLFromString(config.settings.email.color_primary); + const primaryForegroundHSL = getHSLFromString( + config.settings.email.color_primary_foreground + ); + + return { + site_name: config.settings.general.site_name, + site_short_name: config.settings.general.site_short_name, + frontend_url: { + url: "http://localhost:3000" + }, + color: { + primary: { + DEFAULT: `[${primaryHSL ? convertColor.hslToHex(primaryHSL) : "#215fdc"}]`, + foreground: `[${ + primaryForegroundHSL + ? convertColor.hslToHex(primaryForegroundHSL) + : "#131415" + }]` + }, + background: "[#f8f9fc]", + foreground: "[#131415]", + card: "[#fff]", + border: "[#e0e4eb]", + muted: { + DEFAULT: "[#f1f3f9]", + foreground: "[#676d79]" + } + } + }; + }; + + template: EmailHelpersServiceType["template"] = props => { + return EmailTemplate({ ...props, helpers: this.getHelpersForEmail() }); + }; +} diff --git a/packages/backend/src/providers/email/email-helpers.type.ts b/packages/backend/src/providers/email/email-helpers.type.ts new file mode 100644 index 000000000..ff1810eb4 --- /dev/null +++ b/packages/backend/src/providers/email/email-helpers.type.ts @@ -0,0 +1,28 @@ +import { EmailTemplateProps } from "./template/email-template"; + +export interface GetHelpersForEmailType { + site_name: string; + site_short_name: string; + frontend_url: { + url: string; + }; + color: { + primary: { + DEFAULT: string; + foreground: string; + }; + background: string; + foreground: string; + card: string; + border: string; + muted: { + DEFAULT: string; + foreground: string; + }; + }; +} + +export interface EmailHelpersServiceType { + getHelpersForEmail: () => GetHelpersForEmailType; + template: (props: Omit) => JSX.Element; +} diff --git a/packages/backend/src/providers/email/email.ts b/packages/backend/src/providers/email/email.ts new file mode 100644 index 000000000..00fa2a28a --- /dev/null +++ b/packages/backend/src/providers/email/email.ts @@ -0,0 +1,38 @@ +import * as fs from "fs"; +import { join } from "path"; + +export const getTranslationForEmail = (namespaces: string) => { + const resolveNamespace = namespaces.split("."); + const path = join( + process.cwd(), + "..", + "frontend", + "plugins", + resolveNamespace[0], + "langs", + "en.json" + ); + + const read = fs.readFileSync(path, "utf-8"); + const messages = JSON.parse(read); + + return (key: string) => { + let message = messages; + + [...resolveNamespace, ...key.split(".")].forEach(part => { + try { + const next = message[part as any]; + + if (part == null || next == null) { + return key; + } + + message = next; + } catch (e) { + return key; + } + }); + + return message; + }; +}; diff --git a/packages/backend/src/core/admin/email/emails/_components/header.tsx b/packages/backend/src/providers/email/template/_components/header.tsx similarity index 100% rename from packages/backend/src/core/admin/email/emails/_components/header.tsx rename to packages/backend/src/providers/email/template/_components/header.tsx diff --git a/packages/backend/src/core/admin/email/emails/email-template.tsx b/packages/backend/src/providers/email/template/email-template.tsx similarity index 92% rename from packages/backend/src/core/admin/email/emails/email-template.tsx rename to packages/backend/src/providers/email/template/email-template.tsx index 9c1f91611..8fdb6ac26 100644 --- a/packages/backend/src/core/admin/email/emails/email-template.tsx +++ b/packages/backend/src/providers/email/template/email-template.tsx @@ -12,23 +12,24 @@ import { } from "@react-email/components"; import * as React from "react"; -import { getHelpersForEmail, getTranslationForEmail } from "../helpers"; import { HeaderEmail } from "./_components/header"; +import { getTranslationForEmail } from "../email"; +import { GetHelpersForEmailType } from "../email-helpers.type"; -interface Props { +export interface EmailTemplateProps { children: React.ReactNode; previewText: string; header?: React.ReactNode; + helpers: GetHelpersForEmailType; } export const EmailTemplate = ({ previewText = "previewText", header = , - children = "This is the email template." -}: Props) => { + children = "This is the email template.", + helpers: { color, frontend_url, site_name, site_short_name } +}: EmailTemplateProps) => { const t = getTranslationForEmail("admin.core.email"); - const { color, frontend_url, site_name, site_short_name } = - getHelpersForEmail(); return ( diff --git a/packages/backend/src/providers/index.ts b/packages/backend/src/providers/index.ts new file mode 100644 index 000000000..dcec97608 --- /dev/null +++ b/packages/backend/src/providers/index.ts @@ -0,0 +1,4 @@ +export * from "./config"; +export * from "./plugins.type"; +export * from "./email/email"; +export * from "./email/email-helpers.type"; diff --git a/packages/backend/src/core/admin/plugins/type.ts b/packages/backend/src/providers/plugins.type.ts similarity index 84% rename from packages/backend/src/core/admin/plugins/type.ts rename to packages/backend/src/providers/plugins.type.ts index 5297cbd6a..b77638f60 100644 --- a/packages/backend/src/core/admin/plugins/type.ts +++ b/packages/backend/src/providers/plugins.type.ts @@ -1,4 +1,4 @@ -import { CreateAdminPluginsArgs } from "./create/dto/create.args"; +import { CreateAdminPluginsArgs } from "../core/admin/plugins/create/dto/create.args"; interface NavPluginInfoJSONType { code: string; diff --git a/packages/backend/src/providers/providers.module.ts b/packages/backend/src/providers/providers.module.ts new file mode 100644 index 000000000..8eb9b095c --- /dev/null +++ b/packages/backend/src/providers/providers.module.ts @@ -0,0 +1,25 @@ +import { Global, Module } from "@nestjs/common"; + +import { AuthorizationAdminSessionsService } from "../core/admin/sessions/authorization/authorization.service"; +import { InternalAuthorizationCoreSessionsService } from "../core/sessions/authorization/internal/internal_authorization.service"; +import { EmailHelpersService } from "./email/email-helpers.service"; + +@Global() +@Module({ + providers: [ + { + provide: "IOAdminAuthGuards", + useClass: AuthorizationAdminSessionsService + }, + { + provide: "IOAuthGuards", + useClass: InternalAuthorizationCoreSessionsService + }, + { + provide: "EmailHelpersService", + useClass: EmailHelpersService + } + ], + exports: ["IOAdminAuthGuards", "IOAuthGuards", "EmailHelpersService"] +}) +export class GlobalProvidersModule {} From e5761f1a08a06071cc88ca5c8564e171d679c1b2 Mon Sep 17 00:00:00 2001 From: aXenDeveloper Date: Sat, 22 Jun 2024 16:32:07 +0200 Subject: [PATCH 22/27] perf(backend): Add frontend url to email helper by env --- packages/backend/src/app.module.ts | 19 +++++++++---------- .../providers/email/email-helpers.service.ts | 8 +++++--- .../src/providers/email/email-helpers.type.ts | 4 +--- .../email/template/email-template.tsx | 2 +- 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/packages/backend/src/app.module.ts b/packages/backend/src/app.module.ts index bc9697517..13a30d907 100644 --- a/packages/backend/src/app.module.ts +++ b/packages/backend/src/app.module.ts @@ -14,6 +14,15 @@ import { CoreModule } from "./core/core.module"; import { DatabaseModule, DatabaseModuleArgs } from "./database/database.module"; import { GlobalProvidersModule } from "./providers/providers.module"; +export interface VitNodePaths { + envFile: string; +} + +interface Args { + database: DatabaseModuleArgs; + paths: VitNodePaths; +} + const internalPaths = { backend: join(process.cwd(), "src"), frontend: join(process.cwd(), "..", "frontend"), @@ -145,16 +154,6 @@ const config = () => { return data; }; -export interface VitNodePaths { - envFile: string; -} - -interface Args { - database: DatabaseModuleArgs; - paths: VitNodePaths; - // schemaDatabase: Record; -} - @Module({}) export class VitNodeCoreModule { static register({ paths, database }: Args): DynamicModule { diff --git a/packages/backend/src/providers/email/email-helpers.service.ts b/packages/backend/src/providers/email/email-helpers.service.ts index 1446766a3..5b9ab6b13 100644 --- a/packages/backend/src/providers/email/email-helpers.service.ts +++ b/packages/backend/src/providers/email/email-helpers.service.ts @@ -3,13 +3,17 @@ import { getConfigFile } from "../config"; import { convertColor, getHSLFromString } from "@vitnode/shared"; import { EmailHelpersServiceType } from "./email-helpers.type"; import EmailTemplate from "./template/email-template"; +import { ConfigService } from "@nestjs/config"; @Injectable() export class EmailHelpersService { + constructor(private readonly configService: ConfigService) {} + getHelpersForEmail: EmailHelpersServiceType["getHelpersForEmail"] = () => { const config = getConfigFile(); // TODO: Implement parseFrontendUrlFromEnv // const frontend_url = parseFrontendUrlFromEnv(); + const frontend_url: string = this.configService.getOrThrow("frontend_url"); const primaryHSL = getHSLFromString(config.settings.email.color_primary); const primaryForegroundHSL = getHSLFromString( @@ -19,9 +23,7 @@ export class EmailHelpersService { return { site_name: config.settings.general.site_name, site_short_name: config.settings.general.site_short_name, - frontend_url: { - url: "http://localhost:3000" - }, + frontend_url, color: { primary: { DEFAULT: `[${primaryHSL ? convertColor.hslToHex(primaryHSL) : "#215fdc"}]`, diff --git a/packages/backend/src/providers/email/email-helpers.type.ts b/packages/backend/src/providers/email/email-helpers.type.ts index ff1810eb4..94c89b33b 100644 --- a/packages/backend/src/providers/email/email-helpers.type.ts +++ b/packages/backend/src/providers/email/email-helpers.type.ts @@ -3,9 +3,7 @@ import { EmailTemplateProps } from "./template/email-template"; export interface GetHelpersForEmailType { site_name: string; site_short_name: string; - frontend_url: { - url: string; - }; + frontend_url: string; color: { primary: { DEFAULT: string; diff --git a/packages/backend/src/providers/email/template/email-template.tsx b/packages/backend/src/providers/email/template/email-template.tsx index 8fdb6ac26..d94c72227 100644 --- a/packages/backend/src/providers/email/template/email-template.tsx +++ b/packages/backend/src/providers/email/template/email-template.tsx @@ -134,7 +134,7 @@ export const EmailTemplate = ({
{site_short_name} © {new Date().getFullYear()} From 95500191d430fa515d60c988190e07470af91653 Mon Sep 17 00:00:00 2001 From: aXenDeveloper Date: Sat, 22 Jun 2024 20:28:52 +0200 Subject: [PATCH 23/27] chore: Change prettier config --- .prettierrc | 2 +- README.md | 6 +- apps/backend/codegen.ts | 18 ++--- apps/backend/drizzle.config.ts | 4 +- apps/backend/src/app.module.ts | 10 +-- apps/backend/src/database/client.ts | 4 +- apps/backend/src/database/schema.ts | 4 +- apps/backend/src/functions/envs.ts | 2 +- apps/backend/src/functions/update-object.ts | 8 +- apps/backend/src/main.ts | 8 +- .../src/plugins/blog/admin/admin.module.ts | 2 +- .../categories/create/create.resolver.ts | 2 +- .../admin/categories/create/create.service.ts | 24 +++--- .../categories/create/dto/create.args.ts | 2 +- .../blog/admin/database/drizzle.config.ts | 4 +- .../plugins/blog/admin/database/functions.ts | 2 +- .../src/plugins/blog/admin/database/index.ts | 2 +- .../blog/admin/database/schema/articles.ts | 58 +++++++-------- .../blog/admin/database/schema/categories.ts | 60 +++++++-------- apps/backend/src/plugins/blog/blog.module.ts | 2 +- .../blog/categories/categories.module.ts | 2 +- .../blog/categories/show/show.resolver.ts | 2 +- .../blog/categories/show/show.service.ts | 16 ++-- .../core/admin/database/drizzle.config.ts | 4 +- .../src/plugins/core/admin/database/index.ts | 2 +- .../core/admin/database/schema/admins.ts | 42 +++++------ .../core/admin/database/schema/files.ts | 30 ++++---- .../core/admin/database/schema/groups.ts | 24 +++--- .../core/admin/database/schema/languages.ts | 10 +-- .../core/admin/database/schema/moderators.ts | 24 +++--- .../plugins/core/admin/database/schema/nav.ts | 50 ++++++------- .../core/admin/database/schema/plugins.ts | 8 +- .../core/admin/database/schema/sessions.ts | 34 ++++----- .../core/admin/database/schema/users.ts | 24 +++--- apps/backend/src/plugins/plugins.module.ts | 6 +- .../backend/src/utils/actions/finish-build.ts | 2 +- .../src/utils/actions/helpers/manifest.ts | 28 +++---- .../utils/actions/helpers/update-plugins.ts | 23 +++--- apps/backend/src/utils/actions/migrate.ts | 14 ++-- apps/docs/package.json | 2 +- .../admin/(auth)/blog/categories/page.tsx | 8 +- .../(admin)/admin/(auth)/blog/layout.tsx | 6 +- .../admin/(auth)/core/advanced/files/page.tsx | 12 +-- .../admin/(auth)/core/advanced/layout.tsx | 6 +- .../(admin)/admin/(auth)/core/langs/page.tsx | 12 +-- .../core/plugins/[code]/dev/files/page.tsx | 10 +-- .../(auth)/core/plugins/[code]/dev/layout.tsx | 8 +- .../core/plugins/[code]/dev/nav/page.tsx | 16 ++-- .../core/plugins/[code]/dev/query-api.ts | 6 +- .../admin/(auth)/core/plugins/page.tsx | 12 +-- .../admin/(auth)/core/settings/email/page.tsx | 8 +- .../(auth)/core/settings/general/page.tsx | 8 +- .../admin/(auth)/core/settings/layout.tsx | 6 +- .../(auth)/core/settings/metadata/page.tsx | 6 +- .../admin/(auth)/core/styles/editor/page.tsx | 2 +- .../admin/(auth)/core/styles/layout.tsx | 6 +- .../admin/(auth)/core/styles/nav/page.tsx | 6 +- .../(admin)/admin/(auth)/get-session-admin.ts | 4 +- .../[locale]/(admin)/admin/(auth)/layout.tsx | 6 +- .../admin/(auth)/members/groups/page.tsx | 10 +-- .../members/staff/administrators/page.tsx | 12 +-- .../(auth)/members/staff/moderators/page.tsx | 12 +-- .../admin/(auth)/members/users/page.tsx | 12 +-- .../(admin)/admin/(auth)/providers.tsx | 6 +- .../(admin)/admin/(configs)/install/page.tsx | 4 +- .../app/[locale]/(admin)/admin/layout.tsx | 2 +- .../(container)/settings/devices/page.tsx | 4 +- .../(container)/settings/files/page.tsx | 8 +- .../(main)/(container)/settings/layout.tsx | 4 +- apps/frontend/app/[locale]/(main)/page.tsx | 12 +-- .../app/[locale]/(main)/profile/[id]/page.tsx | 10 +-- .../app/[locale]/(main)/session-provider.tsx | 2 +- .../(utils)/admin/theme-editor/page.tsx | 6 +- apps/frontend/app/[locale]/catch.tsx | 11 ++- apps/frontend/app/[locale]/layout.tsx | 16 ++-- apps/frontend/app/[locale]/providers.tsx | 10 +-- apps/frontend/app/layout.tsx | 6 +- apps/frontend/app/robots.ts | 4 +- apps/frontend/app/sitemap.ts | 20 ++--- apps/frontend/components/calendar-picker.tsx | 2 +- .../frontend/components/color/color-input.tsx | 8 +- .../components/color/picker/picker.tsx | 64 ++++++++-------- .../components/data-table/data-table.tsx | 36 ++++----- .../frontend/components/data-table/header.tsx | 2 +- .../advanced-filter-toolbar-data-table.tsx | 2 +- .../toolbar/filter/content/content.tsx | 4 +- .../toolbar/filter/content/list.tsx | 4 +- .../data-table/toolbar/filter/filter.tsx | 4 +- .../hooks/use-filter-toolbar-data-table.ts | 2 +- .../components/data-table/toolbar/search.tsx | 4 +- .../components/data-table/toolbar/toolbar.tsx | 2 +- .../components/date-format/date-format.tsx | 4 +- .../date-format/hooks/use-date-format.ts | 14 ++-- apps/frontend/components/editor/editor.tsx | 26 +++---- .../extensions/code/code-block-component.tsx | 10 +-- .../editor/extensions/code/code.tsx | 6 +- .../editor/extensions/emoji/client.tsx | 16 ++-- .../editor/extensions/emoji/emoji.tsx | 10 +-- .../editor/extensions/extensions.ts | 32 ++++---- .../editor/extensions/files/client.tsx | 2 +- .../editor/extensions/files/files.ts | 56 +++++++------- .../extensions/files/hooks/functions.ts | 6 +- .../files/hooks/upload-mutation-api.ts | 10 +-- .../use-upload-files-handler-editor.ts.ts | 32 ++++---- .../components/editor/extensions/heading.tsx | 10 +-- .../editor/extensions/mentions/client.tsx | 10 +-- .../editor/extensions/mentions/emoji.tsx | 8 +- .../components/editor/footer/files/button.tsx | 4 +- .../editor/footer/files/item/content.tsx | 2 +- .../files/item/hooks/delete-mutation-api.ts | 6 +- .../editor/footer/files/item/icon.tsx | 2 +- .../editor/footer/files/item/item.tsx | 24 +++--- .../components/editor/footer/files/list.tsx | 4 +- .../components/editor/footer/footer.tsx | 4 +- .../editor/footer/language-select.tsx | 9 ++- .../editor/hooks/use-editor-state.ts | 4 +- .../editor/read-only/code-block.tsx | 14 ++-- .../editor/read-only/file-download-button.tsx | 4 +- .../components/editor/read-only/read-only.tsx | 10 +-- .../components/editor/toolbar/button.tsx | 2 +- .../editor/toolbar/custom/color/color.tsx | 8 +- .../editor/toolbar/custom/emoji/content.tsx | 4 +- .../editor/toolbar/custom/emoji/emoji.tsx | 6 +- .../editor/toolbar/custom/heading.tsx | 8 +- .../editor/toolbar/custom/link/content.tsx | 12 +-- .../editor/toolbar/custom/link/link.tsx | 6 +- .../components/editor/toolbar/custom/more.tsx | 2 +- .../components/editor/toolbar/custom/plus.tsx | 4 +- .../editor/toolbar/custom/text-align.tsx | 4 +- .../components/editor/toolbar/toggle.tsx | 2 +- .../components/editor/toolbar/toolbar.tsx | 4 +- .../groups/input/content/content.tsx | 6 +- .../components/groups/input/content/list.tsx | 4 +- .../groups/input/content/query-api.ts | 6 +- .../components/groups/input/group-input.tsx | 2 +- .../header-content/header-content.tsx | 4 +- apps/frontend/components/icon/icon-client.tsx | 6 +- apps/frontend/components/icon/icon.tsx | 2 +- .../components/icon/input/content/content.tsx | 16 ++-- .../icon/input/content/emojis/emojis.tsx | 8 +- .../icon/input/content/emojis/skin-select.tsx | 8 +- .../icon/input/content/icons/icons.tsx | 4 +- .../components/icon/input/icon-input.tsx | 10 +-- apps/frontend/components/img.tsx | 6 +- apps/frontend/components/loader.tsx | 2 +- .../permissions-table/permissions-table.tsx | 74 +++++++++---------- .../components/permissions-table/query-api.ts | 6 +- .../use-permissions-table-api.ts | 2 +- apps/frontend/components/steps/steps.tsx | 4 +- .../switchers/dark-light-mode-switcher.tsx | 2 +- .../switchers/language-switcher.tsx | 4 +- .../frontend/components/tabs/tabs-trigger.tsx | 10 +-- apps/frontend/components/tabs/tabs.tsx | 2 +- .../components/text-language-input.tsx | 14 ++-- apps/frontend/components/ui/accordion.tsx | 2 +- apps/frontend/components/ui/alert-dialog.tsx | 14 ++-- apps/frontend/components/ui/alert.tsx | 10 +-- apps/frontend/components/ui/badge.tsx | 10 +-- apps/frontend/components/ui/breadcrumbs.tsx | 4 +- apps/frontend/components/ui/button.tsx | 12 +-- apps/frontend/components/ui/calendar.tsx | 10 +-- apps/frontend/components/ui/card.tsx | 6 +- apps/frontend/components/ui/carousel.tsx | 18 ++--- apps/frontend/components/ui/checkbox.tsx | 2 +- apps/frontend/components/ui/command.tsx | 12 +-- apps/frontend/components/ui/dialog.tsx | 18 ++--- apps/frontend/components/ui/drawer.tsx | 6 +- apps/frontend/components/ui/dropdown-menu.tsx | 16 ++-- .../components/ui/files/files-input.tsx | 6 +- .../preview/item/item-preview-files-input.tsx | 4 +- apps/frontend/components/ui/form.tsx | 24 +++--- apps/frontend/components/ui/hover-card.tsx | 2 +- apps/frontend/components/ui/input.tsx | 2 +- apps/frontend/components/ui/label.tsx | 2 +- apps/frontend/components/ui/popover.tsx | 2 +- apps/frontend/components/ui/progress.tsx | 2 +- apps/frontend/components/ui/radio-group.tsx | 2 +- apps/frontend/components/ui/resizable.tsx | 4 +- apps/frontend/components/ui/select.tsx | 16 ++-- apps/frontend/components/ui/separator.tsx | 2 +- apps/frontend/components/ui/sheet.tsx | 18 ++--- apps/frontend/components/ui/sonner.tsx | 4 +- apps/frontend/components/ui/switch.tsx | 4 +- apps/frontend/components/ui/table.tsx | 10 +-- apps/frontend/components/ui/textarea.tsx | 2 +- apps/frontend/components/ui/toggle-group.tsx | 6 +- apps/frontend/components/ui/toggle.tsx | 16 ++-- apps/frontend/components/ui/tooltip.tsx | 2 +- .../components/user/avatar/avatar-user.tsx | 4 +- .../user/inputs/content/content.tsx | 8 +- .../components/user/inputs/content/list.tsx | 4 +- .../user/inputs/content/query-api.ts | 6 +- .../components/user/inputs/user-input.tsx | 8 +- apps/frontend/config/generate-config.ts | 16 ++-- apps/frontend/config/helpers.ts | 4 +- apps/frontend/config/index.ts | 26 +++---- apps/frontend/config/url.ts | 2 +- apps/frontend/global.d.ts | 2 +- .../graphql/cookie-from-string-to-object.ts | 10 +-- apps/frontend/graphql/fetcher.ts | 18 ++--- apps/frontend/graphql/get-session-data.ts | 6 +- apps/frontend/i18n.ts | 18 ++--- apps/frontend/middleware.ts | 14 ++-- .../finish/finish-install-config-view.tsx | 4 +- .../install/hooks/use-install-vitnode.ts | 2 +- .../install/layout-install-configs-view.tsx | 14 ++-- .../account/account-install-configs-view.tsx | 8 +- .../install/steps/database/mutation-api.ts | 4 +- .../submit-database-install-configs.tsx | 2 +- .../license/form-license-install-configs.tsx | 10 +-- .../plugins/admin/global/error-admin-view.tsx | 4 +- .../internal-error/internal-error-view.tsx | 8 +- .../plugins/admin/global/rebuild-required.tsx | 8 +- .../plugins/admin/hooks/api/query-api.ts | 6 +- .../api/use-short-show-groups-admin-api.ts | 4 +- .../plugins/admin/hooks/use-session-admin.ts | 2 +- .../admin/layout/header/header-admin.tsx | 2 +- .../header/user-bar/item-user-bar-admin.tsx | 6 +- .../layout/header/user-bar/mutation-api.ts | 4 +- .../layout/header/user-bar/user-bar-admin.tsx | 4 +- .../plugins/admin/layout/nav/item/item.tsx | 4 +- .../plugins/admin/layout/nav/item/link.tsx | 12 +-- .../plugins/admin/layout/nav/nav-admin.tsx | 50 ++++++------- .../core/advanced/files/actions/actions.tsx | 6 +- .../advanced/files/actions/delete/content.tsx | 8 +- .../advanced/files/actions/delete/delete.tsx | 10 +-- .../actions/delete/hooks/mutation-api.ts | 6 +- .../hooks/use-delete-file-advanced-admin.ts | 8 +- .../files/files-advanced-core-admin-view.tsx | 24 +++--- .../admin/views/core/langs/actions/create.tsx | 4 +- .../core/langs/create-edit/create-edit.tsx | 4 +- .../core/langs/create-edit/fields/locale.tsx | 12 +-- .../langs/create-edit/fields/timezone.tsx | 12 +-- .../create-edit/hooks/create-mutation-api.ts | 6 +- .../create-edit/hooks/edit-mutation-api.ts | 6 +- .../hooks/use-create-edit-lang-admin.ts | 16 ++-- .../views/core/langs/create-edit/timezones.ts | 2 +- .../admin/views/core/langs/enabled-row.tsx | 4 +- .../core/langs/langs-core-admin-view.tsx | 20 ++--- .../core/langs/table/actions/actions.tsx | 2 +- .../langs/table/actions/delete/content.tsx | 8 +- .../langs/table/actions/delete/delete.tsx | 4 +- .../actions/delete/hooks/mutation-api.ts | 6 +- .../delete/hooks/use-delete-lang-admin.ts | 12 +-- .../langs/table/actions/download/content.tsx | 22 +++--- .../langs/table/actions/download/download.tsx | 6 +- .../actions/download/hooks/mutation-api.ts | 6 +- .../table/actions/download/hooks/query-api.ts | 6 +- .../download/hooks/use-download-lang-admin.ts | 16 ++-- .../views/core/langs/table/actions/edit.tsx | 4 +- .../langs/table/actions/update/content.tsx | 4 +- .../actions/update/hooks/mutation-api.ts | 10 +-- .../update/hooks/use-update-lang-admin.ts | 12 +-- .../langs/table/actions/update/update.tsx | 4 +- .../core/plugins/actions/create/content.tsx | 2 +- .../core/plugins/actions/create/create.tsx | 4 +- .../core/plugins/actions/create/form.tsx | 2 +- .../create/hooks/mutation-create-api.ts | 6 +- .../actions/create/hooks/mutation-edit-api.ts | 6 +- .../hooks/use-create-edit-plugin-admin.ts | 20 ++--- .../views/core/plugins/actions/upload.tsx | 4 +- .../views/core/plugins/plugins-admin-view.tsx | 20 ++--- .../core/plugins/table/actions/actions.tsx | 2 +- .../plugins/table/actions/delete/content.tsx | 6 +- .../plugins/table/actions/delete/delete.tsx | 4 +- .../actions/delete/hooks/mutation-api.ts | 6 +- .../delete/hooks/use-delete-plugin-admin.ts | 6 +- .../hooks/use-set-default-admin.ts | 6 +- .../table/actions/set-default/set-default.tsx | 2 +- .../core/plugins/table/actions/upload.tsx | 8 +- .../core/plugins/upload/hooks/mutation-api.ts | 10 +-- .../upload/hooks/use-upload-plugin-admin.ts | 12 +-- .../views/core/plugins/upload/upload.tsx | 2 +- .../dev/layout/actions/download/content.tsx | 10 +-- .../dev/layout/actions/download/download.tsx | 4 +- .../actions/download/hooks/mutation-api.ts | 6 +- .../hooks/use-download-plugin-admin.ts | 16 ++-- .../core/plugins/views/dev/layout/layout.tsx | 4 +- .../views/dev/nav/actions/create/create.tsx | 6 +- .../views/dev/nav/create-edit/create-edit.tsx | 12 +-- .../create-edit/hooks/create-mutation-api.ts | 8 +- .../create-edit/hooks/edit-mutation-api.ts | 6 +- .../hooks/use-create-nav-plugin-admin.ts | 16 ++-- .../views/core/plugins/views/dev/nav/item.tsx | 6 +- .../views/dev/nav/item/actions/actions.tsx | 2 +- .../dev/nav/item/actions/delete/content.tsx | 6 +- .../dev/nav/item/actions/delete/delete.tsx | 10 +-- .../item/actions/delete/hooks/mutation-api.ts | 6 +- .../hooks/use-delete-nav-plugin-admin.ts | 8 +- .../views/dev/nav/item/actions/edit.tsx | 8 +- .../hooks/mutation-change-position-api.ts | 8 +- .../hooks/use-item-nav-dev-plugin-admin.ts | 2 +- .../views/core/plugins/views/dev/nav/nav.tsx | 26 +++---- .../email/actions/testing/content.tsx | 4 +- .../actions/testing/hooks/mutation-api.ts | 6 +- .../testing/hooks/use-testing-email-admin.tsx | 10 +-- .../email/actions/testing/testing.tsx | 4 +- .../email/email-settings-admin-view.tsx | 4 +- .../core/settings/email/hooks/mutation-api.ts | 6 +- .../hooks/use-email-settings-form-admin.ts | 12 +-- .../settings/general/hooks/mutation-api.ts | 6 +- .../general/hooks/use-settings-core-admin.ts | 14 ++-- .../general/main-settings-core-admin.tsx | 4 +- .../metadata/manifest/hooks/mutation-api.ts | 6 +- .../hooks/use-manifest-core-admin-view.ts | 14 ++-- .../manifest/manifest-metadata-core-view.tsx | 6 +- .../core/styles/editor/editor-admin-view.tsx | 2 +- .../core/styles/editor/hooks/mutation-api.ts | 2 +- .../styles/editor/hooks/use-editor-admin.ts | 12 +-- .../views/core/styles/nav/actions/create.tsx | 4 +- .../styles/nav/create-edit/create-edit.tsx | 6 +- .../create-edit/hooks/create-mutation-api.ts | 6 +- .../create-edit/hooks/edit-mutation-api.ts | 6 +- .../hooks/use-create-edit-nav-admin.ts | 20 ++--- .../views/core/styles/nav/nav-admin-view.tsx | 8 +- .../nav/table/actions/delete/content.tsx | 6 +- .../nav/table/actions/delete/delete.tsx | 10 +-- .../actions/delete/hooks/mutation-api.ts | 6 +- .../delete/hooks/use-delete-nav-admin.ts | 6 +- .../core/styles/nav/table/actions/edit.tsx | 8 +- .../hooks/mutation-change-position-api.ts | 6 +- .../views/core/styles/nav/table/table.tsx | 16 ++-- .../actions/actions-groups-members-admin.tsx | 6 +- .../create-edit-form/content/content.tsx | 16 ++-- .../groups/create-edit-form/content/main.tsx | 2 +- .../create-edit-form-groups-members-admin.tsx | 10 +-- .../hooks/mutation-create-api.ts | 6 +- .../hooks/mutation-edit-api.ts | 6 +- ...e-create-edit-form-groups-members-admin.ts | 18 ++--- .../groups/table/actions/delete/content.tsx | 8 +- .../groups/table/actions/delete/delete.tsx | 10 +-- .../actions/delete/hooks/mutation-api.ts | 6 +- .../delete/hooks/use-delete-group-admin.ts | 10 +-- .../members/groups/table/actions/edit.tsx | 6 +- .../views/members/groups/table/table.tsx | 16 ++-- .../staff/administrators/actions/create.tsx | 4 +- .../administrators/administrators-view.tsx | 2 +- .../create-edit-form/create-edit-form.tsx | 4 +- .../create-edit-form/hooks/mutation-api.ts | 6 +- .../create-edit-form/hooks/use-form.ts | 20 ++--- .../table/actions/delete/content.tsx | 6 +- .../table/actions/delete/delete.tsx | 6 +- .../table/actions/delete/mutation-api.ts | 6 +- .../staff/administrators/table/table.tsx | 20 ++--- .../staff/moderators/actions/create.tsx | 4 +- .../create-edit-form/create-edit-form.tsx | 4 +- .../create-edit-form/hooks/mutation-api.ts | 6 +- .../create-edit-form/hooks/use-form.ts | 20 ++--- .../staff/moderators/moderators-view.tsx | 2 +- .../table/actions/delete/content.tsx | 6 +- .../table/actions/delete/delete.tsx | 6 +- .../table/actions/delete/mutation-api.ts | 6 +- .../members/staff/moderators/table/table.tsx | 20 ++--- .../advanced-filters-users-members-admin.tsx | 12 +-- ...ent-groups-filters-users-members-admin.tsx | 2 +- .../groups-filters-users-members-admin.tsx | 4 +- .../admin/views/members/users/table/table.tsx | 22 +++--- .../views/sign-in/form/form-sign-in-admin.tsx | 2 +- .../sign-in/hooks/use-sign-in-admin-view.ts | 8 +- .../views/theme_editor/content/content.tsx | 8 +- .../views/theme_editor/content/submit.tsx | 4 +- .../theme_editor/content/tabs/color-tab.tsx | 62 ++++++++-------- .../views/theme_editor/hooks/mutation-api.ts | 6 +- .../hooks/use-theme-editor-api.ts | 40 +++++----- .../theme_editor/hooks/use-theme-editor.ts | 6 +- .../views/theme_editor/theme-editor-view.tsx | 14 ++-- .../admin/views/theme_editor/toolbar.tsx | 6 +- .../admin/views/categories/actions/create.tsx | 4 +- .../views/categories/categories-view.tsx | 20 ++--- .../categories/create-edit/create-edit.tsx | 6 +- .../create-edit/hooks/create-mutation-api.ts | 6 +- .../use-create-edit-category-blog-admin.ts | 18 ++--- .../categories/create-edit/tabs/main.tsx | 2 +- .../create-edit/tabs/permissions.tsx | 10 +-- .../plugins/core/hooks/drag&drop/item.tsx | 18 ++--- .../core/hooks/drag&drop/use-functions.ts | 38 +++++----- .../core/hooks/drag&drop/use-projection.ts | 16 ++-- .../avatar/api/mutation-delete-api.ts | 4 +- .../avatar/api/mutation-upload-api.ts | 8 +- .../avatar/use-copper-modal-change-avatar.ts | 10 +-- .../avatar/use-modal-change-avatar.ts | 10 +-- .../core/hooks/settings/use-settings-view.ts | 12 +-- .../core/hooks/sign/in/mutation-api.ts | 6 +- .../core/hooks/sign/in/use-sign-in-view.ts | 8 +- .../core/hooks/sign/out/mutation-api.ts | 4 +- .../core/hooks/sign/out/use-sign-out-api.ts | 4 +- .../core/hooks/sign/up/mutation-api.ts | 6 +- .../core/hooks/sign/up/use-sign-up-view.ts | 38 +++++----- .../plugins/core/hooks/use-globals.ts | 2 +- .../plugins/core/hooks/use-session.ts | 6 +- .../plugins/core/hooks/use-text-lang.ts | 10 +-- .../hooks/utils/use-get-sort-by-params-api.ts | 6 +- .../core/hooks/utils/use-merge-refs.ts | 2 +- .../hooks/utils/use-pagination-api-ssr.ts | 16 ++-- .../header/user-bar/auth/auth-user-bar.tsx | 4 +- .../layout/header/user-bar/user-bar.tsx | 4 +- .../core/templates/layout/nav/item.tsx | 20 ++--- .../plugins/core/templates/layout/nav/nav.tsx | 8 +- .../layout/quick-menu/drawer/drawer.tsx | 12 +-- .../layout/quick-menu/drawer/header.tsx | 4 +- .../layout/quick-menu/drawer/nav/item.tsx | 10 +-- .../layout/quick-menu/drawer/nav/nav.tsx | 14 ++-- .../core/templates/layout/quick-menu/item.tsx | 6 +- .../layout/quick-menu/quick-menu.tsx | 8 +- .../views/auth/sign/in/form/form-sign-in.tsx | 2 +- .../views/auth/sign/in/sign-in-view.tsx | 4 +- .../views/auth/sign/up/form/form-sign-up.tsx | 8 +- .../views/auth/sign/up/form/success.tsx | 4 +- .../views/auth/sign/up/sign-up-view.tsx | 4 +- .../views/global/error/error-view.tsx | 4 +- .../templates/views/settings/nav/drawer.tsx | 2 +- .../nav/item/link/link-item-nav-settings.tsx | 4 +- .../views/settings/views/devices/content.tsx | 4 +- .../views/settings/views/files/content.tsx | 24 +++--- .../views/files/files-settings-view.tsx | 4 +- .../header/change-avatar/change-avatar.tsx | 6 +- .../modal/modal-change-avatar.tsx | 6 +- apps/frontend/tailwind.config.ts | 44 +++++------ packages/backend/package.json | 2 +- .../backend/scripts/{init.mjs => setup.mjs} | 17 +++-- packages/backend/src/app.module.ts | 46 ++++++------ .../backend/src/core/admin/admin.module.ts | 6 +- .../src/core/admin/email/email.module.ts | 4 +- .../src/core/admin/email/helpers.service.ts | 2 +- .../src/core/admin/email/mail.service.ts | 14 ++-- .../src/core/admin/email/send/send.service.ts | 7 +- .../email/settings/edit/edit.resolver.ts | 2 +- .../admin/email/settings/edit/edit.service.ts | 20 ++--- .../admin/email/settings/show/show.service.ts | 4 +- .../email/settings/test/test.resolver.ts | 2 +- .../admin/email/settings/test/test.service.ts | 4 +- .../admin/files/delete/delete.resolver.ts | 2 +- .../core/admin/files/delete/delete.service.ts | 6 +- .../files/download/download.controller.ts | 18 ++--- .../src/core/admin/files/files.module.ts | 4 +- .../core/admin/files/show/show.resolver.ts | 2 +- .../src/core/admin/files/show/show.service.ts | 30 ++++---- .../admin/groups/create/create.resolver.ts | 2 +- .../admin/groups/create/create.service.ts | 12 +-- .../admin/groups/create/dto/create.args.ts | 2 +- .../admin/groups/delete/delete.resolver.ts | 2 +- .../admin/groups/delete/delete.service.ts | 6 +- .../core/admin/groups/edit/edit.resolver.ts | 2 +- .../core/admin/groups/edit/edit.service.ts | 18 ++--- .../src/core/admin/groups/groups.module.ts | 4 +- .../core/admin/groups/show/dto/show.args.ts | 6 +- .../core/admin/groups/show/show.resolver.ts | 2 +- .../core/admin/groups/show/show.service.ts | 28 +++---- .../create_database.service.ts | 68 ++++++++--------- .../src/core/admin/install/install.module.ts | 4 +- .../admin/install/layout/dto/layout.obj.ts | 4 +- .../admin/install/layout/layout.service.ts | 10 +-- .../admin/languages/create/create.resolver.ts | 2 +- .../admin/languages/create/create.service.ts | 26 +++---- .../admin/languages/delete/delete.resolver.ts | 2 +- .../admin/languages/delete/delete.service.ts | 16 ++-- .../languages/download/download.resolver.ts | 2 +- .../languages/download/download.service.ts | 22 +++--- .../admin/languages/edit/dto/edit.args.ts | 2 +- .../admin/languages/edit/edit.resolver.ts | 2 +- .../core/admin/languages/edit/edit.service.ts | 2 +- .../core/admin/languages/languages.module.ts | 4 +- .../admin/languages/update/update.resolver.ts | 2 +- .../admin/languages/update/update.service.ts | 8 +- .../core/admin/members/edit/edit.resolver.ts | 2 +- .../core/admin/members/edit/edit.service.ts | 8 +- .../src/core/admin/members/members.module.ts | 4 +- .../core/admin/members/show/dto/show.args.ts | 8 +- .../core/admin/members/show/show.resolver.ts | 2 +- .../core/admin/members/show/show.service.ts | 22 +++--- .../core/admin/members/stats/stats.service.ts | 2 +- .../metadata/manifest/edit/edit.resolver.ts | 2 +- .../metadata/manifest/edit/edit.service.ts | 18 ++--- .../core/admin/metadata/manifest/functions.ts | 4 +- .../core/admin/metadata/metadata.module.ts | 4 +- .../change_position.resolver.ts | 2 +- .../change_position.service.ts | 14 ++-- .../core/admin/nav/create/create.resolver.ts | 2 +- .../core/admin/nav/create/create.service.ts | 16 ++-- .../core/admin/nav/create/dto/create.args.ts | 4 +- .../core/admin/nav/delete/delete.resolver.ts | 2 +- .../core/admin/nav/delete/delete.service.ts | 10 +-- .../src/core/admin/nav/edit/edit.resolver.ts | 2 +- .../src/core/admin/nav/edit/edit.service.ts | 20 ++--- .../backend/src/core/admin/nav/nav.module.ts | 4 +- .../admin/plugins/create/create.resolver.ts | 2 +- .../admin/plugins/create/create.service.ts | 24 +++--- .../admin/plugins/create/dto/create.args.ts | 2 +- .../src/core/admin/plugins/delete/contents.ts | 10 +-- .../admin/plugins/delete/delete.resolver.ts | 2 +- .../admin/plugins/delete/delete.service.ts | 10 +-- .../plugins/download/download.resolver.ts | 2 +- .../plugins/download/download.service.ts | 46 ++++++------ .../core/admin/plugins/edit/dto/edit.args.ts | 2 +- .../core/admin/plugins/edit/edit.resolver.ts | 2 +- .../core/admin/plugins/edit/edit.service.ts | 12 +-- .../admin/plugins/files/files.resolver.ts | 2 +- .../core/admin/plugins/files/files.service.ts | 20 ++--- .../helpers/files/change/change.service.ts | 38 +++++----- .../plugins/helpers/files/change/contents.ts | 16 ++-- .../plugins/helpers/files/create/contents.ts | 8 +- .../files/create/create-files.service.ts | 36 ++++----- .../change_position.resolver.ts | 2 +- .../change_position.service.ts | 14 ++-- .../plugins/nav/create/create.resolver.ts | 2 +- .../plugins/nav/create/create.service.ts | 16 ++-- .../plugins/nav/delete/delete.resolver.ts | 2 +- .../plugins/nav/delete/delete.service.ts | 6 +- .../admin/plugins/nav/edit/edit.resolver.ts | 2 +- .../admin/plugins/nav/edit/edit.service.ts | 14 ++-- .../core/admin/plugins/nav/helpers.service.ts | 4 +- .../admin/plugins/nav/nav-plugins.module.ts | 4 +- .../admin/plugins/nav/show/show.resolver.ts | 2 +- .../admin/plugins/nav/show/show.service.ts | 4 +- .../src/core/admin/plugins/plugins.module.ts | 4 +- .../core/admin/plugins/show/dto/show.args.ts | 4 +- .../core/admin/plugins/show/show.resolver.ts | 2 +- .../core/admin/plugins/show/show.service.ts | 12 +-- .../admin/plugins/upload/upload.resolver.ts | 2 +- .../admin/plugins/upload/upload.service.ts | 66 ++++++++--------- .../authorization/authorization.resolver.ts | 2 +- .../authorization/authorization.service.ts | 36 ++++----- .../core/admin/sessions/sessions.module.ts | 10 +-- .../sessions/sign_out/sign_out.service.ts | 8 +- .../admin/settings/functions/get-core-info.ts | 2 +- .../admin/settings/main/edit/dto/edit.obj.ts | 2 +- .../admin/settings/main/edit/edit.resolver.ts | 2 +- .../admin/settings/main/edit/edit.service.ts | 34 ++++----- .../admin/settings/main/general.module.ts | 2 +- .../core/admin/settings/settings.module.ts | 2 +- .../administrators/create/create.resolver.ts | 4 +- .../administrators/create/create.service.ts | 34 ++++----- .../administrators/delete/delete.resolver.ts | 4 +- .../administrators/delete/delete.service.ts | 4 +- .../administrators/show/dto/show.args.ts | 4 +- .../staff/administrators/show/dto/show.obj.ts | 4 +- .../administrators/show/show.resolver.ts | 2 +- .../staff/administrators/show/show.service.ts | 36 ++++----- .../moderators/create/create.resolver.ts | 2 +- .../staff/moderators/create/create.service.ts | 38 +++++----- .../moderators/delete/delete.resolver.ts | 2 +- .../staff/moderators/delete/delete.service.ts | 6 +- .../staff/moderators/show/dto/show.args.ts | 4 +- .../staff/moderators/show/dto/show.obj.ts | 2 +- .../staff/moderators/show/show.resolver.ts | 2 +- .../staff/moderators/show/show.service.ts | 36 ++++----- .../src/core/admin/staff/staff.module.ts | 4 +- .../admin/theme_editor/edit/edit.resolver.ts | 2 +- .../admin/theme_editor/edit/edit.service.ts | 8 +- .../admin/theme_editor/theme_editor.module.ts | 2 +- packages/backend/src/core/core.module.ts | 6 +- .../src/core/editor/delete/delete.resolver.ts | 2 +- .../src/core/editor/delete/delete.service.ts | 12 +-- .../backend/src/core/editor/editor.module.ts | 4 +- .../src/core/editor/upload/upload.resolver.ts | 2 +- .../src/core/editor/upload/upload.service.ts | 36 ++++----- .../files/download/download.controller.ts | 10 +-- packages/backend/src/core/files/files.cron.ts | 10 +-- .../backend/src/core/files/files.module.ts | 4 +- .../files/helpers/delete/delete.service.ts | 6 +- .../src/core/files/helpers/upload/helpers.ts | 12 +-- .../files/helpers/upload/upload.service.ts | 24 +++--- .../src/core/files/show/dto/show.args.ts | 4 +- .../src/core/files/show/show.resolver.ts | 2 +- .../src/core/files/show/show.service.ts | 22 +++--- .../src/core/helpers/helpers.module.ts | 2 +- .../text_language/parser/helpers.service.ts | 14 ++-- .../text_language/parser/parser.service.ts | 40 +++++----- .../src/core/languages/languages.module.ts | 2 +- .../src/core/languages/show/dto/show.args.ts | 4 +- .../src/core/languages/show/show.resolver.ts | 2 +- .../src/core/languages/show/show.service.ts | 12 +-- .../avatar/avatar-core_members.module.ts | 4 +- .../members/avatar/delete/delete.resolver.ts | 2 +- .../members/avatar/delete/delete.service.ts | 4 +- .../members/avatar/upload/upload.resolver.ts | 2 +- .../members/avatar/upload/upload.service.ts | 16 ++-- .../core/members/delete/delete.resolver.ts | 2 +- .../src/core/members/delete/delete.service.ts | 4 +- .../src/core/members/members.module.ts | 4 +- .../src/core/members/show/dto/show.args.ts | 6 +- .../src/core/members/show/show.resolver.ts | 2 +- .../src/core/members/show/show.service.ts | 20 ++--- .../core/members/sign_up/dto/sign_up.args.ts | 4 +- .../core/members/sign_up/sign_up.resolver.ts | 2 +- .../core/members/sign_up/sign_up.service.ts | 22 +++--- .../src/core/middleware/middleware.cron.ts | 4 +- .../src/core/middleware/middleware.module.ts | 4 +- .../src/core/middleware/show/show.service.ts | 4 +- packages/backend/src/core/nav/nav.module.ts | 2 +- .../backend/src/core/nav/show/show.service.ts | 22 +++--- .../src/core/plugins/plugins.module.ts | 2 +- .../src/core/plugins/show/show.service.ts | 2 +- .../authorization/authorization.resolver.ts | 2 +- .../authorization/authorization.service.ts | 44 +++++------ .../internal_authorization.service.ts | 30 ++++---- .../core/sessions/devices/devices.module.ts | 2 +- .../sessions/devices/show/show.resolver.ts | 2 +- .../sessions/devices/show/show.service.ts | 6 +- .../src/core/sessions/sessions.cron.ts | 12 +-- .../src/core/sessions/sessions.module.ts | 10 +-- .../core/sessions/sign_in/device.service.ts | 14 ++-- .../core/sessions/sign_in/sign_in.resolver.ts | 2 +- .../core/sessions/sign_in/sign_in.service.ts | 50 ++++++------- .../sessions/sign_out/sign_out.service.ts | 6 +- .../src/core/settings/settings.module.ts | 2 +- .../src/core/settings/show/show.service.ts | 14 ++-- .../core/theme_editor/show/show.service.ts | 18 ++--- .../core/theme_editor/theme_editor.module.ts | 4 +- packages/backend/src/database/client.ts | 4 +- .../backend/src/database/database.module.ts | 8 +- .../backend/src/database/database.service.ts | 4 +- .../backend/src/decorators/user.decorator.ts | 2 +- .../backend/src/errors/access-denied-error.ts | 2 +- packages/backend/src/errors/custom-error.ts | 2 +- .../backend/src/errors/not-found-error.ts | 2 +- .../src/functions/get-user-agent-data.ts | 2 +- .../backend/src/functions/input-sorting.ts | 12 +-- packages/backend/src/functions/pagination.ts | 18 ++--- .../backend/src/functions/rebuild-required.ts | 8 +- .../src/graphql-upload/fs-capacitor.ts | 16 ++-- .../graphql-upload/graphql-upload-express.ts | 4 +- .../src/graphql-upload/graphql-upload.ts | 2 +- .../src/graphql-upload/process-request.ts | 72 +++++++++--------- packages/backend/src/graphql-upload/upload.ts | 2 +- packages/backend/src/main.ts | 14 ++-- packages/backend/src/providers/config.ts | 2 +- .../providers/email/email-helpers.service.ts | 15 ++-- .../src/providers/email/email-helpers.type.ts | 18 ++--- packages/backend/src/providers/email/email.ts | 2 +- .../email/template/email-template.tsx | 14 ++-- .../backend/src/providers/providers.module.ts | 10 +-- .../templates/core/admin/database/index.ts | 2 +- .../core/admin/database/schema/admins.ts | 42 +++++------ .../core/admin/database/schema/files.ts | 30 ++++---- .../core/admin/database/schema/groups.ts | 24 +++--- .../core/admin/database/schema/languages.ts | 10 +-- .../core/admin/database/schema/moderators.ts | 24 +++--- .../core/admin/database/schema/nav.ts | 50 ++++++------- .../core/admin/database/schema/plugins.ts | 8 +- .../core/admin/database/schema/sessions.ts | 34 ++++----- .../core/admin/database/schema/users.ts | 24 +++--- .../src/utils/guards/admin-auth.guard.ts | 6 +- .../utils/guards/admin-permission.guard.ts | 6 +- .../backend/src/utils/guards/auth.guard.ts | 6 +- packages/backend/src/utils/pagination.ts | 2 +- packages/backend/src/utils/text-language.ts | 34 ++++----- packages/frontend/src/helpers/flatten-tree.ts | 8 +- packages/frontend/src/helpers/zod.ts | 6 +- packages/shared/src/colors.ts | 6 +- 650 files changed, 3207 insertions(+), 3187 deletions(-) rename packages/backend/scripts/{init.mjs => setup.mjs} (69%) diff --git a/.prettierrc b/.prettierrc index 5c6880c3b..1d3b41bd9 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,7 +1,7 @@ { "singleQuote": false, "arrowParens": "avoid", - "trailingComma": "none", + "trailingComma": "all", "printWidth": 80, "plugins": ["prettier-plugin-tailwindcss"], "tailwindFunctions": ["cn"] diff --git a/README.md b/README.md index 654e314be..d6b45c25f 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ -

+


- VitNode Logo + VitNode Logo

-

+

# VitNode diff --git a/apps/backend/codegen.ts b/apps/backend/codegen.ts index d558cc943..fc1afcd43 100644 --- a/apps/backend/codegen.ts +++ b/apps/backend/codegen.ts @@ -5,7 +5,7 @@ import * as dotenv from "dotenv"; if (process.env.NODE_ENV === "production") { dotenv.config({ - path: join(process.cwd(), "..", "..", ".env") + path: join(process.cwd(), "..", "..", ".env"), }); } @@ -16,27 +16,27 @@ const config: CodegenConfig = { overwrite: true, schema: `${graphql_url}/graphql`, documents: [ - join(process.cwd(), "..", "frontend", "plugins/**/graphql/**/*.gql") + join(process.cwd(), "..", "frontend", "plugins/**/graphql/**/*.gql"), ], generates: { [`${join(process.cwd(), "..", "frontend", "graphql", "hooks.ts")}`]: { plugins: [ "typescript", "typescript-operations", - "typescript-document-nodes" + "typescript-document-nodes", ], config: { scalars: { - DateTime: "Date" + DateTime: "Date", }, enumsAsConst: true, allowEnumStringTypes: true, namingConvention: { - enumValues: "change-case-all#lowerCase" - } - } - } - } + enumValues: "change-case-all#lowerCase", + }, + }, + }, + }, }; export default config; diff --git a/apps/backend/drizzle.config.ts b/apps/backend/drizzle.config.ts index ef5ed11de..064937b3e 100644 --- a/apps/backend/drizzle.config.ts +++ b/apps/backend/drizzle.config.ts @@ -6,7 +6,7 @@ export default defineConfig({ dialect: "postgresql", dbCredentials: { ...DATABASE_ENVS, - ssl: false + ssl: false, }, - schema: "./src/plugins/**/admin/database/schema/*.ts" + schema: "./src/plugins/**/admin/database/schema/*.ts", }); diff --git a/apps/backend/src/app.module.ts b/apps/backend/src/app.module.ts index 4b6521118..e9ca83431 100644 --- a/apps/backend/src/app.module.ts +++ b/apps/backend/src/app.module.ts @@ -11,14 +11,14 @@ import { schemaDatabase } from "./database/schema"; imports: [ VitNodeCoreModule.register({ paths: { - envFile: join(process.cwd(), "..", "..", ".env") + envFile: join(process.cwd(), "..", "..", ".env"), }, database: { config: DATABASE_ENVS, - schemaDatabase - } + schemaDatabase, + }, }), - PluginsModule - ] + PluginsModule, + ], }) export class AppModule {} diff --git a/apps/backend/src/database/client.ts b/apps/backend/src/database/client.ts index 0388abcf5..4a2710ce8 100644 --- a/apps/backend/src/database/client.ts +++ b/apps/backend/src/database/client.ts @@ -7,7 +7,7 @@ import * as dotenv from "dotenv"; import { schemaDatabase } from "./schema"; dotenv.config({ - path: join(process.cwd(), "..", "..", ".env") + path: join(process.cwd(), "..", "..", ".env"), }); export const DATABASE_ENVS = { @@ -15,7 +15,7 @@ export const DATABASE_ENVS = { port: process.env.DB_PORT ? +process.env.DB_PORT : 5432, user: process.env.DB_USER ?? "root", password: process.env.DB_PASSWORD ?? "root", - database: process.env.DB_DATABASE ?? "vitnode" + database: process.env.DB_DATABASE ?? "vitnode", }; export const poolDB = new Pool(DATABASE_ENVS); diff --git a/apps/backend/src/database/schema.ts b/apps/backend/src/database/schema.ts index 9e36c20f6..3d268244e 100644 --- a/apps/backend/src/database/schema.ts +++ b/apps/backend/src/database/schema.ts @@ -1,4 +1,4 @@ -// ! DO NOT REMOVE OR MODIFY THIS FILE!!! +// ! DO NOT REMOVE, MODIFY OR MOVE THIS FILE!!! import tableCore from "../plugins/core/admin/database/index"; import tableBlog from "../plugins/blog/admin/database/index"; @@ -7,5 +7,5 @@ import tableBlog from "../plugins/blog/admin/database/index"; export const schemaDatabase = { ...tableBlog, // ! === MODULE === - ...tableCore + ...tableCore, }; diff --git a/apps/backend/src/functions/envs.ts b/apps/backend/src/functions/envs.ts index 7d23fef64..09d5b793e 100644 --- a/apps/backend/src/functions/envs.ts +++ b/apps/backend/src/functions/envs.ts @@ -7,6 +7,6 @@ export const parseFrontendUrlFromEnv = () => { url: frontendUrl, protocol: urlObj.protocol, hostname: urlObj.hostname, - port: urlObj.port + port: urlObj.port, }; }; diff --git a/apps/backend/src/functions/update-object.ts b/apps/backend/src/functions/update-object.ts index 5ef6e95a0..ebeaa7408 100644 --- a/apps/backend/src/functions/update-object.ts +++ b/apps/backend/src/functions/update-object.ts @@ -1,6 +1,6 @@ export function updateObject>( config: T, - defaultData: T + defaultData: T, ): T { const updatedConfig = config; for (const key in defaultData) { @@ -19,7 +19,7 @@ export function updateObject>( } updatedConfig[key] = updateObject( (config[key] || {}) as T[Extract], - defaultData[key] + defaultData[key], ); } else { // Handle primitive values @@ -34,7 +34,7 @@ export function updateObject>( // eslint-disable-next-line @typescript-eslint/no-explicit-any export function objectToArray>( - obj: T + obj: T, ): Record { if (typeof obj !== "object" || obj === null) { return obj; @@ -52,6 +52,6 @@ export function objectToArray>( return acc; }, - {} + {}, ); } diff --git a/apps/backend/src/main.ts b/apps/backend/src/main.ts index 730fea368..f64d3a071 100644 --- a/apps/backend/src/main.ts +++ b/apps/backend/src/main.ts @@ -13,14 +13,14 @@ async function bootstrap() { origin: [ process.env.NEXT_PUBLIC_FRONTEND_URL ? process.env.NEXT_PUBLIC_FRONTEND_URL - : "http://localhost:3000" - ] - } + : "http://localhost:3000", + ], + }, }); await app.listen(process.env.PORT ?? "8080", null, () => { console.log( - `Application is running on: http://localhost:${process.env.PORT ?? 8080}/graphql` + `Application is running on: http://localhost:${process.env.PORT ?? 8080}/graphql`, ); }); } diff --git a/apps/backend/src/plugins/blog/admin/admin.module.ts b/apps/backend/src/plugins/blog/admin/admin.module.ts index 12594b2e9..eba9a4ea5 100644 --- a/apps/backend/src/plugins/blog/admin/admin.module.ts +++ b/apps/backend/src/plugins/blog/admin/admin.module.ts @@ -4,6 +4,6 @@ import { CreateBlogCategoriesService } from "./categories/create/create.service" import { CreateBlogCategoriesResolver } from "./categories/create/create.resolver"; @Module({ - providers: [CreateBlogCategoriesService, CreateBlogCategoriesResolver] + providers: [CreateBlogCategoriesService, CreateBlogCategoriesResolver], }) export class AdminBlogModule {} diff --git a/apps/backend/src/plugins/blog/admin/categories/create/create.resolver.ts b/apps/backend/src/plugins/blog/admin/categories/create/create.resolver.ts index d5c03326f..f2cf065cb 100644 --- a/apps/backend/src/plugins/blog/admin/categories/create/create.resolver.ts +++ b/apps/backend/src/plugins/blog/admin/categories/create/create.resolver.ts @@ -14,7 +14,7 @@ export class CreateBlogCategoriesResolver { @Mutation(() => ShowBlogCategories) @UseGuards(AdminAuthGuards) async admin__blog_categories__create( - @Args() args: CreatePluginCategoriesArgs + @Args() args: CreatePluginCategoriesArgs, ): Promise { return this.service.create(args); } diff --git a/apps/backend/src/plugins/blog/admin/categories/create/create.service.ts b/apps/backend/src/plugins/blog/admin/categories/create/create.service.ts index ff6480476..073f9a93c 100644 --- a/apps/backend/src/plugins/blog/admin/categories/create/create.service.ts +++ b/apps/backend/src/plugins/blog/admin/categories/create/create.service.ts @@ -1,5 +1,8 @@ import { Injectable } from "@nestjs/common"; -import { DatabaseService } from "vitnode-backend"; +import { + DatabaseService, + ParserTextLanguageCoreHelpersService, +} from "vitnode-backend"; import { CreatePluginCategoriesArgs } from "./dto/create.args"; @@ -8,22 +11,21 @@ import { blog_categories, blog_categories_description, blog_categories_name, - blog_categories_permissions + blog_categories_permissions, } from "../../database/schema/categories"; -import { ParserTextLanguageCoreHelpersService } from "vitnode-backend"; @Injectable() export class CreateBlogCategoriesService { constructor( private readonly databaseService: DatabaseService, - private readonly parserTextLang: ParserTextLanguageCoreHelpersService + private readonly parserTextLang: ParserTextLanguageCoreHelpersService, ) {} async create({ color, description, name, - permissions + permissions, }: CreatePluginCategoriesArgs): Promise { const categories = await this.databaseService.db .insert(blog_categories) @@ -35,21 +37,21 @@ export class CreateBlogCategoriesService { await this.parserTextLang.parse({ item_id: categoryId, database: blog_categories_name, - data: name + data: name, }); await this.parserTextLang.parse({ item_id: categoryId, database: blog_categories_description, - data: description + data: description, }); const data = await this.databaseService.db.query.blog_categories.findFirst({ where: (table, { eq }) => eq(table.id, categoryId), with: { name: true, - description: true - } + description: true, + }, }); // Set permissions @@ -58,8 +60,8 @@ export class CreateBlogCategoriesService { permissions.groups.map(item => ({ blog_id: data[0].id, group_id: item.group_id, - ...item - })) + ...item, + })), ); } diff --git a/apps/backend/src/plugins/blog/admin/categories/create/dto/create.args.ts b/apps/backend/src/plugins/blog/admin/categories/create/dto/create.args.ts index d4e2649e9..2c0161372 100644 --- a/apps/backend/src/plugins/blog/admin/categories/create/dto/create.args.ts +++ b/apps/backend/src/plugins/blog/admin/categories/create/dto/create.args.ts @@ -4,7 +4,7 @@ import { ArrayMinSize, ValidateNested, IsArray } from "class-validator"; import { IsTextLanguageInput, TextLanguageInput, - TransformTextLanguageInput + TransformTextLanguageInput, } from "vitnode-backend"; @InputType() diff --git a/apps/backend/src/plugins/blog/admin/database/drizzle.config.ts b/apps/backend/src/plugins/blog/admin/database/drizzle.config.ts index e20186256..4e20ee6b9 100644 --- a/apps/backend/src/plugins/blog/admin/database/drizzle.config.ts +++ b/apps/backend/src/plugins/blog/admin/database/drizzle.config.ts @@ -1,4 +1,4 @@ -// ! DO NOT REMOVE OR MODIFY THIS FILE!!! +// ! DO NOT REMOVE, MODIFY OR MOVE THIS FILE!!! import { defineConfig } from "drizzle-kit"; @@ -8,5 +8,5 @@ export default defineConfig({ dialect: "postgresql", dbCredentials: DATABASE_ENVS, schema: "./src/plugins/blog/admin/database/schema/*.ts", - out: "./src/plugins/blog/admin/database/migrations/" + out: "./src/plugins/blog/admin/database/migrations/", }); diff --git a/apps/backend/src/plugins/blog/admin/database/functions.ts b/apps/backend/src/plugins/blog/admin/database/functions.ts index 8461c2ba8..70ad54e3a 100644 --- a/apps/backend/src/plugins/blog/admin/database/functions.ts +++ b/apps/backend/src/plugins/blog/admin/database/functions.ts @@ -1,4 +1,4 @@ -// ! DO NOT REMOVE OR MODIFY THIS FILE!!! +// ! DO NOT REMOVE, MODIFY OR MOVE THIS FILE!!! import { default as tables } from "./index"; export const getTables = () => { diff --git a/apps/backend/src/plugins/blog/admin/database/index.ts b/apps/backend/src/plugins/blog/admin/database/index.ts index 3e8befd98..2392095c4 100644 --- a/apps/backend/src/plugins/blog/admin/database/index.ts +++ b/apps/backend/src/plugins/blog/admin/database/index.ts @@ -3,5 +3,5 @@ import * as categories from "./schema/categories"; export default { ...articles, - ...categories + ...categories, }; diff --git a/apps/backend/src/plugins/blog/admin/database/schema/articles.ts b/apps/backend/src/plugins/blog/admin/database/schema/articles.ts index 2b4cf0a33..d670f47ac 100644 --- a/apps/backend/src/plugins/blog/admin/database/schema/articles.ts +++ b/apps/backend/src/plugins/blog/admin/database/schema/articles.ts @@ -5,7 +5,7 @@ import { pgTable, serial, timestamp, - varchar + varchar, } from "drizzle-orm/pg-core"; import { blog_categories } from "./categories"; @@ -18,21 +18,21 @@ export const blog_articles = pgTable( { id: serial("id").primaryKey(), author_id: integer("author_id").references(() => core_users.id, { - onDelete: "cascade" + onDelete: "cascade", }), category_id: integer("category_id").references(() => blog_categories.id, { - onDelete: "cascade" + onDelete: "cascade", }), created: timestamp("created").notNull().defaultNow(), update: timestamp("update").notNull().defaultNow(), - ip_address: varchar("ip_address", { length: 45 }) + ip_address: varchar("ip_address", { length: 45 }), }, table => ({ author_id_idx: index("blog_articles_author_id_idx").on(table.author_id), category_id_idx: index("blog_articles_category_id_idx").on( - table.category_id - ) - }) + table.category_id, + ), + }), ); export const blog_articles_relations = relations( @@ -40,15 +40,15 @@ export const blog_articles_relations = relations( ({ many, one }) => ({ author: one(core_users, { fields: [blog_articles.author_id], - references: [core_users.id] + references: [core_users.id], }), content: many(blog_articles_content), title: many(blog_articles_title), category: one(blog_categories, { fields: [blog_articles.category_id], - references: [blog_categories.id] - }) - }) + references: [blog_categories.id], + }), + }), ); export const blog_articles_content = pgTable( @@ -56,21 +56,21 @@ export const blog_articles_content = pgTable( { id: serial("id").primaryKey(), item_id: integer("item_id").references(() => blog_articles.id, { - onDelete: "cascade" + onDelete: "cascade", }), language_code: varchar("language_code") .notNull() .references(() => core_languages.code, { - onDelete: "cascade" + onDelete: "cascade", }), - value: varchar("value").notNull() + value: varchar("value").notNull(), }, table => ({ item_id_idx: index("blog_articles_content_item_id_idx").on(table.item_id), language_code_idx: index("blog_articles_content_language_code_idx").on( - table.language_code - ) - }) + table.language_code, + ), + }), ); export const blog_articles_content_relations = relations( @@ -78,9 +78,9 @@ export const blog_articles_content_relations = relations( ({ one }) => ({ article: one(blog_articles, { fields: [blog_articles_content.item_id], - references: [blog_articles.id] - }) - }) + references: [blog_articles.id], + }), + }), ); export const blog_articles_title = pgTable( @@ -88,21 +88,21 @@ export const blog_articles_title = pgTable( { id: serial("id").primaryKey(), item_id: integer("item_id").references(() => blog_articles.id, { - onDelete: "cascade" + onDelete: "cascade", }), language_code: varchar("language_code") .notNull() .references(() => core_languages.code, { - onDelete: "cascade" + onDelete: "cascade", }), - value: varchar("value", { length: 100 }).notNull() + value: varchar("value", { length: 100 }).notNull(), }, table => ({ item_id_idx: index("blog_articles_title_item_id_idx").on(table.item_id), language_code_idx: index("blog_articles_title_language_code_idx").on( - table.language_code - ) - }) + table.language_code, + ), + }), ); export const blog_articles_title_relations = relations( @@ -110,7 +110,7 @@ export const blog_articles_title_relations = relations( ({ one }) => ({ article: one(blog_articles, { fields: [blog_articles_title.item_id], - references: [blog_articles.id] - }) - }) + references: [blog_articles.id], + }), + }), ); diff --git a/apps/backend/src/plugins/blog/admin/database/schema/categories.ts b/apps/backend/src/plugins/blog/admin/database/schema/categories.ts index e66ea98b0..74c836890 100644 --- a/apps/backend/src/plugins/blog/admin/database/schema/categories.ts +++ b/apps/backend/src/plugins/blog/admin/database/schema/categories.ts @@ -5,7 +5,7 @@ import { pgTable, serial, timestamp, - varchar + varchar, } from "drizzle-orm/pg-core"; import { relations } from "drizzle-orm"; @@ -24,7 +24,7 @@ export const blog_categories = pgTable("blog_categories", { can_all_reply: boolean("can_all_reply").notNull().default(true), can_all_download_files: boolean("can_all_download_files") .notNull() - .default(true) + .default(true), }); export const blog_categories_relations = relations( @@ -33,8 +33,8 @@ export const blog_categories_relations = relations( articles: many(blog_articles), name: many(blog_categories_name), description: many(blog_categories_description), - permissions: many(blog_categories_permissions) - }) + permissions: many(blog_categories_permissions), + }), ); export const blog_categories_name = pgTable( @@ -42,21 +42,21 @@ export const blog_categories_name = pgTable( { id: serial("id").primaryKey(), item_id: integer("item_id").references(() => blog_categories.id, { - onDelete: "cascade" + onDelete: "cascade", }), language_code: varchar("language_code") .notNull() .references(() => core_languages.code, { - onDelete: "cascade" + onDelete: "cascade", }), - value: varchar("value", { length: 100 }).notNull() + value: varchar("value", { length: 100 }).notNull(), }, table => ({ item_id_idx: index("blog_categories_name_item_id_idx").on(table.item_id), language_code_idx: index("blog_categories_name_language_code_idx").on( - table.language_code - ) - }) + table.language_code, + ), + }), ); export const blog_categories_name_relations = relations( @@ -64,9 +64,9 @@ export const blog_categories_name_relations = relations( ({ one }) => ({ category: one(blog_categories, { fields: [blog_categories_name.item_id], - references: [blog_categories.id] - }) - }) + references: [blog_categories.id], + }), + }), ); export const blog_categories_description = pgTable( @@ -74,23 +74,23 @@ export const blog_categories_description = pgTable( { id: serial("id").primaryKey(), item_id: integer("item_id").references(() => blog_categories.id, { - onDelete: "cascade" + onDelete: "cascade", }), language_code: varchar("language_code") .notNull() .references(() => core_languages.code, { - onDelete: "cascade" + onDelete: "cascade", }), - value: varchar("value").notNull() + value: varchar("value").notNull(), }, table => ({ item_id_idx: index("blog_categories_description_item_id_idx").on( - table.item_id + table.item_id, ), language_code_idx: index( - "blog_categories_description_language_code_idx" - ).on(table.language_code) - }) + "blog_categories_description_language_code_idx", + ).on(table.language_code), + }), ); export const blog_categories_description_relations = relations( @@ -98,9 +98,9 @@ export const blog_categories_description_relations = relations( ({ one }) => ({ category: one(blog_categories, { fields: [blog_categories_description.item_id], - references: [blog_categories.id] - }) - }) + references: [blog_categories.id], + }), + }), ); export const blog_categories_permissions = pgTable( @@ -108,22 +108,22 @@ export const blog_categories_permissions = pgTable( { id: serial("id").primaryKey(), blog_id: integer("blog_id").references(() => blog_categories.id, { - onDelete: "cascade" + onDelete: "cascade", }), group_id: integer("group_id").references(() => core_groups.id, { - onDelete: "cascade" + onDelete: "cascade", }), can_read: boolean("can_read").notNull().default(false), can_create: boolean("can_create").notNull().default(false), can_reply: boolean("can_reply").notNull().default(false), - can_download_files: boolean("can_download_files").notNull().default(false) + can_download_files: boolean("can_download_files").notNull().default(false), }, table => ({ blog_id_idx: index("blog_categories_permissions_blog_id_idx").on( - table.blog_id + table.blog_id, ), group_id_idx: index("blog_categories_permissions_group_id_idx").on( - table.group_id - ) - }) + table.group_id, + ), + }), ); diff --git a/apps/backend/src/plugins/blog/blog.module.ts b/apps/backend/src/plugins/blog/blog.module.ts index 1f41a20a3..2a1282584 100644 --- a/apps/backend/src/plugins/blog/blog.module.ts +++ b/apps/backend/src/plugins/blog/blog.module.ts @@ -4,6 +4,6 @@ import { AdminBlogModule } from "./admin/admin.module"; import { BlogCategoriesModule } from "./categories/categories.module"; @Module({ - imports: [AdminBlogModule, BlogCategoriesModule] + imports: [AdminBlogModule, BlogCategoriesModule], }) export class BlogModule {} diff --git a/apps/backend/src/plugins/blog/categories/categories.module.ts b/apps/backend/src/plugins/blog/categories/categories.module.ts index 0c873a2ad..d0bb2c52a 100644 --- a/apps/backend/src/plugins/blog/categories/categories.module.ts +++ b/apps/backend/src/plugins/blog/categories/categories.module.ts @@ -4,6 +4,6 @@ import { ShowBlogCategoriesService } from "./show/show.service"; import { ShowBlogCategoriesResolver } from "./show/show.resolver"; @Module({ - providers: [ShowBlogCategoriesService, ShowBlogCategoriesResolver] + providers: [ShowBlogCategoriesService, ShowBlogCategoriesResolver], }) export class BlogCategoriesModule {} diff --git a/apps/backend/src/plugins/blog/categories/show/show.resolver.ts b/apps/backend/src/plugins/blog/categories/show/show.resolver.ts index f3dd64e6a..8049e7669 100644 --- a/apps/backend/src/plugins/blog/categories/show/show.resolver.ts +++ b/apps/backend/src/plugins/blog/categories/show/show.resolver.ts @@ -10,7 +10,7 @@ export class ShowBlogCategoriesResolver { @Query(() => ShowBlogCategoriesObj) async blog_categories__show( - @Args() args: ShowBlogCategoriesArgs + @Args() args: ShowBlogCategoriesArgs, ): Promise { return this.service.show(args); } diff --git a/apps/backend/src/plugins/blog/categories/show/show.service.ts b/apps/backend/src/plugins/blog/categories/show/show.service.ts index 6a376c6c6..000a33e49 100644 --- a/apps/backend/src/plugins/blog/categories/show/show.service.ts +++ b/apps/backend/src/plugins/blog/categories/show/show.service.ts @@ -4,7 +4,7 @@ import { inputPaginationCursor, outputPagination, SortDirectionEnum, - DatabaseService + DatabaseService, } from "vitnode-backend"; import { ShowBlogCategoriesArgs } from "./dto/show.args"; @@ -19,7 +19,7 @@ export class ShowBlogCategoriesService { async show({ cursor, first, - last + last, }: ShowBlogCategoriesArgs): Promise { const pagination = await inputPaginationCursor({ cursor, @@ -29,20 +29,20 @@ export class ShowBlogCategoriesService { last, primaryCursor: { column: "id", - schema: blog_categories.id + schema: blog_categories.id, }, defaultSortBy: { direction: SortDirectionEnum.asc, - column: "position" - } + column: "position", + }, }); const edges = await this.databaseService.db.query.blog_categories.findMany({ ...pagination, with: { name: true, - description: true - } + description: true, + }, }); const totalCount = await this.databaseService.db @@ -54,7 +54,7 @@ export class ShowBlogCategoriesService { totalCount, first, cursor, - last + last, }); } } diff --git a/apps/backend/src/plugins/core/admin/database/drizzle.config.ts b/apps/backend/src/plugins/core/admin/database/drizzle.config.ts index 4dc9be04f..d5a2f2fc4 100644 --- a/apps/backend/src/plugins/core/admin/database/drizzle.config.ts +++ b/apps/backend/src/plugins/core/admin/database/drizzle.config.ts @@ -1,4 +1,4 @@ -// ! DO NOT REMOVE OR MODIFY THIS FILE!!! +// ! DO NOT REMOVE, MODIFY OR MOVE THIS FILE!!! import { defineConfig } from "drizzle-kit"; @@ -8,5 +8,5 @@ export default defineConfig({ dialect: "postgresql", dbCredentials: DATABASE_ENVS, schema: "./src/plugins/core/admin/database/schema/*.ts", - out: "./src/plugins/core/admin/database/migrations/" + out: "./src/plugins/core/admin/database/migrations/", }); diff --git a/apps/backend/src/plugins/core/admin/database/index.ts b/apps/backend/src/plugins/core/admin/database/index.ts index 92713a56a..74e9b8404 100644 --- a/apps/backend/src/plugins/core/admin/database/index.ts +++ b/apps/backend/src/plugins/core/admin/database/index.ts @@ -17,5 +17,5 @@ export default { ...admins, ...moderators, ...plugins, - ...nav + ...nav, }; diff --git a/apps/backend/src/plugins/core/admin/database/schema/admins.ts b/apps/backend/src/plugins/core/admin/database/schema/admins.ts index 3aa32f4b8..8f8e93e09 100644 --- a/apps/backend/src/plugins/core/admin/database/schema/admins.ts +++ b/apps/backend/src/plugins/core/admin/database/schema/admins.ts @@ -6,7 +6,7 @@ import { pgTable, serial, timestamp, - varchar + varchar, } from "drizzle-orm/pg-core"; import { relations } from "drizzle-orm"; @@ -19,23 +19,23 @@ export const core_admin_permissions = pgTable( { id: serial("id").primaryKey(), group_id: integer("group_id").references(() => core_groups.id, { - onDelete: "cascade" + onDelete: "cascade", }), user_id: integer("user_id").references(() => core_users.id, { - onDelete: "cascade" + onDelete: "cascade", }), unrestricted: boolean("unrestricted").notNull().default(false), created: timestamp("created").notNull().defaultNow(), updated: timestamp("updated").notNull().defaultNow(), protected: boolean("protected").notNull().default(false), - permissions: jsonb("permissions").default("{}") + permissions: jsonb("permissions").default("{}"), }, table => ({ group_id_idx: index("core_admin_permissions_group_id_idx").on( - table.group_id + table.group_id, ), - user_id_idx: index("core_admin_permissions_user_id_idx").on(table.user_id) - }) + user_id_idx: index("core_admin_permissions_user_id_idx").on(table.user_id), + }), ); export const core_admin_permissions_relations = relations( @@ -43,13 +43,13 @@ export const core_admin_permissions_relations = relations( ({ one }) => ({ group: one(core_groups, { fields: [core_admin_permissions.group_id], - references: [core_groups.id] + references: [core_groups.id], }), user: one(core_users, { fields: [core_admin_permissions.user_id], - references: [core_users.id] - }) - }) + references: [core_users.id], + }), + }), ); export const core_admin_sessions = pgTable( @@ -59,23 +59,23 @@ export const core_admin_sessions = pgTable( user_id: integer("user_id") .notNull() .references(() => core_users.id, { - onDelete: "cascade" + onDelete: "cascade", }), created: timestamp("created").notNull().defaultNow(), last_seen: timestamp("last_seen").notNull().defaultNow(), expires: timestamp("expires").notNull(), device_id: integer("device_id") .references(() => core_sessions_known_devices.id, { - onDelete: "cascade" + onDelete: "cascade", }) - .notNull() + .notNull(), }, table => ({ login_token_idx: index("core_admin_sessions_login_token_idx").on( - table.login_token + table.login_token, ), - user_id_idx: index("core_admin_sessions_user_id_idx").on(table.user_id) - }) + user_id_idx: index("core_admin_sessions_user_id_idx").on(table.user_id), + }), ); export const core_admin_sessions_relations = relations( @@ -83,11 +83,11 @@ export const core_admin_sessions_relations = relations( ({ one }) => ({ user: one(core_users, { fields: [core_admin_sessions.user_id], - references: [core_users.id] + references: [core_users.id], }), device: one(core_sessions_known_devices, { fields: [core_admin_sessions.device_id], - references: [core_sessions_known_devices.id] - }) - }) + references: [core_sessions_known_devices.id], + }), + }), ); diff --git a/apps/backend/src/plugins/core/admin/database/schema/files.ts b/apps/backend/src/plugins/core/admin/database/schema/files.ts index 489851e0e..0f5e11cd9 100644 --- a/apps/backend/src/plugins/core/admin/database/schema/files.ts +++ b/apps/backend/src/plugins/core/admin/database/schema/files.ts @@ -6,7 +6,7 @@ import { serial, text, timestamp, - varchar + varchar, } from "drizzle-orm/pg-core"; import { relations } from "drizzle-orm"; @@ -20,32 +20,32 @@ export const core_files = pgTable( file_alt: varchar("file_alt", { length: 255 }), file_name: varchar("file_name", { length: 255 }).notNull(), file_name_original: varchar("file_name_original", { - length: 255 + length: 255, }).notNull(), dir_folder: varchar("dir_folder", { length: 255 }).notNull(), user_id: integer("user_id") .notNull() .references(() => core_users.id, { - onDelete: "cascade" + onDelete: "cascade", }), created: timestamp("created").notNull().defaultNow(), file_size: integer("file_size").notNull(), mimetype: varchar("mimetype", { length: 255 }).notNull(), width: integer("width"), height: integer("height"), - security_key: varchar("security_key", { length: 255 }) + security_key: varchar("security_key", { length: 255 }), }, table => ({ - user_id_idx: index("core_files_user_id_idx").on(table.user_id) - }) + user_id_idx: index("core_files_user_id_idx").on(table.user_id), + }), ); export const core_files_relations = relations(core_files, ({ many, one }) => ({ user: one(core_users, { fields: [core_files.user_id], - references: [core_users.id] + references: [core_users.id], }), - using: many(core_files_using) + using: many(core_files_using), })); export const core_files_using = pgTable( @@ -56,11 +56,11 @@ export const core_files_using = pgTable( .notNull() .references(() => core_files.id), plugin: varchar("plugin", { length: 255 }).notNull(), - folder: varchar("folder", { length: 255 }).notNull() + folder: varchar("folder", { length: 255 }).notNull(), }, table => ({ - file_id_idx: index("core_files_using_file_id_idx").on(table.file_id) - }) + file_id_idx: index("core_files_using_file_id_idx").on(table.file_id), + }), ); export const core_files_using_relations = relations( @@ -68,9 +68,9 @@ export const core_files_using_relations = relations( ({ one }) => ({ file: one(core_files, { fields: [core_files_using.file_id], - references: [core_files.id] - }) - }) + references: [core_files.id], + }), + }), ); export const core_migrations = pgTable("core_migrations", { @@ -78,5 +78,5 @@ export const core_migrations = pgTable("core_migrations", { hash: text("hash").notNull(), plugin: varchar("plugin", { length: 255 }).notNull(), created_migration: bigint("created_migration", { mode: "bigint" }), - created: timestamp("created").notNull().defaultNow() + created: timestamp("created").notNull().defaultNow(), }); diff --git a/apps/backend/src/plugins/core/admin/database/schema/groups.ts b/apps/backend/src/plugins/core/admin/database/schema/groups.ts index d8a95a9f7..ff2dfa3c0 100644 --- a/apps/backend/src/plugins/core/admin/database/schema/groups.ts +++ b/apps/backend/src/plugins/core/admin/database/schema/groups.ts @@ -6,7 +6,7 @@ import { pgTable, serial, timestamp, - varchar + varchar, } from "drizzle-orm/pg-core"; import { core_languages } from "./languages"; @@ -25,11 +25,11 @@ export const core_groups = pgTable("core_groups", { .default(500000), files_max_storage_for_submit: integer("files_max_storage_for_submit") .notNull() - .default(10000) + .default(10000), }); export const core_groups_relations = relations(core_groups, ({ many }) => ({ - name: many(core_groups_names) + name: many(core_groups_names), })); export const core_groups_names = pgTable( @@ -39,21 +39,21 @@ export const core_groups_names = pgTable( item_id: integer("item_id") .notNull() .references(() => core_groups.id, { - onDelete: "cascade" + onDelete: "cascade", }), language_code: varchar("language_code") .notNull() .references(() => core_languages.code, { - onDelete: "cascade" + onDelete: "cascade", }), - value: varchar("value", { length: 255 }).notNull() + value: varchar("value", { length: 255 }).notNull(), }, table => ({ item_id_idx: index("core_groups_names_item_id_idx").on(table.item_id), language_code_idx: index("core_groups_names_language_code_idx").on( - table.language_code - ) - }) + table.language_code, + ), + }), ); export const core_groups_names_relations = relations( @@ -61,7 +61,7 @@ export const core_groups_names_relations = relations( ({ one }) => ({ group: one(core_groups, { fields: [core_groups_names.item_id], - references: [core_groups.id] - }) - }) + references: [core_groups.id], + }), + }), ); diff --git a/apps/backend/src/plugins/core/admin/database/schema/languages.ts b/apps/backend/src/plugins/core/admin/database/schema/languages.ts index 6b1919d0c..151dfd83c 100644 --- a/apps/backend/src/plugins/core/admin/database/schema/languages.ts +++ b/apps/backend/src/plugins/core/admin/database/schema/languages.ts @@ -4,7 +4,7 @@ import { pgTable, serial, timestamp, - varchar + varchar, } from "drizzle-orm/pg-core"; export const core_languages = pgTable( @@ -23,11 +23,11 @@ export const core_languages = pgTable( locale: varchar("locale", { length: 50 }).notNull().default("enUS"), allow_in_input: boolean("allow_in_input").default(true), site_copyright: varchar("site_copyright", { - length: 255 - }).default("") + length: 255, + }).default(""), }, table => ({ code_idx: index("core_languages_code_idx").on(table.code), - name_idx: index("core_languages_name_idx").on(table.name) - }) + name_idx: index("core_languages_name_idx").on(table.name), + }), ); diff --git a/apps/backend/src/plugins/core/admin/database/schema/moderators.ts b/apps/backend/src/plugins/core/admin/database/schema/moderators.ts index cae6f5187..cfe914f59 100644 --- a/apps/backend/src/plugins/core/admin/database/schema/moderators.ts +++ b/apps/backend/src/plugins/core/admin/database/schema/moderators.ts @@ -4,7 +4,7 @@ import { integer, pgTable, serial, - timestamp + timestamp, } from "drizzle-orm/pg-core"; import { relations } from "drizzle-orm"; @@ -16,24 +16,24 @@ export const core_moderators_permissions = pgTable( { id: serial("id").primaryKey(), group_id: integer("group_id").references(() => core_groups.id, { - onDelete: "cascade" + onDelete: "cascade", }), user_id: integer("user_id").references(() => core_users.id, { - onDelete: "cascade" + onDelete: "cascade", }), unrestricted: boolean("unrestricted").notNull().default(false), created: timestamp("created").notNull().defaultNow(), updated: timestamp("updated").notNull().defaultNow(), - protected: boolean("protected").notNull().default(false) + protected: boolean("protected").notNull().default(false), }, table => ({ group_id_idx: index("core_moderators_permissions_group_id_idx").on( - table.group_id + table.group_id, ), user_id_idx: index("core_moderators_permissions_user_id_idx").on( - table.user_id - ) - }) + table.user_id, + ), + }), ); export const core_moderators_permissions_relations = relations( @@ -41,11 +41,11 @@ export const core_moderators_permissions_relations = relations( ({ one }) => ({ group: one(core_groups, { fields: [core_moderators_permissions.group_id], - references: [core_groups.id] + references: [core_groups.id], }), user: one(core_users, { fields: [core_moderators_permissions.user_id], - references: [core_users.id] - }) - }) + references: [core_users.id], + }), + }), ); diff --git a/apps/backend/src/plugins/core/admin/database/schema/nav.ts b/apps/backend/src/plugins/core/admin/database/schema/nav.ts index 54aad0e6d..263f86b8f 100644 --- a/apps/backend/src/plugins/core/admin/database/schema/nav.ts +++ b/apps/backend/src/plugins/core/admin/database/schema/nav.ts @@ -5,7 +5,7 @@ import { integer, pgTable, serial, - varchar + varchar, } from "drizzle-orm/pg-core"; import { core_languages } from "./languages"; @@ -19,11 +19,11 @@ export const core_nav = pgTable( position: integer("position").notNull().default(0), // ! Warning: this is a recursive relation. It's not supported by drizzle-orm yet. parent_id: integer("parent_id").notNull().default(0), - icon: varchar("icon", { length: 50 }) + icon: varchar("icon", { length: 50 }), }, table => ({ - parent_id_idx: index("core_nav_parent_id_idx").on(table.parent_id) - }) + parent_id_idx: index("core_nav_parent_id_idx").on(table.parent_id), + }), ); export const core_nav_relations = relations(core_nav, ({ many, one }) => ({ @@ -31,8 +31,8 @@ export const core_nav_relations = relations(core_nav, ({ many, one }) => ({ description: many(core_nav_description), parent: one(core_nav, { fields: [core_nav.parent_id], - references: [core_nav.id] - }) + references: [core_nav.id], + }), })); export const core_nav_name = pgTable( @@ -42,32 +42,32 @@ export const core_nav_name = pgTable( item_id: serial("item_id") .notNull() .references(() => core_nav.id, { - onDelete: "cascade" + onDelete: "cascade", }), language_code: varchar("language_code") .notNull() .references(() => core_languages.code, { - onDelete: "cascade" + onDelete: "cascade", }), - value: varchar("value", { length: 100 }).notNull() + value: varchar("value", { length: 100 }).notNull(), }, table => ({ item_id_idx: index("core_nav_name_item_id_idx").on(table.item_id), language_code_idx: index("core_nav_name_language_code_idx").on( - table.language_code - ) - }) + table.language_code, + ), + }), ); export const core_nav_name_relations = relations(core_nav_name, ({ one }) => ({ nav: one(core_nav, { fields: [core_nav_name.item_id], - references: [core_nav.id] + references: [core_nav.id], }), language: one(core_languages, { fields: [core_nav_name.language_code], - references: [core_languages.code] - }) + references: [core_languages.code], + }), })); export const core_nav_description = pgTable( @@ -77,21 +77,21 @@ export const core_nav_description = pgTable( item_id: serial("item_id") .notNull() .references(() => core_nav.id, { - onDelete: "cascade" + onDelete: "cascade", }), language_code: varchar("language_code") .notNull() .references(() => core_languages.code, { - onDelete: "cascade" + onDelete: "cascade", }), - value: varchar("value", { length: 200 }).notNull() + value: varchar("value", { length: 200 }).notNull(), }, table => ({ item_id_idx: index("core_nav_description_item_id_idx").on(table.item_id), language_code_idx: index("core_nav_description_language_code_idx").on( - table.language_code - ) - }) + table.language_code, + ), + }), ); export const core_nav_description_relations = relations( @@ -99,11 +99,11 @@ export const core_nav_description_relations = relations( ({ one }) => ({ nav: one(core_nav, { fields: [core_nav_description.item_id], - references: [core_nav.id] + references: [core_nav.id], }), language: one(core_languages, { fields: [core_nav_description.language_code], - references: [core_languages.code] - }) - }) + references: [core_languages.code], + }), + }), ); diff --git a/apps/backend/src/plugins/core/admin/database/schema/plugins.ts b/apps/backend/src/plugins/core/admin/database/schema/plugins.ts index b9597140c..0481488d2 100644 --- a/apps/backend/src/plugins/core/admin/database/schema/plugins.ts +++ b/apps/backend/src/plugins/core/admin/database/schema/plugins.ts @@ -5,7 +5,7 @@ import { pgTable, serial, timestamp, - varchar + varchar, } from "drizzle-orm/pg-core"; export const core_plugins = pgTable( @@ -24,10 +24,10 @@ export const core_plugins = pgTable( author: varchar("author", { length: 100 }).notNull(), author_url: varchar("author_url", { length: 255 }), default: boolean("default").notNull().default(false), - allow_default: boolean("allow_default").notNull().default(true) + allow_default: boolean("allow_default").notNull().default(true), }, table => ({ code_idx: index("core_plugins_code_idx").on(table.code), - name_idx: index("core_plugins_name_idx").on(table.name) - }) + name_idx: index("core_plugins_name_idx").on(table.name), + }), ); diff --git a/apps/backend/src/plugins/core/admin/database/schema/sessions.ts b/apps/backend/src/plugins/core/admin/database/schema/sessions.ts index f054850cb..056ae6a77 100644 --- a/apps/backend/src/plugins/core/admin/database/schema/sessions.ts +++ b/apps/backend/src/plugins/core/admin/database/schema/sessions.ts @@ -5,7 +5,7 @@ import { serial, text, timestamp, - varchar + varchar, } from "drizzle-orm/pg-core"; import { relations } from "drizzle-orm"; @@ -19,30 +19,30 @@ export const core_sessions = pgTable( user_id: integer("user_id") .notNull() .references(() => core_users.id, { - onDelete: "cascade" + onDelete: "cascade", }), created: timestamp("created").notNull().defaultNow(), expires: timestamp("expires").notNull(), device_id: integer("device_id") .references(() => core_sessions_known_devices.id, { - onDelete: "cascade" + onDelete: "cascade", }) - .notNull() + .notNull(), }, table => ({ - user_id_idx: index("core_sessions_user_id_idx").on(table.user_id) - }) + user_id_idx: index("core_sessions_user_id_idx").on(table.user_id), + }), ); export const core_sessions_relations = relations(core_sessions, ({ one }) => ({ user: one(core_users, { fields: [core_sessions.user_id], - references: [core_users.id] + references: [core_users.id], }), device: one(core_sessions_known_devices, { fields: [core_sessions.device_id], - references: [core_sessions_known_devices.id] - }) + references: [core_sessions_known_devices.id], + }), })); export const core_sessions_known_devices = pgTable( @@ -54,13 +54,13 @@ export const core_sessions_known_devices = pgTable( uagent_browser: varchar("uagent_browser", { length: 200 }).notNull(), uagent_version: varchar("uagent_version", { length: 100 }).notNull(), uagent_os: varchar("uagent_os", { length: 100 }).notNull(), - last_seen: timestamp("last_seen").notNull().defaultNow() + last_seen: timestamp("last_seen").notNull().defaultNow(), }, table => ({ ip_address_idx: index("core_sessions_known_devices_ip_address_idx").on( - table.ip_address - ) - }) + table.ip_address, + ), + }), ); export const core_sessions_known_devices_relations = relations( @@ -68,11 +68,11 @@ export const core_sessions_known_devices_relations = relations( ({ one }) => ({ session: one(core_sessions, { fields: [core_sessions_known_devices.id], - references: [core_sessions.device_id] + references: [core_sessions.device_id], }), admin_session: one(core_admin_sessions, { fields: [core_sessions_known_devices.id], - references: [core_admin_sessions.device_id] - }) - }) + references: [core_admin_sessions.device_id], + }), + }), ); diff --git a/apps/backend/src/plugins/core/admin/database/schema/users.ts b/apps/backend/src/plugins/core/admin/database/schema/users.ts index d3ed418cd..d42372589 100644 --- a/apps/backend/src/plugins/core/admin/database/schema/users.ts +++ b/apps/backend/src/plugins/core/admin/database/schema/users.ts @@ -7,7 +7,7 @@ import { serial, text, timestamp, - varchar + varchar, } from "drizzle-orm/pg-core"; import { core_groups } from "./groups"; @@ -29,24 +29,24 @@ export const core_users = pgTable( last_name: varchar("last_name", { length: 255 }), birthday: timestamp("birthday"), ip_address: varchar("ip_address", { length: 255 }).notNull(), - language: varchar("language", { length: 5 }).notNull().default("en") + language: varchar("language", { length: 5 }).notNull().default("en"), }, table => ({ name_seo_idx: index("core_users_name_seo_idx").on(table.name_seo), name_idx: index("core_users_name_idx").on(table.name), - email_idx: index("core_users_email_idx").on(table.email) - }) + email_idx: index("core_users_email_idx").on(table.email), + }), ); export const core_users_relations = relations(core_users, ({ one }) => ({ group: one(core_groups, { fields: [core_users.group_id], - references: [core_groups.id] + references: [core_groups.id], }), avatar: one(core_files_avatars, { fields: [core_users.id], - references: [core_files_avatars.user_id] - }) + references: [core_files_avatars.user_id], + }), })); export const core_files_avatars = pgTable("core_files_avatars", { @@ -58,8 +58,8 @@ export const core_files_avatars = pgTable("core_files_avatars", { mimetype: varchar("mimetype", { length: 255 }).notNull(), extension: varchar("extension", { length: 32 }).notNull(), user_id: integer("user_id").references(() => core_users.id, { - onDelete: "cascade" - }) + onDelete: "cascade", + }), }); export const core_files_avatars_relations = relations( @@ -67,7 +67,7 @@ export const core_files_avatars_relations = relations( ({ one }) => ({ user: one(core_users, { fields: [core_files_avatars.user_id], - references: [core_users.id] - }) - }) + references: [core_users.id], + }), + }), ); diff --git a/apps/backend/src/plugins/plugins.module.ts b/apps/backend/src/plugins/plugins.module.ts index b5df97674..354bb63de 100644 --- a/apps/backend/src/plugins/plugins.module.ts +++ b/apps/backend/src/plugins/plugins.module.ts @@ -1,4 +1,4 @@ -// ! DO NOT REMOVE OR MODIFY THIS FILE!!! +// ! DO NOT REMOVE, MODIFY OR MOVE THIS FILE!!! import { Module } from "@nestjs/common"; @@ -7,8 +7,8 @@ import { BlogModule } from "./blog/blog.module"; @Module({ imports: [ - BlogModule + BlogModule, // ! === MODULE === - ] + ], }) export class PluginsModule {} diff --git a/apps/backend/src/utils/actions/finish-build.ts b/apps/backend/src/utils/actions/finish-build.ts index 94c1ff762..f709bb056 100644 --- a/apps/backend/src/utils/actions/finish-build.ts +++ b/apps/backend/src/utils/actions/finish-build.ts @@ -28,7 +28,7 @@ import { db } from "@/database/client"; throw error; } - }) + }), ); }); diff --git a/apps/backend/src/utils/actions/helpers/manifest.ts b/apps/backend/src/utils/actions/helpers/manifest.ts index defdce1eb..8563d83ae 100644 --- a/apps/backend/src/utils/actions/helpers/manifest.ts +++ b/apps/backend/src/utils/actions/helpers/manifest.ts @@ -2,13 +2,13 @@ import { join } from "path"; import * as fs from "fs"; import * as dotenv from "dotenv"; +import { ABSOLUTE_PATHS_BACKEND, getConfigFile } from "vitnode-backend"; import { parseFrontendUrlFromEnv } from "@/functions/envs"; import { objectToArray, updateObject } from "@/functions/update-object"; -import { ABSOLUTE_PATHS_BACKEND, getConfigFile } from "vitnode-backend"; dotenv.config({ - path: join(process.cwd(), "..", ".env") + path: join(process.cwd(), "..", ".env"), }); interface ManifestType { @@ -66,7 +66,7 @@ const generateDefaultManifest = ({ lang_code, frontend_url, site_name, - site_short_name + site_short_name, }: { frontend_url: string; lang_code: string; @@ -87,16 +87,16 @@ const generateDefaultManifest = ({ { src: "/icons/favicon.ico", sizes: "any", - type: "image/x-icon" - } - ] + type: "image/x-icon", + }, + ], }); export const generateManifest = () => { const config = getConfigFile(); const languages = fs .readdirSync( - ABSOLUTE_PATHS_BACKEND.plugin({ code: "core" }).frontend.language + ABSOLUTE_PATHS_BACKEND.plugin({ code: "core" }).frontend.language, ) .map(fileName => fileName.replace(".json", "")); const frontend_url = parseFrontendUrlFromEnv().url; @@ -106,12 +106,12 @@ export const generateManifest = () => { lang_code, frontend_url, site_name: config.settings.general.site_name, - site_short_name: config.settings.general.site_short_name + site_short_name: config.settings.general.site_short_name, }); const path = join( ABSOLUTE_PATHS_BACKEND.uploads.public, "assets", - lang_code + lang_code, ); const filePath = join(path, "manifest.webmanifest"); @@ -124,10 +124,10 @@ export const generateManifest = () => { { ...manifest, start_url: `${start_url}${manifest.start_url.replace(start_url, "")}`, - id: `${start_url}${manifest.start_url.replace(start_url, "")}` + id: `${start_url}${manifest.start_url.replace(start_url, "")}`, }, - defaultManifest - ) + defaultManifest, + ), ); fs.writeFile( @@ -136,7 +136,7 @@ export const generateManifest = () => { "utf8", err => { if (err) throw err; - } + }, ); return; @@ -150,7 +150,7 @@ export const generateManifest = () => { "utf8", err => { if (err) throw err; - } + }, ); }); }; diff --git a/apps/backend/src/utils/actions/helpers/update-plugins.ts b/apps/backend/src/utils/actions/helpers/update-plugins.ts index 4fc60584a..6afa5706a 100644 --- a/apps/backend/src/utils/actions/helpers/update-plugins.ts +++ b/apps/backend/src/utils/actions/helpers/update-plugins.ts @@ -3,47 +3,46 @@ import * as fs from "fs"; import { NodePgDatabase } from "drizzle-orm/node-postgres"; import { eq } from "drizzle-orm"; -import { ConfigPlugin } from "vitnode-backend"; +import { ConfigPlugin, ABSOLUTE_PATHS_BACKEND } from "vitnode-backend"; import { core_plugins } from "@/plugins/core/admin/database/schema/plugins"; import { schemaDatabase } from "@/database/schema"; import { poolDB } from "@/database/client"; -import { ABSOLUTE_PATHS_BACKEND } from "vitnode-backend"; export const updatePlugins = async ({ - db + db, }: { db: NodePgDatabase; }) => { fs.readdir(join(process.cwd(), "src", "plugins"), async (err, plugins) => { let isDefaultIndex: number | null = null; const defaultPlugin = await db.query.core_plugins.findFirst({ - where: (table, { eq }) => eq(table.default, true) + where: (table, { eq }) => eq(table.default, true), }); await Promise.all( plugins .filter( - plugin => !["database", "plugins.module.ts", "core"].includes(plugin) + plugin => !["database", "plugins.module.ts", "core"].includes(plugin), ) .map(async (code, index) => { const paths = ABSOLUTE_PATHS_BACKEND.plugin({ code }); const config: ConfigPlugin = JSON.parse( - fs.readFileSync(paths.config, "utf8") + fs.readFileSync(paths.config, "utf8"), ); if (config.allow_default) { isDefaultIndex = index; } const versions: Record = JSON.parse( - fs.readFileSync(paths.versions, "utf8") + fs.readFileSync(paths.versions, "utf8"), ); const latestVersion = Object.keys(versions).sort().reverse()[0]; const version = versions[latestVersion]; let pluginId: number | null = null; const plugin = await db.query.core_plugins.findFirst({ - where: (table, { eq }) => eq(table.code, code) + where: (table, { eq }) => eq(table.code, code), }); if (plugin) { @@ -59,7 +58,7 @@ export const updatePlugins = async ({ author_url: config.author_url, allow_default: config.allow_default, version, - version_code: +latestVersion + version_code: +latestVersion, }) .where(eq(core_plugins.id, pluginId)); } else { @@ -76,14 +75,14 @@ export const updatePlugins = async ({ allow_default: config.allow_default, version: version ?? null, version_code: latestVersion ? +latestVersion : null, - default: isDefaultIndex === index && !defaultPlugin - } + default: isDefaultIndex === index && !defaultPlugin, + }, ]) .returning(); pluginId = pluginInsert[0].id; } - }) + }), ); await poolDB.end(); diff --git a/apps/backend/src/utils/actions/migrate.ts b/apps/backend/src/utils/actions/migrate.ts index 41750ecc5..013e6c68c 100644 --- a/apps/backend/src/utils/actions/migrate.ts +++ b/apps/backend/src/utils/actions/migrate.ts @@ -3,13 +3,13 @@ import * as fs from "fs"; import { sql } from "drizzle-orm"; import { MigrationMeta } from "drizzle-orm/migrator"; - import { ABSOLUTE_PATHS_BACKEND } from "vitnode-backend"; + import { db } from "@/database/client"; // Source: https://github.com/drizzle-team/drizzle-orm/blob/main/drizzle-orm/src/migrator.ts const readMigrationFiles = ({ - pluginCode + pluginCode, }: { pluginCode: string; }): MigrationMeta[] => { @@ -47,11 +47,11 @@ const readMigrationFiles = ({ sql: result, bps: journalEntry.breakpoints, folderMillis: journalEntry.when, - hash: createHash("sha256").update(query).digest("hex") + hash: createHash("sha256").update(query).digest("hex"), }); } catch { throw new Error( - `No file ${migrationPath} found in ${migrationFolderTo} folder` + `No file ${migrationPath} found in ${migrationFolderTo} folder`, ); } } @@ -66,7 +66,7 @@ export const migrate = async ({ pluginCode }: { pluginCode: string }) => { // Create the migration table await db.execute( - sql`CREATE SCHEMA IF NOT EXISTS ${sql.identifier(migrationsSchema)}` + sql`CREATE SCHEMA IF NOT EXISTS ${sql.identifier(migrationsSchema)}`, ); await db.execute(sql` CREATE TABLE IF NOT EXISTS ${sql.identifier(migrationsSchema)}.${sql.identifier(migrationsTable)} ( @@ -103,8 +103,8 @@ export const migrate = async ({ pluginCode }: { pluginCode: string }) => { // Insert the migration into the migrations table await tx.execute( sql`insert into ${sql.identifier(migrationsSchema)}.${sql.identifier( - migrationsTable - )} ("hash", "created_migration", "plugin") values(${migration.hash}, ${migration.folderMillis}, ${pluginCode})` + migrationsTable, + )} ("hash", "created_migration", "plugin") values(${migration.hash}, ${migration.folderMillis}, ${pluginCode})`, ); } } diff --git a/apps/docs/package.json b/apps/docs/package.json index 57910a80e..3980859ce 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -5,7 +5,7 @@ "scripts": { "build": "next build", "dev": "next dev --port 3001", - "start": "next start" + "start": "next start --port 3001" }, "dependencies": { "class-variance-authority": "^0.7.0", diff --git a/apps/frontend/app/[locale]/(admin)/admin/(auth)/blog/categories/page.tsx b/apps/frontend/app/[locale]/(admin)/admin/(auth)/blog/categories/page.tsx index 8e8c67020..9e5c719c7 100644 --- a/apps/frontend/app/[locale]/(admin)/admin/(auth)/blog/categories/page.tsx +++ b/apps/frontend/app/[locale]/(admin)/admin/(auth)/blog/categories/page.tsx @@ -6,7 +6,7 @@ import { fetcher } from "@/graphql/fetcher"; import { Admin_Blog_Categories__Show, Admin_Blog_Categories__ShowQuery, - Admin_Blog_Categories__ShowQueryVariables + Admin_Blog_Categories__ShowQueryVariables, } from "@/graphql/hooks"; import { Card, CardContent, CardHeader } from "@/components/ui/card"; import { HeaderContent } from "@/components/header-content/header-content"; @@ -17,7 +17,7 @@ const getData = async () => { Admin_Blog_Categories__ShowQuery, Admin_Blog_Categories__ShowQueryVariables >({ - query: Admin_Blog_Categories__Show + query: Admin_Blog_Categories__Show, }); return data; @@ -27,14 +27,14 @@ export async function generateMetadata(): Promise { const t = await getTranslations("blog.admin.categories"); return { - title: t("title") + title: t("title"), }; } export default async function Page() { const [t, data] = await Promise.all([ getTranslations("blog.admin.categories"), - getData() + getData(), ]); return ( diff --git a/apps/frontend/app/[locale]/(admin)/admin/(auth)/blog/layout.tsx b/apps/frontend/app/[locale]/(admin)/admin/(auth)/blog/layout.tsx index 67dd80663..434c5fcd8 100644 --- a/apps/frontend/app/[locale]/(admin)/admin/(auth)/blog/layout.tsx +++ b/apps/frontend/app/[locale]/(admin)/admin/(auth)/blog/layout.tsx @@ -12,7 +12,7 @@ export async function generateMetadata(): Promise { const [config, t, tAdmin] = await Promise.all([ getConfigFile(), getTranslations("blog.admin.nav"), - getTranslations("admin") + getTranslations("admin"), ]); const defaultTitle = `${t("title")} - ${tAdmin("title_short")} - ${config.settings.general.site_name}`; @@ -20,8 +20,8 @@ export async function generateMetadata(): Promise { return { title: { default: defaultTitle, - template: `%s - ${defaultTitle}` - } + template: `%s - ${defaultTitle}`, + }, }; } diff --git a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/advanced/files/page.tsx b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/advanced/files/page.tsx index 458ea049c..076dd8737 100644 --- a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/advanced/files/page.tsx +++ b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/advanced/files/page.tsx @@ -7,11 +7,11 @@ import { Admin__Core_Files__Show, ShowCoreFilesSortingColumnEnum, Admin__Core_Files__ShowQuery, - Admin__Core_Files__ShowQueryVariables + Admin__Core_Files__ShowQueryVariables, } from "@/graphql/hooks"; import { usePaginationAPISsr, - SearchParamsPagination + SearchParamsPagination, } from "@/plugins/core/hooks/utils/use-pagination-api-ssr"; import { fetcher } from "@/graphql/fetcher"; import { FilesAdvancedCoreAdminView } from "@/plugins/admin/views/core/advanced/files/files-advanced-core-admin-view"; @@ -22,7 +22,7 @@ const getData = async (variables: Admin__Core_Files__ShowQueryVariables) => { Admin__Core_Files__ShowQueryVariables >({ query: Admin__Core_Files__Show, - variables + variables, }); return data; @@ -36,7 +36,7 @@ export async function generateMetadata(): Promise { const t = await getTranslations("admin.core.advanced.files"); return { - title: t("title") + title: t("title"), }; } @@ -45,11 +45,11 @@ export default async function Page({ searchParams }: Props) { searchParams, defaultPageSize: 10, search: true, - sortByEnum: ShowCoreFilesSortingColumnEnum + sortByEnum: ShowCoreFilesSortingColumnEnum, }); const [t, data] = await Promise.all([ getTranslations("admin.core.advanced.files"), - getData(variables) + getData(variables), ]); return ( diff --git a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/advanced/layout.tsx b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/advanced/layout.tsx index 6bc9c35b8..c7767e08f 100644 --- a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/advanced/layout.tsx +++ b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/advanced/layout.tsx @@ -12,7 +12,7 @@ export async function generateMetadata(): Promise { const [t, tCore, config] = await Promise.all([ getTranslations("admin"), getTranslations("core.admin"), - getConfigFile() + getConfigFile(), ]); const defaultTitle = `${tCore("nav.advanced")} - ${t("title_short")} - ${config.settings.general.site_name}`; @@ -20,8 +20,8 @@ export async function generateMetadata(): Promise { return { title: { template: `%s - ${defaultTitle}`, - absolute: defaultTitle - } + absolute: defaultTitle, + }, }; } diff --git a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/langs/page.tsx b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/langs/page.tsx index d95424926..a751e8830 100644 --- a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/langs/page.tsx +++ b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/langs/page.tsx @@ -5,11 +5,11 @@ import { Core_Languages__Show, ShowCoreLanguagesSortingColumnEnum, Core_Languages__ShowQuery, - Core_Languages__ShowQueryVariables + Core_Languages__ShowQueryVariables, } from "@/graphql/hooks"; import { usePaginationAPISsr, - SearchParamsPagination + SearchParamsPagination, } from "@/plugins/core/hooks/utils/use-pagination-api-ssr"; import { HeaderContent } from "@/components/header-content/header-content"; import { Card } from "@/components/ui/card"; @@ -24,7 +24,7 @@ const getData = async (variables: Core_Languages__ShowQueryVariables) => { Core_Languages__ShowQueryVariables >({ query: Core_Languages__Show, - variables + variables, }); return data; @@ -40,7 +40,7 @@ export async function generateMetadata(): Promise { const t = await getTranslations("admin.core.langs"); return { - title: t("title") + title: t("title"), }; } @@ -49,12 +49,12 @@ export default async function Page({ searchParams }: Props) { searchParams, defaultPageSize: 10, search: true, - sortByEnum: ShowCoreLanguagesSortingColumnEnum + sortByEnum: ShowCoreLanguagesSortingColumnEnum, }); const [t, data] = await Promise.all([ getTranslations("admin.core.langs"), - getData(variables) + getData(variables), ]); return ( diff --git a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/plugins/[code]/dev/files/page.tsx b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/plugins/[code]/dev/files/page.tsx index 95174199b..00ac8e08f 100644 --- a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/plugins/[code]/dev/files/page.tsx +++ b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/plugins/[code]/dev/files/page.tsx @@ -5,7 +5,7 @@ import { cn } from "@vitnode/frontend/helpers"; import { Admin__Core_Plugins__Files, Admin__Core_Plugins__FilesQuery, - Admin__Core_Plugins__FilesQueryVariables + Admin__Core_Plugins__FilesQueryVariables, } from "@/graphql/hooks"; import { fetcher } from "@/graphql/fetcher"; @@ -21,7 +21,7 @@ const getData = async (variables: Admin__Core_Plugins__FilesQueryVariables) => { Admin__Core_Plugins__FilesQueryVariables >({ query: Admin__Core_Plugins__Files, - variables + variables, }); return data; @@ -31,14 +31,14 @@ export async function generateMetadata(): Promise { const t = await getTranslations("admin.core.plugins.dev.files"); return { - title: t("title") + title: t("title"), }; } export default async function Page({ params: { code } }: Props) { const [data, t] = await Promise.all([ getData({ code }), - getTranslations("admin.core.plugins.dev.files") + getTranslations("admin.core.plugins.dev.files"), ]); return ( @@ -57,7 +57,7 @@ export default async function Page({ params: { code } }: Props) { "text-muted-foreground italic": !item[1], "text-primary font-semibold": item[1], "text-destructive font-semibold": - !item[1] && item[0] === "default_page" + !item[1] && item[0] === "default_page", })} > {t("file_detected", { count: +item[1] })} diff --git a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/plugins/[code]/dev/layout.tsx b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/plugins/[code]/dev/layout.tsx index 0e79af225..ef0fcef1d 100644 --- a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/plugins/[code]/dev/layout.tsx +++ b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/plugins/[code]/dev/layout.tsx @@ -15,12 +15,12 @@ interface Props { } export async function generateMetadata({ - params: { code } + params: { code }, }: Props): Promise { const [t, tCore, config] = await Promise.all([ getTranslations("admin"), getTranslations("core.admin"), - getConfigFile() + getConfigFile(), ]); const { data } = await getPluginDataAdmin({ code }); @@ -31,8 +31,8 @@ export async function generateMetadata({ return { title: { template: `%s - ${defaultTitle}`, - absolute: defaultTitle - } + absolute: defaultTitle, + }, }; } diff --git a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/plugins/[code]/dev/nav/page.tsx b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/plugins/[code]/dev/nav/page.tsx index fde23d387..b2d798f9f 100644 --- a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/plugins/[code]/dev/nav/page.tsx +++ b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/plugins/[code]/dev/nav/page.tsx @@ -7,7 +7,7 @@ import { Admin__Core_Plugins__Nav__Show, Admin__Core_Plugins__Nav__ShowQuery, Admin__Core_Plugins__Nav__ShowQueryVariables, - ShowAdminNavPluginsObj + ShowAdminNavPluginsObj, } from "@/graphql/hooks"; import { fetcher } from "@/graphql/fetcher"; import { NavDevPluginAdminView } from "@/plugins/admin/views/core/plugins/views/dev/nav/nav"; @@ -21,14 +21,14 @@ interface Props { } const getData = async ( - variables: Admin__Core_Plugins__Nav__ShowQueryVariables + variables: Admin__Core_Plugins__Nav__ShowQueryVariables, ) => { const { data } = await fetcher< Admin__Core_Plugins__Nav__ShowQuery, Admin__Core_Plugins__Nav__ShowQueryVariables >({ query: Admin__Core_Plugins__Nav__Show, - variables + variables, }); return data; @@ -38,7 +38,7 @@ export async function generateMetadata(): Promise { const t = await getTranslations("admin.core.plugins.dev.nav"); return { - title: t("title") + title: t("title"), }; } @@ -54,9 +54,9 @@ export default async function Page({ params: { code } }: Props) { nav.children?.map(child => ({ id: `${nav.code}_${child.code}`, ...child, - children: [] - })) ?? [] - })) + children: [], + })) ?? [], + })), }); const icons: { @@ -64,7 +64,7 @@ export default async function Page({ params: { code } }: Props) { id: string; }[] = flattenData.map(item => ({ icon: item.icon ? : null, - id: item.id.toString() + id: item.id.toString(), })); return ( diff --git a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/plugins/[code]/dev/query-api.ts b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/plugins/[code]/dev/query-api.ts index b9b02163a..de3361e87 100644 --- a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/plugins/[code]/dev/query-api.ts +++ b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/plugins/[code]/dev/query-api.ts @@ -1,12 +1,12 @@ import { Admin__Core_Plugins__Show__Item, Admin__Core_Plugins__Show__ItemQuery, - Admin__Core_Plugins__Show__ItemQueryVariables + Admin__Core_Plugins__Show__ItemQueryVariables, } from "@/graphql/hooks"; import { fetcher, ErrorType } from "@/graphql/fetcher"; export const getPluginDataAdmin = async ( - variables: Admin__Core_Plugins__Show__ItemQueryVariables + variables: Admin__Core_Plugins__Show__ItemQueryVariables, ) => { try { const { data } = await fetcher< @@ -14,7 +14,7 @@ export const getPluginDataAdmin = async ( Admin__Core_Plugins__Show__ItemQueryVariables >({ query: Admin__Core_Plugins__Show__Item, - variables + variables, }); return { data }; diff --git a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/plugins/page.tsx b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/plugins/page.tsx index 5046bc63f..bee14418d 100644 --- a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/plugins/page.tsx +++ b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/plugins/page.tsx @@ -5,11 +5,11 @@ import { Admin__Core_Plugins__Show, ShowAdminPluginsSortingColumnEnum, Admin__Core_Plugins__ShowQuery, - Admin__Core_Plugins__ShowQueryVariables + Admin__Core_Plugins__ShowQueryVariables, } from "@/graphql/hooks"; import { usePaginationAPISsr, - SearchParamsPagination + SearchParamsPagination, } from "@/plugins/core/hooks/utils/use-pagination-api-ssr"; import { HeaderContent } from "@/components/header-content/header-content"; import { Card } from "@/components/ui/card"; @@ -28,7 +28,7 @@ const getData = async (variables: Admin__Core_Plugins__ShowQueryVariables) => { Admin__Core_Plugins__ShowQueryVariables >({ query: Admin__Core_Plugins__Show, - variables + variables, }); return data; @@ -38,7 +38,7 @@ export async function generateMetadata(): Promise { const t = await getTranslations("admin.core.plugins"); return { - title: t("title") + title: t("title"), }; } @@ -47,11 +47,11 @@ export default async function Page({ searchParams }: Props) { searchParams, search: true, sortByEnum: ShowAdminPluginsSortingColumnEnum, - defaultPageSize: 10 + defaultPageSize: 10, }); const [data, t] = await Promise.all([ getData(variables), - getTranslations("admin.core.plugins") + getTranslations("admin.core.plugins"), ]); return ( diff --git a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/settings/email/page.tsx b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/settings/email/page.tsx index 680beaaa6..bdcf778c3 100644 --- a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/settings/email/page.tsx +++ b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/settings/email/page.tsx @@ -8,7 +8,7 @@ import { fetcher } from "@/graphql/fetcher"; import { Admin__Core_Email_Settings__Show, Admin__Core_Email_Settings__ShowQuery, - Admin__Core_Email_Settings__ShowQueryVariables + Admin__Core_Email_Settings__ShowQueryVariables, } from "@/graphql/hooks"; import { ActionsEmailSettingsAdmin } from "@/plugins/admin/views/core/settings/email/actions/actions"; @@ -17,7 +17,7 @@ const getData = async () => { Admin__Core_Email_Settings__ShowQuery, Admin__Core_Email_Settings__ShowQueryVariables >({ - query: Admin__Core_Email_Settings__Show + query: Admin__Core_Email_Settings__Show, }); return data; @@ -27,14 +27,14 @@ export async function generateMetadata(): Promise { const t = await getTranslations("core.admin.nav"); return { - title: t("settings_email") + title: t("settings_email"), }; } export default async function Page() { const [t, data] = await Promise.all([ getTranslations("core.admin.nav"), - getData() + getData(), ]); return ( diff --git a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/settings/general/page.tsx b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/settings/general/page.tsx index 2d3693b91..c405406fc 100644 --- a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/settings/general/page.tsx +++ b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/settings/general/page.tsx @@ -6,7 +6,7 @@ import { Card } from "@/components/ui/card"; import { Core_Main_Settings__Show, Core_Main_Settings__ShowQuery, - Core_Main_Settings__ShowQueryVariables + Core_Main_Settings__ShowQueryVariables, } from "@/graphql/hooks"; import { fetcher } from "@/graphql/fetcher"; import { GeneralSettingsCoreAdmin } from "@/plugins/admin/views/core/settings/general/main-settings-core-admin"; @@ -16,7 +16,7 @@ const getData = async () => { Core_Main_Settings__ShowQuery, Core_Main_Settings__ShowQueryVariables >({ - query: Core_Main_Settings__Show + query: Core_Main_Settings__Show, }); return data; @@ -26,14 +26,14 @@ export async function generateMetadata(): Promise { const t = await getTranslations("core.admin.nav"); return { - title: t("settings_general") + title: t("settings_general"), }; } export default async function Page() { const [t, data] = await Promise.all([ getTranslations("core.admin.nav"), - getData() + getData(), ]); return ( diff --git a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/settings/layout.tsx b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/settings/layout.tsx index 709d30df9..2e446c3d4 100644 --- a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/settings/layout.tsx +++ b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/settings/layout.tsx @@ -12,7 +12,7 @@ export async function generateMetadata(): Promise { const [t, tCore, config] = await Promise.all([ getTranslations("admin"), getTranslations("core.admin"), - getConfigFile() + getConfigFile(), ]); const defaultTitle = `${tCore("nav.settings")} - ${t("title_short")} - ${config.settings.general.site_name}`; @@ -20,8 +20,8 @@ export async function generateMetadata(): Promise { return { title: { template: `%s - ${defaultTitle}`, - absolute: defaultTitle - } + absolute: defaultTitle, + }, }; } diff --git a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/settings/metadata/page.tsx b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/settings/metadata/page.tsx index 1a06e18b4..8948a0cfa 100644 --- a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/settings/metadata/page.tsx +++ b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/settings/metadata/page.tsx @@ -6,7 +6,7 @@ import { Card } from "@/components/ui/card"; import { Admin__Core_Manifest_Metadata__Show, Admin__Core_Manifest_Metadata__ShowQuery, - Admin__Core_Manifest_Metadata__ShowQueryVariables + Admin__Core_Manifest_Metadata__ShowQueryVariables, } from "@/graphql/hooks"; import { fetcher } from "@/graphql/fetcher"; import { ManifestMetadataCoreAdminView } from "@/plugins/admin/views/core/settings/metadata/manifest/manifest-metadata-core-view"; @@ -16,7 +16,7 @@ const getData = async () => { Admin__Core_Manifest_Metadata__ShowQuery, Admin__Core_Manifest_Metadata__ShowQueryVariables >({ - query: Admin__Core_Manifest_Metadata__Show + query: Admin__Core_Manifest_Metadata__Show, }); return data; @@ -26,7 +26,7 @@ export async function generateMetadata(): Promise { const t = await getTranslations("admin.core.metadata.manifest"); return { - title: t("title") + title: t("title"), }; } diff --git a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/styles/editor/page.tsx b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/styles/editor/page.tsx index 1034df10d..cf1ad9216 100644 --- a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/styles/editor/page.tsx +++ b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/styles/editor/page.tsx @@ -9,7 +9,7 @@ export async function generateMetadata(): Promise { const t = await getTranslations("admin.core.styles.editor"); return { - title: t("title") + title: t("title"), }; } diff --git a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/styles/layout.tsx b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/styles/layout.tsx index b2de427ff..458b1e5d9 100644 --- a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/styles/layout.tsx +++ b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/styles/layout.tsx @@ -12,7 +12,7 @@ export async function generateMetadata(): Promise { const [t, tCore, config] = await Promise.all([ getTranslations("admin"), getTranslations("core.admin"), - getConfigFile() + getConfigFile(), ]); const defaultTitle = `${tCore("nav.styles")} - ${t("title_short")} - ${config.settings.general.site_name}`; @@ -20,8 +20,8 @@ export async function generateMetadata(): Promise { return { title: { template: `%s - ${defaultTitle}`, - absolute: defaultTitle - } + absolute: defaultTitle, + }, }; } diff --git a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/styles/nav/page.tsx b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/styles/nav/page.tsx index 3732dd6a4..b85c0f48b 100644 --- a/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/styles/nav/page.tsx +++ b/apps/frontend/app/[locale]/(admin)/admin/(auth)/core/styles/nav/page.tsx @@ -4,7 +4,7 @@ import { getTranslations } from "next-intl/server"; import { Admin__Core_Nav__Show, Admin__Core_Nav__ShowQuery, - Admin__Core_Nav__ShowQueryVariables + Admin__Core_Nav__ShowQueryVariables, } from "@/graphql/hooks"; import { fetcher } from "@/graphql/fetcher"; import { NavAdminView } from "@/plugins/admin/views/core/styles/nav/nav-admin-view"; @@ -14,7 +14,7 @@ const getData = async () => { Admin__Core_Nav__ShowQuery, Admin__Core_Nav__ShowQueryVariables >({ - query: Admin__Core_Nav__Show + query: Admin__Core_Nav__Show, }); return data; @@ -24,7 +24,7 @@ export async function generateMetadata(): Promise { const t = await getTranslations("admin.core.styles.nav"); return { - title: t("title") + title: t("title"), }; } diff --git a/apps/frontend/app/[locale]/(admin)/admin/(auth)/get-session-admin.ts b/apps/frontend/app/[locale]/(admin)/admin/(auth)/get-session-admin.ts index 403e30b3f..91dc894f4 100644 --- a/apps/frontend/app/[locale]/(admin)/admin/(auth)/get-session-admin.ts +++ b/apps/frontend/app/[locale]/(admin)/admin/(auth)/get-session-admin.ts @@ -4,7 +4,7 @@ import { fetcher } from "@/graphql/fetcher"; import { Admin__Sessions__Authorization, Admin__Sessions__AuthorizationQuery, - Admin__Sessions__AuthorizationQueryVariables + Admin__Sessions__AuthorizationQueryVariables, } from "@/graphql/hooks"; export const getSessionAdminData = async () => { @@ -19,7 +19,7 @@ export const getSessionAdminData = async () => { Admin__Sessions__AuthorizationQueryVariables >({ query: Admin__Sessions__Authorization, - cache: "force-cache" + cache: "force-cache", }); return data; diff --git a/apps/frontend/app/[locale]/(admin)/admin/(auth)/layout.tsx b/apps/frontend/app/[locale]/(admin)/admin/(auth)/layout.tsx index a598615b6..76224b4f1 100644 --- a/apps/frontend/app/[locale]/(admin)/admin/(auth)/layout.tsx +++ b/apps/frontend/app/[locale]/(admin)/admin/(auth)/layout.tsx @@ -16,7 +16,7 @@ interface Props { export async function generateMetadata(): Promise { const [config, t] = await Promise.all([ getConfigFile(), - getTranslations("admin") + getTranslations("admin"), ]); const defaultTitle = `${t("title_short")} - ${config.settings.general.site_name}`; @@ -24,8 +24,8 @@ export async function generateMetadata(): Promise { return { title: { default: defaultTitle, - template: `%s - ${defaultTitle}` - } + template: `%s - ${defaultTitle}`, + }, }; } diff --git a/apps/frontend/app/[locale]/(admin)/admin/(auth)/members/groups/page.tsx b/apps/frontend/app/[locale]/(admin)/admin/(auth)/members/groups/page.tsx index 69f271510..e0839707a 100644 --- a/apps/frontend/app/[locale]/(admin)/admin/(auth)/members/groups/page.tsx +++ b/apps/frontend/app/[locale]/(admin)/admin/(auth)/members/groups/page.tsx @@ -5,11 +5,11 @@ import { Admin__Core_Groups__Show, ShowAdminGroupsSortingColumnEnum, Admin__Core_Groups__ShowQuery, - Admin__Core_Groups__ShowQueryVariables + Admin__Core_Groups__ShowQueryVariables, } from "@/graphql/hooks"; import { usePaginationAPISsr, - SearchParamsPagination + SearchParamsPagination, } from "@/plugins/core/hooks/utils/use-pagination-api-ssr"; import { fetcher } from "@/graphql/fetcher"; import { GroupsMembersAdminView } from "@/plugins/admin/views/members/groups/groups-members-admin-view"; @@ -24,7 +24,7 @@ const getData = async (variables: Admin__Core_Groups__ShowQueryVariables) => { Admin__Core_Groups__ShowQueryVariables >({ query: Admin__Core_Groups__Show, - variables + variables, }); return data; @@ -34,7 +34,7 @@ export async function generateMetadata(): Promise { const t = await getTranslations("admin.members.groups"); return { - title: t("title") + title: t("title"), }; } @@ -43,7 +43,7 @@ export default async function Page({ searchParams }: Props) { searchParams, search: true, sortByEnum: ShowAdminGroupsSortingColumnEnum, - defaultPageSize: 10 + defaultPageSize: 10, }); const data = await getData(variables); diff --git a/apps/frontend/app/[locale]/(admin)/admin/(auth)/members/staff/administrators/page.tsx b/apps/frontend/app/[locale]/(admin)/admin/(auth)/members/staff/administrators/page.tsx index 64899dc38..65201b18f 100644 --- a/apps/frontend/app/[locale]/(admin)/admin/(auth)/members/staff/administrators/page.tsx +++ b/apps/frontend/app/[locale]/(admin)/admin/(auth)/members/staff/administrators/page.tsx @@ -5,24 +5,24 @@ import { Admin__Core_Staff_Administrators__Show, ShowAdminStaffAdministratorsSortingColumnEnum, Admin__Core_Staff_Administrators__ShowQuery, - Admin__Core_Staff_Administrators__ShowQueryVariables + Admin__Core_Staff_Administrators__ShowQueryVariables, } from "@/graphql/hooks"; import { usePaginationAPISsr, - SearchParamsPagination + SearchParamsPagination, } from "@/plugins/core/hooks/utils/use-pagination-api-ssr"; import { fetcher } from "@/graphql/fetcher"; import { AdministratorsStaffAdminView } from "@/plugins/admin/views/members/staff/administrators/administrators-view"; const getData = async ( - variables: Admin__Core_Staff_Administrators__ShowQueryVariables + variables: Admin__Core_Staff_Administrators__ShowQueryVariables, ) => { const { data } = await fetcher< Admin__Core_Staff_Administrators__ShowQuery, Admin__Core_Staff_Administrators__ShowQueryVariables >({ query: Admin__Core_Staff_Administrators__Show, - variables + variables, }); return data; @@ -36,7 +36,7 @@ export async function generateMetadata(): Promise { const t = await getTranslations("admin.members.staff.administrators"); return { - title: t("title") + title: t("title"), }; } @@ -45,7 +45,7 @@ export default async function Page({ searchParams }: Props) { searchParams, search: true, sortByEnum: ShowAdminStaffAdministratorsSortingColumnEnum, - defaultPageSize: 10 + defaultPageSize: 10, }); const data = await getData(variables); diff --git a/apps/frontend/app/[locale]/(admin)/admin/(auth)/members/staff/moderators/page.tsx b/apps/frontend/app/[locale]/(admin)/admin/(auth)/members/staff/moderators/page.tsx index 0e69cbc75..11e90e227 100644 --- a/apps/frontend/app/[locale]/(admin)/admin/(auth)/members/staff/moderators/page.tsx +++ b/apps/frontend/app/[locale]/(admin)/admin/(auth)/members/staff/moderators/page.tsx @@ -5,24 +5,24 @@ import { Admin__Core_Staff_Moderators__Show, ShowAdminStaffModeratorsSortingColumnEnum, Admin__Core_Staff_Moderators__ShowQuery, - Admin__Core_Staff_Moderators__ShowQueryVariables + Admin__Core_Staff_Moderators__ShowQueryVariables, } from "@/graphql/hooks"; import { usePaginationAPISsr, - SearchParamsPagination + SearchParamsPagination, } from "@/plugins/core/hooks/utils/use-pagination-api-ssr"; import { fetcher } from "@/graphql/fetcher"; import { ModeratorsStaffAdminView } from "@/plugins/admin/views/members/staff/moderators/moderators-view"; const getData = async ( - variables: Admin__Core_Staff_Moderators__ShowQueryVariables + variables: Admin__Core_Staff_Moderators__ShowQueryVariables, ) => { const { data } = await fetcher< Admin__Core_Staff_Moderators__ShowQuery, Admin__Core_Staff_Moderators__ShowQueryVariables >({ query: Admin__Core_Staff_Moderators__Show, - variables + variables, }); return data; @@ -36,7 +36,7 @@ export async function generateMetadata(): Promise { const t = await getTranslations("admin.members.staff.moderators"); return { - title: t("title") + title: t("title"), }; } @@ -45,7 +45,7 @@ export default async function Page({ searchParams }: Props) { searchParams, search: true, sortByEnum: ShowAdminStaffModeratorsSortingColumnEnum, - defaultPageSize: 10 + defaultPageSize: 10, }); const data = await getData(variables); diff --git a/apps/frontend/app/[locale]/(admin)/admin/(auth)/members/users/page.tsx b/apps/frontend/app/[locale]/(admin)/admin/(auth)/members/users/page.tsx index b0c1d4e6d..90c05e3fc 100644 --- a/apps/frontend/app/[locale]/(admin)/admin/(auth)/members/users/page.tsx +++ b/apps/frontend/app/[locale]/(admin)/admin/(auth)/members/users/page.tsx @@ -5,11 +5,11 @@ import { Admin__Core_Members__Show, ShowAdminMembersSortingColumnEnum, Admin__Core_Members__ShowQuery, - Admin__Core_Members__ShowQueryVariables + Admin__Core_Members__ShowQueryVariables, } from "@/graphql/hooks"; import { usePaginationAPISsr, - SearchParamsPagination + SearchParamsPagination, } from "@/plugins/core/hooks/utils/use-pagination-api-ssr"; import { fetcher } from "@/graphql/fetcher"; import { UsersMembersAdminView } from "@/plugins/admin/views/members/users/users-members-admin-view"; @@ -28,7 +28,7 @@ const getData = async (variables: Admin__Core_Members__ShowQueryVariables) => { Admin__Core_Members__ShowQueryVariables >({ query: Admin__Core_Members__Show, - variables + variables, }); return data; @@ -38,7 +38,7 @@ export async function generateMetadata(): Promise { const t = await getTranslations("admin.members.users"); return { - title: t("title") + title: t("title"), }; } @@ -48,11 +48,11 @@ export default async function Page({ searchParams }: Props) { searchParams, sortByEnum: ShowAdminMembersSortingColumnEnum, search: true, - defaultPageSize: 10 + defaultPageSize: 10, }), groups: Array.isArray(searchParams.groups) ? searchParams.groups?.map(group => Number(group)) - : Number(searchParams.groups) + : Number(searchParams.groups), }; const data = await getData(variables); diff --git a/apps/frontend/app/[locale]/(admin)/admin/(auth)/providers.tsx b/apps/frontend/app/[locale]/(admin)/admin/(auth)/providers.tsx index 662bc3111..da4b91599 100644 --- a/apps/frontend/app/[locale]/(admin)/admin/(auth)/providers.tsx +++ b/apps/frontend/app/[locale]/(admin)/admin/(auth)/providers.tsx @@ -13,14 +13,14 @@ interface Props { export const Providers = ({ children, data: { - admin__sessions__authorization: { user: session, version } - } + admin__sessions__authorization: { user: session, version }, + }, }: Props) => { return ( {children} diff --git a/apps/frontend/app/[locale]/(admin)/admin/(configs)/install/page.tsx b/apps/frontend/app/[locale]/(admin)/admin/(configs)/install/page.tsx index e044a9c49..3c12e5006 100644 --- a/apps/frontend/app/[locale]/(admin)/admin/(configs)/install/page.tsx +++ b/apps/frontend/app/[locale]/(admin)/admin/(configs)/install/page.tsx @@ -4,7 +4,7 @@ import { ErrorType, fetcher } from "@/graphql/fetcher"; import { Admin__Install__Layout, Admin__Install__LayoutQuery, - Admin__Install__LayoutQueryVariables + Admin__Install__LayoutQueryVariables, } from "@/graphql/hooks"; import { LayoutInstallConfigsView } from "@/plugins/admin/configs/views/install/layout-install-configs-view"; import { InternalErrorView } from "@/plugins/admin/global/internal-error/internal-error-view"; @@ -15,7 +15,7 @@ const getData = async () => { Admin__Install__LayoutQueryVariables >({ query: Admin__Install__Layout, - cache: "force-cache" + cache: "force-cache", }); return data; diff --git a/apps/frontend/app/[locale]/(admin)/admin/layout.tsx b/apps/frontend/app/[locale]/(admin)/admin/layout.tsx index ead38fce1..0dbb15546 100644 --- a/apps/frontend/app/[locale]/(admin)/admin/layout.tsx +++ b/apps/frontend/app/[locale]/(admin)/admin/layout.tsx @@ -13,7 +13,7 @@ export async function generateMetadata(): Promise { return { title: t("title"), - robots: "noindex, nofollow" + robots: "noindex, nofollow", }; } diff --git a/apps/frontend/app/[locale]/(main)/(container)/settings/devices/page.tsx b/apps/frontend/app/[locale]/(main)/(container)/settings/devices/page.tsx index ceadc8b90..5c0d0f015 100644 --- a/apps/frontend/app/[locale]/(main)/(container)/settings/devices/page.tsx +++ b/apps/frontend/app/[locale]/(main)/(container)/settings/devices/page.tsx @@ -4,7 +4,7 @@ import { cookies } from "next/headers"; import { Core_Sessions__Devices__Show, Core_Sessions__Devices__ShowQuery, - Core_Sessions__Devices__ShowQueryVariables + Core_Sessions__Devices__ShowQueryVariables, } from "@/graphql/hooks"; import { DevicesSettingsView } from "@/plugins/core/templates/views/settings/views/devices/devices-settings-view"; import { fetcher } from "@/graphql/fetcher"; @@ -14,7 +14,7 @@ const getData = async () => { Core_Sessions__Devices__ShowQuery, Core_Sessions__Devices__ShowQueryVariables >({ - query: Core_Sessions__Devices__Show + query: Core_Sessions__Devices__Show, }); return data; diff --git a/apps/frontend/app/[locale]/(main)/(container)/settings/files/page.tsx b/apps/frontend/app/[locale]/(main)/(container)/settings/files/page.tsx index e54419397..ceacdd8c1 100644 --- a/apps/frontend/app/[locale]/(main)/(container)/settings/files/page.tsx +++ b/apps/frontend/app/[locale]/(main)/(container)/settings/files/page.tsx @@ -4,11 +4,11 @@ import { Core_Members__Files__Show, ShowCoreFilesSortingColumnEnum, Core_Members__Files__ShowQuery, - Core_Members__Files__ShowQueryVariables + Core_Members__Files__ShowQueryVariables, } from "@/graphql/hooks"; import { usePaginationAPISsr, - SearchParamsPagination + SearchParamsPagination, } from "@/plugins/core/hooks/utils/use-pagination-api-ssr"; import { fetcher } from "@/graphql/fetcher"; import { FilesSettingsView } from "@/plugins/core/templates/views/settings/views/files/files-settings-view"; @@ -20,7 +20,7 @@ const getData = async (variables: Core_Members__Files__ShowQueryVariables) => { >({ query: Core_Members__Files__Show, variables, - cache: "force-cache" + cache: "force-cache", }); return data; @@ -35,7 +35,7 @@ export default async function Page({ searchParams }: Props) { searchParams, defaultPageSize: 10, search: true, - sortByEnum: ShowCoreFilesSortingColumnEnum + sortByEnum: ShowCoreFilesSortingColumnEnum, }); const data = await getData(variables); diff --git a/apps/frontend/app/[locale]/(main)/(container)/settings/layout.tsx b/apps/frontend/app/[locale]/(main)/(container)/settings/layout.tsx index 52894a9b0..963676baf 100644 --- a/apps/frontend/app/[locale]/(main)/(container)/settings/layout.tsx +++ b/apps/frontend/app/[locale]/(main)/(container)/settings/layout.tsx @@ -16,9 +16,9 @@ export async function generateMetadata(): Promise { return { title: { default: t("title"), - template: `%s - ${t("title")} - ${config.settings.general.site_name}` + template: `%s - ${t("title")} - ${config.settings.general.site_name}`, }, - robots: "noindex, nofollow" + robots: "noindex, nofollow", }; } diff --git a/apps/frontend/app/[locale]/(main)/page.tsx b/apps/frontend/app/[locale]/(main)/page.tsx index c648666e1..8b4c853ae 100644 --- a/apps/frontend/app/[locale]/(main)/page.tsx +++ b/apps/frontend/app/[locale]/(main)/page.tsx @@ -10,14 +10,14 @@ interface Props { } const getDescription = async ({ - locale + locale, }: { locale: Props["params"]["locale"]; }): Promise => { const { data: { - core_settings__show: { site_description } - } + core_settings__show: { site_description }, + }, } = await getSessionData(); const textFromLang = site_description.find(t => t.language_code === locale); @@ -30,10 +30,10 @@ const getDescription = async ({ }; export async function generateMetadata({ - params: { locale } + params: { locale }, }: Props): Promise { return { - description: await getDescription({ locale }) + description: await getDescription({ locale }), }; } @@ -42,7 +42,7 @@ export default async function Page() { const PageFromTheme: React.LazyExoticComponent<() => JSX.Element> = React.lazy( async () => - import(`../../../plugins/${default_plugin}/templates/default-page`) + import(`../../../plugins/${default_plugin}/templates/default-page`), ); return ; diff --git a/apps/frontend/app/[locale]/(main)/profile/[id]/page.tsx b/apps/frontend/app/[locale]/(main)/profile/[id]/page.tsx index 829a8526f..989970c45 100644 --- a/apps/frontend/app/[locale]/(main)/profile/[id]/page.tsx +++ b/apps/frontend/app/[locale]/(main)/profile/[id]/page.tsx @@ -6,7 +6,7 @@ import { ProfileView } from "@/plugins/core/templates/views/profile/profile-view import { Core_Members__Profiles, Core_Members__ProfilesQuery, - Core_Members__ProfilesQueryVariables + Core_Members__ProfilesQueryVariables, } from "@/graphql/hooks"; import { fetcher } from "@/graphql/fetcher"; @@ -18,9 +18,9 @@ const getData = async ({ id }: { id: string }) => { query: Core_Members__Profiles, variables: { first: 1, - nameSeo: id + nameSeo: id, }, - cache: "force-cache" + cache: "force-cache", }); return data; @@ -31,14 +31,14 @@ interface Props { } export async function generateMetadata({ - params: { id } + params: { id }, }: Props): Promise { const api = await getData({ id }); const data = api.core_members__show.edges.at(0); if (!data) return {}; return { - title: data.name + title: data.name, }; } diff --git a/apps/frontend/app/[locale]/(main)/session-provider.tsx b/apps/frontend/app/[locale]/(main)/session-provider.tsx index f538b76f2..0b55b6247 100644 --- a/apps/frontend/app/[locale]/(main)/session-provider.tsx +++ b/apps/frontend/app/[locale]/(main)/session-provider.tsx @@ -16,7 +16,7 @@ export const SessionProvider = ({ children, data }: Props) => { value={{ session: data?.core_sessions__authorization.user, nav: data?.core_nav__show.edges ?? [], - files: data?.core_sessions__authorization.files + files: data?.core_sessions__authorization.files, }} > {children} diff --git a/apps/frontend/app/[locale]/(utils)/admin/theme-editor/page.tsx b/apps/frontend/app/[locale]/(utils)/admin/theme-editor/page.tsx index 461834f54..08a0754f2 100644 --- a/apps/frontend/app/[locale]/(utils)/admin/theme-editor/page.tsx +++ b/apps/frontend/app/[locale]/(utils)/admin/theme-editor/page.tsx @@ -1,7 +1,7 @@ import { Core_Theme_Editor__Show, Core_Theme_Editor__ShowQuery, - Core_Theme_Editor__ShowQueryVariables + Core_Theme_Editor__ShowQueryVariables, } from "@/graphql/hooks"; import { fetcher } from "@/graphql/fetcher"; import { ThemeEditorView } from "@/plugins/admin/views/theme_editor/theme-editor-view"; @@ -13,7 +13,7 @@ const getData = async () => { Core_Theme_Editor__ShowQuery, Core_Theme_Editor__ShowQueryVariables >({ - query: Core_Theme_Editor__Show + query: Core_Theme_Editor__Show, }); return data; @@ -22,7 +22,7 @@ const getData = async () => { export default async function Page() { const [data, session] = await Promise.all([ getData(), - await getSessionData() + await getSessionData(), ]); if (!session.data.core_sessions__authorization.user?.is_admin) { diff --git a/apps/frontend/app/[locale]/catch.tsx b/apps/frontend/app/[locale]/catch.tsx index d4d79fbac..c131a9a18 100644 --- a/apps/frontend/app/[locale]/catch.tsx +++ b/apps/frontend/app/[locale]/catch.tsx @@ -9,7 +9,7 @@ import { InternalErrorView } from "@/plugins/admin/global/internal-error/interna const inter = Inter({ subsets: ["latin"], display: "swap", - variable: "--font-inter" + variable: "--font-inter", }); interface Props { @@ -23,16 +23,19 @@ export const CatchLayout = async ({ defaultPlugins, locale }: Props) => { try { return { ...(await import(`../../plugins/${plugin.code}/langs/${locale}.json`)) - .default + .default, }; } catch (e) { return {}; } - }) + }), ); const messages: AbstractIntlMessages = { - ...messagesFormApps.reduce((acc, messages) => ({ ...acc, ...messages }), {}) + ...messagesFormApps.reduce( + (acc, messages) => ({ ...acc, ...messages }), + {}, + ), }; const config = await getConfigFile(); diff --git a/apps/frontend/app/[locale]/layout.tsx b/apps/frontend/app/[locale]/layout.tsx index 93df140e4..44a71d84c 100644 --- a/apps/frontend/app/[locale]/layout.tsx +++ b/apps/frontend/app/[locale]/layout.tsx @@ -10,7 +10,7 @@ import { Providers } from "./providers"; import { Core_Middleware, Core_MiddlewareQuery, - Core_MiddlewareQueryVariables + Core_MiddlewareQueryVariables, } from "@/graphql/hooks"; import { CatchLayout } from "./catch"; import { getConfigFile } from "@/config/helpers"; @@ -24,7 +24,7 @@ const getData = async () => { Core_MiddlewareQueryVariables >({ query: Core_Middleware, - cache: "force-cache" + cache: "force-cache", }); return data; @@ -37,13 +37,13 @@ interface Props { export function generateMetadata({ params: { locale } }: Props): Metadata { return { - manifest: `${CONFIG.backend_public_url}/assets/${locale}/manifest.webmanifest` + manifest: `${CONFIG.backend_public_url}/assets/${locale}/manifest.webmanifest`, }; } export default async function LocaleLayout({ children, - params: { locale } + params: { locale }, }: Props) { const defaultPlugins = [{ code: "core" }, { code: "admin" }]; @@ -59,19 +59,19 @@ export default async function LocaleLayout({ return { ...( await import(`../../plugins/${plugin.code}/langs/${locale}.json`) - ).default + ).default, }; } catch (e) { return {}; } - }) + }), ); const messages: AbstractIntlMessages = { ...messagesFormApps.reduce( (acc, messages) => ({ ...acc, ...messages }), - {} - ) + {}, + ), }; return ( diff --git a/apps/frontend/app/[locale]/providers.tsx b/apps/frontend/app/[locale]/providers.tsx index ecbabdbfe..6bc8a404e 100644 --- a/apps/frontend/app/[locale]/providers.tsx +++ b/apps/frontend/app/[locale]/providers.tsx @@ -23,10 +23,10 @@ export const Providers = ({ children, config, data }: Props) => { defaultOptions: { queries: { refetchOnWindowFocus: false, - refetchOnMount: false - } - } - }) + refetchOnMount: false, + }, + }, + }), ); return ( @@ -38,7 +38,7 @@ export const Providers = ({ children, config, data }: Props) => { defaultLanguage: data?.core_languages__show.edges.find(lang => lang.default)?.code ?? "en", - config + config, }} > { return { title: { default: defaultTitle, - template: `%s - ${defaultTitle}` + template: `%s - ${defaultTitle}`, }, icons: { - icon: "/icons/favicon.ico" - } + icon: "/icons/favicon.ico", + }, }; } diff --git a/apps/frontend/app/robots.ts b/apps/frontend/app/robots.ts index bae7ed46d..ba284b9fe 100644 --- a/apps/frontend/app/robots.ts +++ b/apps/frontend/app/robots.ts @@ -7,8 +7,8 @@ export default function robots(): MetadataRoute.Robots { rules: { userAgent: "*", allow: "/", - disallow: "/private/" + disallow: "/private/", }, - sitemap: `${CONFIG.frontend_url}/sitemap.xml` + sitemap: `${CONFIG.frontend_url}/sitemap.xml`, }; } diff --git a/apps/frontend/app/sitemap.ts b/apps/frontend/app/sitemap.ts index 8514a082e..62d1cd14c 100644 --- a/apps/frontend/app/sitemap.ts +++ b/apps/frontend/app/sitemap.ts @@ -6,7 +6,7 @@ import { getSessionData } from "@/graphql/get-session-data"; const generateAlternateLanguagesForSitemap = ({ frontendUrl, languages, - slug + slug, }: { frontendUrl: string; languages: { code: string }[]; @@ -23,8 +23,8 @@ export default async function sitemap(): Promise { const { data: { core_languages__show: { edges: languages }, - core_plugins__show - } + core_plugins__show, + }, } = await getSessionData(); const plugins = core_plugins__show.filter(item => item.allow_default); @@ -36,9 +36,9 @@ export default async function sitemap(): Promise { languages: generateAlternateLanguagesForSitemap({ languages, frontendUrl: CONFIG.frontend_url, - slug: () => `/${plugin.code}` - }) - } + slug: () => `/${plugin.code}`, + }), + }, }; }); @@ -49,10 +49,10 @@ export default async function sitemap(): Promise { alternates: { languages: generateAlternateLanguagesForSitemap({ languages, - frontendUrl: CONFIG.frontend_url - }) - } + frontendUrl: CONFIG.frontend_url, + }), + }, }, - ...data + ...data, ]; } diff --git a/apps/frontend/components/calendar-picker.tsx b/apps/frontend/components/calendar-picker.tsx index dc0ebf78a..c1ef432b6 100644 --- a/apps/frontend/components/calendar-picker.tsx +++ b/apps/frontend/components/calendar-picker.tsx @@ -24,7 +24,7 @@ export const CalendarPicker = ({ onSelect, selected }: Props) => { variant={"outline"} className={cn( "w-full justify-start text-left font-normal", - !selected && "text-muted-foreground" + !selected && "text-muted-foreground", )} > diff --git a/apps/frontend/components/color/color-input.tsx b/apps/frontend/components/color/color-input.tsx index cee95e956..74ff739a9 100644 --- a/apps/frontend/components/color/color-input.tsx +++ b/apps/frontend/components/color/color-input.tsx @@ -28,7 +28,7 @@ export const ColorInput = ({ const t = useTranslations("core.colors"); const [open, setOpen] = React.useState(false); const [color, setColor] = React.useState( - getHSLFromString(value) + getHSLFromString(value), ); // Set color from value @@ -46,19 +46,19 @@ export const ColorInput = ({ variant="outline" className={cn("max-w-52 flex-1 justify-start", { "text-black": color && colorBrightness, - "text-white": color && !colorBrightness + "text-white": color && !colorBrightness, })} style={{ backgroundColor: color ? `hsl(${color.h}, ${color.s}%, ${color.l}%)` - : "" + : "", }} disabled={disabled} {...rest} > {color ? `hsl(${color.h}, ${color.s}%, ${color.l}%)` : t("none")} diff --git a/apps/frontend/components/color/picker/picker.tsx b/apps/frontend/components/color/picker/picker.tsx index 8529bfcfb..7c16807e7 100644 --- a/apps/frontend/components/color/picker/picker.tsx +++ b/apps/frontend/components/color/picker/picker.tsx @@ -6,7 +6,7 @@ import { useTranslations } from "next-intl"; import { checkColorType, convertColor, - isColorBrightness + isColorBrightness, } from "@vitnode/shared"; import { cn } from "@vitnode/frontend/helpers"; @@ -16,7 +16,7 @@ import { Tooltip, TooltipContent, TooltipProvider, - TooltipTrigger + TooltipTrigger, } from "@/components/ui/tooltip"; const presetColors: { color: HslColor; name: string }[] = [ @@ -25,97 +25,97 @@ const presetColors: { color: HslColor; name: string }[] = [ color: { h: 0, s: 80, - l: 45 - } + l: 45, + }, }, { name: "Orange", color: { h: 30, s: 80, - l: 45 - } + l: 45, + }, }, { name: "Yellow", color: { h: 60, s: 80, - l: 45 - } + l: 45, + }, }, { name: "Lime", color: { h: 150, s: 80, - l: 45 - } + l: 45, + }, }, { name: "Green", color: { h: 150, s: 80, - l: 45 - } + l: 45, + }, }, { name: "Teal", color: { h: 180, s: 80, - l: 45 - } + l: 45, + }, }, { name: "Cyan", color: { h: 210, s: 80, - l: 45 - } + l: 45, + }, }, { name: "Blue", color: { h: 240, s: 80, - l: 45 - } + l: 45, + }, }, { name: "Indigo", color: { h: 270, s: 80, - l: 45 - } + l: 45, + }, }, { name: "Purple", color: { h: 300, s: 80, - l: 45 - } + l: 45, + }, }, { name: "Magenta", color: { h: 330, s: 80, - l: 45 - } + l: 45, + }, }, { name: "Primary", color: { h: 221.2, s: 83.2, - l: 53.3 - } - } + l: 53.3, + }, + }, ]; interface Props { @@ -127,7 +127,7 @@ interface Props { export const PickerColor = ({ color, disableRemoveColor, setColor }: Props) => { const t = useTranslations("core.colors"); const [internalColor, setInternalColor] = React.useState( - color + color, ); const inputRef = React.useRef(null); const colorBrightness = internalColor @@ -179,7 +179,7 @@ export const PickerColor = ({ color, disableRemoveColor, setColor }: Props) => { internalColor ?? { h: 0, s: 0, - l: 0 + l: 0, } } onChange={color => { @@ -197,7 +197,7 @@ export const PickerColor = ({ color, disableRemoveColor, setColor }: Props) => { type="text" className={cn("h-9", { "text-black": internalColor && colorBrightness, - "text-white": internalColor && !colorBrightness + "text-white": internalColor && !colorBrightness, })} ref={inputRef} defaultValue={ @@ -208,7 +208,7 @@ export const PickerColor = ({ color, disableRemoveColor, setColor }: Props) => { style={{ backgroundColor: internalColor ? `hsl(${internalColor.h}, ${internalColor.s}%, ${internalColor.l}%)` - : "" + : "", }} onChange={e => handleInput(e.target.value)} /> @@ -247,7 +247,7 @@ export const PickerColor = ({ color, disableRemoveColor, setColor }: Props) => { key={name} className="size-7 rounded-sm border" style={{ - backgroundColor: `hsl(${color.h}, ${color.s}%, ${color.l}%)` + backgroundColor: `hsl(${color.h}, ${color.s}%, ${color.l}%)`, }} onClick={() => { setColor(color); diff --git a/apps/frontend/components/data-table/data-table.tsx b/apps/frontend/components/data-table/data-table.tsx index c5a4668a4..7103737a4 100644 --- a/apps/frontend/components/data-table/data-table.tsx +++ b/apps/frontend/components/data-table/data-table.tsx @@ -6,7 +6,7 @@ import { getCoreRowModel, useReactTable, ColumnDef, - SortingState + SortingState, } from "@tanstack/react-table"; import { useTranslations } from "next-intl"; import { useSearchParams } from "next/navigation"; @@ -19,7 +19,7 @@ import { TableCell, TableHead, TableHeader, - TableRow + TableRow, } from "@/components/ui/table"; import { Button } from "../ui/button"; import { PageInfo } from "@/graphql/hooks"; @@ -28,7 +28,7 @@ import { SelectContent, SelectItem, SelectTrigger, - SelectValue + SelectValue, } from "../ui/select"; import { ToolbarDataTable, ToolbarDataTableProps } from "./toolbar/toolbar"; import { SkeletonDataTable } from "./skeleton"; @@ -36,7 +36,7 @@ import { Tooltip, TooltipContent, TooltipProvider, - TooltipTrigger + TooltipTrigger, } from "../ui/tooltip"; interface TDataMin { @@ -70,7 +70,7 @@ export function DataTable({ const pagination = { first: searchParams.get("first"), last: searchParams.get("last"), - cursor: searchParams.get("cursor") + cursor: searchParams.get("cursor"), }; const table = useReactTable({ @@ -94,11 +94,11 @@ export function DataTable({ ? [ { id: defaultSorting.sortBy.toString(), - desc: defaultSorting.sortDirection === "desc" - } + desc: defaultSorting.sortDirection === "desc", + }, ] - : [] - } + : [], + }, }); const enablePageSize = [10, 20, 30, 40, 50]; @@ -134,7 +134,7 @@ export function DataTable({ ? null : flexRender( header.column.columnDef.header, - header.getContext() + header.getContext(), )} ); @@ -155,13 +155,13 @@ export function DataTable({
{flexRender( cell.column.columnDef.cell, - cell.getContext() + cell.getContext(), )}
) : ( flexRender( cell.column.columnDef.cell, - cell.getContext() + cell.getContext(), ) )} @@ -195,7 +195,7 @@ export function DataTable({ value={`${pageSizeValue}`} onValueChange={value => { const params = new URLSearchParams( - searchParams.toString() + searchParams.toString(), ); if (params.has("last")) { params.set("last", value); @@ -205,7 +205,7 @@ export function DataTable({ params.delete("last"); } push(`${pathname}?${params.toString()}`, { - scroll: false + scroll: false, }); }} > @@ -237,13 +237,13 @@ export function DataTable({ if (!pageInfo.startCursor) return; const params = new URLSearchParams( - searchParams.toString() + searchParams.toString(), ); params.set("cursor", `${pageInfo.startCursor}`); params.set("last", `${pageSizeValue}`); params.delete("first"); push(`${pathname}?${params.toString()}`, { - scroll: false + scroll: false, }); }} > @@ -258,13 +258,13 @@ export function DataTable({ if (!pageInfo.endCursor) return; const params = new URLSearchParams( - searchParams.toString() + searchParams.toString(), ); params.set("cursor", `${pageInfo.endCursor}`); params.set("first", `${pageSizeValue}`); params.delete("last"); push(`${pathname}?${params.toString()}`, { - scroll: false + scroll: false, }); }} > diff --git a/apps/frontend/components/data-table/header.tsx b/apps/frontend/components/data-table/header.tsx index 637deeca0..0b71aa011 100644 --- a/apps/frontend/components/data-table/header.tsx +++ b/apps/frontend/components/data-table/header.tsx @@ -13,7 +13,7 @@ interface Props extends HeaderContext { export function HeaderSortingDataTable({ children, column, - table + table, }: Props) { const searchParams = useSearchParams(); const pathname = usePathname(); diff --git a/apps/frontend/components/data-table/toolbar/advanced-filter/advanced-filter-toolbar-data-table.tsx b/apps/frontend/components/data-table/toolbar/advanced-filter/advanced-filter-toolbar-data-table.tsx index 36be1cb87..92c20eb61 100644 --- a/apps/frontend/components/data-table/toolbar/advanced-filter/advanced-filter-toolbar-data-table.tsx +++ b/apps/frontend/components/data-table/toolbar/advanced-filter/advanced-filter-toolbar-data-table.tsx @@ -8,7 +8,7 @@ import { SheetContent, SheetHeader, SheetTitle, - SheetTrigger + SheetTrigger, } from "../../../ui/sheet"; import { Loader } from "../../../loader"; diff --git a/apps/frontend/components/data-table/toolbar/filter/content/content.tsx b/apps/frontend/components/data-table/toolbar/filter/content/content.tsx index 5534b8eab..4ca81ad1a 100644 --- a/apps/frontend/components/data-table/toolbar/filter/content/content.tsx +++ b/apps/frontend/components/data-table/toolbar/filter/content/content.tsx @@ -15,7 +15,7 @@ import { CommandItem, CommandList, CommandSeparator, - commandInputClassName + commandInputClassName, } from "@/components/ui/command"; import { ListContentFilterToolbarDataTable } from "./list"; import { useFilterToolbarDataTable } from "../hooks/use-filter-toolbar-data-table"; @@ -56,7 +56,7 @@ export const ContentFilterToolbarDataTable = ({ onChange={e => handleSearchInput(e.target.value)} className={cn( commandInputClassName, - "border-0 px-0 focus-visible:ring-0 focus-visible:ring-offset-0" + "border-0 px-0 focus-visible:ring-0 focus-visible:ring-offset-0", )} placeholder={title} /> diff --git a/apps/frontend/components/data-table/toolbar/filter/content/list.tsx b/apps/frontend/components/data-table/toolbar/filter/content/list.tsx index 411e31c2a..163363f68 100644 --- a/apps/frontend/components/data-table/toolbar/filter/content/list.tsx +++ b/apps/frontend/components/data-table/toolbar/filter/content/list.tsx @@ -11,7 +11,7 @@ import { useFilterToolbarDataTable } from "../hooks/use-filter-toolbar-data-tabl export const ListContentFilterToolbarDataTable = ({ isFetching, - options + options, }: Pick) => { const t = useTranslations("core"); const { id } = useFilterToolbarDataTable(); @@ -51,7 +51,7 @@ export const ListContentFilterToolbarDataTable = ({ "border-primary mr-2 flex h-4 w-4 items-center justify-center rounded-sm border", isSelected ? "bg-primary text-primary-foreground" - : "opacity-50 [&_svg]:invisible" + : "opacity-50 [&_svg]:invisible", )} > diff --git a/apps/frontend/components/data-table/toolbar/filter/filter.tsx b/apps/frontend/components/data-table/toolbar/filter/filter.tsx index 00d932eb4..36891de7f 100644 --- a/apps/frontend/components/data-table/toolbar/filter/filter.tsx +++ b/apps/frontend/components/data-table/toolbar/filter/filter.tsx @@ -5,7 +5,7 @@ import { useSearchParams } from "next/navigation"; import { Popover, PopoverContent, - PopoverTrigger + PopoverTrigger, } from "@/components/ui/popover"; import { Button } from "@/components/ui/button"; import { Separator } from "@/components/ui/separator"; @@ -22,7 +22,7 @@ export interface FilterToolbarDataTableProps { export function FilterToolbarDataTable({ children, id, - title + title, }: FilterToolbarDataTableProps) { const searchParams = useSearchParams(); const selectedValues = searchParams.getAll(id); diff --git a/apps/frontend/components/data-table/toolbar/filter/hooks/use-filter-toolbar-data-table.ts b/apps/frontend/components/data-table/toolbar/filter/hooks/use-filter-toolbar-data-table.ts index acf87fc96..eceaafb6f 100644 --- a/apps/frontend/components/data-table/toolbar/filter/hooks/use-filter-toolbar-data-table.ts +++ b/apps/frontend/components/data-table/toolbar/filter/hooks/use-filter-toolbar-data-table.ts @@ -7,7 +7,7 @@ interface Args { export const FilterToolbarDataTableContext = React.createContext({ id: "", - title: "" + title: "", }); export const useFilterToolbarDataTable = () => diff --git a/apps/frontend/components/data-table/toolbar/search.tsx b/apps/frontend/components/data-table/toolbar/search.tsx index 00aa56d6e..50bf867e1 100644 --- a/apps/frontend/components/data-table/toolbar/search.tsx +++ b/apps/frontend/components/data-table/toolbar/search.tsx @@ -12,7 +12,7 @@ interface Props { export const SearchToolbarDataTable = ({ searchPlaceholder, - startTransition + startTransition, }: Props) => { const searchParams = useSearchParams(); const pathname = usePathname(); @@ -36,7 +36,7 @@ export const SearchToolbarDataTable = ({ startTransition(() => { push(params.toString() ? `${pathname}?${params.toString()}` : pathname, { - scroll: false + scroll: false, }); }); }, 500); diff --git a/apps/frontend/components/data-table/toolbar/toolbar.tsx b/apps/frontend/components/data-table/toolbar/toolbar.tsx index 3b0a1ae9e..5fda762d2 100644 --- a/apps/frontend/components/data-table/toolbar/toolbar.tsx +++ b/apps/frontend/components/data-table/toolbar/toolbar.tsx @@ -14,7 +14,7 @@ export const ToolbarDataTable = ({ advancedFilters, filters, searchPlaceholder, - startTransition + startTransition, }: ToolbarDataTableProps) => { if (!searchPlaceholder && filters && filters && advancedFilters) return null; diff --git a/apps/frontend/components/date-format/date-format.tsx b/apps/frontend/components/date-format/date-format.tsx index aba54a071..b043bd10b 100644 --- a/apps/frontend/components/date-format/date-format.tsx +++ b/apps/frontend/components/date-format/date-format.tsx @@ -6,7 +6,7 @@ import { Tooltip, TooltipContent, TooltipProvider, - TooltipTrigger + TooltipTrigger, } from "../ui/tooltip"; import { useDateFormat } from "./hooks/use-date-format"; @@ -19,7 +19,7 @@ interface Props { export const DateFormat = ({ className, date, ref, showFullDate }: Props) => { const { currentTime, fullDate, getDateWithFormatDistance } = useDateFormat({ - date + date, }); if (currentTime.getFullYear() == new Date().getFullYear() && !showFullDate) { diff --git a/apps/frontend/components/date-format/hooks/use-date-format.ts b/apps/frontend/components/date-format/hooks/use-date-format.ts index 9a520527e..9bd29c210 100644 --- a/apps/frontend/components/date-format/hooks/use-date-format.ts +++ b/apps/frontend/components/date-format/hooks/use-date-format.ts @@ -12,20 +12,20 @@ export const useDateFormat = ({ date }: Args) => { const currentLocale = useLocale(); const { languages } = useGlobals(); const currentLanguage = languages.find( - language => language.code === currentLocale + language => language.code === currentLocale, ); const currentTime = new Date(date); const relative = Math.floor( - (new Date().getTime() - currentTime.getTime()) / 1000 + (new Date().getTime() - currentTime.getTime()) / 1000, ); const getDateFormat = (dateFormat: string) => { const locale = currentLanguage?.locale || "enUS"; return format(currentTime, dateFormat, { - locale: localeDate[locale as keyof typeof localeDate] + locale: localeDate[locale as keyof typeof localeDate], }); }; @@ -38,20 +38,20 @@ export const useDateFormat = ({ date }: Args) => { return formatDistance(currentTime, new Date(), { addSuffix: true, - locale: localeDate[locale as keyof typeof localeDate] + locale: localeDate[locale as keyof typeof localeDate], }); } // When date is < 7 days if (relative < 604800) { return getDateFormat( - currentLanguage?.time_24 ? "EEEE, H:mm" : "EEEE, H:mm a" + currentLanguage?.time_24 ? "EEEE, H:mm" : "EEEE, H:mm a", ); } // When date is < 1 year return getDateFormat( - currentLanguage?.time_24 ? "d MMMM, H:mm" : "MMMM d, H:mm a" + currentLanguage?.time_24 ? "d MMMM, H:mm" : "MMMM d, H:mm a", ); }; @@ -60,6 +60,6 @@ export const useDateFormat = ({ date }: Args) => { getDateWithFormatDistance, currentTime, getDateFormat, - currentLanguage + currentLanguage, }; }; diff --git a/apps/frontend/components/editor/editor.tsx b/apps/frontend/components/editor/editor.tsx index eb4ba4692..9338aae7a 100644 --- a/apps/frontend/components/editor/editor.tsx +++ b/apps/frontend/components/editor/editor.tsx @@ -14,7 +14,7 @@ import { EmojiExtensionEditor } from "./extensions/emoji/emoji"; import { Skeleton } from "../ui/skeleton"; import { useUploadFilesHandlerEditor, - UploadFilesHandlerEditorArgs + UploadFilesHandlerEditorArgs, } from "./extensions/files/hooks/use-upload-files-handler-editor.ts"; import { EditorStateContext } from "./hooks/use-editor-state"; @@ -45,31 +45,31 @@ export const Editor = ({ className, disableLanguage, onChange, - value + value, }: WithLanguage | WithoutLanguage) => { const { files, setFiles, uploadFiles } = useUploadFilesHandlerEditor({ value, - allowUploadFiles + allowUploadFiles, }); const locale = useLocale(); const { defaultLanguage } = useGlobals(); const [selectedLanguage, setSelectedLanguage] = React.useState( - locale ?? defaultLanguage + locale ?? defaultLanguage, ); const editor = useEditor({ autofocus: autoFocus, extensions: [ ...extensionsEditor({ - uploadFiles + uploadFiles, }), - EmojiExtensionEditor + EmojiExtensionEditor, ], editorProps: { attributes: { class: cn( - "bg-card min-h-32 resize-y overflow-auto p-4 focus:outline-none [&>*:not(:last-child)]:mb-[0.5rem]" - ) - } + "bg-card min-h-32 resize-y overflow-auto p-4 focus:outline-none [&>*:not(:last-child)]:mb-[0.5rem]", + ), + }, }, content: (() => { const current = Array.isArray(value) @@ -95,7 +95,7 @@ export const Editor = ({ // Remove form the array if content is empty if (editor.isEmpty) { onChange( - currentValue.filter(v => v.language_code !== selectedLanguage) + currentValue.filter(v => v.language_code !== selectedLanguage), ); return; @@ -103,9 +103,9 @@ export const Editor = ({ onChange([ ...currentValue.filter(v => v.language_code !== selectedLanguage), - { language_code: selectedLanguage, value: content } + { language_code: selectedLanguage, value: content }, ]); - } + }, }); // Toggle the editor content when the selected language changes @@ -135,7 +135,7 @@ export const Editor = ({ value, onChange: onChange as (value: TextLanguage[] | string) => void, selectedLanguage, - setFiles + setFiles, }} >
diff --git a/apps/frontend/components/editor/extensions/code/code.tsx b/apps/frontend/components/editor/extensions/code/code.tsx index a8f50ad3c..8114c98dd 100644 --- a/apps/frontend/components/editor/extensions/code/code.tsx +++ b/apps/frontend/components/editor/extensions/code/code.tsx @@ -18,16 +18,16 @@ export const classNameCodeBlock = cn( "[&_.hljs-bullet]:text-yellow-700 dark:[&_.hljs-bullet]:text-yellow-500 [&_.hljs-name]:text-yellow-700 dark:[&_.hljs-name]:text-yellow-500 [&_.hljs-operator]:text-yellow-700 dark:[&_.hljs-operator]:text-yellow-500 [&_.hljs-punctuation]:text-yellow-700 dark:[&_.hljs-punctuation]:text-yellow-500 [&_.hljs-type]:text-yellow-700 dark:[&_.hljs-type]:text-yellow-500", "[&_.hljs-attribute]:text-orange-700 dark:[&_.hljs-attribute]:text-orange-500 [&_.hljs-selector-class]:text-orange-700 dark:[&_.hljs-selector-class]:text-orange-500 [&_.hljs-selector-tag]:text-orange-700 dark:[&_.hljs-selector-tag]:text-orange-500", "[&_.hljs-comment]:text-muted-foreground", - "[&_.hljs-regexp]:text-rose-600" + "[&_.hljs-regexp]:text-rose-600", ); export const CodeBlockLowlightExtensionEditor = CodeBlockLowlight.extend({ addNodeView() { return renderReactNode(); - } + }, }).configure({ lowlight: lowlight, - languageClassPrefix: "language-" + languageClassPrefix: "language-", }); // import { NodeViewWrapper } from "@tiptap/react"; diff --git a/apps/frontend/components/editor/extensions/emoji/client.tsx b/apps/frontend/components/editor/extensions/emoji/client.tsx index a3d4c3f23..8acc0b2fe 100644 --- a/apps/frontend/components/editor/extensions/emoji/client.tsx +++ b/apps/frontend/components/editor/extensions/emoji/client.tsx @@ -13,13 +13,13 @@ import { Button } from "@/components/ui/button"; import { ComponentListRef, SuggestionKeyDownProps, - SuggestionProps + SuggestionProps, } from "../mentions/client"; const ComponentList = ({ command, items, - ref + ref, }: { command: (_props: { id: string }) => void; items: Emoji[]; @@ -28,7 +28,7 @@ const ComponentList = ({ const t = useTranslations("core"); const [selectedIndex, setSelectedIndex] = React.useState(0); const skinToneIndexLocalStorage = localStorage.getItem( - CONFIG.local_storage.editor_skin_tone + CONFIG.local_storage.editor_skin_tone, ); const skinToneIndex = skinToneIndexLocalStorage ? +skinToneIndexLocalStorage @@ -77,7 +77,7 @@ const ComponentList = ({ } return false; - } + }, })); return ( @@ -93,7 +93,7 @@ const ComponentList = ({