diff --git a/package.json b/package.json index 87c352711..2d73587f9 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "@nestjs/event-emitter": "^2.0.4", "@nestjs/platform-express": "^10.3.8", "@nestjs/schedule": "^4.0.2", - "@prisma/client": "5.11.0", + "@prisma/client": "5.16.2", "class-transformer": "^0.5.1", "class-validator": "^0.14.1", "discord-api-types": "^0.37.73", @@ -50,8 +50,9 @@ "lavalink-client": "^2.1.7", "moment": "^2.30.1", "necord": "^6.8.3", + "nestjs-prisma": "^0.23.0", "parse-ms": "=2.1.0", - "prisma": "^5.11.0", + "prisma": "^5.16.2", "reflect-metadata": "^0.2.1", "rxjs": "^7.8.1", "topgg-autoposter": "^2.0.2" diff --git a/src/lib/index.ts b/src/lib/index.ts index 6be654714..bf7c872f5 100644 --- a/src/lib/index.ts +++ b/src/lib/index.ts @@ -1,2 +1,4 @@ +export * from "./node-handler"; +export * from "./prisma-utils"; export * from "./sharding"; export * from "./top.gg-autoposter"; diff --git a/src/lib/node-handler.ts b/src/lib/node-handler.ts index 336a1aaaf..e26a9213f 100644 --- a/src/lib/node-handler.ts +++ b/src/lib/node-handler.ts @@ -3,10 +3,11 @@ import { Logger } from "@nestjs/common"; export function NodeHandler(): void { const logger = new Logger("NodeHandler"); process.on("uncaughtException", (error, origin) => { - logger.error("Uncaught Exception:", error, "Origin: ", origin); + logger.error(`Uncaught Exception: ${error} | Origin: ${origin}`); }); process.on("unhandledRejection", (reason, promise) => { - logger.error("Unhandled Rejection at:", promise, "reason:", reason); + logger.error(`Unhandled Rejection reason: ${reason} | at:`); + console.log(promise); }); } diff --git a/src/lib/prisma-utils.ts b/src/lib/prisma-utils.ts new file mode 100644 index 000000000..e5e7f6fc7 --- /dev/null +++ b/src/lib/prisma-utils.ts @@ -0,0 +1,10 @@ +import { HttpStatus } from "@nestjs/common"; +import { PrismaClientExceptionFilter } from "nestjs-prisma"; + +export const PrismaExceptionFilter = (httpAdapter) => { + return new PrismaClientExceptionFilter(httpAdapter, { + P2000: HttpStatus.BAD_REQUEST, + P2002: HttpStatus.CONFLICT, + P2025: HttpStatus.NOT_FOUND, + }); +}; diff --git a/src/lib/sharding.ts b/src/lib/sharding.ts index 90a6aa047..a76f94fcb 100644 --- a/src/lib/sharding.ts +++ b/src/lib/sharding.ts @@ -1,7 +1,7 @@ import path from "node:path"; import { Config } from "@/modules/config/types"; import { Logger } from "@nestjs/common"; -import type { ConfigService } from "@nestjs/config"; +import { ConfigService } from "@nestjs/config"; import { ShardingManager as _ShardingManager } from "discord.js"; export class ShardingManager extends _ShardingManager { diff --git a/src/main.ts b/src/main.ts index ab4e89be6..04f9c2a5c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -2,17 +2,19 @@ import { Logger } from "@nestjs/common"; import { ConfigService } from "@nestjs/config"; import { NestFactory } from "@nestjs/core"; import { AppModule } from "./app.module"; -import { ShardingManager, TopGGAutoPoster } from "./lib"; -import { NodeHandler } from "./lib/node-handler"; +import { NodeHandler, PrismaExceptionFilter, ShardingManager, TopGGAutoPoster } from "./lib"; async function bootstrap() { NodeHandler(); const app = await NestFactory.create(AppModule); const configService = app.get(ConfigService); + const httpAdapter = app.getHttpAdapter(); const logger = new Logger("Main"); const ShardManager = new ShardingManager(configService); const TopGGPoster = new TopGGAutoPoster(configService.getOrThrow("TopGGToken"), ShardManager); + app.useGlobalFilters(PrismaExceptionFilter(httpAdapter)); + try { await ShardManager.init(); await TopGGPoster.init(); diff --git a/src/modules/database/als/als.module.ts b/src/modules/database/als/als.module.ts deleted file mode 100644 index 82f7e9f94..000000000 --- a/src/modules/database/als/als.module.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { AsyncLocalStorage } from "node:async_hooks"; -import { Global, Module, Provider } from "@nestjs/common"; -import { Repositories } from "../types/constants"; -import { AlsService } from "./als.service"; -import { AlsStore } from "./types"; - -export const AlsProvider: Provider> = { - provide: Repositories.ALS, - useValue: new AsyncLocalStorage(), -}; - -@Global() -@Module({ - providers: [AlsService, AlsProvider], - exports: [AlsProvider], -}) -export class AlsModule {} diff --git a/src/modules/database/als/als.service.ts b/src/modules/database/als/als.service.ts deleted file mode 100644 index 352e93e37..000000000 --- a/src/modules/database/als/als.service.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { AsyncLocalStorage } from "node:async_hooks"; -import { Inject, Injectable, OnModuleInit } from "@nestjs/common"; -import { Repositories } from "../types/constants"; -import { AlsStore } from "./types"; - -@Injectable() -export class AlsService implements OnModuleInit { - public constructor(@Inject(Repositories.ALS) private readonly als: AsyncLocalStorage) {} - - public async onModuleInit() { - this.als.enterWith({ - PrismaConnected: false, - }); - } -} diff --git a/src/modules/database/als/interfaces/IAsyncLocalStorage.ts b/src/modules/database/als/interfaces/IAsyncLocalStorage.ts deleted file mode 100644 index b858dbb0d..000000000 --- a/src/modules/database/als/interfaces/IAsyncLocalStorage.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { AsyncLocalStorage } from "node:async_hooks"; -import type { AlsStore } from "../types"; - -export interface IAsyncLocalStorage extends AsyncLocalStorage {} diff --git a/src/modules/database/als/types/index.ts b/src/modules/database/als/types/index.ts deleted file mode 100644 index 349eecbbc..000000000 --- a/src/modules/database/als/types/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface AlsStore { - PrismaConnected: boolean; -} diff --git a/src/modules/database/database.module.ts b/src/modules/database/database.module.ts index d1578e258..37a02f5dd 100644 --- a/src/modules/database/database.module.ts +++ b/src/modules/database/database.module.ts @@ -1,8 +1,7 @@ import { Services } from "@/types/Constants"; import { Global, Module, Provider } from "@nestjs/common"; -import { AlsModule } from "./als/als.module"; +import { PrismaModule } from "nestjs-prisma"; import { DatabaseService } from "./database.service"; -import { PrismaModule } from "./prisma/Prisma.module"; import { RepositoriesModule } from "./repositories/Repositories.module"; const provider: Provider = { @@ -12,7 +11,18 @@ const provider: Provider = { @Global() @Module({ - imports: [AlsModule, RepositoriesModule, PrismaModule], + imports: [ + PrismaModule.forRootAsync({ + isGlobal: true, + useFactory: () => ({ + prismaOptions: { + log: ["info"], + }, + explicitConnect: false, + }), + }), + RepositoriesModule, + ], providers: [provider], exports: [provider], }) diff --git a/src/modules/database/database.service.ts b/src/modules/database/database.service.ts index 9bf727ff9..fcee049b1 100644 --- a/src/modules/database/database.service.ts +++ b/src/modules/database/database.service.ts @@ -1,7 +1,6 @@ import type { IReactionRolesRepository } from "@/modules/reactionRoles/interfaces/IReactionRoleRepository"; import { ReactionRoles } from "@/modules/reactionRoles/types/constants"; import { Inject, Injectable } from "@nestjs/common"; -import type { IAsyncLocalStorage } from "./als/interfaces/IAsyncLocalStorage"; import type { IDatabaseService } from "./interfaces/IDatabaseService"; import type { IGuildRepository, IUserRepository } from "./repositories/interfaces"; import { Repositories } from "./types/constants"; @@ -9,16 +8,11 @@ import { Repositories } from "./types/constants"; @Injectable() export class DatabaseService implements IDatabaseService { public constructor( - @Inject(Repositories.ALS) private readonly als: IAsyncLocalStorage, @Inject(Repositories.Guild) private readonly guild: IGuildRepository, @Inject(Repositories.User) private readonly user: IUserRepository, @Inject(ReactionRoles.Repository) private readonly reactionRoles: IReactionRolesRepository, ) {} - public AlsRepo(): IAsyncLocalStorage { - return this.als; - } - public GuildRepo(): IGuildRepository { return this.guild; } diff --git a/src/modules/database/interfaces/IDatabaseService.ts b/src/modules/database/interfaces/IDatabaseService.ts index 64981dd9a..7489cf995 100644 --- a/src/modules/database/interfaces/IDatabaseService.ts +++ b/src/modules/database/interfaces/IDatabaseService.ts @@ -1,10 +1,8 @@ import type { IReactionRolesRepository } from "@/modules/reactionRoles/interfaces"; -import type { IAsyncLocalStorage } from "../als/interfaces/IAsyncLocalStorage"; import type { IGuildRepository } from "../repositories/interfaces/IGuildRepository"; import type { IUserRepository } from "../repositories/interfaces/IUserRepository"; export interface IDatabaseService { - AlsRepo(): IAsyncLocalStorage; GuildRepo(): IGuildRepository; UserRepo(): IUserRepository; ReactionRolesRepo(): IReactionRolesRepository; diff --git a/src/modules/database/prisma/Prisma.module.ts b/src/modules/database/prisma/Prisma.module.ts deleted file mode 100644 index f4947d74a..000000000 --- a/src/modules/database/prisma/Prisma.module.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Services } from "@/types/Constants"; -import { Global, Module, Provider } from "@nestjs/common"; -import { PrismaService } from "./Prisma.service"; - -const provider: Provider = { - provide: Services.Prisma, - useClass: PrismaService, -}; - -@Global() -@Module({ - providers: [provider], - exports: [provider], -}) -export class PrismaModule {} diff --git a/src/modules/database/prisma/Prisma.service.ts b/src/modules/database/prisma/Prisma.service.ts deleted file mode 100644 index 64b380e3b..000000000 --- a/src/modules/database/prisma/Prisma.service.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { AsyncLocalStorage } from "node:async_hooks"; -import { Inject, Injectable, Logger, OnApplicationShutdown, OnModuleInit } from "@nestjs/common"; -import { PrismaClient } from "@prisma/client"; -import { AlsStore } from "../als/types"; -import { Repositories } from "../types/constants"; - -@Injectable() -export class PrismaService extends PrismaClient implements OnModuleInit, OnApplicationShutdown { - public constructor(@Inject(Repositories.ALS) private readonly als: AsyncLocalStorage) { - super(); - } - - private readonly logger = new Logger(PrismaService.name); - - public async onModuleInit() { - const state = this.als.getStore()["PrismaConnected"]; - if (!state) { - await this.$connect(); - this.logger.log("PostgreSQL connected via Prisma"); - this.als.getStore()["PrismaConnected"] = true; - } - } - - public async onApplicationShutdown(signal?: string) { - await this.$disconnect(); - this.logger.log(`PostgreSQL disconnected from Prisma reason: ${signal}`); - this.als.getStore()["PrismaConnected"] = false; - } -} diff --git a/src/modules/database/repositories/Guild.repository.ts b/src/modules/database/repositories/Guild.repository.ts index dd735693f..3769d8f46 100644 --- a/src/modules/database/repositories/Guild.repository.ts +++ b/src/modules/database/repositories/Guild.repository.ts @@ -1,22 +1,21 @@ -import { Services } from "@/types/Constants"; -import { Inject, Injectable, Logger } from "@nestjs/common"; +import { Injectable, Logger } from "@nestjs/common"; +import { Prisma } from "@prisma/client"; +import { DefaultArgs } from "@prisma/client/runtime/library"; import { Guild } from "discord.js"; +import { PrismaService } from "nestjs-prisma"; import { GuildEntity } from "../entities"; -import { PrismaService } from "../prisma/Prisma.service"; import { DatabaseStatus } from "../types"; import type { IGuildRepository } from "./interfaces"; -import { DefaultArgs } from "@prisma/client/runtime/library"; -import { Prisma } from "@prisma/client"; @Injectable() export class GuildRepository implements IGuildRepository { - public constructor(@Inject(Services.Prisma) private readonly prisma: PrismaService) {} + public constructor(private readonly prisma: PrismaService) {} private readonly logger = new Logger(GuildRepository.name); - public guildSettings(): Prisma.GuildSettingsDelegate { - return this.prisma.guildSettings - } + public guildSettings(): Prisma.GuildSettingsDelegate { + return this.prisma.guildSettings; + } public async get(guildId: string): Promise { return await this.prisma.guild.findUnique({ diff --git a/src/modules/database/repositories/User.repository.ts b/src/modules/database/repositories/User.repository.ts index d0f9b827b..e284ce427 100644 --- a/src/modules/database/repositories/User.repository.ts +++ b/src/modules/database/repositories/User.repository.ts @@ -1,21 +1,20 @@ -import { Services } from "@/types/Constants"; -import { Inject, Logger } from "@nestjs/common"; +import { Logger } from "@nestjs/common"; +import { Prisma } from "@prisma/client"; +import { DefaultArgs } from "@prisma/client/runtime/library"; import { User } from "discord.js"; +import { PrismaService } from "nestjs-prisma"; import { UserEntity } from "../entities"; -import { PrismaService } from "../prisma/Prisma.service"; import { DatabaseStatus } from "../types"; -import type { IUserRepository } from "./interfaces"; -import { Prisma } from "@prisma/client"; -import { DefaultArgs } from "@prisma/client/runtime/library"; +import { IUserRepository } from "./interfaces"; export class UserRepository implements IUserRepository { - public constructor(@Inject(Services.Prisma) private readonly prisma: PrismaService) {} - + public constructor(private readonly prisma: PrismaService) {} + private readonly logger = new Logger(UserRepository.name); - public userSettings(): Prisma.UserSettingsDelegate { - return this.prisma.userSettings - } + public userSettings(): Prisma.UserSettingsDelegate { + return this.prisma.userSettings; + } public async get(userId: string): Promise { return await this.prisma.user.findUnique({ @@ -27,14 +26,14 @@ export class UserRepository implements IUserRepository { }); } - public async getAll(): Promise { - return await this.prisma.user.findMany({ + public async getAll(): Promise { + return await this.prisma.user.findMany({ include: { - Settings: true, APIUser: true, + Settings: true, }, }); - } + } public async create(user: User): Promise<{ callback: UserEntity | void; status: DatabaseStatus }> { let status = DatabaseStatus.Created; diff --git a/src/modules/reactionRoles/ReactionRoles.repository.ts b/src/modules/reactionRoles/ReactionRoles.repository.ts index 5fbbafcd7..9e2faea35 100644 --- a/src/modules/reactionRoles/ReactionRoles.repository.ts +++ b/src/modules/reactionRoles/ReactionRoles.repository.ts @@ -1,14 +1,13 @@ -import type { PrismaService } from "@/modules/database/prisma/Prisma.service"; -import { Services } from "@/types/Constants"; -import { Inject, Injectable } from "@nestjs/common"; +import { Injectable } from "@nestjs/common"; import type { Guild, TextChannel } from "discord.js"; +import { PrismaService } from "nestjs-prisma"; import type { ReactionRolesEntity } from "./entities/ReactionRole.entity"; import type { IReactionRolesRepository } from "./interfaces/IReactionRoleRepository"; import type { IReaction, REACTION_OPTIONS } from "./types"; @Injectable() export class ReactionRolesRepository implements IReactionRolesRepository { - public constructor(@Inject(Services.Prisma) private readonly prisma: PrismaService) {} + public constructor(private readonly prisma: PrismaService) {} public async getAll(guild: Guild): Promise { return await this.prisma.guildReactionRoles.findMany({ @@ -30,18 +29,12 @@ export class ReactionRolesRepository implements IReactionRolesRepository { })[0]; } - public async getInChannel( - guild: Guild, - channel: TextChannel, - ): Promise { + public async getInChannel(guild: Guild, channel: TextChannel): Promise { const data = await this.getAll(guild); return data.filter(async (reaction) => reaction.Channel === channel.id); } - private async checkIfExists( - guild: Guild, - { Channel, Message, Role, Emoji, Option }: IReaction, - ): Promise { + private async checkIfExists(guild: Guild, { Channel, Message, Role, Emoji, Option }: IReaction): Promise { const GetGuild = await this.getAll(guild); let Verify = false; for (const reaction of GetGuild) { @@ -124,9 +117,7 @@ export class ReactionRolesRepository implements IReactionRolesRepository { return { status: "Deleted" }; } - public async deleteMany( - guild: Guild, - ): Promise<{ status: "UnableToDelete" | "Deleted"; count: number }> { + public async deleteMany(guild: Guild): Promise<{ status: "UnableToDelete" | "Deleted"; count: number }> { const count = await this.prisma.guildReactionRoles.count({ where: { guildId: guild.id }, }); diff --git a/src/types/Constants.ts b/src/types/Constants.ts index 5807d72c8..e2ae5d11c 100644 --- a/src/types/Constants.ts +++ b/src/types/Constants.ts @@ -5,7 +5,6 @@ export const isInProduction = false; export enum Services { NDB = "NDB_SERVICE", - Prisma = "PRISMA_SERVICE", Database = "DATABASE_SERVICE", User = "USER_SERVICE", Auth = "AUTH_SERVICE", diff --git a/yarn.lock b/yarn.lock index e34fb904a..1f0b17da0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15,6 +15,25 @@ __metadata: languageName: node linkType: hard +"@angular-devkit/core@npm:13.3.11, @angular-devkit/core@npm:^13.3.0": + version: 13.3.11 + resolution: "@angular-devkit/core@npm:13.3.11" + dependencies: + ajv: "npm:8.9.0" + ajv-formats: "npm:2.1.1" + fast-json-stable-stringify: "npm:2.1.0" + magic-string: "npm:0.25.7" + rxjs: "npm:6.6.7" + source-map: "npm:0.7.3" + peerDependencies: + chokidar: ^3.5.2 + peerDependenciesMeta: + chokidar: + optional: true + checksum: 10c0/4ad3c49eb707cf828ec8c5a433a15d41da4e10db875178f88ff24747caf317ecd2aad8b5faf38e95077b7a0c86355a8378959c1bd60e45c63dd09c028849f1bd + languageName: node + linkType: hard + "@angular-devkit/core@npm:17.1.2": version: 17.1.2 resolution: "@angular-devkit/core@npm:17.1.2" @@ -50,6 +69,19 @@ __metadata: languageName: node linkType: hard +"@angular-devkit/schematics@npm:13.3.11, @angular-devkit/schematics@npm:^13.3.0": + version: 13.3.11 + resolution: "@angular-devkit/schematics@npm:13.3.11" + dependencies: + "@angular-devkit/core": "npm:13.3.11" + jsonc-parser: "npm:3.0.0" + magic-string: "npm:0.25.7" + ora: "npm:5.4.1" + rxjs: "npm:6.6.7" + checksum: 10c0/7eaecf427363fdd31e26bbf4fd494ea1388ae1bc7058092b178b78f98431f1b28d4e316d3c9964d06ea0ce63286d55566f008d0bcefb3bea3574f3246cccedb0 + languageName: node + linkType: hard + "@angular-devkit/schematics@npm:17.1.2": version: 17.1.2 resolution: "@angular-devkit/schematics@npm:17.1.2" @@ -1263,61 +1295,61 @@ __metadata: languageName: node linkType: hard -"@prisma/client@npm:5.11.0": - version: 5.11.0 - resolution: "@prisma/client@npm:5.11.0" +"@prisma/client@npm:5.16.2": + version: 5.16.2 + resolution: "@prisma/client@npm:5.16.2" peerDependencies: prisma: "*" peerDependenciesMeta: prisma: optional: true - checksum: 10c0/4c314e5b9d0ae880cd048cfa224a017d5d044a850efadf189e02937abc09a24de764d62738cea7016c8af31dfa18069d5a0f7c4ac99a0b6e454987d5c3afbbfe + checksum: 10c0/4aefff22a3ad5ac3a7b6298c41949e4962b328a13d9f9e9095b530ce3ad931a1052716450d464850f240e6fa109b6db5719a9cf0f868e75ad44c39ad2409f2df languageName: node linkType: hard -"@prisma/debug@npm:5.12.0": - version: 5.12.0 - resolution: "@prisma/debug@npm:5.12.0" - checksum: 10c0/e63333f60aaad7df338b628d850dfd961b8b984b69d7bc678b01935e15b7f08056560460bbdd261178196e19cec61624be6e1483f6d095c840b7a96ce90bdb73 +"@prisma/debug@npm:5.16.2": + version: 5.16.2 + resolution: "@prisma/debug@npm:5.16.2" + checksum: 10c0/63dac1010cb8304f512b84c903209f4f5b3d8a359284b576101d11e457af9af4eb57e78a1445e101e9e4a6801cdd04e299f12dd0a50eb26fd785387f6c0986b7 languageName: node linkType: hard -"@prisma/engines-version@npm:5.12.0-21.473ed3124229e22d881cb7addf559799debae1ab": - version: 5.12.0-21.473ed3124229e22d881cb7addf559799debae1ab - resolution: "@prisma/engines-version@npm:5.12.0-21.473ed3124229e22d881cb7addf559799debae1ab" - checksum: 10c0/3903d26695f352fee5600e70258c494c8f99b0a2df0d400cdef99b7361e2c63896720c9d77584b198159d045bf5d0ef0eb4bdf902f9ef9002a0da363aec26ff6 +"@prisma/engines-version@npm:5.16.0-24.34ace0eb2704183d2c05b60b52fba5c43c13f303": + version: 5.16.0-24.34ace0eb2704183d2c05b60b52fba5c43c13f303 + resolution: "@prisma/engines-version@npm:5.16.0-24.34ace0eb2704183d2c05b60b52fba5c43c13f303" + checksum: 10c0/de02aed86429fbae0c98dbcb35baa9e1583a37aa222692a832a24153ed173a5559257c31296ecbd8ae5a8a99887f3aaf0797d819ca45e562905ce0bea411fe75 languageName: node linkType: hard -"@prisma/engines@npm:5.12.0": - version: 5.12.0 - resolution: "@prisma/engines@npm:5.12.0" +"@prisma/engines@npm:5.16.2": + version: 5.16.2 + resolution: "@prisma/engines@npm:5.16.2" dependencies: - "@prisma/debug": "npm:5.12.0" - "@prisma/engines-version": "npm:5.12.0-21.473ed3124229e22d881cb7addf559799debae1ab" - "@prisma/fetch-engine": "npm:5.12.0" - "@prisma/get-platform": "npm:5.12.0" - checksum: 10c0/8e5796031fc66b07bffc2c3daaa06f249c54429964f2f93d9c8d0f7f13e1224c6c999c0014c7d4ee4152a10093b998a172f8fe62d7546a622a307a86e615b93d + "@prisma/debug": "npm:5.16.2" + "@prisma/engines-version": "npm:5.16.0-24.34ace0eb2704183d2c05b60b52fba5c43c13f303" + "@prisma/fetch-engine": "npm:5.16.2" + "@prisma/get-platform": "npm:5.16.2" + checksum: 10c0/4e059639779402c9446b2d4795f7cc6b17ef1e9eb85f000a8b591d45fc755fbe66d49b6acec7ed2fd2847b4ffd48fefdc961a9e2439a24de53e59447e03179b5 languageName: node linkType: hard -"@prisma/fetch-engine@npm:5.12.0": - version: 5.12.0 - resolution: "@prisma/fetch-engine@npm:5.12.0" +"@prisma/fetch-engine@npm:5.16.2": + version: 5.16.2 + resolution: "@prisma/fetch-engine@npm:5.16.2" dependencies: - "@prisma/debug": "npm:5.12.0" - "@prisma/engines-version": "npm:5.12.0-21.473ed3124229e22d881cb7addf559799debae1ab" - "@prisma/get-platform": "npm:5.12.0" - checksum: 10c0/57d8cb0c8cad8fca4a67d5598ed65b0948494f537a177eb40a305cb2c979f4080d0331054b9c75b1c4db47e73e3e7db7ed12c8f0597f2dfbfb33df16ecd28207 + "@prisma/debug": "npm:5.16.2" + "@prisma/engines-version": "npm:5.16.0-24.34ace0eb2704183d2c05b60b52fba5c43c13f303" + "@prisma/get-platform": "npm:5.16.2" + checksum: 10c0/00b63683df0278bdcfa4b88756189359dbe03ac5a08f33db29cba839fd9f5c97818608ac9ddc4bc99e407957e7227a5bb6dbb08d64c709835af097a607da78aa languageName: node linkType: hard -"@prisma/get-platform@npm:5.12.0": - version: 5.12.0 - resolution: "@prisma/get-platform@npm:5.12.0" +"@prisma/get-platform@npm:5.16.2": + version: 5.16.2 + resolution: "@prisma/get-platform@npm:5.16.2" dependencies: - "@prisma/debug": "npm:5.12.0" - checksum: 10c0/cb5e6ad867565ac4c1f40833e1aab04e983d9db653f0f77137d88632de3c6ae6f0a0f8b19db5eaf1b0668f9b34c59f25d641d47df67de24a6a3d56c76cdb2057 + "@prisma/debug": "npm:5.16.2" + checksum: 10c0/4a9cb31411944e59f8fd678c38e40de8f52dcb931a63f95bd33b951157c5d61229d5d0c5928fd9450a49edcb0723cabf239e65c6f277488af7cb36d45bb125c4 languageName: node linkType: hard @@ -1457,6 +1489,17 @@ __metadata: languageName: node linkType: hard +"@schematics/angular@npm:~13.3.0": + version: 13.3.11 + resolution: "@schematics/angular@npm:13.3.11" + dependencies: + "@angular-devkit/core": "npm:13.3.11" + "@angular-devkit/schematics": "npm:13.3.11" + jsonc-parser: "npm:3.0.0" + checksum: 10c0/c19de968b3345032985aeafadd23c1c4e3ea52fbe933be1d187c35130b813505fb9ccfe8205303c01b5c2ecde6f54797a3b398cd5531f22be1185ba3bc3b327e + languageName: node + linkType: hard + "@sinclair/typebox@npm:^0.27.8": version: 0.27.8 resolution: "@sinclair/typebox@npm:0.27.8" @@ -1956,6 +1999,18 @@ __metadata: languageName: node linkType: hard +"ajv@npm:8.9.0": + version: 8.9.0 + resolution: "ajv@npm:8.9.0" + dependencies: + fast-deep-equal: "npm:^3.1.1" + json-schema-traverse: "npm:^1.0.0" + require-from-string: "npm:^2.0.2" + uri-js: "npm:^4.2.2" + checksum: 10c0/791cf7c386abcf90fd988f7cfa1d1455a74ed178f9c53ad1621375e6752d88de6a5b447efd93107bc68b2578d4ac4fee29d8fefc1724b6324d8ac3987ca64a3f + languageName: node + linkType: hard + "ajv@npm:^6.12.5": version: 6.12.6 resolution: "ajv@npm:6.12.6" @@ -3424,7 +3479,7 @@ __metadata: languageName: node linkType: hard -"fast-json-stable-stringify@npm:^2.0.0": +"fast-json-stable-stringify@npm:2.1.0, fast-json-stable-stringify@npm:^2.0.0": version: 2.1.0 resolution: "fast-json-stable-stringify@npm:2.1.0" checksum: 10c0/7f081eb0b8a64e0057b3bb03f974b3ef00135fbf36c1c710895cd9300f13c94ba809bb3a81cf4e1b03f6e5285610a61abbd7602d0652de423144dfee5a389c9b @@ -4510,6 +4565,13 @@ __metadata: languageName: node linkType: hard +"jsonc-parser@npm:3.0.0": + version: 3.0.0 + resolution: "jsonc-parser@npm:3.0.0" + checksum: 10c0/373632ab71f773ce6081dd70297c40fbb05aacde07ab8a5852c78c0a13d1fadb7ad886202e87bfc0168dd78568cda2d4eb36e785dac330f93e5e772d7a67f33f + languageName: node + linkType: hard + "jsonc-parser@npm:3.2.0": version: 3.2.0 resolution: "jsonc-parser@npm:3.2.0" @@ -4805,6 +4867,15 @@ __metadata: languageName: node linkType: hard +"magic-string@npm:0.25.7": + version: 0.25.7 + resolution: "magic-string@npm:0.25.7" + dependencies: + sourcemap-codec: "npm:^1.4.4" + checksum: 10c0/d5da35f01d5437d7d6c030fe8185285a78b97144d07944d62187bd985ee2f6dcc8c9a538ded6a3afe186f5d6f2e705b45f9f307b19020aff530447bd32f24375 + languageName: node + linkType: hard + "magic-string@npm:0.30.5": version: 0.30.5 resolution: "magic-string@npm:0.30.5" @@ -5224,7 +5295,7 @@ __metadata: "@nestjs/schedule": "npm:^4.0.2" "@nestjs/schematics": "npm:^10.1.1" "@nestjs/testing": "npm:^10.3.3" - "@prisma/client": "npm:5.11.0" + "@prisma/client": "npm:5.16.2" "@types/node": "npm:^20.11.27" "@vitest/coverage-istanbul": "npm:^1.4.0" "@vitest/ui": "npm:^1.4.0" @@ -5240,8 +5311,9 @@ __metadata: lint-staged: "npm:^15.2.2" moment: "npm:^2.30.1" necord: "npm:^6.8.3" + nestjs-prisma: "npm:^0.23.0" parse-ms: "npm:=2.1.0" - prisma: "npm:^5.11.0" + prisma: "npm:^5.16.2" reflect-metadata: "npm:^0.2.1" rxjs: "npm:^7.8.1" source-map-support: "npm:^0.5.21" @@ -5293,6 +5365,21 @@ __metadata: languageName: node linkType: hard +"nestjs-prisma@npm:^0.23.0": + version: 0.23.0 + resolution: "nestjs-prisma@npm:0.23.0" + dependencies: + "@angular-devkit/core": "npm:^13.3.0" + "@angular-devkit/schematics": "npm:^13.3.0" + "@schematics/angular": "npm:~13.3.0" + peerDependencies: + "@nestjs/common": ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 + "@prisma/client": ^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 + prisma: ^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 + checksum: 10c0/a91286c0abf0767cf8076f1e687139aa67b038e0918f4ac934cca16a45bdf7b27967b0a6eda350587795e89f576c569afc9af1be67608d4ab5b3e8b1762f54b0 + languageName: node + linkType: hard + "node-abort-controller@npm:^3.0.1": version: 3.1.1 resolution: "node-abort-controller@npm:3.1.1" @@ -5686,14 +5773,14 @@ __metadata: languageName: node linkType: hard -"prisma@npm:^5.11.0": - version: 5.12.0 - resolution: "prisma@npm:5.12.0" +"prisma@npm:^5.16.2": + version: 5.16.2 + resolution: "prisma@npm:5.16.2" dependencies: - "@prisma/engines": "npm:5.12.0" + "@prisma/engines": "npm:5.16.2" bin: prisma: build/index.js - checksum: 10c0/94b92f2f4c052f0568a2460f54f15f0f9655c4651066f4a8f49d95d4ac4ac3d250270168ac829a79b2358c841fa8846375b73287655a3126cdcd45b3470f7ba4 + checksum: 10c0/0820150bfe2f9372b34b97be694554fe8ceb51542e467df0afed94575c425556b534bf8080d8526544c5d3ec339c43072360abfe6b14319b65a0480b116aa983 languageName: node linkType: hard @@ -6062,6 +6149,15 @@ __metadata: languageName: node linkType: hard +"rxjs@npm:6.6.7": + version: 6.6.7 + resolution: "rxjs@npm:6.6.7" + dependencies: + tslib: "npm:^1.9.0" + checksum: 10c0/e556a13a9aa89395e5c9d825eabcfa325568d9c9990af720f3f29f04a888a3b854f25845c2b55875d875381abcae2d8100af9cacdc57576e7ed6be030a01d2fe + languageName: node + linkType: hard + "rxjs@npm:7.8.1, rxjs@npm:^7.5.5, rxjs@npm:^7.8.1": version: 7.8.1 resolution: "rxjs@npm:7.8.1" @@ -6324,6 +6420,13 @@ __metadata: languageName: node linkType: hard +"source-map@npm:0.7.3": + version: 0.7.3 + resolution: "source-map@npm:0.7.3" + checksum: 10c0/7d2ddb51f3d2451847692a9ac7808da2b2b3bf7aef92ece33128919040a7e74d9a5edfde7a781f035c974deff876afaf83f2e30484faffffb86484e7408f5d7c + languageName: node + linkType: hard + "source-map@npm:0.7.4, source-map@npm:^0.7.4": version: 0.7.4 resolution: "source-map@npm:0.7.4" @@ -6338,6 +6441,13 @@ __metadata: languageName: node linkType: hard +"sourcemap-codec@npm:^1.4.4": + version: 1.4.8 + resolution: "sourcemap-codec@npm:1.4.8" + checksum: 10c0/f099279fdaae070ff156df7414bbe39aad69cdd615454947ed3e19136bfdfcb4544952685ee73f56e17038f4578091e12b17b283ed8ac013882916594d95b9e6 + languageName: node + linkType: hard + "split2@npm:^4.0.0": version: 4.2.0 resolution: "split2@npm:4.2.0" @@ -6822,6 +6932,13 @@ __metadata: languageName: node linkType: hard +"tslib@npm:^1.9.0": + version: 1.14.1 + resolution: "tslib@npm:1.14.1" + checksum: 10c0/69ae09c49eea644bc5ebe1bca4fa4cc2c82b7b3e02f43b84bd891504edf66dbc6b2ec0eef31a957042de2269139e4acff911e6d186a258fb14069cd7f6febce2 + languageName: node + linkType: hard + "type-detect@npm:^4.0.0, type-detect@npm:^4.0.8": version: 4.0.8 resolution: "type-detect@npm:4.0.8"